Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript

# Conflicts:
#	src/CMakeLists.txt
#	wadsrc/static/actors/doom/doomarmor.txt
#	wadsrc/static/decorate.txt
This commit is contained in:
Christoph Oelckers 2016-11-15 11:36:59 +01:00
commit 6e223ebc21
589 changed files with 51621 additions and 39063 deletions

View File

@ -829,8 +829,8 @@ add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CUR
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y )
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h
COMMAND lemon -C${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/zscript/zcc-parse.lemon
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/zscript/zcc-parse.lemon )
COMMAND lemon -C${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/scripting/zscript/zcc-parse.lemon
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/scripting/zscript/zcc-parse.lemon )
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h
COMMAND re2c --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re
@ -892,13 +892,17 @@ file( GLOB HEADER_FILES
posix/cocoa/*.h
posix/sdl/*.h
r_data/*.h
rapidjson/*.h
resourcefiles/*.h
sfmt/*.h
sound/*.h
textures/*.h
thingdef/*.h
scripting/*.h
scripting/codegeneration/*.h
scripting/decorate/*.h
scripting/zscript/*.h
scripting/vm/*.h
xlat/*.h
zscript/*.h
gl/*.h
gl/api/*.h
gl/data/*.h
@ -923,36 +927,17 @@ set( NOT_COMPILED_SOURCE_FILES
${OTHER_SYSTEM_SOURCES}
sc_man_scanner.h
sc_man_scanner.re
g_doom/a_arachnotron.cpp
g_doom/a_archvile.cpp
g_doom/a_bossbrain.cpp
g_doom/a_bruiser.cpp
g_doom/a_cacodemon.cpp
g_doom/a_cyberdemon.cpp
g_doom/a_demon.cpp
g_doom/a_doomimp.cpp
g_doom/a_doomweaps.cpp
g_doom/a_fatso.cpp
g_doom/a_keen.cpp
g_doom/a_lostsoul.cpp
g_doom/a_painelemental.cpp
g_doom/a_possessed.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
g_heretic/a_hereticimp.cpp
g_heretic/a_hereticweaps.cpp
g_heretic/a_ironlich.cpp
g_heretic/a_knight.cpp
g_heretic/a_wizard.cpp
g_hexen/a_bats.cpp
g_hexen/a_bishop.cpp
g_hexen/a_blastradius.cpp
g_hexen/a_boostarmor.cpp
g_hexen/a_centaur.cpp
g_hexen/a_clericflame.cpp
g_hexen/a_clericholy.cpp
g_hexen/a_clericmace.cpp
@ -962,7 +947,6 @@ set( NOT_COMPILED_SOURCE_FILES
g_hexen/a_fighterhammer.cpp
g_hexen/a_fighterplayer.cpp
g_hexen/a_fighterquietus.cpp
g_hexen/a_firedemon.cpp
g_hexen/a_flechette.cpp
g_hexen/a_flies.cpp
g_hexen/a_fog.cpp
@ -1002,7 +986,7 @@ set( NOT_COMPILED_SOURCE_FILES
xlat/xlat_parser.y
xlat_parser.c
xlat_parser.h
zscript/zcc-parse.lemon
scripting/zscript/zcc-parse.lemon
zcc-parse.c
zcc-parse.h
@ -1403,14 +1387,6 @@ set (PCH_SOURCES
textures/texturemanager.cpp
textures/tgatexture.cpp
textures/warptexture.cpp
thingdef/olddecorations.cpp
thingdef/thingdef.cpp
thingdef/thingdef_data.cpp
thingdef/thingdef_exp.cpp
thingdef/thingdef_expression.cpp
thingdef/thingdef_parse.cpp
thingdef/thingdef_properties.cpp
thingdef/thingdef_states.cpp
xlat/parse_xlat.cpp
fragglescript/t_func.cpp
fragglescript/t_load.cpp
@ -1425,15 +1401,23 @@ set (PCH_SOURCES
r_data/voxels.cpp
r_data/renderstyle.cpp
r_data/r_interpolate.cpp
scripting/thingdef.cpp
scripting/thingdef_data.cpp
scripting/thingdef_properties.cpp
scripting/codegeneration/codegen.cpp
scripting/decorate/olddecorations.cpp
scripting/decorate/thingdef_exp.cpp
scripting/decorate/thingdef_parse.cpp
scripting/decorate/thingdef_states.cpp
scripting/vm/vmbuilder.cpp
scripting/vm/vmdisasm.cpp
scripting/vm/vmexec.cpp
scripting/vm/vmframe.cpp
scripting/zscript/ast.cpp
scripting/zscript/zcc_compile.cpp
scripting/zscript/zcc_expr.cpp
scripting/zscript/zcc_parser.cpp
sfmt/SFMT.cpp
zscript/ast.cpp
zscript/vmbuilder.cpp
zscript/vmdisasm.cpp
zscript/vmexec.cpp
zscript/vmframe.cpp
zscript/zcc_compile.cpp
zscript/zcc_expr.cpp
zscript/zcc_parser.cpp
)
enable_precompiled_headers( g_pch.h PCH_SOURCES )
@ -1459,6 +1443,8 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
math/log10.c
math/mtherr.c
math/polevl.c
math/pow.c
math/powi.c
math/sin.c
math/sinh.c
math/sqrt.c
@ -1493,11 +1479,11 @@ include_directories( .
oplsynth
sound
textures
thingdef
timidity
wildmidi
xlat
zscript
scripting
scripting/vm
../gdtoa
../dumb/include
${CMAKE_BINARY_DIR}/gdtoa
@ -1614,7 +1600,9 @@ source_group("Audio Files\\Timidity\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRE
source_group("Audio Files\\Timidity\\Source" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/timidity/.+\\.cpp$")
source_group("Audio Files\\WildMidi\\Headers" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/wildmidi/.+\\.h$")
source_group("Audio Files\\WildMidi\\Source" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/wildmidi/.+\\.cpp$")
source_group("Decorate++" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/thingdef/.+")
source_group("External\\Math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/math/.+")
source_group("External\\RapidJSON" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/.+")
source_group("Externak\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+")
source_group("FraggleScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/fragglescript/.+")
source_group("Games\\Doom Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_doom/.+")
source_group("Games\\Heretic Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_heretic/.+")
@ -1622,9 +1610,7 @@ source_group("Games\\Hexen Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR
source_group("Games\\Raven Shared" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_raven/.+")
source_group("Games\\Strife Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_strife/.+")
source_group("Intermission" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/intermission/.+")
source_group("Math" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/math/.+")
source_group("Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/menu/.+")
source_group("RapidJSON" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/rapidjson/.+")
source_group("OpenGL Renderer" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gl/.+")
source_group("OpenGL Renderer\\Data" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gl/data/.+")
source_group("OpenGL Renderer\\Dynamic Lights" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gl/dynlights/.+")
@ -1646,15 +1632,18 @@ source_group("Render Data\\Resource Sources" REGULAR_EXPRESSION "^${CMAKE_CURREN
source_group("Render Data\\Textures" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/textures/.+")
source_group("Render Interface" FILES r_defs.h r_renderer.h r_sky.cpp r_sky.h r_state.h r_utility.cpp r_utility.h)
source_group("Resource Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/resourcefiles/.+")
source_group("POSIX Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/.+")
source_group("Cocoa Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/cocoa/.+")
source_group("OS X Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/.+")
source_group("Unix Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/unix/.+")
source_group("SDL Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/sdl/.+")
source_group("SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+")
source_group("Platforms\\POSIX Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/.+")
source_group("Platforms\\Cocoa Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/cocoa/.+")
source_group("Platforms\\OS X Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/osx/.+")
source_group("Platforms\\Unix Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/unix/.+")
source_group("Platforms\\SDL Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/posix/sdl/.+")
source_group("Platforms\\Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/win32/.+")
source_group("Scripting\\Decorate" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/decorate/.+")
source_group("Scripting\\ZScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/zscript/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h)
source_group("Scripting\\Code Generation" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/codegeneration/.+")
source_group("Scripting\\VM" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/vm/.+")
source_group("Scripting" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/scripting/.+")
source_group("Shared Game" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_shared/.+")
source_group("Versioning" FILES version.h win32/zdoom.rc)
source_group("Win32 Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/win32/.+")
source_group("Xlat" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/xlat/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.h)
source_group("ZScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/zscript/.+" FILES ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.c ${CMAKE_CURRENT_BINARY_DIR}/zcc-parse.h)
source_group("Source Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h sc_man_scanner.re)

View File

@ -565,6 +565,7 @@ class DDropItem : public DObject
{
DECLARE_CLASS(DDropItem, DObject)
HAS_OBJECT_POINTERS
HAS_FIELDS
public:
DDropItem *Next;
FName Name;
@ -578,6 +579,7 @@ const double MinVel = EQUAL_EPSILON;
class AActor : public DThinker
{
DECLARE_CLASS_WITH_META (AActor, DThinker, PClassActor)
HAS_FIELDS
HAS_OBJECT_POINTERS
public:
AActor () throw();
@ -612,7 +614,7 @@ public:
virtual void BeginPlay(); // Called immediately after the actor is created
virtual void PostBeginPlay(); // Called immediately before the actor's first tick
virtual void LevelSpawned(); // Called after BeginPlay if this actor was spawned by the world
void LevelSpawned(); // Called after BeginPlay if this actor was spawned by the world
virtual void HandleSpawnFlags(); // Translates SpawnFlags into in-game flags.
virtual void MarkPrecacheSounds() const; // Marks sounds used by this actor for precaching.
@ -731,7 +733,7 @@ public:
void ObtainInventory (AActor *other);
// Die. Now.
virtual bool Massacre ();
bool Massacre ();
// Transforms the actor into a finely-ground paste
virtual bool Grind(bool items);
@ -956,7 +958,7 @@ public:
{
SetOrigin(Pos() + vel, true);
}
virtual void SetOrigin(double x, double y, double z, bool moving);
void SetOrigin(double x, double y, double z, bool moving);
void SetOrigin(const DVector3 & npos, bool moving)
{
SetOrigin(npos.X, npos.Y, npos.Z, moving);
@ -968,7 +970,7 @@ public:
bool IsInsideVisibleAngles() const;
// Calculate amount of missile damage
virtual int GetMissileDamage(int mask, int add);
int GetMissileDamage(int mask, int add);
bool CanSeek(AActor *target) const;
@ -1366,7 +1368,7 @@ public:
Vel.Y = speed * Angles.Yaw.Sin();
}
void VelFromAngle(DAngle angle, double speed)
void VelFromAngle(double speed, DAngle angle)
{
Vel.X = speed * angle.Cos();
Vel.Y = speed * angle.Sin();

View File

@ -15,14 +15,16 @@
#include "serializer.h"
#include "d_player.h"
IMPLEMENT_POINTY_CLASS(DBot)
DECLARE_POINTER(dest)
DECLARE_POINTER(prev)
DECLARE_POINTER(enemy)
DECLARE_POINTER(missile)
DECLARE_POINTER(mate)
DECLARE_POINTER(last_mate)
END_POINTERS
IMPLEMENT_CLASS(DBot, false, true, false, false)
IMPLEMENT_POINTERS_START(DBot)
IMPLEMENT_POINTER(dest)
IMPLEMENT_POINTER(prev)
IMPLEMENT_POINTER(enemy)
IMPLEMENT_POINTER(missile)
IMPLEMENT_POINTER(mate)
IMPLEMENT_POINTER(last_mate)
IMPLEMENT_POINTERS_END
DBot::DBot ()
: DThinker(STAT_BOT)

View File

@ -187,7 +187,7 @@ static const char *KeyConfCommands[] =
// CODE --------------------------------------------------------------------
IMPLEMENT_CLASS (DWaitingCommand)
IMPLEMENT_CLASS(DWaitingCommand, false, false, false, false)
void DWaitingCommand::Serialize(FSerializer &arc)
{
@ -225,7 +225,7 @@ void DWaitingCommand::Tick ()
}
}
IMPLEMENT_CLASS (DStoredCommand)
IMPLEMENT_CLASS(DStoredCommand, false, false, false, false)
DStoredCommand::DStoredCommand ()
{

View File

@ -632,7 +632,10 @@ int strbin (char *str)
if (*p >= '0' && *p <= '7')
c += *p-'0';
else
{
p--;
break;
}
p++;
}
*str++ = c;
@ -732,7 +735,10 @@ FString strbin1 (const char *start)
if (*p >= '0' && *p <= '7')
c += *p-'0';
else
{
p--;
break;
}
p++;
}
result << c;

View File

@ -70,6 +70,10 @@
#include "doomerrors.h"
#include "p_effect.h"
#include "serializer.h"
#include "vm.h"
#include "thingdef.h"
#include "info.h"
#include "v_text.h"
#include "vmbuilder.h"
// [SO] Just the way Randy said to do it :)
@ -227,9 +231,11 @@ DehInfo deh =
// from the original actor's defaults. The original actor is then changed to
// spawn the new class.
IMPLEMENT_POINTY_CLASS (ADehackedPickup)
DECLARE_POINTER (RealPickup)
END_POINTERS
IMPLEMENT_CLASS(ADehackedPickup, false, true, false, false)
IMPLEMENT_POINTERS_START(ADehackedPickup)
IMPLEMENT_POINTER(RealPickup)
IMPLEMENT_POINTERS_END
TArray<PClassActor *> TouchedActors;
@ -794,7 +800,7 @@ void SetDehParams(FState *state, int codepointer)
// Let's identify the codepointer we're dealing with.
PFunction *sym;
sym = dyn_cast<PFunction>(RUNTIME_CLASS(AInventory)->Symbols.FindSymbol(FName(MBFCodePointers[codepointer].name), true));
sym = dyn_cast<PFunction>(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(FName(MBFCodePointers[codepointer].name), true));
if (sym == NULL) return;
if (codepointer < 0 || (unsigned)codepointer >= countof(MBFCodePointerFactories))
@ -804,22 +810,26 @@ void SetDehParams(FState *state, int codepointer)
}
else
{
VMFunctionBuilder buildit;
int numargs = sym->GetImplicitArgs();
VMFunctionBuilder buildit(numargs);
// Allocate registers used to pass parameters in.
// self, stateowner, state (all are pointers)
buildit.Registers[REGT_POINTER].Get(NAP);
buildit.Registers[REGT_POINTER].Get(numargs);
// Emit code to pass the standard action function parameters.
for (int i = 0; i < NAP; i++)
for (int i = 0; i < numargs; i++)
{
buildit.Emit(OP_PARAM, 0, REGT_POINTER, i);
}
// Emit code for action parameters.
int argcount = MBFCodePointerFactories[codepointer](buildit, value1, value2);
buildit.Emit(OP_TAIL_K, buildit.GetConstantAddress(sym->Variants[0].Implementation, ATAG_OBJECT), NAP + argcount, 0);
buildit.Emit(OP_TAIL_K, buildit.GetConstantAddress(sym->Variants[0].Implementation, ATAG_OBJECT), numargs + argcount, 0);
// Attach it to the state.
VMScriptFunction *sfunc = buildit.MakeFunction();
sfunc->NumArgs = NAP;
VMScriptFunction *sfunc = new VMScriptFunction;
buildit.MakeFunction(sfunc);
sfunc->NumArgs = numargs;
sfunc->ImplicitArgs = numargs;
state->SetAction(sfunc);
sfunc->PrintableName.Format("Dehacked.%s.%d.%d", MBFCodePointers[codepointer].name.GetChars(), value1, value2);
}
}
@ -1480,6 +1490,14 @@ static int PatchFrame (int frameNum)
return result;
}
// there is exactly one place where this is needed and we do not want to expose the state internals to ZSCRIPT.
DEFINE_ACTION_FUNCTION(AActor, isDEHState)
{
PARAM_PROLOGUE;
PARAM_POINTER(state, FState);
ACTION_RETURN_BOOL(state != nullptr && (state->DefineFlags & SDF_DEHACKED));
}
static int PatchSprite (int sprNum)
{
int result;
@ -2101,23 +2119,24 @@ static int PatchCodePtrs (int dummy)
if (!symname.CompareNoCase(MBFCodePointers[i].alias))
{
symname = MBFCodePointers[i].name;
Printf("%s --> %s\n", MBFCodePointers[i].alias, MBFCodePointers[i].name.GetChars());
DPrintf(DMSG_SPAMMY, "%s --> %s\n", MBFCodePointers[i].alias, MBFCodePointers[i].name.GetChars());
}
}
// This skips the action table and goes directly to the internal symbol table
// DEH compatible functions are easy to recognize.
PFunction *sym = dyn_cast<PFunction>(RUNTIME_CLASS(AInventory)->Symbols.FindSymbol(symname, true));
PFunction *sym = dyn_cast<PFunction>(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(symname, true));
if (sym == NULL)
{
Printf("Frame %d: Unknown code pointer '%s'\n", frame, Line2);
Printf(TEXTCOLOR_RED "Frame %d: Unknown code pointer '%s'\n", frame, Line2);
}
else
{
TArray<DWORD> &args = sym->Variants[0].ArgFlags;
if ((sym->Flags & (VARF_Method | VARF_Action)) != (VARF_Method | VARF_Action) || (args.Size() > NAP && !(args[NAP] & VARF_Optional)))
unsigned numargs = sym->GetImplicitArgs();
if ((sym->Variants[0].Flags & VARF_Virtual || (args.Size() > numargs && !(args[numargs] & VARF_Optional))))
{
Printf("Frame %d: Incompatible code pointer '%s'\n", frame, Line2);
Printf(TEXTCOLOR_RED "Frame %d: Incompatible code pointer '%s'\n", frame, Line2);
sym = NULL;
}
}
@ -2715,11 +2734,11 @@ static bool LoadDehSupp ()
}
else
{
// all relevant code pointers are either defined in AInventory
// all relevant code pointers are either defined in AStateProvider
// or AActor so this will find all of them.
FString name = "A_";
name << sc.String;
PFunction *sym = dyn_cast<PFunction>(RUNTIME_CLASS(AInventory)->Symbols.FindSymbol(name, true));
PFunction *sym = dyn_cast<PFunction>(RUNTIME_CLASS(AStateProvider)->Symbols.FindSymbol(name, true));
if (sym == NULL)
{
sc.ScriptError("Unknown code pointer '%s'", sc.String);
@ -2727,7 +2746,8 @@ static bool LoadDehSupp ()
else
{
TArray<DWORD> &args = sym->Variants[0].ArgFlags;
if ((sym->Flags & (VARF_Method|VARF_Action)) != (VARF_Method | VARF_Action) || (args.Size() > NAP && !(args[NAP] & VARF_Optional)))
unsigned numargs = sym->GetImplicitArgs();
if ((sym->Variants[0].Flags & VARF_Virtual || (args.Size() > numargs && !(args[numargs] & VARF_Optional))))
{
sc.ScriptMessage("Incompatible code pointer '%s'", sc.String);
}
@ -3010,7 +3030,6 @@ void FinishDehPatch ()
while (subclass == nullptr);
AActor *defaults2 = GetDefaultByType (subclass);
memcpy ((void *)defaults2, (void *)defaults1, sizeof(AActor));
// Make a copy of the replaced class's state labels
FStateDefinitions statedef;

View File

@ -109,6 +109,7 @@
#include "p_local.h"
#include "autosegs.h"
#include "fragglescript/t_fs.h"
#include "vm.h"
EXTERN_CVAR(Bool, hud_althud)
void DrawHUD();

View File

@ -119,9 +119,11 @@ protected:
DDecalThinker () : DThinker (STAT_DECALTHINKER) {}
};
IMPLEMENT_POINTY_CLASS (DDecalThinker)
DECLARE_POINTER (TheDecal)
END_POINTERS
IMPLEMENT_CLASS(DDecalThinker, false, true, false, false)
IMPLEMENT_POINTERS_START(DDecalThinker)
IMPLEMENT_POINTER(TheDecal)
IMPLEMENT_POINTERS_END
void DDecalThinker::Serialize(FSerializer &arc)
{
@ -1151,7 +1153,7 @@ FDecalAnimator::~FDecalAnimator ()
{
}
IMPLEMENT_CLASS (DDecalFader)
IMPLEMENT_CLASS(DDecalFader, false, false, false, false)
void DDecalFader::Serialize(FSerializer &arc)
{
@ -1200,7 +1202,7 @@ DThinker *FDecalFaderAnim::CreateThinker (DBaseDecal *actor, side_t *wall) const
return fader;
}
IMPLEMENT_CLASS (DDecalStretcher)
IMPLEMENT_CLASS(DDecalStretcher, false, false, false, false)
void DDecalStretcher::Serialize(FSerializer &arc)
{
@ -1288,7 +1290,7 @@ void DDecalStretcher::Tick ()
}
}
IMPLEMENT_CLASS (DDecalSlider)
IMPLEMENT_CLASS(DDecalSlider, false, false, false, false)
void DDecalSlider::Serialize(FSerializer &arc)
{
@ -1368,8 +1370,7 @@ FDecalAnimator *FDecalLib::FindAnimator (const char *name)
return NULL;
}
IMPLEMENT_CLASS (DDecalColorer)
IMPLEMENT_CLASS(DDecalColorer, false, false, false, false)
void DDecalColorer::Serialize(FSerializer &arc)
{

View File

@ -48,6 +48,7 @@
#include "a_sharedglobal.h"
#include "dsectoreffect.h"
#include "serializer.h"
#include "virtual.h"
//==========================================================================
//
@ -57,13 +58,15 @@
ClassReg DObject::RegistrationInfo =
{
NULL, // MyClass
"DObject", // Name
NULL, // ParentType
NULL, // Pointers
&DObject::InPlaceConstructor, // ConstructNative
sizeof(DObject), // SizeOf
CLASSREG_PClass, // MetaClassNum
nullptr, // MyClass
"DObject", // Name
nullptr, // ParentType
&DVMObject<DObject>::RegistrationInfo, // VMExport
nullptr, // Pointers
&DObject::InPlaceConstructor, // ConstructNative
&DObject::InitNativeFields, // InitNatives
sizeof(DObject), // SizeOf
CLASSREG_PClass, // MetaClassNum
};
_DECLARE_TI(DObject)
@ -344,11 +347,37 @@ DObject::~DObject ()
//
//==========================================================================
void DObject::InitNativeFields()
{
auto meta = RUNTIME_CLASS(DObject);
meta->AddNativeField("bDestroyed", TypeSInt32, myoffsetof(DObject, ObjectFlags), VARF_ReadOnly, OF_EuthanizeMe);
}
//==========================================================================
//
//
//
//==========================================================================
void DObject::Destroy ()
{
ObjectFlags = (ObjectFlags & ~OF_Fixed) | OF_EuthanizeMe;
}
DEFINE_ACTION_FUNCTION(DObject, Destroy)
{
PARAM_SELF_PROLOGUE(DObject);
self->VMSuperCall();
self->Destroy();
return 0;
}
DEFINE_ACTION_FUNCTION(DObject, GetClass)
{
PARAM_SELF_PROLOGUE(DObject);
ACTION_RETURN_OBJECT(self->GetClass());
}
//==========================================================================
//
//

View File

@ -36,6 +36,7 @@
#include <stdlib.h>
#include "doomtype.h"
#include "i_system.h"
class PClass;
@ -109,8 +110,10 @@ struct ClassReg
PClass *MyClass;
const char *Name;
ClassReg *ParentType;
ClassReg *VMExport;
const size_t *Pointers;
void (*ConstructNative)(void *);
void(*InitNatives)();
unsigned int SizeOf:28;
unsigned int MetaClassNum:4;
@ -124,8 +127,8 @@ enum EInPlace { EC_InPlace };
public: \
virtual PClass *StaticType() const; \
static ClassReg RegistrationInfo, * const RegistrationInfoPtr; \
private: \
typedef parent Super; \
private: \
typedef cls ThisClass;
#define DECLARE_ABSTRACT_CLASS_WITH_META(cls,parent,meta) \
@ -147,10 +150,8 @@ protected: \
#define HAS_OBJECT_POINTERS \
static const size_t PointerOffsets[];
// Taking the address of a field in an object at address 1 instead of
// address 0 keeps GCC from complaining about possible misuse of offsetof.
#define DECLARE_POINTER(field) (size_t)&((ThisClass*)1)->field - 1,
#define END_POINTERS ~(size_t)0 };
#define HAS_FIELDS \
static void InitNativeFields();
#if defined(_MSC_VER)
# pragma section(".creg$u",read)
@ -159,36 +160,41 @@ protected: \
# define _DECLARE_TI(cls) ClassReg * const cls::RegistrationInfoPtr __attribute__((section(SECTION_CREG))) = &cls::RegistrationInfo;
#endif
#define _IMP_PCLASS(cls,ptrs,create) \
#define _IMP_PCLASS(cls, ptrs, create, initn, vmexport) \
ClassReg cls::RegistrationInfo = {\
NULL, \
nullptr, \
#cls, \
&cls::Super::RegistrationInfo, \
vmexport, \
ptrs, \
create, \
initn, \
sizeof(cls), \
cls::MetaClassNum }; \
_DECLARE_TI(cls) \
PClass *cls::StaticType() const { return RegistrationInfo.MyClass; }
#define _IMP_CREATE_OBJ(cls) \
void cls::InPlaceConstructor(void *mem) { new((EInPlace *)mem) cls; }
#define IMPLEMENT_CLASS(cls, isabstract, ptrs, fields, vmexport) \
_X_CONSTRUCTOR_##isabstract(cls) \
_IMP_PCLASS(cls, _X_POINTERS_##ptrs(cls), _X_ABSTRACT_##isabstract(cls), _X_FIELDS_##fields(cls), _X_VMEXPORT_##vmexport(cls))
#define IMPLEMENT_POINTY_CLASS(cls) \
_IMP_CREATE_OBJ(cls) \
_IMP_PCLASS(cls,cls::PointerOffsets,cls::InPlaceConstructor) \
const size_t cls::PointerOffsets[] = {
// Taking the address of a field in an object at address 1 instead of
// address 0 keeps GCC from complaining about possible misuse of offsetof.
#define IMPLEMENT_POINTERS_START(cls) const size_t cls::PointerOffsets[] = {
#define IMPLEMENT_POINTER(field) (size_t)&((ThisClass*)1)->field - 1,
#define IMPLEMENT_POINTERS_END ~(size_t)0 };
#define IMPLEMENT_CLASS(cls) \
_IMP_CREATE_OBJ(cls) \
_IMP_PCLASS(cls,NULL,cls::InPlaceConstructor)
#define IMPLEMENT_ABSTRACT_CLASS(cls) \
_IMP_PCLASS(cls,NULL,NULL)
#define IMPLEMENT_ABSTRACT_POINTY_CLASS(cls) \
_IMP_PCLASS(cls,cls::PointerOffsets,NULL) \
const size_t cls::PointerOffsets[] = {
// Possible arguments for the IMPLEMENT_CLASS macro
#define _X_POINTERS_true(cls) cls::PointerOffsets
#define _X_POINTERS_false(cls) nullptr
#define _X_FIELDS_true(cls) cls::InitNativeFields
#define _X_FIELDS_false(cls) nullptr
#define _X_CONSTRUCTOR_true(cls)
#define _X_CONSTRUCTOR_false(cls) void cls::InPlaceConstructor(void *mem) { new((EInPlace *)mem) cls; }
#define _X_ABSTRACT_true(cls) nullptr
#define _X_ABSTRACT_false(cls) cls::InPlaceConstructor
#define _X_VMEXPORT_true(cls) &DVMObject<cls>::RegistrationInfo
#define _X_VMEXPORT_false(cls) nullptr
enum EObjectFlags
{
@ -201,7 +207,6 @@ enum EObjectFlags
OF_EuthanizeMe = 1 << 5, // Object wants to die
OF_Cleanup = 1 << 6, // Object is now being deleted by the collector
OF_YesReallyDelete = 1 << 7, // Object is being deleted outside the collector, and this is okay, so don't print a warning
OF_Transient = 1 << 11, // Object should not be archived (references to it will be nulled on disk)
OF_WhiteBits = OF_White0 | OF_White1,
OF_MarkBits = OF_WhiteBits | OF_Black,
@ -210,6 +215,8 @@ enum EObjectFlags
OF_JustSpawned = 1 << 8, // Thinker was spawned this tic
OF_SerialSuccess = 1 << 9, // For debugging Serialize() calls
OF_Sentinel = 1 << 10, // Object is serving as the sentinel in a ring list
OF_Transient = 1 << 11, // Object should not be archived (references to it will be nulled on disk)
OF_SuperCall = 1 << 12, // A super call from the VM is about to be performed
};
template<class T> class TObjPtr;
@ -438,6 +445,7 @@ public:
virtual PClass *StaticType() const { return RegistrationInfo.MyClass; }
static ClassReg RegistrationInfo, * const RegistrationInfoPtr;
static void InPlaceConstructor (void *mem);
static void InitNativeFields();
typedef PClass MetaClass;
private:
typedef DObject ThisClass;
@ -463,6 +471,11 @@ public:
void SerializeUserVars(FSerializer &arc);
virtual void Serialize(FSerializer &arc);
void VMSuperCall()
{
ObjectFlags |= OF_SuperCall;
}
void ClearClass()
{
Class = NULL;
@ -574,6 +587,8 @@ protected:
}
};
class AInventory;//
// When you write to a pointer to an Object, you must call this for
// proper bookkeeping in case the Object holding this pointer has
// already been processed by the GC.

View File

@ -77,6 +77,7 @@
#include "r_utility.h"
#include "menu/menu.h"
#include "intermission/intermission.h"
#include "vm.h"
// MACROS ------------------------------------------------------------------
@ -124,7 +125,8 @@ public:
int PolyNum;
int SideNum;
};
IMPLEMENT_CLASS(DSectorMarker)
IMPLEMENT_CLASS(DSectorMarker, false, false, false, false)
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -14,11 +14,25 @@ typedef std::pair<const class PType *, unsigned> FTypeAndOffset;
// Making all these different storage types use a common set of flags seems
// like the simplest thing to do.
#define VARF_Optional (1<<0) // func param is optional
#define VARF_Method (1<<1) // func has an implied self parameter
#define VARF_Action (1<<2) // func has implied owner and state parameters
#define VARF_Native (1<<3) // func is native code/don't auto serialize field
#define VARF_ReadOnly (1<<4) // field is read only, do not write to it
enum
{
VARF_Optional = (1<<0), // func param is optional
VARF_Method = (1<<1), // func has an implied self parameter
VARF_Action = (1<<2), // func has implied owner and state parameters
VARF_Native = (1<<3), // func is native code/don't auto serialize field
VARF_ReadOnly = (1<<4), // field is read only, do not write to it
VARF_Private = (1<<5), // field is private to containing class
VARF_Protected = (1<<6), // field is only accessible by containing class and children.
VARF_Deprecated = (1<<7), // Deprecated fields should output warnings when used.
VARF_Virtual = (1<<8), // function is virtual
VARF_Final = (1<<9), // Function may not be overridden in subclasses
VARF_In = (1<<10),
VARF_Out = (1<<11),
VARF_Implicit = (1<<12), // implicitly created parameters (i.e. do not compare types when checking function signatures)
VARF_Static = (1<<13), // static class data (by necessity read only.)
VARF_InternalAccess = (1<<14), // overrides VARF_ReadOnly for internal script code.
VARF_Override = (1<<15), // overrides a virtual function from the parent class.
};
// Symbol information -------------------------------------------------------
@ -57,7 +71,6 @@ struct StateCallData;
class VMFrameStack;
struct VMValue;
struct VMReturn;
typedef int (*actionf_p)(VMFrameStack *stack, VMValue *param, int numparam, VMReturn *ret, int numret);/*(VM_ARGS)*/
class VMFunction;
// A VM function ------------------------------------------------------------
@ -86,18 +99,6 @@ public:
PSymbolType() : PSymbol(NAME_None) {}
};
// A symbol for a compiler tree node ----------------------------------------
class PSymbolTreeNode : public PSymbol
{
DECLARE_CLASS(PSymbolTreeNode, PSymbol);
public:
struct ZCC_NamedNode *Node;
PSymbolTreeNode(FName name, struct ZCC_NamedNode *node) : PSymbol(name), Node(node) {}
PSymbolTreeNode() : PSymbol(NAME_None) {}
};
// A symbol table -----------------------------------------------------------
struct PSymbolTable
@ -111,6 +112,10 @@ struct PSymbolTable
// Sets the table to use for searches if this one doesn't contain the
// requested symbol.
void SetParentTable (PSymbolTable *parent);
PSymbolTable *GetParentTable() const
{
return ParentSymbolTable;
}
// Finds a symbol in the table, optionally searching parent tables
// as well.
@ -120,6 +125,7 @@ struct PSymbolTable
// specific symbol table the symbol was found in.
PSymbol *FindSymbolInTable(FName symname, PSymbolTable *&symtable);
// Places the symbol in the table and returns a pointer to it or NULL if
// a symbol with the same name is already in the table. This symbol is
// not copied and will be freed when the symbol table is destroyed.
@ -132,15 +138,33 @@ struct PSymbolTable
// Frees all symbols from this table.
void ReleaseSymbols();
private:
typedef TMap<FName, PSymbol *> MapType;
MapType::Iterator GetIterator()
{
return MapType::Iterator(Symbols);
}
private:
PSymbolTable *ParentSymbolTable;
MapType Symbols;
friend class DObject;
};
// A symbol for a compiler tree node ----------------------------------------
class PSymbolTreeNode : public PSymbol
{
DECLARE_CLASS(PSymbolTreeNode, PSymbol);
public:
struct ZCC_TreeNode *Node;
PSymbolTreeNode(FName name, struct ZCC_TreeNode *node) : PSymbol(name), Node(node) {}
PSymbolTreeNode() : PSymbol(NAME_None) {}
};
extern PSymbolTable GlobalSymbols;
// Basic information shared by all types ------------------------------------
@ -179,6 +203,7 @@ class PType : public PTypeBase
HAS_OBJECT_POINTERS;
protected:
enum { MetaClassNum = CLASSREG_PClassType };
public:
typedef PClassType MetaClass;
MetaClass *GetClass() const;
@ -196,10 +221,13 @@ public:
unsigned int Align; // this type's preferred alignment
PType *HashNext; // next type in this type table
PSymbolTable Symbols;
bool MemberOnly = false; // type may only be used as a struct/class member but not as a local variable or function argument.
FString mDescriptiveName;
BYTE loadOp, storeOp, moveOp, RegType, RegCount;
PType();
PType(unsigned int size, unsigned int align);
PType(unsigned int size = 1, unsigned int align = 1);
virtual ~PType();
virtual bool isNumeric() { return false; }
bool AddConversion(PType *target, void (*convertconst)(ZCC_ExprConstant *, class FSharedStringArena &));
@ -240,14 +268,33 @@ public:
virtual double GetValueFloat(void *addr) const;
// Gets the opcode to store from a register to memory
virtual int GetStoreOp() const;
int GetStoreOp() const
{
return storeOp;
}
// Gets the opcode to load from memory to a register
virtual int GetLoadOp() const;
int GetLoadOp() const
{
return loadOp;
}
// Gets the opcode to move from register to another register
int GetMoveOp() const
{
return moveOp;
}
// Gets the register type for this type
virtual int GetRegType() const;
int GetRegType() const
{
return RegType;
}
int GetRegCount() const
{
return RegCount;
}
// Returns true if this type matches the two identifiers. Referring to the
// above table, any type is identified by at most two characteristics. Each
// type that implements this function will cast these to the appropriate type.
@ -259,6 +306,8 @@ public:
// Get the type IDs used by IsMatch
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
const char *DescriptiveName() const;
size_t PropagateMark();
static void StaticInit();
@ -351,8 +400,12 @@ public:
PTypeBase *Outer; // object this type is contained within
FName TypeName; // this type's name
PNamedType() : Outer(NULL) {}
PNamedType(FName name, PTypeBase *outer) : Outer(outer), TypeName(name) {}
PNamedType() : Outer(NULL) {
mDescriptiveName = "NamedType";
}
PNamedType(FName name, PTypeBase *outer) : Outer(outer), TypeName(name) {
mDescriptiveName = name.GetChars();
}
virtual bool IsMatch(intptr_t id1, intptr_t id2) const;
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
@ -365,7 +418,7 @@ class PInt : public PBasicType
{
DECLARE_CLASS(PInt, PBasicType);
public:
PInt(unsigned int size, bool unsign);
PInt(unsigned int size, bool unsign, bool compatible = true);
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
@ -374,13 +427,13 @@ public:
virtual void SetValue(void *addr, double val);
virtual int GetValueInt(void *addr) const;
virtual double GetValueFloat(void *addr) const;
virtual int GetStoreOp() const;
virtual int GetLoadOp() const;
virtual int GetRegType() const;
virtual bool isNumeric() override { return IntCompatible; }
bool Unsigned;
bool IntCompatible;
protected:
PInt();
void SetOps();
};
class PBool : public PInt
@ -403,11 +456,10 @@ public:
virtual void SetValue(void *addr, double val);
virtual int GetValueInt(void *addr) const;
virtual double GetValueFloat(void *addr) const;
virtual int GetStoreOp() const;
virtual int GetLoadOp() const;
virtual int GetRegType() const;
virtual bool isNumeric() override { return true; }
protected:
PFloat();
void SetOps();
private:
struct SymbolInitF
{
@ -432,8 +484,6 @@ class PString : public PBasicType
public:
PString();
virtual int GetRegType() const;
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
void SetDefaultValue(void *base, unsigned offset, TArray<FTypeAndOffset> *special=NULL) const override;
@ -470,6 +520,13 @@ public:
PColor();
};
class PStateLabel : public PInt
{
DECLARE_CLASS(PStateLabel, PInt);
public:
PStateLabel();
};
// Pointers -----------------------------------------------------------------
class PStatePointer : public PBasicType
@ -480,10 +537,6 @@ public:
void WriteValue(FSerializer &ar, const char *key,const void *addr) const override;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
virtual int GetStoreOp() const;
virtual int GetLoadOp() const;
virtual int GetRegType() const;
};
class PPointer : public PBasicType
@ -491,13 +544,11 @@ class PPointer : public PBasicType
DECLARE_CLASS(PPointer, PBasicType);
HAS_OBJECT_POINTERS;
public:
PPointer(PType *pointsat);
PPointer();
PPointer(PType *pointsat, bool isconst = false);
PType *PointedType;
virtual int GetStoreOp() const;
virtual int GetLoadOp() const;
virtual int GetRegType() const;
bool IsConst;
virtual bool IsMatch(intptr_t id1, intptr_t id2) const;
virtual void GetTypeIDs(intptr_t &id1, intptr_t &id2) const;
@ -506,7 +557,7 @@ public:
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
protected:
PPointer();
void SetOps();
};
class PClassPointer : public PPointer
@ -532,13 +583,12 @@ class PField : public PSymbol
DECLARE_CLASS(PField, PSymbol);
HAS_OBJECT_POINTERS
public:
PField(FName name, PType *type) : PSymbol(name), Offset(0), Type(type), Flags(0) {}
PField(FName name, PType *type, DWORD flags) : PSymbol(name), Offset(0), Type(type), Flags(flags) {}
PField(FName name, PType *type, DWORD flags, unsigned offset) : PSymbol(name), Offset(offset), Type(type), Flags(flags) {}
PField(FName name, PType *type, DWORD flags = 0, size_t offset = 0, int bitvalue = -1);
unsigned int Offset;
size_t Offset;
PType *Type;
DWORD Flags;
int BitValue;
protected:
PField();
};
@ -630,8 +680,10 @@ public:
PStruct(FName name, PTypeBase *outer);
TArray<PField *> Fields;
bool HasNativeFields;
virtual PField *AddField(FName name, PType *type, DWORD flags=0);
virtual PField *AddNativeField(FName name, PType *type, size_t address, DWORD flags = 0, int bitvalue = -1);
size_t PropagateMark();
@ -668,19 +720,27 @@ class PFunction : public PSymbol
public:
struct Variant
{
//PPrototype *Proto;
PPrototype *Proto;
VMFunction *Implementation;
TArray<DWORD> ArgFlags; // Should be the same length as Proto->ArgumentTypes
TArray<FName> ArgNames; // we need the names to access them later when the function gets compiled.
DWORD Flags;
PClass *SelfClass;
};
TArray<Variant> Variants;
DWORD Flags;
PClass *OwningClass = nullptr;
unsigned AddVariant(PPrototype *proto, TArray<DWORD> &argflags, VMFunction *impl);
unsigned AddVariant(PPrototype *proto, TArray<DWORD> &argflags, TArray<FName> &argnames, VMFunction *impl, int flags);
int GetImplicitArgs()
{
if (Variants[0].Flags & VARF_Action) return 3;
else if (Variants[0].Flags & VARF_Method) return 1;
return 0;
}
size_t PropagateMark();
PFunction(FName name) : PSymbol(name), Flags(0) {}
PFunction() : PSymbol(NAME_None), Flags(0) {}
PFunction(PClass *owner = nullptr, FName name = NAME_None) : PSymbol(name), OwningClass(owner) {}
};
// Meta-info for every class derived from DObject ---------------------------
@ -699,8 +759,9 @@ protected:
// We unravel _WITH_META here just as we did for PType.
enum { MetaClassNum = CLASSREG_PClassClass };
TArray<FTypeAndOffset> SpecialInits;
virtual void Derive(PClass *newclass);
void Derive(PClass *newclass, FName name);
void InitializeSpecials(void *addr) const;
void SetSuper();
public:
typedef PClassClass MetaClass;
MetaClass *GetClass() const;
@ -709,18 +770,24 @@ public:
void WriteAllFields(FSerializer &ar, const void *addr) const;
bool ReadValue(FSerializer &ar, const char *key,void *addr) const override;
bool ReadAllFields(FSerializer &ar, void *addr) const;
void InitializeDefaults();
int FindVirtualIndex(FName name, PPrototype *proto);
virtual void DeriveData(PClass *newclass);
virtual void DeriveData(PClass *newclass) {}
static void StaticInit();
static void StaticShutdown();
static void StaticBootstrap();
// Per-class information -------------------------------------
PClass *ParentClass; // the class this class derives from
PClass *VMExported; // this is here to allow script classes to override native virtual functions
const size_t *Pointers; // object pointers defined by this class *only*
const size_t *FlatPointers; // object pointers defined by this class and all its superclasses; not initialized by default
BYTE *Defaults;
bool bRuntimeClass; // class was defined at run-time, not compile-time
bool bExported; // This type has been declared in a script
bool bDecorateClass; // may be subject to some idiosyncracies due to DECORATE backwards compatibility
TArray<VMFunction*> Virtuals; // virtual function table
void (*ConstructNative)(void *);
@ -764,7 +831,7 @@ public:
static PClassActor *FindActor(const FString &name) { return FindActor(FName(name, true)); }
static PClassActor *FindActor(ENamedName name) { return FindActor(FName(name)); }
static PClassActor *FindActor(FName name);
PClass *FindClassTentative(FName name, bool fatal = true); // not static!
PClass *FindClassTentative(FName name);
static TArray<PClass *> AllClasses;
@ -777,7 +844,7 @@ class PClassType : public PClass
protected:
public:
PClassType();
virtual void Derive(PClass *newclass);
virtual void DeriveData(PClass *newclass);
PClass *TypeTableType; // The type to use for hashing into the type table
};
@ -799,17 +866,6 @@ inline PClass::MetaClass *PClass::GetClass() const
return static_cast<MetaClass *>(DObject::GetClass());
}
// A class that hasn't had its parent class defined yet ---------------------
class PClassWaitingForParent : public PClass
{
DECLARE_CLASS(PClassWaitingForParent, PClass);
public:
PClassWaitingForParent(FName myname, FName parentname);
FName ParentName;
};
// Type tables --------------------------------------------------------------
struct FTypeTable
@ -836,9 +892,8 @@ PVector *NewVector(unsigned int size);
PMap *NewMap(PType *keytype, PType *valuetype);
PArray *NewArray(PType *type, unsigned int count);
PDynArray *NewDynArray(PType *type);
PPointer *NewPointer(PType *type);
PPointer *NewPointer(PType *type, bool isconst = false);
PClassPointer *NewClassPointer(PClass *restrict);
PClassWaitingForParent *NewUnknownClass(FName myname, FName parentname);
PEnum *NewEnum(FName name, PTypeBase *outer);
PStruct *NewStruct(FName name, PTypeBase *outer);
PPrototype *NewPrototype(const TArray<PType *> &rettypes, const TArray<PType *> &argtypes);
@ -856,7 +911,11 @@ extern PString *TypeString;
extern PName *TypeName;
extern PSound *TypeSound;
extern PColor *TypeColor;
extern PStruct *TypeVector2;
extern PStruct *TypeVector3;
extern PStatePointer *TypeState;
extern PStateLabel *TypeStateLabel;
extern PPointer *TypeNullPtr;
// A constant value ---------------------------------------------------------

