diff --git a/data/mods/Xedra_Evolved/mutations/paraclesians/homullus_mutations.json b/data/mods/Xedra_Evolved/mutations/paraclesians/homullus_mutations.json index c7b60c4b8b59b..533a9deda2633 100644 --- a/data/mods/Xedra_Evolved/mutations/paraclesians/homullus_mutations.json +++ b/data/mods/Xedra_Evolved/mutations/paraclesians/homullus_mutations.json @@ -246,6 +246,31 @@ "threshreq": [ "THRESH_HOMULLUS" ], "category": [ "HOMULLUS" ] }, + { + "type": "mutation", + "id": "HOMULLUS_ARMOR_MULT_1", + "name": "Reinforced Armor", + "points": 4, + "visibility": 0, + "ugliness": 0, + "description": "Humans are flimsy creatures compared to even natural animals, yet by crafting armor they obtain durability that unthinking creatures will never reach. You draw on this legacy, increasing the strength of armor you wear by 20%", + "changes_to": "HOMULLUS_ARMOR_MULT_2", + "category": [ "HOMULLUS" ], + "enchantments": [ { "values": [ { "value": "ARMOR_ALL", "multiply": -0.2 } ] } ] + }, + { + "type": "mutation", + "id": "HOMULLUS_ARMOR_MULT_2", + "name": "Fortified Armor", + "points": 8, + "visibility": 0, + "ugliness": 0, + "description": "You embody the tales of ancient knights, increasing the strength of armor you wear by 40%", + "prereqs": [ "HOMULLUS_ARMOR_MULT_1" ], + "threshreq": [ "THRESH_HOMULLUS" ], + "category": [ "HOMULLUS" ], + "enchantments": [ { "values": [ { "value": "ARMOR_ALL", "multiply": -0.4 } ] } ] + }, { "type": "mutation", "id": "HOMULLUS_GAIN_BIONIC_POWER", diff --git a/doc/MAGIC.md b/doc/MAGIC.md index 23463f379c14c..9002a8e6eaba5 100644 --- a/doc/MAGIC.md +++ b/doc/MAGIC.md @@ -789,6 +789,7 @@ The following is a list of possible enchantment `values`: Character status value | Description --- |--- `ARMOR_ACID` | Negative values give armor against the damage, positive values make you accept more damage of this type. +`ARMOR_ALL` | `ARMOR_BASH` | `ARMOR_BIO` | `ARMOR_BULLET` | @@ -923,6 +924,7 @@ A small subset of enchantments can be applied to monsters via effects. These are Character status value | Description --- |--- `ARMOR_ACID` | Negative values give armor against the damage, positive values make the monster accept more damage of this type. +`ARMOR_ALL` | `ARMOR_BASH` | `ARMOR_BIO` | `ARMOR_BULLET` | diff --git a/src/character_armor.cpp b/src/character_armor.cpp index b0e6b9b118377..829e8b10e9354 100644 --- a/src/character_armor.cpp +++ b/src/character_armor.cpp @@ -119,6 +119,9 @@ static void armor_enchantment_adjust( Character &guy, damage_unit &du ) } else if( du.type == STATIC( damage_type_id( "bullet" ) ) ) { du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BULLET ); } + if( du.type != STATIC( damage_type_id( "pure" ) ) ) { + du.amount = guy.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); + } du.amount = std::max( 0.0f, du.amount ); } diff --git a/src/magic_enchantment.cpp b/src/magic_enchantment.cpp index a68d414e1e1d2..8b0b96c75aba1 100644 --- a/src/magic_enchantment.cpp +++ b/src/magic_enchantment.cpp @@ -114,6 +114,7 @@ namespace io case enchant_vals::mod::STOMACH_SIZE_MULTIPLIER: return "STOMACH_SIZE_MULTIPLIER"; case enchant_vals::mod::LEARNING_FOCUS: return "LEARNING_FOCUS"; case enchant_vals::mod::RECOIL_MODIFIER: return "RECOIL_MODIFIER"; + case enchant_vals::mod::ARMOR_ALL: return "ARMOR_ALL"; case enchant_vals::mod::ARMOR_ACID: return "ARMOR_ACID"; case enchant_vals::mod::ARMOR_BASH: return "ARMOR_BASH"; case enchant_vals::mod::ARMOR_BIO: return "ARMOR_BIO"; @@ -294,6 +295,7 @@ bool enchantment::is_monster_relevant() const for( const std::pair &pair_values : values_add ) { if( pair_values.first == enchant_vals::mod::ARMOR_ACID || + pair_values.first == enchant_vals::mod::ARMOR_ALL || pair_values.first == enchant_vals::mod::ARMOR_BASH || pair_values.first == enchant_vals::mod::ARMOR_BIO || pair_values.first == enchant_vals::mod::ARMOR_BULLET || @@ -312,6 +314,7 @@ bool enchantment::is_monster_relevant() const for( const std::pair &pair_values : values_multiply ) { if( pair_values.first == enchant_vals::mod::ARMOR_ACID || + pair_values.first == enchant_vals::mod::ARMOR_ALL || pair_values.first == enchant_vals::mod::ARMOR_BASH || pair_values.first == enchant_vals::mod::ARMOR_BIO || pair_values.first == enchant_vals::mod::ARMOR_BULLET || diff --git a/src/magic_enchantment.h b/src/magic_enchantment.h index 9fa0aa51996bd..1b6ca6c00108a 100644 --- a/src/magic_enchantment.h +++ b/src/magic_enchantment.h @@ -90,15 +90,16 @@ enum class mod : int { MENDING_MODIFIER, STOMACH_SIZE_MULTIPLIER, LEARNING_FOCUS, + ARMOR_ACID, + ARMOR_ALL, ARMOR_BASH, - ARMOR_CUT, - ARMOR_STAB, + ARMOR_BIO, ARMOR_BULLET, - ARMOR_HEAT, ARMOR_COLD, + ARMOR_CUT, ARMOR_ELEC, - ARMOR_ACID, - ARMOR_BIO, + ARMOR_HEAT, + ARMOR_STAB, EXTRA_BASH, EXTRA_CUT, EXTRA_STAB, diff --git a/src/monster.cpp b/src/monster.cpp index 0fd37e477cfe9..f1ccf117fce14 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -249,6 +249,9 @@ static void armor_enchantment_adjust( monster &mon, damage_unit &du ) } else if( du.type == STATIC( damage_type_id( "bullet" ) ) ) { du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_BULLET ); } + if( du.type != STATIC( damage_type_id( "pure" ) ) ) { + du.amount = mon.calculate_by_enchantment( du.amount, enchant_vals::mod::ARMOR_ALL ); + } du.amount = std::max( 0.0f, du.amount ); }