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); }
private int SetBaseDamage(SkillNameTag skillNameTag) { SkillTypeTag skillType = GetComponent <PCSkillManager>() .GetSkillTypeTag(skillNameTag); int damage = zeroDamage; Dictionary <SkillComponentTag, EffectData> compEffect; SkillComponentTag checkComp; if (skillType == SkillTypeTag.Attack) { damage = baseDamage; compEffect = GetComponent <PCSkillManager>() .GetSkillEffect(skillNameTag); checkComp = SkillComponentTag.AirCurse; if (compEffect.TryGetValue(checkComp, out EffectData effectData)) { damage += effectData.Power; } } nameDamage[skillNameTag] = damage; return(damage); }
private void PCBuffSelf_TakingAction(object sender, PublishActionEventArgs e) { if (e.SubTag != SubTag.PC) { return; } SkillNameTag skillName = GetComponent <PCSkillManager>() .GetSkillNameTag(e.Action); SkillTypeTag skillType = GetComponent <PCSkillManager>() .GetSkillTypeTag(skillName); if (skillType != SkillTypeTag.Buff) { return; } Dictionary <SkillComponentTag, EffectData> compInt = GetComponent <PCSkillManager>().GetSkillEffect(skillName); foreach (SkillComponentTag sct in buffComps) { if (compInt.ContainsKey(sct)) { GetComponent <ActorStatus>().AddStatus(sct, compInt[sct]); } } GameCore.AxeManCore.GetComponent <LogManager>().Add( new LogMessage(LogCategoryTag.Combat, LogMessageTag.PCBuff)); }
private void SetMaxCooldown(SkillNameTag skillNameTag) { Dictionary <SkillSlotTag, SkillComponentTag> slotComp = GetComponent <PCSkillManager>().GetSkillSlot(skillNameTag); int cd = baseCD; foreach (SkillSlotTag sst in slotComp.Keys) { switch (sst) { case SkillSlotTag.Merit1: case SkillSlotTag.Merit2: case SkillSlotTag.Merit3: cd++; break; case SkillSlotTag.Flaw1: case SkillSlotTag.Flaw2: case SkillSlotTag.Flaw3: cd--; break; default: break; } } maxCDDict[skillNameTag] = cd; }
private void Effect(CommandTag commandTag) { SkillTypeTag skillType = skillManager.GetSkillTypeTag(commandTag); if (!printEffect.Contains(skillType)) { return; } SkillNameTag skillName = skillManager.GetSkillNameTag(commandTag); Dictionary <SkillComponentTag, EffectData> compInt = skillManager.GetSkillEffect(skillName); SkillComponentTag[] sortedComp = SortComponents(skillType, compInt); string comp; string effect; SkillComponentTag current; for (int i = 0; i < sortedComp.Length; i++) { current = sortedComp[i]; comp = skillManager.GetSkillComponentName(current); effect = skillManager.GetSkillEffectName(current, compInt[current]); SearchText(uiCurseText[i]).text = comp; SearchText(uiCurseData[i]).text = effect; } }
private void ApplySkillFlawEffect_TakenAction(object sender, PublishActionEventArgs e) { if (e.SubTag != SubTag.PC) { return; } SkillNameTag skillName = GetComponent <PCSkillManager>().GetSkillNameTag(e.Action); if (skillName == SkillNameTag.INVALID) { return; } Dictionary <SkillComponentTag, EffectData> compInt = GetComponent <PCSkillManager>().GetSkillEffect(skillName); foreach (SkillComponentTag sct in skillComps) { if (compInt.ContainsKey(sct)) { GetComponent <ActorStatus>().AddStatus(sct, compInt[sct]); } } }
private void SkillFlawEffect(SwitchGameModeEventArgs e) { SkillNameTag skillName = skillManager.GetSkillNameTag(e.CommandTag); Dictionary <SkillComponentTag, EffectData> compInt = skillManager.GetSkillEffect(skillName); int index = 0; Text uiText; Text uiData; string effectName; string effectData; foreach (SkillComponentTag sct in orderedFlawEffect) { if (compInt.ContainsKey(sct)) { uiText = SearchText(orderedUIText[index]); uiData = SearchText(orderedUIData[index]); effectName = skillManager.GetSkillComponentName(sct); effectData = skillManager.GetSkillEffectName(sct, compInt[sct]); uiText.text = effectName; uiData.text = effectData; index++; } } }
private int SetBaseRange(SkillNameTag skillNameTag) { SkillTypeTag skillType = GetComponent <PCSkillManager>() .GetSkillTypeTag(skillNameTag); int range = minRange; Dictionary <SkillComponentTag, EffectData> compEffect; SkillComponentTag checkComp; if (skillType != SkillTypeTag.Buff) { range = baseRange; compEffect = GetComponent <PCSkillManager>() .GetSkillEffect(skillNameTag); checkComp = SkillComponentTag.AirMerit; if (compEffect.TryGetValue(checkComp, out EffectData effectData)) { range += effectData.Power; } } nameRange[skillNameTag] = range; return(range); }
private void PCTeleportSelf_TakingAction(object sender, PublishActionEventArgs e) { if (e.SubTag != SubTag.PC) { return; } SkillNameTag skillName = GetComponent <PCSkillManager>() .GetSkillNameTag(e.Action); SkillTypeTag skillType = GetComponent <PCSkillManager>() .GetSkillTypeTag(skillName); if (skillType != SkillTypeTag.Move) { return; } int[] source = GetComponent <MetaInfo>().Position; int[] target = targetPosition; GetComponent <LocalManager>().SetPosition(target); GameCore.AxeManCore.GetComponent <TileOverlay>().TryHideTile(source); GameCore.AxeManCore.GetComponent <TileOverlay>().TryHideTile(target); GameCore.AxeManCore.GetComponent <LogManager>().Add( new LogMessage(LogCategoryTag.Combat, LogMessageTag.PCTeleport)); }
public void RemoveSkillComponent(SkillNameTag skillNameTag, SkillSlotTag skillSlotTag) { if (slotCompDict.TryGetValue(skillNameTag, out var slotComp)) { slotComp.Remove(skillSlotTag); } }
public SkillTypeTag GetSkillTypeTag(SkillNameTag skillNameTag) { if (nameTypeDict.TryGetValue(skillNameTag, out SkillTypeTag data)) { return(data); } return(SkillTypeTag.INVALID); }
public string GetSkillName(SkillNameTag skillNameTag) { if (skillNameDict.TryGetValue(skillNameTag, out string skillName)) { return(skillName); } return(invalidName); }
public int GetCurrentCooldown(SkillNameTag skillNameTag) { if (currentCDDict.TryGetValue(skillNameTag, out int cooldown)) { return(cooldown); } return(invalidCD); }
public Dictionary <SkillSlotTag, SkillComponentTag> GetSkillSlot( SkillNameTag skillNameTag) { if (slotCompDict.TryGetValue(skillNameTag, out var slotComp)) { return(new Dictionary <SkillSlotTag, SkillComponentTag>(slotComp)); } return(null); }
private void Canvas_World_FailedVerifying(object sender, FailedVerifyingEventArgs e) { SkillNameTag tag = skillManager.GetSkillNameTag(e.UseSkill); string skillName = skillManager.GetSkillName(tag); SearchText(UITag.Modeline).text = GetText(UITextDataTag.UseSkill, skillName); }
private void SetCurrentCooldown(SkillNameTag skillNameTag, int cooldown) { if (currentCDDict.ContainsKey(skillNameTag)) { currentCDDict[skillNameTag] = cooldown; GetComponent <LocalManager>().ChangedSkillCooldown( new ChangedSkillCooldownEventArgs(skillNameTag)); } }
private void Range(CommandTag commandTag) { SearchText(UITag.RangeText).text = "Range"; SkillNameTag skillName = skillManager.GetSkillNameTag(commandTag); SearchText(UITag.RangeData).text = skillManager.GetSkillRange(skillName).ToString(); }
private bool TryGetData(SkillNameTag skillName, SkillSlotTag skillSlot, out XElement xElement) { xElement = xmlFile .Element(skillName.ToString()) .Element(skillSlot.ToString()); return(xElement != null); }
private void SetTemplateData(SkillNameTag skillName, SkillSlotTag skillSlot, SkillComponentTag skillComponent) { nameSlotCompDict[skillName][skillSlot] = skillComponent; xmlFile .Element(skillName.ToString()) .Element(skillSlot.ToString()) .Value = skillComponent.ToString(); }
private void SetCurrentCooldown(SkillNameTag skillNameTag, int cooldown) { if (currentCDDict.ContainsKey(skillNameTag)) { currentCDDict[skillNameTag] = cooldown; GameCore.AxeManCore.GetComponent <PublishSkill>() .PublishSkillCooldown( new ChangedSkillCooldownEventArgs(skillNameTag)); } }
public SkillTypeTag GetSkillTypeTag(SkillNameTag skillName, out string shortTypeName, out string fullTypeName) { SkillTypeTag skillType = skillTypeDict[skillName]; shortTypeName = shortTypeNameDict[skillType]; fullTypeName = fullTypeNameDict[skillType]; return(skillType); }
public int GetSkillRange(SkillNameTag skillName) { int invalid = -1; if (skillRangeDict.TryGetValue(skillName, out int range)) { return(range); } return(invalid); }
private void SkillNameType(CommandTag e) { SkillNameTag skillName = skillManager.GetSkillNameTag(e); SkillTypeTag skillType = skillManager.GetSkillTypeTag(skillName); string name = skillManager.GetSkillName(skillName); string type = skillManager.GetLongSkillTypeName(skillType); SearchText(UITag.SkillText).text = type; SearchText(UITag.SkillData).text = name; }
private void Range(CommandTag commandTag) { SearchText(UITag.RangeText).text = GetComponent <UITextData>().GetStringData( UITextCategoryTag.ActorStatus, UITextDataTag.AttackRange); SkillNameTag skillName = skillManager.GetSkillNameTag(commandTag); SearchText(UITag.RangeData).text = skillManager.GetSkillRange(skillName).ToString(); }
private Dictionary <SkillComponentTag, int[]> SetSkillEffect( SkillNameTag skillNameTag) { Dictionary <SkillSlotTag, SkillComponentTag> slotComp = GetComponent <PCSkillManager>().GetSkillSlot(skillNameTag); Dictionary <SkillComponentTag, int[]> compInt = new Dictionary <SkillComponentTag, int[]>(); foreach (SkillComponentTag sct in slotComp.Values) { if (compInt.TryGetValue(sct, out int[] powerDuration))
private void SetTemplateData(SkillNameTag skillName, SkillTypeTag skillType) { SkillSlotTag skillSlot = SkillSlotTag.SkillType; nameTypeDict[skillName] = skillType; xmlFile .Element(skillName.ToString()) .Element(skillSlot.ToString()) .Value = skillType.ToString(); }
public int GetMaxCooldown(SkillNameTag skillNameTag) { if (!maxCDDict.ContainsKey(skillNameTag)) { return(invalidCD); } if (maxCDDict[skillNameTag] == invalidCD) { SetMaxCooldown(skillNameTag); } return(maxCDDict[skillNameTag]); }
private void Canvas_World_SwitchedGameMode(object sender, SwitchGameModeEventArgs e) { if (e.EnterMode == GameModeTag.ExamineMode) { SearchText(UITag.Modeline).text = ExamineModeText(); } else if (e.EnterMode == GameModeTag.AimMode) { skillNameTag = skillManager.GetSkillNameTag(e.CommandTag); SearchText(UITag.Modeline).text = AimModeText(); } }
private void Canvas_World_SwitchingGameMode(object sender, SwitchGameModeEventArgs e) { if (e.LeaveMode == GameModeTag.ExamineMode) { ClearModeline(); } else if (e.LeaveMode == GameModeTag.AimMode) { skillNameTag = SkillNameTag.INVALID; ClearModeline(); } }
private void SkillName() { UITag[] ui = new UITag[] { UITag.QText, UITag.WText, UITag.EText, UITag.RText }; for (int i = 0; i < ui.Length; i++) { SkillNameTag tag = skillManager.GetSkillNameTag(ui[i]); SearchText(ui[i]).text = skillManager.GetSkillName(tag); } }