mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-14 16:40:52 +00:00
- scriptified PlayerOnWater.
This commit is contained in:
parent
3106c8e6f5
commit
ce00183707
14 changed files with 28 additions and 63 deletions
|
@ -47,6 +47,7 @@ xx(DukePaper)
|
|||
xx(RedneckFeather)
|
||||
xx(DukeSteamBase)
|
||||
xx(RedneckFire)
|
||||
xx(DukePlayerOnWater)
|
||||
|
||||
xx(spawnstate)
|
||||
xx(brokenstate)
|
||||
|
|
|
@ -277,28 +277,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
case DTILE_CHAINGUN:
|
||||
t->shade = -127;
|
||||
break;
|
||||
case DTILE_PLAYERONWATER:
|
||||
if (hw_models && modelManager.CheckModel(h->spr.picnum, h->spr.pal))
|
||||
{
|
||||
k = 0;
|
||||
t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
else
|
||||
{
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
t->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
|
||||
t->picnum = h->spr.picnum + k + ((h->temp_data[0] < 4) * 5);
|
||||
if (OwnerAc) t->shade = OwnerAc->spr.shade;
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
h->dispicnum = t->picnum;
|
||||
|
|
|
@ -354,19 +354,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
t->shade = -127;
|
||||
t->picnum = RTILE_RRTILE2944 + ((PlayClock >> 2) & 4);
|
||||
break;
|
||||
case RTILE_PLAYERONWATER:
|
||||
|
||||
k = angletorotation1(t->Angles.Yaw, viewang);
|
||||
if (k > 4)
|
||||
{
|
||||
k = 8 - k;
|
||||
t->cstat |= CSTAT_SPRITE_XFLIP;
|
||||
}
|
||||
else t->cstat &= ~CSTAT_SPRITE_XFLIP;
|
||||
|
||||
t->picnum = h->spr.picnum + k + ((h->temp_data[0] < 4) * 5);
|
||||
if (OwnerAc) t->shade = OwnerAc->spr.shade;
|
||||
break;
|
||||
}
|
||||
|
||||
h->dispicnum = t->picnum;
|
||||
|
|
|
@ -160,7 +160,7 @@ void initactorflags_d()
|
|||
setflag(SFLAG2_DONTANIMATE, { DTILE_TRIPBOMB, DTILE_LASERLINE });
|
||||
//setflag(SFLAG2_INTERPOLATEANGLE, { DTILE_BEARINGPLATE });
|
||||
setflag(SFLAG2_GREENBLOOD, { DTILE_OOZFILTER, DTILE_NEWBEAST, DTILE_NUKEBARREL });
|
||||
setflag(SFLAG2_ALWAYSROTATE1, { DTILE_RAT, DTILE_CAMERA1, DTILE_CHAIR3 });
|
||||
setflag(SFLAG2_ALWAYSROTATE1, { DTILE_RAT, DTILE_CAMERA1, DTILE_CHAIR3, DTILE_PLAYERONWATER });
|
||||
setflag(SFLAG2_ALWAYSROTATE2, { DTILE_RPG });
|
||||
setflag(SFLAG2_DIENOW, { DTILE_RADIUSEXPLOSION, DTILE_KNEE });
|
||||
setflag(SFLAG2_TRANFERPALTOJIBS, { DTILE_LIZTROOP });
|
||||
|
|
|
@ -177,7 +177,7 @@ void initactorflags_r()
|
|||
if (isRRRA()) setflag(SFLAG2_BREAKMIRRORS, { RTILE_RPG2 });
|
||||
setflag(SFLAG2_CAMERA, { RTILE_CAMERA1 });
|
||||
setflag(SFLAG2_GREENBLOOD, { RTILE_OOZFILTER });
|
||||
setflag(SFLAG2_ALWAYSROTATE1, { RTILE_RAT, RTILE_CAMERA1, RTILE_CHAIR3 });
|
||||
setflag(SFLAG2_ALWAYSROTATE1, { RTILE_RAT, RTILE_CAMERA1, RTILE_CHAIR3, RTILE_PLAYERONWATER });
|
||||
setflag(SFLAG2_ALWAYSROTATE2, { RTILE_RPG });
|
||||
setflag(SFLAG2_DIENOW, { RTILE_RADIUSEXPLOSION });
|
||||
setflag(SFLAG2_NORADIUSPUSH, { RTILE_HULK });
|
||||
|
|
|
@ -1630,7 +1630,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
if (p->on_ground == 1)
|
||||
{
|
||||
if (p->dummyplayersprite == nullptr)
|
||||
p->dummyplayersprite = spawn(pact, DTILE_PLAYERONWATER);
|
||||
p->dummyplayersprite = spawn(pact, PClass::FindActor(NAME_DukePlayerOnWater));
|
||||
|
||||
p->footprintcount = 6;
|
||||
if (tilesurface(p->cursector->floortexture) == TSURF_SLIME)
|
||||
|
|
|
@ -1898,7 +1898,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
if (p->on_ground == 1)
|
||||
{
|
||||
if (p->dummyplayersprite == nullptr)
|
||||
p->dummyplayersprite = spawn(pact, RTILE_PLAYERONWATER);
|
||||
p->dummyplayersprite = spawn(pact, PClass::FindActor(NAME_DukePlayerOnWater));
|
||||
|
||||
p->footprintcount = 6;
|
||||
if (tilesurface(p->cursector->floortexture) == TSURF_SLIME)
|
||||
|
|
|
@ -281,7 +281,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
|||
}
|
||||
|
||||
|
||||
if (targ->spr.picnum == DTILE_PLAYERONWATER)
|
||||
if (targ->IsKindOf(NAME_DukePlayerOnWater))
|
||||
{
|
||||
targ = targ->GetOwner();
|
||||
if (!targ) return;
|
||||
|
|
|
@ -256,7 +256,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
|||
break;
|
||||
}
|
||||
|
||||
if (targ->spr.picnum == RTILE_PLAYERONWATER)
|
||||
if (targ->IsKindOf(NAME_DukePlayerOnWater))
|
||||
{
|
||||
targ = targ->GetOwner();
|
||||
if (!targ) return;
|
||||
|
|
|
@ -72,17 +72,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
if (!badguy(act) || commonEnemySetup(act, actj))
|
||||
CallInitialize(act);
|
||||
break;
|
||||
case DTILE_PLAYERONWATER:
|
||||
if (actj)
|
||||
{
|
||||
act->spr.scale = actj->spr.scale;
|
||||
act->vel.Z = 0.5;
|
||||
if (act->sector()->lotag != 2)
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
ChangeActorStat(act, STAT_DUMMYPLAYER);
|
||||
break;
|
||||
|
||||
case DTILE_APLAYER:
|
||||
{
|
||||
act->spr.scale = DVector2(0, 0);
|
||||
|
|
|
@ -111,17 +111,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
|
||||
break;
|
||||
|
||||
case RTILE_PLAYERONWATER:
|
||||
if (actj)
|
||||
{
|
||||
act->spr.scale = actj->spr.scale;
|
||||
act->vel.Z = 0.5;
|
||||
if (act->sector()->lotag != 2)
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
ChangeActorStat(act, STAT_DUMMYPLAYER);
|
||||
break;
|
||||
|
||||
case RTILE_APLAYER:
|
||||
{
|
||||
act->spr.scale = DVector2(0, 0);
|
||||
|
|
|
@ -253,6 +253,7 @@ spawnclasses
|
|||
3400 = DukeBlimp
|
||||
762 = DukeMike
|
||||
1518 = DukePlayerLyingDead
|
||||
1420 = DukePlayerOnWater
|
||||
|
||||
46 = DukeCrystalAmmo
|
||||
55 = DukeSteroids
|
||||
|
|
|
@ -290,6 +290,7 @@ spawnclasses
|
|||
241 = DukeWaterBubbleMaker
|
||||
1391 = RedneckBlood
|
||||
3998 = RedneckPlayerLyingDead
|
||||
3860 = DukePlayerOnWater
|
||||
|
||||
|
||||
4861 = RedneckHen
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
class DukePlayerOnWater : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "PLAYERONWATER";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (!mapSpawned && self.ownerActor)
|
||||
{
|
||||
self.scale = self.ownerActor.scale;
|
||||
self.vel.Z = 0.5;
|
||||
if (self.sector.lotag != ST_2_UNDERWATER)
|
||||
self.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
}
|
||||
self.ChangeStat(STAT_DUMMYPLAYER);
|
||||
}
|
||||
}
|
||||
|
||||
class DukePlayerLyingDead : DukeActor
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue