From b4dcf8ddcf3cdf4e4d953c9b9037e9aeb1ec5ffb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 Dec 2022 15:28:03 +0100 Subject: [PATCH] - exported the remaining Duke enemies. --- source/games/duke/src/actors.cpp | 6 +- source/games/duke/src/actors_d.cpp | 28 --------- source/games/duke/src/funct.h | 2 - source/games/duke/src/spawn_d.cpp | 53 ---------------- .../filter/dukelike/rmapinfo.spawnclasses | 11 ++++ wadsrc/static/zscript.txt | 3 + .../zscript/games/duke/actors/commander.zs | 26 ++++++++ .../static/zscript/games/duke/actors/mech.zs | 60 +++++++++++++++++++ .../zscript/games/duke/actors/octabrain.zs | 26 ++++++++ 9 files changed, 127 insertions(+), 88 deletions(-) create mode 100644 wadsrc/static/zscript/games/duke/actors/commander.zs create mode 100644 wadsrc/static/zscript/games/duke/actors/mech.zs create mode 100644 wadsrc/static/zscript/games/duke/actors/octabrain.zs diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index cec1f8429..b6e571447 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -3316,11 +3316,7 @@ void movefta(void) auto check_fta_sounds = [](DDukeActor* act) { - if (act->GetClass() == RUNTIME_CLASS(DDukeActor)) - { - if (!isRR()) check_fta_sounds_d(act); - } - else if (act->spr.extra > 0) + if (act->spr.extra > 0) CallPlayFTASound(act); }; diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index d02a47c02..5d99b0d1c 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -44,34 +44,6 @@ This file contains parts of DukeGDX by Alexander Makarov-[M210] (m210-2007@mail. BEGIN_DUKE_NS -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - -void check_fta_sounds_d(DDukeActor* actor) -{ - if (actor->spr.extra > 0) switch (actor->spr.picnum) - { - case DTILE_DRONE: - S_PlayActorSound(DRON_RECOG, actor); - break; - case DTILE_COMMANDER: - case DTILE_COMMANDERSTAYPUT: - S_PlayActorSound(COMM_RECOG, actor); - break; - case DTILE_ORGANTIC: - S_PlayActorSound(TURR_RECOG, actor); - break; - case DTILE_OCTABRAIN: - case DTILE_OCTABRAINSTAYPUT: - S_PlayActorSound(OCTA_RECOG, actor); - break; - } -} - - //--------------------------------------------------------------------------- // // diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 0e241e848..477552251 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -79,8 +79,6 @@ void handle_se35(DDukeActor* i); void handle_se128(DDukeActor* i); void handle_se130(DDukeActor* i, int countmax); -void check_fta_sounds_d(DDukeActor* i); - int dodge(DDukeActor*); void alterang(int ang, DDukeActor* actor, int g_p); void fall_common(DDukeActor* actor, int g_p, int JIBS6, int DRONE, int BLOODPOOL, int SHOTSPARK1, int squished, int thud, int(*fallspecial)(DDukeActor*, int)); diff --git a/source/games/duke/src/spawn_d.cpp b/source/games/duke/src/spawn_d.cpp index c9b7ff940..aaec5213e 100644 --- a/source/games/duke/src/spawn_d.cpp +++ b/source/games/duke/src/spawn_d.cpp @@ -189,59 +189,6 @@ DDukeActor* spawninit_d(DDukeActor* actj, DDukeActor* act, TArray* act->spr.cstat |= CSTAT_SPRITE_INVISIBLE; ChangeActorStat(act, STAT_STANDABLE); break; - case DTILE_OCTABRAINSTAYPUT: - case DTILE_COMMANDERSTAYPUT: - act->actorstayput = act->sector(); - [[fallthrough]]; - case DTILE_ROTATEGUN: - case DTILE_DRONE: - case DTILE_OCTABRAIN: - case DTILE_COMMANDER: - case DTILE_ORGANTIC: - case DTILE_SHARK: - - if (act->spr.picnum != DTILE_SHARK) - { - act->spr.scale = DVector2(0.625, 0.625); - act->clipdist = 20; - } - else - { - act->spr.scale = DVector2(0.9375, 0.9375); - act->clipdist = 10; - } - - if (actj) act->spr.lotag = 0; - - if ((act->spr.lotag > ud.player_skill) || ud.monsters_off == 1) - { - act->spr.scale = DVector2(0, 0); - ChangeActorStat(act, STAT_MISC); - break; - } - else - { - makeitfall(act); - - act->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; - - if (act->spr.picnum == DTILE_ORGANTIC) act->spr.cstat |= CSTAT_SPRITE_YCENTER; - - if (actj) - { - act->timetosleep = 0; - check_fta_sounds_d(act); - ChangeActorStat(act, STAT_ACTOR); - } - else ChangeActorStat(act, STAT_ZOMBIEACTOR); - } - - if (act->spr.picnum == DTILE_ROTATEGUN) - act->vel.Z = 0; - - break; - - case DTILE_FLOORFLAME: act->spr.shade = -127; ChangeActorStat(act, STAT_STANDABLE); diff --git a/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses b/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses index e2c47d9d5..e4eb68358 100644 --- a/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses +++ b/wadsrc/static/filter/dukelike/rmapinfo.spawnclasses @@ -325,4 +325,15 @@ spawnclasses 1741 = DukeLiztrooperToilet 1742 = DukeLiztrooperSitting 1744 = DukeLiztrooperDucking + + 1820 = DukeOctabrain + 1821 = DukeOctabrainStayput + 1920 = DukeCommander + 1921 = DukeCommanderStayput + + 1550 = DukeShark + 1880 = DukeDrone + 2420 = DukeTurret + 2360 = DukeRotateGun + } diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 1261078dd..81ce3af1e 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -117,6 +117,9 @@ version "4.10" #include "zscript/games/duke/actors/pigcop.zs" #include "zscript/games/duke/actors/liztroop.zs" #include "zscript/games/duke/actors/lizman.zs" +#include "zscript/games/duke/actors/octabrain.zs" +#include "zscript/games/duke/actors/commander.zs" +#include "zscript/games/duke/actors/mech.zs" #include "zscript/games/duke/actors/boss1.zs" #include "zscript/games/duke/actors/boss2.zs" #include "zscript/games/duke/actors/boss3.zs" diff --git a/wadsrc/static/zscript/games/duke/actors/commander.zs b/wadsrc/static/zscript/games/duke/actors/commander.zs new file mode 100644 index 000000000..a9beda5a3 --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/commander.zs @@ -0,0 +1,26 @@ +class DukeCommander : DukeActor +{ + default + { + pic "COMMANDER"; + } + + override void PlayFTASound() + { + self.PlayActorSound("COMM_RECOG"); + } +} + +class DukeCommanderStayput: DukeCommander +{ + default + { + pic "COMMANDERSTAYPUT"; + } + + override void initialize() + { + super.initialize(); + self.actorstayput = self.sector; // make this a flag once everything has been exported. + } +} diff --git a/wadsrc/static/zscript/games/duke/actors/mech.zs b/wadsrc/static/zscript/games/duke/actors/mech.zs new file mode 100644 index 000000000..15fffad98 --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/mech.zs @@ -0,0 +1,60 @@ +class DukeDrone : DukeActor +{ + default + { + pic "DRONE"; + } + + override void PlayFTASound() + { + self.PlayActorSound("DRON_RECOG"); + } +} + +class DukeTurret : DukeActor +{ + default + { + pic "ORGANTIC"; + } + + override void PlayFTASound() + { + self.PlayActorSound("TURR_RECOG"); + } + + override void Initialize() + { + self.cstat |= CSTAT_SPRITE_YCENTER; + } +} + +class DukeRotateGun : DukeActor +{ + default + { + pic "ROTATEGUN"; + } + + override void Initialize() + { + self.vel.Z = 0; + } +} + +class DukeShark : DukeActor +{ + default + { + pic "SHARK"; + } + + override void Initialize() + { + // override some defaults. + self.scale = (0.9375, 0.9375); + self.clipdist = 10; + } +} + + diff --git a/wadsrc/static/zscript/games/duke/actors/octabrain.zs b/wadsrc/static/zscript/games/duke/actors/octabrain.zs new file mode 100644 index 000000000..05db5c9a8 --- /dev/null +++ b/wadsrc/static/zscript/games/duke/actors/octabrain.zs @@ -0,0 +1,26 @@ +class DukeOctabrain : DukeActor +{ + default + { + pic "OCTABRAIN"; + } + + override void PlayFTASound() + { + self.PlayActorSound("OCTA_RECOG"); + } +} + +class DukeOctabrainStayput: DukeOctabrain +{ + default + { + pic "OCTABRAINSTAYPUT"; + } + + override void initialize() + { + super.initialize(); + self.actorstayput = self.sector; // make this a flag once everything has been exported. + } +}