share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
changeset 12578 5b23c42ef150
parent 12577 e2b5c6e805e8
child 12586 7510fe66bfbb
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Thu Sep 28 18:39:59 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Thu Sep 28 19:26:22 2017 +0200
@@ -122,7 +122,6 @@
 	AddAmmo(hero.gear, amSniperRifle, 2)
 	AddAmmo(hero.gear, amWatermelon, 2)
 
-	-- these 2 are needed in order hero has 10 sec more in the first turn
 	AddAmmo(hero.gear, amSkip, 100)
 	timeLeft = 0
 
@@ -142,7 +141,7 @@
 function onNewTurn()
 	if CurrentHedgehog == hero.gear then
 		if firstTurn then
-			-- Unique game rule in this mission
+			-- Unique game rule in this mission: First turn has more time
 			TurnTimeLeft = 25000
 			-- Generous ready time on first turn to give more time to read
 			ReadyTimeLeft = 35000
@@ -192,10 +191,15 @@
 	end
 end
 
-onHogAttack = hideMissionOnAction
-onAttack = hideMissionOnAction
 onSlot = hideMissionOnAction
 onSetWeapon = hideMissionOnAction
+onAttack = hideMissionOnAction
+function onHogAttack(ammoType)
+	hideMissionOnAction()
+	if CurrentHedgehog == hero.gear then
+		lastWeaponUsed = ammoType
+	end
+end
 
 -------------- EVENTS ------------------
 
@@ -277,11 +281,6 @@
 	end
 end
 
-function onSwitch()
-	ReadyTimeLeft = ReadyTimeLeft + 2000
-	PlaySound(sndExtraTime)
-end
-
 function isHog(gear)
 	local hog = false
 	for i=1,table.getn(enemiesOdd) do