share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/first_blood.lua
author belphegorr <szabibibi@gmail.com>
Wed, 22 Aug 2012 19:13:13 +0300
changeset 7512 cc3f036121fe
parent 7448 d0521a3a4358
child 8043 da083f8d95e6
permissions -rw-r--r--
Modified missions to be compatible with the merge Removed empty functions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
     1
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     2
loadfile(GetDataPath() .. "Scripts/Animate.lua")()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     3
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     4
-----------------------------Variables---------------------------------
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     5
startDialogue = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     6
damageAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     7
onShroomAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     8
onFlowerAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
     9
tookParaAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    10
tookPunchAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    11
onMoleHeadAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    12
tookRope2Anim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    13
challengeAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    14
challengeFailedAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    15
challengeCompletedAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    16
beforeKillAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    17
closeCannim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    18
cannKilledAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    19
cannKilledEarlyAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    20
princessDamagedAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    21
elderDamagedAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    22
pastMoleHeadAnim = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    23
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    24
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    25
targets = {}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    26
crates = {}
7236
378fc97dae99 Reduced number of crates on the challenge in mission 1, fixed an error with mission 3 (at the end)
belphegorr <szabibibi@gmail.com>
parents: 7228
diff changeset
    27
targXdif2 = {2755, 2638, 2921, 2973, 3162, 3067, 3062, 1300}
378fc97dae99 Reduced number of crates on the challenge in mission 1, fixed an error with mission 3 (at the end)
belphegorr <szabibibi@gmail.com>
parents: 7228
diff changeset
    28
targYdif2 = {1197, 1537, 1646, 1857, 1804, 1173, 1167, 1183}
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    29
targXdif1 = {2749, 2909, 2770, 2836, 1558, 1305}
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    30
targYdif1 = {1179, 1313, 1734, 1441, 1152, 1259}
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    31
targetPosX = {{821, 866, 789}, {614, 656, 638}, {1238, 1237, 1200}}
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    32
targetPosY = {{1342, 1347, 1326}, {1112, 1121, 1061}, {1152, 1111, 1111}}
7236
378fc97dae99 Reduced number of crates on the challenge in mission 1, fixed an error with mission 3 (at the end)
belphegorr <szabibibi@gmail.com>
parents: 7228
diff changeset
    33
crateNum = {6, 8}
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    34
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    35
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    36
stage = 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    37
cratesCollected = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    38
chalTries = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    39
targetsDestroyed = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    40
targsWave = 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    41
tTime = -1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    42
difficulty = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    43
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    44
cannibalVisible = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    45
cannibalKilles = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    46
youngdamaged = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    47
youngKilled = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    48
elderDamaged = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    49
princessDamaged = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    50
elderKilled = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    51
princessKilled = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    52
rope1Taken = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    53
paraTaken = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    54
rope2Taken = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    55
punchTaken = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    56
canKilled = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    57
desertTaken = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    58
challengeFailed = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    59
difficultyChoice = false
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
    60
princessFace = "Left"
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
    61
