Skip to content

Commit

Permalink
BALANCE Limit overeating and overdrinking +misc stuff
Browse files Browse the repository at this point in the history
The intent of limiting overeating and overdrinking is preventing infinite health grinding from pine tea and similar. This is a tedious but optimal tactic.
The same tactic can be used for morale bonus.

When eating/drinking over fullness, you gain "bloated" status.
When eating/drinking when bloated, you vomit first.
Bloated status clears a minute after your calories and thirst go back to normal range (actual time depends on how nourishing the meal was).
Vomiting removes positive health mod (the direction of health stat change).

Additionally:
Simplified cannibal effects - no more bonuses from other traits, higher base bonus.
Removed rigid table manners trait.
Simplified rot penalties: it no longer scales with rottedness, instead being equal to old "halfway rotten".
  • Loading branch information
Coolthulhu committed Sep 1, 2020
1 parent 61bbfc8 commit 6c92546
Show file tree
Hide file tree
Showing 15 changed files with 202 additions and 321 deletions.
12 changes: 12 additions & 0 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -1901,5 +1901,17 @@
"max_intensity": 7,
"max_duration": "22 d",
"int_dur_factor": "3 d"
},
{
"type": "effect_type",
"id": "bloated",
"name": [ "Bloated" ],
"desc": [
"You're too full to eat anything. You'll vomit if you try eating anything without waiting for your stomach to empty."
],
"apply_message": "Your stomach is full.",
"remove_message": "You no longer feel so full.",
"rating": "bad",
"max_duration": "10 m"
}
]
44 changes: 14 additions & 30 deletions data/json/items/chemicals_and_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@
"phase": "liquid",
"charges": 2,
"category": "chems",
"fun": -30,
"freezing_point": 17
"fun": -30
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -318,68 +317,56 @@
"fun": -15
},
{
"type": "COMESTIBLE",
"type": "AMMO",
"id": "insecticide",
"category": "chems",
"name": { "str_sp": "insecticide" },
"weight": "1 g",
"//": "Typically sold in larger quantities, but that's handed in the charge count.",
"color": "pink",
"looks_like": "fungicide",
"use_action": "BLECH",
"stim": -7,
"container": "bag_plastic",
"comestible_type": "FOOD",
"symbol": "!",
"healthy": -7,
"description": "Agricultural-grade chemical insecticide powder designed to eradicate insect pests.",
"price": 1100,
"price_postapoc": 1000,
"material": "powder",
"ammo_type": "components",
"volume": "125ml",
"charges": 400,
"stack_size": 200,
"fun": -15
"count": 400,
"stack_size": 200
},
{
"type": "COMESTIBLE",
"type": "AMMO",
"id": "salt_water",
"name": { "str_sp": "salt water" },
"weight": "260 g",
"color": "light_cyan",
"container": "bottle_plastic",
"comestible_type": "DRINK",
"symbol": "~",
"quench": -30,
"healthy": -1,
"description": "Water with salt added. Not good for drinking.",
"price": 0,
"price_postapoc": 0,
"volume": "250 ml",
"phase": "liquid",
"category": "chems",
"freezing_point": 28,
"fun": -1
"ammo_type": "components",
"category": "chems"
},
{
"type": "COMESTIBLE",
"type": "AMMO",
"id": "soapy_water",
"name": { "str_sp": "soapy water" },
"weight": "260 g",
"color": "light_cyan",
"container": "bottle_plastic",
"comestible_type": "DRINK",
"symbol": "~",
"quench": -5,
"healthy": -1,
"description": "Water with soap added. Not good for drinking.",
"price": 0,
"price_postapoc": 0,
"volume": "250 ml",
"phase": "liquid",
"category": "chems",
"freezing_point": 28,
"fun": -1
"ammo_type": "components",
"category": "chems"
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -447,24 +434,21 @@
"drop_action": { "type": "emit_actor", "emits": [ "emit_acid_splash" ], "scale_qty": true }
},
{
"type": "COMESTIBLE",
"type": "AMMO",
"id": "sewage",
"name": "sewage sample",
"weight": "280 g",
"color": "green",
"use_action": "SEWAGE",
"container": "bottle_plastic",
"comestible_type": "DRINK",
"symbol": "~",
"quench": 5,
"healthy": -20,
"description": "A sample of sewage from a treatment plant. Gross.",
"price": 0,
"price_postapoc": 0,
"volume": "250 ml",
"phase": "liquid",
"category": "chems",
"fun": -20
"ammo_type": "components",
"category": "chems"
},
{
"type": "AMMO",
Expand Down
9 changes: 0 additions & 9 deletions data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,6 @@
"valid": false,
"cancels": [ "SLOWLEARNER" ]
},
{
"type": "mutation",
"id": "TABLEMANNERS",
"name": { "str": "Rigid Table Manners" },
"points": -1,
"description": "You've been taught proper table manners from your early childhood on. Now you can't even think about eating without a table. Eating without it frustrates you, but eating like a civilized person gives you a bigger morale bonus.",
"starting_trait": true,
"valid": false
},
{
"type": "mutation",
"id": "STRONGSTOMACH",
Expand Down
9 changes: 9 additions & 0 deletions data/json/obsoletion/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,14 @@
"description": "You recover from pain much faster than normal. DUMMIED OUT because it wasn't actually functional…",
"valid": false,
"player_display": false
},
{
"type": "mutation",
"id": "TABLEMANNERS",
"name": { "str": "Rigid Table Manners" },
"points": 0,
"description": "You've been taught proper table manners from your early childhood on. Now you can't even think about eating without a table. Eating without it frustrates you, but eating like a civilized person gives you a bigger morale bonus.",
"starting_trait": false,
"valid": false
}
]
12 changes: 9 additions & 3 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ static const efftype_id effect_bite( "bite" );
static const efftype_id effect_bleed( "bleed" );
static const efftype_id effect_blind( "blind" );
static const efftype_id effect_blisters( "blisters" );
static const efftype_id effect_bloated( "bloated" );
static const efftype_id effect_boomered( "boomered" );
static const efftype_id effect_cig( "cig" );
static const efftype_id effect_cold( "cold" );
Expand Down Expand Up @@ -7510,11 +7511,9 @@ void Character::vomit()
if( get_effect_int( effect_fungus ) >= 3 ) {
add_msg_player_or_npc( m_bad, _( "You vomit thousands of live spores!" ),
_( "<npcname> vomits thousands of live spores!" ) );
stomach.empty();
fungal_effects( *g, g->m ).fungalize( pos(), this );
} else if( stomach.get_calories() > 0 ) {
} else if( stomach.get_calories() > 0 || get_thirst() < 0 ) {
add_msg_player_or_npc( m_bad, _( "You throw up heavily!" ), _( "<npcname> throws up heavily!" ) );
stomach.empty();
g->m.add_field( adjacent_tile(), fd_bile, 1 );
} else {
return;
Expand All @@ -7526,6 +7525,13 @@ void Character::vomit()
stomach.get_calories() / 100, dummy_nausea.get_int_dur_factor() ) );
}

stomach.empty();
set_thirst( std::max( 0, get_thirst() ) );
remove_effect( effect_bloated );
if( get_healthy_mod() > 0 ) {
set_healthy_mod( 0 );
}

moves -= 100;
for( auto &elem : *effects ) {
for( auto &_effect_it : elem.second ) {
Expand Down
24 changes: 13 additions & 11 deletions src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,27 +140,29 @@ enum sleep_deprivation_levels {

// This tries to represent both rating and
// character's decision to respect said rating
enum edible_rating {
enum class edible_rating {
// Edible or we pretend it is
EDIBLE,
edible,
// Not food at all
INEDIBLE,
inedible,
// Not food because mutated mouth/system
INEDIBLE_MUTATION,
inedible_mutation,
// You can eat it, but it will hurt morale
ALLERGY,
allergy,
// Smaller allergy penalty
ALLERGY_WEAK,
allergy_weak,
// Cannibalism (unless psycho/cannibal)
CANNIBALISM,
cannibalism,
// Rotten or not rotten enough (for saprophages)
ROTTEN,
rotten,
// Can provoke vomiting if you already feel nauseous.
NAUSEA,
nausea,
// We did overeat, cramming more will surely cause vomiting.
bloated,
// We can eat this, but we'll overeat
TOO_FULL,
too_full,
// Some weird stuff that requires a tool we don't have
NO_TOOL
no_tool
};

enum class rechargeable_cbm {
Expand Down
Loading

0 comments on commit 6c92546

Please sign in to comment.