| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SoldierBuff : MonoBehaviour
- {
- private Demonic dem;
- private AttackController ac;
- private AttributeStatus ats;
- private void OnEnable()
- {
- dem = GetComponent<Demonic>();
- ac = dem.attackController;
- ats = dem.attributeStatus;
- }
- public void AddHP(int hp)
- {
- dem.totalHp += hp;
- dem.hp += hp;
- dem.uiHp.Show(dem.hp, dem.totalHp);
- }
- public void AddSummonAttack(int attack)
- {
- ac.attackMethod[0].attackInfo.damage += attack;
- }
- public void AddMarchAttack(int attack)
- {
- for(int i = 1; i < ac.attackMethod.Length; i++)
- {
- ac.attackMethod[i].attackInfo.damage += attack;
- }
- }
- public void AddArmor(int armor)
- {
- ats.resistances.armor += armor;
- }
- public void AddShootDownDamage(int damage)
- {
- for(int i = 0; i < ac.attackMethod.Length; i++)
- {
- AttackInfo ai = ac.attackMethod[i].attackInfo;
- AttackEffect[] aes = ai.attackEffect;
- foreach(AttackEffect ae in aes)
- {
- if (ae == AttackEffect.ShotDown)
- {
- AttackInfo.ShotDown sd = ai.shotDown;
- sd.landingDamage += damage;
- ai.shotDown = sd;
- break;
- }
- }
- ac.attackMethod[i].attackInfo = ai;
- }
- }
- }
|