Ejemplo n.º 1
0
        private IEnumerator startBattle()
        {
            AddText(BATTLE_START);
            while (!IsResolved)
            {
                yield return(startRound());

                yield return(new WaitForSeconds(0.10f));
            }

            string            message = string.Empty;
            PlayerPartyStatus result  = PlayerStatus;

            if (result == PlayerPartyStatus.ALIVE)
            {
                message = VICTORY;
            }
            else if (result == PlayerPartyStatus.DEAD)
            {
                message = DEFEAT;
            }
            else     // Didn't find party
            {
                message = "...";
            }

            AddText(message);
            PostBattle(result);
        }
Ejemplo n.º 2
0
        private void PostBattle(PlayerPartyStatus status)
        {
            Grid postBattle = new Grid("Main");

            postBattle.OnEnter = () => {
                postBattle.List.Clear();
                if (status == PlayerPartyStatus.ALIVE || status == PlayerPartyStatus.NOT_FOUND)
                {
                    if (status == PlayerPartyStatus.ALIVE)
                    {
                        postBattle.List.Add(GetLootButton(postBattle));
                        if (!wasExperienceGiven)
                        {
                            wasExperienceGiven = true;
                            GiveExperienceToVictors();
                        }
                    }
                    Character anyoneFromVictorParty = VictoriousParty.FirstOrDefault();
                    postBattle.List.Add(PageUtil.GenerateItemsGrid(false, this, postBattle, anyoneFromVictorParty, PageUtil.GetOutOfBattlePlayableHandler(this)));
                    postBattle.List.Add(PageUtil.GenerateGroupEquipmentGrid(postBattle, this, VictoriousParty, PageUtil.GetOutOfBattlePlayableHandler(this), false));
                    postBattle.List.Add(new Process("Continue", () => GoToPage(victory)));
                }
                else
                {
                    postBattle.List.Add(new Process("Continue", () => GoToPage(defeat)));
                }
                Actions = postBattle.List;
            };
            postBattle.Invoke();
        }