A_CustomPunch Extension
- Added Melee/Miss parameters just like A_CustomMeleeAttack.
This commit is contained in:
parent
f4a60f29f3
commit
8594bfaa8b
2 changed files with 10 additions and 3 deletions
|
|
@ -1414,6 +1414,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
ACTION_PARAM_FIXED(LifeSteal, 5);
|
||||
ACTION_PARAM_INT(lifestealmax, 6);
|
||||
ACTION_PARAM_CLASS(armorbonustype, 7);
|
||||
ACTION_PARAM_SOUND(MeleeSound, 8);
|
||||
ACTION_PARAM_SOUND(MissSound, 9);
|
||||
|
||||
if (!self->player) return;
|
||||
|
||||
|
|
@ -1443,7 +1445,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
|
||||
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage);
|
||||
|
||||
if (linetarget)
|
||||
if (!linetarget)
|
||||
{
|
||||
if (MissSound) S_Sound(self, CHAN_WEAPON, MissSound, 1, ATTN_NORM);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN))
|
||||
{
|
||||
|
|
@ -1474,7 +1480,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
|
|||
|
||||
if (weapon != NULL)
|
||||
{
|
||||
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
|
||||
if (MeleeSound) S_Sound(self, CHAN_WEAPON, MeleeSound, 1, ATTN_NORM);
|
||||
else S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
if (!(flags & CPF_NOTURN))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue