public Inventory(Program game, BattleField field) { InitializeComponent(); Potions.Text = game.getPotions(); Ally1Equipment.Text = game.PlayerTeam[0].name() + " has equipped:\r\nWeapon:\r\n" + game.PlayerTeam[0].getWeapon() + "\r\nArmor:\r\n" + game.PlayerTeam[0].getArmor(); YourEquipment.Text = game.PlayerTeam[1].name() + " has equipped:\r\nWeapon:\r\n" + game.PlayerTeam[1].getWeapon() + "\r\nArmor:\r\n" + game.PlayerTeam[1].getArmor(); Ally2Equipment.Text = game.PlayerTeam[2].name() + " has equipped:\r\nWeapon:\r\n" + game.PlayerTeam[2].getWeapon() + "\r\nArmor:\r\n" + game.PlayerTeam[2].getArmor(); this.game = game; this.field = field; if (!field.Human) { UsePotion.Visible = false; } else { UsePotion.Visible = true; } }
public override void use(Hero x, BattleField field) { field.Output.Text += ("You revived " + x.name() + " back to full health\r\n"); x.Heal(x.calcPercent(100)); }
public override void use(Hero x, BattleField field) { field.Output.Text += ("You healed " + x.name() + " for half their health\r\n"); x.Heal(x.calcPercent(50)); }
public override void loot(bool x, BattleField field) { Random r = Program.r; int chance = r.Next(101); if (x)//with theif: 60% to get a potion based on level, 20% chance to get a revive(5% chance for max), 10% to get a weapon, 10% to get armor { if (chance <= 10) { field.currentGame().weapon();//ask user who gets new weapon } else if (chance <= 10) { field.currentGame().armor();//ask user who gets new armor } else if (chance <= 40) { if (r.Next(101) <= 5) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive potion\r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive potion\r\n"); } } else { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion\r\n"); } else if (level >= 25) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion\r\n"); } else if (level >= 5) { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion\r\n"); } else { Program.AddLoot(new Basic()); field.Output.Text += ("You looted 1 basic potion\r\n"); } } } else//without theif: 70% to get a potion based on level, 10% chance to get a revive, 5% to get a weapon, 5% to get armor, 10% to get nothing { if (chance <= 70) { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion\r\n"); } else if (level >= 25) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion from\r\n"); } else if (level >= 5) { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion from\r\n"); } else { Program.AddLoot(new Basic()); field.Output.Text += ("You looted 1 basic potion\r\n"); } } else if (chance <= 80) { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive potion\r\n"); } else if (chance <= 85) { field.currentGame().weapon(); } else if (chance <= 90) { field.currentGame().armor(); } } }
public override void loot(bool x, BattleField field) { Random r = Program.r; int chance = r.Next(101); if (x)//with thief: 30% chance to get an advanced or higher potion ,30% chance to get a revive(15% chance for max) ,20% chance to get a weapon, 20% chance to get armor { if (chance <= 20) { field.currentGame().weapon();//ask user who gets new weapon } else if (chance <= 40) { field.currentGame().armor();//ask user who gets new armor } else if (chance <= 70) { if (r.Next(101) <= 15) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive\r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive\r\n"); } } else { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion\r\n"); } else if (level >= 25) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion\r\n"); } else { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion\r\n"); } } } else//without if: 20% chance to get a revive(with 10% for max revive) ,50% chance to get an advanced or higher potion ,15% chance to get a weapon, 15% chance to get armor { if (chance <= 15) { field.currentGame().weapon();//ask user who gets new weapon } else if (chance <= 30) { field.currentGame().armor(); } else if (chance <= 80) { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion\r\n"); } else if (level >= 25) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion\r\n"); } else { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion\r\n"); } } else { if (r.Next(101) <= 10) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive\r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive\r\n"); } } } }
public override void loot(bool x, BattleField field) { Random r = Program.r; int chance = r.Next(101); if (x)//with theif: 40% to get an advanced potion or higher ,20% to get a revive(10% to get max revive) ,15% to get a weapon, 25% to get armor { if (chance <= 25) { field.currentGame().armor();//ask user who gets new armor } else if (chance <= 40) { field.currentGame().weapon(); } else if (chance <= 60) { if (r.Next(101) <= 10) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive potion\r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive potion from\r\n"); } } else { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion \r\n"); } else if (level >= 20) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion \r\n"); } else { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion \r\n"); } } } else//without theif: 60% to get an advance potion or higher, 15% chance to get a revive(5% chance to get a max revive) ,10% to get a weapon, 15% to get armor { if (chance <= 15) { if (r.Next(101) <= 5) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive potion \r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive potion \r\n"); } } else if (chance <= 25) { field.currentGame().weapon();//ask user who gets new weapon } else if (chance <= 40) { field.currentGame().armor(); } else { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion \r\n"); } else if (level >= 25) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion \r\n"); } else { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion \r\n"); } } } }
public SelectTarget(BattleField field, Program game, Inventory inventory) { InitializeComponent(); this.field = field; this.game = game; this.inventory = inventory; Button[] buttons = { Ally1, You, Ally2 }; for (int x = 0; x < 3; x++) { buttons[x].Text = game.PlayerTeam[x] + ""; if (inventory.type >= 5) { if (game.PlayerTeam[x].health > 0) { buttons[x].Enabled = false; } else { buttons[x].Enabled = true; } } else if (game.PlayerTeam[x].health > 0 && game.PlayerTeam[x].health < game.PlayerTeam[x].maxhealth) { buttons[x].Enabled = true; } else { buttons[x].Enabled = false; } } int count = 0; foreach (Button x in buttons) { if (!x.Enabled) { count++; } } if (count == 3) { new Popup("You cannot use that potion"); inventory.use = false; this.Close(); } if (inventory.type == 1) { potion = new Basic(); } else if (inventory.type == 2) { potion = new Advanced(); } else if (inventory.type == 3) { potion = new Super(); } else if (inventory.type == 4) { potion = new Mega(); } else if (inventory.type == 5) { potion = new Revive(); } else { potion = new MaxRevive(); } }
public override void loot(bool x, BattleField field) { Random r = Program.r; int chance = r.Next(101); if (x)//with theif: 5% to get 2 potions based on level or higher ,50% to get an advanced potion or higher(95%),15% to get a revive or a mega revive(5%),15% to get a new weapon, 15% to get armor { if (chance <= 15) { field.currentGame().weapon();//ask user who gets new weapon } else if (chance <= 15) { field.currentGame().armor(); } else if (chance <= 45) { if (r.Next(101) <= 5) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 2 revive potion\r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive potion\r\n"); } } else if (chance <= 95) { if (r.Next(101) <= 5) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive \r\n"); } else { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion \r\n"); } else if (level >= 20) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion \r\n"); } else { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion \r\n"); } } } else { if (level >= 60) { for (int y = 0; y < 2; y++) { Program.AddLoot(new Mega()); } field.Output.Text += ("You looted 2 mega potion \r\n"); } else if (level >= 30) { for (int y = 0; y < 2; y++) { Program.AddLoot(new Super()); } field.Output.Text += ("You looted 2 super potion \r\n"); } else if (level >= 10) { for (int y = 0; y < 2; y++) { Program.AddLoot(new Advanced()); } field.Output.Text += ("You looted 2 advanced potion \r\n"); } else { for (int y = 0; y < 2; y++) { Program.AddLoot(new Basic()); } field.Output.Text += ("You looted 2 basic potion \r\n"); } } } else//without theif: 10% to chance 2 potions based on level ,10% chance to get a revive ,10% to get a weapon, 10% to get armor,60% to get a potion based on level { if (chance <= 60) { if (level >= 50) { Program.AddLoot(new Mega()); field.Output.Text += ("You looted 1 mega potion \r\n"); } else if (level >= 25) { Program.AddLoot(new Super()); field.Output.Text += ("You looted 1 super potion \r\n"); } else if (level >= 5) { Program.AddLoot(new Advanced()); field.Output.Text += ("You looted 1 advanced potion \r\n"); } else { Program.AddLoot(new Basic()); field.Output.Text += ("You looted 1 basic potion \r\n"); } } else if (chance <= 70) { if (r.Next(101) <= 5) { Program.AddLoot(new MaxRevive()); field.Output.Text += ("You looted 1 max revive potion \r\n"); } else { Program.AddLoot(new Revive()); field.Output.Text += ("You looted 1 revive potion \r\n"); } } else if (chance <= 80) { field.currentGame().weapon();//ask user who gets new weapon } else if (chance <= 90) { field.currentGame().armor(); } else { if (level >= 60) { for (int y = 0; y < 2; y++) { Program.AddLoot(new Mega()); } field.Output.Text += ("You looted 2 mega potions \r\n"); } else if (level >= 30) { for (int y = 0; y < 2; y++) { Program.AddLoot(new Super()); } field.Output.Text += ("You looted 2 super potions \r\n"); } else if (level >= 10) { for (int y = 0; y < 2; y++) { Program.AddLoot(new Advanced()); } field.Output.Text += ("You looted 2 advanced potions \r\n"); } else { for (int y = 0; y < 2; y++) { Program.AddLoot(new Basic()); } field.Output.Text += ("You looted 2 basic potions \r\n"); } } } }
public abstract void loot(bool x, BattleField field);
public override void use(Hero x, BattleField field) { field.Output.Text += ("You healed " + x.name() + " for 25 health\r\n"); x.Heal(25); }
public abstract void use(Hero x, BattleField field);
public override abstract void loot(bool x, BattleField field);