View File

@ -31,7 +31,7 @@
#include "serializer.h"
#include "doomstat.h"
IMPLEMENT_CLASS (DSectorEffect)
IMPLEMENT_CLASS(DSectorEffect, false, false, false, false)
DSectorEffect::DSectorEffect ()
: DThinker(STAT_SECTOREFFECT)
@ -71,9 +71,11 @@ void DSectorEffect::Serialize(FSerializer &arc)
arc("sector", m_Sector);
}
IMPLEMENT_POINTY_CLASS (DMover)
DECLARE_POINTER(interpolation)
END_POINTERS
IMPLEMENT_CLASS(DMover, false, true, false, false)
IMPLEMENT_POINTERS_START(DMover)
IMPLEMENT_POINTER(interpolation)
IMPLEMENT_POINTERS_END
DMover::DMover ()
{
@ -106,9 +108,7 @@ void DMover::StopInterpolation(bool force)
}
}
IMPLEMENT_CLASS (DMovingFloor)
IMPLEMENT_CLASS(DMovingFloor, false, false, false, false)
DMovingFloor::DMovingFloor ()
{
@ -121,7 +121,7 @@ DMovingFloor::DMovingFloor (sector_t *sector)
interpolation = sector->SetInterpolation(sector_t::FloorMove, true);
}
IMPLEMENT_CLASS (DMovingCeiling)
IMPLEMENT_CLASS(DMovingCeiling, false, false, false, false)
DMovingCeiling::DMovingCeiling ()
{

View File

@ -40,6 +40,7 @@
#include "doomerrors.h"
#include "serializer.h"
#include "d_player.h"
#include "virtual.h"
static cycle_t ThinkCycles;
@ -47,7 +48,7 @@ extern cycle_t BotSupportCycles;
extern cycle_t ActionCycles;
extern int BotWTG;
IMPLEMENT_CLASS (DThinker)
IMPLEMENT_CLASS(DThinker, false, false, false, true)
DThinker *NextToThink;
@ -480,7 +481,7 @@ void FThinkerIterator::Reinit ()
m_SearchingFresh = false;
}
DThinker *FThinkerIterator::Next ()
DThinker *FThinkerIterator::Next (bool exact)
{
if (m_ParentType == NULL)
{
@ -496,7 +497,11 @@ DThinker *FThinkerIterator::Next ()
{
DThinker *thinker = m_CurrThinker;
m_CurrThinker = thinker->NextThinker;
if (thinker->IsKindOf(m_ParentType))
if (exact)
{
if (thinker->IsA(m_ParentType)) return thinker;
}
else if (thinker->IsKindOf(m_ParentType))
{
return thinker;
}
@ -521,6 +526,44 @@ DThinker *FThinkerIterator::Next ()
return NULL;
}
// This is for scripting, which needs the iterator wrapped into an object with the needed functions exported.
// Unfortunately we cannot have templated type conversions in scripts.
class DThinkerIterator : public DObject, public FThinkerIterator
{
DECLARE_CLASS(DThinkerIterator, DObject)
public:
DThinkerIterator(PClass *cls = nullptr, int statnum = MAX_STATNUM + 1)
: FThinkerIterator(cls, statnum)
{
}
};
IMPLEMENT_CLASS(DThinkerIterator, false, false, false, false);
DEFINE_ACTION_FUNCTION(DThinkerIterator, Create)
{
PARAM_PROLOGUE;
PARAM_CLASS_DEF(type, DThinker);
PARAM_INT_DEF(statnum);
ACTION_RETURN_OBJECT(new DThinkerIterator(type, statnum));
}
DEFINE_ACTION_FUNCTION(DThinkerIterator, Next)
{
PARAM_SELF_PROLOGUE(DThinkerIterator);
ACTION_RETURN_OBJECT(self->Next());
}
DEFINE_ACTION_FUNCTION(DThinkerIterator, Reinit)
{
PARAM_SELF_PROLOGUE(DThinkerIterator);
self->Reinit();
return 0;
}
ADD_STAT (think)
{
FString out;

View File

@ -121,7 +121,7 @@ private:
public:
FThinkerIterator (const PClass *type, int statnum=MAX_STATNUM+1);
FThinkerIterator (const PClass *type, int statnum, DThinker *prev);
DThinker *Next ();
DThinker *Next (bool exact = false);
void Reinit ();
};
@ -146,9 +146,9 @@ public:
TThinkerIterator (const char *subclass, int statnum=MAX_STATNUM+1) : FThinkerIterator(PClass::FindClass(subclass), statnum)
{
}
T *Next ()
T *Next (bool exact = false)
{
return static_cast<T *>(FThinkerIterator::Next ());
return static_cast<T *>(FThinkerIterator::Next (exact));
}
};

View File

@ -1785,9 +1785,7 @@ public:
void Destroy() { Super::Destroy(); m_Sector->lightingdata=NULL; }
};
IMPLEMENT_CLASS (DLightLevel)
IMPLEMENT_CLASS(DLightLevel, false, false, false, false)
void DLightLevel::Serialize(FSerializer &arc)
{
@ -3636,7 +3634,7 @@ void FParser::SF_Pow()
{
if (CheckArgs(2))
{
t_return.setDouble(pow(floatvalue(t_argv[0]), floatvalue(t_argv[1])));
t_return.setDouble(g_pow(floatvalue(t_argv[0]), floatvalue(t_argv[1])));
}
}

View File

@ -71,9 +71,11 @@
//
//==========================================================================
IMPLEMENT_POINTY_CLASS(DFsSection)
DECLARE_POINTER(next)
END_POINTERS
IMPLEMENT_CLASS(DFsSection, false, true, false, false)
IMPLEMENT_POINTERS_START(DFsSection)
IMPLEMENT_POINTER(next)
IMPLEMENT_POINTERS_END
//==========================================================================
//

View File

@ -75,23 +75,23 @@ AActor *trigger_obj;
//
//==========================================================================
#define DECLARE_16_POINTERS(v, i) \
DECLARE_POINTER(v[i]) \
DECLARE_POINTER(v[i+1]) \
DECLARE_POINTER(v[i+2]) \
DECLARE_POINTER(v[i+3]) \
DECLARE_POINTER(v[i+4]) \
DECLARE_POINTER(v[i+5]) \
DECLARE_POINTER(v[i+6]) \
DECLARE_POINTER(v[i+7]) \
DECLARE_POINTER(v[i+8]) \
DECLARE_POINTER(v[i+9]) \
DECLARE_POINTER(v[i+10]) \
DECLARE_POINTER(v[i+11]) \
DECLARE_POINTER(v[i+12]) \
DECLARE_POINTER(v[i+13]) \
DECLARE_POINTER(v[i+14]) \
DECLARE_POINTER(v[i+15]) \
#define IMPLEMENT_16_POINTERS(v, i) \
IMPLEMENT_POINTER(v[i]) \
IMPLEMENT_POINTER(v[i+1]) \
IMPLEMENT_POINTER(v[i+2]) \
IMPLEMENT_POINTER(v[i+3]) \
IMPLEMENT_POINTER(v[i+4]) \
IMPLEMENT_POINTER(v[i+5]) \
IMPLEMENT_POINTER(v[i+6]) \
IMPLEMENT_POINTER(v[i+7]) \
IMPLEMENT_POINTER(v[i+8]) \
IMPLEMENT_POINTER(v[i+9]) \
IMPLEMENT_POINTER(v[i+10]) \
IMPLEMENT_POINTER(v[i+11]) \
IMPLEMENT_POINTER(v[i+12]) \
IMPLEMENT_POINTER(v[i+13]) \
IMPLEMENT_POINTER(v[i+14]) \
IMPLEMENT_POINTER(v[i+15]) \
//==========================================================================
//
@ -99,30 +99,32 @@ AActor *trigger_obj;
//
//==========================================================================
IMPLEMENT_POINTY_CLASS(DFsScript)
DECLARE_POINTER(parent)
DECLARE_POINTER(trigger)
DECLARE_16_POINTERS(sections, 0)
DECLARE_POINTER(sections[16])
DECLARE_16_POINTERS(variables, 0)
DECLARE_16_POINTERS(children, 0)
DECLARE_16_POINTERS(children, 16)
DECLARE_16_POINTERS(children, 32)
DECLARE_16_POINTERS(children, 48)
DECLARE_16_POINTERS(children, 64)
DECLARE_16_POINTERS(children, 80)
DECLARE_16_POINTERS(children, 96)
DECLARE_16_POINTERS(children, 112)
DECLARE_16_POINTERS(children, 128)
DECLARE_16_POINTERS(children, 144)
DECLARE_16_POINTERS(children, 160)
DECLARE_16_POINTERS(children, 176)
DECLARE_16_POINTERS(children, 192)
DECLARE_16_POINTERS(children, 208)
DECLARE_16_POINTERS(children, 224)
DECLARE_16_POINTERS(children, 240)
DECLARE_POINTER(children[256])
END_POINTERS
IMPLEMENT_CLASS(DFsScript, false, true, false, false)
IMPLEMENT_POINTERS_START(DFsScript)
IMPLEMENT_POINTER(parent)
IMPLEMENT_POINTER(trigger)
IMPLEMENT_16_POINTERS(sections, 0)
IMPLEMENT_POINTER(sections[16])
IMPLEMENT_16_POINTERS(variables, 0)
IMPLEMENT_16_POINTERS(children, 0)
IMPLEMENT_16_POINTERS(children, 16)
IMPLEMENT_16_POINTERS(children, 32)
IMPLEMENT_16_POINTERS(children, 48)
IMPLEMENT_16_POINTERS(children, 64)
IMPLEMENT_16_POINTERS(children, 80)
IMPLEMENT_16_POINTERS(children, 96)
IMPLEMENT_16_POINTERS(children, 112)
IMPLEMENT_16_POINTERS(children, 128)
IMPLEMENT_16_POINTERS(children, 144)
IMPLEMENT_16_POINTERS(children, 160)
IMPLEMENT_16_POINTERS(children, 176)
IMPLEMENT_16_POINTERS(children, 192)
IMPLEMENT_16_POINTERS(children, 208)
IMPLEMENT_16_POINTERS(children, 224)
IMPLEMENT_16_POINTERS(children, 240)
IMPLEMENT_POINTER(children[256])
IMPLEMENT_POINTERS_END
//==========================================================================
//
@ -267,12 +269,14 @@ void DFsScript::ParseScript(char *position)
//
//==========================================================================
IMPLEMENT_POINTY_CLASS(DRunningScript)
DECLARE_POINTER(prev)
DECLARE_POINTER(next)
DECLARE_POINTER(trigger)
DECLARE_16_POINTERS(variables, 0)
END_POINTERS
IMPLEMENT_CLASS(DRunningScript, false, true, false, false)
IMPLEMENT_POINTERS_START(DRunningScript)
IMPLEMENT_POINTER(prev)
IMPLEMENT_POINTER(next)
IMPLEMENT_POINTER(trigger)
IMPLEMENT_16_POINTERS(variables, 0)
IMPLEMENT_POINTERS_END
//==========================================================================
//
@ -375,10 +379,13 @@ void DRunningScript::Serialize(FSerializer &arc)
// The main thinker
//
//==========================================================================
IMPLEMENT_POINTY_CLASS(DFraggleThinker)
DECLARE_POINTER(RunningScripts)
DECLARE_POINTER(LevelScript)
END_POINTERS
IMPLEMENT_CLASS(DFraggleThinker, false, true, false, false)
IMPLEMENT_POINTERS_START(DFraggleThinker)
IMPLEMENT_POINTER(RunningScripts)
IMPLEMENT_POINTER(LevelScript)
IMPLEMENT_POINTERS_END
TObjPtr<DFraggleThinker> DFraggleThinker::ActiveThinker;

View File

@ -179,10 +179,12 @@ AActor* actorvalue(const svalue_t &svalue)
//
//==========================================================================
IMPLEMENT_POINTY_CLASS(DFsVariable)
DECLARE_POINTER (next)
DECLARE_POINTER (actor)
END_POINTERS
IMPLEMENT_CLASS(DFsVariable, false, true, false, false)
IMPLEMENT_POINTERS_START(DFsVariable)
IMPLEMENT_POINTER(next)
IMPLEMENT_POINTER(actor)
IMPLEMENT_POINTERS_END
//==========================================================================
//

View File

@ -1,30 +0,0 @@
/*
#include "actor.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
DEFINE_ACTION_FUNCTION(AActor, A_BspiAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindActor("ArachnotronPlasma"));
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BabyMetal)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "baby/walk", 1, ATTN_IDLE);
A_Chase (stack, self);
return 0;
}

View File

@ -1,160 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "p_local.h"
#include "s_sound.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
//
// PIT_VileCheck
// Detect a corpse that could be raised.
//
void A_Fire(AActor *self, double height);
//
// A_VileStart
//
DEFINE_ACTION_FUNCTION(AActor, A_VileStart)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_VOICE, "vile/start", 1, ATTN_NORM);
return 0;
}
//
// A_Fire
// Keep fire in front of player unless out of sight
//
DEFINE_ACTION_FUNCTION(AActor, A_StartFire)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "vile/firestrt", 1, ATTN_NORM);
A_Fire (self, 0);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_FireCrackle)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "vile/firecrkl", 1, ATTN_NORM);
A_Fire (self, 0);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Fire)
{
PARAM_ACTION_PROLOGUE;
PARAM_FLOAT_OPT(height) { height = 0; }
A_Fire(self, height);
return 0;
}
void A_Fire(AActor *self, double height)
{
AActor *dest;
dest = self->tracer;
if (dest == NULL || self->target == NULL)
return;
// don't move it if the vile lost sight
if (!P_CheckSight (self->target, dest, 0) )
return;
DVector3 newpos = dest->Vec3Angle(24., dest->Angles.Yaw, height);
self->SetOrigin(newpos, true);
}
//
// A_VileTarget
// Spawn the hellfire
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(fire, AActor) { fire = PClass::FindActor("ArchvileFire"); }
AActor *fog;
if (!self->target)
return 0;
A_FaceTarget (self);
fog = Spawn (fire, self->target->Pos(), ALLOW_REPLACE);
self->tracer = fog;
fog->target = self;
fog->tracer = self->target;
A_Fire(fog, 0);
return 0;
}
//
// A_VileAttack
//
// A_VileAttack flags
#define VAF_DMGTYPEAPPLYTODIRECT 1
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SOUND_OPT (snd) { snd = "vile/stop"; }
PARAM_INT_OPT (dmg) { dmg = 20; }
PARAM_INT_OPT (blastdmg) { blastdmg = 70; }
PARAM_INT_OPT (blastrad) { blastrad = 70; }
PARAM_FLOAT_OPT (thrust) { thrust = 1; }
PARAM_NAME_OPT (dmgtype) { dmgtype = NAME_Fire; }
PARAM_INT_OPT (flags) { flags = 0; }
AActor *fire, *target;
if (NULL == (target = self->target))
return 0;
A_FaceTarget (self);
if (!P_CheckSight (self, target, 0) )
return 0;
S_Sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
int newdam;
if (flags & VAF_DMGTYPEAPPLYTODIRECT)
newdam = P_DamageMobj (target, self, self, dmg, dmgtype);
else
newdam = P_DamageMobj (target, self, self, dmg, NAME_None);
P_TraceBleed (newdam > 0 ? newdam : dmg, target);
fire = self->tracer;
if (fire != NULL)
{
// move the fire between the vile and the player
DVector3 pos = target->Vec3Angle(-24., self->Angles.Yaw, 0);
fire->SetOrigin (pos, true);
P_RadiusAttack (fire, self, blastdmg, blastrad, dmgtype, 0);
}
if (!(target->flags7 & MF7_DONTTHRUST))
{
target->Vel.Z = thrust * 1000 / MAX(1, target->Mass);
}
return 0;
}

View File

@ -7,112 +7,17 @@
#include "s_sound.h"
#include "statnums.h"
#include "a_specialspot.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "doomstat.h"
#include "g_level.h"
*/
static FRandom pr_brainscream ("BrainScream");
static FRandom pr_brainexplode ("BrainExplode");
static FRandom pr_spawnfly ("SpawnFly");
DEFINE_ACTION_FUNCTION(AActor, A_BrainAwake)
{
PARAM_ACTION_PROLOGUE;
// killough 3/26/98: only generates sound now
S_Sound (self, CHAN_VOICE, "brain/sight", 1, ATTN_NONE);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BrainPain)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_VOICE, "brain/pain", 1, ATTN_NONE);
return 0;
}
static void BrainishExplosion (const DVector3 &pos)
{
AActor *boom = Spawn("Rocket", pos, NO_REPLACE);
if (boom != NULL)
{
boom->DeathSound = "misc/brainexplode";
boom->Vel.Z = pr_brainscream() /128.;
PClassActor *cls = PClass::FindActor("BossBrain");
if (cls != NULL)
{
FState *state = cls->FindState(NAME_Brainexplode);
if (state != NULL)
boom->SetState (state);
}
boom->effects = 0;
boom->SetDamage(0); // disables collision detection which is not wanted here
boom->tics -= pr_brainscream() & 7;
if (boom->tics < 1)
boom->tics = 1;
}
}
DEFINE_ACTION_FUNCTION(AActor, A_BrainScream)
{
PARAM_ACTION_PROLOGUE;
for (double x = -196; x < +320; x += 8)
{
// (1 / 512.) is actually what the original value of 128 did, even though it probably meant 128 map units.
BrainishExplosion(self->Vec2OffsetZ(x, -320, (1 / 512.) + pr_brainexplode() * 2));
}
S_Sound (self, CHAN_VOICE, "brain/death", 1, ATTN_NONE);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BrainExplode)
{
PARAM_ACTION_PROLOGUE;
double x = pr_brainexplode.Random2() / 32.;
DVector3 pos = self->Vec2OffsetZ(x, 0, 1 / 512. + pr_brainexplode() * 2);
BrainishExplosion(pos);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BrainDie)
{
PARAM_ACTION_PROLOGUE;
// [RH] If noexit, then don't end the level.
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
return 0;
// New dmflag: Kill all boss spawned monsters before ending the level.
if (dmflags2 & DF2_KILLBOSSMONST)
{
int count; // Repeat until we have no more boss-spawned monsters.
do // (e.g. Pain Elementals can spawn more to kill upon death.)
{
TThinkerIterator<AActor> it;
AActor *mo;
count = 0;
while ((mo = it.Next()))
{
if (mo->health > 0 && mo->flags4 & MF4_BOSSSPAWNED)
{
P_DamageMobj(mo, self, self, mo->health, NAME_None,
DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR);
count++;
}
}
} while (count != 0);
}
G_ExitLevel (0, false);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_DEF(spawntype, AActor);
DSpotState *state = DSpotState::GetSpotState();
AActor *targ;
@ -173,153 +78,3 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
return 0;
}
static void SpawnFly(AActor *self, PClassActor *spawntype, FSoundID sound)
{
AActor *newmobj;
AActor *fog;
AActor *eye = self->master; // The eye is the spawnshot's master, not the target!
AActor *targ = self->target; // Unlike other projectiles, the target is the intended destination.
int r;
// [GZ] Should be more viable than a countdown...
if (self->special2 != 0)
{
if (self->special2 > level.maptime)
return; // still flying
}
else
{
if (self->reactiontime == 0 || --self->reactiontime != 0)
return; // still flying
}
if (spawntype != NULL)
{
fog = Spawn (spawntype, targ->Pos(), ALLOW_REPLACE);
if (fog != NULL) S_Sound (fog, CHAN_BODY, sound, 1, ATTN_NORM);
}
FName SpawnName;
DDropItem *di; // di will be our drop item list iterator
DDropItem *drop; // while drop stays as the reference point.
int n = 0;
// First see if this cube has its own actor list
drop = self->GetDropItems();
// If not, then default back to its master's list
if (drop == NULL && eye != NULL)
drop = eye->GetDropItems();
if (drop != NULL)
{
for (di = drop; di != NULL; di = di->Next)
{
if (di->Name != NAME_None)
{
if (di->Amount < 0)
{
di->Amount = 1; // default value is -1, we need a positive value.
}
n += di->Amount; // this is how we can weight the list.
}
}
di = drop;
n = pr_spawnfly(n);
while (n >= 0)
{
if (di->Name != NAME_None)
{
n -= di->Amount; // logically, none of the -1 values have survived by now.
}
if ((di->Next != NULL) && (n >= 0))
{
di = di->Next;
}
else
{
n = -1;
}
}
SpawnName = di->Name;
}
if (SpawnName == NAME_None)
{
// Randomly select monster to spawn.
r = pr_spawnfly ();
// Probability distribution (kind of :),
// decreasing likelihood.
if (r < 50) SpawnName = "DoomImp";
else if (r < 90) SpawnName = "Demon";
else if (r < 120) SpawnName = "Spectre";
else if (r < 130) SpawnName = "PainElemental";
else if (r < 160) SpawnName = "Cacodemon";
else if (r < 162) SpawnName = "Archvile";
else if (r < 172) SpawnName = "Revenant";
else if (r < 192) SpawnName = "Arachnotron";
else if (r < 222) SpawnName = "Fatso";
else if (r < 246) SpawnName = "HellKnight";
else SpawnName = "BaronOfHell";
}
spawntype = PClass::FindActor(SpawnName);
if (spawntype != NULL)
{
newmobj = Spawn (spawntype, targ->Pos(), ALLOW_REPLACE);
if (newmobj != NULL)
{
// Make the new monster hate what the boss eye hates
if (eye != NULL)
{
newmobj->CopyFriendliness (eye, false);
}
// Make it act as if it was around when the player first made noise
// (if the player has made noise).
newmobj->LastHeard = newmobj->Sector->SoundTarget;
if (newmobj->SeeState != NULL && P_LookForPlayers (newmobj, true, NULL))
{
newmobj->SetState (newmobj->SeeState);
}
if (!(newmobj->ObjectFlags & OF_EuthanizeMe))
{
// telefrag anything in this spot
P_TeleportMove (newmobj, newmobj->Pos(), true);
}
newmobj->flags4 |= MF4_BOSSSPAWNED;
}
}
// remove self (i.e., cube).
self->Destroy ();
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnFly)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (spawntype, AActor) { spawntype = NULL; }
FSoundID sound;
if (spawntype != NULL)
{
sound = GetDefaultByType(spawntype)->SeeSound;
}
else
{
spawntype = PClass::FindActor("SpawnFire");
sound = "brain/spawn";
}
SpawnFly(self, spawntype, sound);
return 0;
}
// travelling cube sound
DEFINE_ACTION_FUNCTION(AActor, A_SpawnSound)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "brain/cube", 1, ATTN_IDLE);
SpawnFly(self, PClass::FindActor("SpawnFire"), "brain/spawn");
return 0;
}

