From 98137822b87b514003c5ce8f673cfdd323b6b3cd Mon Sep 17 00:00:00 2001 From: ZTsukei Date: Sun, 26 Feb 2017 10:19:12 -0500 Subject: [PATCH] Fake Items working - Still a weird bug where the item won't throw if you're turning. --- src/d_player.h | 1 + src/doomdef.h | 12 ++-- src/g_game.c | 18 +++-- src/info.c | 64 +++++++++--------- src/info.h | 2 +- src/k_kart.c | 14 ++-- src/p_inter.c | 21 +++--- src/p_mobj.c | 177 ++++++++++++++++++++++++++++++++++++++++++++++++- src/p_user.c | 40 +++++++++-- 9 files changed, 278 insertions(+), 71 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 6ea2798e..f0bc54bc 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -245,6 +245,7 @@ typedef enum k_throwdir, // Held dir of controls; 1 = forward, 0 = none, -1 = backward (was "player->heldDir") k_turndir, // Turn direction for drifting; -1 = Left, 1 = Right, 0 = none + k_camspin, // Used to 180 the camera while a button is held k_sounds, // Used this to stop and then force music restores as it hits zero k_boosting, // Determines if you're currently shroom-boosting diff --git a/src/doomdef.h b/src/doomdef.h index 317b63e3..4fa110d3 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -140,19 +140,19 @@ extern FILE *logstream; #endif -//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 +#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 #ifdef DEVELOP #define VERSION 101 // Game version -#define SUBVERSION 3 // more precise version number +#define SUBVERSION 4 // more precise version number #define VERSIONSTRING "Development EXE" -#define VERSIONSTRINGW "v1.1.03" +#define VERSIONSTRINGW "v1.1.04" // most interface strings are ignored in development mode. // we use comprevision and compbranch instead. #else #define VERSION 101 // Game version -#define SUBVERSION 3 // more precise version number -#define VERSIONSTRING "DevEXE v1.1.03" -#define VERSIONSTRINGW L"v1.1.03" +#define SUBVERSION 4 // more precise version number +#define VERSIONSTRING "DevEXE v1.1.04" +#define VERSIONSTRINGW L"v1.1.04" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif diff --git a/src/g_game.c b/src/g_game.c index 843de1b7..037c94d5 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -955,7 +955,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) static INT32 turnheld; // for accelerative turning static boolean keyboard_look; // true if lookup/down using keyboard - static boolean resetdown; // don't cam reset every frame G_CopyTiccmd(cmd, I_BaseTiccmd(), 1); // empty, or external driver @@ -1065,9 +1064,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) } // But forward/backward IS used for aiming. axis = JoyAxis(AXISMOVE); - if (PLAYER1INPUTDOWN(gc_aimforward) || (gamepadjoystickmove && axis < 0)) + if (PLAYER1INPUTDOWN(gc_aimforward) || (gamepadjoystickmove && axis < 0) || (analogjoystickmove && axis < 0)) cmd->buttons |= BT_FORWARD; - if (PLAYER1INPUTDOWN(gc_aimbackward) || (gamepadjoystickmove && axis > 0)) + if (PLAYER1INPUTDOWN(gc_aimbackward) || (gamepadjoystickmove && axis > 0) || (analogjoystickmove && axis > 0)) cmd->buttons |= BT_BACKWARD; /* if (PLAYER1INPUTDOWN(gc_forward) || (gamepadjoystickmove && axis < 0)) @@ -1150,12 +1149,11 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics) if (PLAYER1INPUTDOWN(gc_lookback)) { - if (camera.chase && !resetdown) - P_ResetCamera(&players[displayplayer], &camera); // TODO: Replace with a camflip - resetdown = true; + if (camera.chase && !player->kartstuff[k_camspin]) + player->kartstuff[k_camspin] = 1; } - else - resetdown = false; + else if (player->kartstuff[k_camspin] > 0) + player->kartstuff[k_camspin] = -1; // jump button if (PLAYER1INPUTDOWN(gc_jump)) @@ -2021,9 +2019,9 @@ void G_Ticker(boolean run) // SRB2kart // Save the dir the player is holding // to allow items to be thrown forward or backward. - if (cmd->forwardmove > 0) + if (cmd->buttons & BT_FORWARD) players[i].kartstuff[k_throwdir] = 1; - else if (cmd->forwardmove < 0) + else if (cmd->buttons & BT_BACKWARD) players[i].kartstuff[k_throwdir] = -1; else players[i].kartstuff[k_throwdir] = 0; diff --git a/src/info.c b/src/info.c index ebad16e1..61e0463f 100644 --- a/src/info.c +++ b/src/info.c @@ -55,7 +55,7 @@ char sprnames[NUMSPRITES + 1][5] = "GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI", "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", //SRB2kart Sprites - "SPRG","BSPR","RNDM","SPRK","KFRE","DRIF","DSMO","FAKE","DFAK","BANA", + "SPRG","BSPR","RNDM","RPOP","KFRE","DRIF","DSMO","FITM","DFAK","BANA", "DBAN","GSHE","GSTR","DGSH","RSHE","RSTR","DRSH","BOMB","BLIG","LIGH", "SINK","SITR","POKE" }; @@ -2562,10 +2562,10 @@ state_t states[NUMSTATES] = {SPR_RNDM, 23, 3, {NULL}, 0, 0, S_RANDOMITEM1}, // S_RANDOMITEM24 {SPR_RNDM, 0, 1, {A_ItemPop}, 0, 0, S_NULL}, // S_DEADRANDOMITEM - {SPR_SPRK, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_RANDOMITEMPOP2}, // S_RANDOMITEMPOP1 - {SPR_SPRK, FF_FULLBRIGHT|1, 5, {NULL}, 0, 0, S_RANDOMITEMPOP3}, // S_RANDOMITEMPOP2 - {SPR_SPRK, FF_FULLBRIGHT|2, 5, {NULL}, 0, 0, S_RANDOMITEMPOP4}, // S_RANDOMITEMPOP3 - {SPR_SPRK, FF_FULLBRIGHT|3, 5, {NULL}, 0, 0, S_NULL}, // S_RANDOMITEMPOP4 + {SPR_RPOP, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_RANDOMITEMPOP2}, // S_RANDOMITEMPOP1 + {SPR_RPOP, FF_FULLBRIGHT|1, 5, {NULL}, 0, 0, S_RANDOMITEMPOP3}, // S_RANDOMITEMPOP2 + {SPR_RPOP, FF_FULLBRIGHT|2, 5, {NULL}, 0, 0, S_RANDOMITEMPOP4}, // S_RANDOMITEMPOP3 + {SPR_RPOP, FF_FULLBRIGHT|3, 5, {NULL}, 0, 0, S_NULL}, // S_RANDOMITEMPOP4 {SPR_DRIF, 0, 2, {NULL}, 0, 0, S_DRIFTSPARK2}, // S_DRIFTSPARK1 {SPR_DRIF, 1, 2, {NULL}, 0, 0, S_DRIFTSPARK3}, // S_DRIFTSPARK2 @@ -2589,30 +2589,30 @@ state_t states[NUMSTATES] = {SPR_KFRE, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_KARTFIRE8}, // S_KARTFIRE7 {SPR_KFRE, FF_FULLBRIGHT|6, 2, {NULL}, 0, 0, S_NULL}, // S_KARTFIRE8 - {SPR_FITE, 0, 3, {NULL}, 0, 0, S_FAKEITEM2}, // S_FAKEITEM1 - {SPR_FITE, 1, 3, {NULL}, 0, 0, S_FAKEITEM3}, // S_FAKEITEM2 - {SPR_FITE, 2, 3, {NULL}, 0, 0, S_FAKEITEM4}, // S_FAKEITEM3 - {SPR_FITE, 3, 3, {NULL}, 0, 0, S_FAKEITEM5}, // S_FAKEITEM4 - {SPR_FITE, 4, 3, {NULL}, 0, 0, S_FAKEITEM6}, // S_FAKEITEM5 - {SPR_FITE, 5, 3, {NULL}, 0, 0, S_FAKEITEM7}, // S_FAKEITEM6 - {SPR_FITE, 6, 3, {NULL}, 0, 0, S_FAKEITEM8}, // S_FAKEITEM7 - {SPR_FITE, 7, 3, {NULL}, 0, 0, S_FAKEITEM9}, // S_FAKEITEM8 - {SPR_FITE, 8, 3, {NULL}, 0, 0, S_FAKEITEM10}, // S_FAKEITEM9 - {SPR_FITE, 9, 3, {NULL}, 0, 0, S_FAKEITEM11}, // S_FAKEITEM10 - {SPR_FITE, 10, 3, {NULL}, 0, 0, S_FAKEITEM12}, // S_FAKEITEM11 - {SPR_FITE, 11, 3, {NULL}, 0, 0, S_FAKEITEM13}, // S_FAKEITEM12 - {SPR_FITE, 12, 3, {NULL}, 0, 0, S_FAKEITEM14}, // S_FAKEITEM13 - {SPR_FITE, 13, 3, {NULL}, 0, 0, S_FAKEITEM15}, // S_FAKEITEM14 - {SPR_FITE, 14, 3, {NULL}, 0, 0, S_FAKEITEM16}, // S_FAKEITEM15 - {SPR_FITE, 15, 3, {NULL}, 0, 0, S_FAKEITEM17}, // S_FAKEITEM16 - {SPR_FITE, 16, 3, {NULL}, 0, 0, S_FAKEITEM18}, // S_FAKEITEM17 - {SPR_FITE, 17, 3, {NULL}, 0, 0, S_FAKEITEM19}, // S_FAKEITEM18 - {SPR_FITE, 18, 3, {NULL}, 0, 0, S_FAKEITEM20}, // S_FAKEITEM19 - {SPR_FITE, 19, 3, {NULL}, 0, 0, S_FAKEITEM21}, // S_FAKEITEM20 - {SPR_FITE, 20, 3, {NULL}, 0, 0, S_FAKEITEM22}, // S_FAKEITEM21 - {SPR_FITE, 21, 3, {NULL}, 0, 0, S_FAKEITEM23}, // S_FAKEITEM22 - {SPR_FITE, 22, 3, {NULL}, 0, 0, S_FAKEITEM24}, // S_FAKEITEM23 - {SPR_FITE, 23, 3, {NULL}, 0, 0, S_FAKEITEM1}, // S_FAKEITEM24 + {SPR_FITM, 0, 3, {NULL}, 0, 0, S_FAKEITEM2}, // S_FAKEITEM1 + {SPR_FITM, 1, 3, {NULL}, 0, 0, S_FAKEITEM3}, // S_FAKEITEM2 + {SPR_FITM, 2, 3, {NULL}, 0, 0, S_FAKEITEM4}, // S_FAKEITEM3 + {SPR_FITM, 3, 3, {NULL}, 0, 0, S_FAKEITEM5}, // S_FAKEITEM4 + {SPR_FITM, 4, 3, {NULL}, 0, 0, S_FAKEITEM6}, // S_FAKEITEM5 + {SPR_FITM, 5, 3, {NULL}, 0, 0, S_FAKEITEM7}, // S_FAKEITEM6 + {SPR_FITM, 6, 3, {NULL}, 0, 0, S_FAKEITEM8}, // S_FAKEITEM7 + {SPR_FITM, 7, 3, {NULL}, 0, 0, S_FAKEITEM9}, // S_FAKEITEM8 + {SPR_FITM, 8, 3, {NULL}, 0, 0, S_FAKEITEM10}, // S_FAKEITEM9 + {SPR_FITM, 9, 3, {NULL}, 0, 0, S_FAKEITEM11}, // S_FAKEITEM10 + {SPR_FITM, 10, 3, {NULL}, 0, 0, S_FAKEITEM12}, // S_FAKEITEM11 + {SPR_FITM, 11, 3, {NULL}, 0, 0, S_FAKEITEM13}, // S_FAKEITEM12 + {SPR_FITM, 12, 3, {NULL}, 0, 0, S_FAKEITEM14}, // S_FAKEITEM13 + {SPR_FITM, 13, 3, {NULL}, 0, 0, S_FAKEITEM15}, // S_FAKEITEM14 + {SPR_FITM, 14, 3, {NULL}, 0, 0, S_FAKEITEM16}, // S_FAKEITEM15 + {SPR_FITM, 15, 3, {NULL}, 0, 0, S_FAKEITEM17}, // S_FAKEITEM16 + {SPR_FITM, 16, 3, {NULL}, 0, 0, S_FAKEITEM18}, // S_FAKEITEM17 + {SPR_FITM, 17, 3, {NULL}, 0, 0, S_FAKEITEM19}, // S_FAKEITEM18 + {SPR_FITM, 18, 3, {NULL}, 0, 0, S_FAKEITEM20}, // S_FAKEITEM19 + {SPR_FITM, 19, 3, {NULL}, 0, 0, S_FAKEITEM21}, // S_FAKEITEM20 + {SPR_FITM, 20, 3, {NULL}, 0, 0, S_FAKEITEM22}, // S_FAKEITEM21 + {SPR_FITM, 21, 3, {NULL}, 0, 0, S_FAKEITEM23}, // S_FAKEITEM22 // ***** + {SPR_FITM, 22, 3, {NULL}, 0, 0, S_FAKEITEM24}, // S_FAKEITEM23 // ***** + {SPR_FITM, 23, 3, {NULL}, 0, 0, S_FAKEITEM1}, // S_FAKEITEM24 // ***** {SPR_DFAK, 0, 175, {NULL}, 0, 0, S_FAKEITEM1}, // S_DEADFAKEITEM {SPR_BANA, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BANANAITEM @@ -14114,13 +14114,13 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_RANDOMITEMPOP -1, // doomednum - S_RANDOMITEMPOP1, // spawnstate + S_SPRK1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_RANDOMITEMPOP1, // painstate + S_SPRK1, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -14236,7 +14236,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_DEADFAKEITEM, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - k_fakeitem, // speed + 8, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset diff --git a/src/info.h b/src/info.h index 15781fea..70c4cb14 100644 --- a/src/info.h +++ b/src/info.h @@ -585,7 +585,7 @@ typedef enum sprite SPR_DSMO, // Drift Smoke // Kart Items - SPR_FITE, // Fake Item box + SPR_FITM, // Fake Item box SPR_DFAK, // Dead Fake Item SPR_BANA, // Banana Peel SPR_DBAN, // Dead Banana Peel diff --git a/src/k_kart.c b/src/k_kart.c index f73ab9a8..fc7049d1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -313,13 +313,13 @@ static fixed_t K_KartItemOdds_Retro[MAXPLAYERS][NUMKARTITEMS][MAXPLAYERS] = { //1st // { 0 }, // Magnet { 0 }, // Boo - { 40 }, // Mushroom + { 0 }, // Mushroom { 0 }, // Triple Mushroom { 0 }, // Mega Mushroom { 0 }, // Gold Mushroom { 0 }, // Star { 0 }, // Triple Banana - { 0 }, // Fake Item + { 40 }, // Fake Item { 0 }, // Banana { 0 }, // Green Shell { 0 }, // Red Shell @@ -836,7 +836,6 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) if (cv_megashroom.value) K_KartSetItemResult(ppos, 5); // Mega Mushroom if (cv_goldshroom.value) K_KartSetItemResult(ppos, 6); // Gold Mushroom if (cv_star.value) K_KartSetItemResult(ppos, 7); // Star - /* if (cv_triplebanana.value) K_KartSetItemResult(ppos, 8); // Triple Banana if (cv_fakeitem.value) K_KartSetItemResult(ppos, 9); // Fake Item if (cv_banana.value) K_KartSetItemResult(ppos, 10); // Banana @@ -848,7 +847,6 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) if (cv_fireflower.value) K_KartSetItemResult(ppos, 16); // Fire Flower if (cv_tripleredshell.value) K_KartSetItemResult(ppos, 17); // Triple Red Shell if (cv_lightning.value && pingame > pexiting) K_KartSetItemResult(ppos, 18); // Lightning - */ // Award the player whatever power is rolled if (numchoices > 0) @@ -1071,6 +1069,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) void K_PlayTauntSound(mobj_t *source) { + return; // Doesn't work yet... INT32 prandom; prandom = P_RandomFixed(); @@ -1754,7 +1753,7 @@ void K_DoMushroom(player_t *player, boolean doPFlag) if (player->kartstuff[k_sounds]) // Prevents taunt sounds from playing every time the button is pressed return; - //K_PlayTauntSound(player->mo); + K_PlayTauntSound(player->mo); player->kartstuff[k_sounds] = 50; } @@ -2182,7 +2181,7 @@ void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground) if (!P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_star); player->kartstuff[k_startimer] = bonustime; // Activate it - //K_PlayTauntSound(player->mo); + K_PlayTauntSound(player->mo); player->kartstuff[k_star] = 0; player->kartstuff[k_itemclose] = 10; player->pflags |= PF_ATTACKDOWN; @@ -2426,6 +2425,7 @@ void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground) newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT); newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT); mo = P_SpawnMobj(newx, newy, player->mo->z, MT_FAKESHIELD); + mo->scale = FRACUNIT/2; mo->threshold = 10; if (mo) P_SetTarget(&mo->target, player->mo); @@ -2483,7 +2483,7 @@ void K_MoveKartPlayer(player_t *player, ticcmd_t *cmd, boolean onground) S_ChangeMusicInternal("mega", true); if (!P_IsLocalPlayer(player)) S_StartSound(player->mo, sfx_mega); - //K_PlayTauntSound(player->mo); + K_PlayTauntSound(player->mo); player->kartstuff[k_growshrinktimer] = bonustime; S_StartSound(player->mo, sfx_mario3); player->pflags |= PF_ATTACKDOWN; diff --git a/src/p_inter.c b/src/p_inter.c index 4a4268f0..239197a3 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2101,11 +2101,11 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) G_StopMetalRecording(); if (gametype == GT_MATCH && cv_match_scoring.value == 0 // note, no team match suicide penalty && ((target == source) || (source == NULL && inflictor == NULL) || (source && !source->player))) - { // Suicide penalty - if (target->player->score >= 50) - target->player->score -= 50; - else - target->player->score = 0; + { // Suicide penalty - Not in Kart + //if (target->player->score >= 50) + // target->player->score -= 50; + //else + // target->player->score = 0; } target->flags2 &= ~MF2_DONTDRAW; @@ -2689,13 +2689,14 @@ static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj { player_t *player = target->player; - // You can't kill yourself, idiot... - if (source == target) - return false; + // You can't kill yourself, idiot... // Unless it's Mario kart. Which it is. In this mod. All the time. + //if (source == target) + // return false; // In COOP/RACE/CHAOS, you can't hurt other players unless cv_friendlyfire is on - if (!cv_friendlyfire.value && (G_PlatformGametype())) - return false; + // ...But in SRB2kart, you can! + //if (!cv_friendlyfire.value && (G_PlatformGametype())) + // return false; // Tag handling if (G_TagGametype()) diff --git a/src/p_mobj.c b/src/p_mobj.c index e83b3256..050b1fbf 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6441,7 +6441,8 @@ void P_MobjThinker(mobj_t *mobj) case MT_TRIPLEBANANASHIELD1: case MT_TRIPLEBANANASHIELD2: case MT_TRIPLEBANANASHIELD3: - if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator) + if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo + && mobj->target->player->health > 0 && !mobj->target->player->spectator) { INT32 zfixds = 56; if (mobj->type == MT_BANANASHIELD || mobj->type == MT_TRIPLEBANANASHIELD1 || mobj->type == MT_TRIPLEBANANASHIELD2 || mobj->type == MT_TRIPLEBANANASHIELD3) @@ -6859,6 +6860,19 @@ void P_MobjThinker(mobj_t *mobj) P_SetObjectMomZ(mobj, -2*FRACUNIT/3, true); } break; + //{ SRB2kart Items - Death States + case MT_GREENITEM: + case MT_REDITEM: + case MT_REDITEMDUD: + case MT_BANANAITEM: + case MT_FAKEITEM: + if (mobj->z <= mobj->floorz) + P_RemoveMobj(mobj); + break; + case MT_BOMBITEM: + P_SetMobjState(mobj, mobj->info->deathstate); + break; + //} default: break; } @@ -7281,6 +7295,167 @@ void P_MobjThinker(mobj_t *mobj) P_InstaThrust(mobj, mobj->angle, FixedMul(mobj->info->speed, mobj->scale)); } break; + //{ SRB2kart Items + /*case MT_LAKITU: + if (!mobj->target->player) + { + P_SetMobjState(mobj, S_DISS); + return; + } + if (mobj->target->player && !splitscreen + && !(mobj->target->player == &players[displayplayer]) + && !(mobj->state >= &states[S_LAKITUFSH1] && mobj->state <= &states[S_LAKITUFSH2])) + mobj->flags2 |= MF2_DONTDRAW; + else + mobj->flags2 &= ~MF2_DONTDRAW; + + if ((mobj->state >= &states[S_LAKITUSL1] && mobj->state <= &states[S_LAKITUSL12]) + || (mobj->state >= &states[S_LAKITULAP1A] && mobj->state <= &states[S_LAKITUFLG8])) + { + const fixed_t radius = FIXEDSCALE(128, mobj->target->scale)*FRACUNIT; + mobj->angle = (mobj->target->angle); + P_UnsetThingPosition(mobj); + { + const angle_t fa = mobj->angle>>ANGLETOFINESHIFT; + mobj->x = mobj->target->x + FixedMul(FINECOSINE(fa),radius); + mobj->y = mobj->target->y + FixedMul(FINESINE(fa),radius); + if (mobj->state >= &states[S_LAKITUFLG1] && mobj->state <= &states[S_LAKITUFLG8]) + { + if (mobj->target->eflags & MFE_VERTICALFLIP) + mobj->z = mobj->target->z - 128*FRACUNIT; + else + mobj->z = mobj->target->z + 64*FRACUNIT; + } + P_SetThingPosition(mobj); + } + } + break;*/ + case MT_POKEY: + if (mobj->threshold) + { + if (mobj->state == &states[S_POKEY1]) + mobj->health = 1; + else if (mobj->state == &states[S_POKEY2]) + mobj->health = 2; + else if (mobj->state == &states[S_POKEY3]) + mobj->health = 3; + else if (mobj->state == &states[S_POKEY4]) + mobj->health = 4; + else if (mobj->state == &states[S_POKEY5]) + mobj->health = 5; + else if (mobj->state == &states[S_POKEY6]) + mobj->health = 6; + else if (mobj->state == &states[S_POKEY7]) + mobj->health = 7; + else if (mobj->state == &states[S_POKEY8]) + mobj->health = 8; + + mobj->threshold++; + P_SetMobjState(mobj, S_POKEYIDLE); + } + if (mobj->state == &states[S_POKEYIDLE] && mobj->threshold >= 105) + { + if (mobj->health == 1) + P_SetMobjState(mobj, S_POKEY1); + else if (mobj->health == 2) + P_SetMobjState(mobj, S_POKEY2); + else if (mobj->health == 3) + P_SetMobjState(mobj, S_POKEY3); + else if (mobj->health == 4) + P_SetMobjState(mobj, S_POKEY4); + else if (mobj->health == 5) + P_SetMobjState(mobj, S_POKEY5); + else if (mobj->health == 6) + P_SetMobjState(mobj, S_POKEY6); + else if (mobj->health == 7) + P_SetMobjState(mobj, S_POKEY7); + else if (mobj->health == 8) + P_SetMobjState(mobj, S_POKEY8); + mobj->threshold = 0; + } + break; + case MT_GREENITEM: + mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); + P_InstaThrust(mobj, mobj->angle, mobj->info->speed); + if (mobj->threshold > 0) + mobj->threshold--; + if (leveltime % 6 == 0) + S_StartSound(mobj, mobj->info->activesound); + break; + case MT_REDITEM: + if (mobj->threshold > 0) + mobj->threshold--; + if (leveltime % 7 == 0) + S_StartSound(mobj, mobj->info->activesound); + break; + case MT_REDITEMDUD: + mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->x+mobj->momx, mobj->y+mobj->momy); + P_InstaThrust(mobj, mobj->angle, mobj->info->speed); + if (mobj->threshold > 0) + mobj->threshold--; + if (leveltime % 7 == 0) + S_StartSound(mobj, mobj->info->activesound); + break; + case MT_BANANAITEM: + case MT_FAKEITEM: + if (mobj->z <= mobj->floorz && mobj->health > 1) + { + S_StartSound(mobj, mobj->info->activesound); + mobj->momx = mobj->momy = 0; + mobj->health = 1; + } + if (mobj->threshold > 0) + mobj->threshold--; + break; + case MT_SINK: + if (mobj->z <= mobj->floorz) + { + S_StartSound(mobj, mobj->info->deathsound); + P_SetMobjState(mobj, S_NULL); + } + if (mobj->threshold > 0) + mobj->threshold--; + break; + case MT_BOMBITEM: + if (mobj->z <= mobj->floorz) + { + if (mobj->health > mobj->info->spawnhealth-1) + { + if (mobj->state == &states[S_BOMBAIR]) + P_SetMobjState(mobj, S_BOMBITEM); + + mobj->momx = mobj->momy = 0; + S_StartSound(mobj, mobj->info->activesound); + } + mobj->health--; + } + if (mobj->threshold > 0) + mobj->threshold--; + break; + case MT_BOMBEXPLOSION: + if ((mobj->z < mobj->floorz - mobj->height) || (mobj->z > mobj->ceilingz + mobj->height)) + { + P_KillMobj(mobj, NULL, NULL); + break; + } + + if (mobj->tics != -1) + { + mobj->tics--; + + // you can cycle through multiple states in a tic + if (!mobj->tics) + if (!P_SetMobjState(mobj, mobj->state->nextstate)) + return; // freed itself + } + + P_UnsetThingPosition(mobj); + mobj->x += mobj->momx; + mobj->y += mobj->momy; + mobj->z += mobj->momz; + P_SetThingPosition(mobj); + return; + //} case MT_TURRET: P_MobjCheckWater(mobj); P_CheckPosition(mobj, mobj->x, mobj->y); diff --git a/src/p_user.c b/src/p_user.c index eafd640d..76d11ecd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -855,10 +855,10 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Discourages players from intentionally hurting themselves to avoid being tagged. if (gametype == GT_TAG && (!(player->pflags & PF_TAGGED) && !(player->pflags & PF_TAGIT))) { - if (player->score >= 50) - player->score -= 50; - else - player->score = 0; + //if (player->score >= 50) + // player->score -= 50; + //else + // player->score = 0; } P_ResetPlayer(player); @@ -1005,6 +1005,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings) // Adds to the player's score void P_AddPlayerScore(player_t *player, UINT32 amount) { + return; // SRB2kart - no score. UINT32 oldscore; if (player->bot) @@ -8246,6 +8247,36 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->angle = angle; } + // SRB2kart - Camera flipper + if (!objectplacing && displayplayer == consoleplayer) + { + if (player->kartstuff[k_camspin] == 1) + { + if (thiscam == &camera) + { + CV_SetValue(&cv_cam_rotate, camrotate + 180); + } + else + { + CV_SetValue(&cv_cam2_rotate, camrotate + 180); + } + player->kartstuff[k_camspin] = 2; + } + if (player->kartstuff[k_camspin] == -1) + { + if (thiscam == &camera) + { + CV_SetValue(&cv_cam_rotate, camrotate - 180); + } + else + { + CV_SetValue(&cv_cam2_rotate, camrotate - 180); + } + player->kartstuff[k_camspin] = 0; + } + } + + /* // SRB2kart - camera controls are disabled... for now. if (!objectplacing && !(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->pflags & PF_NIGHTSMODE) && displayplayer == consoleplayer) { #ifdef REDSANALOG @@ -8288,6 +8319,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } } } + */ // sets ideal cam pos if (twodlevel || (mo->flags2 & MF2_TWOD))