|
|
@@ -8,36 +8,49 @@ public class SoldierBuff : MonoBehaviour
|
|
|
private AttackController ac;
|
|
|
private AttributeStatus ats;
|
|
|
|
|
|
- private void OnEnable()
|
|
|
+ private int initTotalHp;
|
|
|
+ private int initHp;
|
|
|
+ private List<AttackInfo> initAttackInfo;
|
|
|
+ private int initArmor;
|
|
|
+
|
|
|
+ private void Awake()
|
|
|
{
|
|
|
dem = GetComponent<Demonic>();
|
|
|
ac = dem.attackController;
|
|
|
ats = dem.attributeStatus;
|
|
|
+
|
|
|
+ initTotalHp = dem.totalHp;
|
|
|
+ initHp = dem.hp;
|
|
|
+ for (int i = 0; i < ac.attackMethod.Length; i++)
|
|
|
+ {
|
|
|
+ initAttackInfo.Add(ac.attackMethod[i].attackInfo);
|
|
|
+ }
|
|
|
+ initArmor = ats.resistances.armor;
|
|
|
}
|
|
|
|
|
|
public void AddHP(int hp)
|
|
|
{
|
|
|
- dem.totalHp += hp;
|
|
|
- dem.hp += hp;
|
|
|
+ dem.totalHp = initTotalHp + hp;
|
|
|
+ dem.hp += initHp + hp;
|
|
|
dem.uiHp.Show(dem.hp, dem.totalHp);
|
|
|
}
|
|
|
|
|
|
public void AddSummonAttack(int attack)
|
|
|
{
|
|
|
- ac.attackMethod[0].attackInfo.damage += attack;
|
|
|
+ ac.attackMethod[0].attackInfo.damage = initAttackInfo[0].damage + attack;
|
|
|
}
|
|
|
|
|
|
public void AddMarchAttack(int attack)
|
|
|
{
|
|
|
for(int i = 1; i < ac.attackMethod.Length; i++)
|
|
|
{
|
|
|
- ac.attackMethod[i].attackInfo.damage += attack;
|
|
|
+ ac.attackMethod[i].attackInfo.damage = initAttackInfo[i].damage + attack;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void AddArmor(int armor)
|
|
|
{
|
|
|
- ats.resistances.armor += armor;
|
|
|
+ ats.resistances.armor = initArmor + armor;
|
|
|
}
|
|
|
|
|
|
public void AddShootDownDamage(int damage)
|
|
|
@@ -51,7 +64,7 @@ public class SoldierBuff : MonoBehaviour
|
|
|
if (ae == AttackEffect.ShotDown)
|
|
|
{
|
|
|
AttackInfo.ShotDown sd = ai.shotDown;
|
|
|
- sd.landingDamage += damage;
|
|
|
+ sd.landingDamage = initAttackInfo[i].shotDown.landingDamage + damage;
|
|
|
ai.shotDown = sd;
|
|
|
break;
|
|
|
}
|
|
|
@@ -60,7 +73,7 @@ public class SoldierBuff : MonoBehaviour
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void AddShootDownDamageRate(float rate)
|
|
|
+ public void AddBlowUpDamageRate(float rate)
|
|
|
{
|
|
|
for (int i = 0; i < ac.attackMethod.Length; i++)
|
|
|
{
|
|
|
@@ -71,7 +84,7 @@ public class SoldierBuff : MonoBehaviour
|
|
|
if (ae == AttackEffect.BlowUp)
|
|
|
{
|
|
|
AttackInfo.BlowUp blowUp = ai.blowUp;
|
|
|
- blowUp.landingDamageRate += rate;
|
|
|
+ blowUp.landingDamageRate = initAttackInfo[i].blowUp.landingDamageRate + rate;
|
|
|
ai.blowUp = blowUp;
|
|
|
break;
|
|
|
}
|