Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------ BEGIN SCRIPT ------
- -- Copy and Paste this text into an empty text file, and save it as
- -- YOURTITLEHERE.lua, in your Data/Missions/Training/ folder.
- HedgewarsScriptLoad("/Scripts/Locale.lua")
- HedgewarsScriptLoad("/Scripts/Tracker.lua")
- local hhs = {}
- local wepArray = {
- amBazooka, amBee, amMortar, amDrill, amSnowball,
- amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
- amShotgun, amDEagle, amSniperRifle, amSineGun, amLandGun, amIceGun,
- amFirePunch, amWhip, amBaseballBat, amKamikaze, amSeduction, amHammer,
- amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine, amAirMine,
- amAirAttack, amMineStrike, amDrillStrike, amNapalm, amPiano, amBirdy,
- amBlowTorch, amPickHammer, amGirder, amRubber, amPortalGun,
- amRope, amParachute, amTeleport, amJetpack,
- amInvulnerable, amLaserSight, amVampiric,
- amLowGravity, amExtraDamage, amExtraTime, amResurrector, amTardis, amSwitch
- }
- function onGameInit()
- ClearGameFlags()
- EnableGameFlags(gfDisableWind, gfDisableGirders, gfDisableLandObjects, gfPerHogAmmo)
- Map = "Eyes"
- Theme = "Nature"
- TurnTime = 45000
- Explosives = 0
- MinesNum = 0
- CaseFreq = 0
- Delay = 100
- HealthCaseProb = 35
- HealthCaseAmount = 25
- DamagePercent = 100
- MinesTime = 3000
- MineDudPercent = 0
- SuddenDeathTurns = 50
- WaterRise = 0
- HealthDecrease = 1
- ------ TEAM LIST ------
- AddTeam("The Fruit", "0xff4980c1", "Cherry", "Castle", "Default", "cm_mog")
- hhs[1] = AddHog("The Rotten", 0, 1, "fr_apple")
- SetGearPosition(hhs[1], 734, 505)
- setGearValue(hhs[1], "tag", "failure")
- AddTeam("Fruit", "0xff1de6ba", "Cherry", "Castle", "Default", "cm_mog")
- hhs[2] = AddHog("Juicy", 1, 1, "fr_lemon")
- SetGearPosition(hhs[2], 772, 175)
- hhs[3] = AddHog("Sweet", 1, 1, "fr_tomato")
- SetGearPosition(hhs[3], 1495, 230)
- hhs[4] = AddHog("Fruity", 1, 1, "fr_banana")
- SetGearPosition(hhs[4], 522, 27)
- hhs[5] = AddHog("Ripe", 1, 1, "fr_orange")
- SetGearPosition(hhs[5], 683, 314)
- hhs[6] = AddHog("Squishy", 1, 1, "fr_pumpkin")
- SetGearPosition(hhs[6], 1610, 259)
- hhs[7] = AddHog("Sour", 1, 1, "fr_lemon")
- SetGearPosition(hhs[7], 1174, 457)
- hhs[8] = AddHog("Bitter", 1, 1, "fr_lemon")
- SetGearPosition(hhs[8], 1907, 738)
- AddTeam("Clowns", "0xff1de6ba", "Rubberduck", "Castle", "Mobster", "cm_birdy")
- hhs[9] = AddHog("Chester", 1, 1, "Joker")
- SetGearPosition(hhs[9], 808, 661)
- hhs[10] = AddHog("Buster", 1, 1, "clown")
- SetGearPosition(hhs[10], 134, 493)
- hhs[11] = AddHog("Molly", 1, 1, "WhySoSerious")
- SetGearPosition(hhs[11], 972, 862)
- hhs[12] = AddHog("Bozo", 1, 1, "clown-copper")
- SetGearPosition(hhs[12], 866, 484)
- hhs[13] = AddHog("Loopy", 1, 1, "clown-crossed")
- SetGearPosition(hhs[13], 450, 315)
- hhs[14] = AddHog("Bobo", 1, 1, "clown-crossed")
- SetGearPosition(hhs[14], 562, 275)
- hhs[15] = AddHog("Giggles", 1, 1, "clown-copper")
- SetGearPosition(hhs[15], 1136, 282)
- hhs[16] = AddHog("Baggy", 1, 1, "clown-copper")
- SetGearPosition(hhs[16], 196, 819)
- AddTeam("The Zoo", "0xff1de6ba", "Bone", "Castle", "Default", "cm_hurrah")
- hhs[17] = AddHog("Sheepy", 1, 1, "zoo_Sheep")
- SetGearPosition(hhs[17], 560, 620)
- hhs[18] = AddHog("Deer", 1, 1, "zoo_Deer")
- SetGearPosition(hhs[18], 1509, 592)
- hhs[19] = AddHog("Fishy", 1, 1, "zoo_fish")
- SetGearPosition(hhs[19], 676, 65)
- hhs[20] = AddHog("Batty", 1, 1, "zoo_Bat")
- SetGearPosition(hhs[20], 2020, 767)
- hhs[21] = AddHog("Bacon", 1, 1, "zoo_Pig")
- SetGearPosition(hhs[21], 1377, 703)
- hhs[22] = AddHog("Legs", 1, 1, "zoo_frog")
- SetGearPosition(hhs[22], 1924, 885)
- setGearValue(hhs[22], "tag", "victory")
- hhs[23] = AddHog("Horns", 1, 1, "zoo_Moose")
- SetGearPosition(hhs[23], 458, 557)
- hhs[24] = AddHog("Tails", 1, 1, "zoo_Beaver")
- SetGearPosition(hhs[24], 1578, 39)
- end
- function LoadHogWeapons()
- for i = 1,24 do
- AddAmmo(hhs[i], amBazooka, 100)
- AddAmmo(hhs[i], amGrenade, 100)
- AddAmmo(hhs[i], amRope, 100)
- end
- end
- function LoadSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)
- PlaceSprite(pX, pY, pSprite, pFrame, pTint, p1, p2, p3, pLandFlags)
- end
- function LoadGearData()
- --BEGIN CORE DATA--
- ------ PORTAL DISTANCE and UFO FUEL ------
- ufoFuel = 0
- portalDistance = 5000
- ------ GIRDER LIST ------
- LoadSprite(732, 532, sprAmGirder, 7, 4294967295, nil, nil, nil, lfNormal)
- ------ UTILITY CRATE LIST ------
- ------ BARREL LIST ------
- SetHealth(AddGear(143, 556, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(363, 689, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(740, 696, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(524, 343, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(563, 95, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(967, 101, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1017, 316, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1264, 637, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1054, 968, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1397, 944, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1450, 693, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1784, 419, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1539, 286, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1607, 79, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(448, 610, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1759, 789, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1888, 771, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(2012, 799, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(1865, 962, gtExplosives, 0, 0, 0, 0), 1)
- SetHealth(AddGear(79, 960, gtExplosives, 0, 0, 0, 0), 1)
- --END CORE DATA--
- LoadHogWeapons()
- end
- function onGameStart()
- LoadGearData()
- DetermineMissionGoal()
- end
- function onNewTurn()
- --insert code according to taste
- end
- function onGameTick()
- runOnGears(UpdateTagCircles)
- end
- function UpdateTagCircles(gear)
- if getGearValue(gear,"tag") ~= nil then
- if getGearValue(gear,"tCirc") == nil then
- setGearValue(gear, "tCirc",AddVisualGear(0,0,vgtCircle,0,true))
- end
- if getGearValue(gear,"tag") == "victory" then
- SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0xff0000ff)
- elseif getGearValue(gear,"tag") == "failure" then
- SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0x00ff00ff)
- elseif getGearValue(gear,"tag") == "collection" then
- SetVisualGearValues(getGearValue(gear,"tCirc"), GetX(gear), GetY(gear), 100, 255, 1, 10, 0, 150, 3, 0x0000ffff)
- end
- end
- end
- function CheckForConditions(gear)
- if getGearValue(gear,"tag") == "victory" then
- victoryObj = victoryObj +1
- elseif getGearValue(gear,"tag") == "failure" then
- failObj = failObj +1
- elseif getGearValue(gear,"tag") == "collection" then
- collectObj = collectObj +1
- end
- end
- function CheckForConclusion(gear)
- if getGearValue(gear,"tag") == "failure" then
- EndGameIn("failure")
- else
- victoryObj = 0
- failObj = 0
- collectObj = 0
- runOnGears(CheckForConditions)
- if GetGearType(gear) ~= gtCase then
- victoryObj = victoryObj - 1
- if (victoryObj == 0) and (collectObj == 0) then
- EndGameIn("victory")
- end
- else
- if (GetGearMessage(gear) == 256) and (getGearValue(gear,"tag") == "collection") then
- if GetHogLevel(CurrentHedgehog) ~= 0 then
- EndGameIn("failure")
- else
- collectObj = collectObj - 1
- if (victoryObj == 0) and (collectObj == 0) then
- EndGameIn("victory")
- end
- end
- elseif (GetGearMessage(gear) == 0) and (getGearValue(gear,"tag") == "victory") then
- victoryObj = victoryObj - 1
- if (victoryObj == 0) and (collectObj == 0) then
- EndGameIn("victory")
- end
- else
- EndGameIn("failure")
- end
- end
- end
- end
- function DetermineMissionGoal()
- victoryObj = 0
- failObj = 0
- collectObj = 0
- vComment = ""
- fComment = ""
- collectComment = ""
- runOnGears(CheckForConditions)
- if victoryObj > 0 then
- if victoryObj == 1 then
- vComment = loc("Destroy the red target")
- else
- vComment = loc("Destroy the red targets")
- end
- end
- if collectObj > 0 then
- if collectObj == 1 then
- collectComment = loc("Collect the blue target")
- else
- collectComment = loc("Collect all the blue targets")
- end
- end
- if (collectObj == 0) and (victoryObj == 0) then
- vComment = loc("Destroy the enemy.")
- end
- if failObj > 0 then
- if failObj == 1 then
- fComment = loc("The green target must survive")
- else
- fComment = loc("The green targets must survive")
- end
- end
- ShowMission(loc("User Challenge"), loc("Mission Goals") .. ":", collectComment .. "|" .. vComment .. "|" .. fComment, 0, 0)
- end
- function isATrackedGear(gear)
- if (GetGearType(gear) == gtHedgehog) or
- (GetGearType(gear) == gtExplosives) or
- (GetGearType(gear) == gtMine) or
- (GetGearType(gear) == gtSMine) or
- (GetGearType(gear) == gtAirMine) or
- (GetGearType(gear) == gtTarget) or
- (GetGearType(gear) == gtKnife) or
- (GetGearType(gear) == gtPortal) or
- (GetGearType(gear) == gtCase)
- then
- return(true)
- else
- return(false)
- end
- end
- function onGearAdd(gear)
- if isATrackedGear(gear) then
- trackGear(gear)
- end
- end
- function EndGameIn(c)
- teamCounter = 0
- lastRecordedTeam = ""
- for i = 1, #hhs do
- if GetHogTeamName(hhs[i]) ~= lastRecordedTeam then --er, is this okay without nill checks?
- lastRecordedTeam = GetHogTeamName(hhs[i])
- teamCounter = teamCounter + 1
- if teamCounter == 9 then
- teamCounter = 1
- end
- if (c == "victory") and (GetHogLevel(hhs[i]) ~= 0) then
- DismissTeam(GetHogTeamName(hhs[i]))
- ShowMission(loc("User Challenge"), loc("MISSION SUCCESSFUL"), loc("Congratulations!"), 0, 0)
- elseif (c == "failure") and (GetHogLevel(hhs[i]) == 0) then
- DismissTeam(GetHogTeamName(hhs[i]))
- ShowMission(loc("User Challenge"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
- elseif (c == "victory") and (GetHogLevel(hhs[i]) == 0) then
- PlaySound(sndVictory,hhs[i]) -- check if we actually need this
- end
- end
- end
- end
- function onGearDelete(gear)
- --insert code according to taste
- if isATrackedGear(gear) then
- if getGearValue(gear,"tag") ~= nil then
- CheckForConclusion(gear)
- end
- if getGearValue(gear, "tCirc") ~= nil then
- DeleteVisualGear(getGearValue(gear, "tCirc"))
- end
- trackDeletion(gear)
- end
- end
- --enable and/or alter code according to taste
- function onAmmoStoreInit()
- for i = 1, #wepArray do
- SetAmmo(wepArray[i], 0, 0, 0, 1)
- end
- SetAmmo(amSkip, 9, 0, 0, 0)
- end
- ------ END GENERATED MISSION ------
- function GeneratePreviewData()
- PreviewGirder(732, 532, 7)
- PreviewPlacedGear(143, 556)
- PreviewPlacedGear(363, 689)
- PreviewPlacedGear(740, 696)
- PreviewPlacedGear(524, 343)
- PreviewPlacedGear(563, 95)
- PreviewPlacedGear(967, 101)
- PreviewPlacedGear(1017, 316)
- PreviewPlacedGear(1264, 637)
- PreviewPlacedGear(1054, 968)
- PreviewPlacedGear(1397, 944)
- PreviewPlacedGear(1450, 693)
- PreviewPlacedGear(1784, 419)
- PreviewPlacedGear(1539, 286)
- PreviewPlacedGear(1607, 79)
- PreviewPlacedGear(448, 610)
- PreviewPlacedGear(1759, 789)
- PreviewPlacedGear(1888, 771)
- PreviewPlacedGear(2012, 799)
- PreviewPlacedGear(1865, 962)
- PreviewPlacedGear(79, 960)
- PreviewPlacedGear(672, 553)
- PreviewPlacedGear(672, 548)
- PreviewPlacedGear(674, 552)
- end
- --BEGIN HWMAP CONVERTER POINTS--
- -- You can paste this data into the HWMAP converter if needed.
- --[[
- 5000 0 98
- 732 532 107
- 143 556 15
- 363 689 15
- 740 696 15
- 524 343 15
- 563 95 15
- 967 101 15
- 1017 316 15
- 1264 637 15
- 1054 968 15
- 1397 944 15
- 1450 693 15
- 1784 419 15
- 1539 286 15
- 1607 79 15
- 448 610 15
- 1759 789 15
- 1888 771 15
- 2012 799 15
- 1865 962 15
- 79 960 15
- 672 553 20
- 672 548 25
- 674 552 63
- --]]
- --END HWMAP CONVERTER POINTS--
- ------ END GENERATED SCRIPT ------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement