- Converted all action functions be directly callable by the VM (though they are not yet

usable).

SVN r2154 (scripting)
This commit is contained in:
Randy Heit 2010-02-12 06:04:57 +00:00
parent 7ea11cd169
commit 739e684549
108 changed files with 2827 additions and 1295 deletions

View file

@ -1603,7 +1603,7 @@ static void SetPointer(FState *state, PSymbol *sym, int frame = 0)
else
{
FString symname = sym->SymbolName.GetChars();
state->SetAction(static_cast<PSymbolActionFunction*>(sym));
state->SetAction(static_cast<PSymbolActionFunction*>(sym)->Function);
// Note: CompareNoCase() calls stricmp() and therefore returns 0 when they're the same.
for (unsigned int i = 0; i < MBFCodePointers.Size(); i++)

View file

@ -71,6 +71,7 @@
#include "r_interpolate.h"
#include "doomstat.h"
#include "m_argv.h"
#include "autosegs.h"
// MACROS ------------------------------------------------------------------
@ -328,6 +329,17 @@ static void MarkRoot()
SectorMarker->SecNum = 0;
}
Mark(SectorMarker);
// Mark action functions
if (!FinalGC)
{
FAutoSegIterator probe(ARegHead, ARegTail);
while (*++probe != NULL)
{
AFuncDesc *afunc = (AFuncDesc *)*probe;
Mark(*(afunc->VMPointer));
}
}
// Mark classes
for (unsigned j = 0; j < PClass::m_Types.Size(); ++j)
{
@ -362,7 +374,7 @@ static void MarkRoot()
//
// Atomic
//
// If their were any propagations that needed to be done atomicly, they
// If there were any propagations that needed to be done atomicly, they
// would go here. It also sets things up for the sweep state.
//
//==========================================================================

View file

@ -224,7 +224,7 @@ void PClass::InsertIntoHash ()
}
// Find a type, passed the name as a name
const PClass *PClass::FindClass (FName zaname)
PClass *PClass::FindClass (FName zaname)
{
if (zaname == NAME_None)
{
@ -518,7 +518,9 @@ size_t PClass::PropagateMark()
IMPLEMENT_ABSTRACT_CLASS(PSymbol);
IMPLEMENT_CLASS(PSymbolConst);
IMPLEMENT_CLASS(PSymbolVariable);
IMPLEMENT_CLASS(PSymbolActionFunction);
IMPLEMENT_POINTY_CLASS(PSymbolActionFunction)
DECLARE_POINTER(Function)
END_POINTERS
IMPLEMENT_POINTY_CLASS(PSymbolVMFunction)
DECLARE_POINTER(Function)
END_POINTERS

View file

@ -6,6 +6,7 @@
#endif
#include "thingdef/thingdef_type.h"
#include "vm.h"
// Symbol information -------------------------------------------------------
@ -81,23 +82,27 @@ public:
// parameters passed.
struct FState;
struct StateCallData;
typedef void (*actionf_p)(AActor *self, AActor *stateowner, FState *state, int parameters, StateCallData *statecall);
class VMFrameStack;
struct VMValue;
struct VMReturn;
typedef int (*actionf_p)(VMFrameStack *stack, VMValue *param, int numparam, VMReturn *ret, int numret);/*(VM_ARGS)*/
class VMFunction;
class PSymbolActionFunction : public PSymbol
{
DECLARE_CLASS(PSymbolActionFunction, PSymbol);
HAS_OBJECT_POINTERS;
public:
FString Arguments;
actionf_p Function;
VMFunction *Function;
int defaultparameterindex;
PSymbolActionFunction(FName name) : PSymbol(name, SYM_ActionFunction) {}
PSymbolActionFunction() : PSymbol(NAME_None, SYM_ActionFunction) {}
};
// A symbol table -----------------------------------------------------------
// A VM function ------------------------------------------------------------
class VMFunction;
class PSymbolVMFunction : public PSymbol
{
DECLARE_CLASS(PSymbolVMFunction, PSymbol);
@ -195,10 +200,10 @@ public:
}
// Find a type, given its name.
static const PClass *FindClass (const char *name) { return FindClass (FName (name, true)); }
static const PClass *FindClass (const FString &name) { return FindClass (FName (name, true)); }
static const PClass *FindClass (ENamedName name) { return FindClass (FName (name)); }
static const PClass *FindClass (FName name);
static PClass *FindClass (const char *name) { return FindClass (FName (name, true)); }
static PClass *FindClass (const FString &name) { return FindClass (FName (name, true)); }
static PClass *FindClass (ENamedName name) { return FindClass (FName (name)); }
static PClass *FindClass (FName name);
const PClass *FindClassTentative (FName name); // not static!
static TArray<PClass *> m_Types;

View file

@ -8,18 +8,23 @@
*/
DEFINE_ACTION_FUNCTION(AActor, A_BspiAttack)
{
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("ArachnotronPlasma"));
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BabyMetal)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "baby/walk", 1, ATTN_IDLE);
A_Chase (self);
A_Chase (stack, self);
return 0;
}

View file

@ -21,7 +21,9 @@ void A_Fire(AActor *self, int height);
//
DEFINE_ACTION_FUNCTION(AActor, A_VileStart)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_VOICE, "vile/start", 1, ATTN_NORM);
return 0;
}
@ -31,22 +33,27 @@ DEFINE_ACTION_FUNCTION(AActor, A_VileStart)
//
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)
{
ACTION_PARAM_START(1);
ACTION_PARAM_FIXED(height,0);
PARAM_ACTION_PROLOGUE;
PARAM_FIXED_OPT(height) { height = 0; }
A_Fire(self, height);
return 0;
}
void A_Fire(AActor *self, int height)
@ -77,12 +84,13 @@ void A_Fire(AActor *self, int height)
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget)
{
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(fire,0);
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(fire, AActor) { fire = PClass::FindClass("ArchvileFire"); }
AActor *fog;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
@ -93,6 +101,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget)
fog->target = self;
fog->tracer = self->target;
A_Fire(fog, 0);
return 0;
}
@ -102,25 +111,25 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget)
// A_VileAttack
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack)
{
ACTION_PARAM_START(6);
ACTION_PARAM_SOUND(snd,0);
ACTION_PARAM_INT(dmg,1);
ACTION_PARAM_INT(blastdmg,2);
ACTION_PARAM_INT(blastrad,3);
ACTION_PARAM_FIXED(thrust,4);
ACTION_PARAM_NAME(dmgtype,5);
{
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_FIXED_OPT (thrust) { thrust = FRACUNIT; }
PARAM_NAME_OPT (dmgtype) { dmgtype = NAME_Fire; }
AActor *fire, *target;
angle_t an;
if (NULL == (target = self->target))
return;
return 0;
A_FaceTarget (self);
if (!P_CheckSight (self, target, 0) )
return;
return 0;
S_Sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM);
P_TraceBleed (dmg, target);
@ -139,4 +148,5 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack)
P_RadiusAttack (fire, self, blastdmg, blastrad, dmgtype, false);
}
target->velz = Scale(thrust, 1000, target->Mass);
return 0;
}

View file

@ -18,13 +18,17 @@ 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 (fixed_t x, fixed_t y, fixed_t z)
@ -53,6 +57,7 @@ static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z)
DEFINE_ACTION_FUNCTION(AActor, A_BrainScream)
{
PARAM_ACTION_PROLOGUE;
fixed_t x;
for (x = self->x - 196*FRACUNIT; x < self->x + 320*FRACUNIT; x += 8*FRACUNIT)
@ -61,34 +66,40 @@ DEFINE_ACTION_FUNCTION(AActor, A_BrainScream)
128 + (pr_brainscream() << (FRACBITS + 1)));
}
S_Sound (self, CHAN_VOICE, "brain/death", 1, ATTN_NONE);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BrainExplode)
{
PARAM_ACTION_PROLOGUE;
fixed_t x = self->x + pr_brainexplode.Random2()*2048;
fixed_t z = 128 + pr_brainexplode()*2*FRACUNIT;
BrainishExplosion (x, self->y, z);
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;
return 0;
G_ExitLevel (0, false);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS(spawntype, AActor);
DSpotState *state = DSpotState::GetSpotState();
AActor *targ;
AActor *spit;
bool isdefault = false;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
// shoot a cube at current target
targ = state->GetNextInList(PClass::FindClass("BossTarget"), G_SkillProperty(SKILLP_EasyBossBrain));
@ -135,6 +146,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
S_Sound (self, CHAN_WEAPON, "brain/spit", 1, ATTN_NONE);
}
}
return 0;
}
static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound)
@ -255,10 +267,10 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnFly)
{
FSoundID sound;
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (spawntype, AActor) { spawntype = NULL; }
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
FSoundID sound;
if (spawntype != NULL)
{
@ -266,15 +278,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnFly)
}
else
{
spawntype = PClass::FindClass ("SpawnFire");
spawntype = PClass::FindClass("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::FindClass("SpawnFire"), "brain/spawn");
return 0;
}

View file

@ -3,8 +3,10 @@ static FRandom pr_bruisattack ("BruisAttack");
DEFINE_ACTION_FUNCTION(AActor, A_BruisAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
if (self->CheckMeleeRange ())
{
@ -12,9 +14,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_BruisAttack)
S_Sound (self, CHAN_WEAPON, "baron/melee", 1, ATTN_NORM);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("BaronBall"));
return 0;
}

View file

@ -14,8 +14,10 @@ static FRandom pr_headattack ("HeadAttack");
DEFINE_ACTION_FUNCTION(AActor, A_HeadAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
@ -24,9 +26,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_HeadAttack)
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("CacodemonBall"));
return 0;
}

View file

@ -9,15 +9,21 @@
DEFINE_ACTION_FUNCTION(AActor, A_CyberAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("Rocket"));
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Hoof)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "cyber/hoof", 1, ATTN_IDLE);
A_Chase (self);
A_Chase (stack, self);
return 0;
}

View file

@ -13,8 +13,10 @@ static FRandom pr_sargattack ("SargAttack");
DEFINE_ACTION_FUNCTION(AActor, A_SargAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
@ -23,4 +25,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_SargAttack)
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
}
return 0;
}

View file

@ -17,8 +17,10 @@ static FRandom pr_troopattack ("TroopAttack");
//
DEFINE_ACTION_FUNCTION(AActor, A_TroopAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
if (self->CheckMeleeRange ())
@ -27,9 +29,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_TroopAttack)
S_Sound (self, CHAN_WEAPON, "imp/melee", 1, ATTN_NORM);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
// launch a missile
P_SpawnMissile (self, self->target, PClass::FindClass("DoomImpBall"));
return 0;
}

View file

@ -37,6 +37,8 @@
DEFINE_ACTION_FUNCTION(AActor, A_BarrelDestroy)
{
PARAM_ACTION_PROLOGUE;
if ((dmflags2 & DF2_BARRELS_RESPAWN) &&
(deathmatch || alwaysapplydmflags))
{
@ -48,5 +50,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_BarrelDestroy)
{
self->Destroy ();
}
return 0;
}

View file

@ -28,6 +28,8 @@ static FRandom pr_oldbfg ("OldBFG");
//
DEFINE_ACTION_FUNCTION(AActor, A_Punch)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int pitch;
@ -39,7 +41,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
}
@ -63,6 +65,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
linetarget->x,
linetarget->y);
}
return 0;
}
//
@ -70,6 +73,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
//
DEFINE_ACTION_FUNCTION(AActor, A_FirePistol)
{
PARAM_ACTION_PROLOGUE;
bool accurate;
if (self->player != NULL)
@ -78,7 +83,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePistol)
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
P_SetPsprite (self->player, ps_flash, weapon->FindState(NAME_Flash));
}
@ -94,6 +99,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePistol)
S_Sound (self, CHAN_WEAPON, "weapons/pistol", 1, ATTN_NORM);
P_GunShot (self, accurate, PClass::FindClass(NAME_BulletPuff), P_BulletSlope (self));
return 0;
}
//
@ -101,32 +107,34 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePistol)
//
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; }
angle_t angle;
player_t *player;
AActor *linetarget;
ACTION_PARAM_START(4);
ACTION_PARAM_SOUND(fullsound, 0);
ACTION_PARAM_SOUND(hitsound, 1);
ACTION_PARAM_INT(damage, 2);
ACTION_PARAM_CLASS(pufftype, 3);
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
if (pufftype == NULL) pufftype = PClass::FindClass(NAME_BulletPuff);
if (damage == 0) damage = 2;
if (pufftype == NULL)
pufftype = PClass::FindClass(NAME_BulletPuff);
if (damage == 0)
damage = 2;
damage *= (pr_saw()%10+1);
damage *= (pr_saw()%10 + 1);
angle = self->angle;
angle += pr_saw.Random2() << 18;
@ -138,7 +146,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
if (!linetarget)
{
S_Sound (self, CHAN_WEAPON, fullsound, 1, ATTN_NORM);
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
@ -160,6 +168,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
self->angle += ANG90/20;
}
self->flags |= MF_JUSTATTACKED;
return 0;
}
//
@ -167,12 +176,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
//
DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun)
{
PARAM_ACTION_PROLOGUE;
int i;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, "weapons/shotgf", 1, ATTN_NORM);
@ -180,7 +191,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun)
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
P_SetPsprite (player, ps_flash, weapon->FindState(NAME_Flash));
}
player->mo->PlayAttacking2 ();
@ -189,6 +200,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun)
for (i=0 ; i<7 ; i++)
P_GunShot (self, false, PClass::FindClass(NAME_BulletPuff), pitch);
return 0;
}
//
@ -196,6 +208,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun)
//
DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
{
PARAM_ACTION_PROLOGUE;
int i;
angle_t angle;
int damage;
@ -203,7 +217,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
if (NULL == (player = self->player))
{
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, "weapons/sshotf", 1, ATTN_NORM);
@ -211,7 +225,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
P_SetPsprite (player, ps_flash, weapon->FindState(NAME_Flash));
}
player->mo->PlayAttacking2 ();
@ -237,22 +251,29 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
pitch + (pr_fireshotgun2.Random2() * 332063), damage,
NAME_None, NAME_BulletPuff);
}
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);
CALL_ACTION(A_ReFire, self);
return 0;
}
@ -305,18 +326,20 @@ void P_SetSafeFlash(AWeapon * weapon, player_t * player, FState * flashstate, in
//
DEFINE_ACTION_FUNCTION(AActor, A_FireCGun)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (self == NULL || NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
S_Sound (self, CHAN_WEAPON, "weapons/chngun", 1, ATTN_NORM);
@ -340,6 +363,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCGun)
player->mo->PlayAttacking2 ();
P_GunShot (self, !player->refire, PClass::FindClass(NAME_BulletPuff), P_BulletSlope (self));
return 0;
}
//
@ -347,19 +371,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCGun)
//
DEFINE_ACTION_FUNCTION(AActor, A_FireMissile)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, PClass::FindClass("Rocket"));
return 0;
}
//
@ -367,20 +394,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMissile)
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(grenade, AActor) { grenade = PClass::FindClass("Grenade"); }
player_t *player;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(grenade, 0);
if (grenade == NULL) return;
if (grenade == NULL)
return 0;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
// Temporarily raise the pitch to send the grenade slightly upwards
@ -388,6 +418,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade)
self->pitch -= (1152 << FRACBITS);
P_SpawnPlayerMissile(self, grenade);
self->pitch = SavedPlayerPitch;
return 0;
}
//
@ -395,17 +426,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade)
//
DEFINE_ACTION_FUNCTION(AActor, A_FirePlasma)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
FState *flash = weapon->FindState(NAME_Flash);
if (flash != NULL)
@ -415,6 +448,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePlasma)
}
P_SpawnPlayerMissile (self, PClass::FindClass("PlasmaBall"));
return 0;
}
//
@ -451,22 +485,29 @@ static void FireRailgun(AActor *self, int RailOffset)
DEFINE_ACTION_FUNCTION(AActor, A_FireRailgun)
{
PARAM_ACTION_PROLOGUE;
FireRailgun(self, 0);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_FireRailgunRight)
{
PARAM_ACTION_PROLOGUE;
FireRailgun(self, 10);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_FireRailgunLeft)
{
PARAM_ACTION_PROLOGUE;
FireRailgun(self, -10);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_RailWait)
{
// Okay, this was stupid. Just use a NULL function instead of this.
return 0;
}
//
@ -475,21 +516,24 @@ DEFINE_ACTION_FUNCTION(AActor, A_RailWait)
DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, 0, 0, 0, PClass::FindClass("BFGBall"), self->angle, NULL, NULL, !!(dmflags2 & DF2_NO_FREEAIMBFG));
return 0;
}
//
@ -498,6 +542,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (spraytype, AActor) { spraytype = NULL; }
PARAM_INT_OPT (numrays) { numrays = 40; }
PARAM_INT_OPT (damagecnt) { damagecnt = 15; }
int i;
int j;
int damage;
@ -505,10 +554,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
AActor *thingToHit;
AActor *linetarget;
ACTION_PARAM_START(3);
ACTION_PARAM_CLASS(spraytype, 0);
ACTION_PARAM_INT(numrays, 1);
ACTION_PARAM_INT(damagecnt, 2);
if (spraytype == NULL) spraytype = PClass::FindClass("BFGExtra");
if (numrays <= 0) numrays = 40;
@ -516,7 +561,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
// [RH] Don't crash if no target
if (!self->target)
return;
return 0;
// offset angles from its attack angle
for (i = 0; i < numrays; i++)
@ -544,6 +589,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
P_DamageMobj (thingToHit, self->target, self->target, damage, NAME_BFGSplash);
P_TraceBleed (damage, thingToHit, self->target);
}
return 0;
}
//
@ -551,7 +597,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
//
DEFINE_ACTION_FUNCTION(AActor, A_BFGsound)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/bfgf", 1, ATTN_NORM);
return 0;
}
//
@ -565,6 +613,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BFGsound)
DEFINE_ACTION_FUNCTION(AActor, A_FireOldBFG)
{
PARAM_ACTION_PROLOGUE;
const PClass * plasma[] = {PClass::FindClass("PlasmaBall1"), PClass::FindClass("PlasmaBall2")};
AActor * mo = NULL;
@ -572,14 +621,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireOldBFG)
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
self->player->extralight = 2;
@ -597,5 +646,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireOldBFG)
self->angle = SavedPlayerAngle;
self->pitch = SavedPlayerPitch;
}
if (doesautoaim) self->player->ReadyWeapon->WeaponFlags &= ~WIF_NOAUTOAIM; // Restore autoaim setting
if (doesautoaim)
{ // Restore autoaim setting
self->player->ReadyWeapon->WeaponFlags &= ~WIF_NOAUTOAIM;
}
return 0;
}

View file

@ -19,20 +19,23 @@
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;
angle_t an;
if (!self->target)
return;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
return 0;
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
@ -49,18 +52,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1)
missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->vely = FixedMul (missile->Speed, finesine[an]);
}
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
AActor *missile;
angle_t an;
if (!self->target)
return;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
return 0;
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
@ -77,18 +81,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->vely = FixedMul (missile->Speed, finesine[an]);
}
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
AActor *missile;
angle_t an;
if (!self->target)
return;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
return 0;
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
@ -111,6 +116,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
missile->velx = FixedMul (missile->Speed, finecosine[an]);
missile->vely = FixedMul (missile->Speed, finesine[an]);
}
return 0;
}
//
@ -122,14 +128,14 @@ AActor * P_OldSpawnMissile(AActor * source, AActor * dest, const PClass *type);
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
{
int i, j;
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (spawntype, AActor) { spawntype = NULL; }
PARAM_INT_OPT (n) { n = 0; }
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_FIXED_OPT (vrange) { vrange = 4*FRACUNIT; }
PARAM_FIXED_OPT (hrange) { hrange = FRACUNIT/2; }
ACTION_PARAM_START(5);
ACTION_PARAM_CLASS(spawntype, 0);
ACTION_PARAM_INT(n, 1);
ACTION_PARAM_INT(flags, 2);
ACTION_PARAM_FIXED(vrange, 3);
ACTION_PARAM_FIXED(hrange, 4);
int i, j;
if (n == 0) n = self->Damage; // GetMissileDamage (0, 1);
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
@ -169,4 +175,5 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
}
}
target->Destroy();
return 0;
}

View file

@ -13,8 +13,12 @@
// DOOM II special, map 32.
// Uses special tag 666 by default.
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KeenDie)
{
PARAM_ACTION_PROLOGUE;
PARAM_INT(doortag);
CALL_ACTION(A_NoBlocking, self);
// scan the remaining thinkers to see if all Keens are dead
@ -27,14 +31,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KeenDie)
if (other != self && other->health > 0 && other->IsA (matchClass))
{
// other Keen not dead
return;
return 0;
}
}
ACTION_PARAM_START(1);
ACTION_PARAM_INT(doortag, 0);
EV_DoDoor (DDoor::doorOpen, NULL, NULL, doortag, 2*FRACUNIT, 0, 0, 0);
return 0;
}

View file

@ -48,24 +48,29 @@ void A_SkullAttack(AActor *self, fixed_t speed)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullAttack)
{
ACTION_PARAM_START(1);
ACTION_PARAM_FIXED(n, 0);
PARAM_ACTION_PROLOGUE;
PARAM_FIXED_OPT(speed) { speed = SKULLSPEED; }
if (n <= 0) n = SKULLSPEED;
A_SkullAttack(self, n);
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;
return 0;
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
A_FaceTarget(self);
damage = (pr_oldsoul()%8+1)*self->Damage;
P_DamageMobj(self->target, self, self, damage, NAME_None);
return 0;
}

View file

@ -12,13 +12,22 @@
DECLARE_ACTION(A_SkullAttack)
static const PClass *GetSpawnType(DECLARE_PARAMINFO)
static const PClass *GetSpawnType(VMValue *param)
{
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
const PClass *spawntype;
if (spawntype == NULL) spawntype = PClass::FindClass("LostSoul");
return spawntype;
if (param == NULL || param->Type == REGT_NIL)
{
spawntype = NULL;
}
else
{
assert(param->Type == REGT_POINTER);
assert(param->atag == ATAG_OBJECT || param->a == NULL);
spawntype = (const PClass *)param->a;
}
return (spawntype != NULL) ? spawntype : PClass::FindClass("LostSoul");
}
@ -38,7 +47,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
int prestep;
if (spawntype == NULL) return;
if (self->DamageType==NAME_Massacre) return;
if (self->DamageType == NAME_Massacre) return;
// [RH] check to make sure it's not too close to the ceiling
if (self->z + self->height + 8*FRACUNIT > self->ceilingz)
@ -139,34 +148,43 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainAttack)
{
if (!self->target)
return;
PARAM_ACTION_PROLOGUE;
const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO);
if (!self->target)
return 0;
const PClass *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
A_FaceTarget (self);
A_PainShootSkull (self, self->angle, spawntype);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack)
{
if (!self->target)
return;
PARAM_ACTION_PROLOGUE;
const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO);
if (!self->target)
return 0;
const PClass *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
A_FaceTarget (self);
A_PainShootSkull (self, self->angle + ANG45, spawntype);
A_PainShootSkull (self, self->angle - ANG45, spawntype);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie)
{
if (self->target != NULL && self->IsFriend (self->target))
PARAM_ACTION_PROLOGUE;
if (self->target != NULL && self->IsFriend(self->target))
{ // And I thought you were my friend!
self->flags &= ~MF_FRIENDLY;
}
const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO);
const PClass *spawntype = GetSpawnType(numparam > NAP ? &param[NAP] : NULL);
CALL_ACTION(A_NoBlocking, self);
A_PainShootSkull (self, self->angle + ANG90, spawntype);
A_PainShootSkull (self, self->angle + ANG180, spawntype);
A_PainShootSkull (self, self->angle + ANG270, spawntype);
return 0;
}

View file

@ -20,12 +20,14 @@ static FRandom pr_cposrefire ("CPosRefire");
//
DEFINE_ACTION_FUNCTION(AActor, A_PosAttack)
{
PARAM_ACTION_PROLOGUE;
int angle;
int damage;
int slope;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
angle = self->angle;
@ -35,6 +37,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PosAttack)
angle += pr_posattack.Random2() << 20;
damage = ((pr_posattack()%5)+1)*3;
P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_None, NAME_BulletPuff);
return 0;
}
static void A_SPosAttack2 (AActor *self)
@ -57,33 +60,41 @@ static void A_SPosAttack2 (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_SPosAttackUseAtkSound)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
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;
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;
int angle;
int bangle;
int damage;
int slope;
if (!self->target)
return;
return 0;
// [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH)
@ -99,15 +110,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_CPosAttack)
angle = bangle + (pr_cposattack.Random2() << 20);
damage = ((pr_cposattack()%5)+1)*3;
P_LineAttack (self, angle, MISSILERANGE, slope, damage, NAME_None, 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;
return 0;
if (!self->target
|| P_HitFriend (self)
@ -116,4 +130,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_CPosRefire)
{
self->SetState (self->SeeState);
}
return 0;
}

View file

@ -19,11 +19,13 @@ static FRandom pr_skelfist ("SkelFist");
// A_SkelMissile
//
DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
{
{
PARAM_ACTION_PROLOGUE;
AActor *missile;
if (!self->target)
return;
return 0;
A_FaceTarget (self);
missile = P_SpawnMissileZ (self, self->z + 48*FRACUNIT,
@ -35,12 +37,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
missile->y += missile->vely;
missile->tracer = self->target;
}
return 0;
}
#define TRACEANGLE (0xc000000)
DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
{
PARAM_ACTION_PROLOGUE;
angle_t exact;
fixed_t dist;
fixed_t slope;
@ -57,7 +62,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
// [RH] level.time is always 0-based, so nothing special to do here.
if (level.time & 3)
return;
return 0;
// spawn a puff of smoke behind the rocket
P_SpawnPuff (self, PClass::FindClass(NAME_BulletPuff), self->x, self->y, self->z, 0, 3);
@ -74,7 +79,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
dest = self->tracer;
if (!dest || dest->health <= 0 || self->Speed == 0 || !self->CanSeek(dest))
return;
return 0;
// change angle
exact = R_PointToAngle2 (self->x, self->y, dest->x, dest->y);
@ -124,21 +129,27 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
else
self->velz += FRACUNIT/8;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SkelWhoosh)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
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;
return 0;
A_FaceTarget (self);
@ -149,4 +160,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelFist)
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
}
return 0;
}

View file

@ -164,17 +164,19 @@ void AScriptedMarine::Tick ()
DEFINE_ACTION_FUNCTION(AActor, A_M_Refire)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL || self->target->health <= 0)
{
if (self->MissileState && pr_m_refire() < 160)
{ // Look for a new target most of the time
if (P_LookForPlayers (self, true, NULL) && P_CheckMissileRange (self))
{ // Found somebody new and in range, so don't stop shooting
return;
return 0;
}
}
self->SetState (self->state + 1);
return;
return 0;
}
if ((self->MissileState == NULL && !self->CheckMeleeRange ()) ||
!P_CheckSight (self, self->target) ||
@ -182,6 +184,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_Refire)
{
self->SetState (self->state + 1);
}
return 0;
}
//============================================================================
@ -192,15 +195,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_Refire)
DEFINE_ACTION_FUNCTION(AActor, A_M_SawRefire)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL || self->target->health <= 0)
{
self->SetState (self->state + 1);
return;
return 0;
}
if (!self->CheckMeleeRange ())
{
self->SetState (self->state + 1);
}
return 0;
}
//============================================================================
@ -211,10 +217,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_SawRefire)
DEFINE_ACTION_FUNCTION(AActor, A_MarineNoise)
{
PARAM_ACTION_PROLOGUE;
if (static_cast<AScriptedMarine *>(self)->CurrentWeapon == AScriptedMarine::WEAPON_Chainsaw)
{
S_Sound (self, CHAN_WEAPON, "weapons/sawidle", 1, ATTN_NORM);
}
return 0;
}
//============================================================================
@ -225,8 +234,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_MarineNoise)
DEFINE_ACTION_FUNCTION(AActor, A_MarineChase)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_MarineNoise, self);
A_Chase (self);
A_Chase (stack, self);
return 0;
}
//============================================================================
@ -237,8 +248,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_MarineChase)
DEFINE_ACTION_FUNCTION(AActor, A_MarineLook)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_MarineNoise, self);
CALL_ACTION(A_Look, self);
return 0;
}
//============================================================================
@ -249,14 +262,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_MarineLook)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Saw)
{
ACTION_PARAM_START(4);
ACTION_PARAM_SOUND(fullsound, 0);
ACTION_PARAM_SOUND(hitsound, 1);
ACTION_PARAM_INT(damage, 2);
ACTION_PARAM_CLASS(pufftype, 3);
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; }
if (self->target == NULL)
return;
return 0;
if (pufftype == NULL) pufftype = PClass::FindClass(NAME_BulletPuff);
if (damage == 0) damage = 2;
@ -277,7 +290,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Saw)
if (!linetarget)
{
S_Sound (self, CHAN_WEAPON, fullsound, 1, ATTN_NORM);
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
@ -303,6 +316,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Saw)
S_Sound (self, CHAN_WEAPON, fullsound, 1, ATTN_NORM);
}
//A_Chase (self);
return 0;
}
//============================================================================
@ -338,10 +352,11 @@ static void MarinePunch(AActor *self, int damagemul)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Punch)
{
ACTION_PARAM_START(1);
ACTION_PARAM_INT(mult, 0);
PARAM_ACTION_PROLOGUE;
PARAM_INT(mult);
MarinePunch(self, mult);
return 0;
}
//============================================================================
@ -374,16 +389,17 @@ void P_GunShot2 (AActor *mo, bool accurate, int pitch, const PClass *pufftype)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FirePistol)
{
if (self->target == NULL)
return;
PARAM_ACTION_PROLOGUE;
PARAM_BOOL(accurate);
ACTION_PARAM_START(1);
ACTION_PARAM_BOOL(accurate, 0);
if (self->target == NULL)
return 0;
S_Sound (self, CHAN_WEAPON, "weapons/pistol", 1, ATTN_NORM);
A_FaceTarget (self);
P_GunShot2 (self, accurate, P_AimLineAttack (self, self->angle, MISSILERANGE),
PClass::FindClass(NAME_BulletPuff));
return 0;
}
//============================================================================
@ -394,10 +410,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FirePistol)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun)
{
PARAM_ACTION_PROLOGUE;
int pitch;
if (self->target == NULL)
return;
return 0;
S_Sound (self, CHAN_WEAPON, "weapons/shotgf", 1, ATTN_NORM);
A_FaceTarget (self);
@ -407,6 +425,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun)
P_GunShot2 (self, false, pitch, PClass::FindClass(NAME_BulletPuff));
}
self->special1 = level.maptime + 27;
return 0;
}
//============================================================================
@ -417,6 +436,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun)
DEFINE_ACTION_FUNCTION(AActor, A_M_CheckAttack)
{
PARAM_ACTION_PROLOGUE;
if (self->special1 != 0 || self->target == NULL)
{
self->SetState (self->FindState("SkipAttack"));
@ -425,6 +446,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_CheckAttack)
{
A_FaceTarget (self);
}
return 0;
}
//============================================================================
@ -435,10 +457,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_CheckAttack)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun2)
{
PARAM_ACTION_PROLOGUE;
int pitch;
if (self->target == NULL)
return;
return 0;
S_Sound (self, CHAN_WEAPON, "weapons/sshotf", 1, ATTN_NORM);
A_FaceTarget (self);
@ -453,6 +477,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun2)
NAME_None, PClass::FindClass(NAME_BulletPuff));
}
self->special1 = level.maptime;
return 0;
}
//============================================================================
@ -463,16 +488,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun2)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FireCGun)
{
if (self->target == NULL)
return;
PARAM_ACTION_PROLOGUE;
PARAM_BOOL(accurate);
ACTION_PARAM_START(1);
ACTION_PARAM_BOOL(accurate, 0);
if (self->target == NULL)
return 0;
S_Sound (self, CHAN_WEAPON, "weapons/chngun", 1, ATTN_NORM);
A_FaceTarget (self);
P_GunShot2 (self, accurate, P_AimLineAttack (self, self->angle, MISSILERANGE),
PClass::FindClass(NAME_BulletPuff));
return 0;
}
//============================================================================
@ -487,8 +513,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FireCGun)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireMissile)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
if (self->CheckMeleeRange ())
{ // If too close, punch it
@ -499,6 +527,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireMissile)
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("Rocket"));
}
return 0;
}
//============================================================================
@ -509,11 +538,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireMissile)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireRailgun)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
CALL_ACTION(A_MonsterRail, self);
self->special1 = level.maptime + 50;
return 0;
}
//============================================================================
@ -524,12 +556,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireRailgun)
DEFINE_ACTION_FUNCTION(AActor, A_M_FirePlasma)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("PlasmaBall"));
self->special1 = level.maptime + 20;
return 0;
}
//============================================================================
@ -540,8 +575,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FirePlasma)
DEFINE_ACTION_FUNCTION(AActor, A_M_BFGsound)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
if (self->special1 != 0)
{
@ -554,6 +591,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_BFGsound)
// Don't interrupt the firing sequence
self->PainChance = 0;
}
return 0;
}
//============================================================================
@ -564,13 +602,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_BFGsound)
DEFINE_ACTION_FUNCTION(AActor, A_M_FireBFG)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
A_FaceTarget (self);
P_SpawnMissile (self, self->target, PClass::FindClass("BFGBall"));
self->special1 = level.maptime + 30;
self->PainChance = MARINE_PAIN_CHANCE;
return 0;
}
//---------------------------------------------------------------------------

View file

@ -13,11 +13,13 @@ 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;
return 0;
if (!self->target
|| P_HitFriend (self)
@ -26,10 +28,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpidRefire)
{
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 (self);
A_Chase (stack, self);
return 0;
}

View file

@ -66,9 +66,11 @@ void AChickenPlayer::MorphPlayerThink ()
DEFINE_ACTION_FUNCTION(AActor, A_ChicAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return;
return 0;
}
if (self->CheckMeleeRange())
{
@ -76,6 +78,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChicAttack)
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
}
return 0;
}
//----------------------------------------------------------------------------
@ -86,6 +89,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChicAttack)
DEFINE_ACTION_FUNCTION(AActor, A_Feathers)
{
PARAM_ACTION_PROLOGUE;
int i;
int count;
AActor *mo;
@ -107,6 +112,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Feathers)
mo->velz = FRACUNIT + (pr_feathers() << 9);
mo->SetState (mo->SpawnState + (pr_feathers()&7));
}
return 0;
}
//---------------------------------------------------------------------------
@ -132,14 +138,17 @@ void P_UpdateBeak (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_BeakRaise)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
player->psprites[ps_weapon].sy = WEAPONTOP;
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->GetReadyState());
return 0;
}
//----------------------------------------------------------------------------
@ -161,6 +170,8 @@ void P_PlayPeck (AActor *chicken)
DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -169,7 +180,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
if (NULL == (player = self->player))
{
return;
return 0;
}
damage = 1 + (pr_beakatkpl1()&3);
@ -184,6 +195,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
P_PlayPeck (player->mo);
player->chickenPeck = 12;
player->psprites[ps_weapon].tics -= pr_beakatkpl1() & 7;
return 0;
}
//----------------------------------------------------------------------------
@ -194,6 +206,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL2)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -202,7 +216,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL2)
if (NULL == (player = self->player))
{
return;
return 0;
}
damage = pr_beakatkpl2.HitDice (4);
@ -217,4 +231,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL2)
P_PlayPeck (player->mo);
player->chickenPeck = 12;
player->psprites[ps_weapon].tics -= pr_beakatkpl2()&3;
return 0;
}

View file

@ -28,8 +28,11 @@ static FRandom pr_bluespark ("BlueSpark");
DEFINE_ACTION_FUNCTION(AActor, A_Sor1Pain)
{
PARAM_ACTION_PROLOGUE;
self->special1 = 20; // Number of steps to walk fast
CALL_ACTION(A_Pain, self);
return 0;
}
//----------------------------------------------------------------------------
@ -40,12 +43,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor1Pain)
DEFINE_ACTION_FUNCTION(AActor, A_Sor1Chase)
{
PARAM_ACTION_PROLOGUE;
if (self->special1)
{
self->special1--;
self->tics -= 3;
}
A_Chase(self);
A_Chase(stack, self);
return 0;
}
//----------------------------------------------------------------------------
@ -58,13 +64,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor1Chase)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
fixed_t velz;
angle_t angle;
if (!self->target)
{
return;
return 0;
}
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
if (self->CheckMeleeRange ())
@ -72,7 +80,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
int damage = pr_scrc1atk.HitDice (8);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
const PClass *fx = PClass::FindClass("SorcererFX1");
@ -103,6 +111,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
}
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -113,6 +122,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
DEFINE_ACTION_FUNCTION(AActor, A_SorcererRise)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
self->flags &= ~MF_SOLID;
@ -120,6 +131,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcererRise)
mo->SetState (mo->FindState("Rise"));
mo->angle = self->angle;
mo->CopyFriendliness (self, true);
return 0;
}
//----------------------------------------------------------------------------
@ -165,6 +177,7 @@ void P_DSparilTeleport (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Decide)
{
PARAM_ACTION_PROLOGUE;
static const int chance[] =
{
@ -181,6 +194,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Decide)
{
P_DSparilTeleport (self);
}
return 0;
}
//----------------------------------------------------------------------------
@ -191,11 +205,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Decide)
DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
{
PARAM_ACTION_PROLOGUE;
int chance;
if (!self->target)
{
return;
return 0;
}
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NONE);
if (self->CheckMeleeRange())
@ -203,7 +219,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
int damage = pr_s2a.HitDice (20);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
chance = self->health < self->SpawnHealth()/2 ? 96 : 48;
if (pr_s2a() < chance)
@ -220,6 +236,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
{ // Blue bolt
P_SpawnMissile (self, self->target, PClass::FindClass("Sorcerer2FX1"));
}
return 0;
}
//----------------------------------------------------------------------------
@ -230,6 +247,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark)
{
PARAM_ACTION_PROLOGUE;
int i;
AActor *mo;
@ -240,6 +259,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark)
mo->vely = pr_bluespark.Random2() << 9;
mo->velz = FRACUNIT + (pr_bluespark()<<8);
}
return 0;
}
//----------------------------------------------------------------------------
@ -250,6 +270,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark)
DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn("Wizard", self->x, self->y, self->z, ALLOW_REPLACE);
@ -273,6 +295,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
Spawn<ATeleportFog> (self->x, self->y, self->z, ALLOW_REPLACE);
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -283,8 +306,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
DEFINE_ACTION_FUNCTION(AActor, A_Sor2DthInit)
{
PARAM_ACTION_PROLOGUE;
self->special1 = 7; // Animation loop counter
P_Massacre (); // Kill monsters early
return 0;
}
//----------------------------------------------------------------------------
@ -295,9 +321,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_Sor2DthInit)
DEFINE_ACTION_FUNCTION(AActor, A_Sor2DthLoop)
{
PARAM_ACTION_PROLOGUE;
if (--self->special1)
{ // Need to loop
self->SetState (self->FindState("DeathLoop"));
}
return 0;
}

View file

@ -47,6 +47,8 @@ bool AArtiTomeOfPower::Use (bool pickup)
DEFINE_ACTION_FUNCTION(AActor, A_TimeBomb)
{
PARAM_ACTION_PROLOGUE;
self->z += 32*FRACUNIT;
self->RenderStyle = STYLE_Add;
self->alpha = FRACUNIT;
@ -55,6 +57,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_TimeBomb)
{
P_HitFloor (self);
}
return 0;
}
class AArtiTimeBomb : public AInventory

View file

@ -19,6 +19,8 @@ static FRandom pr_imp ("ImpExplode");
DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
{
PARAM_ACTION_PROLOGUE;
AActor *chunk;
self->flags &= ~MF_NOGRAVITY;
@ -36,6 +38,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
{ // Extreme death crash
self->SetState (self->FindState("XCrash"));
}
return 0;
}
//----------------------------------------------------------------------------
@ -46,8 +49,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
DEFINE_ACTION_FUNCTION(AActor, A_ImpDeath)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_SOLID;
self->flags2 |= MF2_FLOORCLIP;
return 0;
}
//----------------------------------------------------------------------------
@ -58,9 +64,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_ImpDeath)
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

@ -42,8 +42,8 @@ static FRandom pr_volcimpact ("VolcBallImpact");
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
{
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(gootype, 0);
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT (gootype, AActor) { gootype = PClass::FindClass("PodGoo"); }
int count;
int chance;
@ -52,7 +52,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
chance = pr_podpain ();
if (chance < 128)
{
return;
return 0;
}
for (count = chance > 240 ? 2 : 1; count; count--)
{
@ -62,6 +62,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
goo->vely = pr_podpain.Random2() << 9;
goo->velz = FRACUNIT/2 + (pr_podpain() << 9);
}
return 0;
}
//----------------------------------------------------------------------------
@ -72,15 +73,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
DEFINE_ACTION_FUNCTION(AActor, A_RemovePod)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if ( (mo = self->master))
if ( (mo = self->master) )
{
if (mo->special1 > 0)
{
mo->special1--;
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -93,8 +97,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_RemovePod)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
{
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(podtype, 0);
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(podtype, AActor) { podtype = PClass::FindClass("Pod"); }
AActor *mo;
fixed_t x;
@ -103,7 +107,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
if (self->special1 == MAX_GEN_PODS)
{ // Too many generated pods
return;
return 0;
}
x = self->x;
y = self->y;
@ -112,14 +116,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
if (!P_CheckPosition (mo, x, y))
{ // Didn't fit
mo->Destroy ();
return;
return 0;
}
mo->SetState (mo->FindState("Grow"));
P_ThrustMobj (mo, pr_makepod()<<24, (fixed_t)(4.5*FRACUNIT));
S_Sound (mo, CHAN_BODY, self->AttackSound, 1, ATTN_IDLE);
self->special1++; // Increment generated pod count
mo->master = self; // Link the generator to the pod
return;
return 0;
}
//----------------------------------------------------------------------------
@ -130,10 +134,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
{
PARAM_ACTION_PROLOGUE;
if (++self->health > 35)
{
self->velz += self->velz/2;
}
return 0;
}
@ -145,7 +152,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
DEFINE_ACTION_FUNCTION(AActor, A_VolcanoSet)
{
PARAM_ACTION_PROLOGUE;
self->tics = 105 + (pr_volcano() & 127);
return 0;
}
//----------------------------------------------------------------------------
@ -156,6 +166,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoSet)
DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
{
PARAM_ACTION_PROLOGUE;
int i;
int count;
AActor *blast;
@ -176,6 +188,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM);
P_CheckMissileSpawn (blast);
}
return 0;
}
//----------------------------------------------------------------------------
@ -186,6 +199,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
{
PARAM_ACTION_PROLOGUE;
int i;
AActor *tiny;
angle_t angle;
@ -210,5 +225,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
tiny->velz = FRACUNIT + (pr_volcimpact() << 9);
P_CheckMissileSpawn (tiny);
}
return 0;
}

View file

@ -61,6 +61,8 @@ extern bool P_AutoUseChaosDevice (player_t *player);
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int slope;
player_t *player;
@ -68,18 +70,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
ACTION_PARAM_START(2);
ACTION_PARAM_INT(damage, 0);
ACTION_PARAM_CLASS(puff, 1);
PARAM_INT (damage);
PARAM_CLASS (puff, AActor);
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
if (puff == NULL) puff = PClass::FindClass(NAME_BulletPuff); // just to be sure
angle = self->angle;
@ -93,6 +94,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
self->angle = R_PointToAngle2 (self->x,
self->y, linetarget->x, linetarget->y);
}
return 0;
}
@ -104,20 +106,22 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
angle_t pitch = P_BulletSlope(self);
damage = 7+(pr_fgw()&7);
@ -128,6 +132,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
}
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_None, "GoldWandPuff1");
S_Sound (self, CHAN_WEAPON, "weapons/wandhit", 1, ATTN_NORM);
return 0;
}
//----------------------------------------------------------------------------
@ -138,6 +143,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
{
PARAM_ACTION_PROLOGUE;
int i;
angle_t angle;
int damage;
@ -146,14 +153,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
angle_t pitch = P_BulletSlope(self);
velz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed,
@ -168,6 +175,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
angle += ((ANG45/8)*2)/4;
}
S_Sound (self, CHAN_WEAPON, "weapons/wandhit", 1, ATTN_NORM);
return 0;
}
//----------------------------------------------------------------------------
@ -178,22 +186,25 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX1"));
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX3"), self->angle-(ANG45/10));
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX3"), self->angle+(ANG45/10));
return 0;
}
//----------------------------------------------------------------------------
@ -204,24 +215,27 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX2"));
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX2"), self->angle-(ANG45/10));
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX2"), self->angle+(ANG45/10));
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX3"), self->angle-(ANG45/5));
P_SpawnPlayerMissile (self, PClass::FindClass("CrossbowFX3"), self->angle+(ANG45/5));
return 0;
}
//---------------------------------------------------------------------------
@ -232,6 +246,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -243,17 +259,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
ACTION_PARAM_START(1);
ACTION_PARAM_INT(power, 0);
PARAM_INT(power);
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
player->psprites[ps_weapon].sx = ((pr_gatk()&3)-2) * FRACUNIT;
player->psprites[ps_weapon].sy = WEAPONTOP + (pr_gatk()&3) * FRACUNIT;
@ -281,7 +296,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
player->extralight = !player->extralight;
}
S_Sound (self, CHAN_AUTO, "weapons/gauntletson", 1, ATTN_NORM);
return;
return 0;
}
randVal = pr_gatk();
if (randVal < 64)
@ -323,6 +338,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
self->angle += ANG90/20;
}
self->flags |= MF_JUSTATTACKED;
return 0;
}
// --- Mace -----------------------------------------------------------------
@ -406,24 +422,26 @@ void FireMacePL1B (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
{
PARAM_ACTION_PROLOGUE;
AActor *ball;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (pr_maceatk() < 28)
{
FireMacePL1B (self);
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
player->psprites[ps_weapon].sx = ((pr_maceatk()&3)-2)*FRACUNIT;
player->psprites[ps_weapon].sy = WEAPONTOP+(pr_maceatk()&3)*FRACUNIT;
@ -433,6 +451,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
{
ball->special1 = 16; // tics till dropoff
}
return 0;
}
//----------------------------------------------------------------------------
@ -443,14 +462,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
{
PARAM_ACTION_PROLOGUE;
if (self->special1 == 0)
{
return;
return 0;
}
self->special1 -= 4;
if (self->special1 > 0)
{
return;
return 0;
}
self->special1 = 0;
self->flags &= ~MF_NOGRAVITY;
@ -469,6 +490,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
self->vely = (int)(self->vely * velscale);
#endif
self->velz -= self->velz >> 1;
return 0;
}
//----------------------------------------------------------------------------
@ -479,6 +501,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact)
{
PARAM_ACTION_PROLOGUE;
if ((self->health != MAGIC_JUNK) && (self->flags & MF_INBOUNCE))
{ // Bounce
self->health = MAGIC_JUNK;
@ -494,6 +518,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact)
self->gravity = FRACUNIT;
S_Sound (self, CHAN_BODY, "weapons/macehit", 1, ATTN_NORM);
}
return 0;
}
//----------------------------------------------------------------------------
@ -504,6 +529,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact)
DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
{
PARAM_ACTION_PROLOGUE;
AActor *tiny;
angle_t angle;
@ -558,6 +585,7 @@ boom:
self->BounceFlags = BOUNCE_None;
self->gravity = FRACUNIT;
}
return 0;
}
//----------------------------------------------------------------------------
@ -568,20 +596,22 @@ boom:
DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
player_t *player;
AActor *linetarget;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->angle, &linetarget);
if (mo)
@ -596,6 +626,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
}
}
S_Sound (self, CHAN_WEAPON, "weapons/maceshoot", 1, ATTN_NORM);
return 0;
}
//----------------------------------------------------------------------------
@ -606,6 +637,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
{
PARAM_ACTION_PROLOGUE;
int i;
AActor *target;
angle_t angle = 0;
@ -615,7 +648,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
if ((self->z <= self->floorz) && P_HitFloor (self))
{ // Landed in some sort of liquid
self->Destroy ();
return;
return 0;
}
if (self->flags & MF_INBOUNCE)
{
@ -687,6 +720,7 @@ boom:
self->gravity = FRACUNIT;
S_Sound (self, CHAN_BODY, "weapons/maceexplode", 1, ATTN_NORM);
}
return 0;
}
@ -762,20 +796,22 @@ int ARipper::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
angle_t pitch = P_BulletSlope(self);
damage = pr_fb1.HitDice (4);
@ -786,6 +822,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
}
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_None, "BlasterPuff");
S_Sound (self, CHAN_WEAPON, "weapons/blastershoot", 1, ATTN_NORM);
return 0;
}
//----------------------------------------------------------------------------
@ -796,6 +833,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers)
{
PARAM_ACTION_PROLOGUE;
int i;
angle_t angle;
AActor *ripper;
@ -811,6 +850,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers)
ripper->vely = FixedMul (ripper->Speed, finesine[angle]);
P_CheckMissileSpawn (ripper);
}
return 0;
}
// --- Skull rod ------------------------------------------------------------
@ -883,19 +923,21 @@ void ARainTracker::Serialize (FArchive &arc)
DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
mo = P_SpawnPlayerMissile (self, PClass::FindClass("HornRodFX1"));
// Randomize the first frame
@ -903,6 +945,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
{
mo->SetState (mo->state->GetNextState());
}
return 0;
}
//----------------------------------------------------------------------------
@ -916,19 +959,21 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL1)
DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
AActor *MissileActor;
AActor *linetarget;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AHornRodFX2), self->angle, &linetarget, &MissileActor);
// Use MissileActor instead of the return value from
@ -943,6 +988,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
}
S_Sound (MissileActor, CHAN_WEAPON, "weapons/hornrodpowshoot", 1, ATTN_NORM);
}
return 0;
}
//----------------------------------------------------------------------------
@ -953,11 +999,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
DEFINE_ACTION_FUNCTION(AActor, A_AddPlayerRain)
{
PARAM_ACTION_PROLOGUE;
ARainTracker *tracker;
if (self->target == NULL || self->target->health <= 0)
{ // Shooter is dead or nonexistant
return;
return 0;
}
tracker = self->target->FindInventory<ARainTracker> ();
@ -1000,6 +1048,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AddPlayerRain)
tracker->Rain1 = self;
}
self->special1 = S_FindSound ("misc/rain");
return 0;
}
//----------------------------------------------------------------------------
@ -1010,6 +1059,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_AddPlayerRain)
DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
{
PARAM_ACTION_PROLOGUE;
fixed_t x;
fixed_t y;
AActor *mo;
@ -1021,7 +1072,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
if (self->target == NULL)
{ // Player left the game
self->Destroy ();
return;
return 0;
}
tracker = self->target->FindInventory<ARainTracker> ();
if (tracker != NULL)
@ -1036,11 +1087,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
}
}
self->Destroy ();
return;
return 0;
}
if (pr_storm() < 25)
{ // Fudge rain frequency
return;
return 0;
}
x = self->x + ((pr_storm()&127) - 64) * FRACUNIT;
y = self->y + ((pr_storm()&127) - 64) * FRACUNIT;
@ -1056,6 +1107,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
{
S_Sound (self, CHAN_BODY|CHAN_LOOP, self->special1, 1, ATTN_NORM);
}
return 0;
}
//----------------------------------------------------------------------------
@ -1066,6 +1118,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
DEFINE_ACTION_FUNCTION(AActor, A_RainImpact)
{
PARAM_ACTION_PROLOGUE;
if (self->z > self->floorz)
{
self->SetState (self->FindState("NotFloor"));
@ -1074,6 +1128,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RainImpact)
{
P_HitFloor (self);
}
return 0;
}
//----------------------------------------------------------------------------
@ -1084,7 +1139,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RainImpact)
DEFINE_ACTION_FUNCTION(AActor, A_HideInCeiling)
{
PARAM_ACTION_PROLOGUE;
self->z = self->ceilingz + 4*FRACUNIT;
return 0;
}
// --- Phoenix Rod ----------------------------------------------------------
@ -1168,25 +1226,28 @@ int APhoenixFX2::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, RUNTIME_CLASS(APhoenixFX1));
angle = self->angle + ANG180;
angle >>= ANGLETOFINESHIFT;
self->velx += FixedMul (4*FRACUNIT, finecosine[angle]);
self->vely += FixedMul (4*FRACUNIT, finesine[angle]);
return 0;
}
//----------------------------------------------------------------------------
@ -1197,6 +1258,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
{
PARAM_ACTION_PROLOGUE;
AActor *puff;
angle_t angle;
@ -1214,6 +1277,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]);
puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]);
puff->velz = 0;
return 0;
}
//----------------------------------------------------------------------------
@ -1224,6 +1288,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
APhoenixRod *flamethrower = static_cast<APhoenixRod *> (self->player->ReadyWeapon);
@ -1232,6 +1298,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
flamethrower->FlameCount = FLAME_THROWER_TICS;
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -1244,6 +1311,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_InitPhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
angle_t angle;
fixed_t x, y, z;
@ -1254,7 +1323,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
if (NULL == (player = self->player))
{
return;
return 0;
}
soundid = "weapons/phoenixpowshoot";
@ -1265,7 +1334,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
P_SetPsprite (player, ps_weapon, flamethrower->FindState("Powerdown"));
player->refire = 0;
S_StopSound (self, CHAN_WEAPON);
return;
return 0;
}
angle = self->angle;
x = self->x + (pr_fp2.Random2() << 9);
@ -1284,6 +1353,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
S_Sound (self, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
P_CheckMissileSpawn (mo);
return 0;
}
//----------------------------------------------------------------------------
@ -1294,19 +1364,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_ShutdownPhoenixPL2)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
S_StopSound (self, CHAN_WEAPON);
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
return 0;
}
//----------------------------------------------------------------------------
@ -1317,7 +1390,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShutdownPhoenixPL2)
DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd)
{
PARAM_ACTION_PROLOGUE;
self->velz += FRACUNIT*3/2;
return 0;
}
//----------------------------------------------------------------------------
@ -1328,6 +1404,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd)
DEFINE_ACTION_FUNCTION(AActor, A_FloatPuff)
{
PARAM_ACTION_PROLOGUE;
self->velz += FRACUNIT*18/10;
return 0;
}

View file

@ -59,6 +59,8 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
{
PARAM_ACTION_PROLOGUE;
int i;
AActor *fire;
AActor *baseFire;
@ -77,7 +79,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
target = self->target;
if (target == NULL)
{
return;
return 0;
}
A_FaceTarget (self);
if (self->CheckMeleeRange ())
@ -85,7 +87,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
int damage = pr_atk.HitDice (6);
P_DamageMobj (target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, target, self);
return;
return 0;
}
dist = P_AproxDistance (self->x-target->x, self->y-target->y)
> 8*64*FRACUNIT;
@ -133,6 +135,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
S_Sound (self, CHAN_BODY, "ironlich/attack3", 1, ATTN_NORM);
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -143,13 +146,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
{
PARAM_ACTION_PROLOGUE;
self->health -= 3;
if (self->health < 0)
{
self->velx = self->vely = self->velz = 0;
self->SetState (self->FindState(NAME_Death));
self->flags &= ~MF_MISSILE;
return;
return 0;
}
if ((self->special2 -= 3) < 0)
{
@ -158,9 +163,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
}
if (self->tracer && self->tracer->flags&MF_SHADOW)
{
return;
return 0;
}
P_SeekerMissile (self, ANGLE_1*10, ANGLE_1*30);
return 0;
}
//----------------------------------------------------------------------------
@ -171,6 +177,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
{
PARAM_ACTION_PROLOGUE;
int i;
angle_t angle;
AActor *shard;
@ -187,6 +195,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
shard->velz = -FRACUNIT*6/10;
P_CheckMissileSpawn (shard);
}
return 0;
}
//----------------------------------------------------------------------------
@ -197,6 +206,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
DEFINE_ACTION_FUNCTION(AActor, A_LichFireGrow)
{
PARAM_ACTION_PROLOGUE;
self->health--;
self->z += 9*FRACUNIT;
if (self->health == 0)
@ -204,5 +215,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichFireGrow)
self->Damage = self->GetDefault()->Damage;
self->SetState (self->FindState("NoGrow"));
}
return 0;
}

View file

@ -21,6 +21,8 @@ static FRandom pr_knightatk ("KnightAttack");
DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
fixed_t x, y;
@ -30,6 +32,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
mo->velx = pr_dripblood.Random2 () << 10;
mo->vely = pr_dripblood.Random2 () << 10;
mo->gravity = FRACUNIT/8;
return 0;
}
//----------------------------------------------------------------------------
@ -40,9 +43,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
DEFINE_ACTION_FUNCTION(AActor, A_KnightAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return;
return 0;
}
if (self->CheckMeleeRange ())
{
@ -50,16 +55,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_KnightAttack)
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
S_Sound (self, CHAN_BODY, "hknight/melee", 1, ATTN_NORM);
return;
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*FRACUNIT, self->target, PClass::FindClass("RedAxe"));
return;
return 0;
}
// Green axe
P_SpawnMissileZ (self, self->z + 36*FRACUNIT, self->target, PClass::FindClass("KnightAxe"));
return 0;
}

View file

@ -20,8 +20,11 @@ static FRandom pr_wizatk3 ("WizAtk3");
DEFINE_ACTION_FUNCTION(AActor, A_GhostOff)
{
PARAM_ACTION_PROLOGUE;
self->RenderStyle = STYLE_Normal;
self->flags3 &= ~MF3_GHOST;
return 0;
}
//----------------------------------------------------------------------------
@ -32,8 +35,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_GhostOff)
DEFINE_ACTION_FUNCTION(AActor, A_WizAtk1)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
CALL_ACTION(A_GhostOff, self);
return 0;
}
//----------------------------------------------------------------------------
@ -44,10 +50,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk1)
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;
}
//----------------------------------------------------------------------------
@ -58,12 +67,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk2)
DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
CALL_ACTION(A_GhostOff, self);
if (!self->target)
{
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
if (self->CheckMeleeRange())
@ -71,7 +82,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
int damage = pr_wizatk3.HitDice (4);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
const PClass *fx = PClass::FindClass("WizardFX1");
mo = P_SpawnMissile (self, self->target, fx);
@ -80,4 +91,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->velz);
P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->velz);
}
return 0;
}

View file

@ -27,17 +27,22 @@ static FRandom pr_batmove ("BatMove");
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;
angle_t angle;
// Countdown until next spawn
if (self->special1-- > 0) return;
if (self->special1-- > 0) return 0;
self->special1 = self->args[0]; // Reset frequency count
delta = self->args[1];
@ -51,11 +56,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatSpawn)
mo->special2 = self->args[3]<<3; // Set lifetime
mo->target = self;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_BatMove)
{
PARAM_ACTION_PROLOGUE;
angle_t newangle;
if (self->special2 < 0)
@ -86,4 +94,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatMove)
// Handle Z movement
self->z = self->target->z + 2*FloatBobOffsets[self->args[0]];
self->args[0] = (self->args[0]+3)&63;
return 0;
}

View file

@ -24,9 +24,11 @@ static FRandom pr_pain ("BishopPainBlur");
DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return;
return 0;
}
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
if (self->CheckMeleeRange())
@ -34,9 +36,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack)
int damage = pr_atk.HitDice (4);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
self->special1 = (pr_atk() & 3) + 5;
return 0;
}
//============================================================================
@ -48,13 +51,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack)
DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if (!self->target || !self->special1)
{
self->special1 = 0;
self->SetState (self->SeeState);
return;
return 0;
}
mo = P_SpawnMissile (self, self->target, PClass::FindClass("BishopFX"));
if (mo != NULL)
@ -63,6 +68,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack2)
mo->special2 = 16; // High word == x/y, Low word == z
}
self->special1--;
return 0;
}
//============================================================================
@ -73,6 +79,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopAttack2)
DEFINE_ACTION_FUNCTION(AActor, A_BishopMissileWeave)
{
PARAM_ACTION_PROLOGUE;
fixed_t newX, newY;
int weaveXY, weaveZ;
int angle;
@ -92,6 +100,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopMissileWeave)
weaveZ = (weaveZ + 2) & 63;
self->z += FloatBobOffsets[weaveZ];
self->special2 = weaveZ + (weaveXY<<16);
return 0;
}
//============================================================================
@ -102,14 +111,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopMissileWeave)
DEFINE_ACTION_FUNCTION(AActor, A_BishopDecide)
{
PARAM_ACTION_PROLOGUE;
if (pr_decide() < 220)
{
return;
return 0;
}
else
{
self->SetState (self->FindState ("Blur"));
}
}
return 0;
}
//============================================================================
@ -120,6 +132,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopDecide)
DEFINE_ACTION_FUNCTION(AActor, A_BishopDoBlur)
{
PARAM_ACTION_PROLOGUE;
self->special1 = (pr_doblur() & 3) + 3; // Random number of blurs
if (pr_doblur() < 120)
{
@ -134,6 +148,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopDoBlur)
P_ThrustMobj (self, self->angle, 11*FRACUNIT);
}
S_Sound (self, CHAN_BODY, "BishopBlur", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -144,6 +159,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopDoBlur)
DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if (!--self->special1)
@ -164,6 +181,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
{
mo->angle = self->angle;
}
return 0;
}
//============================================================================
@ -174,9 +192,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
DEFINE_ACTION_FUNCTION(AActor, A_BishopChase)
{
PARAM_ACTION_PROLOGUE;
self->z -= FloatBobOffsets[self->special2] >> 1;
self->special2 = (self->special2 + 4) & 63;
self->z += FloatBobOffsets[self->special2] >> 1;
return 0;
}
//============================================================================
@ -187,6 +208,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopChase)
DEFINE_ACTION_FUNCTION(AActor, A_BishopPuff)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn ("BishopPuff", self->x, self->y, self->z + 40*FRACUNIT, ALLOW_REPLACE);
@ -194,6 +217,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopPuff)
{
mo->velz = FRACUNIT/2;
}
return 0;
}
//============================================================================
@ -204,12 +228,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopPuff)
DEFINE_ACTION_FUNCTION(AActor, A_BishopPainBlur)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
if (pr_pain() < 64)
{
self->SetState (self->FindState ("Blur"));
return;
return 0;
}
fixed_t x = self->x + (pr_pain.Random2()<<12);
fixed_t y = self->y + (pr_pain.Random2()<<12);
@ -219,4 +245,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopPainBlur)
{
mo->angle = self->angle;
}
return 0;
}

View file

@ -16,6 +16,8 @@ static FRandom pr_centaurdefend ("CentaurDefend");
DEFINE_ACTION_FUNCTION(AActor, A_CentaurDefend)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
if (self->CheckMeleeRange() && pr_centaurdefend() < 32)
{
@ -24,4 +26,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_CentaurDefend)
self->flags2&=~(MF2_REFLECTIVE|MF2_INVULNERABLE);
self->SetState (self->MeleeState);
}
return 0;
}

View file

@ -69,20 +69,23 @@ void ACFlameMissile::Effect ()
DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACFlameMissile));
S_Sound (self, CHAN_WEAPON, "ClericFlameFire", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -93,11 +96,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
self->velx = 0;
self->vely = 0;
self->velz = 0;
S_Sound (self, CHAN_BODY, "ClericFlameExplode", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -108,6 +114,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff)
DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
{
PARAM_ACTION_PROLOGUE;
int i;
int an, an90;
fixed_t dist;
@ -148,6 +156,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
}
self->SetState (self->SpawnState);
}
return 0;
}
//============================================================================
@ -158,10 +167,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
DEFINE_ACTION_FUNCTION(AActor, A_CFlameRotate)
{
PARAM_ACTION_PROLOGUE;
int an;
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
self->velx = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]);
self->vely = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]);
self->angle += ANG90/15;
return 0;
}

View file

@ -184,6 +184,8 @@ bool AHolySpirit::IsOkayToAttack (AActor *link)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack2)
{
PARAM_ACTION_PROLOGUE;
int j;
int i;
AActor *mo;
@ -229,6 +231,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack2)
}
SpawnSpiritTail (mo);
}
return 0;
}
//============================================================================
@ -261,24 +264,27 @@ void SpawnSpiritTail (AActor *spirit)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
AActor *linetarget;
if (NULL == (player = self->player))
{
return;
return 0;
}
ACWeapWraithverge *weapon = static_cast<ACWeapWraithverge *> (self->player->ReadyWeapon);
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
AActor * missile = P_SpawnPlayerMissile (self, 0,0,0, PClass::FindClass ("HolyMissile"), self->angle, &linetarget);
if (missile != NULL) missile->tracer = linetarget;
weapon->CHolyCount = 3;
S_Sound (self, CHAN_WEAPON, "HolySymbolFire", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -289,6 +295,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyPalette)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
ACWeapWraithverge *weapon = static_cast<ACWeapWraithverge *> (self->player->ReadyWeapon);
@ -297,6 +305,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyPalette)
weapon->CHolyCount--;
}
}
return 0;
}
//============================================================================
@ -372,6 +381,8 @@ static void CHolyTailRemove (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyTail)
{
PARAM_ACTION_PROLOGUE;
AActor *parent;
parent = self->target;
@ -379,7 +390,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyTail)
if (parent == NULL || parent->health <= 0) // better check for health than current state - it's safer!
{ // Ghost removed, so remove all tail parts
CHolyTailRemove (self);
return;
return 0;
}
else
{
@ -391,6 +402,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyTail)
}
CHolyTailFollow (self, 10*FRACUNIT);
}
return 0;
}
//============================================================================
@ -529,6 +541,8 @@ static void CHolyWeave (AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
{
PARAM_ACTION_PROLOGUE;
self->health--;
if (self->health <= 0)
{
@ -537,7 +551,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
self->velz = 0;
self->SetState (self->FindState(NAME_Death));
self->tics -= pr_holyseek()&3;
return;
return 0;
}
if (self->tracer)
{
@ -549,6 +563,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
}
}
CHolyWeave (self);
return 0;
}
//============================================================================
@ -559,6 +574,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
DEFINE_ACTION_FUNCTION(AActor, A_CHolyCheckScream)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_CHolySeek, self);
if (pr_checkscream() < 20)
{
@ -568,6 +585,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyCheckScream)
{
CHolyFindTarget(self);
}
return 0;
}
//============================================================================
@ -579,10 +597,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyCheckScream)
DEFINE_ACTION_FUNCTION(AActor, A_ClericAttack)
{
if (!self->target) return;
PARAM_ACTION_PROLOGUE;
if (!self->target) return 0;
AActor * missile = P_SpawnMissileZ (self, self->z + 40*FRACUNIT, self->target, PClass::FindClass ("HolyMissile"));
if (missile != NULL) missile->tracer = NULL; // No initial target
S_Sound (self, CHAN_WEAPON, "HolySymbolFire", 1, ATTN_NORM);
return 0;
}

View file

@ -17,6 +17,8 @@ static FRandom pr_maceatk ("CMaceAttack");
DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -26,7 +28,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
damage = 25+(pr_maceatk()&15);
@ -60,5 +62,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
slope = P_AimLineAttack (player->mo, angle, MELEERANGE, &linetarget);
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, PClass::FindClass ("HammerPuff"));
macedone:
return;
return 0;
}

View file

@ -46,6 +46,8 @@ int ACStaffMissile::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
{
PARAM_ACTION_PROLOGUE;
AActor *pmo;
int damage;
int newLife;
@ -57,7 +59,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
@ -107,6 +109,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
break;
}
}
return 0;
}
//============================================================================
@ -117,19 +120,21 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACStaffMissile), self->angle-(ANG45/15));
if (mo)
@ -142,6 +147,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
mo->special2 = 0;
}
S_Sound (self, CHAN_WEAPON, "ClericCStaffFire", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -152,6 +158,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither)
{
PARAM_ACTION_PROLOGUE;
fixed_t newX, newY;
int weaveXY;
int angle;
@ -165,6 +173,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither)
newY += FixedMul(finesine[angle], FloatBobOffsets[weaveXY]);
P_TryMove (self, newX, newY, true);
self->special2 = weaveXY;
return 0;
}
//============================================================================
@ -175,7 +184,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffMissileSlither)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink)
{
PARAM_ACTION_PROLOGUE;
self->special1 = (pr_blink()>>1)+20;
return 0;
}
//============================================================================
@ -186,6 +198,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffInitBlink)
DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheckBlink)
{
PARAM_ACTION_PROLOGUE;
if (self->player && self->player->ReadyWeapon)
{
if (!--self->special1)
@ -198,4 +212,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheckBlink)
DoReadyWeapon(self);
}
}
return 0;
}

View file

@ -164,6 +164,8 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
DEFINE_ACTION_FUNCTION(AActor, A_DragonInitFlight)
{
PARAM_ACTION_PROLOGUE;
FActorIterator iterator (self->tid);
do
@ -172,10 +174,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonInitFlight)
if (self->tracer == NULL)
{
self->SetState (self->SpawnState);
return;
return 0;
}
} while (self->tracer == self);
self->RemoveFromHash ();
return 0;
}
//============================================================================
@ -186,6 +189,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonInitFlight)
DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
DragonSeek (self, 4*ANGLE_1, 8*ANGLE_1);
@ -194,7 +199,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
if(!(self->target->flags&MF_SHOOTABLE))
{ // target died
self->target = NULL;
return;
return 0;
}
angle = R_PointToAngle2(self->x, self->y, self->target->x,
self->target->y);
@ -215,6 +220,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
{
P_LookForPlayers (self, true, NULL);
}
return 0;
}
//============================================================================
@ -225,6 +231,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
DEFINE_ACTION_FUNCTION(AActor, A_DragonFlap)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_DragonFlight, self);
if (pr_dragonflap() < 240)
{
@ -234,6 +242,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlap)
{
self->PlayActiveSound ();
}
return 0;
}
//============================================================================
@ -244,7 +253,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlap)
DEFINE_ACTION_FUNCTION(AActor, A_DragonAttack)
{
P_SpawnMissile (self, self->target, PClass::FindClass ("DragonFireball"));
PARAM_ACTION_PROLOGUE;
P_SpawnMissile (self, self->target, PClass::FindClass ("DragonFireball"));
return 0;
}
//============================================================================
@ -255,6 +267,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonAttack)
DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int i;
int delay;
@ -272,7 +286,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2)
mo->tics = delay+(pr_dragonfx2()&3)*i*2;
mo->target = self->target;
}
}
}
return 0;
}
//============================================================================
@ -283,11 +298,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFX2)
DEFINE_ACTION_FUNCTION(AActor, A_DragonPain)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_Pain, self);
if (!self->tracer)
{ // no destination spot yet
self->SetState (self->SeeState);
}
return 0;
}
//============================================================================
@ -298,8 +316,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonPain)
DEFINE_ACTION_FUNCTION(AActor, A_DragonCheckCrash)
{
PARAM_ACTION_PROLOGUE;
if (self->z <= self->floorz)
{
self->SetState (self->FindState ("Crash"));
}
return 0;
}

View file

@ -70,11 +70,13 @@ FState *AFWeapAxe::GetAtkState (bool hold)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (player->ReadyWeapon->Ammo1->Amount)
{
@ -84,6 +86,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
{
DoReadyWeapon(self);
}
return 0;
}
//============================================================================
@ -94,11 +97,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReady)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (player->ReadyWeapon->Ammo1->Amount <= 0)
{
@ -108,6 +113,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
{
DoReadyWeapon(self);
}
return 0;
}
//============================================================================
@ -118,11 +124,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckReadyG)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (player->ReadyWeapon->Ammo1->Amount)
{
@ -132,6 +140,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
{
CALL_ACTION(A_Raise, self);
}
return 0;
}
//============================================================================
@ -142,11 +151,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUp)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (player->ReadyWeapon->Ammo1->Amount <= 0)
{
@ -156,6 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
{
CALL_ACTION(A_Raise, self);
}
return 0;
}
//============================================================================
@ -166,16 +178,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckUpG)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckAtk)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (player->ReadyWeapon->Ammo1->Amount)
{
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->FindState ("FireGlow"));
}
return 0;
}
//============================================================================
@ -186,6 +201,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeCheckAtk)
DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
fixed_t power;
int damage;
@ -199,7 +216,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
AActor *pmo=player->mo;
@ -271,6 +288,6 @@ axedone:
}
}
}
return;
return 0;
}

View file

@ -27,6 +27,8 @@ extern void AdjustPlayerAngle (AActor *pmo, AActor *linetarget);
DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
fixed_t power;
@ -37,7 +39,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
AActor *pmo=player->mo;
@ -91,7 +93,7 @@ hammerdone:
{
pmo->special1 = false;
}
return;
return 0;
}
//============================================================================
@ -102,27 +104,30 @@ hammerdone:
DEFINE_ACTION_FUNCTION(AActor, A_FHammerThrow)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
if (!player->mo->special1)
{
return;
return 0;
}
AWeapon *weapon = player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire, false))
return;
return 0;
}
mo = P_SpawnPlayerMissile (player->mo, PClass::FindClass ("HammerMissile"));
if (mo)
{
mo->special1 = 0;
}
}
return 0;
}

View file

@ -134,6 +134,8 @@ void AdjustPlayerAngle (AActor *pmo, AActor *linetarget)
DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -145,7 +147,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
APlayerPawn *pmo = player->mo;
@ -207,6 +209,6 @@ punchdone:
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->FindState ("Fire2"));
S_Sound (pmo, CHAN_VOICE, "*fistgrunt", 1, ATTN_NORM);
}
return;
return 0;
}

View file

@ -63,10 +63,10 @@ bool AFighterWeaponPiece::TryPickup (AActor *&toucher)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces)
{
ACTION_PARAM_START(3);
ACTION_PARAM_CLASS(p1, 0);
ACTION_PARAM_CLASS(p2, 1);
ACTION_PARAM_CLASS(p3, 2);
PARAM_ACTION_PROLOGUE;
PARAM_CLASS(p1, AActor);
PARAM_CLASS(p2, AActor);
PARAM_CLASS(p3, AActor);
for (int i = 0, j = 0, fineang = 0; i < 3; ++i)
{
@ -85,6 +85,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces)
}
}
}
return 0;
}
@ -117,17 +118,19 @@ int AFSwordMissile::DoSpecialDamage(AActor *victim, AActor *source, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
P_SpawnPlayerMissile (self, 0, 0, -10*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle+ANGLE_45/4);
P_SpawnPlayerMissile (self, 0, 0, -5*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle+ANGLE_45/8);
@ -135,6 +138,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
P_SpawnPlayerMissile (self, 0, 0, 5*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle-ANGLE_45/8);
P_SpawnPlayerMissile (self, 0, 0, 10*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle-ANGLE_45/4);
S_Sound (self, CHAN_WEAPON, "FighterSwordFire", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -145,6 +149,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames)
{
PARAM_ACTION_PROLOGUE;
int i;
for (i = 1+(pr_fswordflame()&3); i; i--)
@ -154,6 +160,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames)
fixed_t z = self->z+((pr_fswordflame()-128)<<11);
Spawn ("FSwordFlame", x, y, z, ALLOW_REPLACE);
}
return 0;
}
//============================================================================
@ -164,7 +171,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordFlames)
DEFINE_ACTION_FUNCTION(AActor, A_FighterAttack)
{
if (!self->target) return;
PARAM_ACTION_PROLOGUE;
if (!self->target) return 0;
angle_t angle = self->angle;
@ -174,5 +183,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FighterAttack)
P_SpawnMissileAngle (self, RUNTIME_CLASS(AFSwordMissile), angle-ANG45/8, 0);
P_SpawnMissileAngle (self, RUNTIME_CLASS(AFSwordMissile), angle-ANG45/4, 0);
S_Sound (self, CHAN_WEAPON, "FighterSwordFire", 1, ATTN_NORM);
return 0;
}

View file

@ -81,11 +81,14 @@ void A_FiredSpawnRock (AActor *actor)
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;
}
//============================================================================
@ -96,11 +99,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredRocks)
DEFINE_ACTION_FUNCTION(AActor, A_SmBounce)
{
PARAM_ACTION_PROLOGUE;
// give some more velocity (x,y,&z)
self->z = self->floorz + FRACUNIT;
self->velz = (2*FRACUNIT) + (pr_smbounce() << 10);
self->velx = pr_smbounce()%3<<FRACBITS;
self->vely = pr_smbounce()%3<<FRACBITS;
return 0;
}
//============================================================================
@ -111,10 +117,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SmBounce)
DEFINE_ACTION_FUNCTION(AActor, A_FiredAttack)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
AActor *mo = P_SpawnMissile (self, self->target, PClass::FindClass ("FireDemonMissile"));
if (mo) S_Sound (self, CHAN_BODY, "FireDemonAttack", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -125,6 +134,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredAttack)
DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
{
PARAM_ACTION_PROLOGUE;
int weaveindex = self->special1;
AActor *target = self->target;
angle_t ang;
@ -146,7 +157,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
if(!self->target || !(self->target->flags&MF_SHOOTABLE))
{ // Invalid target
P_LookForPlayers (self,true, NULL);
return;
return 0;
}
// Strafe
@ -194,7 +205,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
{
self->SetState (self->MissileState);
self->flags |= MF_JUSTATTACKED;
return;
return 0;
}
}
else
@ -207,6 +218,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
{
self->PlayActiveSound ();
}
return 0;
}
//============================================================================
@ -217,6 +229,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn ("FireDemonSplotch1", self->x, self->y, self->z, ALLOW_REPLACE);
@ -233,4 +247,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch)
mo->vely = (pr_firedemonsplotch() - 128) << 11;
mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
}
return 0;
}

View file

@ -297,6 +297,8 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn<APoisonCloud> (self->x, self->y, self->z+28*FRACUNIT, ALLOW_REPLACE);
@ -304,6 +306,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit)
{
mo->target = self->target;
}
return 0;
}
//===========================================================================
@ -314,14 +317,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagInit)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagCheck)
{
PARAM_ACTION_PROLOGUE;
if (--self->special1 <= 0)
{
self->SetState (self->FindState ("Death"));
}
else
{
return;
return 0;
}
return 0;
}
//===========================================================================
@ -332,12 +338,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagCheck)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage)
{
PARAM_ACTION_PROLOGUE;
int bobIndex;
P_RadiusAttack (self, self->target, 4, 40, self->DamageType, true);
bobIndex = self->special2;
self->z += FloatBobOffsets[bobIndex]>>4;
self->special2 = (bobIndex+1)&63;
return 0;
}
//===========================================================================
@ -348,10 +357,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonBagDamage)
DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb)
{
PARAM_ACTION_PROLOGUE;
if (--self->health <= 0)
{
self->SetState (self->FindState(NAME_Death));
}
return 0;
}
//===========================================================================
@ -362,6 +374,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb)
DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
{
PARAM_ACTION_PROLOGUE;
// [RH] Check using actual velocity, although the velz < 2 check still stands
//if (abs(self->velx) < FRACUNIT*3/2 && abs(self->vely) < FRACUNIT*3/2
// && self->velz < 2*FRACUNIT)
@ -376,4 +390,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
self->flags &= ~MF_MISSILE;
}
CALL_ACTION(A_CheckThrowBomb, self);
return 0;
}

View file

@ -27,6 +27,8 @@ static FRandom pr_fogspawn ("FogSpawn");
DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
{
PARAM_ACTION_PROLOGUE;
static const char *fogs[3] =
{
"FogPatchSmall",
@ -34,11 +36,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
"FogPatchLarge"
};
AActor *mo=NULL;
AActor *mo = NULL;
angle_t delta;
if (self->special1-- > 0) return;
if (self->special1-- > 0)
{
return 0;
}
self->special1 = self->args[2]; // Reset frequency count
mo = Spawn (fogs[pr_fogspawn()%3], self->x, self->y, self->z, ALLOW_REPLACE);
@ -55,6 +59,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
mo->args[4] = 1; // Set to moving
mo->special2 = pr_fogspawn()&63;
}
return 0;
}
//==========================================================================
@ -65,16 +70,21 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
DEFINE_ACTION_FUNCTION(AActor, A_FogMove)
{
PARAM_ACTION_PROLOGUE;
int speed = self->args[0]<<FRACBITS;
angle_t angle;
int weaveindex;
if (!(self->args[4])) return;
if (!self->args[4])
{
return 0;
}
if (self->args[3]-- <= 0)
{
self->SetStateNF (self->FindState(NAME_Death));
return;
return 0;
}
if ((self->args[3] % 4) == 0)
@ -87,5 +97,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogMove)
angle = self->angle>>ANGLETOFINESHIFT;
self->velx = FixedMul(speed, finecosine[angle]);
self->vely = FixedMul(speed, finesine[angle]);
return 0;
}

View file

@ -231,6 +231,8 @@ void ASorcBall1::DoFireSpell ()
DEFINE_ACTION_FUNCTION(AActor, A_SorcSpinBalls)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
fixed_t z;
@ -252,6 +254,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcSpinBalls)
if (mo) mo->target = self;
mo = Spawn("SorcBall3", self->x, self->y, z, NO_REPLACE);
if (mo) mo->target = self;
return 0;
}
@ -263,11 +266,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcSpinBalls)
DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
{
PARAM_ACTION_PROLOGUE;
// [RH] If no parent, then die instead of crashing
if (self->target == NULL)
{
self->SetState (self->FindState(NAME_Pain));
return;
return 0;
}
ASorcBall *actor;
@ -287,7 +292,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
if (actor->target->health <= 0)
{
actor->SetState (actor->FindState(NAME_Pain));
return;
return 0;
}
baseangle = (angle_t)parent->special1;
@ -375,6 +380,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
actor->SetOrigin (x, y, parent->z - parent->floorclip + parent->height);
actor->floorz = parent->floorz;
actor->ceilingz = parent->ceilingz;
return 0;
}
//============================================================================
@ -387,8 +393,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
DEFINE_ACTION_FUNCTION(AActor, A_SpeedBalls)
{
PARAM_ACTION_PROLOGUE;
self->args[3] = SORC_ACCELERATE; // speed mode
self->args[2] = SORCBALL_TERMINAL_SPEED; // target speed
return 0;
}
@ -682,8 +691,11 @@ void A_SorcOffense2(AActor *actor)
DEFINE_ACTION_FUNCTION(AActor, A_SorcBossAttack)
{
PARAM_ACTION_PROLOGUE;
self->args[3] = SORC_ACCELERATE;
self->args[2] = SORCBALL_INITIAL_SPEED;
return 0;
}
//============================================================================
@ -696,6 +708,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBossAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
{
PARAM_ACTION_PROLOGUE;
fixed_t x,y,z;
fixed_t dist = 5*FRACUNIT;
angle_t angle = self->angle >> ANGLETOFINESHIFT;
@ -718,6 +732,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
mo->velz = FRACUNIT*2;
}
}
return 0;
}
@ -731,8 +746,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX1Seek)
{
PARAM_ACTION_PROLOGUE;
A_DoBounceCheck (self, "SorcererHeadScream");
P_SeekerMissile (self,ANGLE_1*2,ANGLE_1*6);
return 0;
}
@ -754,6 +772,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX1Seek)
// Split ball in two
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn(self->GetClass(), self->x, self->y, self->z, NO_REPLACE);
@ -773,6 +793,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
mo->SetState (mo->FindState("Orbit"));
}
self->Destroy ();
return 0;
}
//============================================================================
@ -785,6 +806,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
fixed_t x,y,z;
AActor *parent = self->target;
@ -793,7 +816,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit)
if (parent == NULL)
{
self->Destroy();
return;
return 0;
}
fixed_t dist = parent->radius;
@ -841,6 +864,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit)
self->SetOrigin (x, y, z);
self->floorz = parent->floorz;
self->ceilingz = parent->ceilingz;
return 0;
}
//============================================================================
@ -853,6 +877,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnBishop)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = Spawn("Bishop", self->x, self->y, self->z, ALLOW_REPLACE);
if (mo)
@ -869,6 +895,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnBishop)
}
}
self->Destroy ();
return 0;
}
//============================================================================
@ -879,8 +906,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnBishop)
DEFINE_ACTION_FUNCTION(AActor, A_SorcererBishopEntry)
{
PARAM_ACTION_PROLOGUE;
Spawn("SorcFX3Explosion", self->x, self->y, self->z, ALLOW_REPLACE);
S_Sound (self, CHAN_VOICE, self->SeeSound, 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -893,10 +923,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcererBishopEntry)
DEFINE_ACTION_FUNCTION(AActor, A_SorcFX4Check)
{
PARAM_ACTION_PROLOGUE;
if (self->special2-- <= 0)
{
self->SetState (self->FindState(NAME_Death));
}
return 0;
}
//============================================================================
@ -909,6 +942,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX4Check)
DEFINE_ACTION_FUNCTION(AActor, A_SorcBallPop)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE);
self->flags &= ~MF_NOGRAVITY;
self->gravity = FRACUNIT/8;
@ -918,6 +953,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallPop)
self->special2 = 4*FRACUNIT; // Initial bounce factor
self->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit
self->args[3] = 5; // Bounce time in seconds
return 0;
}
//============================================================================
@ -950,5 +986,8 @@ void A_DoBounceCheck (AActor *self, const char *sound)
DEFINE_ACTION_FUNCTION(AActor, A_BounceCheck)
{
PARAM_ACTION_PROLOGUE;
A_DoBounceCheck (self, "SorcererBigBallExplode");
return 0;
}

View file

@ -55,6 +55,8 @@ void APottery1::HitFloor ()
DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
{
PARAM_ACTION_PROLOGUE;
AActor *mo = NULL;
int i;
@ -79,6 +81,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
self->x, self->y, self->z, ALLOW_REPLACE);
}
}
return 0;
}
//============================================================================
@ -89,8 +92,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
DEFINE_ACTION_FUNCTION(AActor, A_PotteryChooseBit)
{
PARAM_ACTION_PROLOGUE;
self->SetState (self->FindState(NAME_Death) + 1 + 2*(pr_bit()%5));
self->tics = 256+(pr_bit()<<1);
return 0;
}
//============================================================================
@ -101,6 +107,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryChooseBit)
DEFINE_ACTION_FUNCTION(AActor, A_PotteryCheck)
{
PARAM_ACTION_PROLOGUE;
int i;
for(i = 0; i < MAXPLAYERS; i++)
@ -112,10 +120,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryCheck)
pmo->y, self->x, self->y) - pmo->angle) <= ANGLE_45))
{ // Previous state (pottery bit waiting state)
self->SetState (self->state - 1);
return;
return 0;
}
}
}
}
return 0;
}
// Lynched corpse (no heart) ------------------------------------------------
@ -143,10 +152,13 @@ void AZCorpseLynchedNoHeart::PostBeginPlay ()
DEFINE_ACTION_FUNCTION(AActor, A_CorpseBloodDrip)
{
PARAM_ACTION_PROLOGUE;
if (pr_drip() <= 128)
{
Spawn ("CorpseBloodDrip", self->x, self->y, self->z + self->height/2, ALLOW_REPLACE);
}
return 0;
}
//============================================================================
@ -157,6 +169,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseBloodDrip)
DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int i;
@ -182,6 +196,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
}
S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_IDLE);
self->Destroy ();
return 0;
}
//============================================================================
@ -192,6 +207,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int i;
@ -208,6 +225,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
mo->special1 = 0;
}
}
return 0;
}
//============================================================================
@ -218,10 +236,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust)
{
PARAM_ACTION_PROLOGUE;
if (pr_leafthrust() <= 96)
{
self->velz += (pr_leafthrust()<<9)+FRACUNIT;
}
return 0;
}
//============================================================================
@ -232,11 +253,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust)
DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
{
PARAM_ACTION_PROLOGUE;
self->special1++;
if (self->special1 >= 20)
{
self->SetState (NULL);
return;
return 0;
}
angle_t ang = self->target ? self->target->angle : self->angle;
if (pr_leafcheck() > 64)
@ -245,12 +268,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
{
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+FRACUNIT);
}
return;
return 0;
}
self->SetState (self->SpawnState + 7);
self->velz = (pr_leafcheck()<<9)+FRACUNIT;
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+2*FRACUNIT);
self->flags |= MF_MISSILE;
return 0;
}
//===========================================================================
@ -261,7 +285,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
DEFINE_ACTION_FUNCTION(AActor, A_PoisonShroom)
{
PARAM_ACTION_PROLOGUE;
self->tics = 128+(pr_shroom()<<1);
return 0;
}
//===========================================================================
@ -272,6 +299,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_PoisonShroom)
DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int i;
@ -299,6 +328,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode)
}
S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_NORM);
self->Destroy ();
return 0;
}
// Bell ---------------------------------------------------------------------
@ -328,6 +358,8 @@ void AZBell::Activate (AActor *activator)
DEFINE_ACTION_FUNCTION(AActor, A_BellReset1)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_NOGRAVITY;
self->height <<= 2;
if (self->special)
@ -336,6 +368,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BellReset1)
self->args[1], self->args[2], self->args[3], self->args[4]);
self->special = 0;
}
return 0;
}
//===========================================================================
@ -346,8 +379,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_BellReset1)
DEFINE_ACTION_FUNCTION(AActor, A_BellReset2)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_SHOOTABLE;
self->flags &= ~MF_CORPSE;
self->health = 5;
return 0;
}

View file

@ -26,6 +26,8 @@ static const char *WispTypes[2] =
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyLook)
{
PARAM_ACTION_PROLOGUE;
fixed_t dist;
fixed_t an;
@ -40,6 +42,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyLook)
self->y+FixedMul(dist, finesine[an]),
self->z+60*FRACUNIT, ALLOW_REPLACE);
}
return 0;
}
//============================================================================
@ -50,11 +53,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyLook)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
{
PARAM_ACTION_PROLOGUE;
fixed_t dist;
fixed_t an;
AActor *mo;
A_Chase (self);
A_Chase (stack, self);
if (pr_iceguychase() < 128)
{
dist = ((pr_iceguychase()-128)*self->radius)>>7;
@ -72,6 +77,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
mo->target = self;
}
}
return 0;
}
//============================================================================
@ -82,11 +88,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
{
PARAM_ACTION_PROLOGUE;
fixed_t an;
if(!self->target)
{
return;
return 0;
}
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
P_SpawnMissileXYZ(self->x+FixedMul(self->radius>>1,
@ -99,6 +107,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
finesine[an]), self->z+40*FRACUNIT, self, self->target,
PClass::FindClass ("IceGuyFX"));
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -109,11 +118,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
{
PARAM_ACTION_PROLOGUE;
self->velx = 0;
self->vely = 0;
self->velz = 0;
self->height = self->GetDefault()->height;
CALL_ACTION(A_FreezeDeathChunks, self);
return 0;
}
//============================================================================
@ -124,6 +136,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
DEFINE_ACTION_FUNCTION(AActor, A_IceGuyMissileExplode)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int i;
@ -136,5 +150,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyMissileExplode)
mo->target = self->target;
}
}
return 0;
}

View file

@ -89,6 +89,8 @@ extern void SpawnSpiritTail (AActor *spirit);
DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
{
PARAM_ACTION_PROLOGUE;
AActor *spot;
if ((!self->special2) && (self->health <= (self->SpawnHealth()/2)))
@ -103,10 +105,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
P_StartScript (self, NULL, 249, NULL, 0, 0, 0, 0, 0, false);
self->special2 = 1; // Don't run again
return;
return 0;
}
if (!self->target) return;
if (self->target == NULL)
{
return 0;
}
if (pr_koraxchase()<30)
{
self->SetState (self->MissileState);
@ -140,6 +145,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
}
}
}
return 0;
}
//============================================================================
@ -150,6 +156,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxBonePop)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int i;
@ -161,6 +169,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxBonePop)
}
P_StartScript (self, NULL, 255, NULL, 0, 0, 0, 0, false, false); // Death script
return 0;
}
//============================================================================
@ -190,6 +199,8 @@ void KSpiritInit (AActor *spirit, AActor *korax)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxDecide)
{
PARAM_ACTION_PROLOGUE;
if (pr_koraxdecide()<220)
{
self->SetState (self->FindState("Attack"));
@ -198,6 +209,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxDecide)
{
self->SetState (self->FindState("Command"));
}
return 0;
}
//============================================================================
@ -208,6 +220,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxDecide)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxMissile)
{
PARAM_ACTION_PROLOGUE;
static const struct { const char *type, *sound; } choices[6] =
{
{ "WraithFX1", "WraithMissileFire" },
@ -236,6 +250,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxMissile)
{
KoraxFire (self, info, i);
}
return 0;
}
//============================================================================
@ -248,6 +263,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxMissile)
DEFINE_ACTION_FUNCTION(AActor, A_KoraxCommand)
{
PARAM_ACTION_PROLOGUE;
fixed_t x,y,z;
angle_t ang;
int numcommands;
@ -272,6 +289,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxCommand)
P_StartScript (self, NULL, 250+(pr_koraxcommand()%numcommands),
NULL, 0, 0, 0, 0, false, false);
return 0;
}
//============================================================================
@ -329,6 +347,8 @@ void KoraxFire (AActor *actor, const PClass *type, int arm)
DEFINE_ACTION_FUNCTION(AActor, A_KSpiritWeave)
{
PARAM_ACTION_PROLOGUE;
fixed_t newX, newY;
int weaveXY, weaveZ;
int angle;
@ -350,6 +370,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KSpiritWeave)
weaveZ = (weaveZ+(pr_kspiritweave()%5))&63;
self->z += FloatBobOffsets[weaveZ]<<1;
self->special2 = weaveZ+(weaveXY<<16);
return 0;
}
//============================================================================
@ -430,6 +451,8 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
DEFINE_ACTION_FUNCTION(AActor, A_KSpiritRoam)
{
PARAM_ACTION_PROLOGUE;
if (self->health-- <= 0)
{
S_Sound (self, CHAN_VOICE, "SpiritDie", 1, ATTN_NORM);
@ -448,6 +471,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KSpiritRoam)
S_Sound (self, CHAN_VOICE, "SpiritActive", 1, ATTN_NONE);
}
}
return 0;
}
//============================================================================
@ -458,11 +482,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_KSpiritRoam)
DEFINE_ACTION_FUNCTION(AActor, A_KBolt)
{
PARAM_ACTION_PROLOGUE;
// Countdown lifetime
if (self->special1-- <= 0)
{
self->Destroy ();
}
return 0;
}
//============================================================================
@ -473,6 +500,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_KBolt)
DEFINE_ACTION_FUNCTION(AActor, A_KBoltRaise)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
fixed_t z;
@ -491,6 +520,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KBoltRaise)
{
// Maybe cap it off here
}
return 0;
}
//============================================================================

View file

@ -51,6 +51,8 @@ int AFrostMissile::DoSpecialDamage (AActor *victim, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -62,14 +64,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
if (NULL == (player = self->player))
{
return;
return 0;
}
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, "MageShardsFire", 1, ATTN_NORM);
@ -99,6 +101,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
mo->args[0] = 3; // Mark Initial shard as super damage
}
}
return 0;
}
//============================================================================
@ -109,11 +112,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int spawndir = self->special1;
int spermcount = self->special2;
if (spermcount <= 0) return; // No sperm left
if (spermcount <= 0)
{
return 0; // No sperm left
}
self->special2 = 0;
spermcount--;
@ -173,4 +181,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
mo->args[0] = (spermcount==3)?2:0;
}
}
return 0;
}

View file

@ -126,11 +126,14 @@ int ALightningZap::SpecialMissileHit (AActor *thing)
DEFINE_ACTION_FUNCTION(AActor, A_LightningReady)
{
PARAM_ACTION_PROLOGUE;
DoReadyWeapon(self);
if (pr_lightningready() < 160)
{
S_Sound (self, CHAN_WEAPON, "MageLightningReady", 1, ATTN_NORM);
}
return 0;
}
//============================================================================
@ -141,6 +144,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningReady)
DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
{
PARAM_ACTION_PROLOGUE;
AActor *cMo;
AActor *target = NULL;
int zigZag;
@ -149,7 +154,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
{
if (self->lastenemy == NULL)
{
return;
return 0;
}
self->z = self->floorz;
target = self->lastenemy->tracer;
@ -196,6 +201,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
P_ThrustMobj (self, self->angle, self->Speed>>1);
}
}
return 0;
}
@ -207,6 +213,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
{
PARAM_ACTION_PROLOGUE;
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
if (lightning == NULL) lightning = PClass::FindClass("LightningZap");
@ -219,7 +226,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
if (self->health <= 0)
{
self->SetState (self->FindState(NAME_Death));
return;
return 0;
}
if (self->flags3 & MF3_FLOORHUGGER)
{
@ -251,6 +258,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
{
S_Sound (self, CHAN_BODY, self->ActiveSound, 1, ATTN_NORM);
}
return 0;
}
//============================================================================
@ -261,9 +269,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
{
ACTION_PARAM_START(2);
ACTION_PARAM_CLASS(floor, 0);
ACTION_PARAM_CLASS(ceiling, 1);
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(floor, AActor) { floor = PClass::FindClass("LightningFloor"); }
PARAM_CLASS_OPT(ceiling, AActor) { ceiling = PClass::FindClass("LightningCeiling"); }
AActor *fmo, *cmo;
@ -291,6 +299,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
weapon->DepleteAmmo (weapon->bAltFire);
}
}
return 0;
}
//============================================================================
@ -301,6 +310,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MLightningAttack)
DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = self->lastenemy;
@ -316,6 +327,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
self->vely = mo->vely;
}
}
return 0;
}
//============================================================================
@ -326,7 +338,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
{
const PClass *lightning=PClass::FindClass((ENamedName) self->GetClass()->Meta.GetMetaInt (ACMETA_MissileName, NAME_None));
PARAM_ACTION_PROLOGUE;
const PClass *lightning = PClass::FindClass(ENamedName(self->GetClass()->Meta.GetMetaInt(ACMETA_MissileName, NAME_None)));
if (lightning == NULL) lightning = PClass::FindClass("LightningZap");
AActor *mo;
@ -338,6 +352,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
mo->velz = 40*FRACUNIT;
mo->Damage = 0;
}
return 0;
}
//============================================================================
@ -348,6 +363,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
DEFINE_ACTION_FUNCTION(AActor, A_LightningRemove)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = self->lastenemy;
@ -356,4 +373,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningRemove)
mo->lastenemy = NULL;
P_ExplodeMissile (mo, NULL, NULL);
}
return 0;
}

View file

@ -179,20 +179,22 @@ void MStaffSpawn (AActor *pmo, angle_t angle)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
player_t *player;
AActor *linetarget;
if (NULL == (player = self->player))
{
return;
return 0;
}
AMWeapBloodscourge *weapon = static_cast<AMWeapBloodscourge *> (self->player->ReadyWeapon);
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
angle = self->angle;
@ -211,6 +213,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
MStaffSpawn (self, angle+ANGLE_1*5);
S_Sound (self, CHAN_WEAPON, "MageStaffFire", 1, ATTN_NORM);
weapon->MStaffCount = 3;
return 0;
}
//============================================================================
@ -221,6 +224,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffPalette)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
AMWeapBloodscourge *weapon = static_cast<AMWeapBloodscourge *> (self->player->ReadyWeapon);
@ -229,6 +234,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffPalette)
weapon->MStaffCount--;
}
}
return 0;
}
//============================================================================
@ -239,11 +245,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffPalette)
DEFINE_ACTION_FUNCTION(AActor, A_MStaffTrack)
{
PARAM_ACTION_PROLOGUE;
if ((self->tracer == 0) && (pr_mstafftrack()<50))
{
self->tracer = P_RoughMonsterSearch (self, 10);
}
P_SeekerMissile (self, ANGLE_1*2, ANGLE_1*10);
return 0;
}
//============================================================================
@ -299,13 +308,17 @@ void MStaffSpawn2 (AActor *actor, angle_t angle)
DEFINE_ACTION_FUNCTION(AActor, A_MageAttack)
{
if (!self->target) return;
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
{
return 0;
}
angle_t angle;
angle = self->angle;
MStaffSpawn2 (self, angle);
MStaffSpawn2 (self, angle-ANGLE_1*5);
MStaffSpawn2 (self, angle+ANGLE_1*5);
S_Sound (self, CHAN_WEAPON, "MageStaffFire", 1, ATTN_NORM);
return 0;
}

View file

@ -51,8 +51,11 @@ void AMageWandMissile::Effect ()
DEFINE_ACTION_FUNCTION(AActor, A_MWandAttack)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AMageWandMissile));
S_Sound (self, CHAN_WEAPON, "MageWandFire", 1, ATTN_NORM);
return 0;
}

View file

@ -60,6 +60,8 @@ void APigPlayer::MorphPlayerThink ()
DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int slope;
@ -69,7 +71,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
if (NULL == (player = self->player))
{
return;
return 0;
}
damage = 3+(pr_snoutattack()&3);
@ -85,6 +87,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
S_Sound(player->mo, CHAN_VOICE, "PigAttack", 1, ATTN_NORM);
}
}
return 0;
}
//============================================================================
@ -95,9 +98,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
DEFINE_ACTION_FUNCTION(AActor, A_PigPain)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_Pain, self);
if (self->z <= self->floorz)
{
self->velz = FRACUNIT*7/2;
}
return 0;
}

View file

@ -25,8 +25,11 @@ static FRandom pr_delaygib ("DelayGib");
DEFINE_ACTION_FUNCTION(AActor, A_SerpentUnHide)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
self->floorclip = 24*FRACUNIT;
return 0;
}
//============================================================================
@ -37,8 +40,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentUnHide)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHide)
{
PARAM_ACTION_PROLOGUE;
self->renderflags |= RF_INVISIBLE;
self->floorclip = 0;
return 0;
}
//============================================================================
@ -50,7 +56,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentHide)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentRaiseHump)
{
PARAM_ACTION_PROLOGUE;
self->floorclip -= 4*FRACUNIT;
return 0;
}
//============================================================================
@ -61,7 +70,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentRaiseHump)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentLowerHump)
{
PARAM_ACTION_PROLOGUE;
self->floorclip += 4*FRACUNIT;
return 0;
}
//============================================================================
@ -74,21 +86,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentLowerHump)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHumpDecide)
{
PARAM_ACTION_PROLOGUE;
if (self->MissileState != NULL)
{
if (pr_serpenthump() > 30)
{
return;
return 0;
}
else if (pr_serpenthump() < 40)
{ // Missile attack
self->SetState (self->MeleeState);
return;
return 0;
}
}
else if (pr_serpenthump() > 3)
{
return;
return 0;
}
if (!self->CheckMeleeRange ())
{ // The hump shouldn't occur when within melee range
@ -102,6 +116,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentHumpDecide)
S_Sound (self, CHAN_BODY, "SerpentActive", 1, ATTN_NORM);
}
}
return 0;
}
//============================================================================
@ -112,16 +127,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentHumpDecide)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentCheckForAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return;
return 0;
}
if (self->MissileState != NULL)
{
if (!self->CheckMeleeRange ())
{
self->SetState (self->FindState ("Attack"));
return;
return 0;
}
}
if (P_CheckMeleeRange2 (self))
@ -139,6 +156,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentCheckForAttack)
self->SetState (self->FindState ("Attack"));
}
}
return 0;
}
//============================================================================
@ -149,14 +167,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentCheckForAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentChooseAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target || self->CheckMeleeRange())
{
return;
return 0;
}
if (self->MissileState != NULL)
{
self->SetState (self->MissileState);
}
return 0;
}
//============================================================================
@ -167,9 +188,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentChooseAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentMeleeAttack)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
{
return;
return 0;
}
if (self->CheckMeleeRange ())
{
@ -182,6 +205,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentMeleeAttack)
{
CALL_ACTION(A_SerpentCheckForAttack, self);
}
return 0;
}
//============================================================================
@ -192,6 +216,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentMeleeAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
static const char *GibTypes[] =
{
@ -213,6 +239,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
mo->floorclip = 6*FRACUNIT;
}
}
return 0;
}
//============================================================================
@ -223,7 +250,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
DEFINE_ACTION_FUNCTION(AActor, A_FloatGib)
{
PARAM_ACTION_PROLOGUE;
self->floorclip -= FRACUNIT;
return 0;
}
//============================================================================
@ -234,7 +264,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FloatGib)
DEFINE_ACTION_FUNCTION(AActor, A_SinkGib)
{
PARAM_ACTION_PROLOGUE;
self->floorclip += FRACUNIT;
return 0;
}
//============================================================================
@ -245,7 +278,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SinkGib)
DEFINE_ACTION_FUNCTION(AActor, A_DelayGib)
{
PARAM_ACTION_PROLOGUE;
self->tics -= pr_delaygib()>>2;
return 0;
}
//============================================================================
@ -256,6 +292,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DelayGib)
DEFINE_ACTION_FUNCTION(AActor, A_SerpentHeadCheck)
{
PARAM_ACTION_PROLOGUE;
if (self->z <= self->floorz)
{
if (Terrains[P_GetThingFloorType(self)].IsLiquid)
@ -268,5 +306,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentHeadCheck)
self->SetState (self->FindState(NAME_Death));
}
}
return 0;
}

View file

@ -78,16 +78,21 @@ void AThrustFloor::Deactivate (AActor *activator)
DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitUp)
{
PARAM_ACTION_PROLOGUE;
self->special2 = 5; // Raise speed
self->args[0] = 1; // Mark as up
self->floorclip = 0;
self->flags = MF_SOLID;
self->flags2 = MF2_NOTELEPORT|MF2_FLOORCLIP;
self->special1 = 0L;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitDn)
{
PARAM_ACTION_PROLOGUE;
self->special2 = 5; // Raise speed
self->args[0] = 0; // Mark as down
self->floorclip = self->GetDefault()->height;
@ -96,11 +101,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustInitDn)
self->renderflags = RF_INVISIBLE;
static_cast<AThrustFloor *>(self)->DirtClump =
Spawn("DirtClump", self->x, self->y, self->z, ALLOW_REPLACE);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_ThrustRaise)
{
PARAM_ACTION_PROLOGUE;
AThrustFloor *actor = static_cast<AThrustFloor *>(self);
if (A_RaiseMobj (actor, self->special2*FRACUNIT))
@ -123,10 +131,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustRaise)
if (pr_thrustraise()<40)
P_SpawnDirt (actor, actor->radius);
actor->special2++; // Increase raise speed
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_ThrustLower)
{
PARAM_ACTION_PROLOGUE;
if (A_SinkMobj (self, 6*FRACUNIT))
{
self->args[0] = 0;
@ -135,10 +146,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustLower)
else
self->SetStateNF (self->FindState ("ThrustInit1"));
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_ThrustImpale)
{
PARAM_ACTION_PROLOGUE;
AActor *thing;
FBlockThingsIterator it(FBoundingBox(self->x, self->y, self->radius));
while ((thing = it.Next()))
@ -158,5 +172,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_ThrustImpale)
P_TraceBleed (10001, thing);
self->args[1] = 1; // Mark thrust thing as bloody
}
return 0;
}

View file

@ -49,6 +49,8 @@ bool AArtiDarkServant::Use (bool pickup)
DEFINE_ACTION_FUNCTION(AActor, A_Summon)
{
PARAM_ACTION_PROLOGUE;
AMinotaurFriend *mo;
mo = Spawn<AMinotaurFriend> (self->x, self->y, self->z, ALLOW_REPLACE);
@ -59,7 +61,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Summon)
mo->Destroy ();
AActor *arti = Spawn<AArtiDarkServant> (self->x, self->y, self->z, ALLOW_REPLACE);
if (arti) arti->flags |= MF_DROPPED;
return;
return 0;
}
mo->StartTime = level.maptime;
@ -82,4 +84,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_Summon)
Spawn ("MinotaurSmoke", self->x, self->y, self->z, ALLOW_REPLACE);
S_Sound (self, CHAN_VOICE, mo->ActiveSound, 1, ATTN_NORM);
}
return 0;
}

View file

@ -65,30 +65,41 @@ static void TeloSpawn (AActor *source, const char *type)
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnA)
{
PARAM_ACTION_PROLOGUE;
TeloSpawn (self, "TelOtherFX2");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnB)
{
PARAM_ACTION_PROLOGUE;
TeloSpawn (self, "TelOtherFX3");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnC)
{
PARAM_ACTION_PROLOGUE;
TeloSpawn (self, "TelOtherFX4");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TeloSpawnD)
{
PARAM_ACTION_PROLOGUE;
TeloSpawn (self, "TelOtherFX5");
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CheckTeleRing)
{
PARAM_ACTION_PROLOGUE;
if (self->special1-- <= 0)
{
self->SetState (self->FindState(NAME_Death));
}
return 0;
}
//===========================================================================

View file

@ -29,6 +29,8 @@ static FRandom pr_wraithfx4 ("WraithFX4");
DEFINE_ACTION_FUNCTION(AActor, A_WraithInit)
{
PARAM_ACTION_PROLOGUE;
self->z += 48<<FRACBITS;
// [RH] Make sure the wraith didn't go into the ceiling
@ -38,6 +40,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithInit)
}
self->special1 = 0; // index into floatbob
return 0;
}
//============================================================================
@ -48,11 +51,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithInit)
DEFINE_ACTION_FUNCTION(AActor, A_WraithRaiseInit)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
self->flags2 &= ~MF2_NONSHOOTABLE;
self->flags3 &= ~MF3_DONTBLAST;
self->flags |= MF_SHOOTABLE|MF_SOLID;
self->floorclip = self->height;
return 0;
}
//============================================================================
@ -63,6 +69,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithRaiseInit)
DEFINE_ACTION_FUNCTION(AActor, A_WraithRaise)
{
PARAM_ACTION_PROLOGUE;
if (A_RaiseMobj (self, 2*FRACUNIT))
{
// Reached it's target height
@ -75,6 +83,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithRaise)
}
P_SpawnDirt (self, self->radius);
return 0;
}
//============================================================================
@ -85,6 +94,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithRaise)
DEFINE_ACTION_FUNCTION(AActor, A_WraithMelee)
{
PARAM_ACTION_PROLOGUE;
int amount;
// Steal health from target and give to self
@ -94,6 +105,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithMelee)
P_DamageMobj (self->target, self, self, amount, NAME_Melee);
self->health += amount;
}
return 0;
}
//============================================================================
@ -104,6 +116,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithMelee)
DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
angle_t angle;
int i;
@ -130,6 +144,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
mo->floorclip = 10*FRACUNIT;
}
}
return 0;
}
//============================================================================
@ -142,6 +157,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
DEFINE_ACTION_FUNCTION(AActor, A_WraithFX3)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
int numdropped = pr_wraithfx3()%15;
@ -156,6 +173,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX3)
mo->target = self;
}
}
return 0;
}
//============================================================================
@ -225,6 +243,8 @@ void A_WraithFX4 (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_WraithChase)
{
PARAM_ACTION_PROLOGUE;
int weaveindex = self->special1;
self->z += FloatBobOffsets[weaveindex];
self->special1 = (weaveindex+2)&63;
@ -233,6 +253,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithChase)
// P_SetMobjState(self, S_WRAITH_RAISE2);
// return;
// }
A_Chase (self);
A_Chase (stack, self);
A_WraithFX4 (self);
return 0;
}

View file

@ -174,18 +174,23 @@ bool AMinotaurFriend::OkayToSwitchTarget (AActor *other)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDeath)
{
PARAM_ACTION_PROLOGUE;
if (Wads.CheckNumForName ("MNTRF1", ns_sprites) < 0 &&
Wads.CheckNumForName ("MNTRF0", ns_sprites) < 0)
self->SetState(self->FindState ("FadeOut"));
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk1)
{
PARAM_ACTION_PROLOGUE;
player_t *player;
if (!self->target)
{
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, "minotaur/melee", 1, ATTN_NORM);
if (self->CheckMeleeRange())
@ -199,6 +204,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk1)
player->deltaviewheight = -16*FRACUNIT;
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -213,6 +219,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk1)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
{
PARAM_ACTION_PROLOGUE;
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
angle_t angle;
AActor *target;
@ -221,7 +229,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
target = self->target;
if (!target)
{
return;
return 0;
}
if (!friendly)
{
@ -260,6 +268,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
// Don't need to call P_SetMobjState because the current state
// falls through to the swing attack
}
return 0;
}
//----------------------------------------------------------------------------
@ -270,10 +279,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
{
PARAM_ACTION_PROLOGUE;
AActor *puff;
if (!self->target) return;
if (self->target == NULL)
{
return 0;
}
if (self->special1 > 0)
{
const PClass *type;
@ -296,6 +309,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
self->flags2 &= ~MF2_INVULNERABLE;
self->SetState (self->SeeState);
}
return 0;
}
//----------------------------------------------------------------------------
@ -308,15 +322,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
angle_t angle;
fixed_t velz;
fixed_t z;
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
if (!self->target)
if (self->target == NULL)
{
return;
return 0;
}
S_Sound (self, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
if (self->CheckMeleeRange())
@ -325,7 +341,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
damage = pr_atk.HitDice (friendly ? 3 : 5);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
return 0;
}
z = self->z + 40*FRACUNIT;
const PClass *fx = PClass::FindClass("MinotaurFX1");
@ -343,6 +359,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), velz);
}
}
return 0;
}
//----------------------------------------------------------------------------
@ -355,13 +372,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
player_t *player;
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
if (!self->target)
{
return;
return 0;
}
S_Sound (self, CHAN_VOICE, "minotaur/attack3", 1, ATTN_NORM);
if (self->CheckMeleeRange())
@ -398,6 +417,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
self->SetState (self->FindState ("HammerLoop"));
self->special2 = 1;
}
return 0;
}
//----------------------------------------------------------------------------
@ -408,6 +428,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk3)
DEFINE_ACTION_FUNCTION(AActor, A_MntrFloorFire)
{
PARAM_ACTION_PROLOGUE;
AActor *mo;
fixed_t x, y;
@ -418,6 +440,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MntrFloorFire)
mo->target = self->target;
mo->velx = 1; // Force block checking
P_CheckMissileSpawn (mo);
return 0;
}
//---------------------------------------------------------------------------
@ -464,6 +487,8 @@ void P_MinotaurSlam (AActor *source, AActor *target)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
{
PARAM_ACTION_PROLOGUE;
// In case pain caused him to skip his fade in.
self->RenderStyle = STYLE_Normal;
@ -474,7 +499,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS)
{
P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None);
return;
return 0;
}
}
@ -496,6 +521,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
self->movedir = (self->movedir+7)%8;
FaceMovementDirection (self);
}
return 0;
}
@ -509,10 +535,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam)
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
{
PARAM_ACTION_PROLOGUE;
if (!self->IsKindOf(RUNTIME_CLASS(AMinotaurFriend)))
{
CALL_ACTION(A_Look, self);
return;
return 0;
}
AActor *mo = NULL;
@ -573,14 +601,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurLook)
{
self->SetStateNF (self->FindState ("Roam"));
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
{
PARAM_ACTION_PROLOGUE;
if (!self->IsKindOf(RUNTIME_CLASS(AMinotaurFriend)))
{
A_Chase (self);
return;
A_Chase (stack, self);
return 0;
}
AMinotaurFriend *self1 = static_cast<AMinotaurFriend *> (self);
@ -591,7 +622,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS)
{
P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None);
return;
return 0;
}
if (pr_minotaurchase() < 30)
@ -601,7 +632,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
!(self1->target->flags&MF_SHOOTABLE))
{ // look for a new target
self1->SetState (self1->FindState ("Spawn"));
return;
return 0;
}
FaceMovementDirection (self1);
@ -615,14 +646,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
S_Sound (self1, CHAN_WEAPON, self1->AttackSound, 1, ATTN_NORM);
}
self1->SetState (self1->MeleeState);
return;
return 0;
}
// Missile attack
if (self1->MissileState && P_CheckMissileRange(self1))
{
self1->SetState (self1->MissileState);
return;
return 0;
}
// chase towards target
@ -637,5 +668,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurChase)
{
self1->PlayActiveSound ();
}
return 0;
}

View file

@ -59,6 +59,8 @@ IMPLEMENT_CLASS (ASwitchingDecoration)
DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
{
PARAM_ACTION_PROLOGUE;
// [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH)
{
@ -73,7 +75,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
{
P_DropItem (self, self->Conversation->DropType, -1, 256);
self->Conversation = NULL;
return;
return 0;
}
self->Conversation = NULL;
@ -96,11 +98,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
}
}
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Fall)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_NoBlocking, self);
return 0;
}
//==========================================================================
@ -111,8 +117,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_Fall)
DEFINE_ACTION_FUNCTION(AActor, A_SetFloorClip)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_FLOORCLIP;
self->AdjustFloorClip ();
return 0;
}
//==========================================================================
@ -123,8 +132,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetFloorClip)
DEFINE_ACTION_FUNCTION(AActor, A_UnSetFloorClip)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_FLOORCLIP;
self->floorclip = 0;
return 0;
}
//==========================================================================
@ -135,7 +147,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnSetFloorClip)
DEFINE_ACTION_FUNCTION(AActor, A_HideThing)
{
PARAM_ACTION_PROLOGUE;
self->renderflags |= RF_INVISIBLE;
return 0;
}
//==========================================================================
@ -146,7 +161,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_HideThing)
DEFINE_ACTION_FUNCTION(AActor, A_UnHideThing)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
return 0;
}
//============================================================================
@ -157,6 +175,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnHideThing)
DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeath)
{
PARAM_ACTION_PROLOGUE;
int t = pr_freezedeath();
self->tics = 75+t+pr_freezedeath();
self->flags |= MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD|MF_ICECORPSE;
@ -184,6 +204,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeath)
self->args[1], self->args[2], self->args[3], self->args[4]);
self->special = 0;
}
return 0;
}
//==========================================================================
@ -194,8 +215,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeath)
DEFINE_ACTION_FUNCTION(AActor, A_GenericFreezeDeath)
{
PARAM_ACTION_PROLOGUE;
self->Translation = TRANSLATION(TRANSLATION_Standard, 7);
CALL_ACTION(A_FreezeDeath, self);
return 0;
}
//============================================================================
@ -206,6 +230,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenericFreezeDeath)
DEFINE_ACTION_FUNCTION(AActor, A_IceSetTics)
{
PARAM_ACTION_PROLOGUE;
int floor;
self->tics = 70+(pr_icesettics()&63);
@ -218,6 +244,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceSetTics)
{
self->tics <<= 1;
}
return 0;
}
//============================================================================
@ -228,6 +255,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceSetTics)
DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
{
PARAM_ACTION_PROLOGUE;
int i;
int numChunks;
@ -236,7 +264,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
if (self->velx || self->vely || self->velz)
{
self->tics = 3*TICRATE;
return;
return 0;
}
S_Sound (self, CHAN_BODY, "misc/icebreak", 1, ATTN_NORM);
@ -297,6 +325,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
CALL_ACTION(A_NoBlocking, self);
self->SetState(self->FindState(NAME_Null));
return 0;
}
//----------------------------------------------------------------------------
@ -400,13 +429,20 @@ void DCorpsePointer::Serialize (FArchive &arc)
// throw another corpse on the queue
DEFINE_ACTION_FUNCTION(AActor, A_QueueCorpse)
{
PARAM_ACTION_PROLOGUE;
if (sv_corpsequeuesize > 0)
{
new DCorpsePointer (self);
}
return 0;
}
// Remove an self from the queue (for resurrection)
DEFINE_ACTION_FUNCTION(AActor, A_DeQueueCorpse)
{
PARAM_ACTION_PROLOGUE;
TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
DCorpsePointer *corpsePtr;
@ -416,9 +452,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeQueueCorpse)
{
corpsePtr->Corpse = NULL;
corpsePtr->Destroy ();
return;
return 0;
}
}
return 0;
}
//============================================================================
@ -429,7 +466,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeQueueCorpse)
DEFINE_ACTION_FUNCTION(AActor, A_SetInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_INVULNERABLE;
return 0;
}
//============================================================================
@ -440,7 +480,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetInvulnerable)
DEFINE_ACTION_FUNCTION(AActor, A_UnSetInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_INVULNERABLE;
return 0;
}
//============================================================================
@ -451,7 +494,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnSetInvulnerable)
DEFINE_ACTION_FUNCTION(AActor, A_SetReflective)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_REFLECTIVE;
return 0;
}
//============================================================================
@ -462,7 +508,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetReflective)
DEFINE_ACTION_FUNCTION(AActor, A_UnSetReflective)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_REFLECTIVE;
return 0;
}
//============================================================================
@ -473,7 +522,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnSetReflective)
DEFINE_ACTION_FUNCTION(AActor, A_SetReflectiveInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_REFLECTIVE|MF2_INVULNERABLE;
return 0;
}
//============================================================================
@ -484,7 +536,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetReflectiveInvulnerable)
DEFINE_ACTION_FUNCTION(AActor, A_UnSetReflectiveInvulnerable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~(MF2_REFLECTIVE|MF2_INVULNERABLE);
return 0;
}
//==========================================================================
@ -495,8 +550,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnSetReflectiveInvulnerable)
DEFINE_ACTION_FUNCTION(AActor, A_SetShootable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 &= ~MF2_NONSHOOTABLE;
self->flags |= MF_SHOOTABLE;
return 0;
}
//==========================================================================
@ -507,8 +565,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetShootable)
DEFINE_ACTION_FUNCTION(AActor, A_UnSetShootable)
{
PARAM_ACTION_PROLOGUE;
self->flags2 |= MF2_NONSHOOTABLE;
self->flags &= ~MF_SHOOTABLE;
return 0;
}
//===========================================================================
@ -519,7 +580,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_UnSetShootable)
DEFINE_ACTION_FUNCTION(AActor, A_NoGravity)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_NOGRAVITY;
return 0;
}
//===========================================================================
@ -530,8 +594,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_NoGravity)
DEFINE_ACTION_FUNCTION(AActor, A_Gravity)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_NOGRAVITY;
self->gravity = FRACUNIT;
return 0;
}
//===========================================================================
@ -542,8 +609,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_Gravity)
DEFINE_ACTION_FUNCTION(AActor, A_LowGravity)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_NOGRAVITY;
self->gravity = FRACUNIT/8;
return 0;
}
//===========================================================================

View file