View File

@ -1,23 +0,0 @@
static FRandom pr_bruisattack ("BruisAttack");
DEFINE_ACTION_FUNCTION(AActor, A_BruisAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
if (self->CheckMeleeRange ())
{
int damage = (pr_bruisattack()%8+1)*10;
S_Sound (self, CHAN_WEAPON, "baron/melee", 1, ATTN_NORM);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return 0;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindActor("BaronBall"));
return 0;
}

View File

@ -1,35 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "s_sound.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_headattack ("HeadAttack");
DEFINE_ACTION_FUNCTION(AActor, A_HeadAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = (pr_headattack()%6+1)*10;
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return 0;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindActor("CacodemonBall"));
return 0;
}

View File

@ -1,29 +0,0 @@
/*
#include "actor.h"
#include "p_local.h"
#include "s_sound.h"
#include "p_enemy.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
DEFINE_ACTION_FUNCTION(AActor, A_CyberAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindActor("Rocket"));
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Hoof)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "cyber/hoof", 1, ATTN_IDLE);
A_Chase (stack, self);
return 0;
}

View File

@ -1,29 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_sargattack ("SargAttack");
DEFINE_ACTION_FUNCTION(AActor, A_SargAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = ((pr_sargattack()%10)+1)*4;
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
}
return 0;
}

View File

@ -1,38 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_troopattack ("TroopAttack");
//
// A_TroopAttack
//
DEFINE_ACTION_FUNCTION(AActor, A_TroopAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = (pr_troopattack()%8+1)*3;
S_Sound (self, CHAN_WEAPON, "imp/melee", 1, ATTN_NORM);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return 0;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindActor("DoomImpBall"));
return 0;
}

View File

@ -7,7 +7,7 @@
#include "gi.h"
#include "doomstat.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
#include "p_enemy.h"
#include "a_doomglobal.h"
@ -19,41 +19,11 @@
#include "p_maputl.h"
#include "serializer.h"
#include "g_shared/a_pickups.h"
#include "vm.h"
// Include all the other Doom stuff here to reduce compile time
#include "a_arachnotron.cpp"
#include "a_archvile.cpp"
#include "a_bossbrain.cpp"
#include "a_bruiser.cpp"
#include "a_cacodemon.cpp"
#include "a_cyberdemon.cpp"
#include "a_demon.cpp"
#include "a_doomimp.cpp"
#include "a_doomweaps.cpp"
#include "a_fatso.cpp"
#include "a_keen.cpp"
#include "a_lostsoul.cpp"
#include "a_painelemental.cpp"
#include "a_possessed.cpp"
#include "a_revenant.cpp"
#include "a_spidermaster.cpp"
#include "a_scriptedmarine.cpp"
// The barrel of green goop ------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_BarrelDestroy)
{
PARAM_ACTION_PROLOGUE;
if (dmflags2 & DF2_BARRELS_RESPAWN)
{
self->Height = self->GetDefault()->Height;
self->renderflags |= RF_INVISIBLE;
self->flags &= ~MF_SOLID;
}
else
{
self->Destroy ();
}
return 0;
}

View File

@ -11,7 +11,7 @@
#include "p_effect.h"
#include "gi.h"
#include "templates.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "doomstat.h"
*/
@ -28,7 +28,7 @@ static FRandom pr_oldbfg ("OldBFG");
//
DEFINE_ACTION_FUNCTION(AActor, A_Punch)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -69,7 +69,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
//
DEFINE_ACTION_FUNCTION(AActor, A_FirePistol)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
bool accurate;
@ -115,18 +115,18 @@ enum SAW_Flags
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
{
PARAM_ACTION_PROLOGUE;
PARAM_SOUND_OPT (fullsound) { fullsound = "weapons/sawfull"; }
PARAM_SOUND_OPT (hitsound) { hitsound = "weapons/sawhit"; }
PARAM_INT_OPT (damage) { damage = 2; }
PARAM_CLASS_OPT (pufftype, AActor) { pufftype = NULL; }
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_FLOAT_OPT (range) { range = 0; }
PARAM_ANGLE_OPT (spread_xy) { spread_xy = 2.8125; }
PARAM_ANGLE_OPT (spread_z) { spread_z = 0.; }
PARAM_FLOAT_OPT (lifesteal) { lifesteal = 0; }
PARAM_INT_OPT (lifestealmax) { lifestealmax = 0; }
PARAM_CLASS_OPT (armorbonustype, ABasicArmorBonus) { armorbonustype = NULL; }
PARAM_ACTION_PROLOGUE(AActor);
PARAM_SOUND_DEF (fullsound)
PARAM_SOUND_DEF (hitsound)
PARAM_INT_DEF (damage)
PARAM_CLASS_DEF (pufftype, AActor)
PARAM_INT_DEF (flags)
PARAM_FLOAT_DEF (range)
PARAM_ANGLE_DEF (spread_xy)
PARAM_ANGLE_DEF (spread_z)
PARAM_FLOAT_DEF (lifesteal)
PARAM_INT_DEF (lifestealmax)
PARAM_CLASS_DEF (armorbonustype, ABasicArmorBonus)
DAngle angle;
DAngle slope;
@ -257,7 +257,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
//
DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
int i;
player_t *player;
@ -291,7 +291,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun)
//
DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
int i;
DAngle angle;
@ -336,29 +336,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_OpenShotgun2)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/sshoto", 1, ATTN_NORM);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_LoadShotgun2)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/sshotl", 1, ATTN_NORM);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CloseShotgun2)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/sshotc", 1, ATTN_NORM);
A_ReFire (self);
return 0;
}
//------------------------------------------------------------------------------------
//
// Setting a random flash like some of Doom's weapons can easily crash when the
@ -411,7 +388,7 @@ void P_SetSafeFlash(AWeapon *weapon, player_t *player, FState *flashstate, int i
//
DEFINE_ACTION_FUNCTION(AActor, A_FireCGun)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -456,7 +433,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCGun)
//
DEFINE_ACTION_FUNCTION(AActor, A_FireMissile)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -479,8 +456,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMissile)
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(grenade, AActor) { grenade = PClass::FindActor("Grenade"); }
PARAM_ACTION_PROLOGUE(AActor);
PARAM_CLASS_DEF(grenade, AActor);
player_t *player;
@ -511,7 +488,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade)
//
DEFINE_ACTION_FUNCTION(AActor, A_FirePlasma)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -574,38 +551,32 @@ static void FireRailgun(AActor *self, int offset_xy, bool fromweapon)
DEFINE_ACTION_FUNCTION(AActor, A_FireRailgun)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
FireRailgun(self, 0, ACTION_CALL_FROM_PSPRITE());
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_FireRailgunRight)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
FireRailgun(self, 10, ACTION_CALL_FROM_PSPRITE());
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_FireRailgunLeft)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
FireRailgun(self, -10, ACTION_CALL_FROM_PSPRITE());
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_RailWait)
{
// Okay, this was stupid. Just use a NULL function instead of this.
return 0;
}
//
// A_FireBFG
//
DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -638,15 +609,15 @@ enum BFG_Flags
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (spraytype, AActor) { spraytype = NULL; }
PARAM_INT_OPT (numrays) { numrays = 0; }
PARAM_INT_OPT (damagecnt) { damagecnt = 0; }
PARAM_ANGLE_OPT (angle) { angle = 0.; }
PARAM_FLOAT_OPT (distance) { distance = 0; }
PARAM_ANGLE_OPT (vrange) { vrange = 0.; }
PARAM_INT_OPT (defdamage) { defdamage = 0; }
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_DEF (spraytype, AActor)
PARAM_INT_DEF (numrays)
PARAM_INT_DEF (damagecnt)
PARAM_ANGLE_DEF (angle)
PARAM_FLOAT_DEF (distance)
PARAM_ANGLE_DEF (vrange)
PARAM_INT_DEF (defdamage)
PARAM_INT_DEF (flags)
int i;
int j;
@ -717,16 +688,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
return 0;
}
//
// A_BFGsound
//
DEFINE_ACTION_FUNCTION(AActor, A_BFGsound)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/bfgf", 1, ATTN_NORM);
return 0;
}
//
// A_FireOldBFG
//
@ -738,7 +699,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BFGsound)
DEFINE_ACTION_FUNCTION(AActor, A_FireOldBFG)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
PClassActor *plasma[] = { PClass::FindActor("PlasmaBall1"), PClass::FindActor("PlasmaBall2") };
AActor * mo = NULL;

