Advertisement
Guest User

Untitled

a guest
Jun 15th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.86 KB | None | 0 0
  1. else if( id == effect_toxin_buildup ) {
  2.         // Loosely based on toxic man-made compounds (mostly pesticides) which don't degrade
  3.         // easily, leading to build-up in muscle and fat tissue through bioaccumulation.
  4.         // Symptoms vary, and many are too long-term to be relevant in C:DDA (i.e. carcinogens),
  5.         // but lowered immune response and neurotoxicity (i.e. seizures, migraines) are common.
  6.  
  7.         if( in_sleep_state() ) {
  8.             return;
  9.         }
  10.         // Modifier for symptom frequency.
  11.         // Each symptom is twice as frequent for each level of intensity above the one it first appears for.
  12.         int mod = 1;
  13.         switch( intense ) {
  14.             case 3:
  15.                 // Tonic-clonic seizure (full body convulsive seizure)
  16.                 if( one_turn_in( 3_days ) && !has_effect( effect_valium ) ) {
  17.                     add_msg_if_player( m_bad, _( "You lose control of your body as it begins to convulse!" ) );
  18.                     time_duration td = rng( 30_seconds, 4_minutes );
  19.                     add_effect( effect_motor_seizure, td );
  20.                     add_effect( effect_downed, td );
  21.                     add_effect( effect_stunned, td );
  22.                     if( one_in( 3 ) ) {
  23.                         add_msg_if_player( m_bad, _( "You lose consciousness!" ) );
  24.                         fall_asleep( td );
  25.                     }
  26.                 }
  27.                 mod *= 2;
  28.             /* fallthrough */
  29.             case 2:
  30.                 // Myoclonic seizure (muscle spasm)
  31.                 if( one_turn_in( 2_hours / mod ) && !has_effect( effect_valium ) ) {
  32.                     std::string limb = random_entry<std::vector<std::string>>( {
  33.                         translate_marker( "arm" ), translate_marker( "hand" ), translate_marker( "leg" )
  34.                     } );
  35.                     add_msg_if_player( m_bad, string_format(
  36.                                            _( "Your %s suddenly jerks in an unexpected direction!" ), _( limb ) ) );
  37.                     if( limb == "arm" ) {
  38.                         mod_dex_bonus( -8 );
  39.                         recoil = MAX_RECOIL;
  40.                     } else if( limb == "hand" ) {
  41.                         if( is_armed() && can_unwield( weapon ).success() ) {
  42.                             if( dice( 4, 4 ) > get_dex() ) {
  43.                                 put_into_vehicle_or_drop( *this, item_drop_reason::tumbling, { remove_weapon() } );
  44.                             } else {
  45.                                 add_msg_if_player( m_neutral, _( "However, you manage to keep hold of your weapon." ) );
  46.                             }
  47.                         }
  48.                     } else if( limb == "leg" ) {
  49.                         if( dice( 4, 4 ) > get_dex() ) {
  50.                             add_effect( effect_downed, rng( 5_seconds, 10_seconds ) );
  51.                         } else {
  52.                             add_msg_if_player( m_neutral, _( "However, you manage to keep your footing." ) );
  53.                         }
  54.                     }
  55.                 }
  56.                 // Atonic seizure (a.k.a. drop seizure)
  57.                 if( one_turn_in( 2_days / mod ) && !has_effect( effect_valium ) ) {
  58.                     add_msg_if_player( m_bad,
  59.                                        _( "You suddenly lose all muscle tone, and can't support your own weight!" ) );
  60.                     add_effect( effect_motor_seizure, rng( 1_seconds, 2_seconds ) );
  61.                     add_effect( effect_downed, rng( 5_seconds, 10_seconds ) );
  62.                 }
  63.                 mod *= 2;
  64.             /* fallthrough */
  65.             case 1:
  66.                 // Migraine
  67.                 if( one_turn_in( 2_days / mod ) ) {
  68.                     add_msg_if_player( m_bad, _( "You have a splitting headache." ) );
  69.                     mod_pain( 12 );
  70.                 }
  71.  
  72.                 break;
  73.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement