From 5f2e419db339fd803574d98b0e35a96b216d9ff2 Mon Sep 17 00:00:00 2001 From: SeventhSentinel Date: Sun, 12 Aug 2018 11:04:36 -0400 Subject: [PATCH] fakes use MF_SPECIAL, no longer destroyable --- src/info.c | 8 +-- src/p_inter.c | 40 ++++++++++- src/p_map.c | 192 +------------------------------------------------- 3 files changed, 44 insertions(+), 196 deletions(-) diff --git a/src/info.c b/src/info.c index 0fa1e1ddb..2e8b74e64 100644 --- a/src/info.c +++ b/src/info.c @@ -14566,7 +14566,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_DEADFAKEITEM, // deathstate S_NULL, // xdeathstate - sfx_None, // deathsound + sfx_kc2e, // deathsound 8, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height @@ -14574,7 +14574,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags + MF_SPECIAL|MF_SHOOTABLE|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, @@ -14593,7 +14593,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_DEADFAKEITEM, // deathstate S_NULL, // xdeathstate - sfx_None, // deathsound + sfx_kc2e, // deathsound 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height @@ -14601,7 +14601,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_fake, // activesound - MF_BOUNCE|MF_SHOOTABLE, // flags + MF_SPECIAL|MF_BOUNCE|MF_SHOOTABLE, // flags S_NULL // raisestate }, diff --git a/src/p_inter.c b/src/p_inter.c index e90c555f4..cc183a5b1 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -435,7 +435,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) { - if (player->kartstuff[k_comebackmode] == 1 || player->kartstuff[k_comebacktimer]) + if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer]) return; if (player->kartstuff[k_comebackmode] == 0) player->kartstuff[k_comebackmode] = 1; @@ -445,6 +445,43 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_SetTarget(&special->target, toucher); P_KillMobj(special, toucher, toucher); break; + case MT_FAKESHIELD: // SRB2kart + case MT_FAKEITEM: + if ((special->target == toucher || special->target == toucher->target) && (special->threshold > 0)) + return; + + if (special->health <= 0 || toucher->health <= 0) + return; + + if (!P_CanPickupItem(player, 2)) + return; + + /*if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) + { + if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer]) + return; + if (player->kartstuff[k_comebackmode] == 0) + player->kartstuff[k_comebackmode] = 2; + }*/ + + { + mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); + S_StartSound(poof, special->info->deathsound); + + K_StripItems(player); + if (player->kartstuff[k_itemroulette] <= 0) + player->kartstuff[k_itemroulette] = 1; + player->kartstuff[k_roulettetype] = 2; + if (special->target && special->target->player + && (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)) + player->kartstuff[k_eggmanblame] = special->target->player-players; + else + player->kartstuff[k_eggmanblame] = player-players; + + P_RemoveMobj(special); + return; + } + break; case MT_KARMAHITBOX: if (!special->target->player) return; @@ -506,6 +543,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->kartstuff[k_roulettetype] = 1; } return; + // ***************************************** // // Rings, coins, spheres, weapon panels, etc // // ***************************************** // diff --git a/src/p_map.c b/src/p_map.c index 0f1607b9e..9202e6e3f 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -742,37 +742,6 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD) - { - if (tmthing->type == MT_ORBINAUT_SHIELD || tmthing->type == MT_JAWZ_SHIELD) - { - // This Item Damage - if (tmthing->eflags & MFE_VERTICALFLIP) - tmthing->z -= tmthing->height; - else - tmthing->z += tmthing->height; - - S_StartSound(tmthing, tmthing->info->deathsound); - P_KillMobj(tmthing, thing, thing); - - P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); - P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); - - P_SpawnMobj(thing->x/2 + tmthing->x/2, thing->y/2 + tmthing->y/2, thing->z/2 + tmthing->z/2, MT_ITEMCLASH); - } - - // Other Item Damage - if (thing->eflags & MFE_VERTICALFLIP) - thing->z -= thing->height; - else - thing->z += thing->height; - - S_StartSound(thing, thing->info->deathsound); - P_KillMobj(thing, tmthing, tmthing); - - P_SetObjectMomZ(thing, 8*FRACUNIT, false); - P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); - } else if (thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE) { // This Item Damage @@ -934,131 +903,6 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD) - { - if (tmthing->type == MT_BANANA_SHIELD) - { - // This Item Damage - if (tmthing->eflags & MFE_VERTICALFLIP) - tmthing->z -= tmthing->height; - else - tmthing->z += tmthing->height; - - S_StartSound(tmthing, tmthing->info->deathsound); - P_KillMobj(tmthing, thing, thing); - - P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); - P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); - - P_SpawnMobj(thing->x/2 + tmthing->x/2, thing->y/2 + tmthing->y/2, thing->z/2 + tmthing->z/2, MT_ITEMCLASH); - } - // Other Item Damage - if (thing->eflags & MFE_VERTICALFLIP) - thing->z -= thing->height; - else - thing->z += thing->height; - - S_StartSound(thing, thing->info->deathsound); - P_KillMobj(thing, tmthing, tmthing); - - P_SetObjectMomZ(thing, 8*FRACUNIT, false); - P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); - } - - return true; - } - else if (tmthing->type == MT_FAKESHIELD || tmthing->type == MT_FAKEITEM) - { - // see if it went over / under - if (tmthing->z > thing->z + thing->height) - return true; // overhead - if (tmthing->z + tmthing->height < thing->z) - return true; // underneath - - if (((tmthing->target == thing) || (tmthing->target == thing->target)) && (tmthing->threshold > 0 || (thing->type != MT_PLAYER && thing->threshold > 0))) - return true; - - if (tmthing->health <= 0 || thing->health <= 0) - return true; - - if (thing->player && thing->player->powers[pw_flashing]) - return true; - - if (thing->type == MT_ORBINAUT // When these items collide with the fake item, just the fake item is destroyed - || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD - || thing->type == MT_SSMINE - || thing->type == MT_BANANA || thing->type == MT_BALLHOG) - { - // This Item Damage - if (tmthing->eflags & MFE_VERTICALFLIP) - tmthing->z -= tmthing->height; - else - tmthing->z += tmthing->height; - - S_StartSound(tmthing, tmthing->info->deathsound); - P_KillMobj(tmthing, thing, thing); - - P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); - P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); - } - else if (thing->type == MT_ORBINAUT_SHIELD // When these items collide with the fake item, both of them are destroyed - || thing->type == MT_JAWZ_SHIELD - || thing->type == MT_SSMINE_SHIELD - || thing->type == MT_BANANA_SHIELD - || thing->type == MT_FAKEITEM || thing->type == MT_FAKESHIELD) - { - // Other Item Damage - if (thing->eflags & MFE_VERTICALFLIP) - thing->z -= thing->height; - else - thing->z += thing->height; - - S_StartSound(thing, thing->info->deathsound); - P_KillMobj(thing, tmthing, tmthing); - - P_SetObjectMomZ(thing, 8*FRACUNIT, false); - P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); - - P_SpawnMobj(thing->x/2 + tmthing->x/2, thing->y/2 + tmthing->y/2, thing->z/2 + tmthing->z/2, MT_ITEMCLASH); - - // This Item Damage - if (tmthing->eflags & MFE_VERTICALFLIP) - tmthing->z -= tmthing->height; - else - tmthing->z += tmthing->height; - - S_StartSound(tmthing, tmthing->info->deathsound); - P_KillMobj(tmthing, thing, thing); - - P_SetObjectMomZ(tmthing, 8*FRACUNIT, false); - P_InstaThrust(tmthing, R_PointToAngle2(thing->x, thing->y, tmthing->x, tmthing->y)+ANGLE_90, 16*FRACUNIT); - } - else if (thing->type == MT_PLAYER) - { - // Player Damage - { - mobj_t *poof = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_EXPLODE); - S_StartSound(poof, sfx_kc2e); - } - - if (P_CanPickupItem(thing->player, 2)) - { - if (thing->player->kartstuff[k_itemroulette] <= 0) - thing->player->kartstuff[k_itemroulette] = 1; - thing->player->kartstuff[k_roulettetype] = 2; - if (tmthing->target && tmthing->target->player) - thing->player->kartstuff[k_eggmanblame] = tmthing->target->player-players; - } - - // This Item Damage - if (tmthing->eflags & MFE_VERTICALFLIP) - tmthing->z -= tmthing->height; - else - tmthing->z += tmthing->height; - - S_StartSound(tmthing, tmthing->info->deathsound); - P_RemoveMobj(tmthing); - } return true; } @@ -1106,7 +950,6 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (tmthing->type == MT_PLAYER && (thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_ORBINAUT || thing->type == MT_JAWZ_SHIELD || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD - || thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM || thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA || thing->type == MT_SSMINE_SHIELD || thing->type == MT_SSMINE || thing->type == MT_MINEEXPLOSION @@ -1120,8 +963,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // underneath if (tmthing->player && tmthing->player->powers[pw_flashing] - && !(thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD - || thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM)) + && !(thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)) return true; if (thing->type == MT_ORBINAUT_SHIELD || thing->type == MT_JAWZ_SHIELD @@ -1152,38 +994,6 @@ static boolean PIT_CheckThing(mobj_t *thing) P_SetObjectMomZ(thing, 8*FRACUNIT, false); P_InstaThrust(thing, R_PointToAngle2(tmthing->x, tmthing->y, thing->x, thing->y)+ANGLE_90, 16*FRACUNIT); } - else if (thing->type == MT_FAKESHIELD || thing->type == MT_FAKEITEM) - { - if ((thing->target == tmthing) && (thing->threshold > 0)) - return true; - - if (tmthing->health <= 0 || thing->health <= 0) - return true; - - // Player Damage - { - mobj_t *poof = P_SpawnMobj(thing->x, thing->y, thing->z, MT_EXPLODE); - S_StartSound(poof, sfx_kc2e); - } - - if (P_CanPickupItem(tmthing->player, 2)) - { - if (tmthing->player->kartstuff[k_itemroulette] <= 0) - tmthing->player->kartstuff[k_itemroulette] = 1; - tmthing->player->kartstuff[k_roulettetype] = 2; - if (thing->target && thing->target->player) - tmthing->player->kartstuff[k_eggmanblame] = thing->target->player-players; - } - - // Other Item Damage - if (thing->eflags & MFE_VERTICALFLIP) - thing->z -= thing->height; - else - thing->z += thing->height; - - S_StartSound(thing, thing->info->deathsound); - P_RemoveMobj(thing); - } else if (thing->type == MT_BANANA_SHIELD || thing->type == MT_BANANA || thing->type == MT_BALLHOG) {