Skip to content

Commit

Permalink
- add support for loading resources using id from filename if id not …
Browse files Browse the repository at this point in the history
…present

- load resources from existing id (name aliases)
- fix audio.play action setting loop to false
- add alphanum check to ids
- update color parsing code
- add name to level
- refactor parse utils code
- refactor fadeIn/Out
- add action to pause level
- refactor of level code (WIP)
- update gamefiles:
- add all quests
- add all gossip texts
- change texts location
- disable keys when showing text/game menu
- add label with map name to levels (except town)
- update colors (blue/gold) to be closer to original
- show different inventory image depending on player class
- change save game to not save cel loading (only player)
- change code to check if using beta MPQ file and adjust accordingly
  • Loading branch information
demo committed Nov 2, 2016
1 parent b98b54f commit 17cbbda
Show file tree
Hide file tree
Showing 597 changed files with 6,146 additions and 1,586 deletions.
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ set(SOURCE_FILES
src/Event.cpp
src/Event.h
src/EventManager.h
src/FadeInOut.cpp
src/FadeInOut.h
src/FileUtils.cpp
src/FileUtils.h
src/Font2.h
Expand Down Expand Up @@ -133,6 +135,7 @@ set(SOURCE_FILES
src/Game/LevelMap.cpp
src/Game/LevelMap.h
src/Game/LevelObject.h
src/Game/MapCoord.h
src/Game/PathFinder.cpp
src/Game/PathFinder.h
src/Game/Player.cpp
Expand Down Expand Up @@ -209,8 +212,6 @@ set(SOURCE_FILES
src/Parser/ParseText.h
src/Parser/ParseTexture.cpp
src/Parser/ParseTexture.h
src/Parser/ParseUtils.cpp
src/Parser/ParseUtils.h
src/Parser/ParseVariable.cpp
src/Parser/ParseVariable.h
src/Parser/Game/ParseLevel.cpp
Expand All @@ -223,6 +224,16 @@ set(SOURCE_FILES
src/Parser/Game/ParsePlayerClass.h
src/Parser/Game/ParseQuest.cpp
src/Parser/Game/ParseQuest.h
src/Parser/Utils/ParseUtils.cpp
src/Parser/Utils/ParseUtils.h
src/Parser/Utils/ParseUtilsIdx.cpp
src/Parser/Utils/ParseUtilsIdx.h
src/Parser/Utils/ParseUtilsKey.cpp
src/Parser/Utils/ParseUtilsKey.h
src/Parser/Utils/ParseUtilsVal.cpp
src/Parser/Utils/ParseUtilsVal.h
src/Parser/Utils/ParseUtilsVar.cpp
src/Parser/Utils/ParseUtilsVar.h
src/rapidjson/allocators.h
src/rapidjson/document.h
src/rapidjson/encodedstream.h
Expand Down
15 changes: 13 additions & 2 deletions DGEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<ClCompile Include="src\Circle.cpp" />
<ClCompile Include="src\Dun.cpp" />
<ClCompile Include="src\Event.cpp" />
<ClCompile Include="src\FadeInOut.cpp" />
<ClCompile Include="src\FileUtils.cpp" />
<ClCompile Include="src\Game.cpp" />
<ClCompile Include="src\GameUtils.cpp" />
Expand Down Expand Up @@ -86,8 +87,12 @@
<ClCompile Include="src\Parser\ParseSound.cpp" />
<ClCompile Include="src\Parser\ParseText.cpp" />
<ClCompile Include="src\Parser\ParseTexture.cpp" />
<ClCompile Include="src\Parser\ParseUtils.cpp" />
<ClCompile Include="src\Parser\ParseVariable.cpp" />
<ClCompile Include="src\Parser\Utils\ParseUtils.cpp" />
<ClCompile Include="src\Parser\Utils\ParseUtilsIdx.cpp" />
<ClCompile Include="src\Parser\Utils\ParseUtilsKey.cpp" />
<ClCompile Include="src\Parser\Utils\ParseUtilsVal.cpp" />
<ClCompile Include="src\Parser\Utils\ParseUtilsVar.cpp" />
<ClCompile Include="src\Pcx.cpp" />
<ClCompile Include="src\PhysFSStream.cpp" />
<ClCompile Include="src\Rectangle.cpp" />
Expand Down Expand Up @@ -138,6 +143,7 @@
<ClInclude Include="src\CelCache.h" />
<ClInclude Include="src\CelUtils.h" />
<ClInclude Include="src\Circle.h" />
<ClInclude Include="src\FadeInOut.h" />
<ClInclude Include="src\FileUtils.h" />
<ClInclude Include="src\GameUtils.h" />
<ClInclude Include="src\Game\CelLevelObject.h" />
Expand All @@ -149,6 +155,7 @@
<ClInclude Include="src\Game\LevelHelper.h" />
<ClInclude Include="src\Game\LevelMap.h" />
<ClInclude Include="src\Game\LevelObject.h" />
<ClInclude Include="src\Game\MapCoord.h" />
<ClInclude Include="src\Game\PathFinder.h" />
<ClInclude Include="src\Game\Player.h" />
<ClInclude Include="src\Game\PlayerClass.h" />
Expand Down Expand Up @@ -197,8 +204,12 @@
<ClInclude Include="src\Parser\ParseSound.h" />
<ClInclude Include="src\Parser\ParseText.h" />
<ClInclude Include="src\Parser\ParseTexture.h" />
<ClInclude Include="src\Parser\ParseUtils.h" />
<ClInclude Include="src\Parser\ParseVariable.h" />
<ClInclude Include="src\Parser\Utils\ParseUtils.h" />
<ClInclude Include="src\Parser\Utils\ParseUtilsIdx.h" />
<ClInclude Include="src\Parser\Utils\ParseUtilsKey.h" />
<ClInclude Include="src\Parser\Utils\ParseUtilsVal.h" />
<ClInclude Include="src\Parser\Utils\ParseUtilsVar.h" />
<ClInclude Include="src\Rectangle.h" />
<ClInclude Include="src\ReverseIterable.h" />
<ClInclude Include="src\SFMLUtils.h" />
Expand Down
2 changes: 1 addition & 1 deletion License Notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SFML uses the zlib/png license.
https://github.com/SFML/SFML

Other SFML code snippets were taken from the wiki
and should hava a permissive license.
and should have a permissive license.

Mapbox Variant uses the BSD license.

Expand Down
15 changes: 13 additions & 2 deletions android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ LOCAL_SRC_FILES += Dun.h
LOCAL_SRC_FILES += Event.cpp
LOCAL_SRC_FILES += Event.h
LOCAL_SRC_FILES += EventManager.h
LOCAL_SRC_FILES += FadeInOut.cpp
LOCAL_SRC_FILES += FadeInOut.h
LOCAL_SRC_FILES += FileUtils.cpp
LOCAL_SRC_FILES += FileUtils.h
LOCAL_SRC_FILES += Font2.h
Expand Down Expand Up @@ -133,6 +135,7 @@ LOCAL_SRC_FILES += Game/LevelHelper.h
LOCAL_SRC_FILES += Game/LevelMap.cpp
LOCAL_SRC_FILES += Game/LevelMap.h
LOCAL_SRC_FILES += Game/LevelObject.h
LOCAL_SRC_FILES += Game/MapCoord.h
LOCAL_SRC_FILES += Game/PathFinder.cpp
LOCAL_SRC_FILES += Game/PathFinder.h
LOCAL_SRC_FILES += Game/Player.cpp
Expand Down Expand Up @@ -209,8 +212,6 @@ LOCAL_SRC_FILES += Parser/ParseText.cpp
LOCAL_SRC_FILES += Parser/ParseText.h
LOCAL_SRC_FILES += Parser/ParseTexture.cpp
LOCAL_SRC_FILES += Parser/ParseTexture.h
LOCAL_SRC_FILES += Parser/ParseUtils.cpp
LOCAL_SRC_FILES += Parser/ParseUtils.h
LOCAL_SRC_FILES += Parser/ParseVariable.cpp
LOCAL_SRC_FILES += Parser/ParseVariable.h
LOCAL_SRC_FILES += Parser/Game/ParseLevel.cpp
Expand All @@ -223,6 +224,16 @@ LOCAL_SRC_FILES += Parser/Game/ParsePlayerClass.cpp
LOCAL_SRC_FILES += Parser/Game/ParsePlayerClass.h
LOCAL_SRC_FILES += Parser/Game/ParseQuest.cpp
LOCAL_SRC_FILES += Parser/Game/ParseQuest.h
LOCAL_SRC_FILES += Parser/Utils/ParseUtils.cpp
LOCAL_SRC_FILES += Parser/Utils/ParseUtils.h
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsIdx.cpp
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsIdx.h
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsKey.cpp
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsKey.h
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsVal.cpp
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsVal.h
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsVar.cpp
LOCAL_SRC_FILES += Parser/Utils/ParseUtilsVar.h
LOCAL_SRC_FILES += rapidjson/allocators.h
LOCAL_SRC_FILES += rapidjson/document.h
LOCAL_SRC_FILES += rapidjson/encodedstream.h
Expand Down
13 changes: 6 additions & 7 deletions gamefiles/level/l1/level.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
"minBlocks": 10,
"sol": "levels/l1data/l1.sol"
},
"levelObject": {
"id": "town",
"name": "Up to town",
"mapPosition": [66, 26],
"texture": "empty",
"textureRect": [32, 32],
"action": { "name": "load", "file": ["level/town/load.json", "positionPlayer", "[25, 31]"] }
"action": {
"name": "if.equal",
"param1": "%beta%",
"param2": true,
"then": { "name": "load", "file": "level/l1/levelObjectsBeta.json" },
"else": { "name": "load", "file": "level/l1/levelObjects.json" }
}
}
10 changes: 10 additions & 0 deletions gamefiles/level/l1/levelObjects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"levelObject": {
"id": "town",
"name": "Up to town",
"mapPosition": [66, 26],
"texture": "empty",
"textureRect": [32, 32],
"action": { "name": "load", "file": ["level/town/load.json", "positionPlayer", "[25, 31]"] }
}
}
10 changes: 10 additions & 0 deletions gamefiles/level/l1/levelObjectsBeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"levelObject": {
"id": "town",
"name": "Up to town",
"mapPosition": [66, 27],
"texture": "empty",
"textureRect": [32, 32],
"action": { "name": "load", "file": ["level/town/load.json", "positionPlayer", "[25, 31]"] }
}
}
9 changes: 9 additions & 0 deletions gamefiles/level/l1/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"action": {
"name": "if.equal",
"param1": "%showMap%",
"param2": true,
"then": { "name": "drawable.visible", "id": "txtMapLabel", "visible": true },
"else": { "name": "drawable.visible", "id": "txtMapLabel", "visible": false }
}
}
9 changes: 9 additions & 0 deletions gamefiles/level/l10/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"action": {
"name": "if.equal",
"param1": "%showMap%",
"param2": true,
"then": { "name": "drawable.visible", "id": "txtMapLabel", "visible": true },
"else": { "name": "drawable.visible", "id": "txtMapLabel", "visible": false }
}
}
9 changes: 9 additions & 0 deletions gamefiles/level/l15/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"action": {
"name": "if.equal",
"param1": "%showMap%",
"param2": true,
"then": { "name": "drawable.visible", "id": "txtMapLabel", "visible": true },
"else": { "name": "drawable.visible", "id": "txtMapLabel", "visible": false }
}
}
9 changes: 9 additions & 0 deletions gamefiles/level/l5/map.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"action": {
"name": "if.equal",
"param1": "%showMap%",
"param2": true,
"then": { "name": "drawable.visible", "id": "txtMapLabel", "visible": true },
"else": { "name": "drawable.visible", "id": "txtMapLabel", "visible": false }
}
}
61 changes: 33 additions & 28 deletions gamefiles/level/load.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
{
"action": {
"name": "game.fadeOut",
"action": [
{ "name": "resource.popAll", "id": "currentLevel" },
{ "name": "load", "file": "loadingScreens/{1}.json" },
{ "name": "game.fadeIn",
"action": [
{ "name": "loadingScreen.setProgress", "progress": 35 },
{ "name": "resource.add", "id": "currentLevel" },
{ "name": "load", "file": "level/clearPlayers.json" },
{ "name": "level.clearObjects" },
{ "name": "load", "file": "level/{2}/level.json" },
{ "name": "loadingScreen.setProgress", "progress": 70 },
{ "name": "load", "file": "level/{2}/players.json" },
{ "name": "loadingScreen.setProgress", "progress": 90 },
{ "name": "load", "file": "level/{2}/sounds.json" },
{ "name": "loadingScreen.setProgress", "progress": 100 },
{ "name": "load", "file": "level/{2}/music.json" },
{ "name": "if.equal",
"param1": "{3}",
"param2": "positionPlayer",
"then": { "name": "load", "file": ["level/positionPlayer.json", "{4}"] }
},
{ "name": "load", "file": "level/playOrStopMusic.json" }
]
}
]
}
"action": [
{ "name": "level.pause", "pause": true },
{
"name": "game.fadeOut",
"action": [
{ "name": "resource.popAll", "id": "currentLevel" },
{ "name": "load", "file": "loadingScreens/{1}.json" },
{ "name": "game.fadeIn",
"action": [
{ "name": "level.pause", "pause": false },
{ "name": "loadingScreen.setProgress", "progress": 35 },
{ "name": "resource.add", "id": "currentLevel" },
{ "name": "load", "file": "level/clearPlayers.json" },
{ "name": "level.clearObjects" },
{ "name": "load", "file": "level/{2}/level.json" },
{ "name": "loadingScreen.setProgress", "progress": 70 },
{ "name": "load", "file": "level/{2}/players.json" },
{ "name": "loadingScreen.setProgress", "progress": 90 },
{ "name": "load", "file": "level/{2}/sounds.json" },
{ "name": "loadingScreen.setProgress", "progress": 100 },
{ "name": "load", "file": "level/{2}/music.json" },
{ "name": "if.equal",
"param1": "{3}",
"param2": "positionPlayer",
"then": { "name": "load", "file": ["level/positionPlayer.json", "{4}"] }
},
{ "name": "load", "file": "level/playOrStopMusic.json" },
{ "name": "load", "file": ["level/setMapAction.json", "{2}"] }
]
}
]
}
]
}
3 changes: 2 additions & 1 deletion gamefiles/level/loadBase.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{ "name": "load", "file": "level/clearPlayers.json" },
{ "name": "level.clearObjects" },
{ "name": "loadingScreen.setProgress", "progress": 20 },
{ "name": "load", "file": "level/variables.json" },
{ "name": "load", "file": "res/level/actions.json" },
{ "name": "loadingScreen.setProgress", "progress": 25 },
{ "name": "load", "file": "res/level/fonts.json" },
Expand All @@ -20,7 +21,7 @@
{ "name": "loadingScreen.setProgress", "progress": 35 },
{ "name": "load", "file": "level/loadBaseLevel.json" },
{ "name": "loadingScreen.setProgress", "progress": 45},
{ "name": "load", "file": "{3}/loadPlayerCel.json" },
{ "name": "load", "file": "level/player/loadCel.json" },
{ "name": "loadingScreen.setProgress", "progress": 55 },
{ "name": "resource.add", "id": "currentLevel" },
{ "name": "load", "file": "level/{2}/level.json" },
Expand Down
1 change: 1 addition & 0 deletions gamefiles/level/newGame.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
{ "name": "loadingScreen.setProgress", "progress": 10 },
{ "name": "resource.add", "id": "level", "ignorePrevious": true },
{ "name": "loadingScreen.setProgress", "progress": 20 },
{ "name": "load", "file": "level/variables.json" },
{ "name": "load", "file": "res/level/actions.json" },
{ "name": "loadingScreen.setProgress", "progress": 25 },
{ "name": "load", "file": "res/level/fonts.json" },
Expand Down
19 changes: 18 additions & 1 deletion gamefiles/level/player/loadCel.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
{
"load": "{1}/loadPlayerCel.json"
"action": {
"name": "switch",
"param": "%charClass%",
"case": [
{
"value": "Warrior",
"action": { "name": "load", "file": "level/player/loadWarriorCel.json" }
},
{
"value": "Rogue",
"action": { "name": "load", "file": "level/player/loadRogueCel.json" }
},
{
"value": "Sorceror",
"action": { "name": "load", "file": "level/player/loadSorcerorCel.json" }
}
]
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"celFile": [
{ "id": "rlsas", "file": "plrgfx/rogue/rls/rlsas.cl2" },
{ "id": "rlsat", "file": "plrgfx/rogue/rls/rlsat.cl2" },
{ "id": "rlsaw", "file": "plrgfx/rogue/rls/rlsaw.cl2" },
{ "id": "rlsfm", "file": "plrgfx/rogue/rls/rlsfm.cl2" },
{ "id": "rlsht", "file": "plrgfx/rogue/rls/rlsht.cl2" },
{ "id": "rlslm", "file": "plrgfx/rogue/rls/rlslm.cl2" },
{ "id": "rlsqm", "file": "plrgfx/rogue/rls/rlsqm.cl2" },
{ "id": "rlsst", "file": "plrgfx/rogue/rls/rlsst.cl2" },
{ "id": "rlswl", "file": "plrgfx/rogue/rls/rlswl.cl2" }
],
"action": {
"name": "if.equal",
"param1": "%beta%",
"param2": true,
"then": { "name": "load", "file": "level/player/loadRogueCelFilesBeta.json" },
"else": { "name": "load", "file": "level/player/loadRogueCelFiles.json" }
},
"celTexture": [
{
"id": "rls",
Expand Down
13 changes: 13 additions & 0 deletions gamefiles/level/player/loadRogueCelFiles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"celFile": [
{ "id": "rlsas", "file": "plrgfx/rogue/rls/rlsas.cl2" },
{ "id": "rlsat", "file": "plrgfx/rogue/rls/rlsat.cl2" },
{ "id": "rlsaw", "file": "plrgfx/rogue/rls/rlsaw.cl2" },
{ "id": "rlsfm", "file": "plrgfx/rogue/rls/rlsfm.cl2" },
{ "id": "rlsht", "file": "plrgfx/rogue/rls/rlsht.cl2" },
{ "id": "rlslm", "file": "plrgfx/rogue/rls/rlslm.cl2" },
{ "id": "rlsqm", "file": "plrgfx/rogue/rls/rlsqm.cl2" },
{ "id": "rlsst", "file": "plrgfx/rogue/rls/rlsst.cl2" },
{ "id": "rlswl", "file": "plrgfx/rogue/rls/rlswl.cl2" }
]
}
Loading

0 comments on commit 17cbbda

Please sign in to comment.