diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index c41b05039..b6e8f3f1e 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -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; diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index ccd3d005c..716a06ecd 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -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; diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index ccf34f783..b04fdddd5 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -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, diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index f8861e285..962744fa2 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -66,64 +66,12 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* 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* 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; } diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index aa64d4476..70efad0de 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -80,36 +80,11 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* 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* 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: diff --git a/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses b/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses index cdeb70971..c51496ed3 100644 --- a/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/duke.worldtour/rmapinfo.spawnclasses @@ -18,5 +18,6 @@ spawnclasses 5135 = DukeFlamethrowerAmmo 5143 = DukeOnFire 5152 = DukeOnFireSmoke - + 5268 = DukeWhispySmoke + 5846 = DukeSeriousSam } diff --git a/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses b/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses index 259ca2f5f..a473dcbd1 100644 --- a/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses @@ -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 diff --git a/wadsrc/static/filter/redneck/rmapinfo.spawnclasses b/wadsrc/static/filter/redneck/rmapinfo.spawnclasses index edcf78b69..a079987d0 100644 --- a/wadsrc/static/filter/redneck/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/redneck/rmapinfo.spawnclasses @@ -287,6 +287,10 @@ spawnclasses 1554 = DukeSmallSmoke 1327 = DukeSteam 3437 = RedneckBowlingBallSprite + 241 = DukeWaterBubbleMaker + 1391 = RedneckBlood + 3998 = RedneckPlayerLyingDead + 4861 = RedneckHen 4862 = RedneckHenStayput diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index b33b717fd..b4053fbfb 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -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" diff --git a/wadsrc/static/zscript/games/duke/actors/dukedecos.zs b/wadsrc/static/zscript/games/duke/actors/dukedecos.zs index 4f957800f..0b772b74f 100644 --- a/wadsrc/static/zscript/games/duke/actors/dukedecos.zs +++ b/wadsrc/static/zscript/games/duke/actors/dukedecos.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); + } +} + diff --git a/wadsrc/static/zscript/games/duke/actors/player.zs b/wadsrc/static/zscript/games/duke/actors/player.zs new file mode 100644 index 000000000..995dd2210 --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/player.zs @@ -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; + } +}