share/hedgewars/Data/Missions/Training/SniperRifle.lua
author sheepluva
Sat, 03 Apr 2010 01:30:13 +0000
changeset 3274 1e7dcd32890a
parent 3273 d398b7bb3ecd
child 3284 7ffd0e20ad08
permissions -rw-r--r--
more translations! from inu and szczur
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3271
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     1
-- Hedgewars SniperRifle Training
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     2
-- Scripting Example
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     3
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     4
-- Lines such as this one are comments - they are ignored
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     5
-- by the game, no matter what kind of text is in there.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     6
-- It's also possible to place a comment after some real
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     7
-- instruction as you see below. In short, everything
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     8
-- following "--" is ignored.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
     9
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    10
---------------------------------------------------------------
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    11
-- At first we put all text we'd like to use in some arrays.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    12
-- This way we're able to localize the text to be shown without
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    13
-- modifying other files.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    14
-- The language to be used is stored in the global variable
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    15
-- 'L' that is set by the game (string).
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    16
-- Text may then be accessed using "arrayname[L]".
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    17
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    18
local caption = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    19
	["en"] = "Sniper Training",
3273
d398b7bb3ecd * add some tiny translation from inu
sheepluva
parents: 3271
diff changeset
    20
	["de"] = "Scharfschützen-Training",
3274
1e7dcd32890a more translations! from inu and szczur
sheepluva
parents: 3273
diff changeset
    21
	["pl"] = "Trening Snajperski",
3273
d398b7bb3ecd * add some tiny translation from inu
sheepluva
parents: 3271
diff changeset
    22
	["pt_PT"] = "Treino com Sniper"
3271
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    23
	-- To add other languages, just add lines similar to the
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    24
	-- existing ones - don't forget the trailing ","!
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    25
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    26
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    27
local subcaption = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    28
	["en"] = "Aiming Practice",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    29
	["de"] = "Zielübung",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    30
	["es"] = "Practica tu puntería",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    31
	["pl"] = "Potrenuj celność",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    32
	["pt_PT"] = "Pratica a tua pontaria"
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    33
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    34
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    35
local goal = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    36
	["en"] = "Eliminate all targets before your time runs out.|You have unlimited ammo for this mission.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    37
	["de"] = "Eliminiere alle Ziele bevor die Zeit ausläuft.|Du hast in dieser Mission unbegrenzte Munition.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    38
	["es"] = "Destruye todos los objetivos antes de que se agote el tiempo.|La munición en esta misión es ilimitada.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    39
	["pl"] = "Zniszcz wszystkie cele zanim upłynie czas.|W tej misji masz nieskończoną ilość amunicji.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    40
	["pt_PT"] = "Destrói todos os alvos antes do tempo terminar.|Tens munições infinitas para esta missão."
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    41
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    42
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    43
local timeout = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    44
	["en"] = "Oh no! Time's up! Just try again.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    45
	["de"] = "Oh nein! Die Zeit ist um! Versuche es nochmal.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    46
	["es"] = "¡Oh, no, se te acabó el tiempo! ¿Por qué no lo intentas de nuevo?",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    47
	["pl"] = "Ajajaj! Koniec czasu! Spróbuj jeszcze raz.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    48
	["pt_PT"] = "Oh não! Acabou o tempo! Tenta novamente."
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    49
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    50
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    51
local success = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    52
	["en"] = "Congratulations! You've eliminated all targets|within the allowed time frame.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    53
	["de"] = "Gratulation! Du hast alle Ziele innerhalb der|verfügbaren Zeit ausgeschaltet.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    54
	["es"] = "¡Felicidades! Has destruido todos los objectivos|dentro del tiempo establecido.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    55
	["pl"] = "Gratulacje! Zniszczyłeś wszystkie cele przed upłynięciem czasu.",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    56
	["pt_PT"] = "Parabéns! Eliminaste todos os alvos|dentro do tempo limite."
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    57
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    58
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    59
local teamname = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    60
	["en"] = "Sniperz",
3274
1e7dcd32890a more translations! from inu and szczur
sheepluva
parents: 3273
diff changeset
    61
	["de"] = "Heckenschützen",
1e7dcd32890a more translations! from inu and szczur
sheepluva
parents: 3273
diff changeset
    62
	["pl"] = "Snajperzy"
3271
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    63
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    64
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    65
local hogname = {
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    66
	["en"] = "Hunter",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    67
	["de"] = "Jäger",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    68
	["es"] = "Cazador",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    69
	["pl"] = "Strzelec",
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    70
	["pt_PT"] = "Comando"
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    71
	}
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    72
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    73
-- To handle missing texts we define a small wrapper function that
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    74
-- we'll use to retrieve text.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    75
local function loc(text)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    76
	if text == nil then return "**missing**"
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    77
	elseif text[L] == nil then return text["en"]
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    78
	else return text[L]
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    79
	end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    80
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    81
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    82
---------------------------------------------------------------
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    83
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    84
-- This variable will hold the number of destroyed targets.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    85
local score = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    86
-- This variable represents the number of targets to destroy.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    87
local score_goal = 31
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    88
-- This variable controls how many milliseconds/ticks we'd
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    89
-- like to wait before we end the round once all targets
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    90
-- have been destroyed.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    91
local end_timer = 5000 -- 5000 ms = 5 s
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    92
-- This variable is set to true if the game is lost (i.e.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    93
-- time runs out).
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    94
local game_lost = false
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    95
-- This variable will point to the hog's gear
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    96
local player = nil
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    97
-- This variable will grab the time left at the end of the round
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    98
local time_goal = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
    99
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   100
local target = nil
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   101
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   102
local last_hit_time = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   103
-- This is a custom function to make it easier to
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   104
-- spawn more targets with just one line of code
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   105
-- You may define as many custom functions as you
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   106
-- like.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   107
function spawnTarget(x, y)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   108
	-- add a new target gear
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   109
	target = AddGear(x, y, gtTarget, 0, 0, 0, 0)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   110
    -- have the camera move to the target so the player knows where it is
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   111
    FollowGear(target)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   112
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   113
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   114
function blowUp(x, y)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   115
	-- adds some TNT
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   116
	gear = AddGear(x, y, gtDynamite, 0, 0, 0, 0)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   117
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   118
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   119
-- This function is called before the game loads its
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   120
-- resources.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   121
-- It's one of the predefined function names that will
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   122
-- be called by the game. They give you entry points
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   123
-- where you're able to call your own code using either
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   124
-- provided instructions or custom functions.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   125
function onGameInit()
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   126
	-- At first we have to overwrite/set some global variables
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   127
	-- that define the map, the game has to load, as well as
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   128
	-- other things such as the game rules to use, etc.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   129
	-- Things we don't modify here will use their default values.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   130
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   131
	-- The base number for the random number generator
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   132
	Seed = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   133
	-- Game settings and rules
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   134
	GameFlags = gfMultiWeapon + gfOneClanMode + gfArtillery
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   135
	-- The time the player has to move each round (in ms)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   136
	TurnTime = 150000
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   137
	-- The frequency of crate drops
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   138
	CaseFreq = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   139
	-- The number of mines being placed
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   140
	LandAdds = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   141
	-- The number of explosives being placed
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   142
	Explosives = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   143
	-- The delay between each round
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   144
	Delay = 0
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   145
	-- The map to be played
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   146
	Map = "Ropes"
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   147
	-- The theme to be used
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   148
	Theme = "City"
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   149
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   150
	-- Create the player team
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   151
	AddTeam(loc(teamname), 14483456, "Simple", "Island", "Default")
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   152
	-- And add a hog to it
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   153
	player = AddHog(loc(hogname), 0, 1, "Sniper")
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   154
	SetGearPosition(player, 602, 1465);
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   155
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   156
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   157
-- This function is called when the round starts
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   158
-- it spawns the first target that has to be destroyed.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   159
-- In addition it shows the scenario goal(s).
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   160
function onGameStart()
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   161
	-- Spawn the first target.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   162
	spawnTarget(860,1020)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   163
	
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   164
	-- Show some nice mission goals.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   165
	-- Parameters are: caption, sub caption, description,
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   166
	-- extra text, icon and time to show.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   167
	-- A negative icon parameter (-n) represents the n-th weapon icon
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   168
	-- A positive icon paramter (n) represents the (n+1)-th mission icon
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   169
	-- A timeframe of 0 is replaced with the default time to show.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   170
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amSniperRifle, 0);
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   171
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   172
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   173
-- This function is called every game tick.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   174
-- Note that there are 1000 ticks within one second.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   175
-- You shouldn't try to calculate too complicated
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   176
-- code here as this might slow down your game.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   177
function onGameTick()
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   178
    if game_lost then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   179
        return
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   180
    end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   181
    -- after a target is destroyed, show hog, then target
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   182
    if (target ~= nil) and (TurnTimeLeft + 1300 < last_hit_time) then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   183
        -- move camera to the target
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   184
        FollowGear(target)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   185
    elseif TurnTimeLeft + 300 < last_hit_time then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   186
        -- move camera to the hog
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   187
        FollowGear(player)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   188
    end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   189
	-- If time's up, set the game to be lost.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   190
	-- We actually check the time to be "1 ms" as it
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   191
	-- will be at "0 ms" right at the start of the game.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   192
	if TurnTimeLeft == 1 and score < score_goal then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   193
		game_lost = true
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   194
		-- ... and show a short message.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   195
		ShowMission(loc(caption), loc(subcaption), loc(timeout), -amSkip, 0);
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   196
		-- How about killing our poor hog due to his poor performance?
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   197
		SetHealth(player, 0);
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   198
		-- Just to be sure set the goal time to 1 ms
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   199
		time_goal = 1
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   200
	end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   201
	-- If the goal is reached or we've lost ...
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   202
	if score == score_goal or game_lost then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   203
		-- ... check to see if the time we'd like to
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   204
		-- wait has passed and then ...
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   205
		if end_timer == 0 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   206
			-- ... end the game ...
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   207
			EndGame()
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   208
		else
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   209
			-- ... or just lower the timer by 1.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   210
			end_timer = end_timer - 1
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   211
			-- Reset the time left to stop the timer
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   212
			TurnTimeLeft = time_goal
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   213
		end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   214
	end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   215
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   216
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   217
-- This function is called when the game is initialized
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   218
-- to request the available ammo and probabilities
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   219
function onAmmoStoreInit()
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   220
	-- add an unlimited supply of shotgun ammo
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   221
	SetAmmo(amSniperRifle, 9, 0, 0)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   222
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   223
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   224
-- This function is called when a new gear is added.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   225
-- We don't need it for this training, so we can
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   226
-- keep it empty.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   227
function onGearAdd(gear)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   228
end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   229
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   230
-- This function is called before a gear is destroyed.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   231
-- We use it to count the number of targets destroyed.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   232
function onGearDelete(gear)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   233
    
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   234
    if GetGearType(gear) == gtCase then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   235
        game_lost = true
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   236
        return
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   237
    end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   238
	
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   239
	if (GetGearType(gear) == gtTarget) then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   240
        -- remember when the target was hit for adjusting the camera
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   241
        last_hit_time = TurnTimeLeft
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   242
		-- Add one point to our score/counter
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   243
		score = score + 1
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   244
		-- If we haven't reached the goal ...
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   245
		if score < score_goal then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   246
			-- ... spawn another target.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   247
            if score == 1 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   248
                spawnTarget(1520,1350)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   249
            elseif score == 2 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   250
                spawnTarget(1730,1040)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   251
            elseif score == 3 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   252
                spawnTarget(2080,780)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   253
            elseif score == 4 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   254
                blowUp(1730,1226)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   255
                blowUp(1440,1595)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   256
                blowUp(1527,1575)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   257
                blowUp(1614,1595)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   258
                blowUp(1420,1675)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   259
                blowUp(1527,1675)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   260
                blowUp(1634,1675)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   261
                blowUp(1440,1755)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   262
                blowUp(1527,1775)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   263
                blowUp(1614,1755)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   264
                spawnTarget(1527,1667)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   265
            elseif score == 5 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   266
                spawnTarget(1527,1667)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   267
            elseif score == 6 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   268
                spawnTarget(2175,1300)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   269
            elseif score == 7 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   270
                spawnTarget(2250,940)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   271
            elseif score == 8 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   272
                spawnTarget(2665,1540)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   273
            elseif score == 9 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   274
                spawnTarget(3040,1160)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   275
            elseif score == 10 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   276
                spawnTarget(2930,1500)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   277
            elseif score == 11 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   278
                spawnTarget(700,720)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   279
            elseif score == 12 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   280
                blowUp(914,1222)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   281
                blowUp(1050,1222)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   282
                blowUp(1160,1008)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   283
                blowUp(1160,1093)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   284
                blowUp(1160,1188)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   285
                blowUp(375,911)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   286
                blowUp(510,911)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   287
                blowUp(640,911)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   288
                blowUp(780,911)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   289
                blowUp(920,911)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   290
                blowUp(1060,913)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   291
                blowUp(1198,913)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   292
                spawnTarget(1200,730)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   293
            elseif score == 13 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   294
                spawnTarget(1200,830)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   295
            elseif score == 14 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   296
                spawnTarget(1430,450)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   297
            elseif score == 15 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   298
                spawnTarget(796,240)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   299
            elseif score == 16 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   300
                spawnTarget(300,10)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   301
            elseif score == 17 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   302
                spawnTarget(2080,820)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   303
            elseif score == 18 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   304
                blowUp(2110,920)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   305
                blowUp(2210,920)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   306
                blowUp(2200,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   307
                blowUp(2300,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   308
                blowUp(2300,400)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   309
                blowUp(2300,500)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   310
                blowUp(2300,600)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   311
                blowUp(2300,700)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   312
                blowUp(2300,800)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   313
                blowUp(2300,900)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   314
                blowUp(2401,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   315
                blowUp(2532,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   316
                blowUp(2663,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   317
                spawnTarget(2300,760)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   318
            elseif score == 19 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   319
                spawnTarget(2300,760)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   320
            elseif score == 20 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   321
                spawnTarget(2738,190)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   322
            elseif score == 21 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   323
                spawnTarget(2590,-100)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   324
            elseif score == 22 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   325
                blowUp(2790,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   326
                blowUp(2930,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   327
                blowUp(3060,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   328
                blowUp(3190,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   329
                blowUp(3310,305)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   330
                blowUp(3393,613)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   331
                blowUp(2805,370)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   332
                blowUp(2805,500)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   333
                blowUp(2805,630)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   334
                blowUp(2805,760)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   335
                blowUp(2805,890)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   336
                blowUp(2700,890)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   337
                blowUp(3258,370)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   338
                blowUp(3258,475)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   339
                blowUp(3264,575)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   340
                spawnTarget(3230,240)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   341
            elseif score == 23 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   342
                spawnTarget(3230,290)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   343
            elseif score == 24 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   344
                spawnTarget(3670,250)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   345
            elseif score == 25 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   346
                spawnTarget(2620,-100)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   347
            elseif score == 26 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   348
                spawnTarget(2870,300)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   349
            elseif score == 27 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   350
                spawnTarget(3850,900)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   351
            elseif score == 28 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   352
                spawnTarget(3780,300)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   353
            elseif score == 29 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   354
                spawnTarget(3670,0)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   355
            elseif score == 30 then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   356
                spawnTarget(3480,1200)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   357
            end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   358
		else
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   359
			if not game_lost then
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   360
			-- Otherwise show that the goal was accomplished
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   361
			ShowMission(loc(caption), loc(subcaption), loc(success), 0, 0);
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   362
			-- Also let the hogs shout "victory!"
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   363
			PlaySound(sndVictory)
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   364
			-- Save the time left so we may keep it.
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   365
			time_goal = TurnTimeLeft
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   366
			end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   367
		end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   368
	end
0405e07ca44b * add some kind of SniperRifle training mission
sheepluva
parents:
diff changeset
   369
end