Skip to content

Commit

Permalink
Merge pull request #78659 from osuphobia/refactor_enchantment_2
Browse files Browse the repository at this point in the history
Make enchantment mutations work again
  • Loading branch information
Night-Pryanik authored Dec 22, 2024
2 parents 248e058 + 8e9b8ae commit 53cbd1e
Show file tree
Hide file tree
Showing 37 changed files with 441 additions and 469 deletions.
52 changes: 6 additions & 46 deletions data/mods/Magiclysm/mutations/magical.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"starting_trait": false,
"purifiable": false,
"player_display": false,
"//": "The second enchantment takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74984. If that bug is fixed, it can be deleted.",
"enchantments": [
{
"condition": "ALWAYS",
Expand All @@ -43,7 +42,6 @@
],
"mutations": [ "FANGS", "MUZZLE_BEAR", "TAIL_STUB", "PAWS_LARGE", "URSINE_FUR", "URSINE_EARS", "PRED3" ]
},
{ "condition": "ALWAYS", "values": [ { "value": "HEARING_MULT", "multiply": 0.25 } ] },
{
"condition": { "and": [ { "u_has_flag": "QUADRUPED_CROUCH" }, { "u_has_flag": "QUADRUPED_RUN" }, { "not": "u_can_drop_weapon" } ] },
"values": [ { "value": "MOVE_COST", "multiply": -0.15 } ],
Expand All @@ -55,19 +53,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"flags": [
"MUTE",
"MYOPIC_IN_LIGHT",
"NO_SPELLCASTING",
"PRED3",
"QUADRUPED_CROUCH",
"QUADRUPED_RUN",
"TOUGH_FEET",
"TEMPORARY_SHAPESHIFT",
"SHAPESHIFT_SIZE_HUGE"
],
"override_look": { "id": "mon_bear", "tile_category": "monster" },
"integrated_armor": [ "integrated_claws_st", "integrated_fangs", "integrated_ursine_fur" ]
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT", "SHAPESHIFT_SIZE_HUGE" ],
"override_look": { "id": "mon_bear", "tile_category": "monster" }
},
{
"type": "mutation",
Expand Down Expand Up @@ -96,7 +83,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74984. If that bug is fixed, it can be deleted.",
"enchantments": [
{
"condition": "ALWAYS",
Expand All @@ -113,14 +99,6 @@
],
"mutations": [ "FANGS", "TAIL_LONG", "PAWS", "FELINE_FUR", "FELINE_EARS", "PRED3", "WHISKERS", "FELINE_LEAP" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "HEARING_MULT", "multiply": 0.25 },
{ "value": "COMBAT_CATCHUP", "multiply": 2 },
{ "value": "DODGE_CHANCE", "add": 5 }
]
},
{
"condition": { "and": [ { "u_has_flag": "QUADRUPED_CROUCH" }, { "u_has_flag": "QUADRUPED_RUN" }, { "not": "u_can_drop_weapon" } ] },
"values": [ { "value": "MOVE_COST", "multiply": -0.15 } ],
Expand All @@ -132,9 +110,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"flags": [ "MUTE", "NO_SPELLCASTING", "PRED3", "QUADRUPED_CROUCH", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_cougar", "tile_category": "monster" },
"integrated_armor": [ "integrated_fangs", "integrated_feline_fur", "integrated_claws" ]
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_cougar", "tile_category": "monster" }
},
{
"type": "mutation",
Expand Down Expand Up @@ -187,15 +164,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"attacks": {
"attack_text_u": "You kick %s with your hooves!",
"attack_text_npc": "%1$s kicks %2$s with their hooves!",
"chance": 15,
"strength_damage": { "damage_type": "bash", "amount": 3 }
},
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_CROUCH", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_deer", "tile_category": "monster" },
"integrated_armor": [ "integrated_antlers", "integrated_feline_fur" ]
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_deer", "tile_category": "monster" }
},
{
"type": "mutation",
Expand Down Expand Up @@ -293,7 +263,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment, as well as bodytemp modifiers, takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74984. If that bug is fixed, it can be deleted.",
"bodytemp_modifiers": [ 300, 800 ],
"enchantments": [
{
Expand All @@ -311,15 +280,6 @@
"skills": [ { "value": "dodge", "add": 6 } ],
"mutations": [ "BIRD_EYE", "DOWN", "EAGLEEYED", "LIGHTEATER" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "PERCEPTION", "add": 4 },
{ "value": "BODYTEMP_SLEEP", "add": 0.5 },
{ "value": "OVERMAP_SIGHT", "add": 4 },
{ "value": "METABOLISM", "multiply": -0.333 }
]
},
{
"condition": "u_has_weapon",
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
Expand Down
15 changes: 2 additions & 13 deletions data/mods/Xedra_Evolved/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"enchantments": [
{
"condition": "ALWAYS",
Expand All @@ -699,15 +698,6 @@
],
"mutations": [ "FANGS", "MUZZLE", "TAIL_FLUFFY", "PAWS", "LUPINE_FUR", "LUPINE_EARS", "PERSISTENCE_HUNTER2", "PRED3" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "STAMINA_REGEN_MOD", "add": 0.2 },
{ "value": "HEARING_MULT", "multiply": 0.75 },
{ "value": "COMBAT_CATCHUP", "multiply": 2 },
{ "value": "DODGE_CHANCE", "add": 4 }
]
},
{
"condition": { "and": [ { "not": "u_can_drop_weapon" } ] },
"values": [ { "value": "MOVE_COST", "multiply": -0.15 } ],
Expand All @@ -719,9 +709,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"flags": [ "MUTE", "PRED3", "QUADRUPED_CROUCH", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_wolf", "tile_category": "monster" },
"integrated_armor": [ "integrated_fangs", "integrated_lupine_fur" ]
"flags": [ "MUTE", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_wolf", "tile_category": "monster" }
},
{
"type": "mutation",
Expand Down
15 changes: 2 additions & 13 deletions data/mods/Xedra_Evolved/mutations/shapeshifters.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"starting_trait": false,
"purifiable": false,
"player_display": false,
"//": "The second enchantment takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"enchantments": [
{
"condition": "ALWAYS",
Expand All @@ -108,23 +107,13 @@
],
"mutations": [ "MUZZLE", "TAIL_FLUFFY", "PAWS", "LUPINE_FUR", "LUPINE_EARS", "PERSISTENCE_HUNTER2", "PRED3" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "STAMINA_REGEN_MOD", "add": 0.2 },
{ "value": "HEARING_MULT", "multiply": 0.75 },
{ "value": "COMBAT_CATCHUP", "multiply": 2 },
{ "value": "DODGE_CHANCE", "add": 4 }
]
},
{
"condition": { "and": [ { "not": "is_day" }, { "math": [ "moon_phase() == 4" ] } ] },
"values": [ { "value": "DEXTERITY", "add": 2 }, { "value": "STRENGTH", "add": 2 }, { "value": "SPEED", "multiply": 0.05 } ]
}
],
"flags": [ "NO_SPELLCASTING", "PRED3", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT", "SHAPESHIFT_SIZE_HUGE" ],
"override_look": { "id": "mon_loup_garou", "tile_category": "monster" },
"integrated_armor": [ "integrated_claws_werewolf", "integrated_werewolf_teeth", "integrated_lupine_fur" ]
"flags": [ "NO_SPELLCASTING", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT", "SHAPESHIFT_SIZE_HUGE" ],
"override_look": { "id": "mon_loup_garou", "tile_category": "monster" }
},
{
"type": "effect_on_condition",
Expand Down
89 changes: 7 additions & 82 deletions data/mods/Xedra_Evolved/mutations/temporary.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@
"starting_trait": false,
"purifiable": false,
"player_display": false,
"//": "The second enchantment takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"enchantments": [
{
"condition": "ALWAYS",
Expand All @@ -166,7 +165,6 @@
],
"mutations": [ "FANGS", "MUZZLE_BEAR", "TAIL_STUB", "PAWS_LARGE", "URSINE_FUR", "URSINE_EARS", "PRED3" ]
},
{ "condition": "ALWAYS", "values": [ { "value": "HEARING_MULT", "multiply": 0.25 } ] },
{
"condition": { "and": [ { "u_has_flag": "QUADRUPED_CROUCH" }, { "u_has_flag": "QUADRUPED_RUN" }, { "not": "u_can_drop_weapon" } ] },
"values": [ { "value": "MOVE_COST", "multiply": -0.15 } ],
Expand All @@ -178,19 +176,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"flags": [
"MUTE",
"MYOPIC_IN_LIGHT",
"NO_SPELLCASTING",
"PRED3",
"QUADRUPED_CROUCH",
"QUADRUPED_RUN",
"TOUGH_FEET",
"TEMPORARY_SHAPESHIFT",
"SHAPESHIFT_SIZE_HUGE"
],
"override_look": { "id": "mon_bear", "tile_category": "monster" },
"integrated_armor": [ "integrated_claws_st", "integrated_fangs", "integrated_ursine_fur" ]
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT", "SHAPESHIFT_SIZE_HUGE" ],
"override_look": { "id": "mon_bear", "tile_category": "monster" }
},
{
"type": "mutation",
Expand Down Expand Up @@ -229,15 +216,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"attacks": {
"attack_text_u": "You kick %s with your hooves!",
"attack_text_npc": "%1$s kicks %2$s with their hooves!",
"chance": 15,
"strength_damage": { "damage_type": "bash", "amount": 3 }
},
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_CROUCH", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_deer", "tile_category": "monster" },
"integrated_armor": [ "integrated_antlers", "integrated_feline_fur" ]
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_deer", "tile_category": "monster" }
},
{
"type": "mutation",
Expand All @@ -252,7 +232,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"enchantments": [
{
"condition": "ALWAYS",
Expand All @@ -269,14 +248,6 @@
],
"mutations": [ "FANGS", "TAIL_LONG", "PAWS", "FELINE_FUR", "FELINE_EARS", "PRED3", "WHISKERS", "FELINE_LEAP" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "HEARING_MULT", "multiply": 0.25 },
{ "value": "COMBAT_CATCHUP", "multiply": 2 },
{ "value": "DODGE_CHANCE", "add": 5 }
]
},
{
"condition": { "and": [ { "u_has_flag": "QUADRUPED_CROUCH" }, { "u_has_flag": "QUADRUPED_RUN" }, { "not": "u_can_drop_weapon" } ] },
"values": [ { "value": "MOVE_COST", "multiply": -0.15 } ],
Expand All @@ -288,9 +259,8 @@
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
}
],
"flags": [ "MUTE", "NO_SPELLCASTING", "PRED3", "QUADRUPED_CROUCH", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_cougar", "tile_category": "monster" },
"integrated_armor": [ "integrated_fangs", "integrated_feline_fur", "integrated_claws" ]
"flags": [ "MUTE", "NO_SPELLCASTING", "QUADRUPED_RUN", "TOUGH_FEET", "TEMPORARY_SHAPESHIFT" ],
"override_look": { "id": "mon_cougar", "tile_category": "monster" }
},
{
"type": "mutation",
Expand All @@ -305,7 +275,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment, as well as bodytemp modifiers, takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"bodytemp_modifiers": [ 500, 1200 ],
"enchantments": [
{
Expand All @@ -323,15 +292,6 @@
"skills": [ { "value": "dodge", "add": 4 } ],
"mutations": [ "BIRD_EYE", "DOWN", "EAGLEEYED", "LIGHTEATER" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "PERCEPTION", "add": 4 },
{ "value": "BODYTEMP_SLEEP", "add": 0.5 },
{ "value": "OVERMAP_SIGHT", "add": 4 },
{ "value": "METABOLISM", "multiply": -0.333 }
]
},
{
"condition": "u_has_weapon",
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
Expand Down Expand Up @@ -360,7 +320,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment, as well as bodytemp modifiers, takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"bodytemp_modifiers": [ 500, 1200 ],
"enchantments": [
{
Expand All @@ -376,33 +335,9 @@
],
"skills": [ { "value": "dodge", "add": 4 }, { "value": "unarmed", "add": 1 } ],
"mutations": [ "BEAK", "BIRD_EYE", "BIRD_LEGS", "DOWN", "EAGLEEYED", "HOLLOW_BONES", "LIGHTEATER", "SCREECH", "WINGS_BIRD" ]
},
{
"condition": "ALWAYS",
"incoming_damage_mod_post_absorbed": [ { "type": "bash", "multiply": 0.8 } ],
"values": [
{ "value": "PERCEPTION", "add": 4 },
{ "value": "BODYTEMP_SLEEP", "add": 0.5 },
{ "value": "OVERMAP_SIGHT", "add": 4 },
{ "value": "METABOLISM", "multiply": -0.2 },
{ "value": "MOVE_COST", "multiply": -0.2 },
{ "value": "ATTACK_SPEED", "multiply": -0.2 },
{ "value": "CARRY_WEIGHT", "multiply": -0.1 },
{ "value": "SOCIAL_INTIMIDATE", "add": 10 },
{ "value": "SOCIAL_LIE", "add": -20 },
{ "value": "SOCIAL_PERSUADE", "add": -10 }
]
}
],
"attacks": {
"attack_text_u": "You rip into %s with your beak!",
"attack_text_npc": "%1$s rips into %2$s with their beak!",
"body_part": "mouth",
"chance": 15,
"strength_damage": { "damage_type": "cut", "amount": 3 }
},
"flags": [ "TEMPORARY_SHAPESHIFT", "SHAPESHIFT_SIZE_LARGE", "WINGS_2", "WING_GLIDE" ],
"integrated_armor": [ "integrated_feathers", "integrated_talons" ]
"flags": [ "TEMPORARY_SHAPESHIFT", "SHAPESHIFT_SIZE_LARGE" ]
},
{
"type": "mutation",
Expand All @@ -417,7 +352,6 @@
"purifiable": false,
"valid": false,
"player_display": false,
"//": "The second enchantment, as well as bodytemp modifiers, takes into account the effects of the mutations added by the first enchantment, whose own enchantments do not transfer over due to bug #74994. If that bug is fixed, it can be deleted.",
"bodytemp_modifiers": [ 300, 800 ],
"enchantments": [
{
Expand All @@ -435,15 +369,6 @@
"skills": [ { "value": "dodge", "add": 6 } ],
"mutations": [ "BIRD_EYE", "DOWN", "EAGLEEYED", "LIGHTEATER" ]
},
{
"condition": "ALWAYS",
"values": [
{ "value": "PERCEPTION", "add": 4 },
{ "value": "BODYTEMP_SLEEP", "add": 0.5 },
{ "value": "OVERMAP_SIGHT", "add": 4 },
{ "value": "METABOLISM", "multiply": -0.333 }
]
},
{
"condition": "u_has_weapon",
"values": [ { "value": "MELEE_DAMAGE", "multiply": -1 }, { "value": "RANGE", "multiply": -1 } ]
Expand Down
2 changes: 1 addition & 1 deletion src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ int Character::get_total_bionics_slots( const bodypart_id &bp ) const
{
const bodypart_str_id &id = bp.id();
int mut_bio_slots = 0;
for( const trait_id &mut : get_mutations() ) {
for( const trait_id &mut : get_functioning_mutations() ) {
mut_bio_slots += mut->bionic_slot_bonus( id );
}
return bp->bionic_slots() + mut_bio_slots;
Expand Down
2 changes: 1 addition & 1 deletion src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4352,7 +4352,7 @@ void cata_tiles::draw_zlevel_overlay( const tripoint &p, const lit_level ll, int
void cata_tiles::draw_entity_with_overlays( const Character &ch, const tripoint &p, lit_level ll,
int &height_3d )
{
std::vector<trait_id> override_look_muts = ch.get_mutations( true,
std::vector<trait_id> override_look_muts = ch.get_functioning_mutations( true,
false, []( const mutation_branch & mut ) {
return mut.override_look.has_value();
} );
Expand Down
Loading

0 comments on commit 53cbd1e

Please sign in to comment.