@ -72,10 +72,12 @@ void ACustomBridge::BeginPlay ()
DEFINE_ACTION_FUNCTION(AActor, A_BridgeOrbit)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
{ // Don't crash if somebody spawned this into the world
// independantly of a Bridge actor.
return;
return 0;
}
// Set default values
// Every five tics, Hexen moved the ball 3/256th of a revolution.
@ -97,18 +99,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_BridgeOrbit)
self->x = self->target->x + rotationradius * finecosine[self->angle >> ANGLETOFINESHIFT];
self->y = self->target->y + rotationradius * finesine[self->angle >> ANGLETOFINESHIFT];
self->z = self->target->z;
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BridgeInit)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(balltype, AActor) { balltype = NULL; }
angle_t startangle;
AActor *ball;
fixed_t cx, cy, cz;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(balltype, 0);
if (balltype == NULL) balltype = PClass::FindClass("BridgeBall");
cx = self->x;
@ -127,6 +130,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BridgeInit)
ball->target = self;
CALL_ACTION(A_BridgeOrbit, ball);
}
return 0;
}
/* never used

View file

@ -266,11 +266,14 @@ bool P_GiveBody (AActor *actor, int num)
DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialThing1)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
if (static_cast<AInventory *>(self)->DoRespawn ())
{
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
}
return 0;
}
//---------------------------------------------------------------------------
@ -281,12 +284,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialThing1)
DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialThing2)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_SPECIAL;
if (!(self->GetDefault()->flags & MF_NOGRAVITY))
{
self->flags &= ~MF_NOGRAVITY;
}
self->SetState (self->SpawnState);
return 0;
}
@ -298,6 +304,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialThing2)
DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialDoomThing)
{
PARAM_ACTION_PROLOGUE;
self->renderflags &= ~RF_INVISIBLE;
self->flags |= MF_SPECIAL;
if (!(self->GetDefault()->flags & MF_NOGRAVITY))
@ -310,6 +318,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialDoomThing)
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
Spawn ("ItemFog", self->x, self->y, self->z, ALLOW_REPLACE);
}
return 0;
}
//---------------------------------------------------------------------------
@ -320,6 +329,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialDoomThing)
DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
{
PARAM_ACTION_PROLOGUE;
// Move item back to its original location
fixed_t _x, _y;
sector_t *sec;
@ -356,6 +367,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
self->z += FloatBobOffsets[(self->FloatBobPhase + level.maptime) & 63];
}
}
return 0;
}
int AInventory::StaticLastMessageTic;

View file

@ -164,7 +164,7 @@ class ARandomSpawner : public AActor
Super::Tick();
if (tracer == NULL || tracer->health <= 0)
{
CALL_ACTION(A_BossDeath, this);
A_BossDeath(this);
Destroy();
}
}
@ -172,4 +172,3 @@ class ARandomSpawner : public AActor
};
IMPLEMENT_CLASS (ARandomSpawner)

View file

@ -384,36 +384,36 @@ void ASpecialSpot::Destroy()
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnSingleItem)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS (cls, AActor);
PARAM_INT_OPT (fail_sp) { fail_sp = 0; }
PARAM_INT_OPT (fail_co) { fail_co = 0; }
PARAM_INT_OPT (fail_dm) { fail_dm = 0; }
AActor *spot = NULL;
DSpotState *state = DSpotState::GetSpotState();
if (state != NULL) spot = state->GetRandomSpot(RUNTIME_TYPE(self), true);
if (spot == NULL) return;
ACTION_PARAM_START(4);
ACTION_PARAM_CLASS(cls, 0);
ACTION_PARAM_INT(fail_sp, 1);
ACTION_PARAM_INT(fail_co, 2);
ACTION_PARAM_INT(fail_dm, 3);
if (spot == NULL) return 0;
if (!multiplayer && pr_spawnmace() < fail_sp)
{ // Sometimes doesn't show up if not in deathmatch
return;
return 0;
}
if (multiplayer && !deathmatch && pr_spawnmace() < fail_co)
{
return;
return 0;
}
if (deathmatch && pr_spawnmace() < fail_dm)
{
return;
return 0;
}
if (cls == NULL)
{
return;
return 0;
}
AActor *spawned = Spawn(cls, self->x, self->y, self->z, ALLOW_REPLACE);
@ -432,5 +432,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnSingleItem)
static_cast<AInventory*>(spawned)->SpawnPointClass = RUNTIME_TYPE(self);
}
}
return 0;
}

View file

@ -1702,23 +1702,24 @@ const PClass *Net_ReadWeapon(BYTE **stream)
DEFINE_ACTION_FUNCTION_PARAMS(AWeapon, A_ZoomFactor)
{
ACTION_PARAM_START(2);
ACTION_PARAM_FLOAT(zoom, 0);
ACTION_PARAM_INT(flags, 1);
PARAM_ACTION_PROLOGUE;
PARAM_FLOAT_OPT (zoom) { zoom = 1; }
PARAM_INT_OPT (flags) { flags = 0; }
if (self->player != NULL && self->player->ReadyWeapon != NULL)
{
zoom = 1 / clamp(zoom, 0.1f, 50.f);
zoom = 1 / clamp(zoom, 0.1, 50.0);
if (flags & 1)
{ // Make the zoom instant.
self->player->FOV = self->player->DesiredFOV * zoom;
self->player->FOV = float(self->player->DesiredFOV * zoom);
}
if (flags & 2)
{ // Disable pitch/yaw scaling.
zoom = -zoom;
}
self->player->ReadyWeapon->FOVScale = zoom;
self->player->ReadyWeapon->FOVScale = float(zoom);
}
return 0;
}
//===========================================================================
@ -1729,11 +1730,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AWeapon, A_ZoomFactor)
DEFINE_ACTION_FUNCTION_PARAMS(AWeapon, A_SetCrosshair)
{
ACTION_PARAM_START(1);
ACTION_PARAM_INT(xhair, 0);
PARAM_ACTION_PROLOGUE;
PARAM_INT(xhair);
if (self->player != NULL && self->player->ReadyWeapon != NULL)
{
self->player->ReadyWeapon->Crosshair = xhair;
}
return 0;
}

View file

@ -27,11 +27,14 @@
DEFINE_ACTION_FUNCTION(AActor, A_HideDecepticon)
{
PARAM_ACTION_PROLOGUE;
EV_DoDoor (DDoor::doorClose, NULL, self, 999, 8*FRACUNIT, 0, 0, 0);
if (self->target != NULL && self->target->player != NULL)
{
P_NoiseAlert (self->target, self);
}
return 0;
}
//============================================================================
@ -42,6 +45,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_HideDecepticon)
DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
{
PARAM_ACTION_PROLOGUE;
int i;
// [RH] Disable translucency here.
@ -49,7 +54,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
// Only the Blue Acolyte does extra stuff on death.
if (self->GetClass()->TypeName != NAME_AcolyteBlue)
return;
return 0;
// Make sure somebody is still alive
for (i = 0; i < MAXPLAYERS; ++i)
@ -58,7 +63,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
break;
}
if (i == MAXPLAYERS)
return;
return 0;
// Make sure all the other blue acolytes are dead.
TThinkerIterator<AActor> iterator(NAME_AcolyteBlue);
@ -68,7 +73,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
{
if (other != self && other->health > 0)
{ // Found a living one
return;
return 0;
}
}
@ -76,6 +81,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
players[i].SetLogNumber (14);
S_StopSound (CHAN_VOICE);
S_Sound (CHAN_VOICE, "svox/voc14", 1, ATTN_NORM);
return 0;
}
//============================================================================
@ -86,9 +92,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie)
DEFINE_ACTION_FUNCTION(AActor, A_BeShadowyFoe)
{
PARAM_ACTION_PROLOGUE;
self->RenderStyle = STYLE_Translucent;
self->alpha = HR_SHADOW;
self->flags &= ~MF_FRIENDLY;
return 0;
}
//============================================================================
@ -99,6 +108,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeShadowyFoe)
DEFINE_ACTION_FUNCTION(AActor, A_AcolyteBits)
{
PARAM_ACTION_PROLOGUE;
if (self->SpawnFlags & MTF_SHADOW)
{
CALL_ACTION(A_BeShadowyFoe, self);
@ -115,4 +126,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteBits)
self->RenderStyle.BlendOp = STYLEOP_None;
}
}
return 0;
}

View file

@ -22,6 +22,8 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target);
DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall)
{
PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("AlienChunkSmall", self->x, self->y, self->z + 10*FRACUNIT, ALLOW_REPLACE);
if (foo != NULL)
@ -36,10 +38,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall)
foo->velz = (pr_spectrechunk() & 15) << FRACBITS;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkLarge)
{
PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("AlienChunkLarge", self->x, self->y, self->z + 10*FRACUNIT, ALLOW_REPLACE);
if (foo != NULL)
@ -54,13 +59,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkLarge)
foo->velz = (pr_spectrechunk() & 7) << FRACBITS;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
AActor *foo = Spawn("SpectralLightningV2", self->x, self->y, self->z + 32*FRACUNIT, ALLOW_REPLACE);
@ -76,10 +83,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
P_SpawnSubMissile (self, PClass::FindClass("SpectralLightningBall2"), self);
}
self->angle -= ANGLE_180 / 20 * 10;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
{
PARAM_ACTION_PROLOGUE;
AActor *player;
char voc[32];
int log;
@ -88,7 +98,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
CALL_ACTION(A_NoBlocking, self); // [RH] Need this for Sigil rewarding
if (!CheckBossDeath (self))
{
return;
return 0;
}
for (i = 0, player = NULL; i < MAXPLAYERS; ++i)
{
@ -100,7 +110,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
}
if (player == NULL)
{
return;
return 0;
}
switch (self->GetClass()->TypeName)
@ -184,9 +194,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
break;
default:
return;
return 0;
}
mysnprintf (voc, countof(voc), "svox/voc%d", log);
S_Sound (CHAN_VOICE, voc, 1, ATTN_NORM);
player->player->SetLogNumber (log);
return 0;
}

View file

@ -20,8 +20,10 @@ bool Sys_1ed64 (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
if (Sys_1ed64 (self))
{
@ -44,42 +46,55 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
}
self->SetState (self->SeeState);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft)
{
PARAM_ACTION_PROLOGUE;
self->angle += ANGLE_90/16;
AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile"));
if (misl != NULL)
{
misl->velz += FRACUNIT;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepRight)
{
PARAM_ACTION_PROLOGUE;
self->angle -= ANGLE_90/16;
AActor *misl = P_SpawnMissileZAimed (self, self->z + 48*FRACUNIT, self->target, PClass::FindClass("FastFlameMissile"));
if (misl != NULL)
{
misl->velz += FRACUNIT;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderRefire)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL ||
self->target->health <= 0 ||
!P_CheckSight (self, self->target))
{
self->SetState (self->SeeState);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderDeath)
{
PARAM_ACTION_PROLOGUE;
if (CheckBossDeath (self))
{
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 667, FRACUNIT, 0, 0, 0, false);
}
return 0;
}

View file

@ -14,10 +14,13 @@ static FRandom pr_entity ("Entity");
DEFINE_ACTION_FUNCTION(AActor, A_SubEntityDeath)
{
PARAM_ACTION_PROLOGUE;
if (CheckBossDeath (self))
{
G_ExitLevel (0, false);
}
return 0;
}
void A_SpectralMissile (AActor *self, const char *missilename)
@ -41,6 +44,8 @@ DECLARE_ACTION(A_Spectre3Attack)
DEFINE_ACTION_FUNCTION(AActor, A_EntityAttack)
{
PARAM_ACTION_PROLOGUE;
// Apparent Strife bug: Case 5 was unreachable because they used % 5 instead of % 6.
// I've fixed that by making case 1 duplicate it, since case 1 did nothing.
switch (pr_entity() % 5)
@ -66,11 +71,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityAttack)
A_SpectralMissile (self, "SpectralLightningBigBall2");
break;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
{
PARAM_ACTION_PROLOGUE;
AActor *entity = Spawn("EntityBoss", self->x, self->y, self->z + 70*FRACUNIT, ALLOW_REPLACE);
if (entity != NULL)
{
@ -79,10 +87,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
entity->velz = 5*FRACUNIT;
entity->tracer = self;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
{
PARAM_ACTION_PROLOGUE;
AActor *second;
fixed_t secondRadius = GetDefaultByName("EntitySecond")->radius * 2;
angle_t an;
@ -121,4 +132,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
second->vely = FixedMul (secondRadius, finesine[an]) << 2;
A_FaceTarget (second);
return 0;
}

View file

@ -12,8 +12,11 @@ static FRandom pr_inq ("Inquisitor");
DEFINE_ACTION_FUNCTION(AActor, A_InquisitorWalk)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "inquisitor/walk", 1, ATTN_NORM);
A_Chase (self);
A_Chase (stack, self);
return 0;
}
bool InquisitorCheckDistance (AActor *self)
@ -27,8 +30,10 @@ bool InquisitorCheckDistance (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_InquisitorDecide)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return;
return 0;
A_FaceTarget (self);
if (!InquisitorCheckDistance (self))
@ -42,14 +47,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorDecide)
self->SetState (self->FindState("Jump"));
}
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
{
PARAM_ACTION_PROLOGUE;
AActor *proj;
if (self->target == NULL)
return;
return 0;
A_FaceTarget (self);
@ -67,16 +75,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
proj->velz += 16*FRACUNIT;
}
self->z -= 32*FRACBITS;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
{
PARAM_ACTION_PROLOGUE;
fixed_t dist;
fixed_t speed;
angle_t an;
if (self->target == NULL)
return;
return 0;
S_Sound (self, CHAN_ITEM|CHAN_LOOP, "inquisitor/jump", 1, ATTN_NORM);
self->z += 64*FRACUNIT;
@ -94,10 +105,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
self->velz = (self->target->z - self->z) / dist;
self->reactiontime = 60;
self->flags |= MF_NOGRAVITY;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_InquisitorCheckLand)
{
PARAM_ACTION_PROLOGUE;
self->reactiontime--;
if (self->reactiontime < 0 ||
self->velx == 0 ||
@ -108,21 +122,24 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorCheckLand)
self->reactiontime = 0;
self->flags &= ~MF_NOGRAVITY;
S_StopSound (self, CHAN_ITEM);
return;
return 0;
}
if (!S_IsActorPlayingSomething (self, CHAN_ITEM, -1))
{
S_Sound (self, CHAN_ITEM|CHAN_LOOP, "inquisitor/jump", 1, ATTN_NORM);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_TossArm)
{
PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("InquisitorArm", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
foo->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22);
foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
foo->velz = pr_inq() << 10;
return 0;
}

View file

@ -41,8 +41,11 @@ int ALoreShot::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
Spawn("LoreShot2", self->x, self->y, self->z, ALLOW_REPLACE);
Spawn("LoreShot2", self->x - (self->velx >> 1), self->y - (self->vely >> 1), self->z - (self->velz >> 1), ALLOW_REPLACE);
Spawn("LoreShot2", self->x - self->velx, self->y - self->vely, self->z - self->velz, ALLOW_REPLACE);
return 0;
}

View file

@ -20,6 +20,8 @@ IMPLEMENT_CLASS (AOracle)
DEFINE_ACTION_FUNCTION(AActor, A_WakeOracleSpectre)
{
PARAM_ACTION_PROLOGUE;
TThinkerIterator<AActor> it(NAME_AlienSpectre3);
AActor *spectre = it.Next();
@ -29,6 +31,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WakeOracleSpectre)
spectre->target = self->target;
spectre->SetState (spectre->SeeState);
}
return 0;
}

View file

@ -75,21 +75,24 @@ PalEntry AProgLevelEnder::GetBlend ()
DEFINE_ACTION_FUNCTION(AActor, A_ProgrammerMelee)
{
PARAM_ACTION_PROLOGUE;
int damage;
if (self->target == NULL)
return;
return 0;
A_FaceTarget (self);
if (!self->CheckMeleeRange ())
return;
return 0;
S_Sound (self, CHAN_WEAPON, "programmer/clank", 1, ATTN_NORM);
damage = ((pr_prog() % 10) + 1) * 6;
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return 0;
}
//============================================================================
@ -100,10 +103,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_ProgrammerMelee)
DEFINE_ACTION_FUNCTION(AActor, A_SpotLightning)
{
PARAM_ACTION_PROLOGUE;
AActor *spot;
if (self->target == NULL)
return;
return 0;
spot = Spawn("SpectralLightningSpot", self->target->x, self->target->y, self->target->floorz, ALLOW_REPLACE);
if (spot != NULL)
@ -113,6 +118,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpotLightning)
spot->health = -2;
spot->tracer = self->target;
}
return 0;
}
//============================================================================
@ -123,6 +129,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpotLightning)
DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
{
PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("ProgrammerBase", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
if (foo != NULL)
{
@ -131,6 +139,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]);
foo->velz = pr_prog() << 9;
}
return 0;
}
//============================================================================
@ -141,8 +150,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
DEFINE_ACTION_FUNCTION(AActor, A_ProgrammerDeath)
{
PARAM_ACTION_PROLOGUE;
if (!CheckBossDeath (self))
return;
return 0;
for (int i = 0; i < MAXPLAYERS; ++i)
{
@ -154,4 +165,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_ProgrammerDeath)
}
// the sky change scripts are now done as special actions in MAPINFO
CALL_ACTION(A_BossDeath, self);
return 0;
}

View file

@ -13,6 +13,8 @@ static FRandom pr_reaverattack ("ReaverAttack");
DEFINE_ACTION_FUNCTION(AActor, A_ReaverRanged)
{
PARAM_ACTION_PROLOGUE;
if (self->target != NULL)
{
angle_t bangle;
@ -30,4 +32,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_ReaverRanged)
P_LineAttack (self, angle, MISSILERANGE, pitch, damage, NAME_None, NAME_StrifePuff);
}
}
return 0;
}

View file

@ -22,10 +22,12 @@ static FRandom pr_shootgun ("ShootGun");
DEFINE_ACTION_FUNCTION(AActor, A_ShootGun)
{
PARAM_ACTION_PROLOGUE;
int pitch;
if (self->target == NULL)
return;
return 0;
S_Sound (self, CHAN_WEAPON, "monsters/rifle", 1, ATTN_NORM);
A_FaceTarget (self);
@ -33,6 +35,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShootGun)
P_LineAttack (self, self->angle + (pr_shootgun.Random2() << 19),
MISSILERANGE, pitch,
3*(pr_shootgun() % 5 + 1), NAME_None, NAME_StrifePuff);
return 0;
}
// Teleporter Beacon --------------------------------------------------------
@ -71,6 +74,8 @@ bool ATeleporterBeacon::Use (bool pickup)
DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
{
PARAM_ACTION_PROLOGUE;
AActor *owner = self->target;
AActor *rebel;
angle_t an;
@ -79,7 +84,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
if (!P_TryMove (rebel, rebel->x, rebel->y, true))
{
rebel->Destroy ();
return;
return 0;
}
// Once the rebels start teleporting in, you can't pick up the beacon anymore.
self->flags &= ~MF_SPECIAL;
@ -114,4 +119,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
{
self->SetState(self->FindState(NAME_Death));
}
return 0;
}

View file

@ -11,15 +11,17 @@ static FRandom pr_sentinelrefire ("SentinelRefire");
DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob)
{
PARAM_ACTION_PROLOGUE;
fixed_t minz, maxz;
if (self->flags & MF_INFLOAT)
{
self->velz = 0;
return;
return 0;
}
if (self->threshold != 0)
return;
return 0;
maxz = self->ceilingz - self->height - 16*FRACUNIT;
minz = self->floorz + 96*FRACUNIT;
@ -36,16 +38,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob)
self->velz += FRACUNIT;
}
self->reactiontime = (minz >= self->z) ? 4 : 0;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack)
{
PARAM_ACTION_PROLOGUE;
AActor *missile, *trail;
// [BB] Without a target the P_SpawnMissileZAimed call will crash.
if (!self->target)
{
return;
return 0;
}
missile = P_SpawnMissileZAimed (self, self->z + 32*FRACUNIT, self->target, PClass::FindClass("SentinelFX2"));
@ -69,10 +74,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack)
}
missile->z += missile->velz >> 2;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SentinelRefire)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget (self);
if (pr_sentinelrefire() >= 30)
@ -86,4 +94,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelRefire)
self->SetState (self->SeeState);
}
}
return 0;
}

View file

@ -28,14 +28,19 @@ void ASpectralMonster::Touch (AActor *toucher)
DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail)
{
PARAM_ACTION_PROLOGUE;
AActor *foo = Spawn("SpectralLightningHTail", self->x - self->velx, self->y - self->vely, self->z, ALLOW_REPLACE);
foo->angle = self->angle;
foo->health = self->health;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SpectralBigBallLightning)
{
PARAM_ACTION_PROLOGUE;
const PClass *cls = PClass::FindClass("SpectralLightningH3");
if (cls)
{
@ -46,12 +51,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralBigBallLightning)
self->angle += ANGLE_90;
P_SpawnSubMissile (self, cls, self->target);
}
return 0;
}
static FRandom pr_zap5 ("Zap5");
DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
{
PARAM_ACTION_PROLOGUE;
AActor *flash;
fixed_t x, y;
@ -76,6 +84,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
flash->target = self->target;
flash->velz = -18*FRACUNIT;
flash->health = self->health;
return 0;
}
// In Strife, this number is stored in the data segment, but it doesn't seem to be
@ -84,6 +93,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
{
PARAM_ACTION_PROLOGUE;
AActor *dest;
angle_t exact;
fixed_t dist;
@ -92,7 +103,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
dest = self->tracer;
if (!dest || dest->health <= 0 || self->Speed == 0 || !self->CanSeek(dest))
return;
return 0;
// change angle
exact = R_PointToAngle2 (self->x, self->y, dest->x, dest->y);
@ -144,4 +155,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
self->velz += FRACUNIT/8;
}
}
return 0;
}

View file

@ -13,6 +13,8 @@ static FRandom pr_stalker ("Stalker");
DEFINE_ACTION_FUNCTION(AActor, A_StalkerChaseDecide)
{
PARAM_ACTION_PROLOGUE;
if (!(self->flags & MF_NOGRAVITY))
{
self->SetState (self->FindState("SeeFloor"));
@ -21,10 +23,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_StalkerChaseDecide)
{
self->SetState (self->FindState("Drop"));
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_StalkerLookInit)
{
PARAM_ACTION_PROLOGUE;
FState *state;
if (self->flags & MF_NOGRAVITY)
{
@ -38,16 +43,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_StalkerLookInit)
{
self->SetState (state);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_StalkerDrop)
{
PARAM_ACTION_PROLOGUE;
self->flags5 &= ~MF5_NOVERTICALMELEERANGE;
self->flags &= ~MF_NOGRAVITY;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_StalkerAttack)
{
PARAM_ACTION_PROLOGUE;
if (self->flags & MF_NOGRAVITY)
{
self->SetState (self->FindState("Drop"));
@ -63,11 +74,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_StalkerAttack)
P_TraceBleed (damage, self->target, self);
}
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_StalkerWalk)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_BODY, "stalker/walk", 1, ATTN_NORM);
A_Chase (self);
A_Chase (stack, self);
return 0;
}

View file

@ -23,6 +23,8 @@ IMPLEMENT_CLASS(ADegninOre)
DEFINE_ACTION_FUNCTION(AActor, A_RemoveForceField)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~MF_SPECIAL;
for (int i = 0; i < self->Sector->linecount; ++i)
@ -36,6 +38,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RemoveForceField)
line->sidedef[1]->SetTexture(side_t::mid, FNullTextureID());
}
}
return 0;
}
bool ADegninOre::Use (bool pickup)

View file

@ -431,22 +431,30 @@ int AForceFieldGuard::TakeSpecialDamage (AActor *inflictor, AActor *source, int
DEFINE_ACTION_FUNCTION(AActor, A_SetShadow)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_STRIFEx8000000|MF_SHADOW;
self->RenderStyle = STYLE_Translucent;
self->alpha = HR_SHADOW;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_ClearShadow)
{
PARAM_ACTION_PROLOGUE;
self->flags &= ~(MF_STRIFEx8000000|MF_SHADOW);
self->RenderStyle = STYLE_Normal;
self->alpha = OPAQUE;
return 0;
}
static FRandom pr_gethurt ("HurtMe!");
DEFINE_ACTION_FUNCTION(AActor, A_GetHurt)
{
PARAM_ACTION_PROLOGUE;
self->flags4 |= MF4_INCOMBAT;
if ((pr_gethurt() % 5) == 0)
{
@ -457,16 +465,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_GetHurt)
{
self->Die (self->target, self->target);
}
return 0;
}
// Klaxon Warning Light -----------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_TurretLook)
{
PARAM_ACTION_PROLOGUE;
AActor *target;
if (self->flags5 & MF5_INCONVERSATION)
return;
return 0;
self->threshold = 0;
target = self->LastHeard;
@ -478,7 +489,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_TurretLook)
self->target = target;
if ((self->flags & MF_AMBUSH) && !P_CheckSight (self, target))
{
return;
return 0;
}
if (self->SeeSound != 0)
{
@ -488,10 +499,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_TurretLook)
self->threshold = 10;
self->SetState (self->SeeState);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_KlaxonBlare)
{
PARAM_ACTION_PROLOGUE;
if (--self->reactiontime < 0)
{
self->target = NULL;
@ -515,6 +529,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KlaxonBlare)
{
S_Sound (self, CHAN_VOICE, "misc/alarm", 1, ATTN_NORM);
}
return 0;
}
// Power Coupling -----------------------------------------------------------
@ -578,6 +593,8 @@ IMPLEMENT_CLASS (AMeat)
DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
{
PARAM_ACTION_PROLOGUE;
const char *gibtype = (self->flags & MF_NOBLOOD) ? "Junk" : "Meat";
AActor *gib = Spawn (gibtype, self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
angle_t an;
@ -585,7 +602,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
if (gib == NULL)
{
return;
return 0;
}
an = pr_gibtosser() << 24;
@ -594,37 +611,49 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
gib->velx = speed * finecosine[an >> ANGLETOFINESHIFT];
gib->vely = speed * finesine[an >> ANGLETOFINESHIFT];
gib->velz = (pr_gibtosser() & 15) << FRACBITS;
return 0;
}
//============================================================================
DEFINE_ACTION_FUNCTION(AActor, A_FLoopActiveSound)
{
PARAM_ACTION_PROLOGUE;
if (self->ActiveSound != 0 && !(level.time & 7))
{
S_Sound (self, CHAN_VOICE, self->ActiveSound, 1, ATTN_NORM);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Countdown)
{
PARAM_ACTION_PROLOGUE;
if (--self->reactiontime <= 0)
{
P_ExplodeMissile (self, NULL, NULL);
self->flags &= ~MF_SKULLFLY;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_LoopActiveSound)
{
PARAM_ACTION_PROLOGUE;
if (self->ActiveSound != 0 && !S_IsActorPlayingSomething (self, CHAN_VOICE, -1))
{
S_Sound (self, CHAN_VOICE|CHAN_LOOP, self->ActiveSound, 1, ATTN_NORM);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
{
PARAM_ACTION_PROLOGUE;
sector_t *sec = self->Sector;
if (self->z == sec->floorplane.ZatPoint (self->x, self->y))
@ -643,6 +672,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
self->vely += FixedMul (speed, finesine[finean]);
}
}
return 0;
}
//============================================================================
@ -653,6 +683,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
DEFINE_ACTION_FUNCTION(AActor, A_ClearSoundTarget)
{
PARAM_ACTION_PROLOGUE;
AActor *actor;
self->Sector->SoundTarget = NULL;
@ -660,11 +692,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_ClearSoundTarget)
{
actor->LastHeard = NULL;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_VOICE, "human/imonfire", 1, ATTN_NORM);
if (self->player != NULL && self->player->mo == self)
@ -676,17 +711,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
self->player->playerstate = PST_LIVE;
self->player->extralight = 3;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_DropFire)
{
PARAM_ACTION_PROLOGUE;
AActor *drop = Spawn("FireDroplet", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
drop->velz = -FRACUNIT;
P_RadiusAttack (self, self, 64, 64, NAME_Fire, false);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL && self->player->mo == self)
{
self->player->playerstate = PST_DEAD;
@ -694,10 +735,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrispyPlayer)
self->player->psprites[ps_weapon].state +
(self->FindState("FireHandsLower") - self->FindState("FireHands")));
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_HandLower)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
pspdef_t *psp = &self->player->psprites[ps_weapon];
@ -708,5 +752,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower)
}
if (self->player->extralight > 0) self->player->extralight--;
}
return 0;
}

View file

@ -94,6 +94,8 @@ void P_DaggerAlert (AActor *target, AActor *emitter)
DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
{
PARAM_ACTION_PROLOGUE;
angle_t angle;
int damage;
int pitch;
@ -129,6 +131,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
{
S_Sound (self, CHAN_WEAPON, "misc/swish", 1, ATTN_NORM);
}
return 0;
}
//============================================================================
@ -139,6 +142,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
DEFINE_ACTION_FUNCTION(AActor, A_AlertMonsters)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
P_NoiseAlert(self, self);
@ -147,6 +152,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlertMonsters)
{
P_NoiseAlert (self->target, self);
}
return 0;
}
// Poison Bolt --------------------------------------------------------------
@ -186,12 +192,15 @@ int APoisonBolt::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_ClearFlash)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (player == NULL)
return;
return 0;
P_SetPsprite (player, ps_flash, NULL);
return 0;
}
//============================================================================
@ -202,10 +211,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_ClearFlash)
DEFINE_ACTION_FUNCTION(AActor, A_ShowElectricFlash)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
P_SetPsprite (self->player, ps_flash, self->player->ReadyWeapon->FindState(NAME_Flash));
}
return 0;
}
//============================================================================
@ -216,19 +228,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShowElectricFlash)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireArrow)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS(ti, AActor);
angle_t savedangle;
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(ti, 0);
if (self->player == NULL)
return;
return 0;
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
if (ti)
@ -240,6 +252,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireArrow)
self->angle = savedangle;
S_Sound (self, CHAN_WEAPON, "weapons/xbowshoot", 1, ATTN_NORM);
}
return 0;
}
// Assault Gun --------------------------------------------------------------
@ -274,6 +287,8 @@ void P_StrifeGunShot (AActor *mo, bool accurate, angle_t pitch)
DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
{
PARAM_ACTION_PROLOGUE;
bool accurate;
S_Sound (self, CHAN_WEAPON, "weapons/assaultgun", 1, ATTN_NORM);
@ -284,7 +299,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
self->player->mo->PlayAttacking2 ();
accurate = !self->player->refire;
@ -295,6 +310,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
}
P_StrifeGunShot (self, accurate, P_BulletSlope (self));
return 0;
}
// Mini-Missile Launcher ----------------------------------------------------
@ -307,17 +323,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireAssaultGun)
DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
angle_t savedangle;
if (self->player == NULL)
return;
return 0;
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
savedangle = self->angle;
@ -325,6 +343,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
player->mo->PlayAttacking2 ();
P_SpawnPlayerMissile (self, PClass::FindClass("MiniMissile"));
self->angle = savedangle;
return 0;
}
//============================================================================
@ -335,6 +354,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
{
PARAM_ACTION_PROLOGUE;
AActor *trail;
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
@ -344,6 +365,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
{
trail->velz = FRACUNIT;
}
return 0;
}
// Flame Thrower ------------------------------------------------------------
@ -356,8 +378,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
DEFINE_ACTION_FUNCTION(AActor, A_FlameDie)
{
PARAM_ACTION_PROLOGUE;
self->flags |= MF_NOGRAVITY;
self->velz = (pr_flamedie() & 3) << FRACBITS;
return 0;
}
//============================================================================
@ -368,6 +393,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameDie)
DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (player != NULL)
@ -376,7 +403,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
player->mo->PlayAttacking2 ();
}
@ -387,6 +414,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
{
self->velz += 5*FRACUNIT;
}
return 0;
}
// Mauler -------------------------------------------------------------------
@ -402,13 +430,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
// Strife apparently didn't show the player shooting. Let's fix that.
self->player->mo->PlayAttacking2 ();
@ -431,6 +461,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
// original.
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Disintegrate, NAME_MaulerPuff);
}
return 0;
}
//============================================================================
@ -443,6 +474,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/mauler2charge", 1, ATTN_NORM);
if (self->player != NULL)
@ -450,6 +483,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
self->player->psprites[ps_weapon].sx += pr_mauler2.Random2() << 10;
self->player->psprites[ps_weapon].sy += pr_mauler2.Random2() << 10;
}
return 0;
}
//============================================================================
@ -462,19 +496,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2Pre)
DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
AWeapon *weapon = self->player->ReadyWeapon;
if (weapon != NULL)
{
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
}
self->player->mo->PlayAttacking2 ();
}
P_SpawnPlayerMissile (self, PClass::FindClass("MaulerTorpedo"));
P_DamageMobj (self, self, NULL, 20, self->DamageType);
P_ThrustMobj (self, self->angle + ANGLE_180, 0x7D000);
return 0;
}
//============================================================================
@ -489,6 +526,8 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target);
DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
{
PARAM_ACTION_PROLOGUE;
AActor *wavedef = GetDefaultByName("MaulerTorpedoWave");
fixed_t savedz;
self->angle += ANGLE_180;
@ -506,6 +545,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
P_SpawnSubMissile (self, PClass::FindClass("MaulerTorpedoWave"), self->target);
}
self->z = savedz;
return 0;
}
AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target)
@ -568,11 +608,16 @@ int APhosphorousFire::DoSpecialDamage (AActor *target, int damage)
DEFINE_ACTION_FUNCTION(AActor, A_BurnArea)
{
PARAM_ACTION_PROLOGUE;
P_RadiusAttack (self, self->target, 128, 128, self->DamageType, true);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
{
PARAM_ACTION_PROLOGUE;
self->velz -= 8*FRACUNIT;
self->velx += (pr_phburn.Random2 (3)) << FRACBITS;
self->vely += (pr_phburn.Random2 (3)) << FRACBITS;
@ -624,6 +669,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
drop->flags |= MF_DROPPED;
}
}
return 0;
}
//============================================================================
@ -634,25 +680,25 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
{
PARAM_ACTION_PROLOGUE;
PARAM_CLASS(grenadetype, AActor);
PARAM_ANGLE(angleofs);
PARAM_STATE(flash)
player_t *player = self->player;
AActor *grenade;
angle_t an;
fixed_t tworadii;
AWeapon *weapon;
ACTION_PARAM_START(3);
ACTION_PARAM_CLASS(grenadetype, 0);
ACTION_PARAM_ANGLE(Angle, 1);
ACTION_PARAM_STATE(flash, 2);
if (player == NULL || grenadetype == NULL)
return;
return 0;
if ((weapon = player->ReadyWeapon) == NULL)
return;
return 0;
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
return 0;
P_SetPsprite (player, ps_flash, flash);
@ -662,7 +708,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
grenade = P_SpawnSubMissile (self, grenadetype, self);
self->z -= 32*FRACUNIT;
if (grenade == NULL)
return;
return 0;
if (grenade->SeeSound != 0)
{
@ -676,11 +722,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
grenade->x += FixedMul (finecosine[an], tworadii);
grenade->y += FixedMul (finesine[an], tworadii);
an = self->angle + Angle;
an = self->angle + angleofs;
an >>= ANGLETOFINESHIFT;
grenade->x += FixedMul (finecosine[an], 15*FRACUNIT);
grenade->y += FixedMul (finesine[an], 15*FRACUNIT);
}
return 0;
}
// The Almighty Sigil! ------------------------------------------------------
@ -771,12 +818,15 @@ AInventory *ASigil::CreateCopy (AActor *other)
DEFINE_ACTION_FUNCTION(AActor, A_SelectPiece)
{
PARAM_ACTION_PROLOGUE;
int pieces = MIN (static_cast<ASigil*>(self)->NumPieces, 5);
if (pieces > 1)
{
self->SetState (self->FindState("Spawn")+pieces);
}
return 0;
}
//============================================================================
@ -794,15 +844,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectPiece)
DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilView)
{
PARAM_ACTION_PROLOGUE;
int pieces;
if (self->player == NULL)
{
return;
return 0;
}
pieces = static_cast<ASigil*>(self->player->ReadyWeapon)->NumPieces;
P_SetPsprite (self->player, ps_weapon,
self->player->psprites[ps_weapon].state + pieces);
return 0;
}
//============================================================================
@ -817,11 +870,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilView)
DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilDown)
{
PARAM_ACTION_PROLOGUE;
int pieces;
if (self->player == NULL)
{
return;
return 0;
}
pieces = static_cast<ASigil*>(self->player->ReadyWeapon)->DownPieces;
static_cast<ASigil*>(self->player->ReadyWeapon)->DownPieces = 0;
@ -831,6 +886,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilDown)
}
P_SetPsprite (self->player, ps_weapon,
self->player->psprites[ps_weapon].state + pieces);
return 0;
}
//============================================================================
@ -843,15 +899,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilDown)
DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilAttack)
{
PARAM_ACTION_PROLOGUE;
int pieces;
if (self->player == NULL)
{
return;
return 0;
}
pieces = static_cast<ASigil*>(self->player->ReadyWeapon)->NumPieces;
P_SetPsprite (self->player, ps_weapon,
self->player->psprites[ps_weapon].state + 4*pieces - 3);
return 0;
}
//============================================================================
@ -862,11 +921,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_SelectSigilAttack)
DEFINE_ACTION_FUNCTION(AActor, A_SigilCharge)
{
PARAM_ACTION_PROLOGUE;
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
if (self->player != NULL)
{
self->player->extralight = 2;
}
return 0;
}
//============================================================================
@ -877,10 +939,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SigilCharge)
DEFINE_ACTION_FUNCTION(AActor, A_LightInverse)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
self->player->extralight = INT_MIN;
}
return 0;
}
//============================================================================
@ -891,12 +956,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightInverse)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
{
PARAM_ACTION_PROLOGUE;
AActor *spot;
player_t *player = self->player;
AActor *linetarget;
if (player == NULL || player->ReadyWeapon == NULL)
return;
return 0;
P_DamageMobj (self, self, NULL, 1*4, 0, DMG_NO_ARMOR);
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
@ -924,6 +991,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
spot->health = -1;
spot->target = self;
}
return 0;
}
//============================================================================
@ -934,15 +1002,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil2)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (player == NULL || player->ReadyWeapon == NULL)
return;
return 0;
P_DamageMobj (self, self, NULL, 2*4, 0, DMG_NO_ARMOR);
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
P_SpawnPlayerMissile (self, PClass::FindClass("SpectralLightningH1"));
return 0;
}
//============================================================================
@ -953,12 +1024,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil2)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
{
PARAM_ACTION_PROLOGUE;
AActor *spot;
player_t *player = self->player;
int i;
if (player == NULL || player->ReadyWeapon == NULL)
return;
return 0;
P_DamageMobj (self, self, NULL, 3*4, 0, DMG_NO_ARMOR);
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
@ -974,6 +1047,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
}
}
self->angle -= (ANGLE_180/20)*10;
return 0;
}
//============================================================================
@ -984,12 +1058,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
{
PARAM_ACTION_PROLOGUE;
AActor *spot;
player_t *player = self->player;
AActor *linetarget;
if (player == NULL || player->ReadyWeapon == NULL)
return;
return 0;
P_DamageMobj (self, self, NULL, 4*4, 0, DMG_NO_ARMOR);
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
@ -1012,6 +1088,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
spot->vely += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]);
}
}
return 0;
}
//============================================================================
@ -1022,15 +1099,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
DEFINE_ACTION_FUNCTION(AActor, A_FireSigil5)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (player == NULL || player->ReadyWeapon == NULL)
return;
return 0;
P_DamageMobj (self, self, NULL, 5*4, 0, DMG_NO_ARMOR);
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
P_SpawnPlayerMissile (self, PClass::FindClass("SpectralLightningBigBall1"));
return 0;
}
//============================================================================

View file

@ -13,13 +13,15 @@ static FRandom pr_templar ("Templar");
DEFINE_ACTION_FUNCTION(AActor, A_TemplarAttack)
{
PARAM_ACTION_PROLOGUE;
int damage;
angle_t angle;
int pitch;
int pitchdiff;
if (self->target == NULL)
return;
return 0;
S_Sound (self, CHAN_WEAPON, "templar/shoot", 1, ATTN_NORM);
A_FaceTarget (self);
@ -32,4 +34,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_TemplarAttack)
pitchdiff = pr_templar.Random2() * 332063;
P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, NAME_Disintegrate, NAME_MaulerPuff);
}
return 0;
}

View file

@ -18,30 +18,36 @@ extern const PClass *QuestItemClasses[31];
DEFINE_ACTION_FUNCTION(AActor, A_Bang4Cloud)
{
PARAM_ACTION_PROLOGUE;
fixed_t spawnx, spawny;
spawnx = self->x + (pr_bang4cloud.Random2() & 3) * 10240;
spawny = self->y + (pr_bang4cloud.Random2() & 3) * 10240;
Spawn("Bang4Cloud", spawnx, spawny, self->z, ALLOW_REPLACE);
return 0;
}
// -------------------------------------------------------------------
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveQuestItem)
{
ACTION_PARAM_START(1);
ACTION_PARAM_INT(questitem, 0);
PARAM_ACTION_PROLOGUE;
PARAM_INT(questitem);
// Give one of these quest items to every player in the game
for (int i = 0; i < MAXPLAYERS; ++i)
if (questitem >= 0 && questitem < countof(QuestItemClasses))
{
if (playeringame[i])
for (int i = 0; i < MAXPLAYERS; ++i)
{
AInventory *item = static_cast<AInventory *>(Spawn (QuestItemClasses[questitem-1], 0,0,0, NO_REPLACE));
if (!item->CallTryPickup (players[i].mo))
if (playeringame[i])
{
item->Destroy ();
AInventory *item = static_cast<AInventory *>(Spawn (QuestItemClasses[questitem - 1], 0,0,0, NO_REPLACE));
if (!item->CallTryPickup (players[i].mo))
{
item->Destroy ();
}
}
}
}
@ -55,20 +61,26 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveQuestItem)
{
C_MidPrint (SmallFont, name);
}
return 0;
}
// PowerCrystal -------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_ExtraLightOff)
{
PARAM_ACTION_PROLOGUE;
if (self->target != NULL && self->target->player != NULL)
{
self->target->player->extralight = 0;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Explode512)
{
PARAM_ACTION_PROLOGUE;
P_RadiusAttack (self, self->target, 512, 512, NAME_None, true);
if (self->target != NULL && self->target->player != NULL)
{
@ -81,10 +93,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Explode512)
// Strife didn't do this next part, but it looks good
self->RenderStyle = STYLE_Add;
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_LightGoesOut)
{
PARAM_ACTION_PROLOGUE;
AActor *foo;
sector_t *sec = self->Sector;
vertex_t *spot;
@ -106,4 +121,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightGoesOut)
foo->velz = (7 + (pr_lightout() & 3)) << FRACBITS;
}
}
return 0;
}

View file

@ -51,79 +51,13 @@
extern void LoadActors ();
int CallDecorateAction(VMFrameStack *stack, VMValue *param, int numparam, VMReturn *ret, int numret)
{
assert(numparam == 6);
actionf_p action = (actionf_p)param[5].a;
action((AActor *)param[0].a, (AActor *)param[1].a, (FState *)param[2].a, param[3].i, (StateCallData *)param[4].a);
return 0;
}
void FState::SetAction(PSymbolActionFunction *func, bool setdefaultparams)
{
if (func != NULL)
{
// All generated functions use this code.
static const VM_UBYTE codetemplate[] =
{
OP_PARAM, 0, REGT_POINTER, 0,
OP_PARAM, 0, REGT_POINTER, 1,
OP_PARAM, 0, REGT_POINTER, 2,
OP_PARAM, 0, REGT_INT, 0,
OP_PARAM, 0, REGT_POINTER, 3,
OP_PARAM, 0, REGT_POINTER|REGT_KONST, 0,
OP_CALL_K, 1, 6, 0,
OP_RET, 0, REGT_NIL, 0
};
// Find the CallDecorateAction function. If not found, create it and install it
// in Actor.
VMFunction *callfunc;
PSymbol *sym = RUNTIME_CLASS(AActor)->Symbols.FindSymbol("CallDecorateAction", false);
if (sym == NULL)
{
PSymbolVMFunction *symfunc = new PSymbolVMFunction("CallDecorateAction");
VMNativeFunction *calldec = new VMNativeFunction(CallDecorateAction);
symfunc->Function = calldec;
sym = symfunc;
RUNTIME_CLASS(AActor)->Symbols.AddSymbol(sym);
}
assert(sym->SymbolType == SYM_VMFunction);
assert(((PSymbolVMFunction *)sym)->Function != NULL);
callfunc = ((PSymbolVMFunction *)sym)->Function;
// Create a function for this state.
VMScriptFunction *vmfunc = new VMScriptFunction;
vmfunc->Alloc(sizeof(codetemplate)/sizeof(VMOP), 0, 0, 0, 2);
memcpy(vmfunc->Code, codetemplate, sizeof(codetemplate));
FVoidObj *konsta = vmfunc->KonstA;
VM_ATAG *atag = vmfunc->KonstATags();
konsta[0].v = (void *)func->Function;
konsta[1].o = callfunc;
atag[0] = ATAG_GENERIC;
atag[1] = ATAG_OBJECT;
vmfunc->NumRegA = 4;
vmfunc->NumRegD = 1;
vmfunc->MaxParam = 6;
vmfunc->NumArgs = 5;
ActionFunc = vmfunc;
if (setdefaultparams) ParameterIndex = func->defaultparameterindex+1;
}
else
{
ActionFunc = NULL;
if (setdefaultparams) ParameterIndex = 0;
}
}
bool FState::CallAction(AActor *self, AActor *stateowner, StateCallData *statecall)
{
if (ActionFunc != NULL)
{
//ActionFunc(self, stateowner, this, ParameterIndex-1, statecall);
VMFrameStack stack;
VMValue params[5] = { self, stateowner, this, ParameterIndex - 1, VMValue(statecall, ATAG_STATE) };
VMValue params[4] = { self, stateowner, VMValue(this, ATAG_STATE), statecall };
stack.Call(ActionFunc, params, countof(params), NULL, 0, NULL);
return true;
}

View file

@ -62,7 +62,6 @@ struct FState
BYTE DefineFlags; // Unused byte so let's use it during state creation.
FState *NextState;
VMFunction *ActionFunc;
int ParameterIndex;
inline int GetFrame() const
{
@ -92,7 +91,7 @@ struct FState
{
Frame = (Frame & SF_FULLBRIGHT) | (frame-'A');
}
void SetAction(PSymbolActionFunction *func, bool setdefaultparams = true);
void SetAction(VMFunction *func) { ActionFunc = func; }
bool CallAction(AActor *self, AActor *stateowner, StateCallData *statecall = NULL);
static const PClass *StaticFindStateOwner (const FState *state);
static const PClass *StaticFindStateOwner (const FState *state, const FActorInfo *info);
@ -190,4 +189,21 @@ extern FDoomEdMap DoomEdMap;
int GetSpriteIndex(const char * spritename);
TArray<FName> &MakeStateNameList(const char * fname);
// Standard parameters for all action functons
// self - Actor this action is to operate on (player if a weapon)
// stateowner - Actor this action really belongs to (may be a weapon)
// callingstate - State this action was called from
// statecall - CustomInventory stuff
#define PARAM_ACTION_PROLOGUE_TYPE(type) \
PARAM_PROLOGUE; \
PARAM_OBJECT (self, type); \
PARAM_OBJECT_OPT (stateowner, AActor) { stateowner = self; } \
PARAM_STATE_OPT (callingstate) { callingstate = NULL; } \
PARAM_POINTER_OPT(statecall, StateCallData) { statecall = NULL; }
#define PARAM_ACTION_PROLOGUE PARAM_ACTION_PROLOGUE_TYPE(AActor)
// Number of action paramaters
#define NAP 4
#endif // __INFO_H__

View file

@ -1688,10 +1688,12 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
//
DEFINE_ACTION_FUNCTION(AActor, A_Look)
{
PARAM_ACTION_PROLOGUE;
AActor *targ;
if (self->flags5 & MF5_INCONVERSATION)
return;
return 0;
// [RH] Set goal now if appropriate
if (self->special == Thing_SetGoal && self->args[0] == 0)
@ -1723,7 +1725,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)
if (targ && targ->player && (targ->player->cheats & CF_NOTARGET))
{
return;
return 0;
}
}
@ -1767,7 +1769,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)
}
if (!P_LookForPlayers (self, self->flags4 & MF4_LOOKALLAROUND, NULL))
return;
return 0;
// go into chase state
seeyou:
@ -1793,6 +1795,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)
{
self->SetState (self->SeeState);
}
return 0;
}
@ -1805,30 +1808,32 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
{
ACTION_PARAM_START(6);
ACTION_PARAM_INT(flags, 0);
ACTION_PARAM_FIXED(minseedist, 1);
ACTION_PARAM_FIXED(maxseedist, 2);
ACTION_PARAM_FIXED(maxheardist, 3);
ACTION_PARAM_ANGLE(fov, 4);
ACTION_PARAM_STATE(seestate, 5);
PARAM_ACTION_PROLOGUE;
PARAM_INT_OPT (flags) { flags = 0; }
PARAM_FIXED_OPT (minseedist) { minseedist = 0; }
PARAM_FIXED_OPT (maxseedist) { maxseedist = 0; }
PARAM_FIXED_OPT (maxheardist) { maxheardist = 0; }
PARAM_ANGLE_OPT (fov) { fov = 0; }
PARAM_STATE_OPT (seestate) { seestate = NULL; }
AActor *targ = NULL; // Shuts up gcc
fixed_t dist;
FLookExParams params = {fov, minseedist, maxseedist, maxheardist, flags, seestate };
FLookExParams params = { fov, minseedist, maxseedist, maxheardist, flags, seestate };
if (self->flags5 & MF5_INCONVERSATION)
return;
return 0;
// [RH] Set goal now if appropriate
if (self->special == Thing_SetGoal && self->args[0] == 0)
{
NActorIterator iterator (NAME_PatrolPoint, self->args[1]);
NActorIterator iterator(NAME_PatrolPoint, self->args[1]);
self->special = 0;
self->goal = iterator.Next ();
self->reactiontime = self->args[2] * TICRATE + level.maptime;
if (self->args[3] == 0) self->flags5 &=~ MF5_CHASEGOAL;
else self->flags5 |= MF5_CHASEGOAL;
if (self->args[3] == 0)
self->flags5 &= ~MF5_CHASEGOAL;
else
self->flags5 |= MF5_CHASEGOAL;
}
self->threshold = 0; // any shot will wake up
@ -1851,8 +1856,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
}
else
{
dist = P_AproxDistance (targ->x - self->x,
targ->y - self->y);
dist = P_AproxDistance (targ->x - self->x, targ->y - self->y);
// [KS] If the target is too far away, don't respond to the sound.
if (maxheardist && dist > maxheardist)
@ -1866,7 +1870,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
if (targ && targ->player && (targ->player->cheats & CF_NOTARGET))
{
return;
return 0;
}
}
@ -1923,8 +1927,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
{
if (self->flags & MF_AMBUSH)
{
dist = P_AproxDistance (self->target->x - self->x,
self->target->y - self->y);
dist = P_AproxDistance (self->target->x - self->x, self->target->y - self->y);
if (P_CheckSight (self, self->target, 2) &&
(!minseedist || dist > minseedist) &&
(!maxseedist || dist < maxseedist))
@ -1941,11 +1944,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
if (!(flags & LOF_NOSIGHTCHECK))
{
if (!P_LookForPlayers(self, true, &params))
return;
return 0;
}
else
{
return;
return 0;
}
// go into chase state
@ -1979,6 +1982,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
self->SetState (self->SeeState);
}
}
return 0;
}
// [KS] *** End additions by me ***
@ -1990,20 +1994,22 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_Wander)
{
PARAM_ACTION_PROLOGUE;
// [RH] Strife probably clears this flag somewhere, but I couldn't find where.
// This seems as good a place as any.
self->flags4 &= ~MF4_INCOMBAT;
if (self->flags5 & MF5_INCONVERSATION)
return;
return 0;
if (self->flags4 & MF4_STANDSTILL)
return;
return 0;
if (self->reactiontime != 0)
{
self->reactiontime--;
return;
return 0;
}
// turn towards movement direction if not there yet
@ -2026,6 +2032,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Wander)
P_RandomChaseDir (self);
self->movecount += 5;
}
return 0;
}
@ -2036,10 +2043,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_Wander)
//==========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_Look2)
{
PARAM_ACTION_PROLOGUE;
AActor *targ;
if (self->flags5 & MF5_INCONVERSATION)
return;
return 0;
self->threshold = 0;
targ = self->LastHeard;
@ -2062,7 +2071,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look2)
self->target = targ;
self->threshold = 10;
self->SetState (self->SeeState);
return;
return 0;
}
else
{
@ -2070,7 +2079,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look2)
goto nosee;
self->SetState (self->SeeState);
self->flags4 |= MF4_INCOMBAT;
return;
return 0;
}
}
nosee:
@ -2082,6 +2091,7 @@ nosee:
{
self->SetState (self->SpawnState + 3);
}
return 0;
}
//=============================================================================
@ -2097,7 +2107,7 @@ nosee:
//=============================================================================
#define CLASS_BOSS_STRAFE_RANGE 64*10*FRACUNIT
void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missilestate, bool playactive, bool nightmarefast, bool dontmove)
void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *meleestate, FState *missilestate, bool playactive, bool nightmarefast, bool dontmove)
{
int delta;
@ -2607,53 +2617,60 @@ enum ChaseFlags
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Chase)
{
ACTION_PARAM_START(3);
ACTION_PARAM_STATE(melee, 0);
ACTION_PARAM_STATE(missile, 1);
ACTION_PARAM_INT(flags, 2);
PARAM_ACTION_PROLOGUE;
PARAM_STATE_OPT (melee) { melee = NULL; }
PARAM_STATE_OPT (missile) { missile = NULL; }
PARAM_INT_OPT (flags) { flags = 0; }
if (melee != (FState*)-1)
if (numparam >= NAP + 1)
{
if (flags & CHF_RESURRECT && P_CheckForResurrection(self, false)) return;
if ((flags & CHF_RESURRECT) && P_CheckForResurrection(self, false))
return 0;
A_DoChase(self, !!(flags&CHF_FASTCHASE), melee, missile, !(flags&CHF_NOPLAYACTIVE),
A_DoChase(stack, self, !!(flags&CHF_FASTCHASE), melee, missile, !(flags&CHF_NOPLAYACTIVE),
!!(flags&CHF_NIGHTMAREFAST), !!(flags&CHF_DONTMOVE));
}
else // this is the old default A_Chase
{
A_DoChase (self, false, self->MeleeState, self->MissileState, true, !!(gameinfo.gametype & GAME_Raven), false);
A_DoChase(stack, self, false, self->MeleeState, self->MissileState, true, !!(gameinfo.gametype & GAME_Raven), false);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_FastChase)
{
A_DoChase (self, true, self->MeleeState, self->MissileState, true, true, false);
PARAM_ACTION_PROLOGUE;
A_DoChase(stack, self, true, self->MeleeState, self->MissileState, true, true, false);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_VileChase)
{
PARAM_ACTION_PROLOGUE;
if (!P_CheckForResurrection(self, true))
A_DoChase (self, false, self->MeleeState, self->MissileState, true, !!(gameinfo.gametype & GAME_Raven), false);
A_DoChase(stack, self, false, self->MeleeState, self->MissileState, true, !!(gameinfo.gametype & GAME_Raven), false);
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ExtChase)
{
ACTION_PARAM_START(4);
ACTION_PARAM_BOOL(domelee, 0);
ACTION_PARAM_BOOL(domissile, 1);
ACTION_PARAM_BOOL(playactive, 2);
ACTION_PARAM_BOOL(nightmarefast, 3);
PARAM_ACTION_PROLOGUE;
PARAM_BOOL (domelee);
PARAM_BOOL (domissile);
PARAM_BOOL_OPT (playactive) { playactive = true; }
PARAM_BOOL_OPT (nightmarefast) { nightmarefast = false; }
// Now that A_Chase can handle state label parameters, this function has become rather useless...
A_DoChase(self, false,
domelee ? self->MeleeState:NULL, domissile ? self->MissileState:NULL,
A_DoChase(stack, self, false,
domelee ? self->MeleeState : NULL, domissile ? self->MissileState : NULL,
playactive, nightmarefast, false);
return 0;
}
// for internal use
void A_Chase(AActor *self)
void A_Chase(VMFrameStack *stack, AActor *self)
{
A_DoChase (self, false, self->MeleeState, self->MissileState, true, !!(gameinfo.gametype & GAME_Raven), false);
A_DoChase(stack, self, false, self->MeleeState, self->MissileState, true, !!(gameinfo.gametype & GAME_Raven), false);
}
//=============================================================================
@ -2673,8 +2690,7 @@ void A_FaceTarget (AActor *self)
}
self->flags &= ~MF_AMBUSH;
self->angle = R_PointToAngle2 (self->x, self->y,
self->target->x, self->target->y);
self->angle = R_PointToAngle2 (self->x, self->y, self->target->x, self->target->y);
if (self->target->flags & MF_SHADOW)
{
@ -2684,7 +2700,9 @@ void A_FaceTarget (AActor *self)
DEFINE_ACTION_FUNCTION(AActor, A_FaceTarget)
{
PARAM_ACTION_PROLOGUE;
A_FaceTarget(self);
return 0;
}
//===========================================================================
@ -2696,8 +2714,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FaceTarget)
//===========================================================================
DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
{
PARAM_ACTION_PROLOGUE;
if (!self->target)
return;
return 0;
// [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH)
@ -2726,10 +2746,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
}
P_RailAttack (self, self->GetMissileDamage (0, 1), 0);
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_Scream)
{
PARAM_ACTION_PROLOGUE;
if (self->DeathSound)
{
// Check for bosses.
@ -2743,14 +2765,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_Scream)
S_Sound (self, CHAN_VOICE, self->DeathSound, 1, ATTN_NORM);
}
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_XScream)
{
PARAM_ACTION_PROLOGUE;
if (self->player)
S_Sound (self, CHAN_VOICE, "*gibbed", 1, ATTN_NORM);
else
S_Sound (self, CHAN_VOICE, "misc/gibbed", 1, ATTN_NORM);
return 0;
}
//===========================================================================
@ -2761,8 +2786,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_XScream)
DEFINE_ACTION_FUNCTION(AActor, A_ScreamAndUnblock)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_Scream, self);
CALL_ACTION(A_NoBlocking, self);
return 0;
}
//===========================================================================
@ -2773,10 +2800,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_ScreamAndUnblock)
DEFINE_ACTION_FUNCTION(AActor, A_ActiveSound)
{
PARAM_ACTION_PROLOGUE;
if (self->ActiveSound)
{
S_Sound (self, CHAN_VOICE, self->ActiveSound, 1, ATTN_NORM);
}
return 0;
}
//===========================================================================
@ -2787,8 +2816,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_ActiveSound)
DEFINE_ACTION_FUNCTION(AActor, A_ActiveAndUnblock)
{
PARAM_ACTION_PROLOGUE;
CALL_ACTION(A_ActiveSound, self);
CALL_ACTION(A_NoBlocking, self);
return 0;
}
//---------------------------------------------------------------------------
@ -2921,6 +2952,8 @@ void P_TossItem (AActor *item)
DEFINE_ACTION_FUNCTION(AActor, A_Pain)
{
PARAM_ACTION_PROLOGUE;
// [RH] Vary player pain sounds depending on health (ala Quake2)
if (self->player && self->player->morphTics == 0)
{
@ -2962,15 +2995,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_Pain)
{
S_Sound (self, CHAN_VOICE, self->PainSound, 1, ATTN_NORM);
}
return 0;
}
// killough 11/98: kill an object
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Die)
{
ACTION_PARAM_START(1);
ACTION_PARAM_NAME(damagetype, 0);
PARAM_ACTION_PROLOGUE;
PARAM_NAME_OPT (damagetype) { damagetype = NAME_None; }
P_DamageMobj (self, NULL, NULL, self->health, damagetype, DMG_FORCED);
return 0;
}
//
@ -2980,12 +3015,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Die)
DEFINE_ACTION_FUNCTION(AActor, A_Detonate)
{
int damage = self->GetMissileDamage (0, 1);
PARAM_ACTION_PROLOGUE;
int damage = self->GetMissileDamage(0, 1);
P_RadiusAttack (self, self->target, damage, damage, self->DamageType, true);
if (self->z <= self->floorz + (damage << FRACBITS))
{
P_HitFloor (self);
}
return 0;
}
bool CheckBossDeath (AActor *actor)
@ -3022,7 +3059,7 @@ bool CheckBossDeath (AActor *actor)
// A_BossDeath
// Possibly trigger special effects if on a boss level
//
DEFINE_ACTION_FUNCTION(AActor, A_BossDeath)
void A_BossDeath(AActor *self)
{
FName mytype = self->GetClass()->TypeName;
@ -3118,6 +3155,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_BossDeath)
G_ExitLevel (0, false);
}
DEFINE_ACTION_FUNCTION(AActor, A_BossDeath)
{
PARAM_ACTION_PROLOGUE;
A_BossDeath(self);
return 0;
}
//----------------------------------------------------------------------------
//
// PROC P_Massacre
@ -3191,6 +3235,7 @@ bool A_RaiseMobj (AActor *actor, fixed_t speed)
DEFINE_ACTION_FUNCTION(AActor, A_ClassBossHealth)
{
PARAM_ACTION_PROLOGUE;
if (multiplayer && !deathmatch) // co-op only
{
if (!self->special1)
@ -3199,4 +3244,5 @@ DEFINE_ACTION_FUNCTION(AActor, A_ClassBossHealth)
self->special1 = true; // has been initialized
}
}
return 0;
}

View file

@ -64,9 +64,9 @@ DECLARE_ACTION(A_NoBlocking)
DECLARE_ACTION(A_Scream)
DECLARE_ACTION(A_FreezeDeath)
DECLARE_ACTION(A_FreezeDeathChunks)
DECLARE_ACTION(A_BossDeath)
void A_BossDeath(AActor *self);
void A_Chase(AActor *self);
void A_Chase(VMFrameStack *stack, AActor *self);
void A_FaceTarget (AActor *actor);
bool A_RaiseMobj (AActor *, fixed_t speed);

View file

@ -1009,7 +1009,7 @@ bool AActor::Grind(bool items)
{
if (this->flags4 & MF4_BOSSDEATH)
{
CALL_ACTION(A_BossDeath, this);
A_BossDeath(this);
}
flags &= ~MF_SOLID;
flags3 |= MF3_DONTGIB;
@ -1027,7 +1027,7 @@ bool AActor::Grind(bool items)
{
if (this->flags4 & MF4_BOSSDEATH)
{
CALL_ACTION(A_BossDeath, this);
A_BossDeath(this);
}
const PClass *i = PClass::FindClass("RealGibs");

View file

@ -424,13 +424,16 @@ enum EWRF_Options
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_WeaponReady)
{
ACTION_PARAM_START(1);
ACTION_PARAM_INT(paramflags, 0);
PARAM_ACTION_PROLOGUE;
PARAM_INT_OPT(flags) { flags = 0; }
if (!(paramflags & WRF_NoSwitch)) DoReadyWeaponToSwitch(self);
if ((paramflags & WRF_NoFire) != WRF_NoFire) DoReadyWeaponToFire(self,
(!(paramflags & WRF_NoPrimary)), (!(paramflags & WRF_NoSecondary)));
if (!(paramflags & WRF_NoBob)) DoReadyWeaponToBob(self);
if (!(flags & WRF_NoSwitch))
DoReadyWeaponToSwitch(self);
if ((flags & WRF_NoFire) != WRF_NoFire)
DoReadyWeaponToFire(self, !(flags & WRF_NoPrimary), !(flags & WRF_NoSecondary));
if (!(flags & WRF_NoBob))
DoReadyWeaponToBob(self);
return 0;
}
//---------------------------------------------------------------------------
@ -509,11 +512,13 @@ void P_CheckWeaponSwitch (player_t *player)
DEFINE_ACTION_FUNCTION(AInventory, A_ReFire)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (NULL == player)
{
return;
return 0;
}
if ((player->cmd.ucmd.buttons&BT_ATTACK)
&& !player->ReadyWeapon->bAltFire
@ -535,16 +540,19 @@ DEFINE_ACTION_FUNCTION(AInventory, A_ReFire)
player->ReadyWeapon->CheckAmmo (player->ReadyWeapon->bAltFire
? AWeapon::AltFire : AWeapon::PrimaryFire, true);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AInventory, A_ClearReFire)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (NULL != player)
{
player->refire = 0;
}
return 0;
}
//---------------------------------------------------------------------------
@ -559,12 +567,15 @@ DEFINE_ACTION_FUNCTION(AInventory, A_ClearReFire)
DEFINE_ACTION_FUNCTION(AInventory, A_CheckReload)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
self->player->ReadyWeapon->CheckAmmo (
self->player->ReadyWeapon->bAltFire ? AWeapon::AltFire
: AWeapon::PrimaryFire, true);
}
return 0;
}
//---------------------------------------------------------------------------
@ -575,12 +586,14 @@ DEFINE_ACTION_FUNCTION(AInventory, A_CheckReload)
DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
pspdef_t *psp;
if (NULL == player)
{
return;
return 0;
}
psp = &player->psprites[ps_weapon];
if (player->morphTics || player->cheats & CF_INSTANTWEAPSWITCH)
@ -593,17 +606,17 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
}
if (psp->sy < WEAPONBOTTOM)
{ // Not lowered all the way yet
return;
return 0;
}
if (player->playerstate == PST_DEAD)
{ // Player is dead, so don't bring up a pending weapon
psp->sy = WEAPONBOTTOM;
return;
return 0;
}
if (player->health <= 0)
{ // Player is dead, so keep the weapon off screen
P_SetPsprite (player, ps_weapon, NULL);
return;
return 0;
}
/* if (player->PendingWeapon != WP_NOCHANGE)
{ // [RH] Make sure we're actually changing weapons.
@ -612,6 +625,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
// [RH] Clear the flash state. Only needed for Strife.
P_SetPsprite (player, ps_flash, NULL);
P_BringUpWeapon (player);
return 0;
}
//---------------------------------------------------------------------------
@ -622,27 +636,29 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Lower)
DEFINE_ACTION_FUNCTION(AInventory, A_Raise)
{
PARAM_ACTION_PROLOGUE;
if (self == NULL)
{
return;
return 0;
}
player_t *player = self->player;
pspdef_t *psp;
if (NULL == player)
{
return;
return 0;
}
if (player->PendingWeapon != WP_NOCHANGE)
{
P_SetPsprite (player, ps_weapon, player->ReadyWeapon->GetDownState());
return;
return 0;
}
psp = &player->psprites[ps_weapon];
psp->sy -= RAISESPEED;
if (psp->sy > WEAPONTOP)
{ // Not raised all the way yet
return;
return 0;
}
psp->sy = WEAPONTOP;
if (player->ReadyWeapon != NULL)
@ -653,6 +669,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Raise)
{
player->psprites[ps_weapon].state = NULL;
}
return 0;
}
@ -663,11 +680,12 @@ DEFINE_ACTION_FUNCTION(AInventory, A_Raise)
//
DEFINE_ACTION_FUNCTION(AInventory, A_GunFlash)
{
PARAM_ACTION_PROLOGUE;
player_t *player = self->player;
if (NULL == player)
{
return;
return 0;
}
player->mo->PlayAttacking2 ();
@ -675,6 +693,7 @@ DEFINE_ACTION_FUNCTION(AInventory, A_GunFlash)
if (player->ReadyWeapon->bAltFire) flash = player->ReadyWeapon->FindState(NAME_AltFlash);
if (flash == NULL) flash = player->ReadyWeapon->FindState(NAME_Flash);
P_SetPsprite (player, ps_flash, flash);
return 0;
}
@ -740,37 +759,47 @@ void P_GunShot (AActor *mo, bool accurate, const PClass *pufftype, angle_t pitch
DEFINE_ACTION_FUNCTION(AInventory, A_Light0)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
self->player->extralight = 0;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AInventory, A_Light1)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
self->player->extralight = 1;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AInventory, A_Light2)
{
PARAM_ACTION_PROLOGUE;
if (self->player != NULL)
{
self->player->extralight = 2;
}
return 0;
}
DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_Light)
{
ACTION_PARAM_START(1);
ACTION_PARAM_INT(light, 0);
PARAM_ACTION_PROLOGUE;
PARAM_INT(light);
if (self->player != NULL)
{
self->player->extralight = clamp<int>(light, 0, 20);
}
return 0;
}
//------------------------------------------------------------------------

View file

@ -1249,6 +1249,8 @@ void APlayerPawn::TweakSpeeds (int &forward, int &side)
DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
{
PARAM_ACTION_PROLOGUE;
int sound = 0;
int chan = CHAN_VOICE;
@ -1262,7 +1264,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
{
S_Sound (self, CHAN_VOICE, "*death", 1, ATTN_NORM);
}
return;
return 0;
}
// Handle the different player death screams
@ -1311,6 +1313,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
}
}
S_Sound (self, chan, sound, 1, ATTN_NORM);
return 0;
}
@ -1322,17 +1325,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
{
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(spawntype, 0);
PARAM_ACTION_PROLOGUE;
PARAM_CLASS_OPT(spawntype, APlayerChunk) { spawntype = NULL; }
APlayerPawn *mo;
player_t *player;
// [GRB] Parameterized version
if (!spawntype || !spawntype->IsDescendantOf (RUNTIME_CLASS (APlayerChunk)))
if (spawntype == NULL || !spawntype->IsDescendantOf(RUNTIME_CLASS(APlayerChunk)))
{
spawntype = PClass::FindClass("BloodySkull");
if (spawntype == NULL) return;
if (spawntype == NULL) return 0;
}
self->flags &= ~MF_SOLID;
@ -1357,6 +1360,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
}
player->damagecount = 32;
}
return 0;
}
//----------------------------------------------------------------------------
@ -1367,10 +1371,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
DEFINE_ACTION_FUNCTION(AActor, A_CheckPlayerDone)
{
PARAM_ACTION_PROLOGUE;
if (self->player == NULL)
{
self->Destroy ();
self->Destroy();
}
return 0;
}
//===========================================================================
@ -1384,7 +1391,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckPlayerDone)
void P_CheckPlayerSprites()
{
for(int i=0; i<MAXPLAYERS; i++)
for (int i = 0; i < MAXPLAYERS; i++)
{
player_t * player = &players[i];
APlayerPawn * mo = player->mo;

View file

@ -802,7 +802,7 @@ static void CalcPolyobjSoundOrg(const FPolyObj *poly, fixed_t *x, fixed_t *y, fi
//==========================================================================
static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyObj *poly,
const FVector3 *pt, int channel, FSoundID sound_id, float volume, float attenuation)
const FVector3 *pt, int channel, FSoundID sound_id, double volume, double attenuation)
{
sfxinfo_t *sfx;
int chanflags;
@ -860,7 +860,7 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO
sfx = &S_sfx[sound_id];
// Scale volume according to SNDINFO data.
volume = MIN(volume * sfx->Volume, 1.f);
volume = MIN(volume * sfx->Volume, 1.0);
if (volume <= 0)
return NULL;
@ -1037,11 +1037,11 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO
{
SoundListener listener;
S_SetListener(listener, players[consoleplayer].camera);
chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, volume, rolloff, attenuation, pitch, basepriority, pos, vel, channel, startflags, NULL);
chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, float(volume), rolloff, float(attenuation), pitch, basepriority, pos, vel, channel, startflags, NULL);
}
else
{
chan = (FSoundChan*)GSnd->StartSound (sfx->data, volume, pitch, startflags, NULL);
chan = (FSoundChan*)GSnd->StartSound (sfx->data, float(volume), pitch, startflags, NULL);
}
}
if (chan == NULL && (chanflags & CHAN_LOOP))
@ -1063,13 +1063,13 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO
chan->OrgID = FSoundID(org_id);
chan->SfxInfo = sfx;
chan->EntChannel = channel;
chan->Volume = volume;
chan->Volume = float(volume);
chan->ChanFlags |= chanflags;
chan->NearLimit = near_limit;
chan->LimitRange = limit_range;
chan->Pitch = pitch;
chan->Priority = basepriority;
chan->DistanceScale = attenuation;
chan->DistanceScale = float(attenuation);
chan->SourceType = type;
switch (type)
{
@ -1156,7 +1156,7 @@ void S_RestartSound(FSoundChan *chan)
//
//==========================================================================
void S_Sound (int channel, FSoundID sound_id, float volume, float attenuation)
void S_Sound (int channel, FSoundID sound_id, double volume, double attenuation)
{
S_StartSound (NULL, NULL, NULL, NULL, channel, sound_id, volume, attenuation);
}
@ -1167,7 +1167,7 @@ void S_Sound (int channel, FSoundID sound_id, float volume, float attenuation)
//
//==========================================================================
void S_Sound (AActor *ent, int channel, FSoundID sound_id, float volume, float attenuation)
void S_Sound (AActor *ent, int channel, FSoundID sound_id, double volume, double attenuation)
{
if (ent == NULL || ent->Sector->Flags & SECF_SILENT)
return;
@ -1180,7 +1180,7 @@ void S_Sound (AActor *ent, int channel, FSoundID sound_id, float volume, float a
//
//==========================================================================
void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume, float attenuation)
void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, double volume, double attenuation)
{
S_StartSound (NULL, NULL, poly, NULL, channel, sound_id, volume, attenuation);
}
@ -1191,7 +1191,7 @@ void S_Sound (const FPolyObj *poly, int channel, FSoundID sound_id, float volume
//
//==========================================================================
void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sound_id, float volume, float attenuation)
void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sound_id, double volume, double attenuation)
{
FVector3 pt(FIXED2FLOAT(x), FIXED2FLOAT(z), FIXED2FLOAT(y));
S_StartSound (NULL, NULL, NULL, &pt, channel, sound_id, volume, attenuation);
@ -1203,7 +1203,7 @@ void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sound_id, f
//
//==========================================================================
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, float volume, float attenuation)
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, double volume, double attenuation)
{
S_StartSound (NULL, sec, NULL, NULL, channel, sfxid, volume, attenuation);
}

View file

@ -217,11 +217,11 @@ void S_PrecacheLevel ();
void S_CacheSound (sfxinfo_t *sfx);
// Start sound for thing at <ent>
void S_Sound (int channel, FSoundID sfxid, float volume, float attenuation);
void S_Sound (AActor *ent, int channel, FSoundID sfxid, float volume, float attenuation);
void S_Sound (const FPolyObj *poly, int channel, FSoundID sfxid, float volume, float attenuation);
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, float volume, float attenuation);
void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sfxid, float volume, float attenuation);
void S_Sound (int channel, FSoundID sfxid, double volume, double attenuation);
void S_Sound (AActor *ent, int channel, FSoundID sfxid, double volume, double attenuation);
void S_Sound (const FPolyObj *poly, int channel, FSoundID sfxid, double volume, double attenuation);
void S_Sound (const sector_t *sec, int channel, FSoundID sfxid, double volume, double attenuation);
void S_Sound (fixed_t x, fixed_t y, fixed_t z, int channel, FSoundID sfxid, double volume, double attenuation);
// sound channels
// channel 0 never willingly overrides

View file

@ -47,7 +47,7 @@ namespace FMOD
FMOD global system functions (optional).
*/
inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = (FMOD_MEMORY_NORMAL | FMOD_MEMORY_XBOX360_PHYSICAL)) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced) { return FMOD_Memory_GetStats(currentalloced, maxalloced); }
//inline FMOD_RESULT Memory_GetStats (int *currentalloced, int *maxalloced) { return FMOD_Memory_GetStats(currentalloced, maxalloced); }
inline FMOD_RESULT Debug_SetLevel(FMOD_DEBUGLEVEL level) { return FMOD_Debug_SetLevel(level); }
inline FMOD_RESULT Debug_GetLevel(FMOD_DEBUGLEVEL *level) { return FMOD_Debug_GetLevel(level); }
inline FMOD_RESULT File_SetDiskBusy(int busy) { return FMOD_File_SetDiskBusy(busy); }

