[solved]How to prevent projectle from shattering Ice Corpse?
Posted: Fri Nov 20, 2020 12:58 pm
by Lagi
how do i set some projectiles to not affect ice corpse? I cannot use damage type ice, because Im using different custom damage type.
when I freeze monsters they corpse are resistant to ice projectiles - thats fine.
problem is I have a "block/stun" projectile, that should not shatter ice corpse, as well.
Spoiler:
Re: How to prevent projectile from shattering Ice Corpse?
Posted: Sat Nov 21, 2020 2:26 am
by Kzer-Za
Maybe there is a simpler way, then someone will correct me, but I think that you could try overriding SpecialMissileHit in the stunner projectile class.
class blockstun : actor
{
default
{
+NOBLOCKMAP;
+NOGRAVITY ;
+BLOODLESSIMPACT;
+CAUSEPAIN;
+DONTSPLASH;
damagetype "stun";
}
override int SpecialMissileHit (Actor victim)
{
if (victim)
{
if (victim.InStateSequence(victim.CurState, victim.ResolveState("Ice")))
{
return 0;
}
}
return -1;
}
}
above dont work any different, than decorate
Spoiler:
int SpecialMissileHit(Actor victim)
Called when a missile hits an actor. This is called after all other collision checks. Returning one of the following values will determine what the missile does next:
1: The missile ignores the actor
0: The missile hits but does no special behavior (e.g. won't deal damage, explode, etc.)
-1: Uses standard missile hit behavior
if (target->health <= 0)
{
if (inflictor && mod == NAME_Ice && !(inflictor->flags7 & MF7_ICESHATTER))
{
return -1;
}
else if (target->flags & MF_ICECORPSE) // frozen
{
target->tics = 1;
target->flags6 |= MF6_SHATTERING;
target->Vel.Zero();
}
return -1;
}
return -1, mean the damage is cancelled. Too bad if damage is 0 or lower, it will still shatter the ice.
if (damage < 0) damage = 0;
Re: How to prevent projectile from shattering Ice Corpse?
Posted: Sat Nov 21, 2020 5:10 am
by Graf Zahl
Kzer-Za wrote:Maybe there is a simpler way, then someone will correct me, but I think that you could try overriding SpecialMissileHit in the stunner projectile class.