File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 ' body_human'
66 },
77 stats = {
8+ ap = 40 ,
89 hp = 8
910 }
1011 },
@@ -14,6 +15,7 @@ return {
1415 ' body_human'
1516 },
1617 stats = {
18+ ap = 30 ,
1719 hp = 5
1820 }
1921 },
@@ -23,6 +25,7 @@ return {
2325 ' body_dog'
2426 },
2527 stats = {
28+ ap = 20 ,
2629 hp = 4
2730 }
2831 }
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ local Character = MapObject:subclass( 'Character' )
2323-- Constants
2424-- ------------------------------------------------
2525
26- local DEFAULT_ACTION_POINTS = 40
27-
2826local STANCES = require ( ' src.constants.STANCES' )
2927local ITEM_TYPES = require ( ' src.constants.ITEM_TYPES' )
3028
@@ -116,12 +114,14 @@ end
116114-- Public Methods
117115-- ------------------------------------------------
118116
119- function Character :initialize ( classID )
117+ function Character :initialize ( classID , actionPoints )
120118 MapObject .initialize ( self )
121119
122120 self .creatureClass = classID
123121
124- self .actionPoints = DEFAULT_ACTION_POINTS
122+ self .maxActionPoints = actionPoints
123+ self .actionPoints = actionPoints
124+
125125 self .actions = Queue ()
126126
127127 self .fov = {}
240240-- Resets the character's action points to the default value.
241241--
242242function Character :resetActionPoints ()
243- self .actionPoints = DEFAULT_ACTION_POINTS
243+ self .actionPoints = self . maxActionPoints
244244end
245245
246246---
451451-- @treturn number The total amount of action points.
452452--
453453function Character :getMaxActionPoints ()
454- return DEFAULT_ACTION_POINTS
454+ return self . maxActionPoints
455455end
456456
457457---
Original file line number Diff line number Diff line change 197197function CharacterFactory .newCharacter ( factionType )
198198 local classID = pickCreatureClass ( factionType )
199199 local class = findClass ( classID )
200- local character = Character ( classID )
200+ local character = Character ( classID , class . stats . ap )
201201
202202 local bodyType = Util .pickRandomValue ( class .body )
203203 if bodyType == ' body_human' then
You can’t perform that action at this time.
0 commit comments