Beispiel #1
0
        public MainWindow()
        {
            Gnomes      = new ObservableCollection <GnomeRow>();
            Professions = new List <Profession>();
            Enemies     = new List <EnemyRow>();

            InitializeComponent();
            InitializeTabs();
            InitializeGnomoria();

            ProgressBar.Visibility = Visibility.Hidden;
            GameLoaded             = false;
            ShowWorld(null, null);

            ItemList.ItemsSource     = ItemRow.GetItems();
            MaterialList.ItemsSource = MaterialRow.GetMaterials();
            //QualityList.ItemsSource = QualityRow.GetQualities();
            ItemList.SelectedIndex     = 145;
            MaterialList.SelectedIndex = 59;
            //QualityList.SelectedIndex = 5;
        }
Beispiel #2
0
        public string CreateItem(ItemRow item, MaterialRow material, int amount, Vector3 position)
        {
            string name = "";

            for (var i = 0; i < amount; i++)
            {
                switch (item.ItemId)
                {
                    case ItemID.LeatherArmorPanel:
                    case ItemID.LeatherBoot:
                    case ItemID.LeatherBracer:
                    case ItemID.LeatherCuirass:
                    case ItemID.LeatherGlove:
                    case ItemID.LeatherGreave:
                    case ItemID.LeatherHelm:
                    case ItemID.LeatherStrap:
                    case ItemID.BoneShirt:
                    case ItemID.Needle:
                    case ItemID.Statuette:
                    case ItemID.Sausage:
                    case ItemID.SausageOmelette:
                    case ItemID.Sandwich:
                    case ItemID.SkullHelmet:
                    case ItemID.Wine:
                    case ItemID.Barrel:
                    case ItemID.Bed:
                    case ItemID.BedFrame:
                    case ItemID.Bellows:
                    case ItemID.Cabinet:
                    case ItemID.Chair:
                    case ItemID.Crate:
                    case ItemID.CrossbowStock:
                    case ItemID.Dresser:
                    case ItemID.FancyBedFrame:
                    case ItemID.FancyBed:
                    case ItemID.Haft:
                    case ItemID.Hilt:
                    case ItemID.Loom:
                    case ItemID.TrainingDummy:
                    case ItemID.Wheelbarrow:
                    case ItemID.WoodDoor:
                    case ItemID.WoodenShield:
                    case ItemID.Workbench:
                    case ItemID.Block:
                    case ItemID.Chisel:
                    case ItemID.Furnace:
                    case ItemID.Hearth:
                    case ItemID.Knife:
                    case ItemID.Mold:
                    case ItemID.PetRock:
                    case ItemID.Pillar:
                    case ItemID.Sawblade:
                    case ItemID.Statue:
                    case ItemID.Stick:
                    case ItemID.StoneDoor:
                    case ItemID.StoneHammer:
                    case ItemID.StoneHandAxe:
                    case ItemID.StoneKnifeBlade:
                    case ItemID.StoneSword:
                    case ItemID.Table:
                    case ItemID.Torch:
                    case ItemID.Trough:
                    case ItemID.Gem:
                    case ItemID.AmmoPouch:
                    case ItemID.Bag:
                    case ItemID.Bandage:
                    case ItemID.Mattress:
                    case ItemID.Padding:
                    case ItemID.String:
                    case ItemID.Bolt:
                    case ItemID.AlarmBell:
                    case ItemID.Anvil:
                    case ItemID.ArmorPlate:
                    case ItemID.Axle:
                    case ItemID.BallPeenHammer:
                    case ItemID.Bar:
                    case ItemID.BattleAxe:
                    case ItemID.BattleAxeHead:
                    case ItemID.BladeTrap:
                    case ItemID.Blunderbuss:
                    case ItemID.BlunderbussBarrel:
                    case ItemID.Boot:
                    case ItemID.Breastplate:
                    case ItemID.Claymore:
                    case ItemID.ClaymoreBlade:
                    case ItemID.CommemorativeCoin:
                    case ItemID.Crossbow:
                    case ItemID.CrossbowBolt:
                    case ItemID.CrossbowBow:
                    case ItemID.CuttingWheel:
                    case ItemID.Cylinder:
                    case ItemID.File:
                    case ItemID.MechanicalWall:
                    case ItemID.Gauntlet:
                    case ItemID.Gear:
                    case ItemID.Gearbox:
                    case ItemID.GemmedNecklace:
                    case ItemID.GemmedRing:
                    case ItemID.Greave:
                    case ItemID.Hammer:
                    case ItemID.HammerHead:
                    case ItemID.HandAxe:
                    case ItemID.HandAxeHead:
                    case ItemID.Handcrank:
                    case ItemID.Hatch:
                    case ItemID.Helmet:
                    case ItemID.Lever:
                    case ItemID.MechanismBase:
                    case ItemID.MetalSliver:
                    case ItemID.MusketRound:
                    case ItemID.Necklace:
                    case ItemID.Pauldron:
                    case ItemID.Pickaxe:
                    case ItemID.PickaxeHead:
                    case ItemID.Pistol:
                    case ItemID.PistolBarrel:
                    case ItemID.PressurePlate:
                    case ItemID.Ring:
                    case ItemID.Rod:
                    case ItemID.Screw:
                    case ItemID.Shield:
                    case ItemID.ShieldBacking:
                    case ItemID.ShieldBoss:
                    case ItemID.Spike:
                    case ItemID.SpikeTrap:
                    case ItemID.Spring:
                    case ItemID.Sword:
                    case ItemID.SwordBlade:
                    case ItemID.TowerShield:
                    case ItemID.TowerShieldBacking:
                    case ItemID.TrapBase:
                    case ItemID.Warhammer:
                    case ItemID.WarhammerHead:
                    case ItemID.Wrench:
                    case ItemID.Cheese:
                    case ItemID.CheeseOmelette:
                    case ItemID.MushroomOmelette:
                    case ItemID.Bread:
                    case ItemID.Plank:
                        /*var complexItem = CreateComplexItem(item.ItemId, material.Material, position);
                        name = complexItem.Name();
                        break;*/
                    case ItemID.Bone:
                    case ItemID.Clipping:
                    case ItemID.Egg:
                    case ItemID.Fruit:
                    case ItemID.Meat:
                    case ItemID.Milk:
                    case ItemID.Mushroom:
                    case ItemID.RawCloth:
                    case ItemID.RawCoal:
                    case ItemID.RawGem:
                    case ItemID.RawHide:
                    case ItemID.RawOre:
                    case ItemID.RawSoil:
                    case ItemID.RawStone:
                    case ItemID.RawWood:
                    case ItemID.Seed:
                    case ItemID.Skull:
                    case ItemID.Straw:
                    case ItemID.Wheat:
                    default:
                        var newItem = CreateSimpleItem(item.ItemId, material.Material, position);
                        GnomanEmpire.Instance.Fortress.AddItem(newItem);
                        name = newItem.Name();
                        break;
                }
            }
            return name;
        }
