Beispiel #1
0
        public static Enemy GetMonster(int enemyID)
        {
            // Animal enemies only drop items (like skins, fangs etc). Gold only from humanoid enemies
            switch (enemyID)
            {
            case 0:
                Enemy snake =
                    new Enemy("Snake", 1, 5, 3, 3, 1, 1, 3, 10, 0, 65, World.EnemyIDSnake, false, 1);
                snake.Avatar = @"/Images/Creatures/Enemies/Village/snake.png";
                snake.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDSnakeSkin));
                snake.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDSnakeFang));
                snake.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDSnakeEye));
                return(snake);

            case 1:
                Enemy rat =
                    new Enemy("Rat", 1, 4, 5, 3, 1, 1, 4, 5, 0, 35, World.EnemyIDRat, false, 1);
                rat.Avatar = @"/Images/Creatures/Enemies/Village/rat.png";
                rat.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDRatSkin));
                rat.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDRatTail));
                return(rat);

            case 2:
                Enemy goblin =
                    new Enemy("Goblin", 2, 7, 4, 4, 1, 1, 3, 10, 10, 45, World.EnemyIDGoblin, true, 3);
                goblin.Avatar = @"/Images/Creatures/Enemies/Forest/goblin.png";
                goblin.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDGoblinSkin));
                goblin.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDGoblinFang));
                return(goblin);

            case 3:
                Enemy wolf =
                    new Enemy("Wolf", 2, 8, 8, 4, 1, 1, 3, 20, 0, 55, World.EnemyIDWolf, true, 5);
                wolf.Avatar = @"/Images/Creatures/Enemies/Forest/wolf.png";
                wolf.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDWolfSkin));
                wolf.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDWolfFang));
                return(wolf);

            case 4:
                Enemy rogue =
                    new Enemy("Rogue", 3, 6, 5, 6, 1, 2, 5, 30, 20, 35, World.EnemyIDRogue, true, 5);
                rogue.Avatar = @"/Images/Creatures/Enemies/Forest/rogue.png";
                rogue.SkillBook.Add(World.SkillByID(World.SwordSKillIDHeavyStrike));
                return(rogue);

            case 5:
                Enemy forestWisp =
                    new Enemy("Forest Wisp", 3, 5, 3, 5, 10, 7, 5, 30, 0, 25, 5, false, 3);
                forestWisp.Avatar = @"/Images/Creatures/Enemies/Forest/forestWisp.png";
                forestWisp.SkillBook.Add(World.SkillByID(World.MagicIDFireball));
                forestWisp.Inventory.Add(ItemsFactory.CreateGameItem(World.EnemyLootIDWispDust));
                return(forestWisp);

            default:
                throw new ArgumentException(string.Format("MonsterType '{0}' does not exist", enemyID));
            }
        }
