Ejemplo n.º 1
0
        public static void Start()
        {
            var encounterCard = EncounterLib.Encounters.First();

            CombatForm cf = new CombatForm(encounterCard);

            cf.ShowDialog();
        }
Ejemplo n.º 2
0
        protected override void OpenUIFormSuccessHandler(object sender, GameEventArgs e)
        {
            var args = (OpenUIFormSuccessEventArgs)e;

            if (args.UIForm.Logic as CombatForm)
            {
                m_CombatForm = (CombatForm)args.UIForm.Logic;
            }
        }
Ejemplo n.º 3
0
        private void RunBtn_Click(object sender, EventArgs e)
        {
            CombatState cs = new CombatState();

            cs.Encounter  = fEncounter;
            cs.PartyLevel = fPartyLevel;

            CombatForm dlg = new CombatForm(cs);

            dlg.Show();
        }
Ejemplo n.º 4
0
        private void RunBtn_Click(object sender, EventArgs e)
        {
            if (SelectedCombat != null)
            {
                Session.Project.SavedCombats.Remove(SelectedCombat);
                Session.Modified = true;

                Close();

                CombatForm dlg = new CombatForm(SelectedCombat);
                dlg.Show();
            }
        }
Ejemplo n.º 5
0
        void run_encounter(EncounterDeck deck, bool choose_map)
        {
            MapAreaSelectForm map_dlg = null;

            if (choose_map)
            {
                map_dlg = new MapAreaSelectForm(Guid.Empty, Guid.Empty);
                if (map_dlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            Encounter enc = new Encounter();
            bool      ok  = deck.DrawEncounter(enc);

            update_decks();

            if (ok)
            {
                CombatState cs = new CombatState();
                cs.Encounter  = enc;
                cs.PartyLevel = Session.Project.Party.Level;

                if ((map_dlg != null) && (map_dlg.Map != null))
                {
                    cs.Encounter.MapID = map_dlg.Map.ID;

                    if (map_dlg.MapArea != null)
                    {
                        cs.Encounter.MapAreaID = map_dlg.MapArea.ID;
                    }
                }

                CombatForm dlg = new CombatForm(cs);
                dlg.Show();
            }
            else
            {
                string str = "An encounter could not be built from this deck; check that there are enough cards remaining.";
                MessageBox.Show(str, "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 6
0
        public void Die(Player player, CombatForm combatForm, MainForm mainForm)
        {
            DialogResult victory = MessageBox.Show(combatForm,
                                                   $"{this.name} defeated!\n" +
                                                   $"Experience earned: {this.expReward(this.level)}\n" +
                                                   $"Gold found: {this.gold}g\n" +
                                                   $"Items found: wip",
                                                   "Victory!",
                                                   MessageBoxButtons.OK);

            player.IncreaseExp(this.expReward(this.level));
            player.gold += this.gold;

            mainForm.UpdateText();

            if (victory == DialogResult.OK)
            {
                combatForm.Close();
            }
        }