diff --git a/Aquaria/Avatar.cpp b/Aquaria/Avatar.cpp index 87a399c..f7da9b4 100644 --- a/Aquaria/Avatar.cpp +++ b/Aquaria/Avatar.cpp @@ -6054,10 +6054,7 @@ void Avatar::splash(bool down) if (down) { - int freq = 1000; - if (rolling) - freq = 900; - sound("splash-into", freq); + sound("splash-into", rolling ? 0.9f : 1.0f); //dsq->postProcessingFx.disable(FXT_RADIALBLUR); if (_isUnderWater && core->afterEffectManager) core->afterEffectManager->addEffect(new ShockEffect(Vector(core->width/2, core->height/2),core->screenCenter,0.08,0.05,22,0.2f, 1.2)); diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index 68eee0e..2c0828f 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -2186,10 +2186,13 @@ PlaySfx DSQ::calcPositionalSfx(const Vector &position, float maxdist) { Vector diff = position - dsq->game->avatar->position; - // TODO: this might be cooler if finetuned for different aspect ratios. - // This value is suitable enough for widescreen in default zoom, at least -- FG + // Aspect-ratio-adjustment: + // Just multiplying the cut-off distance with aspect increases it too much on widescreen, + // so only a part of it is aspect-corrected to make it sound better. + // Aspect is most likely >= 5/4 here, which results in a higher value than + // the default of 1024; this is intended. -- FG if (maxdist <= 0) - maxdist = 1024; + maxdist = 724 + (300 * aspect); float dist = diff.getLength2D(); if (dist < maxdist) diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 2c7762b..fff56be 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -1421,7 +1421,13 @@ luaFunc(entity_sound) Entity *e = entity(L); if (e && !dsq->isSkippingCutscene()) { - e->sound(lua_tostring(L, 2), lua_tonumber(L, 3), lua_tonumber(L, 4)); + float freq = lua_tonumber(L, 3); + // HACK: most old scripts still use a freq value of ~1000 as normal pitch. + // Pitch values this high produce a barely audible click only, + // so a cheap hack like this fixes it without changing older scripts. -- FG + if (freq >= 100) + freq *= 0.001f; + e->sound(lua_tostring(L, 2), freq, lua_tonumber(L, 4)); } luaReturnNum(0); } diff --git a/game_scripts/scripts/entities/anglerfish.lua b/game_scripts/scripts/entities/anglerfish.lua index a27b399..e2aabcf 100644 --- a/game_scripts/scripts/entities/anglerfish.lua +++ b/game_scripts/scripts/entities/anglerfish.lua @@ -234,7 +234,7 @@ function animationKey(me, key) ]]-- elseif key == 3 then - entity_sound(me, "Bite", 400 + math.random(100)) + entity_sound(me, "Bite", 700 + math.random(100)) entity_moveTowardsTarget(me, 1, 8000) end end