--[[ Two guys having epic convo zoomed in zoom out have to kill everyone on the ground before the other guy on the plane becomes killable. then water also starts rising. ]] loadfile(GetDataPath() .. "Scripts/Locale.lua")() local player = nil -- This variable will point to the hog's gear local enemy = nil local robot = {} local robotTNames = {} local ropeGear = nil local jetGear = nil local GameOver = false local expTimer = 0 local expLimit = 5000 local startSpawningCrates = true local numCrates = 0 local crateCounter = 0 function onGameInit() -- Things we don't modify here will use their default values. Seed = 0 -- The base number for the random number generator GameFlags = gfInfAttack + gfMoreWind-- Game settings and rules TurnTime = 20000 -- The time the player has to move each round (in ms) CaseFreq = 0 -- The frequency of crate drops MinesNum = 0 -- The number of mines being placed MinesTime = 1000 Explosives = 0 -- The number of explosives being placed Delay = 10 -- The delay between each round Map = "Wind" -- The map to be played --Theme = "City" -- The theme to be used Theme = "Nature" -- The theme to be used --------- --AddTeam(loc("Chaotix"), 24483456, "Simple", "Island", "Default") --AddHog(loc("Knuckles"), 0, 1, "sth_Knux") --AddHog(loc("Sonic"), 0, 1, "sth_Sonic") -------- AddTeam(loc("Bloody Rookies"), 14483456, "Simple", "Island", "Default") player = AddHog(loc("Hunter"), 0, 1, "NoHat") AddTeam(loc("Toxic Team"), 1175851, "Simple", "Island", "Default") enemy = AddHog(loc("Poison"), 1, 100, "Skull") hog1 = AddHog(loc("Poison"), 1, 100, "Skull") hog2 = AddHog(loc("Poison"), 1, 100, "Skull") --SetGearPosition(player, 1454, 1540) --SetGearPosition(enemy, 2488, 1960) SetGearPosition(hog1, 2333, 1932) SetGearPosition(hog2, 2634, 1932) HogTurnLeft(hog2, true) robotTNames[0] = loc("Robots") robotTNames[1] = loc("More Robots") robotTNames[2] = loc("Even More Robots") robotTNames[3] = loc("Lots of Robots") robotTNames[4] = loc("Tons of Robots") for z = 0, 2 do AddTeam(robotTNames[z], 1175851, "Earth", "Island", "Robot", "cm_binary") for i = (z*8) , (z*8)+7 do robot[i] = AddHog(loc("Robot") .. " #" .. i, 5, 100, "Cyborg") end end end function onGameStart() --[[SpawnAmmoCrate(1450,1910,amJetpack) SpawnAmmoCrate(2568,1714,amFirePunch) SpawnAmmoCrate(1974,1875,amBlowTorch) SpawnAmmoCrate(2056,1877,amParachute)]] ShowMission(loc("Eye of the Storm"), loc("User Challenge"), loc("Eliminate the enemy"), -amFirePunch, 0); SetWind(-100) FollowGear(hog2) SetZoom(2.5) end function onGameTick() expTimer = expTimer + 1 if expTimer == expLimit then expTimer = 0 expLimit = GetRandom(5000) AddVisualGear(GetRandom(4096) , GetRandom(2048), vgtBigExplosion, 0, false) --PlaySound(sndExplosion) z = GetRandom(2) if z == 1 then z = 1 else z = -1 end SetWind( (GetRandom(100)*z) ) end if startSpawningCrates == true then crateCounter = crateCounter + 1 if crateCounter == 4000 then crateCounter = 0 if (numCrates < 10) and (GetGearElasticity(ropeGear) ~= 0) then z = GetRandom(10) if z >= 8 then nc = SpawnAmmoCrate(0,0,amWatermelon) elseif z >= 5 then nc = SpawnAmmoCrate(0,0,amClusterBomb) else nc = SpawnAmmoCrate(0,0,amBazooka) end --[[if z == 0 then nc = SpawnAmmoCrate(0,0,amBazooka) elseif z == 1 then nc = SpawnAmmoCrate(0,0,amClusterBomb) elseif z == 2 then nc = SpawnUtilityCrate(0,0,amRope) elseif z == 3 then nc = SpawnUtilityCrate(0,0,amParachute) end]] FindPlace(nc, false, 0, LAND_WIDTH) FollowGear(CurrentHedgehog) end end end if CurrentHedgehog ~= nil then AddCaption(GetX(CurrentHedgehog) .. ";" .. GetY(CurrentHedgehog)) if jetGear ~= nil then SetHealth(jetGear,2000) end end if (TotalRounds == 3) and (GameOver == false) then SetHealth(player, 0) GameOver = true end if TurnTimeLeft == 1 then SetHealth(player, 0) GameOver = true end end function onAmmoStoreInit() --SetAmmo(ammoType, count, probability, delay, numberInCrate) SetAmmo(amBazooka, 0, 0, 0, 5) SetAmmo(amClusterBomb, 0, 0, 0, 5) SetAmmo(amWatermelon, 0, 0, 0, 3) --SetAmmo(amGirder, 1, 0, 0, 1) SetAmmo(amParachute, 9, 0, 0, 5) --SetAmmo(amTeleport, 1, 0, 0, 1) SetAmmo(amJetpack, 9, 0, 0, 1) SetAmmo(amRope, 9, 0, 0, 1) end function onGearAdd(gear) if GetGearType(gear) == gtCase then numCrates = numCrates + 1 end if GetGearType(gear) == gtRope then ropeGear = gear end if GetGearType(gear) == gtJetpack then jetGear = gear end end function onGearDelete(gear) if GetGearType(gear) == gtCase then numCrates = numCrates - 1 TurnTimeLeft = TurnTimeLeft + 10000 end if GetGearType(gear) == gtRope then ropeGear = nil end if GetGearType(gear) == gtJetpack then jetGear = nil end if (gear == enemy) and (GameOver == false) then ShowMission(loc("Operation Diver: HARDCORE"), loc("MISSION SUCCESS"), loc("Congratulations!" .. " " .. loc("You are HARDCORE!")), 0, 0) elseif gear == player then ShowMission(loc("Operation Diver: HARDCORE"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0) GameOver = true end end