share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 12014 9937075bbfd5
parent 12012 06afe8535b1c
child 12015 37787ab00853
equal deleted inserted replaced
12013:3e615852f36e 12014:9937075bbfd5
   408 ----------------------------
   408 ----------------------------
   409 
   409 
   410 local preMadeTeam = 	{
   410 local preMadeTeam = 	{
   411 
   411 
   412 				{
   412 				{
   413 				"Clowns",
   413 				loc_noop("Clowns"),
   414 				{"WhySoSerious","clown-copper","clown-crossed","clown","Joker"},
   414 				{"WhySoSerious","clown-copper","clown-crossed","clown","Joker"},
   415 				{"Baggy","Bingo","Bobo","Bozo","Buster","Chester","Copper","Heckles","Giggles","Jingo","Molly","Loopy","Patches","Tatters"},
   415 				{loc_noop("Baggy"),loc_noop("Bingo"),loc_noop("Bobo"),loc_noop("Bozo"),loc_noop("Buster"),loc_noop("Chester"),loc_noop("Copper"),loc_noop("Heckles"),loc_noop("Giggles"),loc_noop("Jingo"),loc_noop("Molly"),loc_noop("Loopy"),loc_noop("Patches"),loc_noop("Tatters")},
   416 				"R","cm_birdy","Mobster","Rubberduck","Castle"
   416 				"R","cm_birdy","Mobster","Rubberduck","Castle"
   417 				},
   417 				},
   418 
   418 
   419 				{
   419 				{
   420 				"Street Fighters",
   420 				loc_noop("Street Fighters"),
   421 				{"sf_balrog","sf_blanka","sf_chunli","sf_guile","sf_honda","sf_ken","sf_ryu","sf_vega"},
   421 				{"sf_balrog","sf_blanka","sf_chunli","sf_guile","sf_honda","sf_ken","sf_ryu","sf_vega"},
   422 				{"Balrog","Blanka","Chunli","Guile","Honda","Ken","Ryu","Vega"},
   422 				{loc_noop("Balrog"),loc_noop("Blanka"),loc_noop("Chunli"),loc_noop("Guile"),loc_noop("Honda"),loc_noop("Ken"),loc_noop("Ryu"),loc_noop("Vega")},
   423 				"F","cm_balrog","Surfer","dragonball","Castle"
   423 				"F","cm_balrog","Surfer","dragonball","Castle"
   424 				},
   424 				},
   425 
   425 
   426 				{
   426 				{
   427 				"Cybernetic Empire",
   427 				loc_noop("Cybernetic Empire"),
   428 				{"cyborg1","cyborg2"},
   428 				{"cyborg1","cyborg2"},
   429 				{"Unit 189","Unit 234","Unit 333","Unit 485","Unit 527","Unit 638","Unit 709","Unit 883"},
   429 				{loc_noop("Unit 189"),loc_noop("Unit 234"),loc_noop("Unit 333"),loc_noop("Unit 485"),loc_noop("Unit 527"),loc_noop("Unit 638"),loc_noop("Unit 709"),loc_noop("Unit 883")},
   430 				"R","cm_binary","Robot","Grave","Castle"
   430 				"R","cm_binary","Robot","Grave","Castle"
   431 				},
   431 				},
   432 
   432 
   433 				{
   433 				{
   434 				"Color Squad",
   434 				loc_noop("Color Squad"),
   435 				{"hair_blue","hair_green","hair_red","hair_yellow","hair_purple","hair_grey","hair_orange","hair_pink"},
   435 				{"hair_blue","hair_green","hair_red","hair_yellow","hair_purple","hair_grey","hair_orange","hair_pink"},
   436 				{"Blue","Green","Red","Yellow","Purple","Grey","Orange","Pink"},
   436 				{loc_noop("Blue"),loc_noop("Green"),loc_noop("Red"),loc_noop("Yellow"),loc_noop("Purple"),loc_noop("Grey"),loc_noop("Orange"),loc_noop("Pink")},
   437 				"F","cm_birdy","Singer","Grave","Castle"
   437 				"F","cm_birdy","Singer","Grave","Castle"
   438 				},
   438 				},
   439 
   439 
   440 				{
   440 				{
   441 				"Fruit",
   441 				loc_noop("Fruit"),
   442 				{"fr_apple","fr_banana","fr_lemon","fr_orange","fr_pumpkin","fr_tomato"},
   442 				{"fr_apple","fr_banana","fr_lemon","fr_orange","fr_pumpkin","fr_tomato"},
   443 				{"Juicy","Squishy","Sweet","Sour","Bitter","Ripe","Rotten","Fruity"},
   443 				{loc_noop("Juicy"),loc_noop("Squishy"),loc_noop("Sweet"),loc_noop("Sour"),loc_noop("Bitter"),loc_noop("Ripe"),loc_noop("Rotten"),loc_noop("Fruity")},
   444 				"R","cm_mog","Default","Cherry","Castle"
   444 				"R","cm_mog","Default","Cherry","Castle"
   445 				},
   445 				},
   446 
   446 
   447 				{
   447 				{
   448 				"The Police",
   448 				loc_noop("The Police"),
   449 				{"bobby","bobby2v","policecap","policegirl","royalguard"},
   449 				{"bobby","bobby2v","policecap","policegirl","royalguard"},
   450 				{"Hightower","Lassard","Callahan","Jones","Harris","Thompson","Mahoney","Hooks","Tackleberry"},
   450 				{loc_noop("Hightower"),loc_noop("Lassard"),loc_noop("Callahan"),loc_noop("Jones"),loc_noop("Harris"),loc_noop("Thompson"),loc_noop("Mahoney"),loc_noop("Hooks"),loc_noop("Tackleberry")},
   451 				"R","cm_star","British","Statue","Castle"
   451 				"R","cm_star","British","Statue","Castle"
   452 				},
   452 				},
   453 
   453 
   454 				{
   454 				{
   455 				"The Ninja-Samurai Alliance",
   455 				loc_noop("The Ninja-Samurai Alliance"),
   456 				{"NinjaFull","NinjaStraight","NinjaTriangle","Samurai","StrawHat","StrawHatEyes","StrawHatFacial","naruto"},
   456 				{"NinjaFull","NinjaStraight","NinjaTriangle","Samurai","StrawHat","StrawHatEyes","StrawHatFacial","naruto"},
   457 				{"Bushi","Tatsujin","Itami","Arashi","Shinobi","Ukemi","Godai","Kenshi","Ninpo"},
   457 				{loc_noop("Bushi"),loc_noop("Tatsujin"),loc_noop("Itami"),loc_noop("Arashi"),loc_noop("Shinobi"),loc_noop("Ukemi"),loc_noop("Godai"),loc_noop("Kenshi"),loc_noop("Ninpo")},
   458 				"R","japan","Default","octopus","Castle"
   458 				"R","japan","Default","octopus","Castle"
   459 				},
   459 				},
   460 
   460 
   461 				{
   461 				{
   462 				"Pokémon",
   462 				loc_noop("Pokémon"),
   463 				{"poke_ash","poke_charmander","poke_chikorita","poke_jigglypuff","poke_lugia","poke_mudkip","poke_pikachu","poke_slowpoke","poke_squirtle","poke_voltorb"},
   463 				{"poke_ash","poke_charmander","poke_chikorita","poke_jigglypuff","poke_lugia","poke_mudkip","poke_pikachu","poke_slowpoke","poke_squirtle","poke_voltorb"},
   464 				{"Ash","Charmander","Chikorita","Jigglypuff","Lugia","Mudkip","Pikachu","Slowpoke","Squirtle","Voltorb"},
   464 				{loc_noop("Ash"),loc_noop("Charmander"),loc_noop("Chikorita"),loc_noop("Jigglypuff"),loc_noop("Lugia"),loc_noop("Mudkip"),loc_noop("Pikachu"),loc_noop("Slowpoke"),loc_noop("Squirtle"),loc_noop("Voltorb")},
   465 				"FR","cm_pokemon","Default","pokeball","Castle"
   465 				"FR","cm_pokemon","Default","pokeball","Castle"
   466 				},
   466 				},
   467 
   467 
   468 				{
   468 				{
   469 				"The Zoo",
   469 				loc_noop("The Zoo"),
   470 				{"zoo_Bat","zoo_Beaver","zoo_Bunny","zoo_Deer","zoo_Hedgehog","zoo_Moose","zoo_Pig","zoo_Porkey","zoo_Sheep","zoo_chicken","zoo_elephant","zoo_fish","zoo_frog","zoo_snail","zoo_turtle"},
   470 				{"zoo_Bat","zoo_Beaver","zoo_Bunny","zoo_Deer","zoo_Hedgehog","zoo_Moose","zoo_Pig","zoo_Porkey","zoo_Sheep","zoo_chicken","zoo_elephant","zoo_fish","zoo_frog","zoo_snail","zoo_turtle"},
   471 				{"Batty","Tails","Bunny","Deer","Spikes","Horns","Bacon","Porkey","Sheepy","Chicken","Trunks","Fishy","Legs","Slimer","Roshi"},
   471 				{loc_noop("Batty"),loc_noop("Tails"),loc_noop("Bunny"),loc_noop("Deer"),loc_noop("Spikes"),loc_noop("Horns"),loc_noop("Bacon"),loc_noop("Porkey"),loc_noop("Sheepy"),loc_noop("Chicken"),loc_noop("Trunks"),loc_noop("Fishy"),loc_noop("Legs"),loc_noop("Slimer"),loc_noop("Roshi")},
   472 				"FR","cm_hurrah","Default","Bone","Castle"
   472 				"FR","cm_hurrah","Default","Bone","Castle"
   473 				},
   473 				},
   474 
   474 
   475 				{
   475 				{
   476 				"The Devs",
   476 				loc_noop("The Devs"),
   477 				{"ushanka","zoo_Sheep","bb_bob","Skull","poke_mudkip","lambda","WizardHat","sf_ryu","android","fr_lemon","mp3"},
   477 				{"ushanka","zoo_Sheep","bb_bob","Skull","poke_mudkip","lambda","WizardHat","sf_ryu","android","fr_lemon","mp3"},
   478 				{"unC0Rr", "sheepluva", "nemo", "mikade", "koda", "burp","HeneK","Tiyuri","Xeli","Displacer","szczur"},
   478 				{loc_noop("unC0Rr"), loc_noop("sheepluva"), loc_noop("nemo"), loc_noop("mikade"), loc_noop("koda"), loc_noop("burp"),loc_noop("HeneK"),loc_noop("Tiyuri"),loc_noop("Xeli"),loc_noop("Displacer"),loc_noop("szczur")},
   479 				"FR","hedgewars","Classic","Statue","Castle"
   479 				"FR","hedgewars","Classic","Statue","Castle"
   480 				},
   480 				},
   481 
   481 
   482 				{
   482 				{
   483 				"Mushroom Kingdom",
   483 				loc_noop("Mushroom Kingdom"),
   484 				{"sm_daisy","sm_luigi","sm_mario","sm_peach","sm_toad","sm_wario"},
   484 				{"sm_daisy","sm_luigi","sm_mario","sm_peach","sm_toad","sm_wario"},
   485 				{"Daisy","Luigi","Mario","Princess Peach","Toad","Wario"},
   485 				{loc_noop("Daisy"),loc_noop("Luigi"),loc_noop("Mario"),loc_noop("Princess Peach"),loc_noop("Toad"),loc_noop("Wario")},
   486 				"FR","cm_birdy","Default","Badger","Castle"
   486 				"FR","cm_birdy","Default","Badger","Castle"
   487 				},
   487 				},
   488 
   488 
   489 				{
   489 				{
   490 				"Pirates",
   490 				loc_noop("Pirates"),
   491 				{"pirate_jack","pirate_jack_bandana"},
   491 				{"pirate_jack","pirate_jack_bandana"},
   492 				{"Rusted Diego","Fuzzy Beard","Al.Kaholic","Morris","Yumme Gunpowder","Cutlass Cain","Jim Morgan","Silver","Dubloon Devil","Ugly Mug","Fair Wind","Scallywag","Salty Dog","Bearded Beast","Timbers","Both Barrels","Jolly Roger"},
   492 				{loc_noop("Rusted Diego"),loc_noop("Fuzzy Beard"),loc_noop("Al.Kaholic"),loc_noop("Morris"),loc_noop("Yumme Gunpowder"),loc_noop("Cutlass Cain"),loc_noop("Jim Morgan"),loc_noop("Silver"),loc_noop("Dubloon Devil"),loc_noop("Ugly Mug"),loc_noop("Fair Wind"),loc_noop("Scallywag"),loc_noop("Salty Dog"),loc_noop("Bearded Beast"),loc_noop("Timbers"),loc_noop("Both Barrels"),loc_noop("Jolly Roger")},
   493 				"R","cm_pirate","Pirate","chest","Castle"
   493 				"R","cm_pirate","Pirate","chest","Castle"
   494 				},
   494 				},
   495 
   495 
   496 				{
   496 				{
   497 				"Gangsters",
   497 				loc_noop("Gangsters"),
   498 				{"Moustache","Cowboy","anzac","Bandit","thug","Jason","NinjaFull","chef"},
   498 				{"Moustache","Cowboy","anzac","Bandit","thug","Jason","NinjaFull","chef"},
   499 				{"The Boss","Jimmy","Frankie","Morris","Mooney","Knives","Tony","Meals"},
   499 				{loc_noop("The Boss"),loc_noop("Jimmy"),loc_noop("Frankie"),loc_noop("Morris"),loc_noop("Mooney"),loc_noop("Knives"),loc_noop("Tony"),loc_noop("Meals")},
   500 				"F","cm_anarchy","Mobster","deadhog","Castle"
   500 				"F","cm_anarchy","Mobster","deadhog","Castle"
   501 				},
   501 				},
   502 
   502 
   503 
   503 
   504 				{
   504 				{
   505 				"Twenty-Twenty",
   505 				loc_noop("Twenty-Twenty"),
   506 				{"Glasses","lambda","SunGlasses","Sniper","Terminator_Glasses","Moustache_glasses","doctor","punkman","rasta"},
   506 				{"Glasses","lambda","SunGlasses","Sniper","Terminator_Glasses","Moustache_glasses","doctor","punkman","rasta"},
   507 				{"Specs","Speckles","Spectator","Glasses","Glassy","Harry Potter","Goggles","Clark Kent","Goggs","Lightbender","Specs Appeal","Four Eyes"},
   507 				{loc_noop("Specs"),loc_noop("Speckles"),loc_noop("Spectator"),loc_noop("Glasses"),loc_noop("Glassy"),loc_noop("Harry Potter"),loc_noop("Goggles"),loc_noop("Clark Kent"),loc_noop("Goggs"),loc_noop("Lightbender"),loc_noop("Specs Appeal"),loc_noop("Four Eyes")},
   508 				"R","cm_face","Default","eyecross","Castle"
   508 				"R","cm_face","Default","eyecross","Castle"
   509 				},
   509 				},
   510 
   510 
   511 
   511 
   512 				{
   512 				{
   513 				"Monsters",
   513 				loc_noop("Monsters"),
   514 				{"Skull","Jason","ShaggyYeti","Zombi","cyclops","Mummy","hogpharoah","vampirichog"},
   514 				{"Skull","Jason","ShaggyYeti","Zombi","cyclops","Mummy","hogpharoah","vampirichog"},
   515 				{"Bones","Jason","Yeti","Zombie","Old One Eye","Ramesses","Xerxes","Count Hogula"},
   515 				{loc_noop("Bones"),loc_noop("Jason"),loc_noop("Yeti"),loc_noop("Zombie"),loc_noop("Old One Eye"),loc_noop("Ramesses"),loc_noop("Xerxes"),loc_noop("Count Hogula")},
   516 				"FR","cm_vampire","Default","octopus","Castle"
   516 				"FR","cm_vampire","Default","octopus","Castle"
   517 				},
   517 				},
   518 
   518 
   519 				{
   519 				{
   520 				"The Iron Curtain",
   520 				loc_noop("The Iron Curtain"),
   521 				{"ushanka","war_sovietcomrade1","war_sovietcomrade1","ushanka"},
   521 				{"ushanka","war_sovietcomrade1","war_sovietcomrade1","ushanka"},
   522 				{"Alex","Sergey","Vladimir","Andrey","Dimitry","Ivan","Oleg","Kostya","Anton","Eugene"},
   522 				{loc_noop("Alex"),loc_noop("Sergey"),loc_noop("Vladimir"),loc_noop("Andrey"),loc_noop("Dimitry"),loc_noop("Ivan"),loc_noop("Oleg"),loc_noop("Kostya"),loc_noop("Anton"),loc_noop("Eugene")},
   523 				"R","cm_soviet","Russian","skull","Castle"
   523 				"R","cm_soviet","Russian","skull","Castle"
   524 				},
   524 				},
   525 
   525 
   526 				{
   526 				{
   527 				"Desert Storm",
   527 				loc_noop("Desert Storm"),
   528 				{"war_desertofficer","war_desertgrenadier1","war_desertmedic","war_desertsapper1","war_desertgrenadier2","war_desertgrenadier4","war_desertsapper2","war_desertgrenadier5"},
   528 				{"war_desertofficer","war_desertgrenadier1","war_desertmedic","war_desertsapper1","war_desertgrenadier2","war_desertgrenadier4","war_desertsapper2","war_desertgrenadier5"},
   529 				{"Brigadier Briggs","Lt. Luke","Sgt. Smith","Corporal Calvin","Frank","Joe","Sam","Donald"},
   529 				{loc_noop("Brigadier Briggs"),loc_noop("Lt. Luke"),loc_noop("Sgt. Smith"),loc_noop("Corporal Calvin"),loc_noop("Frank"),loc_noop("Joe"),loc_noop("Sam"),loc_noop("Donald")},
   530 				"F","cm_birdy","Default","Grave","Castle"
   530 				"F","cm_birdy","Default","Grave","Castle"
   531 				},
   531 				},
   532 
   532 
   533 				{
   533 				{
   534 				"The Hospital",
   534 				loc_noop("The Hospital"),
   535 				{"doctor","nurse","war_britmedic","war_desertmedic","war_germanww2medic"},
   535 				{"doctor","nurse","war_britmedic","war_desertmedic","war_germanww2medic"},
   536 				{"Dr. Blackwell","Dr. Drew","Dr. Harvey","Dr. Crushing","Dr. Jenner","Dr. Barnard","Dr. Parkinson","Dr. Banting","Dr. Horace","Dr. Hollows","Dr. Jung"},
   536 				{loc_noop("Dr. Blackwell"),loc_noop("Dr. Drew"),loc_noop("Dr. Harvey"),loc_noop("Dr. Crushing"),loc_noop("Dr. Jenner"),loc_noop("Dr. Barnard"),loc_noop("Dr. Parkinson"),loc_noop("Dr. Banting"),loc_noop("Dr. Horace"),loc_noop("Dr. Hollows"),loc_noop("Dr. Jung")},
   537 				"R","cm_birdy","Default","heart","Castle"
   537 				"R","cm_birdy","Default","heart","Castle"
   538 				}
   538 				}
   539 
   539 
   540 				}
   540 				}
   541 
   541 
       
   542 local preMadeTeamNamesTranslated = {}
       
   543 local preMadeTeamNamesOriginal = {}
       
   544 for i=1, #preMadeTeam do
       
   545 	table.insert(preMadeTeamNamesOriginal, preMadeTeam[i][1])
       
   546 	table.insert(preMadeTeamNamesTranslated, loc(preMadeTeam[i][1]))
       
   547 end
   542 
   548 
   543 local fortArray =	{
   549 local fortArray =	{
   544 					"Cake", "Castle", "Earth", "EvilChicken", "Flowerhog",
   550 					"Cake", "Castle", "Earth", "EvilChicken", "Flowerhog",
   545 					"Hydrant", "Lego", "Plane", "Statue", "SteelTower", "Tank",
   551 					"Hydrant", "Lego", "Plane", "Statue", "SteelTower", "Tank",
   546 					"UFO", "Wood"
   552 					"UFO", "Wood"
  1381 	elseif cat[cIndex] == loc("Goal Mode") then
  1387 	elseif cat[cIndex] == loc("Goal Mode") then
  1382 		pMode = {loc("Victory Condition: Destroy"),loc("Losing Condition: Destroy"),loc("Victory Condition: Collect")}
  1388 		pMode = {loc("Victory Condition: Destroy"),loc("Losing Condition: Destroy"),loc("Victory Condition: Collect")}
  1383 	elseif cat[cIndex] == loc("Hog Identity Mode") then
  1389 	elseif cat[cIndex] == loc("Hog Identity Mode") then
  1384 		pMode = {loc("Soldier"),loc("Grenadier"),loc("Sniper"),loc("Pyro"),loc("Ninja"),loc("Commander"),loc("Chef"),loc("Engineer"),loc("Physicist"),loc("Trapper"),loc("Saint"),loc("Clown")}
  1390 		pMode = {loc("Soldier"),loc("Grenadier"),loc("Sniper"),loc("Pyro"),loc("Ninja"),loc("Commander"),loc("Chef"),loc("Engineer"),loc("Physicist"),loc("Trapper"),loc("Saint"),loc("Clown")}
  1385 	elseif cat[cIndex] == loc("Team Identity Mode") then
  1391 	elseif cat[cIndex] == loc("Team Identity Mode") then
  1386 		pMode = {loc("Clowns"),loc("Street Fighters"),loc("Cybernetic Empire"),loc("Color Squad"),loc("Fruit"),loc("The Police"),loc("The Ninja-Samurai Alliance"),loc("Pokémon"),loc("The Zoo"),loc("The Devs"),loc("Mushroom Kingdom"),loc("Pirates"),loc("Gangsters"),loc("Twenty-Twenty"),loc("Monsters"),loc("The Iron Curtain"),loc("Desert Storm"),loc("The Hospital")}
  1392 		pMode = preMadeTeamNamesTranslated
  1387 	elseif cat[cIndex] == loc("Health Modification Mode") then
  1393 	elseif cat[cIndex] == loc("Health Modification Mode") then
  1388 		pMode = { {100, "set"}, {125, "set"}, {150, "set"}, {200, "set"}, {300, "set"}, {1000, "set"},
  1394 		pMode = { {100, "set"}, {125, "set"}, {150, "set"}, {200, "set"}, {300, "set"}, {1000, "set"},
  1389 			{"-100", "mod"}, {"-10", "mod"}, {"-1", "mod"}, {"+1", "mod"}, {"+10", "mod"}, {"+100", "mod"},
  1395 			{"-100", "mod"}, {"-10", "mod"}, {"-1", "mod"}, {"+1", "mod"}, {"+10", "mod"}, {"+100", "mod"},
  1390 			{1, "set"}, {10, "set"}, {15, "set"}, {20, "set"}, {25, "set"}, {30, "set"}, {40, "set"}, {50, "set"}, {75, "set"}, 
  1396 			{1, "set"}, {10, "set"}, {15, "set"}, {20, "set"}, {25, "set"}, {30, "set"}, {40, "set"}, {50, "set"}, {75, "set"}, 
  1391 } 
  1397 } 
  1458 		end
  1464 		end
  1459 
  1465 
  1460 		lastRecordedTeam = GetHogTeamName(gear)
  1466 		lastRecordedTeam = GetHogTeamName(gear)
  1461 
  1467 
  1462 		table.insert(tempDataList, "")
  1468 		table.insert(tempDataList, "")
       
  1469 
       
  1470 		local oTeamName = getGearValue(gear, "originalTeamName")
       
  1471 		if oTeamName == nil or oTeamName == "" then
       
  1472 			oTeamName = GetHogTeamName(gear)
       
  1473 		end
  1463 		table.insert	(tempDataList,
  1474 		table.insert	(tempDataList,
  1464 						"	AddTeam(loc(\"" ..
  1475 						"	AddTeam(loc(\"" ..
  1465 						GetHogTeamName(gear) .. "\")" ..
  1476 						oTeamName  .. "\")" ..
  1466 						", " .. tColor ..
  1477 						", " .. tColor ..
  1467 						", " .. "\"" .. tGrave .. "\"" ..
  1478 						", " .. "\"" .. tGrave .. "\"" ..
  1468 						", " .. "\"" .. tFort .. "\"" ..
  1479 						", " .. "\"" .. tFort .. "\"" ..
  1469 						", " .. "\"" .. tVoice .. "\"" ..
  1480 						", " .. "\"" .. tVoice .. "\"" ..
  1470 						", " .. "\"" .. tFlag .. "\"" ..
  1481 						", " .. "\"" .. tFlag .. "\"" ..
  1473 
  1484 
  1474 	end
  1485 	end
  1475 
  1486 
  1476 	table.insert(hhs, gear)
  1487 	table.insert(hhs, gear)
  1477 
  1488 
       
  1489 	local oName = getGearValue(gear, "originalName")
       
  1490 	if oName == nil or oName == "" then
       
  1491 		oName = GetHogName(gear)
       
  1492 	end
  1478 	table.insert	(tempDataList,	"	hhs[" .. #hhs .."] = AddHog(loc(\"" ..
  1493 	table.insert	(tempDataList,	"	hhs[" .. #hhs .."] = AddHog(loc(\"" ..
  1479 					GetHogName(gear) .. "\"), " ..
  1494 					oName .. "\"), " ..
  1480 					GetHogLevel(gear) .. ", " ..
  1495 					GetHogLevel(gear) .. ", " ..
  1481 					GetHealth(gear) .. ", \"" ..
  1496 					GetHealth(gear) .. ", \"" ..
  1482 					GetHogHat(gear) .. "\"" ..
  1497 					GetHogHat(gear) .. "\"" ..
  1483 					")"
  1498 					")"
  1484 			)
  1499 			)
  3317 
  3332 
  3318 		setGearValue(gear,"flag",preMadeTeam[pIndex][5])
  3333 		setGearValue(gear,"flag",preMadeTeam[pIndex][5])
  3319 		setGearValue(gear,"voice",preMadeTeam[pIndex][6])
  3334 		setGearValue(gear,"voice",preMadeTeam[pIndex][6])
  3320 		setGearValue(gear,"grave",preMadeTeam[pIndex][7])
  3335 		setGearValue(gear,"grave",preMadeTeam[pIndex][7])
  3321 		setGearValue(gear,"fort",preMadeTeam[pIndex][8])
  3336 		setGearValue(gear,"fort",preMadeTeam[pIndex][8])
       
  3337 		setGearValue(gear,"originalTeamName",preMadeTeamNamesOriginal[pIndex])
  3322 
  3338 
  3323 		if preMadeTeam[pIndex][4] == "R" then -- random team
  3339 		if preMadeTeam[pIndex][4] == "R" then -- random team
  3324 
  3340 
  3325 			if #hArr > 0 then
  3341 			if #hArr > 0 then
  3326 				--if there are unchosen hats left, choose one
  3342 				--if there are unchosen hats left, choose one
  3333 				SetHogHat(gear,preMadeTeam[pIndex][2][1+GetRandom(#preMadeTeam[pIndex][2])])
  3349 				SetHogHat(gear,preMadeTeam[pIndex][2][1+GetRandom(#preMadeTeam[pIndex][2])])
  3334 			end
  3350 			end
  3335 
  3351 
  3336 			if #nArr > 0 then
  3352 			if #nArr > 0 then
  3337 				i = 1+GetRandom(#nArr)
  3353 				i = 1+GetRandom(#nArr)
  3338 				SetHogName(gear,nArr[i])
  3354 				SetHogNameAndTranslate(gear, nArr[i])
  3339 				table.remove(nArr,i)
  3355 				table.remove(nArr,i)
  3340 			else
  3356 			else
  3341 				SetHogName(gear,preMadeTeam[pIndex][3][1+GetRandom(#preMadeTeam[pIndex][3])])
  3357 				SetHogNameAndTranslate(gear, preMadeTeam[pIndex][3][1+GetRandom(#preMadeTeam[pIndex][3])])
  3342 			end
  3358 			end
  3343 
  3359 
  3344 		elseif preMadeTeam[pIndex][4] == "F" then -- fixed team w/ exactly 8 guys
  3360 		elseif preMadeTeam[pIndex][4] == "F" then -- fixed team w/ exactly 8 guys
  3345 			SetHogName(gear,preMadeTeam[pIndex][3][hIndex])
  3361 			SetHogNameAndTranslate(gear, preMadeTeam[pIndex][3][hIndex])
  3346 			SetHogHat(gear,preMadeTeam[pIndex][2][hIndex])
  3362 			SetHogHat(gear,preMadeTeam[pIndex][2][hIndex])
  3347 			hIndex = hIndex +1
  3363 			hIndex = hIndex +1
  3348 		else -- FR fixed random team with more or less than 8 guys
  3364 		else -- FR fixed random team with more or less than 8 guys
  3349 
  3365 
  3350 			if #hArr > 0 then
  3366 			if #hArr > 0 then
  3351 				i = 1+GetRandom(#hArr)
  3367 				i = 1+GetRandom(#hArr)
  3352 				SetHogHat(gear,hArr[i])
  3368 				SetHogHat(gear,hArr[i])
  3353 				SetHogName(gear,nArr[i])
  3369 				SetHogNameAndTranslate(gear, nArr[i])
  3354 				table.remove(hArr,i)
  3370 				table.remove(hArr,i)
  3355 				table.remove(nArr,i)
  3371 				table.remove(nArr,i)
  3356 			else
  3372 			else
  3357 				SetHogHat(gear,"NoHat")
  3373 				SetHogHat(gear,"NoHat")
  3358 				SetHogName(gear,"Uninspiring hog")
  3374 				SetHogNameAndTranslate(gear,loc_noop("Hedgehog"))
  3359 			end
  3375 			end
  3360 
  3376 
  3361 		end
  3377 		end
  3362 
  3378 
  3363 	end
  3379 	end
  3370 
  3386 
  3371 	clearAmmo(gear)
  3387 	clearAmmo(gear)
  3372 
  3388 
  3373 	if pro == loc("Sniper") then
  3389 	if pro == loc("Sniper") then
  3374 
  3390 
  3375 		SetHogName(gear,loc("Sniper"))
  3391 		SetHogNameAndTranslate(gear, "Sniper")
  3376 		SetHogHat(gear, "Sniper")
  3392 		SetHogHat(gear, "Sniper")
  3377 		SetHealth(gear, 50)
  3393 		SetHealth(gear, 50)
  3378 		AddAmmo(gear, amSniperRifle, 100)
  3394 		AddAmmo(gear, amSniperRifle, 100)
  3379 		AddAmmo(gear, amDEagle, 100)
  3395 		AddAmmo(gear, amDEagle, 100)
  3380 
  3396 
  3381 	elseif pro == loc("Pyro") then
  3397 	elseif pro == loc("Pyro") then
  3382 
  3398 
  3383 		SetHogName(gear,loc("Pyro"))
  3399 		SetHogNameAndTranslate(gear, "Pyro")
  3384 		SetHogHat(gear, "Gasmask")
  3400 		SetHogHat(gear, "Gasmask")
  3385 		SetHealth(gear, 80)
  3401 		SetHealth(gear, 80)
  3386 		AddAmmo(gear, amFlamethrower, 100)
  3402 		AddAmmo(gear, amFlamethrower, 100)
  3387 		AddAmmo(gear, amMolotov, 100)
  3403 		AddAmmo(gear, amMolotov, 100)
  3388 		AddAmmo(gear, amNapalm, 1)
  3404 		AddAmmo(gear, amNapalm, 1)
  3389 
  3405 
  3390 	elseif pro == loc("Soldier") then
  3406 	elseif pro == loc("Soldier") then
  3391 
  3407 
  3392 		SetHogName(gear,loc("Soldier"))
  3408 		SetHogNameAndTranslate(gear, "Soldier")
  3393 		SetHogHat(gear, "war_americanww2helmet")
  3409 		SetHogHat(gear, "war_americanww2helmet")
  3394 		SetHealth(gear, 100)
  3410 		SetHealth(gear, 100)
  3395 		AddAmmo(gear, amBazooka, 100)
  3411 		AddAmmo(gear, amBazooka, 100)
  3396 		AddAmmo(gear, amShotgun, 100)
  3412 		AddAmmo(gear, amShotgun, 100)
  3397 		AddAmmo(gear, amMortar, 100)
  3413 		AddAmmo(gear, amMortar, 100)
  3398 
  3414 
  3399 	elseif pro == loc("Grenadier") then
  3415 	elseif pro == loc("Grenadier") then
  3400 
  3416 
  3401 		SetHogName(gear,loc("Grenadier"))
  3417 		SetHogNameAndTranslate(gear, "Grenadier")
  3402 		SetHogHat(gear, "war_desertgrenadier1")
  3418 		SetHogHat(gear, "war_desertgrenadier1")
  3403 		SetHealth(gear, 100)
  3419 		SetHealth(gear, 100)
  3404 		AddAmmo(gear, amGrenade, 100)
  3420 		AddAmmo(gear, amGrenade, 100)
  3405 		AddAmmo(gear, amClusterBomb, 100)
  3421 		AddAmmo(gear, amClusterBomb, 100)
  3406 		AddAmmo(gear, amGasBomb, 100)
  3422 		AddAmmo(gear, amGasBomb, 100)
  3407 
  3423 
  3408 	elseif pro == loc("Chef") then
  3424 	elseif pro == loc("Chef") then
  3409 
  3425 
  3410 		SetHogName(gear,loc("Chef"))
  3426 		SetHogNameAndTranslate(gear, "Chef")
  3411 		SetHogHat(gear, "chef")
  3427 		SetHogHat(gear, "chef")
  3412 		SetHealth(gear, 65)
  3428 		SetHealth(gear, 65)
  3413 		AddAmmo(gear, amGasBomb, 100)
  3429 		AddAmmo(gear, amGasBomb, 100)
  3414 		AddAmmo(gear, amKnife, 100)
  3430 		AddAmmo(gear, amKnife, 100)
  3415 		AddAmmo(gear, amCake, 1)
  3431 		AddAmmo(gear, amCake, 1)
  3416 
  3432 
  3417 	elseif pro == loc("Ninja") then
  3433 	elseif pro == loc("Ninja") then
  3418 
  3434 
  3419 		SetHogName(gear,loc("Ninja"))
  3435 		SetHogNameAndTranslate(gear, "Ninja")
  3420 		SetHogHat(gear, "NinjaFull")
  3436 		SetHogHat(gear, "NinjaFull")
  3421 		SetHealth(gear, 80)
  3437 		SetHealth(gear, 80)
  3422 		AddAmmo(gear, amRope, 100)
  3438 		AddAmmo(gear, amRope, 100)
  3423 		AddAmmo(gear, amFirePunch, 100)
  3439 		AddAmmo(gear, amFirePunch, 100)
  3424 		AddAmmo(gear, amParachute, 1)
  3440 		AddAmmo(gear, amParachute, 1)
  3425 
  3441 
  3426 	elseif pro == loc("Commander") then
  3442 	elseif pro == loc("Commander") then
  3427 
  3443 
  3428 		SetHogName(gear,loc("Commander"))
  3444 		SetHogNameAndTranslate(gear, "Commander")
  3429 		SetHogHat(gear, "sf_vega")
  3445 		SetHogHat(gear, "sf_vega")
  3430 		SetHealth(gear, 120)
  3446 		SetHealth(gear, 120)
  3431 		AddAmmo(gear, amDEagle, 100)
  3447 		AddAmmo(gear, amDEagle, 100)
  3432 		AddAmmo(gear, amAirAttack, 2)
  3448 		AddAmmo(gear, amAirAttack, 2)
  3433 		AddAmmo(gear, amNapalm, 1)
  3449 		AddAmmo(gear, amNapalm, 1)
  3434 		AddAmmo(gear, amDrillStrike, 1)
  3450 		AddAmmo(gear, amDrillStrike, 1)
  3435 		AddAmmo(gear, amMineStrike, 1)
  3451 		AddAmmo(gear, amMineStrike, 1)
  3436 
  3452 
  3437 	elseif pro == loc("Engineer") then
  3453 	elseif pro == loc("Engineer") then
  3438 
  3454 
  3439 		SetHogName(gear,loc("Engineer"))
  3455 		SetHogNameAndTranslate(gear, "Engineer")
  3440 		SetHogHat(gear, "Glasses")
  3456 		SetHogHat(gear, "Glasses")
  3441 		SetHealth(gear, 45)
  3457 		SetHealth(gear, 45)
  3442 		AddAmmo(gear, amGirder, 4)
  3458 		AddAmmo(gear, amGirder, 4)
  3443 		AddAmmo(gear, amRubber, 2)
  3459 		AddAmmo(gear, amRubber, 2)
  3444 		AddAmmo(gear, amLandGun, 2)
  3460 		AddAmmo(gear, amLandGun, 2)
  3445 		AddAmmo(gear, amBlowTorch, 100)
  3461 		AddAmmo(gear, amBlowTorch, 100)
  3446 		AddAmmo(gear, amPickHammer, 100)
  3462 		AddAmmo(gear, amPickHammer, 100)
  3447 
  3463 
  3448 	elseif pro == loc("Physicist") then
  3464 	elseif pro == loc("Physicist") then
  3449 
  3465 
  3450 		SetHogName(gear,loc("Physicist"))
  3466 		SetHogNameAndTranslate(gear, "Physicist")
  3451 		SetHogHat(gear, "lambda")
  3467 		SetHogHat(gear, "lambda")
  3452 		SetHealth(gear, 80)
  3468 		SetHealth(gear, 80)
  3453 		AddAmmo(gear, amIceGun, 2)
  3469 		AddAmmo(gear, amIceGun, 2)
  3454 		AddAmmo(gear, amSineGun, 100)
  3470 		AddAmmo(gear, amSineGun, 100)
  3455 		AddAmmo(gear, amBee, 2)
  3471 		AddAmmo(gear, amBee, 2)
  3456 		AddAmmo(gear, amLowGravity, 100)
  3472 		AddAmmo(gear, amLowGravity, 100)
  3457 
  3473 
  3458 	elseif pro == loc("Trapper") then
  3474 	elseif pro == loc("Trapper") then
  3459 
  3475 
  3460 		SetHogName(gear,loc("Trapper"))
  3476 		SetHogNameAndTranslate(gear, "Trapper")
  3461 		SetHogHat(gear, "Skull")
  3477 		SetHogHat(gear, "Skull")
  3462 		SetHealth(gear, 100)
  3478 		SetHealth(gear, 100)
  3463 		AddAmmo(gear, amMine, 100)
  3479 		AddAmmo(gear, amMine, 100)
  3464 		AddAmmo(gear, amSMine, 4)
  3480 		AddAmmo(gear, amSMine, 4)
  3465 		AddAmmo(gear, amAirMine, 2)
  3481 		AddAmmo(gear, amAirMine, 2)
  3466 		AddAmmo(gear, amMolotov, 100)
  3482 		AddAmmo(gear, amMolotov, 100)
  3467 
  3483 
  3468 	elseif pro == loc("Saint") then
  3484 	elseif pro == loc("Saint") then
  3469 
  3485 
  3470 		SetHogName(gear,loc("Saint"))
  3486 		SetHogNameAndTranslate(gear, "Saint")
  3471 		SetHogHat(gear, "angel")
  3487 		SetHogHat(gear, "angel")
  3472 		SetHealth(gear, 200)
  3488 		SetHealth(gear, 200)
  3473 		AddAmmo(gear, amSeduction, 100)
  3489 		AddAmmo(gear, amSeduction, 100)
  3474 		AddAmmo(gear, amInvulnerable, 100)
  3490 		AddAmmo(gear, amInvulnerable, 100)
  3475 		AddAmmo(gear, amIceGun, 2)
  3491 		AddAmmo(gear, amIceGun, 2)
  3476 		AddAmmo(gear, amHammer, 100)
  3492 		AddAmmo(gear, amHammer, 100)
  3477 		AddAmmo(gear, amResurrector, 100)
  3493 		AddAmmo(gear, amResurrector, 100)
  3478 
  3494 
  3479 	elseif pro == loc("Clown") then
  3495 	elseif pro == loc("Clown") then
  3480 
  3496 
  3481 		SetHogName(gear,loc("Clown"))
  3497 		SetHogNameAndTranslate(gear, "Clown")
  3482 		SetHogHat(gear, "clown-copper")
  3498 		SetHogHat(gear, "clown-copper")
  3483 		SetHealth(gear, 70)
  3499 		SetHealth(gear, 70)
  3484 		AddAmmo(gear, amBaseballBat, 100)
  3500 		AddAmmo(gear, amBaseballBat, 100)
  3485 		AddAmmo(gear, amGasBomb, 100)
  3501 		AddAmmo(gear, amGasBomb, 100)
  3486 		AddAmmo(gear, amBallgun, 1)
  3502 		AddAmmo(gear, amBallgun, 1)
  3534 	else
  3550 	else
  3535 		return(false)
  3551 		return(false)
  3536 	end
  3552 	end
  3537 end
  3553 end
  3538 
  3554 
       
  3555 function SetHogNameAndTranslate(gear, originalName)
       
  3556 	SetHogName(gear, loc(originalName))
       
  3557 	--[[ Store the original (usually English) hog name, since we need it for exporting.
       
  3558 	This way, we can display the translated name in the editor and export the properly
       
  3559 	loc()'ed original name afterwards ]]
       
  3560 	setGearValue(gear, "originalName", originalName)
       
  3561 end
       
  3562 
  3539 -- track hedgehogs and placement gears
  3563 -- track hedgehogs and placement gears
  3540 function onGearAdd(gear)
  3564 function onGearAdd(gear)
  3541 
  3565 
  3542 	if GetGearType(gear) == gtJetpack then
  3566 	if GetGearType(gear) == gtJetpack then
  3543 		ufoGear = gear
  3567 		ufoGear = gear