Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / activity / prop / active / ActiveProp5000.cs
@lijincheng lijincheng on 8 Jul 2023 452 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. AutoDestroy = true;
  13. MaxCount = 10;
  14. Superposition = true;
  15. }
  16.  
  17. public override bool OnCheckUse()
  18. {
  19. return !Master.IsHpFull();
  20. }
  21.  
  22. protected override int OnUse()
  23. {
  24. Master.Hp += 2;
  25. return 1;
  26. }
  27. }