Skip to content

Commit

Permalink
Jsonize field effects for toxic gas
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhilkinSerg committed Nov 22, 2019
1 parent e26ed36 commit 5cce7d9
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 22 deletions.
68 changes: 65 additions & 3 deletions data/json/field_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,71 @@
"type": "field_type",
"legacy_enum_id": 13,
"intensity_levels": [
{ "name": "hazy cloud", "sym": "8", "dangerous": true, "translucency": 1 },
{ "name": "toxic gas", "color": "light_green", "transparent": false, "translucency": 10 },
{ "name": "thick toxic gas", "color": "green", "translucency": 0 }
{
"name": "hazy cloud",
"sym": "8",
"dangerous": true,
"translucency": 1,
"effects": [
{
"effect_id": "poison",
"body_part": "MOUTH",
"intensity": 2,
"min_duration": "2 minutes",
"max_duration": "2 minutes",
"immune_inside_vehicle": true,
"message": "You feel sick from inhaling the hazy cloud",
"message_type": "bad"
}
]
},
{
"name": "toxic gas",
"color": "light_green",
"transparent": false,
"translucency": 10,
"effects": [
{
"effect_id": "poison",
"body_part": "MOUTH",
"intensity": 5,
"min_duration": "3 minutes",
"max_duration": "3 minutes",
"immune_inside_vehicle": true,
"message": "You feel sick from inhaling the toxic gas",
"message_type": "bad"
}
]
},
{
"name": "thick toxic gas",
"color": "green",
"translucency": 0,
"effects": [
{
"effect_id": "poison",
"body_part": "MOUTH",
"intensity": 5,
"min_duration": "3 minutes",
"max_duration": "3 minutes",
"//": "won't be applied outside of vehicles, so it could apply harsher effect",
"immune_outside_vehicle": true,
"message": "You feel sick from inhaling the thick toxic gas",
"message_type": "bad"
},
{
"effect_id": "badpoison",
"body_part": "MOUTH",
"intensity": 5,
"min_duration": "3 minutes",
"max_duration": "3 minutes",
"//": "won't be applied inside of vehicles, so it could apply lesser effect",
"immune_inside_vehicle": true,
"message": "You feel sick from inhaling the thick toxic gas",
"message_type": "bad"
}
]
}
],
"decay_amount_factor": 5,
"gas_absorption_factor": 15,
Expand Down
19 changes: 0 additions & 19 deletions src/map_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1537,25 +1537,6 @@ void map::player_in_field( player &u )
u.add_env_effect( effect_blind, bp_eyes, 2, 2_turns );
}
}
if( ft == fd_toxic_gas ) {
// Toxic gas at low levels poisons you.
// Toxic gas at high levels will cause very nasty poison.
{
bool inhaled = false;
if( ( cur.get_field_intensity() == 2 && !inside ) ||
( cur.get_field_intensity() == 3 && inside ) ) {
inhaled = u.add_env_effect( effect_poison, bp_mouth, 5, 3_minutes );
} else if( cur.get_field_intensity() == 3 && !inside ) {
inhaled = u.add_env_effect( effect_badpoison, bp_mouth, 5, 3_minutes );
} else if( cur.get_field_intensity() == 1 && !inside ) {
inhaled = u.add_env_effect( effect_poison, bp_mouth, 2, 2_minutes );
}
if( inhaled ) {
// Player does not know how the npc feels, so no message.
u.add_msg_if_player( m_bad, _( "You feel sick from inhaling the %s" ), cur.name() );
}
}
}

if( cur.extra_radiation_min() > 0 ) {
// Get irradiated by the nuclear fallout.
Expand Down

0 comments on commit 5cce7d9

Please sign in to comment.