選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

player_infos.gd 891 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. extends Object
  2. class_name PlayerInfos
  3. # curHp
  4. var curHp : int = 10 setget curHp_set, curHp_get
  5. signal curHp_update
  6. func curHp_set(value):
  7. curHp = value
  8. emit_signal("curHp_update", value)
  9. func curHp_get():
  10. return curHp
  11. # maxHp
  12. var maxHp : int = 10 setget maxHp_set, maxHp_get
  13. signal maxHp_update
  14. func maxHp_set(value):
  15. maxHp = value
  16. emit_signal("maxHp_update", value)
  17. func maxHp_get():
  18. return maxHp
  19. # damage
  20. var damage : int = 1 setget damage_set, damage_get
  21. signal damage_update
  22. func damage_set(value):
  23. damage = value
  24. emit_signal("damage_update", value)
  25. func damage_get():
  26. return damage
  27. # gold
  28. var gold : int = 0 setget gold_set, gold_get
  29. signal gold_update
  30. func gold_set(value):
  31. gold = value
  32. emit_signal("gold_update", value)
  33. func gold_get():
  34. return gold
  35. func reset():
  36. curHp = maxHp
  37. emit_signal("curHp_update", curHp)
  38. gold = 0
  39. emit_signal("gold_update", gold)