share/hedgewars/Data/Scripts/SpeedShoppa.lua
changeset 14464 ead8928a59f8
parent 14401 6c21bd8547dd
child 14475 2113296b7a29
equal deleted inserted replaced
14463:bd1db668b7c0 14464:ead8928a59f8
   162 	end
   162 	end
   163 
   163 
   164 	_G.finalize = function()
   164 	_G.finalize = function()
   165 		if not gameEnded then
   165 		if not gameEnded then
   166 			if cratesCollected == #crates then
   166 			if cratesCollected == #crates then
       
   167 				SaveMissionVar("Won", "true")
   167 				PlaySound(sndVictory, playerHog)
   168 				PlaySound(sndVictory, playerHog)
   168 				SetEffect(playerHog, heInvulnerable, 1)
   169 				SetEffect(playerHog, heInvulnerable, 1)
   169 				SetState(playerHog, bor(GetState(playerHog), gstWinner))
   170 				SetState(playerHog, bor(GetState(playerHog), gstWinner))
   170 				SetState(playerHog, band(GetState(playerHog), bnot(gstHHDriven)))
   171 				SetState(playerHog, band(GetState(playerHog), bnot(gstHHDriven)))
   171 				AddCaption(loc("Challenge completed!"))
   172 				AddCaption(loc("Challenge completed!"))