View File

@ -1,177 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
//
// Mancubus attack,
// firing three missiles in three different directions?
// Doesn't look like it.
//
#define FATSPREAD (90./8)
DEFINE_ACTION_FUNCTION(AActor, A_FatRaise)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
S_Sound (self, CHAN_WEAPON, "fatso/raiseguns", 1, ATTN_NORM);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
AActor *missile;
if (!self->target)
return 0;
if (spawntype == NULL) spawntype = PClass::FindActor("FatShot");
A_FaceTarget (self);
// Change direction to ...
self->Angles.Yaw += FATSPREAD;
P_SpawnMissile (self, self->target, spawntype);
missile = P_SpawnMissile (self, self->target, spawntype);
if (missile != NULL)
{
missile->Angles.Yaw += FATSPREAD;
missile->VelFromAngle();
}
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
AActor *missile;
if (!self->target)
return 0;
if (spawntype == NULL) spawntype = PClass::FindActor("FatShot");
A_FaceTarget (self);
// Now here choose opposite deviation.
self->Angles.Yaw -= FATSPREAD;
P_SpawnMissile (self, self->target, spawntype);
missile = P_SpawnMissile (self, self->target, spawntype);
if (missile != NULL)
{
missile->Angles.Yaw -= FATSPREAD*2;
missile->VelFromAngle();
}
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
AActor *missile;
if (!self->target)
return 0;
if (spawntype == NULL) spawntype = PClass::FindActor("FatShot");
A_FaceTarget (self);
missile = P_SpawnMissile (self, self->target, spawntype);
if (missile != NULL)
{
missile->Angles.Yaw -= FATSPREAD/2;
missile->VelFromAngle();
}
missile = P_SpawnMissile (self, self->target, spawntype);
if (missile != NULL)
{
missile->Angles.Yaw += FATSPREAD/2;
missile->VelFromAngle();
}
return 0;
}
//
// killough 9/98: a mushroom explosion effect, sorta :)
// Original idea: Linguica
//
enum
{
MSF_Standard = 0,
MSF_Classic = 1,
MSF_DontHurt = 2,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (spawntype, AActor) { spawntype = NULL; }
PARAM_INT_OPT (n) { n = 0; }
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_FLOAT_OPT (vrange) { vrange = 4; }
PARAM_FLOAT_OPT (hrange) { hrange = 0.5; }
int i, j;
if (n == 0)
{
n = self->GetMissileDamage(0, 1);
}
if (spawntype == NULL)
{
spawntype = PClass::FindActor("FatShot");
}
P_RadiusAttack (self, self->target, 128, 128, self->DamageType, (flags & MSF_DontHurt) ? 0 : RADF_HURTSOURCE);
P_CheckSplash(self, 128.);
// Now launch mushroom cloud
AActor *target = Spawn("Mapspot", self->Pos(), NO_REPLACE); // We need something to aim at.
AActor *master = (flags & MSF_DontHurt) ? (AActor*)(self->target) : self;
target->Height = self->Height;
for (i = -n; i <= n; i += 8)
{
for (j = -n; j <= n; j += 8)
{
AActor *mo;
target->SetXYZ(
self->X() + i, // Aim in many directions from source
self->Y() + j,
self->Z() + (P_AproxDistance(i,j) * vrange)); // Aim up fairly high
if ((flags & MSF_Classic) || // Flag explicitely set, or no flags and compat options
(flags == 0 && (self->state->DefineFlags & SDF_DEHACKED) && (i_compatflags & COMPATF_MUSHROOM)))
{ // Use old function for MBF compatibility
mo = P_OldSpawnMissile (self, master, target, spawntype);
}
else // Use normal function
{
mo = P_SpawnMissile(self, target, spawntype, master);
}
if (mo != NULL)
{ // Slow it down a bit
mo->Vel *= hrange;
mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity
}
}
}
target->Destroy();
return 0;
}

View File

@ -1,42 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "p_local.h"
#include "p_spec.h"
#include "p_enemy.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
//
// A_KeenDie
// DOOM II special, map 32.
// Uses special tag 666 by default.
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KeenDie)
{
PARAM_ACTION_PROLOGUE;
PARAM_INT_OPT(doortag) { doortag = 666; }
A_Unblock(self, false);
// scan the remaining thinkers to see if all Keens are dead
AActor *other;
TThinkerIterator<AActor> iterator;
const PClass *matchClass = self->GetClass ();
while ( (other = iterator.Next ()) )
{
if (other != self && other->health > 0 && other->IsA (matchClass))
{
// other Keen not dead
return 0;
}
}
EV_DoDoor (DDoor::doorOpen, NULL, NULL, doortag, 2., 0, 0, 0);
return 0;
}

View File

@ -1,86 +0,0 @@
/*
#include "templates.h"
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gi.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
FRandom pr_oldsoul ("BetaLostSoul");
//
// SkullAttack
// Fly at the player like a missile.
//
void A_SkullAttack(AActor *self, double speed)
{
AActor *dest;
if (!self->target)
return;
dest = self->target;
self->flags |= MF_SKULLFLY;
S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM);
A_FaceTarget (self);
self->VelFromAngle(speed);
self->Vel.Z = (dest->Center() - self->Z()) / self->DistanceBySpeed(dest, speed);
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_FLOAT_OPT(speed) { speed = SKULLSPEED; }
if (speed <= 0)
speed = SKULLSPEED;
A_SkullAttack(self, speed);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BetaSkullAttack)
{
PARAM_ACTION_PROLOGUE;
int damage;
if (!self || !self->target || self->target->GetSpecies() == self->GetSpecies())
return 0;
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
A_FaceTarget(self);
damage = (pr_oldsoul()%8+1)*self->GetMissileDamage(0,1);
P_DamageMobj(self->target, self, self, damage, NAME_None);
return 0;
}
//==========================================================================
//
// CVAR transsouls
//
// How translucent things drawn with STYLE_SoulTrans are. Normally, only
// Lost Souls have this render style, but a dehacked patch could give other
// things this style. Values less than 0.25 will automatically be set to
// 0.25 to ensure some degree of visibility. Likewise, values above 1.0 will
// be set to 1.0, because anything higher doesn't make sense.
//
//==========================================================================
CUSTOM_CVAR (Float, transsouls, 0.75f, CVAR_ARCHIVE)
{
if (self < 0.25f)
{
self = 0.25f;
}
else if (self > 1.f)
{
self = 1.f;
}
}

View File

@ -6,7 +6,7 @@
#include "a_action.h"
#include "templates.h"
#include "m_bbox.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "doomstat.h"
*/
@ -21,7 +21,7 @@ enum PA_Flags
// A_PainShootSkull
// Spawn a lost soul and launch it at the target
//
void A_PainShootSkull (AActor *self, DAngle Angle, PClassActor *spawntype, int flags = 0, int limit = -1)
void A_PainShootSkull (VMFrameStack *stack, AActor *self, DAngle Angle, PClassActor *spawntype, int flags = 0, int limit = -1)
{
AActor *other;
double prestep;
@ -137,58 +137,22 @@ void A_PainShootSkull (AActor *self, DAngle Angle, PClassActor *spawntype, int f
other->CopyFriendliness (self, !(flags & PAF_NOTARGET));
if (!(flags & PAF_NOSKULLATTACK))
A_SkullAttack(other, SKULLSPEED);
}
//
// A_PainAttack
// Spawn a lost soul and launch it at the target
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
PARAM_CLASS_OPT (spawntype, AActor) { spawntype = NULL; }
PARAM_ANGLE_OPT (angle) { angle = 0.; }
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_INT_OPT (limit) { limit = -1; }
if (!(flags & PAF_AIMFACING))
A_FaceTarget (self);
A_PainShootSkull (self, self->Angles.Yaw + angle, spawntype, flags, limit);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
if (!self->target)
return 0;
A_FaceTarget (self);
A_PainShootSkull (self, self->Angles.Yaw + 45., spawntype);
A_PainShootSkull (self, self->Angles.Yaw - 45., spawntype);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
if (self->target != NULL && self->IsFriend(self->target))
{ // And I thought you were my friend!
self->flags &= ~MF_FRIENDLY;
{
DECLARE_VMFUNC(AActor, A_SkullAttack);
CallAction(stack, A_SkullAttack, other);
}
A_Unblock(self, true);
A_PainShootSkull (self, self->Angles.Yaw + 90, spawntype);
A_PainShootSkull (self, self->Angles.Yaw + 180, spawntype);
A_PainShootSkull (self, self->Angles.Yaw + 270, spawntype);
}
DEFINE_ACTION_FUNCTION(AActor, A_PainShootSkull)
{
PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS(spawntype, AActor);
PARAM_FLOAT(angle);
PARAM_INT_DEF(flags);
PARAM_INT_DEF(limit);
A_PainShootSkull(stack, self, angle, spawntype, flags, limit);
return 0;
}

View File

@ -1,134 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_posattack ("PosAttack");
static FRandom pr_sposattack ("SPosAttack");
static FRandom pr_cposattack ("CPosAttack");
static FRandom pr_cposrefire ("CPosRefire");
//
// A_PosAttack
//
DEFINE_ACTION_FUNCTION(AActor, A_PosAttack)
{
PARAM_ACTION_PROLOGUE;
int damage;
DAngle angle;
DAngle slope;
if (!self->target)
return 0;
A_FaceTarget (self);
angle = self->Angles.Yaw;
slope = P_AimLineAttack (self, angle, MISSILERANGE);
S_Sound (self, CHAN_WEAPON, "grunt/attack", 1, ATTN_NORM);
angle += pr_posattack.Random2() * (22.5 / 256);
damage = ((pr_posattack()%5)+1)*3;
P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_Hitscan, NAME_BulletPuff);
return 0;
}
static void A_SPosAttack2 (AActor *self)
{
int i;
DAngle bangle;
DAngle slope;
A_FaceTarget (self);
bangle = self->Angles.Yaw;
slope = P_AimLineAttack (self, bangle, MISSILERANGE);
for (i=0 ; i<3 ; i++)
{
DAngle angle = bangle + pr_sposattack.Random2() * (22.5 / 256);
int damage = ((pr_sposattack()%5)+1)*3;
P_LineAttack(self, angle, MISSILERANGE, slope, damage, NAME_Hitscan, NAME_BulletPuff);
}
}
DEFINE_ACTION_FUNCTION(AActor, A_SPosAttackUseAtkSound)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
A_SPosAttack2 (self);
return 0;
}
// This version of the function, which uses a hard-coded sound, is
// meant for Dehacked only.
DEFINE_ACTION_FUNCTION(AActor, A_SPosAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
S_Sound (self, CHAN_WEAPON, "shotguy/attack", 1, ATTN_NORM);
A_SPosAttack2 (self);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CPosAttack)
{
PARAM_ACTION_PROLOGUE;
DAngle angle;
DAngle bangle;
int damage;
DAngle slope;
if (!self->target)
return 0;
// [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH)
{
self->visdir = 1;
}
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
A_FaceTarget (self);
bangle = self->Angles.Yaw;
slope = P_AimLineAttack (self, bangle, MISSILERANGE);
angle = bangle + pr_cposattack.Random2() * (22.5 / 256);
damage = ((pr_cposattack()%5)+1)*3;
P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_Hitscan, NAME_BulletPuff);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CPosRefire)
{
PARAM_ACTION_PROLOGUE;
// keep firing unless target got out of sight
A_FaceTarget (self);
if (pr_cposrefire() < 40)
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;
}

View File

@ -1,152 +0,0 @@
/*
#include "templates.h"
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "gstrings.h"
#include "a_action.h"
#include "thingdef/thingdef.h"
#include "g_level.h"
*/
static FRandom pr_tracer ("Tracer");
static FRandom pr_skelfist ("SkelFist");
//
// A_SkelMissile
//
DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
{
PARAM_ACTION_PROLOGUE;
AActor *missile;
if (!self->target)
return 0;
A_FaceTarget (self);
self->AddZ(16.);
missile = P_SpawnMissile(self, self->target, PClass::FindActor("RevenantTracer"));
self->AddZ(-16.);
if (missile != NULL)
{
missile->SetOrigin(missile->Vec3Offset(missile->Vel.X, missile->Vel.Y, 0.), false);
missile->tracer = self->target;
}
return 0;
}
#define TRACEANGLE (16.875)
DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
{
PARAM_ACTION_PROLOGUE;
double dist;
double slope;
AActor *dest;
AActor *smoke;
// killough 1/18/98: this is why some missiles do not have smoke
// and some do. Also, internal demos start at random gametics, thus
// the bug in which revenants cause internal demos to go out of sync.
//
// killough 3/6/98: fix revenant internal demo bug by subtracting
// levelstarttic from gametic:
//
// [RH] level.time is always 0-based, so nothing special to do here.
if (level.time & 3)
return 0;
// spawn a puff of smoke behind the rocket
P_SpawnPuff (self, PClass::FindActor(NAME_BulletPuff), self->Pos(), self->Angles.Yaw, self->Angles.Yaw, 3);
smoke = Spawn ("RevenantTracerSmoke", self->Vec3Offset(-self->Vel.X, -self->Vel.Y, 0.), ALLOW_REPLACE);
smoke->Vel.Z = 1.;
smoke->tics -= pr_tracer()&3;
if (smoke->tics < 1)
smoke->tics = 1;
// adjust direction
dest = self->tracer;
if (!dest || dest->health <= 0 || self->Speed == 0 || !self->CanSeek(dest))
return 0;
// change angle
DAngle exact = self->AngleTo(dest);
DAngle diff = deltaangle(self->Angles.Yaw, exact);
if (diff < 0)
{
self->Angles.Yaw -= TRACEANGLE;
if (deltaangle(self->Angles.Yaw, exact) > 0)
self->Angles.Yaw = exact;
}
else if (diff > 0)
{
self->Angles.Yaw += TRACEANGLE;
if (deltaangle(self->Angles.Yaw, exact) < 0.)
self->Angles.Yaw = exact;
}
self->VelFromAngle();
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
{
// change slope
dist = self->DistanceBySpeed(dest, self->Speed);
if (dest->Height >= 56.)
{
slope = (dest->Z() + 40. - self->Z()) / dist;
}
else
{
slope = (dest->Z() + self->Height*(2./3) - self->Z()) / dist;
}
if (slope < self->Vel.Z)
self->Vel.Z -= 1. / 8;
else
self->Vel.Z += 1. / 8;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SkelWhoosh)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
S_Sound (self, CHAN_WEAPON, "skeleton/swing", 1, ATTN_NORM);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SkelFist)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
{
int damage = ((pr_skelfist()%10)+1)*6;
S_Sound (self, CHAN_WEAPON, "skeleton/melee", 1, ATTN_NORM);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
}
return 0;
}

View File

