# HG changeset patch # User Wuzzy # Date 1518289702 -3600 # Node ID a5c5fe878a4e413abce5f58563ac350ef8aa7559 # Parent 544c4302efe498508900a96f76d60ed627c85f14 Racer, TechRacer: Fade out waypoints at the end diff -r 544c4302efe4 -r a5c5fe878a4e share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sat Feb 10 19:30:51 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sat Feb 10 20:08:22 2018 +0100 @@ -489,6 +489,10 @@ end gameOver = true + for i=0, wpCount-1 do + -- Fade out waypoints + SetVisualGearValues(wpCirc[i], nil, nil, 0, 0, nil, 6) + end EndTurn(true) end @@ -513,11 +517,11 @@ end racerActive = false -- newadd - if trackFinished and not turnSkipped then + if trackFinished and not gameOver then for i=0, wpCount-1 do SetVisualGearValues(wpCirc[i], nil, nil, 255, 255, nil, 2) end - elseif not turnSkipped then + elseif not gameOver then for i=0, wpCount-1 do SetVisualGearValues(wpCirc[i], nil, nil, 32, 32, nil, 1) end @@ -700,10 +704,12 @@ gTimer = 0 -- Set the waypoints to unactive on new round - for i = 0,(wpCount-1) do - wpActive[i] = false - wpCol[i] = 0xffffffff - SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 164, 224, 1, 10, 0, wpRad, 5, wpCol[i]) + if not gameOver then + for i = 0,(wpCount-1) do + wpActive[i] = false + wpCol[i] = 0xffffffff + SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 164, 224, 1, 10, 0, wpRad, 5, wpCol[i]) + end end -- Handle Starting Stage of Game diff -r 544c4302efe4 -r a5c5fe878a4e share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua Sat Feb 10 19:30:51 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua Sat Feb 10 20:08:22 2018 +0100 @@ -324,7 +324,7 @@ NR = (48/100*wpRad)/2 - if dist < (NR*NR) then + if dist < (NR*NR) and not gameOver then --if dist < (wpRad*wpRad) then --AddCaption("howdy") wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new --GetClanColor(1) @@ -509,6 +509,10 @@ end gameOver = true + for i=0, wpCount-1 do + -- Fade out waypoints + SetVisualGearValues(wpCirc[i], nil, nil, 0, 0, nil, 6) + end EndTurn(true) end @@ -578,11 +582,11 @@ if endTurn then EndTurn(true) end - if trackFinished then + if trackFinished and not gameOver then for i=0, wpCount-1 do SetVisualGearValues(wpCirc[i], nil, nil, 255, 255, nil, 2) end - else + elseif not gameOver then for i=0, wpCount-1 do SetVisualGearValues(wpCirc[i], nil, nil, 32, 32, nil, 1) end @@ -660,7 +664,7 @@ end function CallBob(x,y) - if not racerActive then + if not racerActive and not gameOver then if wpCount == 0 or wpX[wpCount - 1] ~= x or wpY[wpCount - 1] ~= y then wpX[wpCount] = x @@ -699,14 +703,21 @@ LoadMap(mapID) end - for i = 0,(wpCount-1) do - DeleteVisualGear(wpCirc[i]) - end - wpCount = 0 + if gameOver then + for i = 0,(wpCount-1) do + SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 164, 224, 1, 10, 0, wpRad, 5, wpCol[wpCount]) + end - for i = 1, techCount-1 do - CallBob(techX[i],techY[i]) - end + else + for i = 0,(wpCount-1) do + DeleteVisualGear(wpCirc[i]) + end + wpCount = 0 + + for i = 1, techCount-1 do + CallBob(techX[i],techY[i]) + end + end activationStage = 200 --runOnHogs(RestoreHog) @@ -1041,10 +1052,12 @@ gTimer = 0 -- Set the waypoints to unactive on new round - for i = 0,(wpCount-1) do - wpActive[i] = false - wpCol[i] = 0xffffffff - SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 164, 224, 1, 10, 0, wpRad, 5, wpCol[i]) + if not gameOver then + for i = 0,(wpCount-1) do + wpActive[i] = false + wpCol[i] = 0xffffffff + SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 164, 224, 1, 10, 0, wpRad, 5, wpCol[i]) + end end -- Handle Starting Stage of Game