share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
changeset 10227 0b848d595f22
parent 10044 33e64afccd3b
child 10228 947cadb40bc5
equal deleted inserted replaced
10226:cb63617a0c2f 10227:0b848d595f22
   357                                         loc("STATUS UPDATE"),
   357                                         loc("STATUS UPDATE"),
   358                                         loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" ..
   358                                         loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" ..
   359                                         loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000)
   359                                         loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000)
   360 
   360 
   361         -- end game if its at round limit
   361         -- end game if its at round limit
   362         if roundNumber == roundLimit then
   362         if roundNumber >= roundLimit then
   363                 for i = 0, (numhhs-1) do
   363                 for i = 0, (numhhs-1) do
   364                         if GetHogClan(hhs[i]) ~= bestClan then
   364                         if GetHogClan(hhs[i]) ~= bestClan then
   365                                 SetEffect(hhs[i], heResurrectable, 0)
   365                                 SetEffect(hhs[i], heResurrectable, 0)
   366                                 SetHealth(hhs[i],0)
   366                                 SetHealth(hhs[i],0)
   367                         end
   367                         end
   513         TryRepositionHogs()
   513         TryRepositionHogs()
   514 
   514 
   515 end
   515 end
   516 
   516 
   517 function PlaceWayPoint(x,y)
   517 function PlaceWayPoint(x,y)
   518 
   518     if not racerActive then
   519         if (wpCount < wpLimit) then -- seems to not work with a hedgehog nil chek
   519         if wpCount == 0 or wpX[wpCount - 1] ~= x or wpY[wpCount - 1] ~= y then
   520 
   520 
   521                 wpX[wpCount] = x
   521             wpX[wpCount] = x
   522                 wpY[wpCount] = y
   522             wpY[wpCount] = y
   523                 wpCol[wpCount] = 0xffffffff
   523             wpCol[wpCount] = 0xffffffff
   524                 wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
   524             wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
   525                                                                                                                                                 --100
   525                                                                                                                                             
   526                 SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
   526             SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
   527 
   527 
   528                 wpCount = wpCount + 1
   528             wpCount = wpCount + 1
   529 
   529 
   530                 AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount))
   530             AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount))
   531 
   531         end
   532         end
   532     end
   533 
       
   534 end
   533 end
   535 
   534 
   536 function onSpecialPoint(x,y,flag)
   535 function onSpecialPoint(x,y,flag)
   537     specialPointsX[specialPointsCount] = x
   536     specialPointsX[specialPointsCount] = x
   538     specialPointsY[specialPointsCount] = y
   537     specialPointsY[specialPointsCount] = y
   669                     AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
   668                     AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
   670                 end
   669                 end
   671 
   670 
   672                                 if (CheckWaypoints() == true) then
   671                                 if (CheckWaypoints() == true) then
   673                                         AdjustScores()
   672                                         AdjustScores()
   674                                         racerActive = false
       
   675                                         DisableTumbler()
   673                                         DisableTumbler()
   676                                 end
   674                                 end
   677 
   675 
   678                         end
   676                         end
   679 
   677