@ -7,7 +7,7 @@
#include "a_doomglobal.h"
#include "s_sound.h"
#include "r_data/r_translate.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -19,7 +19,7 @@ static FRandom pr_m_gunshot ("SMarineGunshot");
static FRandom pr_m_saw ("SMarineSaw");
static FRandom pr_m_fireshotgun2 ("SMarineFireSSG");
IMPLEMENT_CLASS (AScriptedMarine)
IMPLEMENT_CLASS(AScriptedMarine, false, false, false, false)
void AScriptedMarine::Serialize(FSerializer &arc)
{
@ -150,8 +150,8 @@ void AScriptedMarine::Tick ()
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Refire)
{
PARAM_ACTION_PROLOGUE;
PARAM_BOOL_OPT(ignoremissile) { ignoremissile = false; }
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(ignoremissile);
if (self->target == NULL || self->target->health <= 0)
{
@ -182,7 +182,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Refire)
DEFINE_ACTION_FUNCTION(AActor, A_M_SawRefire)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL || self->target->health <= 0)
{
@ -204,7 +204,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_SawRefire)
DEFINE_ACTION_FUNCTION(AActor, A_MarineNoise)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (static_cast<AScriptedMarine *>(self)->CurrentWeapon == AScriptedMarine::WEAPON_Chainsaw)
{
@ -221,7 +221,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MarineNoise)
DEFINE_ACTION_FUNCTION(AActor, A_MarineChase)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
CALL_ACTION(A_MarineNoise, self);
A_Chase (stack, self);
return 0;
@ -235,7 +235,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MarineChase)
DEFINE_ACTION_FUNCTION(AActor, A_MarineLook)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
CALL_ACTION(A_MarineNoise, self);
CALL_ACTION(A_Look, self);
return 0;
@ -249,11 +249,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_MarineLook)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Saw)
{
PARAM_ACTION_PROLOGUE;
PARAM_SOUND_OPT (fullsound) { fullsound = "weapons/sawfull"; }
PARAM_SOUND_OPT (hitsound) { hitsound = "weapons/sawhit"; }
PARAM_INT_OPT (damage) { damage = 2; }
PARAM_CLASS_OPT (pufftype, AActor) { pufftype = NULL; }
PARAM_SELF_PROLOGUE(AActor);
PARAM_SOUND_DEF (fullsound)
PARAM_SOUND_DEF (hitsound)
PARAM_INT_DEF (damage)
PARAM_CLASS_DEF (pufftype, AActor)
if (self->target == NULL)
return 0;
@ -347,7 +347,7 @@ static void MarinePunch(AActor *self, int damagemul)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Punch)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(mult);
MarinePunch(self, mult);
@ -384,7 +384,7 @@ void P_GunShot2 (AActor *mo, bool accurate, DAngle pitch, PClassActor *pufftype)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FirePistol)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL(accurate);
if (self->target == NULL)
@ -405,7 +405,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FirePistol)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
DAngle pitch;
@ -431,7 +431,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun)
DEFINE_ACTION_FUNCTION(AActor, A_M_CheckAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->special1 != 0 || self->target == NULL)
{
@ -452,7 +452,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_CheckAttack)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
DAngle pitch;
@ -483,7 +483,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun2)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FireCGun)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL(accurate);
if (self->target == NULL)
@ -508,7 +508,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FireCGun)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireMissile)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
return 0;
@ -533,7 +533,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireMissile)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireRailgun)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
return 0;
@ -551,7 +551,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireRailgun)
DEFINE_ACTION_FUNCTION(AActor, A_M_FirePlasma)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
return 0;
@ -570,7 +570,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FirePlasma)
DEFINE_ACTION_FUNCTION(AActor, A_M_BFGsound)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
return 0;
@ -597,7 +597,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_BFGsound)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireBFG)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
return 0;

View File

@ -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 "thingdef/thingdef.h"
*/
static FRandom pr_spidrefire ("SpidRefire");
DEFINE_ACTION_FUNCTION(AActor, A_SpidRefire)
{
PARAM_ACTION_PROLOGUE;
// 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_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "spider/walk", 1, ATTN_IDLE);
A_Chase (stack, self);
return 0;
}

View File

@ -11,7 +11,7 @@
#include "p_enemy.h"
#include "d_event.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
void P_UpdateBeak (AActor *actor);
@ -29,7 +29,7 @@ public:
void MorphPlayerThink ();
};
IMPLEMENT_CLASS(AChickenPlayer)
IMPLEMENT_CLASS(AChickenPlayer, false, false, false, false)
void AChickenPlayer::MorphPlayerThink ()
{
@ -66,7 +66,7 @@ void AChickenPlayer::MorphPlayerThink ()
DEFINE_ACTION_FUNCTION(AActor, A_ChicAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->target)
{
@ -89,7 +89,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChicAttack)
DEFINE_ACTION_FUNCTION(AActor, A_Feathers)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
int count;
@ -138,7 +138,7 @@ void P_UpdateBeak (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_BeakRaise)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -170,7 +170,7 @@ void P_PlayPeck (AActor *chicken)
DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -205,7 +205,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;

View File

@ -9,7 +9,7 @@
#include "a_sharedglobal.h"
#include "gstrings.h"
#include "a_specialspot.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -28,7 +28,7 @@ static FRandom pr_bluespark ("BlueSpark");
DEFINE_ACTION_FUNCTION(AActor, A_Sor1Pain)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->special1 = 20; // Number of steps to walk fast
CALL_ACTION(A_Pain, self);
@ -43,7 +43,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor1Pain)
DEFINE_ACTION_FUNCTION(AActor, A_Sor1Chase)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->special1)
{
@ -64,7 +64,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor1Chase)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
DAngle angle;
@ -120,7 +120,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
DEFINE_ACTION_FUNCTION(AActor, A_SorcererRise)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -173,7 +173,7 @@ void P_DSparilTeleport (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Decide)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
static const int chance[] =
{
@ -201,7 +201,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Decide)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int chance;
@ -243,7 +243,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
AActor *mo;
@ -266,7 +266,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark)
DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -301,7 +301,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
DEFINE_ACTION_FUNCTION(AActor, A_Sor2DthInit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->special1 = 7; // Animation loop counter
P_Massacre (); // Kill monsters early
@ -316,7 +316,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor2DthInit)
DEFINE_ACTION_FUNCTION(AActor, A_Sor2DthLoop)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (--self->special1)
{ // Need to loop

View File

@ -5,7 +5,7 @@
#include "gstrings.h"
#include "p_local.h"
#include "s_sound.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
// Tome of power ------------------------------------------------------------
@ -17,8 +17,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiTomeOfPower)
IMPLEMENT_CLASS(AArtiTomeOfPower, false, false, false, false)
bool AArtiTomeOfPower::Use (bool pickup)
{
@ -47,7 +46,7 @@ bool AArtiTomeOfPower::Use (bool pickup)
DEFINE_ACTION_FUNCTION(AActor, A_TimeBomb)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->AddZ(32, false);
self->RenderStyle = STYLE_Add;
@ -64,8 +63,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiTimeBomb)
IMPLEMENT_CLASS(AArtiTimeBomb, false, false, false, false)
bool AArtiTimeBomb::Use (bool pickup)
{

View File

@ -1,96 +0,0 @@
/*
#include "templates.h"
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_impmsatk ("ImpMsAttack");
static FRandom pr_imp ("ImpExplode");
//----------------------------------------------------------------------------
//
// PROC A_ImpMsAttack
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_ImpMsAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target || pr_impmsatk() > 64)
{
self->SetState (self->SeeState);
return 0;
}
A_SkullAttack(self, 12.);
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_ImpExplode
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
{
PARAM_ACTION_PROLOGUE;
AActor *chunk;
self->flags &= ~MF_NOGRAVITY;
chunk = Spawn("HereticImpChunk1", self->Pos(), ALLOW_REPLACE);
chunk->Vel.X = pr_imp.Random2() / 64.;
chunk->Vel.Y = pr_imp.Random2() / 64.;
chunk->Vel.Z = 9;
chunk = Spawn("HereticImpChunk2", self->Pos(), ALLOW_REPLACE);
chunk->Vel.X = pr_imp.Random2() / 64.;
chunk->Vel.Y = pr_imp.Random2() / 64.;
chunk->Vel.Z = 9;
if (self->special1 == 666)
{ // Extreme death crash
self->SetState (self->FindState("XCrash"));
}
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_ImpDeath
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_ImpDeath)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_SOLID;
self->flags2 |= MF2_FLOORCLIP;
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_ImpXDeath1
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_ImpXDeath1)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_SOLID;
self->flags |= MF_NOGRAVITY;
self->flags2 |= MF2_FLOORCLIP;
self->special1 = 666; // Flag the crash routine
return 0;
}

View File

@ -6,7 +6,7 @@
#include "p_local.h"
#include "s_sound.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "p_enemy.h"
#include "a_specialspot.h"
#include "g_level.h"
@ -18,16 +18,14 @@
#include "a_morph.h"
#include "p_spec.h"
#include "serializer.h"
#include "vm.h"
// Include all the other Heretic stuff here to reduce compile time
#include "a_chicken.cpp"
#include "a_dsparil.cpp"
#include "a_hereticartifacts.cpp"
#include "a_hereticimp.cpp"
#include "a_hereticweaps.cpp"
#include "a_ironlich.cpp"
#include "a_knight.cpp"
#include "a_wizard.cpp"
static FRandom pr_podpain ("PodPain");
@ -46,8 +44,8 @@ static FRandom pr_volcimpact ("VolcBallImpact");
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (gootype, AActor) { gootype = PClass::FindActor("PodGoo"); }
PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_DEF (gootype, AActor)
int count;
int chance;
@ -77,7 +75,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
DEFINE_ACTION_FUNCTION(AActor, A_RemovePod)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -101,8 +99,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_RemovePod)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(podtype, AActor) { podtype = PClass::FindActor("Pod"); }
PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_DEF(podtype, AActor)
AActor *mo;
@ -132,7 +130,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (++self->health > 35)
{
@ -150,7 +148,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
DEFINE_ACTION_FUNCTION(AActor, A_VolcanoSet)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->tics = 105 + (pr_volcano() & 127);
return 0;
@ -164,7 +162,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoSet)
DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
int count;
@ -192,7 +190,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
unsigned int i;
AActor *tiny;

View File

@ -11,7 +11,7 @@
#include "gstrings.h"
#include "gi.h"
#include "r_data/r_translate.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "doomstat.h"
*/
@ -61,7 +61,7 @@ extern bool P_AutoUseChaosDevice (player_t *player);
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
DAngle slope;
@ -107,7 +107,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -144,7 +144,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
int i;
DAngle angle;
@ -187,7 +187,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -216,7 +216,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -247,7 +247,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle Angle;
int damage;
@ -358,7 +358,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (AMaceFX4)
IMPLEMENT_CLASS(AMaceFX4, false, false, false, false)
int AMaceFX4::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -421,7 +421,7 @@ void FireMacePL1B (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
AActor *ball;
player_t *player;
@ -461,7 +461,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->special1 == 0)
{
@ -498,7 +498,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if ((self->health != MAGIC_JUNK) && (self->flags & MF_INBOUNCE))
{ // Bounce
@ -526,7 +526,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact)
DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *tiny;
@ -579,7 +579,7 @@ boom:
DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -618,7 +618,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
AActor *target;
@ -726,7 +726,7 @@ void ABlasterFX1::Effect ()
}
}
IMPLEMENT_CLASS(ABlasterFX1)
IMPLEMENT_CLASS(ABlasterFX1, false, false, false, false)
// Ripper -------------------------------------------------------------------
@ -738,7 +738,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS(ARipper)
IMPLEMENT_CLASS(ARipper, false, false, false, false)
int ARipper::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -761,7 +761,7 @@ int ARipper::DoSpecialDamage (AActor *target, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -798,7 +798,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
unsigned int i;
DAngle angle;
@ -828,7 +828,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (AHornRodFX2)
IMPLEMENT_CLASS(AHornRodFX2, false, false, false, false)
int AHornRodFX2::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -849,7 +849,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (ARainPillar)
IMPLEMENT_CLASS(ARainPillar, false, false, false, false)
int ARainPillar::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -871,7 +871,7 @@ public:
TObjPtr<AActor> Rain1, Rain2;
};
IMPLEMENT_CLASS (ARainTracker)
IMPLEMENT_CLASS(ARainTracker, false, false, false, false)
void ARainTracker::Serialize(FSerializer &arc)
{
@ -888,7 +888,7 @@ void ARainTracker::Serialize(FSerializer &arc)
DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -924,7 +924,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
AActor *MissileActor;
@ -964,7 +964,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
DEFINE_ACTION_FUNCTION(AActor, A_AddPlayerRain)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
ARainTracker *tracker;
@ -1024,7 +1024,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AddPlayerRain)
DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
ARainTracker *tracker;
@ -1095,7 +1095,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
DEFINE_ACTION_FUNCTION(AActor, A_RainImpact)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->Z() > self->floorz)
{
self->SetState (self->FindState("NotFloor"));
@ -1115,7 +1115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RainImpact)
DEFINE_ACTION_FUNCTION(AActor, A_HideInCeiling)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
// We use bouncecount to store the 3D floor index
double foo;
@ -1158,8 +1158,8 @@ public:
void EndPowerup ();
};
IMPLEMENT_CLASS (APhoenixRod)
IMPLEMENT_CLASS (APhoenixRodPowered)
IMPLEMENT_CLASS(APhoenixRod, false, false, false, false)
IMPLEMENT_CLASS(APhoenixRodPowered, false, false, false, false)
void APhoenixRodPowered::EndPowerup ()
{
@ -1177,8 +1177,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (APhoenixFX1)
IMPLEMENT_CLASS(APhoenixFX1, false, false, false, false)
int APhoenixFX1::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -1199,7 +1198,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (APhoenixFX2)
IMPLEMENT_CLASS(APhoenixFX2, false, false, false, false)
int APhoenixFX2::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -1218,7 +1217,7 @@ int APhoenixFX2::DoSpecialDamage (AActor *target, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -1246,7 +1245,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *puff;
DAngle angle;
@ -1271,7 +1270,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -1294,7 +1293,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
@ -1347,7 +1346,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_ShutdownPhoenixPL2)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -1373,7 +1372,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShutdownPhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Vel.Z += 1.5;
return 0;
@ -1387,7 +1386,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd)
DEFINE_ACTION_FUNCTION(AActor, A_FloatPuff)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Vel.Z += 1.8;
return 0;

View File

@ -7,7 +7,7 @@
#include "p_enemy.h"
#include "a_action.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -22,7 +22,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS(AWhirlwind)
IMPLEMENT_CLASS(AWhirlwind, false, false, false, false)
int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -63,7 +63,7 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
AActor *fire;
@ -143,7 +143,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->health -= 3;
if (self->health < 0)
@ -174,7 +174,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
unsigned int i;
AActor *shard;
@ -199,7 +199,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
DEFINE_ACTION_FUNCTION(AActor, A_LichFireGrow)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->health--;
self->AddZ(9.);

View File

@ -1,70 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "a_action.h"
#include "a_sharedglobal.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_dripblood ("DripBlood");
static FRandom pr_knightatk ("KnightAttack");
//----------------------------------------------------------------------------
//
// PROC A_DripBlood
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
double xo = pr_dripblood.Random2() / 32.;
double yo = pr_dripblood.Random2() / 32.;
mo = Spawn ("Blood", self->Vec3Offset(xo, yo, 0.), ALLOW_REPLACE);
mo->Vel.X = pr_dripblood.Random2 () / 64.;
mo->Vel.Y = pr_dripblood.Random2() / 64.;
mo->Gravity = 1./8;
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_KnightAttack
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_KnightAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return 0;
}
if (self->CheckMeleeRange ())
{
int damage = pr_knightatk.HitDice (3);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
S_Sound (self, CHAN_BODY, "hknight/melee", 1, ATTN_NORM);
return 0;
}
// Throw axe
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
if (self->flags & MF_SHADOW || pr_knightatk () < 40)
{ // Red axe
P_SpawnMissileZ (self, self->Z() + 36, self->target, PClass::FindActor("RedAxe"));
return 0;
}
// Green axe
P_SpawnMissileZ (self, self->Z() + 36, self->target, PClass::FindActor("KnightAxe"));
return 0;
}

View File

@ -1,95 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "s_sound.h"
#include "p_local.h"
#include "p_enemy.h"
#include "a_action.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_wizatk3 ("WizAtk3");
//----------------------------------------------------------------------------
//
// PROC A_GhostOff
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_GhostOff)
{
PARAM_ACTION_PROLOGUE;
self->RenderStyle = STYLE_Normal;
self->flags3 &= ~MF3_GHOST;
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_WizAtk1
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_WizAtk1)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
CALL_ACTION(A_GhostOff, self);
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_WizAtk2
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_WizAtk2)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
self->Alpha = HR_SHADOW;
self->RenderStyle = STYLE_Translucent;
self->flags3 |= MF3_GHOST;
return 0;
}
//----------------------------------------------------------------------------
//
// PROC A_WizAtk3
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
CALL_ACTION(A_GhostOff, self);
if (!self->target)
{
return 0;
}
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
if (self->CheckMeleeRange())
{
int damage = pr_wizatk3.HitDice (4);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return 0;
}
PClassActor *fx = PClass::FindActor("WizardFX1");
mo = P_SpawnMissile (self, self->target, fx);
if (mo != NULL)
{
P_SpawnMissileAngle(self, fx, mo->Angles.Yaw - 45. / 8, mo->Vel.Z);
P_SpawnMissileAngle(self, fx, mo->Angles.Yaw + 45. / 8, mo->Vel.Z);
}
return 0;
}

View File

@ -1,98 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "p_local.h"
#include "s_sound.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_batspawn ("BatSpawn");
static FRandom pr_batmove ("BatMove");
//===========================================================================
// Bat Spawner Variables
// special1 frequency counter
// special2
// args[0] frequency of spawn (1=fastest, 10=slowest)
// args[1] spread angle (0..255)
// args[2]
// args[3] duration of bats (in octics)
// args[4] turn amount per move (in degrees)
//
// Bat Variables
// special2 lifetime counter
// args[4] turn amount per move (in degrees)
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BatSpawnInit)
{
PARAM_ACTION_PROLOGUE;
self->special1 = 0; // Frequency count
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BatSpawn)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int delta;
DAngle angle;
// Countdown until next spawn
if (self->special1-- > 0) return 0;
self->special1 = self->args[0]; // Reset frequency count
delta = self->args[1];
if (delta==0) delta=1;
angle = self->Angles.Yaw + (((pr_batspawn() % delta) - (delta >> 1)) * (360 / 256.));
mo = P_SpawnMissileAngle (self, PClass::FindActor("Bat"), angle, 0);
if (mo)
{
mo->args[0] = pr_batspawn()&63; // floatbob index
mo->args[4] = self->args[4]; // turn degrees
mo->special2 = self->args[3]<<3; // Set lifetime
mo->target = self;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BatMove)
{
PARAM_ACTION_PROLOGUE;
DAngle newangle;
if (self->special2 < 0)
{
self->SetState (self->FindState(NAME_Death));
}
self->special2 -= 2; // Called every 2 tics
if (pr_batmove()<128)
{
newangle = self->Angles.Yaw + self->args[4];
}
else
{
newangle = self->Angles.Yaw - self->args[4];
}
// Adjust velocity vector to new direction
self->VelFromAngle(newangle, self->Speed);
if (pr_batmove()<15)
{
S_Sound (self, CHAN_VOICE, "BatScream", 1, ATTN_IDLE);
}
// Handle Z movement
self->SetZ(self->target->Z() + 2 * BobSin(self->args[0]));
self->args[0] = (self->args[0]+3)&63;
return 0;
}

View File

@ -1,230 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "p_local.h"
#include "s_sound.h"
#include "a_action.h"
#include "m_random.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_boom ("BishopBoom");
static FRandom pr_atk ("BishopAttack");
static FRandom pr_decide ("BishopDecide");
static FRandom pr_doblur ("BishopDoBlur");
static FRandom pr_sblur ("BishopSpawnBlur");
static FRandom pr_pain ("BishopPainBlur");
//============================================================================
//
// A_BishopAttack
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return 0;
}
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
if (self->CheckMeleeRange())
{
int damage = pr_atk.HitDice (4);
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
return 0;
}
self->special1 = (pr_atk() & 3) + 5;
return 0;
}
//============================================================================
//
// A_BishopAttack2
//
// Spawns one of a string of bishop missiles
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if (!self->target || !self->special1)
{
self->special1 = 0;
self->SetState (self->SeeState);
return 0;
}
mo = P_SpawnMissile (self, self->target, PClass::FindActor("BishopFX"));
if (mo != NULL)
{
mo->tracer = self->target;
}
self->special1--;
return 0;
}
//============================================================================
//
// A_BishopMissileWeave
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopMissileWeave)
{
PARAM_ACTION_PROLOGUE;
A_Weave(self, 2, 2, 2., 1.);
return 0;
}
//============================================================================
//
// A_BishopDecide
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopDecide)
{
PARAM_ACTION_PROLOGUE;
if (pr_decide() < 220)
{
return 0;
}
else
{
self->SetState (self->FindState ("Blur"));
}
return 0;
}
//============================================================================
//
// A_BishopDoBlur
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopDoBlur)
{
PARAM_ACTION_PROLOGUE;
self->special1 = (pr_doblur() & 3) + 3; // Random number of blurs
if (pr_doblur() < 120)
{
self->Thrust(self->Angles.Yaw + 90, 11);
}
else if (pr_doblur() > 125)
{
self->Thrust(self->Angles.Yaw - 90, 11);
}
else
{ // Thrust forward
self->Thrust(11);
}
S_Sound (self, CHAN_BODY, "BishopBlur", 1, ATTN_NORM);
return 0;
}
//============================================================================
//
// A_BishopSpawnBlur
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if (!--self->special1)
{
self->Vel.X = self->Vel.Y = 0;
if (pr_sblur() > 96)
{
self->SetState (self->SeeState);
}
else
{
self->SetState (self->MissileState);
}
}
mo = Spawn ("BishopBlur", self->Pos(), ALLOW_REPLACE);
if (mo)
{
mo->Angles.Yaw = self->Angles.Yaw;
}
return 0;
}
//============================================================================
//
// A_BishopChase
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopChase)
{
PARAM_ACTION_PROLOGUE;
double newz = self->Z() - BobSin(self->special2) / 2.;
self->special2 = (self->special2 + 4) & 63;
newz += BobSin(self->special2) / 2.;
self->SetZ(newz);
return 0;
}
//============================================================================
//
// A_BishopPuff
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopPuff)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn ("BishopPuff", self->PosPlusZ(40.), ALLOW_REPLACE);
if (mo)
{
mo->Vel.Z = -.5;
}
return 0;
}
//============================================================================
//
// A_BishopPainBlur
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_BishopPainBlur)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if (pr_pain() < 64)
{
self->SetState (self->FindState ("Blur"));
return 0;
}
double xo = pr_pain.Random2() / 16.;
double yo = pr_pain.Random2() / 16.;
double zo = pr_pain.Random2() / 32.;
mo = Spawn ("BishopPainBlur", self->Vec3Offset(xo, yo, zo), ALLOW_REPLACE);
if (mo)
{
mo->Angles.Yaw = self->Angles.Yaw;
}
return 0;
}

View File

@ -95,13 +95,13 @@ enum
DEFINE_ACTION_FUNCTION_PARAMS (AActor, A_Blast)
{
PARAM_ACTION_PROLOGUE;
PARAM_INT_OPT (blastflags) { blastflags = 0; }
PARAM_FLOAT_OPT (strength) { strength = 255; }
PARAM_FLOAT_OPT (radius) { radius = 255; }
PARAM_FLOAT_OPT (speed) { speed = 20; }
PARAM_CLASS_OPT (blasteffect, AActor) { blasteffect = PClass::FindActor("BlastEffect"); }
PARAM_SOUND_OPT (blastsound) { blastsound = "BlastRadius"; }
PARAM_ACTION_PROLOGUE(AActor);
PARAM_INT_DEF (blastflags)
PARAM_FLOAT_DEF (strength)
PARAM_FLOAT_DEF (radius)
PARAM_FLOAT_DEF (speed)
PARAM_CLASS_DEF (blasteffect, AActor)
PARAM_SOUND_DEF (blastsound)
AActor *mo;
TThinkerIterator<AActor> iterator;

View File

@ -17,7 +17,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiBoostArmor)
IMPLEMENT_CLASS(AArtiBoostArmor, false, false, false, false)
bool AArtiBoostArmor::Use (bool pickup)
{

View File

@ -1,30 +0,0 @@
/*
#include "actor.h"
#include "p_enemy.h"
#include "a_action.h"
#include "m_random.h"
#include "thingdef/thingdef.h"
*/
static FRandom pr_centaurdefend ("CentaurDefend");
//============================================================================
//
// A_CentaurDefend
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_CentaurDefend)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
if (self->CheckMeleeRange() && pr_centaurdefend() < 32)
{
// This should unset REFLECTIVE as well
// (unless you want the Centaur to reflect projectiles forever!)
self->flags2&=~(MF2_REFLECTIVE|MF2_INVULNERABLE);
self->SetState (self->MeleeState);
}
return 0;
}

View File

@ -10,7 +10,7 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
const double FLAMESPEED = 0.45;
@ -33,7 +33,7 @@ public:
void Effect ();
};
IMPLEMENT_CLASS (ACFlameMissile)
IMPLEMENT_CLASS(ACFlameMissile, false, false, false, false)
void ACFlameMissile::BeginPlay ()
{
@ -66,7 +66,7 @@ void ACFlameMissile::Effect ()
DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -93,7 +93,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->renderflags &= ~RF_INVISIBLE;
self->Vel.Zero();
@ -109,7 +109,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff)
DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
DAngle an;
@ -159,10 +159,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
DEFINE_ACTION_FUNCTION(AActor, A_CFlameRotate)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
DAngle an = self->Angles.Yaw + 90.;
self->VelFromAngle(an, FLAMEROTSPEED);
self->VelFromAngle(FLAMEROTSPEED, an);
self->Vel += DVector2(self->specialf1, self->specialf2);
self->Angles.Yaw += 6.;

View File

@ -7,7 +7,7 @@
#include "a_hexenglobal.h"
#include "gstrings.h"
#include "a_weaponpiece.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
#include "doomstat.h"
*/
@ -58,11 +58,11 @@ public:
BYTE CHolyCount;
};
IMPLEMENT_CLASS (ACWeapWraithverge)
IMPLEMENT_CLASS(ACWeapWraithverge, false, false, false, false)
// Holy Spirit --------------------------------------------------------------
IMPLEMENT_CLASS (AHolySpirit)
IMPLEMENT_CLASS(AHolySpirit, false, false, false, false)
bool AHolySpirit::Slam(AActor *thing)
{
@ -131,7 +131,7 @@ bool AHolySpirit::SpecialBlastHandling (AActor *source, double strength)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int j;
AActor *mo;
@ -211,7 +211,7 @@ void SpawnSpiritTail (AActor *spirit)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
FTranslatedLineTarget t;
@ -245,7 +245,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyPalette)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -328,7 +328,7 @@ static void CHolyTailRemove (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyTail)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *parent;
@ -446,7 +446,7 @@ static void CHolySeekerMissile (AActor *actor, DAngle thresh, DAngle turnMax)
DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->health--;
if (self->health <= 0)
@ -481,7 +481,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyCheckScream)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
CALL_ACTION(A_CHolySeek, self);
if (pr_checkscream() < 20)
@ -504,7 +504,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyCheckScream)
DEFINE_ACTION_FUNCTION(AActor, A_ClericAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->target) return 0;

View File

@ -2,7 +2,7 @@
#include "m_random.h"
#include "p_local.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_maceatk ("CMaceAttack");
@ -15,7 +15,7 @@ static FRandom pr_maceatk ("CMaceAttack");
DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;

View File

@ -10,7 +10,7 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_staffcheck ("CStaffCheck");
@ -25,7 +25,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (ACStaffMissile)
IMPLEMENT_CLASS(ACStaffMissile, false, false, false, false)
int ACStaffMissile::DoSpecialDamage (AActor *target, int damage, FName damagetype)
{
@ -46,7 +46,7 @@ int ACStaffMissile::DoSpecialDamage (AActor *target, int damage, FName damagetyp
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
APlayerPawn *pmo;
int damage;
@ -115,7 +115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -153,7 +153,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
A_Weave(self, 3, 0, 1., 0.);
return 0;
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
self->weaponspecial = (pr_blink()>>1)+20;
return 0;
@ -181,7 +181,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheckBlink)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
if (self->player && self->player->ReadyWeapon)
{

View File

@ -6,7 +6,7 @@
#include "a_action.h"
#include "m_random.h"
#include "s_sound.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_dragonseek ("DragonSeek");
@ -150,7 +150,7 @@ static void DragonSeek (AActor *actor, DAngle thresh, DAngle turnMax)
DEFINE_ACTION_FUNCTION(AActor, A_DragonInitFlight)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
FActorIterator iterator (self->tid);
@ -175,7 +175,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonInitFlight)
DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
DAngle angle;
@ -216,7 +216,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
DEFINE_ACTION_FUNCTION(AActor, A_DragonFlap)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
CALL_ACTION(A_DragonFlight, self);
if (pr_dragonflap() < 240)
@ -238,7 +238,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlap)
DEFINE_ACTION_FUNCTION(AActor, A_DragonAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
P_SpawnMissile (self, self->target, PClass::FindActor("DragonFireball"));
return 0;
@ -252,7 +252,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonAttack)
DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int i;
@ -283,7 +283,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2)
DEFINE_ACTION_FUNCTION(AActor, A_DragonPain)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
CALL_ACTION(A_Pain, self);
if (!self->tracer)
@ -301,7 +301,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonPain)
DEFINE_ACTION_FUNCTION(AActor, A_DragonCheckCrash)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->Z() <= self->floorz)
{

View File

@ -10,20 +10,15 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
DECLARE_ACTION(A_Raise)
#define AXERANGE (2.25 * MELEERANGE)
static FRandom pr_axeatk ("FAxeAtk");
void A_FAxeCheckReady (AActor *actor);
void A_FAxeCheckUp (AActor *actor);
void A_FAxeCheckAtk (AActor *actor);
void A_FAxeCheckReadyG (AActor *actor);
void A_FAxeCheckUpG (AActor *actor);
void A_FAxeAttack (AActor *actor);
// The Fighter's Axe --------------------------------------------------------
class AFWeapAxe : public AFighterWeapon
@ -36,7 +31,7 @@ public:
FState *GetAtkState (bool hold);
};
IMPLEMENT_CLASS (AFWeapAxe)
IMPLEMENT_CLASS(AFWeapAxe, false, false, false, false)
FState *AFWeapAxe::GetUpState ()
{
@ -66,7 +61,7 @@ FState *AFWeapAxe::GetAtkState (bool hold)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -93,7 +88,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -120,7 +115,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -147,7 +142,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -174,7 +169,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckAtk)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -197,7 +192,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckAtk)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int power;

View File

@ -10,7 +10,7 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
const double HAMMER_RANGE = 1.5 * MELEERANGE;
@ -25,7 +25,7 @@ static FRandom pr_hammeratk ("FHammerAtk");
DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -95,7 +95,7 @@ hammerdone:
DEFINE_ACTION_FUNCTION(AActor, A_FHammerThrow)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
AActor *mo;
player_t *player;

View File

@ -8,12 +8,12 @@
#include "p_local.h"
#include "a_action.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
IMPLEMENT_CLASS (AFighterWeapon)
IMPLEMENT_CLASS (AClericWeapon)
IMPLEMENT_CLASS (AMageWeapon)
IMPLEMENT_CLASS(AFighterWeapon, false, false, false, false)
IMPLEMENT_CLASS(AClericWeapon, false, false, false, false)
IMPLEMENT_CLASS(AMageWeapon, false, false, false, false)
static FRandom pr_fpatk ("FPunchAttack");
@ -99,7 +99,7 @@ static bool TryPunch(APlayerPawn *pmo, DAngle angle, int damage, int power)
DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
int damage;
int i;

View File

@ -10,7 +10,7 @@
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "a_weaponpiece.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_quietusdrop ("QuietusDrop");
@ -59,7 +59,7 @@ public:
int DoSpecialDamage(AActor *victim, int damage, FName damagetype);
};
IMPLEMENT_CLASS (AFSwordMissile)
IMPLEMENT_CLASS(AFSwordMissile, false, false, false, false)
int AFSwordMissile::DoSpecialDamage(AActor *victim, int damage, FName damagetype)
{
@ -78,7 +78,7 @@ int AFSwordMissile::DoSpecialDamage(AActor *victim, int damage, FName damagetype
DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
player_t *player;
@ -109,7 +109,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
@ -131,7 +131,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames)
DEFINE_ACTION_FUNCTION(AActor, A_FighterAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->target) return 0;

View File

@ -1,248 +0,0 @@
/*
#include "actor.h"
#include "info.h"
#include "p_local.h"
#include "s_sound.h"
#include "p_enemy.h"
#include "a_action.h"
#include "m_random.h"
#include "thingdef/thingdef.h"
*/
#define FIREDEMON_ATTACK_RANGE (64*8.)
static FRandom pr_firedemonrock ("FireDemonRock");
static FRandom pr_smbounce ("SMBounce");
static FRandom pr_firedemonchase ("FiredChase");
static FRandom pr_firedemonsplotch ("FiredSplotch");
//============================================================================
// Fire Demon AI
//
// special1 index into floatbob
// special2 whether strafing or not
//============================================================================
//============================================================================
//
// A_FiredSpawnRock
//
//============================================================================
void A_FiredSpawnRock (AActor *actor)
{
AActor *mo;
PClassActor *rtype;
switch (pr_firedemonrock() % 5)
{
case 0:
rtype = PClass::FindActor("FireDemonRock1");
break;
case 1:
rtype = PClass::FindActor("FireDemonRock2");
break;
case 2:
rtype = PClass::FindActor("FireDemonRock3");
break;
case 3:
rtype = PClass::FindActor("FireDemonRock4");
break;
case 4:
default:
rtype = PClass::FindActor("FireDemonRock5");
break;
}
double xo = (pr_firedemonrock() - 128) / 16.;
double yo = (pr_firedemonrock() - 128) / 16.;
double zo = pr_firedemonrock() / 32.;
mo = Spawn (rtype, actor->Vec3Offset(xo, yo, zo), ALLOW_REPLACE);
if (mo)
{
mo->target = actor;
mo->Vel.X = (pr_firedemonrock() - 128) / 64.;
mo->Vel.Y = (pr_firedemonrock() - 128) / 64.;
mo->Vel.Z = (pr_firedemonrock() / 64.);
mo->special1 = 2; // Number bounces
}
// Initialize fire demon
actor->special2 = 0;
actor->flags &= ~MF_JUSTATTACKED;
}
//============================================================================
//
// A_FiredRocks
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_FiredRocks)
{
PARAM_ACTION_PROLOGUE;
A_FiredSpawnRock (self);
A_FiredSpawnRock (self);
A_FiredSpawnRock (self);
A_FiredSpawnRock (self);
A_FiredSpawnRock (self);
return 0;
}
//============================================================================
//
// A_SmBounce
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SmBounce)
{
PARAM_ACTION_PROLOGUE;
// give some more velocity (x,y,&z)
self->SetZ(self->floorz + 1);
self->Vel.Z = 2. + pr_smbounce() / 64.;
self->Vel.X = pr_smbounce() % 3;
self->Vel.Y = pr_smbounce() % 3;
return 0;
}
//============================================================================
//
// A_FiredAttack
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_FiredAttack)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return 0;
AActor *mo = P_SpawnMissile (self, self->target, PClass::FindActor("FireDemonMissile"));
if (mo) S_Sound (self, CHAN_BODY, "FireDemonAttack", 1, ATTN_NORM);
return 0;
}
//============================================================================
//
// A_FiredChase
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
{
PARAM_ACTION_PROLOGUE;
int weaveindex = self->special1;
AActor *target = self->target;
DAngle ang;
double dist;
if (self->reactiontime) self->reactiontime--;
if (self->threshold) self->threshold--;
// Float up and down
self->AddZ(BobSin(weaveindex));
self->special1 = (weaveindex + 2) & 63;
// Ensure it stays above certain height
if (self->Z() < self->floorz + 64)
{
self->AddZ(2);
}
if(!self->target || !(self->target->flags&MF_SHOOTABLE))
{ // Invalid target
P_LookForPlayers (self,true, NULL);
return 0;
}
// Strafe
if (self->special2 > 0)
{
self->special2--;
}
else
{
self->special2 = 0;
self->Vel.X = self->Vel.Y = 0;
dist = self->Distance2D(target);
if (dist < FIREDEMON_ATTACK_RANGE)
{
if (pr_firedemonchase() < 30)
{
ang = self->AngleTo(target);
if (pr_firedemonchase() < 128)
ang += 90;
else
ang -= 90;
self->Thrust(ang, 8);
self->special2 = 3; // strafe time
}
}
}
FaceMovementDirection (self);
// Normal movement
if (!self->special2)
{
if (--self->movecount<0 || !P_Move (self))
{
P_NewChaseDir (self);
}
}
// Do missile attack
if (!(self->flags & MF_JUSTATTACKED))
{
if (P_CheckMissileRange (self) && (pr_firedemonchase() < 20))
{
self->SetState (self->MissileState);
self->flags |= MF_JUSTATTACKED;
return 0;
}
}
else
{
self->flags &= ~MF_JUSTATTACKED;
}
// make active sound
if (pr_firedemonchase() < 3)
{
self->PlayActiveSound ();
}
return 0;
}
//============================================================================
//
// A_FiredSplotch
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn ("FireDemonSplotch1", self->Pos(), ALLOW_REPLACE);
if (mo)
{
mo->Vel.X = (pr_firedemonsplotch() - 128) / 32.;
mo->Vel.Y = (pr_firedemonsplotch() - 128) / 32.;
mo->Vel.Z = (pr_firedemonsplotch() / 64.) + 3;
}
mo = Spawn ("FireDemonSplotch2", self->Pos(), ALLOW_REPLACE);
if (mo)
{
mo->Vel.X = (pr_firedemonsplotch() - 128) / 32.;
mo->Vel.Y = (pr_firedemonsplotch() - 128) / 32.;
mo->Vel.Z = (pr_firedemonsplotch() / 64.) + 3;
}
return 0;
}

View File

@ -10,7 +10,7 @@
#include "a_action.h"
#include "a_hexenglobal.h"
#include "w_wad.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -24,7 +24,7 @@ DECLARE_ACTION(A_CheckThrowBomb)
// Poison Bag Artifact (Flechette) ------------------------------------------
IMPLEMENT_CLASS (AArtiPoisonBag)
IMPLEMENT_CLASS(AArtiPoisonBag, false, false, false, false)
// Poison Bag 1 (The Cleric's) ----------------------------------------------
@ -35,7 +35,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiPoisonBag1)
IMPLEMENT_CLASS(AArtiPoisonBag1, false, false, false, false)
bool AArtiPoisonBag1::Use (bool pickup)
{
@ -60,7 +60,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiPoisonBag2)
IMPLEMENT_CLASS(AArtiPoisonBag2, false, false, false, false)
bool AArtiPoisonBag2::Use (bool pickup)
{
@ -85,7 +85,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiPoisonBag3)
IMPLEMENT_CLASS(AArtiPoisonBag3, false, false, false, false)
bool AArtiPoisonBag3::Use (bool pickup)
{
@ -136,7 +136,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiPoisonBagGiver)
IMPLEMENT_CLASS(AArtiPoisonBagGiver, false, false, false, false)
bool AArtiPoisonBagGiver::Use (bool pickup)
{
@ -167,7 +167,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiPoisonBagShooter)
IMPLEMENT_CLASS(AArtiPoisonBagShooter, false, false, false, false)
bool AArtiPoisonBagShooter::Use (bool pickup)
{
@ -296,7 +296,7 @@ public:
void BeginPlay ();
};
IMPLEMENT_CLASS (APoisonCloud)
IMPLEMENT_CLASS(APoisonCloud, false, false, false, false)
void APoisonCloud::BeginPlay ()
{
@ -362,7 +362,7 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage, FName damagetype)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -382,7 +382,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagCheck)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (--self->special1 <= 0)
{
@ -403,7 +403,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagCheck)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int bobIndex;
@ -422,7 +422,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage)
DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (--self->health <= 0)
{
@ -439,7 +439,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb)
DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
// [RH] Check using actual velocity, although the vel.z < 2 check still stands
if (self->Vel.Z < 2 && self->Vel.LengthSquared() < (9./4.))

View File

@ -60,7 +60,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlySearch)
// So search the sectors instead. We can't potentially find something all
// the way on the other side of the map and we can't find invisible corpses,
// but at least we aren't crippled on maps with lots of stuff going on.
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
validcount++;
AActor *other = FindCorpse(self, self->Sector, 5);
@ -74,7 +74,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlySearch)
DEFINE_ACTION_FUNCTION(AActor, A_FlyBuzz)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *targ = self->target;

View File

@ -1,7 +1,7 @@
/*
#include "m_random.h"
#include "p_local.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_fogspawn ("FogSpawn");
@ -27,7 +27,7 @@ static FRandom pr_fogspawn ("FogSpawn");
DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
static const char *fogs[3] =
{
@ -70,7 +70,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
DEFINE_ACTION_FUNCTION(AActor, A_FogMove)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
double speed = self->args[0];
int weaveindex;

View File

@ -25,7 +25,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiHealingRadius)
IMPLEMENT_CLASS(AArtiHealingRadius, false, false, false, false)
bool AArtiHealingRadius::Use (bool pickup)
{

View File

@ -7,7 +7,7 @@
#include "m_random.h"
#include "a_hexenglobal.h"
#include "i_system.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -72,7 +72,7 @@ public:
void Die (AActor *source, AActor *inflictor, int dmgflags);
};
IMPLEMENT_CLASS (AHeresiarch)
IMPLEMENT_CLASS(AHeresiarch, false, false, false, false)
void AHeresiarch::Serialize(FSerializer &arc)
{
@ -122,7 +122,7 @@ public:
}
};
IMPLEMENT_CLASS (ASorcBall)
IMPLEMENT_CLASS(ASorcBall, false, false, false, false)
// First ball (purple) - fires projectiles ----------------------------------
@ -140,7 +140,7 @@ public:
virtual void CastSorcererSpell ();
};
IMPLEMENT_CLASS (ASorcBall1)
IMPLEMENT_CLASS(ASorcBall1, false, false, false, false)
// Second ball (blue) - generates the shield --------------------------------
@ -156,7 +156,7 @@ public:
virtual void CastSorcererSpell ();
};
IMPLEMENT_CLASS (ASorcBall2)
IMPLEMENT_CLASS(ASorcBall2, false, false, false, false)
// Third ball (green) - summons Bishops -------------------------------------
@ -172,7 +172,7 @@ public:
virtual void CastSorcererSpell ();
};
IMPLEMENT_CLASS (ASorcBall3)
IMPLEMENT_CLASS(ASorcBall3, false, false, false, false)
// Sorcerer spell 1 (The burning, bouncing head thing) ----------------------
@ -218,7 +218,7 @@ void ASorcBall1::DoFireSpell ()
DEFINE_ACTION_FUNCTION(AActor, A_SorcSpinBalls)
{
PARAM_ACTION_PROLOGUE_TYPE(AHeresiarch);
PARAM_SELF_PROLOGUE(AHeresiarch);
AActor *mo;
@ -254,7 +254,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcSpinBalls)
DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
{
PARAM_ACTION_PROLOGUE_TYPE(ASorcBall);
PARAM_SELF_PROLOGUE(ASorcBall);
// [RH] If no parent, then die instead of crashing
if (self->target == NULL)
@ -380,7 +380,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
DEFINE_ACTION_FUNCTION(AActor, A_SpeedBalls)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->args[3] = SORC_ACCELERATE; // speed mode
self->args[2] = SORCBALL_TERMINAL_SPEED; // target speed
@ -676,7 +676,7 @@ void A_SorcOffense2(AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_SorcBossAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->args[3] = SORC_ACCELERATE;
self->args[2] = SORCBALL_INITIAL_SPEED;
@ -693,7 +693,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBossAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int speed = (int)self->Speed;
DAngle rangle;
AActor *mo;
@ -725,7 +725,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX1Seek)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
A_DoBounceCheck (self, "SorcererHeadScream");
P_SeekerMissile(self, 2, 6);
@ -751,7 +751,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX1Seek)
// Split ball in two
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -785,7 +785,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
DAngle angle;
DVector3 pos;
@ -852,7 +852,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnBishop)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
mo = Spawn("Bishop", self->Pos(), ALLOW_REPLACE);
@ -881,7 +881,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnBishop)
DEFINE_ACTION_FUNCTION(AActor, A_SorcererBishopEntry)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
Spawn("SorcFX3Explosion", self->Pos(), ALLOW_REPLACE);
S_Sound (self, CHAN_VOICE, self->SeeSound, 1, ATTN_NORM);
@ -898,7 +898,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcererBishopEntry)
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX4Check)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->special2-- <= 0)
{
@ -917,7 +917,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX4Check)
DEFINE_ACTION_FUNCTION(AActor, A_SorcBallPop)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE);
self->flags &= ~MF_NOGRAVITY;
@ -961,7 +961,7 @@ void A_DoBounceCheck (AActor *self, const char *sound)
DEFINE_ACTION_FUNCTION(AActor, A_BounceCheck)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
A_DoBounceCheck (self, "SorcererBigBallExplode");
return 0;

View File

@ -7,7 +7,7 @@
#include "a_sharedglobal.h"
#include "a_hexenglobal.h"
#include "i_system.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "gi.h"
#include "g_level.h"
#include "p_enemy.h"
@ -24,13 +24,11 @@
#include "p_maputl.h"
#include "p_spec.h"
#include "serializer.h"
#include "vm.h"
// Include all the Hexen stuff here to reduce compile time
#include "a_bats.cpp"
#include "a_bishop.cpp"
#include "a_blastradius.cpp"
#include "a_boostarmor.cpp"
#include "a_centaur.cpp"
#include "a_clericflame.cpp"
#include "a_clericholy.cpp"
#include "a_clericmace.cpp"
@ -40,7 +38,6 @@
#include "a_fighterhammer.cpp"
#include "a_fighterplayer.cpp"
#include "a_fighterquietus.cpp"
#include "a_firedemon.cpp"
#include "a_flechette.cpp"
#include "a_flies.cpp"
#include "a_fog.cpp"

View File

@ -11,7 +11,7 @@
#include "p_local.h"
#include "p_lnspec.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
#include "doomstat.h"
*/
@ -39,7 +39,7 @@ public:
void HitFloor ();
};
IMPLEMENT_CLASS (APottery1)
IMPLEMENT_CLASS(APottery1, false, false, false, false)
void APottery1::HitFloor ()
{
@ -55,7 +55,7 @@ void APottery1::HitFloor ()
DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo = NULL;
int i;
@ -93,7 +93,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
DEFINE_ACTION_FUNCTION(AActor, A_PotteryChooseBit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->SetState (self->FindState(NAME_Death) + 1 + 2*(pr_bit()%5));
self->tics = 256+(pr_bit()<<1);
@ -108,7 +108,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryChooseBit)
DEFINE_ACTION_FUNCTION(AActor, A_PotteryCheck)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
@ -136,7 +136,7 @@ public:
void PostBeginPlay ();
};
IMPLEMENT_CLASS (AZCorpseLynchedNoHeart)
IMPLEMENT_CLASS(AZCorpseLynchedNoHeart, false, false, false, false)
void AZCorpseLynchedNoHeart::PostBeginPlay ()
{
@ -152,7 +152,7 @@ void AZCorpseLynchedNoHeart::PostBeginPlay ()
DEFINE_ACTION_FUNCTION(AActor, A_CorpseBloodDrip)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (pr_drip() <= 128)
{
@ -169,7 +169,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseBloodDrip)
DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int i;
@ -207,7 +207,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int i;
@ -238,7 +238,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (pr_leafthrust() <= 96)
{
@ -255,7 +255,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust)
DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->special1++;
if (self->special1 >= 20)
@ -287,7 +287,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonShroom)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->tics = 128 + (pr_shroom() << 1);
return 0;
@ -301,7 +301,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonShroom)
DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int i;
@ -344,7 +344,7 @@ public:
void Activate (AActor *activator);
};
IMPLEMENT_CLASS (AZBell)
IMPLEMENT_CLASS(AZBell, false, false, false, false)
void AZBell::Activate (AActor *activator)
{
@ -362,7 +362,7 @@ void AZBell::Activate (AActor *activator)
DEFINE_ACTION_FUNCTION(AActor, A_BellReset1)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->flags |= MF_NOGRAVITY;
self->Height *= 4;
@ -383,7 +383,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BellReset1)
DEFINE_ACTION_FUNCTION(AActor, A_BellReset2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->flags |= MF_SHOOTABLE;
self->flags &= ~MF_CORPSE;

View File

@ -6,7 +6,7 @@
#include "p_enemy.h"
#include "a_action.h"
#include "m_random.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_iceguylook ("IceGuyLook");
@ -26,7 +26,7 @@ static const char *WispTypes[2] =
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyLook)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
double dist;
DAngle an;
@ -49,7 +49,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyLook)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
double dist;
DAngle an;
@ -78,7 +78,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if(!self->target)
{
@ -98,7 +98,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Vel.Zero();
self->Height = self->GetDefault()->Height;
@ -114,7 +114,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyMissileExplode)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
unsigned int i;

