Skip to content

Commit

Permalink
Removed stat requirements from armor.
Browse files Browse the repository at this point in the history
  • Loading branch information
justindz committed Sep 12, 2021
1 parent 43952e6 commit 8a7aa65
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 55 deletions.
24 changes: 0 additions & 24 deletions armor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ class Armor(Document):
'bonus_electricity_res': float,
'bonus_water_res': float,
'value': int,
'required_strength': int,
'required_intelligence': int,
'required_dexterity': int,
'required_willpower': int,
}
required_fields = [
'name',
Expand All @@ -59,10 +55,6 @@ class Armor(Document):
'bonus_electricity_res',
'bonus_water_res',
'value',
'required_strength',
'required_intelligence',
'required_dexterity',
'required_willpower'
]
default_values = {
'bonus_strength': 0,
Expand All @@ -81,10 +73,6 @@ class Armor(Document):
'bonus_fire_res': 0.0,
'bonus_electricity_res': 0.0,
'bonus_water_res': 0.0,
'required_strength': 0,
'required_intelligence': 0,
'required_dexterity': 0,
'required_willpower': 0,
}
use_dot_notation = True
use_autorefs = True
Expand Down Expand Up @@ -112,18 +100,6 @@ def get_bonuses_display_string(item):


prefixes = {
'Streamlined': {
1: {'effect': 'required_strength', 'value': -1}
},
'Striking': {
1: {'effect': 'required_intelligence', 'value': -1}
},
'Fitted': {
1: {'effect': 'required_dexterity', 'value': -1}
},
'Pious': {
1: {'effect': 'required_willpower', 'value': -1}
},
'Collectible': {
1: {'effect': 'value', 'value': 30}
},
Expand Down
163 changes: 150 additions & 13 deletions armors.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
'level': 3,
'weight': 2,
'_itype': 2,
'bonus_init': 1
'bonus_init': 1,
'bonus_electric_res': 0.01,
},
'cloth_armor': {
'name': 'Cloth Armor',
Expand All @@ -52,25 +53,75 @@
'weight': 3,
'_itype': 3,
'bonus_init': 1,
'bonus_carry': 10
'bonus_carry': 10,
'bonus_electric_res': 0.01,
},
'cloth_boots': {
'name': 'Cloth Boots',
'description': 'TODO',
'level': 3,
'weight': 2,
'_itype': 5,
'bonus_init': 1
'bonus_init': 1,
'bonus_electric_res': 0.01,
},
'cloth_gloves': {
'name': 'Cloth Gloves',
'description': 'TODO',
'level': 3,
'weight': 2,
'_itype': 6,
'bonus_init': 1
'bonus_init': 1,
'bonus_electric_res': 0.01,
},
# 5 - Boiled Leather
'boiled_leather_helm': {
'name': 'Boiled Leather Helm',
'description': 'TODO',
'level': 5,
'weight': 4,
'_itype': 2,
'bonus_earth_res': 0.01,
'bonus_fire_res': 0.01,
'bonus_electric_res': 0.01,
'bonus_water_res': 0.01,
},
'boiled_leather_armor': {
'name': 'Boiled Leather Armor',
'description': 'TODO',
'level': 5,
'weight': 8,
'_itype': 3,
'bonus_carry': 20,
'bonus_earth_res': 0.01,
'bonus_fire_res': 0.01,
'bonus_electric_res': 0.01,
'bonus_water_res': 0.01,
},
'boiled_leather_boots': {
'name': 'Boiled Leather Boots',
'description': 'TODO',
'level': 5,
'weight': 4,
'_itype': 5,
'bonus_init': 1,
'bonus_earth_res': 0.01,
'bonus_fire_res': 0.01,
'bonus_electric_res': 0.01,
'bonus_water_res': 0.01,
},
'boiled_leather_gloves': {
'name': 'Boiled Leather Gloves',
'description': 'TODO',
'level': 5,
'weight': 4,
'_itype': 6,
'bonus_init': 1,
'bonus_earth_res': 0.01,
'bonus_fire_res': 0.01,
'bonus_electric_res': 0.01,
'bonus_water_res': 0.01,
},
# 7 - Studded Leather
# 9 - Chainmail
# ----- Heavy ------
Expand All @@ -83,7 +134,6 @@
'_itype': 2,
'bonus_init': -1,
'bonus_earth_res': 0.01,
'required_strength': 3
},
'rusty_armor': {
'name': 'Rusty Armor',
Expand All @@ -94,7 +144,6 @@
'bonus_init': -1,
'bonus_carry': 10,
'bonus_earth_res': 0.01,
'required_strength': 3
},
'rusty_boots': {
'name': 'Rusty Boots',
Expand All @@ -103,7 +152,6 @@
'weight': 3,
'_itype': 5,
'bonus_earth_res': 0.01,
'required_strength': 3
},
'rusty_gauntlets': {
'name': 'Rusty Gauntlets',
Expand All @@ -112,7 +160,6 @@
'weight': 3,
'_itype': 6,
'bonus_earth_res': 0.01,
'required_strength': 3
},
# 3 - Wood
'wood_helmet': {
Expand All @@ -125,7 +172,6 @@
'bonus_earth_res': 0.01,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'required_strength': 3
},
'wood_armor': {
'name': 'Wooden Armor',
Expand All @@ -138,7 +184,6 @@
'bonus_earth_res': 0.01,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'required_strength': 3
},
'wood_guards': {
'name': 'Wooden Guards',
Expand All @@ -149,7 +194,6 @@
'bonus_earth_res': 0.01,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'required_strength': 3
},
'wood_gloves': {
'name': 'Wooden Padded Gloves',
Expand All @@ -158,12 +202,105 @@
'weight': 2,
'_itype': 6,
'bonus_earth_res': 0.01,
'bonus_fire_res': 0.0,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'required_strength': 3
},
# 5 - Bronze
'bronze_helmet': {
'name': 'Bronze Helmet',
'description': 'TODO',
'level': 5,
'weight': 8,
'_itype': 2,
'bonus_init': -1,
'bonus_earth_res': 0.02,
'bonus_fire_res': 0.02,
'bonus_water_res': 0.01,
},
'bronze_armor': {
'name': 'Bronze Armor',
'description': 'TODO',
'level': 5,
'weight': 15,
'_itype': 3,
'bonus_init': -2,
'bonus_carry': 10,
'bonus_earth_res': 0.02,
'bonus_fire_res': 0.02,
'bonus_water_res': 0.01,
},
'bronze_sabotons': {
'name': 'Bronze Sabotons',
'description': 'TODO',
'level': 5,
'weight': 7,
'_itype': 5,
'bonus_earth_res': 0.02,
'bonus_fire_res': 0.02,
'bonus_water_res': 0.01,
},
'bronze_gloves': {
'name': 'Bronze Padded Gloves',
'description': 'TODO',
'level': 5,
'weight': 5,
'_itype': 6,
'bonus_earth_res': 0.02,
'bonus_fire_res': 0.02,
'bonus_water_res': 0.01,
},
# 7 - Iron
# 9 - Steel
# ----- Ceremonial -----
# 3
'worn_headband': {
'name': 'Worn Headband',
'description': 'TODO',
'level': 3,
'weight': 3,
'_itype': 2,
'bonus_stamina_regen': 1,
},
'worn_coat': {
'name': 'Worn Coat',
'description': 'TODO',
'level': 3,
'weight': 3,
'_itype': 3,
'bonus_carry': 10,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'bonus_stamina': 10,
},
'worn_hakama': {
'name': 'Worn Hakama',
'description': 'TODO',
'level': 3,
'weight': 3,
'_itype': 5,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'bonus_stamina': 10,
},
# ----- Spiritual -----
# 3
'vine_circlet': {
'name': 'Vine Circlet',
'description': 'TODO',
'level': 3,
'weight': 3,
'_itype': 2,
'bonus_mana_regen': 1,
},
'fur_robe': {
'name': 'Fur Robe',
'description': 'TODO',
'level': 3,
'weight': 4,
'_itype': 3,
'bonus_carry': 10,
'bonus_electricity_res': 0.01,
'bonus_water_res': 0.01,
'bonus_mana': 20,
},
}
17 changes: 9 additions & 8 deletions character.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,18 @@ def equip(self, item):
if self.level < item['level']:
return False

if self.strength + self.bonus_strength < item['required_strength']:
return False
if item['_itype'] == ItemType.weapon.value:
if self.strength + self.bonus_strength < item['required_strength']:
return False

if self.intelligence + self.bonus_intelligence < item['required_intelligence']:
return False
if self.intelligence + self.bonus_intelligence < item['required_intelligence']:
return False

if self.dexterity + self.bonus_dexterity < item['required_dexterity']:
return False
if self.dexterity + self.bonus_dexterity < item['required_dexterity']:
return False

if self.willpower + self.bonus_willpower < item['required_willpower']:
return False
if self.willpower + self.bonus_willpower < item['required_willpower']:
return False

slot = ItemType(item['_itype']).name

Expand Down
2 changes: 1 addition & 1 deletion enemies.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
'lust_demon':
Enemy('Lust Demon',
[
SingleTargetAttack('Sensuous Embrace', 0, 0.05, [
SingleTargetAttack('Fluid Embrace', 0, 0.05, [
Effect(EffectType.damage_health, Elements.water, _dice_value=6),
Effect(EffectType.damage_health, Elements.water, _dice_value=6),
]),
Expand Down
17 changes: 8 additions & 9 deletions utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,14 @@ def ability_to_str(ability_name: str, level=1) -> str:


def get_requirements_display_string(item) -> str:
if item["_itype"] not in [1, 2, 3, 4, 5, 6, 7, 8]:
raise Exception(f'get_requirements_display_string for unsupported _itype {item["_itype"]} on {item["name"]}')

display_string = ''
display_string += f'\nStrength {item["required_strength"]}' if item['required_strength'] != 0 else ''
display_string += f'\nIntelligence {item["required_intelligence"]}' if item['required_intelligence'] != 0 else ''
display_string += f'\nDexterity {item["required_dexterity"]}' if item['required_dexterity'] != 0 else ''
display_string += f'\nWillpower {item["required_willpower"]}' if item['required_willpower'] != 0 else ''
return display_string.lstrip('\n')
if item["_itype"] == 1:
display_string = f'\nStrength {item["required_strength"]}' if item['required_strength'] != 0 else ''
display_string += f'\nIntelligence {item["required_intelligence"]}' if item['required_intelligence'] != 0 else ''
display_string += f'\nDexterity {item["required_dexterity"]}' if item['required_dexterity'] != 0 else ''
display_string += f'\nWillpower {item["required_willpower"]}' if item['required_willpower'] != 0 else ''
return display_string.lstrip('\n')
else:
return 'None'


def get_socket_display(item) -> str:
Expand Down

0 comments on commit 8a7aa65

Please sign in to comment.