diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index a3bea67..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python: Current File", - "type": "python", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal", - "cwd": "${fileDirname}" - } - ] -} \ No newline at end of file diff --git a/CodeNameEmpty b/CodeNameEmpty new file mode 160000 index 0000000..5b33e2d --- /dev/null +++ b/CodeNameEmpty @@ -0,0 +1 @@ +Subproject commit 5b33e2db00798f3fe3e464cd15b11baf5ce0f904 diff --git a/GameLauncher.spec b/GameLauncher.spec index dc2e12b..538e342 100644 --- a/GameLauncher.spec +++ b/GameLauncher.spec @@ -3,8 +3,8 @@ block_cipher = None -a = Analysis(['src\\main.py'], - pathex=['C:\\Users\\ninon\\Google Drive\\CodeNameEmpty-NightlyDev\\CodeNameEmpty'], +a = Analysis(['src\\launchGame.py'], + pathex=['F:\\Drive\\CodeNameEmptyRestart\\CodeNameEmpty'], binaries=[], datas=[], hiddenimports=[], diff --git a/compile.bat b/compile.bat index 10f853e..53ea255 100644 --- a/compile.bat +++ b/compile.bat @@ -1,6 +1,16 @@ -pyinstaller --onefile --clean --noconsole^ - -n GameLauncher ^ - GameLauncher.spec +echo Creating executable... +pyinstaller GameLauncher.spec + +echo Created executable. +echo Creating res directory... xcopy /s /y /f src\res dist\res +rem xcopy /y /f src\res dist\res + +echo Created res directory. + +rem echo Zipping res directory... +rem python zipResources.py +rem echo Zip complete. + pause \ No newline at end of file diff --git a/dist/GameLauncher.exe b/dist/GameLauncher.exe index 8b876fc..27cee2e 100644 Binary files a/dist/GameLauncher.exe and b/dist/GameLauncher.exe differ diff --git a/dist/res/official.zip b/dist/res/official.zip new file mode 100644 index 0000000..ddac24b Binary files /dev/null and b/dist/res/official.zip differ diff --git a/src/res/official/areas/area_forest.json b/dist/res/official/areas/area_gen_forest_1.json similarity index 61% rename from src/res/official/areas/area_forest.json rename to dist/res/official/areas/area_gen_forest_1.json index 7d5b406..992224f 100644 --- a/src/res/official/areas/area_forest.json +++ b/dist/res/official/areas/area_gen_forest_1.json @@ -1,21 +1,16 @@ { "name":[ - "The $nameAdjs $names's $forest", - "The $names's $forest", - "The $adjs $forest", - "$adjs $forest" + "The $names's $forest Trail", + "The $adjs $forest Trail", + "$adjs $forest Trail" ], "names":{ "type":"choose", "choices":[ "Elder", - "God", "King", "Queen", - "Dragon", "Bear", - "Ruffian", - "Troublemaker", "Huntsman" ] }, @@ -23,39 +18,20 @@ "type":"choose", "choices":[ "Forest", - "Woods", "Thicket", - "Woodland", - "Timberland", - "Wilds", - "Grove" + "Grove", + "Wilderness", + "Woodland" ] }, "adjs":{ "type":"choose", "choices":[ - "Red", "Yellow", "Green", - "Black", - "Dark", "Sunny", "Foggy", "Dense", - "Royal", - "Broken", - "Old" - ] - }, - "nameAdjs":{ - "type":"choose", - "choices":[ - "Good", - "Holy", - "Evil", - "Cruel", - "Loving", - "Loved", "Old" ] }, @@ -67,20 +43,22 @@ ], "aType":"Forest", "hostilityMin":1, - "hostilityMax":5, - "eventChance":10, + "hostilityMax":4, + "eventChance":45, "events":[ - ["event_lostItem", "1d8"], - ["event_flipACoin", "1d8"], - ["event_forestAreaMisc", "2d8"], - ["event_forestAreaMisc2", "2d8"] + ["event_lostItem", "1d20"], + ["event_flipACoin", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] ], - "enemyChance":10, + "hostilityAffectsEnemyChance":true, + "enemyChance":15, "enemyPointsPerHostility":2, "enemies":[ ["enemy_rodentOfUnusualSize", 2], ["enemy_wolf",3], - ["enemy_bandit", 5], ["enemy_greatWolf",7] ], "npcChance":0, @@ -90,7 +68,8 @@ "minNewAreas":3, "maxNewAreas":6, "areas":[ - ["area_forest","2d5", ["required"]], - ["area_strongHold","1d6"] + ["area_gen_forest_1","2d5", ["required"]], + ["area_gen_forest_2","2d5"], + ["area_gen_forest_3","2d5"] ] } \ No newline at end of file diff --git a/dist/res/official/areas/area_gen_forest_2.json b/dist/res/official/areas/area_gen_forest_2.json new file mode 100644 index 0000000..860a69e --- /dev/null +++ b/dist/res/official/areas/area_gen_forest_2.json @@ -0,0 +1,74 @@ +{ + "name":[ + "The $names's $forest", + "The $adjs $forest", + "$adjs $forest" + ], + "names":{ + "type":"choose", + "choices":[ + "Elder", + "King", + "Queen", + "Bear", + "Huntsman" + ] + }, + "forest":{ + "type":"choose", + "choices":[ + "Forest", + "Thicket", + "Grove", + "Wilderness", + "Woodland" + ] + }, + "adjs":{ + "type":"choose", + "choices":[ + "Yellow", + "Green", + "Sunny", + "Foggy", + "Dense", + "Old" + ] + }, + "desc":[ + "Trees surround you on either side. There is an eerie sound of an owl in the distance.\nYou push past the trees as you continue moving forward.", + "It is almost impossible to see past the trees.\nYou continue to push on.", + "Next to no light is able to pass through the thick layer of leaves above.\nThe few beams of light guide you as you go on.", + "There is a slight chill to the air, probably because of the lack of sunlight.\nAt least you won't sweat as you hike on." + ], + "aType":"Forest", + "hostilityMin":3, + "hostilityMax":6, + "eventChance":35, + "events":[ + ["event_lostItem", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] + ], + "hostilityAffectsEnemyChance":true, + "enemyChance":15, + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf",4], + ["enemy_bandit",6], + ["enemy_greatWolf",8] + ], + "npcChance":0, + "npcs":[ + ], + "minNewAreas":2, + "maxNewAreas":6, + "areas":[ + ["area_gen_forest_2", "1d8"], + ["area_gen_forest_1", "2d6"], + ["area_gen_forest_3", "2d6"], + ["area_gen_forest_4", "2d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_gen_forest_3.json b/dist/res/official/areas/area_gen_forest_3.json new file mode 100644 index 0000000..2d56b7e --- /dev/null +++ b/dist/res/official/areas/area_gen_forest_3.json @@ -0,0 +1,78 @@ +{ + "name":[ + "The $names's $forest Trail", + "The $adjs $forest Trail", + "$adjs $forest Trail" + ], + "names":{ + "type":"choose", + "choices":[ + "Elder", + "King", + "Queen", + "Bear", + "Huntsman" + ] + }, + "forest":{ + "type":"choose", + "choices":[ + "Forest", + "Thicket", + "Grove", + "Wilderness", + "Woodland" + ] + }, + "adjs":{ + "type":"choose", + "choices":[ + "Yellow", + "Green", + "Sunny", + "Bright", + "Foggy", + "Dense", + "Old" + ] + }, + "desc":[ + "Trees surround you on either side. There is an eerie sound of an owl in the distance.\nYou push past the trees as you continue moving forward.", + "It is almost impossible to see past the trees.\nYou continue to push on.", + "Next to no light is able to pass through the thick layer of leaves above.\nThe few beams of light guide you as you go on.", + "There is a slight chill to the air, probably because of the lack of sunlight.\nAt least you won't sweat as you hike on." + ], + "aType":"Forest", + "hostilityMin":2, + "hostilityMax":4, + "eventChance":40, + "events":[ + ["event_lostItem", "1d20"], + ["event_flipACoin", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] + ], + "hostilityAffectsEnemyChance":true, + "enemyChance":20, + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy_rodentOfUnusualSize", 2], + ["enemy_wolf",3], + ["enemy_greatWolf",7] + ], + "npcChance":0, + "npcs":[ + ], + "minNewAreas":3, + "maxNewAreas":6, + "areas":[ + ["area_gen_forest_1", "2d6"], + ["area_gen_forest_2", "2d6"], + ["area_gen_forest_3", "1d8", ["required"]], + ["area_gen_forest_4", "1d12"], + ["cave_wolf_entrance", "1d8"], + ["area_village_gate_east", "2d6", ["limited"]] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_gen_forest_4.json b/dist/res/official/areas/area_gen_forest_4.json new file mode 100644 index 0000000..7056b42 --- /dev/null +++ b/dist/res/official/areas/area_gen_forest_4.json @@ -0,0 +1,84 @@ +{ + "name":[ + "The $nameAdjs $names's $forest", + "$nameAdjs $adjs $forest" + ], + "names":{ + "type":"choose", + "choices":[ + "Elder", + "God", + "King", + "Queen", + "Dragon", + "Bear", + "Ruffian", + "Troublemaker", + "Huntsman" + ] + }, + "forest":{ + "type":"choose", + "choices":[ + "Forest", + "Thicket", + "Wilds", + "Wilderness", + "Woodland" + ] + }, + "adjs":{ + "type":"choose", + "choices":[ + "Dark", + "Foggy", + "Dense", + "Royal", + "Broken" + ] + }, + "nameAdjs":{ + "type":"choose", + "choices":[ + "Evil", + "Cruel", + "Old" + ] + }, + "desc":[ + "Trees surround you on either side. There is an eerie sound of an owl in the distance.\nYou push past the trees as you continue moving forward.", + "It is almost impossible to see past the trees.\nYou continue to push on.", + "Next to no light is able to pass through the thick layer of leaves above.\nThe few beams of light guide you as you go on.", + "There is a slight chill to the air, probably because of the lack of sunlight.\nAt least you won't sweat as you hike on." + ], + "aType":"Forest", + "hostilityMin":5, + "hostilityMax":7, + "eventChance":35, + "events":[ + ["event_lostItem", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] + ], + "hostilityAffectsEnemyChance":true, + "enemyChance":15, + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf",3], + ["enemy_bandit",7], + ["enemy_banditStrong",9], + ["enemy_greatWolf",8], + ["enemy_bear",11] + ], + "npcChance":0, + "npcs":[ + ], + "minNewAreas":3, + "maxNewAreas":5, + "areas":[ + ["area_gen_forest_3", "1d8", ["required"]], + ["cave_wolf_entrance", "1d8"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_start_1.json b/dist/res/official/areas/area_start_1.json new file mode 100644 index 0000000..6dd6384 --- /dev/null +++ b/dist/res/official/areas/area_start_1.json @@ -0,0 +1,41 @@ +{ + "name":[ + "$descriptor $aName" + ], + "aName":{ + "type":"choose", + "choices":[ + "Grove", + "Clearing" + ] + }, + "descriptor":{ + "type":"choose", + "choices":[ + "Clear", + "Empty", + "Peaceful" + ] + }, + "desc":[ + "You hear birds chirping somewhere in the distance. Opening your eyes, you are greated to a calm $aName." + ], + "aType":"Forest", + "hostilityMin":1, + "hostilityMax":1, + "eventChance":100, + "events":[ + ["intro_event_1","1d1"] + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":1, + "areas":[ + ["area_start_2","1d1", ["required", "limited"]] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_start_2.json b/dist/res/official/areas/area_start_2.json new file mode 100644 index 0000000..d28811f --- /dev/null +++ b/dist/res/official/areas/area_start_2.json @@ -0,0 +1,51 @@ +{ + "name":[ + "$descriptor $aName" + ], + "aName":{ + "type":"choose", + "choices":[ + "Path", + "Pathway", + "Trail" + ] + }, + "descriptor":{ + "type":"choose", + "choices":[ + "Lightly Treaded", + "Rough Looking", + "Barely Treaded" + ] + }, + "descriptorLowercase":{ + "type":"choose", + "choices":[ + "lightly treaded", + "rough looking", + "barely treaded" + ] + }, + "desc":[ + "You walk along the $descriptorLowercase path, unsure if it will actually lead anywhere worthwhile.", + "The path is tough follow due to its apparent lack of use. You are unsure if following this path is the smartest decision." + ], + "aType":"Forest", + "hostilityMin":2, + "hostilityMax":3, + "eventChance":100, + "events":[ + ["intro_event_2", "1d6"] + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":1, + "areas":[ + ["area_gen_forest_1","1d1", ["required","limited"]] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_village_gate_east.json b/dist/res/official/areas/area_village_gate_east.json new file mode 100644 index 0000000..ebf5fed --- /dev/null +++ b/dist/res/official/areas/area_village_gate_east.json @@ -0,0 +1,49 @@ +{ + "name":[ + "Eastern Village Gate" + ], + "descWall":{ + "type":"choose", + "choices":[ + "You walk up to the village gate, taking in its rough texture and the many holes that have been drilled into it.", + "The wooden gate is old and rough. Worn down from weather and the passage of time.", + "The tall, oak gate used to protect the village from the dangers outside stands before you.", + "The walls of the village stand before you. Tall and intimidating with its dark wood exterior." + ] + }, + "guardDiscussion":{ + "type":"choose", + "choices":[ + "their wild night at the village's inn", + "the ludicrous price of bread", + "how underpaid they are", + "how boring gate duty is", + "how poor the weather has been recently", + "the terrible crop season", + "a crazy woman that seems to be constantly causing issues" + ] + }, + "desc":[ + "$descWall\nTwo guards stand at the doors of the gate. Their bored expressions conveying their lack of interest at doing such a job.", + "$descWall\nThe gate's guards lean on the side of the walls. The two of them chatting about $guardDiscussion.", + "$descWall\nYou overhear the two gate guards discussing $guardDiscussion.", + "$descWall" + ], + "aType":"Village Wall", + "hostilityMin":0, + "hostilityMax":0, + "eventChance":0, + "events":[ + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":4, + "areas":[ + ["area_gen_forest_3", "2d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_village_gate_west.json b/dist/res/official/areas/area_village_gate_west.json new file mode 100644 index 0000000..b9e37b8 --- /dev/null +++ b/dist/res/official/areas/area_village_gate_west.json @@ -0,0 +1,49 @@ +{ + "name":[ + "Village Gate West" + ], + "descWall":{ + "type":"choose", + "choices":[ + "You walk up to the village gate, taking in its rough texture and the many holes that have been drilled into it.", + "The wooden gate is old and rough. Worn down from weather and the passage of time.", + "The tall, oak gate used to protect the village from the dangers outside stands before you.", + "The walls of the village stand before you. Tall and intimidating with its dark wood exterior." + ] + }, + "guardDiscussion":{ + "type":"choose", + "choices":[ + "their wild night at the village's inn", + "the ludicrous price of bread", + "how underpaid they are", + "how boring gate duty is", + "how poor the weather has been recently", + "the terrible crop season", + "a crazy woman that is constantly causing issues" + ] + }, + "desc":[ + "$descWall\nTwo guards stand at the doors of the gate. Their bored expressions conveying their lack of interest at doing such a job.", + "$descWall\nThe gate's guards lean on the side of the walls. The two of them chatting about $guardDiscussion.", + "$descWall\nYou overhear the two gate guards discussing $guardDiscussion.", + "$descWall" + ], + "aType":"Village Wall", + "hostilityMin":0, + "hostilityMax":0, + "eventChance":0, + "events":[ + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":4, + "areas":[ + ["area_gen_forest_3", "2d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/cave_wolf_entrance.json b/dist/res/official/areas/cave_wolf_entrance.json new file mode 100644 index 0000000..d03799e --- /dev/null +++ b/dist/res/official/areas/cave_wolf_entrance.json @@ -0,0 +1,104 @@ +{ + "name":[ + "$cave of $beasts", + "$beastDesc $beasts' $cave $entrance", + "$entrance to the $cave of $beasts", + "$beasts' $caveDesc $cave", + "$caveDesc $cave of $beasts", + "$cave of $beastDesc $beasts" + ], + "cave":{ + "type":"choose", + "choices":[ + "Cave", + "Cavern", + "Den", + "Hollow", + "Pass", + "Grotto", + "Respite" + ] + }, + "beasts":{ + "type":"choose", + "choices":[ + "Wolves", + "Dogs", + "Beasts" + ] + }, + "beastDesc":{ + "type":"choose", + "choices":[ + "Gray", + "Bone", + "Petty", + "Violent", + "Bloody", + "Cruel", + "Large", + "Feral" + ] + }, + "caveDesc":{ + "type":"choose", + "choices":[ + "Cavernous", + "Winding", + "Large", + "Dark", + "Damp" + ] + }, + "entrance":{ + "type":"choose", + "choices":[ + "Entrance", + "Entry", + "Inlet" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "Going inside could prove to be a bad idea.", + "You can't shake off the feeling of death around you.", + "The sickly looking trees closest to the entrance add to the unnerving feel of the cave.", + "You cannot think of a good reason to enter.", + "You can only prepare yourself so much for whatever lies within." + ] + }, + "desc":[ + "A draft of air blows out from the cave's dark entrance. A sense of lingering danger coming from within.\n$randomDetail", + "You can hear howls from within the cave. The sounds are obviously coming from beasts that are calling it their home.\n$randomDetail", + "The entrance to the cave appears to have been carved out. Small glyphs and runes have been etched into the sides.\n$randomDetail", + "Two large boulders lean against each other, forming a sort of entrance into the dark depths into the wall of rock.\n$randomDetail", + "You see blood splatters all around the entrance to the cave. Small bones are littered about the area. You imagine what lies beyond.\n$randomDetail" + ], + "aType":"Cave", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":0, + "events":[ + ], + "enemyChance":75, + "enemyMessage":[ + "You see a group of wolves guarding the $entrance to the cave.", + "As you appraoch the cave you see several wolves laying by the $entrance.", + "The cave's $entrance is guarded by several wolves laying beside it." + ], + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf", 4], + ["enemy_greatWolf", 7] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":3, + "areas":[ + ["cave_wolf_room_1a", "1d1", ["required", "limited"]], + ["area_gen_forest_3","1d5", ["required"]], + ["area_gen_forest_4","1d5"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/cave_wolf_room_1a.json b/dist/res/official/areas/cave_wolf_room_1a.json new file mode 100644 index 0000000..e420c5b --- /dev/null +++ b/dist/res/official/areas/cave_wolf_room_1a.json @@ -0,0 +1,87 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Tight", + "Drafty", + "Slim", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "tight", + "drafty", + "slim", + "sparkling" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "All you can hear is the snapping of small bones under your feet as you walk.", + "It is impossible to count the number of dead creatures that have made this place their final resting place.", + "The growls from deeper within the cave grow louder as you continue on." + ] + }, + "desc":[ + "You enter the cave and pause for a moment, allowing your eyes to get used to the darkness within the cave.\n$randomDetail", + "The stench of rotting flesh causes you to nearly wretch within the darkness.\n$randomDetail" + ], + "aType":"Cave", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":0, + "events":[ + ], + "enemyChance":75, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":4, + "areas":[ + ["cave_wolf_room_2a", "1d6", ["required", "limited"]], + ["cave_wolf_room_1a", "1d6", ["limited"]], + ["cave_wolf_room_1b", "1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/cave_wolf_room_1b.json b/dist/res/official/areas/cave_wolf_room_1b.json new file mode 100644 index 0000000..3d5d1f9 --- /dev/null +++ b/dist/res/official/areas/cave_wolf_room_1b.json @@ -0,0 +1,86 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Tight", + "Drafty", + "Slim", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "tight", + "drafty", + "slim", + "sparkling" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "You can hear the faint sound of dripping water echoing through the dark passages.", + "There are streaks of dried up blood along the floor. It looks like the cave's inhabitants drag their prey deep into the cave system." + ] + }, + "desc":[ + "You continue working your way through the $nameDescLowercase cave system. $randomDetail", + "The winding corridors of the $nameDescLowercase give a deepening sense of dread the further in you go. $randomDetail" + ], + "aType":"Cave", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":35, + "events":[ + ["event_cave_wolf_1", "1d6"] + ], + "enemyChance":66, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":3, + "areas":[ + ["cave_wolf_room_2a", "1d6", ["limited"]], + ["cave_wolf_room_1a", "1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/cave_wolf_room_2a.json b/dist/res/official/areas/cave_wolf_room_2a.json new file mode 100644 index 0000000..843848c --- /dev/null +++ b/dist/res/official/areas/cave_wolf_room_2a.json @@ -0,0 +1,84 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Roomy", + "Tight", + "Drafty", + "Slim", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "tight", + "drafty", + "slim", + "sparkling" + ] + }, + "desc":[ + "Based on the echoes of your movement, you estimate you are halfway through the cave system.", + "You can hear water dripping somewhere deeper inside the cave.", + "This seems to be the deepest portion of the cave. The everpresent darkness surrounds you at every turn.", + "The cave begins to slope and turn about randomly. Anyone could get easily lost within the dark corridors.", + "There is no more light this deep within the cave. All is darkness. You have only your other senses to help you." + ], + "aType":"Cave", + "hostilityMin":5, + "hostilityMax":7, + "eventChance":100, + "events":[ + ["event_cave_wolf_1", "1d6"], + ["event_cave_found_item_1", "1d6"] + ], + "enemyChance":75, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":3, + "areas":[ + ["cave_wolf_room_3", "1d6", ["required", "limited"]], + ["cave_wolf_room_2a", "1d6", ["limited"]] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/cave_wolf_room_3.json b/dist/res/official/areas/cave_wolf_room_3.json new file mode 100644 index 0000000..7738573 --- /dev/null +++ b/dist/res/official/areas/cave_wolf_room_3.json @@ -0,0 +1,83 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Roomy", + "Drafty", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "drafty", + "sparkling" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "Bones litter the ground. This is obviously a nest for a foul beast.", + "A bit of grass has been piled into one of the sides of the area.", + "What appears to be a freshly eaten meal sits at the center of the area." + ] + }, + "desc":[ + "The cave opens up a bit into a slightly more spacious room. $randomDetail", + "You push into another chamber of the cave. This one is more spacious that the previous ones. $randomDetail" + ], + "aType":"Cave", + "hostilityMin":5, + "hostilityMax":7, + "eventChance":0, + "events":[ + ], + "enemyChance":75, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":4, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":2, + "areas":[ + ["area_gen_forest_3", "1d6", ["required"]], + ["area_gen_forest_4", "1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/legacy/area_forest_tower.json b/dist/res/official/areas/legacy/area_forest_tower.json new file mode 100644 index 0000000..9ccd3e0 --- /dev/null +++ b/dist/res/official/areas/legacy/area_forest_tower.json @@ -0,0 +1,45 @@ +{ + "name":[ + "$nameDesc Tower", + "Tower in the Forest" + ], + "nameDesc":{ + "type":"choose", + "choices":[ + "Abandoned", + "Forgotten", + "Derelict", + "Crumbling" + ] + }, + "towerDesc":{ + "type":"choose", + "choices":[ + "The tower stands tall in the middle of the forest. Its crumbling exterior still presenting the master worksmanship of its original architects.", + "The derelict spire reaches high above the surrounding trees. The structure is made up of carfully carved stones that perfectly fit into the other. If only it had received some form of upkeep.", + "The tower looms over the surrounding trees with its intimidating presence. The torn banners are the only indicator that the tower has been abandoned for some time." + ] + }, + "desc":[ + "The worn trail has numerous lush trees to either side of it. Following the trail leads to an abandoned looking tower.\n$towerDesc", + "Following the dirt path under the coverage of trees eventually leads to a worn tower.\n$towerDesc", + "The seemingly endless path curves through the dense forest. Continuing to follow it leads to a derelict looking tower." + ], + "aType":"Forest", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":90, + "events":[ + ["event_tower_forest", "1d6"] + ], + "enemyChance":0, + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":3, + "maxNewAreas":5, + "areas":[ + ["area_forest","2d5", ["required"]] + ] +} \ No newline at end of file diff --git a/dist/res/official/areas/area_strongHold.json b/dist/res/official/areas/legacy/area_strongHold.json similarity index 100% rename from dist/res/official/areas/area_strongHold.json rename to dist/res/official/areas/legacy/area_strongHold.json diff --git a/dist/res/official/areas/template_area_file.json b/dist/res/official/areas/template_area_file.json new file mode 100644 index 0000000..95e7c4d --- /dev/null +++ b/dist/res/official/areas/template_area_file.json @@ -0,0 +1,47 @@ +{ + "name":[ + "Name", + "Name with $var" + ], + "var":{ + "type":"choose", + "choices":[ + "variable", + "random text" + ] + }, + "desc":[ + "Description text", + "Other possible description text.", + "$vars can be used here as well" + ], + "aType":"Forest", + "hostilityMin":1, + "hostilityMax":10, + "eventChance":35, + "events":[ + ["event id here", "die roll (1d8)"], + ["event 2 id here", "1d8"] + ], + "enemyChance":35, + "enemyMessage":[ + "This tag is optional", + "$vars are able to be used as well" + ], + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy id here", hostilitypointsneededtospawn], + ["enemy 2 id here", 2], + ["group", ["enemy", "ids", "of", "group", "here"], 10] + ], + "npcChance":0, + "npcs":[ + "npc_defNPC" + ], + "minNewAreas":1, + "maxNewAreas":10, + "areas":[ + ["area id here","die roll (1d8)", ["required"]], + ["area 2 id here","1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/armor/armor_starting_armor.json b/dist/res/official/armor/armor_starting_armor.json new file mode 100644 index 0000000..5eaa6bc --- /dev/null +++ b/dist/res/official/armor/armor_starting_armor.json @@ -0,0 +1,13 @@ +{ + "name":[ + "Ruined Cloak", + "Torn Cloak" + ], + "desc":[ + "The cloak will protect you only if a blow lands on an undamaged portion of it.", + "The worn out cloak won't protect you from much." + ], + "defence":"1d2-1", + "worthMin":5, + "worthMax":15 +} \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_bandit.json b/dist/res/official/enemies/enemy_bandit.json index 058e3c3..3608946 100644 --- a/dist/res/official/enemies/enemy_bandit.json +++ b/dist/res/official/enemies/enemy_bandit.json @@ -25,23 +25,24 @@ "It's a bandit... What else do you want from me?" ], "deathMsg":[ - "topples to the ground, his blood pooling around his body." + "topples to the ground, his blood pooling around his body.", + "breathes his last and falls to the ground, his blood pooling around his body." ], "hp":"2d5+8", "damage":"0", + "modCount":"0", "modifier":[ ], "weapon":[ - "weapon_ironSword" + "weapon_ironSword", + "weapon_club" ], "armor":[ "armor_hideArmor" ], "itemChance":50, "itemDrops":[ - ["armor_hideArmor", "You search the bandit and take his armor."], - ["weapon_ironSword", "You search the bandit and take his sword."], - ["template_IronSword", "You search the bandit and take his sword. How a bandit got ahold of such a nice weapon is anyone's guess."] + ["consumable_potion_health", "You search the bandit, finding a potion."] ], "xp":5 } \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_banditStrong.json b/dist/res/official/enemies/enemy_banditStrong.json new file mode 100644 index 0000000..3100890 --- /dev/null +++ b/dist/res/official/enemies/enemy_banditStrong.json @@ -0,0 +1,52 @@ +{ + "name":[ + "$racetype $title", + "$title" + ], + "title":{ + "type":"choose", + "choices":[ + "Bandit", + "Thief", + "Scoundrel", + "Outcast" + ] + }, + "racetype":{ + "type":"choose", + "choices":[ + "Human", + "Elven", + "Orc" + ] + }, + "eID":"banditStrong", + "desc":[ + "It's a bandit... What else do you want from me?" + ], + "deathMsg":[ + "topples to the ground, his blood pooling around his body.", + "breathes his last and falls to the ground, his blood pooling around his body." + ], + "hp":"2d6+10", + "damage":"0", + "modCount":"1d2", + "modifier":[ + ["strong",3], + ["largeBody",3], + ["veryStrong",2] + ], + "weapon":[ + "weapon_steelSword" + ], + "armor":[ + "armor_hideArmor" + ], + "itemChance":60, + "itemDrops":[ + ["consumable_potion_health", "You search the bandit, finding a potion."], + ["consumable_potion_health", "You search the bandit, finding a potion."], + ["weapon_steelSword", "You search the bandit, finding a potion."] + ], + "xp":10 +} \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_bear.json b/dist/res/official/enemies/enemy_bear.json new file mode 100644 index 0000000..e3d41d2 --- /dev/null +++ b/dist/res/official/enemies/enemy_bear.json @@ -0,0 +1,57 @@ +{ + "name":[ + "$color Furred Bear", + "$color2 Bear" + ], + "color":{ + "type":"choose", + "choices":[ + "Black", + "Onyx", + "Pitch-Black", + "Charcoal", + "Dark Gray", + "Slate", + "Darkly" + ] + }, + "color2":{ + "type":"choose", + "choices":[ + "Black", + "Dark Gray", + "Jet-Black", + "Pitch-Black" + ] + }, + "eID":"blackBear", + "desc":[ + "The bear eyes you intently. Its fur glinting in the light.", + "The scars across the bear's body lets any of its enemies know that its not new to fighting." + ], + "deathMsg":[ + "gives one last roar before succumbing to its wounds.", + "groans before collapsing on the ground." + ], + "hp":"3d8+8", + "damage":"1d6+2", + "modCount":"1d3", + "modifier":[ + ["None",3], + ["strong",2], + ["veryStrong",2], + ["strong",2], + ["weak",2], + ["largeBody",3], + ["sick",1] + ], + "weapon":[ + "weapon_wolfClaws" + ], + "armor":[ + "armor_greatWolfHide" + ], + "itemChance":0, + "itemDrops":[], + "xp":15 +} \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_greatWolf.json b/dist/res/official/enemies/enemy_greatWolf.json index c6573a1..4b4289c 100644 --- a/dist/res/official/enemies/enemy_greatWolf.json +++ b/dist/res/official/enemies/enemy_greatWolf.json @@ -17,11 +17,14 @@ ], "hp":"2d3+10", "damage":"1d3", + "modCount":"1d3-1", "modifier":[ - ["None",2], - ["strong",3], + ["strong",2], ["veryStrong",1], - ["weak",1] + ["weak",1], + ["largeBody",2], + ["wolfRabid",3], + ["wolfStrong",3] ], "weapon":[ "weapon_wolfClaws" @@ -29,9 +32,11 @@ "armor":[ "armor_greatWolfHide" ], - "itemChance":1, + "itemChance":50, "itemDrops":[ - ["material_greatWolfPelt","You skin the large beast and take it as a reward."] + ["material_greatWolfPelt","You skin the large beast and take it as a reward."], + ["consumable_raw_meat","You skin the large beast, taking some of its flesh with you."], + ["consumable_raw_meat","You are able to take some of the beast's flesh."] ], "xp":12 } \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_orc.json b/dist/res/official/enemies/enemy_orc.json index 446efc0..e276433 100644 --- a/dist/res/official/enemies/enemy_orc.json +++ b/dist/res/official/enemies/enemy_orc.json @@ -16,6 +16,7 @@ ], "hp":"3d6+10", "damage":"0d0", + "modCount":"1d3-1", "modifier":[ ["None",3], ["strong",3], @@ -31,8 +32,10 @@ "armor":[ "armor_orcArmor" ], - "itemChance":0, + "itemChance":50, "itemDrops":[ + ["consumable_potion_health", "You search the Orc and find a healing potion."], + ["weapon_steelSword", "You search the Orc and find a steel sword."] ], "xp":8 } \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_orcCaptain.json b/dist/res/official/enemies/enemy_orcCaptain.json index e3c3265..2ff0108 100644 --- a/dist/res/official/enemies/enemy_orcCaptain.json +++ b/dist/res/official/enemies/enemy_orcCaptain.json @@ -17,6 +17,7 @@ ], "hp":"3d6+15", "damage":"1d3", + "modCount":"1d3-1", "modifier":[ ["None",5], ["strong",3], @@ -29,9 +30,11 @@ "armor":[ "armor_orcArmor" ], - "itemChance":25, + "itemChance":50, "itemDrops":[ - ["armor_ironArmor", "You see that the orc you killed had a bag of valuables. Within it you find some iron armor."] + ["armor_ironArmor", "You see that the orc you killed had a bag of valuables. Within it you find some iron armor."], + ["consumable_potion_health", "You search the $name and find a healing potion."], + ["consumable_potion_health", "You search the Orc and find a healing potion."] ], "xp":20 } \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_robbedQuestEnemy.json b/dist/res/official/enemies/enemy_robbedQuestEnemy.json index 79898c7..8db85a8 100644 --- a/dist/res/official/enemies/enemy_robbedQuestEnemy.json +++ b/dist/res/official/enemies/enemy_robbedQuestEnemy.json @@ -11,6 +11,7 @@ ], "hp":"2d4+8", "damage":"1d1", + "modCount":"0", "modifier":[ ], "weapon":[ diff --git a/dist/res/official/enemies/enemy_rodentOfUnusualSize.json b/dist/res/official/enemies/enemy_rodentOfUnusualSize.json index 519b153..41f535b 100644 --- a/dist/res/official/enemies/enemy_rodentOfUnusualSize.json +++ b/dist/res/official/enemies/enemy_rodentOfUnusualSize.json @@ -40,11 +40,13 @@ ], "hp":"1d4+3", "damage":"0", + "modCount":"1d3-1", "modifier":[ - ["None",3], - ["weak",5], + ["None",1], + ["weak",4], ["strong",1], - ["veryWeak",3] + ["veryWeak",2], + ["largeBody",2] ], "weapon":[ "weapon_wolfClaws" @@ -52,9 +54,9 @@ "armor":[ "None" ], - "itemChance":0, + "itemChance":50, "itemDrops":[ - ["material_wolfPelt","You skin the wolf and take it as a reward."] + ["consumable_raw_meat","You are able to salvage some of the beast's flesh."] ], "xp":1 } \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_template.json b/dist/res/official/enemies/enemy_template.json new file mode 100644 index 0000000..df6e469 --- /dev/null +++ b/dist/res/official/enemies/enemy_template.json @@ -0,0 +1,33 @@ +{ + "name":[ + "Enemy Name", + "Enemy Name Variant" + ], + "eID":"enemyId", + "desc":[ + "Description when fighting enemy.", + "Second description for fighting" + ], + "deathMsg":[ + "this message plays on death.", + "these messages should start with a lowercase letter and include a period at the end." + ], + "hp":"1d20", + "damage":"1d3", + "modCount":"1d3-1", + "modifier":[ + ["None",3], + ["mod type",2] + ], + "weapon":[ + "weapon_id" + ], + "armor":[ + "armor_id" + ], + "itemChance":50, + "itemDrops":[ + ["item_id","Description when player recieves the item drop."] + ], + "xp":3 +} \ No newline at end of file diff --git a/dist/res/official/enemies/enemy_wolf.json b/dist/res/official/enemies/enemy_wolf.json index 0544794..6a335eb 100644 --- a/dist/res/official/enemies/enemy_wolf.json +++ b/dist/res/official/enemies/enemy_wolf.json @@ -15,11 +15,15 @@ ], "hp":"2d3+5", "damage":"0", + "modCount":"1d3-1", "modifier":[ - ["None",3], + ["None",1], ["weak",2], ["strong",1], - ["veryWeak",1] + ["veryWeak",2], + ["largeBody",1], + ["wolfRabid",2], + ["wolfStrong",2] ], "weapon":[ "weapon_wolfClaws" @@ -27,9 +31,11 @@ "armor":[ "armor_wolfHide" ], - "itemChance":10, + "itemChance":50, "itemDrops":[ - ["material_wolfPelt","You skin the wolf and take it as a reward."] + ["material_wolfPelt","You skin the wolf and take it as a reward."], + ["consumable_raw_meat","You skin the large beast, taking some of its flesh with you."], + ["consumable_raw_meat","You are able to take some of the beast's flesh."] ], "xp":3 } \ No newline at end of file diff --git a/dist/res/official/events/event_cave_found_item_1.json b/dist/res/official/events/event_cave_found_item_1.json new file mode 100644 index 0000000..5a2d37f --- /dev/null +++ b/dist/res/official/events/event_cave_found_item_1.json @@ -0,0 +1,99 @@ +{ + "id":"itemInCave", + "type":"random", + "name":[ + "A Forgotten Item", + "A Dropped Item", + "Finding Something within the Cave" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "You continue working through the depths of the cave. As you walk through the corridors you spot something glinting in the shadows." + ], + "actions":[ + { + "action":"Check it out", + "eventDo":[ + ["say","You pick up the item and investigate it."], + ["goto", ["#healingItem1","#healingItem2","#healingItem3"]] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["say","You decide that whatever it is, it is not worth your time and continue on."], + ["finish"] + ] + } + ] + }, + "#healingItem1":{ + "msg":[ + "You grab the thing and examine it. It is just a slightly bruised, but still somehwat fresh apple." + ], + "actions":[ + { + "action":"Take it", + "eventDo":[ + ["say","You slip the apple into your bag and continue on."], + ["give","consumable_apple",1], + ["finish"] + ] + }, + { + "action":"Leave it", + "eventDo":[ + ["say", "The apple is not worth the space it would take up in you bag. You decide to leave it where you found it."], + ["finish"] + ] + } + ] + }, + "#healingItem2":{ + "msg":[ + "You grab the thing and examine it. It appears to be a healing potion." + ], + "actions":[ + { + "action":"Take it", + "eventDo":[ + ["say","You slip the potion into your bag and continue on."], + ["give","consumable_potion_health",1], + ["finish"] + ] + }, + { + "action":"Leave it", + "eventDo":[ + ["say", "The potion is not worth the space it would take up in you bag. You decide to leave it where you found it."], + ["finish"] + ] + } + ] + }, + "#healingItem3":{ + "msg":[ + "You examine the object and see that it is not a singular item, but rather what appears to be two different healing poitions." + ], + "actions":[ + { + "action":"Take them", + "eventDo":[ + ["say","You slip the potions into your bag and continue on."], + ["give","consumable_potion_health",2], + ["finish"] + ] + }, + { + "action":"Leave it", + "eventDo":[ + ["say", "Those potions are not worth the space they would take up in you bag. You decide to leave it where you found it."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/event_cave_wolf_1.json b/dist/res/official/events/event_cave_wolf_1.json new file mode 100644 index 0000000..b66d176 --- /dev/null +++ b/dist/res/official/events/event_cave_wolf_1.json @@ -0,0 +1,57 @@ +{ + "id":"caveWolfEvent1", + "type":"random", + "name":[ + "A Group of Wolves", + "A Pack of Wolves" + ], + "start":[ + "#BasicPack1", + "#BasicPack2", + "#DangerousPack" + ], + "#BasicPack1":{ + "msg":[ + "You continue working your way through the tight chambers of the cave. Pushing through a particularly tight passageway you lose your balance and trip. You quickly get up to see several wolves circling around you.", + "The deep growling of several wolves causes you to pause. Unlike the growls you heard earleir, these are much closer. The sound is steadily getting louder." + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_greatWolf"]], + ["finish"] + ] + } + ] + }, + "#BasicPack2":{ + "msg":[ + "You continue working your way through the tight chambers of the cave. Pushing through a particularly tight passageway you lose your balance and trip. You quickly get up to see several wolves quickly approaching you.", + "The deep growling of several wolves causes you to pause. Unlike the growls you heard earlier, these are much closer. The sound is steadily getting louder." + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_wolf", "enemy_wolf"]], + ["finish"] + ] + } + ] + }, + "#DangerousPack":{ + "msg":[ + "The sound of a wolf howling causes you to jump. You can't see to much further into the dark passages, but you can easily make out the eyes of several wolves. One of the wolves in the far back appears much larger than any of the ones in the front." + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_wolf", "enemy_wolf", "enemy_greatWolf"]], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/event_forestAreaMisc.json b/dist/res/official/events/event_forestAreaMisc.json index 002c0d5..3e9e913 100644 --- a/dist/res/official/events/event_forestAreaMisc.json +++ b/dist/res/official/events/event_forestAreaMisc.json @@ -12,7 +12,7 @@ "You hear a rustling in the trees to the right of you.", "You hear a rustling in the trees to the left of you.", "In the distance you can hear wolves howling.", - "The leaves rustle in the wind as you walk", + "The leaves rustle in the wind as you walk.", "There are birds chirping as you continue to walk the beaten path." ], "actions":[] diff --git a/dist/res/official/events/event_forestAreaMisc2.json b/dist/res/official/events/event_forestAreaMisc2.json index 0c93c20..c30bd81 100644 --- a/dist/res/official/events/event_forestAreaMisc2.json +++ b/dist/res/official/events/event_forestAreaMisc2.json @@ -12,7 +12,8 @@ "You glance around as you continue walking the path. You pause for a moment, enjoying the clear day, before continuing on.", "You take a deep breath and look at the trees to either side of you. The calmness of the scene feels wasted as you continue on your way.", "You pass by a large oak tree as you walk the pathway. Its bark broken by what appear to be claws. You ready your guard as you continue walking.", - "You stop walking for a moment as you feel a cool breeze. You hear the leaves on the trees rustle as you continue making your way down the path." + "You stop walking for a moment as you feel a cool breeze. You hear the leaves on the trees rustle as you continue making your way down the path.", + "While the trees around you give you a sense of calm, the eery silence is enough to make you uneasy. It's quiet enough to make you wonder if you are actually alone." ], "actions":[] } diff --git a/dist/res/official/events/event_forest_apple.json b/dist/res/official/events/event_forest_apple.json new file mode 100644 index 0000000..dd768b7 --- /dev/null +++ b/dist/res/official/events/event_forest_apple.json @@ -0,0 +1,32 @@ +{ + "id":"eventForestApple", + "type":"random", + "name":[ + "An Apple Tree" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "As you continue along the dirt path you notice an apple tree not too far away. You examine it and see a single fresh apple just waiting to be taken." + ], + "actions":[ + { + "action":"Take it", + "eventDo":[ + ["say","You reach up to the tree and grab the apple."], + ["give","consumable_apple",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["say","You opt to leave the tree alone. You don't need an apple taking up space in your inventory."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/event_forgotten_item.json b/dist/res/official/events/event_forgotten_item.json new file mode 100644 index 0000000..9bf398f --- /dev/null +++ b/dist/res/official/events/event_forgotten_item.json @@ -0,0 +1,98 @@ +{ + "id":"eventItemInTheDirt", + "type":"random", + "name":[ + "Something Left in the Dirt", + "Lost Item" + ], + "start":[ + "#start" + ], + "#start":{ + "msg":[ + "You notice something sticking up out of the dirt as you walk. You walk over to it, seeing that it is a leather bag with something obviously shoved into it." + ], + "actions":[ + { + "action":"Open the bag", + "eventDo":[ + ["goto",["#ironSword", "#hideArmor", "#healthPotion"]] + ] + }, + { + "action":"Ignore it and continue on", + "eventDo":[ + ["finish"] + ] + } + ] + }, + "#ironSword":{ + "msg":[ + "You open the bag, pulling out a simple iron sword wrapped in a thin cloth.", + "You kneel down by the bag and open the flap. Inside you find an iron sword wrapped with a thin cloth." + ], + "actions":[ + { + "action":"Take the sword", + "eventDo":[ + ["say","You throw the cloth away and take the sword with you."], + ["give","weapon_ironSword",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["finish"] + ] + } + ] + }, + "#hideArmor":{ + "msg":[ + "You open the bag, pulling out a set of hide armor inside.", + "Opening the bag's flap reveals a set of hide armor shoved hastily inside.", + "Inside the leather bag sits a neatly folded set of hide armor." + ], + "actions":[ + { + "action":"Take the armor", + "eventDo":[ + ["say","You pull the armor out of the bag and take it with you."], + ["give","armor_hideArmor",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["finish"] + ] + } + ] + }, + "#healthPotion":{ + "msg":[ + "You throw the flap of the bag open and find a health potion inside.", + "Inside the bag is a single health potion.", + "You flip open the bag's flap and see a health potion." + ], + "actions":[ + { + "action":"Take the potion", + "eventDo":[ + ["say","You grab the health potion and throw it into your own bag."], + ["give","consumable_potion_health",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/event_mysteriousOrb.json b/dist/res/official/events/event_mysteriousOrb.json new file mode 100644 index 0000000..bc77fbc --- /dev/null +++ b/dist/res/official/events/event_mysteriousOrb.json @@ -0,0 +1,24 @@ +{ + "id":"mysteriousOrb", + "type":"random", + "isRepeatable":false, + "name":[ + "A Strange Orb" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":["As you walk down the path you notice a patch of burnt up grass. You stop and take a closer look at the patch of burnt grass and see a small orb sitting in the center of it."], + "actions":[ + { + "action":"Pick it up", + "eventDo":[ + ["say","You kneel down and pick the orb up. You examine the strange metal sphere and realize that you really do not have any idea what it is."], + ["give","misc_mysteriousOrb", 1], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/event_tower_forest.json b/dist/res/official/events/event_tower_forest.json new file mode 100644 index 0000000..e251ced --- /dev/null +++ b/dist/res/official/events/event_tower_forest.json @@ -0,0 +1,45 @@ +{ + "id":"towerEnemies", + "type":"random", + "name":[ + "Reaching the Tower", + "At the Tower" + ], + "start":[ + "#wolves", + "#bandits", + "#bear" + ], + "#wolves":{ + "msg":[ + "" + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_greatWolf"]], + ["finish"] + ] + } + ] + }, + "#bandits":{ + "msg":[ + "" + ], + "actions":[ + ["spawnEnemy",["enemy_bandit", "enemy_bandit", "enemy_bandit","enemy_bandit"]], + ["finish"] + ] + }, + "#bear":{ + "msg":[ + "" + ], + "actions":[ + ["spawnEnemy",["enemy_bear"]], + ["finish"] + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/intro_event_1.json b/dist/res/official/events/intro_event_1.json new file mode 100644 index 0000000..7c4eeda --- /dev/null +++ b/dist/res/official/events/intro_event_1.json @@ -0,0 +1,25 @@ +{ + "id":"areaStartIntro", + "type":"intro", + "name":[ + "Dazed and Confused" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "You suddenly sit up, unable to remember why you are in the middle of the forest." + ], + "actions":[ + { + "action":"Take in your surroundings", + "eventDo":[ + ["say","You stand up, looking around at the trees spread out around you."], + ["say","Figuring out what you were doing and why you are in the middle of a forest should probably be your top priority.\nThere is a lightly treaded path in front of you. It could be the way to the nearest town."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/intro_event_2.json b/dist/res/official/events/intro_event_2.json new file mode 100644 index 0000000..3a15894 --- /dev/null +++ b/dist/res/official/events/intro_event_2.json @@ -0,0 +1,124 @@ +{ + "id":"areaStartIntro2", + "type":"intro", + "name":[ + "Abandoned Camp", + "Empty Campsite" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "You continue following the trail, eventually entering a clearing. A fire pit sits at the center and a broken tent sits on its own just a few yards away.", + "As you follow the trail, you stumble into what appears to be an abandoned campsite. A broken tent and empty fire pit are the only things of notice." + ], + "actions":[ + { + "action":"Investigate the fire pit", + "eventDo":[ + ["say","You walk over to the fire pit and kneel down to see if there is anything of note.\nExamining the ash and footprints around the pit lead you to believe that there was only a single person staying at the campsite."], + ["goto", ["#firepit"]] + ] + }, + { + "action":"Investigate the broken tent", + "eventDo":[ + ["say","You walk over to the broken tent and pick through the scraps of fabric."], + ["goto", ["#brokentent","#luckytent"]] + ] + }, + { + "action":"Leave the campsite", + "eventDo":[ + ["say","After looking at the state of the camp, you decide that it would not be wise to stick around and see what made the previous visitor leave in such a hurry."], + ["finish"] + ] + } + ] + }, + "#firepit":{ + "msg":[ + "You stand up from the fire pit and look around at the rest of the camp. The tent sits on its own in silence.", + "Standing up from the firepit you take another glance around the camp. All that was left behind by the prior visitor was the tent." + ], + "actions":[ + { + "action":"Investigate the abandoned tent", + "eventDo":[ + ["say","You walk over to the broken tent and pick through the scraps of fabric."], + ["goto", ["#brokentent","#luckytent"]] + ] + }, + { + "action":"Leave the campsite", + "eventDo":[ + ["say","You stand up and walk towards the trail. Odds are there's nothing worthwhile here, and you definitely don't want to see what made the previous visitor leave in such a hurry."], + ["finish"] + ] + } + ] + }, + "#brokentent":{ + "msg":[ + "Upon lifting one of the tent flaps you find a satchel with a bit of weight to it.", + "Tossing parts of the tent to the side you see a small bag. Lifting it up you can feel that there's something inside." + ], + "actions":[ + { + "action":"Open the bag", + "eventDo":[ + ["say","You open the top flap of the bag and shake its contents out in front of you. Several apples drop down onto the ground.\nYou pocket the apples."], + ["give","consumable_apple",3], + ["goto", ["#anEncounter","#noEncounter"]] + ] + } + ] + }, + "#luckytent":{ + "msg":[ + "Upon lifting one of the tent flaps you find a satchel with a bit of weight to it.", + "Tossing parts of the tent to the side you see a small bag. Lifting it up you can feel that there's something inside." + ], + "actions":[ + { + "action":"Open the bag", + "eventDo":[ + ["say","You open the top flap of the bag and shake its contents out in front of you. Three glass bottles drop onto the ground.\nPicking one up to look at closer makes you realize that they are healing potions! You throw the potions into your bag."], + ["give","consumable_potion_health",3], + ["goto", ["#anEncounter","#noEncounter"]] + ] + } + ] + }, + "#anEncounter":{ + "msg":[ + "You stand up, glad that searching the campsite was worth the time.\nA sudden loud snap alerts you to a pair of large rodents that are closing in on you fast. You don't have any choice other than to fight.", + "You stand up and glance around the camp one last time.\nA high pitched screech causes you to spin around. A pair of unusually big rodents are circling you. Your only choice is to fight them off. " + ], + "actions":[ + { + "action":"Ready your weapon", + "eventDo":[ + ["spawnEnemy",["enemy_rodentOfUnusualSize","enemy_rodentOfUnusualSize"]], + ["finish"] + ] + } + ] + }, + "#noEncounter":{ + "msg":[ + "You stand up, glad that searching the campsite was worth the time.", + "You stand up and glance around the camp one last time." + ], + "actions":[ + { + "action":"Continue along the path", + "eventDo":[ + ["say","Since there is nothing left at the site to search you continue once more along the trail."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/events/template_event_file.json b/dist/res/official/events/template_event_file.json new file mode 100644 index 0000000..afcf645 --- /dev/null +++ b/dist/res/official/events/template_event_file.json @@ -0,0 +1,57 @@ +{ + "id":"templateEvent", + "type":"random", + "name":[ + "Random title 1", + "Random title 2" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "Random initial message 1", + "Random initial message 2" + ], + "actions":[ + { + "action":"This is an action that takes you to another step", + "eventDo":[ + ["say","This is a say command. The next command will take you to another branch of the event"], + ["goto", ["#secondStep"]] + ] + }, + { + "action":"This is an action that will exit", + "eventDo":[ + ["say","This is a say command. The next action will end the event"], + ["finish"] + ] + } + ] + }, + "#secondStep":{ + "msg":[ + "These function the same as the first branch" + ], + "actions":[ + { + "action":"This action has a requirement", + "requirements":[ + ["have","gold",1] + ], + "eventDo":[ + ["say","If this action was chosen, the player will lose 1 gold and then end the event."], + ["take","gold",1], + ["finish"] + ] + }, + { + "action":"This action has no requirements", + "eventDo":[ + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/dist/res/official/meta.json b/dist/res/official/meta.json index bac4d81..6d579f8 100644 --- a/dist/res/official/meta.json +++ b/dist/res/official/meta.json @@ -1,93 +1,133 @@ { - "name":"Official Data Pack", - "author":"Sprinklez Media", - "desc":"This is the official game data and assets for the game.", - "packType":"standalone", - "version":0.1, - "gameLogo":[ - " _____ _____ _____ __ _____ _____ _____", - " | _ || __ || | __| || __|| ||_ _|", - " | __|| -|| | || | || __|| --| | |", - " |__| |__|__||_____||_____||_____||_____| |_|", - " _____ _____ _____ _____ __ __", - " | __|| || _ ||_ _|| | |", - " | __|| | | || __| | | |_ _|", - " |_____||_|_|_||__| |_| |_|" - ], - "gameDesc":[ - "Welcome to the void", - "REALLY early access", - "No, it's not complete", - "Estimated Release: Eventually", - "Made by A Donut with Sprinklez", - "Coming when it's done", - "There aren't very many of these", - "Growing all the time!", - "Ever closer to completion", - "The void stares back" - ], - "weapons":[ - "weapon_ironSword", - "weapon_wolfClaws", - "weapon_orcSword", - "template_IronSword" - ], - "armor":[ - "armor_wolfHide", - "armor_hideArmor", - "armor_ironArmor", - "armor_greatWolfHide", - "armor_orcArmor", - "armor_orcCaptainArmor" - ], - "misc":[ - "material_wolfPelt", - "material_stick", - "material_greatWolfPelt", - "misc_pieceOfMetal", - "consumable_apple" - ], - "areas":[ - "area_forest", - "area_strongHold" - ], - "races":[ - "race_human", - "race_elf", - "race_orc", - "race_dwarf", - "race_draktilien" - ], - "startableRaces":[ - "race_human", - "race_elf", - "race_orc", - "race_dwarf", - "race_draktilien" - ], - "npcs":[ - "npc_defNPC" - ], - "enemies":[ - "enemy_bandit", - "enemy_rodentOfUnusualSize", - "enemy_wolf", - "enemy_greatWolf", - "enemy_orc", - "enemy_orcCaptain", - "enemy_robbedQuestEnemy" - ], - "modifiers":[ - "modifiersList" - ], - "quests":[ - "quest_robbed" - ], - "events":[ - "event_lostItem", - "event_flipACoin", - "event_forestAreaMisc", - "event_forestAreaMisc2" - ], - "startingArea":"area_forest" + "name": "Official Data Pack", + "author": "Sprinklez Media", + "desc": "This is the official game data and assets for the game.", + "packType": "standalone", + "version": 0.1, + "gameLogo": [ + " _____ _____ _____ __ _____ _____ _____", + " | _ || __ || | __| || __|| ||_ _|", + " | __|| -|| | || | || __|| --| | |", + " |__| |__|__||_____||_____||_____||_____| |_|", + " _____ _____ _____ _____ __ __", + " | __|| || _ ||_ _|| | |", + " | __|| | | || __| | | |_ _|", + " |_____||_|_|_||__| |_| |_|" + ], + "gameDesc": [ + "There aren't very many of these", + "Growing all the time!", + "Ever closer to completion", + "Entirely open source on GitHub", + "The void stares back", + "Now with a tiny bit of story!", + "Now with some dev tools!", + "Inspired by Huw2k8's The Wastes", + "This project has been in development for way too long" + ], + "areas": [ + "area_start_1", + "area_start_2", + "area_gen_forest_1", + "area_gen_forest_2", + "area_gen_forest_3", + "area_gen_forest_4", + "cave_wolf_entrance", + "cave_wolf_room_1a", + "cave_wolf_room_1b", + "cave_wolf_room_2a", + "cave_wolf_room_3", + "area_village_gate_east", + "area_village_gate_west" + ], + "armor": [ + "armor_starting_armor", + "armor_wolfHide", + "armor_hideArmor", + "armor_ironArmor", + "armor_greatWolfHide", + "armor_orcArmor", + "armor_orcCaptainArmor" + ], + "enemies": [ + "enemy_bandit", + "enemy_banditStrong", + "enemy_bear", + "enemy_greatWolf", + "enemy_orc", + "enemy_orcCaptain", + "enemy_robbedQuestEnemy", + "enemy_rodentOfUnusualSize", + "enemy_wolf" + ], + "events": [ + "intro_event_1", + "intro_event_2", + "event_lostItem", + "event_forgotten_item", + "event_flipACoin", + "event_forestAreaMisc", + "event_forestAreaMisc2", + "event_mysteriousOrb", + "event_forest_apple", + "event_cave_wolf_1", + "event_cave_found_item_1", + "event_tower_forest" + ], + "misc": [ + "consumable_apple", + "consumable_potion_health", + "consumable_raw_meat", + "material_wolfPelt", + "material_stick", + "material_greatWolfPelt", + "misc_pieceOfMetal", + "misc_mysteriousOrb" + ], + "modifiers": [ + "consumable_modifiers", + "enemy_modifiers", + "enemy_wolf_modifiers", + "forest_spirit", + "weapon_modifiers" + ], + "npcs": [], + "quests": [ + "quest_beginnings" + ], + "races": [ + "race_human", + "race_elf", + "race_orc", + "race_dwarf", + "race_draktilien" + ], + "startableRaces": [ + "race_human", + "race_elf", + "race_orc", + "race_dwarf", + "race_draktilien" + ], + "weapons": [ + "weapon_club", + "weapon_ironSword", + "weapon_orcSword", + "weapon_starter_sword", + "weapon_steelSword", + "weapon_treeBranch", + "weapon_wolfClaws" + ], + "startingArea": [ + "area_start_1" + ], + "startingWeapon": [ + "weapon_starter_sword" + ], + "startingArmor": [ + "armor_starting_armor" + ], + "startingInventory": [ + "consumable_potion_health" + ] } \ No newline at end of file diff --git a/dist/res/official/misc/consumable_apple.json b/dist/res/official/misc/consumable_apple.json index 8be5450..0a43ca3 100644 --- a/dist/res/official/misc/consumable_apple.json +++ b/dist/res/official/misc/consumable_apple.json @@ -8,9 +8,10 @@ "The apple looks large and delicious.", "The skin is a little bruised, but still edible." ], - "cType":"edible", + "iType":"consumable", + "consumeText":["Eat"], "effects":[ - ["heal","1d6"] + ["heal","2d3"] ], "worth":2 } \ No newline at end of file diff --git a/dist/res/official/misc/consumable_potion_health.json b/dist/res/official/misc/consumable_potion_health.json new file mode 100644 index 0000000..6ccd2ae --- /dev/null +++ b/dist/res/official/misc/consumable_potion_health.json @@ -0,0 +1,24 @@ +{ + "name":[ + "Potion of Health", + "Health Potion" + ], + "desc":[ + "A red liquid sloshes within the glass vial", + "It's a small vial full of a red liquid.", + "The glass container has a label that reads, 'drink if in trouble'." + ], + "iType":"consumable", + "consumeText":["Drink"], + "modifier":[ + ["strongEffect", 1], + ["improvedEffect", 2], + ["slightlyImprovedEffect", 3], + ["impairedEffect", 3], + ["None", 6] + ], + "effects":[ + ["heal","1d12+6"] + ], + "worth":15 +} \ No newline at end of file diff --git a/dist/res/official/misc/consumable_raw_meat.json b/dist/res/official/misc/consumable_raw_meat.json new file mode 100644 index 0000000..2a3336b --- /dev/null +++ b/dist/res/official/misc/consumable_raw_meat.json @@ -0,0 +1,15 @@ +{ + "name":[ + "Raw Meat", + "Raw Flesh" + ], + "desc":[ + "It is a hunk of raw flesh. It may give some nourishment, but cooking it would probably help." + ], + "iType":"consumable", + "consumeText":["Eat"], + "effects":[ + ["heal","1d4"] + ], + "worth":3 +} \ No newline at end of file diff --git a/dist/res/official/misc/misc_greatWolfPelt.json b/dist/res/official/misc/misc_greatWolfPelt.json deleted file mode 100644 index ad8e0a1..0000000 --- a/dist/res/official/misc/misc_greatWolfPelt.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name":[ - "Great Wolf Pelt", - "Great Wolf Hide", - "Alpha Wolf Pelt", - "Alpha Wolf Hide", - "Large Black Wolf Pelt", - "Large Gray Wolf Hide" - ], - "desc":[ - "The pelt is so large it is guaranteed a fair price.", - "There is no doubt that you could argue for a good price, considering it came from such a ferocious wolf." - ], - "worthMin":15, - "worthMax":25 -} \ No newline at end of file diff --git a/dist/res/official/misc/misc_mysteriousOrb.json b/dist/res/official/misc/misc_mysteriousOrb.json new file mode 100644 index 0000000..2bc1364 --- /dev/null +++ b/dist/res/official/misc/misc_mysteriousOrb.json @@ -0,0 +1,6 @@ +{ + "name":["Mysterious Orb"], + "desc":["It's a strange looking orb. It is perfectly smooth all around and appears to be made of a metal of some kind. It gives off a hollow sound when you tap it."], + "iType":"essential", + "worth":0 +} \ No newline at end of file diff --git a/dist/res/official/misc/misc_stick.json b/dist/res/official/misc/misc_stick.json deleted file mode 100644 index 59bdd5b..0000000 --- a/dist/res/official/misc/misc_stick.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name":[ - "Stick", - "Wooden Stick" - ], - "desc":[ - "It is a basic chunk of wood from a tree.", - "There does not seem like you can do anything with it." - ], - "worthMin":1, - "worthMax":5 -} \ No newline at end of file diff --git a/dist/res/official/misc/misc_wolfPelt.json b/dist/res/official/misc/misc_wolfPelt.json deleted file mode 100644 index 1cb7b2c..0000000 --- a/dist/res/official/misc/misc_wolfPelt.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name":[ - "Wolf Pelt", - "Wolf Hide" - ], - "desc":[ - "It might fetch a good price.", - "The hide seems to be in good shape.", - "The fur seems warm and thick enough to be used as an armor. Maybe if you found more..." - ], - "worthMin":5, - "worthMax":10 -} \ No newline at end of file diff --git a/dist/res/official/modifiers/consumable_modifiers.json b/dist/res/official/modifiers/consumable_modifiers.json new file mode 100644 index 0000000..136fe28 --- /dev/null +++ b/dist/res/official/modifiers/consumable_modifiers.json @@ -0,0 +1,51 @@ +{ + "impairedEffect": { + "name": [ + "Weakened", + "Old", + "Impaired", + "Expired" + ], + "desc": [ + "It seems to be less than average." + ], + "effect": "impaired", + "strength": "1d6+6" + }, + "improvedEffect": { + "name": [ + "Improved", + "Refined", + "Enhanced" + ], + "desc": [ + "It seems to be well above average." + ], + "effect": "improved", + "strength": "1d6+6" + }, + "slightlyImprovedEffect": { + "name": [ + "Marginally Improved", + "Partially Refined", + "Mildly Enhanced" + ], + "desc": [ + "It seems to be above average." + ], + "effect": "improved", + "strength": "1d3+3" + }, + "strongEffect": { + "name": [ + "Strong", + "Potent", + "Concentrated" + ], + "desc": [ + "It seems to be stronger than average." + ], + "effect": "strongEffect", + "strength": "+2" + } +} \ No newline at end of file diff --git a/dist/res/official/modifiers/enemy_modifiers.json b/dist/res/official/modifiers/enemy_modifiers.json new file mode 100644 index 0000000..f2b8f2a --- /dev/null +++ b/dist/res/official/modifiers/enemy_modifiers.json @@ -0,0 +1,99 @@ +{ + "dying": { + "name": [ + "Very Sick", + "Dying", + "Bloody" + ], + "desc": [ + "It is surprising that the $name is still standing in its current state.", + "The weakness caused by its condition is noticable.", + "There is a very small chance that the $name will be able to fight for an extended amount of time." + ], + "effect": "health", + "strength": "-2d2" + }, + "largeBody": { + "name": [ + "Healthy", + "Well Fed", + "Large", + "Bulky" + ], + "desc": [ + "The $name's body is huge.", + "The $name can probably take quite a beating." + ], + "effect": "health", + "strength": "2d3" + }, + "sick": { + "name": [ + "Sickly", + "Unhealthy", + "Hurt" + ], + "desc": [ + "It is surprising that the $name is still standing in its current state.", + "The weakness caused by its condition is noticable.", + "There's a chance that the $name will fall quicker than others." + ], + "effect": "health", + "strength": "-1d3" + }, + "strong": { + "name": [ + "Strong", + "Fit", + "Quick", + "Mad", + "Irritated" + ], + "desc": [ + "It looks like it could easily deal some damage.", + "It looks like it may be able to deal more damage than normally possible." + ], + "effect": "damage", + "strength": "1d2-1" + }, + "veryStrong": { + "name": [ + "Very Strong", + "Fast", + "Rugged", + "Angry", + "Furious" + ], + "desc": [ + "It looks like it could easily deal some damage.", + "The $name definitely has a higher damage potential." + ], + "effect": "damage", + "strength": "1d3-1" + }, + "veryWeak": { + "name": [ + "Very Weak", + "Tiny", + "Very Slow" + ], + "desc": [ + "It will be tough for such an enemy to land a strong blow." + ], + "effect": "damage", + "strength": "-1d3-1" + }, + "weak": { + "name": [ + "Weak", + "Small", + "Lesser" + ], + "desc": [ + "This $name is smaller than others of the same kind.", + "There is no way the $name can hit as strong as others." + ], + "effect": "damage", + "strength": "-1d2-1" + } +} \ No newline at end of file diff --git a/dist/res/official/modifiers/enemy_wolf_modifiers.json b/dist/res/official/modifiers/enemy_wolf_modifiers.json new file mode 100644 index 0000000..ff75f84 --- /dev/null +++ b/dist/res/official/modifiers/enemy_wolf_modifiers.json @@ -0,0 +1,31 @@ +{ + "wolfRabid": { + "name": [ + "Rabid", + "Foaming", + "Mad-Eyed", + "Fearless" + ], + "desc": [ + "The wolf is foaming at the mouth.", + "The wolf has a mad look in its eye.", + "The rabid wolf does not appear to be showing any sign of fear." + ], + "effect": "damage", + "strength": "1d3" + }, + "wolfStrong": { + "name": [ + "Well Built", + "Muscular", + "Towering" + ], + "desc": [ + "The wolf is massive in size.", + "The frame of the wolf is impressive.", + "There are few wolves as large as the one in front of you." + ], + "effect": "health", + "strength": "2d3" + } +} \ No newline at end of file diff --git a/dist/res/official/modifiers/forest_spirit.json b/dist/res/official/modifiers/forest_spirit.json new file mode 100644 index 0000000..8eccc48 --- /dev/null +++ b/dist/res/official/modifiers/forest_spirit.json @@ -0,0 +1,15 @@ +{ + "forest_spirit_young": { + "name": [ + "Young", + "Confused", + "Recently Awoken" + ], + "desc": [ + "The spirit was recently awoken and is not able to attack as hard.", + "It is too out of it to get a proper hit in." + ], + "effect": "damage", + "strength": "-1d3" + } +} \ No newline at end of file diff --git a/dist/res/official/modifiers/weapon_modifiers.json b/dist/res/official/modifiers/weapon_modifiers.json new file mode 100644 index 0000000..76b883e --- /dev/null +++ b/dist/res/official/modifiers/weapon_modifiers.json @@ -0,0 +1,83 @@ +{ + "wep_branch_rotten": { + "name": [ + "Rotten", + "Rotted", + "Rotting", + "Cracked" + ], + "desc": [ + "The branch looks extremely weak.", + "The branch is cracked and rotten." + ], + "effect": "damage", + "strength": "-1d2-1" + }, + "wep_branch_spiky": { + "name": [ + "Spiky", + "Branchy", + "Cruel Looking" + ], + "desc": [ + "The limb has lots of smaller branches growing out of it.", + "This particular branch looks extra spiky." + ], + "effect": "damage", + "strength": "1d2-1" + }, + "wep_club_heavy": { + "name": [ + "Heavy", + "Large", + "Massive" + ], + "desc": [ + "The club is weighted well.", + "This club has a good bit of heft to it." + ], + "effect": "damage", + "strength": "1d3-1" + }, + "wep_damaged": { + "name": [ + "Damaged", + "Broken", + "Scratched", + "Dull" + ], + "desc": [ + "The weapon is not in the best of shape.", + "The weapon looks somewhat damaged." + ], + "effect": "damage", + "strength": "-1d2-1" + }, + "wep_goodShape": { + "name": [ + "Sharp", + "Well Maintained", + "Well Made" + ], + "desc": [ + "The weapon looks extremely sharp.", + "The weapon looks like it was well maintained.", + "The weapon is in good condition." + ], + "effect": "damage", + "strength": "1d3-1" + }, + "wep_polished": { + "name": [ + "Polished", + "Clean", + "Shiny" + ], + "desc": [ + "The weapon looks extremely shiny.", + "The weapon looks like it was cleaned recently." + ], + "effect": "worth", + "strength": "20" + } +} \ No newline at end of file diff --git a/dist/res/official/modifiersList.json b/dist/res/official/modifiersList.json deleted file mode 100644 index 5eb1632..0000000 --- a/dist/res/official/modifiersList.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "strong":{ - "name":["Strong","Fit","Quick"], - "effect":"damage", - "strength":"1d2-1" - }, - "veryStrong":{ - "name":["Very Strong","Fast","Rugged"], - "effect":"damage", - "strength":"1d3-1" - }, - "weak":{ - "name":["Weak","Small","Lesser"], - "effect":"damage", - "strength":"-1d2-1" - }, - "veryWeak":{ - "name":["Very Weak","Tiny","Very Slow"], - "effect":"damage", - "strength":"-1d3-1" - }, - "sick":{ - "name":["Sickly","Unhealthy","Hurt"], - "effect":"health", - "strength":"-1d3" - }, - "dying":{ - "name":["Very Sick","Dying","Bloody"], - "effect":"health", - "strength":"-2d2" - } -} \ No newline at end of file diff --git a/dist/res/official/quests/quest_beginnings.json b/dist/res/official/quests/quest_beginnings.json new file mode 100644 index 0000000..0c151a2 --- /dev/null +++ b/dist/res/official/quests/quest_beginnings.json @@ -0,0 +1,23 @@ +{ + "title":"A New Beginning", + "desc":"Who am I? Why did I wake up in the middle of nowhere? I should stick to trails until I find a village or town. I need to find someone who could help me figure this out.", + "qID":"Beginnings", + "devComments":"Starts immediately after exiting the starting area", + "spawnConditions":[ + ["inAreaId", "area_gen_forest_1"] + ], + "spawnChance":11, + "do":[ + ["say", "I should stick to trails until I find a village or town. I need to find someone who could help me figure this out."] + ], + "nextStep":{ + "requirements":[ + ["inAreaType", "Village Wall"] + ], + "do":[ + ["say", "Well, this quest isn't ready..."], + ["setDesc", "I did not prepare the rest of this quest yet... sorry."], + ["questComplete",true] + ] + } +} \ No newline at end of file diff --git a/dist/res/official/quests/quest_robbed.json b/dist/res/official/quests/quest_robbed.json index 8fa1192..7c61601 100644 --- a/dist/res/official/quests/quest_robbed.json +++ b/dist/res/official/quests/quest_robbed.json @@ -15,7 +15,7 @@ ["inAreaType","Enemy Land"] ], "do":[ - ["spawnEnemy","enemy_robbedQuestEnemy"], + ["spawnEnemy",["enemy_robbedQuestEnemy"]], ["say","The person that robbed the old man is here somewhere."] ], "nextStep":{ diff --git a/dist/res/official/weapons/weapon_club.json b/dist/res/official/weapons/weapon_club.json new file mode 100644 index 0000000..bc80ad4 --- /dev/null +++ b/dist/res/official/weapons/weapon_club.json @@ -0,0 +1,21 @@ +{ + "name":[ + "Club", + "Wooden Club" + ], + "damage":"1d3+1", + "worthMin":5, + "worthMax":15, + "requiredHands":2, + "desc":[ + "A basic wooden club." + ], + "actionText":[ + "The club blurs as it is swung through the air." + ], + "modifierChance":75, + "modifierCount":"+1", + "modifiers":[ + ["wep_club_heavy","1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/weapons/weapon_ironSword.json b/dist/res/official/weapons/weapon_ironSword.json index d1820d3..562ed77 100644 --- a/dist/res/official/weapons/weapon_ironSword.json +++ b/dist/res/official/weapons/weapon_ironSword.json @@ -1,6 +1,6 @@ { "name":[ - "Scratched Iron Sword", + "Plain Iron Sword", "Iron Sword" ], "damage":"1d4+2", @@ -14,5 +14,11 @@ "actionText":[ "There is a blur as the sword swings through the air.", "The sword is silent as is is jabbed into its target." + ], + "modifierChance":100, + "modifierCount":"+1", + "modifiers":[ + ["wep_damaged","1d6"], + ["wep_goodShape","1d6"] ] } \ No newline at end of file diff --git a/dist/res/official/weapons/weapon_starter_sword.json b/dist/res/official/weapons/weapon_starter_sword.json new file mode 100644 index 0000000..437c81a --- /dev/null +++ b/dist/res/official/weapons/weapon_starter_sword.json @@ -0,0 +1,18 @@ +{ + "name":[ + "Broken Sword", + "Shattered Sword" + ], + "damage":"1d3", + "worthMin":10, + "worthMax":20, + "requiredHands":2, + "desc":[ + "The blade of the sword is completely shattered. It will still deal damage, but do not expect it to deal much.", + "The sword is in good shape until you get to the shattered blade. It looks like it has as much of a chance to hurt its target as it does its own wielder." + ], + "actionText":[ + "There is a blur as the sword swings through the air.", + "The sword is silent as is is jabbed into its target." + ] +} \ No newline at end of file diff --git a/dist/res/official/weapons/weapon_steelSword.json b/dist/res/official/weapons/weapon_steelSword.json new file mode 100644 index 0000000..568c47e --- /dev/null +++ b/dist/res/official/weapons/weapon_steelSword.json @@ -0,0 +1,25 @@ +{ + "name":[ + "Plain Steel Sword", + "Steel Sword" + ], + "damage":"1d4+2", + "worthMin":40, + "worthMax":60, + "requiredHands":2, + "desc":[ + "The iron gleams when light hits it.", + "The blade is scratched on the sides." + ], + "actionText":[ + "There is a blur as the sword swings through the air.", + "The sword is silent as is is jabbed into its target." + ], + "modifierChance":100, + "modifierCount":"+1", + "modifiers":[ + ["wep_damaged","1d5"], + ["wep_goodShape","1d6"], + ["wep_polished","1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/official/weapons/weapon_treeBranch.json b/dist/res/official/weapons/weapon_treeBranch.json new file mode 100644 index 0000000..fd398f3 --- /dev/null +++ b/dist/res/official/weapons/weapon_treeBranch.json @@ -0,0 +1,23 @@ +{ + "name":[ + "Tree Branch", + "Wooden Branch" + ], + "damage":"1d3", + "worthMin":0, + "worthMax":10, + "requiredHands":2, + "desc":[ + "A wooden tree branch covered in bark.", + "A tree branch covered in bark and moss." + ], + "actionText":[ + "The branch creaks as it is swung through the air." + ], + "modifierChance":75, + "modifierCount":"1d2", + "modifiers":[ + ["wep_branch_rotten","1d6"], + ["wep_branch_spiky","1d6"] + ] +} \ No newline at end of file diff --git a/dist/res/packs.json b/dist/res/packs.json deleted file mode 100644 index 4c5969b..0000000 --- a/dist/res/packs.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "packs":[ - "official" - ], - "start":"official" -} \ No newline at end of file diff --git a/dist/res/settings.json b/dist/res/settings.json index 873b538..da18f96 100644 --- a/dist/res/settings.json +++ b/dist/res/settings.json @@ -13,12 +13,12 @@ "GAMESETTINGS": [ [ "DELAYENABLED", - "Display Effects", + "[BROKEN] Display Effects", false ], [ "EVENTDELAYENABLED", - "Delay After Random Event", + "[BROKEN] Delay After Random Event", false ], [ @@ -30,6 +30,11 @@ "DEBUGDISPLAY", "Developer Display (Used for debugging)", false + ], + [ + "DISABLEENEMIES", + "Disable Enemy Encounters (Used for debugging)", + false ] ], "DATAPACKSETTINGS": { diff --git a/script.spec b/script.spec new file mode 100644 index 0000000..74421ae --- /dev/null +++ b/script.spec @@ -0,0 +1,50 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['script.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='script', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +coll = COLLECT( + exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='script', +) diff --git a/src/ApplicationWindowClass.py b/src/ApplicationWindowClass.py index d15d021..44540ea 100644 --- a/src/ApplicationWindowClass.py +++ b/src/ApplicationWindowClass.py @@ -36,7 +36,7 @@ def initiate_window(self, windowTitle, displaySettings = {}, pdelay=0, delay=Tru self.master = root self.master.geometry("{}x{}".format(self.settings["WIDTH"],self.settings["HEIGHT"])) self.master.protocol('WM_DELETE_WINDOW', self._close_button_event) - self.master.bind('', self._window_rezise_event) + self.master.bind('', self._window_resize_event) self.create_widgets() self.pack() self.window_is_open = True @@ -123,7 +123,7 @@ def _get_enter_pressed(self): return True return False - def _window_rezise_event(self, event): + def _window_resize_event(self, event): fontSize = int(self.master.winfo_width() / 70) self.font = font.Font(family="courier", size=fontSize) self.output_box.configure(font=self.font) diff --git a/src/areaClass.py b/src/areaClass.py index 02c8c59..5905e16 100644 --- a/src/areaClass.py +++ b/src/areaClass.py @@ -7,115 +7,118 @@ from eventClass import Event from textGeneration import generateString -# Hostility will range 1-10 -# Hostility affects how close to player strength enemys will be -# 0 = No hostiles -# 1-3 = below -# 4-6 = equal -# 7-9 = above -# 10 = Much higher -# This not only will affect strength but also rewards, with higher hostility giving better rewards. - class Area(object): - def __init__(self,areaType,debug = 0,**kwargs): - self.name = generateString(areaType) - print(f'\n GENERATING AREA: {self.name}') - self.desc = generateString(areaType, "desc") - self.newArea = random.randint(areaType["minNewAreas"],areaType["maxNewAreas"]) - self.newAreaTypes = areaType["areas"] - self.aType = areaType["aType"] - self.enemy = [] - self.event = None - self.npc = None - self.hostility = random.randint(areaType["hostilityMin"],areaType["hostilityMax"]) - - self.kwargs = kwargs - - chance = random.randint(0,areaType["eventChance"]) - # chance = 3 - if chance < 5 and chance != 0 and len(areaType["events"])>0: - self.event = self.chooseAnEvent(areaType) + def __init__(self,areaType,nonrepeatableevents=[],globalEvents=[],areaId="",**kwargs): + self.name = generateString(areaType) + self.aId = areaId + print(f'GENERATING AREA: {self.name}') + self.desc = generateString(areaType, "desc") + self.newArea = random.randint(areaType["minNewAreas"],areaType["maxNewAreas"]) + self.newAreaTypes = areaType["areas"] + self.aType = areaType["aType"] + self.enemy = [] + self.event = None + self.npc = None + self.hostility = random.randint(areaType["hostilityMin"],areaType["hostilityMax"]) - # ENEMY GENERATION - # MUST BE DEDONE - chance = areaType["enemyChance"] - try: - hostilityAffectsEnemyChance = areaType["hostilityAffectsEnemyChance"] - except: - hostilityAffectsEnemyChance = False - if hostilityAffectsEnemyChance: - c = chance+(self.hostility*10) - if c<0: - c=0 - else: - c = chance - if random.randint(0,100) <= c: - enemyPoints = self.hostility * areaType["enemyPointsPerHostility"] - attempts = 1 - currentEnemyDanger = 0 - while currentEnemyDanger < enemyPoints and attempts <= 3: - currentEnemyDanger = 0 - enemies = [] - possibleEnemies = copy.copy(areaType["enemies"]) - print(f'Attempt: {attempts}') - print(f'Possible Enemies: {possibleEnemies}') - print(f'Total Enemy Points: {enemyPoints}') - while len(possibleEnemies) > 0: - enemiesCheck = copy.copy(possibleEnemies) - possibleEnemies = [] - for enemy in enemiesCheck: - print(enemy) - if enemy[1] > enemyPoints - currentEnemyDanger: - print(f'removing: {enemy[0]} because {enemy[1]} >= {enemyPoints - currentEnemyDanger}') - else: - print(f'Keeping {enemy[0]} because {enemy[1]} <= {enemyPoints - currentEnemyDanger}') - possibleEnemies.append(enemy) - print(possibleEnemies) - if len(possibleEnemies) > 0: - newEnemy = random.choice(possibleEnemies) - currentEnemyDanger += newEnemy[1] - enemies.append(newEnemy[0]) - attempts += 1 - print(currentEnemyDanger) - self.enemy = enemies + self.kwargs = kwargs + + if random.randint(1,100) <= areaType["eventChance"]: + self.event = self.chooseAnEvent(areaType, nonrepeatableevents, globalEvents) + + # Enemy Generation/Spawning + chance = areaType["enemyChance"] + try: + hostilityAffectsEnemyChance = areaType["hostilityAffectsEnemyChance"] + if hostilityAffectsEnemyChance: + c = chance*self.hostility + except: + hostilityAffectsEnemyChance = False + c = chance + if c<0: + c=0 + print("Enemy Chance: {}".format(str(c))) + if random.randint(1,100) <= c: + enemyPoints = self.hostility * areaType["enemyPointsPerHostility"] + attempts = 1 + currentEnemyDanger = 0 + while currentEnemyDanger < enemyPoints and attempts <= 3: + currentEnemyDanger = 0 + enemies = [] + possibleEnemies = copy.copy(areaType["enemies"]) + while len(possibleEnemies) > 0: + enemiesCheck = copy.copy(possibleEnemies) + possibleEnemies = [] + for enemy in enemiesCheck: + if enemy[0] != "group" and enemy[1] <= enemyPoints - currentEnemyDanger: + # This enemy choice is not a group and has a low enough danger level + possibleEnemies.append(enemy) + elif enemy[0] == "group" and enemy[2] <= enemyPoints - currentEnemyDanger: + # This enemy choice is a group and has a low enough danger level + possibleEnemies.append(enemy) + if len(possibleEnemies) > 0: + newEnemy = random.choice(possibleEnemies) + # check if enemy is a group or not + if enemy[0] != "group": + # This is not a group, add them to the enemy list normally + currentEnemyDanger += newEnemy[1] + enemies.append(newEnemy[0]) + else: + # this enemy is apart of a group, add them individually to the list + currentEnemyDanger += newEnemy[2] + for enemyid in newEnemy[1]: + enemies.append(enemyid) + attempts += 1 + self.enemy = enemies - + # Optional Area data tags + datakeys = areaType.keys() + self.enemyMessage = None + if "enemyMessage" in datakeys and len(areaType["enemyMessage"]): + self.enemyMessage = generateString(areaType, "enemyMessage") - ''' - chance = areaType["enemyChance"] - enemies = [] - c = math.pow(15,(self.hostility-2.0)/10.0) - for enemy, echance in areaType["enemies"]: - enemies+=[enemy]*echance - for i in range(0,10): - if len(self.enemy)0: - self.npc = random.choice(areaType["npcs"]) - - def chooseAnEvent(self, areaType): - areaChoices = areaType["events"][::] - currentEvent = areaChoices[0] - highRoll = rollDice(currentEvent[1]) - for event in areaChoices[1:]: - newRoll = rollDice(event[1]) - if newRoll > highRoll: - currentEvent = event - highRoll = newRoll - return currentEvent[0] + # NPC's not yet implemented + chance = random.randint(0,areaType["npcChance"]) + if chance < 10 and chance != 0 and len(areaType["npcs"])>0: + self.npc = random.choice(areaType["npcs"]) + + def chooseAnEvent(self, areaType, nonrepeatableevents, globalevents): + areaChoices = areaType["events"][::] + for event in globalevents: + areaChoices.append(event) + # Remove any non-repeatable events that have already occured + for event in areaChoices: + if event[0] in nonrepeatableevents: + areaChoices.remove(event) + currentEvent = areaChoices[0] + highRoll = rollDice(currentEvent[1]) + for event in areaChoices[1:]: + newRoll = rollDice(event[1]) + if newRoll > highRoll: + currentEvent = event + highRoll = newRoll + return currentEvent[0] - def load(self,weapons,armor,misc,enemies,npcs,events,modifiers): - # Loads in the enemies and events with any objects that they may need - if self.enemy != []: - e = [] - for enemy in self.enemy: - newEnemy = Enemy(enemies[enemy],weapons,armor,misc,modifiers) - e.append(newEnemy) - self.enemy = e - if self.event: - self.event = Event(events[self.event]) + def load(self,weapons,armor,misc,enemies,npcs,events,modifiers): + # Loads in the enemies and events with any objects that they may need + if self.enemy != []: + e = [] + for enemy in self.enemy: + newEnemy = Enemy(enemies[enemy],weapons,armor,misc,modifiers) + e.append(newEnemy) + self.enemy = e + if self.event: + self.event = Event(events[self.event], self.event) diff --git a/src/dataPackEditor.py b/src/dataPackEditor.py new file mode 100644 index 0000000..9db05f8 --- /dev/null +++ b/src/dataPackEditor.py @@ -0,0 +1,1027 @@ + + +# Official imports +import copy +import os +from tkinter import font +import tkinter as tk +from tkinter import ttk +from tkinter import simpledialog, messagebox +from tkinter import * +from tkinter.tix import NoteBook + +# Local Imports +from jsonDecoder import loadJson, saveJson + + +class MetaDataEditor(tk.Frame): + def __init__(self, fileLocation, settings): + self.settings = settings + self.fileLoc = fileLocation + self.metaFileData = loadJson(metaFile) + + self.window_is_open = False + + def initiate_window(self): + root = tk.Tk() + super().__init__(root) + print(self.fileLoc) + super().winfo_toplevel().title("Project: Empty Datapack Editor | {}".format(self.fileLoc)) + + self.master = root + self.master.geometry("{}x{}".format(600,400)) + self.master.minsize(600, 400) + self.master.protocol('WM_DELETE_WINDOW', self._close_button_event) + root.option_add('*tearOff', FALSE) + + self.menubar = Menu(self.master) + self.master['menu'] = self.menubar + + self.create_widgets() + self.pack() + self.window_is_open = True + + self.master.mainloop() + + def create_widgets(self): + self.font = font.Font(family="courier", size=12) + self.fontText = font.Font(family="courier", size=10) + self.fontBold = font.Font(family="courier", size=12, underline=True, weight=font.BOLD) + + menu_file = Menu(self.menubar) + menu_edit = Menu(self.menubar) + menu_help = Menu(self.menubar) + self.menubar.add_cascade(menu=menu_file, label='File') + self.menubar.add_cascade(menu=menu_edit, label='Edit') + self.menubar.add_cascade(menu=menu_help, label='Help') + + # menu_file.add_command(label='New', command=self.newFile) + menu_file.add_command(label='Open...', command=self.openFile) + menu_file.add_separator() + menu_file.add_command(label='Exit', command=self._close_button_event) + + menu_edit.add_command(label='Save', command=self.savePack) + + menu_help.add_command(label='Help', command=self.menuHelp) + menu_help.add_command(label='About', command=self.menuAbout) + + self.masterframe = ttk.Frame(self.master) + self.masterframe.pack(expand=1, fill="both") + self.tabControl = ttk.Notebook(self.masterframe) + + self.create_metadatatab() + self.create_areastab() + # self.create_armorstab() + self.create_enemiestab() + self.create_eventstab() + # self.create_misctab() + self.create_modifiertab() + # self.create_npcstab() + # self.create_queststab() + # self.create_racestab() + self.create_weaponstab() + + self.tabControl.pack(expand=1, fill="both") + + def create_metadatatab(self): + # TAB CREATION + self.metadatatab = ttk.Labelframe(self.tabControl, text="Data Pack Info") + self.metadatatab.grid(row=0, column=0, padx=50, pady=50, sticky=E+W+N+S) + self.tabControl.add(self.metadatatab, text = " Metadata ") + + + # SCROLLABLE CREATION + canvas = tk.Canvas(self.metadatatab) + scrollbar = ttk.Scrollbar(self.metadatatab, orient=VERTICAL, command=canvas.yview) + + metadataFrame = ttk.Frame(canvas) + metadataFrame.grid(row=0, column=0, columnspan=1, padx=10, pady=10, sticky=E+W+N+S) + metadataFrame.bind( + "", + lambda e: canvas.configure( + scrollregion=canvas.bbox("all") + ) + ) + + + # ELEMENT CREATION + ttk.Label(metadataFrame, text="Name", font=self.font).grid(row=0, column=0, padx=10, pady=5, sticky=E) + ttk.Label(metadataFrame, text="Author", font=self.font).grid(row=1, column=0, padx=10, pady=5, sticky=E) + ttk.Label(metadataFrame, text="Description", font=self.font).grid(row=2, column=0, padx=10, pady=5, sticky=E) + ttk.Label(metadataFrame, text="Pack Type", font=self.font).grid(row=3, column=0, padx=10, pady=5, sticky=E) + ttk.Label(metadataFrame, text="Version", font=self.font).grid(row=4, column=0, padx=10, pady=5, sticky=E) + ttk.Label(metadataFrame, text="Game Descriptions", font=self.font).grid(row=5, column=0, padx=10, pady=5, sticky=E) + + Button(metadataFrame, text="Update Metadata", command=self.savePack, font=self.font).grid(row=6,column=0, columnspan=3, sticky=E+W) + + self.packName = Entry(metadataFrame, font=self.fontText) + self.packAuth = Entry(metadataFrame, font=self.fontText) + self.packDesc = Entry(metadataFrame, font=self.fontText) + self.packType = Entry(metadataFrame, font=self.fontText) + self.packVers = Entry(metadataFrame, font=self.fontText) + self.packName.grid(row=0, column=1, columnspan=2, padx=10, pady=5, sticky=E+W) + self.packAuth.grid(row=1, column=1, columnspan=2, padx=10, pady=5, sticky=E+W) + self.packDesc.grid(row=2, column=1, columnspan=2, padx=10, pady=5, sticky=E+W) + self.packType.grid(row=3, column=1, columnspan=2, padx=10, pady=5, sticky=E+W) + self.packVers.grid(row=4, column=1, columnspan=1, padx=10, pady=5, sticky=E+W) + self.packName.insert(END, self.metaFileData["name"]) + self.packAuth.insert(END, self.metaFileData["author"]) + self.packDesc.insert(END, self.metaFileData["desc"]) + self.packType.insert(END, self.metaFileData["packType"]) + self.packVers.insert(END, self.metaFileData["version"]) + + self.gameDesc = tk.Text(metadataFrame) + self.gameDesc.configure(font=self.fontText, wrap='none') + self.gameDesc.grid(row=5, column=1, columnspan=2, padx=10, pady=5, sticky=E+W+N+S) + + + # FINISHING TOUCHES + canvas.create_window((0, 0), window=metadataFrame, anchor="nw") + canvas.pack(side="left", fill="both", expand=True) + + metadataFrame.rowconfigure(5, weight=1) + metadataFrame.columnconfigure(0, weight=0) + metadataFrame.columnconfigure(1, weight=1) + metadataFrame.columnconfigure(2, weight=3) + metadataFrame.columnconfigure(2, weight=3) + + metadataFrame.pack(expand=1, fill="both") + self.metadataGameDescFill() + + + def create_modifiertab(self): + self.modifiertab = ttk.Frame(self.tabControl) + self.modifiertab.grid(row=0, column=0, padx=50, pady=50, sticky=E+W+N+S) + self.tabControl.add(self.modifiertab, text = " Modifiers ") + + canvas = tk.Canvas(self.modifiertab) + + modifierFrame = ttk.Frame(canvas) + modifierFrame.grid(row=0, column=0, columnspan=1, padx=10, pady=10, sticky=E+W+N+S) + + # ELEMENT CREATION + # Files display + self.modifierFilesList = StringVar(value=[]) + modifierFilesFrame = ttk.Frame(modifierFrame) + modifierFilesFrame.grid(row=0, column=0, sticky=N+E+W+S) + ttk.Label(modifierFilesFrame, text="Collections", font=self.font).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.modifierFiles = Listbox(modifierFilesFrame, listvariable=self.modifierFilesList, font=self.fontText) + self.modifierFiles.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.modifierFiles.bind("<>", self._modifierLoadCollection) + Button(modifierFilesFrame, text="-", command=self.delModifierFile, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(modifierFilesFrame, text="+", command=self.newModifierFile, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + modifierFilesFrame.rowconfigure(1, weight=1) + modifierFilesFrame.columnconfigure(0, weight=1) + modifierFilesFrame.columnconfigure(1, weight=1) + + # Modifier List Display + self.currentModifiersList = StringVar(value=[]) + seperator = ttk.Separator(modifierFrame, orient=VERTICAL) + seperator.grid(row=0, column=1, stick=N+S) + modifiersListFrame = Frame(modifierFrame) + modifiersListFrame.grid(row=0, column=2, sticky=N+E+W+S) + + ttk.Label(modifiersListFrame, text="Modifiers", font=self.font ).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.modifierList = Listbox(modifiersListFrame, listvariable=self.currentModifiersList, font=self.fontText) + self.modifierList.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.modifierList.bind("<>", self._modifierLoadModifier) + Button(modifiersListFrame, text="-", command=self.delSelectedModifier, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(modifiersListFrame, text="+", command=self.newModifier, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + modifiersListFrame.rowconfigure(1, weight=1) + modifiersListFrame.columnconfigure(0, weight=1) + modifiersListFrame.columnconfigure(1, weight=1) + + # Modifier data display + seperator = ttk.Separator(modifierFrame, orient=VERTICAL) + seperator.grid(row=0, column=3, stick=N+S) + modifierDataFrame = ttk.Frame(modifierFrame) + modifierDataFrame.grid(row=0, column=4, sticky=N+E+W+S) + + ttk.Label(modifierDataFrame, text="Modifier ID", font=self.fontBold).grid(row=0, column=0, padx=10, pady=5, sticky=E) + ttk.Label(modifierDataFrame, text="Name", font=self.fontBold).grid(row=1, column=0, padx=10, pady=5, sticky=E) + ttk.Label(modifierDataFrame, text="Description", font=self.fontBold).grid(row=2, column=0, padx=10, pady=5, sticky=E) + ttk.Label(modifierDataFrame, text="Effect", font=self.fontBold).grid(row=3, column=0, padx=10, pady=5, sticky=E) + ttk.Label(modifierDataFrame, text="Strength", font=self.fontBold).grid(row=4, column=0, padx=10, pady=5, sticky=E+N) + + self.modId = Entry(modifierDataFrame, font=self.fontText) + self.modName = Text(modifierDataFrame, height=3, font=self.fontText) + self.modDesc = Text(modifierDataFrame, height=3, font=self.fontText) + self.modEffect = Entry(modifierDataFrame, font=self.fontText) + self.modStrength = Entry(modifierDataFrame, font=self.fontText) + saveModifier = Button(modifierDataFrame, text="Save", command=self.saveModifier, font=self.font) + + self.modId.grid(row=0, column=1, columnspan=1, padx=10, pady=5, sticky=E+W) + self.modName.grid(row=1, column=1, columnspan=1, padx=10, pady=5, sticky=N+S+E+W) + self.modDesc.grid(row=2, column=1, columnspan=1, padx=10, pady=5, sticky=N+S+E+W) + self.modEffect.grid(row=3, column=1, columnspan=1, padx=10, pady=5, sticky=E+W) + self.modStrength.grid(row=4, column=1, columnspan=1, padx=10, pady=5, sticky=N+E+W) + saveModifier.grid(row=5, column=0, columnspan=2, sticky=E+W) + # self.packName.insert(END, self.metaFileData["name"]) + + self.modName.configure(wrap='none') + self.modDesc.configure(wrap='none') + + modifierDataFrame.columnconfigure(1, weight=1) + modifierDataFrame.rowconfigure(1, weight=1) + modifierDataFrame.rowconfigure(2, weight=1) + + + # FINISHING TOUCHES + canvas.create_window((0, 0), window=modifierFrame, anchor="nw") + canvas.pack(side="left", fill="both", expand=True) + + modifierFrame.rowconfigure(0, weight=1) + modifierFrame.columnconfigure(0, weight=1, minsize=200) + modifierFrame.columnconfigure(1, weight=0) + modifierFrame.columnconfigure(2, weight=1, minsize=200) + modifierFrame.columnconfigure(3, weight=0) + modifierFrame.columnconfigure(4, weight=10) + + modifierFrame.pack(expand=1, fill="both") + + self.modifierInitialLoad() + + def create_enemiestab(self): + self.enemytab = ttk.Frame(self.tabControl) + self.tabControl.add(self.enemytab, text = " Enemies ") + + enemyFrame = ttk.Frame(self.enemytab) + enemyFrame.grid(row=0, column=0, columnspan=1, padx=0, pady=0, sticky=E+W+N+S) + + # ELEMENT CREATION + # Files display + self.enemyFileList = StringVar(value=[]) + enemyFileFrame = ttk.Frame(enemyFrame) + enemyFileFrame.grid(row=0, column=0, rowspan=2, sticky=N+E+W+S) + ttk.Label(enemyFileFrame, text="Enemies", font=self.font).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.enemyFiles = Listbox(enemyFileFrame, listvariable=self.enemyFileList, font=self.fontText) + self.enemyFiles.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.enemyFiles.bind("<>", self._enemyLoadSelection) + Button(enemyFileFrame, text="-", command=self.delEnemy, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(enemyFileFrame, text="+", command=self.newEnemy, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + ttk.Separator(enemyFrame, orient=VERTICAL).grid(row=0, column=1, columnspan=1, sticky=N+S) + + enemyFileFrame.rowconfigure(1, weight=1) + enemyFileFrame.columnconfigure(0, weight=1) + enemyFileFrame.columnconfigure(1, weight=1) + + enemyFrame.rowconfigure(0, weight=1) + enemyFrame.columnconfigure(0, weight=1, minsize=200) + enemyFrame.columnconfigure(1, weight=0) + enemyFrame.columnconfigure(2, weight=5) + + # Sub Tabs setup + + enemyTabs = ttk.Notebook(enemyFrame) + enemyTabs.grid(row=0, column=2, sticky=N+S+E+W) + + enemyDataTab = ttk.Frame(self.enemytab) + enemyTabs.add(enemyDataTab, text = " Required Data ") + enemyOptionalTab = ttk.Frame(self.enemytab) + enemyTabs.add(enemyOptionalTab, text = " Optional Data ") + enemyVarTab = ttk.Frame(self.enemytab) + enemyTabs.add(enemyVarTab, text = " Variables ") + + # Enemy Data subtab + + enemyDataFrame = ttk.Frame(enemyDataTab) + + ttk.Label(enemyDataFrame, text="Enemy ID", font=self.fontBold).grid(row=0, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Enemy Type ID", font=self.fontBold).grid(row=1, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Name", font=self.fontBold).grid(row=2, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Description", font=self.fontBold).grid(row=3, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Death Message", font=self.fontBold).grid(row=4, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Health", font=self.fontBold).grid(row=5, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Damage", font=self.fontBold).grid(row=5, column=2, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Possible Weapons", font=self.fontBold).grid(row=6, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyDataFrame, text="Possible Armors", font=self.fontBold).grid(row=7, column=0, padx=10, pady=5, sticky=E) + + self.enemyId = Entry(enemyDataFrame, font=self.fontText) + self.enemyGroupId = Entry(enemyDataFrame, font=self.fontText) + self.enemyName = Text(enemyDataFrame, height=3, font=self.fontText) + self.enemyDesc = Text(enemyDataFrame, height=3, font=self.fontText) + self.enemyDeathMsg = Text(enemyDataFrame, height=3, font=self.fontText) + self.enemyHP = Entry(enemyDataFrame, font=self.fontText) + self.enemyDMG = Entry(enemyDataFrame, font=self.fontText) + self.enemyWeapons = Text(enemyDataFrame, height=3, font=self.fontText) + self.enemyArmors = Text(enemyDataFrame, height=3, font=self.fontText) + + self.enemyId.grid(row=0, column=1, columnspan=2, padx=0, pady=5, sticky=W+E) + self.enemyGroupId.grid(row=1, column=1, columnspan=2, padx=0, pady=5, sticky=W+E) + self.enemyName.grid(row=2, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W) + self.enemyDesc.grid(row=3, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W+E) + self.enemyDeathMsg.grid(row=4, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W+E) + self.enemyHP.grid(row=5, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.enemyDMG.grid(row=5, column=3, columnspan=1, padx=0, pady=5, sticky=W) + self.enemyWeapons.grid(row=6, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W) + self.enemyArmors.grid(row=7, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W) + + enemyDataFrame.columnconfigure(3, weight=1) + enemyDataFrame.rowconfigure(2, weight=1) + enemyDataFrame.rowconfigure(3, weight=1) + enemyDataFrame.rowconfigure(4, weight=1) + enemyDataFrame.rowconfigure(6, weight=1) + enemyDataFrame.rowconfigure(7, weight=1) + + # Enemy Optional Data + + enemyOptionalFrame = ttk.Frame(enemyOptionalTab) + + ttk.Label(enemyOptionalFrame, text="Mod Count", font=self.font).grid(row=0, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyOptionalFrame, text="Possible Modifiers", font=self.font).grid(row=1, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyOptionalFrame, text="Item Drop Chance", font=self.font).grid(row=2, column=0, padx=10, pady=5, sticky=E) + ttk.Label(enemyOptionalFrame, text="Item Drops", font=self.font).grid(row=3, column=0, padx=10, pady=5, sticky=E) + + self.enemyModCount = Entry(enemyOptionalFrame, font=self.fontText) + self.enemyMods = Text(enemyOptionalFrame, height=3, font=self.fontText) + self.enemyItemDropChance = Entry(enemyOptionalFrame, font=self.fontText) + self.enemyItemDrops = Text(enemyOptionalFrame, height=3, font=self.fontText) + + self.enemyModCount.grid(row=0, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.enemyMods.grid(row=1, column=1, columnspan=2, padx=0, pady=5, sticky=N+S+W) + self.enemyItemDropChance.grid(row=2, column=1, columnspan=2, padx=0, pady=5, sticky=W) + self.enemyItemDrops.grid(row=3, column=1, columnspan=2, padx=0, pady=5, sticky=N+S+W) + + enemyOptionalFrame.columnconfigure(3, weight=1) + enemyOptionalFrame.rowconfigure(1, weight=1) + enemyOptionalFrame.rowconfigure(3, weight=1) + + # Enemy Variable Tab + + enemyVarFrame = ttk.Frame(enemyVarTab) + enemyVarsListFrame = ttk.Frame(enemyVarFrame) + + enemyVarsListFrame.grid(row=0, column=0, columnspan=1, padx=0, pady=0, sticky=E+W+N+S) + + ttk.Label(enemyVarsListFrame, text="Variables", font=self.font).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.enemyFiles = Listbox(enemyVarsListFrame, listvariable=self.enemyFileList, font=self.fontText) + self.enemyFiles.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.enemyFiles.bind("<>", self._enemyLoadSelection) + Button(enemyVarsListFrame, text="-", command=self.delEnemy, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(enemyVarsListFrame, text="+", command=self.newEnemy, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + ttk.Separator(enemyVarFrame, orient=VERTICAL).grid(row=0, column=1, columnspan=1, sticky=N+S) + + enemyVarsListFrame.rowconfigure(1, weight=1) + enemyVarsListFrame.columnconfigure(0, weight=1) + enemyVarsListFrame.columnconfigure(1, weight=1) + + # Variable Data Sub-frame + variableDataFrame = ttk.Frame(enemyVarFrame) + variableDataFrame.grid(row=0, column=2, sticky=N+S+E+W) + + ttk.Label(variableDataFrame, text="Name", font=self.fontBold).grid(row=0, column=0, columnspan=1, padx=5, pady=5, sticky=E) + ttk.Label(variableDataFrame, text="Type", font=self.fontBold).grid(row=1, column=0, columnspan=1, padx=5, pady=5, sticky=E) + ttk.Label(variableDataFrame, text="Value", font=self.fontBold).grid(row=2, column=0, columnspan=1, padx=5, pady=5, sticky=E) + + self.enemyVarName = Entry(variableDataFrame, font=self.fontText) + self.enemyVarType = Entry(variableDataFrame, font=self.fontText) + self.enemyVarValue = Text(variableDataFrame, height=3, font=self.fontText) + + self.enemyVarName.grid(row=0, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.enemyVarType.grid(row=1, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.enemyVarType.insert(END, "choose") + self.enemyVarType.configure(state=DISABLED) + self.enemyVarValue.grid(row=2, column=1, columnspan=2, padx=0, pady=5, sticky=N+S+W+E) + + variableDataFrame.rowconfigure(2, weight=1) + variableDataFrame.columnconfigure(2, weight=1) + + enemyVarFrame.rowconfigure(0, weight=1) + enemyVarFrame.columnconfigure(0, weight=1, minsize=100) + enemyVarFrame.columnconfigure(1, weight=0) + enemyVarFrame.columnconfigure(2, weight=5) + + # Finishing Touches + + Button(enemyFrame, text="Save", command=self.saveEnemy, font=self.font).grid(row=1, column=1, columnspan=4, sticky=N+E+W+S) + + self.enemytab.rowconfigure(0, weight=1) + self.enemytab.columnconfigure(0, weight=1) + + enemyDataFrame.pack(expand=1, fill=BOTH) + enemyOptionalFrame.pack(expand=1, fill=BOTH) + enemyVarFrame.pack(expand=1, fill=BOTH) + + def create_weaponstab(self): + self.weapontab = ttk.Frame(self.tabControl) + self.tabControl.add(self.weapontab, text = " Weapons ") + + weaponFrame = ttk.Frame(self.weapontab) + weaponFrame.grid(row=0, column=0, columnspan=1, padx=0, pady=0, sticky=E+W+N+S) + + # ELEMENT CREATION + # Files display + self.weaponFileList = StringVar(value=[]) + weaponFileFrame = ttk.Frame(weaponFrame) + weaponFileFrame.grid(row=0, column=0, sticky=N+E+W+S) + ttk.Label(weaponFileFrame, text="Weapons", font=self.font).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.weaponFiles = Listbox(weaponFileFrame, listvariable=self.weaponFileList, font=self.fontText) + self.weaponFiles.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.weaponFiles.bind("<>", self._weaponLoadSelection) + Button(weaponFileFrame, text="-", command=self.delWeapon, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(weaponFileFrame, text="+", command=self.newWeapon, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + ttk.Separator(weaponFrame, orient=VERTICAL).grid(row=0, column=1, columnspan=1, sticky=N+S) + + weaponFileFrame.rowconfigure(1, weight=1) + weaponFileFrame.columnconfigure(0, weight=1) + weaponFileFrame.columnconfigure(1, weight=1) + + # Data display + weaponDataFrame = ttk.Frame(weaponFrame) + weaponDataFrame.grid(row=0, column=2, sticky=N+E+W+S) + + ttk.Label(weaponDataFrame, text="Weapon ID", font=self.fontBold).grid(row=0, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Name", font=self.fontBold).grid(row=1, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Description", font=self.fontBold).grid(row=2, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Action Text", font=self.fontBold).grid(row=3, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Damage", font=self.fontBold).grid(row=4, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Num Hands", font=self.font).grid(row=4, column=2, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Min Worth", font=self.font).grid(row=5, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Max Worth", font=self.font).grid(row=5, column=2, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Mod Chance", font=self.font).grid(row=6, column=0, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Mod Count", font=self.font).grid(row=6, column=2, padx=10, pady=5, sticky=E) + ttk.Label(weaponDataFrame, text="Mods", font=self.font).grid(row=7, column=0, padx=10, pady=5, sticky=E) + + self.wepId = Entry(weaponDataFrame, font=self.fontText) + self.wepName = Text(weaponDataFrame, height=3, font=self.fontText) + self.wepDesc = Text(weaponDataFrame, height=3, font=self.fontText) + self.wepActionText = Text(weaponDataFrame, height=3, font=self.fontText) + self.wepDmg = Entry(weaponDataFrame, font=self.fontText) + self.wepHand = Entry(weaponDataFrame, font=self.fontText) + self.wepWorMin = Entry(weaponDataFrame, font=self.fontText) + self.wepWorMax = Entry(weaponDataFrame, font=self.fontText) + self.wepModChance = Entry(weaponDataFrame, font=self.fontText) + self.wepModCnt = Entry(weaponDataFrame, font=self.fontText) + self.wepMods = Text(weaponDataFrame, height=3, font=self.fontText) + + self.wepId.grid(row=0, column=1, columnspan=2, padx=0, pady=5, sticky=W+E) + self.wepName.grid(row=1, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W) + self.wepDesc.grid(row=2, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W+E) + self.wepActionText.grid(row=3, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W+E) + self.wepDmg.grid(row=4, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.wepHand.grid(row=4, column=3, columnspan=1, padx=0, pady=5, sticky=W) + self.wepWorMin.grid(row=5, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.wepWorMax.grid(row=5, column=3, columnspan=1, padx=0, pady=5, sticky=W) + self.wepModChance.grid(row=6, column=1, columnspan=1, padx=0, pady=5, sticky=W) + self.wepModCnt.grid(row=6, column=3, columnspan=1, padx=0, pady=5, sticky=W) + self.wepMods.grid(row=7, column=1, columnspan=3, padx=0, pady=5, sticky=N+S+W+N) + + Button(weaponDataFrame, text="Save", command=self.saveWeapon, font=self.font).grid(row=8, column=0, columnspan=4, sticky=N+E+W+S) + + weaponDataFrame.rowconfigure(1, weight=1) + weaponDataFrame.rowconfigure(2, weight=1) + weaponDataFrame.rowconfigure(3, weight=1) + weaponDataFrame.rowconfigure(7, weight=1) + weaponDataFrame.columnconfigure(3, weight=1) + + weaponFrame.rowconfigure(0, weight=1) + weaponFrame.columnconfigure(0, weight=1, minsize=200) + weaponFrame.columnconfigure(1, weight=0) + weaponFrame.columnconfigure(2, weight=5) + + self.weapontab.rowconfigure(0, weight=1) + self.weapontab.columnconfigure(0, weight=1) + + self.weaponInitialLoad() + + def create_areastab(self): + self.areatab = ttk.Frame(self.tabControl) + self.tabControl.add(self.areatab, text = " Areas ") + + areaFrame = ttk.Frame(self.areatab) + areaFrame.grid(row=0, column=0, columnspan=1, padx=0, pady=0, sticky=E+W+N+S) + + # ELEMENT CREATION + # Files display + self.areaFileList = StringVar(value=[]) + areaFileFrame = ttk.Frame(areaFrame) + areaFileFrame.grid(row=0, column=0, rowspan=2, sticky=N+E+W+S) + ttk.Label(areaFileFrame, text="Areas", font=self.font).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.areaFiles = Listbox(areaFileFrame, listvariable=self.areaFileList, font=self.fontText) + self.areaFiles.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.areaFiles.bind("<>", self._areaLoadSelection) + Button(areaFileFrame, text="-", command=self.delArea, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(areaFileFrame, text="+", command=self.newArea, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + ttk.Separator(areaFrame, orient=VERTICAL).grid(row=0, column=1, columnspan=1, sticky=N+S) + + areaFileFrame.rowconfigure(1, weight=1) + areaFileFrame.columnconfigure(0, weight=1) + areaFileFrame.columnconfigure(1, weight=1) + + areaFrame.rowconfigure(0, weight=1) + areaFrame.columnconfigure(0, weight=1, minsize=200) + areaFrame.columnconfigure(1, weight=0) + areaFrame.columnconfigure(2, weight=5) + + # Sub Tabs setup + + areaTabs = ttk.Notebook(areaFrame) + areaTabs.grid(row=0, column=2, sticky=N+S+E+W) + + areaDataTab = ttk.Frame(self.areatab) + areaTabs.add(areaDataTab, text = " Info ") + areaEnemyTab = ttk.Frame(self.areatab) + areaTabs.add(areaEnemyTab, text = " Enemies ") + areaEventsTab = ttk.Frame(self.areatab) + areaTabs.add(areaEventsTab, text = " Events ") + areaOtherTab = ttk.Frame(self.areatab) + areaTabs.add(areaOtherTab, text = " Exits ") + enemyVarTab = ttk.Frame(self.areatab) + areaTabs.add(enemyVarTab, text = " Variables ") + + # Finishing Touches + + Button(areaFrame, text="Save", command=self.saveArea, font=self.font).grid(row=1, column=1, columnspan=4, sticky=N+E+W+S) + + self.areatab.rowconfigure(0, weight=1) + self.areatab.columnconfigure(0, weight=1) + + # areaDataFrame.pack(expand=1, fill=BOTH) + # areaOptionalFrame.pack(expand=1, fill=BOTH) + # areaVarFrame.pack(expand=1, fill=BOTH) + + def create_armorstab(self): + self.armortab = ttk.Frame(self.tabControl) + self.tabControl.add(self.armortab, text = " Armors ") + + def create_eventstab(self): + self.eventtab = ttk.Frame(self.tabControl) + self.tabControl.add(self.eventtab, text = " Events ") + + eventFrame = ttk.Frame(self.eventtab) + eventFrame.grid(row=0, column=0, columnspan=1, padx=0, pady=0, sticky=E+W+N+S) + + # ELEMENT CREATION + # Files display + self.eventFileList = StringVar(value=[]) + eventFileFrame = ttk.Frame(eventFrame) + eventFileFrame.grid(row=0, column=0, rowspan=2, sticky=N+E+W+S) + ttk.Label(eventFileFrame, text="Areas", font=self.font).grid(row=0, column=0, columnspan=2, padx=5, pady=5, sticky=N+S+W+E) + self.eventFiles = Listbox(eventFileFrame, listvariable=self.eventFileList, font=self.fontText) + self.eventFiles.grid(row=1, column=0, columnspan=2, sticky=N+S+W+E) + self.eventFiles.bind("<>", self._eventLoadSelection) + Button(eventFileFrame, text="-", command=self.delEvent, font=self.font).grid(row=2, column=0, sticky=N+S+W+E) + Button(eventFileFrame, text="+", command=self.newEvent, font=self.font).grid(row=2, column=1, sticky=N+S+W+E) + + ttk.Separator(eventFrame, orient=VERTICAL).grid(row=0, column=1, columnspan=1, sticky=N+S) + + eventFileFrame.rowconfigure(1, weight=1) + eventFileFrame.columnconfigure(0, weight=1) + eventFileFrame.columnconfigure(1, weight=1) + + eventFrame.rowconfigure(0, weight=1) + eventFrame.columnconfigure(0, weight=1, minsize=200) + eventFrame.columnconfigure(1, weight=0) + eventFrame.columnconfigure(2, weight=5) + + # Sub Tabs setup + + eventTabs = ttk.Notebook(eventFrame) + eventTabs.grid(row=0, column=2, sticky=N+S+E+W) + + eventDataTab = ttk.Frame(self.eventtab) + eventTabs.add(eventDataTab, text = " Info ") + eventActionsTab = ttk.Frame(self.eventtab) + eventTabs.add(eventActionsTab, text = " Actions ") + + # Finishing Touches + + Button(eventFrame, text="Save", command=self.saveEvent, font=self.font).grid(row=1, column=1, columnspan=4, sticky=N+E+W+S) + + self.eventtab.rowconfigure(0, weight=1) + self.eventtab.columnconfigure(0, weight=1) + + # areaDataFrame.pack(expand=1, fill=BOTH) + # areaOptionalFrame.pack(expand=1, fill=BOTH) + # areaVarFrame.pack(expand=1, fill=BOTH) + + def create_misctab(self): + self.misctab = ttk.Frame(self.tabControl) + self.tabControl.add(self.misctab, text = " Misc ") + + def create_npcstab(self): + self.npcstab = ttk.Frame(self.tabControl) + self.tabControl.add(self.npcstab, text = " NPCs ") + + def create_queststab(self): + self.queststab = ttk.Frame(self.tabControl) + self.tabControl.add(self.queststab, text = " Quests ") + + def create_racestab(self): + self.racetab = ttk.Frame(self.tabControl) + self.tabControl.add(self.racetab, text = " Races ") + + def _close_button_event(self): + self.window_is_open = False + self.master.destroy() + + def newFile(self): + pass + + def openFile(self): + pass + + def savePack(self): + packType = self.packType.get() + packVers = self.packVers.get() + + self.metaFileData["name"] = self.packName.get() + self.metaFileData["author"] = self.packAuth.get() + self.metaFileData["desc"] = self.packDesc.get() + self.metaFileData["packType"] = self.packType.get() + try: + version = self.packVers.get() + version = float(version) + self.metaFileData["version"] = version + except: + pass + self.metaFileData["gameDesc"] = self.metadataGameDescGet() + + saveJson(self.fileLoc+"/meta.json", self.metaFileData) + + + def saveModifier(self): + currentModifierData = {} + currentModifierData["name"] = self.modifierGetModName() + currentModifierData["desc"] = self.modifierGetModDesc() + currentModifierData["effect"] = self.modEffect.get() + currentModifierData["strength"] = self.modStrength.get() + currentModifierId = list(self.currentOpenCollection.keys())[self.selectedModifier] + newModifierID = self.modId.get() + if (currentModifierId != newModifierID): + self.currentOpenCollection[newModifierID] = currentModifierData + del self.currentOpenCollection[currentModifierId] + else: + self.currentOpenCollection[newModifierID] = currentModifierData + modifierFiles = self.metaFileData["modifiers"] + saveJson(self.fileLoc+"/modifiers/"+modifierFiles[self.selectedModFile]+".json", self.currentOpenCollection) + self.modifierLoadCollection(self.selectedModFile) + self.selectedModifier = list(self.currentOpenCollection.keys()).index(newModifierID) + self.modifierLoadModifier(self.selectedModifier) + + def menuHelp(self): + pass + + def menuAbout(self): + pass + + def _enemyLoadSelection(self, *args): + pass + + def _areaLoadSelection(self, *args): + pass + + def _eventLoadSelection(self, *args): + pass + + def delEnemy(self): + pass + + def newEnemy(self): + pass + + def saveEnemy(self): + pass + + def delArea(self): + pass + + def newArea(self): + pass + + def saveArea(self): + pass + + def delEvent(self): + pass + + def newEvent(self): + pass + + def saveEvent(self): + pass + + def newModifierFile(self): + newfilename = simpledialog.askstring("Modifier Collection Name", "Enter new modifier collection name", parent=self.master) + if (newfilename): + newfilename = newfilename.strip() + if (newfilename and newfilename not in self.metaFileData["modifiers"]): + saveJson(self.fileLoc+"/modifiers/"+newfilename+".json", {}) + self.metaFileData["modifiers"].append(newfilename) + self.metaFileData["modifiers"] = sorted(self.metaFileData["modifiers"]) + saveJson(self.fileLoc+"/meta.json", self.metaFileData) + self.modifierLoadCollection(self.metaFileData["modifiers"].index(newfilename)) + + + def delModifierFile(self): + confirmation = messagebox.askokcancel("Confirm Delete", "Are you sure you want to delete the current Modifier Collection? All modifiers in this collection will be deleted.\ + \nThis cannot be undone.") + if (confirmation): + collectionId = self.metaFileData["modifiers"].pop(self.selectedModFile) + os.remove(self.fileLoc+"/modifiers/"+collectionId+".json") + saveJson(self.fileLoc+"/meta.json", self.metaFileData) + self.modifierLoadCollection(0) + + def delSelectedModifier(self): + if (len(list(self.currentOpenCollection.keys())) > 0): + confirmation = messagebox.askokcancel("Confirm Delete", "Are you sure you want to delete the current Modifier?\ + \nThis cannot be undone.") + if (confirmation): + currentModifierId = list(self.currentOpenCollection.keys())[self.selectedModifier] + del self.currentOpenCollection[currentModifierId] + modifierFiles = self.metaFileData["modifiers"] + saveJson(self.fileLoc+"/modifiers/"+modifierFiles[self.selectedModFile]+".json", self.currentOpenCollection) + self.modifierLoadCollection(self.selectedModFile) + + def newModifier(self): + newModId = "UNNAMEDMODIFIER" + if (newModId not in list(self.currentOpenCollection.keys())): + newModifierData = { + "name":[], + "desc":[], + "effect":"", + "strength":"" + } + self.currentOpenCollection[newModId] = newModifierData + modifierFiles = self.metaFileData["modifiers"] + saveJson(self.fileLoc+"/modifiers/"+modifierFiles[self.selectedModFile]+".json", self.currentOpenCollection) + self.modifierLoadCollection(self.selectedModFile) + self.selectedModifier = list(self.currentOpenCollection.keys()).index(newModId) + + + def metadataGameDescFill(self): + self.gameDesc.delete('1.0', END) + lines = copy.copy(self.metaFileData["gameDesc"]) + self.gameDesc.insert(END, "{}".format(lines.pop(0))) + for line in lines: + self.gameDesc.insert(END, "\n{}".format(line)) + + def metadataGameDescGet(self): + lines = self.gameDesc.get('1.0',END).split("\n") + return [line for line in lines if line.strip()] + + def modifierInitialLoad(self): + self.modifierLoadCollection(0) + + def _modifierLoadCollection(self, *args): + if len(self.modifierFiles.curselection()) == 1: + idx = self.modifierFiles.curselection()[0] + if (idx != self.selectedModFile): + self.modifierLoadCollection(idx) + + def modifierLoadCollection(self, idx): + self.selectedModFile = idx + + modifierFiles = self.metaFileData["modifiers"] + self.currentOpenCollection = dict(sorted(loadJson(self.fileLoc+"/modifiers/"+modifierFiles[self.selectedModFile]+".json").items())) + + self.modifierFilesList.set(modifierFiles) + self.modifierFiles.selection_clear(0, END) + self.modifierFiles.selection_set(self.selectedModFile) + self.modifierFiles.see(self.selectedModFile) + + self.modifierLoadModifier(0) + + def _modifierLoadModifier(self, *args): + if len(self.modifierList.curselection()) == 1: + idx = self.modifierList.curselection()[0] + if (idx != self.selectedModifier): + self.modifierLoadModifier(idx) + + def modifierLoadModifier(self, idx): + self.selectedModifier = idx + + self.currentModifiersList.set(list(self.currentOpenCollection.keys())) + self.modifierList.selection_clear(0, END) + self.modifierList.selection_set(self.selectedModifier) + self.modifierList.see(self.selectedModifier) + + currentModifier = list(self.currentOpenCollection.keys())[self.selectedModifier] + self.modId.delete(0, END) + self.modId.insert(END, currentModifier) + self.modifierSetModNameField(copy.copy(self.currentOpenCollection[currentModifier]["name"])) + self.modifierSetModDescField(copy.copy(self.currentOpenCollection[currentModifier]["desc"])) + self.modEffect.delete(0, END) + self.modEffect.insert(END, self.currentOpenCollection[currentModifier]["effect"]) + self.modStrength.delete(0, END) + self.modStrength.insert(END, self.currentOpenCollection[currentModifier]["strength"]) + + def modifierSetModNameField(self, lines): + self.modName.delete("1.0", END) + if (len(lines)>=1): + self.modName.insert(END, lines.pop(0)) + for line in lines: + self.modName.insert(END, "\n" + line) + + def modifierGetModName(self): + lines = self.modName.get('1.0',END).split("\n") + return [line for line in lines if line.strip()] + + def modifierSetModDescField(self, lines): + self.modDesc.delete("1.0", END) + if (len(lines)>=1): + self.modDesc.insert(END, lines.pop(0)) + for line in lines: + self.modDesc.insert(END, "\n" + line) + + def modifierGetModDesc(self): + lines = self.modDesc.get('1.0',END).split("\n") + return [line for line in lines if line.strip()] + + def weaponInitialLoad(self): + self.weaponLoadSelection(0) + + def _weaponLoadSelection(self, *args): + if (len(self.weaponFiles.curselection()) == 1): + idx = self.weaponFiles.curselection()[0] + if (idx != self.selectedWeapon): + self.weaponLoadSelection(idx) + + def weaponLoadSelection(self, idx): + self.selectedWeapon = idx + weaponFiles = self.metaFileData["weapons"] + self.weaponFileList.set(weaponFiles) + self.wepId.delete(0,END) + self.wepId.insert(0, weaponFiles[self.selectedWeapon]) + self.currentWeapon = loadJson(self.fileLoc+"/weapons/"+weaponFiles[self.selectedWeapon]+".json") + self.weaponSetNameField(self.currentWeapon["name"]) + self.weaponSetDescField(self.currentWeapon["desc"]) + self.weaponSetActionField(self.currentWeapon["actionText"]) + self.wepDmg.delete(0,END) + self.wepDmg.insert(0, self.currentWeapon["damage"]) + self.wepHand.delete(0,END) + if ("requiredHands" in self.currentWeapon.keys()): + self.wepHand.insert(0, self.currentWeapon["requiredHands"]) + self.wepWorMin.delete(0,END) + if ("worthMin" in self.currentWeapon.keys()): + self.wepWorMin.insert(0, self.currentWeapon["worthMin"]) + self.wepWorMax.delete(0,END) + if ("worthMax" in self.currentWeapon.keys()): + self.wepWorMax.insert(0, self.currentWeapon["worthMax"]) + self.wepModChance.delete(0,END) + if ("modifierChance" in self.currentWeapon.keys()): + self.wepModChance.insert(0, self.currentWeapon["modifierChance"]) + self.wepModCnt.delete(0,END) + if ("modifierCount" in self.currentWeapon.keys()): + self.wepModCnt.insert(0, self.currentWeapon["modifierCount"]) + if ("modifiers" in self.currentWeapon.keys()): + self.weaponSetModField(self.currentWeapon["modifiers"]) + else: + self.weaponSetModField([]) + + + def saveWeapon(self): + wepId = self.wepId.get().strip() + + self.currentWeapon = {} + self.currentWeapon["name"] = self.weaponGetNameField() + self.currentWeapon["damage"] = self.wepDmg.get() + self.currentWeapon["desc"] = self.weaponGetDescField() + self.currentWeapon["actionText"] = self.weaponGetActionField() + if (self.wepModCnt.get().strip()): + self.currentWeapon["modifierCount"] = self.wepModCnt.get().strip() + self.currentWeapon["modifiers"] = self.weaponGetModField() + if (self.wepModChance.get.strip()): + try: + self.currentWeapon["modifierChance"] = int(self.wepModChance.get.strip()) + except: + pass + if (self.wepWorMin.get().strip()): + try: + self.currentWeapon["worthMin"] = int(self.wepWorMin.get().strip()) + except: + pass + if (self.wepWorMax.get().strip()): + try: + self.currentWeapon["worthMax"] = int(self.wepWorMax.get().strip()) + except: + pass + if (self.wepHand.get().strip()): + try: + self.currentWeapon["requiredHands"] = int(self.wepHand.get().strip()) + except: + pass + + # Check if weapon ID changed, update if needed + if (wepId != self.metaFileData["weapons"][self.selectedWeapon]): + oldID = self.metaFileData["weapons"].pop(self.selectedWeapon) + self.metaFileData["weapons"].append(wepId) + self.metaFileData["weapons"] = sorted(self.metaFileData["weapons"]) + self.selectedWeapon = self.metaFileData["weapons"].index(wepId) + os.remove("{}/weapons/{}.json".format(self.fileLoc, oldID)) + saveJson("{}/weapons/{}.json".format(self.fileLoc, wepId), self.currentWeapon) + self.weaponLoadSelection(self.selectedWeapon) + + def delWeapon(self): + weaponId = self.metaFileData["weapons"][self.selectedWeapon] + confirmation = messagebox.askokcancel("Confirm Delete", "Are you sure you want to delete %s?\ + \nThis cannot be undone." % (weaponId)) + if (confirmation): + self.metaFileData["weapons"].pop(self.selectedWeapon) + saveJson(self.fileLoc+"/meta.json", self.metaFileData) + os.remove("{}/weapons/{}.json".format(self.fileLoc, weaponId)) + self.weaponLoadSelection(0) + + def newWeapon(self): + newfilename = simpledialog.askstring("New Weapon ID", "Enter new modifier collection name", parent=self.master) + if (newfilename): + newfilename = newfilename.strip() + if (newfilename and newfilename not in self.metaFileData["weapons"]): + newWeaponData = { + "name":[], + "desc":[], + "damage":[], + "actionText":[] + } + saveJson(self.fileLoc+"/weapons/"+newfilename+".json", newWeaponData) + self.metaFileData["weapons"].append(newfilename) + self.metaFileData["weapons"] = sorted(self.metaFileData["weapons"]) + saveJson(self.fileLoc+"/meta.json", self.metaFileData) + idx = self.metaFileData["weapons"].index(newfilename) + self.weaponLoadSelection(idx) + + def weaponSetNameField(self, lines): + self.wepName.delete("1.0", END) + if (len(lines)>=1): + self.wepName.insert(END, lines.pop(0)) + for line in lines: + self.wepName.insert(END, "\n" + line) + + def weaponGetNameField(self): + lines = self.wepName.get('1.0',END).split("\n") + return [line for line in lines if line.strip()] + + def weaponSetDescField(self, lines): + self.wepDesc.delete("1.0", END) + if (len(lines)>=1): + self.wepDesc.insert(END, lines.pop(0)) + for line in lines: + self.wepDesc.insert(END, "\n" + line) + + def weaponGetDescField(self): + lines = self.wepDesc.get('1.0',END).split("\n") + return [line for line in lines if line.strip()] + + def weaponSetActionField(self, lines): + self.wepActionText.delete("1.0", END) + if (len(lines)>=1): + self.wepActionText.insert(END, lines.pop(0)) + for line in lines: + self.wepActionText.insert(END, "\n" + line) + + def weaponGetActionField(self): + lines = self.wepActionText.get('1.0',END).split("\n") + return [line for line in lines if line.strip()] + + def weaponSetModField(self, lines): + self.wepMods.delete("1.0", END) + if (len(lines)>=1): + m = lines.pop(0) + self.wepMods.insert(END, "{}, {}".format(m[0], m[1])) + for line in lines: + self.wepMods.insert(END, "\n{}, {}".format(line[0], line[1])) + + def weaponGetModField(self): + lines = self.wepMods.get('1.0',END).split("\n") + lines = [line for line in lines if line.strip()] + modsList = [] + for line in lines: + try: + line = line.split(",") + modEffect = line[0].strip() + modLiklihood = line[1].strip() + modsList.append([modEffect,modLiklihood]) + except: + pass + return modsList + +# Setup Constansts +RES_FOLDER = "res/" +SETTINGS_FILE = RES_FOLDER + "settings.json" + + +# Load settings file +settings = loadJson(SETTINGS_FILE) + + +# Get datapacks info +dataPackSettings = {} +for setting in settings["DATAPACKSETTINGS"].keys(): + dataPackSettings[setting] = settings["DATAPACKSETTINGS"][setting] + +allPacks = dataPackSettings["packsToLoad"] +initialDataPack = dataPackSettings["start"] + + +# Load metadata file +metaFile = "%s%s/meta.json" % (RES_FOLDER, initialDataPack) + +appWindow = MetaDataEditor(RES_FOLDER+initialDataPack, settings) +appWindow.initiate_window() + diff --git a/src/descriptorClass.py b/src/descriptorClass.py new file mode 100644 index 0000000..92628ce --- /dev/null +++ b/src/descriptorClass.py @@ -0,0 +1,12 @@ + +import random + + +class Descriptor(object): + def __init__(self): + self.descriptions = [] + + def getText(self, textId=None): + if textId == None: + textId = random.randint(0,len(self.descriptions)-1) + return "" \ No newline at end of file diff --git a/src/dieClass.py b/src/dieClass.py index d0cf6d0..4cdac69 100644 --- a/src/dieClass.py +++ b/src/dieClass.py @@ -15,9 +15,10 @@ def rollDice(dieRolls): elif "-" in dice: dice,bonus = dice.split("-") bonus = int(bonus) * -1 - numDice, diceSize = dice.split("d") - for i in range(int(numDice)): - total += multiplyer * random.randint(1,int(diceSize)) + if "d" in dice: + numDice, diceSize = dice.split("d") + for i in range(int(numDice)): + total += multiplyer * random.randint(1,int(diceSize)) total+=bonus else: total += 0 @@ -34,8 +35,9 @@ def maxRoll(dieRolls): elif "-" in dice: dice,bonus = dice.split("-") bonus= int(bonus) * -1 - numDice, diceSize = dice.split("d") - total += int(numDice) * int(diceSize) + int(bonus) + if "d" in dice: + numDice, diceSize = dice.split("d") + total += int(numDice) * int(diceSize) + int(bonus) if dice[0] == "-": dice = dice[1:] bonus = 0 @@ -45,8 +47,9 @@ def maxRoll(dieRolls): elif "-" in dice: dice,bonus = dice.split("-") bonus= int(bonus) * -1 - numDice, diceSize = dice.split("d") - total += int(numDice) * int(diceSize) + int(bonus) * -1 + if "d" in dice: + numDice, diceSize = dice.split("d") + total += int(numDice) * int(diceSize) + int(bonus) * -1 else: total += 0 return total \ No newline at end of file diff --git a/src/displayClass.py b/src/displayClass.py index 3f340c4..a9d57e3 100644 --- a/src/displayClass.py +++ b/src/displayClass.py @@ -27,14 +27,20 @@ def display(self, msg="", br=1, br2=0): if self.debugging: print(newline) self.currentLines.append(newline) - for line in textwrap.wrap(msg, 72): - if self.delay: - time.sleep(self.printdelay) - newline = "| {:75}|".format(line) - if self.debugging: - print(newline) - self.currentLines.append("| {:75}|".format(line)) - # print "| %-75s|" % (line) + pCount = 0 + for paragraph in msg.split("\n"): + if pCount >= 1: + newline = "|%s|" % (" "*78) + self.currentLines.append(newline) + for line in textwrap.wrap(paragraph, 72): + if self.delay: + time.sleep(self.printdelay) + newline = "| {:75}|".format(line) + if self.debugging: + print(newline) + self.currentLines.append("| {:75}|".format(line)) + # print "| %-75s|" % (line) + pCount += 1 if br2 == 1: time.sleep(self.printdelay) newline = "|%s|" % (" "*78) diff --git a/src/enemyClass.py b/src/enemyClass.py index d564903..993709b 100644 --- a/src/enemyClass.py +++ b/src/enemyClass.py @@ -18,25 +18,33 @@ def __init__(self, data, weapons, armor, misc, modifiers): self.xp = data["xp"] if data["weapon"]: self.weapon = generateWeapon( - weapons[random.choice(data["weapon"])]) + weapons[random.choice(data["weapon"])], modifiers) + # Adds modifiers to the enemy + self.modifiers = [] + if "modCount" in data.keys(): + numberOfMods = rollDice(data["modCount"]) + else: + numberOfMods = 0 if data["modifier"]: - # Calculates the chance for each mod - mods = [] - for mod in data["modifier"]: - mods += [mod[0]]*mod[1] - # Chooses a mod - mod = random.choice(mods) - # If the mod is not none add the info - if mod != "None": - mod = modifiers[mod].getInfo() - # modifies the enemy's name to match the effect - self.name = "%s %s" % (mod["n"], self.name) - # Gets into the mod's effects - if mod["e"] == "damage": - self.damage += ";%s" % (mod["s"]) - elif mod["e"] == "health": - self.hpMax += rollDice(mod["s"]) + for i in range(numberOfMods): + # Calculates the chance for each mod + mods = [] + for mod in data["modifier"]: + mods += [mod[0]]*mod[1] + # Chooses a mod + mod = random.choice(mods) + # If the mod is not none add the info + if mod != "None": + mod = modifiers[mod].getInfo() + # modifies the enemy's name to match the effect + self.name = "%s %s" % (mod["n"], self.name) + # Gets into the mod's effects + if mod["e"] == "damage": + self.damage += ";%s" % (mod["s"]) + elif mod["e"] == "health": + self.hpMax += rollDice(mod["s"]) + self.modifiers.append(mod) # Wait until modifiers are added to set the starting health self.hp = self.hpMax @@ -52,23 +60,36 @@ def __init__(self, data, weapons, armor, misc, modifiers): try: if self.itemDrop[0] in weapons.keys(): self.itemDrop[0] = generateWeapon( - weapons[self.itemDrop[0]]) + weapons[self.itemDrop[0]], modifiers) elif self.itemDrop[0] in armor.keys(): self.itemDrop[0] = Armor(armor[self.itemDrop[0]]) elif self.itemDrop[0] in misc.keys(): - self.itemDrop[0] = Misc(misc[self.itemDrop[0]]) - except: + self.itemDrop[0] = Misc(misc[self.itemDrop[0]], modifiers) + except Exception as e: print("Error loading {} item reward.".format(self.name)) + print(e) if self.xp < 1: self.xp = 1 + + def getAccuracy(self): + # TODO: Implement + return 100 + + def getDesc(self): + description = self.desc + for mod in self.modifiers: + if "d" in mod.keys() and random.random() > .5: + description = "{} {}".format(description, mod["d"]) + description = description.replace("$name", self.name) + return description def getHealth(self): return int(((1.0*self.hp)/self.hpMax)*68 + 0.5) def getWeaponDamage(self, rand=True): if self.weapon: - return rollDice(self.damage) + rollDice(self.weapon.damage) + return rollDice(self.damage) + self.weapon.getAttack() else: return rollDice(self.damage) diff --git a/src/eventClass.py b/src/eventClass.py index 217658b..4fbdba8 100644 --- a/src/eventClass.py +++ b/src/eventClass.py @@ -8,8 +8,9 @@ class Event(object): - def __init__(self, data): + def __init__(self, data, resourceId): self.id = data["id"] + self.resourceId = resourceId self.name = random.choice(data["name"]) self.eventType = data["type"] @@ -17,10 +18,18 @@ def __init__(self, data): self.msg = random.choice(data[self.start]["msg"]) self.actions = data[self.start]["actions"] + keys = data.keys() + self.parts = {} - for part in data.keys(): + for part in keys: if "#" in part: self.parts[part] = data[part] + + # Check if the event can be repeated (If not specified defaults to true) + if "isRepeatable" in keys: + self.isRepeatable = data["isRepeatable"] + else: + self.isRepeatable = True self.finished = False @@ -69,15 +78,21 @@ def takeItem(self, item, amount, player): if item == "gold": player.gold -= amount - def giveItem(self, itemId, amount, player, weapons, armor, misc): + def giveItem(self, itemId, amount, player, weapons, armor, misc, modifiers): if itemId == "gold": player.gold += amount + return True elif itemId in weapons.keys(): - player.inv.append(copy.copy(generateWeapon(weapons[itemId]))) + player.inv.append(copy.copy(generateWeapon(weapons[itemId], modifiers))) + return True elif itemId in armor.keys(): player.inv.append(copy.copy(Armor(armor[itemId]))) + return True elif itemId in misc.keys(): - player.inv.append(copy.copy(Misc(misc[itemId]))) + player.inv.append(copy.copy(Misc(misc[itemId], modifiers))) + return True + print("Item id '{}' not found".format(itemId)) + return False class Tag(object): def __init__(self, data): diff --git a/src/gameClass.py b/src/gameClass.py index e8ab51f..2f558ec 100644 --- a/src/gameClass.py +++ b/src/gameClass.py @@ -1,6 +1,5 @@ # Official Python module imports -import copy import random import time import os @@ -51,6 +50,9 @@ def __init__(self): self.areaController = None self.starter = None + self.nonRepeatableEvents = [] + self.globalRandomEvents = [] + self.logos = [] self.descs = [] @@ -89,6 +91,10 @@ def initialLoad(self, folder="res/", settingsdata={}): print("Loading pack \"{}\"...".format(pack)) self.packs[pack] = loadJson("%s%s/meta.json" % (folder, pack)) + if self.packs[pack]["packType"] == "standalone": + self.starterWeapon = random.choice(self.packs[pack]["startingWeapon"]) + self.starterArmor = random.choice(self.packs[pack]["startingArmor"]) + self.starterInventory = self.packs[pack]["startingInventory"] if "gameLogo" in self.packs[pack].keys(): self.logos.append(self.packs[pack]["gameLogo"]) @@ -134,9 +140,10 @@ def initialLoad(self, folder="res/", settingsdata={}): "%s%s/events/%s.json" % (folder, pack, e)) self.disp.dprint("Loaded asset %s" % e) for m in self.packs[pack]["modifiers"]: - mods = loadJson("%s%s/%s.json" % (folder, pack, m)) + mods = loadJson("%s%s/modifiers/%s.json" % (folder, pack, m)) for mod in mods.keys(): self.modifiers[mod] = Modifier(mod, mods[mod]) + self.disp.dprint("Loaded asset %s" % m) print("Finished loading assets.") # Adds all loaded quests into a list of possible quests, as well as @@ -146,6 +153,14 @@ def initialLoad(self, folder="res/", settingsdata={}): if DEBUG: for q in self.possibleQuests: self.disp.dprint(q) + + self.nonRepeatableEvents = [] + self.globalRandomEvents = [] + # Load the global random events: + for event in self.events.keys(): + if "globalEvent" in self.events[event].keys(): + if self.events[event]["globalEvent"]: + self.globalRandomEvents.append([event, self.events[event]["eventChance"]]) self.loadStartingArea() @@ -155,7 +170,7 @@ def initialLoad(self, folder="res/", settingsdata={}): self.loaded = True def loadStartingArea(self): - self.areaController = AreaController(self.areas, self.packs[self.starter]["startingArea"], (0, 0), self.weapons, self.armor, self.misc, self.enemies, self.npcs, self.events, self.modifiers) + self.areaController = AreaController(self.areas, random.choice(self.packs[self.starter]["startingArea"]), (0, 0), self.weapons, self.armor, self.misc, self.enemies, self.npcs, self.events, self.modifiers) ''' # TODO deprecate this loading function @@ -166,18 +181,38 @@ def loadStartingArea(self): ''' self.currentArea = self.areaController.loadArea((0,0)) - # Disables enemies in the first area. - self.currentArea.enemy = [] def loadPlayer(self): # TODO: Add player creation menu here self.player = Player() self.player.race = Race(self.races["human"]) + #self.player.race.limbs[0] = Limb(self.races["drakt"]["limbs"][0], "Draktilien") self.player.disp = self.disp - self.player.weapon = Weapon(self.weapons["weapon_ironSword"]) + + # Sets some defualt equipment to the player + ''' + self.player.weapon = Weapon(self.weapons["weapon_ironSword"], self.modifiers) self.player.armor = Armor(self.armor["armor_hideArmor"]) self.player.inv.append(generateWeapon( - self.weapons["template_IronSword"])) + self.weapons["template_IronSword"], self.modifiers)) + ''' + + self.player.weapon = generateWeapon(self.weapons[self.starterWeapon], self.modifiers) + self.player.armor = Armor(self.armor[self.starterArmor]) + + # Add all the extra inventory gear + for item in self.starterInventory: + newItem = None + if item in self.misc.keys(): + newItem = Misc(self.misc[item], self.modifiers) + elif item in self.weapons.keys(): + newItem = generateWeapon(self.weapons[item], self.modifiers) + elif item in self.armor.keys(): + newItem = Armor(self.armor[item]) + if newItem != None: + self.player.inv.append(newItem) + + self.player.gold = 100 self.loadStartingArea() self.player.hp = self.player.getMaxHP() @@ -224,11 +259,13 @@ def displayCurrentArea(self): self.disp.displayHeader(title) for desc in self.currentArea.desc.split("\n"): self.disp.display(desc) - print("|{}|".format(" " * 78)) # Display enemies that are in the area (if there are any) if self.currentArea.enemy != []: self.disp.closeDisplay() - self.disp.display("You can see enemies in the distance:", 1, 1) + enemyMessage = "You can see enemies in the distance:" + if self.currentArea.enemyMessage != None: + enemyMessage = self.currentArea.enemyMessage + self.disp.display(enemyMessage, 1, 1) for enemy in self.currentArea.enemy: self.disp.display(f'{enemy.name} (Danger - {enemy.getDanger()})', 0, 0) self.disp.closeDisplay() @@ -242,10 +279,6 @@ def reactCurrentArea(self): has occured within the game, such as enemies appearing, or quest objectives getting updated.''' - self.fightEnemies() - if self.player.quit: - return None - ##### Random event Code ##### if self.currentArea.event and self.gameSettings["DISABLEFLAVOREVENTS"] and self.currentArea.event.eventType == "flavor": self.currentArea.event = None @@ -286,8 +319,15 @@ def reactCurrentArea(self): self.currentArea.event.takeItem( action[1], action[2], self.player) elif action[0] == "give": - self.currentArea.event.giveItem(action[1], action[2], self.player, - self.weapons, self.armor, self.misc) + for i in range(action[2]): + result = self.currentArea.event.giveItem(action[1], action[2], self.player, + self.weapons, self.armor, self.misc, self.modifiers) + if self.settings["DEBUG"] and not result: + raise Exception("Something went wrong when processing an event's 'give' command.") + elif action[0] == "spawnEnemy": + for enemyid in action[1]: + self.currentArea.enemy.append(Enemy( + self.enemies[enemyid], self.weapons, self.armor, self.misc, self.modifiers)) elif action[0] == "finish": self.currentArea.event.finish() else: @@ -297,6 +337,10 @@ def reactCurrentArea(self): time.sleep(EVENTDELAY) #input("\nEnter to continue") self.disp.wait_for_enter() + + self.fightEnemies() + if self.player.quit: + return None ##### Interacting with an NPC Code ##### if self.currentArea.npc: @@ -314,7 +358,7 @@ def displayEventAction(self, message): def fightEnemies(self): ##### Fighting Code ##### - if self.currentArea.enemy != []: + if self.currentArea.enemy != [] and not self.gameSettings["DISABLEENEMIES"]: self.disp.clearScreen() for areaEnemy in self.currentArea.enemy: enemyhp = areaEnemy.getHealth() @@ -336,7 +380,7 @@ def fightEnemies(self): self.disp.displayHeader("Enemy Encountered - %s" % (areaEnemy.name)) self.disp.display("%s The enemy has a danger level of %d." % - (areaEnemy.desc, areaEnemy.getDanger()), 1, 1) + (areaEnemy.getDesc(), areaEnemy.getDanger()), 1, 1) self.disp.displayHeader("Info") self.disp.display("Player: %s - %dHP" % (self.player.name, self.player.hp)) @@ -391,17 +435,18 @@ def fightEnemies(self): damage = 0 areaEnemy.hp -= damage self.disp.displayHeader("You") - self.disp.display("%s You dealt %d damage." % - (msg, damage), 1, 1) + self.disp.display("%s You dealt %d damage." % (msg, damage), 1, 1) self.disp.displayHeader(areaEnemy.name) damage = areaEnemy.getWeaponDamage() if self.player.armor: damage -= self.player.getArmorDefence() if damage < 0: - damage = 0 - self.player.hp -= damage - self.disp.display("%s %s dealt %d damage." % ( - areaEnemy.weapon.getAction(), areaEnemy.name, damage)) + self.disp.display("You deflect %s's attack." % areaEnemy.name) + elif self.player.getDodge() - areaEnemy.getAccuracy() > random.randint(1,100): + self.disp.display("%s missed their attack." % (areaEnemy.name)) + else: + self.player.hp -= damage + self.disp.display("%s %s dealt %d damage." % (areaEnemy.weapon.getAction(), areaEnemy.name, damage)) self.disp.closeDisplay() time.sleep(DELAY) # input("\nEnter to continue.") @@ -409,7 +454,7 @@ def fightEnemies(self): elif cmd == 2: self.disp.clearScreen() escape = False - if random.randint(0, self.player.getArmorDefence() + areaEnemy.getWeaponDamage()) < areaEnemy.getArmorDefence(): + if random.randint(0, self.player.getArmorDefence() + areaEnemy.getWeaponDamage()) < 1 + areaEnemy.getArmorDefence(): escape = True if escape: self.disp.displayHeader("Escape Successful") @@ -452,7 +497,8 @@ def fightEnemies(self): if random.randint(1, 100) < areaEnemy.itemChance: self.disp.display("") self.disp.displayHeader("Reward") - self.disp.display(areaEnemy.itemDrop[1]) + itemMessage = areaEnemy.itemDrop[1].replace("$name", areaEnemy.name) + self.disp.display(itemMessage) self.disp.display("You recieved %s." % (areaEnemy.itemDrop[0].name)) self.player.inv.append(areaEnemy.itemDrop[0]) @@ -470,6 +516,8 @@ def chooseNewArea(self): '''This lets the player choose a new area to travel to.''' # Create various area choices: choices = self.randomAreaChoices() + # Shuffle the choices to make sure "required" areas don't always appaear first + random.shuffle(choices) cmd = -1 # Allow the player to choose from those places: @@ -512,14 +560,22 @@ def chooseNewArea(self): self.currentArea = choices[cmd - 1] self.currentArea.load(self.weapons, self.armor, self.misc, self.enemies, self.npcs, self.events, self.modifiers) + + if self.currentArea.event: + if not self.currentArea.event.isRepeatable: + self.nonRepeatableEvents.append(self.currentArea.event.resourceId) self.importantQuestInfo.append( ["inAreaType", self.currentArea.aType, True, False]) + self.importantQuestInfo.append( + ["inAreaId", self.currentArea.aId, True, False]) self.updateQuestInfo() def randomAreaChoices(self): '''This randomly generates areas for the player to choose from.''' + + print("") choices = [] # This is to guarantee that no "limited" areas are used more than once usedAreas = [] @@ -534,6 +590,9 @@ def randomAreaChoices(self): if flag == "required": required.append(area) + # Check if all requirements are met for areas to spawn: + # TODO + # Actually generate areas: for i in range(1, self.currentArea.newArea + 1): if len(required) > 0: @@ -551,7 +610,7 @@ def randomAreaChoices(self): if newroll > highroll and not alreadyUsed: newArea = aType highroll = newroll - generatedArea = Area(self.areas[newArea[0]]) + generatedArea = Area(self.areas[newArea[0]], self.nonRepeatableEvents, self.globalRandomEvents, newArea[0]) usedAreas.append(newArea[0]) choices.append(generatedArea) return choices @@ -572,8 +631,8 @@ def processActions(self, actions): self.disp.displayHeader("Event") self.disp.display(action[1]) self.disp.closeDisplay() - if self.gameSettings["EVENTDELAYENABLED"]: - time.sleep(1) + # if self.gameSettings["EVENTDELAYENABLED"]: + # time.sleep(1) # input("\nEnter to continue") self.disp.wait_for_enter() self.disp.dprint("Processed say condition.") @@ -586,9 +645,9 @@ def processActions(self, actions): itemKey = action[1] item = None if itemKey in self.weapons.keys(): - item = generateWeapon(self.weapons[itemKey]) + item = generateWeapon(self.weapons[itemKey], self.modifiers) elif itemKey in self.misc.keys(): - item = Misc(self.misc[itemKey]) + item = Misc(self.misc[itemKey], self.modifiers) elif itemKey in self.armor.keys(): item = Armor(self.armor[itemKey]) if item != None: @@ -605,8 +664,9 @@ def processActions(self, actions): self.currentQuests.remove(quest) self.disp.dprint("Processed questComplete condition.") elif action[0] == "spawnEnemy": - self.currentArea.enemy.append(Enemy( - self.enemies[action[1]], self.weapons, self.armor, self.misc, self.modifiers)) + for enemyid in action[1]: + self.currentArea.enemy.append(Enemy( + self.enemies[enemyid], self.weapons, self.armor, self.misc, self.modifiers)) self.disp.dprint("Processed spawnEnemy condition.") def updateQuestInfo(self): @@ -726,10 +786,11 @@ def openDataPacks(self): if cmd in range(1, 9) and cmd-1 <= len(toggleablePacks): if self.dataPackSettings["packsToLoad"][cmd-1+9*packPage][0] != "official": - self.dataPackSettings["packsToLoad"][cmd - - 1+9*packPage][1] ^= True + self.dataPackSettings["packsToLoad"][cmd - 1+9*packPage][1] ^= True else: # TODO Display error when attempting to disable the official datapack. + self.disp.clearScreen() + self.disp.display("") pass # The official data pack should be allowed to be disabled, only if # another data pack is enabled diff --git a/src/itemGeneration.py b/src/itemGeneration.py index e9f46fb..eb116ce 100644 --- a/src/itemGeneration.py +++ b/src/itemGeneration.py @@ -6,8 +6,8 @@ from weaponClass import Weapon -def generateWeapon(data=None): - newWeapon = Weapon(data) +def generateWeapon(data=None, modifiers=None): + newWeapon = Weapon(data, modifiers) if newWeapon.generated: newWeapon = _generateWeapon(newWeapon, data) return newWeapon diff --git a/src/launchGame.py b/src/launchGame.py new file mode 100644 index 0000000..5d13add --- /dev/null +++ b/src/launchGame.py @@ -0,0 +1,10 @@ + +''' +This file is the one that is used to launch the game. +It will decompress the game's resource files prior to running, and +then delete them again when done. +''' + +from main import startApplication + +startApplication() \ No newline at end of file diff --git a/src/main.py b/src/main.py index 5c619c6..cd1eecf 100644 --- a/src/main.py +++ b/src/main.py @@ -1,3 +1,15 @@ + +''' +CALL startApplication INSTEAD OF RUNNING THIS FILE DIRECTLY UNLESS +YOU KNOW WHAT YOU ARE DOING!!! + +Only run this file if the game's resources are already decompressed. +If the game's resources are zipped then the game will fail to launch. +''' + +import os +import shutil + from gameClass import Game from jsonDecoder import loadJson, saveJson @@ -6,6 +18,10 @@ MIN_DATA_PACK_VERSION = 0.1 MIN_SAVE_VERSION = 0.1 +RES_FOLDER = None +SETTINGS_FILE = None +SETTINGS = None + # Starts the gameloop def startGame(game): @@ -23,23 +39,44 @@ def startGame(game): return False def openSettings(game, settingsFile): + global RES_FOLDER, SETTINGS game.openOptionsWindow() saveJson(settingsFile, game.settings) game.initialLoad(RES_FOLDER, SETTINGS) def openDataPacks(game, settingsFile): + global RES_FOLDER, SETTINGS game.openDataPacks() saveJson(settingsFile, game.settings) game.initialLoad(RES_FOLDER, SETTINGS) +def startApplication(): + global GAME_VERSION, MIN_SAVE_VERSION, MIN_SAVE_VERSION + global RES_FOLDER, SETTINGS, SETTINGS_FILE -# This code runs with main.py is opened -if __name__ == "__main__": # Loads some resource stuff RES_FOLDER = "res/" SETTINGS_FILE = RES_FOLDER + "settings.json" SETTINGS = loadJson("{}".format(SETTINGS_FILE)) + # TODO Rewrite this bs + ''' + if __name__ != "__main__": + # Unpack the datapack zip folders if needed + print("Prepping datapacks...") + subfolders = [ f.name for f in os.scandir(RES_FOLDER) if f.is_dir() ] + for file in os.listdir(RES_FOLDER): + if file.endswith(".zip"): + print("\tPrepping datapack '{}'".format(os.path.join(RES_FOLDER, file))) + if file.split(".zip")[0] in subfolders: + print ("\t\tDatapack already loaded.") + else: + print ("\t\tDecompressing datapack...") + shutil.unpack_archive(RES_FOLDER + file, RES_FOLDER + file.split(".zip")[0]) + ''' + if __name__ != "__main__": + pass + # Inital game / menu loading game = Game() game.initialLoad(RES_FOLDER, SETTINGS) @@ -71,4 +108,19 @@ def openDataPacks(game, settingsFile): appRunning = False else: pass #TODO finish incorrect command message - game.shutdown_game() \ No newline at end of file + + # Shutdown the app window + game.shutdown_game() + + # TODO REMOVE THIS BULLSHIT + ''' + if __name__ != "__main__": + # Delete the uncompressed datapack folders + subfolders = [ f.name for f in os.scandir(RES_FOLDER) if f.is_dir() ] + for folder in subfolders: + shutil.rmtree(RES_FOLDER+folder) + ''' + +# This code runs with main.py is opened +if __name__ == "__main__": + startApplication() \ No newline at end of file diff --git a/src/miscClass.py b/src/miscClass.py index 69e9c7c..8f1418e 100644 --- a/src/miscClass.py +++ b/src/miscClass.py @@ -1,9 +1,64 @@ import random +from dieClass import rollDice class Misc(object): - def __init__(self,data): + def __init__(self, data, gameModifiers): self.name = random.choice(data["name"]) self.t = data["iType"] self.desc = random.choice(data["desc"]) - self.worth = data["worth"] \ No newline at end of file + self.worth = data["worth"] + try: + self.effects = data["effects"] + except: + self.effects = [] + try: + self.consumeText = random.choice(data["consumeText"]) + except: + self.consumeText = "" + + # Modifier logic + print("\n" + self.name) + print(data.keys()) + self.modifier = None + if "modifier" in data.keys(): + modifiers = data["modifier"] + mods = [] + for mod in modifiers: + mods += [mod[0]]*mod[1] + mod = random.choice(mods) + if mod != "None": + self.modifier = gameModifiers[mod].getInfo() + self.name = "{} {}".format(self.modifier["n"], self.name) + try: + pass + except: + self.modifier = None + + def consumableEffect(self, player): + player.disp.clearScreen() + player.disp.displayHeader("You eat the {}".format(self.name)) + player.disp.display("You eat the {} and wait to feels its effects.".format(self.name)) + + actualEffects = 0 + for effect in self.effects: + if effect[0] == "heal": + healing = rollDice(effect[1]) + if self.modifier: + if self.modifier["e"] == "strongEffect": + healing *= rollDice(self.modifier["s"]) + elif self.modifier["e"] == "improved": + healing += rollDice(self.modifier["s"]) + elif self.modifier["e"] == "impaired": + healing -= rollDice(self.modifier["s"]) + if healing > 0: + actualEffects += 1 + player.giveHP(healing) + player.disp.display("You feel strengthened from the {}, giving you {} hp.".format(self.name, healing)) + + if actualEffects <= 0: + # TODO Display no effects message + pass + + player.disp.closeDisplay() + player.disp.wait_for_enter() diff --git a/src/modifierClass.py b/src/modifierClass.py index 73ad0dc..5c814b6 100644 --- a/src/modifierClass.py +++ b/src/modifierClass.py @@ -7,6 +7,14 @@ def __init__(self,title,data): self.strength = data["strength"] self.name = data["name"] self.title = title + if "desc" in data.keys(): + self.desc = data["desc"] + else: + self.desc = [] def getInfo(self): - return {"e":self.effect,"s":self.strength,"n":random.choice(self.name),"t":self.title} \ No newline at end of file + info = {"e":self.effect,"s":self.strength,"n":random.choice(self.name),"t":self.title} + if len(self.desc) > 0: + info["d"] = random.choice(self.desc) + + return info \ No newline at end of file diff --git a/src/playerClass.py b/src/playerClass.py index dc8ac6f..a333588 100644 --- a/src/playerClass.py +++ b/src/playerClass.py @@ -37,9 +37,8 @@ def playerMenu(self, currentQuests, completedQuests): self.disp.display("Quick Stats:") for stat in self.getUserInfo(): self.disp.display(f'{stat[1]:>15} - {stat[0]}', 0) - self.disp.display("Equipped Gear:", 1, 0) - self.disp.display("\t{}".format( - self.getEquipmentString()), 0) + self.disp.display("Wielding: %s (%s damage)" % (self.weapon.name, self.weapon.damage)) + self.disp.display("Wearing: %s (%s defence)" % (self.armor.name, self.armor.defence), 0) self.disp.closeDisplay() self.disp.display("1. View Inventory") self.disp.display("2. View Quests", 0) @@ -125,16 +124,23 @@ def attemptEquip(self, cmd): self.disp.display("Anything else to continue", 0) elif self.inv[cmd-1].t == "a": self.disp.displayHeader("Equip %s" % (self.inv[cmd-1].name)) - self.disp.display("%s - %s defence" % + self.disp.display("\t%s - %s defence" % (self.inv[cmd-1].name, self.inv[cmd-1].defence)) self.disp.display(self.inv[cmd-1].desc, 0) self.disp.display("Currently equipped:") - self.disp.display("%s - %s defence" % + self.disp.display("\t%s - %s defence" % (self.armor.name, self.armor.defence), 0) self.disp.display(self.armor.desc, 0, 1) self.disp.display("1. Equip", 0) self.disp.display("2. Drop", 0) self.disp.display("Anything else to continue", 0) + elif self.inv[cmd-1].t == "consumable": + self.disp.displayHeader("Examining %s" % (self.inv[cmd-1].name)) + self.disp.display(self.inv[cmd-1].desc) + self.disp.display("Worth: %d" % self.inv[cmd-1].worth, 1, 1) + self.disp.display("1. {}".format(self.inv[cmd-1].consumeText), 0) + self.disp.display("2. Drop", 0) + self.disp.display("Anything else to continue", 0) else: self.disp.displayHeader("Examining %s" % (self.inv[cmd-1].name)) self.disp.display(self.inv[cmd-1].desc) @@ -156,6 +162,9 @@ def attemptEquip(self, cmd): elif self.inv[cmd-1].t == "a" and equip == 1: self.inv.append(self.armor) self.armor = self.inv.pop(cmd-1) + elif self.inv[cmd-1].t == "consumable" and equip == 1: + self.inv[cmd-1].consumableEffect(self) + self.inv.pop(cmd-1) elif equip == 2: self.disp.displayHeader("Item dropped") self.disp.display("You drop %s." % (self.inv.pop(cmd-1).name)) @@ -174,6 +183,9 @@ def viewPlayerDetails(self): self.disp.display(f'\tVitality - {self.getStat("vitality")}', 0) self.disp.display(f'\tPhysique - {self.getStat("physique")}', 0) self.disp.display(f'\tIntelligence - {self.getStat("intelligence")}', 0) + self.disp.display("Equipped Gear:", 1, 0) + self.disp.display("\t{}".format( + self.getEquipmentString()), 0) self.disp.display("Body:") self.disp.display(f'\t{self.getBodyDescription()}', 0) self.disp.closeDisplay() @@ -279,8 +291,18 @@ def giveXP(self, xp): if self.xp >= self.getXpNeededForLevelUp(): self.xp -= self.getXpNeededForLevelUp() self.level += 1 + + def giveHP(self, hp): + ''' Gives the player HP ''' + self.hp += hp + if self.hp > self.getMaxHP(): + self.hp = self.getMaxHP() # Class Getters + def getDodge(self): + # TODO: Implement + return 0 + def getEquipmentString(self): # TODO redo this whole part equipstr = "" @@ -311,7 +333,7 @@ def getHealth(self): def getWeaponDamage(self): if self.weapon: - return rollDice(self.weapon.damage) + return self.weapon.getAttack() else: return 0 diff --git a/src/questClass.py b/src/questClass.py index 48d8b59..d468c5e 100644 --- a/src/questClass.py +++ b/src/questClass.py @@ -72,7 +72,10 @@ def getDo(self): requirements.append(Flag(f)) self.requirements = requirements for action in do: - action.append(self.qID) + if action[0] == "setDesc": + self.desc = action[1] + else: + action.append(self.qID) return do def __str__(self): diff --git a/src/raceClass.py b/src/raceClass.py index 772e824..07b5c87 100644 --- a/src/raceClass.py +++ b/src/raceClass.py @@ -71,7 +71,7 @@ def getLimbCounts(self): def getDescription(self): ''' Generates a description of the race's appearance. ''' - if len(self.getLimbCounts().keys()) > 1: + if len(self.getLimbCounts().keys()) == 1: return self.getPureRaceDescription() else: return self.getMixedRaceDescription() @@ -94,7 +94,19 @@ def getPureRaceDescription(self): def getMixedRaceDescription(self): ''' Creates a dynamic description for the race since their limbs do not all belong to any singular race ''' # TODO add a description generator for nonpure races. - return self.getPureRaceDescription() + limbCounts = self.getLimbCounts() + description = 'You look like a strange Chimera of different races.\n\t' + for rId in limbCounts.keys(): + firstLimbType = list(limbCounts[rId].keys())[0] + description += f'You have {limbCounts[rId][firstLimbType]} {firstLimbType}' + if limbCounts[rId][firstLimbType] > 1: + description += "s" + for limbtype in list(limbCounts[rId].keys())[1:]: + description = f'{description}, {limbCounts[rId][limbtype]} {limbtype}' + if limbCounts[rId][limbtype] > 1: + description += "s" + description += f" that appears to be of the {rId} race. " + return description def getVitalLimbs(self): ''' Returns a list of limbs that are vital to the race ''' diff --git a/dist/res/official/areas/area_forest.json b/src/res/official/areas/area_gen_forest_1.json similarity index 61% rename from dist/res/official/areas/area_forest.json rename to src/res/official/areas/area_gen_forest_1.json index 7d5b406..992224f 100644 --- a/dist/res/official/areas/area_forest.json +++ b/src/res/official/areas/area_gen_forest_1.json @@ -1,21 +1,16 @@ { "name":[ - "The $nameAdjs $names's $forest", - "The $names's $forest", - "The $adjs $forest", - "$adjs $forest" + "The $names's $forest Trail", + "The $adjs $forest Trail", + "$adjs $forest Trail" ], "names":{ "type":"choose", "choices":[ "Elder", - "God", "King", "Queen", - "Dragon", "Bear", - "Ruffian", - "Troublemaker", "Huntsman" ] }, @@ -23,39 +18,20 @@ "type":"choose", "choices":[ "Forest", - "Woods", "Thicket", - "Woodland", - "Timberland", - "Wilds", - "Grove" + "Grove", + "Wilderness", + "Woodland" ] }, "adjs":{ "type":"choose", "choices":[ - "Red", "Yellow", "Green", - "Black", - "Dark", "Sunny", "Foggy", "Dense", - "Royal", - "Broken", - "Old" - ] - }, - "nameAdjs":{ - "type":"choose", - "choices":[ - "Good", - "Holy", - "Evil", - "Cruel", - "Loving", - "Loved", "Old" ] }, @@ -67,20 +43,22 @@ ], "aType":"Forest", "hostilityMin":1, - "hostilityMax":5, - "eventChance":10, + "hostilityMax":4, + "eventChance":45, "events":[ - ["event_lostItem", "1d8"], - ["event_flipACoin", "1d8"], - ["event_forestAreaMisc", "2d8"], - ["event_forestAreaMisc2", "2d8"] + ["event_lostItem", "1d20"], + ["event_flipACoin", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] ], - "enemyChance":10, + "hostilityAffectsEnemyChance":true, + "enemyChance":15, "enemyPointsPerHostility":2, "enemies":[ ["enemy_rodentOfUnusualSize", 2], ["enemy_wolf",3], - ["enemy_bandit", 5], ["enemy_greatWolf",7] ], "npcChance":0, @@ -90,7 +68,8 @@ "minNewAreas":3, "maxNewAreas":6, "areas":[ - ["area_forest","2d5", ["required"]], - ["area_strongHold","1d6"] + ["area_gen_forest_1","2d5", ["required"]], + ["area_gen_forest_2","2d5"], + ["area_gen_forest_3","2d5"] ] } \ No newline at end of file diff --git a/src/res/official/areas/area_gen_forest_2.json b/src/res/official/areas/area_gen_forest_2.json new file mode 100644 index 0000000..860a69e --- /dev/null +++ b/src/res/official/areas/area_gen_forest_2.json @@ -0,0 +1,74 @@ +{ + "name":[ + "The $names's $forest", + "The $adjs $forest", + "$adjs $forest" + ], + "names":{ + "type":"choose", + "choices":[ + "Elder", + "King", + "Queen", + "Bear", + "Huntsman" + ] + }, + "forest":{ + "type":"choose", + "choices":[ + "Forest", + "Thicket", + "Grove", + "Wilderness", + "Woodland" + ] + }, + "adjs":{ + "type":"choose", + "choices":[ + "Yellow", + "Green", + "Sunny", + "Foggy", + "Dense", + "Old" + ] + }, + "desc":[ + "Trees surround you on either side. There is an eerie sound of an owl in the distance.\nYou push past the trees as you continue moving forward.", + "It is almost impossible to see past the trees.\nYou continue to push on.", + "Next to no light is able to pass through the thick layer of leaves above.\nThe few beams of light guide you as you go on.", + "There is a slight chill to the air, probably because of the lack of sunlight.\nAt least you won't sweat as you hike on." + ], + "aType":"Forest", + "hostilityMin":3, + "hostilityMax":6, + "eventChance":35, + "events":[ + ["event_lostItem", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] + ], + "hostilityAffectsEnemyChance":true, + "enemyChance":15, + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf",4], + ["enemy_bandit",6], + ["enemy_greatWolf",8] + ], + "npcChance":0, + "npcs":[ + ], + "minNewAreas":2, + "maxNewAreas":6, + "areas":[ + ["area_gen_forest_2", "1d8"], + ["area_gen_forest_1", "2d6"], + ["area_gen_forest_3", "2d6"], + ["area_gen_forest_4", "2d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_gen_forest_3.json b/src/res/official/areas/area_gen_forest_3.json new file mode 100644 index 0000000..2d56b7e --- /dev/null +++ b/src/res/official/areas/area_gen_forest_3.json @@ -0,0 +1,78 @@ +{ + "name":[ + "The $names's $forest Trail", + "The $adjs $forest Trail", + "$adjs $forest Trail" + ], + "names":{ + "type":"choose", + "choices":[ + "Elder", + "King", + "Queen", + "Bear", + "Huntsman" + ] + }, + "forest":{ + "type":"choose", + "choices":[ + "Forest", + "Thicket", + "Grove", + "Wilderness", + "Woodland" + ] + }, + "adjs":{ + "type":"choose", + "choices":[ + "Yellow", + "Green", + "Sunny", + "Bright", + "Foggy", + "Dense", + "Old" + ] + }, + "desc":[ + "Trees surround you on either side. There is an eerie sound of an owl in the distance.\nYou push past the trees as you continue moving forward.", + "It is almost impossible to see past the trees.\nYou continue to push on.", + "Next to no light is able to pass through the thick layer of leaves above.\nThe few beams of light guide you as you go on.", + "There is a slight chill to the air, probably because of the lack of sunlight.\nAt least you won't sweat as you hike on." + ], + "aType":"Forest", + "hostilityMin":2, + "hostilityMax":4, + "eventChance":40, + "events":[ + ["event_lostItem", "1d20"], + ["event_flipACoin", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] + ], + "hostilityAffectsEnemyChance":true, + "enemyChance":20, + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy_rodentOfUnusualSize", 2], + ["enemy_wolf",3], + ["enemy_greatWolf",7] + ], + "npcChance":0, + "npcs":[ + ], + "minNewAreas":3, + "maxNewAreas":6, + "areas":[ + ["area_gen_forest_1", "2d6"], + ["area_gen_forest_2", "2d6"], + ["area_gen_forest_3", "1d8", ["required"]], + ["area_gen_forest_4", "1d12"], + ["cave_wolf_entrance", "1d8"], + ["area_village_gate_east", "2d6", ["limited"]] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_gen_forest_4.json b/src/res/official/areas/area_gen_forest_4.json new file mode 100644 index 0000000..7056b42 --- /dev/null +++ b/src/res/official/areas/area_gen_forest_4.json @@ -0,0 +1,84 @@ +{ + "name":[ + "The $nameAdjs $names's $forest", + "$nameAdjs $adjs $forest" + ], + "names":{ + "type":"choose", + "choices":[ + "Elder", + "God", + "King", + "Queen", + "Dragon", + "Bear", + "Ruffian", + "Troublemaker", + "Huntsman" + ] + }, + "forest":{ + "type":"choose", + "choices":[ + "Forest", + "Thicket", + "Wilds", + "Wilderness", + "Woodland" + ] + }, + "adjs":{ + "type":"choose", + "choices":[ + "Dark", + "Foggy", + "Dense", + "Royal", + "Broken" + ] + }, + "nameAdjs":{ + "type":"choose", + "choices":[ + "Evil", + "Cruel", + "Old" + ] + }, + "desc":[ + "Trees surround you on either side. There is an eerie sound of an owl in the distance.\nYou push past the trees as you continue moving forward.", + "It is almost impossible to see past the trees.\nYou continue to push on.", + "Next to no light is able to pass through the thick layer of leaves above.\nThe few beams of light guide you as you go on.", + "There is a slight chill to the air, probably because of the lack of sunlight.\nAt least you won't sweat as you hike on." + ], + "aType":"Forest", + "hostilityMin":5, + "hostilityMax":7, + "eventChance":35, + "events":[ + ["event_lostItem", "1d20"], + ["event_forestAreaMisc", "1d20+6"], + ["event_forestAreaMisc2", "1d20+6"], + ["event_forest_apple", "1d20+3"], + ["event_forgotten_item", "1d15"] + ], + "hostilityAffectsEnemyChance":true, + "enemyChance":15, + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf",3], + ["enemy_bandit",7], + ["enemy_banditStrong",9], + ["enemy_greatWolf",8], + ["enemy_bear",11] + ], + "npcChance":0, + "npcs":[ + ], + "minNewAreas":3, + "maxNewAreas":5, + "areas":[ + ["area_gen_forest_3", "1d8", ["required"]], + ["cave_wolf_entrance", "1d8"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_start_1.json b/src/res/official/areas/area_start_1.json new file mode 100644 index 0000000..6dd6384 --- /dev/null +++ b/src/res/official/areas/area_start_1.json @@ -0,0 +1,41 @@ +{ + "name":[ + "$descriptor $aName" + ], + "aName":{ + "type":"choose", + "choices":[ + "Grove", + "Clearing" + ] + }, + "descriptor":{ + "type":"choose", + "choices":[ + "Clear", + "Empty", + "Peaceful" + ] + }, + "desc":[ + "You hear birds chirping somewhere in the distance. Opening your eyes, you are greated to a calm $aName." + ], + "aType":"Forest", + "hostilityMin":1, + "hostilityMax":1, + "eventChance":100, + "events":[ + ["intro_event_1","1d1"] + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":1, + "areas":[ + ["area_start_2","1d1", ["required", "limited"]] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_start_2.json b/src/res/official/areas/area_start_2.json new file mode 100644 index 0000000..d28811f --- /dev/null +++ b/src/res/official/areas/area_start_2.json @@ -0,0 +1,51 @@ +{ + "name":[ + "$descriptor $aName" + ], + "aName":{ + "type":"choose", + "choices":[ + "Path", + "Pathway", + "Trail" + ] + }, + "descriptor":{ + "type":"choose", + "choices":[ + "Lightly Treaded", + "Rough Looking", + "Barely Treaded" + ] + }, + "descriptorLowercase":{ + "type":"choose", + "choices":[ + "lightly treaded", + "rough looking", + "barely treaded" + ] + }, + "desc":[ + "You walk along the $descriptorLowercase path, unsure if it will actually lead anywhere worthwhile.", + "The path is tough follow due to its apparent lack of use. You are unsure if following this path is the smartest decision." + ], + "aType":"Forest", + "hostilityMin":2, + "hostilityMax":3, + "eventChance":100, + "events":[ + ["intro_event_2", "1d6"] + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":1, + "areas":[ + ["area_gen_forest_1","1d1", ["required","limited"]] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_village_gate_east.json b/src/res/official/areas/area_village_gate_east.json new file mode 100644 index 0000000..ebf5fed --- /dev/null +++ b/src/res/official/areas/area_village_gate_east.json @@ -0,0 +1,49 @@ +{ + "name":[ + "Eastern Village Gate" + ], + "descWall":{ + "type":"choose", + "choices":[ + "You walk up to the village gate, taking in its rough texture and the many holes that have been drilled into it.", + "The wooden gate is old and rough. Worn down from weather and the passage of time.", + "The tall, oak gate used to protect the village from the dangers outside stands before you.", + "The walls of the village stand before you. Tall and intimidating with its dark wood exterior." + ] + }, + "guardDiscussion":{ + "type":"choose", + "choices":[ + "their wild night at the village's inn", + "the ludicrous price of bread", + "how underpaid they are", + "how boring gate duty is", + "how poor the weather has been recently", + "the terrible crop season", + "a crazy woman that seems to be constantly causing issues" + ] + }, + "desc":[ + "$descWall\nTwo guards stand at the doors of the gate. Their bored expressions conveying their lack of interest at doing such a job.", + "$descWall\nThe gate's guards lean on the side of the walls. The two of them chatting about $guardDiscussion.", + "$descWall\nYou overhear the two gate guards discussing $guardDiscussion.", + "$descWall" + ], + "aType":"Village Wall", + "hostilityMin":0, + "hostilityMax":0, + "eventChance":0, + "events":[ + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":4, + "areas":[ + ["area_gen_forest_3", "2d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_village_gate_west.json b/src/res/official/areas/area_village_gate_west.json new file mode 100644 index 0000000..b9e37b8 --- /dev/null +++ b/src/res/official/areas/area_village_gate_west.json @@ -0,0 +1,49 @@ +{ + "name":[ + "Village Gate West" + ], + "descWall":{ + "type":"choose", + "choices":[ + "You walk up to the village gate, taking in its rough texture and the many holes that have been drilled into it.", + "The wooden gate is old and rough. Worn down from weather and the passage of time.", + "The tall, oak gate used to protect the village from the dangers outside stands before you.", + "The walls of the village stand before you. Tall and intimidating with its dark wood exterior." + ] + }, + "guardDiscussion":{ + "type":"choose", + "choices":[ + "their wild night at the village's inn", + "the ludicrous price of bread", + "how underpaid they are", + "how boring gate duty is", + "how poor the weather has been recently", + "the terrible crop season", + "a crazy woman that is constantly causing issues" + ] + }, + "desc":[ + "$descWall\nTwo guards stand at the doors of the gate. Their bored expressions conveying their lack of interest at doing such a job.", + "$descWall\nThe gate's guards lean on the side of the walls. The two of them chatting about $guardDiscussion.", + "$descWall\nYou overhear the two gate guards discussing $guardDiscussion.", + "$descWall" + ], + "aType":"Village Wall", + "hostilityMin":0, + "hostilityMax":0, + "eventChance":0, + "events":[ + ], + "enemyChance":0, + "enemyMessage":[""], + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":4, + "areas":[ + ["area_gen_forest_3", "2d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/cave_wolf_entrance.json b/src/res/official/areas/cave_wolf_entrance.json new file mode 100644 index 0000000..d03799e --- /dev/null +++ b/src/res/official/areas/cave_wolf_entrance.json @@ -0,0 +1,104 @@ +{ + "name":[ + "$cave of $beasts", + "$beastDesc $beasts' $cave $entrance", + "$entrance to the $cave of $beasts", + "$beasts' $caveDesc $cave", + "$caveDesc $cave of $beasts", + "$cave of $beastDesc $beasts" + ], + "cave":{ + "type":"choose", + "choices":[ + "Cave", + "Cavern", + "Den", + "Hollow", + "Pass", + "Grotto", + "Respite" + ] + }, + "beasts":{ + "type":"choose", + "choices":[ + "Wolves", + "Dogs", + "Beasts" + ] + }, + "beastDesc":{ + "type":"choose", + "choices":[ + "Gray", + "Bone", + "Petty", + "Violent", + "Bloody", + "Cruel", + "Large", + "Feral" + ] + }, + "caveDesc":{ + "type":"choose", + "choices":[ + "Cavernous", + "Winding", + "Large", + "Dark", + "Damp" + ] + }, + "entrance":{ + "type":"choose", + "choices":[ + "Entrance", + "Entry", + "Inlet" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "Going inside could prove to be a bad idea.", + "You can't shake off the feeling of death around you.", + "The sickly looking trees closest to the entrance add to the unnerving feel of the cave.", + "You cannot think of a good reason to enter.", + "You can only prepare yourself so much for whatever lies within." + ] + }, + "desc":[ + "A draft of air blows out from the cave's dark entrance. A sense of lingering danger coming from within.\n$randomDetail", + "You can hear howls from within the cave. The sounds are obviously coming from beasts that are calling it their home.\n$randomDetail", + "The entrance to the cave appears to have been carved out. Small glyphs and runes have been etched into the sides.\n$randomDetail", + "Two large boulders lean against each other, forming a sort of entrance into the dark depths into the wall of rock.\n$randomDetail", + "You see blood splatters all around the entrance to the cave. Small bones are littered about the area. You imagine what lies beyond.\n$randomDetail" + ], + "aType":"Cave", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":0, + "events":[ + ], + "enemyChance":75, + "enemyMessage":[ + "You see a group of wolves guarding the $entrance to the cave.", + "As you appraoch the cave you see several wolves laying by the $entrance.", + "The cave's $entrance is guarded by several wolves laying beside it." + ], + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf", 4], + ["enemy_greatWolf", 7] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":3, + "areas":[ + ["cave_wolf_room_1a", "1d1", ["required", "limited"]], + ["area_gen_forest_3","1d5", ["required"]], + ["area_gen_forest_4","1d5"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/cave_wolf_room_1a.json b/src/res/official/areas/cave_wolf_room_1a.json new file mode 100644 index 0000000..e420c5b --- /dev/null +++ b/src/res/official/areas/cave_wolf_room_1a.json @@ -0,0 +1,87 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Tight", + "Drafty", + "Slim", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "tight", + "drafty", + "slim", + "sparkling" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "All you can hear is the snapping of small bones under your feet as you walk.", + "It is impossible to count the number of dead creatures that have made this place their final resting place.", + "The growls from deeper within the cave grow louder as you continue on." + ] + }, + "desc":[ + "You enter the cave and pause for a moment, allowing your eyes to get used to the darkness within the cave.\n$randomDetail", + "The stench of rotting flesh causes you to nearly wretch within the darkness.\n$randomDetail" + ], + "aType":"Cave", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":0, + "events":[ + ], + "enemyChance":75, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":4, + "areas":[ + ["cave_wolf_room_2a", "1d6", ["required", "limited"]], + ["cave_wolf_room_1a", "1d6", ["limited"]], + ["cave_wolf_room_1b", "1d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/cave_wolf_room_1b.json b/src/res/official/areas/cave_wolf_room_1b.json new file mode 100644 index 0000000..3d5d1f9 --- /dev/null +++ b/src/res/official/areas/cave_wolf_room_1b.json @@ -0,0 +1,86 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Tight", + "Drafty", + "Slim", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "tight", + "drafty", + "slim", + "sparkling" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "You can hear the faint sound of dripping water echoing through the dark passages.", + "There are streaks of dried up blood along the floor. It looks like the cave's inhabitants drag their prey deep into the cave system." + ] + }, + "desc":[ + "You continue working your way through the $nameDescLowercase cave system. $randomDetail", + "The winding corridors of the $nameDescLowercase give a deepening sense of dread the further in you go. $randomDetail" + ], + "aType":"Cave", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":35, + "events":[ + ["event_cave_wolf_1", "1d6"] + ], + "enemyChance":66, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":2, + "maxNewAreas":3, + "areas":[ + ["cave_wolf_room_2a", "1d6", ["limited"]], + ["cave_wolf_room_1a", "1d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/cave_wolf_room_2a.json b/src/res/official/areas/cave_wolf_room_2a.json new file mode 100644 index 0000000..843848c --- /dev/null +++ b/src/res/official/areas/cave_wolf_room_2a.json @@ -0,0 +1,84 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Roomy", + "Tight", + "Drafty", + "Slim", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "tight", + "drafty", + "slim", + "sparkling" + ] + }, + "desc":[ + "Based on the echoes of your movement, you estimate you are halfway through the cave system.", + "You can hear water dripping somewhere deeper inside the cave.", + "This seems to be the deepest portion of the cave. The everpresent darkness surrounds you at every turn.", + "The cave begins to slope and turn about randomly. Anyone could get easily lost within the dark corridors.", + "There is no more light this deep within the cave. All is darkness. You have only your other senses to help you." + ], + "aType":"Cave", + "hostilityMin":5, + "hostilityMax":7, + "eventChance":100, + "events":[ + ["event_cave_wolf_1", "1d6"], + ["event_cave_found_item_1", "1d6"] + ], + "enemyChance":75, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":3, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":3, + "areas":[ + ["cave_wolf_room_3", "1d6", ["required", "limited"]], + ["cave_wolf_room_2a", "1d6", ["limited"]] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/cave_wolf_room_3.json b/src/res/official/areas/cave_wolf_room_3.json new file mode 100644 index 0000000..7738573 --- /dev/null +++ b/src/res/official/areas/cave_wolf_room_3.json @@ -0,0 +1,83 @@ +{ + "name":[ + "$nameDesc $room", + "$room" + ], + "room":{ + "type":"choose", + "choices":[ + "Passage", + "Cavernous Room", + "Cavern", + "Pathway", + "Chamber", + "Clear Space" + ] + }, + "nameDesc":{ + "type":"choose", + "choices":[ + "Dimly lit", + "Darkly lit", + "Barely lit", + "Dark", + "Small", + "Large", + "Roomy", + "Drafty", + "Sparkling" + ] + }, + "nameDescLowercase":{ + "type":"choose", + "choices":[ + "dimly lit", + "darkly lit", + "barely lit", + "dark", + "small", + "large", + "roomy", + "drafty", + "sparkling" + ] + }, + "randomDetail":{ + "type":"choose", + "choices":[ + "Bones litter the ground. This is obviously a nest for a foul beast.", + "A bit of grass has been piled into one of the sides of the area.", + "What appears to be a freshly eaten meal sits at the center of the area." + ] + }, + "desc":[ + "The cave opens up a bit into a slightly more spacious room. $randomDetail", + "You push into another chamber of the cave. This one is more spacious that the previous ones. $randomDetail" + ], + "aType":"Cave", + "hostilityMin":5, + "hostilityMax":7, + "eventChance":0, + "events":[ + ], + "enemyChance":75, + "enemyMessage":[ + "You can discern moving shapes within the $nameDescLowercase passageway.", + "Multiple pairs of eyes stare at you as you work your way through the $nameDescLowercase tunnel.", + "A growl alerts you to several enemies within the $nameDescLowercase cavern.", + "The $nameDescLowercase passage appears to be full of enemies." + ], + "enemyPointsPerHostility":4, + "enemies":[ + ["enemy_wolf", 2], + ["enemy_greatWolf", 5] + ], + "npcChance":0, + "npcs":[], + "minNewAreas":1, + "maxNewAreas":2, + "areas":[ + ["area_gen_forest_3", "1d6", ["required"]], + ["area_gen_forest_4", "1d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/legacy/area_forest_tower.json b/src/res/official/areas/legacy/area_forest_tower.json new file mode 100644 index 0000000..9ccd3e0 --- /dev/null +++ b/src/res/official/areas/legacy/area_forest_tower.json @@ -0,0 +1,45 @@ +{ + "name":[ + "$nameDesc Tower", + "Tower in the Forest" + ], + "nameDesc":{ + "type":"choose", + "choices":[ + "Abandoned", + "Forgotten", + "Derelict", + "Crumbling" + ] + }, + "towerDesc":{ + "type":"choose", + "choices":[ + "The tower stands tall in the middle of the forest. Its crumbling exterior still presenting the master worksmanship of its original architects.", + "The derelict spire reaches high above the surrounding trees. The structure is made up of carfully carved stones that perfectly fit into the other. If only it had received some form of upkeep.", + "The tower looms over the surrounding trees with its intimidating presence. The torn banners are the only indicator that the tower has been abandoned for some time." + ] + }, + "desc":[ + "The worn trail has numerous lush trees to either side of it. Following the trail leads to an abandoned looking tower.\n$towerDesc", + "Following the dirt path under the coverage of trees eventually leads to a worn tower.\n$towerDesc", + "The seemingly endless path curves through the dense forest. Continuing to follow it leads to a derelict looking tower." + ], + "aType":"Forest", + "hostilityMin":4, + "hostilityMax":6, + "eventChance":90, + "events":[ + ["event_tower_forest", "1d6"] + ], + "enemyChance":0, + "enemyPointsPerHostility":1, + "enemies":[], + "npcChance":0, + "npcs":[], + "minNewAreas":3, + "maxNewAreas":5, + "areas":[ + ["area_forest","2d5", ["required"]] + ] +} \ No newline at end of file diff --git a/src/res/official/areas/area_strongHold.json b/src/res/official/areas/legacy/area_strongHold.json similarity index 100% rename from src/res/official/areas/area_strongHold.json rename to src/res/official/areas/legacy/area_strongHold.json diff --git a/src/res/official/areas/template_area_file.json b/src/res/official/areas/template_area_file.json new file mode 100644 index 0000000..95e7c4d --- /dev/null +++ b/src/res/official/areas/template_area_file.json @@ -0,0 +1,47 @@ +{ + "name":[ + "Name", + "Name with $var" + ], + "var":{ + "type":"choose", + "choices":[ + "variable", + "random text" + ] + }, + "desc":[ + "Description text", + "Other possible description text.", + "$vars can be used here as well" + ], + "aType":"Forest", + "hostilityMin":1, + "hostilityMax":10, + "eventChance":35, + "events":[ + ["event id here", "die roll (1d8)"], + ["event 2 id here", "1d8"] + ], + "enemyChance":35, + "enemyMessage":[ + "This tag is optional", + "$vars are able to be used as well" + ], + "enemyPointsPerHostility":2, + "enemies":[ + ["enemy id here", hostilitypointsneededtospawn], + ["enemy 2 id here", 2], + ["group", ["enemy", "ids", "of", "group", "here"], 10] + ], + "npcChance":0, + "npcs":[ + "npc_defNPC" + ], + "minNewAreas":1, + "maxNewAreas":10, + "areas":[ + ["area id here","die roll (1d8)", ["required"]], + ["area 2 id here","1d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/armor/armor_starting_armor.json b/src/res/official/armor/armor_starting_armor.json new file mode 100644 index 0000000..5eaa6bc --- /dev/null +++ b/src/res/official/armor/armor_starting_armor.json @@ -0,0 +1,13 @@ +{ + "name":[ + "Ruined Cloak", + "Torn Cloak" + ], + "desc":[ + "The cloak will protect you only if a blow lands on an undamaged portion of it.", + "The worn out cloak won't protect you from much." + ], + "defence":"1d2-1", + "worthMin":5, + "worthMax":15 +} \ No newline at end of file diff --git a/src/res/official/enemies/enemy_bandit.json b/src/res/official/enemies/enemy_bandit.json index 058e3c3..3608946 100644 --- a/src/res/official/enemies/enemy_bandit.json +++ b/src/res/official/enemies/enemy_bandit.json @@ -25,23 +25,24 @@ "It's a bandit... What else do you want from me?" ], "deathMsg":[ - "topples to the ground, his blood pooling around his body." + "topples to the ground, his blood pooling around his body.", + "breathes his last and falls to the ground, his blood pooling around his body." ], "hp":"2d5+8", "damage":"0", + "modCount":"0", "modifier":[ ], "weapon":[ - "weapon_ironSword" + "weapon_ironSword", + "weapon_club" ], "armor":[ "armor_hideArmor" ], "itemChance":50, "itemDrops":[ - ["armor_hideArmor", "You search the bandit and take his armor."], - ["weapon_ironSword", "You search the bandit and take his sword."], - ["template_IronSword", "You search the bandit and take his sword. How a bandit got ahold of such a nice weapon is anyone's guess."] + ["consumable_potion_health", "You search the bandit, finding a potion."] ], "xp":5 } \ No newline at end of file diff --git a/src/res/official/enemies/enemy_banditStrong.json b/src/res/official/enemies/enemy_banditStrong.json new file mode 100644 index 0000000..3100890 --- /dev/null +++ b/src/res/official/enemies/enemy_banditStrong.json @@ -0,0 +1,52 @@ +{ + "name":[ + "$racetype $title", + "$title" + ], + "title":{ + "type":"choose", + "choices":[ + "Bandit", + "Thief", + "Scoundrel", + "Outcast" + ] + }, + "racetype":{ + "type":"choose", + "choices":[ + "Human", + "Elven", + "Orc" + ] + }, + "eID":"banditStrong", + "desc":[ + "It's a bandit... What else do you want from me?" + ], + "deathMsg":[ + "topples to the ground, his blood pooling around his body.", + "breathes his last and falls to the ground, his blood pooling around his body." + ], + "hp":"2d6+10", + "damage":"0", + "modCount":"1d2", + "modifier":[ + ["strong",3], + ["largeBody",3], + ["veryStrong",2] + ], + "weapon":[ + "weapon_steelSword" + ], + "armor":[ + "armor_hideArmor" + ], + "itemChance":60, + "itemDrops":[ + ["consumable_potion_health", "You search the bandit, finding a potion."], + ["consumable_potion_health", "You search the bandit, finding a potion."], + ["weapon_steelSword", "You search the bandit, finding a potion."] + ], + "xp":10 +} \ No newline at end of file diff --git a/src/res/official/enemies/enemy_bear.json b/src/res/official/enemies/enemy_bear.json new file mode 100644 index 0000000..e3d41d2 --- /dev/null +++ b/src/res/official/enemies/enemy_bear.json @@ -0,0 +1,57 @@ +{ + "name":[ + "$color Furred Bear", + "$color2 Bear" + ], + "color":{ + "type":"choose", + "choices":[ + "Black", + "Onyx", + "Pitch-Black", + "Charcoal", + "Dark Gray", + "Slate", + "Darkly" + ] + }, + "color2":{ + "type":"choose", + "choices":[ + "Black", + "Dark Gray", + "Jet-Black", + "Pitch-Black" + ] + }, + "eID":"blackBear", + "desc":[ + "The bear eyes you intently. Its fur glinting in the light.", + "The scars across the bear's body lets any of its enemies know that its not new to fighting." + ], + "deathMsg":[ + "gives one last roar before succumbing to its wounds.", + "groans before collapsing on the ground." + ], + "hp":"3d8+8", + "damage":"1d6+2", + "modCount":"1d3", + "modifier":[ + ["None",3], + ["strong",2], + ["veryStrong",2], + ["strong",2], + ["weak",2], + ["largeBody",3], + ["sick",1] + ], + "weapon":[ + "weapon_wolfClaws" + ], + "armor":[ + "armor_greatWolfHide" + ], + "itemChance":0, + "itemDrops":[], + "xp":15 +} \ No newline at end of file diff --git a/src/res/official/enemies/enemy_greatWolf.json b/src/res/official/enemies/enemy_greatWolf.json index c6573a1..4b4289c 100644 --- a/src/res/official/enemies/enemy_greatWolf.json +++ b/src/res/official/enemies/enemy_greatWolf.json @@ -17,11 +17,14 @@ ], "hp":"2d3+10", "damage":"1d3", + "modCount":"1d3-1", "modifier":[ - ["None",2], - ["strong",3], + ["strong",2], ["veryStrong",1], - ["weak",1] + ["weak",1], + ["largeBody",2], + ["wolfRabid",3], + ["wolfStrong",3] ], "weapon":[ "weapon_wolfClaws" @@ -29,9 +32,11 @@ "armor":[ "armor_greatWolfHide" ], - "itemChance":1, + "itemChance":50, "itemDrops":[ - ["material_greatWolfPelt","You skin the large beast and take it as a reward."] + ["material_greatWolfPelt","You skin the large beast and take it as a reward."], + ["consumable_raw_meat","You skin the large beast, taking some of its flesh with you."], + ["consumable_raw_meat","You are able to take some of the beast's flesh."] ], "xp":12 } \ No newline at end of file diff --git a/src/res/official/enemies/enemy_orc.json b/src/res/official/enemies/enemy_orc.json index 446efc0..e276433 100644 --- a/src/res/official/enemies/enemy_orc.json +++ b/src/res/official/enemies/enemy_orc.json @@ -16,6 +16,7 @@ ], "hp":"3d6+10", "damage":"0d0", + "modCount":"1d3-1", "modifier":[ ["None",3], ["strong",3], @@ -31,8 +32,10 @@ "armor":[ "armor_orcArmor" ], - "itemChance":0, + "itemChance":50, "itemDrops":[ + ["consumable_potion_health", "You search the Orc and find a healing potion."], + ["weapon_steelSword", "You search the Orc and find a steel sword."] ], "xp":8 } \ No newline at end of file diff --git a/src/res/official/enemies/enemy_orcCaptain.json b/src/res/official/enemies/enemy_orcCaptain.json index e3c3265..2ff0108 100644 --- a/src/res/official/enemies/enemy_orcCaptain.json +++ b/src/res/official/enemies/enemy_orcCaptain.json @@ -17,6 +17,7 @@ ], "hp":"3d6+15", "damage":"1d3", + "modCount":"1d3-1", "modifier":[ ["None",5], ["strong",3], @@ -29,9 +30,11 @@ "armor":[ "armor_orcArmor" ], - "itemChance":25, + "itemChance":50, "itemDrops":[ - ["armor_ironArmor", "You see that the orc you killed had a bag of valuables. Within it you find some iron armor."] + ["armor_ironArmor", "You see that the orc you killed had a bag of valuables. Within it you find some iron armor."], + ["consumable_potion_health", "You search the $name and find a healing potion."], + ["consumable_potion_health", "You search the Orc and find a healing potion."] ], "xp":20 } \ No newline at end of file diff --git a/src/res/official/enemies/enemy_robbedQuestEnemy.json b/src/res/official/enemies/enemy_robbedQuestEnemy.json index 79898c7..8db85a8 100644 --- a/src/res/official/enemies/enemy_robbedQuestEnemy.json +++ b/src/res/official/enemies/enemy_robbedQuestEnemy.json @@ -11,6 +11,7 @@ ], "hp":"2d4+8", "damage":"1d1", + "modCount":"0", "modifier":[ ], "weapon":[ diff --git a/src/res/official/enemies/enemy_rodentOfUnusualSize.json b/src/res/official/enemies/enemy_rodentOfUnusualSize.json index 519b153..41f535b 100644 --- a/src/res/official/enemies/enemy_rodentOfUnusualSize.json +++ b/src/res/official/enemies/enemy_rodentOfUnusualSize.json @@ -40,11 +40,13 @@ ], "hp":"1d4+3", "damage":"0", + "modCount":"1d3-1", "modifier":[ - ["None",3], - ["weak",5], + ["None",1], + ["weak",4], ["strong",1], - ["veryWeak",3] + ["veryWeak",2], + ["largeBody",2] ], "weapon":[ "weapon_wolfClaws" @@ -52,9 +54,9 @@ "armor":[ "None" ], - "itemChance":0, + "itemChance":50, "itemDrops":[ - ["material_wolfPelt","You skin the wolf and take it as a reward."] + ["consumable_raw_meat","You are able to salvage some of the beast's flesh."] ], "xp":1 } \ No newline at end of file diff --git a/src/res/official/enemies/enemy_template.json b/src/res/official/enemies/enemy_template.json new file mode 100644 index 0000000..df6e469 --- /dev/null +++ b/src/res/official/enemies/enemy_template.json @@ -0,0 +1,33 @@ +{ + "name":[ + "Enemy Name", + "Enemy Name Variant" + ], + "eID":"enemyId", + "desc":[ + "Description when fighting enemy.", + "Second description for fighting" + ], + "deathMsg":[ + "this message plays on death.", + "these messages should start with a lowercase letter and include a period at the end." + ], + "hp":"1d20", + "damage":"1d3", + "modCount":"1d3-1", + "modifier":[ + ["None",3], + ["mod type",2] + ], + "weapon":[ + "weapon_id" + ], + "armor":[ + "armor_id" + ], + "itemChance":50, + "itemDrops":[ + ["item_id","Description when player recieves the item drop."] + ], + "xp":3 +} \ No newline at end of file diff --git a/src/res/official/enemies/enemy_wolf.json b/src/res/official/enemies/enemy_wolf.json index 0544794..6a335eb 100644 --- a/src/res/official/enemies/enemy_wolf.json +++ b/src/res/official/enemies/enemy_wolf.json @@ -15,11 +15,15 @@ ], "hp":"2d3+5", "damage":"0", + "modCount":"1d3-1", "modifier":[ - ["None",3], + ["None",1], ["weak",2], ["strong",1], - ["veryWeak",1] + ["veryWeak",2], + ["largeBody",1], + ["wolfRabid",2], + ["wolfStrong",2] ], "weapon":[ "weapon_wolfClaws" @@ -27,9 +31,11 @@ "armor":[ "armor_wolfHide" ], - "itemChance":10, + "itemChance":50, "itemDrops":[ - ["material_wolfPelt","You skin the wolf and take it as a reward."] + ["material_wolfPelt","You skin the wolf and take it as a reward."], + ["consumable_raw_meat","You skin the large beast, taking some of its flesh with you."], + ["consumable_raw_meat","You are able to take some of the beast's flesh."] ], "xp":3 } \ No newline at end of file diff --git a/src/res/official/events/event_cave_found_item_1.json b/src/res/official/events/event_cave_found_item_1.json new file mode 100644 index 0000000..5a2d37f --- /dev/null +++ b/src/res/official/events/event_cave_found_item_1.json @@ -0,0 +1,99 @@ +{ + "id":"itemInCave", + "type":"random", + "name":[ + "A Forgotten Item", + "A Dropped Item", + "Finding Something within the Cave" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "You continue working through the depths of the cave. As you walk through the corridors you spot something glinting in the shadows." + ], + "actions":[ + { + "action":"Check it out", + "eventDo":[ + ["say","You pick up the item and investigate it."], + ["goto", ["#healingItem1","#healingItem2","#healingItem3"]] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["say","You decide that whatever it is, it is not worth your time and continue on."], + ["finish"] + ] + } + ] + }, + "#healingItem1":{ + "msg":[ + "You grab the thing and examine it. It is just a slightly bruised, but still somehwat fresh apple." + ], + "actions":[ + { + "action":"Take it", + "eventDo":[ + ["say","You slip the apple into your bag and continue on."], + ["give","consumable_apple",1], + ["finish"] + ] + }, + { + "action":"Leave it", + "eventDo":[ + ["say", "The apple is not worth the space it would take up in you bag. You decide to leave it where you found it."], + ["finish"] + ] + } + ] + }, + "#healingItem2":{ + "msg":[ + "You grab the thing and examine it. It appears to be a healing potion." + ], + "actions":[ + { + "action":"Take it", + "eventDo":[ + ["say","You slip the potion into your bag and continue on."], + ["give","consumable_potion_health",1], + ["finish"] + ] + }, + { + "action":"Leave it", + "eventDo":[ + ["say", "The potion is not worth the space it would take up in you bag. You decide to leave it where you found it."], + ["finish"] + ] + } + ] + }, + "#healingItem3":{ + "msg":[ + "You examine the object and see that it is not a singular item, but rather what appears to be two different healing poitions." + ], + "actions":[ + { + "action":"Take them", + "eventDo":[ + ["say","You slip the potions into your bag and continue on."], + ["give","consumable_potion_health",2], + ["finish"] + ] + }, + { + "action":"Leave it", + "eventDo":[ + ["say", "Those potions are not worth the space they would take up in you bag. You decide to leave it where you found it."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/event_cave_wolf_1.json b/src/res/official/events/event_cave_wolf_1.json new file mode 100644 index 0000000..b66d176 --- /dev/null +++ b/src/res/official/events/event_cave_wolf_1.json @@ -0,0 +1,57 @@ +{ + "id":"caveWolfEvent1", + "type":"random", + "name":[ + "A Group of Wolves", + "A Pack of Wolves" + ], + "start":[ + "#BasicPack1", + "#BasicPack2", + "#DangerousPack" + ], + "#BasicPack1":{ + "msg":[ + "You continue working your way through the tight chambers of the cave. Pushing through a particularly tight passageway you lose your balance and trip. You quickly get up to see several wolves circling around you.", + "The deep growling of several wolves causes you to pause. Unlike the growls you heard earleir, these are much closer. The sound is steadily getting louder." + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_greatWolf"]], + ["finish"] + ] + } + ] + }, + "#BasicPack2":{ + "msg":[ + "You continue working your way through the tight chambers of the cave. Pushing through a particularly tight passageway you lose your balance and trip. You quickly get up to see several wolves quickly approaching you.", + "The deep growling of several wolves causes you to pause. Unlike the growls you heard earlier, these are much closer. The sound is steadily getting louder." + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_wolf", "enemy_wolf"]], + ["finish"] + ] + } + ] + }, + "#DangerousPack":{ + "msg":[ + "The sound of a wolf howling causes you to jump. You can't see to much further into the dark passages, but you can easily make out the eyes of several wolves. One of the wolves in the far back appears much larger than any of the ones in the front." + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_wolf", "enemy_wolf", "enemy_greatWolf"]], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/event_forestAreaMisc.json b/src/res/official/events/event_forestAreaMisc.json index 002c0d5..3e9e913 100644 --- a/src/res/official/events/event_forestAreaMisc.json +++ b/src/res/official/events/event_forestAreaMisc.json @@ -12,7 +12,7 @@ "You hear a rustling in the trees to the right of you.", "You hear a rustling in the trees to the left of you.", "In the distance you can hear wolves howling.", - "The leaves rustle in the wind as you walk", + "The leaves rustle in the wind as you walk.", "There are birds chirping as you continue to walk the beaten path." ], "actions":[] diff --git a/src/res/official/events/event_forestAreaMisc2.json b/src/res/official/events/event_forestAreaMisc2.json index 0c93c20..c30bd81 100644 --- a/src/res/official/events/event_forestAreaMisc2.json +++ b/src/res/official/events/event_forestAreaMisc2.json @@ -12,7 +12,8 @@ "You glance around as you continue walking the path. You pause for a moment, enjoying the clear day, before continuing on.", "You take a deep breath and look at the trees to either side of you. The calmness of the scene feels wasted as you continue on your way.", "You pass by a large oak tree as you walk the pathway. Its bark broken by what appear to be claws. You ready your guard as you continue walking.", - "You stop walking for a moment as you feel a cool breeze. You hear the leaves on the trees rustle as you continue making your way down the path." + "You stop walking for a moment as you feel a cool breeze. You hear the leaves on the trees rustle as you continue making your way down the path.", + "While the trees around you give you a sense of calm, the eery silence is enough to make you uneasy. It's quiet enough to make you wonder if you are actually alone." ], "actions":[] } diff --git a/src/res/official/events/event_forest_apple.json b/src/res/official/events/event_forest_apple.json new file mode 100644 index 0000000..dd768b7 --- /dev/null +++ b/src/res/official/events/event_forest_apple.json @@ -0,0 +1,32 @@ +{ + "id":"eventForestApple", + "type":"random", + "name":[ + "An Apple Tree" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "As you continue along the dirt path you notice an apple tree not too far away. You examine it and see a single fresh apple just waiting to be taken." + ], + "actions":[ + { + "action":"Take it", + "eventDo":[ + ["say","You reach up to the tree and grab the apple."], + ["give","consumable_apple",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["say","You opt to leave the tree alone. You don't need an apple taking up space in your inventory."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/event_forgotten_item.json b/src/res/official/events/event_forgotten_item.json new file mode 100644 index 0000000..9bf398f --- /dev/null +++ b/src/res/official/events/event_forgotten_item.json @@ -0,0 +1,98 @@ +{ + "id":"eventItemInTheDirt", + "type":"random", + "name":[ + "Something Left in the Dirt", + "Lost Item" + ], + "start":[ + "#start" + ], + "#start":{ + "msg":[ + "You notice something sticking up out of the dirt as you walk. You walk over to it, seeing that it is a leather bag with something obviously shoved into it." + ], + "actions":[ + { + "action":"Open the bag", + "eventDo":[ + ["goto",["#ironSword", "#hideArmor", "#healthPotion"]] + ] + }, + { + "action":"Ignore it and continue on", + "eventDo":[ + ["finish"] + ] + } + ] + }, + "#ironSword":{ + "msg":[ + "You open the bag, pulling out a simple iron sword wrapped in a thin cloth.", + "You kneel down by the bag and open the flap. Inside you find an iron sword wrapped with a thin cloth." + ], + "actions":[ + { + "action":"Take the sword", + "eventDo":[ + ["say","You throw the cloth away and take the sword with you."], + ["give","weapon_ironSword",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["finish"] + ] + } + ] + }, + "#hideArmor":{ + "msg":[ + "You open the bag, pulling out a set of hide armor inside.", + "Opening the bag's flap reveals a set of hide armor shoved hastily inside.", + "Inside the leather bag sits a neatly folded set of hide armor." + ], + "actions":[ + { + "action":"Take the armor", + "eventDo":[ + ["say","You pull the armor out of the bag and take it with you."], + ["give","armor_hideArmor",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["finish"] + ] + } + ] + }, + "#healthPotion":{ + "msg":[ + "You throw the flap of the bag open and find a health potion inside.", + "Inside the bag is a single health potion.", + "You flip open the bag's flap and see a health potion." + ], + "actions":[ + { + "action":"Take the potion", + "eventDo":[ + ["say","You grab the health potion and throw it into your own bag."], + ["give","consumable_potion_health",1], + ["finish"] + ] + }, + { + "action":"Ignore it", + "eventDo":[ + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/event_mysteriousOrb.json b/src/res/official/events/event_mysteriousOrb.json new file mode 100644 index 0000000..bc77fbc --- /dev/null +++ b/src/res/official/events/event_mysteriousOrb.json @@ -0,0 +1,24 @@ +{ + "id":"mysteriousOrb", + "type":"random", + "isRepeatable":false, + "name":[ + "A Strange Orb" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":["As you walk down the path you notice a patch of burnt up grass. You stop and take a closer look at the patch of burnt grass and see a small orb sitting in the center of it."], + "actions":[ + { + "action":"Pick it up", + "eventDo":[ + ["say","You kneel down and pick the orb up. You examine the strange metal sphere and realize that you really do not have any idea what it is."], + ["give","misc_mysteriousOrb", 1], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/event_tower_forest.json b/src/res/official/events/event_tower_forest.json new file mode 100644 index 0000000..e251ced --- /dev/null +++ b/src/res/official/events/event_tower_forest.json @@ -0,0 +1,45 @@ +{ + "id":"towerEnemies", + "type":"random", + "name":[ + "Reaching the Tower", + "At the Tower" + ], + "start":[ + "#wolves", + "#bandits", + "#bear" + ], + "#wolves":{ + "msg":[ + "" + ], + "actions":[ + { + "action":"Prepare yourself for a fight", + "eventDo":[ + ["spawnEnemy",["enemy_wolf", "enemy_wolf", "enemy_greatWolf"]], + ["finish"] + ] + } + ] + }, + "#bandits":{ + "msg":[ + "" + ], + "actions":[ + ["spawnEnemy",["enemy_bandit", "enemy_bandit", "enemy_bandit","enemy_bandit"]], + ["finish"] + ] + }, + "#bear":{ + "msg":[ + "" + ], + "actions":[ + ["spawnEnemy",["enemy_bear"]], + ["finish"] + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/intro_event_1.json b/src/res/official/events/intro_event_1.json new file mode 100644 index 0000000..7c4eeda --- /dev/null +++ b/src/res/official/events/intro_event_1.json @@ -0,0 +1,25 @@ +{ + "id":"areaStartIntro", + "type":"intro", + "name":[ + "Dazed and Confused" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "You suddenly sit up, unable to remember why you are in the middle of the forest." + ], + "actions":[ + { + "action":"Take in your surroundings", + "eventDo":[ + ["say","You stand up, looking around at the trees spread out around you."], + ["say","Figuring out what you were doing and why you are in the middle of a forest should probably be your top priority.\nThere is a lightly treaded path in front of you. It could be the way to the nearest town."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/intro_event_2.json b/src/res/official/events/intro_event_2.json new file mode 100644 index 0000000..3a15894 --- /dev/null +++ b/src/res/official/events/intro_event_2.json @@ -0,0 +1,124 @@ +{ + "id":"areaStartIntro2", + "type":"intro", + "name":[ + "Abandoned Camp", + "Empty Campsite" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "You continue following the trail, eventually entering a clearing. A fire pit sits at the center and a broken tent sits on its own just a few yards away.", + "As you follow the trail, you stumble into what appears to be an abandoned campsite. A broken tent and empty fire pit are the only things of notice." + ], + "actions":[ + { + "action":"Investigate the fire pit", + "eventDo":[ + ["say","You walk over to the fire pit and kneel down to see if there is anything of note.\nExamining the ash and footprints around the pit lead you to believe that there was only a single person staying at the campsite."], + ["goto", ["#firepit"]] + ] + }, + { + "action":"Investigate the broken tent", + "eventDo":[ + ["say","You walk over to the broken tent and pick through the scraps of fabric."], + ["goto", ["#brokentent","#luckytent"]] + ] + }, + { + "action":"Leave the campsite", + "eventDo":[ + ["say","After looking at the state of the camp, you decide that it would not be wise to stick around and see what made the previous visitor leave in such a hurry."], + ["finish"] + ] + } + ] + }, + "#firepit":{ + "msg":[ + "You stand up from the fire pit and look around at the rest of the camp. The tent sits on its own in silence.", + "Standing up from the firepit you take another glance around the camp. All that was left behind by the prior visitor was the tent." + ], + "actions":[ + { + "action":"Investigate the abandoned tent", + "eventDo":[ + ["say","You walk over to the broken tent and pick through the scraps of fabric."], + ["goto", ["#brokentent","#luckytent"]] + ] + }, + { + "action":"Leave the campsite", + "eventDo":[ + ["say","You stand up and walk towards the trail. Odds are there's nothing worthwhile here, and you definitely don't want to see what made the previous visitor leave in such a hurry."], + ["finish"] + ] + } + ] + }, + "#brokentent":{ + "msg":[ + "Upon lifting one of the tent flaps you find a satchel with a bit of weight to it.", + "Tossing parts of the tent to the side you see a small bag. Lifting it up you can feel that there's something inside." + ], + "actions":[ + { + "action":"Open the bag", + "eventDo":[ + ["say","You open the top flap of the bag and shake its contents out in front of you. Several apples drop down onto the ground.\nYou pocket the apples."], + ["give","consumable_apple",3], + ["goto", ["#anEncounter","#noEncounter"]] + ] + } + ] + }, + "#luckytent":{ + "msg":[ + "Upon lifting one of the tent flaps you find a satchel with a bit of weight to it.", + "Tossing parts of the tent to the side you see a small bag. Lifting it up you can feel that there's something inside." + ], + "actions":[ + { + "action":"Open the bag", + "eventDo":[ + ["say","You open the top flap of the bag and shake its contents out in front of you. Three glass bottles drop onto the ground.\nPicking one up to look at closer makes you realize that they are healing potions! You throw the potions into your bag."], + ["give","consumable_potion_health",3], + ["goto", ["#anEncounter","#noEncounter"]] + ] + } + ] + }, + "#anEncounter":{ + "msg":[ + "You stand up, glad that searching the campsite was worth the time.\nA sudden loud snap alerts you to a pair of large rodents that are closing in on you fast. You don't have any choice other than to fight.", + "You stand up and glance around the camp one last time.\nA high pitched screech causes you to spin around. A pair of unusually big rodents are circling you. Your only choice is to fight them off. " + ], + "actions":[ + { + "action":"Ready your weapon", + "eventDo":[ + ["spawnEnemy",["enemy_rodentOfUnusualSize","enemy_rodentOfUnusualSize"]], + ["finish"] + ] + } + ] + }, + "#noEncounter":{ + "msg":[ + "You stand up, glad that searching the campsite was worth the time.", + "You stand up and glance around the camp one last time." + ], + "actions":[ + { + "action":"Continue along the path", + "eventDo":[ + ["say","Since there is nothing left at the site to search you continue once more along the trail."], + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/events/template_event_file.json b/src/res/official/events/template_event_file.json new file mode 100644 index 0000000..afcf645 --- /dev/null +++ b/src/res/official/events/template_event_file.json @@ -0,0 +1,57 @@ +{ + "id":"templateEvent", + "type":"random", + "name":[ + "Random title 1", + "Random title 2" + ], + "start":[ + "#startingPoint" + ], + "#startingPoint":{ + "msg":[ + "Random initial message 1", + "Random initial message 2" + ], + "actions":[ + { + "action":"This is an action that takes you to another step", + "eventDo":[ + ["say","This is a say command. The next command will take you to another branch of the event"], + ["goto", ["#secondStep"]] + ] + }, + { + "action":"This is an action that will exit", + "eventDo":[ + ["say","This is a say command. The next action will end the event"], + ["finish"] + ] + } + ] + }, + "#secondStep":{ + "msg":[ + "These function the same as the first branch" + ], + "actions":[ + { + "action":"This action has a requirement", + "requirements":[ + ["have","gold",1] + ], + "eventDo":[ + ["say","If this action was chosen, the player will lose 1 gold and then end the event."], + ["take","gold",1], + ["finish"] + ] + }, + { + "action":"This action has no requirements", + "eventDo":[ + ["finish"] + ] + } + ] + } +} \ No newline at end of file diff --git a/src/res/official/meta.json b/src/res/official/meta.json index bac4d81..6d579f8 100644 --- a/src/res/official/meta.json +++ b/src/res/official/meta.json @@ -1,93 +1,133 @@ { - "name":"Official Data Pack", - "author":"Sprinklez Media", - "desc":"This is the official game data and assets for the game.", - "packType":"standalone", - "version":0.1, - "gameLogo":[ - " _____ _____ _____ __ _____ _____ _____", - " | _ || __ || | __| || __|| ||_ _|", - " | __|| -|| | || | || __|| --| | |", - " |__| |__|__||_____||_____||_____||_____| |_|", - " _____ _____ _____ _____ __ __", - " | __|| || _ ||_ _|| | |", - " | __|| | | || __| | | |_ _|", - " |_____||_|_|_||__| |_| |_|" - ], - "gameDesc":[ - "Welcome to the void", - "REALLY early access", - "No, it's not complete", - "Estimated Release: Eventually", - "Made by A Donut with Sprinklez", - "Coming when it's done", - "There aren't very many of these", - "Growing all the time!", - "Ever closer to completion", - "The void stares back" - ], - "weapons":[ - "weapon_ironSword", - "weapon_wolfClaws", - "weapon_orcSword", - "template_IronSword" - ], - "armor":[ - "armor_wolfHide", - "armor_hideArmor", - "armor_ironArmor", - "armor_greatWolfHide", - "armor_orcArmor", - "armor_orcCaptainArmor" - ], - "misc":[ - "material_wolfPelt", - "material_stick", - "material_greatWolfPelt", - "misc_pieceOfMetal", - "consumable_apple" - ], - "areas":[ - "area_forest", - "area_strongHold" - ], - "races":[ - "race_human", - "race_elf", - "race_orc", - "race_dwarf", - "race_draktilien" - ], - "startableRaces":[ - "race_human", - "race_elf", - "race_orc", - "race_dwarf", - "race_draktilien" - ], - "npcs":[ - "npc_defNPC" - ], - "enemies":[ - "enemy_bandit", - "enemy_rodentOfUnusualSize", - "enemy_wolf", - "enemy_greatWolf", - "enemy_orc", - "enemy_orcCaptain", - "enemy_robbedQuestEnemy" - ], - "modifiers":[ - "modifiersList" - ], - "quests":[ - "quest_robbed" - ], - "events":[ - "event_lostItem", - "event_flipACoin", - "event_forestAreaMisc", - "event_forestAreaMisc2" - ], - "startingArea":"area_forest" + "name": "Official Data Pack", + "author": "Sprinklez Media", + "desc": "This is the official game data and assets for the game.", + "packType": "standalone", + "version": 0.1, + "gameLogo": [ + " _____ _____ _____ __ _____ _____ _____", + " | _ || __ || | __| || __|| ||_ _|", + " | __|| -|| | || | || __|| --| | |", + " |__| |__|__||_____||_____||_____||_____| |_|", + " _____ _____ _____ _____ __ __", + " | __|| || _ ||_ _|| | |", + " | __|| | | || __| | | |_ _|", + " |_____||_|_|_||__| |_| |_|" + ], + "gameDesc": [ + "There aren't very many of these", + "Growing all the time!", + "Ever closer to completion", + "Entirely open source on GitHub", + "The void stares back", + "Now with a tiny bit of story!", + "Now with some dev tools!", + "Inspired by Huw2k8's The Wastes", + "This project has been in development for way too long" + ], + "areas": [ + "area_start_1", + "area_start_2", + "area_gen_forest_1", + "area_gen_forest_2", + "area_gen_forest_3", + "area_gen_forest_4", + "cave_wolf_entrance", + "cave_wolf_room_1a", + "cave_wolf_room_1b", + "cave_wolf_room_2a", + "cave_wolf_room_3", + "area_village_gate_east", + "area_village_gate_west" + ], + "armor": [ + "armor_starting_armor", + "armor_wolfHide", + "armor_hideArmor", + "armor_ironArmor", + "armor_greatWolfHide", + "armor_orcArmor", + "armor_orcCaptainArmor" + ], + "enemies": [ + "enemy_bandit", + "enemy_banditStrong", + "enemy_bear", + "enemy_greatWolf", + "enemy_orc", + "enemy_orcCaptain", + "enemy_robbedQuestEnemy", + "enemy_rodentOfUnusualSize", + "enemy_wolf" + ], + "events": [ + "intro_event_1", + "intro_event_2", + "event_lostItem", + "event_forgotten_item", + "event_flipACoin", + "event_forestAreaMisc", + "event_forestAreaMisc2", + "event_mysteriousOrb", + "event_forest_apple", + "event_cave_wolf_1", + "event_cave_found_item_1", + "event_tower_forest" + ], + "misc": [ + "consumable_apple", + "consumable_potion_health", + "consumable_raw_meat", + "material_wolfPelt", + "material_stick", + "material_greatWolfPelt", + "misc_pieceOfMetal", + "misc_mysteriousOrb" + ], + "modifiers": [ + "consumable_modifiers", + "enemy_modifiers", + "enemy_wolf_modifiers", + "forest_spirit", + "weapon_modifiers" + ], + "npcs": [], + "quests": [ + "quest_beginnings" + ], + "races": [ + "race_human", + "race_elf", + "race_orc", + "race_dwarf", + "race_draktilien" + ], + "startableRaces": [ + "race_human", + "race_elf", + "race_orc", + "race_dwarf", + "race_draktilien" + ], + "weapons": [ + "weapon_club", + "weapon_ironSword", + "weapon_orcSword", + "weapon_starter_sword", + "weapon_steelSword", + "weapon_treeBranch", + "weapon_wolfClaws" + ], + "startingArea": [ + "area_start_1" + ], + "startingWeapon": [ + "weapon_starter_sword" + ], + "startingArmor": [ + "armor_starting_armor" + ], + "startingInventory": [ + "consumable_potion_health" + ] } \ No newline at end of file diff --git a/src/res/official/misc/consumable_apple.json b/src/res/official/misc/consumable_apple.json index 8be5450..0a43ca3 100644 --- a/src/res/official/misc/consumable_apple.json +++ b/src/res/official/misc/consumable_apple.json @@ -8,9 +8,10 @@ "The apple looks large and delicious.", "The skin is a little bruised, but still edible." ], - "cType":"edible", + "iType":"consumable", + "consumeText":["Eat"], "effects":[ - ["heal","1d6"] + ["heal","2d3"] ], "worth":2 } \ No newline at end of file diff --git a/src/res/official/misc/consumable_potion_health.json b/src/res/official/misc/consumable_potion_health.json new file mode 100644 index 0000000..6ccd2ae --- /dev/null +++ b/src/res/official/misc/consumable_potion_health.json @@ -0,0 +1,24 @@ +{ + "name":[ + "Potion of Health", + "Health Potion" + ], + "desc":[ + "A red liquid sloshes within the glass vial", + "It's a small vial full of a red liquid.", + "The glass container has a label that reads, 'drink if in trouble'." + ], + "iType":"consumable", + "consumeText":["Drink"], + "modifier":[ + ["strongEffect", 1], + ["improvedEffect", 2], + ["slightlyImprovedEffect", 3], + ["impairedEffect", 3], + ["None", 6] + ], + "effects":[ + ["heal","1d12+6"] + ], + "worth":15 +} \ No newline at end of file diff --git a/src/res/official/misc/consumable_raw_meat.json b/src/res/official/misc/consumable_raw_meat.json new file mode 100644 index 0000000..2a3336b --- /dev/null +++ b/src/res/official/misc/consumable_raw_meat.json @@ -0,0 +1,15 @@ +{ + "name":[ + "Raw Meat", + "Raw Flesh" + ], + "desc":[ + "It is a hunk of raw flesh. It may give some nourishment, but cooking it would probably help." + ], + "iType":"consumable", + "consumeText":["Eat"], + "effects":[ + ["heal","1d4"] + ], + "worth":3 +} \ No newline at end of file diff --git a/src/res/official/misc/misc_mysteriousOrb.json b/src/res/official/misc/misc_mysteriousOrb.json new file mode 100644 index 0000000..2bc1364 --- /dev/null +++ b/src/res/official/misc/misc_mysteriousOrb.json @@ -0,0 +1,6 @@ +{ + "name":["Mysterious Orb"], + "desc":["It's a strange looking orb. It is perfectly smooth all around and appears to be made of a metal of some kind. It gives off a hollow sound when you tap it."], + "iType":"essential", + "worth":0 +} \ No newline at end of file diff --git a/src/res/official/modifiers/consumable_modifiers.json b/src/res/official/modifiers/consumable_modifiers.json new file mode 100644 index 0000000..136fe28 --- /dev/null +++ b/src/res/official/modifiers/consumable_modifiers.json @@ -0,0 +1,51 @@ +{ + "impairedEffect": { + "name": [ + "Weakened", + "Old", + "Impaired", + "Expired" + ], + "desc": [ + "It seems to be less than average." + ], + "effect": "impaired", + "strength": "1d6+6" + }, + "improvedEffect": { + "name": [ + "Improved", + "Refined", + "Enhanced" + ], + "desc": [ + "It seems to be well above average." + ], + "effect": "improved", + "strength": "1d6+6" + }, + "slightlyImprovedEffect": { + "name": [ + "Marginally Improved", + "Partially Refined", + "Mildly Enhanced" + ], + "desc": [ + "It seems to be above average." + ], + "effect": "improved", + "strength": "1d3+3" + }, + "strongEffect": { + "name": [ + "Strong", + "Potent", + "Concentrated" + ], + "desc": [ + "It seems to be stronger than average." + ], + "effect": "strongEffect", + "strength": "+2" + } +} \ No newline at end of file diff --git a/src/res/official/modifiers/enemy_modifiers.json b/src/res/official/modifiers/enemy_modifiers.json new file mode 100644 index 0000000..f2b8f2a --- /dev/null +++ b/src/res/official/modifiers/enemy_modifiers.json @@ -0,0 +1,99 @@ +{ + "dying": { + "name": [ + "Very Sick", + "Dying", + "Bloody" + ], + "desc": [ + "It is surprising that the $name is still standing in its current state.", + "The weakness caused by its condition is noticable.", + "There is a very small chance that the $name will be able to fight for an extended amount of time." + ], + "effect": "health", + "strength": "-2d2" + }, + "largeBody": { + "name": [ + "Healthy", + "Well Fed", + "Large", + "Bulky" + ], + "desc": [ + "The $name's body is huge.", + "The $name can probably take quite a beating." + ], + "effect": "health", + "strength": "2d3" + }, + "sick": { + "name": [ + "Sickly", + "Unhealthy", + "Hurt" + ], + "desc": [ + "It is surprising that the $name is still standing in its current state.", + "The weakness caused by its condition is noticable.", + "There's a chance that the $name will fall quicker than others." + ], + "effect": "health", + "strength": "-1d3" + }, + "strong": { + "name": [ + "Strong", + "Fit", + "Quick", + "Mad", + "Irritated" + ], + "desc": [ + "It looks like it could easily deal some damage.", + "It looks like it may be able to deal more damage than normally possible." + ], + "effect": "damage", + "strength": "1d2-1" + }, + "veryStrong": { + "name": [ + "Very Strong", + "Fast", + "Rugged", + "Angry", + "Furious" + ], + "desc": [ + "It looks like it could easily deal some damage.", + "The $name definitely has a higher damage potential." + ], + "effect": "damage", + "strength": "1d3-1" + }, + "veryWeak": { + "name": [ + "Very Weak", + "Tiny", + "Very Slow" + ], + "desc": [ + "It will be tough for such an enemy to land a strong blow." + ], + "effect": "damage", + "strength": "-1d3-1" + }, + "weak": { + "name": [ + "Weak", + "Small", + "Lesser" + ], + "desc": [ + "This $name is smaller than others of the same kind.", + "There is no way the $name can hit as strong as others." + ], + "effect": "damage", + "strength": "-1d2-1" + } +} \ No newline at end of file diff --git a/src/res/official/modifiers/enemy_wolf_modifiers.json b/src/res/official/modifiers/enemy_wolf_modifiers.json new file mode 100644 index 0000000..ff75f84 --- /dev/null +++ b/src/res/official/modifiers/enemy_wolf_modifiers.json @@ -0,0 +1,31 @@ +{ + "wolfRabid": { + "name": [ + "Rabid", + "Foaming", + "Mad-Eyed", + "Fearless" + ], + "desc": [ + "The wolf is foaming at the mouth.", + "The wolf has a mad look in its eye.", + "The rabid wolf does not appear to be showing any sign of fear." + ], + "effect": "damage", + "strength": "1d3" + }, + "wolfStrong": { + "name": [ + "Well Built", + "Muscular", + "Towering" + ], + "desc": [ + "The wolf is massive in size.", + "The frame of the wolf is impressive.", + "There are few wolves as large as the one in front of you." + ], + "effect": "health", + "strength": "2d3" + } +} \ No newline at end of file diff --git a/src/res/official/modifiers/forest_spirit.json b/src/res/official/modifiers/forest_spirit.json new file mode 100644 index 0000000..8eccc48 --- /dev/null +++ b/src/res/official/modifiers/forest_spirit.json @@ -0,0 +1,15 @@ +{ + "forest_spirit_young": { + "name": [ + "Young", + "Confused", + "Recently Awoken" + ], + "desc": [ + "The spirit was recently awoken and is not able to attack as hard.", + "It is too out of it to get a proper hit in." + ], + "effect": "damage", + "strength": "-1d3" + } +} \ No newline at end of file diff --git a/src/res/official/modifiers/weapon_modifiers.json b/src/res/official/modifiers/weapon_modifiers.json new file mode 100644 index 0000000..76b883e --- /dev/null +++ b/src/res/official/modifiers/weapon_modifiers.json @@ -0,0 +1,83 @@ +{ + "wep_branch_rotten": { + "name": [ + "Rotten", + "Rotted", + "Rotting", + "Cracked" + ], + "desc": [ + "The branch looks extremely weak.", + "The branch is cracked and rotten." + ], + "effect": "damage", + "strength": "-1d2-1" + }, + "wep_branch_spiky": { + "name": [ + "Spiky", + "Branchy", + "Cruel Looking" + ], + "desc": [ + "The limb has lots of smaller branches growing out of it.", + "This particular branch looks extra spiky." + ], + "effect": "damage", + "strength": "1d2-1" + }, + "wep_club_heavy": { + "name": [ + "Heavy", + "Large", + "Massive" + ], + "desc": [ + "The club is weighted well.", + "This club has a good bit of heft to it." + ], + "effect": "damage", + "strength": "1d3-1" + }, + "wep_damaged": { + "name": [ + "Damaged", + "Broken", + "Scratched", + "Dull" + ], + "desc": [ + "The weapon is not in the best of shape.", + "The weapon looks somewhat damaged." + ], + "effect": "damage", + "strength": "-1d2-1" + }, + "wep_goodShape": { + "name": [ + "Sharp", + "Well Maintained", + "Well Made" + ], + "desc": [ + "The weapon looks extremely sharp.", + "The weapon looks like it was well maintained.", + "The weapon is in good condition." + ], + "effect": "damage", + "strength": "1d3-1" + }, + "wep_polished": { + "name": [ + "Polished", + "Clean", + "Shiny" + ], + "desc": [ + "The weapon looks extremely shiny.", + "The weapon looks like it was cleaned recently." + ], + "effect": "worth", + "strength": "20" + } +} \ No newline at end of file diff --git a/src/res/official/modifiersList.json b/src/res/official/modifiersList.json deleted file mode 100644 index 5eb1632..0000000 --- a/src/res/official/modifiersList.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "strong":{ - "name":["Strong","Fit","Quick"], - "effect":"damage", - "strength":"1d2-1" - }, - "veryStrong":{ - "name":["Very Strong","Fast","Rugged"], - "effect":"damage", - "strength":"1d3-1" - }, - "weak":{ - "name":["Weak","Small","Lesser"], - "effect":"damage", - "strength":"-1d2-1" - }, - "veryWeak":{ - "name":["Very Weak","Tiny","Very Slow"], - "effect":"damage", - "strength":"-1d3-1" - }, - "sick":{ - "name":["Sickly","Unhealthy","Hurt"], - "effect":"health", - "strength":"-1d3" - }, - "dying":{ - "name":["Very Sick","Dying","Bloody"], - "effect":"health", - "strength":"-2d2" - } -} \ No newline at end of file diff --git a/src/res/official/quests/quest_beginnings.json b/src/res/official/quests/quest_beginnings.json new file mode 100644 index 0000000..0c151a2 --- /dev/null +++ b/src/res/official/quests/quest_beginnings.json @@ -0,0 +1,23 @@ +{ + "title":"A New Beginning", + "desc":"Who am I? Why did I wake up in the middle of nowhere? I should stick to trails until I find a village or town. I need to find someone who could help me figure this out.", + "qID":"Beginnings", + "devComments":"Starts immediately after exiting the starting area", + "spawnConditions":[ + ["inAreaId", "area_gen_forest_1"] + ], + "spawnChance":11, + "do":[ + ["say", "I should stick to trails until I find a village or town. I need to find someone who could help me figure this out."] + ], + "nextStep":{ + "requirements":[ + ["inAreaType", "Village Wall"] + ], + "do":[ + ["say", "Well, this quest isn't ready..."], + ["setDesc", "I did not prepare the rest of this quest yet... sorry."], + ["questComplete",true] + ] + } +} \ No newline at end of file diff --git a/src/res/official/quests/quest_robbed.json b/src/res/official/quests/quest_robbed.json index 8fa1192..7c61601 100644 --- a/src/res/official/quests/quest_robbed.json +++ b/src/res/official/quests/quest_robbed.json @@ -15,7 +15,7 @@ ["inAreaType","Enemy Land"] ], "do":[ - ["spawnEnemy","enemy_robbedQuestEnemy"], + ["spawnEnemy",["enemy_robbedQuestEnemy"]], ["say","The person that robbed the old man is here somewhere."] ], "nextStep":{ diff --git a/src/res/official/weapons/weapon_club.json b/src/res/official/weapons/weapon_club.json new file mode 100644 index 0000000..bc80ad4 --- /dev/null +++ b/src/res/official/weapons/weapon_club.json @@ -0,0 +1,21 @@ +{ + "name":[ + "Club", + "Wooden Club" + ], + "damage":"1d3+1", + "worthMin":5, + "worthMax":15, + "requiredHands":2, + "desc":[ + "A basic wooden club." + ], + "actionText":[ + "The club blurs as it is swung through the air." + ], + "modifierChance":75, + "modifierCount":"+1", + "modifiers":[ + ["wep_club_heavy","1d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/weapons/weapon_ironSword.json b/src/res/official/weapons/weapon_ironSword.json index d1820d3..562ed77 100644 --- a/src/res/official/weapons/weapon_ironSword.json +++ b/src/res/official/weapons/weapon_ironSword.json @@ -1,6 +1,6 @@ { "name":[ - "Scratched Iron Sword", + "Plain Iron Sword", "Iron Sword" ], "damage":"1d4+2", @@ -14,5 +14,11 @@ "actionText":[ "There is a blur as the sword swings through the air.", "The sword is silent as is is jabbed into its target." + ], + "modifierChance":100, + "modifierCount":"+1", + "modifiers":[ + ["wep_damaged","1d6"], + ["wep_goodShape","1d6"] ] } \ No newline at end of file diff --git a/src/res/official/weapons/weapon_starter_sword.json b/src/res/official/weapons/weapon_starter_sword.json new file mode 100644 index 0000000..437c81a --- /dev/null +++ b/src/res/official/weapons/weapon_starter_sword.json @@ -0,0 +1,18 @@ +{ + "name":[ + "Broken Sword", + "Shattered Sword" + ], + "damage":"1d3", + "worthMin":10, + "worthMax":20, + "requiredHands":2, + "desc":[ + "The blade of the sword is completely shattered. It will still deal damage, but do not expect it to deal much.", + "The sword is in good shape until you get to the shattered blade. It looks like it has as much of a chance to hurt its target as it does its own wielder." + ], + "actionText":[ + "There is a blur as the sword swings through the air.", + "The sword is silent as is is jabbed into its target." + ] +} \ No newline at end of file diff --git a/src/res/official/weapons/weapon_steelSword.json b/src/res/official/weapons/weapon_steelSword.json new file mode 100644 index 0000000..568c47e --- /dev/null +++ b/src/res/official/weapons/weapon_steelSword.json @@ -0,0 +1,25 @@ +{ + "name":[ + "Plain Steel Sword", + "Steel Sword" + ], + "damage":"1d4+2", + "worthMin":40, + "worthMax":60, + "requiredHands":2, + "desc":[ + "The iron gleams when light hits it.", + "The blade is scratched on the sides." + ], + "actionText":[ + "There is a blur as the sword swings through the air.", + "The sword is silent as is is jabbed into its target." + ], + "modifierChance":100, + "modifierCount":"+1", + "modifiers":[ + ["wep_damaged","1d5"], + ["wep_goodShape","1d6"], + ["wep_polished","1d6"] + ] +} \ No newline at end of file diff --git a/src/res/official/weapons/weapon_treeBranch.json b/src/res/official/weapons/weapon_treeBranch.json new file mode 100644 index 0000000..fd398f3 --- /dev/null +++ b/src/res/official/weapons/weapon_treeBranch.json @@ -0,0 +1,23 @@ +{ + "name":[ + "Tree Branch", + "Wooden Branch" + ], + "damage":"1d3", + "worthMin":0, + "worthMax":10, + "requiredHands":2, + "desc":[ + "A wooden tree branch covered in bark.", + "A tree branch covered in bark and moss." + ], + "actionText":[ + "The branch creaks as it is swung through the air." + ], + "modifierChance":75, + "modifierCount":"1d2", + "modifiers":[ + ["wep_branch_rotten","1d6"], + ["wep_branch_spiky","1d6"] + ] +} \ No newline at end of file diff --git a/src/res/settings.json b/src/res/settings.json index 873b538..836a42f 100644 --- a/src/res/settings.json +++ b/src/res/settings.json @@ -13,12 +13,12 @@ "GAMESETTINGS": [ [ "DELAYENABLED", - "Display Effects", + "[BROKEN] Display Effects", false ], [ "EVENTDELAYENABLED", - "Delay After Random Event", + "[BROKEN] Delay After Random Event", false ], [ @@ -30,6 +30,11 @@ "DEBUGDISPLAY", "Developer Display (Used for debugging)", false + ], + [ + "DISABLEENEMIES", + "Disable Enemy Encounters (Used for debugging)", + true ] ], "DATAPACKSETTINGS": { diff --git a/src/textGeneration.py b/src/textGeneration.py index 8a0ba88..629feee 100644 --- a/src/textGeneration.py +++ b/src/textGeneration.py @@ -15,6 +15,12 @@ def generateString(data=None, tag="name"): nameString = nameString.replace(command, replacement) return nameString +def generateDescription(descriptors, numDescriptorsToUse = 1): + string = "" + for i in range(numDescriptorsToUse): + string += random.choice(descriptors).getString() + return string + def _makeMarkovChain(dataInput=None): chain = "" if dataInput["markovType"] == "data": diff --git a/src/weaponClass.py b/src/weaponClass.py index a0944a7..5bfe698 100644 --- a/src/weaponClass.py +++ b/src/weaponClass.py @@ -1,8 +1,12 @@ + +import copy import random +from dieClass import rollDice + class Weapon(object): - def __init__(self, data=None): + def __init__(self, data=None, modifiers = None): # Decides whether or not the item is generated if "generated" in data.keys(): self.generated = data["generated"] @@ -24,6 +28,38 @@ def __init__(self, data=None): self.worth = random.randint(data["worthMin"],data["worthMax"]) else: self.worth = 0 + self.modifiers = [] + if "modifiers" in data.keys(): + # Get the chance of a modifier + if random.randint(0,100) < data["modifierChance"]: + # Get the number of modifers to add + modCount = rollDice(data["modifierCount"]) + + # Add the modifers: + possibleMods = copy.copy(data["modifiers"]) + for i in range(modCount): + if len(possibleMods) > 0: + highRoll = 0 + newMod = None + for mod in possibleMods: + newRoll = rollDice(mod[1]) + if newRoll > highRoll: + newMod = mod + highRoll = newRoll + if newMod: + possibleMods.remove(newMod) + newMod = modifiers[newMod[0]].getInfo() + self.name = "{} {}".format(newMod["n"], self.name) + if newMod["e"] == "damage": + self.damage += ";{}".format(newMod["s"]) + elif newMod["e"] == "worth": + self.worth += rollDice(newMod["s"]) + if "d" in newMod.keys(): + self.desc += " {}".format(newMod["d"]) + + def getAttack(self): + attack = rollDice(self.damage) + return attack def getAction(self): return random.choice(self.actionText) diff --git a/zipResources.py b/zipResources.py new file mode 100644 index 0000000..271dcd0 --- /dev/null +++ b/zipResources.py @@ -0,0 +1,12 @@ + +import os +import shutil + +print ("Python running...") + +print ("Grabbing datapack directories...") +subfolders = [ f.name for f in os.scandir("src/res/") if f.is_dir() ] +for folder in subfolders: + print ("\tZipping datapack '{}'".format(folder)) + shutil.make_archive("dist/res/{}".format(folder), 'zip', 'src/res/{}'.format(folder)) +print ("Python completed.")