//----------------------------------------------------------------------------- // Somaria Block Methods //----------------------------------------------------------------------------- private void SpawnSomariaBlock() { // Cane of Somaria doesn't work while the player is in a minecart. if (player.IsInMinecart) { return; } ItemCane itemCane = (ItemCane)Weapon; // Break any existing somaria block. if (itemCane.SomariaBlockTile != null) { itemCane.SomariaBlockTile.Break(false); itemCane.SomariaBlockTile = null; } Vector2F pos = player.Center + (Directions.ToVector(SwingDirection) * 19); Point2I tileLocation = player.RoomControl.GetTileLocation(pos); EffectCreateSomariaBlock effect = new EffectCreateSomariaBlock(tileLocation, player.ZPosition, itemCane); player.RoomControl.SpawnEntity(effect); AudioSystem.PlaySound(GameData.SOUND_MYSTERY_SEED); }
//----------------------------------------------------------------------------- // Constructors //----------------------------------------------------------------------------- public EffectCreateSomariaBlock(Point2I tileLocation, float zPosition, ItemCane itemCane) : base(GameData.ANIM_EFFECT_SOMARIA_BLOCK_CREATE) { this.itemCane = itemCane; this.tileLocation = tileLocation; this.position = (tileLocation * GameSettings.TILE_SIZE) + new Vector2F(8, 8); this.zPosition = zPosition; Graphics.DepthLayer = DepthLayer.EffectSomariaBlockPoof; }