share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 12647 f190ed9df875
parent 12646 28183c98a3a9
child 12648 c755afd8fb6b
equal deleted inserted replaced
12646:28183c98a3a9 12647:f190ed9df875
   289 local shoppaPointList = {}
   289 local shoppaPointList = {}
   290 local shoppaPX = {}
   290 local shoppaPX = {}
   291 local shoppaPY = {}
   291 local shoppaPY = {}
   292 local shoppaPR = {}
   292 local shoppaPR = {}
   293 
   293 
       
   294 local savedScriptParam = ""
       
   295 
   294 -- Misc. state variables
   296 -- Misc. state variables
   295 local hedgeEditorMissionPanelShown = false
   297 local hedgeEditorMissionPanelShown = false
   296 local tagGears = {}
   298 local tagGears = {}
   297 local showGearTags = true
   299 local showGearTags = true
   298 
   300 
   377 				{amExtraTime,	"amExtraTime"},
   379 				{amExtraTime,	"amExtraTime"},
   378 
   380 
   379 				}
   381 				}
   380 
   382 
   381 				--skiphog is 6
   383 				--skiphog is 6
       
   384 
       
   385 local effectArray = { heInvulnerable, hePoisoned, heResurrectable, heResurrected, heFrozen }
       
   386 local effectStr = { "heInvulnerable", "hePoisoned", "heResurrectable", "heResurrected", "heFrozen" }
   382 
   387 
   383 ----------------------------
   388 ----------------------------
   384 -- hog and map editing junk
   389 -- hog and map editing junk
   385 ----------------------------
   390 ----------------------------
   386 
   391 
  1478 					")"
  1483 					")"
  1479 			)
  1484 			)
  1480 
  1485 
  1481 	table.insert	(tempDataList,"	SetGearPosition(hhs[" .. #hhs .. "], " .. GetX(gear) .. ", " .. GetY(gear) .. ")")
  1486 	table.insert	(tempDataList,"	SetGearPosition(hhs[" .. #hhs .. "], " .. GetX(gear) .. ", " .. GetY(gear) .. ")")
  1482 
  1487 
       
  1488 	for e=1, #effectArray do
       
  1489 		if GetEffect(gear, effectArray[e]) ~= 0 then
       
  1490 			table.insert	(tempDataList,"	SetEffect(hhs[" .. #hhs .. "], " .. effectStr[e] .. ", " .. GetEffect(gear, effectArray[e]) .. ")")
       
  1491 		end
       
  1492 	end
       
  1493 	local dX, _ = GetGearVelocity(gear)
       
  1494 	if dX < 0 then
       
  1495 		table.insert	(tempDataList,"	HogTurnLeft(hhs[" .. #hhs .. "], true)")
       
  1496 	end
       
  1497 
  1483 	if getGearValue(gear,"tag") ~= nil then
  1498 	if getGearValue(gear,"tag") ~= nil then
  1484 		table.insert	(tempDataList,"	setGearValue(hhs[" .. #hhs .. "], \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
  1499 		table.insert	(tempDataList,"	setGearValue(hhs[" .. #hhs .. "], \"tag\", \"" .. getGearValue(gear,"tag") .. "\")")
  1485 	end
  1500 	end
  1486 
  1501 
  1487 	-- save the ammo values for each gear, we will call this later
  1502 	-- save the ammo values for each gear, we will call this later
  1577 	WriteLnToConsole("	WaterRise = " .. WaterRise)
  1592 	WriteLnToConsole("	WaterRise = " .. WaterRise)
  1578 	WriteLnToConsole("	HealthDecrease = " .. HealthDecrease)
  1593 	WriteLnToConsole("	HealthDecrease = " .. HealthDecrease)
  1579 
  1594 
  1580 	WriteLnToConsole("	Ready = " .. Ready)
  1595 	WriteLnToConsole("	Ready = " .. Ready)
  1581 	WriteLnToConsole("	AirMinesNum = " .. AirMinesNum)
  1596 	WriteLnToConsole("	AirMinesNum = " .. AirMinesNum)
  1582 	WriteLnToConsole("	ScriptParam = " .. ScriptParam)
  1597 	if savedScriptParam ~= "" then
       
  1598 		-- TODO:
       
  1599 		--WriteLnToConsole("	ScriptParam = \"" .. savedScriptParam .. "\"")
       
  1600 	end
  1583 	WriteLnToConsole("	GetAwayTime = " .. GetAwayTime)
  1601 	WriteLnToConsole("	GetAwayTime = " .. GetAwayTime)
  1584 	WriteLnToConsole("	WorldEdge = " .. WorldEdge)
  1602 	WriteLnToConsole("	WorldEdge = " .. WorldEdge)
  1585 
  1603 
  1586 	WriteLnToConsole("")
  1604 	WriteLnToConsole("")
  1587 
  1605 
  3325 
  3343 
  3326 	if mapID == nil then
  3344 	if mapID == nil then
  3327 		mapID = 1
  3345 		mapID = 1
  3328 	end
  3346 	end
  3329 
  3347 
       
  3348 	-- Neccessary cuz ScriptParam is not global
       
  3349 	savedScriptParam = ScriptParam
       
  3350 
  3330 end
  3351 end
  3331 
  3352 
  3332 function onGameInit()
  3353 function onGameInit()
  3333 
  3354 
  3334 	-- perhaps we can get some of this better info in parsecommandoverride
  3355 	-- perhaps we can get some of this better info in parsecommandoverride