Skip to content

Commit

Permalink
Weekly update even without the game update
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
osrsbox committed Feb 12, 2021
1 parent efdeb12 commit fa60b3f
Show file tree
Hide file tree
Showing 119 changed files with 10,504 additions and 10,532 deletions.
50 changes: 33 additions & 17 deletions builders/items/build_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ def populate_non_wiki_item(self):
self.item_dict["equipable_weapon"] = False
self.item_dict["incomplete"] = True

self.item_dict["icon"] = self.icons[self.item_id_str]
try:
self.item_dict["icon"] = self.icons[self.item_id_str]
except KeyError:
self.item_dict["icon"] = self.icons["blank"]

def populate_wiki_item(self):
self.populate_from_cache_data()
Expand All @@ -212,7 +215,10 @@ def populate_wiki_item(self):
self.item_dict["equipable_by_player"] = False
self.item_dict["equipable_weapon"] = False

self.item_dict["icon"] = self.icons[self.item_id_str]
try:
self.item_dict["icon"] = self.icons[self.item_id_str]
except KeyError:
self.item_dict["icon"] = self.icons["blank"]

def populate_from_cache_data(self):
"""Populate an item using raw cache data.
Expand Down Expand Up @@ -504,27 +510,37 @@ def populate_from_wiki_data_equipment(self) -> bool:
if attack_speed is not None:
self.item_dict["weapon"]["attack_speed"] = infobox_cleaner.caller(attack_speed, "speed")
else:
print(">>> populate_from_wiki_data_equipment: No attack_speed")
exit(1)
# If not present, set to 0
self.item_dict["weapon"]["attack_speed"] = 0

# Weapon type
# Extract the CombatStyles template
infobox_combat_parser = WikitextTemplateParser(self.item_wikitext)
has_infobox = infobox_combat_parser.extract_infobox("combatstyles")
if not has_infobox:
# No combatstyles template found for the item!
print("populate_from_wiki_data_equipment: No combatstyles")
exit(1)

# Set the infobox bonuses template
combat_template = infobox_combat_parser.template
weapon_type = infobox_cleaner.caller(combat_template, "weapon_type")
self.item_dict["weapon"]["weapon_type"] = weapon_type
try:
self.item_dict["weapon"]["stances"] = self.weapon_stances[weapon_type]
except KeyError:
print("populate_from_wiki_data_equipment: Weapon type error")
exit(1)
if has_infobox:
# There is a combatstyles infobox, parse it
# Set the infobox bonuses template
combat_template = infobox_combat_parser.template
weapon_type = infobox_cleaner.caller(combat_template, "weapon_type")
weapon_type = weapon_type.lower()
self.item_dict["weapon"]["weapon_type"] = weapon_type
try:
self.item_dict["weapon"]["stances"] = self.weapon_stances[weapon_type]
except KeyError:
print("populate_from_wiki_data_equipment: Weapon type error")
exit(1)

else:
# No combatstyles infobox, try get data from bonuses
weapon_type = self.extract_infobox_value(bonuses_template, "combatstyle")
weapon_type = weapon_type.lower()
self.item_dict["weapon"]["weapon_type"] = weapon_type
try:
self.item_dict["weapon"]["stances"] = self.weapon_stances[weapon_type]
except KeyError:
print("populate_from_wiki_data_equipment: Weapon type error")
exit(1)

# Finally, set the equipable_weapon property to true
self.item_dict["equipable_weapon"] = True
Expand Down
19,377 changes: 9,689 additions & 9,688 deletions data/icons/icons-items-complete.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/items/items-buylimits.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"%LAST_UPDATE%": 1612362870,
"%LAST_UPDATE%": 1612963355,
"3rd age amulet": 8,
"3rd age axe": 40,
"3rd age bow": 8,
Expand Down
4 changes: 4 additions & 0 deletions data/items/items-duplicates.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@
"20782": {
"name": "Bandos godsword (Misthalin Mystery)",
"duplicate": true
},
"21913": {
"name": "Mythical cape",
"duplicate": true
}
}
258 changes: 129 additions & 129 deletions data/items/items-wiki-page-text.json

Large diffs are not rendered by default.

Loading

0 comments on commit fa60b3f

Please sign in to comment.