share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
changeset 13134 9a328734e469
parent 13129 991db8fc45eb
child 13635 fe7d2bbf5f3f
equal deleted inserted replaced
13133:2f7c8e2ebe8e 13134:9a328734e469
   113 local specialPointsX = {}
   113 local specialPointsX = {}
   114 local specialPointsY = {}
   114 local specialPointsY = {}
   115 local specialPointsCount = 0
   115 local specialPointsCount = 0
   116 
   116 
   117 local TeamRope = false
   117 local TeamRope = false
       
   118 
       
   119 local waypointCursor = false
       
   120 local waypointPreview = nil
   118 
   121 
   119 --------------------------
   122 --------------------------
   120 -- hog and team tracking variales
   123 -- hog and team tracking variales
   121 --------------------------
   124 --------------------------
   122 
   125 
   758         wpCol[wpCount] = nil
   761         wpCol[wpCount] = nil
   759         DeleteVisualGear(wpCirc[wpCount])
   762         DeleteVisualGear(wpCirc[wpCount])
   760         wpCirc[wpCount] = nil
   763         wpCirc[wpCount] = nil
   761         SetVisualGearValues(wpCirc[wpCount-1], nil, nil, nil, nil, nil, nil, nil, nil, nil, waypointColour)
   764         SetVisualGearValues(wpCirc[wpCount-1], nil, nil, nil, nil, nil, nil, nil, nil, nil, waypointColour)
   762         AddCaption(string.format(loc("Waypoint removed. Available points: %d"), wpLimit-wpCount))
   765         AddCaption(string.format(loc("Waypoint removed. Available points: %d"), wpLimit-wpCount))
       
   766         PlaySound(sndBump)
   763     else
   767     else
   764         PlaySound(sndDenied)
   768         PlaySound(sndDenied)
   765         AddCaption(loc("No waypoint to be removed!"))
   769         AddCaption(loc("No waypoint to be removed!"))
   766     end
   770     end
   767 end
   771 end
   914                                 end
   918                                 end
   915                         else
   919                         else
   916                                 -- still in placement mode
   920                                 -- still in placement mode
   917                         end
   921                         end
   918 
   922 
   919                 end
   923         	end
   920         end
   924 		if not racerActive and not gameBegun and GetCurAmmoType() == amAirAttack then
   921 
   925 			waypointCursor = true
       
   926 		else
       
   927 			waypointCursor = false
       
   928 		end
       
   929 	else
       
   930 		waypointCursor = false
       
   931 	end
   922 
   932 
   923         -- has the player started his tumbling spree?
   933         -- has the player started his tumbling spree?
   924         if (CurrentHedgehog ~= nil) then
   934         if (CurrentHedgehog ~= nil) then
   925 
   935 
   926                 --airstrike conversion used to be here
   936                 --airstrike conversion used to be here
   953                         DisableTumbler()
   963                         DisableTumbler()
   954                 end
   964                 end
   955 
   965 
   956         end
   966         end
   957 
   967 
       
   968 end
       
   969 
       
   970 function onGameTick()
       
   971 	if waypointCursor then
       
   972 		if not waypointPreview then
       
   973 			waypointPreview = AddVisualGear(CursorX, CursorY, vgtCircle, 0, true)
       
   974 		end
       
   975 		SetVisualGearValues(waypointPreview, CursorX, CursorY, 200, 200, 0, 0, 0, div(wpRad, 5), 5, waypointColourAtPlacement)
       
   976 	else
       
   977 		if waypointPreview then
       
   978 			DeleteVisualGear(waypointPreview)
       
   979 			waypointPreview = nil
       
   980 		end
       
   981 	end
   958 end
   982 end
   959 
   983 
   960 function onGearResurrect(gear)
   984 function onGearResurrect(gear)
   961 
   985 
   962         AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
   986         AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)