Tweak hog spawn height and facing direction in challenges
authorWuzzy <Wuzzy2@mail.ru>
Mon, 21 Jan 2019 19:28:39 +0100
changeset 14653 be8af70adf2c
parent 14652 c09ac49ed1de
child 14654 e7b2542c4d28
Tweak hog spawn height and facing direction in challenges
ChangeLog.txt
share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua
share/hedgewars/Data/Missions/Challenge/Challenge_-_Speed_Shoppa_-_Hedgelove.lua
share/hedgewars/Data/Missions/Challenge/Challenge_-_Speed_Shoppa_-_Ropes.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Bazooka_easy.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Bazooka_hard.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Cluster_Bomb.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Grenade_easy.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Grenade_hard.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Homing_Bee.lua
share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Shotgun.lua
share/hedgewars/Data/Missions/Challenge/User_Mission_-_RCPlane_Challenge.lua
share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua
share/hedgewars/Data/Missions/Challenge/User_Mission_-_That_Sinking_Feeling.lua
share/hedgewars/Data/Scripts/TargetPractice.lua
--- a/ChangeLog.txt	Mon Jan 21 18:59:29 2019 +0100
+++ b/ChangeLog.txt	Mon Jan 21 19:28:39 2019 +0100
@@ -87,6 +87,7 @@
  + SendStat extension: Option to use predefined modes with siPointType, like "!POINTS" or "!TIME"
  + SimpleMission: Add isMissionTeam attribute for teams
  + SpeedShoppa/TargetPractice libraries: Remove custom hog and team info settings
+ + TargetPractice library: Add faceLeft parameter
  + Params explode, poison in the SpawnFake*Crate functions now optional and default to false
  + New global: InitHealth: Initial hog health value from game scheme (read-only)
  + Animate library: AnimOutOfNowhere: destX and destY are now optional (default: current position)
--- a/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Basic_Training_-_Sniper_Rifle.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -136,7 +136,7 @@
 	playerTeamName = AddMissionTeam(-1)
 	-- And add a hog to it
 	player = AddMissionHog(1)
-	SetGearPosition(player, 602, 1465)
+	SetGearPosition(player, 602, 1488)
 end
 
 -- This function is called when the round starts
--- a/share/hedgewars/Data/Missions/Challenge/Challenge_-_Speed_Shoppa_-_Hedgelove.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Challenge_-_Speed_Shoppa_-_Hedgelove.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -15,7 +15,7 @@
 params.theme = "Nature"
 
 params.hog_x = 410
