diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index a489d5ea76237..d543df7fe56b8 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -4316,7 +4316,7 @@ cata::optional mutagen_actor::use( Character &p, item &it, bool, const trip p.add_msg_if_player( m_category.mutagen_message() ); - if( one_in( 6 ) ) { + if( one_in( 6 ) && !p.is_on_ground() ) { p.add_msg_player_or_npc( m_bad, _( "You suddenly feel dizzy, and collapse to the ground." ), _( " suddenly collapses to the ground!" ) ); diff --git a/src/player_hardcoded_effects.cpp b/src/player_hardcoded_effects.cpp index 1a79253269e48..612b825b85dd8 100644 --- a/src/player_hardcoded_effects.cpp +++ b/src/player_hardcoded_effects.cpp @@ -640,7 +640,7 @@ static void eff_fun_datura( Character &u, effect &it ) } if( dur > 600_minutes && one_in( 768 ) ) { u.mod_pain( rng( -3, -24 ) ); - if( dur > 800_minutes && one_in( 16 ) ) { + if( dur > 800_minutes && one_in( 16 ) && !u.is_on_ground() ) { u.add_msg_if_player( m_bad, _( "You're experiencing loss of basic motor skills and blurred vision. Your mind recoils in horror, unable to communicate with your spinal column." ) ); u.add_msg_if_player( m_bad, _( "You stagger and fall!" ) ); @@ -779,7 +779,7 @@ static void eff_fun_hypovolemia( Character &u, effect &it ) u.mod_stamina( -500 * intense ); break; case 6: - if( one_in( 2 ) ) { + if( one_in( 2 ) && !u.is_on_ground() ) { warning = _( "You drop to the ground, fighting to keep yourself conscious." ); u.add_effect( effect_downed, rng( 1_minutes, 2_minutes ) ); break; @@ -907,8 +907,10 @@ static void eff_fun_redcells_anemia( Character &u, effect &it ) u.add_effect( effect_lying_down, rng( 2_minutes, 5_minutes ) ); break; case 6: - u.add_msg_if_player( m_bad, _( "You must sit down for a moment. Just a moment." ) ); - u.add_effect( effect_downed, rng( 1_minutes, 2_minutes ) ); + if( !u.is_on_ground() ) { + u.add_msg_if_player( m_bad, _( "You must sit down for a moment. Just a moment." ) ); + u.add_effect( effect_downed, rng( 1_minutes, 2_minutes ) ); + } break; case 7: // 7-9 empty for variability, as messages stack on higher intensity case 8: @@ -1349,7 +1351,9 @@ void Character::hardcoded_effects( effect &it ) add_miss_reason( _( "Your muscles are locking up and you can't fight effectively." ), 4 ); if( one_in( 3072 ) ) { add_msg_if_player( m_bad, _( "Your muscles spasm." ) ); - schedule_effect( effect_downed, rng( 1_turns, 4_turns ), false, 0, true ); + if( !is_on_ground() ) { + schedule_effect( effect_downed, rng( 1_turns, 4_turns ), false, 0, true ); + } schedule_effect( effect_stunned, rng( 1_turns, 4_turns ) ); if( one_in( 10 ) ) { mod_pain( rng( 1, 10 ) ); @@ -1598,7 +1602,9 @@ void Character::hardcoded_effects( effect &it ) add_msg_if_player( m_bad, _( "You lose control of your body as it begins to convulse!" ) ); time_duration td = rng( 30_seconds, 4_minutes ); schedule_effect( effect_motor_seizure, td ); - schedule_effect( effect_downed, td ); + if( !is_on_ground() ) { + schedule_effect( effect_downed, td ); + } schedule_effect( effect_stunned, td ); if( one_in( 3 ) ) { add_msg_if_player( m_bad, _( "You lose consciousness!" ) ); @@ -1628,7 +1634,7 @@ void Character::hardcoded_effects( effect &it ) } } } else if( limb == "leg" ) { - if( dice( 4, 4 ) > get_dex() ) { + if( dice( 4, 4 ) > get_dex() && !is_on_ground() ) { schedule_effect( effect_downed, rng( 5_seconds, 10_seconds ) ); } else { add_msg_if_player( m_neutral, _( "However, you manage to keep your footing." ) ); @@ -1640,7 +1646,9 @@ void Character::hardcoded_effects( effect &it ) add_msg_if_player( m_bad, _( "You suddenly lose all muscle tone, and can't support your own weight!" ) ); schedule_effect( effect_motor_seizure, rng( 1_seconds, 2_seconds ) ); - schedule_effect( effect_downed, rng( 5_seconds, 10_seconds ) ); + if( !is_on_ground() ) { + schedule_effect( effect_downed, rng( 5_seconds, 10_seconds ) ); + } } mod *= 2; /* fallthrough */ diff --git a/src/suffer.cpp b/src/suffer.cpp index 0bea02090a023..4e5c16d5c50ba 100644 --- a/src/suffer.cpp +++ b/src/suffer.cpp @@ -1289,9 +1289,9 @@ void suffer::from_stimulants( Character &you, const int current_stim ) { // Stim +250 kills if( current_stim > 210 ) { - if( one_turn_in( 2_minutes ) && !you.has_effect( effect_downed ) ) { + if( one_turn_in( 2_minutes ) && !you.is_on_ground() ) { you.add_msg_if_player( m_bad, _( "Your muscles spasm!" ) ); - if( !you.has_effect( effect_downed ) ) { + if( !you.is_on_ground() ) { you.add_msg_if_player( m_bad, _( "You fall to the ground!" ) ); you.add_effect( effect_downed, rng( 6_turns, 20_turns ) ); } @@ -1321,7 +1321,9 @@ void suffer::from_stimulants( Character &you, const int current_stim ) if( one_turn_in( 3_minutes ) && !you.in_sleep_state() ) { you.add_msg_if_player( m_bad, _( "You black out!" ) ); const time_duration dur = rng( 30_minutes, 60_minutes ); - you.add_effect( effect_downed, dur ); + if( !you.is_on_ground() ) { + you.add_effect( effect_downed, dur ); + } you.add_effect( effect_blind, dur ); you.fall_asleep( dur ); } @@ -1336,7 +1338,7 @@ void suffer::from_stimulants( Character &you, const int current_stim ) if( one_turn_in( 15_seconds ) && !you.has_effect( effect_sleep ) ) { you.add_msg_if_player( m_bad, _( "You feel dizzy for a moment." ) ); you.mod_moves( -rng( 10, 30 ) ); - if( one_in( 3 ) && !you.has_effect( effect_downed ) ) { + if( one_in( 3 ) && !you.is_on_ground() ) { you.add_msg_if_player( m_bad, _( "You stumble and fall over!" ) ); you.add_effect( effect_downed, rng( 3_turns, 10_turns ) ); } @@ -1516,7 +1518,7 @@ void suffer::without_sleep( Character &you, const int sleep_deprivation ) you.moves -= 10; you.add_msg_player_or_npc( m_warning, _( "Your shaking legs make you stumble." ), _( " stumbles." ) ); - if( !you.has_effect( effect_downed ) && one_in( 10 ) ) { + if( !you.is_on_ground() && one_in( 10 ) ) { you.add_msg_player_or_npc( m_bad, _( "You fall over!" ), _( " falls over!" ) ); you.add_effect( effect_downed, rng( 3_turns, 10_turns ) ); }