Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / activity / prop / buff / Buff0005.cs
@小李xl 小李xl on 29 Jun 2023 535 bytes 制作被动道具
  1.  
  2. using Godot;
  3.  
  4. /// <summary>
  5. /// 提升伤害buff, 子弹伤害提升20%
  6. /// </summary>
  7. [GlobalClass, Tool]
  8. public partial class Buff0005 : Buff
  9. {
  10. protected override void OnPickUp(Role master)
  11. {
  12. master.RoleState.CalcDamageEvent += CalcDamage;
  13. }
  14.  
  15. protected override void OnRemove(Role master)
  16. {
  17. master.RoleState.CalcDamageEvent -= CalcDamage;
  18. }
  19.  
  20. private void CalcDamage(int originDamage, RefValue<int> refValue)
  21. {
  22. refValue.Value += Mathf.CeilToInt(originDamage * 0.2f);
  23. }
  24. }