diff --git a/source/games/duke/src/zz_player.cpp b/source/games/duke/src/zz_player.cpp index 5a282d048..42ae56f60 100644 --- a/source/games/duke/src/zz_player.cpp +++ b/source/games/duke/src/zz_player.cpp @@ -2702,398 +2702,6 @@ static void P_Thrust(DukePlayer_t *const pPlayer, int shift) pPlayer->vel.y += sintable[fix16_to_int(pPlayer->q16ang)&2047] << shift; } -static int32_t P_DoCounters(int playerNum) -{ - DukePlayer_t *const pPlayer = g_player[playerNum].ps; - - if (RRRA) - { - if (WindTime > 0) - WindTime--; - else if ((krand2() & 127) == 8) - { - WindTime = 120+((krand2()&63)<<2); - WindDir = krand2()&2047; - } - - if (g_bellTime > 0) - { - g_bellTime--; - if (g_bellTime == 0) - sprite[g_bellSprite].picnum++; - } - - if (playerNum == 0 && chickenphase > 0) - chickenphase--; - - if (pPlayer->sea_sick) - { - pPlayer->sea_sick--; - if (pPlayer->sea_sick) - pPlayer->sea_sick_stat = 0; - } - - } - - if (RR) - { - if (pPlayer->yehaa_timer) - pPlayer->yehaa_timer--; - - if (pPlayer->detonate_count > 0) - { - pPlayer->detonate_count++; - pPlayer->detonate_time--; - } - - if (--pPlayer->drink_timer <= 0) - { - pPlayer->drink_timer = 1024; - if (pPlayer->drink_amt) - pPlayer->drink_amt--; - } - - if (--pPlayer->eat_timer <= 0) - { - pPlayer->eat_timer = 1024; - if (pPlayer->eat) - pPlayer->eat--; - } - - if (pPlayer->drink_amt == 100) - { - if (!A_CheckSoundPlaying(pPlayer->i, 420)) - A_PlaySound(420, pPlayer->i); - pPlayer->drink_amt -= 9; - pPlayer->eat >>= 1; - } - pPlayer->eatang = (1647 + pPlayer->eat * 8) & 2047; - - if (pPlayer->eat >= 100) - pPlayer->eat = 100; - - if (pPlayer->eat >= 31 && krand2() < pPlayer->eat) - { - switch (krand2()&3) - { - case 0: - A_PlaySound(404, pPlayer->i); - break; - case 1: - A_PlaySound(422, pPlayer->i); - break; - case 2: - A_PlaySound(423, pPlayer->i); - break; - case 3: - A_PlaySound(424, pPlayer->i); - break; - } - if (!g_netServer && numplayers < 2) - { - pPlayer->noise_radius = 16384; - madenoise(playerNum); - P_Thrust(pPlayer, 4); - } - pPlayer->eat -= 4; - if (pPlayer->eat < 0) - pPlayer->eat = 0; - } - } - - if (pPlayer->invdisptime > 0) - pPlayer->invdisptime--; - - if (pPlayer->tipincs > 0) - pPlayer->tipincs--; - - if (pPlayer->last_pissed_time > 0) - { - if (RR) - { - --pPlayer->last_pissed_time; - - if (pPlayer->drink_amt > 66 && (pPlayer->last_pissed_time % GAMETICSPERSEC) == 0) - pPlayer->drink_amt--; - - if (!adult_lockout) - { - switch (pPlayer->last_pissed_time) - { - case 5662: - A_PlaySound(434, pPlayer->i); - break; - case 5567: - A_PlaySound(434, pPlayer->i); - break; - case 5472: - A_PlaySound(433, pPlayer->i); - break; - case 5072: - A_PlaySound(435, pPlayer->i); - break; - case 5014: - A_PlaySound(434, pPlayer->i); - break; - case 4919: - A_PlaySound(433, pPlayer->i); - break; - } - } - if (pPlayer->last_pissed_time == 5668) - { - pPlayer->holster_weapon = 0; - pPlayer->weapon_pos = WEAPON_POS_RAISE; - } - } - else - switch (--pPlayer->last_pissed_time) - { - case GAMETICSPERSEC * 219: - { - A_PlaySound(FLUSH_TOILET, pPlayer->i); - if (playerNum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND)) - A_PlaySound(DUKE_PISSRELIEF, pPlayer->i); - } - break; - case GAMETICSPERSEC * 218: - { - pPlayer->holster_weapon = 0; - pPlayer->weapon_pos = WEAPON_POS_RAISE; - } - break; - } - } - - if (pPlayer->crack_time > 0) - { - if (--pPlayer->crack_time == 0) - { - pPlayer->knuckle_incs = 1; - pPlayer->crack_time = 777; - } - } - - if (pPlayer->inv_amount[GET_STEROIDS] > 0 && pPlayer->inv_amount[GET_STEROIDS] < 400) - { - if (--pPlayer->inv_amount[GET_STEROIDS] == 0) - { - P_SelectNextInvItem(pPlayer); - if (RR) - { - pPlayer->eat = pPlayer->drink_amt = 0; - pPlayer->eatang = pPlayer->drunkang = 1647; - } - } - - if (!(pPlayer->inv_amount[GET_STEROIDS] & (RR ? 14 : 7))) - if (playerNum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND)) - A_PlaySound(RR ? DUKE_TAKEPILLS : DUKE_HARTBEAT, pPlayer->i); - } - - if (!RR) - { - if (pPlayer->heat_on && pPlayer->inv_amount[GET_HEATS] > 0) - { - if (--pPlayer->inv_amount[GET_HEATS] == 0) - { - pPlayer->heat_on = 0; - P_SelectNextInvItem(pPlayer); - A_PlaySound(NITEVISION_ONOFF, pPlayer->i); - P_UpdateScreenPal(pPlayer); - } - } - - if (pPlayer->holoduke_on >= 0) - { - if (--pPlayer->inv_amount[GET_HOLODUKE] <= 0) - { - A_PlaySound(TELEPORTER, pPlayer->i); - pPlayer->holoduke_on = -1; - P_SelectNextInvItem(pPlayer); - } - } - - if (pPlayer->jetpack_on && pPlayer->inv_amount[GET_JETPACK] > 0) - { - if (--pPlayer->inv_amount[GET_JETPACK] <= 0) - { - pPlayer->jetpack_on = 0; - P_SelectNextInvItem(pPlayer); - A_PlaySound(DUKE_JETPACK_OFF, pPlayer->i); - S_StopEnvSound(DUKE_JETPACK_IDLE, pPlayer->i); - S_StopEnvSound(DUKE_JETPACK_ON, pPlayer->i); - } - } - - if (pPlayer->quick_kick > 0 && sprite[pPlayer->i].pal != 1) - { - pPlayer->last_quick_kick = pPlayer->quick_kick + 1; - - if (--pPlayer->quick_kick == 8) - fi.shoot(pPlayer->i, TILE_KNEE); - } - else if (pPlayer->last_quick_kick > 0) - --pPlayer->last_quick_kick; - } - - if (pPlayer->access_incs && sprite[pPlayer->i].pal != 1) - { - ++pPlayer->access_incs; - - if (sprite[pPlayer->i].extra <= 0) - pPlayer->access_incs = 12; - - if (pPlayer->access_incs == 12) - { - if (pPlayer->access_spritenum >= 0) - { - fi.checkhitswitch(playerNum, pPlayer->access_spritenum, 1); - switch (sprite[pPlayer->access_spritenum].pal) - { - case 0: RR ? pPlayer->keys[1] = 1 : pPlayer->got_access &= (0xffff - 0x1); break; - case 21: RR ? pPlayer->keys[2] = 1 : pPlayer->got_access &= (0xffff - 0x2); break; - case 23: RR ? pPlayer->keys[3] = 1 : pPlayer->got_access &= (0xffff - 0x4); break; - } - pPlayer->access_spritenum = -1; - } - else - { - fi.checkhitswitch(playerNum,pPlayer->access_wallnum,0); - switch (wall[pPlayer->access_wallnum].pal) - { - case 0: RR ? pPlayer->keys[1] = 1 : pPlayer->got_access &= (0xffff - 0x1); break; - case 21: RR ? pPlayer->keys[2] = 1 : pPlayer->got_access &= (0xffff - 0x2); break; - case 23: RR ? pPlayer->keys[3] = 1 : pPlayer->got_access &= (0xffff - 0x4); break; - } - } - } - - if (pPlayer->access_incs > 20) - { - pPlayer->access_incs = 0; - pPlayer->weapon_pos = WEAPON_POS_RAISE; - pPlayer->kickback_pic = 0; - } - } - - if (pPlayer->cursectnum >= 0 && pPlayer->scuba_on == 0 && sector[pPlayer->cursectnum].lotag == ST_2_UNDERWATER) - { - if (pPlayer->inv_amount[GET_SCUBA] > 0) - { - pPlayer->scuba_on = 1; - pPlayer->inven_icon = ICON_SCUBA; - P_DoQuote(QUOTE_SCUBA_ON, pPlayer); - } - else - { - if (pPlayer->airleft > 0) - --pPlayer->airleft; - else - { - pPlayer->extra_extra8 += 32; - if (pPlayer->last_extra < (max_player_health >> 1) && (pPlayer->last_extra & 3) == 0) - A_PlaySound(DUKE_LONGTERM_PAIN, pPlayer->i); - } - } - } - else if (pPlayer->inv_amount[GET_SCUBA] > 0 && pPlayer->scuba_on) - { - pPlayer->inv_amount[GET_SCUBA]--; - if (pPlayer->inv_amount[GET_SCUBA] == 0) - { - pPlayer->scuba_on = 0; - P_SelectNextInvItem(pPlayer); - } - } - - if (pPlayer->knuckle_incs) - { - if (++pPlayer->knuckle_incs == 10) - { - if (RR && !wupass) - { - int soundId = 391; - wupass = 1; - if (!g_lastLevel) switch (ud.volume_number) - { - case 0: - switch (ud.level_number) - { - case 0: - soundId = RRRA ? 63 : 391; - break; - case 1: - soundId = 64; - break; - case 2: - soundId = 77; - break; - case 3: - soundId = 80; - break; - case 4: - soundId = 102; - break; - case 5: - soundId = 103; - break; - case 6: - soundId = 104; - break; - } - break; - case 1: - switch (ud.level_number) - { - case 0: - soundId = 105; - break; - case 1: - soundId = 176; - break; - case 2: - soundId = 177; - break; - case 3: - soundId = 198; - break; - case 4: - soundId = 230; - break; - case 5: - soundId = 255; - break; - case 6: - soundId = 283; - break; - } - break; - } - A_PlaySound(soundId, pPlayer->i); - } - else if (!WW2GI) - { - if (totalclock > 1024) - if (playerNum == screenpeek || GTFLAGS(GAMETYPE_COOPSOUND)) - { - if (rand()&1) - A_PlaySound(DUKE_CRACK,pPlayer->i); - else A_PlaySound(DUKE_CRACK2,pPlayer->i); - } - - A_PlaySound(DUKE_CRACK_FIRST, pPlayer->i); - } - } - else if (pPlayer->knuckle_incs == 22 || TEST_SYNC_KEY(g_player[playerNum].input->bits, SK_FIRE)) - pPlayer->knuckle_incs=0; - - return 1; - } - - return 0; -} - int16_t WeaponPickupSprites[MAX_WEAPONS] = { KNEE__STATIC, FIRSTGUNSPRITE__STATIC, SHOTGUNSPRITE__STATIC, CHAINGUNSPRITE__STATIC, RPGSPRITE__STATIC, HEAVYHBOMB__STATIC, SHRINKERSPRITE__STATIC, DEVISTATORSPRITE__STATIC, TRIPBOMBSPRITE__STATIC, FREEZESPRITE__STATIC, HEAVYHBOMB__STATIC, SHRINKERSPRITE__STATIC