Add tests for reading player data from a saved game
- Changed cPlayer::equip to a bitset - Use a static constant instead of a loop to initialized player starting spells - Only save spell points if the player has any (current if different from max) - Symbolic forms for trait enum (and save symbolic forms also for skills) - When loading a player, clear data which is not always present in the file - Also add an init test for cPlayer
This commit is contained in:
15
test/files/player/basic.txt
Normal file
15
test/files/player/basic.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
UID 3
|
||||
STATUS -1 alive
|
||||
NAME "Freddy O'Hara"
|
||||
SKILL hp 20
|
||||
HEALTH 18
|
||||
EXPERIENCE 12
|
||||
SKILLPTS 3
|
||||
LEVEL 2
|
||||
STATUS web 3
|
||||
TRAIT ambidex
|
||||
TRAIT nimble
|
||||
TRAIT bad-back
|
||||
ICON 3
|
||||
RACE human
|
||||
DIRECTION e
|
9
test/files/player/skills.txt
Normal file
9
test/files/player/skills.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
SKILL str 5
|
||||
SKILL dex 6
|
||||
SKILL int 3
|
||||
SKILL hp 20
|
||||
SKILL edged 3
|
||||
SKILL traps 2
|
||||
SKILL item-lore 1
|
||||
SKILL lockpick 2
|
||||
SKILL luck 1
|
6
test/files/player/spells.txt
Normal file
6
test/files/player/spells.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
MAGE 3
|
||||
MAGE 7
|
||||
MAGE 20
|
||||
PRIEST 2
|
||||
PRIEST 8
|
||||
PRIEST 60
|
Reference in New Issue
Block a user