final mission map and most logic spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Tue, 17 Sep 2013 02:04:41 +0300
branchspacecampaign
changeset 9632 9dd1c36d8b54
parent 9631 a9b7bfac05ee
child 9633 ec72756e7079
final mission map and most logic
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/campaign.ini
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/final.hwp
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/final.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/campaign.ini	Mon Sep 16 05:27:52 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/campaign.ini	Tue Sep 17 02:04:41 2013 +0300
@@ -52,3 +52,7 @@
 [Mission 13]
 Name=Side Mission: Chasing the blue hog
 Script=moon02.lua
+
+[Mission 14]
+Name=Main Mission: The big bang
+Script=final.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Mon Sep 16 05:27:52 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Tue Sep 17 02:04:41 2013 +0300
@@ -156,7 +156,7 @@
 	AddAmmo(smuggler1.gear, amDEagle, 2)	
 	AddAmmo(smuggler3.gear, amRope, 2)
 	
-	-- spawn crates	
+	-- spawn crates
 	SpawnAmmoCrate(btorch2X, btorch2Y, amBlowTorch)
 	SpawnAmmoCrate(btorch3X, btorch3Y, amBlowTorch)
 	SpawnAmmoCrate(rope1X, rope1Y, amRope)
Binary file share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/final.hwp has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/final.lua	Tue Sep 17 02:04:41 2013 +0300
@@ -0,0 +1,89 @@
+------------------- ABOUT ----------------------
+--
+-- Hero has collected all the anti-gravity device
+-- parts but because of the size of the meteorite
+-- he needs to detonate some faulty explosives that
+-- PAotH have previously placed on it.
+
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+HedgewarsScriptLoad("/Scripts/Animate.lua")
+HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
+
+----------------- VARIABLES --------------------
+-- globals
+local missionName = loc("The big bang")
+local challengeObjectives = loc("Find a way to detonate all the explosives and stay alive!")
+
+-- hogs
+local hero = {
+	name = loc("Hog Solo"),
+	x = 790,
+	y = 70
+}
+-- teams
+local teamA = {
+	name = loc("Hog Solo"),
+	color = tonumber("38D61C",16) -- green
+}
+
+-------------- LuaAPI EVENT HANDLERS ------------------
+
+function onGameInit()
+	GameFlags = gfDisableWind + gfOneClanMode
+	Seed = 1
+	TurnTime = -1
+	CaseFreq = 0
+	MinesNum = 0
+	MinesTime = 1
+	Explosives = 0
+	HealthCaseAmount = 50
+	Map = "final_map"
+	Theme = "EarthRise"
+	
+	-- Hog Solo
+	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
+	hero.gear = AddHog(hero.name, 0, 1, "war_desertgrenadier1")
+	AnimSetGearPosition(hero.gear, hero.x, hero.y)
+	
+	initCheckpoint("final")
+	
+	AnimInit()
+	--AnimationSetup()
+end
+
+function onGameStart()
+	AnimWait(hero.gear, 3000)
+	FollowGear(hero.gear)
+	ShowMission(missionName, loc("Challenge Objectives"), challengeObjectives, -amSkip, 0)
+	
+	-- explosives
+	x = 400
+	while x < 815 do
+		AddGear(x, 500, gtExplosives, 0, 0, 0, 0)
+		x = x + math.random(15,40)
+	end
+	-- mines
+	local x = 360
+	while x < 815 do
+		AddGear(x, 480, gtMine, 0, 0, 0, 0)
+		x = x + math.random(5,20)
+	end
+	-- health crate	
+	SpawnHealthCrate(900, 5)
+	-- ammo crates
+	SpawnAmmoCrate(930, 1000,amRCPlane)
+	SpawnAmmoCrate(1220, 672,amPickHammer)
+	SpawnAmmoCrate(1220, 672,amGirder)
+	
+	-- ammo
+	AddAmmo(hero.gear, amPortalGun, 1)	
+	AddAmmo(hero.gear, amFirePunch, 1)	
+	
+	SendHealthStatsOff()
+end
+
+function onAmmoStoreInit()
+	SetAmmo(amRCPlane, 0, 0, 0, 1)
+	SetAmmo(amPickHammer, 0, 0, 0, 2)
+	SetAmmo(amGirder, 0, 0, 0, 1)
+end