Пример #1
0
        public bool UseItem(RandomGenerator random, Character src, List <Character> targets)
        {
            if (targets.Count == 1)
            {
                return(UseItem(random, src, targets.First()));
            }
            if (action == null)
            {
                return(false);
            }
            if (targetType != TargetType.All)
            {
                return(false);
            }

            if (src.items.Contains(this.code) &&
                src.ReduceForAction(0, 0, spNeed) &&
                src.ReduceItem(this.code))
            {
                foreach (Character target in targets)
                {
                    action(random, src, target);
                }
                return(true);
            }

            return(false);
        }
Пример #2
0
        public bool Act(RandomGenerator random, Character src, List <Character> targets)
        {
            if (targets.Count == 1)
            {
                return(Act(random, src, targets.First()));
            }

            if (targetType != TargetType.All)
            {
                return(false);
            }
            if (WeaponCheck(src))
            {
                return(false);
            }

            if (src.ReduceForAction(hpNeed, mpNeed, spNeed))
            {
                foreach (Character target in targets)
                {
                    action(random, src, target);
                }
                return(true);
            }

            return(false);
        }
Пример #3
0
        public bool Act(RandomGenerator random, Character src)
        {
            if (targetType != TargetType.None)
            {
                return(false);
            }
            if (WeaponCheck(src))
            {
                return(false);
            }

            if (src.ReduceForAction(hpNeed, mpNeed, spNeed))
            {
                return(action(random, src, null));
            }

            return(false);
        }
Пример #4
0
        public bool UseItem(RandomGenerator random, Character src)
        {
            if (action == null)
            {
                return(false);
            }
            if (targetType != TargetType.None)
            {
                return(false);
            }

            if (src.items.Contains(this.code) &&
                src.ReduceForAction(0, 0, spNeed) &&
                src.ReduceItem(this.code))
            {
                return(action(random, src, null));
            }

            return(false);
        }
Пример #5
0
        public bool Act(RandomGenerator random, Character src, Character target)
        {
            if (target == null)
            {
                return(Act(random, src));
            }

            if (targetType != TargetType.Single)
            {
                return(false);
            }
            if (!WeaponCheck(src))
            {
                return(false);
            }

            if (src.ReduceForAction(hpNeed, mpNeed, spNeed))
            {
                return(action(random, src, target));
            }

            return(false);
        }