From dbcd0118863ff3e7c5bee45041ccdb757eb2f366 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 22 Aug 2023 16:37:33 +0200 Subject: areas and town/shop setup --- db/_generated/areas/city-park.json | 1 + db/_generated/areas/cotton-town.json | 1 + db/_generated/areas/leather-town.json | 1 + db/_generated/areas/paper-town.json | 2 +- db/_generated/areas/route1.json | 2 +- db/_generated/areas/route2.json | 2 +- db/_generated/areas/route3.json | 2 +- db/areas/city-park.json | 40 +++++++++++++++++++++ db/areas/cotton-town.json | 31 ++++++++++++++++ db/areas/leather-town.json | 21 +++++++++++ db/areas/paper-town.json | 17 +++++++-- db/areas/route1.json | 14 ++++++-- db/areas/route2.json | 35 ++++++++++++++++-- db/areas/route3.json | 24 +++++++++++-- index.html | 22 ++++++++---- resources/css/page.css | 4 +++ resources/css/town.css | 3 ++ resources/js/classes/Area.js | 8 ++--- resources/js/classes/State.js | 4 +-- resources/js/db.js | 5 ++- resources/js/game.js | 68 +++++++++++++++++++++-------------- resources/js/main.js | 7 ++-- resources/js/ui.js | 65 +++++++++++++++++++++++++-------- 23 files changed, 305 insertions(+), 74 deletions(-) create mode 100644 db/_generated/areas/city-park.json create mode 100644 db/_generated/areas/cotton-town.json create mode 100644 db/_generated/areas/leather-town.json create mode 100644 db/areas/city-park.json create mode 100644 db/areas/cotton-town.json create mode 100644 db/areas/leather-town.json create mode 100644 resources/css/town.css diff --git a/db/_generated/areas/city-park.json b/db/_generated/areas/city-park.json new file mode 100644 index 0000000..41fe761 --- /dev/null +++ b/db/_generated/areas/city-park.json @@ -0,0 +1 @@ +{"encounter_slug":"citypark","encounters":[{"monster":"cardiling","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[5,8]},{"monster":"cardiwing","encounter_rate":1,"daytime":true,"exp_req_mod":1,"level_range":[8,11]},{"monster":"cataspike","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[6,9]},{"monster":"eyenemy","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[5,8]},{"monster":"axylightl","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[8,12]},{"monster":"tourbidi","encounter_rate":1,"daytime":false,"exp_req_mod":1,"level_range":[8,12]},{"monster":"squabbit","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[8,12]},{"monster":"puparmor","encounter_rate":1,"daytime":false,"exp_req_mod":1,"level_range":[9,14]}],"requiredEncounters":10,"trainers":[{"name":"Frances","sprite":"florist.png","monsters":[{"slug":"shybulb","level":8},{"slug":"shybulb","level":8}],"inventory":[]}],"environment_slug":"forest","connections":{"route2":{"conditions":[]},"leather-town":{"conditions":["encounters","trainers"]}},"environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/_generated/areas/cotton-town.json b/db/_generated/areas/cotton-town.json new file mode 100644 index 0000000..3956bc8 --- /dev/null +++ b/db/_generated/areas/cotton-town.json @@ -0,0 +1 @@ +{"encounter_slug":"","encounters":[],"requiredEncounters":0,"trainers":[],"environment_slug":"interior","events":{"dryads-grove":false},"connections":{"route1":{"conditions":[]},"route2":{"conditions":[]},"dryads-grove":{"conditions":["event.dryads-grove"]}},"environment":{"slug":"interior","battle_graphics":{"island_back":"paper_back_island.png","island_front":"paper_front_island.png","background":"battle_bg03.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/_generated/areas/leather-town.json b/db/_generated/areas/leather-town.json new file mode 100644 index 0000000..cf191d6 --- /dev/null +++ b/db/_generated/areas/leather-town.json @@ -0,0 +1 @@ +{"encounter_slug":"","encounters":[],"requiredEncounters":0,"trainers":[],"environment_slug":"interior","connections":{"city-park":{"conditions":[]},"route3":{"conditions":[]}},"environment":{"slug":"interior","battle_graphics":{"island_back":"paper_back_island.png","island_front":"paper_front_island.png","background":"battle_bg03.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/_generated/areas/paper-town.json b/db/_generated/areas/paper-town.json index c569938..8c0f0d4 100644 --- a/db/_generated/areas/paper-town.json +++ b/db/_generated/areas/paper-town.json @@ -1 +1 @@ -{"encounter_slug":"","encounters":[],"requiredEncounters":0,"trainers":[{"name":"Rival","monsters":[],"inventory":[]}],"environment_slug":"interior","previousArea":"","nextArea":"route1","environment":{"slug":"interior","battle_graphics":{"island_back":"paper_back_island.png","island_front":"paper_front_island.png","background":"battle_bg03.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file +{"encounter_slug":"","encounters":[],"requiredEncounters":0,"trainers":[{"name":"Rival","monsters":[{"slug":"STARTER","level":2}],"inventory":[]}],"environment_slug":"interior","connections":{"route1":{"conditions":["encounters","trainers"]}},"environment":{"slug":"interior","battle_graphics":{"island_back":"paper_back_island.png","island_front":"paper_front_island.png","background":"battle_bg03.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/_generated/areas/route1.json b/db/_generated/areas/route1.json index 3956a3c..a7c9987 100644 --- a/db/_generated/areas/route1.json +++ b/db/_generated/areas/route1.json @@ -1 +1 @@ -{"encounter_slug":"route1","encounters":[{"monster":"pairagrin","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]},{"monster":"aardorn","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]},{"monster":"cataspike","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]},{"monster":"pairagrin","encounter_rate":3.5,"daytime":false,"exp_req_mod":1,"level_range":[3,5]},{"monster":"aardorn","encounter_rate":3.5,"daytime":false,"exp_req_mod":1,"level_range":[3,5]},{"monster":"cataspike","encounter_rate":3.5,"daytime":false,"exp_req_mod":1,"level_range":[3,5]}],"requiredEncounters":10,"trainers":[{"name":"Bruder Mikki","sprite":"dragonrider.png","monsters":[{"slug":"memnomnom","level":5},{"slug":"jelillow","level":5}],"inventory":[{"slug":"potion","quantity":2}]}],"environment_slug":"forest","previousArea":"paper-town","nextArea":"route2","environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file +{"encounter_slug":"route1","encounters":[{"monster":"pairagrin","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]},{"monster":"aardorn","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]},{"monster":"cataspike","encounter_rate":3.5,"daytime":true,"exp_req_mod":1,"level_range":[2,4]},{"monster":"pairagrin","encounter_rate":3.5,"daytime":false,"exp_req_mod":1,"level_range":[3,5]},{"monster":"aardorn","encounter_rate":3.5,"daytime":false,"exp_req_mod":1,"level_range":[3,5]},{"monster":"cataspike","encounter_rate":3.5,"daytime":false,"exp_req_mod":1,"level_range":[3,5]}],"requiredEncounters":10,"trainers":[{"name":"Bruder Mikki","sprite":"dragonrider.png","monsters":[{"slug":"memnomnom","level":5},{"slug":"jelillow","level":5}],"inventory":[{"slug":"potion","quantity":2}]}],"environment_slug":"forest","connections":{"paper-town":{"conditions":[]},"cotton-town":{"conditions":["encounters","trainers"]}},"environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/_generated/areas/route2.json b/db/_generated/areas/route2.json index 2b4a00f..719fc7a 100644 --- a/db/_generated/areas/route2.json +++ b/db/_generated/areas/route2.json @@ -1 +1 @@ -{"encounter_slug":"route2","encounters":[{"monster":"cardiling","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"aardorn","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"eyenemy","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"axylightl","encounter_rate":1,"daytime":true,"exp_req_mod":1,"level_range":[4,7]},{"monster":"cataspike","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"cardiling","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[3,6]},{"monster":"aardorn","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[4,8]},{"monster":"eyenemy","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[4,8]},{"monster":"axylightl","encounter_rate":1,"daytime":false,"exp_req_mod":1,"level_range":[5,8]},{"monster":"cataspike","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[4,8]}],"requiredEncounters":10,"trainers":[],"environment_slug":"forest","previousArea":"route1","nextArea":"route3","environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file +{"encounter_slug":"route2","encounters":[{"monster":"cardiling","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"aardorn","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"eyenemy","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"axylightl","encounter_rate":1,"daytime":true,"exp_req_mod":1,"level_range":[4,7]},{"monster":"cataspike","encounter_rate":2.5,"daytime":true,"exp_req_mod":1,"level_range":[3,6]},{"monster":"cardiling","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[3,6]},{"monster":"aardorn","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[4,8]},{"monster":"eyenemy","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[4,8]},{"monster":"axylightl","encounter_rate":1,"daytime":false,"exp_req_mod":1,"level_range":[5,8]},{"monster":"cataspike","encounter_rate":2.5,"daytime":false,"exp_req_mod":1,"level_range":[4,8]}],"requiredEncounters":10,"trainers":[{"name":"Rival","monsters":[{"slug":"cardiling","level":3},{"slug":"eyenemy","level":6},{"slug":"STARTER","level":6}],"inventory":[]}],"environment_slug":"forest","connections":{"cotton-town":{"conditions":[]},"city-park":{"conditions":["encounters","trainers"]}},"environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/_generated/areas/route3.json b/db/_generated/areas/route3.json index 45a32f0..6d248cc 100644 --- a/db/_generated/areas/route3.json +++ b/db/_generated/areas/route3.json @@ -1 +1 @@ -{"encounter_slug":"route3","encounters":[{"monster":"cardiling","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[7,10]},{"monster":"elofly","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[7,10]},{"monster":"squabbit","encounter_rate":1,"daytime":true,"exp_req_mod":1,"level_range":[8,11]},{"monster":"shybulb","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[7,10]},{"monster":"cardiling","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[9,12]},{"monster":"elofly","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[9,12]},{"monster":"squabbit","encounter_rate":1,"daytime":false,"exp_req_mod":1,"level_range":[9,12]},{"monster":"shybulb","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[9,12]}],"requiredEncounters":10,"trainers":[],"environment_slug":"forest","previousArea":"route2","nextArea":"route4","environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file +{"encounter_slug":"route3","encounters":[{"monster":"cardiling","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[7,10]},{"monster":"elofly","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[7,10]},{"monster":"squabbit","encounter_rate":1,"daytime":true,"exp_req_mod":1,"level_range":[8,11]},{"monster":"shybulb","encounter_rate":3,"daytime":true,"exp_req_mod":1,"level_range":[7,10]},{"monster":"cardiling","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[9,12]},{"monster":"elofly","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[9,12]},{"monster":"squabbit","encounter_rate":1,"daytime":false,"exp_req_mod":1,"level_range":[9,12]},{"monster":"shybulb","encounter_rate":3,"daytime":false,"exp_req_mod":1,"level_range":[9,12]}],"requiredEncounters":10,"trainers":[{"name":"Miner Roxby","sprite":"miner.png","monsters":[{"slug":"rockitten","level":13},{"slug":"ignibus","level":13}]}],"environment_slug":"forest","connections":{"leather-town":{"conditions":[]}},"environment":{"slug":"forest","battle_graphics":{"island_back":"woodland_island.png","island_front":"woodland_island.png","background":"forest_background.png"},"battle_music":"music_battle_loop"}} \ No newline at end of file diff --git a/db/areas/city-park.json b/db/areas/city-park.json new file mode 100644 index 0000000..113cf51 --- /dev/null +++ b/db/areas/city-park.json @@ -0,0 +1,40 @@ +{ + "encounter_slug": "citypark", + + "encounters": [], + + "requiredEncounters": 10, + + "trainers": [ + { + "name": "Frances", + "sprite": "florist.png", + "monsters": [ + { + "slug": "shybulb", + "level": 8 + }, + { + "slug": "shybulb", + "level": 8 + } + ], + "inventory": [] + } + ], + + "environment_slug": "forest", + + "connections": { + "route2": { + "conditions": [] + }, + + "leather-town": { + "conditions": [ + "encounters", + "trainers" + ] + } + } +} diff --git a/db/areas/cotton-town.json b/db/areas/cotton-town.json new file mode 100644 index 0000000..dfd73e5 --- /dev/null +++ b/db/areas/cotton-town.json @@ -0,0 +1,31 @@ +{ + "encounter_slug": "", + + "encounters": [], + + "requiredEncounters": 0, + + "trainers": [], + + "environment_slug": "interior", + + "events": { + "dryads-grove": false + }, + + "connections": { + "route1": { + "conditions": [] + }, + + "route2": { + "conditions": [] + }, + + "dryads-grove": { + "conditions": [ + "event.dryads-grove" + ] + } + } +} diff --git a/db/areas/leather-town.json b/db/areas/leather-town.json new file mode 100644 index 0000000..7815dfd --- /dev/null +++ b/db/areas/leather-town.json @@ -0,0 +1,21 @@ +{ + "encounter_slug": "", + + "encounters": [], + + "requiredEncounters": 0, + + "trainers": [], + + "environment_slug": "interior", + + "connections": { + "city-park": { + "conditions": [] + }, + + "route3": { + "conditions": [] + } + } +} diff --git a/db/areas/paper-town.json b/db/areas/paper-town.json index b18e17e..7020252 100644 --- a/db/areas/paper-town.json +++ b/db/areas/paper-town.json @@ -8,13 +8,24 @@ "trainers": [ { "name": "Rival", - "monsters": [], + "monsters": [ + { + "slug": "STARTER", + "level": 2 + } + ], "inventory": [] } ], "environment_slug": "interior", - "previousArea": "", - "nextArea": "route1" + "connections": { + "route1": { + "conditions": [ + "encounters", + "trainers" + ] + } + } } diff --git a/db/areas/route1.json b/db/areas/route1.json index 3d1cf23..1615772 100644 --- a/db/areas/route1.json +++ b/db/areas/route1.json @@ -30,6 +30,16 @@ "environment_slug": "forest", - "previousArea": "paper-town", - "nextArea": "route2" + "connections": { + "paper-town": { + "conditions": [] + }, + + "cotton-town": { + "conditions": [ + "encounters", + "trainers" + ] + } + } } diff --git a/db/areas/route2.json b/db/areas/route2.json index f4fc9bb..e4c6d2a 100644 --- a/db/areas/route2.json +++ b/db/areas/route2.json @@ -5,10 +5,39 @@ "requiredEncounters": 10, - "trainers": [], + "trainers": [ + { + "name": "Rival", + "monsters": [ + { + "slug": "cardiling", + "level": 3 + }, + { + "slug": "eyenemy", + "level": 6 + }, + { + "slug": "STARTER", + "level": 6 + } + ], + "inventory": [] + } + ], "environment_slug": "forest", - "previousArea": "route1", - "nextArea": "route3" + "connections": { + "cotton-town": { + "conditions": [] + }, + + "city-park": { + "conditions": [ + "encounters", + "trainers" + ] + } + } } diff --git a/db/areas/route3.json b/db/areas/route3.json index e9242fb..3fa7c2f 100644 --- a/db/areas/route3.json +++ b/db/areas/route3.json @@ -5,10 +5,28 @@ "requiredEncounters": 10, - "trainers": [], + "trainers": [ + { + "name": "Miner Roxby", + "sprite": "miner.png", + "monsters": [ + { + "slug": "rockitten", + "level": 13 + }, + { + "slug": "ignibus", + "level": 13 + } + ] + } + ], "environment_slug": "forest", - "previousArea": "route2", - "nextArea": "route4" + "connections": { + "leather-town": { + "conditions": [] + } + } } diff --git a/index.html b/index.html index e575ec8..0cd65fe 100644 --- a/index.html +++ b/index.html @@ -7,20 +7,30 @@ +
-
-
- +
+
+
+ +
+ +
-
+
-
+
@@ -29,7 +39,7 @@ - +