-params.hog_y = 934
+params.hog_y = 983
 params.crates = {
 	{ x = 183, y = 710 },
 	{ x = 202, y = 519 },
--- a/share/hedgewars/Data/Missions/Challenge/Challenge_-_Speed_Shoppa_-_Ropes.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Challenge_-_Speed_Shoppa_-_Ropes.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -6,13 +6,14 @@
 params.hogName = loc("Hook")
 params.teamFlag = "cm_shoppa"
 params.hogHat = "NoHat"
+params.faceLeft = true
 
 params.time = 115000
 params.map = "Ropes"
 params.theme = "City"
 
 params.hog_x = 3754
-params.hog_y = 1742
+params.hog_y = 1779
 params.crates = {
 	{ x = 3533, y = 1404 },
 	{ x = 3884, y = 1048 },
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Bazooka_easy.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Bazooka_easy.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -9,9 +9,10 @@
 	map = "Lonely_Island",
 	theme = "Island",
 	hog_x = 1439,
-	hog_y = 482,
+	hog_y = 511,
 	hogName = loc("Zook"),
 	hogHat = "war_americanww2helmet",
+	faceLeft = true,
 	teamName = loc("Team Zook"),
 	targets = {
 		{ x = 1310, y = 756 },
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Bazooka_hard.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Bazooka_hard.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -10,7 +10,7 @@
 	map = "SB_Grassy",
 	theme = "Castle",
 	hog_x = 2112,
-	hog_y = 913,
+	hog_y = 935,
 	hogName = loc("Zook"),
 	hogHat = "war_americanww2helmet",
 	teamName = loc("Team Zook"),
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Cluster_Bomb.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Cluster_Bomb.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -9,9 +9,10 @@
 	map = "Trash",
 	theme = "Golf",
 	hog_x = 756,
-	hog_y = 370,
+	hog_y = 403,
 	hogName = loc("Private Nolak"),
 	hogHat = "war_desertgrenadier1",
+	faceLeft = true,
 	teamName = loc("The Hogies"),
 	targets = {
 		{ x = 628, y = 0 },
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Grenade_easy.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Grenade_easy.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -9,9 +9,10 @@
 	map = "SB_Crystal",
 	theme = "Cave",
 	hog_x = 2039,
-	hog_y = 684,
+	hog_y = 701,
 	hogName = loc("Grenadier"),
 	hogHat = "war_desertgrenadier2",
+	faceLeft = true,
 	teamName = loc("Grenade Group"),
 	teamFlag = "cm_grenade",
 	targets = {
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Grenade_hard.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Grenade_hard.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -9,9 +9,10 @@
 	map = "SB_Crystal",
 	theme = "Cave",
 	hog_x = 1456,
-	hog_y = 669,
+	hog_y = 731,
 	hogName = loc("Grenadier"),
 	hogHat = "war_desertgrenadier2",
+	faceLeft = true,
 	teamName = loc("Grenade Group"),
 	teamFlag = "cm_grenade",
 	targets = {
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Homing_Bee.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Homing_Bee.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -8,7 +8,7 @@
 	map = "Hedgewars",
 	theme = "Nature",
 	hog_x = 1990,
-	hog_y = 514,
+	hog_y = 533,
 	hogHat = "NoHat",
 	teamGrave = "bp2",
 	teamFlag = "cm_flower",
--- a/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Shotgun.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/Target_Practice_-_Shotgun.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -8,7 +8,7 @@
 	map = "SB_Haunty",
 	theme = "Halloween",
 	hog_x = 320,
-	hog_y = 324,
+	hog_y = 347,
 	hogHat = "NoHat",
 	hogGrave = "Bones",
 	teamFlag = "cm_crosshair",
--- a/share/hedgewars/Data/Missions/Challenge/User_Mission_-_RCPlane_Challenge.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/User_Mission_-_RCPlane_Challenge.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -38,7 +38,8 @@
 
 	playerTeamName = AddMissionTeam(-1)
 	player = AddMissionHog(80)
-	SetGearPosition(player, 1380, 1500)
+	SetGearPosition(player, 1380, 1582)
+	HogTurnLeft(player, true)
 
 end
 
--- a/share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -174,7 +174,6 @@
 
 	playerTeamName = AddMissionTeam(-1)
 	hhs[0] = AddMissionHog(1)
-	SetGearPosition(player, 1380, 1500)
 
 	AddTeam(loc("Unsuspecting Louts"), -2, "Simple", "Island", "Default", "cm_face")
 	for i = 1, 8 do
@@ -227,6 +226,7 @@
 	SetGearPosition(hhs[14], 3360, 659)
 	SetGearPosition(hhs[15], 3885, 285)
 	SetGearPosition(hhs[16], 935, 1160)
+	HogTurnLeft(hhs[0], true)
 
 	for i = 1, 16 do
 		AssignCharacter(i)
--- a/share/hedgewars/Data/Missions/Challenge/User_Mission_-_That_Sinking_Feeling.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Missions/Challenge/User_Mission_-_That_Sinking_Feeling.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -66,6 +66,7 @@
 
 	playerTeamName = AddMissionTeam(-1)
 	player = AddMissionHog(1)
+	HogTurnLeft(player, false)
 
 	SetGearPosition(player, 3992, 733)
 	SetGearPosition(hh[0], 938, 1369)
--- a/share/hedgewars/Data/Scripts/TargetPractice.lua	Mon Jan 21 18:59:29 2019 +0100
+++ b/share/hedgewars/Data/Scripts/TargetPractice.lua	Mon Jan 21 19:28:39 2019 +0100
@@ -96,6 +96,7 @@
 	- artillery:	if true, the hog can’t move (default: false)
 	- secGearType:	cluster of projectile gear (if present) (used to re-center camera)
 	- clanColor:	color of the (only) clan (default: -1, default first clan color)
+	- faceLeft:	if true, hog starts facing left, otherwise right (default: false)
 	- goalText:	A short string explaining the goal of the mission
 			(default: "Destroy all targets within the time!")
 	- shootText:	A string which says how many times the player shot, “%d” is replaced
@@ -115,6 +116,7 @@
 	if params.goalText == nil then params.goalText = loc("Eliminate all targets before your time runs out.|You have unlimited ammo for this mission.") end
 	if params.shootText == nil then params.shootText = loc("You have shot %d times.") end
 	if params.clanColor == nil then params.clanColor = -1 end
+	if params.faceLeft == nil then params.faceLeft = false end
 	if params.wind == nil then params.wind = 0 end
 	if params.radarTint == nil then params.radarTint = 0xFF3030FF end
 	if params.useRadar == nil then params.useRadar = true end
@@ -158,6 +160,7 @@
 
 		player = AddMissionHog(1)
 		SetGearPosition(player, params.hog_x, params.hog_y)
+		HogTurnLeft(player, params.faceLeft)
 
 		local won = GetMissionVar("Won")
 		-- Unlock the target radar when the player has completed