elderFace = "Left"
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    62
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    63
goals = {
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    64
  [startDialogue] = {loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Enter] to jump"), 1, 4000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    65
  [onShroomAnim] = {loc("First Blood"), loc("A leap in a leap"), loc("Go on top of the flower"), 1, 4000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    66
  [onFlowerAnim] = {loc("First Blood"), loc("Hightime"), loc("Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"), 1, 7000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    67
  [tookParaAnim] = {loc("First Blood"), loc("Omnivore"), loc("Get on the head of the mole"), 1, 4000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    68
  [onMoleHeadAnim] = {loc("First Blood"), loc("The Leap of Faith"), loc("Use the parachute ([Space] while in air) to get the next crate"), 1, 4000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    69
  [tookRope2Anim] = {loc("First Blood"), loc("The Rising"), loc("Do the deed"), 1, 4000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    70
  [tookPunchAnim] = {loc("First Blood"), loc("The Slaughter"), loc("Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."), 1, 5000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    71
  [challengeAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    72
  [challengeFailedAnim] = {loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    73
  [challengeCompletedAnim] = {loc("First Blood"), loc("The Ultimate Weapon"), loc("Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"), 1, 5000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    74
  [beforeKillAnim] = {loc("First Blood"), loc("The First Blood"), loc("Kill the cannibal!"), 1, 5000},
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
    75
  [closeCannim] = {loc("First Blood"), loc("The First Blood"), loc("KILL IT!"), 1, 5000}
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    76
}
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    77
-----------------------------Animations--------------------------------
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    78
function Skipanim(anim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    79
  AnimSwitchHog(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    80
  if goals[anim] ~= nil then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    81
    ShowMission(unpack(goals[anim]))
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    82
  end
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
    83
  if anim == startDialogue then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
    84
    HogTurnLeft(princess, false)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
    85
  end
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    86
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    87
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    88
function SkipDamageAnim(anim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    89
  SwitchHog(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    90
  SetInputMask(0xFFFFFFFF)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    91
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    92
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    93
function SkipOnShroom()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    94
  Skipanim(onShroomAnim)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
    95
  AnimSetGearPosition(elderh, 2700, 1278)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    96
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    97
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    98
function AnimationSetup()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
    99
  AddSkipFunction(damageAnim, SkipDamageAnim, {damageAnim})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   100
  table.insert(damageAnim, {func = AnimWait, args = {youngh, 500}, skipFunc = Skipanim, skipArgs = damageAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   101
  table.insert(damageAnim, {func = AnimSay, args = {elderh, loc("Watch your steps, young one!"), SAY_SAY, 2000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   102
  table.insert(damageAnim, {func = AnimGearWait, args = {youngh, 500}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   103
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   104
  AddSkipFunction(princessDamagedAnim, SkipDamageAnim, {princessDamagedAnim})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   105
  table.insert(princessDamagedAnim, {func = AnimWait, args = {princess, 500}, skipFunc = Skipanim, skipArgs = princessDamagedAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   106
  table.insert(princessDamagedAnim, {func = AnimSay, args = {princess, loc("Why do men keep hurting me?"), SAY_THINK, 3000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   107
  table.insert(princessDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   108
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   109
  AddSkipFunction(elderDamagedAnim, SkipDamageAnim, {elderDamagedAnim})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   110
  table.insert(elderDamagedAnim, {func = AnimWait, args = {elderh, 500}, skipFunc = Skipanim, skipArgs = elderDamagedAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   111
  table.insert(elderDamagedAnim, {func = AnimSay, args = {elderh, loc("Violence is not the answer to your problems!"), SAY_SAY, 3000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   112
  table.insert(elderDamagedAnim, {func = AnimGearWait, args = {youngh, 500}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   113
  
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   114
  AddSkipFunction(startDialogue, Skipanim, {startDialogue})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   115
  table.insert(startDialogue, {func = AnimWait, args = {youngh, 3500}, skipFunc = Skipanim, skipArgs = startDialogue})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   116
  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("Once upon a time, on an island with great natural resources, lived two tribes in heated conflict..."),  5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   117
  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("One tribe was peaceful, spending their time hunting and training, enjoying the small pleasures of life..."), 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   118
  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("The other one were all cannibals, spending their time eating the organs of fellow hedgehogs..."), 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   119
  table.insert(startDialogue, {func = AnimCaption, args = {youngh, loc("And so it began..."), 1000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   120
  table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("What are you doing at a distance so great, young one?"), SAY_SHOUT, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   121
  table.insert(startDialogue, {func = AnimSay, args = {elderh, loc("Come closer, so that your training may continue!"), SAY_SHOUT, 6000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   122
  table.insert(startDialogue, {func = AnimSay, args = {youngh, loc("This is it! It's time to make Fell From Heaven fall for me..."), SAY_THINK, 6000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   123
  table.insert(startDialogue, {func = AnimJump, args = {youngh, "long"}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   124
  table.insert(startDialogue, {func = AnimTurn, args = {princess, "Right"}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   125
  table.insert(startDialogue, {func = AnimSwitchHog, args = {youngh}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   126
  table.insert(startDialogue, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("First Steps"), loc("Press [Left] or [Right] to move around, [Enter] to jump"), 1, 4000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   127
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   128
  AddSkipFunction(onShroomAnim, SkipOnShroom, {onShroomAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   129
  table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("I can see you have been training diligently."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onShroomAnim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   130
  table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("The wind whispers that you are ready to become familiar with tools, now..."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   131
  table.insert(onShroomAnim, {func = AnimSay, args = {elderh, loc("Open that crate and we will continue!"), SAY_SAY, 5000}})
7243
9ae9178c525e Modified Animate.lua function AnimMove to take highercase direction (e.g. "Left")
belphegorr <szabibibi@gmail.com>
parents: 7236
diff changeset
   132
  table.insert(onShroomAnim, {func = AnimMove, args = {elderh, "Right", 2700, 0}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   133
  table.insert(onShroomAnim, {func = AnimTurn, args = {elderh, "Left"}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   134
  table.insert(onShroomAnim, {func = AnimSay, args = {princess, loc("He moves like an eagle in the sky."), SAY_THINK, 4000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   135
  table.insert(onShroomAnim, {func = AnimSwitchHog, args = {youngh}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   136
  table.insert(onShroomAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("A leap in a leap"), loc("Go on top of the flower"), 1, 4000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   137
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   138
  AddSkipFunction(onFlowerAnim, Skipanim, {onFlowerAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   139
  table.insert(onFlowerAnim, {func = AnimSay, args = {elderh, loc("See that crate farther on the right?"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   140
  table.insert(onFlowerAnim, {func = AnimSay, args = {elderh, loc("Swing, Leaks A Lot, on the wings of the wind!"), SAY_SAY, 6000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   141
  table.insert(onFlowerAnim, {func = AnimSay, args = {princess, loc("His arms are so strong!"), SAY_THINK, 4000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   142
  table.insert(onFlowerAnim, {func = AnimSwitchHog, args = {youngh}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   143
  table.insert(onFlowerAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("Hightime"), loc("Collect the crate on the right.|Hint: Select the rope, [Up] or [Down] to aim, [Space] to fire, directional keys to move.|Ropes can be fired again in the air!"), 1, 7000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   144
  
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   145
  AddSkipFunction(tookParaAnim, Skipanim, {tookParaAnim})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   146
  table.insert(tookParaAnim, {func = AnimGearWait, args = {youngh, 1000}, skipFunc = Skipanim, skipArgs = tookParaAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   147
  table.insert(tookParaAnim, {func = AnimSay, args = {elderh, loc("Use the rope to get on the head of the mole, young one!"), SAY_SHOUT, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   148
  table.insert(tookParaAnim, {func = AnimSay, args = {elderh, loc("Worry not, for it is a peaceful animal! There is no reason to be afraid..."), SAY_SHOUT, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   149
  table.insert(tookParaAnim, {func = AnimSay, args = {elderh, loc("We all know what happens when you get frightened..."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   150
  table.insert(tookParaAnim, {func = AnimSay, args = {youngh, loc("So humiliating..."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   151
  table.insert(tookParaAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("Omnivore"), loc("Get on the head of the mole"), 1, 4000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   152
  table.insert(tookParaAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   153
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   154
  AddSkipFunction(onMoleHeadAnim, Skipanim, {onMoleHeadAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   155
  table.insert(onMoleHeadAnim, {func = AnimSay, args = {elderh, loc("Perfect! Now try to get the next crate without hurting yourself!"), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = onMoleHeadAnim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   156
  table.insert(onMoleHeadAnim, {func = AnimSay, args = {elderh, loc("The giant umbrella from the last crate should help break the fall."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   157
  table.insert(onMoleHeadAnim, {func = AnimSay, args = {princess, loc("He's so brave..."), SAY_THINK, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   158
  table.insert(onMoleHeadAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Leap of Faith"), loc("Use the parachute ([Space] while in air) to get the next crate"), 1, 4000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   159
  table.insert(onMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   160
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   161
  AddSkipFunction(pastMoleHeadAnim, Skipanim, {pastMoleHeadAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   162
  table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("I see you have already taken the leap of faith."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = pastMoleHeadAnim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   163
  table.insert(pastMoleHeadAnim, {func = AnimSay, args = {elderh, loc("Get that crate!"), SAY_SAY, 4000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   164
  table.insert(pastMoleHeadAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   165
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   166
  AddSkipFunction(tookRope2Anim, Skipanim, {tookRope2Anim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   167
  table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("Impressive...you are still dry as the corpse of a hawk after a week in the desert..."), SAY_SAY, 5000}, skipFunc = Skipanim, skipArgs = tookRope2Anim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   168
  table.insert(tookRope2Anim, {func = AnimSay, args = {elderh, loc("You probably know what to do next..."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   169
  table.insert(tookRope2Anim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Rising"), loc("Do the deed"), 1, 4000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   170
  table.insert(tookRope2Anim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   171
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   172
  AddSkipFunction(tookPunchAnim, Skipanim, {tookPunchAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   173
  table.insert(tookPunchAnim, {func = AnimSay, args = {elderh, loc("It is time to practice your fighting skills."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   174
  table.insert(tookPunchAnim, {func = AnimSay, args = {elderh, loc("Imagine those targets are the wolves that killed your parents! Take your anger out on them!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   175
  table.insert(tookPunchAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Slaughter"), loc("Destroy the targets!|Hint: Select the Shoryuken and hit [Space]|P.S. You can use it mid-air."), 1, 5000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   176
  table.insert(tookPunchAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   177
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   178
  AddSkipFunction(challengeAnim, Skipanim, {challengeAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   179
  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("I hope you are prepared for a small challenge, young one."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = challengeAnim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   180
  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("Your movement skills will be evaluated now."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   181
  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("Collect all the crates, but remember, our time in this life is limited!"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   182
  table.insert(challengeAnim, {func = AnimSay, args = {elderh, loc("How difficult would you like it to be?")}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   183
  table.insert(challengeAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   184
  table.insert(challengeAnim, {func = AnimWait, args = {youngh, 500}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   185
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   186
  AddSkipFunction(challengeFailedAnim, Skipanim, {challengeFailedAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   187
  table.insert(challengeFailedAnim, {func = AnimSay, args = {elderh, loc("Hmmm...perhaps a little more time will help."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = challengeFailedAnim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   188
  table.insert(challengeFailedAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   189
  table.insert(challengeFailedAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   190
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   191
  AddSkipFunction(challengeCompletedAnim, Skipanim, {challengeCompletedAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   192
  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("The spirits of the ancerstors are surely pleased, Leaks A Lot."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = challengeCompletedAnim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   193
  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("You have proven yourself worthy to see our most ancient secret!"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   194
  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("The weapon in that last crate was bestowed upon us by the ancients!"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   195
  table.insert(challengeCompletedAnim, {func = AnimSay, args = {elderh, loc("Use it with precaution!"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   196
  table.insert(challengeCompletedAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The Ultimate Weapon"), loc("Destroy the targets!|Hint: [Up], [Down] to aim, [Space] to shoot"), 1, 5000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   197
  table.insert(challengeCompletedAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   198
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   199
  AddSkipFunction(beforeKillAnim, Skipanim, {beforeKillAnim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   200
  table.insert(beforeKillAnim, {func = AnimSay, args = {elderh, loc("What do my faulty eyes observe? A spy!"), SAY_SHOUT, 4000}, skipFunc = Skipanim, skipArgs = beforeKillAnim})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   201
  table.insert(beforeKillAnim, {func = AnimFollowGear, args = {cannibal}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   202
  table.insert(beforeKillAnim, {func = AnimWait, args = {cannibal, 1000}})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   203
  table.insert(beforeKillAnim, {func = AnimSay, args = {elderh, loc("Destroy him, Leaks A Lot! He is responsible for the deaths of many of us!"), SAY_SHOUT, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   204
  table.insert(beforeKillAnim, {func = AnimSay, args = {cannibal, loc("Oh, my!"), SAY_THINK, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   205
  table.insert(beforeKillAnim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The First Blood"), loc("Kill the cannibal!"), 1, 5000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   206
  table.insert(beforeKillAnim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   207
  
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   208
  AddSkipFunction(closeCannim, Skipanim, {closeCannim})
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   209
  table.insert(closeCannim, {func = AnimSay, args = {elderh, loc("I see you would like his punishment to be more...personal..."), SAY_SAY, 4000}, skipFunc = Skipanim, skipArgs = closeCannim})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   210
  table.insert(closeCannim, {func = AnimSay, args = {cannibal, loc("I'm certain that this is a misunderstanding, fellow hedgehogs!"), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   211
  table.insert(closeCannim, {func = AnimSay, args = {cannibal, loc("If only I were given a chance to explain my being here..."), SAY_SAY, 4000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   212
  table.insert(closeCannim, {func = AnimSay, args = {elderh, loc("Do not let his words fool you, young one! He will stab you in the back as soon as you turn away!"), SAY_SAY, 6000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   213
  table.insert(closeCannim, {func = AnimSay, args = {elderh, loc("Here...pick your weapon!"), SAY_SAY, 5000}})
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   214
  table.insert(closeCannim, {func = AnimShowMission, args = {youngh, loc("First Blood"), loc("The First Blood"), loc("KILL IT!"), 1, 5000}}) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   215
  table.insert(closeCannim, {func = AnimSwitchHog, args = {youngh}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   216
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   217
  table.insert(cannKilledAnim, {func = AnimSay, args = {elderh, loc("Yes, yeees! You are now ready to enter the real world!"), SAY_SHOUT, 6000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   218
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   219
  table.insert(cannKilledEarlyAnim, {func = AnimSay, args = {elderh, loc("What?! A cannibal? Here? There is no time to waste! Come, you are prepared."), SAY_SHOUT, 4000}})
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   220
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   221
-----------------------------Events------------------------------------
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   222
function CheckNeedToTurn(gear)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   223
  if gear == princess then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   224
    if princessKilled ~= true then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   225
      if (GetX(princess) > GetX(youngh) and princessFace == "Right")
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   226
        or (GetX(princess) < GetX(youngh) and princessFace == "Left") then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   227
      --if (GetX(princess) > GetX(youngh))
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   228
       -- or (GetX(princess) < GetX(youngh)) then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   229
        return true
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   230
      end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   231
    end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   232
  else
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   233
    if elderKilled ~= true then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   234
      if (GetX(elderh) > GetX(youngh) and elderFace == "Right")
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   235
        or (GetX(elderh) < GetX(youngh) and elderFace == "Left") then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   236
        return true
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   237
      end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   238
    end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   239
  end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   240
  return false
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   241
end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   242
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   243
function DoNeedToTurn(gear)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   244
  if gear == princess then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   245
    if GetX(princess) > GetX(youngh) then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   246
      HogTurnLeft(princess, true)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   247
      princessFace = "Left"
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   248
    elseif GetX(princess) < GetX(youngh) then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   249
      HogTurnLeft(princess, false)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   250
      princessFace = "Right"
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   251
    end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   252
  else
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   253
    if GetX(elderh) > GetX(youngh) then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   254
      HogTurnLeft(elderh, true)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   255
      elderFace = "Left"
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   256
    elseif GetX(elderh) < GetX(youngh) then
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   257
      HogTurnLeft(elderh, false)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   258
      elderFace = "Right"
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   259
    end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   260
  end
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   261
end
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   262
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   263
function CheckDamage()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   264
  return youngdamaged and StoppedGear(youngh) 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   265
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   266
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   267
function DoOnDamage()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   268
  AddAnim(damageAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   269
  youngdamaged = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   270
  AddFunction({func = ResetTurnTime, args = {}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   271
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   272
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   273
function CheckDeath()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   274
  return youngKilled
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   275
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   276
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   277
function DoDeath()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   278
  RemoveEventFunc(CheckKilledOthers)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   279
  RemoveEventFunc(CheckDamage)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   280
  RemoveEventFunc(CheckDamagedOthers)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   281
  FinishThem()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   282
  ShowMission(loc("First Blood"), loc("The wasted youth"), loc("Leaks A Lot gave his life for his tribe! He should have survived!"), 2, 4000)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   283
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   284
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   285
function CheckDamagedOthers()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   286
  return (princessDamaged and StoppedGear(princess)) or (elderDamaged and StoppedGear(elderh))
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   287
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   288
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   289
function CheckKilledOthers()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   290
  return princessKilled or elderKilled
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   291
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   292
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   293
function DoOnDamagedOthers()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   294
  if princessDamaged then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   295
    AddAnim(princessDamagedAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   296
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   297
  if elderDamaged then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   298
    AddAnim(elderDamagedAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   299
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   300
  elderDamaged = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   301
  princessDamaged = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   302
  AddFunction({func = ResetTurnTime, args = {}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   303
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   304
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   305
function DoKilledOthers()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   306
  AddCaption(loc("After Leaks A Lot betrayed his tribe, he joined the cannibals..."))
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   307
  FinishThem()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   308
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   309
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   310
function CheckMovedUntilJump()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   311
   return GetX(youngh) >= 2343
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   312
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   313
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   314
function DoMovedUntilJump()
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   315
  ShowMission(loc("First Blood"), loc("Step By Step"), loc("Hint: Double Jump - Press [Backspace] twice"), -amSkip, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   316
  AddEvent(CheckOnShroom, {}, DoOnShroom, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   317
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   318
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   319
function CheckOnShroom()
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   320
  return GetX(youngh) >= 2461 and StoppedGear(youngh)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   321
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   322
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   323
function DoOnShroom()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   324
  ropeCrate1 = SpawnUtilityCrate(2751, 1194, amRope)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   325
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   326
  AddAnim(onShroomAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   327
  AddEvent(CheckOnFlower, {}, DoOnFlower, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   328
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   329
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   330
function CheckOnFlower()
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   331
  return rope1Taken and StoppedGear(youngh)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   332
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   333
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   334
function DoOnFlower()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   335
  AddAmmo(youngh, amRope, 100)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   336
  paraCrate = SpawnUtilityCrate(3245, 1758, amParachute)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   337
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   338
  AddAnim(onFlowerAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   339
  AddEvent(CheckTookParaCrate, {}, DoTookParaCrate, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   340
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   341
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   342
function CheckTookParaCrate()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   343
  return paraTaken and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   344
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   345
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   346
function DoTookParaCrate()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   347
  AddAmmo(youngh, amParachute, 100)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   348
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   349
  AddAnim(tookParaAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   350
  AddEvent(CheckOnMoleHead, {}, DoOnMoleHead, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   351
  AddEvent(CheckPastMoleHead, {}, DoPastMoleHead, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   352
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   353
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   354
function CheckOnMoleHead()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   355
  x = GetX(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   356
  return x >= 3005 and x <= 3126 and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   357
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   358
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   359
function CheckPastMoleHead()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   360
  x = GetX(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   361
  y = GetY(youngh)
7425
3495e70c6d14 Mission 1: Fixed a typo
belphegorr <szabibibi@gmail.com>
parents: 7245
diff changeset
   362
  return x < 3005 and y > 1500 and StoppedGear(youngh) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   363
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   364
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   365
function DoPastMoleHead()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   366
  RemoveEventFunc(CheckOnMoleHead)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   367
  ropeCrate2 = SpawnUtilityCrate(2782, 1720, amRope)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   368
  AddAmmo(youngh, amRope, 0)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   369
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   370
  AddAnim(pastMoleHeadAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   371
  AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   372
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   373
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   374
function DoOnMoleHead()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   375
  RemoveEventFunc(CheckPastMoleHead)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   376
  ropeCrate2 = SpawnUtilityCrate(2782, 1720, amRope)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   377
  AddAmmo(youngh, amRope, 0)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   378
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   379
  AddAnim(onMoleHeadAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   380
  AddEvent(CheckTookRope2, {}, DoTookRope2, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   381
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   382
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   383
function CheckTookRope2()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   384
  return rope2Taken and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   385
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   386
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   387
function DoTookRope2()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   388
  AddAmmo(youngh, amRope, 100)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   389
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   390
  AddAnim(tookRope2Anim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   391
  punchCrate = SpawnAmmoCrate(2460, 1321, amFirePunch)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   392
  AddEvent(CheckTookPunch, {}, DoTookPunch, {})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   393
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   394
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   395
function CheckTookPunch()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   396
  return punchTaken and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   397
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   398
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   399
function DoTookPunch()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   400
  AddAmmo(youngh, amFirePunch, 100)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   401
  AddAmmo(youngh, amRope, 0)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   402
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   403
  AddAnim(tookPunchAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   404
  targets[1] = AddGear(1594, 1185, gtTarget, 0, 0, 0, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   405
  targets[2] = AddGear(2188, 1314, gtTarget, 0, 0, 0, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   406
  targets[3] = AddGear(1961, 1318, gtTarget, 0, 0, 0, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   407
  targets[4] = AddGear(1961, 1200, gtTarget, 0, 0, 0, 0)
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   408
  targets[5] = AddGear(1800, 900, gtTarget, 0, 0, 0, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   409
  AddEvent(CheckTargDestroyed, {}, DoTargDestroyed, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   410
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   411
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   412
function CheckTargDestroyed()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   413
  return targetsDestroyed == 5 and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   414
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   415
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   416
function DoTargDestroyed()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   417
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   418
  AddAnim(challengeAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   419
  targetsDestroyed = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   420
  AddFunction({func = SetChoice, args = {}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   421
  ropeCrate3 = SpawnAmmoCrate(2000, 1200, amRope)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   422
  AddEvent(CheckTookRope3, {}, AddAmmo, {youngh, amRope, 100}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   423
  AddEvent(CheckCratesColled, {}, DoCratesColled, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   424
  AddEvent(CheckChallengeWon, {}, DoChallengeWon, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   425
  AddEvent(CheckTimesUp, {}, DoTimesUp, {}, 1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   426
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   427
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   428
function CheckChoice()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   429
  return difficulty ~= 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   430
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   431
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   432
function DoChoice()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   433
  difficultyChoice = false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   434
  SetInputMask(0xFFFFFFFF)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   435
  StartChallenge(120000 + chalTries * 20000)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   436
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   437
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   438
function CheckCratesColled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   439
  return cratesCollected == crateNum[difficulty]
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   440
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   441
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   442
function DoCratesColled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   443
  RemoveEventFunc(CheckTimesUp)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   444
  TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   445
  AddCaption(loc("As the challenge was completed, Leaks A Lot set foot on the ground..."))
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   446
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   447
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   448
function CheckChallengeWon()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   449
  return cratesCollected == crateNum[difficulty] and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   450
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   451
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   452
function DoChallengeWon()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   453
  desertCrate = SpawnAmmoCrate(1240, 1212, amDEagle)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   454
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   455
  AddAnim(challengeCompletedAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   456
  AddEvent(CheckDesertColled, {}, DoDesertColled, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   457
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   458
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   459
function CheckTookRope3()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   460
  return rope3Taken
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   461
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   462
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   463
function CheckTimesUp()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   464
  return TurnTimeLeft == 100
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   465
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   466
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   467
function DoTimesUp()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   468
  challengeFailed = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   469
  DeleteGear(crates[1])
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   470
  TurnTimeLeft = -1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   471
  AddCaption(loc("And so happenned that Leaks A Lot failed to complete the challenge! He landed, pressured by shame..."))
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   472
  AddEvent(CheckChallengeFailed, {}, DoChallengeFailed, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   473
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   474
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   475
function CheckChallengeFailed()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   476
  return challengeFailed and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   477
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   478
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   479
function DoChallengeFailed()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   480
  challengeFailed = false
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   481
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   482
  AddAnim(challengeFailedAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   483
  chalTries = chalTries + 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   484
  difficulty = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   485
  AddFunction({func = SetChoice, args = {}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   486
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   487
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   488
function CheckDesertColled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   489
  return desertTaken and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   490
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   491
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   492
function DoDesertColled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   493
  AddAmmo(youngh, amDEagle, 100)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   494
  PutTargets(1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   495
  AddEvent(CheckTargetsKilled, {}, DoTargetsKilled, {}, 1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   496
  AddEvent(CheckCannibalKilled, {}, DoCannibalKilledEarly, {}, 0)
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   497
  ShowMission(loc("First Blood"), loc("The Bull's Eye"), loc("[Up], [Down] to aim, [Space] to shoot!"), 1, 5000)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   498
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   499
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   500
function CheckTargetsKilled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   501
  return targetsDestroyed == 3 and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   502
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   503
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   504
function DoTargetsKilled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   505
  targetsDestroyed = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   506
  targsWave = targsWave + 1
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   507
  if targsWave > 3 then
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   508
    RemoveEventFunc(CheckTargetsKilled)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   509
    SetState(cannibal, gstVisible)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   510
    cannibalVisible = true
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   511
    SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   512
    AddAnim(beforeKillAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   513
    AddEvent(CheckCloseToCannibal, {}, DoCloseToCannibal, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   514
    AddEvent(CheckCannibalKilled, {}, DoCannibalKilled, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   515
  else
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   516
    PutTargets(targsWave)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   517
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   518
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   519
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   520
function CheckCloseToCannibal()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   521
  if CheckCannibalKilled() then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   522
    return false
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   523
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   524
  return math.abs(GetX(cannibal) - GetX(youngh)) <= 400 and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   525
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   526
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   527
function DoCloseToCannibal()
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   528
  SetGearMessage(CurrentHedgehog, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   529
  AddAnim(closeCannim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   530
  AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][1], targetPosY[1][1], amWhip}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   531
  AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][2], targetPosY[1][2], amBaseballBat}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   532
  AddFunction({func = SpawnAmmoCrate, args = {targetPosX[1][3], targetPosY[1][3], amHammer}})
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   533
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   534
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   535
function CheckCannibalKilled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   536
  return cannibalKilled and StoppedGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   537
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   538
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   539
function DoCannibalKilled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   540
  AddAnim(cannKilledAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   541
  SaveCampaignVar("Progress", "1")
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   542
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   543
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   544
function DoCannibalKilledEarly()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   545
  AddAnim(cannKilledEarlyAnim)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   546
  DoCannibalKilled()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   547
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   548
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   549
-----------------------------Misc--------------------------------------
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   550
function StartChallenge(time)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   551
  cratesCollected = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   552
  PutCrate(1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   553
  TurnTimeLeft = time
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   554
  ShowMission(loc("First Blood"), loc("The Crate Frenzy"), loc("Collect the crates within the time limit!|If you fail, you'll have to try again."), 1, 5000) 
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   555
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   556
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   557
function SetChoice()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   558
  SetInputMask(band(0xFFFFFFFF, bnot(gmAnimate+gmAttack+gmDown+gmHJump+gmLJump+gmSlot+gmSwitch+gmTimer+gmUp+gmWeapon)))
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   559
  difficultyChoice = true
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   560
  ShowMission(loc("First Blood"), loc("The Torment"), loc("Select difficulty: [Left] - easier or [Right] - harder"), 0, 4000)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   561
  AddEvent(CheckChoice, {}, DoChoice, {}, 0) 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   562
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   563
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   564
function SetTime(time)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   565
  TurnTimeLeft = time
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   566
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   567
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   568
function ResetTurnTime()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   569
  TurnTimeLeft = tTime
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   570
  tTime = -1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   571
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   572
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   573
function PutCrate(i)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   574
  if i > crateNum[difficulty] then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   575
    return
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   576
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   577
  if difficulty == 1 then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   578
    crates[1] = SpawnAmmoCrate(targXdif1[i], targYdif1[i], amRope)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   579
  else
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   580
    crates[1] = SpawnAmmoCrate(targXdif2[i], targYdif2[i], amRope)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   581
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   582
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   583
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   584
function PutTargets(i)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   585
  targets[1] = AddGear(targetPosX[i][1], targetPosY[i][1], gtTarget, 0, 0, 0, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   586
  targets[2] = AddGear(targetPosX[i][2], targetPosY[i][2], gtTarget, 0, 0, 0, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   587
  targets[3] = AddGear(targetPosX[i][3], targetPosY[i][3], gtTarget, 0, 0, 0, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   588
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   589
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   590
function FinishThem()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   591
  SetHealth(elderh, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   592
  SetHealth(youngh, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   593
  SetHealth(princess, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   594
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   595
-----------------------------Main Functions----------------------------
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   596
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   597
function onGameInit()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   598
	Seed = 69 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   599
	GameFlags = gfInfAttack + gfSolidLand + gfDisableWind 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   600
	TurnTime = 100000 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   601
	CaseFreq = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   602
	MinesNum = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   603
	MinesTime = 3000
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   604
	Explosives = 0
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   605
	Delay = 10 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   606
	MapGen = 0
7512
cc3f036121fe Modified missions to be compatible with the merge
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   607
  TemplateFilter = 6
cc3f036121fe Modified missions to be compatible with the merge
belphegorr <szabibibi@gmail.com>
parents: 7448
diff changeset
   608
  TemplateNumber = 33
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   609
	Theme = "Nature"
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   610
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   611
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   612
	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   613
	youngh = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   614
  elderh = AddHog(loc("Righteous Beard"), 0, 99, "IndianChief")
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   615
  princess = AddHog(loc("Fell From Heaven"), 0, 300, "tiara")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   616
  AnimSetGearPosition(princess, 1911, 1361)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   617
  HogTurnLeft(princess, true)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   618
  AnimSetGearPosition(elderh, 2667, 1208)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   619
  HogTurnLeft(elderh, true)
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   620
  AnimSetGearPosition(youngh, 1862, 1362)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   621
  HogTurnLeft(youngh, false)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   622
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   623
  AddTeam(loc("Cannibals"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   624
  cannibal = AddHog(loc("Brainiac"), 0, 5, "Zombi")
7448
d0521a3a4358 Solved "floating repositionings" in every mission
belphegorr <szabibibi@gmail.com>
parents: 7425
diff changeset
   625
  AnimSetGearPosition(cannibal, 525, 1256)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   626
  HogTurnLeft(cannibal, false)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   627
  
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   628
  AnimInit()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   629
  AnimationSetup()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   630
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   631
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   632
function onGameStart()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   633
  TurnTimeLeft = -1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   634
  FollowGear(youngh)
7225
e3f2280d9000 Added localization and changed primary team color.
belphegorr <szabibibi@gmail.com>
parents: 7209
diff changeset
   635
	ShowMission(loc("A Classic Fairytale"), loc("First Blood"), loc("Finish your training|Hint: Animations can be skipped with the [Precise] key."), -amSkip, 0)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   636
  SetState(cannibal, gstInvisible)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   637
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   638
  AddAnim(startDialogue)
7245
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   639
  princessFace = "Right"
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   640
  AddEvent(CheckNeedToTurn, {princess}, DoNeedToTurn, {princess}, 1)
53f73f4ae203 Modified frontend so that updating campaogn progress no longer changes current index of the mission combo box
belphegorr <szabibibi@gmail.com>
parents: 7243
diff changeset
   641
  AddEvent(CheckNeedToTurn, {elderh}, DoNeedToTurn, {elderh}, 1)
7203
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   642
  AddEvent(CheckDamage, {}, DoOnDamage, {}, 1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   643
  AddEvent(CheckDeath, {}, DoDeath, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   644
  AddEvent(CheckDamagedOthers, {}, DoOnDamagedOthers, {}, 1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   645
  AddEvent(CheckKilledOthers, {}, DoKilledOthers, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   646
  AddEvent(CheckMovedUntilJump, {}, DoMovedUntilJump, {}, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   647
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   648
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   649
function onGameTick()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   650
  AnimUnWait()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   651
  if ShowAnimation() == false then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   652
    return
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   653
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   654
  ExecuteAfterAnimations()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   655
  CheckEvents()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   656
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   657
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   658
function onGearDelete(gear)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   659
  if gear == ropeCrate1 then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   660
    rope1Taken = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   661
  elseif gear == paraCrate then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   662
    paraTaken = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   663
  elseif gear == ropeCrate2 then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   664
    rope2Taken = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   665
  elseif gear == ropeCrate3 then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   666
    rope3Taken = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   667
  elseif gear == crates[1] and challengeFailed == false then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   668
    crates[1] = nil
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   669
    cratesCollected = cratesCollected + 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   670
    PutCrate(cratesCollected + 1)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   671
  elseif gear == punchCrate then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   672
    punchTaken = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   673
  elseif gear == desertCrate then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   674
    desertTaken = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   675
  elseif GetGearType(gear) == gtTarget then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   676
    i = 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   677
    while targets[i] ~= gear do
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   678
      i = i + 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   679
    end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   680
    targets[i] = nil
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   681
    targetsDestroyed = targetsDestroyed + 1 
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   682
  elseif gear == cannibal then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   683
    cannibalKilled = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   684
  elseif gear == princess then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   685
    princessKilled = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   686
  elseif gear == elderh then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   687
    elderKilled = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   688
  elseif gear == youngh then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   689
    youngKilled = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   690
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   691
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   692
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   693
function onAmmoStoreInit()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   694
  SetAmmo(amWhip, 0, 0, 0, 8)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   695
  SetAmmo(amBaseballBat, 0, 0, 0, 8)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   696
  SetAmmo(amHammer, 0, 0, 0, 8)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   697
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   698
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   699
function onNewTurn()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   700
  if CurrentHedgehog == cannibal and cannibalVisible == false then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   701
    SetState(cannibal, gstInvisible)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   702
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   703
  SwitchHog(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   704
  FollowGear(youngh)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   705
  TurnTimeLeft = -1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   706
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   707
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   708
function onGearDamage(gear, damage)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   709
  if gear == youngh then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   710
    youngdamaged = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   711
    tTime = TurnTimeLeft
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   712
  elseif gear == princess then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   713
    princessDamaged = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   714
    tTime = TurnTimeLeft
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   715
  elseif gear == elderh then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   716
    elderDamaged = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   717
    tTime = TurnTimeLeft
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   718
  elseif gear == cannibal then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   719
    cannibalVisible = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   720
    cannibalDamaged = true
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   721
    SetState(cannibal, 0)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   722
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   723
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   724
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   725
function onPrecise()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   726
  if GameTime > 2000 then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   727
    SetAnimSkip(true)
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   728
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   729
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   730
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   731
function onLeft()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   732
  if difficultyChoice == true then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   733
    difficulty = 1
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   734
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   735
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   736
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   737
function onRight()
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   738
  if difficultyChoice == true then
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   739
    difficulty = 2
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   740
  end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   741
end
37661b2a7b64 Copied the first two campaign missions and the helper script into share/hedgewars/Data/
belphegorr <szabibibi@gmail.com>
parents:
diff changeset
   742