Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / activity / prop / active / ActiveProp5000.cs
@小李xl 小李xl on 1 Feb 2024 475 bytes 宝箱互动, 新的子弹击中逻辑
  1.  
  2. using Godot;
  3.  
  4. /// <summary>
  5. /// 医药箱, 使用后恢复一颗红心
  6. /// </summary>
  7. [Tool]
  8. public partial class ActiveProp5000 : ActiveProp
  9. {
  10. public override void OnInit()
  11. {
  12. base.OnInit();
  13. AutoDestroy = true;
  14. MaxCount = 10;
  15. Superposition = true;
  16. }
  17.  
  18. public override bool OnCheckUse()
  19. {
  20. return !Master.IsHpFull();
  21. }
  22.  
  23. protected override int OnUse()
  24. {
  25. Master.Hp += 2;
  26. return 1;
  27. }
  28. }