View file

@ -234,24 +234,24 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def)
{
if (extra.bExplosive)
{
info->OwnedStates[extra.DeathStart].SetAction(FindGlobalActionFunction("A_Explode"));
info->OwnedStates[extra.DeathStart].SetAction(FindGlobalActionFunction("A_Explode")->Function);
}
}
else
{
// The first frame plays the death sound and
// the second frame makes it nonsolid.
info->OwnedStates[extra.DeathStart].SetAction(FindGlobalActionFunction("A_Scream"));
info->OwnedStates[extra.DeathStart].SetAction(FindGlobalActionFunction("A_Scream")->Function);
if (extra.bSolidOnDeath)
{
}
else if (extra.DeathStart + 1 < extra.DeathEnd)
{
info->OwnedStates[extra.DeathStart+1].SetAction(FindGlobalActionFunction("A_NoBlocking"));
info->OwnedStates[extra.DeathStart+1].SetAction(FindGlobalActionFunction("A_NoBlocking")->Function);
}
else
{
info->OwnedStates[extra.DeathStart].SetAction(FindGlobalActionFunction("A_ScreamAndUnblock"));
info->OwnedStates[extra.DeathStart].SetAction(FindGlobalActionFunction("A_ScreamAndUnblock")->Function);
}
if (extra.DeathHeight == 0) extra.DeathHeight = ((AActor*)(type->Defaults))->height;
@ -279,17 +279,17 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def)
// The first frame plays the burn sound and
// the second frame makes it nonsolid.
info->OwnedStates[extra.FireDeathStart].SetAction(FindGlobalActionFunction("A_ActiveSound"));
info->OwnedStates[extra.FireDeathStart].SetAction(FindGlobalActionFunction("A_ActiveSound")->Function);
if (extra.bSolidOnBurn)
{
}
else if (extra.FireDeathStart + 1 < extra.FireDeathEnd)
{
info->OwnedStates[extra.FireDeathStart+1].SetAction(FindGlobalActionFunction("A_NoBlocking"));
info->OwnedStates[extra.FireDeathStart+1].SetAction(FindGlobalActionFunction("A_NoBlocking")->Function);
}
else
{
info->OwnedStates[extra.FireDeathStart].SetAction(FindGlobalActionFunction("A_ActiveAndUnblock"));
info->OwnedStates[extra.FireDeathStart].SetAction(FindGlobalActionFunction("A_ActiveAndUnblock")->Function);
}
if (extra.BurnHeight == 0) extra.BurnHeight = ((AActor*)(type->Defaults))->height;
@ -309,13 +309,13 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def)
info->OwnedStates[i].NextState = &info->OwnedStates[info->NumOwnedStates-1];
info->OwnedStates[i].Tics = 5;
info->OwnedStates[i].Misc1 = 0;
info->OwnedStates[i].SetAction(FindGlobalActionFunction("A_FreezeDeath"));
info->OwnedStates[i].SetAction(FindGlobalActionFunction("A_FreezeDeath")->Function);
i = info->NumOwnedStates - 1;
info->OwnedStates[i].NextState = &info->OwnedStates[i];
info->OwnedStates[i].Tics = 1;
info->OwnedStates[i].Misc1 = 0;
info->OwnedStates[i].SetAction(FindGlobalActionFunction("A_FreezeDeathChunks"));
info->OwnedStates[i].SetAction(FindGlobalActionFunction("A_FreezeDeathChunks")->Function);
bag.statedef.SetStateLabel("Ice", &info->OwnedStates[extra.IceDeathStart]);
}
else if (extra.bGenericIceDeath)

