# gob2native - Gobliiins walkthrough, level 17 (AVT017): the dragon's cave
# SPDX-License-Identifier: GPL-3.0-or-later
#
# The level is solved when the picker holds the dagger after the dragon has
# breathed on it. The dragon also cooks the foot into a roast; whatever
# lurks in the table on the middle ledge takes the roast and lets goblins
# cross to the dagger. The spring trap in front of the table is jammed with
# the log, which the wizard later turns into deodorant. The seeds from the
# bag sown on the top ledge grow the foot; the deodorant spray on it while
# it is out (a window of about 1.4 s, here hit in its middle) frees it.
# Energy is lost by anyone standing in front of the dragon (cell 8,21) for
# 30 ticks (the wizard: 90) while it is idle, by stepping on the trap or
# the table unprepared, by the wizard's spell on the trap, and by giving the
# dragon the log or the bone. The runner's own pauses (0.6 s of idle after
# every action, 0.25 s per cursor change) are too long in front of the
# dragon, so those visits use raw clicks, the cursor set beforehand. Before
# each timed part the current goblin waits for his boredom animation
# (v[60] 64 + goblin), which comes every 121 ticks: the next one can't
# then delay anything.
room AVT017
goblin 1
act 66 15            # the fighter knocks a log down onto the middle ledge
goblin 0
pick 54 75           # the picker takes it
use 114 81           # and jams the spring trap with it
pick 126 33          # he puts it down on the top ledge
goblin 2
act 126 33           # the wizard turns it into deodorant
walk 42 93           # and goes down to the middle ledge
untilvar 60 66       # (his boredom animation)
idle
rclick 42 93         # cursor: act
click 108 128        # he casts on the bag in front of the dragon...
untilvar 354 1
rclick 42 93         # (cursor: walk)
untilvar 285 0       # ...which falls open
untilvar 60 18 19
click 42 93          # and he hurries away
idle
goblin 0
walk 42 147          # the picker waits at the foot of the ladder
untilvar 60 64       # (his boredom animation)
idle
rclick 42 147        # cursor: pick
rclick 42 147
click 95 117         # he takes the bag in front of the dragon...
untilvar 114 2
untilvar 60 18 19
click 71 129         # ...and at once steps away, putting it down
idle
pick 78 141          # he takes it again
walk 78 33           # up on the top ledge
untilvar 60 64       # (his boredom animation)
idle
use 78 33            # he sows the seeds: a foot grows out of the ground
untilvar 492 3
pick 126 33          # he swaps the bag for the deodorant
use 30 33            # and sprays the foot: it comes loose
pick 30 33           # he takes the foot
walk 42 147          # down to the foot of the ladder
untilvar 60 64       # (his boredom animation)
idle
rclick 42 147        # cursor: pick
rclick 42 147
click 95 117         # he puts the foot in front of the dragon...
untilvar 114 -1
untilvar 60 18 19
click 71 129         # ...and steps away
idle
untilvar 503 1       # the dragon's breath has made it a roast
walk 42 147
untilvar 60 64       # (his boredom animation)
idle
rclick 42 147        # cursor: pick
rclick 42 147
click 95 117         # he takes the roast...
untilvar 114 3
untilvar 60 18 19
click 71 129         # ...steps away, putting it down
idle
pick 78 141          # and takes it again
use 138 81           # he gives it to the table: it's safe to cross now
pick 306 63          # he takes the dagger at the far end
walk 42 147          # and brings it down
untilvar 60 64       # (his boredom animation)
idle
rclick 42 147        # cursor: pick
rclick 42 147
click 95 117         # he puts the dagger in front of the dragon...
untilvar 114 -1
untilvar 60 18 19
click 71 129         # ...and steps away
idle
untilvar 491 1       # the dragon has breathed on it
walk 42 147
untilvar 60 64       # (his boredom animation)
idle
rclick 42 147        # cursor: pick
rclick 42 147
click 95 117         # he takes the dagger...
untilvar 114 6
untilvar 60 18 19
click 71 129         # ...steps away, putting it down
idle
pick 78 141          # and takes it again: the exit shows
exit
