diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5164e84b6..395e72e2c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -844,7 +844,6 @@ set( NOT_COMPILED_SOURCE_FILES g_doom/a_painelemental.cpp g_doom/a_revenant.cpp g_doom/a_scriptedmarine.cpp - g_doom/a_spidermaster.cpp g_heretic/a_chicken.cpp g_heretic/a_dsparil.cpp g_heretic/a_hereticartifacts.cpp diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 4c8be07f1e..df42bfa7be 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -30,7 +30,6 @@ #include "a_lostsoul.cpp" #include "a_painelemental.cpp" #include "a_revenant.cpp" -#include "a_spidermaster.cpp" #include "a_scriptedmarine.cpp" // The barrel of green goop ------------------------------------------------ diff --git a/src/g_doom/a_spidermaster.cpp b/src/g_doom/a_spidermaster.cpp deleted file mode 100644 index 37d0deb184..0000000000 --- a/src/g_doom/a_spidermaster.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* -#include "templates.h" -#include "actor.h" -#include "m_random.h" -#include "s_sound.h" -#include "p_local.h" -#include "p_enemy.h" -#include "a_action.h" -#include "vm.h" -*/ - -static FRandom pr_spidrefire ("SpidRefire"); - -DEFINE_ACTION_FUNCTION(AActor, A_SpidRefire) -{ - PARAM_SELF_PROLOGUE(AActor); - - // keep firing unless target got out of sight - A_FaceTarget (self); - - if (pr_spidrefire() < 10) - return 0; - - if (!self->target - || P_HitFriend (self) - || self->target->health <= 0 - || !P_CheckSight (self, self->target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES)) - { - self->SetState (self->SeeState); - } - return 0; -} - -DEFINE_ACTION_FUNCTION(AActor, A_Metal) -{ - PARAM_SELF_PROLOGUE(AActor); - - S_Sound (self, CHAN_BODY, "spider/walk", 1, ATTN_IDLE); - A_Chase (stack, self); - return 0; -} diff --git a/src/scripting/vm/vmexec.h b/src/scripting/vm/vmexec.h index 2ddc505997..65891493e0 100644 --- a/src/scripting/vm/vmexec.h +++ b/src/scripting/vm/vmexec.h @@ -924,7 +924,7 @@ begin: reg.d[a] = reg.d[B] ^ reg.d[C]; NEXTOP; OP(XOR_RK): - ASSERTD(a); ASSERTD(B); ASSERTD(C); + ASSERTD(a); ASSERTD(B); ASSERTKD(C); reg.d[a] = reg.d[B] ^ konstd[C]; NEXTOP; diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 027aaf7dc9..02cb4f3cfc 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -113,8 +113,6 @@ class Actor : Thinker native native void A_BossDeath(); native void A_SkullAttack(float speed = 20); native void A_BetaSkullAttack(); - native void A_Metal(); - native void A_SpidRefire(); native void A_PainAttack(class spawntype = "LostSoul", float angle = 0, int flags = 0, int limit = -1); native void A_DualPainAttack(class spawntype = "LostSoul"); native void A_PainDie(class spawntype = "LostSoul"); diff --git a/wadsrc/static/zscript/doom/spidermaster.txt b/wadsrc/static/zscript/doom/spidermaster.txt index b9f0600688..9a72a2bbe6 100644 --- a/wadsrc/static/zscript/doom/spidermaster.txt +++ b/wadsrc/static/zscript/doom/spidermaster.txt @@ -60,3 +60,34 @@ class SpiderMastermind : Actor Stop; } } + +//=========================================================================== +// +// Code (must be attached to Actor) +// +//=========================================================================== + +extend class Actor +{ + void A_SpidRefire() + { + // keep firing unless target got out of sight + A_FaceTarget(); + if (Random[CPosRefire](0, 255) >= 10) + { + if (!target + || HitFriend() + || target.health <= 0 + || !CheckSight(target, SF_SEEPASTBLOCKEVERYTHING|SF_SEEPASTSHOOTABLELINES)) + { + SetState(SeeState); + } + } + } + + void A_Metal() + { + A_PlaySound("spider/walk", CHAN_BODY, 1, false, ATTN_IDLE); + A_Chase(); + } +}