Exemplo n.º 1
0
        public BattleForm(IPokemonParty <IPokemon> pokemonParty, IPokemonParty <IPokemon> enemyPokemonParty)
        {
            InitializeComponent();

            attackButtons[0] = btnAttack1;
            attackButtons[1] = btnAttack2;
            attackButtons[2] = btnAttack3;
            attackButtons[3] = btnAttack4;

            _battleLogController = new BattleLogController(this);
            _playerParty         = pokemonParty;
            _enemyParty          = enemyPokemonParty;
            _equipment           = EquipmentFactory.CreateEquipment();
        }
Exemplo n.º 2
0
        public static int CalculateWinnings(IPokemonParty <IPokemon> pokemonParty, IEquipment equipment)
        {
            float sum      = 0;
            int   winnings = 0;

            foreach (var pokemon in pokemonParty)
            {
                if (pokemon == null)
                {
                    break;
                }
                sum += pokemon.HPCurrent / pokemon.HPMax;
            }

            winnings = Convert.ToInt32(sum * 100 / pokemonParty.Count());
            equipment.ChangeMoneyQuantity(winnings);
            return(winnings);
        }
Exemplo n.º 3
0
        public ItemForm(IEquipment equipment, IPokemonParty <IPokemon> pokemonParty, BattleForm battleForm)
        {
            InitializeComponent();
            //if (isShopForm)
            //    this.parent = parent as AfterWinForm;
            //else
            //    this.parent = parent as BattleForm;
            _equipment    = equipment;
            _battleForm   = battleForm;
            _pokemonParty = pokemonParty;
            this.Text     = "Items";
            //this.Text = isShopForm ? "Shop" : "Items";
            int offset = 0;

            foreach (KeyValuePair <IEquipmentItem, int> item in equipment.EquipmentList)
            {
                // quantity = item.Value ;
                ItemPanel itemPanel = new ItemPanel(item.Key, item.Value, this);
                itemPanel.Location = new Point(0, offset);
                this.Controls.Add(itemPanel);
                offset += itemPanel.Size.Height;
            }
        }
Exemplo n.º 4
0
        private void PreparePartyForm(IPokemonParty <IPokemon> playerPokemonParty)
        {
            this.StartPosition   = FormStartPosition.Manual;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            this.PickedPokemon = playerPokemonParty.GetFirstAlivePokemon();
            int offset = 0;
            int index  = 0;

            foreach (IPokemon pokemon in playerPokemonParty.Pokemons)
            {
                if (pokemon != null)
                {
                    PokemonPanel pokemonPanel = new PokemonPanel(pokemon);
                    //pokemonPanel.Dock = DockStyle.Top;
                    pokemonPanel.Location = new Point(0, offset);
                    pokemonPanel.Index    = index;
                    this.Controls.Add(pokemonPanel);
                    offset += pokemonPanel.Size.Height;
                    index++;
                }
            }
        }
Exemplo n.º 5
0
 public PokemonPartyForm(Form parent, IPokemonParty <IPokemon> playerPokemonParty) : base()
 {
     this.Location = new Point(parent.Location.X + parent.Size.Width, parent.Location.Y);
     PreparePartyForm(playerPokemonParty);
 }
Exemplo n.º 6
0
 public PokemonPartyForm(IPokemonParty <IPokemon> playerPokemonParty) : base()
 {
     PreparePartyForm(playerPokemonParty);
 }