View File

@ -25,7 +25,7 @@
#include "a_action.h"
#include "m_random.h"
#include "i_system.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -88,7 +88,7 @@ extern void SpawnSpiritTail (AActor *spirit);
DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *spot;
@ -155,7 +155,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxBonePop)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int i;
@ -201,7 +201,7 @@ void KSpiritInit (AActor *spirit, AActor *korax)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxDecide)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (pr_koraxdecide()<220)
{
@ -222,7 +222,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxDecide)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxMissile)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
static const struct { const char *type, *sound; } choices[6] =
{
@ -265,7 +265,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxMissile)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxCommand)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
DAngle ang;
int numcommands;
@ -399,7 +399,7 @@ static void A_KSpiritSeeker (AActor *actor, DAngle thresh, DAngle turnMax)
DEFINE_ACTION_FUNCTION(AActor, A_KSpiritRoam)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->health-- <= 0)
{
@ -432,7 +432,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KSpiritRoam)
DEFINE_ACTION_FUNCTION(AActor, A_KBolt)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
// Countdown lifetime
if (self->special1-- <= 0)
@ -450,7 +450,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KBolt)
DEFINE_ACTION_FUNCTION(AActor, A_KBoltRaise)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;

View File

@ -10,7 +10,7 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
const int SHARDSPAWN_LEFT = 1;
@ -32,7 +32,7 @@ public:
int DoSpecialDamage (AActor *victim, int damage, FName damagetype);
};
IMPLEMENT_CLASS (AFrostMissile)
IMPLEMENT_CLASS(AFrostMissile, false, false, false, false)
int AFrostMissile::DoSpecialDamage (AActor *victim, int damage, FName damagetype)
{
@ -51,7 +51,7 @@ int AFrostMissile::DoSpecialDamage (AActor *victim, int damage, FName damagetype
DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -112,7 +112,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int spawndir = self->special1;

View File

@ -10,7 +10,7 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -34,7 +34,7 @@ public:
int SpecialMissileHit (AActor *victim);
};
IMPLEMENT_CLASS(ALightning)
IMPLEMENT_CLASS(ALightning, false, false, false, false)
int ALightning::SpecialMissileHit (AActor *thing)
{
@ -87,7 +87,7 @@ public:
int SpecialMissileHit (AActor *thing);
};
IMPLEMENT_CLASS (ALightningZap)
IMPLEMENT_CLASS(ALightningZap, false, false, false, false)
int ALightningZap::SpecialMissileHit (AActor *thing)
{
@ -126,7 +126,7 @@ int ALightningZap::SpecialMissileHit (AActor *thing)
DEFINE_ACTION_FUNCTION(AActor, A_LightningReady)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DoReadyWeapon(self);
if (pr_lightningready() < 160)
@ -144,7 +144,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningReady)
DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *cMo;
AActor *target = NULL;
@ -211,7 +211,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
PClassActor *lightning = PClass::FindActor(self->GetClass()->MissileName);
AActor *mo;
@ -257,9 +257,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(floor, AActor) { floor = PClass::FindActor("LightningFloor"); }
PARAM_CLASS_OPT(ceiling, AActor) { ceiling = PClass::FindActor("LightningCeiling"); }
PARAM_ACTION_PROLOGUE(AActor);
PARAM_CLASS_DEF(floor, AActor);
PARAM_CLASS_DEF(ceiling, AActor);
AActor *fmo, *cmo;
@ -298,7 +298,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -326,7 +326,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
PClassActor *lightning = PClass::FindActor(self->GetClass()->MissileName);
AActor *mo;
@ -353,7 +353,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
DEFINE_ACTION_FUNCTION(AActor, A_LightningRemove)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;

View File

@ -7,7 +7,7 @@
#include "a_hexenglobal.h"
#include "gstrings.h"
#include "a_weaponpiece.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "doomstat.h"
*/
@ -56,7 +56,7 @@ public:
BYTE MStaffCount;
};
IMPLEMENT_CLASS (AMWeapBloodscourge)
IMPLEMENT_CLASS(AMWeapBloodscourge, false, false, false, false)
// Mage Staff FX2 (Bloodscourge) --------------------------------------------
@ -68,7 +68,7 @@ public:
bool SpecialBlastHandling (AActor *source, double strength);
};
IMPLEMENT_CLASS (AMageStaffFX2)
IMPLEMENT_CLASS(AMageStaffFX2, false, false, false, false)
int AMageStaffFX2::SpecialMissileHit (AActor *victim)
{
@ -122,7 +122,7 @@ void MStaffSpawn (AActor *pmo, DAngle angle, AActor *alttarget)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
player_t *player;
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffPalette)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
if (self->player != NULL)
{
@ -188,7 +188,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffPalette)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffTrack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if ((self->tracer == 0) && (pr_mstafftrack()<50))
{
@ -250,7 +250,7 @@ void MStaffSpawn2 (AActor *actor, DAngle angle)
DEFINE_ACTION_FUNCTION(AActor, A_MageAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
{

View File

@ -11,7 +11,7 @@
#include "p_enemy.h"
#include "d_event.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_snoutattack ("SnoutAttack");
@ -27,7 +27,7 @@ public:
void MorphPlayerThink ();
};
IMPLEMENT_CLASS (APigPlayer)
IMPLEMENT_CLASS(APigPlayer, false, false, false, false)
void APigPlayer::MorphPlayerThink ()
{
@ -58,7 +58,7 @@ void APigPlayer::MorphPlayerThink ()
DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_ACTION_PROLOGUE(AActor);
DAngle angle;
int damage;
@ -96,7 +96,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
DEFINE_ACTION_FUNCTION(AActor, A_PigPain)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
CALL_ACTION(A_Pain, self);
if (self->Z() <= self->floorz)

View File

@ -7,7 +7,7 @@
#include "a_action.h"
#include "m_random.h"
#include "p_terrain.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_serpentchase ("SerpentChase");
@ -25,7 +25,7 @@ static FRandom pr_delaygib ("DelayGib");
DEFINE_ACTION_FUNCTION(AActor, A_SerpentUnHide)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->renderflags &= ~RF_INVISIBLE;
self->Floorclip = 24;
@ -40,7 +40,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentUnHide)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHide)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->renderflags |= RF_INVISIBLE;
self->Floorclip = 0;
@ -56,7 +56,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentHide)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentRaiseHump)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Floorclip -= 4;
return 0;
@ -70,7 +70,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentRaiseHump)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentLowerHump)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Floorclip += 4;
return 0;
@ -86,7 +86,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentLowerHump)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHumpDecide)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->MissileState != NULL)
{
@ -127,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentHumpDecide)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentCheckForAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->target)
{
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentCheckForAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentChooseAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->target || self->CheckMeleeRange())
{
@ -188,7 +188,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentChooseAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentMeleeAttack)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->target)
{
@ -216,7 +216,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentMeleeAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
static const char *GibTypes[] =
@ -250,7 +250,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
DEFINE_ACTION_FUNCTION(AActor, A_FloatGib)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Floorclip -= 1;
return 0;
@ -264,7 +264,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FloatGib)
DEFINE_ACTION_FUNCTION(AActor, A_SinkGib)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Floorclip += 1;;
return 0;
@ -278,7 +278,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SinkGib)
DEFINE_ACTION_FUNCTION(AActor, A_DelayGib)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->tics -= pr_delaygib()>>2;
return 0;
@ -292,7 +292,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DelayGib)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHeadCheck)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->Z() <= self->floorz)
{

View File

@ -7,7 +7,7 @@
#include "a_sharedglobal.h"
#include "s_sound.h"
#include "m_bbox.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_thrustraise ("ThrustRaise");
@ -31,9 +31,11 @@ public:
TObjPtr<AActor> DirtClump;
};
IMPLEMENT_POINTY_CLASS (AThrustFloor)
DECLARE_POINTER (DirtClump)
END_POINTERS
IMPLEMENT_CLASS(AThrustFloor, false, true, false, false)
IMPLEMENT_POINTERS_START(AThrustFloor)
IMPLEMENT_POINTER(DirtClump)
IMPLEMENT_POINTERS_END
void AThrustFloor::Serialize(FSerializer &arc)
{
@ -79,7 +81,7 @@ void AThrustFloor::Deactivate (AActor *activator)
DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitUp)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->special2 = 5; // Raise speed
self->args[0] = 1; // Mark as up
@ -92,7 +94,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitUp)
DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitDn)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->special2 = 5; // Raise speed
self->args[0] = 0; // Mark as down
@ -108,7 +110,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitDn)
DEFINE_ACTION_FUNCTION(AActor, A_ThrustRaise)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AThrustFloor *actor = static_cast<AThrustFloor *>(self);
@ -137,7 +139,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustRaise)
DEFINE_ACTION_FUNCTION(AActor, A_ThrustLower)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (A_SinkMobj (self, 6))
{
@ -152,7 +154,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustLower)
DEFINE_ACTION_FUNCTION(AActor, A_ThrustImpale)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
// This doesn't need to iterate through portals.

View File

@ -6,7 +6,7 @@
#include "p_local.h"
#include "s_sound.h"
#include "ravenshared.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
*/
@ -21,7 +21,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiDarkServant)
IMPLEMENT_CLASS(AArtiDarkServant, false, false, false, false)
//============================================================================
//
@ -49,7 +49,7 @@ bool AArtiDarkServant::Use (bool pickup)
DEFINE_ACTION_FUNCTION(AActor, A_Summon)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AMinotaurFriend *mo;

View File

@ -7,7 +7,7 @@
#include "s_sound.h"
#include "p_lnspec.h"
#include "m_random.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
#include "doomstat.h"
*/
@ -34,7 +34,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiTeleportOther)
IMPLEMENT_CLASS(AArtiTeleportOther, false, false, false, false)
// Teleport Other FX --------------------------------------------------------
@ -45,7 +45,7 @@ public:
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
};
IMPLEMENT_CLASS (ATelOtherFX1)
IMPLEMENT_CLASS(ATelOtherFX1, false, false, false, false)
static void TeloSpawn (AActor *source, const char *type)
{
@ -63,35 +63,35 @@ static void TeloSpawn (AActor *source, const char *type)
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnA)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
TeloSpawn (self, "TelOtherFX2");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnB)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
TeloSpawn (self, "TelOtherFX3");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnC)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
TeloSpawn (self, "TelOtherFX4");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnD)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
TeloSpawn (self, "TelOtherFX5");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CheckTeleRing)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->special1-- <= 0)
{

View File

@ -7,7 +7,7 @@
#include "a_action.h"
#include "m_random.h"
#include "a_sharedglobal.h"
#include "thingdef/thingdef.h"
#include "vm.h"
*/
static FRandom pr_stealhealth ("StealHealth");
@ -23,7 +23,7 @@ static FRandom pr_wraithfx4 ("WraithFX4");
DEFINE_ACTION_FUNCTION(AActor, A_WraithInit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->AddZ(48);
@ -45,7 +45,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithInit)
DEFINE_ACTION_FUNCTION(AActor, A_WraithRaiseInit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->renderflags &= ~RF_INVISIBLE;
self->flags2 &= ~MF2_NONSHOOTABLE;
@ -63,7 +63,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithRaiseInit)
DEFINE_ACTION_FUNCTION(AActor, A_WraithRaise)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (A_RaiseMobj (self, 2))
{
@ -88,7 +88,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithRaise)
DEFINE_ACTION_FUNCTION(AActor, A_WraithMelee)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int amount;
@ -110,7 +110,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithMelee)
DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
DAngle angle;
@ -147,7 +147,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
DEFINE_ACTION_FUNCTION(AActor, A_WraithFX3)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
int numdropped = pr_wraithfx3() % 15;
@ -242,7 +242,7 @@ void A_WraithFX4 (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_WraithChase)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int weaveindex = self->WeaveIndexZ;
self->AddZ(BobSin(weaveindex));

View File

@ -903,7 +903,7 @@ public:
void Tick ();
};
IMPLEMENT_CLASS (DAutosaver)
IMPLEMENT_CLASS(DAutosaver, false, false, false, false)
void DAutosaver::Tick ()
{
@ -1848,6 +1848,58 @@ void FLevelLocals::AddScroller (int secnum)
}
}
//==========================================================================
//
// sets up the script-side version of FLevelLocals
// Since this is a global variable and the script compiler does
// not allow defining them, it will be fully set up here.
//
//==========================================================================
void G_InitLevelLocalsForScript()
{
PStruct *lstruct = NewStruct("LevelLocals", nullptr);
PField *levelf = new PField("level", lstruct, VARF_Native | VARF_Static, (intptr_t)&level);
GlobalSymbols.AddSymbol(levelf);
// This only exports a selection of fields. Not everything here is useful to the playsim.
lstruct->AddNativeField("time", TypeSInt32, myoffsetof(FLevelLocals, time), VARF_ReadOnly);
lstruct->AddNativeField("maptime", TypeSInt32, myoffsetof(FLevelLocals, maptime), VARF_ReadOnly);
lstruct->AddNativeField("totaltime", TypeSInt32, myoffsetof(FLevelLocals, totaltime), VARF_ReadOnly);
lstruct->AddNativeField("starttime", TypeSInt32, myoffsetof(FLevelLocals, starttime), VARF_ReadOnly);
lstruct->AddNativeField("partime", TypeSInt32, myoffsetof(FLevelLocals, partime), VARF_ReadOnly);
lstruct->AddNativeField("sucktime", TypeSInt32, myoffsetof(FLevelLocals, sucktime), VARF_ReadOnly);
lstruct->AddNativeField("cluster", TypeSInt32, myoffsetof(FLevelLocals, cluster), VARF_ReadOnly);
lstruct->AddNativeField("clusterflags", TypeSInt32, myoffsetof(FLevelLocals, clusterflags), VARF_ReadOnly);
lstruct->AddNativeField("levelnum", TypeSInt32, myoffsetof(FLevelLocals, levelnum), VARF_ReadOnly);
//lstruct->AddNativeField("levelname", TypeString, myoffsetof(FLevelLocals, LevelName), VARF_ReadOnly); // must use an access function to resolve string table references.
lstruct->AddNativeField("mapname", TypeString, myoffsetof(FLevelLocals, MapName), VARF_ReadOnly);
lstruct->AddNativeField("nextmap", TypeString, myoffsetof(FLevelLocals, NextMap));
lstruct->AddNativeField("nextsecretmap", TypeString, myoffsetof(FLevelLocals, NextSecretMap));
lstruct->AddNativeField("maptype", TypeSInt32, myoffsetof(FLevelLocals, maptype), VARF_ReadOnly);
lstruct->AddNativeField("monsterstelefrag", TypeSInt32, myoffsetof(FLevelLocals, flags), VARF_ReadOnly, LEVEL_MONSTERSTELEFRAG);
lstruct->AddNativeField("actownspecial", TypeSInt32, myoffsetof(FLevelLocals, flags), VARF_ReadOnly, LEVEL_ACTOWNSPECIAL);
lstruct->AddNativeField("sndseqtotalctrl", TypeSInt32, myoffsetof(FLevelLocals, flags), VARF_ReadOnly, LEVEL_SNDSEQTOTALCTRL);
lstruct->AddNativeField("allmap", TypeSInt32, myoffsetof(FLevelLocals, flags2), 0, (LEVEL2_ALLMAP));
lstruct->AddNativeField("missilesactivateimpact", TypeSInt32, myoffsetof(FLevelLocals, flags2), 0, LEVEL2_MISSILESACTIVATEIMPACT);
lstruct->AddNativeField("monsterfallingdamage", TypeSInt32, myoffsetof(FLevelLocals, flags2), 0, LEVEL2_MONSTERFALLINGDAMAGE);
lstruct->AddNativeField("checkswitchrange", TypeSInt32, myoffsetof(FLevelLocals, flags2), 0, LEVEL2_CHECKSWITCHRANGE);
lstruct->AddNativeField("polygrind", TypeSInt32, myoffsetof(FLevelLocals, flags2), 0, LEVEL2_POLYGRIND);
lstruct->AddNativeField("music", TypeString, myoffsetof(FLevelLocals, Music), VARF_ReadOnly);
lstruct->AddNativeField("musicorder", TypeSInt32, myoffsetof(FLevelLocals, musicorder), VARF_ReadOnly);
lstruct->AddNativeField("total_secrets", TypeSInt32, myoffsetof(FLevelLocals, total_secrets), VARF_ReadOnly);
lstruct->AddNativeField("found_secrets", TypeSInt32, myoffsetof(FLevelLocals, found_secrets));
lstruct->AddNativeField("total_items", TypeSInt32, myoffsetof(FLevelLocals, total_items), VARF_ReadOnly);
lstruct->AddNativeField("found_items", TypeSInt32, myoffsetof(FLevelLocals, found_items));
lstruct->AddNativeField("total_monsters", TypeSInt32, myoffsetof(FLevelLocals, total_monsters), VARF_ReadOnly);
lstruct->AddNativeField("killed_monsters", TypeSInt32, myoffsetof(FLevelLocals, killed_monsters));
lstruct->AddNativeField("gravity", TypeFloat64, myoffsetof(FLevelLocals, gravity));
lstruct->AddNativeField("aircontrol", TypeFloat64, myoffsetof(FLevelLocals, aircontrol));
lstruct->AddNativeField("airfriction", TypeFloat64, myoffsetof(FLevelLocals, airfriction));
lstruct->AddNativeField("airsupply", TypeSInt32, myoffsetof(FLevelLocals, airsupply));
lstruct->AddNativeField("teamdamage", TypeFloat64, myoffsetof(FLevelLocals, teamdamage));
}
//==========================================================================
//
// Lists all currently defined maps

View File

