コード例 #1
0
        static bool Prefix(TwoWeaponFightingDamagePenalty __instance, RuleCalculateWeaponStats evt)
        {
            ItemEntityWeapon maybeWeapon1 = evt.Initiator.Body.PrimaryHand.MaybeWeapon;
            ItemEntityWeapon maybeWeapon2 = evt.Initiator.Body.SecondaryHand.MaybeWeapon;

            var brawler_part = evt.Initiator?.Get <Brawler.UnitPartBrawler>();

            if ((brawler_part?.checkTwoWeapponFlurry()).GetValueOrDefault())
            {
                is_off_hand = false;
                return(false);
            }

            if (evt.Weapon == null ||
                maybeWeapon1 == null ||
                maybeWeapon2 == null ||
                (maybeWeapon1.Blueprint.IsNatural && (!maybeWeapon1.Blueprint.IsUnarmed || Aux.isMainHandUnarmedAndCanBeIgnored(maybeWeapon1.Blueprint, evt.Initiator.Descriptor))) ||
                (maybeWeapon2.Blueprint.IsNatural && (!maybeWeapon2.Blueprint.IsUnarmed || Aux.isOffHandUnarmedAndCanBeIgnored(maybeWeapon2.Blueprint, evt.Initiator.Descriptor))) ||
                maybeWeapon2 != evt.Weapon ||
                (bool)evt.Initiator.Descriptor.State.Features.DoubleSlice ||
                ((evt.Weapon?.Blueprint.IsUnarmed).GetValueOrDefault() && !is_off_hand)
                )
            {
                is_off_hand = false;
                return(false);
            }
            evt.SecondaryWeapon = true;
            is_off_hand         = false;
            return(false);
        }
コード例 #2
0
 private static bool considerUnarmedAndIgnore(BlueprintItemWeapon weapon, UnitDescriptor unit)
 {
     return(Aux.isMainHandUnarmedAndCanBeIgnored(weapon, unit));
 }
コード例 #3
0
 private static bool considerUnarmedAndIgnore(BlueprintItemWeapon weapon, RuleCalculateAttacksCount evt)
 {
     return(Aux.isMainHandUnarmedAndCanBeIgnored(weapon, evt.Initiator.Descriptor));
 }