private IPrototype GetLifeAltar(int[] position) { MainTag mt = MainTag.Altar; SubTag st = SubTag.LifeAltar; return(new ProtoObject(mt, st, position)); }
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); }
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); } }
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); } }
public GameObject[] Search(MainTag mainTag) { Stack <GameObject> data = new Stack <GameObject>(); var ea = new SearchingMainTagEventArgs(mainTag, data); OnSearchingMainTag(ea); return(ea.Data.ToArray()); }
public PublishActionEventArgs(ActionTag action, MainTag mainTag, SubTag subTag, int objectID) { Action = action; MainTag = mainTag; SubTag = subTag; ObjectID = objectID; }
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); }
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)); }
private IPrototype GetLifeAltar() { MainTag mt = MainTag.Building; SubTag st = SubTag.LifeAltar; int[] position = new int[] { 4, 4 }; return(new ProtoObject(mt, st, position)); }
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); }
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; }
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); }
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)); }
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; }
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); }
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); }
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); }
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; }
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; }
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()); }
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)); }
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); }
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); } }
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); }
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); } }
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; }
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; }
public ProtoObject(MainTag mainTag, SubTag subTag, int[] position) { MainTag = mainTag; SubTag = subTag; Position = position; }
public bool Search(int x, int y, MainTag mainTag, out GameObject[] result) { result = Filter(Search(x, y), mainTag); return(result.Length > 0); }
public SearchingMainTagEventArgs(MainTag mainTag, Stack <GameObject> data) { MainTag = mainTag; Data = data; }