Skip to content

Commit c20ac03

Browse files
committed
Add some docstrings to Battler.gd
1 parent e5e0019 commit c20ac03

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

godot/combat/battlers/Battler.gd

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
Base entity that represents a character or a monster in combat
3+
Every battler has an AI node so all characters can work as a monster
4+
or as a computer-controlled player ally
5+
"""
16
extends Position2D
27

38
class_name Battler
@@ -33,13 +38,13 @@ func initialize():
3338
actions.initialize(skills.get_children())
3439
stats.connect("health_depleted", self, "_on_health_depleted")
3540

36-
func is_able_to_play():
37-
"""Return true if the battler is able to play, false instead.
38-
39-
Currently only the battler's health is checked, but in the future we may
40-
want to also check the battler status (frozen, petrified, etc.).
41+
func is_able_to_play() -> bool:
42+
"""
43+
Returns true if the battler can perform an action
44+
Currently it only checks that the battler is alive,
45+
but we should use this method later to check its current status as well
4146
"""
42-
return true if stats.health > 0 else false
47+
return stats.health > 0
4348

4449
func set_selected(value):
4550
selected = value

0 commit comments

Comments
 (0)