Show the central item on the minimap, and other minor aesthetic touches

This commit is contained in:
TehRealSalt 2018-12-06 16:17:17 -05:00
parent dfa0522326
commit 19ca7bf134
3 changed files with 93 additions and 34 deletions

View file

@ -3394,7 +3394,7 @@ state_t states[NUMSTATES] =
{SPR_FWRK, 3|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARMAFIREWORK1}, // S_KARMAFIREWORK4
{SPR_FWRK, 4|FF_FULLBRIGHT, TICRATE, {NULL}, 0, 0, S_NULL}, // S_KARMAFIREWORKTRAIL
{SPR_OTFG, FF_FULLBRIGHT|FF_TRANS50, 8, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEFOG
{SPR_OTFG, FF_FULLBRIGHT|FF_TRANS50, TICRATE, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEFOG
{SPR_OTFG, 1|FF_FULLBRIGHT, 8, {NULL}, 0, 0, S_NULL}, // S_OVERTIMEORB
#ifdef SEENAMES
@ -20072,8 +20072,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8<<FRACBITS, // radius
16<<FRACBITS, // height
16<<FRACBITS, // radius
32<<FRACBITS, // height
-1, // display offset
100, // mass
0, // damage
@ -20099,8 +20099,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
8<<FRACBITS, // radius
16<<FRACBITS, // height
16<<FRACBITS, // radius
32<<FRACBITS, // height
-1, // display offset
100, // mass
0, // damage

View file

@ -5886,6 +5886,7 @@ static patch_t *kp_lapanim_emblem[2];
static patch_t *kp_lapanim_hand[3];
static patch_t *kp_yougotem;
static patch_t *kp_itemminimap;
void K_LoadKartHUDGraphics(void)
{
@ -6131,6 +6132,7 @@ void K_LoadKartHUDGraphics(void)
}
kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX);
kp_itemminimap = (patch_t *) W_CachePatchName("MMAPITEM", PU_HUDGFX);
}
// For the item toggle menu
@ -7295,7 +7297,7 @@ static void K_drawKartPlayerCheck(void)
}
}
static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, patch_t *AutomapPic)
static void K_drawKartMinimapHead(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, patch_t *icon, UINT8 *colormap, patch_t *AutomapPic)
{
// amnum xpos & ypos are the icon's speed around the HUD.
// The number being divided by is for how fast it moves.
@ -7304,8 +7306,6 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
// am xpos & ypos are the icon's starting position. Withouht
// it, they wouldn't 'spawn' on the top-right side of the HUD.
UINT8 skin = 0;
fixed_t amnumxpos, amnumypos;
INT32 amxpos, amypos;
@ -7316,9 +7316,6 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
fixed_t xoffset, yoffset;
fixed_t xscale, yscale, zoom;
if (mo->skin)
skin = ((skin_t*)mo->skin)-skins;
maxx = maxy = INT32_MAX;
minx = miny = INT32_MIN;
minx = bsp->bbox[0][BOXLEFT];
@ -7355,33 +7352,23 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
yscale = FixedDiv(AutomapPic->height, mapheight);
zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20);
amnumxpos = (FixedMul(mo->x, zoom) - FixedMul(xoffset, zoom));
amnumypos = -(FixedMul(mo->y, zoom) - FixedMul(yoffset, zoom));
amnumxpos = (FixedMul(objx, zoom) - FixedMul(xoffset, zoom));
amnumypos = -(FixedMul(objy, zoom) - FixedMul(yoffset, zoom));
if (encoremode)
amnumxpos = -amnumxpos;
amxpos = amnumxpos + ((x + AutomapPic->width/2 - (facemmapprefix[skin]->width/2))<<FRACBITS);
amypos = amnumypos + ((y + AutomapPic->height/2 - (facemmapprefix[skin]->height/2))<<FRACBITS);
amxpos = amnumxpos + ((hudx + AutomapPic->width/2 - (icon->width/2))<<FRACBITS);
amypos = amnumypos + ((hudy + AutomapPic->height/2 - (icon->height/2))<<FRACBITS);
// do we want this? it feels unnecessary. easier to just modify the amnumxpos?
/*if (encoremode)
{
flags |= V_FLIP;
amxpos = -amnumxpos + ((x + AutomapPic->width/2 + (facemmapprefix[skin]->width/2))<<FRACBITS);
amxpos = -amnumxpos + ((hudx + AutomapPic->width/2 + (icon->width/2))<<FRACBITS);
}*/
if (!mo->color) // 'default' color
V_DrawSciencePatch(amxpos, amypos, flags, facemmapprefix[skin], FRACUNIT);
else
{
UINT8 *colormap;
if (mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, mo->color, GTC_CACHE);
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap);
}
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, icon, colormap);
}
static void K_drawKartMinimap(void)
@ -7392,6 +7379,8 @@ static void K_drawKartMinimap(void)
INT32 x, y;
INT32 minimaptrans, splitflags = (splitscreen ? 0 : V_SNAPTORIGHT);
boolean dop1later = false;
UINT8 skin = 0;
UINT8 *colormap = NULL;
// Draw the HUD only when playing in a level.
// hu_stuff needs this, unlike st_stuff.
@ -7443,13 +7432,37 @@ static void K_drawKartMinimap(void)
x -= SHORT(AutomapPic->leftoffset);
y -= SHORT(AutomapPic->topoffset);
// Draw the super item in Battle
if (G_BattleGametype() && battleovertime->enabled)
{
const INT32 prevsplitflags = splitflags;
splitflags &= ~V_HUDTRANSHALF;
splitflags |= V_HUDTRANS;
colormap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE);
K_drawKartMinimapHead(battleovertime->x, battleovertime->y, x, y, splitflags, kp_itemminimap, colormap, AutomapPic);
splitflags = prevsplitflags;
}
// Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen)
if (ghosts)
{
demoghost *g = ghosts;
while (g)
{
K_drawKartMinimapHead(g->mo, x, y, splitflags, AutomapPic);
if (g->mo->skin)
skin = ((skin_t*)g->mo->skin)-skins;
else
skin = 0;
if (g->mo->color)
{
if (g->mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, g->mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, g->mo->color, GTC_CACHE);
}
else
colormap = NULL;
K_drawKartMinimapHead(g->mo->x, g->mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
g = g->next;
}
if (!stplyr->mo || stplyr->spectator) // do we need the latter..?
@ -7481,7 +7494,20 @@ static void K_drawKartMinimap(void)
continue;
}
K_drawKartMinimapHead(players[i].mo, x, y, splitflags, AutomapPic);
if (players[i].mo->skin)
skin = ((skin_t*)players[i].mo->skin)-skins;
else
skin = 0;
if (players[i].mo->color)
{
if (players[i].mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, players[i].mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, players[i].mo->color, GTC_CACHE);
}
else
colormap = NULL;
K_drawKartMinimapHead(players[i].mo->x, players[i].mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
}
}
@ -7490,7 +7516,20 @@ static void K_drawKartMinimap(void)
splitflags &= ~V_HUDTRANSHALF;
splitflags |= V_HUDTRANS;
K_drawKartMinimapHead(stplyr->mo, x, y, splitflags, AutomapPic);
if (stplyr->mo->skin)
skin = ((skin_t*)stplyr->mo->skin)-skins;
else
skin = 0;
if (stplyr->mo->color)
{
if (stplyr->mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, stplyr->mo->color, GTC_CACHE);
else
colormap = R_GetTranslationColormap(skin, stplyr->mo->color, GTC_CACHE);
}
else
colormap = NULL;
K_drawKartMinimapHead(stplyr->mo->x, stplyr->mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
}
static void K_drawKartStartCountdown(void)

