public ManualSkill(string SkillPath, Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect)
        {
            _CanActivate = false;
            IsUnlocked   = false;

            FullName = SkillPath.Substring(0, SkillPath.Length - 5).Substring(27);
            Name     = Path.GetFileNameWithoutExtension(SkillPath);

            FileStream   FS = new FileStream(SkillPath, FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);

            Range  = BR.ReadInt32();
            Target = ManualSkillTarget.LoadCopy(BR);

            Description = BR.ReadString();

            int ListEffectCount = BR.ReadInt32();

            ListEffect = new List <BaseEffect>(ListEffectCount);
            for (int i = 0; i < ListEffectCount; i++)
            {
                ListEffect.Add(BaseEffect.FromFile(BR, DicRequirement, DicEffect));
            }

            FS.Close();
            BR.Close();
        }
        public static ManualSkillTarget LoadCopy(BinaryReader BR)
        {
            string TargetType = BR.ReadString();

            ManualSkillTarget NewManualSkillTarget = DicManualSkillTarget[TargetType].Copy();

            return(NewManualSkillTarget);
        }
示例#3
0
 public SelectSkillTargetScreen(DeathmatchMap Map, ManualSkill ActiveSkill, Character SkillPilot, Unit SkillUnit, Squad SkillSquad, DeathmatchContext Context, ManualSkillTarget Owner)
 {
     this.Map         = Map;
     this.ActiveSkill = ActiveSkill;
     this.SkillPilot  = SkillPilot;
     this.SkillUnit   = SkillUnit;
     this.SkillSquad  = SkillSquad;
     this.Context     = Context;
     this.Owner       = Owner;
 }
        public void ReloadSkills(Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect, Dictionary <string, ManualSkillTarget> DicTarget)
        {
            Target = DicTarget[Target.TargetType].Copy();


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

                foreach (BaseAutomaticSkill ActiveFollowingSkill in ListEffect[E].ListFollowingSkill)
                {
                    ActiveFollowingSkill.ReloadSkills(DicRequirement, DicEffect);
                }
            }
        }