summaryrefslogtreecommitdiff
path: root/vampirism.patch
diff options
context:
space:
mode:
authorjc_gargma <jc_gargma@iserlohn-fortress.net>2022-01-25 18:06:20 -0800
committerjc_gargma <jc_gargma@iserlohn-fortress.net>2022-01-25 18:06:20 -0800
commitdc78a251c7541e9148282821c08120f41cf2b0f6 (patch)
tree5f481d1852cbbfe0cd92b4079cbab94449653486 /vampirism.patch
parentPort the DDA eye colours to BN. (diff)
downloadcataclysm-bn-dc78a251c7541e9148282821c08120f41cf2b0f6.tar.xz
Various fixes to the vampirism patch.
Diffstat (limited to 'vampirism.patch')
-rw-r--r--vampirism.patch175
1 files changed, 134 insertions, 41 deletions
diff --git a/vampirism.patch b/vampirism.patch
index 653c847..c833f7b 100644
--- a/vampirism.patch
+++ b/vampirism.patch
@@ -1,10 +1,10 @@
--- a/src/activity_handlers.cpp
+++ b/src/activity_handlers.cpp
-@@ -220,6 +220,7 @@
+@@ -220,6 +220,7 @@3
static const species_id HUMAN( "HUMAN" );
static const species_id ZOMBIE( "ZOMBIE" );
-+static const std::string trait_flag_VAMPIRE( "CANNIBAL" );
++static const std::string trait_flag_VAMPIRE( "VAMPIRE" );
static const std::string trait_flag_CANNIBAL( "CANNIBAL" );
static const std::string trait_flag_PSYCHOPATH( "PSYCHOPATH" );
static const std::string trait_flag_SAPIOVORE( "SAPIOVORE" );
@@ -12,7 +12,7 @@
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( "VAMPIRE" );
++static const std::string flag_VAMPIRISM( "VAMPIRISM" );
+static const std::string flag_VAMPIRISM_OK( "VAMPIRISM_OK" );
using namespace activity_handlers;
@@ -40,15 +40,12 @@
static const trait_id trait_PACKMULE( "PACKMULE" );
static const trait_id trait_PADDED_FEET( "PADDED_FEET" );
static const trait_id trait_PAWS( "PAWS" );
-@@ -288,9 +288,11 @@
- static const trait_id trait_THRESH_INSECT( "THRESH_INSECT" );
- static const trait_id trait_THRESH_PLANT( "THRESH_PLANT" );
- static const trait_id trait_THRESH_SPIDER( "THRESH_SPIDER" );
-+static const trait_id trait_THRESH_VAMP( "THRESH_VAMP" );
+@@ -288,6 +288,8 @@
static const trait_id trait_TOUGH_FEET( "TOUGH_FEET" );
static const trait_id trait_TRANSPIRATION( "TRANSPIRATION" );
static const trait_id trait_URSINE_EYE( "URSINE_EYE" );
+static const trait_id trait_VAMP_HUNGER( "VAMP_HUNGER" );
++static const trait_id trait_VAMP_SKIN( "VAMP_SKIN" );
static const trait_id trait_VISCOUS( "VISCOUS" );
static const trait_id trait_WATERSLEEP( "WATERSLEEP" );
static const trait_id trait_WEBBED( "WEBBED" );
@@ -86,12 +83,49 @@
set_thirst( 0 );
}
}
+@@ -4843,15 +4843,17 @@
+ void Character::check_needs_extremes()
+ {
+ // Check if we've overdosed... in any deadly way.
+- if( get_stim() > 250 ) {
++ if( ( get_stim() > 250 ) && !( has_trait( trait_VAMP_SKIN ) ) ) {
+ add_msg_if_player( m_bad, _( "You have a sudden heart attack!" ) );
+ g->events().send<event_type::dies_from_drug_overdose>( getID(), efftype_id() );
+ set_part_hp_cur( bodypart_id( "torso" ), 0 );
+- } else if( get_stim() < -200 || get_painkiller() > 240 ) {
++ } else if( ( get_stim() < -200 || get_painkiller() > 240 ) && !( has_trait( trait_VAMP_SKIN ) ) ) {
+ add_msg_if_player( m_bad, _( "Your breathing stops completely." ) );
+ g->events().send<event_type::dies_from_drug_overdose>( getID(), efftype_id() );
+ set_part_hp_cur( bodypart_id( "torso" ), 0 );
+- } else if( has_effect( effect_jetinjector ) && get_effect_dur( effect_jetinjector ) > 40_minutes ) {
++ } else if( ( has_effect( effect_jetinjector ) &&
++ get_effect_dur( effect_jetinjector ) > 40_minutes ) &&
++ !( has_trait( trait_VAMP_SKIN ) ) ) {
+ if( !( has_trait( trait_NOPAIN ) ) ) {
+ add_msg_if_player( m_bad, _( "Your heart spasms painfully and stops." ) );
+ } else {
+@@ -4859,11 +4861,12 @@
+ }
+ g->events().send<event_type::dies_from_drug_overdose>( getID(), effect_jetinjector );
+ set_part_hp_cur( bodypart_id( "torso" ), 0 );
+- } else if( get_effect_dur( effect_adrenaline ) > 50_minutes ) {
++ } else if( ( get_effect_dur( effect_adrenaline ) > 50_minutes ) &&
++ !( has_trait( trait_VAMP_SKIN ) ) ) {
+ add_msg_if_player( m_bad, _( "Your heart spasms and stops." ) );
+ g->events().send<event_type::dies_from_drug_overdose>( getID(), effect_adrenaline );
+ set_part_hp_cur( bodypart_id( "torso" ), 0 );
+- } else if( get_effect_int( effect_drunk ) > 4 ) {
++ } else if( ( get_effect_int( effect_drunk ) > 4 ) && !( has_trait( trait_VAMP_SKIN ) ) ) {
+ add_msg_if_player( m_bad, _( "Your breathing slows down to a stop." ) );
+ g->events().send<event_type::dies_from_drug_overdose>( getID(), effect_drunk );
+ set_part_hp_cur( bodypart_id( "torso" ), 0 );
+
@@ -4985,7 +4988,7 @@
void Character::update_bodytemp( const map &m, weather_manager &weather )
{
- if( has_trait( trait_DEBUG_NOTEMP ) ) {
-+ if( has_trait( trait_DEBUG_NOTEMP ) || has_trait( trait_THRESH_VAMP ) ) {
++ if( has_trait( trait_DEBUG_NOTEMP ) || has_trait( trait_VAMP_SKIN ) ) {
temp_cur.fill( BODYTEMP_NORM );
temp_conv.fill( BODYTEMP_NORM );
return;
@@ -159,8 +193,8 @@
if( ( has_trait( trait_HERBIVORE ) || has_trait( trait_RUMINANT ) ) &&
food.has_any_flag( herbivore_blacklist ) ) {
// Like non-cannibal, but more strict!
-@@ -767,6 +780,12 @@
- edible_rating::cannibalism );
+@@ -744,8 +744,15 @@
+ }
}
+ if( food.has_flag( flag_VAMPIRISM ) && ( !has_trait_flag( "VAMPIRE" ) &&
@@ -169,10 +203,14 @@
+ edible_rating::vampirism );
+ }
+
- const bool edible = comest->comesttype == comesttype_FOOD || food.has_flag( flag_USE_EAT_VERB );
-
- int food_kcal = compute_effective_nutrients( food ).kcal;
-@@ -1116,6 +1135,25 @@
+ const bool carnivore = has_trait( trait_CARNIVORE );
+- if( food.has_flag( flag_CANNIBALISM ) && !has_trait_flag( "CANNIBAL" ) ) {
++ if( ( food.has_flag( flag_CANNIBALISM ) && !food.has_flag( flag_VAMPIRISM ) ) &&
++ !has_trait_flag( "CANNIBAL" ) ) {
+ add_consequence( _( "The thought of eating human flesh makes you feel sick." ),
+ edible_rating::cannibalism );
+ }
+@@ -1084,13 +1091,36 @@
}
}
@@ -195,9 +233,21 @@
+ }
+ }
+
- // Allergy check for food that is ingested (not gum)
- if( !food.has_flag( "NO_INGEST" ) ) {
- const auto allergy = allergy_type( food );
+ if( food.has_flag( flag_CANNIBALISM ) ) {
+ const bool cannibal = has_trait( trait_CANNIBAL );
+ const bool psycho = has_trait( trait_PSYCHOPATH );
+ const bool sapiovore = has_trait( trait_SAPIOVORE );
++ const bool vamp = has_trait( trait_VAMP_HUNGER );
+ if( cannibal ) {
+ add_msg_if_player( m_good, _( "You indulge your shameful hunger." ) );
+ add_morale( MORALE_CANNIBAL, 20, 200 );
++ } else if( vamp && !food.has_flag( flag_VAMPIRISM ) ) {
++ add_msg_if_player( m_bad, _( "You feel horrible for eating a person." ) );
++ add_morale( MORALE_CANNIBAL, -60, -400, 60_minutes, 30_minutes );
+ } else if( psycho || sapiovore ) {
+ // Nothing - doesn't care enough to print a message
+ } else {
+
@@ -1123,6 +1161,11 @@
add_msg_if_player( m_bad, _( "Yuck! How can anybody eat this stuff?" ) );
add_morale( allergy, -75, -400, 30_minutes, 24_minutes );
@@ -228,6 +278,41 @@
--- a/src/item.cpp
+++ b/src/item.cpp
+@@ -148,6 +148,7 @@
+ static const species_id ROBOT( "ROBOT" );
+
+ static const std::string trait_flag_CANNIBAL( "CANNIBAL" );
++static const std::string trait_flag_VAMPIRE( "VAMPIRE" );
+
+ 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" );
+@@ -1722,12 +1722,15 @@
+
+ if( food_item->has_flag( flag_CANNIBALISM ) &&
+ parts->test( iteminfo_parts::FOOD_CANNIBALISM ) ) {
+- if( !g->u.has_trait_flag( trait_flag_CANNIBAL ) ) {
++ if( g->u.has_trait_flag( trait_flag_CANNIBAL ) && !g->u.has_trait_flag( trait_flag_VAMPIRE ) ) {
+ info.emplace_back( "DESCRIPTION",
+- _( "* This food contains <bad>human flesh</bad>." ) );
++ _( "* This food contains <good>human flesh</good>." ) );
++ } else if( g->u.has_trait_flag( trait_flag_VAMPIRE ) && food_item->has_flag( flag_VAMPIRISM ) ) {
++ info.emplace_back( "DESCRIPTION",
++ _( "* This food contains <good>human blood</good>." ) );
+ } else {
+ info.emplace_back( "DESCRIPTION",
+- _( "* This food contains <good>human flesh</good>." ) );
++ _( "* This food contains <bad>human flesh</bad>." ) );
+ }
+ }
+
@@ -3947,6 +3947,7 @@
case edible_rating::allergy:
case edible_rating::allergy_weak:
@@ -281,7 +366,7 @@
static const trait_id trait_M_SKIN3( "M_SKIN3" );
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_VAMP_SKIN( "VAMP_SKIN" );
static const trait_id trait_WEB_WALKER( "WEB_WALKER" );
void map::create_burnproducts( const tripoint &p, const item &fuel, const units::mass &burned_mass )
@@ -290,7 +375,7 @@
u.add_env_effect( effect_teargas, bp_mouth, 5, 20_seconds );
}
- if( cur.get_field_intensity() > 1 && ( !inside || one_in( 3 ) ) ) {
-+ if( !( u.has_trait( trait_THRESH_VAMP ) ) && cur.get_field_intensity() > 1 && ( !inside ||
++ if( !( u.has_trait( trait_VAMP_SKIN ) ) && cur.get_field_intensity() > 1 && ( !inside ||
+ one_in( 3 ) ) ) {
u.add_env_effect( effect_blind, bp_eyes, cur.get_field_intensity() * 2, 10_seconds );
}
@@ -301,7 +386,7 @@
// 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_THRESH_VAMP ) ) && !( u.worn_with_flag( flag_GAS_PROOF ) &&
++ 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 ) ) {
const int intensity = cur.get_field_intensity();
@@ -366,7 +451,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_VAMP_SKIN( "VAMP_SKIN" );
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" );
@@ -374,7 +459,7 @@
if( !mutagen ) {
return;
}
-+ if( has_trait( trait_THRESH_VAMP ) ) {
++ if( has_trait( trait_VAMP_SKIN ) ) {
+ add_msg_if_player( m_good, _( "Your Vampire blood quickly destroys the mutagenic contagion." ) );
+ remove_effect( effect_accumulated_mutagen );
+ return;
@@ -386,7 +471,7 @@
{
bool force_bad = one_in( 3 );
bool force_good = false;
-+ if( has_trait( trait_THRESH_VAMP ) ) {
++ if( has_trait( trait_VAMP_SKIN ) ) {
+ add_msg_if_player( m_good, _( "Your Vampire blood quickly destroys the mutagenic contagion." ) );
+ return;
+ }
@@ -423,14 +508,26 @@
--- a/src/player_hardcoded_effects.cpp
+++ b/src/player_hardcoded_effects.cpp
-@@ -114,6 +114,7 @@
+@@ -114,6 +114,8 @@
static const trait_id trait_SEESLEEP( "SEESLEEP" );
static const trait_id trait_SCHIZOPHRENIC( "SCHIZOPHRENIC" );
static const trait_id trait_THRESH_MYCUS( "THRESH_MYCUS" );
+static const trait_id trait_THRESH_VAMP( "THRESH_VAMP" );
++static const trait_id trait_VAMP_SKIN( "VAMP_SKIN" );
static const trait_id trait_WATERSLEEP( "WATERSLEEP" );
static void eff_fun_onfire( player &u, effect &it )
+@@ -841,7 +841,9 @@
+ }
+
+ if( dur > 1800_minutes && one_in( 300 * 512 ) ) {
+- if( !has_trait( trait_NOPAIN ) ) {
++ if( has_trait( trait_VAMP_SKIN ) ) {
++ return;
++ } else if( !has_trait( trait_NOPAIN ) ) {
+ add_msg_if_player( m_bad,
+ _( "Your heart spasms painfully and stops, dragging you back to reality as you die." ) );
+ } else {
@@ -1095,6 +1097,9 @@
// Determine the strength of effects or dreams based upon category strength
int strength = 0; // Category too weak for any effect or dream
@@ -444,16 +541,12 @@
--- a/src/suffer.cpp
+++ b/src/suffer.cpp
-@@ -143,10 +143,12 @@
- static const trait_id trait_SHOUT3( "SHOUT3" );
- static const trait_id trait_SORES( "SORES" );
- static const trait_id trait_SUNBURN( "SUNBURN" );
-+static const trait_id trait_THRESH_VAMP( "THRESH_VAMP" );
- static const trait_id trait_TROGLO( "TROGLO" );
+@@ -143,6 +143,8 @@
static const trait_id trait_TROGLO2( "TROGLO2" );
static const trait_id trait_TROGLO3( "TROGLO3" );
static const trait_id trait_UNSTABLE( "UNSTABLE" );
+static const trait_id trait_VAMP_CURSE( "VAMP_CURSE" );
++static const trait_id trait_VAMP_SKIN( "VAMP_SKIN" );
static const trait_id trait_VOMITOUS( "VOMITOUS" );
static const trait_id trait_WEB_SPINNER( "WEB_SPINNER" );
static const trait_id trait_WEB_WEAVER( "WEB_WEAVER" );
@@ -463,7 +556,7 @@
{
- if( !has_trait( trait_GILLS ) && !has_trait( trait_GILLS_CEPH ) ) {
+ if( !has_trait( trait_GILLS ) && !has_trait( trait_GILLS_CEPH ) &&
-+ !has_trait( trait_THRESH_VAMP ) ) {
++ !has_trait( trait_VAMP_SKIN ) ) {
oxygen--;
}
if( oxygen < 12 && worn_with_flag( "REBREATHER" ) ) {
@@ -531,7 +624,7 @@
"percent_spread": 10,
"outdoor_age_speedup": "0 turns",
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 7 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 7 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 7 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "2 minutes",
"phase": "gas",
@@ -540,7 +633,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "10 minutes",
"phase": "gas",
@@ -549,7 +642,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ], [ "eyes", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ], [ "eyes", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "5 minutes",
"phase": "gas",
@@ -558,7 +651,7 @@
"gas_absorption_factor": 15,
"dirty_transparency_cache": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"phase": "gas",
"display_items": false,
"display_field": true,
@@ -567,7 +660,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "50 minutes",
"phase": "gas",
@@ -576,7 +669,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "15 minutes",
"phase": "gas",
@@ -585,7 +678,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "10 minutes",
"phase": "gas"
@@ -594,7 +687,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "30 minutes",
"phase": "gas",
@@ -603,7 +696,7 @@
"dirty_transparency_cache": true,
"has_fume": true,
- "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ] },
-+ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "THRESH_VAMP" ] },
++ "immunity_data": { "body_part_env_resistance": [ [ "mouth", 15 ] ], "traits": [ "VAMP_SKIN" ] },
"priority": 8,
"half_life": "30 minutes",
"phase": "gas",