From b46eef7154d87dd17792a273a9c55a8007675755 Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Thu, 9 Nov 2023 02:06:37 -0800 Subject: Porting to 0.4, part 2. --- vampirism.patch | 189 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 108 insertions(+), 81 deletions(-) (limited to 'vampirism.patch') diff --git a/vampirism.patch b/vampirism.patch index 67b7f62..26c90a3 100644 --- a/vampirism.patch +++ b/vampirism.patch @@ -8,15 +8,6 @@ static const trait_flag_str_id trait_flag_CANNIBAL( "CANNIBAL" ); static const trait_flag_str_id trait_flag_PSYCHOPATH( "PSYCHOPATH" ); static const trait_flag_str_id trait_flag_SAPIOVORE( "SAPIOVORE" ); -@@ -278,6 +278,8 @@ - static const std::string flag_SUPPORTS_ROOF( "SUPPORTS_ROOF" ); - static const std::string flag_TREE( "TREE" ); - static const std::string flag_USE_UPS( "USE_UPS" ); -+static const std::string flag_VAMPIRISM( "VAMPIRISM" ); -+static const std::string flag_VAMPIRISM_OK( "VAMPIRISM_OK" ); - - using namespace activity_handlers; - @@ -667,7 +667,8 @@ !corpse.in_species( ZOMBIE ) ); if( is_human && !( u.has_trait_flag( trait_flag_CANNIBAL ) || @@ -127,35 +118,22 @@ static const trait_flag_str_id trait_flag_CANNIBAL( "CANNIBAL" ); +static const trait_flag_str_id trait_flag_VAMPIRE( "VAMPIRE" ); -@@ -114,6 +114,10 @@ - static const std::string flag_HIDDEN_HALLU( "HIDDEN_HALLU" ); -+static const std::string flag_ALLERGEN_ALCOHOL( "ALLERGEN_ALCOHOL" ); - static const std::string flag_ALLERGEN_EGG( "ALLERGEN_EGG" ); -+static const std::string flag_ALLERGEN_FOODSTUFF( "ALLERGEN_FOODSTUFF" ); -+static const std::string flag_ALLERGEN_WATER( "ALLERGEN_WATER" ); - static const std::string flag_ALLERGEN_FRUIT( "ALLERGEN_FRUIT" ); -+static const std::string flag_ALLERGEN_HONEY( "ALLERGEN_HONEY" ); - static const std::string flag_ALLERGEN_JUNK( "ALLERGEN_JUNK" ); - static const std::string flag_ALLERGEN_MEAT( "ALLERGEN_MEAT" ); - static const std::string flag_ALLERGEN_MILK( "ALLERGEN_MILK" ); -@@ -148,11 +148,17 @@ - static const std::string flag_USE_EAT_VERB( "USE_EAT_VERB" ); - static const std::string flag_COLD( "COLD" ); - static const std::string flag_VERY_COLD( "VERY_COLD" ); -+static const std::string flag_VAMPIRISM( "VAMPIRISM" ); -+static const std::string flag_VAMPIRISM_OK( "VAMPIRISM_OK" ); - - const std::vector carnivore_blacklist {{ - flag_ALLERGEN_VEGGY, flag_ALLERGEN_FRUIT, flag_ALLERGEN_WHEAT, flag_ALLERGEN_NUT, - } - }; -+const std::vector vamp_blacklist {{ -+ flag_ALLERGEN_VEGGY, flag_ALLERGEN_FRUIT, flag_ALLERGEN_WHEAT, flag_ALLERGEN_NUT, flag_ALLERGEN_MEAT, flag_ALLERGEN_EGG, flag_ALLERGEN_JUNK, flag_ALLERGEN_MILK, flag_ALLERGEN_HONEY, flag_ALLERGEN_FOODSTUFF, flag_ALLERGEN_ALCOHOL, flag_ALLERGEN_WATER, -+ } -+}; - // This ugly temp array is here because otherwise it goes - // std::vector(char*, char*)->vector(InputIterator,InputIterator) or some such - const std::array temparray {{flag_ALLERGEN_MEAT, flag_ALLERGEN_EGG}}; +@@ -126,6 +126,15 @@ + flag_id( "ALLERGEN_WHEAT" ), flag_id( "ALLERGEN_NUT" ) + }}; + ++static const std::array vamp_blacklist {{ ++ flag_id( "ALLERGEN_VEGGY" ), flag_id( "ALLERGEN_FRUIT" ), ++ flag_id( "ALLERGEN_WHEAT" ), flag_id( "ALLERGEN_NUT" ), ++ flag_id( "ALLERGEN_MEAT" ), flag_id( "ALLERGEN_EGG" ), ++ flag_id( "ALLERGEN_JUNK" ), flag_id( "ALLERGEN_MILK" ), ++ flag_id( "ALLERGEN_HONEY" ), flag_id( "ALLERGEN_FOODSTUFF" ), ++ flag_id( "ALLERGEN_ALCOHOL" ), flag_id( "ALLERGEN_WATER" ) ++ }}; ++ + static const std::array herbivore_blacklist {{ + flag_id( "ALLERGEN_MEAT" ), flag_id( "ALLERGEN_EGG" ) + }}; @@ -712,6 +712,12 @@ _( "Eww. Inedible plant stuff!" ) ); } @@ -227,6 +205,66 @@ if( has_trait( trait_PROJUNK ) ) { add_msg_if_player( m_good, _( "Mmm, junk food." ) ); +--- a/src/flag.cpp ++++ b/src/flag.cpp +@@ -15,13 +15,17 @@ + const flag_id flag_ACT_IN_FIRE( "ACT_IN_FIRE" ); + const flag_id flag_ACT_ON_RANGED_HIT( "ACT_ON_RANGED_HIT" ); + const flag_id flag_ALARMCLOCK( "ALARMCLOCK" ); ++const flag_id flag_ALLERGEN_ALCOHOL( "ALLERGEN_ALCOHOL" ); + const flag_id flag_ALLERGEN_EGG( "ALLERGEN_EGG" ); ++const flag_id flag_ALLERGEN_FOODSTUFF( "ALLERGEN_FOODSTUFF" ); + const flag_id flag_ALLERGEN_FRUIT( "ALLERGEN_FRUIT" ); ++const flag_id flag_ALLERGEN_HONEY( "ALLERGEN_HONEY" ); + const flag_id flag_ALLERGEN_JUNK( "ALLERGEN_JUNK" ); + const flag_id flag_ALLERGEN_MEAT( "ALLERGEN_MEAT" ); + const flag_id flag_ALLERGEN_MILK( "ALLERGEN_MILK" ); + const flag_id flag_ALLERGEN_NUT( "ALLERGEN_NUT" ); + const flag_id flag_ALLERGEN_VEGGY( "ALLERGEN_VEGGY" ); ++const flag_id flag_ALLERGEN_WATER( "ALLERGEN_WATER" ); + const flag_id flag_ALLERGEN_WHEAT( "ALLERGEN_WHEAT" ); + const flag_id flag_ALLERGEN_WOOL( "ALLERGEN_WOOL" ); + const flag_id flag_ALLOWS_NATURAL_ATTACKS( "ALLOWS_NATURAL_ATTACKS" ); +@@ -326,6 +330,8 @@ + const flag_id flag_USE_UPS( "USE_UPS" ); + const flag_id flag_VARSIZE( "VARSIZE" ); + const flag_id flag_VEHICLE( "VEHICLE" ); ++const flag_id flag_VAMPIRISM( "VAMPIRISM" ); ++const flag_id flag_VAMPIRISM_OK( "VAMPIRISM_OK" ); + const flag_id flag_VERY_COLD( "VERY_COLD" ); + const flag_id flag_WAIST( "WAIST" ); + const flag_id flag_WATCH( "WATCH" ); + +--- a/src/flag.h ++++ b/src/flag.h +@@ -17,13 +17,17 @@ + extern const flag_id flag_ACT_IN_FIRE; + extern const flag_id flag_ACT_ON_RANGED_HIT; + extern const flag_id flag_ALARMCLOCK; ++extern const flag_id flag_ALLERGEN_ALCOHOL; + extern const flag_id flag_ALLERGEN_EGG; ++extern const flag_id flag_ALLERGEN_FOODSTUFF; + extern const flag_id flag_ALLERGEN_FRUIT; ++extern const flag_id flag_ALLERGEN_HONEY; + extern const flag_id flag_ALLERGEN_JUNK; + extern const flag_id flag_ALLERGEN_MEAT; + extern const flag_id flag_ALLERGEN_MILK; + extern const flag_id flag_ALLERGEN_NUT; + extern const flag_id flag_ALLERGEN_VEGGY; ++extern const flag_id flag_ALLERGEN_WATER; + extern const flag_id flag_ALLERGEN_WHEAT; + extern const flag_id flag_ALLERGEN_WOOL; + extern const flag_id flag_ALLOWS_NATURAL_ATTACKS; +@@ -327,6 +331,8 @@ + extern const flag_id flag_USE_PLAYER_ENERGY; + extern const flag_id flag_USE_UPS; + extern const flag_id flag_VARSIZE; ++extern const flag_id flag_VAMPIRISM; ++extern const flag_id flag_VAMPIRISM_OK; + extern const flag_id flag_VERY_COLD; + extern const flag_id flag_VEHICLE; + extern const flag_id flag_WAIST; + --- a/src/game.cpp +++ b/src/game.cpp @@ -1040,8 +1040,9 @@ @@ -252,14 +290,6 @@ static const bionic_id bio_digestion( "bio_digestion" ); -@@ -256,6 +257,7 @@ - static const std::string flag_USES_BIONIC_POWER( "USES_BIONIC_POWER" ); - static const std::string flag_USE_UPS( "USE_UPS" ); - static const std::string flag_VARSIZE( "VARSIZE" ); -+static const std::string flag_VAMPIRISM( "VAMPIRISM" ); - static const std::string flag_VEHICLE( "VEHICLE" ); - static const std::string flag_WAIST( "WAIST" ); - static const std::string flag_WATERPROOF_GUN( "WATERPROOF_GUN" ); @@ -1720,18 +1722,34 @@ _( "* This food will cause an allergic reaction." ) ); } @@ -310,31 +340,31 @@ --- a/src/item_factory.cpp +++ b/src/item_factory.cpp -@@ -2251,6 +2251,7 @@ - // First allergens: - // An item is an allergen even if it has trace amounts of allergenic material - std::make_pair( material_id( "hflesh" ), "CANNIBALISM" ), -+ std::make_pair( material_id( "blood" ), "VAMPIRISM" ), - - std::make_pair( material_id( "hflesh" ), "ALLERGEN_MEAT" ), - std::make_pair( material_id( "iflesh" ), "ALLERGEN_MEAT" ), -@@ -2266,10 +2266,16 @@ - std::make_pair( material_id( "mushroom" ), "ALLERGEN_VEGGY" ), - std::make_pair( material_id( "milk" ), "ALLERGEN_MILK" ), - std::make_pair( material_id( "egg" ), "ALLERGEN_EGG" ), -+ std::make_pair( material_id( "alcohol" ), "ALLERGEN_ALCOHOL" ), -+ std::make_pair( material_id( "foodplace_foodstuff" ), "ALLERGEN_FOODSTUFF" ), -+ std::make_pair( material_id( "water" ), "ALLERGEN_WATER" ), -+ std::make_pair( material_id( "honey" ), "ALLERGEN_HONEY" ), - std::make_pair( material_id( "junk" ), "ALLERGEN_JUNK" ), - // Not food, but we can keep it here - std::make_pair( material_id( "wool" ), "ALLERGEN_WOOL" ), - // Now "made of". Those flags should not be passed -+ std::make_pair( material_id( "blood" ), "VAMPIRISM_OK" ), -+ std::make_pair( material_id( "blood" ), "CARNIVORE_OK" ), - std::make_pair( material_id( "flesh" ), "CARNIVORE_OK" ), - std::make_pair( material_id( "hflesh" ), "CARNIVORE_OK" ), - std::make_pair( material_id( "iflesh" ), "CARNIVORE_OK" ), +@@ -2470,6 +2470,7 @@ + // First allergens: + // An item is an allergen even if it has trace amounts of allergenic material + std::make_pair( material_id( "hflesh" ), flag_CANNIBALISM ), ++ std::make_pair( material_id( "blood" ), flag_VAMPIRISM ), + + std::make_pair( material_id( "hflesh" ), flag_ALLERGEN_MEAT ), + std::make_pair( material_id( "iflesh" ), flag_ALLERGEN_MEAT ), +@@ -2484,10 +2485,16 @@ + std::make_pair( material_id( "mushroom" ), flag_ALLERGEN_VEGGY ), + std::make_pair( material_id( "milk" ), flag_ALLERGEN_MILK ), + std::make_pair( material_id( "egg" ), flag_ALLERGEN_EGG ), ++ std::make_pair( material_id( "alcohol" ), flag_ALLERGEN_ALCOHOL ), ++ std::make_pair( material_id( "foodplace_foodstuff" ), flag_ALLERGEN_FOODSTUFF ), ++ std::make_pair( material_id( "water" ), flag_ALLERGEN_WATER ), ++ std::make_pair( material_id( "honey" ), flag_ALLERGEN_HONEY ), + std::make_pair( material_id( "junk" ), flag_ALLERGEN_JUNK ), + // Not food, but we can keep it here + std::make_pair( material_id( "wool" ), flag_ALLERGEN_WOOL ), + // Now "made of". Those flags should not be passed ++ std::make_pair( material_id( "blood" ), flag_VAMPIRISM_OK ), ++ std::make_pair( material_id( "blood" ), flag_CARNIVORE_OK ), + std::make_pair( material_id( "flesh" ), flag_CARNIVORE_OK ), + std::make_pair( material_id( "hflesh" ), flag_CARNIVORE_OK ), + std::make_pair( material_id( "iflesh" ), flag_CARNIVORE_OK ), --- a/src/iteminfo_query.h +++ b/src/iteminfo_query.h @@ -367,18 +397,15 @@ u.add_env_effect( effect_blind, bp_eyes, cur.get_field_intensity() * 2, 10_seconds ); } } -@@ -1537,8 +1537,9 @@ +@@ -1539,7 +1539,7 @@ // The gas won't harm you inside a vehicle. if( !inside ) { // Full body suits protect you from the effects of the gas. -- if( !( u.worn_with_flag( flag_GAS_PROOF ) && u.get_env_resist( bodypart_id( "mouth" ) ) >= 15 && -- u.get_env_resist( bodypart_id( "eyes" ) ) >= 15 ) ) { -+ if( !( u.has_trait( trait_VAMP_SKIN ) ) && !( u.worn_with_flag( flag_GAS_PROOF ) && -+ u.get_env_resist( bodypart_id( "mouth" ) ) >= 15 && -+ u.get_env_resist( bodypart_id( "eyes" ) ) >= 15 ) ) { +- if( !( u.worn_with_flag( STATIC( flag_id( "GAS_PROOF" ) ) ) && ++ if( !( u.has_trait( trait_VAMP_SKIN ) ) && !( u.worn_with_flag( STATIC( flag_id( "GAS_PROOF" ) ) ) && + u.get_env_resist( bodypart_id( "mouth" ) ) >= 15 && + u.get_env_resist( bodypart_id( "eyes" ) ) >= 15 ) ) { const int intensity = cur.get_field_intensity(); - bool inhaled = u.add_env_effect( effect_poison, bp_mouth, 5, intensity * 1_minutes ); - if( u.has_trait( trait_THRESH_MYCUS ) || u.has_trait( trait_THRESH_MARLOSS ) || --- a/src/memorial_logger.cpp +++ b/src/memorial_logger.cpp @@ -474,7 +501,7 @@ static const trait_id trait_TERRIFYING( "TERRIFYING" ); +static const trait_id trait_THRESH_REAL_VAMP( "THRESH_REAL_VAMP" ); - static const std::string flag_NPC_SAFE( "NPC_SAFE" ); + class monfaction; @@ -2492,12 +2492,15 @@ } @@ -546,7 +573,7 @@ + !has_trait( trait_VAMP_SKIN ) ) { oxygen--; } - if( oxygen < 12 && worn_with_flag( "REBREATHER" ) ) { + if( oxygen < 12 && worn_with_flag( flag_REBREATHER ) ) { @@ -751,7 +751,8 @@ return; } -- cgit v1.2.1