Ejemplo n.º 1
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));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        private void Canvas_World_TakenAction(object sender,
                                              PublishActionEventArgs e)
        {
            // Only responds to move action from aim or examine marker.
            if (e.Action != ActionTag.Move)
            {
                return;
            }
            if ((e.SubTag != SubTag.AimMarker) &&
                (e.SubTag != SubTag.ExamineMarker))
            {
                return;
            }

            switch (e.SubTag)
            {
            case SubTag.AimMarker:
                SearchText(UITag.Modeline).text = AimModeText();
                break;

            case SubTag.ExamineMarker:
                SearchText(UITag.Modeline).text = ExamineModeText();
                break;

            default:
                break;
            }
        }
Ejemplo n.º 4
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]);
                }
            }
        }
Ejemplo n.º 5
0
 private void AltarCooldown_TakenAction(object sender,
                                        PublishActionEventArgs e)
 {
     if ((e.SubTag != SubTag.PC) || (e.Action != ActionTag.ActiveAltar))
     {
         return;
     }
     CurrentCooldown = MaxCooldown;
     OnChangedAltarCooldown(EventArgs.Empty);
 }
Ejemplo n.º 6
0
        private void TurnManager_CheckingSchedule(object sender,
                                                  PublishActionEventArgs e)
        {
            if (!GetComponent <Schedule>().Current
                .GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }

            if (endingTurnActions.Contains(e.Action))
            {
                NextActor();
            }
        }
Ejemplo n.º 7
0
        private void SkillCooldown_TakenAction(object sender,
                                               PublishActionEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID) ||
                !IsValidAction(e.Action))
            {
                return;
            }

            SkillNameTag skill = GetComponent <PCSkillManager>()
                                 .GetSkillNameTag(e.Action);

            SetCurrentCooldown(skill, GetMaxCooldown(skill));
        }
Ejemplo n.º 8
0
        private void Canvas_ExamineMode_TakenAction(object sender,
                                                    PublishActionEventArgs e)
        {
            if (e.Action != ActionTag.Move)
            {
                return;
            }
            if ((e.SubTag != SubTag.AimMarker) &&
                (e.SubTag != SubTag.ExamineMarker))
            {
                return;
            }

            ClearText();
            PrintExamineText(e.SubTag);
        }
Ejemplo n.º 9
0
        private void ActiveTrap_TakenAction(object sender,
                                            PublishActionEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID) ||
                !validActions.Contains(e.Action))
            {
                return;
            }

            int[] pos = GetComponent <MetaInfo>().Position;
            GameCore.AxeManCore.GetComponent <SearchObject>().Search(
                pos[0], pos[1], MainTag.Trap, out traps);

            foreach (GameObject go in traps)
            {
                trapTags.Push(go.GetComponent <MetaInfo>().SubTag);
                go.GetComponent <LocalManager>().Remove();
            }
        }
Ejemplo n.º 10
0
        private void PCAttackTarget_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.Attack)
            {
                return;
            }

            if (!GameCore.AxeManCore.GetComponent <SearchObject>()
                .Search(targetPosition[0], targetPosition[1], MainTag.Actor,
                        out GameObject[] targets))