diff --git a/src/dehacked.c b/src/dehacked.c index c8a90d4d0..36c0a4601 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6604,6 +6604,13 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAYERARROW_ITEM", "S_PLAYERARROW_NUMBER", "S_PLAYERARROW_X", + "S_PLAYERARROW_WANTED1", + "S_PLAYERARROW_WANTED2", + "S_PLAYERARROW_WANTED3", + "S_PLAYERARROW_WANTED4", + "S_PLAYERARROW_WANTED5", + "S_PLAYERARROW_WANTED6", + "S_PLAYERARROW_WANTED7", "S_PLAYERBOMB", // Player bomb overlay "S_PLAYERITEM", // Player item overlay @@ -7238,6 +7245,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FIREDITEM", "MT_PLAYERARROW", + "MT_PLAYERWANTED", "MT_KARMAHITBOX", "MT_KARMAWHEEL", diff --git a/src/info.c b/src/info.c index 4e3078e62..a8d828f7a 100644 --- a/src/info.c +++ b/src/info.c @@ -59,7 +59,7 @@ char sprnames[NUMSPRITES + 1][5] = "BANA","GSHE","JAWZ","SSMN","KRBM","BHOG","BLIG","LIGH","SINK","SITR", "KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB", "CHOM","SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ARRO", - "ITEM","ITMI","ITMN","PBOM","VIEW" + "ITEM","ITMI","ITMN","WANT","PBOM","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -2922,6 +2922,14 @@ state_t states[NUMSTATES] = {SPR_ITEM, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_ITEM {SPR_ITMN, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_NUMBER {SPR_ITMN, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_X + {SPR_WANT, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_PLAYERARROW_WANTED2}, // S_PLAYERARROW_WANTED1 + {SPR_WANT, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED3}, // S_PLAYERARROW_WANTED2 + {SPR_WANT, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED4}, // S_PLAYERARROW_WANTED3 + {SPR_WANT, FF_FULLBRIGHT|3, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED5}, // S_PLAYERARROW_WANTED4 + {SPR_WANT, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED6}, // S_PLAYERARROW_WANTED5 + {SPR_WANT, FF_FULLBRIGHT|5, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED7}, // S_PLAYERARROW_WANTED6 + {SPR_WANT, FF_FULLBRIGHT|6, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED1}, // S_PLAYERARROW_WANTED7 + {SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM @@ -16587,6 +16595,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_PLAYERWANTED + -1, // doomednum + S_PLAYERARROW_WANTED1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 8, // speed + 36*FRACUNIT, // radius + 37*FRACUNIT, // height + 0, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + { // MT_KARMAHITBOX -1, // doomednum S_PLAYERBOMB, // spawnstate diff --git a/src/info.h b/src/info.h index 611e337ef..89a33c6c8 100644 --- a/src/info.h +++ b/src/info.h @@ -627,6 +627,7 @@ typedef enum sprite SPR_ITEM, SPR_ITMI, SPR_ITMN, + SPR_WANT, SPR_PBOM, // player bomb @@ -3450,6 +3451,13 @@ typedef enum state S_PLAYERARROW_ITEM, S_PLAYERARROW_NUMBER, S_PLAYERARROW_X, + S_PLAYERARROW_WANTED1, + S_PLAYERARROW_WANTED2, + S_PLAYERARROW_WANTED3, + S_PLAYERARROW_WANTED4, + S_PLAYERARROW_WANTED5, + S_PLAYERARROW_WANTED6, + S_PLAYERARROW_WANTED7, S_PLAYERBOMB, S_PLAYERITEM, @@ -4101,6 +4109,7 @@ typedef enum mobj_type MT_FIREDITEM, MT_PLAYERARROW, + MT_PLAYERWANTED, MT_KARMAHITBOX, MT_KARMAWHEEL, diff --git a/src/k_kart.c b/src/k_kart.c index fbe6e1b5f..87ae1337a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4265,8 +4265,8 @@ static void K_initKartHUD(void) SPBW_X = BASEVIDWIDTH/2; // 270 SPBW_Y = BASEVIDHEIGHT- 24; // 176 // Battle WANTED poster - WANT_X = BASEVIDWIDTH - 47; // 270 - WANT_Y = BASEVIDHEIGHT- 64; // 176 + WANT_X = BASEVIDWIDTH - 55; // 270 + WANT_Y = BASEVIDHEIGHT- 71; // 176 if (splitscreen) // Splitscreen { @@ -4916,13 +4916,14 @@ fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my static void K_drawKartWanted(void) { UINT8 i, numwanted = 0; + UINT8 *colormap = NULL; - /*if (splitscreen) // Can't fit the poster on screen, sadly + if (splitscreen) // Can't fit the poster on screen, sadly { - if (K_IsPlayerWanted(stplyr) && leveltime % 10 > 4) + if (K_IsPlayerWanted(stplyr) && leveltime % 10 > 3) V_DrawRightAlignedString(WANT_X, WANT_Y, K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS|V_REDMAP), "WANTED"); return; - }*/ + } for (i = 0; i < 4; i++) { @@ -4934,11 +4935,13 @@ static void K_drawKartWanted(void) if (numwanted <= 0) return; - V_DrawScaledPatch(WANT_X, WANT_Y, V_HUDTRANS|V_SNAPTORIGHT|V_SNAPTOBOTTOM, kp_wanted); + if (battlewanted[0] != -1) + colormap = R_GetTranslationColormap(0, players[battlewanted[0]].skincolor, GTC_CACHE); + V_DrawFixedPatch(WANT_X< 1) - y += 8; - - if (numwanted == 3 && i == 2) - x += 9; - else if (i & 1) - x += 18; + else + { + if (i & 1) + x += 18; + if (i > 1) + y += 17; + } if (players[battlewanted[i]].skincolor == 0) V_DrawFixedPatch(x*scale, y*scale, scale, V_HUDTRANS|V_SNAPTORIGHT|V_SNAPTOBOTTOM, faceprefix[p->skin], NULL); else { - UINT8 *colormap = R_GetTranslationColormap((p->mo->colorized ? TC_RAINBOW : p->skin), p->mo->color, GTC_CACHE); + colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE); V_DrawFixedPatch(x*scale, y*scale, scale, V_HUDTRANS|V_SNAPTORIGHT|V_SNAPTOBOTTOM, faceprefix[p->skin], colormap); } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 25460ad1f..c9d07368d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6891,10 +6891,14 @@ void P_MobjThinker(mobj_t *mobj) fixed_t scale = mobj->target->scale; mobj->color = mobj->target->color; - if (!netgame || G_RaceGametype() + if (G_RaceGametype() || mobj->target->player == &players[displayplayer] || mobj->target->player->kartstuff[k_balloon] <= 0 - || (mobj->target->player->mo->flags2 & MF2_DONTDRAW)) + || (mobj->target->player->mo->flags2 & MF2_DONTDRAW) +#if 1 // Set to 0 to test without needing to host + || !netgame +#endif + ) mobj->flags2 |= MF2_DONTDRAW; else mobj->flags2 &= ~MF2_DONTDRAW; @@ -6935,6 +6939,7 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->target->player->kartstuff[k_itemroulette]) { P_SetMobjState(mobj, S_PLAYERARROW_BOX); + mobj->tracer->sprite = SPR_ITEM; mobj->tracer->frame = FF_FULLBRIGHT|((mobj->target->player->kartstuff[k_itemroulette] % (13*3)) / 3); } else if (mobj->target->player->kartstuff[k_itemtype]) @@ -6993,6 +6998,18 @@ void P_MobjThinker(mobj_t *mobj) P_SetScale(numx, mobj->scale); numx->destscale = scale; } + + if (K_IsPlayerWanted(mobj->target->player) && mobj->movecount != 1) + { + mobj_t *wanted = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_PLAYERWANTED); + P_SetTarget(&wanted->target, mobj->target); + P_SetTarget(&wanted->tracer, mobj); + P_SetScale(wanted, mobj->scale); + wanted->destscale = scale; + mobj->movecount = 1; + } + else if (!K_IsPlayerWanted(mobj->target->player)) + mobj->movecount = 0; } else mobj->tracer->flags2 |= MF2_DONTDRAW; @@ -7003,6 +7020,54 @@ void P_MobjThinker(mobj_t *mobj) return; } break; + case MT_PLAYERWANTED: + if (mobj->target && mobj->target->health && mobj->tracer + && mobj->target->player && !mobj->target->player->spectator + && mobj->target->player->health && mobj->target->player->playerstate != PST_DEAD + && players[displayplayer].mo && !players[displayplayer].spectator) + { + fixed_t scale = mobj->target->scale; + + if (!K_IsPlayerWanted(mobj->target->player)) + { + mobj->tracer->movecount = 0; + P_RemoveMobj(mobj); + return; + } + + if (mobj->tracer->flags2 & MF2_DONTDRAW) + mobj->flags2 |= MF2_DONTDRAW; + else + mobj->flags2 &= ~MF2_DONTDRAW; + + P_UnsetThingPosition(mobj); + mobj->x = mobj->target->x; + mobj->y = mobj->target->y; + + if (!(mobj->target->eflags & MFE_VERTICALFLIP)) + { + mobj->z = mobj->target->z + (P_GetPlayerHeight(mobj->target->player)+16*FRACUNIT+(64*mobj->scale)); + mobj->eflags &= ~MFE_VERTICALFLIP; + } + else + { + mobj->z = mobj->target->z - (P_GetPlayerHeight(mobj->target->player)+16*FRACUNIT+(64*mobj->scale)); + mobj->eflags |= MFE_VERTICALFLIP; + } + P_SetThingPosition(mobj); + + scale += FixedMul(FixedDiv(abs(P_AproxDistance(players[displayplayer].mo->x-mobj->target->x, + players[displayplayer].mo->y-mobj->target->y)), RING_DIST), mobj->target->scale); + if (scale > 16*FRACUNIT) + scale = 16*FRACUNIT; + mobj->destscale = scale; + } + else if (mobj->health > 0) + { + P_KillMobj(mobj, NULL, NULL); + return; + } + break; //} case MT_WATERDROP: P_SceneryCheckWater(mobj); @@ -8943,7 +9008,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) break; case MT_KARMAHITBOX: // SRB2Kart { - const fixed_t rad = FixedMul(mobjinfo[MT_PLAYER].radius, mobj->scale) + const fixed_t rad = FixedMul(mobjinfo[MT_PLAYER].radius, mobj->scale); mobj_t *cur, *prev = mobj; INT32 i;