share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
changeset 13282 b13071610c07
parent 13215 bc95df84395f
child 13354 f9a15dcd857c
equal deleted inserted replaced
13281:36243bd726df 13282:b13071610c07
  1253 -- handle short range portal gun
  1253 -- handle short range portal gun
  1254 function PortalEffects(gear)
  1254 function PortalEffects(gear)
  1255 
  1255 
  1256 	if GetGearType(gear) == gtPortal then
  1256 	if GetGearType(gear) == gtPortal then
  1257 
  1257 
  1258 		tag = GetTag(gear)
  1258 		local tag = GetTag(gear)
       
  1259 		local col
  1259 		if tag == 0 then
  1260 		if tag == 0 then
  1260 			col = 0xfab02aFF -- orange ball
  1261 			col = 0xfab02aFF -- orange ball
  1261 		elseif tag == 1 then
  1262 		elseif tag == 1 then
  1262 			col = 0x00FF00FF -- orange portal
  1263 			col = 0x00FF00FF -- orange portal
  1263 		elseif tag == 2 then
  1264 		elseif tag == 2 then
  1265 		elseif tag == 3 then
  1266 		elseif tag == 3 then
  1266 			col = 0xFFFF00FF  -- blue portal
  1267 			col = 0xFFFF00FF  -- blue portal
  1267 		end
  1268 		end
  1268 
  1269 
  1269 		if (tag == 0) or (tag == 2) then -- i.e ball form
  1270 		if (tag == 0) or (tag == 2) then -- i.e ball form
  1270 			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtDust, 0, true)
  1271 			local remLife = getGearValue(gear,"life")
  1271 			g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
       
  1272 			SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, 1, g9, col )
       
  1273 
       
  1274 			remLife = getGearValue(gear,"life")
       
  1275 			remLife = remLife - 1
  1272 			remLife = remLife - 1
  1276 			setGearValue(gear, "life", remLife)
  1273 			setGearValue(gear, "life", remLife)
  1277 
  1274 
  1278 			if remLife == 0 then
  1275 			if remLife == 0 then
  1279 
  1276 
  1280 				tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true)
  1277 				local tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true)
  1281 				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
  1278 				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col)
  1282 				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
       
  1283 
  1279 
  1284 				tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true)
  1280 				tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true)
  1285 				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
  1281 				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col)
  1286 				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
       
  1287 
  1282 
  1288 				tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true)
  1283 				tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true)
  1289 				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
  1284 				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col)
  1290 				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
       
  1291 
  1285 
  1292 				tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true)
  1286 				tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true)
  1293 				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
  1287 				SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, col)
  1294 				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
       
  1295 
       
  1296 
  1288 
  1297 				PlaySound(sndVaporize)
  1289 				PlaySound(sndVaporize)
  1298 				DeleteGear(gear)
  1290 				DeleteGear(gear)
  1299 
  1291 
  1300 			end
  1292 			end