diff --git a/source/core/namedef_custom.h b/source/core/namedef_custom.h index 007149db0..667ff40aa 100644 --- a/source/core/namedef_custom.h +++ b/source/core/namedef_custom.h @@ -15,3 +15,4 @@ xx(AltHud) xx(DukeMasterSwitch) xx(DukeTouchplate) xx(DukeSoundController) +xx(DukeRespawnController) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 239cc7488..c252584c3 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -531,34 +531,25 @@ void movefx(void) { DukeStatIterator iti(STAT_FX); while (auto act = iti.Next()) + CallTick(act); +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + +void operaterespawns(int low) +{ + DukeStatIterator it(STAT_FX); + while (auto act = it.Next()) { - switch (act->spr.picnum) - { - default: - CallTick(act); - break; - - case RESPAWN: - if (act->spr.extra == 66) - { - auto j = spawn(act, act->spr.hitag); - if (isRRRA() && j) - { - respawn_rrra(act, j); - } - else - { - deletesprite(act); - } - } - else if (act->spr.extra > (66 - 13)) - act->spr.extra++; - break; - - } + CallOnRespawn(act, low); } } + //--------------------------------------------------------------------------- // // diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 0c0a070a3..36db7f01c 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3265,10 +3265,10 @@ void respawnhitag_d(DDukeActor* actor) case PODFEM1: case NAKED1: case STATUE: - if (actor->spr.yint) fi.operaterespawns(actor->spr.yint); + if (actor->spr.yint) operaterespawns(actor->spr.yint); break; default: - if (actor->spr.hitag >= 0) fi.operaterespawns(actor->spr.hitag); + if (actor->spr.hitag >= 0) operaterespawns(actor->spr.hitag); break; } } diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 53fd875df..b5b7ec80a 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -568,53 +568,6 @@ int ifhitbyweapon_r(DDukeActor *actor) // //--------------------------------------------------------------------------- -void respawn_rrra(DDukeActor* oldact, DDukeActor* newact) -{ - newact->spr.pal = oldact->spr.pal; - if (newact->spr.picnum == MAMA) - { - if (newact->spr.pal == 30) - { - newact->spr.scale = DVector2(0.40625, 0.40625); - newact->clipdist = 18.75; - } - else if (newact->spr.pal == 31) - { - newact->spr.scale = DVector2(0.5625, 0.5625); - newact->clipdist = 25; - } - else if (newact->spr.pal == 32) - { - newact->spr.scale = DVector2(0.78125, 0.78125); - newact->clipdist = 25; - } - else - { - newact->spr.scale = DVector2(0.78125, 0.78125); - newact->clipdist = 25; - } - } - - if (newact->spr.pal == 8) - { - newact->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT; - } - - if (newact->spr.pal != 6) - { - deletesprite(oldact); - return; - } - oldact->spr.extra = (66 - 13); - newact->spr.pal = 0; -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void movefallers_r(void) { DukeStatIterator it(STAT_FALLER); @@ -1746,20 +1699,10 @@ static void rrra_specialstats() } } - it.Reset(119); + it.Reset(STAT_RABBITSPAWN); while (auto act = it.Next()) { - if (act->spr.hitag > 0) - { - if (act->spr.extra == 0) - { - act->spr.hitag--; - act->spr.extra = 150; - spawn(act, RABBIT); - } - else - act->spr.extra--; - } + CallTick(act); } it.Reset(116); while (auto act = it.Next()) @@ -3795,10 +3738,10 @@ void respawnhitag_r(DDukeActor *actor) case FEM10: case NAKED1: case STATUE: - if (actor->spr.yint) fi.operaterespawns(actor->spr.yint); + if (actor->spr.yint) operaterespawns(actor->spr.yint); break; default: - if (actor->spr.hitag >= 0) fi.operaterespawns(actor->spr.hitag); + if (actor->spr.hitag >= 0) operaterespawns(actor->spr.hitag); break; } } diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index 6bb2ace63..aeccb2a3e 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -274,6 +274,7 @@ enum STAT_DESTRUCT = 100, STAT_BOWLING = 105, + STAT_RABBITSPAWN = 119, STAT_REMOVED = MAXSTATUS-2, STAT_NETALLOC = MAXSTATUS-1 }; diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index 3571fbac2..dc26dd2e9 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -39,8 +39,6 @@ bool isadoorwall_d(int dapic); bool isadoorwall_r(int dapic); void animatewalls_d(void); void animatewalls_r(void); -void operaterespawns_d(int low); -void operaterespawns_r(int low); void operateforcefields_r(DDukeActor* act, int low); void operateforcefields_d(DDukeActor* act, int low); bool checkhitswitch_d(int snum, walltype* w, DDukeActor *act); @@ -114,7 +112,6 @@ void SetDispatcher() initactorflags_d, isadoorwall_d, animatewalls_d, - operaterespawns_d, operateforcefields_d, checkhitswitch_d, activatebysector_d, @@ -157,7 +154,6 @@ void SetDispatcher() initactorflags_r, isadoorwall_r, animatewalls_r, - operaterespawns_r, operateforcefields_r, checkhitswitch_r, activatebysector_r, diff --git a/source/games/duke/src/duke3d.h b/source/games/duke/src/duke3d.h index 698f28760..6bcf9337a 100644 --- a/source/games/duke/src/duke3d.h +++ b/source/games/duke/src/duke3d.h @@ -73,7 +73,6 @@ struct Dispatcher void (*initactorflags)(); bool (*isadoorwall)(int dapic); void (*animatewalls)(); - void (*operaterespawns)(int low); void (*operateforcefields)(DDukeActor* act, int low); bool (*checkhitswitch)(int snum, walltype* w, DDukeActor* act); void (*activatebysector)(sectortype* sect, DDukeActor* j); @@ -122,6 +121,7 @@ void CallAction(DDukeActor* actor); void CallOnHit(DDukeActor* actor, DDukeActor* hitter); void CallOnHurt(DDukeActor* actor, player_struct* hitter); bool CallOnUse(DDukeActor* actor, player_struct* user); +void CallOnRespawn(DDukeActor* actor, int low); bool CallAnimate(DDukeActor* actor, tspritetype* hitter); diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 9bce831b4..4ba4ad3aa 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -26,6 +26,7 @@ void resetlanepics(void); void moveplayers(); void doanimations(); void movefx(); +void operaterespawns(int low); void moveclouds(double interpfrac); void movefta(); @@ -85,7 +86,6 @@ void handle_se35(DDukeActor* i, int SMALLSMOKE, int EXPLOSION2); void handle_se128(DDukeActor* i); void handle_se130(DDukeActor* i, int countmax, int EXPLOSION2); -void respawn_rrra(DDukeActor* oldact, DDukeActor* newact); void check_fta_sounds_d(DDukeActor* i); void check_fta_sounds_r(DDukeActor* i); diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index 5f239fdbc..b14908416 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -458,6 +458,15 @@ bool CallOnUse(DDukeActor* actor, player_struct* user) return nval; } +void CallOnRespawn(DDukeActor* actor, int low) +{ + IFVIRTUALPTR(actor, DDukeActor, onRespawn) + { + VMValue val[2] = { actor, low }; + VMCall(func, val, 2, nullptr, 0); + } +} + bool CallAnimate(DDukeActor* actor, tspritetype* tspr) { int nval = false; diff --git a/source/games/duke/src/inlines.h b/source/games/duke/src/inlines.h index 6eb37ee70..dc9fc2d64 100644 --- a/source/games/duke/src/inlines.h +++ b/source/games/duke/src/inlines.h @@ -24,6 +24,11 @@ inline int issoundcontroller(DDukeActor* actor) return actor->GetClass()->TypeName == NAME_DukeSoundController; } +inline int isrespawncontroller(DDukeActor* actor) +{ + return actor->GetClass()->TypeName == NAME_DukeRespawnController; +} + inline int badguypic(int const tileNum) { return ((gs.actorinfo[tileNum].flags & (SFLAG_INTERNAL_BADGUY | SFLAG_BADGUY)) != 0); diff --git a/source/games/duke/src/namelist_r.h b/source/games/duke/src/namelist_r.h index 77bf9c5a0..b39342762 100644 --- a/source/games/duke/src/namelist_r.h +++ b/source/games/duke/src/namelist_r.h @@ -1103,7 +1103,7 @@ y(RRTILE7213, 7213) y(RRTILE7219, 7219) x(EMPTYBIKE, 7220) x(EMPTYBOAT, 7233) -y(RRTILE7424, 7424) +y(RABBITSPAWNER, 7424) y(RRTILE7430, 7430) y(RRTILE7433, 7433) y(RRTILE7441, 7441) diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 5c1d6cea6..8b4d1a941 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -394,7 +394,7 @@ void dokneeattack(int snum, const std::initializer_list & respawnlist) if (isIn(p->actorsqu->spr.picnum, respawnlist)) { if (p->actorsqu->spr.yint) - fi.operaterespawns(p->actorsqu->spr.yint); + operaterespawns(p->actorsqu->spr.yint); } if (p->actorsqu->isPlayer()) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 19adba421..448308a93 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -51,7 +51,6 @@ void premapcontroller(DDukeActor* ac) case ACTIVATORLOCKED: case LOCATORS: case MUSICANDSFX: - case RESPAWN: case SECTOREFFECTOR: ac->spr.cstat &= ~(CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN | CSTAT_SPRITE_ALIGNMENT_MASK); break; diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index 6307d0633..5f0796e79 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -1187,7 +1187,7 @@ void operateactivators(int low, player_struct* plr) } } - fi.operaterespawns(low); + operaterespawns(low); } //--------------------------------------------------------------------------- diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index c4ba5cb4a..17cab1eaf 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -186,34 +186,6 @@ void animatewalls_d(void) // //--------------------------------------------------------------------------- -void operaterespawns_d(int low) -{ - DukeStatIterator it(STAT_FX); - while (auto act = it.Next()) - { - if (act->spr.lotag == low) switch (act->spr.picnum) - { - case RESPAWN: - if (badguypic(act->spr.hitag) && ud.monsters_off) break; - - auto star = spawn(act, TRANSPORTERSTAR); - if (star) - { - star->spr.pos.Z -= 32; - - act->spr.extra = 66 - 12; // Just a way to killit - } - break; - } - } -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void operateforcefields_d(DDukeActor* act, int low) { operateforcefields_common(act, low, { W_FORCEFIELD, W_FORCEFIELD + 1, W_FORCEFIELD + 2, BIGFORCE }); diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index d8f6c771f..deb5d587f 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -301,38 +301,6 @@ void animatewalls_r(void) // //--------------------------------------------------------------------------- -void operaterespawns_r(int low) -{ - DukeStatIterator it(STAT_FX); - while (auto act = it.Next()) - { - if (act->spr.lotag == low) switch (act->spr.picnum) - { - case RESPAWN: - { - if (badguypic(act->spr.hitag) && ud.monsters_off) break; - - auto star = spawn(act, TRANSPORTERSTAR); - if (star) star->spr.pos.Z -= 32; - - act->spr.extra = 66 - 12; // Just a way to killit - break; - } - case RRTILE7424: - if (isRRRA() && !ud.monsters_off) - ChangeActorStat(act, 119); - break; - - } - } -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - void operateforcefields_r(DDukeActor* act, int low) { operateforcefields_common(act, low, { BIGFORCE }); diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index 59e7cdd60..4be711f55 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -63,7 +63,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* case BOSS5: if (act->spr.picnum != FIREFLY) { - if (actj && actj->spr.picnum == RESPAWN) + if (actj && isrespawncontroller(actj)) act->spr.pal = actj->spr.pal; if (act->spr.pal != 0) { @@ -710,7 +710,7 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* if (bossguy(act)) { - if (actj && actj->spr.picnum == RESPAWN) + if (actj && isrespawncontroller(actj)) act->spr.pal = actj->spr.pal; if (act->spr.pal && (!isWorldTour() || !(currentLevel->flags & LEVEL_WT_BOSSSPAWN) || act->spr.pal != 22)) { diff --git a/source/games/duke/src/spawn_r.cpp b/source/games/duke/src/spawn_r.cpp index 374b370e1..17d6c0f11 100644 --- a/source/games/duke/src/spawn_r.cpp +++ b/source/games/duke/src/spawn_r.cpp @@ -93,12 +93,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.hitag = 0; ChangeActorStat(act, 117); break; - case RRTILE7424: - if (!isRRRA()) goto default_case; - act->spr.extra = 0; - act->spr.scale = DVector2(0, 0); - ChangeActorStat(act, STAT_FX); - break; case RRTILE7936: if (!isRRRA()) goto default_case; act->spr.scale = DVector2(0, 0); @@ -569,17 +563,6 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* case SHOTGUNSHELL: initshell(actj, act, act->spr.picnum == SHELL); break; - case RESPAWN: - act->spr.extra = 66 - 13; - if (ud.multimode < 2 && act->spr.pal == 1) - { - act->spr.scale = DVector2(0, 0); - ChangeActorStat(act, STAT_MISC); - break; - } - act->spr.cstat = CSTAT_SPRITE_INVISIBLE; - ChangeActorStat(act, STAT_FX); - break; case SOUNDFX: { act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; @@ -829,6 +812,9 @@ DDukeActor* spawninit_r(DDukeActor* actj, DDukeActor* act, TArray* act->spr.pos.Z += krandf(8) - 4; break; case MAMA: + if (actj && isrespawncontroller(actj)) + act->spr.pal = actj->spr.pal; + if (act->spr.pal == 30) { act->spr.scale = DVector2(0.40625, 0.40625); diff --git a/source/games/duke/src/vmexports.cpp b/source/games/duke/src/vmexports.cpp index af212a8d6..d936d4ec8 100644 --- a/source/games/duke/src/vmexports.cpp +++ b/source/games/duke/src/vmexports.cpp @@ -114,6 +114,13 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Duke, GetSoundFlags, S_GetUserFlags) ACTION_RETURN_INT(S_GetUserFlags(snd)); } +DEFINE_ACTION_FUNCTION_NATIVE(_Duke, badguyID, badguypic) +{ + PARAM_PROLOGUE; + PARAM_INT(p); + ACTION_RETURN_INT(badguypic(p)); +} + DEFINE_GLOBAL_UNSIZED(dlevel) DEFINE_GLOBAL(camsprite) @@ -261,15 +268,23 @@ DDukeActor* DukeActor_Spawn(DDukeActor* origin, int intname) { picnum = TileFiles.tileForName("BURNIMG"); } - if (FName(ENamedName(intname)) == FName("DukeBloodPool")) + else if (FName(ENamedName(intname)) == FName("DukeBloodPool")) { picnum = TileFiles.tileForName("BLOODPOOL"); } - if (FName(ENamedName(intname)) == FName("DukeExplosion2")) + else if (FName(ENamedName(intname)) == FName("DukeExplosion2")) { picnum = TileFiles.tileForName("EXPLOSION2"); } - + else if (FName(ENamedName(intname)) == FName("DukeTransporterStar")) + { + picnum = TileFiles.tileForName("TRANSPORTERSTAR"); + } + else if (FName(ENamedName(intname)) == FName("RedneckRabbit")) + { + picnum = TileFiles.tileForName("RABBIT"); + } + if (picnum == -1) { diff --git a/wadsrc/static/filter/duke/engine/engine.def b/wadsrc/static/filter/duke/engine/engine.def index 97fbd892e..582038888 100644 --- a/wadsrc/static/filter/duke/engine/engine.def +++ b/wadsrc/static/filter/duke/engine/engine.def @@ -3,6 +3,7 @@ spawnclasses 3 = DukeTouchplate 5 = DukeSoundController 8 = DukeMasterSwitch + 9 = DukeRespawnController 1221 = DukeCranePole 1222 = DukeCrane diff --git a/wadsrc/static/filter/redneck.ridesagain/engine/engine.def b/wadsrc/static/filter/redneck.ridesagain/engine/engine.def new file mode 100644 index 000000000..cff689dbe --- /dev/null +++ b/wadsrc/static/filter/redneck.ridesagain/engine/engine.def @@ -0,0 +1,4 @@ +spawnclasses +{ + 7424 = RedneckRabbitSpawner +} diff --git a/wadsrc/static/filter/redneck/engine/engine.def b/wadsrc/static/filter/redneck/engine/engine.def index 6d83591b8..4a6b5da24 100644 --- a/wadsrc/static/filter/redneck/engine/engine.def +++ b/wadsrc/static/filter/redneck/engine/engine.def @@ -3,6 +3,7 @@ spawnclasses 3 = DukeTouchplate 5 = DukeSoundController 8 = DukeMasterSwitch + 9 = DukeRespawnController 1298 = DukeCranePole 1299 = DukeCrane diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 97fc45717..3601c46e0 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -53,6 +53,7 @@ version "4.10" #include "zscript/games/duke/actors/masterswitch.zs" #include "zscript/games/duke/actors/touchplate.zs" #include "zscript/games/duke/actors/soundcontroller.zs" +#include "zscript/games/duke/actors/respawncontroller.zs" #include "zscript/games/duke/actors/crane.zs" #include "zscript/games/duke/actors/waterfountain.zs" #include "zscript/games/duke/actors/flammables.zs" @@ -69,6 +70,8 @@ version "4.10" #include "zscript/games/duke/actors/viewscreen.zs" #include "zscript/games/duke/actors/canwithsomething.zs" +#include "zscript/games/duke/actors/rabbitspawner.zs" + #include "zscript/games/blood/bloodgame.zs" #include "zscript/games/blood/ui/menu.zs" #include "zscript/games/blood/ui/sbar.zs" diff --git a/wadsrc/static/zscript/games/duke/actors/rabbitspawner.zs b/wadsrc/static/zscript/games/duke/actors/rabbitspawner.zs new file mode 100644 index 000000000..75a7bb28f --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/rabbitspawner.zs @@ -0,0 +1,43 @@ +class RedneckRabbitSpawner : DukeActor +{ + default + { + statnum STAT_FX; + extra 0; + } + + override void Initialize() + { + self.cstat = CSTAT_SPRITE_INVISIBLE; + } + + override void Tick() + { + if (self.statnum == STAT_RABBITSPAWN) + { + if (self.hitag > 0) + { + if (self.extra == 0) + { + self.hitag--; + self.extra = 150; + self.spawn("RedneckRabbit"); + } + else + self.extra--; + } + } + } + + override void onRespawn(int low) + { + if (self.lotag == low) + { + if (!ud.monsters_off) + self.ChangeStat(STAT_RABBITSPAWN); + } + } +} + + + diff --git a/wadsrc/static/zscript/games/duke/actors/respawncontroller.zs b/wadsrc/static/zscript/games/duke/actors/respawncontroller.zs new file mode 100644 index 000000000..3b7f138fa --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/respawncontroller.zs @@ -0,0 +1,67 @@ +class DukeRespawnController : DukeActor +{ + default + { + statnum STAT_FX; + extra 66 - 13; + } + + override void Initialize() + { + if (ud.multimode < 2 && self.pal == 1) + { + self.scale = (0, 0); + self.ChangeStat(STAT_MISC); + } + else + self.cstat = CSTAT_SPRITE_INVISIBLE; + } + + override void Tick() + { + if (self.extra == 66) + { + let newact = self.spawnsprite(self.hitag); + if (Raze.isRRRA() && newact) + { + newact.pal = self.pal; + + // RRRA's ghost monsters. + if (newact.pal == 8) + { + newact.cstat |= CSTAT_SPRITE_TRANSLUCENT; + } + + if (newact.pal != 6) + { + self.Destroy(); + return; + } + self.extra = (66 - 13); + newact.pal = 0; + } + else + { + self.Destroy(); + } + } + else if (self.extra > (66 - 13)) + self.extra++; + } + + override void onRespawn(int low) + { + if (self.lotag == low) + { + if (Duke.badguyID(self.hitag) && ud.monsters_off) return; + + let star = self.spawn("DukeTransporterStar"); + if (star) + { + star.pos.Z -= 32; + } + self.extra = 66 - 12; // Trigger the spawn countdown + } + } +} + diff --git a/wadsrc/static/zscript/games/duke/actors/soundcontroller.zs b/wadsrc/static/zscript/games/duke/actors/soundcontroller.zs index 154c17dd9..b3f7fa6fd 100644 --- a/wadsrc/static/zscript/games/duke/actors/soundcontroller.zs +++ b/wadsrc/static/zscript/games/duke/actors/soundcontroller.zs @@ -81,6 +81,7 @@ class DukeSoundController : DukeActor override void OnDestroy() { + Super.OnDestroy(); if (self.temp_data[0] == 1) self.StopSound(self.lotag); } diff --git a/wadsrc/static/zscript/games/duke/actors/touchplate.zs b/wadsrc/static/zscript/games/duke/actors/touchplate.zs index 20004aca2..567c5467f 100644 --- a/wadsrc/static/zscript/games/duke/actors/touchplate.zs +++ b/wadsrc/static/zscript/games/duke/actors/touchplate.zs @@ -93,7 +93,6 @@ class DukeTouchPlate : DukeActor { if (self.temp_data[0] == 0 && !dlevel.check_activator_motion(self.lotag)) { - Console.Printf("Trigger %d", self.spawnindex); self.temp_data[0] = 1; self.temp_data[1] = 1; self.temp_data[3] = !self.temp_data[3]; diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index 2b906f37b..0faf593ad 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -102,6 +102,7 @@ class DukeActor : CoreActor native STAT_DESTRUCT = 100, STAT_BOWLING = 105, + STAT_RABBITSPAWN = 119, STAT_REMOVED = MAXSTATUS-2, @@ -172,6 +173,7 @@ class DukeActor : CoreActor native virtual void onHit(DukeActor hitter) { checkhitdefault(hitter); } virtual void onHurt(DukePlayer p) {} virtual bool onUse(DukePlayer user) { return false; } + virtual void onRespawn(int tag) { } virtual bool animate(tspritetype tspr) { return false; } virtual void RunState() {} // this is the CON function. diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index 82b09cb4b..5a67ee740 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -100,6 +100,7 @@ struct Duke native native static int floorflags(sectortype s); native static int global_random(); native static int GetSoundFlags(int sound); + native static int badguyID(int id); static void PlayBonusMusic() {