share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 12009 c69b36964374
parent 12008 9b4abde68e3b
child 12010 e020e1ce4739
equal deleted inserted replaced
12008:9b4abde68e3b 12009:c69b36964374
  1454 
  1454 
  1455 		lastRecordedTeam = GetHogTeamName(gear)
  1455 		lastRecordedTeam = GetHogTeamName(gear)
  1456 
  1456 
  1457 		table.insert(tempDataList, "")
  1457 		table.insert(tempDataList, "")
  1458 		table.insert	(tempDataList,
  1458 		table.insert	(tempDataList,
  1459 						"	AddTeam(\"" ..
  1459 						"	AddTeam(loc(\"" ..
  1460 						GetHogTeamName(gear) .."\"" ..
  1460 						GetHogTeamName(gear) .. "\")" ..
  1461 						", " .. tColor ..
  1461 						", " .. tColor ..
  1462 						", " .. "\"" .. tGrave .. "\"" ..
  1462 						", " .. "\"" .. tGrave .. "\"" ..
  1463 						", " .. "\"" .. tFort .. "\"" ..
  1463 						", " .. "\"" .. tFort .. "\"" ..
  1464 						", " .. "\"" .. tVoice .. "\"" ..
  1464 						", " .. "\"" .. tVoice .. "\"" ..
  1465 						", " .. "\"" .. tFlag .. "\"" ..
  1465 						", " .. "\"" .. tFlag .. "\"" ..
  1468 
  1468 
  1469 	end
  1469 	end
  1470 
  1470 
  1471 	table.insert(hhs, gear)
  1471 	table.insert(hhs, gear)
  1472 
  1472 
  1473 	table.insert	(tempDataList,	"	hhs[" .. #hhs .."] = AddHog(\"" ..
  1473 	table.insert	(tempDataList,	"	hhs[" .. #hhs .."] = AddHog(loc(\"" ..
  1474 					GetHogName(gear) .. "\", " ..
  1474 					GetHogName(gear) .. "\"), " ..
  1475 					GetHogLevel(gear) .. ", " ..
  1475 					GetHogLevel(gear) .. ", " ..
  1476 					GetHealth(gear) .. ", \"" ..
  1476 					GetHealth(gear) .. ", \"" ..
  1477 					GetHogHat(gear) .. "\"" ..
  1477 					GetHogHat(gear) .. "\"" ..
  1478 					")"
  1478 					")"
  1479 			)
  1479 			)
  2225 	WriteLnToConsole("")
  2225 	WriteLnToConsole("")
  2226 	WriteLnToConsole("	runOnGears(CheckForConditions)")
  2226 	WriteLnToConsole("	runOnGears(CheckForConditions)")
  2227 	WriteLnToConsole("")
  2227 	WriteLnToConsole("")
  2228 	WriteLnToConsole("	if victoryObj > 0 then ")
  2228 	WriteLnToConsole("	if victoryObj > 0 then ")
  2229 	WriteLnToConsole("		if victoryObj == 1 then ")
  2229 	WriteLnToConsole("		if victoryObj == 1 then ")
  2230 	WriteLnToConsole("			vComment = loc(\"Destroy the red target\")")
  2230 	WriteLnToConsole("			vComment = loc(\"- Destroy the red target\") .. \"|\"")
  2231 	WriteLnToConsole("		else ")
  2231 	WriteLnToConsole("		else ")
  2232 	WriteLnToConsole("			vComment = loc(\"Destroy the red targets\")")
  2232 	WriteLnToConsole("			vComment = loc(\"- Destroy the red targets\") .. \"|\"")
  2233 	WriteLnToConsole("		end")
  2233 	WriteLnToConsole("		end")
  2234 	WriteLnToConsole("	end")
  2234 	WriteLnToConsole("	end")
  2235 	WriteLnToConsole("")
  2235 	WriteLnToConsole("")
  2236 	WriteLnToConsole("	if collectObj > 0 then ")
  2236 	WriteLnToConsole("	if collectObj > 0 then ")
  2237 	WriteLnToConsole("		if collectObj == 1 then ")
  2237 	WriteLnToConsole("		if collectObj == 1 then ")
  2238 	WriteLnToConsole("			collectComment = loc(\"Collect the blue target\")")
  2238 	WriteLnToConsole("			collectComment = loc(\"- Collect the blue crate\") .. \"|\"")
  2239 	WriteLnToConsole("		else ")
  2239 	WriteLnToConsole("		else ")
  2240 	WriteLnToConsole("			collectComment = loc(\"Collect all the blue targets\")")
  2240 	WriteLnToConsole("			collectComment = loc(\"- Collect all the blue crates\") .. \"|\"")
  2241 	WriteLnToConsole("		end")
  2241 	WriteLnToConsole("		end")
  2242 	WriteLnToConsole("	end")
  2242 	WriteLnToConsole("	end")
  2243 	WriteLnToConsole("")
  2243 	WriteLnToConsole("")
  2244 	WriteLnToConsole("	if (collectObj == 0) and (victoryObj == 0) then")
  2244 	WriteLnToConsole("	if (collectObj == 0) and (victoryObj == 0) then")
  2245 	WriteLnToConsole("		vComment = loc(\"Destroy the enemy.\")")
  2245 	WriteLnToConsole("		vComment = loc(\"- Destroy the enemy\") .. \"|\"")
  2246 	WriteLnToConsole("	end")
  2246 	WriteLnToConsole("	end")
  2247 	WriteLnToConsole("")
  2247 	WriteLnToConsole("")
  2248 	WriteLnToConsole("	if failObj > 0 then ")
  2248 	WriteLnToConsole("	if failObj > 0 then ")
  2249 	WriteLnToConsole("		if failObj == 1 then ")
  2249 	WriteLnToConsole("		if failObj == 1 then ")
  2250 	WriteLnToConsole("			fComment = loc(\"The green target must survive\")")
  2250 	WriteLnToConsole("			fComment = loc(\"- The green target must survive\") .. \"|\"")
  2251 	WriteLnToConsole("		else ")
  2251 	WriteLnToConsole("		else ")
  2252 	WriteLnToConsole("			fComment = loc(\"The green targets must survive\")")
  2252 	WriteLnToConsole("			fComment = loc(\"- The green targets must survive\") .. \"|\"")
  2253 	WriteLnToConsole("		end")
  2253 	WriteLnToConsole("		end")
  2254 	WriteLnToConsole("	end")
  2254 	WriteLnToConsole("	end")
  2255 	WriteLnToConsole("")
  2255 	WriteLnToConsole("")
  2256 	WriteLnToConsole("	ShowMission(loc(\"User Challenge\"), loc(\"Mission Goals\") .. \":\", collectComment .. \"|\" .. vComment .. \"|\" .. fComment, 0, 0)")
  2256 	WriteLnToConsole("	ShowMission(loc(\"User Mission\"), loc(\"Mission\"), collectComment .. vComment .. fComment, 1, 0)")
  2257 	WriteLnToConsole("")
  2257 	WriteLnToConsole("")
  2258 	WriteLnToConsole("end")
  2258 	WriteLnToConsole("end")
  2259 
  2259 
  2260 	WriteLnToConsole("")
  2260 	WriteLnToConsole("")
  2261 	WriteLnToConsole("function isATrackedGear(gear)")
  2261 	WriteLnToConsole("function isATrackedGear(gear)")
  2302 	WriteLnToConsole("				teamCounter = 1")
  2302 	WriteLnToConsole("				teamCounter = 1")
  2303 	WriteLnToConsole("			end")
  2303 	WriteLnToConsole("			end")
  2304 	WriteLnToConsole("")
  2304 	WriteLnToConsole("")
  2305 	WriteLnToConsole("			if (c ==  \"victory\") and (GetHogLevel(hhs[i]) ~= 0) then")
  2305 	WriteLnToConsole("			if (c ==  \"victory\") and (GetHogLevel(hhs[i]) ~= 0) then")
  2306 	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
  2306 	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
  2307 	WriteLnToConsole("				ShowMission(loc(\"User Challenge\"), loc(\"MISSION SUCCESSFUL\"), loc(\"Congratulations!\"), 0, 0)")
  2307 	WriteLnToConsole("				AddCaption(loc(\"Victory!\"), 0xFFFFFFFF, capgrpGameState)")
       
  2308 	WriteLnToConsole("				ShowMission(loc(\"User Mission\"), loc(\"Mission\"), loc(\"Mission succeeded!\"), 0, 0)")
  2308 	WriteLnToConsole("			elseif (c ==  \"failure\") and (GetHogLevel(hhs[i]) == 0) then")
  2309 	WriteLnToConsole("			elseif (c ==  \"failure\") and (GetHogLevel(hhs[i]) == 0) then")
  2309 	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
  2310 	WriteLnToConsole("				DismissTeam(GetHogTeamName(hhs[i]))")
  2310 	WriteLnToConsole("				ShowMission(loc(\"User Challenge\"), loc(\"MISSION FAILED\"), loc(\"Oh no! Just try again!\"), -amSkip, 0)")
  2311 	WriteLnToConsole("				AddCaption(loc(\"Defeat!\"), 0xFFFFFFFF, capgrpGameState)")
       
  2312 	WriteLnToConsole("				ShowMission(loc(\"User Mission\"), loc(\"Mission\"), loc(\"Mission failed!\"), -amSkip, 0)")
  2311 	WriteLnToConsole("			elseif (c ==  \"victory\") and (GetHogLevel(hhs[i]) == 0) then")
  2313 	WriteLnToConsole("			elseif (c ==  \"victory\") and (GetHogLevel(hhs[i]) == 0) then")
  2312 	WriteLnToConsole("				PlaySound(sndVictory,hhs[i]) -- check if we actually need this")
  2314 	WriteLnToConsole("				PlaySound(sndVictory,hhs[i]) -- check if we actually need this")
  2313 	WriteLnToConsole("			end")
  2315 	WriteLnToConsole("			end")
  2314 	WriteLnToConsole("")
  2316 	WriteLnToConsole("")
  2315 	WriteLnToConsole("		end")
  2317 	WriteLnToConsole("		end")
  3208 		loc("Change Selection: [Up], [Down], [Left], [Right]") .. "|" ..
  3210 		loc("Change Selection: [Up], [Down], [Left], [Right]") .. "|" ..
  3209 		loc("Toggle Help: Precise+1 (While a tool is selected)") .. "|" ..
  3211 		loc("Toggle Help: Precise+1 (While a tool is selected)") .. "|" ..
  3210 		" " .. "|" ..
  3212 		" " .. "|" ..
  3211 		loc("COMMANDS: (Use while no weapon is selected)") .. "|" ..
  3213 		loc("COMMANDS: (Use while no weapon is selected)") .. "|" ..
  3212 		loc("Save Level: Precise+4") .. "|" ..
  3214 		loc("Save Level: Precise+4") .. "|" ..
  3213 		loc("Toggle Editing Weapons and Tools: Precise+2") .. "|" ..
  3215 		loc("Toggle Editing Weapons and Tools: Precise+2")
  3214 		" " .. "|" ..
  3216 		, 4, 5000
  3215 		"", 4, 5000
       
  3216 		)
  3217 		)
  3217 	hedgeEditorMissionPanelShown = true
  3218 	hedgeEditorMissionPanelShown = true
  3218 end
  3219 end
  3219 
  3220 
  3220 function onGameStart()
  3221 function onGameStart()