View file

@ -6490,7 +6490,7 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool
switch(type)
{
case MT_OVERTIMEFOG:
P_SetScale(mo, 2*mo->scale);
P_SetScale(mo, 4*mo->scale);
mo->destscale = 8*mo->scale;
mo->momz = P_RandomRange(1,8)*mo->scale;
break;
@ -6499,6 +6499,8 @@ static void P_SpawnOvertimeParticles(fixed_t x, fixed_t y, mobjtype_t type, bool
mo->destscale = mo->scale/4;
if ((leveltime/2) & 1)
mo->frame++;
/*if (i == 0 && !((leveltime/2) % 3 == 0))
S_StartSoundAtVolume(mo, sfx_s1b1, 64);*/
break;
default:
break;
@ -6511,6 +6513,9 @@ void P_RunBattleOvertime(void)
{
UINT8 i, j;
/*if (!S_IdPlaying(sfx_s3kd4l)) // global ambience
S_StartSound(NULL, sfx_s3kd4l);*/
if (battleovertime->radius > 512)
battleovertime->radius--;
else
@ -6521,8 +6526,9 @@ void P_RunBattleOvertime(void)
for (i = 0; i < 16; i++) // 16 base orbs
{
angle_t ang = FixedAngle(((45*i) * (FRACUNIT>>1)) + ((leveltime % 360)<<FRACBITS));
fixed_t x = battleovertime->x + P_ReturnThrustX(NULL, ang, battleovertime->radius<<FRACBITS);
fixed_t y = battleovertime->y + P_ReturnThrustY(NULL, ang, battleovertime->radius<<FRACBITS);
fixed_t dist = (battleovertime->radius - (2*mobjinfo[MT_OVERTIMEORB].radius))<<FRACBITS;
fixed_t x = battleovertime->x + P_ReturnThrustX(NULL, ang, dist);
fixed_t y = battleovertime->y + P_ReturnThrustY(NULL, ang, dist);
P_SpawnOvertimeParticles(x, y, MT_OVERTIMEORB, true);
}
}
@ -6534,8 +6540,9 @@ void P_RunBattleOvertime(void)
{
fixed_t x = battleovertime->x + ((P_RandomRange(-64,64) * 128)<<FRACBITS);
fixed_t y = battleovertime->y + ((P_RandomRange(-64,64) * 128)<<FRACBITS);
fixed_t closestdist = (battleovertime->radius + (4*mobjinfo[MT_OVERTIMEFOG].radius))<<FRACBITS;
j++;
if (P_AproxDistance(x-battleovertime->x, y-battleovertime->y) <= (battleovertime->radius<<FRACBITS))
if (P_AproxDistance(x-battleovertime->x, y-battleovertime->y) < closestdist)
continue;
P_SpawnOvertimeParticles(x, y, MT_OVERTIMEFOG, false);
break;
@ -9246,6 +9253,18 @@ void P_MobjThinker(mobj_t *mobj)
trail->color = mobj->color;
}
break;
case MT_RANDOMITEM:
if (G_BattleGametype() && mobj->threshold == 70)
{
mobj->color = (1 + (leveltime % (MAXSKINCOLORS-1)));
mobj->colorized = true;
}
else
{
mobj->color = SKINCOLOR_NONE;
mobj->colorized = false;
}
break;
//}
case MT_TURRET:
P_MobjCheckWater(mobj);
@ -9525,6 +9544,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
else
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type);
P_SpawnMobj(newmobj->x, newmobj->y, newmobj->z, MT_EXPLODE); // poof into existance
// Transfer flags2 (strongbox, objectflip)
newmobj->flags2 = mobj->flags2 & ~MF2_DONTDRAW;
if (mobj->threshold == 70)