From 46cb2c50bc4f7dfe55085d842cdc77f225fabf06 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 12 Feb 2012 21:55:40 +0100 Subject: new bits for Tile God to block effects and sounds --- src/tilegod.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/tilegod.cpp b/src/tilegod.cpp index 5162148..5f69778 100644 --- a/src/tilegod.cpp +++ b/src/tilegod.cpp @@ -44,7 +44,7 @@ int daChengeBlock_c::onCreate() { height = settings & 0xF; width = (settings & 0xF0) >> 4; blockType = (settings & 0xF000) >> 12; - pattern = (Pattern)((settings & 0xF0000) >> 16); + pattern = (Pattern)((settings & 0x30000) >> 16); isPermanent = (settings & 0xF0000000) >> 28; if (width == 0) @@ -140,25 +140,31 @@ void daChengeBlock_c::doStuff(Action action, bool wasCalledOnCreation) { default: shardType = 0xFFFF; } - if (shardType == 0xFFFF) { - SpawnEffect("Wm_en_burst_ss", 0, &effectPos, 0, 0); - } else { - u32 sets = (shardType << 8) | 3; - effectPos.y -= 8; - dEffectBreakMgr_c::instance->spawnTile(&effectPos, sets, 0); + if (!(settings & 0x40000)) { + if (shardType == 0xFFFF) { + SpawnEffect("Wm_en_burst_ss", 0, &effectPos, 0, 0); + } else { + u32 sets = (shardType << 8) | 3; + effectPos.y -= 8; + dEffectBreakMgr_c::instance->spawnTile(&effectPos, sets, 0); + } } - Vec2 soundPos; - ConvertStagePositionToScreenPosition(&soundPos, &effectPos); - SoundPlayingClass::instance2->PlaySoundAtPosition(SE_OBJ_BLOCK_BREAK, &soundPos, 0); + if (!(settings & 0x80000)) { + Vec2 soundPos; + ConvertStagePositionToScreenPosition(&soundPos, &effectPos); + SoundPlayingClass::instance2->PlaySoundAtPosition(SE_OBJ_BLOCK_BREAK, &soundPos, 0); + } } } else { effectPos.x = ((float)(worldX)) + 8.0f; effectPos.y = ((float)(-worldY)) - 8.0f; effectPos.z = pos.z; - if (blockType != 2) { - SpawnEffect("Wm_en_burst_ss", 0, &effectPos, 0, 0); + if (!(settings & 0x40000)) { + if (blockType != 2) { + SpawnEffect("Wm_en_burst_ss", 0, &effectPos, 0, 0); + } } } } -- cgit v1.2.3