# HG changeset patch # User Wuzzy # Date 1525390762 -7200 # Node ID 03e4d9b5b09cbcf3f8726c16f8fb787824b6eac1 # Parent f7631fb4c5842e78fbf2efb9ee98fecc4afd227c Continental supplies: Upside-Down World special now works in cave maps as well In cave maps, the hog is teleported just below the border. A bit of land is erased, too. diff -r f7631fb4c584 -r 03e4d9b5b09c share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua Fri May 04 01:01:40 2018 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua Fri May 04 01:39:22 2018 +0200 @@ -1906,10 +1906,29 @@ elseif(CS.ANTARCTICA_SPECIAL == 1 and GetCurAmmoType() == amPickHammer and band(GetState(CurrentHedgehog),gstAttacked)==0) then EndTurnCS(10) - SetGearPosition(CurrentHedgehog,GetX(CurrentHedgehog),0) - ParseCommand("hjump") - SetGearVelocity(CurrentHedgehog, 0, 100000000) + local dx, dy = GetGearVelocity(CurrentHedgehog) + local isLeft = dx < 0 + -- Cave map / map has border + if not MapHasBorder() then + -- Place hog at Y = 0 + SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog), 0) + ParseCommand("hjump") + SetGearVelocity(CurrentHedgehog, 0, 100000000) + -- Open air map + else + -- Place hog just below the top border, erase a bit of land as well + local x = GetX(CurrentHedgehog) + Explode(x, TopY + 6, 32, EXPLNoDamage + EXPLDoNotTouchAny + EXPLNoGfx) + Explode(x, TopY + 20, 24, EXPLNoDamage + EXPLDoNotTouchAny) + SetGearPosition(CurrentHedgehog, x, TopY + 26) + local dx, dy = GetGearVelocity(CurrentHedgehog) + SetGearVelocity(CurrentHedgehog, 0, dy) + ParseCommand("hjump") + end + if isLeft then + HogTurnLeft(CurrentHedgehog, true) + end PlaySound(sndPiano8) PlaySound(sndWarp)