private static bool ShouldSetStunned(Character character, Tameable tameable, HitData hit) { bool tameIsEssential = (TameableMortalityTypes)Configuration.Current.Tameable.mortality == TameableMortalityTypes.Essential; bool tameShouldBeDead = character.GetHealth() <= 0f; bool tameOwnerDamageOverride = Configuration.Current.Tameable.ownerDamageOverride; Character attacker = hit.GetAttacker(); bool tameAttackerIsOwner = attacker == tameable.GetPlayer(attacker.GetZDOID()); return(tameIsEssential && tameShouldBeDead && !(tameOwnerDamageOverride && tameAttackerIsOwner)); }
private static bool ShouldIgnoreDamage(Character tame, Tameable tameable, HitData hit, ZDO zdo) { bool tameIsImmortal = (TameableMortalityTypes)Configuration.Current.Tameable.mortality == TameableMortalityTypes.Immortal; bool tameOwnerDamageOverride = Configuration.Current.Tameable.ownerDamageOverride; Character attacker = hit.GetAttacker(); bool tameAttackerIsOwner = attacker == tameable.GetPlayer(attacker.GetZDOID()); bool tameIsRecoveringFromStun = zdo.GetBool("isRecoveringFromStun"); return((tameIsImmortal && !(tameOwnerDamageOverride && tameAttackerIsOwner)) || tameIsRecoveringFromStun); }