Beispiel #3
0
        public string CreateItem(ItemRow item, MaterialRow material, int amount, Vector3 position)
        {
            string name = "";

            for (var i = 0; i < amount; i++)
            {
                switch (item.ItemId)
                {
                case ItemID.LeatherArmorPanel:
                case ItemID.LeatherBoot:
                case ItemID.LeatherBracer:
                case ItemID.LeatherCuirass:
                case ItemID.LeatherGlove:
                case ItemID.LeatherGreave:
                case ItemID.LeatherHelm:
                case ItemID.LeatherStrap:
                case ItemID.BoneShirt:
                case ItemID.Needle:
                case ItemID.Statuette:
                case ItemID.Sausage:
                case ItemID.SausageOmelette:
                case ItemID.Sandwich:
                case ItemID.SkullHelmet:
                case ItemID.Wine:
                case ItemID.Barrel:
                case ItemID.Bed:
                case ItemID.BedFrame:
                case ItemID.Bellows:
                case ItemID.Cabinet:
                case ItemID.Chair:
                case ItemID.Crate:
                case ItemID.CrossbowStock:
                case ItemID.Dresser:
                case ItemID.FancyBedFrame:
                case ItemID.FancyBed:
                case ItemID.Haft:
                case ItemID.Hilt:
                case ItemID.Loom:
                case ItemID.TrainingDummy:
                case ItemID.Wheelbarrow:
                case ItemID.WoodDoor:
                case ItemID.WoodenShield:
                case ItemID.Workbench:
                case ItemID.Block:
                case ItemID.Chisel:
                case ItemID.Furnace:
                case ItemID.Hearth:
                case ItemID.Knife:
                case ItemID.Mold:
                case ItemID.PetRock:
                case ItemID.Pillar:
                case ItemID.Sawblade:
                case ItemID.Statue:
                case ItemID.Stick:
                case ItemID.StoneDoor:
                case ItemID.StoneHammer:
                case ItemID.StoneHandAxe:
                case ItemID.StoneKnifeBlade:
                case ItemID.StoneSword:
                case ItemID.Table:
                case ItemID.Torch:
                case ItemID.Trough:
                case ItemID.Gem:
                case ItemID.AmmoPouch:
                case ItemID.Bag:
                case ItemID.Bandage:
                case ItemID.Mattress:
                case ItemID.Padding:
                case ItemID.String:
                case ItemID.Bolt:
                case ItemID.AlarmBell:
                case ItemID.Anvil:
                case ItemID.ArmorPlate:
                case ItemID.Axle:
                case ItemID.BallPeenHammer:
                case ItemID.Bar:
                case ItemID.BattleAxe:
                case ItemID.BattleAxeHead:
                case ItemID.BladeTrap:
                case ItemID.Blunderbuss:
                case ItemID.BlunderbussBarrel:
                case ItemID.Boot:
                case ItemID.Breastplate:
                case ItemID.Claymore:
                case ItemID.ClaymoreBlade:
                case ItemID.CommemorativeCoin:
                case ItemID.Crossbow:
                case ItemID.CrossbowBolt:
                case ItemID.CrossbowBow:
                case ItemID.CuttingWheel:
                case ItemID.Cylinder:
                case ItemID.File:
                case ItemID.MechanicalWall:
                case ItemID.Gauntlet:
                case ItemID.Gear:
                case ItemID.Gearbox:
                case ItemID.GemmedNecklace:
                case ItemID.GemmedRing:
                case ItemID.Greave:
                case ItemID.Hammer:
                case ItemID.HammerHead:
                case ItemID.HandAxe:
                case ItemID.HandAxeHead:
                case ItemID.Handcrank:
                case ItemID.Hatch:
                case ItemID.Helmet:
                case ItemID.Lever:
                case ItemID.MechanismBase:
                case ItemID.MetalSliver:
                case ItemID.MusketRound:
                case ItemID.Necklace:
                case ItemID.Pauldron:
                case ItemID.Pickaxe:
                case ItemID.PickaxeHead:
                case ItemID.Pistol:
                case ItemID.PistolBarrel:
                case ItemID.PressurePlate:
                case ItemID.Ring:
                case ItemID.Rod:
                case ItemID.Screw:
                case ItemID.Shield:
                case ItemID.ShieldBacking:
                case ItemID.ShieldBoss:
                case ItemID.Spike:
                case ItemID.SpikeTrap:
                case ItemID.Spring:
                case ItemID.Sword:
                case ItemID.SwordBlade:
                case ItemID.TowerShield:
                case ItemID.TowerShieldBacking:
                case ItemID.TrapBase:
                case ItemID.Warhammer:
                case ItemID.WarhammerHead:
                case ItemID.Wrench:
                case ItemID.Cheese:
                case ItemID.CheeseOmelette:
                case ItemID.MushroomOmelette:
                case ItemID.Bread:
                case ItemID.Plank:
                /*var complexItem = CreateComplexItem(item.ItemId, material.Material, position);
                 * name = complexItem.Name();
                 * break;*/
                case ItemID.Bone:
                case ItemID.Clipping:
                case ItemID.Egg:
                case ItemID.Fruit:
                case ItemID.Meat:
                case ItemID.Milk:
                case ItemID.Mushroom:
                case ItemID.RawCloth:
                case ItemID.RawCoal:
                case ItemID.RawGem:
                case ItemID.RawHide:
                case ItemID.RawOre:
                case ItemID.RawSoil:
                case ItemID.RawStone:
                case ItemID.RawWood:
                case ItemID.Seed:
                case ItemID.Skull:
                case ItemID.Straw:
                case ItemID.Wheat:
                default:
                    var newItem = CreateSimpleItem(item.ItemId, material.Material, position);
                    GnomanEmpire.Instance.Fortress.AddItem(newItem);
                    name = newItem.Name();
                    break;
                }
            }
            return(name);
        }
Beispiel #4
0
 public IEnumerable<ItemRow> GetItems()
 {
     switch (Material)
     {
         case Material.AlpacaBone:
         case Material.BearBone:
         case Material.EmuBone:
         case Material.HoneyBadgerBone:
         case Material.MonitorLizardBone:
         case Material.OgreBone:
         case Material.TwoHeadedOgreBone:
         case Material.YakBone:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Bone),
                 new ItemRow(ItemID.BoneShirt),
                 new ItemRow(ItemID.Needle)
             };
         case Material.AlpacaFlesh:
         case Material.BearFlesh:
         case Material.EmuFlesh:
         case Material.HoneyBadgerFlesh:
         case Material.MonitorLizardFlesh:
         case Material.OgreFlesh:
         case Material.TwoHeadedOgreFlesh:
         case Material.YakFlesh:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Meat),
                 new ItemRow(ItemID.Sausage),
                 new ItemRow(ItemID.SausageOmelette),
                 new ItemRow(ItemID.Sandwich)
             };
         case Material.AlpacaHide:
         case Material.BearHide:
         case Material.EmuHide:
         case Material.HoneyBadgerHide:
         case Material.MonitorLizardHide:
         case Material.OgreHide:
         case Material.ToughOgreHide:
         case Material.YakHide:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.LeatherArmorPanel),
                 new ItemRow(ItemID.LeatherBoot),
                 new ItemRow(ItemID.LeatherBracer),
                 new ItemRow(ItemID.LeatherCuirass),
                 new ItemRow(ItemID.LeatherGlove),
                 new ItemRow(ItemID.LeatherGreave),
                 new ItemRow(ItemID.LeatherHelm),
                 new ItemRow(ItemID.LeatherStrap),
                 new ItemRow(ItemID.RawHide)
             };
         case Material.AlpacaSkull:
         case Material.BearSkull:
         case Material.EmuSkull:
         case Material.HoneyBadgerSkull:
         case Material.MonitorLizardSkull:
         case Material.OgreSkull:
         case Material.TwoHeadedOgreSkull:
         case Material.YakSkull:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Skull),
                 new ItemRow(ItemID.SkullHelmet)
             };
         case Material.Apple:
         case Material.Grape:
         case Material.Orange:
         case Material.Strawberry:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Fruit),
                 new ItemRow(ItemID.Seed),
                 new ItemRow(ItemID.Wine)
             };
         case Material.AppleWood:
         case Material.OrangeWood:
         case Material.Birch:
         case Material.Oak:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Barrel),
                 new ItemRow(ItemID.Bed),
                 new ItemRow(ItemID.BedFrame),
                 new ItemRow(ItemID.Bellows),
                 new ItemRow(ItemID.BlunderbussStock),
                 new ItemRow(ItemID.Cabinet),                  
                 new ItemRow(ItemID.Chair),
                 new ItemRow(ItemID.Clipping),
                 new ItemRow(ItemID.Crate),
                 new ItemRow(ItemID.CrossbowStock),
                 new ItemRow(ItemID.Dresser),
                 new ItemRow(ItemID.FancyBedFrame),
                 new ItemRow(ItemID.FancyBed),
                 new ItemRow(ItemID.Haft),
                 new ItemRow(ItemID.Hilt),
                 new ItemRow(ItemID.Loom),
                 new ItemRow(ItemID.Plank),
                 new ItemRow(ItemID.PistolStock),
                 new ItemRow(ItemID.RawWood),
                 new ItemRow(ItemID.Stick),
                 new ItemRow(ItemID.Table),
                 new ItemRow(ItemID.Torch),
                 new ItemRow(ItemID.TrainingDummy),
                 new ItemRow(ItemID.Wheelbarrow),
                 new ItemRow(ItemID.WoodDoor),
                 new ItemRow(ItemID.WoodenShield),
                 new ItemRow(ItemID.Workbench)
             };
         case Material.Basalt:
         case Material.Bauxite:
         case Material.Granite:
         case Material.LapisLazuli:
         case Material.Marble:
         case Material.Sandstone:
         case Material.Serpentine:
         case Material.Obsidian:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Block),
                 new ItemRow(ItemID.Chair),
                 new ItemRow(ItemID.Chisel),
                 new ItemRow(ItemID.Furnace),
                 new ItemRow(ItemID.Hearth),
                 new ItemRow(ItemID.Knife),
                 new ItemRow(ItemID.Mold),
                 new ItemRow(ItemID.PetRock),
                 new ItemRow(ItemID.Pillar),
                 new ItemRow(ItemID.RawStone),
                 new ItemRow(ItemID.Sawblade),
                 new ItemRow(ItemID.Statue),
                 new ItemRow(ItemID.Statuette),
                 new ItemRow(ItemID.StoneDoor),
                 new ItemRow(ItemID.StoneHammer),
                 new ItemRow(ItemID.StoneHandAxe),
                 new ItemRow(ItemID.StoneKnifeBlade),
                 new ItemRow(ItemID.StoneSword),
                 new ItemRow(ItemID.Table),
                 new ItemRow(ItemID.Trough)
             };
         case Material.Bronze:
         case Material.Copper:
         case Material.Gold:
         case Material.Iron:
         case Material.Malachite:
         case Material.Platinum:
         case Material.RoseGold:
         case Material.Silver:
         case Material.Steel:
         case Material.Tin:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.AlarmBell),
                 new ItemRow(ItemID.Anvil),
                 new ItemRow(ItemID.ArmorPlate),
                 new ItemRow(ItemID.Axle),
                 new ItemRow(ItemID.BallPeenHammer),
                 new ItemRow(ItemID.Bar),
                 new ItemRow(ItemID.BattleAxe),
                 new ItemRow(ItemID.BattleAxeHead),
                 new ItemRow(ItemID.BladeTrap),
                 new ItemRow(ItemID.Blunderbuss),
                 new ItemRow(ItemID.BlunderbussBarrel),
                 new ItemRow(ItemID.Boot),
                 new ItemRow(ItemID.Breastplate),
                 new ItemRow(ItemID.Claymore),
                 new ItemRow(ItemID.ClaymoreBlade),
                 new ItemRow(ItemID.CommemorativeCoin),
                 new ItemRow(ItemID.Crossbow),
                 new ItemRow(ItemID.CrossbowBolt),
                 new ItemRow(ItemID.CrossbowBow),
                 new ItemRow(ItemID.CuttingWheel),
                 new ItemRow(ItemID.Cylinder),
                 new ItemRow(ItemID.FellingAxe),
                 new ItemRow(ItemID.FellingAxeHead),
                 new ItemRow(ItemID.File),
                 new ItemRow(ItemID.MechanicalWall),
                 new ItemRow(ItemID.Gauntlet),
                 new ItemRow(ItemID.Gear),
                 new ItemRow(ItemID.Gearbox),
                 new ItemRow(ItemID.GemmedNecklace),
                 new ItemRow(ItemID.GemmedRing),
                 new ItemRow(ItemID.Greave),
                 new ItemRow(ItemID.Hammer),
                 new ItemRow(ItemID.HammerHead),
                 new ItemRow(ItemID.HandAxe),
                 new ItemRow(ItemID.HandAxeHead),
                 new ItemRow(ItemID.Handcrank),
                 new ItemRow(ItemID.Hatch),
                 new ItemRow(ItemID.Helmet),
                 new ItemRow(ItemID.Lever),
                 new ItemRow(ItemID.MechanismBase),
                 new ItemRow(ItemID.MetalSliver),
                 new ItemRow(ItemID.MusketRound),
                 new ItemRow(ItemID.Necklace),
                 new ItemRow(ItemID.Pauldron),
                 new ItemRow(ItemID.Pickaxe),
                 new ItemRow(ItemID.PickaxeHead),
                 new ItemRow(ItemID.Pistol),
                 new ItemRow(ItemID.PistolBarrel),
                 new ItemRow(ItemID.PressurePlate),
                 new ItemRow(ItemID.RawOre),
                 new ItemRow(ItemID.Ring),
                 new ItemRow(ItemID.Rod),
                 new ItemRow(ItemID.Screw),
                 new ItemRow(ItemID.Shield),
                 new ItemRow(ItemID.ShieldBacking),
                 new ItemRow(ItemID.ShieldBoss),
                 new ItemRow(ItemID.Spike),
                 new ItemRow(ItemID.SpikeTrap),
                 new ItemRow(ItemID.Spring),
                 new ItemRow(ItemID.Statue),
                 new ItemRow(ItemID.Statuette),
                 new ItemRow(ItemID.Sword),
                 new ItemRow(ItemID.SwordBlade),
                 new ItemRow(ItemID.TowerShield),
                 new ItemRow(ItemID.TowerShieldBacking),
                 new ItemRow(ItemID.TrapBase),
                 new ItemRow(ItemID.Warhammer),
                 new ItemRow(ItemID.WarhammerHead),
                 new ItemRow(ItemID.Wrench)
             };
         case Material.BlueGem:
         case Material.GreenGem:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Gem),
                 new ItemRow(ItemID.RawGem)
             };
         case Material.Wool:
         case Material.Cotton:
             var list = new List<ItemRow>
             {
                 new ItemRow(ItemID.RawCloth),
                 new ItemRow(ItemID.AmmoPouch),
                 new ItemRow(ItemID.Bag),
                 new ItemRow(ItemID.Bandage),
                 new ItemRow(ItemID.Mattress),
                 new ItemRow(ItemID.Padding),
                 new ItemRow(ItemID.String)
             };
             if (Material == Material.Cotton)
             {
                 list.Add(new ItemRow(ItemID.Seed));
             }
             return list;
         case Material.Coal:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.RawCoal)
             };
         case Material.Clay:
         case Material.Dirt:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.RawSoil)
             };
         case Material.Egg:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Egg)
             };
         case Material.Mushroom:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Mushroom),
                 new ItemRow(ItemID.MushroomOmelette),
                 new ItemRow(ItemID.Seed),
             };
         case Material.Milk:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Cheese),
                 new ItemRow(ItemID.CheeseOmelette),
                 new ItemRow(ItemID.Milk)
             };
         case Material.Wheat:
             return new List<ItemRow>
             {
                 new ItemRow(ItemID.Bread),
                 new ItemRow(ItemID.Seed),
                 new ItemRow(ItemID.Straw)
             };
         default:
             return ItemRow.GetItems();
     }
 }