コード例 #1
0
ファイル: LootDrops.cs プロジェクト: tjschwartz7/LootDemo
        public static void GetArmor(player newPlayer)
        {
            Random rand = new Random();
            //initialize armor to be returned

            armor Armor = new armor();

            int rng = rand.Next(1, 100);

            if (rng >= 96)
            {
                Armor = LegendaryDrops.PullLegendaryArmor(newPlayer);
            }
            else
            {
                Armor = ArmorStats.GetEffects(newPlayer, Armor);
                while (true)
                {
                    Console.WriteLine("Would you like to equip this armor?");
                    Console.WriteLine("Current set: ");
                    ArmorStats.ShowArmorStats(newPlayer.armorEquipped);
                    Console.WriteLine("\nNew set: ");
                    ArmorStats.ShowArmorStats(Armor);
                    Console.WriteLine("Would you like to equip the new armor?");
                    string armorChoice = Console.ReadLine();
                    if (armorChoice.ToLower() == "yes")
                    {
                        newPlayer.armorEquipped = Armor;
                        break;
                    }
                    else if (armorChoice.ToLower() == "no")
                    {
                        Console.WriteLine("You toss the armor to the side.");
                        break;
                    }
                    Console.Clear();
                }
            }
        }
コード例 #2
0
        public static armor PullLegendaryArmor(player newPlayer)
        {
            armor  Armor    = new armor();
            Random rand     = new Random();
            int    armorRNG = rand.Next(20);

            if (armorRNG == 0)
            {
                //Chance to reflect bullets, nothing
                armor PowerArmor = new armor("T51-B Power Armor", "Reflect", 6, 1, 130);
                Armor = PowerArmor;
            }
            else if (armorRNG == 1)
            {
                //Critical percent, critical multiplier
                armor ShadowShroud = new armor("Shadow Shroud", "Critical Boost", 5, 1, 25);
                Armor = ShadowShroud;
            }
            else if (armorRNG == 2)
            {
                //RPG Damage, RPG Accuracy
                armor Astro = new armor("The Astro", "RPG Specialist", 10, 5, 45);
                Armor = Astro;
            }
            else if (armorRNG == 3)
            {
                //Pistol damage, pistol accuracy
                armor Cowboy = new armor("The Cowboy", "Pistol Specialist", 4, 10, 35);
                Armor = Cowboy;
            }
            else if (armorRNG == 4)
            {
                //Shotgun damage, shotgun accuracy
                armor Enforcer = new armor("The Enforcer", "Shotgun Specialist", 6, 4, 30);
                Armor = Enforcer;
            }
            else if (armorRNG == 5)
            {
                //Assault Rifle damage, accuracy
                armor Mercenary = new armor("The Mercenary", "Assault Rifle Specialist", 3, 3, 40);
                Armor = Mercenary;
            }
            else if (armorRNG == 6)
            {
                //SMG damage, SMG Accuracy
                armor Mobster = new armor("The Mobster", "SMG Specialist", 2, 4, 45);
                Armor = Mobster;
            }
            else if (armorRNG == 7)
            {
                //Melee Damage, melee accuracy
                armor Gladiator = new armor("The Gladiator", "Melee Specialist", 8, 3, 55);
                Armor = Gladiator;
            }
            else if (armorRNG == 8)
            {
                armor MartianSpaceSuit = new armor("Martian Space Suit", "Laser Specialist", 8, 25, 45);
                Armor = MartianSpaceSuit;
            }
            else if (armorRNG == 9)
            {
                armor MirrorGear = new armor("Mirror Gear", "Reflect", 12, 1, 120);
                Armor = MirrorGear;
            }
            else if (armorRNG == 10)
            {
                armor MasterSet = new armor("Master Set", "Universal Specialist", 2, 2, 35);
                Armor = MasterSet;
            }
            else if (armorRNG == 11)
            {
                armor NovaArmor = new armor("Nova Armor", "Stun", 15, 1, 95);
                Armor = NovaArmor;
            }
            else if (armorRNG == 12)
            {
                armor HellArmor = new armor("Hell Armor", "Damage Boost", 3, 1, 125);
                Armor = HellArmor;
            }
            else if (armorRNG == 13)
            {
                armor SniperOutfit = new armor("Sniper's Outfit", "Accuracy Boost", 15, 1, 110);
                Armor = SniperOutfit;
            }
            else if (armorRNG == 14)
            {
                armor TitanArmor = new armor("Titan Armor", "", 1, 1, 185);
                Armor = TitanArmor;
            }



            return(Armor);
        }
コード例 #3
0
ファイル: ArmorStats.cs プロジェクト: tjschwartz7/LootDemo
 public static void ShowArmorStats(armor armorEquipped)
 {
     Console.WriteLine("Armor:\nName: " + armorEquipped.name + "\nDefense: " + armorEquipped.defense + "\nEffect: " + armorEquipped.effect);
 }
コード例 #4
0
ファイル: ArmorStats.cs プロジェクト: tjschwartz7/LootDemo
        public static armor GetEffects(player newPlayer, armor newArmor)
        {
            Random rand = new Random();

            if ((newArmor.defense <= 4 + newPlayer.level && newPlayer.level <= 25) || (newArmor.defense <= newPlayer.level - 10 && (newPlayer.level <= 50 && newPlayer.level > 25)) || (newArmor.defense <= newPlayer.level - 25 && newPlayer.level > 50))
            {
                if (newPlayer.level <= 10)
                {
                    newArmor.defense = rand.Next(1, 10);
                }
                else if (newPlayer.level <= 15)
                {
                    newArmor.defense = rand.Next(2, 20);
                }
                else if (newPlayer.level <= 20)
                {
                    newArmor.defense = rand.Next(3, 30);
                }
                else if (newPlayer.level <= 25)
                {
                    newArmor.defense = rand.Next(5, 40);
                }
                else if (newPlayer.level <= 35)
                {
                    newArmor.defense = rand.Next(10, 50);
                }
                else if (newPlayer.level <= 45)
                {
                    newArmor.defense = rand.Next(15, 65);
                }
                else if (newPlayer.level <= 60)
                {
                    newArmor.defense = rand.Next(15, 75);
                }
                else if (newPlayer.level <= 80)
                {
                    newArmor.defense = rand.Next(15, 100);
                }
                else if (newPlayer.level <= 100)
                {
                    newArmor.defense = rand.Next(20, 140);
                }
                else
                {
                    newArmor.defense = rand.Next(25, 150);
                }

                int rng = rand.Next(0, 3);
                if (rng == 0)
                {
                    newArmor.effect = "Reflect";
                    newArmor.bonus1 = rand.Next(3, 7);
                    newArmor.bonus2 = 1;
                }
                else if (rng == 1)
                {
                    newArmor.effect = "Stun";
                    newArmor.bonus1 = rand.Next(4, 8);
                    newArmor.bonus2 = 1;
                }
                else if (rng == 1)
                {
                    newArmor.effect = "Damage Boost";
                    newArmor.bonus1 = rand.Next(1, 2);
                    newArmor.bonus2 = 0;
                }
                else if (rng == 2)
                {
                    newArmor.effect = "Accuracy Boost";
                    newArmor.bonus1 = rand.Next(3, 6);
                    newArmor.bonus2 = 0;
                }
            }
            else
            {
                newArmor.effect = "";
                newArmor.bonus1 = 0;
                newArmor.bonus2 = 0;
            }



            return(newArmor);
        }