Karma fireworks

Additionally:
- FZ boom no longer has that weird smoke bit before it spawns the smoke column
- Item blinking color is brighter
This commit is contained in:
TehRealSalt 2018-11-26 02:17:14 -05:00
parent b68a58d5b2
commit b5bf8e09c3
6 changed files with 165 additions and 98 deletions

View file

@ -7092,6 +7092,12 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_LIZARDMAN",
"S_LIONMAN",
"S_KARMAFIREWORK1",
"S_KARMAFIREWORK2",
"S_KARMAFIREWORK3",
"S_KARMAFIREWORK4",
"S_KARMAFIREWORKTRAIL",
#ifdef SEENAMES
"S_NAMECHECK",
#endif
@ -7877,6 +7883,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_LIZARDMAN",
"MT_LIONMAN",
"MT_KARMAFIREWORK",
#ifdef SEENAMES
"MT_NAMECHECK",
#endif

View file

@ -68,8 +68,8 @@ char sprnames[NUMSPRITES + 1][5] =
"FROG","CBRA","HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB",
"CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH",
"MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT",
"OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","XMS4",
"XMS5","VIEW"
"OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK",
"XMS4","XMS5","VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -3388,6 +3388,12 @@ state_t states[NUMSTATES] =
{SPR_WBLZ, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LIZARDMAN
{SPR_WBLN, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LIONMAN
{SPR_FWRK, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_KARMAFIREWORK2}, // S_KARMAFIREWORK1
{SPR_FWRK, 1|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_KARMAFIREWORK3}, // S_KARMAFIREWORK2
{SPR_FWRK, 2|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_KARMAFIREWORK4}, // S_KARMAFIREWORK3
{SPR_FWRK, 3|FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_KARMAFIREWORK1}, // S_KARMAFIREWORK4
{SPR_FWRK, 4|FF_FULLBRIGHT, TICRATE, {NULL}, 0, 0, S_NULL}, // S_KARMAFIREWORKTRAIL
#ifdef SEENAMES
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK
#endif
@ -20019,6 +20025,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_KARMAFIREWORK
-1, // doomednum
S_KARMAFIREWORK1, // 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
0, // speed
8<<FRACBITS, // radius
16<<FRACBITS, // height
1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOCLIPTHING|MF_BOUNCE|MF_GRENADEBOUNCE, // flags
S_NULL // raisestate
},
// ============================================================================================================================//
#ifdef SEENAMES

View file

@ -774,6 +774,8 @@ typedef enum sprite
SPR_WBLZ,
SPR_WBLN,
SPR_FWRK,
// Xmas-specific sprites that don't fit aboxe
SPR_XMS4,
SPR_XMS5,
@ -4044,6 +4046,12 @@ typedef enum state
S_LIZARDMAN,
S_LIONMAN,
S_KARMAFIREWORK1,
S_KARMAFIREWORK2,
S_KARMAFIREWORK3,
S_KARMAFIREWORK4,
S_KARMAFIREWORKTRAIL,
#ifdef SEENAMES
S_NAMECHECK,
#endif
@ -4846,6 +4854,8 @@ typedef enum mobj_type
MT_LIZARDMAN,
MT_LIONMAN,
MT_KARMAFIREWORK,
#ifdef SEENAMES
MT_NAMECHECK,
#endif

View file

@ -337,7 +337,7 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
if (skinnum == TC_ALLWHITE)
dest_colormap[i] = 0;
else if (skinnum == TC_BLINK)
dest_colormap[i] = colortranslations[color][7];
dest_colormap[i] = colortranslations[color][3];
else
dest_colormap[i] = (UINT8)i;
}

View file

@ -497,9 +497,18 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
}
else if (special->target->player->kartstuff[k_comebackmode] == 1 && P_CanPickupItem(player, 1))
{
mobj_t *poof = P_SpawnMobj(tmthing->x, tmthing->y, tmthing->z, MT_EXPLODE);
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
S_StartSound(poof, special->info->seesound);
// Karma fireworks
for (i = 0; i < 5; i++)
{
mobj_t *firework = P_SpawnMobj(special->x, special->y, special->z, MT_KARMAFIREWORK);
P_Thrust(firework, FixedAngle((72*i)<<FRACBITS), P_RandomRange(1,8)*special->scale);
P_SetObjectMomZ(firework, P_RandomRange(1,8)*special->scale, false);
firework->color = special->target->color;
}
special->target->player->kartstuff[k_comebackmode] = 0;
special->target->player->kartstuff[k_comebackpoints]++;

View file

@ -1413,6 +1413,9 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
case MT_SIGN:
gravityadd /= 8;
break;
case MT_KARMAFIREWORK:
gravityadd /= 3;
break;
default:
break;
}
@ -2523,7 +2526,7 @@ static boolean P_ZMovement(mobj_t *mo)
if (P_MobjFlip(mo)*mom.z < 0)
{
// If going slower than a fracunit, just stop.
if (abs(mom.z) < FixedMul(FRACUNIT, mo->scale))
if (abs(mom.z) < mo->scale)
{
mom.x = mom.y = mom.z = 0;
@ -8611,7 +8614,9 @@ void P_MobjThinker(mobj_t *mobj)
if (!S_SoundPlaying(mobj, mobj->info->attacksound))
S_StartSound(mobj, mobj->info->attacksound);
if (mobj->extravalue2 > 70) // fire + smoke pillar
if (mobj->extravalue2 <= 8) // Short delay
mobj->extravalue2++; // flametimer
else // fire + smoke pillar
{
UINT8 i;
mobj_t *fire = P_SpawnMobj(mobj->x + (P_RandomRange(-32, 32)*mobj->scale), mobj->y + (P_RandomRange(-32, 32)*mobj->scale), mobj->z, MT_THOK);
@ -8635,20 +8640,6 @@ void P_MobjThinker(mobj_t *mobj)
smoke->scalespeed = mobj->scale/24;
}
}
else
{
mobj->extravalue2++; // flametimer
if (mobj->extravalue2 > 8)
{
mobj_t *smoke = P_SpawnMobj(mobj->x + (P_RandomRange(-31, 31)*mobj->scale), mobj->y + (P_RandomRange(-31, 31)*mobj->scale),
mobj->z + (P_RandomRange(0, 48)*mobj->scale), MT_THOK);
P_SetMobjState(smoke, S_FZEROSMOKE1);
smoke->tics += P_RandomRange(-3, 4);
smoke->scale = mobj->scale*2;
}
}
break;
case MT_EZZPROPELLER:
if (mobj->hnext)
@ -9093,6 +9084,22 @@ void P_MobjThinker(mobj_t *mobj)
}
}
break;
case MT_KARMAFIREWORK:
if (mobj->momz == 0)
{
P_RemoveMobj(mobj);
return;
}
else
{
mobj_t *trail = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_THOK);
P_SetMobjState(trail, S_KARMAFIREWORKTRAIL);
P_SetScale(trail, mobj->scale);
trail->destscale = 1;
trail->scalespeed = mobj->scale/12;
trail->color = mobj->color;
}
break;
//}
case MT_TURRET:
P_MobjCheckWater(mobj);