Because I want to make a mutator that makes it so it's always possible to gib someone no matter what weapon you use.
EDIT: I see there is no way to make this work "properly" but I managed to hack it in anyways
Code: Select all
//=============================================================================
// AlwaysGibMutator.
// You always have a chance to gibb someone no matter what type of damage you cause to them.
//=============================================================================
class AlwaysGibMutator expands Mutator;
var transient private Pawn LastHitCheck;
event PreBeginPlay()
{
LastHitCheck = None;
}
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if( Other.IsA('Weapon') )
{
Weapon(Other).MyDamageType = 'All';
Weapon(Other).AltDamageTYpe = 'All';
}
return true;
}
function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation,
out Vector Momentum, name DamageType)
{
local int Dam;
local vector Mom;
if( (Victim != None) && (Victim != LastHitCheck) )
{
LastHitCheck = Victim;
Dam = ActualDamage;
Mom = Momentum;
ActualDamage = 0;
Momentum = vect(0.0,0.0,0.0);
DamageType = 'All';
Victim.TakeDamage( Dam, InstigatedBy, HitLocation, Mom, 'All');
LastHitCheck = None;
}
if ( NextDamageMutator != None )
NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, 'All' );
}