Exemplo n.º 1
0
        public BaseSkillActivation(BinaryReader BR)
        {
            ActivationPercentage = BR.ReadByte();

            //Requirements
            int ListRequirementCount = BR.ReadInt32();

            ListRequirement = new List <BaseSkillRequirement>(ListRequirementCount);
            for (int R = 0; R < ListRequirementCount; R++)
            {
                ListRequirement.Add(BaseSkillRequirement.LoadCopy(BR));
            }

            //Effects.
            int ListEffectCount = BR.ReadInt32();

            ListEffect       = new List <BaseEffect>(ListEffectCount);
            ListEffectTarget = new List <List <string> >(ListEffectCount);
            for (int E = 0; E < ListEffectCount; E++)
            {
                int ListActivationTypesCount = BR.ReadInt32();

                List <string> NewListActivationType = new List <string>(ListActivationTypesCount);
                for (int A = 0; A < ListActivationTypesCount; A++)
                {
                    NewListActivationType.Add(BR.ReadString());
                }

                ListEffectTarget.Add(NewListActivationType);

                ListEffect.Add(BaseEffect.FromFile(BR));
            }
        }
        public static BaseSkillRequirement LoadCopy(BinaryReader BR, Dictionary <string, BaseSkillRequirement> DicRequirement)
        {
            string RequirementType = BR.ReadString();
            BaseSkillRequirement NewSkillRequirement = DicRequirement[RequirementType].Copy();

            NewSkillRequirement.Load(BR);

            return(NewSkillRequirement);
        }
Exemplo n.º 3
0
        public BaseSkillActivation(BinaryReader BR, Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect,
                                   Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget)
        {
            ActivationPercentage = BR.ReadByte();
            _Weight = BR.ReadInt32();

            //Requirements
            int ListRequirementCount = BR.ReadInt32();

            ListRequirement = new List <BaseSkillRequirement>(ListRequirementCount);
            for (int R = 0; R < ListRequirementCount; R++)
            {
                ListRequirement.Add(BaseSkillRequirement.LoadCopy(BR, DicRequirement));
            }

            //Effects.
            int ListEffectCount = BR.ReadInt32();

            ListEffect           = new List <BaseEffect>(ListEffectCount);
            ListEffectTarget     = new List <List <string> >(ListEffectCount);
            ListEffectTargetReal = new List <List <AutomaticSkillTargetType> >(ListEffectCount);
            for (int E = 0; E < ListEffectCount; E++)
            {
                int ListActivationTypesCount = BR.ReadInt32();

                List <string> NewListActivationType = new List <string>(ListActivationTypesCount);
                List <AutomaticSkillTargetType> NewListEffectTargetReal = new List <AutomaticSkillTargetType>(ListActivationTypesCount);
                for (int A = 0; A < ListActivationTypesCount; A++)
                {
                    string ListActivationType = BR.ReadString();
                    NewListActivationType.Add(ListActivationType);
                    NewListEffectTargetReal.Add(DicAutomaticSkillTarget[ListActivationType].Copy());
                }

                ListEffectTarget.Add(NewListActivationType);
                ListEffectTargetReal.Add(NewListEffectTargetReal);

                ListEffect.Add(BaseEffect.FromFile(BR, DicRequirement, DicEffect, DicAutomaticSkillTarget));
            }
        }
        public void ReloadSkills(Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect, Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget)
        {
            foreach (BaseSkillLevel ActiveSkillLevel in ListSkillLevel)
            {
                foreach (BaseSkillActivation ActiveActivation in ActiveSkillLevel.ListActivation)
                {
                    for (int R = 0; R < ActiveActivation.ListRequirement.Count; R++)
                    {
                        BaseSkillRequirement NewRequirement = DicRequirement[ActiveActivation.ListRequirement[R].SkillRequirementName].Copy();
                        NewRequirement.CopyMembers(ActiveActivation.ListRequirement[R]);
                        ActiveActivation.ListRequirement[R] = NewRequirement;
                    }

                    ActiveActivation.ListEffectTargetReal.Clear();
                    foreach (List <string> ListActiveTarget in ActiveActivation.ListEffectTarget)
                    {
                        List <AutomaticSkillTargetType> NewListEffectTargetReal = new List <AutomaticSkillTargetType>(ListActiveTarget.Count);
                        ActiveActivation.ListEffectTargetReal.Add(NewListEffectTargetReal);
                        foreach (string ActiveTarget in ListActiveTarget)
                        {
                            NewListEffectTargetReal.Add(DicAutomaticSkillTarget[ActiveTarget].Copy());
                        }
                    }

                    for (int E = 0; E < ActiveActivation.ListEffect.Count; E++)
                    {
                        BaseEffect NewEffect = DicEffect[ActiveActivation.ListEffect[E].EffectTypeName].Copy();
                        NewEffect.CopyMembers(ActiveActivation.ListEffect[E]);
                        ActiveActivation.ListEffect[E] = NewEffect;

                        foreach (BaseAutomaticSkill ActiveFollowingSkill in ActiveActivation.ListEffect[E].ListFollowingSkill)
                        {
                            ActiveFollowingSkill.ReloadSkills(DicRequirement, DicEffect, DicAutomaticSkillTarget);
                        }
                    }
                }
            }
        }
 public override void CopyMembers(BaseSkillRequirement Copy)
 {
 }
Exemplo n.º 6
0
 public abstract void CopyMembers(BaseSkillRequirement Copy);