comments{
oh hello, wanderer from a strange and foreign land! you've arrived at probably the most script-heavy level I've ever created, the vehicle tutorial
as of time of writing it's a pretty good example of what scripting is capable of, utilizing most mechanics & triggers, although of course some aren't used (eg: random spawn system, timers)
and also the features that got added after this was created are of course not in :p
on a non-MM-scripting note, perchance I can interest you in some queer splat plaza art? https://cdn.discordapp.com/attachments/962400304383557632/1118804365877186570/2023061513351600_c.jpg
}
info{
rowcount:48
colcount:40
camerapos:Translation: X=6979.433 Y=6487.014 Z=31.000 Rotation: P=49.332417 Y=1.152404 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
biome:lava
creator:Zeldrake
erosioninitialwaittime:10
version:2023-08-02-1
erosionscale:1.0
camerazoom:1200.0
initialcrystals:50
initialore:80
opencaves:9,17/5,15/20,23/
levelname:Tutorial: Vehicles
spiderrate:0
spidermin:1
spidermax:1
}
tiles{
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,50,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,42,38,38,38,46,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,1,38,38,38,26,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,30,26,1,1,1,26,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,46,38,38,38,38,26,1,1,1,34,34,34,38,38,38,46,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,34,34,38,38,38,38,38,1,34,34,34,34,38,38,38,34,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,163,161,26,26,30,38,38,1,34,34,1,38,38,38,38,34,38,30,38,30,26,1,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,34,161,101,101,101,101,30,30,38,34,34,1,1,1,1,46,38,38,38,26,38,38,26,1,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,34,163,34,38,101,101,38,38,38,38,30,1,34,34,34,38,38,38,38,38,38,38,1,1,1,42,50,38,38,38,38,38,38,38,38,
38,38,38,38,38,34,163,34,38,38,101,38,38,38,38,26,1,34,34,34,38,38,38,38,38,38,38,1,1,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,42,38,38,163,34,38,38,38,34,34,34,30,1,34,34,34,1,1,1,1,1,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,101,101,30,38,38,38,38,38,38,38,38,38,1,34,34,34,1,1,1,14,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,46,101,101,101,101,38,38,38,38,38,38,38,38,38,38,38,38,38,1,14,24,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,101,101,38,38,38,38,38,38,38,30,30,46,38,38,46,38,1,1,24,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,34,34,38,38,38,38,38,38,30,30,30,38,38,38,26,38,1,1,14,14,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,34,34,34,34,38,38,38,38,1,1,1,24,24,14,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,46,38,38,38,38,38,6,6,6,6,38,38,1,1,1,1,1,1,14,14,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,30,38,38,6,6,6,6,6,6,6,6,6,6,1,1,1,1,1,24,24,24,1,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,30,1,1,6,6,6,6,6,6,6,6,1,6,1,1,1,1,24,14,14,14,14,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,26,1,1,1,6,6,38,38,38,38,30,1,38,38,38,38,1,1,1,24,24,24,24,50,38,46,38,38,38,38,38,38,38,38,38,38,
38,38,38,30,26,1,1,26,38,38,38,38,38,38,38,38,26,38,38,38,1,1,24,14,14,14,14,38,38,101,38,38,38,38,38,38,38,38,38,38,
38,38,30,26,1,1,1,42,50,38,38,38,38,38,38,38,46,38,38,38,38,1,1,24,24,24,1,38,38,38,26,38,38,38,38,38,38,38,38,38,
38,38,34,30,26,1,38,38,38,38,38,38,38,38,38,38,38,30,38,38,38,1,1,1,24,1,1,38,26,101,38,38,38,38,38,38,38,38,38,38,
38,38,34,34,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,1,1,1,1,24,1,1,1,38,101,38,38,38,38,38,38,38,38,38,38,
38,38,38,46,38,34,38,38,38,38,46,26,38,11,26,38,26,1,1,11,1,1,1,1,14,1,1,1,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,30,38,38,38,38,38,38,1,11,38,38,38,38,1,11,11,11,1,1,14,1,38,38,1,1,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,26,26,101,38,38,38,38,38,11,11,38,38,38,38,11,11,11,11,11,11,11,11,38,38,1,1,1,38,38,38,38,38,38,38,38,38,
38,38,38,38,101,101,101,101,38,38,38,38,38,38,11,11,11,11,11,11,11,11,11,11,11,11,38,38,1,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,101,101,38,30,34,34,38,38,38,38,38,11,11,11,11,11,11,11,11,11,11,38,38,38,26,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,46,38,38,30,30,30,38,38,38,38,38,11,11,11,11,11,30,30,11,11,38,38,38,38,46,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,30,30,30,26,1,38,38,11,11,11,11,11,11,30,30,11,11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,34,34,30,1,1,1,11,11,11,11,11,11,11,11,11,11,11,38,38,38,38,46,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,1,1,1,1,1,1,11,11,11,11,38,38,38,1,1,1,38,26,101,101,30,30,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,50,42,1,26,30,38,38,38,1,11,11,11,38,38,38,38,1,1,38,38,38,101,26,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,11,38,38,38,38,30,26,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,11,38,38,38,38,38,38,38,38,38,46,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,11,11,11,38,38,38,101,101,101,26,26,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,11,11,11,38,38,26,101,101,101,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,11,11,11,11,38,101,30,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,11,11,11,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,38,
}
height{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
}
objectives{
variable:FinalWinVariable>0/Follow Chief's instructions and drill all four Energy Crystal Seams
}
buildings{
BuildingToolStore_C,Translation: X=7350.000 Y=6150.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000,Level=2
BuildingPowerStation_C,Translation: X=7350.000 Y=5550.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000,Level=2
BuildingUpgradeStation_C,Translation: X=7050.000 Y=4950.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
BuildingTeleportPad_C,Translation: X=7350.000 Y=6750.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000,Level=2
BuildingSupportStation_C,Translation: X=7950.000 Y=6750.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000,Level=2
BuildingSupportStation_C,Translation: X=7950.000 Y=6150.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000,Level=2
BuildingDocks_C,Translation: X=7350.000 Y=8250.000 Z=0.000 Rotation: P=0.000000 Y=0.000000 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
BuildingMiningLaser_C,Translation: X=6450.000 Y=4350.000 Z=0.000 Rotation: P=0.000000 Y=-89.999992 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
BuildingMiningLaser_C,Translation: X=6750.000 Y=4050.000 Z=0.000 Rotation: P=0.000000 Y=0.000000 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
}
landslidefrequency{
3.0:22,9/22,8/22,7/22,6/24,8/24,7/24,6/24,9/
10.0:5,9/7,12/7,11/7,10/5,11/5,10/7,7/8,7/
}
lavaspread{
}
miners{
}
briefing{
Welcome Cadet. In this training mission you will learn all about the vehicles aboard the LMS Explorer and how to use them.
}
briefingsuccess{
Congratulations, Cadet! You now know about all the ways you can use the Rock Raider vehicles.
}
briefingfailure{
You have not yet completed the Vehicles training mission.
}
vehicles{
VehicleSmallTransportTruck_C,Translation: X=7049.997 Y=6753.960 Z=1.491 Rotation: P=0.000007 Y=179.999237 R=0.000159 Scale X=1.000 Y=1.000 Z=1.000,ID=1
}
creatures{
CreatureLavaMonster_C
Translation: X=994.991 Y=3976.269 Z=137.150 Rotation: P=0.000000 Y=36.952507 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
ID=0,Sleep=true
CreatureLavaMonster_C
Translation: X=1269.991 Y=4621.835 Z=137.150 Rotation: P=0.000000 Y=-39.817902 R=0.000000 Scale X=1.000 Y=1.000 Z=1.000
ID=1,Sleep=true
}
blocks{
}
script{

# this one's a biggie

arrow CrystalSeamPointArrow=yellow
arrow AnyArrow=yellow
arrow AnyArrowOne=yellow
arrow AnyArrowTwo=yellow
arrow AnyArrowThree=yellow # I need three additional arrows so they all flash in sync. Annoying, but it is what must be done

int AnySmallVehiclesYet=0
int SmallVehicles=0
int NothingInt=0 # possibly all depreciated
int VehiclesDone=0 # very much not depreciated

string temp="Yay!"
string debugA="Yay! A"
string debugB="Yay! B"
string debugC="Yay! C"

DebugEventChainA::msg:debugA
DebugEventChainB::msg:debugB
DebugEventChainC::msg:debugC

vehicle NewVehicleRef
int VRow=0
int VCol=0
# used for pan events

# read: Part 1 A
# with things off the end in case I wanted to squeeze another message in
string P1A="Welcome Cadet! In this training mission you will learn how to use vehicles, powerful mining equipment we can teleport down from the LMS Explorer."
string P1Aa="Vehicles can do tasks much faster than Rock Raiders, and they also have unique capabilities of their own."

string P1B="We'll be using the unique capabilities of vehicles to drill four Crystal Seams across the map:"
string P1Ca="One across a river of water..."
string P1Cb="One across a lake of lava..."
string P1Cc="One buried behind a wall of Hard Rock..."
string P1Cd="and one inside an otherwise inaccessible cavern."

# P1Dx currently unused
string P1Da="Before we begin, there are some important things about vehicles you'll need to know."
string P1Db="The most important is that every vehicle needs its own operator, be they a Pilot, Driver, or Sailor, so you'll want to teleport down some miners too."
string P1Dc="Teleporting down any vehicle not only costs crystals, but the teleporter also needs to be powered: so you will need more crystals than the raw crystal cost of the vehicle in order to teleport it."

string P1E="Teleport down some miners and we'll learn about training."

string P3A="Let's get started with the Small Transport Truck."
string P3B="All vehicles need a Rock Raider to drive them, so the first thing you'll want to do is teleport down a handful of Rock Raiders."

string P4A="Rock Raiders can be trained in many skills. When it comes to vehicles, the important ones are Drivers for land vehicles, Pilots for air vehicles, and Sailors for water vehicles."
string P4B="Rock Raiders will automatically train for vehicles if required, but they can also be given manual train orders."
string P4C="To do so, first select a Rock Raider..."
string P4D="... then select the Training/Upgrade menu..."
string P4E="and then the relevant training. Since the Small Transport Truck is a ground-based vehicle, it requires a Driver."
string P4F="Having a well-trained team of Rock Raiders can save crucial time in the caverns of Planet U. Rock Raiders retain their training, which means you can have a skilled group right from the getgo."

string P5A="Once our Rock Raider has finished their training, they can drive the vehicle!"
string P5B="This can either be done by selecting the Rock Raider and giving a Get In order with Left Mouse Button, or by selecting the vehicle and giving a Get Driver order. Using either method, let's rev up that Small Transport Truck!"




# string P2A="Miners can be trained in all sorts of skills. For vehicles, we only need to train miners as"
# string P2B="In order to train a miner, select them, click Go to Training Menu, and train them as the relevant skill."
# string P2C="Drivers train at a Support Station, Pilots train at the Teleport Pad, and Sailors train at the Docks." 
# string P2D="While miners can be manually trained, they will also automatically train for any jobs that need the training: including getting into any new vehicles."
# string P2E="The Hover Scout needs no training, so select any miner and tell them to get in the Hover Scout, or issue a request for any driver by selecting the Hover Scout and clicking the Get Driver button."
# duds, and yes, this tutorial originally started with you using the Hover Scout

# string P1E="Let's get started! Open the Vehicles menu on the side of the screen using LMB and select any vehicle with LMB to teleport it down."
# string QP1Ab="Manic Miner HQ has already been prepared so we can teleport in basic vehicles: a Tool Store, Power Station, Teleport Pad, and Support Station are all that is needed for basic vehicles."
# string QP1B="Vehicles aren't free, unlike miners: they require Energy Crystals to teleport down. You must have enough Energy Crystals to pay the crystal cost of the vehicle and power the teleporter."
# string QP1C="Let's get started! Open the Vehicles menu on the side and select any vehicle to teleport it down."

# speed:3 # no longer needed thanks to qmsg having many benefits, one of which is that I can mash through all of them as fast as possible (with a few exceptions)
init::;
disable:VehicleHoverScout_C;
disable:VehicleSmallDigger_C;
disable:VehicleSmallTransportTruck_C;
disable:VehicleSMLC_C;
disable:VehicleTunnelScout_C;
disable:VehicleRapidRider_C;
disable:VehicleLoaderDozer_C;
disable:VehicleGraniteGrinder_C;
disable:VehicleLMLC_C;
disable:VehicleChromeCrusher_C;
disable:VehicleCargoCarrier_C;
disable:VehicleTunnelTransport_C;
msg:P1A;
qmsg:P1Aa;
qmsg:P1B;
CrystalSeamIntroEvent;

CrystalSeamIntroEvent::qmsg:P1Ca;
pan:35,5;
showarrow:35,5,CrystalSeamPointArrow;
qmsg:P1Cb;
pan:23,7;
showarrow:23,7,CrystalSeamPointArrow;
qmsg:P1Cc;
pan:3,15;
showarrow:3,15,CrystalSeamPointArrow;
qmsg:P1Cd;
pan:10,30;
showarrow:10,30,CrystalSeamPointArrow;
qmsg:P3A; # would love to branch this into its own event chain for ease of editing but qmsg does not easily allow me to do that
pan:22,23;
hidearrow:CrystalSeamPointArrow;
qmsg:P3B;
enable:VehicleSmallTransportTruck_C;

#qmsg:P1Da;
#qmsg:P1Db;
#qmsg:P1Dc;



# 
# pan:21,25;
# hidearrow:CrystalSeamPointArrow;
# wait:3;
# msg:P1Db;
# wait:3;
# msg:P1Dc;
# wait:3;
# msg:P1E;

if(miners>0)[MinerTrainMonologueEvent]
MinerTrainMonologueEvent::msg:P4A;
qmsg:P4B;
qmsg:P4C;

if(miner.click)[MinerClickedTellHowToTrainEvent]

MinerClickedTellHowToTrainEvent::;
msg:P4D;
qmsg:P4E;
MinerClickedTellHowToTrainEventContinue

# we do not have a very good check for If Miner Has Got Training
# we could check for them waltzing up to the support station but since we do not have RecallOL false
# the player can come down here with trained miners
# and kinda get stuck
# so we're gonna do this instead
# no I don't like it either 

MinerClickedTellHowToTrainEventContinue::;
truewait:1;
qmsg:P4F;
truewait:1;
qmsg:P5A;
qmsg:P5B;

# at this point the STT should have a driver and we are ready to launch! hoo-ray

#  / ----------------------------- \
#  | --- SMALL TRANSPORT TRUCK --- |
#  \ ----------------------------- /

int SmallTruckInt=0
int SmallTruckUpgradedInt=0


if(VehicleSmallTransportTruck_C.driven)[SmallTruckEvent]

SmallTruckEvent::;
msg:STT1;
qmsg:STT2;
place:18,19,42; # Energy Crystal Seam
wait:0.1;
place:18,19,1;
wait:0.5;
pan:18,19;
qmsg:STT3;
((SmallTruckUpgradedInt==0))SmallTruckExplainUpgradesEvent;
((SmallTruckUpgradedInt==1))SmallTruckDoNotExplainUpgradesEvent;


SmallTruckExplainUpgradesEvent::;
SmallTruckInt=1;
qmsg:STT4;
qmsg:STT5;
qmsg:STT6;
qmsg:STT7;

SmallTruckDoNotExplainUpgradesEvent::;
qmsg:STT3b;
((UpgradeUpgradedInt==0))ExplainUpgradeStationUpgradingAltEvent;
((UpgradeUpgradedInt==1))SmallTruckWowYouUpgradedEverythingLetsJustMoveOnEvent


SmallTruckWowYouUpgradedEverythingLetsJustMoveOnEvent::;
qmsg:STT3c;
qmsg:STT12;
qmsg:STTEnd;
enable:VehicleHoverScout_C;
VehiclesDone+=1;


# qmsg:STT9;
# ((UpgradeUpgradedInt==0))qmsg:STT10;

# ((UpgradeUpgradedInt==1))



string STT1="Well done! The Small Transport Truck is a vehicle that excels at carrying resources to where they need to be."
string STT2="It is much faster than a Rock Raider and carries multiple resources at once. This makes it a useful vehicle in almost any scenario."
string STT3="It's already an effective vehicle, but it can be even more effective if it is Upgraded."
string STT3b="... which you've already done. Well, no need to explain that, then."
string STT3c="And you also upgraded the Upgrade Station, so no need for that either! You're flying through this."
string STT4="Nearly all vehicles can recieve upgrades that make them better at their existing task or provide additional functionality to the vehicle!"
string STT5="In the case of the Small Transport Truck, its upgrades are simple: even more speed and even more cargo space."
string STT6="To upgrade a vehicle, you need a powered Upgrade Station and plenty of Ore." 
string STT7="Click on the vehicle to select it, select Upgrade Vehicle, and then your pick of the upgrades!"

#  / -------------------------------- \
#  | WHOOPS SUDDENLY UPGRADE STATION  |
#  \ -------------------------------- /

string STT8="Well done, the Small Transport Truck is now even more effective at its simple yet important job of ferrying resources to where they need to be."
string STT9="Did you find the upgrade process a little slow? By upgrading the Upgrade Station itself, upgrades will be done even quicker!"
string STT10="Upgrading the Upgrade Station is like any other building: click on it and select Upgrade Building. Do this now."

string STT9a="Did you find the upgrade process a little slow? By upgrading the Upgrade St- wait, you already did that."
string STT9b="Yes, I can hear you snickering, saying 'I upgraded the upgrade station to upgrade my rate of upgrading upgrades.' Very funny, Cadet."
# string STT9c # couldn't think of anything funny to put here
# string STTEndAlt="Well, that's all for the Small Transport Truck! Let's move onto the next Small Vehicle, the Hover Scout. Teleport one down from the Vehicles menu when you're ready to move on!"

string STT11="Well done, the Upgrade Station has been upgraded! Keep an eye out for what other upgrades vehicles might have access to."
string STT12="There's one more thing you need to know: the Upgrade Station is also able to repair vehicles that have taken damage."
string STTEnd="That's all for the Small Transport Truck and the Upgrade Station! Let's move onto the next Small Vehicle, the Hover Scout. Teleport one down from the Vehicles menu when you're ready!"


# building UpgradeSt=16,23
int UpgradeUpgradedInt=0 # upgrade station

# if(VehicleSmallTransportTruck_C.upgraded)[DebugEventChainA]
# if(VehicleSmallTransportTruck_C.levelup)[DebugEventChainB]
# if(VehicleSmallTransportTruck_C.upgrade)[DebugEventChainC]
# turns out it's Option C

when(VehicleSmallTransportTruck_C.upgrade)[STTUpgradedWhatDo] 
# we need several checks to fire off this, which is what I call WhatDo events
# they call several sets of conditionals to work out what to do.

STTUpgradedWhatDo::;
SmallTruckUpgradedInt=1;
((SmallTruckInt==1))SmallTruckUpgradedAtReasonableTimeWhatDo

SmallTruckUpgradedAtReasonableTimeWhatDo::;
((UpgradeUpgradedInt==0))SmallTruckUpgradedAtReasonableTimeEvent;
((UpgradeUpgradedInt==1))SmallTruckNoNeedToTellThemAboutUpgradingTheUpgradeStationEvent;


SmallTruckUpgradedAtReasonableTimeEvent::;
msg:STT8;
SmallTruckInt=2;
qmsg:STT9;
qmsg:STT10;


# this is called when you already upgraded the STT but not yet the upgrade station
ExplainUpgradeStationUpgradingAltEvent::;
SmallTruckInt=2;
qmsg:STT9;
qmsg:STT10;

# this is called when you upgrade the STT & the upgrade station is already upgraded
SmallTruckNoNeedToTellThemAboutUpgradingTheUpgradeStationEvent::;
SmallTruckInt=3; # to prevent STTUpgradedWhatDo from firing again
msg:STT8;
qmsg:STT9a;
qmsg:STT9b;
qmsg:STT12;
qmsg:STTEnd;
enable:VehicleHoverScout_C;
VehiclesDone+=1;


if(BuildingUpgradeStation_C.levelup)[UpgradeStationUpgradedCheckWhatDo]

UpgradeStationUpgradedCheckWhatDo::;
UpgradeUpgradedInt=1;
((SmallTruckInt==2))UpgradeStationUpgradedAtReasonableTimeEvent;
# ow, my brain (addendum: don't worry, it gets worse. waaaay worse)


# ((SmallTruckInt==0))UpgradeStationWasAlreadyUpgradedEvent;

UpgradeStationUpgradedAtReasonableTimeEvent::;
msg:STT11;
qmsg:STT12;
qmsg:STTEnd;
enable:VehicleHoverScout_C;
VehiclesDone+=1;










#  / ----------------------------- \
#  | -------- HOVER SCOUT -------- |
#  \ ----------------------------- /




if(VehicleHoverScout_C.New)[HoverScoutEvent]
#if(HoverScoutRef.driven)[HoverScoutEvent]
int HoverScoutPuzzle=0
int HoverScoutPuzzleTwo=0
#vehicle HoverScoutRef=0

# if(VehicleHoverScout_C>0)((AnySmallVehiclesYet==0))[HoverScoutIntroEvent]
# if(VehicleHoverScout_C>0)((AnySmallVehiclesYet>0))[HoverScoutRegularEvent]

# read: (Hover Scout) 1
string HS1="The Hover Scout is a fast and nimble vehicle. It only costs one crystal and is the only vehicle to not require training to drive."
string HS2="This makes it useful for quickly getting a miner to an area you want, which can be very useful when controlling a Rock Raider directly."
string HS3="In addition to moving speedily, it has one ability that your Rock Raiders cannot do: it is able to jump over an impassable tile."
string HS4="Look at this Energy Crystal. Rock Raiders aren't able to walk over this gap, so they wouldn't be able to collect it: but the Hover Scout can jump over the corner of the walls to land safely."
string HS5="To get this Energy Crystal out of here, first you'll need to move the Hover Scout close to the wall so it can make the jump."

string HSA1="The easiest way to use the vehicle's jump ability is to give it a move order to the place you want it to jump."
string HSA2="Other methods include doubleclicking on the vehicle and using SPACE when direct controlling the vehicle."
string HSA3="Using any of those methods, let's get into that cavern!"


string HSC1="Well done, your Hover Scout has made it into this small cavern! Now to get the crystal out of here..."
string HSC2="While the Hover Scout doesn't have a dedicated cargo hold, all vehicles have one manual carry capacity."
string HSC3="This means that if a Rock Raider is holding a resource, and they are manually ordered to get in a vehicle, they will take the resource with them in the vehicle. This allows you to slowly transport resources across gaps like these."
string HSC4="To do this, you'll first need to get the driver out of the vehicle by clicking on it and selecting Exit Vehicle..."
string HSC5="... then tell them to pick up the resource..."
string HSC6="... then get back in the vehicle..."
string HSC7="and finally jump back through the gap with the crystal."

string HSD1="Well done! The Hover Scout has made it back safely with one crystal in tow."
string HSD2="To finally get the crystal into storage, you'll need to get the Rock Raider out of the vehicle one last time so they can deposit it."

string HSE1="Well done, you've collected an Energy Crystal!"
string HSE2="There are other crystals around that might be accessible via a combination of the jump and one manual carry capacity. See if you can collect them."
string HSE3="Otherwise, we can move onto the next vehicle: the Small Digger. Teleport one down when you're ready to move on!"

# string HSN="Well done, you've collected another Energy Crystal!"


# string HSF1="Well done Cadet, you've learnt all you need to know about the Hover Scout as well as the basics of controlling vehicles!"
# string HSF2="Teleport down any other vehicle so you can learn about it too."


HoverScoutEvent::;
savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol; # you'll be seeing this code quite a bit, handy copypaste job
msg:HS1;
qmsg:HS2;
qmsg:HS3;
qmsg:HS4;
pan:28,29;
showarrow:28,29,AnyArrow;
qmsg:HS5;
pan:24,25;
highlightarrow:26,27,AnyArrow;
HoverScoutPuzzle+=1;

when(enter:26,27,VehicleHoverScout_C)[HoverScoutIsOnEntranceTileEvent]

HoverScoutIsOnEntranceTileEvent::;
((HoverScoutPuzzle==1))HoverScoutIsCloseEvent;
((HoverScoutPuzzleTwo==4))HoverScoutHasExitedEvent;

# this allows for multiple things to fire off the one overlap trigger

HoverScoutIsCloseEvent::;
hidearrow:AnyArrow;
HoverScoutPuzzle+=1; # so it should be 2, except it turns to 3 for some reason
msg:HSA1;
qmsg:HSA2;
qmsg:HSA3;
HoverScoutPuzzleTwo+=1;

# only fire once
if(enter:27,28,VehicleHoverScout_C)[HoverScoutPuzzleTwo+=1]

# so text has finished AND is in cavern
if(HoverScoutPuzzleTwo==2)[HoverScoutIsInCavernEvent]

HoverScoutIsInCavernEvent::;
msg:HSC1;
qmsg:HSC2;
qmsg:HSC3;
qmsg:HSC4;
qmsg:HSC5;
qmsg:HSC6;
HoverScoutPuzzleTwo+=1;

when(VehicleHoverScout_C.driven)((HoverScoutPuzzleTwo==3))[HoverScoutHasCrystalAndDriverEvent]

HoverScoutHasCrystalAndDriverEvent::;
msg:HSC7;
HoverScoutPuzzleTwo+=1; # should be 4

HoverScoutHasExitedEvent::;
HoverScoutPuzzleTwo+=1; # should be 5
msg:HSD1;
qmsg:HSD2;
truewait:8;
((HoverScoutPuzzleTwo==5))HoverScoutCrystalBackHomeEventTimeout

when(crystals>0)((HoverScoutPuzzleTwo==5))[HoverScoutCrystalBackHomeEvent] # here be crystals check

HoverScoutCrystalBackHomeEventTimeout::;
HoverScoutPuzzleTwo+=1;
msg:HSE2;
HoverScoutCrystalBackHomeEventContinued;

HoverScoutCrystalBackHomeEvent::;
HoverScoutPuzzleTwo+=1;
msg:HSE1;
qmsg:HSE2;
HoverScoutCrystalBackHomeEventContinued;

HoverScoutCrystalBackHomeEventContinued::;
qmsg:HSE3;
enable:VehicleSmallDigger_C;
VehiclesDone+=1;








#  / ----------------------------- \
#  | ------- SMALL DIGGER  ------- |
#  \ ----------------------------- /



int SDWalls=0
int SDA=0
int SDB=0


string SD2="The Small Digger is an agile vehicle that drills walls much faster than a Rock Raider could. It is also able to drill Hard Rock!"
string SD3="Let's try it out on some of the walls near here. Like miners, you can either give it a direct order by selecting the vehicle and clicking on the wall, or by selecting the wall and giving it a drill order."
string SD4="If you wanted to increase the Small Digger's drilling speed, you could upgrade it or teleport down additional Small Diggers to help it out."

string SD5="There isn't really all that much else to say about it: it's a cost-efficient drilling vehicle that never stops for sandwiches."
string SD6="Let's move onto the Small Mobile Laser Cutter. Teleport one down when you feel ready."


if(VehicleSmallDigger_C.New)[SmallDiggerEvent]

SmallDiggerEvent::;
msg:SD2;
SmallDiggerDrivenEvent;

# if(VehicleSmallDigger_C.driven)[SmallDiggerDrivenEvent]
# the check for small digger mostly just meant everything could fly too fast before you finished reading it

SmallDiggerDrivenEvent::;
savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
qmsg:SD3;
pan:23,20;
place:23,20,26;
place:24,20,26;
place:21,19,26;
place:22,19,46;
place:23,19,34;
place:24,19,30;
place:21,18,30;
place:22,18,30;
place:23,18,34;

if(drill:24,20)[SDWalls+=1] # covers 23,20 and 24,20
if(drill:21,19)[SDWalls+=1]
if(drill:22,19)[SDWalls+=1]
if(drill:23,19)[SDWalls+=1]
if(drill:24,19)[SDWalls+=1]
if(drill:21,18)[SDWalls+=1]
if(drill:22,18)[SDWalls+=1]
if(drill:23,18)[SDWalls+=1]

when(SDWalls>0)[SDWallDugCheckEvent]

SDWallDugCheckEvent::;
((SDWalls>1))SDWallAEvent;
((SDWalls>3))SDWallBEventCheck


SDWallAEvent::;
((SDA==0))msg:SD4;
SDA=1;
truewait:14; # timeout 
((SDB==0))SDWallBEvent;


SDWallBEventCheck::;
NothingInt=1;
((SDB==0))SDWallBEvent

SDWallBEvent::;
SDB=1;
msg:SD5;
qmsg:SD6;
enable:VehicleSMLC_C;
VehiclesDone+=1;



#  / ----------------------------- \
#  | - SMALL MOBILE LASER CUTTER - |
#  \ ----------------------------- /

int SmallCutterPuzzle=0
int SMLCCheeseInt=0
int SMLCWalls=0
int SmallCutterDone=0 
# There would be a way to combine all these variables into just a single one or two and clever checking of 10s & 100s, but I can't quite see it / cannot be bothered
# this isn't LRR, we have variable slots aplenty

# Note: Click fires on the doubleselect to activate laser mode too 

# Note #2: .click does not fire when a vehicle is clicked on as the target of a pickup order

string SC1="The Small Mobile Laser Cutter is a vehicle quite unlike Rock Raiders on foot. The laser cutter it carries is a powerful tool, with range that no standard drills can match." 
string SC2="Once it's got a driver, it can be ordered to drill walls like regular drilling equipment. But this is not what makes laser cutters special."
string SC3="Lasers can be manually controlled: either by clicking on them twice or by pressing X. This will activate the laser aboard the vehicle and allow it to be aimed directly!"
string SC4="To get out of laser mode, either use right mouse button, Escape, or X. If in direct control, press X again."
string SC5="Let's send the Small Mobile Laser Cutter over here to laser these walls. Reminder: doubleclick to activate, click a third time to fire, Esc to cancel."
string SC6="Laser shots require so much power that they can drain the power right out of Energy Crystals! All lasers have a 'free range' within which taking a shot will require no crystals. Outside of this range the cost to fire increases to a maximum of one crystal."
string SC7="Drained crystals will be output at the Power Station. But the power they contain is not lost forever: if there is Recharge Seam around, the crystals can be recharged there for use again."

string SC8="Lasers are very destructive and will damage mining equipment in addition to destroying walls, so aim them carefully!"

string SC9="Lasers do more than drilling at a range: they are able to demolish walls that regular drilling equipment can't access, such as corner walls."
string SC10="Consider this Dirt Wall: your drilling machines are unable to reach it."
string SC11="However, your laser vehicles will make short work of the wall: move your SMLC over and fire away!"
string SC11a="However, your laser vehicles will make short work of the wall ... as you've already noticed. You're getting ahead of yourself, Cadet! Let's move onto the Mining Laser, although I'm sure you'll work out how to use it quickly."
string SC11b="... or your laser buildings, in this case. Even though telling you about the Mining Laser seems pointless as you know how to use it, I think you might find some of the ... more subtle aspects interesting. Pardon me if you know it already, but in my defense, these are the tutorials after all."


string SCB1="Well-aimed shots can open up access to new areas, like the laser shot you just made: you no longer need to use a jumping vehicle to get in."
string SCB2="Keep an eye out for any laserable walls: there might be valuable Energy Crystals behind them!"

string SCC1="The Mining Laser has a much more powerful laser than the Small Mobile Laser Cutter, but shares the same characteristics and controls."
string SCC2="While it is immobile, its cheap cost, large free range, and great drilling power means it still holds its own compared to mobile vehicles."
string SCC3="In addition, it's possible to fire multiple Mining Lasers simultaneously. First, select both Mining Lasers with either a dragbox or by holding SHIFT..."
string SCC4="... then either press X or click on them one by one; and start blasting!"
string SCC5="... and start blasting!" # unused
string SCC6="This is a powerful usage for lasers, but it gets even better: you can assign them to a Control Group so you can activate them anytime."
string SCC7="Like other games, assigning units to a control group is done with Ctrl+X, where X is a number from 0-9."
string SCC8="You can then immediately select these units from anywhere by pressing the associated number, or double-press the number to select them and jump to them from anywhere on the map."
string SCC9="You also get popups above the resource panel that are colorcoded with the type of control group."
string SCC10="All of this is also relevant to units too, but you cannot mix and match miners, vehicles, and buildings in a selection group."
string SCC11="However, you are able to filter-select: if you click-and-drag a selection box with Left Mouse Button, it will normally default to selecting miners. However Left SHIFT will select only vehicles, Left Control will select only miners, and Left Alt will select only buildings."
string SCC12="Feel free to try it out, but it's hard to script a proper check for this beyond just waiting around, so click > when you've got the hang of it! (And press < if you want the explanations again)"
string SCC12b="Sure you've got the hang of it and didn't accidentally hammer > one too many times? Yes? Alright then!"
string SCC12c="Let's move onto the next vehicle, the Rapid Rider! Teleport one down!"

string SCBonus4="This is the Mining Laser. We'll get to them in a bit. If you really wanna try things out early, click on them again to activate their laser, and either right-click or Esc to deactivate."
string SCBonus5="You'll learn more about them in due time. For now, pay attention to what you were supposed to be doing :p" 



string SCBonus1="Hey, I haven't told you that you can hit corner walls with a laser yet!"
string SCBonus2="Look at you, getting ahead of yourself. You'll be raiding those rocks in no time. As I was saying- Ahem!"

# I love convoluted naming conventions
string SCBonusBonus1="And I haven't even told you about the lasers yet. You're really going fast!"

string SCBonus3="Oi! Those walls are for the Mining Laser tutorial. No touchy! Or do touchy, I can't stop you."

string SCBonus6="You've lost one of the Mining Lasers! The Mining Laser tutorial is impossible to complete now, and I am NOT writing script checks to abort for every single progression point when you could have done this. (Think I'm wimping out? Load the level file yourself & scroll down to the script section.) Just know that at some point in time you might not be able to finish it. Oh well. Let's move onto the Rapid Rider: teleport one down and try not to break its tutorial too?"


if(VehicleSMLC_C.new)[SMLCEvent]

SMLCEvent::;
savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:SC1;
qmsg:SC2;
qmsg:SC3;
qmsg:SC4;
qmsg:SC5;
place:16,28,26;
place:17,28,26;
place:18,28,26;
place:18,29,30;
place:18,30,46;
SmallCutterPuzzle=1;
pan:17,27;
showarrow:17,28,AnyArrow;

if(laserhit:16,28)[SMLCWalls+=1]
if(laserhit:17,28)[SMLCWalls+=1]
if(laserhit:18,28)[SMLCWalls+=1]

if(drill:16,28)[SMLCWalls+=10]
if(drill:17,28)[SMLCWalls+=10]
if(drill:18,28)[SMLCWalls+=10]
if(drill:18,29)[SMLCWalls+=10]

int ArrowBodgeInt=0

when(SMLCWalls>0)((SmallCutterPuzzle==1))[SMLCLaserHitEvent][ArrowBodgeEvent]

ArrowBodgeEvent::;
((ArrowBodgeInt==0))hidearrow:AnyArrow;
ArrowBodgeInt=1; # needed for if you complete the second half of the laser tutorial before the first half, which causes the arrow to never disappear

SMLCLaserHitEvent::;
hidearrow:AnyArrow;
SmallCutterPuzzle=2;
msg:SC6;
qmsg:SC7;

when(SMLCWalls>10)((SmallCutterPuzzle==2))[SMLCLaserDrilledEvent]

SMLCLaserDrilledEvent::;
SmallCutterPuzzle=3;
msg:SC8;
truewait:12;
((SmallCutterPuzzle==3))SMLCWalls+=20;

when(SMLCWalls>30)((SmallCutterPuzzle==3))[SMLCMostWallsClearedEvent]

SMLCMostWallsClearedEvent::;
SmallCutterPuzzle=4;
msg:SC9;
qmsg:SC10;
showarrow:24,28,AnyArrow;
pan:24,28;
((SMLCCheeseInt==0))qmsg:SC11;
((SMLCCheeseInt==1))qmsg:SC11a;
((SMLCCheeseInt==1))SMLCTutorialIsDoneOntoMiningLaserSplitB;
((SMLCCheeseInt==2))qmsg:SC11b;
((SMLCCheeseInt==2))SMLCTutorialIsDoneOntoMiningLaserSplitB;

if(drill:24,28)((SmallCutterPuzzle==4))[SMLCCornerHitEvent][SMLCCornerHitEventEarly]

SMLCCornerHitEvent::;
SmallCutterPuzzle=5;
hidearrow:AnyArrow;
msg:SCB1;
qmsg:SCB2;
truewait:10;
((SMLCCheeseInt!=2))SMLCCornerHitEventDoublecheck

SMLCCornerHitEventDoublecheck::;
((SmallCutterDone==0))SMLCTutorialIsDoneOntoMiningLaserSplitA;
# The SmallCutterDone check ensures that the timeout will not cause it to fire again
# It would be fully possible to check this via SmallCutterPuzzle equals SIX instead of needing an entire int just for it 
# but I don't want to poke this too much 
# DANG YOU WHITESPACE


SMLCCornerHitEventEarly::;
SMLCCheeseInt=1;
msg:SCBonus1;
((SmallCutterPuzzle>0))SMLCCheeseInt=1; # set to 1 if SMLC is already in play
((SmallCutterPuzzle>0))qmsg:SCBonus2;
((SmallCutterPuzzle>0))SMLCCornerHitEvent;
((SmallCutterPuzzle==0))SMLCCheeseInt=2; # set to 2 if SMLC is not already in play & this was done by Mining Laser
((SmallCutterPuzzle==0))qmsg:SCBonusBonus1;





if(drill:23,30)[SMLCSecondCornerHitEvent]

SMLCSecondCornerHitEvent::;
truewait:2;
((SMLCCheeseInt!=2))SMLCSecondCornerHitEventDoubleCheck; #so do not fire this if the wall was drilled via non-SMLC means (as we call the mining laser event elsewhere in this case)

SMLCSecondCornerHitEventDoubleCheck::;
NothingInt=0;
((SmallCutterDone==0))SMLCTutorialIsDoneOntoMiningLaserSplitA;

#  / ----------------------------- \
#  | WHOOPS SUDDENLY MINING LASER  |
#  \ ----------------------------- /

building MiningLaserOne=13,22
building MiningLaserTwo=14,21
int MiningLaserPuzzle=0
int MiningLaserClickedA=0
int MiningLaserClickedB=0 #there is a more efficient way to combine these three variables but it eludes me
int MiningLaserWalls=0
int MiningLaserPatience=0 # needed for a single check
int MiningLaserCompleted=0 # also needed for a single check
# wow this is a mess huh

if(MiningLaserOne.dead)((MiningLaserCompleted==0))[MLDown]
if(MiningLaserTwo.dead)((MiningLaserCompleted==0))[MLDown]

MLDown::;
msg:SCBonus6;
((MiningLaserCompleted==0))VehiclesDone+=1; # backup, and the MiningLaserCompleted check ensures that this will not doublefire
MiningLaserCompleted=2;
enable:VehicleRapidRider_C;


# if(SMLCWalls>100)[SMLCTutorialIsDoneOntoMiningLaserSplitA]


# split is needed for just a single msg/qmsg change...
SMLCTutorialIsDoneOntoMiningLaserSplitA::;
SmallCutterDone=1;
hidearrow:AnyArrow;
SmallCutterPuzzle=6;
MiningLaserPuzzle=1;
msg:SCC1;
pan:13,21;
SMLCTutorialIsDoneOntoMiningLaserContinue;

SMLCTutorialIsDoneOntoMiningLaserSplitB::;
hidearrow:AnyArrow;
SmallCutterPuzzle=6;
MiningLaserPuzzle=1;
SmallCutterDone=1;
qmsg:SCC1;
pan:13,21;
SMLCTutorialIsDoneOntoMiningLaserContinue;

SMLCTutorialIsDoneOntoMiningLaserContinue::;
qmsg:SCC2;
qmsg:SCC3;

when(MiningLaserOne.click)[MLOneClicked]
when(MiningLaserTwo.click)[MLTwoClicked]

MLOneClicked::;
NothingInt=0;
((MiningLaserPuzzle==0))PatienceMyYoungPadawan;
((MiningLaserPuzzle>0))MiningLaserOneSelected

MLTwoClicked::;
NothingInt=0;
((MiningLaserPuzzle==0))PatienceMyYoungPadawan;
((MiningLaserPuzzle>0))MiningLaserTwoSelected

MiningLaserOneSelected::;
NothingInt=0;
((MiningLaserClickedA==0))MiningLaserPuzzle+=1;
MiningLaserClickedA=1;

MiningLaserTwoSelected::;
NothingInt=0;
((MiningLaserClickedB==0))MiningLaserPuzzle+=1;
MiningLaserClickedB=1;

PatienceMyYoungPadawan::;
((MiningLaserPatience==0))PatienceMyYoungPadawanActually

PatienceMyYoungPadawanActually::;
MiningLaserPatience=1;
msg:SCBonus4;
qmsg:SCBonus5;



if(MiningLaserPuzzle==3)[MLBothSelectedHopefullyEvent]
MLBothSelectedHopefullyEvent::;
MiningLaserPuzzle+=1;
msg:SCC4;
wait:8; # timeout
MiningLaserWalls+=4;

when(laserhit:13,18)[MiningLaserWallHitEvent]
when(laserhit:12,18)[MiningLaserWallHitEvent]
when(laserhit:11,18)[MiningLaserWallHitEvent]
when(laserhit:11,19)[MiningLaserWallHitEvent]

MiningLaserWallHitEvent::;
NothingInt=0;
((MiningLaserPuzzle==0))msg:SCBonus3;
((MiningLaserPuzzle==4))MiningLaserWalls+=1;

if(MiningLaserWalls>1)[MiningLaserSomeWallsEvent]

MiningLaserSomeWallsEvent::;
MiningLaserPuzzle+=1;
msg:SCC6;
qmsg:SCC7;
qmsg:SCC8;
qmsg:SCC9;
qmsg:SCC10;
qmsg:SCC11;
qmsg:SCC12;
truewait:1;
qmsg:SCC12b;
qmsg:SCC12c;
((MiningLaserCompleted==0))enable:VehicleRapidRider_C;
((MiningLaserCompleted==0))VehiclesDone+=1;
((MiningLaserCompleted==0))MiningLaserCompleted=1;

#  / ----------------------------- \
#  | -------- RAPID RIDER -------- |
#  \ ----------------------------- /


# Rapid Rider

string RR1="Being a water vehicle, the Rapid Rider is teleported down at the Docks instead of the Teleport Pad. It also means it requires a Sailor to control it."
string RR2="It will automatically dropoff resources it finds at the Docks, where they can be transported back by land."
string RR3="Combined with the one manual carry capacity that all vehicles have, it is effective if slow at transporting resources across water."

string RRB1="Let's pick up this crystal using the Rapid Rider."
string RRB2="First, you'll need a Rock Raider trained as a Sailor. Then you'll need to give the Rapid Rider a move order adjacent to the shoreline..."
string RRB3="... then select the Rapid Rider and select Get Out Of Vehicle..."
string RRB4="... then pick up the resource with the Rock Raider..."
string RRB5="... and lastly, get back in the vehicle."
string RRB6="The Rapid Rider will then zoom on home and drop off the resource at the Docks."

string RRC1="But that's not all the Rapid Rider can do."
string RRC2="The Rapid Rider can also be upgraded at the Docks to gain the capability to drill walls!" 
string RRC3="While the drill upgrade is weak, this allows for walls adjacent to the water to be drilled, walls that could not be drilled using conventional methods."
string RRC3b="... is what I WOULD say if you hadn't already taken them down with a laser shot."
string RRC3b2="Congratulations, you're making the already borderline worthless Rapid Rider redundant even in the TUTORIALS. Can't you give it a break?"
string RRC3b3="I was going to tell you how to upgrade it, but not only is that pointless now the walls are gone, but I'm sure someone as clever as you can navigate the Upgrade Menu too."
string RRC4="Upgrade the Rapid Rider by selecting it, then selecting Upgrade Vehicle, then select the Add Drill! (You also can upgrade its Cargo Hold if you like!)"

string RRD1="Now try it out on these walls!"
string RRD2="You've uncovered several Energy Crystals and pieces of Ore! Carrying these back one at a time would be very tedious."
string RRD2b="On the island you drilled earlier, you uncovered several Energy Crystals and pieces of Ore! Carrying these back one at a time would be very tedious."
string RRD3="However, there is a quicker method! If you park the Rapid Rider by the shore and get the Rock Raider onto the land where the resources are..."
string RRD4="... then select the Rock Raider..."
string RRD5="... and directly control them, then you can pick up resources with F and toss them into the water using G."
string RRD6="Once all of the resources are tossed into the water, you can get back in the Rapid Rider, leave direct control mode, and the Rapid Rider will automatically pick up any it can reach and deposit them at the Docks."

string RRE1="Thought that was all the Rapid Rider had? Think again!"
string RRE2="The Rapid Rider also comes with the same Jump ability the Hover Scout has. Like the Hover Scout, it can be activated by doubleclicking on the Rapid Rider, or using SPACE in first person."
string RRE3="This allows for even more manouverability in tight spaces, although it is admittedly rare to find a scenario where this is needed."
string RRE4="But you could use it to get this crystal, for instance."

string RRE5="That's the extensive functionality of the Rapid Rider all wrapped up. Let's look at the last Small Vehicle: the Tunnel Scout!"

string RRBonus="You've built another Docks! There wasn't any real need for that, but more buildings never hurts anything except your power."
string RRBonus2="This will change where the Rapid Rider goes and as a result might cause things to misbehave. There are failsafes, but if you find things aren't progressing when they ought, try moving the Rapid Rider to the original Docks' location."
string RRBonus3="If you're thoughtful enough to throw down a second Docks, I'm sure you'll have no issue navigating this mission!"

# 28,24


int RapidRiderInt=0
int RapidRiderIntB=0

arrow RapidRiderDocksArrow=blue

int RapidRiderWallCheeseInt=0
int RapidRiderUpgradeInt=0 # used for if upgrade happened earlier

when(enter:28,24,VehicleRapidRider_C)[RapidRiderIsAtDocksWhatDoEvent]

if(VehicleRapidRider_C.new)[RapidRiderIsAtDocksWhatDoDelayEvent] # this is needed in case Rapid Rider teleports down somewhere ELSE
RapidRiderIsAtDocksWhatDoDelayEvent::;
wait:0.1;
((RapidRiderInt==0))RapidRiderTeleportedDownEvent;

when(VehicleRapidRider_C.driven)[RapidRiderHasADriverWhatDoEvent]

RapidRiderIsAtDocksWhatDoEvent::;
((RapidRiderInt==0))RapidRiderTeleportedDownEvent;
((RapidRiderInt==4))RapidRiderDrillUpgradeEvent;
((RapidRiderInt==8))RapidRiderJumpExplainEvent;

RapidRiderHasADriverWhatDoEvent::;
((RapidRiderInt==3))RapidRiderZoomHomeEvent;

when(drill:31,20)[IslandDrilledWhatDoEvent]

IslandDrilledWhatDoEvent::;
((RapidRiderInt==6))RapidRiderDrilledWallEvent;
((RapidRiderInt!=6))RapidRiderWallCheeseInt=1;

# introduction
RapidRiderTeleportedDownEvent::;
RapidRiderInt=1;
pan:28,24;
msg:RR1;
qmsg:RR2;
qmsg:RR3;
qmsg:RRB1;
pan:35,21;
qmsg:RRB2;
highlight:33,22,AnyArrowTwo;
highlightarrow:33,21,AnyArrowOne;
highlight:33,20,AnyArrowThree;
RapidRiderInt=2;

when(enter:33,22,VehicleRapidRider_C)((RapidRiderInt==2))[RapidRiderIntB+=1]
when(enter:33,21,VehicleRapidRider_C)((RapidRiderInt==2))[RapidRiderIntB+=1]
when(enter:33,20,VehicleRapidRider_C)((RapidRiderInt==2))[RapidRiderIntB+=1]

if(RapidRiderIntB>0)[RapidRiderIsByShoreEvent]

# move to shore, get out, pick up crystals
RapidRiderIsByShoreEvent::;
RapidRiderInt=3;
hidearrow:AnyArrowOne;
hidearrow:AnyArrowTwo;
hidearrow:AnyArrowThree;
msg:RRB3;
qmsg:RRB4;
qmsg:RRB5;

# get back in vehicle
RapidRiderZoomHomeEvent::;
RapidRiderInt=4;
msg:RRB6;
truewait:8;
((RapidRiderInt==4))RapidRiderDrillUpgradeEvent; # this timeout catches if it went to a DIFFERENT docks


# can be upgraded to drill walls
RapidRiderDrillUpgradeEvent::;
RapidRiderInt=5;
msg:RRC1;
qmsg:RRC2;
RapidRiderInt=6;
qmsg:RRC3;
((RapidRiderWallCheeseInt==1))RapidRiderGetAngryAtWallCheeseEvent; # well maybe Sassy would be a better word
((RapidRiderWallCheeseInt==0))RapidRiderNoWallCheeseEvent;

RapidRiderNoWallCheeseEvent::;
((RapidRiderUpgradeInt==0))qmsg:RRC4;
((RapidRiderUpgradeInt==1))qmsg:RRD1; # these fire if the upgrading already happened earlier 
((RapidRiderUpgradeInt==1))pan:30,20;
((RapidRiderUpgradeInt==1))showarrow:31,21,AnyArrow;

RapidRiderGetAngryAtWallCheeseEvent::;
qmsg:RRC3b;
pan:30,20;
qmsg:RRC3b2;
qmsg:RRC3b3;
RapidRiderDrilledWallEvent;

when(VehicleRapidRider_C.upgrade)[RapidRiderUpgradedWhatDoEvent]

RapidRiderUpgradedWhatDoEvent::;
((RapidRiderInt==6))RapidRiderUpgradedJustFineEvent;
((RapidRiderInt!=6))RapidRiderUpgradeInt=1;

RapidRiderUpgradedJustFineEvent::; # this fires if the upgrade proceeds at the usual time
msg:RRD1;
pan:30,20;
showarrow:31,21,AnyArrow;

# when this event chain is called all things should finally be back to normal with no silly edge cases that still need accounting for
# update: hahaha this was not the case
RapidRiderDrilledWallEvent::;
RapidRiderInt=7;
hidearrow:AnyArrow;
((RapidRiderWallCheeseInt==1))qmsg:RRD2b;
((RapidRiderWallCheeseInt==0))msg:RRD2;
qmsg:RRD3;
qmsg:RRD4;
qmsg:RRD5;
qmsg:RRD6;
RapidRiderInt=8;
truewait:16;
((RapidRiderInt==8))RapidRiderJumpExplainEvent;

RapidRiderJumpExplainEvent::;
RapidRiderInt=9;
msg:RRE1;
qmsg:RRE2;
qmsg:RRE3;
qmsg:RRE4;
pan:27,12;
qmsg:RRE5;
enable:VehicleTunnelScout_C;
VehiclesDone+=1;


when(BuildingDocks_C.new)[NewDocksWarnEventCheckOne]
NewDocksWarnEventCheckOne::((time>2))NewDocksWarnEventCheckTwo
NewDocksWarnEventCheckTwo::((RapidRiderInt!=9))NewDocksWarnEventCheckThree
NewDocksWarnEventCheckThree::((DocksWarnInt==0))NewDocksWarnEvent;

int DocksWarnInt=0

NewDocksWarnEvent::;
DocksWarnInt=1;
msg:RRBonus;
qmsg:RRBonus2;
pan:28,24;
highlightarrow:28,24,RapidRiderDocksArrow;
qmsg:RRBonus3;
hidearrow:RapidRiderDocksArrow;


#  / ----------------------------- \
#  | -------- TUNNEL SCOUT ------- |
#  \ ----------------------------- /


#string TS1="You have teleported down a Tunnel Scout. This aerial vehicle is able to fly over land, water, and lava, making it excellent for reaching new areas."
string TS1="The Tunnel Scout is a swift aerial vehicle that is able to fly over land, water, and lava, making it excellent for reaching new areas."
string TS2="Aerial vehicles require a Pilot, who can be trained at the Teleport Pad."
# string TS2b="I would give you a demonstration but I'm sure you can work out that a vehicle that can cross lava can, in fact, cross lava."

#string TS3="Well done, our Tunnel Scout now has a pilot. The Tunnel Scout's mobility is unmatched, but it also has another powerful piece of kit: its Drill upgrade!"
string TS3="The Tunnel Scout's mobility is unmatched, but it also has another powerful piece of kit: its Drill upgrade!"
string TS4="The Drill upgrade on the Tunnel Scout is weak - so weak that it won't automatically respond to Drill Wall orders, only responding to direct orders - but is one of the few ways to drill walls on the edge of a lava lake."
string TS5="In addition, the one manual carry capacity all vehicles have allow it to slowly retrieve resources from dangerous areas. This makes it a powerful utility vehicle."

string TS6="Furthermore, the one manual carry capacity also applies to Dynamite. It's slow but does allow you to dynamite otherwise-inaccessible Hard Rock across a lava lake."
string TS7="I won't make you suffer through a demonstration, partly because the script capacity for it doesn't really exist, but mostly because it's very slow to perform."
string TS8="It's a whole process: start by directly controling a raider, then get out dynamite from Tool Store, get in the Tunnel Scout, fly over, get out of the Tunnel Scout, walk up to wall and press F to detonate the dynamite. Finally, run away for safety."

string TSE2="With that, that is all the Small Vehicles covered!"
string TSE3="The Small Vehicles are inexpensive and effective, and an excellent complement to Rock Raiders on foot in the caverns of Planet U."
string TSE4="However, sometimes you need a bit more firepower than what the Small Vehicles are able to bring."
string TSE5="For that, the LMS Explorer has a selection of Large Vehicles available!"
string TSE6="These are slower, larger, bulkier, vehicles, but pack additional functionality and firepower that the poor Small Mobile Laser Cutter could only ever dream of."
string TSE7="Let's start with the only Large Vehicle to not require the Super Teleport: the Cargo Carrier! Teleport one down."

if(VehicleTunnelScout_C.New)[TunnelScoutEvent]
TunnelScoutEvent::;
savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:TS1;
qmsg:TS2;
TunnelScoutDrivenEvent;

# if(VehicleTunnelScout_C.driven)[TunnelScoutDrivenEvent] # this was mostly just causing shenanigans of the text to go by too fast if somebody got in it & you were still reading
# so I've depreciated all of them
TunnelScoutDrivenEvent::;
qmsg:TS3;
qmsg:TS4;
qmsg:TS5;
qmsg:TS6;
qmsg:TS7;
qmsg:TS8;
truewait:3;# I don't like this but I can't think of anything better
AllSmallVehiclesDoneMonologueEvent;

AllSmallVehiclesDoneMonologueEvent::;
qmsg:TSE2;
qmsg:TSE3;
qmsg:TSE4;
qmsg:TSE5;
qmsg:TSE6;
qmsg:TSE7;
enable:VehicleCargoCarrier_C;
VehiclesDone+=1;


#  / ----------------------------------------------- \
#  | ---------- WOOHOO! THAT TOOK FOREVER ---------- |
#  | -- BUT IT'S NOT OVER YET. LARGE VEHICLE TIME -- |
#  \ ----------------------------------------------- /

# (I do wish it was over tho. This has taken FOREVERRRRR)


#  / ----------------------------- \
#  | -------- CARGO CARRIER ------ |
#  \ ----------------------------- /

int CargoCarrierInt=0
int CargoCarrierCheeseInt=0
int CargoCarrierDoneInt=0 # used for super teleport checks


# Cargo Carrier

string CC1="You have teleported down a Cargo Carrier. This large catamaran doesn't do anything on its own, but has the special ability to carry small vehicles over water."
string CC2="This isn't always the most useful, but sometimes getting a vehicle across a large lake is exactly what you need. Before we can use it, we'll need a Sailor to drive the Cargo Carrier."
string CC3="Once our Cargo Carrier has a Sailor, we'll load up the Small Digger to transport it across the water."
string CC4="First, park the Cargo Carrier next to land..."
string CC5="... click on the Cargo Carrier..." 
string CC6="... and click on the vehicle to pick up. Not all vehicles can fit on the Cargo Carrier."
string CC7="(There's no script check for this, so once you've loaded up a vehicle, hit > )"

string CCB1="Once the Cargo Carrier has picked up its vehicle, move it to the shoreline of its destination..."
string CCB2="... and select Unload Vehicle."
string CCB3="Well done, the vehicle has made it safely to the other side of the river. Your vehicle can now help out with drilling the nearby walls or even establishing a small outpost."
# string CCB3="Well done, the vehicle has made it safely to the other side of the river! You're now able to, well, do whatever really. As I said, not THAT useful."
# string CCB4="You can now go ham and drill all the walls you can eat." # really needs some better wording

string CCD1="But that's not all the Cargo Carrier can do."
string CCD2="If the Cargo Carrier is carrying a Small Mobile Laser Cutter, the laser is able to fire from aboard the Cargo Carrier!"
string CCD3="Take a look at this wall. It's impossible for any ground-based laser to hit it, and it's also impossible for the Rapid Rider's or Tunnel Scout's drill to reach it."
string CCD4="But the Small Mobile Laser Cutter when aboard the Cargo Carrier can! Load it up and get at it!"
string CCD5="Again, there isn't a script check for this, so hit > when the SMLC is onboard."
string CCD6="Once the Small Mobile Laser Cutter is aboard the Cargo Carrier, doubleclick on the Cargo-Carrier-Cutter combo to activate its laser, just like other lasers, and blast it!"

string CCE1="Well done, you've lasered the wall and opened up a new cavern!"
string CCE2="Caverns can often interconnect, so keep an eye out for any odd walls: although note that since this feature is new to Manic Miners, the Standard campaign which replicates LRR's levels will not make much use of it."

string CCEnd="That's it for the Cargo Carrier! Let's move onto the remaining Large Vehicles."

string CCSassy1="... is what I would say if you hadn't already drilled it."
string CCSassy2="Oh well, let's just move on to the next vehicle, the Loader Dozer. This requires a Super Teleport, so you'll need to construct one first."
string CCSassy3="Oh well, let's just move on to the next vehicle, the Loader Dozer. This requires a Super Teleport, which I'm not at all surprised to see you've already built. Let's just get on with it and teleport down a Loader Dozer."



if(VehicleCargoCarrier_C.new)[CargoCarrierEvent]

CargoCarrierEvent::;
msg:CC1;
pan:28,24;
qmsg:CC2;
qmsg:CC3;
pan:33,11;
qmsg:CC4;
pan:27,22;
qmsg:CC5;
CargoCarrierInt=1;
qmsg:CC6;
qmsg:CC7;
CargoCarrierGivenCargoOrderEvent;

# if(VehicleCargoCarrier_C.driven)[CargoCarrierDrivenEvent]
# could fire too quickly & send too many messages at once
CargoCarrierDrivenEvent::;




# AllowCargoCarrierClicks=1;

# OKAY SO

# .click is currently going up by 2 for some weird reason
# I'm not sure if I should script around this or what so I'm just going to
# Not Use It
# begin defunct script 

#when(VehicleCargoCarrier_C.click)[CargoCarrierClickedWhatDo] # was not working correctly

# when(VehicleCargoCarrier_C.click)((AllowCargoCarrierClicks==1))[CargoCarrierInt+=1]

# when(VehicleCargoCarrier_C.click)[Dbug+=1]

# must be in reverse order
CargoCarrierClickedWhatDo::;
((CargoCarrierInt==2))CargoCarrierInt+=1;
((CargoCarrierInt==1))CargoCarrierInt+=1;
# if(CargoCarrierInt==3)[CargoCarrierDoubleclickedEvent]

CargoCarrierDoubleclickedEvent::;
msg:CC6;
CargoCarrierInt+=1;
truewait:10;
CargoCarrierGivenCargoOrderEvent; # for if they didn't select a Small Digger or generally timed out

# when(VehicleSmallDigger_C.click)((CargoCarrierInt==4))[CargoCarrierGivenCargoOrderEvent] # this does not actually work , click does not fire when given a pickup order

# end of defunct script

CargoCarrierGivenCargoOrderEvent::;
qmsg:CCB1;
CargoCarrierInt=5;
pan:33,13;
highlight:33,13,AnyArrowTwo;
highlightarrow:34,13,AnyArrowOne;
highlight:35,13,AnyArrowThree;

when(enter:33,13,VehicleCargoCarrier_C)((CargoCarrierInt==5))[CargoCarrierEnteredAdjacentEvent]
when(enter:34,13,VehicleCargoCarrier_C)((CargoCarrierInt==5))[CargoCarrierEnteredAdjacentEvent]
when(enter:35,13,VehicleCargoCarrier_C)((CargoCarrierInt==5))[CargoCarrierEnteredAdjacentEvent]

CargoCarrierEnteredAdjacentEvent::;
CargoCarrierInt=6;
msg:CCB2;
hidearrow:AnyArrowOne;
hidearrow:AnyArrowTwo;
hidearrow:AnyArrowThree;
wait:10; # in case they don't realise to move it forward one tile (I would put the enter trigger on the tile, but it fires when the CC drives up to it)
((CargoCarrierInt==6))SomethingGotOffCCEvent;

when(enter:33,11)((CargoCarrierInt==6))[SomethingGotOffCCEvent]
when(enter:34,11)((CargoCarrierInt==6))[SomethingGotOffCCEvent]
when(enter:35,11)((CargoCarrierInt==6))[SomethingGotOffCCEvent]

SomethingGotOffCCEvent::;
msg:CCB3;
CargoCarrierInt=7;
truewait:7;
((CargoCarrierInt==7))CargoCarrierInt=8; # will fire the next event chain

# CargoCarrierLaserIntroEvent;

if(drill:32,10)((CargoCarrierInt==7))[CargoCarrierInt+=1]
if(drill:33,9)((CargoCarrierInt==7))[CargoCarrierInt+=1]
if(drill:35,8)((CargoCarrierInt==7))[CargoCarrierInt+=1]

if(CargoCarrierInt==8)[CargoCarrierLaserIntroEvent]

CargoCarrierLaserIntroEvent::;
CargoCarrierInt=9;
msg:CCD1;
qmsg:CCD2;
((CargoCarrierCheeseInt==0))CargoCarrierLaserContinueEvent;
((CargoCarrierCheeseInt==1))CargoCarrierDoNotTalkAboutLaserEvent;


CargoCarrierLaserContinueEvent::;
((CargoCarrierCheeseInt!=2))qmsg:CCD3;
((CargoCarrierCheeseInt!=2))pan:39,19;
((CargoCarrierCheeseInt!=2))showarrow:39,21,AnyArrow;
((CargoCarrierCheeseInt!=2))qmsg:CCD4;
((CargoCarrierCheeseInt!=2))hidearrow:AnyArrow;
((CargoCarrierCheeseInt!=2))pan:34,12; # where the CC probably is, we should probably vehicleref this but that also fails if it gets teleported up so EH
((CargoCarrierCheeseInt!=2))qmsg:CCD5;
((CargoCarrierCheeseInt!=2))qmsg:CCD6;
((CargoCarrierCheeseInt!=2))pan:39,19;
((CargoCarrierCheeseInt!=2))showarrow:39,21,AnyArrow;
((CargoCarrierCheeseInt!=2))CargoCarrierInt=10;
((CargoCarrierCheeseInt==2))CCCornerDrilledFine;

# this MESS of checking CheeseInt is NOT 2 is so if you laser it midway it STOPS

# when(VehicleSMLC_C.click)((CargoCarrierInt==9))[CargoCarrierOrderedToPickUpCutterEvent] # this does not work, click does not fire like this

# It is technically possible this wall is destroyed by either an absurdly precise Mining Laser shot or by the Tunnel Transport
# or just by lasering it before you're told WHICH WAS CAUSING NUISANCES DUE TO SETTING TO 9 AND CHECKING 11
when(drill:39,21)[CCCornerDrilledWhatDo]

CCCornerDrilledWhatDo::;
VehiclesDone+=1;
((CargoCarrierInt<9))CCCornerOutOfOrder;
((CargoCarrierInt==9))CCCornerJustASmidgeEarly;
((CargoCarrierInt==10))CCCornerDrilledFine;


CCCornerDrilledFine::;
CargoCarrierInt=12;
CargoCarrierDoneInt=1;
hidearrow:AnyArrow;
msg:CCE1;
qmsg:CCE2;
qmsg:CCEnd;
SuperTeleportIntroEvent;

CCCornerJustASmidgeEarly::;
CargoCarrierCheeseInt=2;

CCCornerOutOfOrder::;
CargoCarrierCheeseInt=1;

CargoCarrierDoNotTalkAboutLaserEvent::;
CargoCarrierDoneInt=1;
qmsg:CCSassy1;
enable:VehicleLoaderDozer_C;
((BuildingSuperTeleport_C==0))qmsg:CCSassy2;
((BuildingSuperTeleport_C>0))qmsg:CCSassy3;




#  / ----------------------------- \
#  | ------- SUPER TELEPORT ------ |
#  \ ----------------------------- /

# (short section)

string ST1="All the land-based Large Vehicles are so large the Teleport Pad cannot teleport them in!"
string ST2="You'll need to construct a Super Teleport using the resources you gathered before we are able to teleport them down."
string ST2b="... which you've already done. Well, let's get going! Let's start with the Loader Dozer. Teleport one down."

string STB1="Well done, you have constructed a Super Teleport!"
string STB2="Let's get started with the Large Vehicles. The first vehicle we'll examine is the Loader Dozer. Teleport one down."

# string STC1="We haven't even finished with the Small Vehicles and you've already built a Super Teleport? Talk about getting ahead of yourself."
string STC2="The Super Teleport is needed to teleport down Large Vehicles, but we haven't even finished with the Small Vehicles! Talk about getting ahead of yourself."

# building ref was used for pan event but then I realised I could save the vehicle not the building and just pan to THAT, so now defunct



int SuperTeleportCheeseInt=0 # is needed in the really silly edge case they teleport it up

SuperTeleportIntroEvent::;
qmsg:ST1;
qmsg:ST2;
((SuperTeleportCheeseInt==1))qmsg:ST2b;
((SuperTeleportCheeseInt==1))enable:VehicleLoaderDozer_C;

if(BuildingSuperTeleport_C.new)[SuperTeleportBuiltEvent]

SuperTeleportBuiltEvent::;
((CargoCarrierDoneInt==1))SuperTeleportBuiltNormalEvent;
((CargoCarrierDoneInt!=1))SuperTeleportBuiltEarlyEvent;

# we can't check for VehiclesDone due to issues whereby they can skip the tutorials by teleporting up the MLs which is semi-intended
# so we run a check for if the CC tutorial has finished

SuperTeleportBuiltEarlyEvent::;
SuperTeleportCheeseInt=1;
msg:STC2;

SuperTeleportBuiltNormalEvent::;
msg:STB1;
enable:VehicleLoaderDozer_C;
qmsg:STB2;



#  / ----------------------------- \
#  | -------- LOADER DOZER ------- |
#  \ ----------------------------- /

int LoaderDozerLaserInt=0

int LoaderDozerInt=0
int LDWallT=0 # Top & Bottom
int LDWallB=0
int LDWalls=0 # Total
int LDWallRT=0 # Reinforced Top, aka you actually did the puzzle normally
int LDWallRB=0 # Reinforced Bottom


string LD1="You have teleported down a Loader Dozer. This bulky vehicle easily deals with rubble and quickly clears it much faster than a Rock Raider could."
string LD2="It is also able to compact walls to reinforce them, preventing landslides from occuring."
string LD3="Combined with its immunity to landslide damage, this makes it a powerful vehicle easily able to drive into an unstable area and clean it all up."

string LDB1="Look at this unstable cavern, landsliding all the time. It would be far too dangerous for Rock Raiders or drilling equiment to wander in there."
string LDB2="But the Loader Dozer - once it's got a Driver - can drive right in! Select it with Left Mouse button, then click on a wall with Left Mouse button like you were giving it a drill order: but instead of drilling walls, the Loader Dozer reinforces them!"

string LDC1="Well, that works too. Why send any equiment into harm's reach when you could demolish it from range safely using laser equipment?"
string LDC2="Not only does that stop the wall from landsliding, the adjacent wall is now a corner wall that cannot landslide, and you don't even need to drill or reinforce it! Two birds, one laser."

string LDF1="Well, that works too. Why reinforce a dangerous wall, when you could simply get rid of it?" 
string LDF2="Not only does that stop the wall from landsliding, the adjacent wall is now a corner wall that cannot landslide, and you don't even need to drill or reinforce it! Two birds, one drill."

string LDG1="Well done, you've taken care of all the landsliding walls... by drilling them without the Loader Dozer's help."
string LDG2="Unlike the Rapid Rider or the SMLC, the Loader Dozer is actually pretty good at its job. So, even though you can get its job done with raiders with hammers, dynamite, or both, it's still a vehicle worth your crystals."
string LDG3="Let's just move onto the next vehicle, the Granite Grinder."

string LDE1="Well done, all the walls have been taken care of! Now it's safe to send our drilling equipment in." 
string LDE2="And speaking of drilling equipment, the next vehicle we want to take a look at is the Granite Grinder! Teleport one in, it's just what we need."

# string LDE1="That's one wall taken care of! Keep going and tidy them all up."
# string LDE2="Halfway there, halfway safe! If you haven't already, try driving the Loader Dozer around in direct control: just barge right into a wall to reinforce it."
# string LDE3="And that's the last of them! Now it's safe to send our drilling equipment in."




if(VehicleLoaderDozer_C.New)[LoaderDozerEvent]

LoaderDozerEvent::savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:LD1;
qmsg:LD2;
qmsg:LD3;
qmsg:LDB1;
pan:7,23;
place:7,23,63;
place:8,23,63;
place:9,23,63;
place:10,23,1;
place:11,23,1;
LoaderDozerInt=1;
qmsg:LDB2;

# 7,24 & 9,22 no longer exist

#if(laserhit:7,22)((LoaderDozerLaserInt==0))[LoaderDozerWallLasered]
#if(laserhit:8,22)((LoaderDozerLaserInt==0))[LoaderDozerWallLasered]


# IF YOU CHEESED PUZZLE BY DRILLING EVERYTHING

if(drill:8,24)((LoaderDozerInt==1))[LoaderDozerWallDrilledTop]
if(drill:9,24)((LoaderDozerInt==1))[LoaderDozerWallDrilledTop]

if(drill:7,22)((LoaderDozerInt==1))[LoaderDozerWallDrilledBot]
if(drill:8,22)((LoaderDozerInt==1))[LoaderDozerWallDrilledBot]

if(laserhit:8,24)((LoaderDozerInt==1))[LoaderDozerWallLaseredTop]
if(laserhit:9,24)((LoaderDozerInt==1))[LoaderDozerWallLaseredTop]
if(laserhit:7,22)((LoaderDozerInt==1))[LoaderDozerWallLaseredTop] # turns out we don't need bottom specific events as we just check for them being drilled instead
if(laserhit:8,22)((LoaderDozerInt==1))[LoaderDozerWallLaseredTop]

LoaderDozerWallDrilledTop::;
LDWallT+=1;
LDWalls+=1;

LoaderDozerWallDrilledBot::;
LDWallB+=1;
LDWalls+=1;

LoaderDozerWallLaseredTop::;
LoaderDozerLaserInt=1; # was primarily used to stop message from repeatedly firing, now that's taken care of with if


if(LDWalls>0)((LoaderDozerLaserInt==0))[LoaderDozerSnarkAboutDrillingNotReinforcing][LoaderDozerSnarkAboutLaserNotReinforcing]

LoaderDozerSnarkAboutDrillingNotReinforcing::;
msg:LDF1;
qmsg:LDF2;

LoaderDozerSnarkAboutLaserNotReinforcing::;
msg:LDC1;
qmsg:LDC2;

when(LDWallB>0)[LoaderDozerCheckPuzzleCompletion]
when(LDWallT>0)[LoaderDozerCheckPuzzleCompletion]

LoaderDozerCheckPuzzleCompletion::;
((LDWallT>0))LDTopWallDoneCheckBottom; # by drilling
((LDWallRT==2))LDTopWallDoneCheckBottom;
((LDWallRB==2))LDBotWallDoneCheckTop # by reinforcing

LDTopWallDoneCheckBottom::;
((LDWallB>0))LDTopAndBottomWallsDrilled;

LDBotWallDoneCheckTop::;
((LDWallT>0))LDTopAndBottomWallsDrilled;

LDTopAndBottomWallsDrilled::;
((LoaderDozerInt==1))LDTopAndBottomWallsDrilledToCompletePuzzle;

LDTopAndBottomWallsDrilledToCompletePuzzle::;
LoaderDozerInt=2;
msg:LDG1;
qmsg:LDG2;
qmsg:LDG3;
enable:VehicleGraniteGrinder_C;
VehiclesDone+=1;



# IF YOU ACTUALLY REINFORCED IT LIKE A SENSIBLE PERSON WHO FOLLOWS INSTRUCTIONS

if(change:8,24)[LDTopWallChanged] # keep in mind this ALSO fires drill triggers
if(change:9,24)[LDTopWallChanged]

if(change:7,22)[LDBotWallChanged]
if(change:8,22)[LDBotWallChanged]

# also, keep in mind that if eg the top wall is drilled, it is no longer possible to reinforce the top walls, BUT it is still possible to reinforce the bottom walls

LDTopWallChanged::;
wait:0.1; # to give the drill chain enough time to catch up
((LDWallT==0))LDWallRT+=1;

LDBotWallChanged::;
wait:0.1;
((LDWallB==0))LDWallRB+=1;



when(LDWallRB>0)[LoaderDozerWallChangeWhatDo]
when(LDWallRT>0)[LoaderDozerWallChangeWhatDo]


# very mangley set of double conditionals
# top two account for one side reinforced, one side drilled

# LoaderDozerWallChangeWhatDo::; 

# AGH SPENT TEN MINUTES BUGHUNTING THIS ONLY TO FIND THE ERROR WAS WHITESPAAAAAAACE

LoaderDozerWallChangeWhatDo::;
((LDWallT>0))LoaderDozerWhatTopDrilled;
((LDWallB>0))LoaderDozerWhatBotDrilled;
((LDWallRT==2))LoaderDozerWallChangeWhatDoTopReinforced # check for reinforce victory

LoaderDozerWhatTopDrilled::;
((LDWallRB==2))LoaderDozerTopAndBottomAreNowSafe

LoaderDozerWhatBotDrilled::;
((LDWallRT==2))LoaderDozerTopAndBottomAreNowSafe

LoaderDozerWallChangeWhatDoTopReinforced::;
((LDWallRB==2))LoaderDozerTopAndBottomAreNowSafe

LoaderDozerTopAndBottomAreNowSafe::;
LoaderDozerInt=2;
msg:LDE1;
qmsg:LDE2;
enable:VehicleGraniteGrinder_C;
VehiclesDone+=1;


# ((LoaderDozerWallInt==1))msg:LDE1;
# ((LoaderDozerWallInt==3))msg:LDE2;
# ((LoaderDozerWallInt==6))LoaderDozerAllWallsDone # ah, simpler times

LoaderDozerAllWallsDone::;
LoaderDozerLaserInt=2;
msg:LDE3;
qmsg:LDF1;
enable:VehicleGraniteGrinder_C;
VehiclesDone+=1;



#  / ----------------------------- \
#  | ------ GRANITE GRINDER ------ |
#  \ ----------------------------- /

int GraniteGrinderInt=0
int GraniteGrinderWallEarlyInt=0


string GG1="You have teleported down the Granite Grinder. This powerful walker drills walls much faster than the Small Digger."

string GG2="In particular, it is helpful for drilling Hard Rock, and drills even quicker when upgraded."
string GG3="Combining this with its good speed, it's a consistently reliable and valuable vehicle."
string GG4="Let's try it out on some of these walls! Send it over to drill the Ore Seam."

string GG4b="I was going to point you to the cavern you just made safe to drill it out, but you've already cleared out the Ore Seam! Well, that illustrates how, as good as the Granite Grinder is, it isn't a neccessary vehicle, and you can get the same task done with less."

string GGB1="Drilling isn't all the Granite Grinder can do."
string GGB2="It has the same Jump ability as the Hover Scout, allowing it to make its way into narrow caverns or across dangerous terrain. It is the largest vehicle that's able to jump."
string GGB3="As a quick refresher, to Jump with a vehicle, position it close to its destination and then give it a move order; or use SPACE if directly controlling it."

string GGEnd="That's all for the Granite Grinder: let's move onto its big brother, the Chrome Crusher! You'll need to upgrade the Super Teleport to Level 2 to be able to teleport it down." 

if(VehicleGraniteGrinder_C.New)[GraniteGrinderEvent]

GraniteGrinderEvent::savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:GG1;
qmsg:GG2;
qmsg:GG3;
GraniteGrinderInt=1;
((GraniteGrinderWallEarlyInt==0))qmsg:GG4;
((GraniteGrinderWallEarlyInt==0))pan:8,23;
((GraniteGrinderWallEarlyInt==0))showarrow:6,23,AnyArrow;
((GraniteGrinderWallEarlyInt==1))qmsg:GG4b;
((GraniteGrinderWallEarlyInt==1))GraniteGrinderJumpExplanation

# if(VehicleGraniteGrinder_C.driven) # I could, but this just feels odd

if(drill:6,23)[WallForGraniteGrinderHasBeenDrilled]

WallForGraniteGrinderHasBeenDrilled::;
OreSeams+=1;
GraniteGrinderWallEarlyInt=1; # even if this is drilled at the correct time, we can still set this, as it will not affect what's already happened
((GraniteGrinderInt==1))GraniteGrinderJumpExplanation;


GraniteGrinderJumpExplanation::;
hidearrow:AnyArrow;
msg:GGB1;
qmsg:GGB2;
qmsg:GGB3;
qmsg:GGEnd;
enable:VehicleChromeCrusher_C;
VehiclesDone+=1;

#  / ----------------------------- \
#  | ------ CHROME CRUSHER ------- |
#  \ ----------------------------- /

# Chrome Crusher

# CC also is Cargo Carrier hence CCR
string CCR1="You have teleported down the Chrome Crusher. This chrome behemoth is respected by all Rock Raiders, as it is the most powerful drilling vehicle aboard the LMS Explorer."
string CCR2="While ponderously slow and expensive, it also comes equipped with a laser and scanner, making it capable of many tasks."
string CCR3="That's, really, all there is to say about it. You know about drilling, you know about lasers, and hopefully you know about scanners (open the Radar, it's the [[]] button in the top left)."
string CCR4="Let's move on to the next vehicle, the Large Mobile Laser Cutter!"

if(VehicleChromeCrusher_C.New)[ChromeCrusherEvent]

ChromeCrusherEvent::savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:CCR1;
qmsg:CCR2;
qmsg:CCR3;
qmsg:CCR4;
enable:VehicleLMLC_C;
VehiclesDone+=1;

#  / ----------------------------- \
#  | --------- LARGE MLC --------- |
#  \ ----------------------------- /


string LC1="You have teleported down the Large Mobile Laser Cutter. This vehicle packs power its smaller counterpart, the Small Mobile Laser Cutter, could only dream of."
string LC2="With a good free range and great drilling power, its slow speed is a small tradeoff for the amount of firepower you get."
string LC3="When combined into a control group of multiple Large Mobile Laser Cutters, the result - while expensive - is devastatingly effective, made even more devastating by how units in a multiselect will not friendly fire."
string LC4="It is undeniably expensive, though; and don't sleep on the Mining Laser, which is much cheaper and still has a fantastic free range." # plug

string LCEnd="We'll get to using it more in a bit, but first let's move on to the final vehicle, the Tunnel Transport!"

if(VehicleLMLC_C.New)[LMLCEvent]

LMLCEvent::savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:LC1;
qmsg:LC2;
qmsg:LC3;
qmsg:LC4;
qmsg:LCEnd;
enable:VehicleTunnelTransport_C;
VehiclesDone+=1;




#  / ----------------------------- \
#  | ------ TUNNEL TRANSPORT ----- |
#  \ ----------------------------- /

int TunnelTransportInt=0
int TunnelTransportWallEarlyInt=0

string TT1="You have teleported down the Tunnel Transport. This large aerial vehicle has two main roles."
string TT2="Firstly, it's able to carry resources over land, water, and lava, making it superior to the slow and water-limited Rapid Rider, or the manual clicks needed for the Tunnel Scout."
string TT3="Secondly, like the Cargo Carrier, it is able to load and unload vehicles, making it essential for transporting equipment across lava. Remember, to load a vehicle, click on the Tunnel Transport and select the vehicle you want to carry."

string TT4="However, the Tunnel Transport has an importance difference from the Cargo Carrier: it is also able to carry Large Vehicles."
string TT5="And like the Cargo Carrier, laser vehicles are able to fire while being carried, meaning the Tunnel Transport + Large Mobile Laser Cutter is a devastating combination that almost no wall can stand against. Let's load the LMLC up and try it out!"
string TT5b="Since there isn't a script check for if your TT has a vehicle onboard or not, I'll assume you are carrying an LMLC when you hit >"

string TT6="Try it out on some of these Hard Rock walls next to lava; walls that would be difficult to mine any other way. Remember, doubleclick on a laser to activate it."
string TT6b="Try it out on some of these Hard Rock walls next to lava... is what I WOULD say if you hadn't already zapped them!"

string TT7="Nicely done, the wall has been taken down. This is one of the very few ways to get rid of Hard Rock on the edge of lava."

string TTB1="That's very nearly everything you need to know about vehicles, but there's one more thing."
string TTB2="Odds are good your Tunnel Transport was flying all over the place, picking up Ore, ferrying odd crystals about, and that's all good and well but sometimes you want a vehicle to stay put and only accept orders you give it directly."
string TTB3="This can be done by selecting the vehicle and clicking the Lock Vehicle button." 
string TTB4="It's particularly helpful for the Tunnel Transport, which otherwise has a bad habit of running across the other side of the map to pick up three random ore that you really don't care about."

string TTBonus4="One of the best ways to get rid of walls directly on the edge of lava is to hit them with lasers. Nicely done, Cadet!"

# UNFORTUNATELY
# .click does NOT fire for when a vehicle has been given a pick-me-up order

if(VehicleTunnelTransport_C.New)[TunnelTransportEvent]

TunnelTransportEvent::savevehicle:NewVehicleRef;
VRow=NewVehicleRef.Row;
VCol=NewVehicleRef.Col-1;
pan:VRow,VCol;
msg:TT1;
qmsg:TT2;
qmsg:TT3;
qmsg:TT4;
qmsg:TT5;
TunnelTransportInt=1;
((TunnelTransportWallEarlyInt==1))qmsg:TT6b;
((TunnelTransportWallEarlyInt==1))pan:17,13;
((TunnelTransportWallEarlyInt==1))TTEndEvent; # bypass the whole laser chain cause those walls don't exist anymore!
((TunnelTransportWallEarlyInt!=1))qmsg:TT5b;
((TunnelTransportWallEarlyInt!=1))TTBoardedLMLCProbably;


when(TunnelTransportInt>0)[TunnelTransportIntChangedWhatDo]

TunnelTransportIntChangedWhatDo::;
((TunnelTransportInt>5))TTWallDrilledCheck;

TTWallDrilledCheck::;
((TunnelTransportInt<10))TTWallDrilledEvent

TTWallDrilledEvent::;
TunnelTransportInt=10;
hidearrow:AnyArrow;
msg:TT7;
TTEndEvent;

# this kit and kaboodle is needed for it to only fire once & in the rare scenario you drill two walls at once


TTBoardedLMLCProbably::;
qmsg:TT6;
pan:17,13;
showarrow:17,13,AnyArrow;
TunnelTransportInt=5;


if(drill:17,14)[TTLMLCWallHit]
if(drill:17,13)[TTLMLCWallHit]
if(drill:17,12)[TTLMLCWallHit]
if(drill:17,11)[TTLMLCWallHit]

TTLMLCWallHit::;
((TunnelTransportInt>4))TunnelTransportInt+=1;
((TunnelTransportInt<5))TTLMLCWallHitEarly

TTLMLCWallHitEarly::;
((TunnelTransportWallEarlyInt==0))msg:TTBonus4;
TunnelTransportWallEarlyInt=1;

TTEndEvent::;
qmsg:TTB1;
qmsg:TTB2;
qmsg:TTB3;
qmsg:TTB4;
VehiclesDone+=1;
truewait:2;
AllVehiclesDoneEvent;


#  / --------------------------------------- \
#  | ------ ALL VEHICLES DONE, GO HAM ------ |
#  \ --------------------------------------- /

# (finally!)

# See, what makes this Extra Fun to script is I want cheeky lil' messages for if these happen before they're supposed to
# it'd be SO MUCH easier to go "wow, you drilled the seam, hooray" (check if all four seams are drilled) "wowee, you drilled them all, good job, mission complete"
# but that's just Not What I Wanna Do
# so instead
# we get THIS

# string ImTooTired="Currently too tired to finish this last bit of the tutorial. It'll just point you at the seams (once I put them back in) and say Go Nuts and then win when done. TBC"


string SeamIntro="And that is all there is to learn about the vehicles aboard the LMS Explorer! I hope they and this information serves you well, Cadet."
string SeamIntroB="There only remains the initial objective: to drill all four Crystal Seams."

string WaterSeamIntro="One Crystal Seam is across the water."
string WaterSeamDrilled="One Crystal Seam was across the water, but you've already sailed over and drilled it. Did you manage to get the crystals back home from it?"
string WaterSeamSniped="One Crystal Seam was across the water, but you've carefully positioned a laser just right to blast it."

string LavaSeamIntro="One Crystal Seam is across the lava."
string LavaSeamDrilled="One Crystal Seam was across the lava, but you've already flown over and mined it out." # there is no laser snipe for this seam

string RockSeamIntro="One Crystal Seam is behind a wall of Hard Rock."
string RockSeamDrilled="One Crystal Seam was behind a wall of Hard Rock, but you dug it out already."
string RockSeamSniped="One Crystal Seam was behind a wall of Hard Rock, but you made a clean laser shot right through the gaps."

string JumpSeamIntro="And the final Crystal Seam is in a cavern inaccessible by raiders on foot."
string JumpSeamDrilled="And the final Crystal Seam was in a cavern inaccessible by raiders on foot - accent on the was, as you've already drilled it!"
string JumpSeamSniped="And the final Crystal Seam was in a cavern inaccessible by raiders on foot, but that's clearly no barrier for you and your laser equipment, Cadet!"

string SeamOutroEarly="You've already drilled all four seams before the tutorial has even finished! Very eager of you, Cadet. Well done, mission complete. Except the mission is already complete. You know you can leave now by using the Exit Mission button?"
# When the above fires, victory will have already been triggered
string SeamOutro="Now it's your turn, Cadet. Use what you've learned about vehicles to go forth where no miner has gone before, drill those seams, and bring those Energy Crystals home."

# NOTE: It is perfectly possible to get the "OMG you sniped it!" message by just waltzing up with a SMLC given a drill order
# I can get around this by putting enter triggers nearby, but, I, really, don't want to do that 
# this has been long enough



AllVehiclesDoneEvent::;
TutorialPartOver=1;
qmsg:SeamIntro;
qmsg:SeamIntroB;
((WaterSeam==0))qmsg:WaterSeamIntro;
((WaterSeam==0))showarrow:35,5,CrystalSeamPointArrow;
((WaterSeam==2))qmsg:WaterSeamDrilled;
((WaterSeam==2))hidearrow:CrystalSeamPointArrow;
((WaterSeam==3))qmsg:WaterSeamSniped;
((WaterSeam==3))hidearrow:CrystalSeamPointArrow;
pan:35,5;
((LavaSeam==0))qmsg:LavaSeamIntro;
((LavaSeam==0))showarrow:23,7,CrystalSeamPointArrow;
((LavaSeam==2))qmsg:LavaSeamDrilled;
((LavaSeam==2))hidearrow:CrystalSeamPointArrow;
pan:23,7;
((RockSeam==0))qmsg:RockSeamIntro;
((RockSeam==0))showarrow:3,15,CrystalSeamPointArrow;
((RockSeam==2))qmsg:RockSeamDrilled;
((RockSeam==2))hidearrow:CrystalSeamPointArrow;
((RockSeam==3))qmsg:RockSeamSniped;
((RockSeam==3))hidearrow:CrystalSeamPointArrow;
pan:3,15;
((JumpSeam==0))qmsg:JumpSeamIntro;
((JumpSeam==0))showarrow:10,30,CrystalSeamPointArrow;
((JumpSeam==2))qmsg:JumpSeamDrilled;
((JumpSeam==2))hidearrow:CrystalSeamPointArrow;
((JumpSeam==3))qmsg:JumpSeamSniped;
((JumpSeam==3))hidearrow:CrystalSeamPointArrow;
pan:10,30;
((Seams!=4))qmsg:SeamOutro;
((Seams!=4))pan:20,23;
hidearrow:CrystalSeamPointArrow;
((Seams==4))SeamsDoneEarlyEvent;


SeamsDoneEarlyEvent::;
msg:SeamOutroEarly;
# we don't need win conditions since that already happened




int Seams=0
int TutorialPartOver=0

string SeamsRemainingMessage="There are four Energy Crystal Seams remaining."

when(Seams>0)[SeamsChangedWhatDo]

SeamsChangedWhatDo::;
((Seams==1))SeamsRemainingMessage="There are three Crystal Seams remaining. Keep going!";
((Seams==2))SeamsRemainingMessage="There are two Crystal Seams remaining. You're halfway there!";
((Seams==3))SeamsRemainingMessage="There is only one Crystal Seam remaining. You're nearly done, Cadet!";






int JumpSeam=0

string JSA="Well done, you've jumped in with a vehicle and drilled the Crystal Seam. "
string JSB="Nice laser shot, Cadet! That's one Energy Crystal seam mined out."
string JSC="I wonder what the best way to get the crystals back is. I'm sure you'll find a way, Cadet."

string JSD="Oh well done, you've found out that, yes, you can cheese jump puzzles by just WALKING there in direct control mode. Shhhh! This is a bug! Do not use it! It will break maps! Or do use it, I can't stop you. *sigh.* Well, try to not break the rest of the tutorial, okay?"
string JSE="Well done, you've used the Hover Scout's jump to drill one of the four Crystal Seams, and the tutorial has barely started!"
string JSE2="You are able to solve problems before others even bring them up as problems. Well done, Cadet!"
string JSF="Clean laser shot, Cadet, and the tutorial isn't even finished! Well done on your attentiveness."
string JSG="Well done Cadet, you've used a vehicle's jump ability to get in there and drill the Crystal Seam, and the tutorial isn't even done yet! Very forward-thinking of you. Good work!"

if(laserhit:10,30)((JumpSeam==0))[JumpSeam=1]


if(drill:10,30)[JumpSeamDrilledWhatDo]

JumpSeamDrilledWhatDo::;
((VehiclesDone==0))JumpSeamDrilledSuperEarly;
((VehiclesDone==1))JumpSeamProbablyDrilledWithHoverScout;
((VehiclesDone==2))JumpSeamProbablyDrilledWithHoverScout;
((VehiclesDone==3))JumpSeamProbablyShotBySMLC; # could also be mining laser
((VehiclesDone==4))JumpSeamProbablyShotBySMLC;
((VehiclesDone==5))JumpSeamProbablyShotBySMLC;
((VehiclesDone==6))JumpSeamProbablyShotBySMLC;
((VehiclesDone==7))JumpSeamProbablyShotBySMLC;
((VehiclesDone==8))JumpSeamProbablyDrilledWithGraniteGrinder;
((VehiclesDone==9))JumpSeamProbablyDrilledWithGraniteGrinder;
((VehiclesDone==10))JumpSeamProbablyDrilledWithGraniteGrinder; # end of 10 is CC so CC laser is in play but we already check for laser in GG check
((VehiclesDone==11))JumpSeamProbablyDrilledWithGraniteGrinder;
((VehiclesDone==12))JumpSeamDrilledAtSensibleTime;

JumpSeamDrilledSuperEarly::;
((JumpSeam==1))JumpSeamWasLasered;
((JumpSeam==0))JumpSeamFirstPersonCheese;

JumpSeamFirstPersonCheese::;
msg:JSD;
JumpSeamTidyUpEvent;

JumpSeamProbablyDrilledWithHoverScout::;
((JumpSeam==0))JumpSeamWasDrilledWithHoverScout;
((JumpSeam==1))JumpSeamWasLasered;

JumpSeamWasDrilledWithHoverScout::;
msg:JSE;
qmsg:JSE2;
JumpSeamTidyUpEvent;

JumpSeamProbablyShotBySMLC::;
((JumpSeam==1))JumpSeamWasShotBySMLC;
((JumpSeam==0))JumpSeamWasDrilledWithHoverScout;

JumpSeamWasShotBySMLC::;
msg:JSF;
JumpSeamTidyUpEventLaser;

# the keen-eyed among you will notice that all these checks for 1-4 do essentially the same thing due to checking JumpSeam
# and thus this redirect is not actually needed and could be written out
# shhhhhhh
JumpSeamWasLasered::;
JumpSeamWasShotBySMLC;

JumpSeamProbablyDrilledWithGraniteGrinder::;
((JumpSeam==1))JumpSeamWasLasered;
((JumpSeam==0))JumpSeamWasDrilledByGraniteGrinderOrHoverScoutOrFirstPersonCheeseWeCantTell

JumpSeamWasDrilledByGraniteGrinderOrHoverScoutOrFirstPersonCheeseWeCantTell::;
msg:JSG;
JumpSeamTidyUpEvent;

JumpSeamDrilledAtSensibleTime::;
((JumpSeam==0))JumpSeamJumped;
((JumpSeam==1))JumpSeamSniped;



JumpSeamJumped::;
Seams+=1;
JumpSeam=2;
msg:JSA;
qmsg:JSC;
((Seams!=4))qmsg:SeamsRemainingMessage;

JumpSeamSniped::;
JumpSeam=3;
Seams+=1;
msg:JSB;
qmsg:JSC;
((Seams!=4))qmsg:SeamsRemainingMessage;


JumpSeamTidyUpEvent::;
Seams+=1;
JumpSeam=2

JumpSeamTidyUpEventLaser::;
Seams+=1;
JumpSeam=3









int RockSeam=0

string RSA="Well done, you've dug through the Hard Rock and drilled the Crystal Seam! That's another one down."
string RSB="What a snipe, Cadet! That's some careful aiming. And any crystals you spent on the shot can easily be recharged. Well done!"

string RSC="What a snipe, Cadet! That's some careful aiming, and the tutorial isn't even done. Clever of you to work this out so early: well done!"
string RSD="You know this is the -vehicles- tutorial, not the -dynamite OP- tutorial, Cadet? Yes, yes, it's true, silly amounts of raiders, silly amounts of tool stores, and an unhealthy dose of dynamite does clear almost every map."
string RSD2="But you won't be able to drill one of the other seams without using vehicles, so you'll at least need to use SOME of them."

string RSE="It's slow going, but the Small Digger is able to dig through the Hard Rock to reach this Crystal Seam, as you've just demonstrated!"
string RSE2="And we haven't even gotten to the Large Vehicles yet - as you exemplify, you'd be surprised what you can get done with just the Small Vehicles. Well done!"

string RSF="The Large Vehicles are much better suited to chowing through walls of Hard Rock, and you've made it all the way to the Crystal Seam! But there's still a few more vehicles to cover, so hang on Cadet!"


if(laserhit:3,15)((RockSeam==0))[RockSeam=1]

if(drill:3,15)[RockSeamDrilledWhatDo]

RockSeamDrilledWhatDo::;
((VehiclesDone==0))RockSeamDrilledSuperEarly;
((VehiclesDone==1))RockSeamDrilledSuperEarly;
((VehiclesDone==2))RockSeamDrilledSuperEarly;
((VehiclesDone==3))RockSeamProbablyDrilledWithSmallDigger;
((VehiclesDone==4))RockSeamProbablyDrilledWithSmallDigger;
((VehiclesDone==5))RockSeamProbablyDrilledWithSmallDigger;
((VehiclesDone==6))RockSeamProbablyDrilledWithSmallDigger;
((VehiclesDone==7))RockSeamProbablyDrilledWithSmallDigger;
((VehiclesDone==8))RockSeamProbablyDrilledWithLargeVehicle;
((VehiclesDone==9))RockSeamProbablyDrilledWithLargeVehicle;
((VehiclesDone==10))RockSeamProbablyDrilledWithLargeVehicle;
((VehiclesDone==11))RockSeamProbablyDrilledWithLargeVehicle;
((VehiclesDone==12))RockSeamDrilledAtSensibleTime;


RockSeamDrilledSuperEarly::;
((RockSeam==1))RockSeamWasLasered;
((RockSeam==0))RockSeamWasDynamited;


RockSeamWasLasered::;
msg:RSC;
RockSeamTidyUpEventLaser;

RockSeamWasDynamited::;
msg:RSD;
qmsg:RSD2;
RockSeamTidyUpEvent;

RockSeamProbablyDrilledWithSmallDigger::;
((RockSeam==1))RockSeamWasLasered;
((RockSeam==0))RockSeamWasDrilledWithSmallDigger;

RockSeamWasDrilledWithSmallDigger::;
msg:RSE;
qmsg:RSE2;
RockSeamTidyUpEvent;

RockSeamProbablyDrilledWithLargeVehicle::;
((RockSeam==1))RockSeamWasLasered;
((RockSeam==0))RockSeamWasDrilledWithLargeVehicle;

RockSeamWasDrilledWithLargeVehicle::;
msg:RSF;
RockSeamTidyUpEvent;

RockSeamTidyUpEvent::;
Seams+=1;
RockSeam=2

RockSeamTidyUpEventLaser::;
Seams+=1;
RockSeam=3

RockSeamDrilledAtSensibleTime::;
((RockSeam==0))RockSeamRocked;
((RockSeam==1))RockSeamSniped;


# if(drill:3,15)((RockSeam==0))[RockSeamRocked][RockSeamSniped] #absolutely hilarious find and replace job to give us RockSeamRocked
# (I wish the script was that simple, yes that's what the check used to look like but I needed to make extensive changes)


RockSeamRocked::;
RockSeam=2;
msg:RSA;
Seams+=1;
((Seams!=4))qmsg:SeamsRemainingMessage;

RockSeamSniped::;
RockSeam=3;
msg:RSB;
Seams+=1;
((Seams!=4))qmsg:SeamsRemainingMessage;





int WaterSeam=0

string WSA="Well done, you've sailed over the water and drilled one of the four Crystal Seams."
string WSB="That's a long shot to make with a laser, Cadet, but you did it just fine! Top marks for accuracy, you're going to have no problem gunning down monsters by the dozen."

# string WSC="You sailed over the water with a Rapid Rider and drilled the seam. And the tutorial isn't even over yet. Yay" # yes I *am* losing it why do you ask
string WSC="You sailed over the water with a Rapid Rider and drilled one of the four Crystal Seams. Well done! Yet there's still more vehicles to cover!"

if(laserhit:35,5)((WaterSeam==0))[WaterSeam=1]

if(drill:35,5)((WaterSeam==1))[WaterSeamWasSniped][WaterSeamDrilledWhatDo]

WaterSeamWasSniped::;
msg:WSB;
WaterSeam=3;
Seams+=1;
((VehiclesDone==12))CheckyQmsgBodge

WaterSeamDrilledWhatDo::;
((VehiclesDone==4))WaterSeamRapidRider;
((VehiclesDone!=4))WaterSeamWeDunno; # could be tunnel scout, rapid rider, cargo carrier, short of enter triggers for every single vehicle class (which I do NOT want to do) we cannot tell
Seams+=1;
WaterSeam=2;

WaterSeamRapidRider::;
msg:WSC;

WaterSeamWeDunno::;
msg:WSA;
((VehiclesDone==12))CheckyQmsgBodge

CheckyQmsgBodge::;
((Seams!=4))qmsg:SeamsRemainingMessage; # quick and lazy double conditional






# if(drill:35,5)((WaterSeam==0))[WaterSeamWatered][WaterSeamSniped] # these find and replace jobs keep getting dumber

# defunct
WaterSeamWatered::; # Congratulations Cadet, you've watered the Water Seam. I'm sure it'll grow into a big juicy Recharge Water Seam when it's all grown up. For now, put it in a sunny, frost-free, place. Maybe a windowsill?
WaterSeam=2;
Seams+=1;
msg:WSA;
qmsg:SeamsRemainingMessage;

WaterSeamSniped::;
WaterSeam=3;
Seams+=1;
msg:WSB;
qmsg:SeamsRemainingMessage;




int LavaSeam=0 
# Lava seam has no snipe position, although it can be drilled by mining around from the water with a little patience
if(drill:23,7)((VehiclesDone==12))[LavaSeamLavaed][LavaSeamLavaedEarly]

string LSA="Well done, you flew over and drilled the seam."
string LSB="Well done Cadet, the tutorial's not even over and you're already flying over the dangerous lava and drilling the seam. Well done! But stick around, there's still more vehicles to cover."

LavaSeamLavaedEarly::;
LavaSeam=2;
Seams+=1;
msg:LSB;

LavaSeamLavaed::;
LavaSeam=2;
Seams+=1;
msg:LSA;
((VehiclesDone==12))CheckyQmsgBodge; # you know, the moment I put Bodge next to its name I just KNEW it was going to be reused and become an important part of the script




when(Seams==4)[AllSeamsDrilledWhatDo]

string AllSeamsA="Well done Cadet, you've drilled all four seams... without even finishing the tutorial!"
string AllSeamsB="You clearly need no further instruction and have got this all sorted already. That said, there may be some additional tidbits that I still have to say about specific vehicles, so stick around if you like. Seeing as you're so active, all the vehicles are now available without needing to go through them in order."
string AllSeamsC="Or, since you're clearly capable, go onwards into the caverns of Planet U itself! The choice is yours."

string AllSeamsD="Well done Cadet, you've used the power of vehicles to drill all four Crystal Seams across the map."
string AllSeamsE="You've learnt well: go apply your knowledge to the caverns of Planet U and see what you find!"
string AllSeamsF="Oh, and just one final note: since several of these vehicle mechanics are new to Manic Miners, the Standard campaign, which is a modified port of the LRR levels, will not require these new mechanics."
string AllSeamsG="So, to see vehicles at their best you will want to look into the Remastered campaign or several of the Community Levels - but the Standard campaign is a great place to start too."
string AllSeamsH="In any case, that is all there is to using the vehicles of the Rock Raider mining fleet. Well done Cadet: training mission complete."
string AllSeamsEmpty=" "


AllSeamsDrilledWhatDo::;
truewait:4;
((VehiclesDone!=12))AllSeamsDrilledEarly;
((VehiclesDone==12))AllSeamsDrilledAtOrderlyTime;


AllSeamsDrilledEarly::;
qmsg:AllSeamsA;
qmsg:AllSeamsB;
enable:VehicleHoverScout_C;
enable:VehicleSmallDigger_C;
enable:VehicleSmallTransportTruck_C;
enable:VehicleSMLC_C;
enable:VehicleTunnelScout_C;
enable:VehicleRapidRider_C;
enable:VehicleLoaderDozer_C;
enable:VehicleGraniteGrinder_C;
enable:VehicleLMLC_C;
enable:VehicleChromeCrusher_C;
ensable:VehicleCargoCarrier_C;
ensable:VehicleTunnelTransport_C;
qmsg:AllSeamsC;
qmsg:AllSeamsEmpty;
FinalWinVariable=1;

AllSeamsDrilledAtOrderlyTime::;
msg:AllSeamsD;
qmsg:AllSeamsE;
qmsg:AllSeamsF;
qmsg:AllSeamsG;
qmsg:AllSeamsH;
qmsg:AllSeamsEmpty;
FinalWinVariable=1;




int FinalWinVariable=0











#  / ------------------------------- \
#  | -------- BONUS CONTENT -------- |
#  \ ------------------------------- /

# for those that decide to explore the rest of the map

int MonstersInt=0

string FS1="Woah, you've discovered a fifth Crystal Seam!"
string FS2="... but it's guarded by lifeforms made of molten rock, Lava Monsters!"
string FS3="They're sleeping at present, but if we want to get the crystals out of this seam, we'll need to neutralize the threat they pose to our mining equipment!"
string FS4="There are three straightforward ways to deal with monsters."
string FS5="The first is equip Rock Raiders with weapons they can use to defend themselves. Select a miner, select Go To Tool Menu, and then your pick of the weaponry available."
string FS6="Once they have a weapon, they can either be manually ordered to attack a monster, or the alarm for Action Stations up the top can be sounded."
string FS7="The second method is to take them out yourself by commanding lasers on vehicles or buildings."
string FS8="Given these lifeforms are made of rock, our laser equipment made to mine rock are effective against them, but you need to position carefully and make sure that the monsters don't destroy whatever laser you're controlling."
string FS9="The third method is to build Electric Fences."
string FS10="Electric Fences are free to build and use, but only activate within 2 tiles (not diagonally) of a powered Electric Fence or powered building."
string FS11="They have a cooldown, so they won't zap every monster, but they're very helpful as a passive way to deal with threats."
string FS12="Tread carefully Cadet, this could be dangerous!"

string FSB1="More are coming?! Activate Action Stations! Still got that control group for your Mining Lasers? Might want to use it!"

string FSC3="Well done, you cleared out the Lava Monsters and their reinforcements successfully."
string FSC4="A single monster is easy to deal with, but monsters are much more dangerous when they come in groups."
string FSC5="Take care in the caverns Cadet, you never know what you might find down there!"

string FSD1="Well done, you've drilled the fifth Energy Crystal Seam! At this rate, we'll soon have enough power to get the LMS home. Well done, Cadet!"
string FSD2="... are you a cadet? Since you're doing this well, I officially grant you the rank of Rock Raider. You deserve it!"

creature M1=0
creature M2=1

if(M1.wake)[MonstersInt+=1]
if(M2.wake)[MonstersInt+=1]

if(MonstersInt>0)[MonstersIntChangedWhatDo]

MonstersIntChangedWhatDo::;
((MonstersInt==1))MonstersWokeUp;


if(drill:13,5)[FifthSeamCavernEvent]

FifthSeamCavernEvent::;
pan:14,3;
msg:FS1;
qmsg:FS2;
qmsg:FS3;
qmsg:FS4;
qmsg:FS5;
qmsg:FS6;
qmsg:FS7;
qmsg:FS8;
qmsg:FS9;
qmsg:FS10;
qmsg:FS11;
qmsg:FS12;


MonstersWokeUp::;
wake:M1;
wake:M2;
wait:random(0.5)(1.0);
msg:FSB1;
speed:0.75;
emerge:16,5,A,LavaMonster,0;
wait:random(1.0)(2.0);
emerge:16,4,A,LavaMonster,0;
MonstersInt=3;

when(CreatureLavaMonster_C.dead)((monsters==0))[MonstersCleared]

MonstersCleared::;
MonstersInt=4;
speed:1.0;
msg:FSC3;
qmsg:FSC4;
qmsg:FSC5;

if(drill:12,3)[FifthSeamDrilled]

FifthSeamDrilled::;
msg:FSD1;
qmsg:FSD2;



int OreSeams=0

# 16 total

string OS1="You're not just drilling these Energy Crystal seams around here, you're drilling the Ore Seams too! Well done, Cadet!"
string OS2="You've drilled half of the Ore Seams around here! Can you find the other half?"
string OS3="You're just three Ore Seams away from drilling all of them. Good going!"
string OS4="Only one more Ore Seam remaining!"

string OSB1="Well done, you've drilled every Ore Seam!"
string OSB2="This ore will speed up mining operations alongside the crystals you've gathered. Well done!"

if(drill:21,29)[OreSeams+=1]
if(drill:31,28)[OreSeams+=1]
if(drill:33,28)[OreSeams+=1]
if(drill:37,25)[OreSeams+=1]
# if(drill:6,23)[OreSeams+=1] # TRIGGER FOR THIS IS IN GRANITE GRINDER SECTION 
if(drill:3,19)[OreSeams+=1]
if(drill:9,20)[OreSeams+=1]
if(drill:15,18)[OreSeams+=1]
if(drill:15,15)[OreSeams+=1]
if(drill:23,16)[OreSeams+=1]
if(drill:6,8)[OreSeams+=1]
if(drill:14,2)[OreSeams+=1]
if(drill:18,5)[OreSeams+=1]
if(drill:26,3)[OreSeams+=1]
if(drill:31,4)[OreSeams+=1]
if(drill:26,10)[OreSeams+=1]

when(OreSeams>0)[OreSeamsChangedWhatDo]

OreSeamsChangedWhatDo::;
((OreSeams==6))msg:OS1;
((OreSeams==8))msg:OS2;
((OreSeams==13))msg:OS3;
((OreSeams==15))msg:OS4;
((OreSeams==16))msg:OSB1;
((OreSeams==16))qmsg:OSB2;



}
