Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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));
        }
Example #4
0
        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;
        }
Example #5
0
        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;
            }
        }
Example #6
0
        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]);
                }
            }
        }
Example #7
0
        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++;
                }
            }
        }
Example #8
0
        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);
        }
Example #9
0
        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));
        }
Example #10
0
 public void RemoveSkillComponent(SkillNameTag skillNameTag,
                                  SkillSlotTag skillSlotTag)
 {
     if (slotCompDict.TryGetValue(skillNameTag, out var slotComp))
     {
         slotComp.Remove(skillSlotTag);
     }
 }
Example #11
0
 public SkillTypeTag GetSkillTypeTag(SkillNameTag skillNameTag)
 {
     if (nameTypeDict.TryGetValue(skillNameTag, out SkillTypeTag data))
     {
         return(data);
     }
     return(SkillTypeTag.INVALID);
 }
Example #12
0
 public string GetSkillName(SkillNameTag skillNameTag)
 {
     if (skillNameDict.TryGetValue(skillNameTag, out string skillName))
     {
         return(skillName);
     }
     return(invalidName);
 }
Example #13
0
 public int GetCurrentCooldown(SkillNameTag skillNameTag)
 {
     if (currentCDDict.TryGetValue(skillNameTag, out int cooldown))
     {
         return(cooldown);
     }
     return(invalidCD);
 }
Example #14
0
 public Dictionary <SkillSlotTag, SkillComponentTag> GetSkillSlot(
     SkillNameTag skillNameTag)
 {
     if (slotCompDict.TryGetValue(skillNameTag, out var slotComp))
     {
         return(new Dictionary <SkillSlotTag, SkillComponentTag>(slotComp));
     }
     return(null);
 }
Example #15
0
        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);
        }
Example #16
0
 private void SetCurrentCooldown(SkillNameTag skillNameTag, int cooldown)
 {
     if (currentCDDict.ContainsKey(skillNameTag))
     {
         currentCDDict[skillNameTag] = cooldown;
         GetComponent <LocalManager>().ChangedSkillCooldown(
             new ChangedSkillCooldownEventArgs(skillNameTag));
     }
 }
Example #17
0
        private void Range(CommandTag commandTag)
        {
            SearchText(UITag.RangeText).text = "Range";

            SkillNameTag skillName = skillManager.GetSkillNameTag(commandTag);

            SearchText(UITag.RangeData).text
                = skillManager.GetSkillRange(skillName).ToString();
        }
Example #18
0
        private bool TryGetData(SkillNameTag skillName, SkillSlotTag skillSlot,
                                out XElement xElement)
        {
            xElement = xmlFile
                       .Element(skillName.ToString())
                       .Element(skillSlot.ToString());

            return(xElement != null);
        }
Example #19
0
 private void SetTemplateData(SkillNameTag skillName,
                              SkillSlotTag skillSlot, SkillComponentTag skillComponent)
 {
     nameSlotCompDict[skillName][skillSlot] = skillComponent;
     xmlFile
     .Element(skillName.ToString())
     .Element(skillSlot.ToString())
     .Value
         = skillComponent.ToString();
 }
Example #20
0
 private void SetCurrentCooldown(SkillNameTag skillNameTag, int cooldown)
 {
     if (currentCDDict.ContainsKey(skillNameTag))
     {
         currentCDDict[skillNameTag] = cooldown;
         GameCore.AxeManCore.GetComponent <PublishSkill>()
         .PublishSkillCooldown(
             new ChangedSkillCooldownEventArgs(skillNameTag));
     }
 }
Example #21
0
        public SkillTypeTag GetSkillTypeTag(SkillNameTag skillName,
                                            out string shortTypeName, out string fullTypeName)
        {
            SkillTypeTag skillType = skillTypeDict[skillName];

            shortTypeName = shortTypeNameDict[skillType];
            fullTypeName  = fullTypeNameDict[skillType];

            return(skillType);
        }
Example #22
0
        public int GetSkillRange(SkillNameTag skillName)
        {
            int invalid = -1;

            if (skillRangeDict.TryGetValue(skillName, out int range))
            {
                return(range);
            }
            return(invalid);
        }
Example #23
0
        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;
        }
Example #24
0
        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();
        }
Example #25
0
        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))
Example #26
0
        private void SetTemplateData(SkillNameTag skillName,
                                     SkillTypeTag skillType)
        {
            SkillSlotTag skillSlot = SkillSlotTag.SkillType;

            nameTypeDict[skillName] = skillType;
            xmlFile
            .Element(skillName.ToString())
            .Element(skillSlot.ToString())
            .Value
                = skillType.ToString();
        }
Example #27
0
        public int GetMaxCooldown(SkillNameTag skillNameTag)
        {
            if (!maxCDDict.ContainsKey(skillNameTag))
            {
                return(invalidCD);
            }

            if (maxCDDict[skillNameTag] == invalidCD)
            {
                SetMaxCooldown(skillNameTag);
            }
            return(maxCDDict[skillNameTag]);
        }
Example #28
0
 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();
     }
 }
Example #29
0
 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);
            }
        }