Beispiel #2
0
        internal World CreateWorld()
        {
            World newWorld = new World();

            newWorld.AddQuest("Welcome to the Village", World.QuestIDWelcomeToVillage, "Elder wants me to kill rat and bring 5 rat skins", "Bring me 5 rat skins", "I'm still waiting for 5 rat skins", "Finally, now rats will stop bothering this village, for now.", ItemsFactory.ItemByID(World.EnemyLootIDRatSkin), 5, 100, 50);

            NPC villageElder = new NPC("Village Elder", World.NPCIDVillageElder, "Welcome to our humble village, traveller.", World.QuestByID(World.QuestIDWelcomeToVillage));

            Shop villageShop = new Shop(World.ShopIDVillageShop);

            villageShop.Inventory.Add(ItemsFactory.CreateGameItem(World.ItemIDSmallHealingPotion));
            villageShop.Inventory.Add(ItemsFactory.CreateGameItem(World.ItemIDSmallManaPotion));

            newWorld.AddRegion("Village", World.RegionIDVillage);
            newWorld.RegionByID(World.RegionIDVillage).AddEnemy(EnemyFactory.GetMonster(World.EnemyIDRat));
            newWorld.RegionByID(World.RegionIDVillage).AddEnemy(EnemyFactory.GetMonster(World.EnemyIDSnake));

            newWorld.AddRegion("Forest", World.RegionIDForest);
            newWorld.RegionByID(World.RegionIDForest).AddEnemy(EnemyFactory.GetMonster(World.EnemyIDGoblin));
            newWorld.RegionByID(World.RegionIDForest).AddEnemy(EnemyFactory.GetMonster(World.EnemyIDWolf));
            newWorld.RegionByID(World.RegionIDForest).AddEnemy(EnemyFactory.GetMonster(World.EnemyIDRogue));
            newWorld.RegionByID(World.RegionIDForest).AddEnemy(EnemyFactory.GetMonster(World.EnemyIDForestWisp));

            newWorld.AddRace("Human", 0, 0, 0, 0, 0, 0, World.RaceIDHuman);
            newWorld.AddRace("Elf", -2, 2, -2, 1, 0, 1, World.RaceIDElf);
            newWorld.AddRace("Dwarf", 2, -2, 2, -2, 0, 0, World.RaceIDDwarf);
            newWorld.AddRace("DogFolk", -1, -2, 0, 2, 2, -1, World.RaceIDDogFolk);
            newWorld.AddRace("CatFolk", -2, 2, -1, 0, -1, 2, World.RaceIDCatFolk);

            newWorld.AddStatusEffect("Burn", World.StatusEffectIDBurn, "Fire covered your body and dealing Damage: 5% of maxHP. Duration: 3 turns.", 5f, 0, 3, StatusEffect.StatusType.DamageOverTime);
            newWorld.AddStatusEffect("Bleed", World.StatusEffectIDBleed, "Opened wound is bleeding, dealing Damage: 3% of maxHP. Duration: 5 turns.", 3f, 0, 5, StatusEffect.StatusType.DamageOverTime);
            newWorld.AddStatusEffect("Regeneration", World.StatusEffectIDRegeneration, "Your wounds is curing over time. Healing: 3% of maxHP. Duration: 3 turns.", 3f, 0, 3, StatusEffect.StatusType.HealOverTime);

            newWorld.AddSpecialAttack("Fireball", World.MagicIDFireball, "Throw a fireball to enemy. Base Damage: 3 + 0.8 for each Intelligence point. Mana cost: 5", 3f, 5, 0.8f, World.StatusEffectByID(World.StatusEffectIDBurn), Skills.Target.Enemy, Skills.Attribute.Intelligence, Skills.SpecialAttackType.Magic, GameItems.WeaponType.None);
            newWorld.AddSpecialAttack("IceArrow", World.MagicIDIceArrow, "Create an arrow of ice and shoot it to the enemy. Base Damage: 2 + 1.2 for each Intelligence point. Mana cost: 7", 1f, 7, 1.2f, null, Skills.Target.Enemy, Skills.Attribute.Intelligence, Skills.SpecialAttackType.Magic, GameItems.WeaponType.None);
            newWorld.AddSpecialAttack("ThunderStrike", World.MagicIDThunderStrike, "Summon a thunder than strike the enemy. Base Damage: 5 + 1 for each Intelligence point. Mana cost: 10", 5f, 10, 1f, null, Skills.Target.Enemy, Skills.Attribute.Intelligence, Skills.SpecialAttackType.Magic, GameItems.WeaponType.None);
            newWorld.AddSpecialAttack("Small Heal", World.MagicIDSmallHeal, "Cure yourself with magic. Base healing: 5 + 1.5 for Mind point. Mana cost: 10", 5, 10, 1.5f, null, SpecialAttack.Skills.Target.Self, Skills.Attribute.Mind, Skills.SpecialAttackType.Magic, GameItems.WeaponType.None);
            newWorld.AddSpecialAttack("Regeneration", World.MagicIDSmallHeal, "Casting regeneration, that heal your wounds over time. Base healing: 5 + 1.5 for Mind point. Mana cost: 10", 5, 10, 1.5f, World.StatusEffectByID(World.StatusEffectIDRegeneration), Skills.Target.Self, Skills.Attribute.Mind, Skills.SpecialAttackType.Magic, GameItems.WeaponType.None);


            newWorld.AddSpecialAttack("Sword: Fast Strike", World.SwordSKillIDFastStrike, "Deal fast strike with sword. Base Damage: 3 + 0.8 for each Agility point. Mana Cost: 5", 3, 5, 0.8f, null, Skills.Target.Enemy, Skills.Attribute.Agility, Skills.SpecialAttackType.Skill, GameItems.WeaponType.Sword);
            newWorld.AddSpecialAttack("Sword: Heavy Strike", World.SwordSKillIDHeavyStrike, "Deal heavy strike with sword. Base Damage: 5 + 1.5 for each Strength point. Mana Cost 15", 5, 15, 1.5f, World.StatusEffectByID(World.StatusEffectIDBleed), Skills.Target.Enemy, Skills.Attribute.Strength, Skills.SpecialAttackType.Skill, GameItems.WeaponType.Sword);
            newWorld.AddSpecialAttack("Sword: MultiHit", World.SwordSKillIDMultiHit, "Deals multiple hits (from 2 to 5). Base Damage from 1 hit: 2 + 0.5 for each Agility point. Mana Cost 10", 2, 10, 0.5f, null, Skills.Target.Enemy, Skills.Attribute.Agility, Skills.SpecialAttackType.Skill, GameItems.WeaponType.Sword);

            newWorld.AddLocation(0, -1, "Garden",
                                 "Your Garden", newWorld.RegionByID(World.RegionIDVillage), true);

            newWorld.AddLocation(0, 0, "Home",
                                 "Home sweet home", newWorld.RegionByID(World.RegionIDVillage), true);

            newWorld.AddLocation(0, 1, "House garden",
                                 "This is your garden", newWorld.RegionByID(World.RegionIDVillage), false);

            newWorld.AddLocation(0, 2, "Road to the House",
                                 "Road to your house", newWorld.RegionByID(World.RegionIDVillage), false);

            newWorld.AddLocation(0, 3, "North Street",
                                 "North Street. Most popular street in village. Here you can buy items.", newWorld.RegionByID(World.RegionIDVillage), false, null, villageElder);

            newWorld.AddLocation(-1, 3, "Village Shop",
                                 "Local shop", newWorld.RegionByID(World.RegionIDVillage), false, villageShop);

            newWorld.AddLocation(0, 4, "North Road to the Forest",
                                 "Road to the forest", newWorld.RegionByID(World.RegionIDVillage), false);

            newWorld.AddLocation(0, 5, "Forest South Entrance",
                                 "South forest entrance", newWorld.RegionByID(World.RegionIDForest), false);

            newWorld.AddLocation(0, 6, "Forest Crossroad",
                                 "South forest crossroad", newWorld.RegionByID(World.RegionIDForest), false);

            return(newWorld);
        }
Beispiel #3
0
        public GameSession()
        {
            Hero = new Hero("", 1, 5, 5, 5, 5, 5, 5);

            WorldFactory factory = new WorldFactory();

            CurrentWorld    = factory.CreateWorld();
            CurrentLocation = CurrentWorld.LocationAt(0, 0); // Starting position (home)
            Checkpoint      = CurrentWorld.LocationAt(0, 0); // Starting checkpoint

            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.WeaponIDWoodStaff));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.WeaponIDWoodSword));

            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDNoHeadArmor));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDNoBodyArmor));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDNoLegsArmor));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDNoFeetArmor));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDSilkHat));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDSilkRobe));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDSilkPants));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ArmorIDSilkSandals));

            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ItemIDSmallHealingPotion));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ItemIDSmallHealingPotion));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ItemIDSmallManaPotion));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.ItemIDSmallManaPotion));

            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.MaterialIDHealingGrass));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.MaterialIDHealingGrass));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.MaterialIDHealingGrass));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.MaterialIDHealingGrass));

            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.EnemyLootIDRatTail));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.EnemyLootIDRatTail));
            Hero.AddItemToInventory(ItemsFactory.CreateGameItem(World.EnemyLootIDSnakeFang));

            Hero.PlayersGarden.AvailableSeeds.Add(ItemsFactory.CreateGameItem(World.SeedIDHealingGrass));

            Hero.RecipeList.Add(RecipeFactory.RecipeByID(World.AlchemyRecipeIDSmallHealingPotion));
            Hero.RecipeList.Add(RecipeFactory.RecipeByID(World.AlchemyRecipeIDSmallManaPotion));

            Hero.SkillBook.Add(World.SkillByID(World.MagicIDFireball));
            Hero.SkillBook.Add(World.SkillByID(World.MagicIDSmallHeal));

            Hero.SkillBook.Add(World.SkillByID(World.SwordSKillIDFastStrike));

            // Equip starting gear
            Hero.CurrentWeapon    = Hero.Inventory[World.WeaponIDWoodStaff];
            Hero.CurrentHeadArmor = Hero.Inventory[World.ArmorIDNoHeadArmor];
            Hero.CurrentBodyArmor = Hero.Inventory[World.ArmorIDNoBodyArmor];
            Hero.CurrentLegsArmor = Hero.Inventory[World.ArmorIDNoLegsArmor];
            Hero.CurrentFeetArmor = Hero.Inventory[World.ArmorIDNoFeetArmor];

            // Bad way to remove equiped items from inventory, but works for now...
            Hero.Inventory.Remove(Hero.CurrentWeapon);
            Hero.Inventory.Remove(Hero.CurrentHeadArmor);
            Hero.Inventory.Remove(Hero.CurrentBodyArmor);
            Hero.Inventory.Remove(Hero.CurrentLegsArmor);
            Hero.Inventory.Remove(Hero.CurrentFeetArmor);


            for (int i = 0; i < Hero.PlayersGarden.Size; i++)
            {
                if (Hero.PlayersGarden.Slots[i] == null)
                {
                    Hero.PlayersGarden.Slots[i] = new GameItems("Empty Slot", -1, 0, 0, GameItems.TypeOfItem.Seed);
                }
            }

            GetEnemyAtRegion();
        }