Changes needed to integrate the Darkness Warlord character with UFPS:
Make this change to DamageOnCollision.cs:
// DamageMessage tDamage = new DamageMessage() { damageGiver = tGiver, damageAmount = DamageAmount };
// aOtherCollider.gameObject.SendMessageUpwards("Damage", tDamage, SendMessageOptions.DontRequireReceiver);
vp_DamageInfo tDamage = new vp_DamageInfo(DamageAmount, tGiver.transform, tGiver.transform, vp_DamageInfo.DamageType.Impact);
aOtherCollider.gameObject.SendMessageUpwards("Damage", tDamage, SendMessageOptions.DontRequireReceiver);
Add this to DamageMessageReceiver.cs
public virtual void Damage(vp_DamageInfo aDamageMessage)
{
CurrentDamage += aDamageMessage.Damage;
}
Add this to AIDamageReceiver.cs
public override void Damage(vp_DamageInfo aDamageMessage)
{
base.Damage(aDamageMessage);
if ((HealthElement != null) && (aDamageMessage.Damage > 0))
{
if ((aDamageMessage.OriginalSource != null) && (aDamageMessage.OriginalSource.IsChildOf(HealthElement.AI.Body.transform)))
return;
object tEnemy = HealthElement.AI.WorkingMemory.GetItem<object>("currentEnemy");
if (tEnemy == null)
{
HealthElement.AI.WorkingMemory.SetItem<CreatureAspect>("currentEnemy", FindAliveCreatureAspect(aDamageMessage.OriginalSource.gameObject));
}
}
}