mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- scriptified some simple sound functions.
This commit is contained in:
parent
fb91982da2
commit
c14b7f58d3
2 changed files with 26 additions and 50 deletions
|
@ -3157,51 +3157,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_Scream)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
if (self->DeathSound)
|
||||
{
|
||||
// Check for bosses.
|
||||
if (self->flags2 & MF2_BOSS)
|
||||
{
|
||||
// full volume
|
||||
S_Sound (self, CHAN_VOICE, self->DeathSound, 1, ATTN_NONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_Sound (self, CHAN_VOICE, self->DeathSound, 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_XScream)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
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;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_ActiveSound
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_ActiveSound)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
if (self->ActiveSound)
|
||||
{
|
||||
S_Sound(self, CHAN_VOICE, self->ActiveSound, 1, ATTN_NORM);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Modifies the drop amount of this item according to the current skill's
|
||||
|
|
|
@ -968,10 +968,8 @@ class Actor : Thinker native
|
|||
native void A_Pain();
|
||||
native void A_NoBlocking(bool drop = true);
|
||||
void A_Fall() { A_NoBlocking(); }
|
||||
native void A_XScream();
|
||||
native void A_Look();
|
||||
native void A_Chase(statelabel melee = null, statelabel missile = null, int flags = 0x40000000);
|
||||
native void A_Scream();
|
||||
native void A_VileChase();
|
||||
native bool A_CheckForResurrection();
|
||||
native void A_BossDeath();
|
||||
|
@ -980,9 +978,6 @@ class Actor : Thinker native
|
|||
return Level.ExecuteSpecial(special, self, null, false, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
|
||||
|
||||
native void A_ActiveSound();
|
||||
|
||||
native void A_FastChase();
|
||||
native void A_PlayerScream();
|
||||
native void A_SkullPop(class<PlayerChunk> skulltype = "BloodySkull");
|
||||
|
@ -1151,6 +1146,32 @@ class Actor : Thinker native
|
|||
return ACS_ExecuteWithResult(-int(script), arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Sounds
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void A_Scream()
|
||||
{
|
||||
if (DeathSound)
|
||||
{
|
||||
A_PlaySound(DeathSound, CHAN_VOICE, 1, false, bBoss? ATTN_NONE : ATTN_NORM);
|
||||
}
|
||||
}
|
||||
|
||||
void A_XScream()
|
||||
{
|
||||
A_PlaySound(player? Sound("*gibbed") : Sound("misc/gibbed"), CHAN_VOICE);
|
||||
}
|
||||
|
||||
void A_ActiveSound()
|
||||
{
|
||||
if (ActiveSound)
|
||||
{
|
||||
A_PlaySound(ActiveSound, CHAN_VOICE);
|
||||
}
|
||||
}
|
||||
|
||||
States(Actor, Overlay, Weapon, Item)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue