From f1e8d1ded7aefc05d12e43b8f06c8e50c09c8895 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Fri, 7 Jan 2022 22:16:58 -0800 Subject: Change vampire mutation immunity to occur in the mutate function. --- custom.patch | 55 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 21 deletions(-) (limited to 'custom.patch') diff --git a/custom.patch b/custom.patch index 85315ab..7ed870d 100644 --- a/custom.patch +++ b/custom.patch @@ -311,27 +311,6 @@ add( pgettext( "memorial_male", "Killed an innocent person, %s, in cold blood and " ---- a/src/monattack.cpp -+++ b/src/monattack.cpp -@@ -143,6 +143,7 @@ - static const trait_id trait_TAIL_CATTLE( "TAIL_CATTLE" ); - static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); - static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); -+static const trait_id trait_THRESH_VAMP( "THRESH_VAMP" ); - - static const mtype_id mon_ant_acid_larva( "mon_ant_acid_larva" ); - static const mtype_id mon_ant_acid_queen( "mon_ant_acid_queen" ); -@@ -2758,6 +2759,9 @@ - damage_instance dam = damage_instance(); - dam.add_damage( DT_STAB, 6, 10, 0.6, 1 ); - bool hit = sting_shoot( z, target, dam, range ); -+ if( target->has_trait( trait_THRESH_VAMP ) ) { -+ return true; -+ } - if( hit ) { - //Add checks if previous NPC/player conditions are removed - dynamic_cast( target )->mutate(); - --- a/src/morale_types.cpp +++ b/src/morale_types.cpp @@ -138,6 +139,7 @@ @@ -354,6 +333,40 @@ extern const morale_type MORALE_MEATARIAN; extern const morale_type MORALE_ANTIFRUIT; +--- a/src/mutation.cpp ++++ b/src/mutation.cpp +@@ -80,6 +80,7 @@ + static const trait_id trait_STR_ALPHA( "STR_ALPHA" ); + static const trait_id trait_THRESH_MARLOSS( "THRESH_MARLOSS" ); + static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" ); ++static const trait_id trait_THRESH_VAMP( "THRESH_VAMP" ); + static const trait_id trait_TREE_COMMUNION( "TREE_COMMUNION" ); + static const trait_id trait_VOMITOUS( "VOMITOUS" ); + static const trait_id trait_WEB_WEAVER( "WEB_WEAVER" ); +@@ -887,6 +888,11 @@ + if( !mutagen ) { + return; + } ++ if( has_trait( trait_THRESH_VAMP ) ) { ++ add_msg_if_player( m_good, _( "Your Vampire blood quickly destroys the mutagenic contagion." ) ); ++ remove_effect( effect_accumulated_mutagen ); ++ return; ++ } + float mut_power = to_turns( mutagen.get_duration() ) / to_turns + ( mutagen.get_int_dur_factor() ); + add_msg_if_player( m_debug, "Mutation accumulation: %.1f", mut_power ); +@@ -926,6 +932,10 @@ + { + bool force_bad = one_in( 3 ); + bool force_good = false; ++ if( has_trait( trait_THRESH_VAMP ) ) { ++ add_msg_if_player( m_good, _( "Your Vampire blood quickly destroys the mutagenic contagion." ) ); ++ return; ++ } + if( has_trait( trait_ROBUST ) && force_bad ) { + // Robust Genetics gives you a 33% chance for a good mutation, + // instead of the 33% chance of a bad one. + --- a/src/npc.cpp +++ b/src/npc.cpp @@ -116,6 +116,7 @@ -- cgit v1.2.1