Add option to toggle friendly fire.

This commit is contained in:
Mari the Deer 2022-08-17 17:34:15 +02:00
commit 283ebbda34
6 changed files with 31 additions and 2 deletions

View file

@ -28,6 +28,17 @@ Class SayaCollar : SWWMArmor
newdamage = splitdmg[0]+splitdmg[1];
}
}
// for friendly fire handling, jammed into here
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
{
int ff = swwm_friendlyfire;
if ( !source || !source.IsFriend(Owner) || !ff ) return;
// 1: block incoming friendly damage
// 2: also block outgoing friendly damage
if ( (passive && ff) || (!passive && (ff == 2)) )
newdamage = 0;
}
}
// high-resonant almasteel plating