Exemple #1
0
        public void Cancel()
        {
            if (TargetSystem.Showing)
            {
                TargetSystem.Hide();
                if (ActionMenu.ActiveAction.Options.Count() == 1)
                {
                    ActionMenu.Show();
                    HealthCounter.Show();
                }
                else
                {
                    OptionsListMenu.Show(ActionMenu.ActiveAction.Options);
                }

                /*
                 * ActionMenu.Hide();
                 * OptionsListMenu.Show(ActionMenu.ActiveAction.Options);
                 * ActiveOption = OptionsListMenu.Active;
                 *
                 *  ActiveOption = OptionsListMenu.Active;
                 * OptionsListMenu.Hide();
                 * TargetSystem.Show(ActiveOption);
                 *
                 */
            }
            else if (OptionsListMenu.Showing)
            {
                OptionsListMenu.Hide();
                ActionMenu.Start();
                HealthCounter.Show();
            }
        }
Exemple #2
0
        public void Start()
        {
            CheckLoaded();
            BattleStateStore.State = BattleState.STARTING;

            Enemies.ForEach(enemy => enemy.OnKilled += Enemy_OnKilled);
            events.ForEach(battleEvent =>
            {
                if (battleEvent.IsAtStart(this) && battleEvent.IsReady(this))
                {
                    battleEvent.Execute(this);
                }
            });
            bool allCompleted = true;

            foreach (var ev in events)
            {
                if (!ev.Completed)
                {
                    allCompleted = false;
                    break;
                }
            }
            if (!allCompleted)
            {
                foreach (var ev in events)
                {
                    if (ev.IsAtStart(this) && !ev.Completed)
                    {
                        ev.OnCompleted((isCompleted) => {
                            OnBattleEventCompleted(isCompleted, () =>
                            {
                                ActionMenu.Start();
                                HealthCounter.Show();
                                BattleStateStore.State = BattleState.STARTED;
                            });
                        });
                    }
                }
            }
            else
            {
                ActionMenu.Start();
                HealthCounter.Show();
                BattleStateStore.State = BattleState.STARTED;
            }
        }