gzdoom-gles/wadsrc/static/zscript/strife/strifefunctions.txt

121 lines
2.5 KiB
Text
Raw Normal View History

// common Strife action functions.
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;
}
// A_ShootGun -------------------------------------------------------------
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");
}
// Kneeling Guy -------------------------------------------------------------
void A_SetShadow()
{
bShadow = true;
A_SetRenderStyle(HR_SHADOW, STYLE_Translucent);
}
void A_ClearShadow()
{
bShadow = false;
A_SetRenderStyle(1, STYLE_Normal);
}
void A_GetHurt()
{
bInCombat = true;
if ((random[HurtMe]() % 5) == 0)
{
A_PlaySound (PainSound, CHAN_VOICE);
health--;
}
if (health <= 0)
{
Die (target, target);
}
}
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');
}
}