mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 20:11:47 +00:00
Merge branch 'fix-water-run-jawz' into 'master'
Let Jawz, Orbinaut and Gachabom water ski See merge request KartKrew/Kart!1400
This commit is contained in:
commit
7f89bee3f2
4 changed files with 84 additions and 38 deletions
92
src/k_kart.c
92
src/k_kart.c
|
|
@ -2842,6 +2842,17 @@ boolean K_WaterRun(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
switch (mobj->type)
|
switch (mobj->type)
|
||||||
{
|
{
|
||||||
|
case MT_ORBINAUT:
|
||||||
|
case MT_GACHABOM:
|
||||||
|
{
|
||||||
|
if (Obj_OrbinautCanRunOnWater(mobj))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
case MT_JAWZ:
|
case MT_JAWZ:
|
||||||
{
|
{
|
||||||
if (mobj->tracer != NULL && P_MobjWasRemoved(mobj->tracer) == false)
|
if (mobj->tracer != NULL && P_MobjWasRemoved(mobj->tracer) == false)
|
||||||
|
|
@ -4775,6 +4786,50 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
|
||||||
th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT));
|
th->momy = FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT));
|
||||||
th->momz = source->momz;
|
th->momz = source->momz;
|
||||||
|
|
||||||
|
if (source->player != NULL)
|
||||||
|
{
|
||||||
|
th->cusval = source->player->itemscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case MT_ORBINAUT:
|
||||||
|
Obj_OrbinautThrown(th, finalspeed, dir);
|
||||||
|
break;
|
||||||
|
case MT_JAWZ:
|
||||||
|
Obj_JawzThrown(th, finalspeed, dir);
|
||||||
|
break;
|
||||||
|
case MT_SPB:
|
||||||
|
th->movefactor = finalspeed;
|
||||||
|
break;
|
||||||
|
case MT_BUBBLESHIELDTRAP:
|
||||||
|
P_SetScale(th, ((5*th->destscale)>>2)*4);
|
||||||
|
th->destscale = (5*th->destscale)>>2;
|
||||||
|
S_StartSound(th, sfx_s3kbfl);
|
||||||
|
S_StartSound(th, sfx_cdfm35);
|
||||||
|
break;
|
||||||
|
case MT_BALLHOG:
|
||||||
|
// Contra spread shot scale up
|
||||||
|
th->destscale = th->destscale << 1;
|
||||||
|
th->scalespeed = abs(th->destscale - th->scale) / (2*TICRATE);
|
||||||
|
break;
|
||||||
|
case MT_GARDENTOP:
|
||||||
|
th->movefactor = finalspeed;
|
||||||
|
break;
|
||||||
|
case MT_GACHABOM:
|
||||||
|
Obj_GachaBomThrown(th, finalspeed, dir);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// I'm calling P_SetOrigin to update the floorz if this
|
||||||
|
// object can run on water. However, P_CanRunOnWater
|
||||||
|
// requires that the object is already on the ground, so
|
||||||
|
// floorz needs to be set beforehand too.
|
||||||
|
th->floorz = source->floorz;
|
||||||
|
th->ceilingz = source->ceilingz;
|
||||||
|
|
||||||
// Get floorz and ceilingz
|
// Get floorz and ceilingz
|
||||||
P_SetOrigin(th, x, y, z);
|
P_SetOrigin(th, x, y, z);
|
||||||
|
|
||||||
|
|
@ -4823,43 +4878,6 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source->player != NULL)
|
|
||||||
{
|
|
||||||
th->cusval = source->player->itemscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case MT_ORBINAUT:
|
|
||||||
Obj_OrbinautThrown(th, finalspeed, dir);
|
|
||||||
break;
|
|
||||||
case MT_JAWZ:
|
|
||||||
Obj_JawzThrown(th, finalspeed, dir);
|
|
||||||
break;
|
|
||||||
case MT_SPB:
|
|
||||||
th->movefactor = finalspeed;
|
|
||||||
break;
|
|
||||||
case MT_BUBBLESHIELDTRAP:
|
|
||||||
P_SetScale(th, ((5*th->destscale)>>2)*4);
|
|
||||||
th->destscale = (5*th->destscale)>>2;
|
|
||||||
S_StartSound(th, sfx_s3kbfl);
|
|
||||||
S_StartSound(th, sfx_cdfm35);
|
|
||||||
break;
|
|
||||||
case MT_BALLHOG:
|
|
||||||
// Contra spread shot scale up
|
|
||||||
th->destscale = th->destscale << 1;
|
|
||||||
th->scalespeed = abs(th->destscale - th->scale) / (2*TICRATE);
|
|
||||||
break;
|
|
||||||
case MT_GARDENTOP:
|
|
||||||
th->movefactor = finalspeed;
|
|
||||||
break;
|
|
||||||
case MT_GACHABOM:
|
|
||||||
Obj_GachaBomThrown(th, finalspeed, dir);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type != MT_BUBBLESHIELDTRAP)
|
if (type != MT_BUBBLESHIELDTRAP)
|
||||||
{
|
{
|
||||||
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
|
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ void Obj_GachaBomThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir);
|
||||||
void Obj_OrbinautJawzMoveHeld(player_t *player);
|
void Obj_OrbinautJawzMoveHeld(player_t *player);
|
||||||
boolean Obj_GachaBomWasTossed(mobj_t *th);
|
boolean Obj_GachaBomWasTossed(mobj_t *th);
|
||||||
void Obj_OrbinautDrop(mobj_t *th);
|
void Obj_OrbinautDrop(mobj_t *th);
|
||||||
|
boolean Obj_OrbinautCanRunOnWater(mobj_t *th);
|
||||||
|
|
||||||
/* Jawz */
|
/* Jawz */
|
||||||
void Obj_JawzThink(mobj_t *th);
|
void Obj_JawzThink(mobj_t *th);
|
||||||
|
|
|
||||||
|
|
@ -255,12 +255,14 @@ void Obj_JawzThink(mobj_t *th)
|
||||||
void Obj_JawzThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir)
|
void Obj_JawzThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir)
|
||||||
{
|
{
|
||||||
INT32 lastTarg = -1;
|
INT32 lastTarg = -1;
|
||||||
|
player_t *owner = NULL;
|
||||||
|
|
||||||
if (jawz_owner(th) != NULL && P_MobjWasRemoved(jawz_owner(th)) == false
|
if (jawz_owner(th) != NULL && P_MobjWasRemoved(jawz_owner(th)) == false
|
||||||
&& jawz_owner(th)->player != NULL)
|
&& jawz_owner(th)->player != NULL)
|
||||||
{
|
{
|
||||||
lastTarg = jawz_owner(th)->player->lastjawztarget;
|
lastTarg = jawz_owner(th)->player->lastjawztarget;
|
||||||
jawz_retcolor(th) = jawz_owner(th)->player->skincolor;
|
jawz_retcolor(th) = jawz_owner(th)->player->skincolor;
|
||||||
|
owner = jawz_owner(th)->player;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -297,6 +299,14 @@ void Obj_JawzThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir)
|
||||||
P_SetTarget(&jawz_chase(th), tryPlayer->mo);
|
P_SetTarget(&jawz_chase(th), tryPlayer->mo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sealed Star: target the UFO immediately. I don't
|
||||||
|
// wanna fuck with the lastjawztarget stuff, so just
|
||||||
|
// do this if a target wasn't set.
|
||||||
|
if (jawz_chase(th) == NULL || P_MobjWasRemoved(jawz_chase(th)) == true)
|
||||||
|
{
|
||||||
|
P_SetTarget(&jawz_chase(th), K_FindJawzTarget(th, owner, ANGLE_90));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
S_StartSound(th, th->info->activesound);
|
S_StartSound(th, th->info->activesound);
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ enum {
|
||||||
ORBI_TOSSED = 0x02, // Gacha Bom tossed forward
|
ORBI_TOSSED = 0x02, // Gacha Bom tossed forward
|
||||||
ORBI_TRAIL = 0x04, // spawn afterimages
|
ORBI_TRAIL = 0x04, // spawn afterimages
|
||||||
ORBI_SPIN = 0x08, // animate facing angle
|
ORBI_SPIN = 0x08, // animate facing angle
|
||||||
|
ORBI_WATERSKI = 0x10, // this orbinaut can waterski
|
||||||
};
|
};
|
||||||
|
|
||||||
#define orbinaut_flags(o) ((o)->movedir)
|
#define orbinaut_flags(o) ((o)->movedir)
|
||||||
|
|
@ -303,10 +304,21 @@ boolean Obj_OrbinautJawzCollide(mobj_t *t1, mobj_t *t2)
|
||||||
|
|
||||||
void Obj_OrbinautThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir)
|
void Obj_OrbinautThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir)
|
||||||
{
|
{
|
||||||
|
orbinaut_flags(th) = 0;
|
||||||
|
|
||||||
if (orbinaut_owner(th) != NULL && P_MobjWasRemoved(orbinaut_owner(th)) == false
|
if (orbinaut_owner(th) != NULL && P_MobjWasRemoved(orbinaut_owner(th)) == false
|
||||||
&& orbinaut_owner(th)->player != NULL)
|
&& orbinaut_owner(th)->player != NULL)
|
||||||
{
|
{
|
||||||
th->color = orbinaut_owner(th)->player->skincolor;
|
th->color = orbinaut_owner(th)->player->skincolor;
|
||||||
|
|
||||||
|
const mobj_t *owner = orbinaut_owner(th);
|
||||||
|
const ffloor_t *rover = P_IsObjectFlipped(owner) ? owner->ceilingrover : owner->floorrover;
|
||||||
|
|
||||||
|
if (dir != -1 && rover && (rover->fofflags & FOF_SWIMMABLE))
|
||||||
|
{
|
||||||
|
// The owner can run on water, so we should too!
|
||||||
|
orbinaut_flags(th) |= ORBI_WATERSKI;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -316,7 +328,7 @@ void Obj_OrbinautThrown(mobj_t *th, fixed_t finalSpeed, SINT8 dir)
|
||||||
th->fuse = RR_PROJECTILE_FUSE;
|
th->fuse = RR_PROJECTILE_FUSE;
|
||||||
orbinaut_speed(th) = finalSpeed;
|
orbinaut_speed(th) = finalSpeed;
|
||||||
|
|
||||||
orbinaut_flags(th) = ORBI_TRAIL;
|
orbinaut_flags(th) |= ORBI_TRAIL;
|
||||||
|
|
||||||
if (dir == -1)
|
if (dir == -1)
|
||||||
{
|
{
|
||||||
|
|
@ -457,3 +469,8 @@ void Obj_OrbinautDrop(mobj_t *th)
|
||||||
{
|
{
|
||||||
orbinaut_flags(th) |= ORBI_DROPPED;
|
orbinaut_flags(th) |= ORBI_DROPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean Obj_OrbinautCanRunOnWater(mobj_t *th)
|
||||||
|
{
|
||||||
|
return (orbinaut_flags(th) & ORBI_WATERSKI) == ORBI_WATERSKI;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue