Ejemplo n.º 1
0
        /// <summary>
        /// Pop a Window to take care of the fight between the Hero and the Enemy
        /// </summary>
        /// <param name="story"></param>
        /// <param name="enemy"></param>
        /// <returns></returns>
        private bool ShowMyDialogBox(Story story, Enemy enemy)
        {
            MessageBoxFight testDialog = new MessageBoxFight()
            {
                DataContext = new FightViewModel(story.PlayerHero, enemy)
            };

            if (testDialog.ShowDialog() == true)
            {
                return(true);
            }
            else
            {
                MessageBox.Show(GlobalTranslator.Instance.Translator.ProvideValue("ErrorEscape"));
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Pop a Window to take care of the fight between the Hero and the Enemy
        /// </summary>
        /// <param name="story"></param>
        /// <param name="enemy"></param>
        /// <param name="ranTurn">The earliest turn the Hero can decide to Run from the fight</param>
        /// <param name="runEvent">The Event that will happen if the player Run</param>
        /// <returns></returns>
        private bool ShowMyDialogBox(Story story, Enemy enemy, int ranTurn, Event runEvent)
        {
            MessageBoxFight testDialog = new MessageBoxFight()
            {
                DataContext = new FightViewModel(story.PlayerHero, enemy, ranTurn)
            };

            if (testDialog.ShowDialog() == true)
            {
                if (((FightViewModel)testDialog.DataContext).RanAway)
                {
                    story.ActualParagraph.GetListDecision.Clear();
                    story.ActualParagraph.GetListDecision.Add(runEvent);
                }
                return(true);
            }
            else
            {
                MessageBox.Show(GlobalTranslator.Instance.Translator.ProvideValue("ErrorEscape"));
                return(false);
            }
        }