@ -110,6 +110,7 @@ struct FMapInfoParser
void ParseAMColors(bool);
FName CheckEndSequence();
FName ParseEndGame();
void ParseDamageDefinition();
};
#define DEFINE_MAP_OPTION(name, old) \
@ -259,7 +260,7 @@ struct FOptionalMapinfoDataPtr
typedef TMap<FName, FOptionalMapinfoDataPtr> FOptData;
typedef TMap<int, FName> FMusicMap;
enum EMapType
enum EMapType : int
{
MAPTYPE_UNKNOWN = 0,
MAPTYPE_DOOM,

View File

@ -1873,6 +1873,18 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i
sc.ScriptError("doomednums definitions not supported with old MAPINFO syntax");
}
}
else if (sc.Compare("damagetype"))
{
if (format_type != FMT_Old)
{
format_type = FMT_New;
ParseDamageDefinition();
}
else
{
sc.ScriptError("damagetype definitions not supported with old MAPINFO syntax");
}
}
else if (sc.Compare("spawnnums"))
{
if (format_type != FMT_Old)

View File

@ -18,3 +18,4 @@
#include <direct.h>
#include <io.h>
#include <limits>
#include <memory>

View File

@ -23,7 +23,7 @@ public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS (AArtiTeleport)
IMPLEMENT_CLASS(AArtiTeleport, false, false, false, false)
bool AArtiTeleport::Use (bool pickup)
{

View File

@ -8,12 +8,13 @@
#include "a_action.h"
#include "gi.h"
#include "w_wad.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "g_level.h"
#include "doomstat.h"
#include "a_pickups.h"
#include "d_player.h"
#include "serializer.h"
#include "vm.h"
#define MAULATORTICS (25*35)
@ -30,7 +31,7 @@ void P_MinotaurSlam (AActor *source, AActor *target);
DECLARE_ACTION(A_MinotaurLook)
IMPLEMENT_CLASS(AMinotaur)
IMPLEMENT_CLASS(AMinotaur, false, false, false, false)
void AMinotaur::Tick ()
{
@ -71,7 +72,7 @@ int AMinotaur::DoSpecialDamage (AActor *target, int damage, FName damagetype)
// Minotaur Friend ----------------------------------------------------------
IMPLEMENT_CLASS(AMinotaurFriend)
IMPLEMENT_CLASS(AMinotaurFriend, false, false, false, false)
void AMinotaurFriend::BeginPlay ()
{
@ -116,12 +117,6 @@ void AMinotaurFriend::Die (AActor *source, AActor *inflictor, int dmgflags)
}
}
bool AMinotaurFriend::OkayToSwitchTarget (AActor *other)
{
if (other == tracer) return false; // Do not target the master
return Super::OkayToSwitchTarget (other);
}
// Action functions for the minotaur ----------------------------------------
//----------------------------------------------------------------------------
@ -134,7 +129,7 @@ bool AMinotaurFriend::OkayToSwitchTarget (AActor *other)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDeath)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (Wads.CheckNumForName ("MNTRF1", ns_sprites) < 0 &&
Wads.CheckNumForName ("MNTRF0", ns_sprites) < 0)
@ -144,7 +139,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDeath)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk1)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
player_t *player;
@ -179,7 +174,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk1)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
AActor *target;
@ -236,7 +231,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *puff;
@ -279,7 +274,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
DAngle angle;
@ -329,7 +324,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
player_t *player;
@ -385,7 +380,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
DEFINE_ACTION_FUNCTION(AActor, A_MntrFloorFire)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
AActor *mo;
@ -414,7 +409,7 @@ void P_MinotaurSlam (AActor *source, AActor *target)
angle = source->AngleTo(target);
thrust = 16 + pr_minotaurslam() / 64.;
target->VelFromAngle(angle, thrust);
target->VelFromAngle(thrust, angle);
damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6);
int newdam = P_DamageMobj (target, NULL, NULL, damage, NAME_Melee);
P_TraceBleed (newdam > 0 ? newdam : damage, target, angle, 0.);
@ -442,7 +437,7 @@ void P_MinotaurSlam (AActor *source, AActor *target)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
// In case pain caused him to skip his fade in.
self->RenderStyle = STYLE_Normal;
@ -490,7 +485,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->IsKindOf(RUNTIME_CLASS(AMinotaurFriend)))
{
@ -561,7 +556,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (!self->IsKindOf(RUNTIME_CLASS(AMinotaurFriend)))
{

View File

@ -21,7 +21,6 @@ public:
int StartTime;
void Die (AActor *source, AActor *inflictor, int dmgflags);
bool OkayToSwitchTarget (AActor *other);
void BeginPlay ();
void Serialize(FSerializer &arc);

View File

@ -1,5 +1,5 @@
#include "actor.h"
#include "thingdef/thingdef.h"
#include "vm.h"
#include "p_conversation.h"
#include "p_lnspec.h"
#include "a_action.h"
@ -29,7 +29,7 @@ public:
void Deactivate (AActor *activator);
};
IMPLEMENT_CLASS (ASwitchableDecoration)
IMPLEMENT_CLASS(ASwitchableDecoration, false, false, false, false)
void ASwitchableDecoration::Activate (AActor *activator)
{
@ -50,7 +50,7 @@ public:
void Deactivate (AActor *activator) {}
};
IMPLEMENT_CLASS (ASwitchingDecoration)
IMPLEMENT_CLASS(ASwitchingDecoration, false, false, false, false)
//----------------------------------------------------------------------------
//
@ -104,73 +104,9 @@ void A_Unblock(AActor *self, bool drop)
DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
{
PARAM_ACTION_PROLOGUE;
A_Unblock(self, true);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Fall)
{
PARAM_ACTION_PROLOGUE;
A_Unblock(self, true);
return 0;
}
//==========================================================================
//
// A_SetFloorClip
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SetFloorClip)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_FLOORCLIP;
self->AdjustFloorClip ();
return 0;
}
//==========================================================================
//
// A_UnSetFloorClip
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_UnSetFloorClip)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_FLOORCLIP;
self->Floorclip = 0;
return 0;
}
//==========================================================================
//
// A_HideThing
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_HideThing)
{
PARAM_ACTION_PROLOGUE;
self->renderflags |= RF_INVISIBLE;
return 0;
}
//==========================================================================
//
// A_UnHideThing
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_UnHideThing)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
PARAM_SELF_PROLOGUE(AActor);
PARAM_BOOL_DEF(drop);
A_Unblock(self, drop);
return 0;
}
@ -182,7 +118,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnHideThing)
DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeath)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int t = pr_freezedeath();
self->tics = 75+t+pr_freezedeath();
@ -228,7 +164,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeath)
DEFINE_ACTION_FUNCTION(AActor, A_GenericFreezeDeath)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
self->Translation = TRANSLATION(TRANSLATION_Standard, 7);
CALL_ACTION(A_FreezeDeath, self);
@ -243,7 +179,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenericFreezeDeath)
DEFINE_ACTION_FUNCTION(AActor, A_IceSetTics)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int floor;
@ -268,7 +204,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceSetTics)
DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
int i;
int numChunks;
@ -368,9 +304,11 @@ private:
DCorpsePointer () {}
};
IMPLEMENT_POINTY_CLASS(DCorpsePointer)
DECLARE_POINTER(Corpse)
END_POINTERS
IMPLEMENT_CLASS(DCorpsePointer, false, true, false, false)
IMPLEMENT_POINTERS_START(DCorpsePointer)
IMPLEMENT_POINTER(Corpse)
IMPLEMENT_POINTERS_END
CUSTOM_CVAR(Int, sv_corpsequeuesize, 64, CVAR_ARCHIVE|CVAR_SERVERINFO)
{
@ -446,7 +384,7 @@ void DCorpsePointer::Serialize(FSerializer &arc)
// throw another corpse on the queue
DEFINE_ACTION_FUNCTION(AActor, A_QueueCorpse)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (sv_corpsequeuesize > 0)
{
@ -458,7 +396,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_QueueCorpse)
// Remove an self from the queue (for resurrection)
DEFINE_ACTION_FUNCTION(AActor, A_DeQueueCorpse)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
DCorpsePointer *corpsePtr;
@ -475,164 +413,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeQueueCorpse)
return 0;
}
//============================================================================
//
// A_SetInvulnerable
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SetInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_INVULNERABLE;
return 0;
}
//============================================================================
//
// A_UnSetInvulnerable
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_UnSetInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_INVULNERABLE;
return 0;
}
//============================================================================
//
// A_SetReflective
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SetReflective)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_REFLECTIVE;
return 0;
}
//============================================================================
//
// A_UnSetReflective
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_UnSetReflective)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_REFLECTIVE;
return 0;
}
//============================================================================
//
// A_SetReflectiveInvulnerable
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SetReflectiveInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_REFLECTIVE|MF2_INVULNERABLE;
return 0;
}
//============================================================================
//
// A_UnSetReflectiveInvulnerable
//
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_UnSetReflectiveInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~(MF2_REFLECTIVE|MF2_INVULNERABLE);
return 0;
}
//==========================================================================
//
// A_SetShootable
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_SetShootable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_NONSHOOTABLE;
self->flags |= MF_SHOOTABLE;
return 0;
}
//==========================================================================
//
// A_UnSetShootable
//
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_UnSetShootable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_NONSHOOTABLE;
self->flags &= ~MF_SHOOTABLE;
return 0;
}
//===========================================================================
//
// A_NoGravity
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_NoGravity)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_NOGRAVITY;
return 0;
}
//===========================================================================
//
// A_Gravity
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_Gravity)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_NOGRAVITY;
self->Gravity = 1;
return 0;
}
//===========================================================================
//
// A_LowGravity
//
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_LowGravity)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_NOGRAVITY;
self->Gravity = 1. / 8;;
return 0;
}
//===========================================================================
//
// FaceMovementDirection
@ -669,3 +449,10 @@ void FaceMovementDirection(AActor *actor)
break;
}
}
DEFINE_ACTION_FUNCTION(AActor, FaceMovementDirection)
{
PARAM_SELF_PROLOGUE(AActor);
FaceMovementDirection(self);
return 0;
}

View File

@ -8,12 +8,11 @@
#include "d_player.h"
#include "serializer.h"
IMPLEMENT_CLASS (AArmor)
IMPLEMENT_CLASS (ABasicArmor)
IMPLEMENT_CLASS (ABasicArmorPickup)
IMPLEMENT_CLASS (ABasicArmorBonus)
IMPLEMENT_CLASS (AHexenArmor)
IMPLEMENT_CLASS(AArmor, false, false, false, false)
IMPLEMENT_CLASS(ABasicArmor, false, false, false, false)
IMPLEMENT_CLASS(ABasicArmorPickup, false, false, false, false)
IMPLEMENT_CLASS(ABasicArmorBonus, false, false, false, false)
IMPLEMENT_CLASS(AHexenArmor, false, false, false, false)
//===========================================================================
//

View File

@ -40,11 +40,11 @@ static FRandom pr_torch ("Torch");
#define TIMEFREEZE_TICS ( 12 * TICRATE )
*/
IMPLEMENT_CLASS (APowerup)
IMPLEMENT_CLASS(APowerup, false, false, false, false)
// Powerup-Giver -------------------------------------------------------------
IMPLEMENT_CLASS(PClassPowerupGiver)
IMPLEMENT_CLASS(PClassPowerupGiver, false, false, false, false)
void PClassPowerupGiver::ReplaceClassRef(PClass *oldclass, PClass *newclass)
{
@ -376,7 +376,7 @@ bool APowerup::GetNoTeleportFreeze ()
// Invulnerability Powerup ---------------------------------------------------
IMPLEMENT_CLASS (APowerInvulnerable)
IMPLEMENT_CLASS(APowerInvulnerable, false, false, false, false)
//===========================================================================
//
@ -513,7 +513,7 @@ int APowerInvulnerable::AlterWeaponSprite (visstyle_t *vis)
// Strength (aka Berserk) Powerup --------------------------------------------
IMPLEMENT_CLASS (APowerStrength)
IMPLEMENT_CLASS(APowerStrength, false, false, false, false)
//===========================================================================
//
@ -578,7 +578,7 @@ PalEntry APowerStrength::GetBlend ()
// Invisibility Powerup ------------------------------------------------------
IMPLEMENT_CLASS (APowerInvisibility)
IMPLEMENT_CLASS(APowerInvisibility, false, false, false, false)
// Invisibility flag combos
#define INVISIBILITY_FLAGS1 (MF_SHADOW)
@ -783,7 +783,7 @@ bool APowerInvisibility::HandlePickup (AInventory *item)
// Ironfeet Powerup ----------------------------------------------------------
IMPLEMENT_CLASS (APowerIronFeet)
IMPLEMENT_CLASS(APowerIronFeet, false, false, false, false)
//===========================================================================
//
@ -820,7 +820,7 @@ void APowerIronFeet::DoEffect ()
// Strife Environment Suit Powerup -------------------------------------------
IMPLEMENT_CLASS (APowerMask)
IMPLEMENT_CLASS(APowerMask, false, false, false, false)
//===========================================================================
//
@ -857,7 +857,7 @@ void APowerMask::DoEffect ()
// Light-Amp Powerup ---------------------------------------------------------
IMPLEMENT_CLASS (APowerLightAmp)
IMPLEMENT_CLASS(APowerLightAmp, false, false, false, false)
//===========================================================================
//
@ -899,7 +899,7 @@ void APowerLightAmp::EndEffect ()
// Torch Powerup -------------------------------------------------------------
IMPLEMENT_CLASS (APowerTorch)
IMPLEMENT_CLASS(APowerTorch, false, false, false, false)
//===========================================================================
//
@ -962,7 +962,7 @@ void APowerTorch::DoEffect ()
// Flight (aka Wings of Wrath) powerup ---------------------------------------
IMPLEMENT_CLASS (APowerFlight)
IMPLEMENT_CLASS(APowerFlight, false, false, false, false)
//===========================================================================
//
@ -1102,7 +1102,7 @@ bool APowerFlight::DrawPowerup (int x, int y)
// Weapon Level 2 (aka Tome of Power) Powerup --------------------------------
IMPLEMENT_CLASS (APowerWeaponLevel2)
IMPLEMENT_CLASS(APowerWeaponLevel2, false, false, false, false)
//===========================================================================
//
@ -1193,7 +1193,7 @@ public:
void Tick ();
};
IMPLEMENT_CLASS (APlayerSpeedTrail)
IMPLEMENT_CLASS(APlayerSpeedTrail, false, false, false, false)
//===========================================================================
//
@ -1216,7 +1216,7 @@ void APlayerSpeedTrail::Tick ()
// Speed Powerup -------------------------------------------------------------
IMPLEMENT_CLASS (APowerSpeed)
IMPLEMENT_CLASS(APowerSpeed, false, false, false, false)
//===========================================================================
//
@ -1303,11 +1303,11 @@ void APowerSpeed::DoEffect ()
// Minotaur (aka Dark Servant) powerup ---------------------------------------
IMPLEMENT_CLASS (APowerMinotaur)
IMPLEMENT_CLASS(APowerMinotaur, false, false, false, false)
// Targeter powerup ---------------------------------------------------------
IMPLEMENT_CLASS (APowerTargeter)
IMPLEMENT_CLASS(APowerTargeter, false, false, false, false)
void APowerTargeter::Travelled ()
{
@ -1422,7 +1422,7 @@ void APowerTargeter::PositionAccuracy ()
// Frightener Powerup --------------------------------
IMPLEMENT_CLASS (APowerFrightener)
IMPLEMENT_CLASS(APowerFrightener, false, false, false, false)
//===========================================================================
//
@ -1458,7 +1458,7 @@ void APowerFrightener::EndEffect ()
// Buddha Powerup --------------------------------
IMPLEMENT_CLASS (APowerBuddha)
IMPLEMENT_CLASS(APowerBuddha, false, false, false, false)
//===========================================================================
//
@ -1494,11 +1494,11 @@ void APowerBuddha::EndEffect ()
// Scanner powerup ----------------------------------------------------------
IMPLEMENT_CLASS (APowerScanner)
IMPLEMENT_CLASS(APowerScanner, false, false, false, false)
// Time freezer powerup -----------------------------------------------------
IMPLEMENT_CLASS( APowerTimeFreezer)
IMPLEMENT_CLASS( APowerTimeFreezer, false, false, false, false)
//===========================================================================
//
@ -1625,7 +1625,7 @@ void APowerTimeFreezer::EndEffect()
// Damage powerup ------------------------------------------------------
IMPLEMENT_CLASS(APowerDamage)
IMPLEMENT_CLASS(APowerDamage, false, false, false, false)
//===========================================================================
//
@ -1682,7 +1682,7 @@ void APowerDamage::ModifyDamage(int damage, FName damageType, int &newdamage, bo
// Quarter damage powerup ------------------------------------------------------
IMPLEMENT_CLASS(APowerProtection)
IMPLEMENT_CLASS(APowerProtection, false, false, false, false)
#define PROTECTION_FLAGS3 (MF3_NORADIUSDMG | MF3_DONTMORPH | MF3_DONTSQUASH | MF3_DONTBLAST | MF3_NOTELEOTHER)
#define PROTECTION_FLAGS5 (MF5_NOPAIN | MF5_DONTRIP)
@ -1760,7 +1760,7 @@ void APowerProtection::ModifyDamage(int damage, FName damageType, int &newdamage
// Drain rune -------------------------------------------------------
IMPLEMENT_CLASS(APowerDrain)
IMPLEMENT_CLASS(APowerDrain, false, false, false, false)
//===========================================================================
//
@ -1800,7 +1800,7 @@ void APowerDrain::EndEffect( )
// Regeneration rune -------------------------------------------------------
IMPLEMENT_CLASS(APowerRegeneration)
IMPLEMENT_CLASS(APowerRegeneration, false, false, false, false)
//===========================================================================
//
@ -1822,7 +1822,7 @@ void APowerRegeneration::DoEffect()
// High jump rune -------------------------------------------------------
IMPLEMENT_CLASS(APowerHighJump)
IMPLEMENT_CLASS(APowerHighJump, false, false, false, false)
//===========================================================================
//
@ -1860,7 +1860,7 @@ void APowerHighJump::EndEffect( )
// Double firing speed rune ---------------------------------------------
IMPLEMENT_CLASS(APowerDoubleFiringSpeed)
IMPLEMENT_CLASS(APowerDoubleFiringSpeed, false, false, false, false)
//===========================================================================
//
@ -1898,7 +1898,7 @@ void APowerDoubleFiringSpeed::EndEffect( )
// Morph powerup ------------------------------------------------------
IMPLEMENT_CLASS(APowerMorph)
IMPLEMENT_CLASS(APowerMorph, false, false, false, false)
//===========================================================================
//
@ -2002,7 +2002,7 @@ void APowerMorph::EndEffect( )
// Infinite Ammo Powerup -----------------------------------------------------
IMPLEMENT_CLASS(APowerInfiniteAmmo)
IMPLEMENT_CLASS(APowerInfiniteAmmo, false, false, false, false)
//===========================================================================
//

View File

@ -2,7 +2,7 @@
#include "info.h"
#include "gi.h"
#include "m_random.h"
#include "thingdef/thingdef.h"
#include "vm.h"
static FRandom pr_orbit ("Orbit");
@ -41,7 +41,7 @@ public:
void Destroy();
};
IMPLEMENT_CLASS(ACustomBridge)
IMPLEMENT_CLASS(ACustomBridge, false, false, false, false)
void ACustomBridge::BeginPlay ()
{
@ -92,7 +92,7 @@ void ACustomBridge::Destroy()
DEFINE_ACTION_FUNCTION(AActor, A_BridgeOrbit)
{
PARAM_ACTION_PROLOGUE;
PARAM_SELF_PROLOGUE(AActor);
if (self->target == NULL)
{ // Don't crash if somebody spawned this into the world
@ -121,8 +121,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BridgeOrbit)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BridgeInit)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(balltype, AActor) { balltype = NULL; }
PARAM_SELF_PROLOGUE(AActor);
PARAM_CLASS_DEF(balltype, AActor);
AActor *ball;
@ -156,7 +156,7 @@ public:
void BeginPlay ();
};
IMPLEMENT_CLASS(AInvisibleBridge)
IMPLEMENT_CLASS(AInvisibleBridge, false, false, false, false)
void AInvisibleBridge::BeginPlay ()
{

View File

@ -64,7 +64,7 @@ protected:
DAngle Range;
};
IMPLEMENT_CLASS (ASecurityCamera)
IMPLEMENT_CLASS(ASecurityCamera, false, false, false, false)
void ASecurityCamera::Serialize(FSerializer &arc)
{
@ -124,7 +124,7 @@ protected:
DAngle MaxPitchChange;
};
IMPLEMENT_CLASS (AAimingCamera)
IMPLEMENT_CLASS(AAimingCamera, false, false, false, false)
void AAimingCamera::Serialize(FSerializer &arc)
{

View File

@ -25,7 +25,7 @@ public:
}
};
IMPLEMENT_CLASS(AGlassShard)
IMPLEMENT_CLASS(AGlassShard, false, false, false, false)
// Dirt stuff

View File

@ -58,12 +58,14 @@ static int ImpactCount;
CVAR (Bool, cl_spreaddecals, true, CVAR_ARCHIVE)
IMPLEMENT_POINTY_CLASS (DBaseDecal)
DECLARE_POINTER(WallPrev)
DECLARE_POINTER(WallNext)
END_POINTERS
IMPLEMENT_CLASS(DBaseDecal, false, true, false, false)
IMPLEMENT_CLASS (DImpactDecal)
IMPLEMENT_POINTERS_START(DBaseDecal)
IMPLEMENT_POINTER(WallPrev)
IMPLEMENT_POINTER(WallNext)
IMPLEMENT_POINTERS_END
IMPLEMENT_CLASS(DImpactDecal, false, false, false, false)
DBaseDecal::DBaseDecal ()
: DThinker(STAT_DECAL),
@ -744,7 +746,7 @@ public:
void BeginPlay ();
};
IMPLEMENT_CLASS (ADecal)
IMPLEMENT_CLASS(ADecal, false, false, false, false)
void ADecal::BeginPlay ()
{

View File

@ -7,8 +7,7 @@
#include "b_bot.h"
#include "p_checkposition.h"
IMPLEMENT_CLASS(AFastProjectile)
IMPLEMENT_CLASS(AFastProjectile, false, false, false, false)
//----------------------------------------------------------------------------

View File

@ -3,9 +3,11 @@
#include "d_player.h"
#include "serializer.h"
IMPLEMENT_POINTY_CLASS (DFlashFader)
DECLARE_POINTER (ForWho)
END_POINTERS
IMPLEMENT_CLASS(DFlashFader, false, true, false, false)
IMPLEMENT_POINTERS_START(DFlashFader)
IMPLEMENT_POINTER(ForWho)
IMPLEMENT_POINTERS_END
DFlashFader::DFlashFader ()
{

View File

@ -46,7 +46,7 @@ public:
void Deactivate (AActor *activator);
};
IMPLEMENT_CLASS (AParticleFountain)
IMPLEMENT_CLASS(AParticleFountain, false, false, false, false)
void AParticleFountain::PostBeginPlay ()
{

View File

@ -46,7 +46,7 @@ public:
int TakeSpecialDamage(AActor *inflictor, AActor *source, int damage, FName damagetype);
};
IMPLEMENT_CLASS(AHateTarget)
IMPLEMENT_CLASS(AHateTarget, false, false, false, false)
void AHateTarget::BeginPlay()
{

View File

@ -470,7 +470,7 @@ bool P_CheckKeys (AActor *owner, int keynum, bool remote)
//
//==========================================================================
IMPLEMENT_CLASS (AKey)
IMPLEMENT_CLASS(AKey, false, false, false, false)
bool AKey::HandlePickup (AInventory *item)
{

View File

@ -13,7 +13,7 @@
static FRandom pr_lightning ("Lightning");
IMPLEMENT_CLASS (DLightningThinker)
IMPLEMENT_CLASS(DLightningThinker, false, false, false, false)
DLightningThinker::DLightningThinker ()
: DThinker (STAT_LIGHTNING)

Some files were not shown because too many files have changed in this diff Show More