share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
changeset 13685 09ea1faf97ca
parent 13643 690cc84e9fd6
child 13687 a8b2a5e7e9db
equal deleted inserted replaced
13684:739fd039daaa 13685:09ea1faf97ca
   880 
   880 
   881 
   881 
   882 function WallHit(id, zXMin,zYMin, zWidth, zHeight)
   882 function WallHit(id, zXMin,zYMin, zWidth, zHeight)
   883 
   883 
   884 	if wTouched[id] == false then
   884 	if wTouched[id] == false then
   885 		tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
   885 		AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
   886 		PlaySound(sndExplosion)
   886 		PlaySound(sndExplosion)
   887 		wallsLeft = wallsLeft - 1
   887 		wallsLeft = wallsLeft - 1
   888 
   888 
   889 		if wallsLeft == 0 then
   889 		if wallsLeft == 0 then
   890 			AddCaption(loc("All walls touched!"))
   890 			AddCaption(loc("All walls touched!"))
   898 
   898 
   899 	end
   899 	end
   900 
   900 
   901 	wTouched[id] = true
   901 	wTouched[id] = true
   902 	if #wTouched > 0 then
   902 	if #wTouched > 0 then
   903 		tempE = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
   903 		AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmoke, 0, false)
   904 	end
   904 	end
   905 
   905 
   906 end
   906 end
   907 
   907 
   908 function CheckForWallCollision()
   908 function CheckForWallCollision()
   923 	for i=1, sparkRuns do
   923 	for i=1, sparkRuns do
   924 		local eX = zXMin + GetRandom(zWidth+10)
   924 		local eX = zXMin + GetRandom(zWidth+10)
   925 		local eY = zYMin + GetRandom(zHeight+10)
   925 		local eY = zYMin + GetRandom(zHeight+10)
   926 
   926 
   927 		local tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
   927 		local tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
   928 		if tempE ~= 0 then
   928 		SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, 1, nil, bCol )
   929 			local g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
       
   930 			SetVisualGearValues(tempE, eX, eY, g3, g4, g5, g6, g7, 1, g9, bCol )
       
   931 		end
       
   932 	end
   929 	end
   933 
   930 
   934 end
   931 end
   935 
   932 
   936 
   933