Add scenario: Teamwork 2
authorWuzzy <almikes@aol.com>
Tue, 11 Apr 2017 04:46:01 +0200
changeset 12233 8b523acb3220
parent 12232 5afbffc6725d
child 12234 04535e6dc15a
Add scenario: Teamwork 2 Credits to Arkhnen, but I heavily reworked it so it properly works in Hedgewars.
CREDITS
ChangeLog.txt
share/hedgewars/Data/Graphics/Missions/Scenario/User_Mission_-_Teamwork_2@2x.png
share/hedgewars/Data/Locale/missions_de.txt
share/hedgewars/Data/Locale/missions_en.txt
share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork_2.lua
--- a/CREDITS	Tue Apr 11 04:14:21 2017 +0200
+++ b/CREDITS	Tue Apr 11 04:46:01 2017 +0200
@@ -66,6 +66,11 @@
 - Stephen Alexander <ArmagonNo1@gmail.com>
 
 ==========
+= MISSIONS
+==========
+- Arkhnen -> Teamwork 2 (2012)
+
+==========
 = SOUNDS
 ==========
 - Mine impact sound from http://www.freesound.org/people/adcbicycle/sounds/13947/
--- a/ChangeLog.txt	Tue Apr 11 04:14:21 2017 +0200
+++ b/ChangeLog.txt	Tue Apr 11 04:46:01 2017 +0200
@@ -161,7 +161,8 @@
  * Disable Sudden Death for good in Shoppa game scheme, some game styles and mission maps
 
 Missions and Campaigns:
- + Added Basic Flying Saucer Training
+ + New scenario: Teamwork 2
+ + New training: Basic Flying Saucer Training
  + Rope-Knocking Challenge was improved (now awards score based on kills and time; taunts for knocking out hedgehogs)
  + A few campaign missions now save your personal best successes (e.g. fastest finish in Hard Flying) which get shown after you finish them agin
  + A Space Adventure shows 2 flowers over fully completed planets (with side missions)
Binary file share/hedgewars/Data/Graphics/Missions/Scenario/User_Mission_-_Teamwork_2@2x.png has changed
--- a/share/hedgewars/Data/Locale/missions_de.txt	Tue Apr 11 04:14:21 2017 +0200
+++ b/share/hedgewars/Data/Locale/missions_de.txt	Tue Apr 11 04:46:01 2017 +0200
@@ -22,6 +22,9 @@
 User_Mission_-_Teamwork.name=Teamwork
 User_Mission_-_Teamwork.desc="Ab und zu … tut Liebe weh."
 
+User_Mission_-_Teamwork_2.name=Teamwork 2
+User_Mission_-_Teamwork_2.desc="Benutze deine Teamfähigkeiten, um den kybernetischen Feind erneut zu besiegen!"
+
 User_Mission_-_Spooky_Tree.name=Spukiger Baum
 User_Mission_-_Spooky_Tree.desc="Viele Kisten hier draußen. Ich hoffe jedenfalls, dass dieser Vogel hier nicht hungrig wird."
 
--- a/share/hedgewars/Data/Locale/missions_en.txt	Tue Apr 11 04:14:21 2017 +0200
+++ b/share/hedgewars/Data/Locale/missions_en.txt	Tue Apr 11 04:46:01 2017 +0200
@@ -19,6 +19,9 @@
 User_Mission_-_Teamwork.name=Teamwork
 User_Mission_-_Teamwork.desc="Sometimes, love hurts."
 
