示例#1
0
        private IPrototype GetLifeAltar(int[] position)
        {
            MainTag mt = MainTag.Altar;
            SubTag  st = SubTag.LifeAltar;

            return(new ProtoObject(mt, st, position));
        }
示例#2
0
        private void PCMove_PlayerCommanding(object sender,
                                             PlayerCommandingEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }
            if (!IsValidCommand(e.Command))
            {
                return;
            }

            int[] source = GetComponent <MetaInfo>().Position;
            int[] target = GetNewPosition(source, e.Command);

            if (!GetComponent <LocalManager>().IsPassable(target))
            {
                return;
            }

            ActionTag action  = ActionTag.Move;
            MainTag   mainTag = GetComponent <MetaInfo>().MainTag;
            SubTag    subTag  = GetComponent <MetaInfo>().SubTag;
            int       id      = GetComponent <MetaInfo>().ObjectID;

            GetComponent <LocalManager>().SetPosition(target);
            GetComponent <LocalManager>().TakenAction(
                new TakenActionEventArgs(action, mainTag, subTag, id));
            GameCore.AxeManCore.GetComponent <TileOverlay>().TryHideTile(source);
            GameCore.AxeManCore.GetComponent <TileOverlay>().TryHideTile(target);
        }
示例#3
0
        private void LoadActorData()
        {
            string character = "charactorData.xml";
            string altar     = "altarData.xml";
            string trap      = "trapData.xml";
            string directory = "Data";

            MainTag[] mainTags = new MainTag[]
            {
                MainTag.Actor,
                MainTag.Altar,
                MainTag.Floor,
                MainTag.Trap
            };
            string[] files = new string[]
            {
                character,
                altar,
                trap,
                trap
            };

            for (int i = 0; i < mainTags.Length; i++)
            {
                mainTagXElement[mainTags[i]]
                    = GetComponent <SaveLoadXML>().Load(files[i], directory);
            }
        }
示例#4
0
文件: ID3v2.cs 项目: CaLink/ID3_Test
        void GetFrame_v34(BinaryReader br)
        {
            int findAll = 0;

            byte[] id = new byte[4];
            ByteReader(id, br);
            string temp = GetContent(id);

            while (findAll != 6 && ((br.BaseStream.Length - br.BaseStream.Position) >= 4))
            {
                switch (temp)
                {
                case "TRCK": TRCK = new MainTag(br, id); findAll++; TRCK.WriteInfo(); break;

                case "TIT2": TIT2 = new MainTag(br, id); findAll++; TIT2.WriteInfo(); break;

                case "TPE1": TPE1 = new MainTag(br, id); findAll++; TPE1.WriteInfo(); break;

                case "TALB": TALB = new MainTag(br, id); findAll++; TALB.WriteInfo(); break;

                case "TYER": TYER = new MainTag(br, id); findAll++; TYER.WriteInfo(); break;

                case "TCON": TCON = new TCON(br, id); findAll++; TCON.WriteInfo(); break;
                }

                id[0] = id[1];
                id[1] = id[2];
                id[2] = id[3];
                id[3] = br.ReadByte();
                temp  = GetContent(id);
            }
        }
示例#5
0
        public GameObject[] Search(MainTag mainTag)
        {
            Stack <GameObject> data = new Stack <GameObject>();
            var ea = new SearchingMainTagEventArgs(mainTag, data);

            OnSearchingMainTag(ea);
            return(ea.Data.ToArray());
        }
示例#6
0
 public PublishActionEventArgs(ActionTag action,
                               MainTag mainTag, SubTag subTag, int objectID)
 {
     Action   = action;
     MainTag  = mainTag;
     SubTag   = subTag;
     ObjectID = objectID;
 }
示例#7
0
        public SkillComponentTag GetEffect(MainTag mainTag, SubTag subTag)
        {
            string effect = (string)GetComponent <ActorData>().GetXElementData(
                mainTag, subTag, ActorDataTag.BuildingEffect);

            Enum.TryParse(effect, out SkillComponentTag skill);

            return(skill);
        }
示例#8
0
        private PublishActionEventArgs GetEventArg(ActionTag actionTag)
        {
            MetaInfo metaInfo = GetComponent <MetaInfo>();
            MainTag  mainTag  = metaInfo.MainTag;
            SubTag   subTag   = metaInfo.SubTag;
            int      id       = metaInfo.ObjectID;

            return(new PublishActionEventArgs(actionTag, mainTag, subTag, id));
        }
示例#9
0
        private IPrototype GetLifeAltar()
        {
            MainTag mt = MainTag.Building;
            SubTag  st = SubTag.LifeAltar;

            int[] position = new int[] { 4, 4 };

            return(new ProtoObject(mt, st, position));
        }
示例#10
0
 public XElement GetXElementData(MainTag mainTag, SubTag subTag,
                                 ActorDataTag actorData)
 {
     if (!TryGetData(mainTag, subTag, actorData, out XElement data))
     {
         TryGetData(mainTag, defaultActor, actorData, out data);
     }
     return(data);
 }
示例#11
0
        private void Awake()
        {
            MainTag      mainTag = GetComponent <MetaInfo>().MainTag;
            SubTag       subTag  = GetComponent <MetaInfo>().SubTag;
            ActorDataTag dataTag = ActorDataTag.MoveDistance;

            baseDistance = GameCore.AxeManCore.GetComponent <ActorData>()
                           .GetIntData(mainTag, subTag, dataTag);
            minDistance = 1;
        }
示例#12
0
 public string GetStringData(MainTag mainTag, SubTag subTag,
                             ActorDataTag actorData)
 {
     if (!TryGetData(mainTag, subTag, actorData, userLanguage,
                     out XElement data))
     {
         TryGetData(mainTag, subTag, actorData, defaultLanguage, out data);
     }
     return((string)data);
 }
示例#13
0
        private string GetTrapEffectName(SubTag subTag)
        {
            MainTag           mainTag  = MainTag.Trap;
            BuildingEffect    building = GetComponent <BuildingEffect>();
            SkillComponentTag skill    = building.GetEffect(mainTag, subTag);
            int data = building.GetPowerDuration(mainTag, subTag);

            return(GetComponent <ConvertSkillMetaInfo>()
                   .GetBuildingEffectName(skill, data));
        }
示例#14
0
        private void Start()
        {
            MainTag mainTag = GetComponent <MetaInfo>().MainTag;
            SubTag  subTag  = GetComponent <MetaInfo>().SubTag;

            restoreHP = GameCore.AxeManCore.GetComponent <ActorData>()
                        .GetIntData(mainTag, subTag, ActorDataTag.RestoreHP);

            GameCore.AxeManCore.GetComponent <TurnManager>().StartedTurn
                += NPCBonusAction_StartedTurn;
        }
示例#15
0
        private bool TryGetData(MainTag mainTag, SubTag subTag,
                                ActorDataTag actorData, LanguageTag language, out XElement xElement)
        {
            if (TryGetData(mainTag, subTag, actorData, out xElement))
            {
                xElement = xElement
                           .Element(language.ToString());

                return(xElement != null);
            }
            return(false);
        }
示例#16
0
        private bool TryGetData(MainTag mainTag, SubTag subTag,
                                ActorDataTag actorData, out XElement xElement)
        {
            if (mainTagXElement.TryGetValue(mainTag, out xElement))
            {
                xElement = xElement
                           .Element(subTag.ToString())
                           .Element(actorData.ToString());

                return(xElement != null);
            }
            return(false);
        }
示例#17
0
        private string TryReplacePlaceholder(string source, string placeholder,
                                             MainTag mainTag, SubTag subTag)
        {
            string newText;

            if (subTag != SubTag.INVALID)
            {
                newText = GetComponent <ActorData>().GetStringData(
                    mainTag, subTag, ActorDataTag.Name);
                source = source.Replace(placeholder, newText);
            }
            return(source);
        }
示例#18
0
        private void PrintTrapData(GameObject target)
        {
            MainTag mainTag = target.GetComponent <MetaInfo>().MainTag;
            SubTag  subTag  = target.GetComponent <MetaInfo>().SubTag;

            string trapText
                = GetComponent <SkillData>().GetSkillComponentName(
                      GetComponent <BuildingEffect>().GetEffect(mainTag, subTag));
            string trapData = GetTrapEffectName(subTag);

            SearchText(UITag.HPText).text = trapText;
            SearchText(UITag.HPData).text = trapData;
        }
示例#19
0
        private void Awake()
        {
            MainTag      mainTag = GetComponent <MetaInfo>().MainTag;
            SubTag       subTag  = GetComponent <MetaInfo>().SubTag;
            ActorDataTag dataTag = ActorDataTag.Cooldown;

            MaxCooldown = GameCore.AxeManCore.GetComponent <ActorData>()
                          .GetIntData(mainTag, subTag, dataTag);
            CurrentCooldown = MaxCooldown;
            MinCooldown     = 0;

            decrease = 1;
        }
示例#20
0
        private GameObject[] Filter(GameObject[] source, MainTag mainTag)
        {
            Stack <GameObject> result = new Stack <GameObject>();

            foreach (GameObject go in source)
            {
                if (go.GetComponent <MetaInfo>().MainTag == mainTag)
                {
                    result.Push(go);
                }
            }
            return(result.ToArray());
        }
示例#21
0
        private void DummyAI_StartingTurn(object sender, StartingTurnEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }

            ActionTag action  = ActionTag.Skip;
            MainTag   mainTag = GetComponent <MetaInfo>().MainTag;
            SubTag    subTag  = GetComponent <MetaInfo>().SubTag;
            int       id      = GetComponent <MetaInfo>().ObjectID;

            GetComponent <LocalManager>().TakingAction(
                new TakingActionEventArgs(action, mainTag, subTag, id));
            GetComponent <LocalManager>().TakenAction(
                new TakenActionEventArgs(action, mainTag, subTag, id));
        }
示例#22
0
        private Stack <IPrototype> GetShieldAltar()
        {
            MainTag mt = MainTag.Building;
            SubTag  st = SubTag.ShieldAltar;

            int[][] position = new int[][]
            {
                new int[] { 2, 2 }, new int[] { 2, 6 },
                new int[] { 6, 2 }, new int[] { 6, 6 }
            };

            Stack <IPrototype> altar = new Stack <IPrototype>();

            foreach (int[] pos in position)
            {
                altar.Push(new ProtoObject(mt, st, pos));
            }
            return(altar);
        }
示例#23
0
        private void ActiveTrap_EndingTurn(object sender,
                                           StartOrEndTurnEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }

            while (trapTags.Count > 0)
            {
                BuildingEffect building
                    = GameCore.AxeManCore.GetComponent <BuildingEffect>();
                MainTag           mainTag = MainTag.Trap;
                SubTag            subTag  = trapTags.Pop();
                SkillComponentTag skill   = building.GetEffect(mainTag, subTag);
                int data = building.GetPowerDuration(mainTag, subTag);

                GetComponent <ActorStatus>().AddStatus(skill,
                                                       new EffectData(data, data));
                AddLog(subTag);
            }
        }
