private void TryCountdownDuration(SkillComponentTag skillComponent) { if (compIntStatus.ContainsKey(skillComponent)) { compIntStatus[skillComponent].Duration -= reduceDuration; } }
private void ActorStatus_EndingTurn(object sender, StartOrEndTurnEventArgs e) { SkillComponentTag merit = SkillComponentTag.WaterMerit; SkillComponentTag flaw = SkillComponentTag.FireFlaw; if (!GetComponent <LocalManager>().MatchID(e.ObjectID)) { return; } if (HasStatus(flaw, out _)) { TryCountdownDuration(flaw); TryCountdownDuration(positiveStatus); } else if (HasStatus(merit, out _)) { TryCountdownDuration(merit); TryCountdownDuration(negativeStatus); } else { TryCountdownDuration(positiveStatus); TryCountdownDuration(negativeStatus); } PublishPCStatus(); }
private SkillComponentTag[] SortComponents(SkillTypeTag skillTypeTag, Dictionary <SkillComponentTag, EffectData> compInt) { Queue <SkillComponentTag> sortedComp = new Queue <SkillComponentTag>(); SkillComponentTag[] checkList; switch (skillTypeTag) { case SkillTypeTag.Buff: checkList = sortedEnhance; break; case SkillTypeTag.Curse: checkList = sortedCurse; break; default: checkList = new SkillComponentTag[] { }; break; } foreach (SkillComponentTag sct in checkList) { if (compInt.ContainsKey(sct)) { sortedComp.Enqueue(sct); } } return(sortedComp.ToArray()); }
private void SkillCooldown_StartedTurn(object sender, StartOrEndTurnEventArgs e) { ActorStatus actorStatus = GetComponent <ActorStatus>(); SkillComponentTag flaw = SkillComponentTag.WaterFlaw; SkillComponentTag merit = SkillComponentTag.FireMerit; int decrease; int cooldown; if (!GetComponent <LocalManager>().MatchID(e.ObjectID) || actorStatus.HasStatus(flaw, out _)) { return; } if (actorStatus.HasStatus(merit, out _)) { decrease = fastDecrease; } else { decrease = normalDecrease; } foreach (SkillNameTag snt in currentCDDict.Keys.ToArray()) { if (currentCDDict[snt] > MinCooldown) { cooldown = currentCDDict[snt] - decrease; cooldown = Math.Max(MinCooldown, cooldown); SetCurrentCooldown(snt, cooldown); } } }
public bool TrySetSkillSlot(SkillNameTag skillNameTag, SkillSlotTag skillSlotTag, SkillComponentTag skillComponentTag) { SkillTypeTag skillTypeTag = GetComponent <PCSkillManager>() .GetSkillTypeTag(skillNameTag); bool canSetSlot; switch (skillSlotTag) { case SkillSlotTag.Merit1: case SkillSlotTag.Merit2: case SkillSlotTag.Merit3: canSetSlot = VerifyMeritSlot(skillTypeTag, skillComponentTag); break; case SkillSlotTag.Flaw1: case SkillSlotTag.Flaw2: case SkillSlotTag.Flaw3: canSetSlot = VerifyFlawSlot(skillComponentTag); break; default: canSetSlot = false; break; } if (canSetSlot && slotCompDict.TryGetValue(skillNameTag, out var slotComp)) { slotComp[skillSlotTag] = skillComponentTag; return(true); } return(false); }
public void AddStatus(SkillComponentTag skillComponentTag, EffectData effectData) { TryMergeStatus(skillComponentTag, effectData); TryNegateStatus(); SetMaxPowerDuration(); PublishPCStatus(); }
public string GetBuildingEffectName(SkillComponentTag skillComponentTag, int powerDuration) { if (HideSkillPower(skillComponentTag)) { return("T X " + powerDuration); } return(powerDuration + " X " + powerDuration); }
private bool VerifyMeritSlot(SkillTypeTag skillTypeTag, SkillComponentTag skillComponentTag) { if (validMeritSlot.TryGetValue(skillTypeTag, out var comp)) { return(Array.Exists(comp, e => e == skillComponentTag)); } return(false); }
private void SetTemplateData(SkillNameTag skillName, SkillSlotTag skillSlot, SkillComponentTag skillComponent) { nameSlotCompDict[skillName][skillSlot] = skillComponent; xmlFile .Element(skillName.ToString()) .Element(skillSlot.ToString()) .Value = skillComponent.ToString(); }
public bool HasStatus(SkillComponentTag skillComponentTag, out EffectData effectData) { if (compIntStatus.TryGetValue(skillComponentTag, out effectData)) { return(true); } effectData = null; return(false); }
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)); }
public bool ConvertCurse2Flaw(SkillComponentTag curse, out SkillComponentTag flaw) { if (curse2flaw.TryGetValue(curse, out SkillComponentTag data)) { flaw = data; return(true); } flaw = SkillComponentTag.INVALID; return(false); }
public string GetSkillEffectName(SkillComponentTag skillComponentTag, EffectData effectData) { int power = effectData.Power; int duration = effectData.Duration; if (HideSkillPower(skillComponentTag)) { return("T X " + duration); } return(power + " X " + duration); }
private void TryMergeStatus(SkillComponentTag skillComponentTag, EffectData effectData) { if (compIntStatus.ContainsKey(skillComponentTag)) { compIntStatus[skillComponentTag].Power += effectData.Power; compIntStatus[skillComponentTag].Duration += effectData.Duration; } else { compIntStatus[skillComponentTag] = effectData; } }
private bool VerifyFlawSlot(SkillComponentTag skillComponentTag) { switch (skillComponentTag) { case SkillComponentTag.FireFlaw: case SkillComponentTag.WaterFlaw: case SkillComponentTag.AirFlaw: case SkillComponentTag.EarthFlaw: return(true); default: return(false); } }
private void NPCBonusAction_StartedTurn(object sender, StartOrEndTurnEventArgs e) { SkillComponentTag flaw = SkillComponentTag.WaterFlaw; if (!GetComponent <LocalManager>().MatchID(e.ObjectID) || GetComponent <ActorStatus>().HasStatus(flaw, out _)) { return; } if (CurrentCooldown > MinCooldown) { CurrentCooldown -= decrease; } }
private void PrintCurse(GameObject target) { SkillComponentTag curseEffect = target.GetComponent <NPCAttack>() .CurseEffect; int powerDuration = target.GetComponent <NPCAttack>().CurseData; if (curseEffect == SkillComponentTag.INVALID) { return; } string curseText = GetComponent <SkillData>().GetSkillComponentName( curseEffect); string curseData = GetComponent <ConvertSkillMetaInfo>() .GetSkillEffectName(curseEffect, new EffectData(powerDuration, powerDuration)); SearchText(UITag.CurseText).text = curseText; SearchText(UITag.CurseData).text = curseData; }
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); } }
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 bool HideSkillPower(SkillComponentTag skillComponentTag) { switch (skillComponentTag) { case SkillComponentTag.FireMerit: case SkillComponentTag.FireFlaw: case SkillComponentTag.FireCurse: case SkillComponentTag.WaterMerit: case SkillComponentTag.WaterFlaw: case SkillComponentTag.WaterCurse: return(true); case SkillComponentTag.AirMerit: case SkillComponentTag.AirFlaw: case SkillComponentTag.AirCurse: case SkillComponentTag.EarthMerit: case SkillComponentTag.EarthFlaw: case SkillComponentTag.EarthCurse: return(false); default: return(false); } }
public void RemoveStatus(SkillComponentTag skillComponentTag) { compIntStatus.Remove(skillComponentTag); PublishPCStatus(); }
public bool TrySetSkillSlot(SkillNameTag skillNameTag, SkillSlotTag skillSlotTag, SkillComponentTag skillComponentTag) { return(GetComponent <SkillSlot>().TrySetSkillSlot(skillNameTag, skillSlotTag, skillComponentTag)); }
public string GetBuildingEffectName(SkillComponentTag skillComponentTag, int powerDuration) { return(GameCore.AxeManCore.GetComponent <ConvertSkillMetaInfo>() .GetBuildingEffectName(skillComponentTag, powerDuration)); }
public string GetSkillComponentName(SkillComponentTag skillComponentTag) { return(GameCore.AxeManCore.GetComponent <SkillData>() .GetSkillComponentName(skillComponentTag)); }
public string GetSkillEffectName(SkillComponentTag skillComponentTag, EffectData effectData) { return(GameCore.AxeManCore.GetComponent <ConvertSkillMetaInfo>() .GetSkillEffectName(skillComponentTag, effectData)); }
public string GetSkillComponentName(SkillComponentTag skillComponentTag) { return(GetStringData(component, skillComponentTag.ToString())); }
public string GetSkillComponentDescription( SkillComponentTag skillComponentTag) { return(GetStringData(description, skillComponentTag.ToString())); }