コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
ファイル: ActorStatus.cs プロジェクト: XiupingWu/AxeMan
        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();
        }
コード例 #3
0
        private void NPCAI_StartingTurn(object sender,
                                        StartOrEndTurnEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }

            if (GetComponent <NPCBonusAction>().HasBonusAction)
            {
                GetComponent <NPCBonusAction>().TakeBonusAction();
            }

            ActionTag action;

            if (GetComponent <NPCAttack>().IsInsideRage(out int outOfRange))
            {
                GetComponent <NPCAttack>().DealDamage();
                GetComponent <NPCAttack>().Curse();

                action = ActionTag.NPCAttack;
            }
            else
            {
                GetComponent <NPCMove>().Approach(outOfRange);

                action = ActionTag.Move;
            }

            GetComponent <LocalManager>().TakingAction(action);
            GetComponent <LocalManager>().TakenAction(action);
            GetComponent <LocalManager>().CheckingSchedule(action);
        }
コード例 #4
0
ファイル: PCStartEndTurn.cs プロジェクト: XiupingWu/AxeMan
 private void PCStartEndTurn_EndingTurn(object sender,
                                        StartOrEndTurnEventArgs e)
 {
     if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
     {
         return;
     }
 }
コード例 #5
0
ファイル: NormalMode.cs プロジェクト: XiupingWu/AxeMan
 private void NormalMode_StartingTurn(object sender,
                                      StartOrEndTurnEventArgs e)
 {
     if (e.SubTag == SubTag.PC)
     {
         GetComponent <GameModeManager>().SwitchGameMode(startTurn);
     }
 }
コード例 #6
0
ファイル: ActorStatus.cs プロジェクト: XiupingWu/AxeMan
 private void ActorStatus_StartingTurn(object sender,
                                       StartOrEndTurnEventArgs e)
 {
     if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
     {
         return;
     }
     TryRemoveStatus();
     PublishPCStatus();
 }
コード例 #7
0
ファイル: PCStartEndTurn.cs プロジェクト: XiupingWu/AxeMan
        private void PCStartEndTurn_StartingTurn(object sender,
                                                 StartOrEndTurnEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }

            if (GameCore.AxeManCore.GetComponent <LogManager>().GetLog(0)
                != newTurn)
            {
                GameCore.AxeManCore.GetComponent <LogManager>().Add(newTurn);
            }
        }
コード例 #8
0
        private void AnnouncePCDeath_EndingTurn(object sender,
                                                StartOrEndTurnEventArgs e)
        {
            if (announce)
            {
                GetComponent <ColorManager>().SetColor(
                    pcRenderer, ColorTag.Orange);

                GetComponent <LogManager>().Add(new LogMessage(
                                                    LogCategoryTag.GameProgress, LogMessageTag.PCDeath));

                announce = false;
            }
        }
コード例 #9
0
        private void AltarCooldown_StartingTurn(object sender,
                                                StartOrEndTurnEventArgs e)
        {
            if (e.SubTag != SubTag.PC)
            {
                return;
            }

            if (CurrentCooldown > 0)
            {
                CurrentCooldown--;
                CurrentCooldown = Math.Max(MinCooldown, CurrentCooldown);
                OnChangedAltarCooldown(EventArgs.Empty);
            }
        }
コード例 #10
0
        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;
            }
        }
コード例 #11
0
ファイル: AltarColor.cs プロジェクト: XiupingWu/AxeMan
        private void AltarColor_StartedTurn(object sender,
                                            StartOrEndTurnEventArgs e)
        {
            if (e.SubTag != SubTag.PC)
            {
                return;
            }

            if (GetComponent <AltarCooldown>().CurrentCooldown
                > GetComponent <AltarCooldown>().MinCooldown)
            {
                SetAltarColor(ColorTag.Grey);
            }
            else
            {
                SetAltarColor(ColorTag.White);
            }
        }
コード例 #12
0
        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);
            }
        }
コード例 #13
0
        private void ProgressBar_EndingTurn(object sender,
                                            StartOrEndTurnEventArgs e)
        {
            if (e.SubTag != SubTag.PC)
            {
                return;
            }

            SpriteRenderer sr;

            currentX = GetXCoordinate(currentX, minX, maxX);
            for (int i = 0; i < bars.Length; i++)
            {
                sr = bars[i].GetComponent <SpriteRenderer>();
                if (i < currentX)
                {
                    GetComponent <ColorManager>().SetColor(sr, ColorTag.Grey);
                }
                else
                {
                    GetComponent <ColorManager>().SetColor(sr, ColorTag.Black);
                }
            }
        }