@@ -18,19 +18,33 @@ class Actor(Model):
1818 display_name : str = ""
1919 is_member : bool = True # Still member in the server
2020
21+ # AI
2122 ai_interacted_at : Optional [datetime ] = None # Last time actor interacted with AI
2223 ai_chat_history : list [dict [str , Any ]] = []
2324
24- xp : NonNegativeInt = 0
25- level : NonNegativeInt = 0
26- rank : NonNegativeInt = 0
25+ # Combat stats
26+ base_health : NonNegativeInt = 1
27+ max_health : NonNegativeInt = 1
28+ base_energy : NonNegativeInt = 1
29+ max_energy : NonNegativeInt = 1
30+ base_attack : NonNegativeInt = 1
31+ base_defense : NonNegativeInt = 1
32+ base_speed : NonNegativeInt = 1
33+
34+ # Gold, Items, & Equipment
2735 gold : NonNegativeInt = 0
2836 items : list [str ] = []
37+ equipment : list [str ] = [] # Equipped items
38+ MAX_ITEMS : ClassVar [int ] = 20
39+ MAX_EQUIPMENT : ClassVar [int ] = 3
2940
41+ # Progress
42+ xp : NonNegativeInt = 0
43+ level : NonNegativeInt = 0
44+ rank : NonNegativeInt = 0
3045 LEVEL_BASE_XP : ClassVar [int ] = 100
3146 LEVEL_EXPONENT : ClassVar [float ] = 2.5
3247 MAX_LEVEL : ClassVar [int ] = 99
33-
3448 RANK_BASE_LEVEL : ClassVar [int ] = 30
3549 RANK_EXPONENT : ClassVar [float ] = 1
3650 RANK_NAMES : ClassVar [list [str ]] = [
@@ -50,6 +64,26 @@ class Actor(Model):
5064
5165 # ----------------------------------------------------------------------------------------------------
5266
67+ @property
68+ def health (self ):
69+ return self .base_health + 0
70+
71+ @property
72+ def energy (self ):
73+ return self .base_energy + 0
74+
75+ @property
76+ def attack (self ):
77+ return self .base_attack + 0
78+
79+ @property
80+ def defense (self ):
81+ return self .base_defense + 0
82+
83+ @property
84+ def speed (self ):
85+ return self .base_speed + 0
86+
5387 @property
5488 def rank_name (self ) -> str :
5589 """Get name of current rank."""
@@ -94,13 +128,21 @@ def try_rank_up(self) -> bool:
94128
95129 # ----------------------------------------------------------------------------------------------------
96130
131+ @property
132+ def health_bar (self ) -> str :
133+ return text_progress_bar (self .health , self .max_health , 6 , "▰" , "▱" )
134+
135+ @property
136+ def energy_bar (self ) -> str :
137+ return text_progress_bar (self .energy , self .max_energy , 6 , "▰" , "▱" )
138+
97139 @property
98140 def rank_bar (self ) -> str :
99141 return text_progress_bar (self .rank , self .MAX_RANKS , 5 , "⭐" , "☆" )
100142
101143 @property
102144 def level_bar (self ) -> str :
103- return text_progress_bar (self .level , self .next_rank_level , 5 , "▰ " , "▱ " )
145+ return text_progress_bar (self .level , self .next_rank_level , 5 , "⬥ " , "⬦ " )
104146
105147 @property
106148 def xp_bar (self ) -> str :
0 commit comments