no extreme death for weapon using with Zscript

Thu Sep 09, 2021 2:55 pm

Im using zcript to simulate autoaim melee attack, ala hexen.

my melee weapons are doing lots of damage to a stun enemies (as intended), but this gib them, which looks odd when you poke monster with sitck and he explode in fountain of blood.
Spoiler:


I was trying without a success to prevent certain weak melee weapon to ever deal XDeath to enemies. Any ideas how to achieve it?

Adding this flag doesnt work, check all code below
NOEXTREMEDEATH
This projectile or puff never gibs its victim.


==========================

i put this in weapon attack sprite seqeunce block instead A_Custompunch
Code:
stff m 3 A_GiveInventory ("Func_StaffAttack")


decorate "function"
Code:
    Actor Func_StaffAttack : HexenMeleeWeapon
    {
       States
       {
       Pickup:
         TNT1 A 0 A_HexenPunch(random(20, 35),100, "staffpuff3")
          Stop
       }
    }

ACTOR staffpuff3 : StaffPuff
{
   +NOEXTREMEDEATH
}



zscript (full):
Code:
class HexenMeleeWeapon  : CustomInventory
{
 


    private action bool TryPunch(double angle, int damage, int power, int range, class<Actor> pufftype)
    {
        Class<Actor> pufftype;
        FTranslatedLineTarget t;

        double slope = AimLineAttack (angle, range, t, 0., ALF_CHECK3D);
        if (t.linetarget != null)
        {
            LineAttack (angle, range, slope, damage, 'Melee', pufftype, true, t);
            if (t.linetarget != null)
            {
                // The mass threshold has been changed to CommanderKeen's value which has been used most often for 'unmovable' stuff.
                if (t.linetarget.player != null || (t.linetarget.Mass < 10000000 && (t.linetarget.bIsMonster)))
                {
                    if (!t.linetarget.bDontThrust)
                    {
                        t.linetarget.Thrust(power, t.attackAngleFromSource);
                    }
                }
                AdjustPlayerAngle(t);
                return true;
            }
        }
        return false;
    }

    action void A_HexenPunch(int damage, int range = 0, class<Actor> pufftype = 'StaffPuff', sound hitsound = "", sound misssound = "")
    {
        if (player == null)
        {
            return;
        }

        if (range == 0)
        {
            range = DEFMELEERANGE;
        }

        if (pufftype == null)
        {
            pufftype = 'StaffPuff';
        }

        for (int i = 0; i < 16; i++)
        {
            if (TryPunch(angle + i*(45./16), damage, 2, range, pufftype) || TryPunch(angle - i*(45./16), damage, 2, range, pufftype))
            {
                // hit something           
                A_StartSound (hitsound, CHAN_WEAPON);
                return;
            }
        }

        A_StartSound (misssound, CHAN_WEAPON);
        double slope = AimLineAttack (angle, range, null, 0., ALF_CHECK3D);
        LineAttack (angle, range, slope, damage, 'Melee', pufftype, true);
    }
}