Beispiel #1
0
        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();
                }
            }
        }
Beispiel #2
0
        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");
                    }
                }
            }
        }
Beispiel #3
0
        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");
                    }
                }
            }
        }
Beispiel #4
0
        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");
                    }
                }
            }
        }