コード例 #1
0
ファイル: ItemCane.cs プロジェクト: radtek/ZeldaOracle
		//-----------------------------------------------------------------------------
		// Constructor
		//-----------------------------------------------------------------------------

		public ItemCane() {
			this.id				= "item_cane";
			this.name			= new string[] { "Cane of Somaria" };
			this.description	= new string[] { "Used to create blocks." };
			this.maxLevel		= Item.Level1;
			this.flags			= ItemFlags.UsableInMinecart | ItemFlags.UsableWhileJumping | ItemFlags.UsableWhileInHole;
			this.sprite			= new Sprite[] { GameData.SPR_ITEM_ICON_CANE };

			this.somariaBlockTile		= null;
			this.somariaBlockTileData	= null;
		}
コード例 #2
0
        public override void OnDestroy()
        {
            base.OnDestroy();

            if (CanBlockSpawnAtLocation(tileLocation))
            {
                // Create the somaria block.
                TileSomariaBlock tile = (TileSomariaBlock)Tile.CreateTile(itemCane.SomariaBlockTileData);
                RoomControl.PlaceTileOnHighestLayer(tile, tileLocation);
                itemCane.SomariaBlockTile = tile;
            }
            else
            {
                // Spawn a poof effect.
                RoomControl.SpawnEntity(
                    new Effect(GameData.ANIM_EFFECT_SOMARIA_BLOCK_DESTROY, DepthLayer.EffectSomariaBlockPoof),
                    position, zPosition);
            }
        }
コード例 #3
0
ファイル: ItemCane.cs プロジェクト: radtek/ZeldaOracle
		public override void OnAdded(Inventory inventory) {
			base.OnAdded(inventory);

			somariaBlockTile = null;

			// Create the somaria block tile data.
			somariaBlockTileData = new TileData(
					typeof(TileSomariaBlock),
					TileFlags.Movable |
					TileFlags.Cuttable |
					TileFlags.Bombable |
					TileFlags.Boomerangable |
					TileFlags.Pickupable |
					TileFlags.InstantPickup);
			somariaBlockTileData.SolidType		= TileSolidType.Solid;
			somariaBlockTileData.CollisionModel	= GameData.MODEL_BLOCK;
			somariaBlockTileData.Sprite			= GameData.SPR_TILE_SOMARIA_BLOCK;
			somariaBlockTileData.BreakAnimation	= GameData.ANIM_EFFECT_SOMARIA_BLOCK_DESTROY;
			somariaBlockTileData.BreakSound		= GameData.SOUND_APPEAR_VANISH;
		}