コード例 #1
0
        public int?GetBaseAttackWithWeapon(Guid ownedItemId, List <int> baseAttack, Guid?primaryWeaponId, Guid?offHandWeapon)
        {
            var actionToUse = GetActionToUseWeapon(ownedItemId, baseAttack.Count, primaryWeaponId, offHandWeapon);

            if (actionToUse == null)
            {
                return(null);
            }

            var usedCount = UsedActions.Count(x => x.ActionUsedBy == ownedItemId);

            if (usedCount < baseAttack.Count)
            {
                return(baseAttack[usedCount]);
            }
            return(null);
        }
コード例 #2
0
        public RoundAction?GetActionToUseWeapon(Guid?itemKey, int numberOfAttacks, Guid?primaryWeaponId, Guid?offHandWeapon)
        {
            var usedCount = UsedActions.Count(x => x.ActionUsedBy == itemKey);

            if (usedCount == 0 && !UsedActions.Any(x => x.Action == RoundAction.Standard || x.Action == RoundAction.FullRound))
            {
                return(RoundAction.Standard);
            }
            else if (usedCount == 1 || (itemKey.HasValue && (itemKey == primaryWeaponId || itemKey == offHandWeapon)))
            {
                return(RoundAction.Move);
            }
            else if (usedCount > 1 && usedCount < numberOfAttacks)
            {
                return(RoundAction.Free);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
 public int GetAttacksTaken()
 {
     return(UsedActions.Count(x => x.ActionUsedBy != null));
 }