예제 #1
0
        public BaseSkillActivation(BaseSkillActivation Clone)
        {
            ListRequirement = new List <BaseSkillRequirement>(Clone.ListRequirement.Count);
            foreach (BaseSkillRequirement ActiveRequirement in Clone.ListRequirement)
            {
                ListRequirement.Add(ActiveRequirement.Copy());
            }

            ListEffect = new List <BaseEffect>(Clone.ListEffect.Count);
            foreach (BaseEffect ActiveEffect in Clone.ListEffect)
            {
                ListEffect.Add(ActiveEffect.Copy());
            }

            ListEffectTarget = new List <List <string> >(Clone.ListEffectTarget.Count);
            foreach (List <string> ActiveEffectTarget in Clone.ListEffectTarget)
            {
                ListEffectTarget.Add(ActiveEffectTarget);
            }

            ListEffectTargetReal = new List <List <AutomaticSkillTargetType> >(Clone.ListEffectTargetReal.Count);
            foreach (List <AutomaticSkillTargetType> ActiveListEffectTargetReal in Clone.ListEffectTargetReal)
            {
                List <AutomaticSkillTargetType> ActiveAutomaticSkillTargetType = new List <AutomaticSkillTargetType>(ActiveListEffectTargetReal.Count);
                foreach (AutomaticSkillTargetType ActiveEffectTargetReal in ActiveListEffectTargetReal)
                {
                    ActiveAutomaticSkillTargetType.Add(ActiveEffectTargetReal.Copy());
                }
                ListEffectTargetReal.Add(ActiveAutomaticSkillTargetType);
            }

            _ActivationPercentage = Clone._ActivationPercentage;
        }
예제 #2
0
        public static BaseAutomaticSkill CreateDummy(string Name)
        {
            BaseAutomaticSkill NewSkill = new BaseAutomaticSkill();

            NewSkill.Name     = Name;
            NewSkill.FullName = Name;
            NewSkill.ListSkillLevel.Add(new BaseSkillLevel());
            NewSkill.CurrentLevel = 1;
            BaseSkillActivation NewActivation = new BaseSkillActivation();

            NewSkill.CurrentSkillLevel.ListActivation.Add(NewActivation);

            return(NewSkill);
        }
        public void AddSkillEffectsToTarget(string SkillRequirementToActivate)
        {
            //No activations remaining.
            if (CurrentSkillLevel.ActivationsCount == 0)
            {
                return;
            }

            BaseSkillActivation SkillActivation = null;

            for (int A = 0; A < CurrentSkillLevel.ListActivation.Count; A++)
            {
                bool HasActivated = CurrentSkillLevel.ListActivation[A].CanActivate(SkillRequirementToActivate, Name);

                if (HasActivated)
                {
                    if (CurrentSkillLevel.ListActivation[A].Weight == -1)
                    {
                        CurrentSkillLevel.ListActivation[A].Activate(Name);
                    }
                    else if (SkillActivation == null || CurrentSkillLevel.ListActivation[A].Weight > SkillActivation.Weight)
                    {
                        SkillActivation = CurrentSkillLevel.ListActivation[A];
                    }

                    if (CurrentSkillLevel.ActivationsCount > 0)
                    {
                        CurrentSkillLevel.ActivationsCount--;
                    }
                }
            }

            if (SkillActivation != null)
            {
                SkillActivation.Activate(Name);
            }
        }