mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-18 07:22:03 +00:00
Maintenence
- Fix merge issues - Update invincibility flash to use its own object instead of MT_OVERLAY, so extra hacks don't need baked into overlay thinking - K_SpawnSparkleTrail can accept mobjs now, since there really wasn't any reason it needed a player. - Comment out a few old MK/vanilla SRB2 effects for now
This commit is contained in:
parent
07a18e5185
commit
a554763128
9 changed files with 82 additions and 46 deletions
|
@ -7106,6 +7106,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
|||
|
||||
"MT_SNEAKERTRAIL",
|
||||
"MT_SPARKLETRAIL",
|
||||
"MT_INVULNFLASH",
|
||||
"MT_DRIFT",
|
||||
"MT_DRIFTDUST",
|
||||
|
||||
|
|
29
src/info.c
29
src/info.c
|
@ -14324,7 +14324,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
{ // MT_SPARKLETRAIL
|
||||
-1, // doomednum
|
||||
S_KARTINVULN_SMALL1, // spawnstate
|
||||
1, // spawnhealth
|
||||
1000, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
8, // reactiontime
|
||||
|
@ -14348,6 +14348,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_INVULNFLASH
|
||||
-1, // doomednum
|
||||
S_INVULNFLASH1, // 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
|
||||
8*FRACUNIT, // radius
|
||||
8*FRACUNIT, // height
|
||||
0, // display offset
|
||||
100, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
{ // MT_DRIFT
|
||||
-1, // doomednum
|
||||
S_DRIFTSPARK1, // spawnstate
|
||||
|
|
|
@ -3965,6 +3965,7 @@ typedef enum mobj_type
|
|||
|
||||
MT_SNEAKERTRAIL,
|
||||
MT_SPARKLETRAIL,
|
||||
MT_INVULNFLASH,
|
||||
MT_DRIFT,
|
||||
MT_DRIFTDUST,
|
||||
|
||||
|
|
36
src/k_kart.c
36
src/k_kart.c
|
@ -1011,7 +1011,7 @@ void K_LakituChecker(player_t *player)
|
|||
{
|
||||
ticcmd_t *cmd = &player->cmd;
|
||||
|
||||
if (player->kartstuff[k_lakitu] == 44)
|
||||
/*if (player->kartstuff[k_lakitu] == 44)
|
||||
{
|
||||
mobj_t *mo;
|
||||
angle_t newangle;
|
||||
|
@ -1033,7 +1033,7 @@ void K_LakituChecker(player_t *player)
|
|||
mo->angle = newangle+ANGLE_180;
|
||||
P_SetTarget(&mo->target, player->mo);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if (player->kartstuff[k_lakitu] > 3)
|
||||
{
|
||||
|
@ -1873,34 +1873,32 @@ void K_SpawnBoostTrail(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
void K_SpawnSparkleTrail(player_t *player)
|
||||
void K_SpawnSparkleTrail(mobj_t *mo)
|
||||
{
|
||||
const INT32 rad = (player->mo->radius*2)>>FRACBITS;
|
||||
fixed_t newx, newy, newz;
|
||||
const INT32 rad = (mo->radius*2)>>FRACBITS;
|
||||
mobj_t *sparkle;
|
||||
INT32 i;
|
||||
|
||||
I_Assert(player != NULL);
|
||||
I_Assert(player->mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(player->mo));
|
||||
I_Assert(mo != NULL);
|
||||
I_Assert(!P_MobjWasRemoved(mo));
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
newx = player->mo->x + player->mo->momx + (P_RandomRange(-rad, rad)<<FRACBITS);
|
||||
newy = player->mo->y + player->mo->momy + (P_RandomRange(-rad, rad)<<FRACBITS);
|
||||
newz = player->mo->z + player->mo->momz + (P_RandomRange(0, player->mo->height>>FRACBITS)<<FRACBITS);
|
||||
fixed_t newx = mo->x + mo->momx + (P_RandomRange(-rad, rad)<<FRACBITS);
|
||||
fixed_t newy = mo->y + mo->momy + (P_RandomRange(-rad, rad)<<FRACBITS);
|
||||
fixed_t newz = mo->z + mo->momz + (P_RandomRange(0, mo->height>>FRACBITS)<<FRACBITS);
|
||||
|
||||
sparkle = P_SpawnMobj(newx, newy, newz, MT_SPARKLETRAIL);
|
||||
|
||||
if (i == 0)
|
||||
P_SetMobjState(sparkle, S_KARTINVULN_LARGE1);
|
||||
|
||||
P_SetTarget(&sparkle->target, player->mo);
|
||||
sparkle->destscale = player->mo->destscale;
|
||||
P_SetScale(sparkle, player->mo->scale);
|
||||
sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP);
|
||||
sparkle->color = player->mo->color;
|
||||
//sparkle->colorized = player->mo->colorized;
|
||||
P_SetTarget(&sparkle->target, mo);
|
||||
sparkle->destscale = mo->destscale;
|
||||
P_SetScale(sparkle, mo->scale);
|
||||
sparkle->eflags = (sparkle->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP);
|
||||
sparkle->color = mo->color;
|
||||
//sparkle->colorized = mo->colorized;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2932,9 +2930,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
S_StartSound(player->mo, sfx_kinvnc);
|
||||
if (!player->kartstuff[k_invincibilitytimer])
|
||||
{
|
||||
mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_OVERLAY);
|
||||
mobj_t *overlay = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INVULNFLASH);
|
||||
P_SetTarget(&overlay->target, player->mo);
|
||||
P_SetMobjState(overlay, S_INVULNFLASH1);
|
||||
overlay->destscale = player->mo->scale;
|
||||
P_SetScale(overlay, player->mo->scale);
|
||||
}
|
||||
|
@ -3244,7 +3241,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
player->kartstuff[k_itemamount]--;
|
||||
|
||||
K_PlayTauntSound(player->mo);
|
||||
player->kartstuff[k_sounds] = 50;
|
||||
}
|
||||
break;
|
||||
case KITEM_GROW:
|
||||
|
|
|
@ -30,8 +30,8 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force);
|
|||
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
|
||||
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
|
||||
void K_SpawnBoostTrail(player_t *player);
|
||||
void K_SpawnSparkleTrail(mobj_t *mo);
|
||||
void K_DriftDustHandling(mobj_t *spawner);
|
||||
void K_SpawnSparkleTrail(player_t *player);
|
||||
void K_DoSneaker(player_t *player, boolean doPFlag);
|
||||
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed);
|
||||
boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y);
|
||||
|
|
|
@ -2090,6 +2090,16 @@ static int lib_kSpawnBoostTrail(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_kSpawnSparkleTrail(lua_State *L)
|
||||
{
|
||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
NOHUD
|
||||
if (!mo)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
K_SpawnSparkleTrail(mo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_kDriftDustHandling(lua_State *L)
|
||||
{
|
||||
mobj_t *spawner = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
|
@ -2100,16 +2110,6 @@ static int lib_kDriftDustHandling(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int lib_kSpawnSparkleTrail(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
NOHUD
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
K_SpawnDriftTrail(player);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lib_kDoSneaker(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
|
@ -2355,8 +2355,8 @@ static luaL_Reg lib[] = {
|
|||
{"K_StealBalloon",lib_kStealBalloon},
|
||||
{"K_SpawnKartExplosion",lib_kSpawnKartExplosion},
|
||||
{"K_SpawnBoostTrail",lib_kSpawnBoostTrail},
|
||||
{"K_DriftDustHandling",lib_kDriftDustHandling},
|
||||
{"K_SpawnSparkleTrail",lib_kSpawnSparkleTrail},
|
||||
{"K_DriftDustHandling",lib_kDriftDustHandling},
|
||||
{"K_DoSneaker",lib_kDoSneaker},
|
||||
{"K_DoPogoSpring",lib_kDoPogoSpring},
|
||||
{"K_MomentumToFacing",lib_kMomentumToFacing},
|
||||
|
|
|
@ -3105,7 +3105,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
|
||||
player->kartstuff[k_sneakertimer] = 0;
|
||||
|
||||
// Size Down
|
||||
// Shrink
|
||||
if (damage == 64)
|
||||
{
|
||||
if (player == source->player)
|
||||
|
@ -3126,7 +3126,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
player->kartstuff[k_growshrinktimer] = 2;
|
||||
}
|
||||
// Invincible or not, we still need this.
|
||||
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING);
|
||||
//P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_LIGHTNING);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
26
src/p_mobj.c
26
src/p_mobj.c
|
@ -8122,6 +8122,23 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
S_StartSound(mobj, sfx_prloop);
|
||||
mobj->health--;
|
||||
break;
|
||||
case MT_SPARKLETRAIL:
|
||||
if (!mobj->target)
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
mobj->color = mobj->target->color;
|
||||
mobj->colorized = mobj->target->colorized;
|
||||
break;
|
||||
case MT_INVULNFLASH:
|
||||
if (!mobj->target || (mobj->target->player && !mobj->target->player->kartstuff[k_invincibilitytimer]))
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
A_CapeChase(mobj);
|
||||
break;
|
||||
//}
|
||||
case MT_TURRET:
|
||||
P_MobjCheckWater(mobj);
|
||||
|
@ -8181,15 +8198,6 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
mobj->tracer->y, mobj->tracer->floorz, SPLATDRAWMODE_SHADE);
|
||||
#endif
|
||||
break;
|
||||
case MT_SPARKLETRAIL:
|
||||
if (!mobj->target)
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
mobj->color = mobj->target->color;
|
||||
mobj->colorized = mobj->target->colorized;
|
||||
break;
|
||||
case MT_SPINFIRE:
|
||||
case MT_SNEAKERTRAIL:
|
||||
if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
|
|
|
@ -2304,12 +2304,12 @@ static void P_CheckInvincibilityTimer(player_t *player)
|
|||
|
||||
//if (mariomode && !player->powers[pw_super]) // SRB2kart
|
||||
player->mo->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
if (leveltime % (TICRATE/7) == 0)
|
||||
/*if (leveltime % (TICRATE/7) == 0)
|
||||
{
|
||||
mobj_t *sparkle = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_IVSP);
|
||||
sparkle->destscale = player->mo->scale;
|
||||
P_SetScale(sparkle, player->mo->scale);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Resume normal music stuff.
|
||||
if (player->powers[pw_invulnerability] == 1 || player->kartstuff[k_invincibilitytimer] == 1)
|
||||
|
@ -6925,6 +6925,9 @@ static void P_MovePlayer(player_t *player)
|
|||
if (player->kartstuff[k_sneakertimer] > 0 && onground && (leveltime & 1))
|
||||
K_SpawnBoostTrail(player);
|
||||
|
||||
if (player->kartstuff[k_invincibilitytimer] > 0)
|
||||
K_SpawnSparkleTrail(player->mo);
|
||||
|
||||
K_DriftDustHandling(player->mo);
|
||||
|
||||
/* // SRB2kart - nadah
|
||||
|
|
Loading…
Reference in a new issue