private Player CreatePlayer() { var player = new Player(); var itemsGenerator = ItemsGeneratorManager.Generator; var weapon = new TorchItem(); player.Inventory.AddItem(weapon); player.Equipment.EquipHoldable(weapon, true); var spellBook = itemsGenerator.GenerateSpellBook(ItemRareness.Trash); player.Inventory.AddItem(spellBook); player.Equipment.EquipItem(spellBook); player.Inventory.AddItem(GenerateStartingUsable()); player.Inventory.AddItem(GenerateStartingUsable()); #if DEBUG player.Inventory.AddItem(new BanHammer()); #endif return(player); }
public void Init(PlayerModel model) { playerModel = model; for (int i = 1; i <= 45; i++) { items.Add(i, null); } items[1] = new BowItem() { Count = 1 }; items[2] = new BackswordItem() { Count = 1 }; items[3] = new GrenadeItem() { Count = 999 }; items[4] = new PickItem() { Count = 1 }; items[5] = new TorchItem() { Count = 100 }; items[6] = new BlowBlockItem(0, 2) { Count = 10 }; items[7] = new AxeItem() { Count = 1 }; items[8] = new BlowBlockItem(0, (short)TileTypeEnum.Brick) { Count = 100 }; items[9] = new BlowBlockItem(0, (short)TileTypeEnum.Stairs) { Count = 1000 }; items[10] = new BlowBlockItem(0, (short)TileTypeEnum.Iron) { Count = 100 }; items[11] = new BlowBlockItem(0, (short)TileTypeEnum.Meat) { Count = 100 }; items[12] = new BlowBlockItem(0, (short)TileTypeEnum.Med) { Count = 100 }; items[13] = new BlowBlockItem(0, (short)TileTypeEnum.Bone) { Count = 100 }; RootContext.Instance.Player.UpdateBag(this); }
public void SetWepoanById(int id) { IItem item = null; switch (id) { case 0: break; case 1: item = new BackswordItem() { Count = 9999 }; break; //земля case 102: item = new BlowBlockItem(0, 2) { Count = 9999 }; break; //трава case 105: item = new BlowBlockItem(0, 5) { Count = 9999 }; break; //угаль case 101: item = new BlowBlockItem(0, 1) { Count = 9999 }; break; case 3: item = new BowItem() { Count = 9999 }; break; case 4: item = new GrenadeItem() { Count = 9999 }; break; case 5: item = new PickItem() { Count = 9999 }; break; case 6: item = new TorchItem() { Count = 9999 }; break; } if (item != null) { item.Use(this); } else { CurrentWeapon = null; ClearSlot(weaponSlo1); } }