Skip to content

Commit fa60b3f

Browse files
committed
Weekly update even without the game update
* Fixed Mythical cape duplicate issue which closes #206 * Fixed missing item icon issue which closes #187 * Fixed Cave horro black mask drop which closes #204 * Did speciefied weekly updates which closes #205 * No major changes to items/monsters, only a couple updates from new wiki data * Pushed PyPi version 2.0.7
1 parent efdeb12 commit fa60b3f

File tree

119 files changed

+10504
-10532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+10504
-10532
lines changed

builders/items/build_item.py

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ def populate_non_wiki_item(self):
200200
self.item_dict["equipable_weapon"] = False
201201
self.item_dict["incomplete"] = True
202202

203-
self.item_dict["icon"] = self.icons[self.item_id_str]
203+
try:
204+
self.item_dict["icon"] = self.icons[self.item_id_str]
205+
except KeyError:
206+
self.item_dict["icon"] = self.icons["blank"]
204207

205208
def populate_wiki_item(self):
206209
self.populate_from_cache_data()
@@ -212,7 +215,10 @@ def populate_wiki_item(self):
212215
self.item_dict["equipable_by_player"] = False
213216
self.item_dict["equipable_weapon"] = False
214217

215-
self.item_dict["icon"] = self.icons[self.item_id_str]
218+
try:
219+
self.item_dict["icon"] = self.icons[self.item_id_str]
220+
except KeyError:
221+
self.item_dict["icon"] = self.icons["blank"]
216222

217223
def populate_from_cache_data(self):
218224
"""Populate an item using raw cache data.
@@ -504,27 +510,37 @@ def populate_from_wiki_data_equipment(self) -> bool:
504510
if attack_speed is not None:
505511
self.item_dict["weapon"]["attack_speed"] = infobox_cleaner.caller(attack_speed, "speed")
506512
else:
507-
print(">>> populate_from_wiki_data_equipment: No attack_speed")
508-
exit(1)
513+
# If not present, set to 0
514+
self.item_dict["weapon"]["attack_speed"] = 0
509515

510516
# Weapon type
511517
# Extract the CombatStyles template
512518
infobox_combat_parser = WikitextTemplateParser(self.item_wikitext)
513519
has_infobox = infobox_combat_parser.extract_infobox("combatstyles")
514-
if not has_infobox:
515-
# No combatstyles template found for the item!
516-
print("populate_from_wiki_data_equipment: No combatstyles")
517-
exit(1)
518520

519-
# Set the infobox bonuses template
520-
combat_template = infobox_combat_parser.template
521-
weapon_type = infobox_cleaner.caller(combat_template, "weapon_type")
522-
self.item_dict["weapon"]["weapon_type"] = weapon_type
523-
try:
524-
self.item_dict["weapon"]["stances"] = self.weapon_stances[weapon_type]
525-
except KeyError:
526-
print("populate_from_wiki_data_equipment: Weapon type error")
527-
exit(1)
521+
if has_infobox:
522+
# There is a combatstyles infobox, parse it
523+
# Set the infobox bonuses template
524+
combat_template = infobox_combat_parser.template
525+
weapon_type = infobox_cleaner.caller(combat_template, "weapon_type")
526+
weapon_type = weapon_type.lower()
527+
self.item_dict["weapon"]["weapon_type"] = weapon_type
528+
try:
529+
self.item_dict["weapon"]["stances"] = self.weapon_stances[weapon_type]
530+
except KeyError:
531+
print("populate_from_wiki_data_equipment: Weapon type error")
532+
exit(1)
533+
534+
else:
535+
# No combatstyles infobox, try get data from bonuses
536+
weapon_type = self.extract_infobox_value(bonuses_template, "combatstyle")
537+
weapon_type = weapon_type.lower()
538+
self.item_dict["weapon"]["weapon_type"] = weapon_type
539+
try:
540+
self.item_dict["weapon"]["stances"] = self.weapon_stances[weapon_type]
541+
except KeyError:
542+
print("populate_from_wiki_data_equipment: Weapon type error")
543+
exit(1)
528544

529545
# Finally, set the equipable_weapon property to true
530546
self.item_dict["equipable_weapon"] = True

data/icons/icons-items-complete.json

Lines changed: 9689 additions & 9688 deletions
Large diffs are not rendered by default.

data/items/items-buylimits.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"%LAST_UPDATE%": 1612362870,
2+
"%LAST_UPDATE%": 1612963355,
33
"3rd age amulet": 8,
44
"3rd age axe": 40,
55
"3rd age bow": 8,

data/items/items-duplicates.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,9 @@
3838
"20782": {
3939
"name": "Bandos godsword (Misthalin Mystery)",
4040
"duplicate": true
41+
},
42+
"21913": {
43+
"name": "Mythical cape",
44+
"duplicate": true
4145
}
4246
}

data/items/items-wiki-page-text.json

Lines changed: 129 additions & 129 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)