Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / buff / condition / Cond_AmmoFull.cs
@小李xl 小李xl on 22 Mar 2024 670 bytes 道具逻辑片段更新参数描述
  1.  
  2. using System.Text.Json;
  3.  
  4. [ConditionFragment(
  5. "AmmoFull",
  6. "判断当前武器弹药状态, ",
  7. Arg1 = "(boolean)是否判断满弹药"
  8. )]
  9. public class Cond_AmmoFull : ConditionFragment
  10. {
  11. private bool _type;
  12. public override void InitParam(JsonElement[] arg)
  13. {
  14. _type = arg[0].GetBoolean();
  15. }
  16.  
  17. public override bool OnCheckUse()
  18. {
  19. if (Role.WeaponPack.ActiveItem == null)
  20. {
  21. return false;
  22. }
  23. if (_type)
  24. {
  25. return !Role.WeaponPack.ActiveItem.IsAmmoFull();
  26. }
  27. else
  28. {
  29. return Role.WeaponPack.ActiveItem.IsAmmoFull();
  30. }
  31. }
  32. }