diff --git a/src/p_inter.c b/src/p_inter.c index 3791b7d52..0940648aa 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -210,144 +210,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) /////ENEMIES & BOSSES!!///////////////////////////////// //////////////////////////////////////////////////////// - switch (special->type) - { - case MT_BLACKEGGMAN: - { - P_DamageMobj(toucher, special, special, 1, 0); // ouch - return; - } - - case MT_BIGMINE: - { - special->momx = toucher->momx/3; - special->momy = toucher->momy/3; - special->momz = toucher->momz/3; - toucher->momx /= -8; - toucher->momy /= -8; - toucher->momz /= -8; - special->flags &= ~MF_SPECIAL; - if (special->info->activesound) - S_StartSound(special, special->info->activesound); - P_SetTarget(&special->tracer, toucher); - player->homing = 0; - return; - } - - case MT_GSNAPPER: - if (toucher->z < special->z + special->height - && toucher->z + toucher->height > special->z - && P_DamageMobj(toucher, special, special, 1, DMG_SPIKE)) - return; // Can only hit snapper from above - break; - - case MT_SPINCUSHION: - if (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) - { - if (P_DamageMobj(toucher, special, special, 1, DMG_SPIKE)) - return; // Cannot hit sharp from above - } - break; - - case MT_FANG: - if (!player->powers[pw_flashing]) - { - if ((special->state == &states[S_FANG_BOUNCE3] - || special->state == &states[S_FANG_BOUNCE4] - || special->state == &states[S_FANG_PINCHBOUNCE3] - || special->state == &states[S_FANG_PINCHBOUNCE4]) - && P_MobjFlip(special)*((special->z + special->height/2) - (toucher->z + toucher->height/2)) > (toucher->height/2)) - { - P_DamageMobj(toucher, special, special, 1, 0); - P_SetTarget(&special->tracer, toucher); - - if (special->state == &states[S_FANG_PINCHBOUNCE3] - || special->state == &states[S_FANG_PINCHBOUNCE4]) - P_SetMobjState(special, S_FANG_PINCHPATHINGSTART2); - else - { - var1 = var2 = 4; - A_Boss5ExtraRepeat(special); - P_SetMobjState(special, S_FANG_PATHINGCONT2); //S_FANG_PATHINGCONT1 if you want him to drop a bomb on the player - } - if (special->eflags & MFE_VERTICALFLIP) - special->z = toucher->z - special->height; - else - special->z = toucher->z + toucher->height; - return; - } - } - break; - - case MT_PYREFLY: - if (special->extravalue2 == 2 && P_DamageMobj(player->mo, special, special, 1, DMG_FIRE)) - return; - - default: - break; - } - -<<<<<<< HEAD - if (special->type == MT_PTERABYTE && special->target == player->mo) - return; // Don't hurt the player you're trying to grab -======= - if (P_PlayerCanDamage(player, special)) // Do you possess the ability to subdue the object? - { - if (special->type == MT_PTERABYTE && special->target == player->mo && special->extravalue1 == 1) - return; // Can't hurt a Pterabyte if it's trying to pick you up - - if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1)) - { - if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)) - { - fixed_t setmomz = -toucher->momz; // Store this, momz get changed by P_DoJump within P_DoBubbleBounce - - if (elementalpierce == 2) // Reset bubblewrap, part 1 - P_DoBubbleBounce(player); - toucher->momz = setmomz; - if (elementalpierce == 2) // Reset bubblewrap, part 2 - { - boolean underwater = toucher->eflags & MFE_UNDERWATER; - - if (underwater) - toucher->momz /= 2; - toucher->momz -= (toucher->momz/(underwater ? 8 : 4)); // Cap the height! - } - } - } - if (player->pflags & PF_BOUNCING) - P_DoAbilityBounce(player, false); - if (special->info->spawnhealth > 1) // Multi-hit? Bounce back! - { - toucher->momx = -toucher->momx; - toucher->momy = -toucher->momy; - if (player->charability == CA_FLY && player->panim == PA_ABILITY) - toucher->momz = -toucher->momz/2; - else if (player->pflags & PF_GLIDING && !P_IsObjectOnGround(toucher)) - { - player->pflags &= ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE); - P_SetPlayerMobjState(toucher, S_PLAY_FALL); - toucher->momz += P_MobjFlip(toucher) * (player->speed >> 3); - toucher->momx = 7*toucher->momx>>3; - toucher->momy = 7*toucher->momy>>3; - } - else if (player->dashmode >= DASHMODE_THRESHOLD && (player->charflags & (SF_DASHMODE|SF_MACHINE)) == (SF_DASHMODE|SF_MACHINE) - && player->panim == PA_DASH) - P_DoPlayerPain(player, special, special); - } - P_DamageMobj(special, toucher, toucher, 1, 0); - if (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY) - P_TwinSpinRejuvenate(player, player->thokitem); - } - else - { - if (special->type == MT_PTERABYTE && special->target == player->mo) - return; // Don't hurt the player you're trying to grab - - P_DamageMobj(toucher, special, special, 1, 0); - } ->>>>>>> srb2/next - P_DamageMobj(toucher, special, special, 1, 0); return; } @@ -776,773 +638,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } return; -<<<<<<< HEAD -======= -// ********************************** // -// NiGHTS gameplay items and powerups // -// ********************************** // - case MT_NIGHTSDRONE: - { - boolean spec = G_IsSpecialStage(gamemap); - boolean cangiveemmy = false; - if (player->bot) - return; - if (player->exiting) - return; - if (player->bonustime) - { - if (spec) //After-mare bonus time/emerald reward in special stages. - { - // only allow the player with the emerald in-hand to leave. - if (toucher->tracer - && toucher->tracer->type == MT_GOTEMERALD) - {} - else // Make sure that SOMEONE has the emerald, at least! - { - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].playerstate == PST_LIVE - && players[i].mo->tracer - && players[i].mo->tracer->type == MT_GOTEMERALD) - return; - // Well no one has an emerald, so exit anyway! - } - cangiveemmy = true; - // Don't play Ideya sound in special stage mode - } - else - S_StartSound(toucher, special->info->activesound); - } - else //Initial transformation. Don't allow second chances in special stages! - { - if (player->powers[pw_carry] == CR_NIGHTSMODE) - return; - - S_StartSound(toucher, sfx_supert); - } - P_SwitchSpheresBonusMode(false); - if (!(netgame || multiplayer) && !(player->powers[pw_carry] == CR_NIGHTSMODE)) - P_SetTarget(&special->tracer, toucher); - P_SetTarget(&player->drone, special); // Mark the player as 'center into the drone' - P_NightserizePlayer(player, special->health); // Transform! - if (!spec) - { - if (toucher->tracer) // Move the Ideya to an anchor! - { - mobj_t *orbittarget = special->target ? special->target : special; - mobj_t *hnext = orbittarget->hnext, *anchorpoint = NULL, *anchorpoint2 = NULL; - mobj_t *mo2; - thinker_t *th; - - // The player might have two Ideyas: toucher->tracer and toucher->tracer->hnext - // so handle their anchorpoints accordingly. - // scan the thinkers to find the corresponding anchorpoint - for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) - continue; - - mo2 = (mobj_t *)th; - - if (mo2->type != MT_IDEYAANCHOR) - continue; - - if (mo2->health == toucher->tracer->health) // do ideya numberes match? - anchorpoint = mo2; - else if (toucher->tracer->hnext && mo2->health == toucher->tracer->hnext->health) - anchorpoint2 = mo2; - - if ((!toucher->tracer->hnext && anchorpoint) - || (toucher->tracer->hnext && anchorpoint && anchorpoint2)) - break; - } - - if (anchorpoint) - { - toucher->tracer->flags |= MF_GRENADEBOUNCE; // custom radius factors - toucher->tracer->threshold = 8 << 20; // X factor 0, Y factor 0, Z factor 8 - } - - if (anchorpoint2) - { - toucher->tracer->hnext->flags |= MF_GRENADEBOUNCE; // custom radius factors - toucher->tracer->hnext->threshold = 8 << 20; // X factor 0, Y factor 0, Z factor 8 - } - - P_SetTarget(&orbittarget->hnext, toucher->tracer); - if (!orbittarget->hnext->hnext) - P_SetTarget(&orbittarget->hnext->hnext, hnext); // Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. - else - P_SetTarget(&orbittarget->hnext->hnext->target, anchorpoint2 ? anchorpoint2 : orbittarget); - P_SetTarget(&orbittarget->hnext->target, anchorpoint ? anchorpoint : orbittarget); - P_SetTarget(&toucher->tracer, NULL); - - if (hnext) - { - orbittarget->hnext->extravalue1 = (angle_t)(hnext->extravalue1 - 72*ANG1); - if (orbittarget->hnext->extravalue1 > hnext->extravalue1) - orbittarget->hnext->extravalue1 -= (72*ANG1)/orbittarget->hnext->extravalue1; - } - } - if (player->exiting) // ...then move it back? - { - mobj_t *hnext = special->target ? special->target : special; // goalpost - while ((hnext = hnext->hnext)) - { - hnext->flags &= ~MF_GRENADEBOUNCE; - hnext->threshold = 0; - P_SetTarget(&hnext->target, toucher); - } - } - return; - } - - if (!cangiveemmy) - return; - - if (player->exiting) - P_GiveEmerald(false); - else if (player->mo->tracer && player->mare) - { - P_KillMobj(toucher->tracer, NULL, NULL, 0); // No emerald for you just yet! - S_StartSound(NULL, sfx_ghosty); - special->flags2 |= MF2_DONTDRAW; - } - - return; - } - case MT_NIGHTSLOOPHELPER: - // One second delay - if (special->fuse < toucher->fuse - TICRATE) - { - thinker_t *th; - mobj_t *mo2; - INT32 count; - fixed_t x,y,z, gatherradius; - angle_t d; - statenum_t sparklestate = S_NULL; - - if (special->target != toucher) // These ain't your helpers, pal! - return; - - x = special->x>>FRACBITS; - y = special->y>>FRACBITS; - z = special->z>>FRACBITS; - count = 1; - - // scan the remaining thinkers - for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) - continue; - - mo2 = (mobj_t *)th; - - if (mo2 == special) - continue; - - // Not our stuff! - if (mo2->target != toucher) - continue; - - if (mo2->type == MT_NIGHTSPARKLE) - mo2->tics = 1; - else if (mo2->type == MT_NIGHTSLOOPHELPER) - { - if (mo2->fuse >= special->fuse) - { - count++; - x += mo2->x>>FRACBITS; - y += mo2->y>>FRACBITS; - z += mo2->z>>FRACBITS; - } - P_RemoveMobj(mo2); - } - } - x = (x/count)<x - x, special->y - y), special->z - z); - P_RemoveMobj(special); - - if (player->powers[pw_nights_superloop]) - { - gatherradius *= 2; - sparklestate = mobjinfo[MT_NIGHTSPARKLE].seestate; - } - - if (gatherradius < 30*FRACUNIT) // Player is probably just sitting there. - return; - - for (d = 0; d < 16; d++) - P_SpawnParaloop(x, y, z, gatherradius, 16, MT_NIGHTSPARKLE, sparklestate, d*ANGLE_22h, false); - - S_StartSound(toucher, sfx_prloop); - - // Now we RE-scan all the thinkers to find close objects to pull - // in from the paraloop. Isn't this just so efficient? - for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) - continue; - - mo2 = (mobj_t *)th; - - if (P_AproxDistance(P_AproxDistance(mo2->x - x, mo2->y - y), mo2->z - z) > gatherradius) - continue; - - if (mo2->flags & MF_SHOOTABLE) - { - P_DamageMobj(mo2, toucher, toucher, 1, 0); - continue; - } - - // Make these APPEAR! - // Tails 12-15-2003 - if (mo2->flags & MF_NIGHTSITEM) - { - // Requires Bonus Time - if ((mo2->flags2 & MF2_STRONGBOX) && !player->bonustime) - continue; - - if (!(mo2->flags & MF_SPECIAL) && mo2->health) - { - mo2->flags2 &= ~MF2_DONTDRAW; - mo2->flags |= MF_SPECIAL; - mo2->flags &= ~MF_NIGHTSITEM; - S_StartSound(toucher, sfx_hidden); - continue; - } - } - - if (!(mo2->type == MT_RING || mo2->type == MT_COIN - || mo2->type == MT_BLUESPHERE || mo2->type == MT_BOMBSPHERE - || mo2->type == MT_NIGHTSCHIP || mo2->type == MT_NIGHTSSTAR - || ((mo2->type == MT_EMBLEM) && (mo2->reactiontime & GE_NIGHTSPULL)))) - continue; - - // Yay! The thing's in reach! Pull it in! - mo2->flags |= MF_NOCLIP|MF_NOCLIPHEIGHT; - mo2->flags2 |= MF2_NIGHTSPULL; - // New NiGHTS attract speed dummied out because the older behavior - // is exploited as a mechanic. Uncomment to enable. - mo2->movefactor = 0; // 32*FRACUNIT; // initialize the NightsItemChase timer - P_SetTarget(&mo2->tracer, toucher); - } - } - return; - case MT_EGGCAPSULE: - if (player->bot) - return; - - // make sure everything is as it should be, THEN take rings from players in special stages - if (player->powers[pw_carry] == CR_NIGHTSMODE && !toucher->target) - return; - - if (toucher->tracer && toucher->tracer->health > 0) - return; // Don't have multiple ideya, unless it's the first one given (health = 0) - - if (player->mare != special->threshold) // wrong mare - return; - - if (special->reactiontime > 0) // capsule already has a player attacking it, ignore - return; - - if (G_IsSpecialStage(gamemap) && !player->exiting) - { // In special stages, share spheres. Everyone gives up theirs to the player who touched the capsule - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && (&players[i] != player) && players[i].spheres > 0) - { - player->spheres += players[i].spheres; - players[i].spheres = 0; - } - } - - if (player->spheres <= 0 || player->exiting) - return; - - // Mark the player as 'pull into the capsule' - P_SetTarget(&player->capsule, special); - special->reactiontime = (player-players)+1; - P_SetTarget(&special->target, NULL); - - // Clear text - player->texttimer = 0; - return; - case MT_NIGHTSBUMPER: - // Don't trigger if the stage is ended/failed - if (player->exiting) - return; - - if (player->bumpertime <= (TICRATE/2)-5) - { - S_StartSound(toucher, special->info->seesound); - if (player->powers[pw_carry] == CR_NIGHTSMODE) - { - player->bumpertime = TICRATE/2; - if (special->threshold > 0) - player->flyangle = (special->threshold*30)-1; - else - player->flyangle = special->threshold; - - player->speed = FixedMul(special->info->speed, special->scale); - P_SetTarget(&player->mo->hnext, special); // Reference bumper for position correction on next tic - } - else // More like a spring - { - angle_t fa; - fixed_t xspeed, yspeed; - const fixed_t speed = FixedMul(FixedDiv(special->info->speed*FRACUNIT,75*FRACUNIT), FixedSqrt(FixedMul(toucher->scale,special->scale))); - - player->bumpertime = TICRATE/2; - - P_UnsetThingPosition(toucher); - toucher->x = special->x; - toucher->y = special->y; - P_SetThingPosition(toucher); - toucher->z = special->z+(special->height/4); - - if (special->threshold > 0) - fa = (FixedAngle(((special->threshold*30)-1)*FRACUNIT)>>ANGLETOFINESHIFT) & FINEMASK; - else - fa = 0; - - xspeed = FixedMul(FINECOSINE(fa),speed); - yspeed = FixedMul(FINESINE(fa),speed); - - P_InstaThrust(toucher, special->angle, xspeed/10); - toucher->momz = yspeed/11; - - toucher->angle = special->angle; - - P_SetPlayerAngle(player, toucher->angle); - - P_ResetPlayer(player); - - P_SetPlayerMobjState(toucher, S_PLAY_FALL); - } - } - return; - case MT_NIGHTSSUPERLOOP: - if (player->bot || !(player->powers[pw_carry] == CR_NIGHTSMODE)) - return; - if (!G_IsSpecialStage(gamemap)) - player->powers[pw_nights_superloop] = (UINT16)special->info->speed; - else - { - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].powers[pw_carry] == CR_NIGHTSMODE) - players[i].powers[pw_nights_superloop] = (UINT16)special->info->speed; - if (special->info->deathsound != sfx_None) - S_StartSound(NULL, special->info->deathsound); - } - - // CECHO showing you what this item is - if (player == &players[displayplayer] || G_IsSpecialStage(gamemap)) - { - HU_SetCEchoFlags(V_AUTOFADEOUT); - HU_SetCEchoDuration(4); - HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Super Paraloop")); - } - break; - case MT_NIGHTSDRILLREFILL: - if (player->bot || !(player->powers[pw_carry] == CR_NIGHTSMODE)) - return; - if (!G_IsSpecialStage(gamemap)) - player->drillmeter = special->info->speed; - else - { - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].powers[pw_carry] == CR_NIGHTSMODE) - players[i].drillmeter = special->info->speed; - if (special->info->deathsound != sfx_None) - S_StartSound(NULL, special->info->deathsound); - } - - // CECHO showing you what this item is - if (player == &players[displayplayer] || G_IsSpecialStage(gamemap)) - { - HU_SetCEchoFlags(V_AUTOFADEOUT); - HU_SetCEchoDuration(4); - HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Drill Refill")); - } - break; - case MT_NIGHTSHELPER: - if (player->bot || !(player->powers[pw_carry] == CR_NIGHTSMODE)) - return; - if (!G_IsSpecialStage(gamemap)) - { - // A flicky orbits us now - mobj_t *flickyobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + toucher->info->height, MT_NIGHTOPIANHELPER); - P_SetTarget(&flickyobj->target, toucher); - - player->powers[pw_nights_helper] = (UINT16)special->info->speed; - } - else - { - mobj_t *flickyobj; - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].mo && players[i].powers[pw_carry] == CR_NIGHTSMODE) { - players[i].powers[pw_nights_helper] = (UINT16)special->info->speed; - flickyobj = P_SpawnMobj(players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->info->height, MT_NIGHTOPIANHELPER); - P_SetTarget(&flickyobj->target, players[i].mo); - } - if (special->info->deathsound != sfx_None) - S_StartSound(NULL, special->info->deathsound); - } - - // CECHO showing you what this item is - if (player == &players[displayplayer] || G_IsSpecialStage(gamemap)) - { - HU_SetCEchoFlags(V_AUTOFADEOUT); - HU_SetCEchoDuration(4); - HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Nightopian Helper")); - } - break; - case MT_NIGHTSEXTRATIME: - if (player->bot || !(player->powers[pw_carry] == CR_NIGHTSMODE)) - return; - if (!G_IsSpecialStage(gamemap)) - { - player->nightstime += special->info->speed; - player->startedtime += special->info->speed; - player->lapstartedtime += special->info->speed; - P_RestoreMusic(player); - } - else - { - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].powers[pw_carry] == CR_NIGHTSMODE) - { - players[i].nightstime += special->info->speed; - players[i].startedtime += special->info->speed; - players[i].lapstartedtime += special->info->speed; - P_RestoreMusic(&players[i]); - } - if (special->info->deathsound != sfx_None) - S_StartSound(NULL, special->info->deathsound); - } - - // CECHO showing you what this item is - if (player == &players[displayplayer] || G_IsSpecialStage(gamemap)) - { - HU_SetCEchoFlags(V_AUTOFADEOUT); - HU_SetCEchoDuration(4); - HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Extra Time")); - } - break; - case MT_NIGHTSLINKFREEZE: - if (player->bot || !(player->powers[pw_carry] == CR_NIGHTSMODE)) - return; - if (!G_IsSpecialStage(gamemap)) - { - player->powers[pw_nights_linkfreeze] = (UINT16)special->info->speed; - player->linktimer = nightslinktics; - } - else - { - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].powers[pw_carry] == CR_NIGHTSMODE) - { - players[i].powers[pw_nights_linkfreeze] += (UINT16)special->info->speed; - players[i].linktimer = nightslinktics; - } - if (special->info->deathsound != sfx_None) - S_StartSound(NULL, special->info->deathsound); - } - - // CECHO showing you what this item is - if (player == &players[displayplayer] || G_IsSpecialStage(gamemap)) - { - HU_SetCEchoFlags(V_AUTOFADEOUT); - HU_SetCEchoDuration(4); - HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze")); - } - break; - case MT_HOOPCOLLIDE: - // This produces a kind of 'domino effect' with the hoop's pieces. - for (; special->hprev != NULL; special = special->hprev); // Move to the first sprite in the hoop - i = 0; - for (; special->type == MT_HOOP; special = special->hnext) - { - special->fuse = 11; - special->movedir = i; - special->extravalue1 = special->target->extravalue1; - special->extravalue2 = special->target->extravalue2; - special->target->threshold = 4242; - i++; - } - // Make the collision detectors disappear. - { - mobj_t *hnext; - for (; special != NULL; special = hnext) - { - hnext = special->hnext; - P_RemoveMobj(special); - } - } - - P_DoNightsScore(player); - - // Hoops are the only things that should add to the drill meter - // Also, one tic's worth of drill is too much. - if (G_IsSpecialStage(gamemap)) - { - for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].powers[pw_carry] == CR_NIGHTSMODE) - players[i].drillmeter += TICRATE/2; - } - else if (player->bot) - players[consoleplayer].drillmeter += TICRATE/2; - else - player->drillmeter += TICRATE/2; - - // Play hoop sound -- pick one depending on the current link. - if (player->linkcount <= 5) - S_StartSound(toucher, sfx_hoop1); - else if (player->linkcount <= 10) - S_StartSound(toucher, sfx_hoop2); - else - S_StartSound(toucher, sfx_hoop3); - return; - -// ***** // -// Mario // -// ***** // - case MT_SHELL: - { - boolean bounceon = ((P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)); - if (special->threshold == TICRATE) // it's moving - { - if (bounceon) - { - // Stop it! - special->momx = special->momy = 0; - S_StartSound(toucher, sfx_mario2); - P_SetTarget(&special->target, NULL); - special->threshold = TICRATE - 1; - toucher->momz = -toucher->momz; - } - else // can't handle in PIT_CheckThing because of landing-on causing it to stop - P_DamageMobj(toucher, special, special->target, 1, 0); - } - else if (special->threshold == 0) - { - // Kick that sucker around! - special->movedir = ((special->movedir == 1) ? -1 : 1); - P_InstaThrust(special, toucher->angle, (special->info->speed*special->scale)); - S_StartSound(toucher, sfx_mario2); - P_SetTarget(&special->target, toucher); - special->threshold = (3*TICRATE)/2; - if (bounceon) - toucher->momz = -toucher->momz; - } - } - return; - case MT_AXE: - { - line_t junk; - thinker_t *th; - mobj_t *mo2; - - if (player->bot) - return; - - junk.tag = LE_AXE; - EV_DoElevator(&junk, bridgeFall, false); - - // scan the remaining thinkers to find koopa - for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) - { - if (th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed) - continue; - - mo2 = (mobj_t *)th; - - if (mo2->type != MT_KOOPA) - continue; - - mo2->momz = 5*FRACUNIT; - break; - } - } - break; - case MT_LETTER: - { - if (special->health && !player->bot) - { - F_StartTextPrompt(199, 0, toucher, 0, true, false); - special->health = 0; - if (ultimatemode && player->continues < 99) - player->continues++; - } - return; - } - case MT_FIREFLOWER: - if (player->bot) - return; - - S_StartSound(toucher, sfx_mario3); - - player->powers[pw_shield] = (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; - - if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - - break; - -// *************** // -// Misc touchables // -// *************** // ->>>>>>> srb2/next case MT_STARPOST: P_TouchStarPost(special, player, special->spawnpoint && (special->spawnpoint->options & MTF_OBJECTSPECIAL)); return; -<<<<<<< HEAD -======= - case MT_FAKEMOBILE: - { - fixed_t touchx, touchy, touchspeed; - angle_t angle; - - if (P_AproxDistance(toucher->x-special->x, toucher->y-special->y) > - P_AproxDistance((toucher->x-toucher->momx)-special->x, (toucher->y-toucher->momy)-special->y)) - { - touchx = toucher->x + toucher->momx; - touchy = toucher->y + toucher->momy; - } - else - { - touchx = toucher->x; - touchy = toucher->y; - } - - angle = R_PointToAngle2(special->x, special->y, touchx, touchy); - touchspeed = P_AproxDistance(toucher->momx, toucher->momy); - - toucher->momx = P_ReturnThrustX(special, angle, touchspeed); - toucher->momy = P_ReturnThrustY(special, angle, touchspeed); - toucher->momz = -toucher->momz; - if (player->pflags & PF_GLIDING && !P_IsObjectOnGround(toucher)) - { - player->pflags &= ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE); - P_SetPlayerMobjState(toucher, S_PLAY_FALL); - toucher->momz += P_MobjFlip(toucher) * (player->speed >> 3); - toucher->momx = 7*toucher->momx>>3; - toucher->momy = 7*toucher->momy>>3; - } - player->homing = 0; - - // Play a bounce sound? - S_StartSound(toucher, special->info->painsound); - } - return; - - case MT_BLACKEGGMAN_GOOPFIRE: - if (!player->powers[pw_flashing] && !(player->powers[pw_ignorelatch] & (1<<15))) - { - toucher->momx = 0; - toucher->momy = 0; - - if (toucher->momz != 0) - special->momz = toucher->momz; - - player->powers[pw_carry] = CR_BRAKGOOP; - P_SetTarget(&toucher->tracer, special); - - P_ResetPlayer(player); - - if (special->target && special->target->state == &states[S_BLACKEGG_SHOOT1]) - { - if (special->target->health <= 2 && P_RandomChance(FRACUNIT/2)) - P_SetMobjState(special->target, special->target->info->missilestate); - else - P_SetMobjState(special->target, special->target->info->raisestate); - } - } - return; - case MT_EGGSHIELD: - { - angle_t angle = R_PointToAngle2(special->x, special->y, toucher->x, toucher->y) - special->angle; - fixed_t touchspeed = P_AproxDistance(toucher->momx, toucher->momy); - if (touchspeed < special->scale) - touchspeed = special->scale; - - // Blocked by the shield? - if (!(angle > ANGLE_90 && angle < ANGLE_270)) - { - toucher->momx = P_ReturnThrustX(special, special->angle, touchspeed); - toucher->momy = P_ReturnThrustY(special, special->angle, touchspeed); - toucher->momz = -toucher->momz; - if (player->pflags & PF_GLIDING && !P_IsObjectOnGround(toucher)) - { - player->pflags &= ~(PF_GLIDING|PF_JUMPED|PF_NOJUMPDAMAGE); - P_SetPlayerMobjState(toucher, S_PLAY_FALL); - toucher->momz += P_MobjFlip(toucher) * (player->speed >> 3); - toucher->momx = 7*toucher->momx>>3; - toucher->momy = 7*toucher->momy>>3; - } - player->homing = 0; - - // Play a bounce sound? - S_StartSound(toucher, special->info->painsound); - - // experimental bounce - if (special->target) - special->target->extravalue1 = -special->target->info->speed; - } - else - { - // Shatter the shield! - toucher->momx = -toucher->momx/2; - toucher->momy = -toucher->momy/2; - toucher->momz = -toucher->momz; - break; - } - } - return; - - case MT_EGGROBO1: - if (special->state == &states[special->info->deathstate]) - return; - if (P_PlayerInPain(player)) - return; - - P_SetMobjState(special, special->info->meleestate); - special->angle = special->movedir; - special->momx = special->momy = 0; - - // Buenos Dias Mandy - P_SetPlayerMobjState(toucher, S_PLAY_STUN); - player->pflags &= ~PF_APPLYAUTOBRAKE; - P_ResetPlayer(player); - player->drawangle = special->angle + ANGLE_180; - P_InstaThrust(toucher, special->angle, FixedMul(3*special->info->speed, special->scale/2)); - toucher->z += P_MobjFlip(toucher); - if (toucher->eflags & MFE_UNDERWATER) // unlikely. - P_SetObjectMomZ(toucher, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); - else - P_SetObjectMomZ(toucher, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); - if (P_IsLocalPlayer(player)) - { - quake.intensity = 9*FRACUNIT; - quake.time = TICRATE/2; - quake.epicenter = NULL; - } - -#if 0 // camera redirection - deemed unnecessary - toucher->angle = special->angle; - P_SetPlayerAngle(player, toucher->angle); -#endif - - S_StartSound(toucher, special->info->attacksound); // home run - - return; - ->>>>>>> srb2/next case MT_BIGTUMBLEWEED: case MT_LITTLETUMBLEWEED: if (toucher->momx || toucher->momy) @@ -1550,119 +649,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->momx = toucher->momx; special->momy = toucher->momy; special->momz = P_AproxDistance(toucher->momx, toucher->momy)/4; -<<<<<<< HEAD -======= - - if (toucher->momz > 0) - special->momz += toucher->momz/8; - - P_SetMobjState(special, special->info->seestate); - } - return; - case MT_SMALLGRABCHAIN: - case MT_BIGGRABCHAIN: - { - boolean macespin = false; - if (P_MobjFlip(toucher)*toucher->momz > 0 - || (player->powers[pw_carry])) - return; - - if (toucher->z > special->z + special->height/2) - return; - - if (toucher->z + toucher->height/2 < special->z) - return; - - if (player->powers[pw_flashing]) - return; - - if (special->tracer && !(special->tracer->flags2 & MF2_STRONGBOX)) - macespin = true; - - if (macespin ? (player->powers[pw_ignorelatch] & (1<<15)) : (player->powers[pw_ignorelatch])) - return; - - if (special->movefactor && special->tracer && special->tracer->angle != ANGLE_90 && special->tracer->angle != ANGLE_270) - { // I don't expect you to understand this, Mr Bond... - angle_t ang = R_PointToAngle2(special->x, special->y, toucher->x, toucher->y) - special->tracer->angle; - if ((special->movefactor > 0) == (special->tracer->angle > ANGLE_90 && special->tracer->angle < ANGLE_270)) - ang += ANGLE_180; - if (ang < ANGLE_180) - return; // I expect you to die. - } - - P_ResetPlayer(player); - P_SetTarget(&toucher->tracer, special); - - if (macespin) - { - player->powers[pw_carry] = CR_MACESPIN; - S_StartSound(toucher, sfx_spin); - P_SetPlayerMobjState(toucher, S_PLAY_ROLL); - } - else - player->powers[pw_carry] = CR_GENERIC; - - // Can't jump first frame - player->pflags |= PF_JUMPSTASIS; - - return; - } - case MT_EGGMOBILE2_POGO: - // sanity checks - if (!special->target || !special->target->health) - return; - // Goomba Stomp'd! - if (special->target->momz < 0) - { - P_DamageMobj(toucher, special, special->target, 1, 0); - //special->target->momz = -special->target->momz; - special->target->momx = special->target->momy = 0; - special->target->momz = 0; - special->target->flags |= MF_NOGRAVITY; - P_SetMobjState(special->target, special->info->raisestate); - S_StartSound(special->target, special->info->activesound); - P_RemoveMobj(special); - } - return; - - case MT_EXTRALARGEBUBBLE: - if (player->powers[pw_shield] & SH_PROTECTWATER) - return; - if (maptol & TOL_NIGHTS) - return; - if (mariomode) - return; - if (special->state-states != S_EXTRALARGEBUBBLE) - return; // Don't grab the bubble during its spawn animation - else if (toucher->eflags & MFE_VERTICALFLIP) - { - if (special->z+special->height < toucher->z - || special->z+special->height > toucher->z + (toucher->height*2/3)) - return; // Only go in the mouth - } - else if (special->z < toucher->z - || special->z > toucher->z + (toucher->height*2/3)) - return; // Only go in the mouth - - // Eaten by player! - if ((!player->bot) && (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1)) - { - player->powers[pw_underwater] = underwatertics + 1; - P_RestoreMusic(player); - } - - if (player->powers[pw_underwater] < underwatertics + 1) - player->powers[pw_underwater] = underwatertics + 1; - - if (!player->climbing) - { - if (player->bot && toucher->state-states != S_PLAY_GASP) - S_StartSound(toucher, special->info->deathsound); // Force it to play a sound for bots - P_SetPlayerMobjState(toucher, S_PLAY_GASP); - P_ResetPlayer(player); - } ->>>>>>> srb2/next if (toucher->momz > 0) special->momz += toucher->momz/8; @@ -1682,77 +668,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } return; -<<<<<<< HEAD -======= - case MT_CANARIVORE_GAS: - // if player and gas touch, attach gas to player (overriding any gas that already attached) and apply slowdown effect - special->flags |= MF_NOGRAVITY|MF_NOCLIPHEIGHT; - P_UnsetThingPosition(special); - special->x = toucher->x - toucher->momx/2; - special->y = toucher->y - toucher->momy/2; - special->z = toucher->z - toucher->momz/2; - P_SetThingPosition(special); - toucher->momx = FixedMul(toucher->momx, 50*FRACUNIT/51); - toucher->momy = FixedMul(toucher->momy, 50*FRACUNIT/51); - special->momx = toucher->momx; - special->momy = toucher->momy; - special->momz = toucher->momz; - return; - - case MT_MINECARTSPAWNER: - if (!player->bot && special->fuse <= TICRATE && player->powers[pw_carry] != CR_MINECART && !(player->powers[pw_ignorelatch] & (1<<15))) - { - mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART); - P_SetTarget(&mcart->target, toucher); - mcart->angle = toucher->angle = player->drawangle = special->angle; - mcart->friction = FRACUNIT; - - P_ResetPlayer(player); - player->pflags |= PF_JUMPDOWN; - player->powers[pw_carry] = CR_MINECART; - player->pflags &= ~PF_APPLYAUTOBRAKE; - P_SetTarget(&toucher->tracer, mcart); - toucher->momx = toucher->momy = toucher->momz = 0; - - special->fuse = 3*TICRATE; - special->flags2 |= MF2_DONTDRAW; - } - return; - - case MT_MINECARTEND: - if (player->powers[pw_carry] == CR_MINECART && toucher->tracer && !P_MobjWasRemoved(toucher->tracer) && toucher->tracer->health) - { - fixed_t maxz = max(toucher->z, special->z + 35*special->scale); - - toucher->momx = toucher->tracer->momx/2; - toucher->momy = toucher->tracer->momy/2; - toucher->momz = toucher->tracer->momz + P_AproxDistance(toucher->tracer->momx, toucher->tracer->momy)/2; - P_ResetPlayer(player); - player->pflags &= ~PF_APPLYAUTOBRAKE; - P_SetPlayerMobjState(toucher, S_PLAY_FALL); - P_SetTarget(&toucher->tracer->target, NULL); - P_KillMobj(toucher->tracer, toucher, special, 0); - P_SetTarget(&toucher->tracer, NULL); - player->powers[pw_carry] = CR_NONE; - P_UnsetThingPosition(toucher); - toucher->x = special->x; - toucher->y = special->y; - toucher->z = maxz; - P_SetThingPosition(toucher); - } - return; - - case MT_MINECARTSWITCHPOINT: - if (player->powers[pw_carry] == CR_MINECART && toucher->tracer && !P_MobjWasRemoved(toucher->tracer) && toucher->tracer->health) - { - mobjflag2_t destambush = special->flags2 & MF2_AMBUSH; - angle_t angdiff = toucher->tracer->angle - special->angle; - if (angdiff > ANGLE_90 && angdiff < ANGLE_270) - destambush ^= MF2_AMBUSH; - toucher->tracer->flags2 = (toucher->tracer->flags2 & ~MF2_AMBUSH) | destambush; - } - return; ->>>>>>> srb2/next default: // SOC or script pickup P_SetTarget(&special->target, toucher); break; @@ -2203,18 +1118,9 @@ boolean P_CheckRacers(void) if (i == MAXPLAYERS) // finished { -<<<<<<< HEAD racecountdown = exitcountdown = 0; return true; } -======= - // Exception for hide and seek. If a round has started and the IT player leaves, end the round. - if ((gametyperules & GTR_HIDEFROZEN) && (leveltime >= (hidetime * TICRATE))) - { - CONS_Printf(M_GetText("The IT player has left the game.\n")); - if (server) - SendNetXCmd(XD_EXITLEVEL, NULL, 0); ->>>>>>> srb2/next for (j = 0; j < MAXPLAYERS; j++) { @@ -2392,36 +1298,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->standingslope = NULL; target->pmomz = 0; -<<<<<<< HEAD if (!target->player->bot && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives()) -======= - if (target->player->powers[pw_super]) - { - target->player->powers[pw_super] = 0; - if (P_IsLocalPlayer(target->player)) - { - music_stack_noposition = true; // HACK: Do not reposition next music - music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music - } - P_RestoreMusic(target->player); - - if (!G_CoopGametype()) - { - HU_SetCEchoFlags(0); - HU_SetCEchoDuration(5); - HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[target->player-players])); - } - } - - target->color = target->player->skincolor; - target->colorized = false; - G_GhostAddColor(GHC_NORMAL); - - if ((target->player->lives <= 1) && (netgame || multiplayer) && G_GametypeUsesCoopLives() && (cv_cooplives.value == 0)) - ; - else if (!target->player->bot && !target->player->spectator && (target->player->lives != INFLIVES) - && G_GametypeUsesLives()) ->>>>>>> srb2/next { if (!(target->player->pflags & PF_FINISHED)) target->player->lives -= 1; // Lose a life Tails 03-11-2000 @@ -2472,33 +1349,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget localaiming[0] = 0; } -<<<<<<< HEAD if (target->player == &players[displayplayers[1]]) localaiming[1] = 0; if (target->player == &players[displayplayers[2]]) localaiming[2] = 0; if (target->player == &players[displayplayers[3]]) localaiming[3] = 0; -======= - //tag deaths handled differently in suicide cases. Don't count spectators! - if (G_TagGametype() - && !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator)) - { - // if you accidentally die before you run out of time to hide, ignore it. - // allow them to try again, rather than sitting the whole thing out. - if (leveltime >= hidetime * TICRATE) - { - if (!(gametyperules & GTR_HIDEFROZEN))//suiciding in survivor makes you IT. - { - target->player->pflags |= PF_TAGIT; - CONS_Printf(M_GetText("%s is now IT!\n"), player_names[target->player-players]); // Tell everyone who is it! - P_CheckSurvivors(); - } - else - { - if (!(target->player->pflags & PF_GAMETYPEOVER)) - { - //otherwise, increment the tagger's score. - //in hide and seek, suiciding players are counted as found. - INT32 w; ->>>>>>> srb2/next if (G_BattleGametype()) K_CheckBumpers(); @@ -2929,177 +1782,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget Graue 12-22-2003 */ } -<<<<<<< HEAD -======= -static void P_NiGHTSDamage(mobj_t *target, mobj_t *source) -{ - player_t *player = target->player; - tic_t oldnightstime = player->nightstime; - - (void)source; // unused - - if (!player->powers[pw_flashing]) - { - angle_t fa; - - player->angle_pos = player->old_angle_pos; - player->speed /= 5; - player->flyangle += 180; // Shuffle's BETTERNIGHTSMOVEMENT? - player->flyangle %= 360; - - if (gametyperules & GTR_RACE) - player->drillmeter -= 5*20; - else - { - if (player->nightstime > 5*TICRATE) - player->nightstime -= 5*TICRATE; - else - player->nightstime = 1; - } - - if (player->pflags & PF_TRANSFERTOCLOSEST) - { - target->momx = -target->momx; - target->momy = -target->momy; - } - else - { - fa = player->old_angle_pos>>ANGLETOFINESHIFT; - - target->momx = FixedMul(FINECOSINE(fa),target->target->radius); - target->momy = FixedMul(FINESINE(fa),target->target->radius); - } - - player->powers[pw_flashing] = flashingtics; - P_SetPlayerMobjState(target, S_PLAY_NIGHTS_STUN); - S_StartSound(target, sfx_nghurt); - - player->mo->rollangle = 0; - - if (oldnightstime > 10*TICRATE - && player->nightstime < 10*TICRATE) - { - if ((mapheaderinfo[gamemap-1]->levelflags & LF_MIXNIGHTSCOUNTDOWN) -#ifdef _WIN32 - // win32 MIDI volume hack means we cannot fade down the music - && S_MusicType() != MU_MID -#endif - ) - { - S_FadeMusic(0, 10*MUSICRATE); - S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. - } - else - P_PlayJingle(player, ((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap)) ? JT_NIGHTSTIMEOUT : JT_SSTIMEOUT); - } - } -} - -static boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) -{ - player_t *player = target->player; - (void)damage; //unused parm - - // If flashing or invulnerable, ignore the tag, - if (player->powers[pw_flashing] || player->powers[pw_invulnerability]) - return false; - - // Don't allow any damage before the round starts. - if (leveltime <= hidetime * TICRATE) - return false; - - // Ignore IT players shooting each other, unless friendlyfire is on. - if ((player->pflags & PF_TAGIT && !((cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE) || (damagetype & DMG_CANHURTSELF)) && - source && source->player && source->player->pflags & PF_TAGIT))) - { - if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) - { - if (player->revitem != MT_LHRT && player->spinitem != MT_LHRT && player->thokitem != MT_LHRT) // Healers do not get to heal other healers. - { - P_SwitchShield(player, SH_PINK); - S_StartSound(target, mobjinfo[MT_PITY_ICON].seesound); - } - } - return false; - } - - // Don't allow players on the same team to hurt one another, - // unless cv_friendlyfire is on. - if (!(cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE) || (damagetype & DMG_CANHURTSELF)) && (player->pflags & PF_TAGIT) == (source->player->pflags & PF_TAGIT)) - { - if (inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) - { - if (player->revitem != MT_LHRT && player->spinitem != MT_LHRT && player->thokitem != MT_LHRT) // Healers do not get to heal other healers. - { - P_SwitchShield(player, SH_PINK); - S_StartSound(target, mobjinfo[MT_PITY_ICON].seesound); - } - } - else if (!(inflictor->flags & MF_FIRE)) - P_GivePlayerRings(player, 1); - if (inflictor->flags2 & MF2_BOUNCERING) - inflictor->fuse = 0; // bounce ring disappears at -1 not 0 - return false; - } - - if (inflictor->type == MT_LHRT) - return false; - - // The tag occurs so long as you aren't shooting another tagger with friendlyfire on. - if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) - { - P_AddPlayerScore(source->player, 100); //award points to tagger. - P_HitDeathMessages(player, inflictor, source, 0); - - if (!(gametyperules & GTR_HIDEFROZEN)) //survivor - { - player->pflags |= PF_TAGIT; //in survivor, the player becomes IT and helps hunt down the survivors. - CONS_Printf(M_GetText("%s is now IT!\n"), player_names[player-players]); // Tell everyone who is it! - } - else - { - player->pflags |= PF_GAMETYPEOVER; //in hide and seek, the player is tagged and stays stationary. - CONS_Printf(M_GetText("%s was found!\n"), player_names[player-players]); // Tell everyone who is it! - } - - //checks if tagger has tagged all players, if so, end round early. - P_CheckSurvivors(); - } - - P_DoPlayerPain(player, source, inflictor); - - // Check for a shield - if (player->powers[pw_shield]) - { - P_RemoveShield(player); - S_StartSound(target, sfx_shldls); - return true; - } - - if (player->powers[pw_carry] == CR_NIGHTSFALL) - { - if (player->spheres > 0) - { - P_PlayRinglossSound(target); - P_PlayerRingBurst(player, player->spheres); - player->spheres = 0; - } - } - else if (player->rings > 0) // Ring loss - { - P_PlayRinglossSound(target); - P_PlayerRingBurst(player, player->rings); - player->rings = 0; - } - else // Death - { - P_PlayDeathSound(target); - P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!! - } - return true; -} - ->>>>>>> srb2/next static boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { player_t *player = target->player; @@ -3110,20 +1792,6 @@ static boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj_t *sou // You can't kill yourself, idiot... if (source == target) return false; - - // In COOP/RACE, you can't hurt other players unless cv_friendlyfire is on - if (!(cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE)) && (gametyperules & GTR_FRIENDLY)) - { - if ((gametyperules & GTR_FRIENDLY) && inflictor->type == MT_LHRT && !(player->powers[pw_shield] & SH_NOSTACK)) // co-op only - { - if (player->revitem != MT_LHRT && player->spinitem != MT_LHRT && player->thokitem != MT_LHRT) // Healers do not get to heal other healers. - { - P_SwitchShield(player, SH_PINK); - S_StartSound(target, mobjinfo[MT_PITY_ICON].seesound); - } - } - return false; - } } return true; @@ -3149,12 +1817,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) P_SetPlayerMobjState(player->mo, player->mo->info->deathstate); -<<<<<<< HEAD - if (player->pflags & PF_TIMEOVER) -======= - // If the player was super, tell them he/she ain't so super nomore. - if (!G_CoopGametype() && player->powers[pw_super]) ->>>>>>> srb2/next + if (player->pflags & PF_GAMETYPEOVER) { mobj_t *boom; player->mo->flags |= (MF_NOGRAVITY|MF_NOCLIP); @@ -3305,57 +1968,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if ((maptol & TOL_NIGHTS) && target->player->powers[pw_carry] != CR_NIGHTSMODE && target->player->powers[pw_carry] != CR_NIGHTSFALL) return false; -<<<<<<< HEAD -======= - - switch (damagetype) - { -#define DAMAGECASE(type)\ - case DMG_##type:\ - if (player->powers[pw_shield] & SH_PROTECT##type)\ - return false;\ - break - DAMAGECASE(WATER); - DAMAGECASE(FIRE); - DAMAGECASE(ELECTRIC); - DAMAGECASE(SPIKE); -#undef DAMAGECASE - default: - break; - } - } - - if (player->powers[pw_carry] == CR_NIGHTSMODE) // NiGHTS damage handling - { - if (!force) - { - if (source == target) - return false; // Don't hit yourself with your own paraloop, baka - if (source && source->player && !(cv_friendlyfire.value || (gametyperules & GTR_FRIENDLYFIRE)) - && ((gametyperules & GTR_FRIENDLY) - || (G_GametypeHasTeams() && player->ctfteam == source->player->ctfteam))) - return false; // Don't run eachother over in special stages and team games and such - } - if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) - return true; - P_NiGHTSDamage(target, source); // -5s :( - return true; - } - - if (G_IsSpecialStage(gamemap) && !(damagetype & DMG_DEATHMASK)) - { - P_SpecialStageDamage(player, inflictor, source); - return true; - } - - if (!force && inflictor && inflictor->flags & MF_FIRE) - { - if (player->powers[pw_shield] & SH_PROTECTFIRE) - return false; // Invincible to fire objects - - if (G_PlatformGametype() && inflictor && source && source->player) - return false; // Don't get hurt by fire generated from friends. ->>>>>>> srb2/next } // Player hits another player