File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 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+ """
16extends Position2D
27
38class_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
4449func set_selected (value ):
4550 selected = value
You can’t perform that action at this time.
0 commit comments