View file

@ -302,9 +302,13 @@ static void FinishThingdef()
p->Emit(&buildit);
delete p;
}
// FIXME: Call a real function
buildit.Emit(OP_CALL_K, buildit.GetConstantAddress(NULL, ATAG_OBJECT), j, 0);
VMScriptFunction *func = buildit.MakeFunction();
func->NumArgs = tcall->Parameters.Size();
for (int k = 0; k < tcall->NumStates; ++k)
{
tcall->ActorInfo->OwnedStates[tcall->FirstState + k].SetAction(func);
}
#if 1
const char *marks = "=======================================================";
char label[64];
@ -318,10 +322,8 @@ static void FinishThingdef()
fprintf(dump, "\nDisassembly:\n");
VMDisasm(dump, func->Code, func->CodeSize, func);
#endif
//if(i==6) I_Error("Poop");
}
fclose(dump);
I_Error("Poop");
for (i = 0; i < PClass::m_Types.Size(); i++)
{

View file

@ -187,6 +187,7 @@ struct AFuncDesc
{
const char *Name;
actionf_p Function;
VMNativeFunction **VMPointer;
};
AFuncDesc *FindFunction(const char * string);
@ -367,26 +368,27 @@ struct StateCallData
// Macros to handle action functions. These are here so that I don't have to
// change every single use in case the parameters change.
#define DECLARE_ACTION(name) void AF_##name(AActor *self, AActor *stateowner, FState *, int, StateCallData *);
#define DECLARE_ACTION(name) extern VMNativeFunction *name##_VMPtr;
// This distinction is here so that CALL_ACTION produces errors when trying to
// access a function that requires parameters.
#define DEFINE_ACTION_FUNCTION(cls, name) \
void AF_##name (AActor *self, AActor *stateowner, FState *, int, StateCallData *); \
static AFuncDesc info_##cls##_##name = { #name, AF_##name }; \
MSVC_ASEG AFuncDesc *infoptr_##cls##_##name GCC_ASEG = &info_##cls##_##name; \
void AF_##name (AActor *self, AActor *stateowner, FState *, int, StateCallData *statecall)
static int AF_##name(VM_ARGS); \
VMNativeFunction *name##_VMPtr; \
static const AFuncDesc cls##_##name##_Hook = { #name, AF_##name, &name##_VMPtr }; \
extern AFuncDesc const *const cls##_##name##_HookPtr; \
MSVC_ASEG AFuncDesc const *const cls##_##name##_HookPtr GCC_ASEG = &cls##_##name##_Hook; \
static int AF_##name(VM_ARGS)
#define DEFINE_ACTION_FUNCTION_PARAMS(cls, name) \
void AFP_##name (AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall); \
static AFuncDesc info_##cls##_##name = { #name, AFP_##name }; \
MSVC_ASEG AFuncDesc *infoptr_##cls##_##name GCC_ASEG = &info_##cls##_##name; \
void AFP_##name (AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall)
#define DEFINE_ACTION_FUNCTION_PARAMS(cls, name) DEFINE_ACTION_FUNCTION(cls, name)
#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall
#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall
//#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall
//#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall
#define CALL_ACTION(name,self) AF_##name(self, self, NULL, 0, NULL)
#define CALL_ACTION(name,self) { /*AF_##name(self, self, NULL, 0, NULL)*/ \
VMValue params[5] = { self, self, NULL, VMValue(NULL, ATAG_STATE) }; \
stack->Call(name##_VMPtr, params, countof(params), NULL, 0, NULL); \
}
int EvalExpressionI (DWORD x, AActor *self);
@ -398,6 +400,7 @@ FState *EvalExpressionState (DWORD x, AActor *self);
const PClass *EvalExpressionClass (DWORD x, AActor *self);
FName EvalExpressionName (DWORD x, AActor *self);
#if 0
#define ACTION_PARAM_START(count)
#define ACTION_PARAM_INT(var, i) \
@ -422,11 +425,12 @@ FName EvalExpressionName (DWORD x, AActor *self);
FName var = EvalExpressionName(ParameterIndex+i, self);
#define ACTION_PARAM_ANGLE(var,i) \
angle_t var = angle_t(EvalExpressionF(ParameterIndex+i, self)*ANGLE_90/90.f);
#endif
#define ACTION_SET_RESULT(v) if (statecall != NULL) statecall->Result = v;
// Checks to see what called the current action function
#define ACTION_CALL_FROM_ACTOR() (CallingState == self->state)
#define ACTION_CALL_FROM_WEAPON() (self->player && CallingState != self->state && statecall == NULL)
#define ACTION_CALL_FROM_ACTOR() (callingstate == self->state)
#define ACTION_CALL_FROM_WEAPON() (self->player && callingstate != self->state && statecall == NULL)
#define ACTION_CALL_FROM_INVENTORY() (statecall != NULL)
#endif

File diff suppressed because it is too large Load diff

View file

@ -590,7 +590,10 @@ void InitThingdef()
while (*++probe != NULL)
{
AFTable.Push(*(AFuncDesc *)*probe);
AFuncDesc *afunc = (AFuncDesc *)*probe;
assert(afunc->VMPointer != NULL);
*(afunc->VMPointer) = new VMNativeFunction(afunc->Function);
AFTable.Push(*afunc);
}
AFTable.ShrinkToFit();
qsort(&AFTable[0], AFTable.Size(), sizeof(AFTable[0]), funccmp);

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