2016-11-29 12:28:43 +00:00
|
|
|
// common Strife action functions that are used by multiple different actors
|
2016-11-28 22:30:14 +00:00
|
|
|
|
|
|
|
extend class Actor
|
|
|
|
{
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
void A_FLoopActiveSound()
|
|
|
|
{
|
|
|
|
if (ActiveSound != 0 && !(level.time & 7))
|
|
|
|
{
|
|
|
|
A_PlaySound (ActiveSound, CHAN_VOICE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void A_LoopActiveSound()
|
|
|
|
{
|
|
|
|
A_PlaySound(ActiveSound, CHAN_VOICE, 1, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
void A_Countdown()
|
|
|
|
{
|
|
|
|
if (--reactiontime <= 0)
|
|
|
|
{
|
|
|
|
ExplodeMissile ();
|
|
|
|
bSkullFly = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// A_ClearSoundTarget
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
void A_ClearSoundTarget()
|
|
|
|
{
|
|
|
|
CurSector.SoundTarget = null;
|
|
|
|
for (Actor mo = CurSector.thinglist; mo != null; mo = mo.snext)
|
|
|
|
{
|
|
|
|
mo.LastHeard = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// A_TossGib
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void A_TossGib()
|
|
|
|
{
|
|
|
|
class <Actor> gibtype;
|
|
|
|
if (bNoBlood) gibtype = "Junk";
|
|
|
|
else gibtype = "Meat";
|
|
|
|
Actor gib = Spawn (gibtype, pos + (0,0,24), ALLOW_REPLACE);
|
|
|
|
|
|
|
|
if (gib == null)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
gib.Angle = random[GibTosser]() * (360 / 256.f);
|
|
|
|
gib.VelFromAngle(random[GibTosser]() & 15);
|
|
|
|
gib.Vel.Z = random[GibTosser]() & 15;
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:00:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2016-11-28 22:30:14 +00:00
|
|
|
|
|
|
|
void A_ShootGun()
|
|
|
|
{
|
|
|
|
if (!target) return;
|
|
|
|
A_PlaySound ("monsters/rifle", CHAN_WEAPON);
|
|
|
|
A_FaceTarget ();
|
|
|
|
double pitch = AimLineAttack (angle, MISSILERANGE);
|
|
|
|
LineAttack (Angle + Random2[ShootGun]() * (11.25 / 256), MISSILERANGE, pitch, 3*(random[ShootGun]() % 5 + 1), 'Hitscan', "StrifePuff");
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:00:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2016-11-28 22:30:14 +00:00
|
|
|
|
|
|
|
void A_SetShadow()
|
|
|
|
{
|
|
|
|
bShadow = true;
|
|
|
|
A_SetRenderStyle(HR_SHADOW, STYLE_Translucent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void A_ClearShadow()
|
|
|
|
{
|
|
|
|
bShadow = false;
|
|
|
|
A_SetRenderStyle(1, STYLE_Normal);
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:00:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-11-28 22:30:14 +00:00
|
|
|
void A_GetHurt()
|
|
|
|
{
|
|
|
|
bInCombat = true;
|
|
|
|
if ((random[HurtMe]() % 5) == 0)
|
|
|
|
{
|
|
|
|
A_PlaySound (PainSound, CHAN_VOICE);
|
|
|
|
health--;
|
|
|
|
}
|
|
|
|
if (health <= 0)
|
|
|
|
{
|
|
|
|
Die (target, target);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:00:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-11-28 22:30:14 +00:00
|
|
|
void A_DropFire()
|
|
|
|
{
|
|
|
|
Actor drop = Spawn("FireDroplet", pos + (0,0,24), ALLOW_REPLACE);
|
|
|
|
drop.Vel.Z = -1.;
|
|
|
|
A_Explode(64, 64, XF_NOSPLASH, damagetype: 'Fire');
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:00:07 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-11-28 23:16:30 +00:00
|
|
|
void A_RemoveForceField()
|
|
|
|
{
|
|
|
|
bSpecial = false;
|
|
|
|
CurSector.RemoveForceField();
|
|
|
|
}
|
2016-11-29 12:00:07 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void A_AlertMonsters(double maxdist = 0, int flags = 0)
|
|
|
|
{
|
|
|
|
Actor target = null;
|
|
|
|
Actor emitter = self;
|
|
|
|
|
|
|
|
if (player != null || (Flags & AMF_TARGETEMITTER))
|
|
|
|
{
|
|
|
|
target = self;
|
|
|
|
}
|
2016-12-12 11:50:17 +00:00
|
|
|
else if (self.target != null && (self.target.player != null || (Flags & AMF_TARGETNONPLAYER)))
|
2016-11-29 12:00:07 +00:00
|
|
|
{
|
|
|
|
target = self.target;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Flags & AMF_EMITFROMTARGET) emitter = target;
|
|
|
|
|
|
|
|
if (target != null && emitter != null)
|
|
|
|
{
|
2016-12-11 11:10:05 +00:00
|
|
|
emitter.SoundAlert(target, false, maxdist);
|
2016-11-29 12:00:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:28:43 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// A_RocketInFlight
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
void A_RocketInFlight()
|
|
|
|
{
|
|
|
|
A_PlaySound ("misc/missileinflight", CHAN_VOICE);
|
|
|
|
SpawnPuff ("MiniMissilePuff", Pos, Angle - 180, Angle - 180, 2, PF_HITTHING);
|
|
|
|
Actor trail = Spawn("RocketTrail", Vec3Offset(-Vel.X, -Vel.Y, 0.), ALLOW_REPLACE);
|
|
|
|
if (trail != null)
|
|
|
|
{
|
|
|
|
trail.Vel.Z = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-29 12:00:07 +00:00
|
|
|
|
2016-11-28 22:30:14 +00:00
|
|
|
}
|