+User_Mission_-_Teamwork_2.name=Teamwork 2
+User_Mission_-_Teamwork_2.desc="Use your teamwork skills to defeat the cybernetic enemy once again!"
+
 User_Mission_-_Spooky_Tree.name=Spooky Tree
 User_Mission_-_Spooky_Tree.desc="Lots of crates out here. I sure hope that bird ain't feeling hungry."
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Scenario/User_Mission_-_Teamwork_2.lua	Tue Apr 11 04:46:01 2017 +0200
@@ -0,0 +1,119 @@
+-- Teamwork 2
+-- Original scenario by Arkhnen
+
+HedgewarsScriptLoad("Scripts/Locale.lua")
+
+local player = nil
+local hlayer = nil
+local enemy = nil
+local Pack = nil
+local help = false
+local GameOver = false
+local skipTime = 0
+
+function onGameInit()
+	Seed = 0
+	GameFlags = gfDisableWind
+	TurnTime = 600000000
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 0
+	-- Disable Sudden Death
+	HealthDecrease = 0
+	WaterRise = 0
+
+	Explosives = 0
+	Delay = 10
+	Map = "CrazyMission"
+	Theme = "CrazyMission"
+
+	AddTeam(loc("Feeble Resistance"), 14483456, "Simple", "Island", "Default", "cm_kiwi")
+	player = AddHog(loc("Greg"), 0, 30, "NoHat")
+	hlayer = AddHog(loc("Mark"), 0, 40, "NoHat")
+
+	AddTeam(loc("Cybernetic Empire"), 1175851, "Simple", "Island", "Robot", "cm_binary")
+	enemy = AddHog(loc("WatchBot 4000"), 5, 50, "cyborg1")
+
+	SetGearPosition(player, 180, 555)
+	SetGearPosition(enemy, 1500, 914)
+	SetGearPosition(hlayer, 333, 555)
+end
+
+function onGameStart()
+	Pack = SpawnAmmoCrate(40, 888, amPickHammer)
+	SpawnAmmoCrate(90, 888, amBaseballBat)
+	SpawnAmmoCrate(822, 750, amBlowTorch)
+	SpawnAmmoCrate(700, 580, amJetpack)
+	SpawnAmmoCrate(1400, 425, amParachute)
+	SpawnAmmoCrate(1900, 770, amDynamite)
+	SpawnAmmoCrate(1794, 970, amDynamite)
+
+	ShowMission(loc("Teamwork 2"), loc("Scenario"), loc("Eliminate WatchBot 4000.") .. "|" .. loc("Both your hedgehogs must survive.") .. "|" .. loc("Land mines explode instantly."), -amBaseballBat, 0)
+
+	AddGear(355, 822, gtSMine, 0, 0, 0, 0)
+	AddGear(515, 525, gtSMine, 0, 0, 0, 0)
+	AddGear(1080, 821, gtMine, 0, 0, 0, 0)
+	AddGear(1055, 821, gtMine, 0, 0, 0, 0)
+	AddGear(930, 587, gtMine, 0, 0, 0, 0)
+	AddGear(955, 556, gtMine, 0, 0, 0, 0)
+	AddGear(980, 556, gtMine, 0, 0, 0, 0)
+	AddGear(1005, 556, gtMine, 0, 0, 0, 0)
+	AddGear(710, 790, gtMine, 0, 0, 0, 0)
+	AddGear(685, 790, gtMine, 0, 0, 0, 0)
+	AddGear(660, 790, gtMine, 0, 0, 0, 0)
+	AddGear(1560, 540, gtMine, 0, 0, 0, 0)
+	AddGear(1610, 600, gtMine, 0, 0, 0, 0)
+	AddGear(1660, 655, gtMine, 0, 0, 0, 0)
+	AddGear(713, 707, gtMine, 0, 0, 0, 0)
+	AddGear(1668, 969, gtExplosives, 0, 0, 0, 0)
+	AddGear(1668, 906, gtExplosives, 0, 0, 0, 0)
+	AddGear(1668, 842, gtExplosives, 0, 0, 0, 0)
+	AddGear(1713, 969, gtExplosives, 0, 0, 0, 0)
+	SetWind(90)
+end
+
+function onGearAdd(gear)
+	if GetGearType(gear) == gtJetpack then
+		SetHealth(gear, 300)
+	end
+end
+
+function onAmmoStoreInit()
+	SetAmmo(amParachute, 1, 0, 0, 2)
+	SetAmmo(amSwitch, 9, 0, 0, 0)
+	SetAmmo(amSkip, 9, 0, 0, 0)
+	SetAmmo(amPickHammer, 0, 0, 0, 1)
+	SetAmmo(amBaseballBat, 0, 0, 0, 1)
+	SetAmmo(amBlowTorch, 0, 0, 0, 2)
+	SetAmmo(amJetpack, 0, 0, 0, 1)
+	SetAmmo(amDynamite, 0, 0, 0, 1)
+end
+
+--[[ This is some hackery to make the enemy hedgehog skip ]]
+function onNewTurn()
+	if CurrentHedgehog == enemy then
+		skipTime = GameTime + 1
+	end
+end
+
+function onGameTick20()
+	if CurrentHedgehog == enemy and skipTime ~= 0 and skipTime < GameTime then
+        	ParseCommand("/skip")
+		skipTime = 0
+	end
+end
+
+function onGearDelete(gear)
+	if gear == Pack then
+		HogSay(CurrentHedgehog, loc("This will certianly come in handy."), SAY_THINK)
+	end
+	if (gear == enemy) and (GameOver == false) then
+		ShowMission(loc("Teamwork 2"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
+		GameOver = true
+	elseif ( ((gear == player) or (gear == hlayer)) and (GameOver == false)) then
+		ShowMission(loc("Teamwork 2"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
+		GameOver = true
+		SetHealth(hlayer, 0)
+		SetHealth(player, 0)
+	end
+end