mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-27 06:22:13 +00:00
- exported most of the remaining content in spawn_d.cpp
This commit is contained in:
parent
8b04f42ab5
commit
3106c8e6f5
11 changed files with 191 additions and 105 deletions
|
@ -123,9 +123,6 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
switch (h->spr.picnum)
|
||||
{
|
||||
case DTILE_DUKELYINGDEAD:
|
||||
t->pos.Z += 24;
|
||||
break;
|
||||
case DTILE_GROWSPARK:
|
||||
t->picnum = DTILE_GROWSPARK + ((PlayClock >> 4) & 3);
|
||||
break;
|
||||
|
|
|
@ -121,11 +121,6 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
|
||||
switch (h->spr.picnum)
|
||||
{
|
||||
case RTILE_DUKELYINGDEAD:
|
||||
h->spr.scale = DVector2(0.375, 0.265625);
|
||||
if (h->spr.extra > 0)
|
||||
t->pos.Z += 6;
|
||||
break;
|
||||
case RTILE_CRYSTALAMMO:
|
||||
t->shade = int(BobVal(PlayClock << 4) * 16);
|
||||
break;
|
||||
|
|
|
@ -147,6 +147,7 @@ void initactorflags_r()
|
|||
RTILE_SHOTSPARK1,
|
||||
RTILE_BURNING,
|
||||
RTILE_WATERBUBBLE,
|
||||
RTILE_WATERBUBBLEMAKER,
|
||||
RTILE_SMALLSMOKE,
|
||||
RTILE_EXPLOSION2,
|
||||
RTILE_EXPLOSION3,
|
||||
|
@ -183,7 +184,6 @@ void initactorflags_r()
|
|||
setflag(SFLAG2_FREEZEDAMAGE | SFLAG2_REFLECTIVE, { RTILE_FREEZEBLAST });
|
||||
setflag(SFLAG2_FLOATING, { RTILE_DRONE });
|
||||
setflag(SFLAG3_BLOODY, { RTILE_BLOODPOOL });
|
||||
setflag(SFLAG3_BROWNBLOOD, { RTILE_FECES });
|
||||
|
||||
setflag(SFLAG2_NOFLOORPAL, {
|
||||
RTILE_RESPAWNMARKERRED,
|
||||
|
|
|
@ -66,64 +66,12 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
auto sectp = act->sector();
|
||||
|
||||
|
||||
if (isWorldTour())
|
||||
{
|
||||
switch (act->spr.picnum)
|
||||
{
|
||||
case DTILE_WHISPYSMOKE:
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
act->spr.pos.X += krandf(16) - 8;
|
||||
act->spr.pos.Y += krandf(16) - 8;
|
||||
act->spr.scale = DVector2(0.3125, 0.3125);
|
||||
return act;
|
||||
case DTILE_SERIOUSSAM:
|
||||
ChangeActorStat(act, STAT_ZOMBIEACTOR);
|
||||
act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
act->spr.extra = 150;
|
||||
return act;
|
||||
}
|
||||
}
|
||||
|
||||
switch (act->spr.picnum)
|
||||
{
|
||||
default:
|
||||
if (!badguy(act) || commonEnemySetup(act, actj))
|
||||
CallInitialize(act);
|
||||
break;
|
||||
case DTILE_BLOOD:
|
||||
act->spr.scale = DVector2(0.25, 0.25);
|
||||
act->spr.pos.Z -= 26;
|
||||
if (actj && actj->spr.pal == 6)
|
||||
act->spr.pal = 6;
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
case DTILE_FECES:
|
||||
if (actj)
|
||||
act->spr.scale = DVector2(REPEAT_SCALE, REPEAT_SCALE);
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
|
||||
case DTILE_DUKELYINGDEAD:
|
||||
if (actj && actj->isPlayer())
|
||||
{
|
||||
act->spr.scale = actj->spr.scale;
|
||||
act->spr.shade = actj->spr.shade;
|
||||
act->spr.pal = ps[actj->PlayerIndex()].palookup;
|
||||
}
|
||||
act->spr.cstat = 0;
|
||||
act->spr.extra = 1;
|
||||
act->vel.X = 292 / 16.;
|
||||
act->vel.Z = 360 / 256.;
|
||||
[[fallthrough]];
|
||||
case DTILE_BLIMP:
|
||||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
act->clipdist = 32;
|
||||
[[fallthrough]];
|
||||
case DTILE_MIKE:
|
||||
if (act->spr.picnum == DTILE_MIKE)
|
||||
act->spr.yint = act->spr.hitag;
|
||||
ChangeActorStat(act, 1);
|
||||
break;
|
||||
case DTILE_PLAYERONWATER:
|
||||
if (actj)
|
||||
{
|
||||
|
@ -147,20 +95,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_PLAYER);
|
||||
break;
|
||||
}
|
||||
case DTILE_WATERDRIPSPLASH: // ok
|
||||
act->spr.scale = DVector2(0.375, 0.375);
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
|
||||
case DTILE_WATERBUBBLEMAKER:
|
||||
if (act->spr.hitag && act->spr.picnum == DTILE_WATERBUBBLEMAKER)
|
||||
{ // JBF 20030913: Pisses off move(), eg. in bobsp2
|
||||
Printf(TEXTCOLOR_YELLOW "WARNING: DTILE_WATERBUBBLEMAKER %d @ %d,%d with hitag!=0. Applying fixup.\n", act->GetIndex(), int(act->spr.pos.X), int(act->spr.pos.Y));
|
||||
act->spr.hitag = 0;
|
||||
}
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
}
|
||||
return act;
|
||||
}
|
||||
|
|
|
@ -80,36 +80,11 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
pistonsound = 1;
|
||||
break;
|
||||
|
||||
case RTILE_BLOOD:
|
||||
act->spr.scale = DVector2(0.0625, 0.0625);
|
||||
act->spr.pos.Z -= 26;
|
||||
ChangeActorStat(act, STAT_MISC);
|
||||
break;
|
||||
case RTILE_GRATE1:
|
||||
act->clipdist = 8;
|
||||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
ChangeActorStat(act, 0);
|
||||
break;
|
||||
case RTILE_DUKELYINGDEAD:
|
||||
if (actj && actj->isPlayer())
|
||||
{
|
||||
act->spr.scale = actj->spr.scale;
|
||||
act->spr.shade = actj->spr.shade;
|
||||
act->spr.pal = ps[actj->PlayerIndex()].palookup;
|
||||
}
|
||||
act->spr.cstat = 0;
|
||||
act->spr.extra = 1;
|
||||
act->vel.X = 292 / 16.;
|
||||
act->vel.Z = 360 / 256.;
|
||||
act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
act->clipdist = 32;
|
||||
[[fallthrough]];
|
||||
case RTILE_MIKE:
|
||||
if (act->spr.picnum == RTILE_MIKE)
|
||||
act->spr.yint = act->spr.hitag;
|
||||
ChangeActorStat(act, STAT_ACTOR);
|
||||
break;
|
||||
|
||||
case RTILE_EXPLOSION3:
|
||||
if (actj)
|
||||
{
|
||||
|
@ -159,10 +134,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray<DDukeActor*>*
|
|||
ChangeActorStat(act, STAT_PLAYER);
|
||||
break;
|
||||
}
|
||||
case RTILE_WATERBUBBLEMAKER:
|
||||
act->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
ChangeActorStat(act, STAT_STANDABLE);
|
||||
break;
|
||||
|
||||
// this is not really nice...
|
||||
case RTILE_BIKERB:
|
||||
|
|
|
@ -18,5 +18,6 @@ spawnclasses
|
|||
5135 = DukeFlamethrowerAmmo
|
||||
5143 = DukeOnFire
|
||||
5152 = DukeOnFireSmoke
|
||||
|
||||
5268 = DukeWhispySmoke
|
||||
5846 = DukeSeriousSam
|
||||
}
|
||||
|
|
|
@ -246,6 +246,13 @@ spawnclasses
|
|||
2311 = DukeFire2
|
||||
1890 = DukeExplosion2
|
||||
2219 = DukeExplosion2Bot
|
||||
2380 = DukeWaterdripSplash
|
||||
662 = DukeWaterBubbleMaker
|
||||
2200 = DukeFeces
|
||||
1620 = DukeBlood
|
||||
3400 = DukeBlimp
|
||||
762 = DukeMike
|
||||
1518 = DukePlayerLyingDead
|
||||
|
||||
46 = DukeCrystalAmmo
|
||||
55 = DukeSteroids
|
||||
|
|
|
@ -287,6 +287,10 @@ spawnclasses
|
|||
1554 = DukeSmallSmoke
|
||||
1327 = DukeSteam
|
||||
3437 = RedneckBowlingBallSprite
|
||||
241 = DukeWaterBubbleMaker
|
||||
1391 = RedneckBlood
|
||||
3998 = RedneckPlayerLyingDead
|
||||
|
||||
|
||||
4861 = RedneckHen
|
||||
4862 = RedneckHenStayput
|
||||
|
|
|
@ -110,6 +110,7 @@ version "4.10"
|
|||
#include "zscript/games/duke/actors/smallsmoke.zs"
|
||||
#include "zscript/games/duke/actors/steam.zs"
|
||||
#include "zscript/games/duke/actors/dukedecos.zs"
|
||||
#include "zscript/games/duke/actors/player.zs"
|
||||
|
||||
#include "zscript/games/duke/actors/dukeitems.zs"
|
||||
#include "zscript/games/duke/actors/batteryammo.zs"
|
||||
|
|
|
@ -80,3 +80,137 @@ class DukeRubberCan : DukeExplodingBarrel
|
|||
self.extra = 0;
|
||||
}
|
||||
}
|
||||
|
||||
class DukeWaterdripSplash : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "WATERDRIPSPLASH";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.scale = (0.375, 0.375);
|
||||
self.ChangeStat(STAT_STANDABLE);
|
||||
}
|
||||
}
|
||||
|
||||
class DukeWaterbubbleMaker : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "WATERBUBBLEMAKER";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.hitag = 0;
|
||||
self.cstat |= CSTAT_SPRITE_INVISIBLE;
|
||||
self.ChangeStat(STAT_STANDABLE);
|
||||
}
|
||||
}
|
||||
|
||||
class DukeFeces : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "FECES";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
if (!mapSpawned)
|
||||
self.scale = (REPEAT_SCALE, REPEAT_SCALE);
|
||||
self.ChangeStat(STAT_MISC);
|
||||
}
|
||||
}
|
||||
|
||||
class DukeBlood : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "Blood";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.pos.Z -= 26;
|
||||
if (!mapSpawned && self.ownerActor && self.ownerActor.pal == 6)
|
||||
self.pal = 6;
|
||||
self.scale = (0.25, 0.25);
|
||||
self.ChangeStat(STAT_MISC);
|
||||
}
|
||||
}
|
||||
|
||||
class RedneckBlood : DukeBlood
|
||||
{
|
||||
override void Initialize()
|
||||
{
|
||||
Super.Initialize();
|
||||
self.scale = (0.0625, 0.0625);
|
||||
self.pos.Z -= 26;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class DukeBlimp : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "BLIMP";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
self.clipdist = 32;
|
||||
self.ChangeStat(STAT_ACTOR);
|
||||
}
|
||||
}
|
||||
|
||||
class DukeMike : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "MIKE";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.yint = self.hitag;
|
||||
self.ChangeStat(STAT_ACTOR);
|
||||
}
|
||||
}
|
||||
|
||||
class DukeWhispySmoke : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "WHISPYSMOKE";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.pos.X += frandom(-8, 8);
|
||||
self.pos.Y += frandom(-8, 8);
|
||||
self.scale = (0.3125, 0.3125);
|
||||
self.ChangeStat(STAT_MISC);
|
||||
}
|
||||
}
|
||||
|
||||
class DukeSeriousSam : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "SERIOSSAM";
|
||||
statnum STAT_ZOMBIEACTOR;
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
||||
self.extra = 150;
|
||||
self.ChangeStat(STAT_ZOMBIEACTOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
42
wadsrc/static/zscript/games/duke/actors/player.zs
Normal file
42
wadsrc/static/zscript/games/duke/actors/player.zs
Normal file
|
@ -0,0 +1,42 @@
|
|||
|
||||
class DukePlayerLyingDead : DukeActor
|
||||
{
|
||||
default
|
||||
{
|
||||
pic "DUKELYINGDEAD";
|
||||
}
|
||||
|
||||
override void Initialize()
|
||||
{
|
||||
let owner = self.ownerActor;
|
||||
if (owner && owner.isPlayer())
|
||||
{
|
||||
self.scale = owner.scale;
|
||||
self.shade = owner.shade;
|
||||
self.pal = owner.GetPlayer().palookup;
|
||||
}
|
||||
self.vel.X = 292 / 16.;
|
||||
self.vel.Z = 360 / 256.;
|
||||
self.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
||||
self.extra = 1;
|
||||
self.clipdist = 32;
|
||||
self.ChangeStat(STAT_ACTOR);
|
||||
}
|
||||
|
||||
override bool animate(tspritetype t)
|
||||
{
|
||||
t.pos.Z += 24;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class RedneckPlayerLyingDead : DukeActor
|
||||
{
|
||||
override bool animate(tspritetype t)
|
||||
{
|
||||
t.scale = (0.375, 0.265625);
|
||||
if (self.extra > 0)
|
||||
t.pos.Z += 6;
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue