private void uncover(Utils.MessageBox sender, bool result) { if (result && levelHandler.player.HasItem(ItemTypes.Spade)) { levelHandler.player.RemoveItem(ItemTypes.Spade); if (base.baseType == TileTypes.Grass) { TileOperators.changeTileAtLocation(this, TileTypes.Chest, Zone.Surface); } else if (base.baseType == TileTypes.Stone) { TileOperators.changeTileAtLocation(this, TileTypes.Chest, Zone.Cave); } levelHandler.player.callMove(); } else if (base.isInRange())//Player could theoretically move before pressing no { Point pos = TileOperators.getGridPosition(this); levelHandler.player.MovePlayer(pos.X, pos.Y); levelHandler.player.callMove(); } sender.Hide(); Program.formRef.Controls.Remove(sender); sender.Controls.Clear(); sender.Dispose(); }
public void animalAttack() { if (base.baseType == TileTypes.Grass) { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Surface); } else if (base.baseType == TileTypes.Stone) { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Cave); } }
//TODO Change the zone to cave if implemented private void buildBridge(Utils.MessageBox sender, bool result) { if (result && levelHandler.player.HasItem(ItemTypes.Log)) { TileOperators.changeTileAtLocation(this, TileTypes.Bridge, Zone.Surface); levelHandler.player.RemoveItem(ItemTypes.Log); levelHandler.player.callMove(); } sender.Hide(); Program.formRef.Controls.Remove(sender); sender.Controls.Clear(); sender.Dispose(); }
public void pickUp() { if (base.baseType == TileTypes.Grass) { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Surface); } else if (base.baseType == TileTypes.Stone) { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Cave); } levelHandler.player.CollectItem(ItemTypes.Rock); levelHandler.player.callMove(); }
private void cutDown(Utils.MessageBox sender, bool result) { if (result && levelHandler.player.HasItem(ItemTypes.Axe))//It is possible for the player to use the item before pressing yes. { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Surface); levelHandler.player.RemoveItem(ItemTypes.Axe); levelHandler.player.CollectItem(ItemTypes.Log); levelHandler.player.callMove(); } sender.Hide(); Program.formRef.Controls.Remove(sender); sender.Controls.Clear(); sender.Dispose(); }
private void attack(Utils.MessageBox sender, bool result) { if (result && levelHandler.player.HasItem(ItemTypes.Sword)) { levelHandler.player.RemoveItem(ItemTypes.Sword); levelHandler.player.CollectItem(ItemTypes.Meat); if (base.baseType == TileTypes.Grass) { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Surface); } else if (base.baseType == TileTypes.Stone) { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Cave); } levelHandler.player.callMove(); } sender.Hide(); Program.formRef.Controls.Remove(sender); sender.Controls.Clear(); sender.Dispose(); }
public void pickUp() { TileOperators.changeTileAtLocation(this, base.baseType, Zone.Surface); levelHandler.player.CollectItem(ItemTypes.Berries); levelHandler.player.callMove(); }