#include "missions.lua" #include "messages.lua" #include "challenges.lua" #include "activities.lua" ------------------------------------------------------------------------------ -- Levels ------------------------------------------------------------------------------ gLevels = {} gLevels["ravine"] = { map_title = "loc@LEVEL_MAP_TITLE_RAVINE", map_x = 673, map_y = 754, title = "loc@LEVEL_TITLE_RAVINE", image = "terminal/level/ravine.png", desc = "loc@LEVEL_DESCRIPTION_RAVINE", } gLevels["town"] = { map_title = "loc@LEVEL_MAP_TITLE_COMBUSTOWN", map_x = 1348, map_y = 418, title = "loc@LEVEL_TITLE_COMBUSTOWN", image = "terminal/level/town.png", desc = "loc@LEVEL_DESCRIPTION_COMBUSTOWN", } gLevels["hub"] = { map_title = "loc@LEVEL_MAP_TITLE_HUB", map_x = 814, map_y = 321, title = "loc@LEVEL_TITLE_HUB", image = "MOD/script/terminal/level/hub.png", desc = "loc@LEVEL_DESCRIPTION_HUB", } gLevels["hub_lockelle"] = { map_title = "loc@LEVEL_MAP_TITLE_HUB_LOCKELLE", map_x = 359, map_y = 883, title = "loc@LEVEL_TITLE_HUB_LOCKELLE", image = "MOD/script/terminal/level/hub_lockelle.png", desc = "loc@LEVEL_DESCRIPTION_HUB_LOCKELLE", } ------------------------------------------------------------------------------ -- Clients ------------------------------------------------------------------------------ gClients = {} gClients["nils"]= { name = "loc@CLIENT_NAME_NILS", image = "MOD/script/terminal/client/nils.png" } gClients["timemachine"]= { name = "Time Machine", image = "MOD/script/terminal/client/time.png" } ------------------------------------------------------------------------------ -- Ranks ------------------------------------------------------------------------------ gRanks = { {score=0, name="loc@RANK_NAME_DEMOLISHER"}, {score=5, name="loc@RANK_NAME_AMATEUR", tool="blowtorch"}, {score=10, name="loc@RANK_NAME_NOVICE", tool="shotgun"}, {score=15, name="loc@RANK_NAME_TRESPASSER", tool="plank"}, {score=20, name="loc@RANK_NAME_BREAKER", tool="pipebomb"}, {score=30, name="loc@RANK_NAME_CROOK", tool="gun"}, {score=40, name="loc@RANK_NAME_WRECKER", tool="bomb"}, {score=50, name="loc@RANK_NAME_TALENTED", tool="wire"}, {score=60, name="loc@RANK_NAME_BALLISTIC", tool="rocket"}, {score=70, name="loc@RANK_NAME_CRACKERJACK", tool="leafblower"}, {score=80, name="loc@RANK_NAME_PROFESSIONAL", tool="booster"}, {score=90, name="loc@RANK_NAME_MIDNIGHTER", tool="turbo"}, {score=100, name="loc@RANK_NAME_EXPERT", tool="explosive"}, {score=110, name="loc@RANK_NAME_TOP_DOG", tool="rifle"}, {score=120, name="loc@RANK_NAME_HOT_SHOT", tool="steroid"}, {score=130, name="loc@RANK_NAME_GENIUS", cash=1000}, {score=140, name="loc@RANK_NAME_SAVANT", cash=2000}, {score=160, name="loc@RANK_NAME_GURU", cash=3000}, {score=180, name="loc@RANK_NAME_MASTERMIND", cash=4000}, {score=200, name="loc@RANK_NAME_VIRTUOSO", cash=5000}, } ------------------------------------------------------------------------------ -- Cinematic ending sequences ------------------------------------------------------------------------------ gCinematic = { ending1 = { music = "win.ogg", esc = "hub", parts = { { id="ending10", file="lee.xml", layers="part1ending"}, } }, ending2 = { music = "ending.ogg", esc = "menu", parts = { { id="ending20", file="hub.xml", layers="part2 part2ending"}, { id="ending21", file="mansion.xml", layers="part2ending"}, { id="ending22", file="marina.xml", layers="part2ending"}, } } } ------------------------------------------------------------------------------ -- Expansions ------------------------------------------------------------------------------ --gExpansions = --{ -- { level="dlc-artvandals", image="menu/expansion/artvandals.png", name="Art Vandals", available=true }, --} function skipMission(id) if gMissions[id] then SetInt("savegame.mod.mission."..id..".score", gMissions[id].required) SetBool("savegame.mod.mission."..id..".complete", true) SetString("savegame.lastcompleted", id) if id == "town_heist" then SetBool("savegame.mod.lamp", true) end end end function startCinematic(cinematic, noLoadingScreen) local c = gCinematic[cinematic].parts[1] StartLevel(c.id, c.file, c.layers, noLoadingScreen) end ------------------------------------------------------------------------------ -- Tools ------------------------------------------------------------------------------ gTools = { sledge = { name="Sledge", image="sledge.png", desc="Short range tool. Causes medium damage on weak materials. Does not need ammunition and does not wear out.", upgrades= { } }, spraycan = { name="Spray can", image="spraycan.png", desc="Make markings in the environment. Useful to help planning an intended path during escape.", upgrades= { } }, extinguisher = { name="Fire extinguisher", image="extinguisher.png", desc="Safety first. Use this tool to put out fires.", upgrades= { } }, blowtorch = { name="Blowtorch", image="blowtorch.png", desc="Cuts through metal, wood and plastic. Can occasionally set things on fire.", upgrades= { { id="ammo", name="Fuel", desc="The number of seconds you can use it", default=20, max=30, step=10, price=100 }, } }, shotgun = { name="Shotgun", image="shotgun.png", desc="Short range tool, causes medium damage on most materials. Damage decreases with distance.", upgrades= { { id="ammo", name="Rounds", desc="The number of shells you have at the start of a mission", default=12, max=24, step=12, price=200 }, { id="range", name="Range", desc="Maximum range for weapon.", default=20, max=24, step=20, price=300 }, { id="damage", name="Damage", desc="How much damage it makes.", default=3, max=5, step=1, price=400 }, } }, plank = { name="Plank", image="plank.png", desc="Wooden planks, used to attach objects, barricade doors or build structures and walkways.", upgrades= { { id="ammo", name="Planks", desc="The number of planks you have at the start of a mission.", default=8, max=16, step=8, price=150 }, { id="width", name="Width", desc="The width of a plank", default=3, max=4, step=1, price=200 }, { id="length", name="Max length", desc="Maximum length of each plank", default=40, max=56, step=8, price=300 }, } }, dynamite_stick = { name="Pipe bomb", image="pipebomb.png", desc="Medium range, throwable explosive, medium blast and poor precision.", upgrades= { { id="ammo", name="Rounds", desc="The number of bombs you have at the start of a mission", default=6, max=18, step=6, price=200 }, { id="damage", name="Blast", desc="How much damage it makes.", default=1, max=1, step=1, price=500 }, } }, revolver = { name="Revolvers", image="gun.png", desc="Good for medium range precision shooting. Causes small damage on most materials within entire range.", upgrades= { { id="ammo", name="Rounds", desc="The number of bullets you have at the start of a mission", default=6, max=36, step=6, price=200 }, { id="range", name="Range", desc="The maximum range", default=40, max=24, step=20, price=300 }, { id="damage", name="Damage", desc="How much damage a bullet makes", default=1, max=5, step=1, price=300 }, } }, dynamite_bundle = { name="Bomb", image="bomb.png", desc="Timed bomb, attaches to objects and detonates in a large explosion after three seconds.", upgrades= { { id="ammo", name="Rounds", desc="The number of bombs you have at the start of a mission", default=6, max=8, step=6, price=400 }, { id="damage", name="Blast", desc="How much damage it makes.", default=1.5, max=1.5, step=1, price=500 }, } }, wire = { name="Cable", image="wire.png", desc="Cables can be used to drag heavy objects with vehicles, suspend objects or build various contraptions.", upgrades= { { id="ammo", name="Cables", desc="The number of cables you have at the start of a mission", default=6, max=24, step=6, price=300 }, { id="stretch", name="Stretch", desc="How much you can stretch a cable when placing it", default=3, max=4, step=1, price=400 }, } }, tnt = { name="Nitroglycerin", image="explosive.png", desc="Nitroglycerin containers are highly explosive and causes massive damage. They can be placed anywhere and will blow up when shot, in fire or otherwise broken.", upgrades= { { id="ammo", name="Rounds", desc="The number of containers you have at the start of a mission", default=4, max=6, step=4, price=400 }, { id="damage", name="Blast", desc="How much damage each container makes.", default=2, max=2, step=1, price=600 }, } }, rifle = { name="Rifle", image="rifle.png", desc="The hunting rifle has excellent precision and long range. Use grab button to zoom in and aim. Bullets pierce through several layers of material.", upgrades= { { id="ammo", name="Rounds", desc="The number of bullet you have at the start of a mission", default=6, max=12, step=6, price=400 }, } }, steroid = { name="XXX", image="steroid.png", desc="BlueTide Founders Edition, Extra Strong. Drinking a bottle will temporarily boost your running speed and jumping ability.", upgrades= { { id="ammo", name="Bottles", desc="The number of BlueTide bottles you have at the start of a mission", default=2, max=4, step=1, price=600 }, { id="time", name="Duration", desc="How long the effect from each bottle will last in seconds", default=4, max=6, step=1, price=800 }, } }, powder = { name="powder", image="powder.png", desc="", upgrades= { { id="ammo", name="Bottles", desc="The number of BlueTide bottles you have at the start of a mission", default=2, max=20, step=1, price=600 } } }, } ------------------------------------------------------------------------------ -- Sandbox levels ------------------------------------------------------------------------------ gSandbox = { [1] = { id="hub", level="hub", name="loc@UI_BUTTON_MENU_HUB_SANDBOX", image="MOD/images/menu/hub.png", file="MOD/hub.xml", layers="sandbox"}, [2] = { id="town_sandbox", level="town_heist", name="loc@UI_BUTTON_MENU_TOWN_SANDBOX", image="MOD/images/menu/town_heist.png", file="MOD/town.xml", layers="sandbox landscape"}, [3] = { id="ravine_sandbox", level="ravine_heist", name="loc@UI_BUTTON_MENU_RAVINE_SANDBOX", image="MOD/images/menu/ravine_heist.png", file="MOD/ravine.xml", layers="sandbox landscape"}, } function getLevelScore(levelId) local score = 0 for id,mission in pairs(gMissions) do if mission.level == levelId then score = score + GetInt("savegame.mod.mission."..id..".score") end end return score end function getScoreDetails(id, score, missionList) local missions = missionList or gMissions local mission = missions[id]; local details = {} details.required = mission.required details.optional = mission.primary + mission.secondary - mission.required if score >= mission.required then details.requiredTaken = mission.required else details.requiredTaken = score end details.optionalTaken = clamp(score - mission.required, 0, mission.primary + mission.secondary - mission.required) details.bonuses = 0 details.bonusesTaken = 0 details.bonus = {} local s = mission.primary + mission.secondary for i=1, #mission.bonus do local t = mission.bonus[i] if score >= s then details.bonuses = details.bonuses + 1 details.bonus[i] = {} details.bonus[i].desc = GetTranslatedStringByKey("TXT_SCORE_SECONDS_LEFT," .. t) if score > s then details.bonus[i].score = 1 details.bonusesTaken = details.bonusesTaken + 1 else details.bonus[i].score = 0 end end s = s + 1 end return details end