# Preferences
P softerChecks on
P revertAspects [ current-positions primary effects ]

# Macros / setup

= _jaunt where [
  p {where}
  g jaunt
]

= vials N [
  a takeVials
    At { gain vial*{N}; deactivate }
]

= enemy which [
  gd enemy{which}
]

= claim what [
  a claim{what}
    At { gain {what}; deactivate }
]

= savePoint [
  a save
    # TODO: Set-to-other-token syntax
    # At { set Health*MaxHealth; save }
    At { set Health*50; save }
]

= bombsRefill [
  a refillBombs
    At set bomb*3
    # TODO: set to max bombs!
]

= breakTarget color number [
  m {color}Target{number}:intact
  a break{color}Target{number}
    q bomb*1
    At { lose bomb*1; set {color}Target{number}:broken; deactivate }
]

= breakWithBomb name what [
  a break{name}
    q !({what}:broken)&bomb*1
    At { set {what}:broken; deactivate }
]

= couldBreakWithBomb name what [
  oa break{name}
    q !({what}:broken)&bomb*1
    e { set {what}:broken; deactivate }
]

= chargeGenerator name [
  m generator{name}:uncharged
  a chargeGenerator{name}
    q whip
    At { set generator{name}:charged; deactivate }
]

# Set up death decision point for goto effects
domain endings
@ death
@ @
domain main

# Journal

  g time: 2024-6-8:16:27
S RedGirders::start
  zz Laboratory
  A gain Health*50
  A gain MaxHealth*50
  o down
    qb openPurpleDoors
  o right
    qb pushRedButtons
  o left
    qb pushRedButtons
x up RedGirders::loft down
  > vials 2
  o right
    qb openPurpleDoors
  o left

xt left SlugsHallway::main right
  > vials 3
  > enemy ExoSlug

x left Research1::main right
  > enemy ExoSlug
  > vials 8
  o up
    q fly

x down AccessTunnel::top up
x down bottom up
  qr walljump|higherjump
  > claim pipe
  F pipe pushRedButtons
  n Pipe also allows us to do a melee attack.
x right rightSide left
  qb pipe
  > enemy ExoSlug
  n [ You need to fight this one to get past. ]

r right RedGirders::start left
  g time: 2024-6-8:16:40
  n [ Time to walk the dog. ]

w
  g time: 2024-6-8:20:35

xt right UnfinishedVestibule::bottom left
  qr pipe
  o right
    q activatePurpleGenerators
x up mid down
  o up top down
    q walljump|higherjump
  @ UnfinishedVestibule::top
    v left RedGirders::loft right
  @ @

x right SecondShaft::bottom left
  m grayBlock:intact
  o right
    qb SecondShaft::bottom::grayBlock:broken
x up top down

x fallRight BusyLayers::bottom climbLeft
  qr walljump
  v left SecondShaft::bottom right
  m block1:intact
  m block2:intact
  o up mid down
    qb block1:broken
  o upMid mid downMid
    q block2:broken&(walljump|higherjump)
    qr block2:broken

x right LonelySlug::main left
  qb pipe
  m block:intact
  o upLeft BusyLayers::mid right
    qb block:broken
  > enemy ExoSlug
  > vials 5
  o down
  > savePoint

xt down HangingBlocks::main up
  > vials 2
  o right
  o left

xt left SplitLevelCorridor::bottom right
  o up top down
    q walljump|higherjump

x down BombsRoom::ledge up
x down main up
  qr walljump
  > enemy SpinSlug
  o left
    qb bombs
    n [ Door opens when you get them, you don't actually blow it up ]
  n [ A tough fight I almost lose. ]
  n level: combat^0
  oa fightSlug
    e [
      {
        <0>combat{
          gain bombs; gain bomb*3; set maxBombs*3; deactivate
        }{
          goto endings//death
        }
      }
    ]
  ta fightSlug%s
