mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
commit
42c1ff2310
4 changed files with 5248 additions and 5111 deletions
|
@ -546,6 +546,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
|
|||
P_SpawnPlayerMissile (self, 0, 0, 0, PClass::FindClass("BFGBall"), self->angle, NULL, NULL, !!(dmflags2 & DF2_NO_FREEAIMBFG));
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// A_BFGSpray
|
||||
// Spawn a BFG explosion on every monster in view
|
||||
|
@ -559,14 +560,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
|
|||
AActor *thingToHit;
|
||||
AActor *linetarget;
|
||||
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_START(7);
|
||||
ACTION_PARAM_CLASS(spraytype, 0);
|
||||
ACTION_PARAM_INT(numrays, 1);
|
||||
ACTION_PARAM_INT(damagecnt, 2);
|
||||
ACTION_PARAM_ANGLE(angle, 3);
|
||||
ACTION_PARAM_FIXED(distance, 4);
|
||||
ACTION_PARAM_ANGLE(vrange, 5);
|
||||
ACTION_PARAM_INT(defdamage, 6);
|
||||
|
||||
if (spraytype == NULL) spraytype = PClass::FindClass("BFGExtra");
|
||||
if (numrays <= 0) numrays = 40;
|
||||
if (damagecnt <= 0) damagecnt = 15;
|
||||
if (angle == 0) angle = ANG90;
|
||||
if (distance <= 0) distance = 16 * 64 * FRACUNIT;
|
||||
if (vrange == 0) vrange = ANGLE_1 * 32;
|
||||
|
||||
// [RH] Don't crash if no target
|
||||
if (!self->target)
|
||||
|
@ -575,10 +583,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
|
|||
// offset angles from its attack angle
|
||||
for (i = 0; i < numrays; i++)
|
||||
{
|
||||
an = self->angle - ANG90/2 + ANG90/numrays*i;
|
||||
an = self->angle - angle/2 + angle/numrays*i;
|
||||
|
||||
// self->target is the originator (player) of the missile
|
||||
P_AimLineAttack (self->target, an, 16*64*FRACUNIT, &linetarget, ANGLE_1*32);
|
||||
P_AimLineAttack (self->target, an, distance, &linetarget, vrange);
|
||||
|
||||
if (!linetarget)
|
||||
continue;
|
||||
|
@ -589,10 +597,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
|
|||
if (spray && (spray->flags5 & MF5_PUFFGETSOWNER))
|
||||
spray->target = self->target;
|
||||
|
||||
|
||||
if (defdamage == 0)
|
||||
{
|
||||
damage = 0;
|
||||
for (j = 0; j < damagecnt; ++j)
|
||||
damage += (pr_bfgspray() & 7) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if this is used, damagecnt will be ignored
|
||||
damage = defdamage;
|
||||
}
|
||||
|
||||
thingToHit = linetarget;
|
||||
int newdam = P_DamageMobj (thingToHit, self->target, self->target, damage, spray != NULL? FName(spray->DamageType) : FName(NAME_BFGSplash),
|
||||
|
|
|
@ -601,11 +601,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Jump)
|
|||
//==========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfHealthLower)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(health, 0);
|
||||
ACTION_PARAM_STATE(jump, 1);
|
||||
ACTION_PARAM_INT(ptr_selector, 2);
|
||||
|
||||
if (self->health < health) ACTION_JUMP(jump);
|
||||
AActor *measured;
|
||||
|
||||
measured = COPY_AAPTR(self, ptr_selector);
|
||||
|
||||
if (measured && measured->health < health)
|
||||
{
|
||||
ACTION_JUMP(jump);
|
||||
}
|
||||
|
||||
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
||||
}
|
||||
|
@ -1757,6 +1765,9 @@ enum SIX_Flags
|
|||
SIXF_TRANSFERSTENCILCOL = 1 << 17,
|
||||
SIXF_TRANSFERALPHA = 1 << 18,
|
||||
SIXF_TRANSFERRENDERSTYLE = 1 << 19,
|
||||
SIXF_SETTARGET = 1 << 20,
|
||||
SIXF_SETTRACER = 1 << 21,
|
||||
SIXF_NOPOINTERS = 1 << 22,
|
||||
};
|
||||
|
||||
static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
||||
|
@ -1813,13 +1824,12 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
|||
mo->Destroy();
|
||||
return false;
|
||||
}
|
||||
else if (originator)
|
||||
else if (originator && !(flags & SIXF_NOPOINTERS))
|
||||
{
|
||||
if (originator->flags3 & MF3_ISMONSTER)
|
||||
{
|
||||
// If this is a monster transfer all friendliness information
|
||||
mo->CopyFriendliness(originator, true);
|
||||
if (flags & SIXF_SETMASTER) mo->master = originator; // don't let it attack you (optional)!
|
||||
}
|
||||
else if (originator->player)
|
||||
{
|
||||
|
@ -1845,10 +1855,26 @@ static bool InitSpawnedItem(AActor *self, AActor *mo, int flags)
|
|||
// If this is a missile or something else set the target to the originator
|
||||
mo->target = originator ? originator : self;
|
||||
}
|
||||
if (flags & SIXF_NOPOINTERS)
|
||||
{
|
||||
//[MC]Intentionally eliminate pointers. Overrides TRANSFERPOINTERS, but is overridden by SETMASTER/TARGET/TRACER.
|
||||
mo->LastHeard = NULL; //Sanity check.
|
||||
mo->target = NULL;
|
||||
mo->master = NULL;
|
||||
mo->tracer = NULL;
|
||||
}
|
||||
if (flags & SIXF_SETMASTER)
|
||||
{
|
||||
mo->master = originator;
|
||||
}
|
||||
if (flags & SIXF_SETTARGET)
|
||||
{
|
||||
mo->target = originator;
|
||||
}
|
||||
if (flags & SIXF_SETTRACER)
|
||||
{
|
||||
mo->tracer = originator;
|
||||
}
|
||||
if (flags & SIXF_TRANSFERSCALE)
|
||||
{
|
||||
mo->scaleX = self->scaleX;
|
||||
|
@ -2658,69 +2684,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIf)
|
|||
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillMaster
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
P_DamageMobj(self->master, self, self, self->master->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillChildren
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillChildren)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor *mo;
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self)
|
||||
{
|
||||
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillSiblings
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor *mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self->master && mo != self)
|
||||
{
|
||||
P_DamageMobj(mo, self, self, mo->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_CountdownArg
|
||||
|
@ -3529,103 +3492,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetLOS)
|
|||
ACTION_JUMP(jump);
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_DamageMaster (int amount, str damagetype)
|
||||
// Damages the master of this child by the specified amount. Negative values heal.
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageMaster)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
if (amount > 0)
|
||||
{
|
||||
P_DamageMobj(self->master, self, self, amount, DamageType, DMG_NO_ARMOR);
|
||||
}
|
||||
else if (amount < 0)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(self->master, amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_DamageChildren (amount, str damagetype)
|
||||
// Damages the children of this master by the specified amount. Negative values heal.
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageChildren)
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * mo;
|
||||
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self)
|
||||
{
|
||||
if (amount > 0)
|
||||
{
|
||||
P_DamageMobj(mo, self, self, amount, DamageType, DMG_NO_ARMOR);
|
||||
}
|
||||
else if (amount < 0)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(mo, amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [KS] *** End of my modifications ***
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_DamageSiblings (int amount, str damagetype)
|
||||
// Damages the siblings of this master by the specified amount. Negative values heal.
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSiblings)
|
||||
{
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * mo;
|
||||
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self->master && mo != self)
|
||||
{
|
||||
if (amount > 0)
|
||||
{
|
||||
P_DamageMobj(mo, self, self, amount, DamageType, DMG_NO_ARMOR);
|
||||
}
|
||||
else if (amount < 0)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(mo, amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Modified code pointer from Skulltag
|
||||
|
@ -4521,7 +4387,8 @@ enum WARPF
|
|||
|
||||
WARPF_STOP = 0x80,
|
||||
WARPF_TOFLOOR = 0x100,
|
||||
WARPF_TESTONLY = 0x200
|
||||
WARPF_TESTONLY = 0x200,
|
||||
WARPF_ABSOLUTEPOSITION = 0x400,
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp)
|
||||
|
@ -4554,7 +4421,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp)
|
|||
{
|
||||
angle += (flags & WARPF_USECALLERANGLE) ? self->angle : reference->angle;
|
||||
}
|
||||
|
||||
if (!(flags & WARPF_ABSOLUTEPOSITION))
|
||||
{
|
||||
if (!(flags & WARPF_ABSOLUTEOFFSET))
|
||||
{
|
||||
angle_t fineangle = angle >> ANGLETOFINESHIFT;
|
||||
|
@ -4608,6 +4476,18 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Warp)
|
|||
reference->y + yofs,
|
||||
reference->z + zofs);
|
||||
}
|
||||
}
|
||||
else //[MC] The idea behind "absolute" is meant to be "absolute". Override everything, just like A_SpawnItemEx's.
|
||||
{
|
||||
if (flags & WARPF_TOFLOOR)
|
||||
{
|
||||
self->SetOrigin(xofs, yofs, self->floorz + zofs);
|
||||
}
|
||||
else
|
||||
{
|
||||
self->SetOrigin(xofs, yofs, zofs);
|
||||
}
|
||||
}
|
||||
|
||||
if ((flags & WARPF_NOCHECKPOSITION) || P_TestMobjLocation(self))
|
||||
{
|
||||
|
@ -4997,77 +4877,301 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetSpeed)
|
|||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_DamageSelf (int amount, str damagetype)
|
||||
// Damages the calling actor by the specified amount. Negative values heal.
|
||||
// Common A_Damage handler
|
||||
//
|
||||
// A_Damage* (int amount, str damagetype, int flags)
|
||||
// Damages the specified actor by the specified amount. Negative values heal.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
enum DMSS
|
||||
{
|
||||
DMSS_FOILINVUL = 1,
|
||||
DMSS_AFFECTARMOR = 2,
|
||||
DMSS_KILL = 4,
|
||||
};
|
||||
|
||||
static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageType, int flags)
|
||||
{
|
||||
if ((amount > 0) || (flags & DMSS_KILL))
|
||||
{
|
||||
if (!(dmgtarget->flags2 & MF2_INVULNERABLE) || (flags & DMSS_FOILINVUL))
|
||||
{
|
||||
if (flags & DMSS_KILL)
|
||||
{
|
||||
P_DamageMobj(dmgtarget, self, self, dmgtarget->health, DamageType, DMG_NO_FACTOR | DMG_NO_ARMOR | DMG_FOILINVUL);
|
||||
}
|
||||
if (flags & DMSS_AFFECTARMOR)
|
||||
{
|
||||
P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL);
|
||||
}
|
||||
else
|
||||
{
|
||||
//[MC] DMG_FOILINVUL is needed for making the damage occur on the actor.
|
||||
P_DamageMobj(dmgtarget, self, self, amount, DamageType, DMG_FOILINVUL | DMG_NO_ARMOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (amount < 0)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(dmgtarget, amount);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSelf)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
P_DamageMobj(self, self, self, amount, DamageType, DMG_NO_ARMOR);
|
||||
}
|
||||
else if (amount < 0)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(self, amount);
|
||||
}
|
||||
DoDamage(self, self, amount, DamageType, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_DamageTarget (int amount, str damagetype)
|
||||
// Damages the target of the actor by the specified amount. Negative values heal.
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageTarget)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
if (self->target != NULL)
|
||||
{
|
||||
|
||||
if (amount > 0)
|
||||
{
|
||||
P_DamageMobj(self->target, self, self, amount, DamageType, DMG_NO_ARMOR);
|
||||
}
|
||||
else if (amount < 0)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(self->target, amount);
|
||||
}
|
||||
}
|
||||
if (self->target != NULL) DoDamage(self->target, self, amount, DamageType, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_DamageTracer (int amount, str damagetype)
|
||||
// Damages the tracer of the actor by the specified amount. Negative values heal.
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageTracer)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
if (self->tracer != NULL) DoDamage(self->tracer, self, amount, DamageType, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageMaster)
|
||||
{
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
if (self->master != NULL) DoDamage(self->master, self, amount, DamageType, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageChildren)
|
||||
{
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * mo;
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self) DoDamage(mo, self, amount, DamageType, flags);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DamageSiblings)
|
||||
{
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_INT(amount, 0);
|
||||
ACTION_PARAM_NAME(DamageType, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor * mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
while ((mo = it.Next()))
|
||||
{
|
||||
if (mo->master == self->master && mo != self) DoDamage(mo, self, amount, DamageType, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_Kill*(damagetype, int flags)
|
||||
//
|
||||
//===========================================================================
|
||||
enum KILS
|
||||
{
|
||||
KILS_FOILINVUL = 1 << 0,
|
||||
KILS_KILLMISSILES = 1 << 1,
|
||||
KILS_NOMONSTERS = 1 << 2,
|
||||
};
|
||||
|
||||
static void DoKill(AActor *killtarget, AActor *self, FName damagetype, int flags)
|
||||
{
|
||||
if ((killtarget->flags & MF_MISSILE) && (flags & KILS_KILLMISSILES))
|
||||
{
|
||||
//[MC] Now that missiles can set masters, lets put in a check to properly destroy projectiles. BUT FIRST! New feature~!
|
||||
//Check to see if it's invulnerable. Disregarded if foilinvul is on, but never works on a missile with NODAMAGE
|
||||
//since that's the whole point of it.
|
||||
if ((!(killtarget->flags2 & MF2_INVULNERABLE) || (flags & KILS_FOILINVUL)) && !(killtarget->flags5 & MF5_NODAMAGE))
|
||||
{
|
||||
P_ExplodeMissile(self->target, NULL, NULL);
|
||||
}
|
||||
}
|
||||
if (!(flags & KILS_NOMONSTERS))
|
||||
{
|
||||
if (flags & KILS_FOILINVUL)
|
||||
{
|
||||
P_DamageMobj(killtarget, self, self, killtarget->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR | DMG_FOILINVUL);
|
||||
}
|
||||
else
|
||||
{
|
||||
P_DamageMobj(killtarget, self, self, killtarget->health, damagetype, DMG_NO_ARMOR | DMG_NO_FACTOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillTarget(damagetype, int flags)
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillTarget)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
if (self->target != NULL) DoKill(self->target, self, damagetype, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillTracer(damagetype, int flags)
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillTracer)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
if (self->tracer != NULL) DoKill(self->tracer, self, damagetype, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillMaster(damagetype, int flags)
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillMaster)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
if (self->master != NULL) DoKill(self->master, self, damagetype, flags);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillChildren(damagetype, int flags)
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillChildren)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor *mo;
|
||||
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self) DoKill(mo, self, damagetype, flags);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_KillSiblings(damagetype, int flags)
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KillSiblings)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_NAME(damagetype, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
||||
TThinkerIterator<AActor> it;
|
||||
AActor *mo;
|
||||
|
||||
if (self->master != NULL)
|
||||
{
|
||||
while ( (mo = it.Next()) )
|
||||
{
|
||||
if (mo->master == self->master && mo != self) DoKill(mo, self, damagetype, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_RemoveTarget
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_RemoveTarget)
|
||||
{
|
||||
if (self->target != NULL)
|
||||
{
|
||||
P_RemoveThing(self->target);
|
||||
}
|
||||
}
|
||||
|
||||
if (amount > 0)
|
||||
//===========================================================================
|
||||
//
|
||||
// A_RemoveTracer
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_RemoveTracer)
|
||||
{
|
||||
P_DamageMobj(self->tracer, self, self, amount, DamageType, DMG_NO_ARMOR);
|
||||
}
|
||||
else if (amount < 0)
|
||||
if (self->tracer != NULL)
|
||||
{
|
||||
amount = -amount;
|
||||
P_GiveBody(self->tracer, amount);
|
||||
}
|
||||
P_RemoveThing(self->tracer);
|
||||
}
|
||||
}
|
|
@ -70,7 +70,7 @@ ACTOR Actor native //: Thinker
|
|||
// End of MBF redundant functions.
|
||||
|
||||
action native A_MonsterRail();
|
||||
action native A_BFGSpray(class<Actor> spraytype = "BFGExtra", int numrays = 40, int damagecount = 15);
|
||||
action native A_BFGSpray(class<Actor> spraytype = "BFGExtra", int numrays = 40, int damagecount = 15, float angle = 90, float distance = 16*64, float vrange = 32, int damage = 0);
|
||||
action native A_Pain();
|
||||
action native A_NoBlocking();
|
||||
action native A_XScream();
|
||||
|
@ -204,7 +204,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, int spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0);
|
||||
action native A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0);
|
||||
action native A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = "", color color2 = "", int flags = 0, bool aim = false, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0);
|
||||
action native A_JumpIfHealthLower(int health, state label);
|
||||
action native A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
|
||||
action native A_JumpIfCloser(float distance, state label);
|
||||
action native A_JumpIfTracerCloser(float distance, state label);
|
||||
action native A_JumpIfMasterCloser(float distance, state label);
|
||||
|
@ -237,9 +237,9 @@ ACTOR Actor native //: Thinker
|
|||
action native A_RemoveMaster();
|
||||
action native A_RemoveChildren(bool removeall = false);
|
||||
action native A_RemoveSiblings(bool removeall = false);
|
||||
action native A_KillMaster(name damagetype = "none");
|
||||
action native A_KillChildren(name damagetype = "none");
|
||||
action native A_KillSiblings(name damagetype = "none");
|
||||
action native A_KillMaster(name damagetype = "none", int flags = 0);
|
||||
action native A_KillChildren(name damagetype = "none", int flags = 0);
|
||||
action native A_KillSiblings(name damagetype = "none", int flags = 0);
|
||||
action native A_RaiseMaster();
|
||||
action native A_RaiseChildren();
|
||||
action native A_RaiseSiblings();
|
||||
|
@ -275,9 +275,9 @@ ACTOR Actor native //: Thinker
|
|||
action native A_CheckLOF(state jump, int flags = 0, float range = 0, float minrange = 0, float angle = 0, float pitch = 0, float offsetheight = 0, float offsetwidth = 0, int ptr_target = AAPTR_DEFAULT);
|
||||
action native A_JumpIfTargetInLOS (state label, float fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0);
|
||||
action native A_JumpIfInTargetLOS (state label, float fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0);
|
||||
action native A_DamageMaster(int amount, name damagetype = "none");
|
||||
action native A_DamageChildren(int amount, name damagetype = "none");
|
||||
action native A_DamageSiblings(int amount, name damagetype = "none");
|
||||
action native A_DamageMaster(int amount, name damagetype = "none", int flags = 0);
|
||||
action native A_DamageChildren(int amount, name damagetype = "none", int flags = 0);
|
||||
action native A_DamageSiblings(int amount, name damagetype = "none", int flags = 0);
|
||||
action native A_SelectWeapon(class<Weapon> whichweapon);
|
||||
action native A_Punch();
|
||||
action native A_Feathers();
|
||||
|
@ -304,9 +304,13 @@ ACTOR Actor native //: Thinker
|
|||
action native A_SetDamageType(name damagetype);
|
||||
action native A_DropItem(class<Actor> item, int dropamount = -1, int chance = 256);
|
||||
action native A_SetSpeed(float speed);
|
||||
action native A_DamageSelf(int amount, name damagetype = "none");
|
||||
action native A_DamageTarget(int amount, name damagetype = "none");
|
||||
action native A_DamageTracer(int amount, name damagetype = "none");
|
||||
action native A_DamageSelf(int amount, name damagetype = "none", int flags = 0);
|
||||
action native A_DamageTarget(int amount, name damagetype = "none", int flags = 0);
|
||||
action native A_DamageTracer(int amount, name damagetype = "none", int flags = 0);
|
||||
action native A_KillTarget(name damagetype = "none", int flags = 0);
|
||||
action native A_KillTracer(name damagetype = "none", int flags = 0);
|
||||
action native A_RemoveTarget();
|
||||
action native A_RemoveTracer();
|
||||
|
||||
action native A_CheckSightOrRange(float distance, state label);
|
||||
action native A_CheckRange(float distance, state label);
|
||||
|
|
|
@ -46,27 +46,30 @@ const int FBF_NOFLASH = 16;
|
|||
const int FBF_NORANDOMPUFFZ = 32;
|
||||
|
||||
// Flags for A_SpawnItemEx
|
||||
const int SXF_TRANSFERTRANSLATION = 1;
|
||||
const int SXF_ABSOLUTEPOSITION = 2;
|
||||
const int SXF_ABSOLUTEANGLE = 4;
|
||||
const int SXF_ABSOLUTEMOMENTUM = 8;
|
||||
const int SXF_ABSOLUTEVELOCITY = 8;
|
||||
const int SXF_SETMASTER = 16;
|
||||
const int SXF_NOCHECKPOSITION = 32;
|
||||
const int SXF_TELEFRAG = 64;
|
||||
const int SXF_CLIENTSIDE = 128; // only used by Skulltag
|
||||
const int SXF_TRANSFERAMBUSHFLAG = 256;
|
||||
const int SXF_TRANSFERPITCH = 512;
|
||||
const int SXF_TRANSFERPOINTERS = 1024;
|
||||
const int SXF_USEBLOODCOLOR = 2048;
|
||||
const int SXF_CLEARCALLERTID = 4096;
|
||||
const int SXF_MULTIPLYSPEED = 8192;
|
||||
const int SXF_TRANSFERSCALE = 16384;
|
||||
const int SXF_TRANSFERSPECIAL = 32768;
|
||||
const int SXF_CLEARCALLERSPECIAL = 65536;
|
||||
const int SXF_TRANSFERSTENCILCOL = 131072;
|
||||
const int SXF_TRANSFERALPHA = 262144;
|
||||
const int SXF_TRANSFERRENDERSTYLE = 524288;
|
||||
const int SXF_TRANSFERTRANSLATION = 1 << 0;
|
||||
const int SXF_ABSOLUTEPOSITION = 1 << 1;
|
||||
const int SXF_ABSOLUTEANGLE = 1 << 2;
|
||||
const int SXF_ABSOLUTEMOMENTUM = 1 << 3; //Since "momentum" is declared to be deprecated in the expressions, for compatibility
|
||||
const int SXF_ABSOLUTEVELOCITY = 1 << 3; //purposes, this was made. It does the same thing though. Do not change the value.
|
||||
const int SXF_SETMASTER = 1 << 4;
|
||||
const int SXF_NOCHECKPOSITION = 1 << 5;
|
||||
const int SXF_TELEFRAG = 1 << 6;
|
||||
const int SXF_CLIENTSIDE = 1 << 7; // only used by Skulltag
|
||||
const int SXF_TRANSFERAMBUSHFLAG = 1 << 8;
|
||||
const int SXF_TRANSFERPITCH = 1 << 9;
|
||||
const int SXF_TRANSFERPOINTERS = 1 << 10;
|
||||
const int SXF_USEBLOODCOLOR = 1 << 11;
|
||||
const int SXF_CLEARCALLERTID = 1 << 12;
|
||||
const int SXF_MULTIPLYSPEED = 1 << 13;
|
||||
const int SXF_TRANSFERSCALE = 1 << 14;
|
||||
const int SXF_TRANSFERSPECIAL = 1 << 15;
|
||||
const int SXF_CLEARCALLERSPECIAL = 1 << 16;
|
||||
const int SXF_TRANSFERSTENCILCOL = 1 << 17;
|
||||
const int SXF_TRANSFERALPHA = 1 << 18;
|
||||
const int SXF_TRANSFERRENDERSTYLE = 1 << 19;
|
||||
const int SXF_SETTARGET = 1 << 20;
|
||||
const int SXF_SETTRACER = 1 << 21;
|
||||
const int SXF_NOPOINTERS = 1 << 22;
|
||||
|
||||
// Flags for A_Chase
|
||||
const int CHF_FASTCHASE = 1;
|
||||
|
@ -314,6 +317,7 @@ Const Int WARPF_COPYINTERPOLATION = 0x40;
|
|||
Const Int WARPF_STOP = 0x80;
|
||||
Const Int WARPF_TOFLOOR = 0x100;
|
||||
Const Int WARPF_TESTONLY = 0x200;
|
||||
Const Int WAPRF_ABSOLUTEPOSITION = 0x400;
|
||||
|
||||
// flags for A_SetPitch/SetAngle
|
||||
const int SPF_FORCECLAMP = 1;
|
||||
|
@ -360,6 +364,16 @@ enum
|
|||
CLOFF_NOAIM = CLOFF_NOAIM_VERT|CLOFF_NOAIM_HORZ
|
||||
};
|
||||
|
||||
// Flags for A_Kill (Master/Target/Tracer/Children/Siblings) series
|
||||
|
||||
const int KILS_FOILINVUL = 1;
|
||||
const int KILS_KILLMISSILES = 2;
|
||||
const int KILS_NOMONSTERS = 4;
|
||||
|
||||
// Flags for A_Damage (Master/Target/Tracer/Children/Siblings/Self) series
|
||||
const int DMSS_FOILINVUL = 1;
|
||||
const int DMSS_AFFECTARMOR = 2;
|
||||
const int DMSS_KILL = 4;
|
||||
|
||||
// Flags for A_AlertMonsters
|
||||
const int AMF_TARGETEMITTER = 1;
|
||||
|
|
Loading…
Reference in a new issue