From 8b785c032cf4eaeebee78d465099d527bdf174f0 Mon Sep 17 00:00:00 2001 From: Bryce Allen Date: Thu, 4 Mar 2021 12:53:45 -0500 Subject: [PATCH] mh4u: use db data, move to subdir --- mhapi/model.py | 14 +- web/index.html | 40 ++++- web/{ => mh4u}/outfitters.html | 0 web/{ => mh4u}/recommends.html | 8 +- web/{ => mh4u}/weaponlist.html | 239 ++++++++++++++++++++---------- web/{ => mh4u}/weaponplanner.html | 17 ++- web/templates/weaponstats.ejs | 11 ++ 7 files changed, 228 insertions(+), 101 deletions(-) rename web/{ => mh4u}/outfitters.html (100%) rename web/{ => mh4u}/recommends.html (94%) rename web/{ => mh4u}/weaponlist.html (58%) rename web/{ => mh4u}/weaponplanner.html (95%) diff --git a/mhapi/model.py b/mhapi/model.py index 0e568c8..5cab3f9 100644 --- a/mhapi/model.py +++ b/mhapi/model.py @@ -664,7 +664,8 @@ class ItemStars(object): if stars is not None: return stars - stars = dict(Village=None, Guild=None, Permit=None, Arena=None) + stars = dict(Village=None, Guild=None, Permit=None, Arena=None, + Event=None) costs = get_costs(self.db, weapon) # find least 'expensive' path for c in costs: @@ -679,7 +680,7 @@ class ItemStars(object): def _get_component_stars(self, c): # need to track unititialized vs unavailable - stars = dict(Village=0, Guild=0, Permit=0, Arena=0) + stars = dict(Village=0, Guild=0, Permit=0, Arena=0, Event=0) for item_name in c["components"].keys(): item = self.db.get_item_by_name(item_name) if item.type == "Materials": @@ -716,7 +717,8 @@ class ItemStars(object): if stars is not None: return stars - stars = dict(Village=None, Guild=None, Permit=None, Arena=None) + stars = dict(Village=None, Guild=None, Permit=None, Arena=None, + Event=None) rows = self.db.get_material_items(material_item_id) for row in rows: item = self.db.get_item(row["item_id"]) @@ -732,7 +734,8 @@ class ItemStars(object): if stars is not None: return stars - stars = dict(Village=None, Guild=None, Permit=None, Arena=None) + stars = dict(Village=None, Guild=None, Permit=None, Arena=None, + Event=None) quests = self.db.get_item_quests(item_id) @@ -754,6 +757,9 @@ class ItemStars(object): # find least expensive quest for getting the item for quest in quests: + if quest.hub == "Caravan": + # For mh4u, map Caravan->Village + quest.hub = "Village" if quest.stars == 0: # ignore training quests if "Training" not in quest.name: diff --git a/web/index.html b/web/index.html index d864077..ed2ba45 100644 --- a/web/index.html +++ b/web/index.html @@ -44,20 +44,20 @@ -
+
Poogie Recommends + >Poogie Recommends (4U)

-
+
Poogie's Weapon Planner + >Poogie's Weapon Planner (4U) @@ -84,16 +84,40 @@ +
Weapon Search: + (MH4U, + MHX, + MHGen, + MHGU)
- Poogie Outfitters - Armor set planner + Poogie Outfitters (4U) + Armor set planner

- Poogie トランスレーター - English to Japanese translation guide + Poogie トランスレーター (MHX) + English to Japanese translation guide (mobile friendly)
+ +

Acknowledgements

+Data is primary from the excellent 4U and Gen android apps: + + +Also sourced for MHX translation and weapon data: + + +
+If you find errors or have suggestions, email poogie at mhapi.info, +or contact /u/bda82 on reddit. diff --git a/web/outfitters.html b/web/mh4u/outfitters.html similarity index 100% rename from web/outfitters.html rename to web/mh4u/outfitters.html diff --git a/web/recommends.html b/web/mh4u/recommends.html similarity index 94% rename from web/recommends.html rename to web/mh4u/recommends.html index 32239e3..1afaef5 100644 --- a/web/recommends.html +++ b/web/mh4u/recommends.html @@ -1,13 +1,13 @@ - Poogie Recommends + Poogie Recommends (4U) - + @@ -342,6 +390,48 @@ + + + + + + + +