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:
Moderator: GZDoom Developers
Spoiler:
Code: Select all
override int SpecialMissileHit (Actor victim)
{
if (victim)
{
if (victim.InStateSequence(victim.CurState, victim.ResolveState("Ice")))
{
return 0;
}
}
return -1;
}
Code: Select all
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;
}
}
Spoiler:I make some research:
Code: Select all
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;
}
if (damage < 0) damage = 0;
That won't work. It completely misses the generic ice death case. The proper bit to check is bIceCorpse.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.
Something like this (untested):
Code: Select all
override int SpecialMissileHit (Actor victim) { if (victim) { if (victim.InStateSequence(victim.CurState, victim.ResolveState("Ice"))) { return 0; } } return -1; }
Code: Select all
override int SpecialMissileHit (Actor victim)
{
if (victim)
{
if (victim.bIceCorpse == true)
{
SetStateLabel("Death");
return 1;
}
}
return -1;
}
Code: Select all
class blockstun2 : actor
{
default
{
+NOBLOCKMAP;
+NOGRAVITY ;
+BLOODLESSIMPACT;
+CAUSEPAIN;
+DONTSPLASH;
damagetype "stun";
Radius 10;
Height 20;
Speed 30 ;
Damage 0;
Projectile;
+THRUGHOST;
}
States
{
Spawn:
DHFX A 2 Bright;
DHFX B 2 Bright ;
DHFX CDEFGH 2 Bright;
Loop;
Death:
FHFX STUVW 4;
Stop;
}
override int SpecialMissileHit (Actor victim)
{
if (victim)
{
if (victim.bIceCorpse == true)
{
return 0;
}
}
return -1;
}
}