Skip to content

Commit

Permalink
- add action to add value to player property
Browse files Browse the repository at this point in the history
- add code to update player's stats based on mounted items
- add formula class (for use in items, players)
- add formulas to items (for sell prices)
- add formulas to player (life, mana, damage, etc)
- add max stats to players
- add Number class
- add onChange to text2 / StringButton
- add variable conversion functions
- normalise level/player names across actions
- prevent duplicate item classes
- prevent loading of level related resources with same id
- refactor getVarOrProp code
- refactor items/player code
- refactor level actions into separate files
- refactor player animation/speed code
- replace magic property to identify magical items with magical (magic now adds to player's magic)
- update player move/walk code
- update gamefiles
- add f1-16 actions to add/remove gold, life, mana (for testing purposes)
- char labels color update
- char label positions
  • Loading branch information
demo committed May 14, 2017
1 parent 4df29d1 commit 1a022c6
Show file tree
Hide file tree
Showing 145 changed files with 8,639 additions and 6,936 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ set(SOURCE_FILES
src/Actions/ActVisibility.h
src/Game/CelLevelObject.cpp
src/Game/CelLevelObject.h
src/Game/Formula.cpp
src/Game/Formula.h
src/Game/fsa.h
src/Game/GameProperties.cpp
src/Game/GameProperties.h
Expand Down Expand Up @@ -154,6 +156,7 @@ set(SOURCE_FILES
src/Game/MapCoord.h
src/Game/Namer.cpp
src/Game/Namer.h
src/Game/Number.h
src/Game/PairXY.h
src/Game/PathFinder.cpp
src/Game/PathFinder.h
Expand Down
3 changes: 3 additions & 0 deletions DGEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<ClCompile Include="src\Game.cpp" />
<ClCompile Include="src\GameUtils.cpp" />
<ClCompile Include="src\Game\CelLevelObject.cpp" />
<ClCompile Include="src\Game\Formula.cpp" />
<ClCompile Include="src\Game\GameProperties.cpp" />
<ClCompile Include="src\Game\ImageLevelObject.cpp" />
<ClCompile Include="src\Game\Item.cpp" />
Expand Down Expand Up @@ -170,6 +171,7 @@
<ClInclude Include="src\FileUtils.h" />
<ClInclude Include="src\GameUtils.h" />
<ClInclude Include="src\Game\CelLevelObject.h" />
<ClInclude Include="src\Game\Formula.h" />
<ClInclude Include="src\Game\fsa.h" />
<ClInclude Include="src\Game\GameProperties.h" />
<ClInclude Include="src\Game\ImageLevelObject.h" />
Expand All @@ -187,6 +189,7 @@
<ClInclude Include="src\Game\LevelObject.h" />
<ClInclude Include="src\Game\MapCoord.h" />
<ClInclude Include="src\Game\Namer.h" />
<ClInclude Include="src\Game\Number.h" />
<ClInclude Include="src\Game\PairXY.h" />
<ClInclude Include="src\Game\PathFinder.h" />
<ClInclude Include="src\Game\Player.h" />
Expand Down
3 changes: 3 additions & 0 deletions android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ LOCAL_SRC_FILES += Actions/ActVariable.h
LOCAL_SRC_FILES += Actions/ActVisibility.h
LOCAL_SRC_FILES += Game/CelLevelObject.cpp
LOCAL_SRC_FILES += Game/CelLevelObject.h
LOCAL_SRC_FILES += Game/Formula.cpp
LOCAL_SRC_FILES += Game/Formula.h
LOCAL_SRC_FILES += Game/fsa.h
LOCAL_SRC_FILES += Game/GameProperties.cpp
LOCAL_SRC_FILES += Game/GameProperties.h
Expand Down Expand Up @@ -154,6 +156,7 @@ LOCAL_SRC_FILES += Game/LevelObject.h
LOCAL_SRC_FILES += Game/MapCoord.h
LOCAL_SRC_FILES += Game/Namer.cpp
LOCAL_SRC_FILES += Game/Namer.h
LOCAL_SRC_FILES += Game/Number.h
LOCAL_SRC_FILES += Game/PairXY.h
LOCAL_SRC_FILES += Game/PathFinder.cpp
LOCAL_SRC_FILES += Game/PathFinder.h
Expand Down
8 changes: 4 additions & 4 deletions gamefiles/level/clearPlayers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"param1": "|currentLevel|currentPlayer.id|",
"param2": "hero",
"then": [
{ "name": "level.clearPlayerClasses", "index": 1 },
{ "name": "level.clearPlayers", "index": 1 }
{ "name": "level.clearPlayers", "index": 1 },
{ "name": "level.clearPlayerClasses", "index": 1 }
],
"else": [
{ "name": "level.clearPlayerClasses" },
{ "name": "level.clearPlayers" }
{ "name": "level.clearPlayers" },
{ "name": "level.clearPlayerClasses" }
]
}
}
3 changes: 2 additions & 1 deletion gamefiles/level/item/amulets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
"type": "Amulet",
"defaults": {
"price": 1200,
"magic": true,
"magical": true,
"durability": "max",
"durabilityMax": "max"
},
"description1": "indestructible",
"description2": "magic1",
"description3": "magic2",
"description4": "noAttributes",
"price1": "price*0.25",
"inventorySize": [1, 1],
"action": "pickItemInLevel",
"actionDropLevel": { "name": "sound.play", "id": "flipring" },
Expand Down
2 changes: 1 addition & 1 deletion gamefiles/level/item/armors.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"durability": 40,
"durabilityMax": 40,
"requiredStrength": 0,
"toVitality": 10,
"vitality": 10,
"damageFromEnemies": -3,
"identified": false,
"unique": true
Expand Down
6 changes: 4 additions & 2 deletions gamefiles/level/item/baseItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
"type": "Armor",
"defaults": {
"identified": true,
"magic": false
"magical": false
},
"description1": "armor",
"description2": "magic1",
"description3": "magic2",
"description4": "required",
"price1": "price*0.25",
"inventorySize": [2, 3],
"action": "pickItemInLevel",
"actionDropLevel": { "name": "sound.play", "id": "fliplarm" },
Expand All @@ -36,12 +37,13 @@
"type": "Weapon",
"defaults": {
"identified": true,
"magic": false
"magical": false
},
"description1": "weapon",
"description2": "magic1",
"description3": "magic2",
"description4": "required",
"price1": "price*0.25",
"inventorySize": [2, 3],
"action": "pickItemInLevel",
"actionDropLevel": { "name": "sound.play", "id": "fliplarm" },
Expand Down
24 changes: 12 additions & 12 deletions gamefiles/level/item/descriptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@
"value": { "min": false, "max": false, "text": "Not Identified" }
},
{
"property": "toStrength",
"value": { "text": "+%toStrength% to Strength" }
"property": "strength",
"value": { "text": "+%strength% to Strength" }
},
{
"property": "toMagic",
"value": { "text": "+%toMagic% to Magic" }
"property": "magic",
"value": { "text": "+%magic% to Magic" }
},
{
"property": "toDexterity",
"value": { "text": "+%toDexterity% to Dexterity" }
"property": "dexterity",
"value": { "text": "+%dexterity% to Dexterity" }
},
{
"property": "toVitality",
"value": { "text": "+%toVitality% to Vitality" }
"property": "vitality",
"value": { "text": "+%vitality% to Vitality" }
}
]
},
{
"id": "magic2",
"names": [
{
"property": "magic",
"property": "magical",
"value": { "min": false, "max": false, "text": "" }
},
{
Expand All @@ -64,7 +64,7 @@
"id": "potion",
"names": [
{
"property": "toLife",
"property": "life",
"value": [
{ "min": "min", "max": -1000, "text": "Kill Player" },
{ "min": -1000, "max": -1, "text": "Steal Life" },
Expand All @@ -73,7 +73,7 @@
]
},
{
"property": "toMana",
"property": "mana",
"value": [
{ "min": "min", "max": -1000, "text": "Remove All Mana" },
{ "min": -1000, "max": -1, "text": "Steal Mana" },
Expand All @@ -82,7 +82,7 @@
]
},
{
"property": "toLifeAndMana",
"property": "lifeAndMana",
"value": [
{ "min": "min", "max": -1000, "text": "Remove All Life And Mana" },
{ "min": -1000, "max": -1, "text": "Steal Life And Mana" },
Expand Down
1 change: 1 addition & 0 deletions gamefiles/level/item/potions.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"description1": "potion",
"description2": "rightClickToUse",
"price1": "price*0.25",
"inventorySize": [1, 1],
"action": "pickItemInLevel",
"actionDropLevel": { "name": "sound.play", "id": "flippot" },
Expand Down
6 changes: 3 additions & 3 deletions gamefiles/level/item/prefixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
]
},
{
"property": "toArmor",
"property": "armor",
"value": [
{ "min": "min", "max": -51, "text": "Vulnerable" },
{ "min": -50, "max": -25, "text": "Rusted" },
Expand Down Expand Up @@ -154,7 +154,7 @@
]
},
{
"property": "toMana",
"property": "mana",
"value": [
{ "min": "min", "max": -11, "text": "Hyena's" },
{ "min": -10, "max": -1, "text": "Frog's" },
Expand Down Expand Up @@ -246,7 +246,7 @@
]
},
{
"property": "toMana",
"property": "mana",
"value": [
{ "min": "min", "max": -11, "text": "Hyena's" },
{ "min": -10, "max": -1, "text": "Frog's" },
Expand Down
1 change: 1 addition & 0 deletions gamefiles/level/item/scrolls.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"description1": "rightClickToRead2",
"description2": "required",
"price1": "price*0.25",
"inventorySize": [1, 1],
"action": "pickItemInLevel",
"actionDropLevel": { "name": "sound.play", "id": "flipscrl" },
Expand Down
16 changes: 8 additions & 8 deletions gamefiles/level/item/suffixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
]
},
{
"property": "toStrength",
"property": "strength",
"value": [
{ "min": "min", "max": -6, "text": "Of Frailty" },
{ "min": -5, "max": -1, "text": "Of Weakness" },
Expand All @@ -66,7 +66,7 @@
]
},
{
"property": "toMagic",
"property": "magic",
"value": [
{ "min": "min", "max": -6, "text": "Of The Fool" },
{ "min": -5, "max": -1, "text": "Of Dyslexia" },
Expand All @@ -78,7 +78,7 @@
]
},
{
"property": "toDexterity",
"property": "dexterity",
"value": [
{ "min": "min", "max": -6, "text": "Of Paralysis" },
{ "min": -5, "max": -1, "text": "Of Atrophy" },
Expand All @@ -90,7 +90,7 @@
]
},
{
"property": "toVitality",
"property": "vitality",
"value": [
{ "min": "min", "max": -6, "text": "Of Illness" },
{ "min": -5, "max": -1, "text": "Of Disease" },
Expand Down Expand Up @@ -159,7 +159,7 @@
]
},
{
"property": "toStrength",
"property": "strength",
"value": [
{ "min": "min", "max": -6, "text": "Of Frailty" },
{ "min": -5, "max": -1, "text": "Of Weakness" },
Expand All @@ -171,7 +171,7 @@
]
},
{
"property": "toMagic",
"property": "magic",
"value": [
{ "min": "min", "max": -6, "text": "Of The Fool" },
{ "min": -5, "max": -1, "text": "Of Dyslexia" },
Expand All @@ -183,7 +183,7 @@
]
},
{
"property": "toDexterity",
"property": "dexterity",
"value": [
{ "min": "min", "max": -6, "text": "Of Paralysis" },
{ "min": -5, "max": -1, "text": "Of Atrophy" },
Expand All @@ -195,7 +195,7 @@
]
},
{
"property": "toVitality",
"property": "vitality",
"value": [
{ "min": "min", "max": -6, "text": "Of Illness" },
{ "min": -5, "max": -1, "text": "Of Disease" },
Expand Down
6 changes: 6 additions & 0 deletions gamefiles/level/load.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"param2": "positionPlayer",
"then": { "name": "load", "file": ["level/positionPlayer.json", "{4}"] }
},
{ "name": "if.notEqual",
"param1": "{2}",
"param2": "town",
"then": { "name": "player.setRestStatus", "status": 1 },
"else": { "name": "player.setRestStatus", "status": 0 }
},
{ "name": "load", "file": "ui/level/char/updateVisiblePanels.json" },
{ "name": "load", "file": "level/playOrStopMusic.json" },
{ "name": "load", "file": ["level/setMapAction.json", "{2}"] }
Expand Down
5 changes: 1 addition & 4 deletions gamefiles/level/player/RogueDefaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
"direction": "Front",
"mapPosition": [64, 73],
"enableHover": false,
"level": 1,
"experience": 0,
"expNextLevel": 2000,
"points": 0,
"inventory": [
{
"index": "Body",
"bodyInventory": true,
"allowedClassTypes": ["Amulet", "Armor", "Axe", "Bow", "Club", "Helmet", "Ring", "Shield", "Staff", "Sword"],
"item": [
{
Expand Down
5 changes: 1 addition & 4 deletions gamefiles/level/player/SorcerorDefaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
"direction": "Front",
"mapPosition": [64, 73],
"enableHover": false,
"level": 1,
"experience": 0,
"expNextLevel": 2000,
"points": 0,
"inventory": [
{
"index": "Body",
"bodyInventory": true,
"allowedClassTypes": ["Amulet", "Armor", "Axe", "Bow", "Club", "Helmet", "Ring", "Shield", "Staff", "Sword"],
"item": [
{
Expand Down
5 changes: 1 addition & 4 deletions gamefiles/level/player/WarriorDefaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@
"direction": "Front",
"mapPosition": [64, 73],
"enableHover": false,
"level": 1,
"experience": 0,
"expNextLevel": 2000,
"points": 0,
"inventory": [
{
"index": "Body",
"bodyInventory": true,
"allowedClassTypes": ["Amulet", "Armor", "Axe", "Bow", "Club", "Helmet", "Ring", "Shield", "Staff", "Sword"],
"item": [
{
Expand Down
Loading

0 comments on commit 1a022c6

Please sign in to comment.