Пример #1
0
        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));
        }
Пример #2
0
        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);
        }