コード例 #1
0
        public void IsExhausted()
        {
            string exhaust = text.GetStringData(node, "NPCExhaust");

            exhaust = exhaust.Replace("%str%", GetDefenderName());
            message.StoreText(exhaust);
        }
コード例 #2
0
        public bool IsValidDestination(int[] check)
        {
            int[] previous = previousPosition.Peek();

            if ((check[0] == previous[0]) && (check[1] == previous[1]))
            {
                countAutoExplore = 0;
                modeline.PrintStaticText(text.GetStringData(node, "Manual"));
                return(false);
            }
            previousPosition.Push(coord.Convert(transform.position));
            return(true);
        }
コード例 #3
0
ファイル: BuyPowerAction.cs プロジェクト: minkooz/FungusCave
        private void ReadyToBuy(bool isReady)
        {
            confirmToBuy = isReady;

            FindObjects.GetUIText(UITag.BuyPowerModeline).text = isReady
                ? text.GetStringData("BuyPower", "Confirm")
                : "";
        }
コード例 #4
0
ファイル: PCDeath.cs プロジェクト: minkooz/FungusCave
        public void DefeatTarget(GameObject target)
        {
            SubObjectTag tag         = target.GetComponent <MetaInfo>().SubTag;
            int          potion      = actorData.GetIntData(tag, DataTag.Potion);
            int          bonusPotion = target.GetComponent <Infection>().HasInfection(
                InfectionTag.Mutated) ? potionData.BonusPotion : 0;
            string victory;

            GetComponent <Potion>().GainPotion(potion + bonusPotion);

            progress.CountKill(target);
            if (progress.IsWin())
            {
                BurySelf();
                color.ChangeObjectColor(getActor(SubObjectTag.Guide),
                                        ColorName.Orange);

                if (progressData.IsRushMode)
                {
                    victory = text.GetStringData(node, "WinRush");
                }
                else
                {
                    victory = text.GetStringData(node, "WinNormal");
                }
                victory = color.GetColorfulText(victory, ColorName.Green);
                message.StoreText(victory);
                modeline.PrintStaticText(text.GetStringData(node, "ReloadWin"));
            }
            else if (progress.LevelCleared())
            {
                BurySelf();
                color.ChangeObjectColor(getActor(SubObjectTag.Guide),
                                        ColorName.Orange);

                victory = text.GetStringData(node, "Level");
                victory = color.GetColorfulText(victory, ColorName.Green);
                message.StoreText(victory);
                modeline.PrintStaticText(text.GetStringData(node, "Continue"));
            }
        }
コード例 #5
0
ファイル: Potion.cs プロジェクト: minkooz/FungusCave
        public void DrinkPotion()
        {
            if (CurrentPotion < 1)
            {
                return;
            }

            int hp = GetComponent <Infection>().HasInfection(InfectionTag.Mutated)
                ? potionData.MutatedHP
                : potionData.RestoreHP;

            GetComponent <HP>().GainHP(hp);

            GetComponent <Infection>().ResetInfection();
            GetComponent <Stress>().LoseStress(potionData.RelieveStress);
            GetComponent <Energy>().GainEnergy(potionData.RestoreEnergy);
            LosePotion(1);

            string drink = text.GetStringData(node, "Potion");

            drink = color.GetColorfulText(drink, ColorName.Orange);
            message.StoreText(drink);
            return;
        }
コード例 #6
0
ファイル: MoveActor.cs プロジェクト: minkooz/FungusCave
        public void MoveGameObject(int targetX, int targetY)
        {
            int[] start = coord.Convert(transform.position);

            if (!GetComponent <Energy>().HasEnoughEnergy())
            {
                return;
            }

            if (!terrain.IsPassable(targetX, targetY))
            {
                // Auto-explore does not work sometimes and will let the actor
                // bump into wall. This is a workaround to prevent printing an
                // error message for NPC.
                if (GetComponent <MetaInfo>().IsPC)
                {
                    modeline.PrintStaticText(
                        text.GetStringData("Combat", "Blocked"));
                }
                return;
            }

            terrain.ChangeStatus(true, start[0], start[1]);
            terrain.ChangeStatus(false, targetX, targetY);

            actor.RemoveActor(start[0], start[1]);
            actor.AddActor(gameObject, targetX, targetY);

            transform.position = coord.Convert(targetX, targetY);

            int moveEnergy = GetComponent <Energy>().GetMoveEnergy(
                start, new int[2] {
                targetX, targetY
            });

            GetComponent <Energy>().LoseEnergy(moveEnergy);
        }
コード例 #7
0
ファイル: PCMessage.cs プロジェクト: minkooz/FungusCave
 public void IsExhausted()
 {
     message.StoreText(text.GetStringData(node, "PCExhaust"));
 }