示例#24
0
        public int GetPowerDuration(MainTag mainTag, SubTag subTag)
        {
            int data;
            int baseAltar;
            int bonusAltar;

            if (mainTag == MainTag.Altar)
            {
                baseAltar = GetComponent <ActorData>().GetIntData(
                    mainTag, subTag, ActorDataTag.PowerDuration);
                bonusAltar = GetComponent <ActorData>().GetIntData(
                    mainTag, subTag, ActorDataTag.AddPowerDuration);

                data = baseAltar + countUpgrade * bonusAltar;
            }
            else
            {
                data = GetComponent <ActorData>().GetIntData(mainTag, subTag,
                                                             ActorDataTag.PowerDuration);
            }
            return(data);
        }
示例#25
0
        private string GetAltarEffectName(SubTag subTag)
        {
            MainTag           mainTag  = MainTag.Altar;
            BuildingEffect    building = GetComponent <BuildingEffect>();
            SkillComponentTag skill    = building.GetEffect(mainTag, subTag);
            int data = building.GetPowerDuration(mainTag, subTag);

            switch (subTag)
            {
            case SubTag.FireAltar:
            case SubTag.WaterAltar:
            case SubTag.AirAltar:
            case SubTag.EarthAltar:
                return(GetComponent <ConvertSkillMetaInfo>()
                       .GetBuildingEffectName(skill, data));

            case SubTag.LifeAltar:
                return(data.ToString());

            default:
                return(null);
            }
        }
示例#26
0
        private void PrintAltarData(GameObject target)
        {
            MainTag mainTag = target.GetComponent <MetaInfo>().MainTag;
            SubTag  subTag  = target.GetComponent <MetaInfo>().SubTag;

            string altarText
                = GetComponent <SkillData>().GetSkillComponentName(
                      GetComponent <BuildingEffect>().GetEffect(mainTag, subTag));
            string altarData = GetAltarEffectName(subTag);

            string cooldownText = GetComponent <UITextData>().GetStringData(
                UITextCategoryTag.ActorStatus, UITextDataTag.Cooldown);

            int    currentCD    = GetComponent <AltarCooldown>().CurrentCooldown;
            int    maxCD        = GetComponent <AltarCooldown>().MaxCooldown;
            string cooldownData = currentCD + "/" + maxCD;

            SearchText(UITag.HPText).text = altarText;
            SearchText(UITag.HPData).text = altarData;

            SearchText(UITag.MoveText).text = cooldownText;
            SearchText(UITag.MoveData).text = cooldownData;
        }
示例#27
0
        private void Awake()
        {
            MainTag      mainTag     = GetComponent <MetaInfo>().MainTag;
            SubTag       subTag      = GetComponent <MetaInfo>().SubTag;
            ActorDataTag range       = ActorDataTag.AttackRange;
            ActorDataTag damage      = ActorDataTag.Damage;
            ActorDataTag curseEffect = ActorDataTag.CurseEffect;
            ActorDataTag curseData   = ActorDataTag.CurseData;

            baseRange = GameCore.AxeManCore.GetComponent <ActorData>()
                        .GetIntData(mainTag, subTag, range);
            baseDamage = GameCore.AxeManCore.GetComponent <ActorData>()
                         .GetIntData(mainTag, subTag, damage);

            Enum.TryParse((string)GameCore.AxeManCore.GetComponent <ActorData>()
                          .GetXElementData(mainTag, subTag, curseEffect),
                          out SkillComponentTag effect);
            CurseEffect = effect;
            CurseData   = GameCore.AxeManCore.GetComponent <ActorData>()
                          .GetIntData(mainTag, subTag, curseData);

            minRange = 1;
        }
示例#28
0
 public ProtoObject(MainTag mainTag, SubTag subTag, int[] position)
 {
     MainTag  = mainTag;
     SubTag   = subTag;
     Position = position;
 }
示例#29
0
 public bool Search(int x, int y, MainTag mainTag, out GameObject[] result)
 {
     result = Filter(Search(x, y), mainTag);
     return(result.Length > 0);
 }
示例#30
0
 public SearchingMainTagEventArgs(MainTag mainTag, Stack <GameObject> data)
 {
     MainTag = mainTag;
     Data    = data;
 }