public void StartBuff(RoleData roleData, ActorBuff actorBuff) { this.roleData = roleData; this.actorBuff = actorBuff; if (buffType.Equals(BuffType.AddHp)) { roleData.hp += amount; EffectPerform.Instance.ShowDamageUI(amount, this.actorBuff.transform); } else if (buffType.Equals(BuffType.AddSpeed)) { roleData.speed += amount; } else if (buffType.Equals(BuffType.AddAtkPower)) { roleData.atkPower += amount; } else if (buffType.Equals(BuffType.AddDefPower)) { roleData.defPower += amount; } if (buffType.Equals(BuffType.SubHp)) { roleData.hp -= amount; EffectPerform.Instance.ShowDamageUI(amount, this.actorBuff.transform); if (roleData.hp <= 0) { roleData.ctrl.Die(); } } else if (buffType.Equals(BuffType.SubSpeed)) { roleData.speed -= amount; if (roleData.speed <= 0) { roleData.speed = 0; } } else if (buffType.Equals(BuffType.SubAtkPower)) { roleData.atkPower -= amount; } else if (buffType.Equals(BuffType.SubDefPower)) { roleData.defPower -= amount; } if (this.buffSettleType.Equals(BuffSettleType.Permernant)) { actorBuff.RemoveBuff(this); } }
public void FinishBuff() { if (buffType.Equals(BuffType.AddHp)) { roleData.hp -= amount; } else if (buffType.Equals(BuffType.AddSpeed)) { roleData.speed -= amount; } else if (buffType.Equals(BuffType.AddAtkPower)) { roleData.atkPower -= amount; } else if (buffType.Equals(BuffType.AddDefPower)) { roleData.defPower -= amount; } if (buffType.Equals(BuffType.SubHp)) { roleData.hp += amount; } else if (buffType.Equals(BuffType.SubSpeed)) { roleData.speed += amount; } else if (buffType.Equals(BuffType.SubAtkPower)) { roleData.atkPower += amount; } else if (buffType.Equals(BuffType.SubDefPower)) { roleData.defPower += amount; } actorBuff.RemoveBuff(this); }