# Routes through the town for tools/town_test.sh (one player) and tools/net_town_test.sh (online).
#
# One route per line: its name, what tools/town_report.py must find at the end, then the buttons as
# "frame:mask" (the masks of SS_INPUT, runtime/core/frame.c). Frame 0 is the moment the player stands in the
# square behind the gate with the control in hand; the tests add their own start to it.
#
# Every route first holds Up for 390 frames: across the square, through the street behind it and into the
# hall of the shops, where the player then stands on the carpet below the counters (x 360). From there a
# counter is reached by walking left or right to its x (1.63 pixels a frame), then up against it, then A.
# Counters from left to right: appraiser 168, item shop 233, storage 296, weapon shop 424, armour shop 488,
# blacksmith 552.
#
# In a counter's menu the hand starts on the seller's goods (item, weapon and armour shop) or on the bag's
# first record (the others). A takes what is under the hand and puts it down; Left and Right go between the
# bag (five records a row) and the goods, Down from the goods goes to the selling place. B twice leaves.
# A new character has six records in the bag, the fifth is the money (400).
#
# Checks: room=N the town's room at the end (1 is the hall); bag=N records used; money=N; held=1 an event
# held the player at some time (a counter or a menu was opened); free=1 the player has the control back at
# the end. A run that ends early, reports a crash or reaches a stub fails whatever the checks say.

# the walk alone
hall        room=1 bag=6 money=400 free=1                  0:0040 390:0000

# item shop: sell the fourth record (8), buy the first of the goods (20) into the empty record, leave
item        room=1 bag=6 money=388 held=1 free=1           0:0040 390:0000 600:0020 678:0000 700:0040 740:0000 760:0001 766:0000 920:0001 926:0000 960:0020 966:0000 990:0020 996:0000 1020:0001 1026:0000 1050:0010 1056:0000 1080:0010 1086:0000 1110:0080 1116:0000 1140:0001 1146:0000 1200:0010 1206:0000 1230:0010 1236:0000 1260:0001 1266:0000 1290:0020 1296:0000 1320:0020 1326:0000 1350:0001 1356:0000 1420:0002 1426:0000 1500:0002 1506:0000

# item shop: open it and stay in it (online: the others go on while this player's menu is open)
item_stay   room=1 bag=6 money=400 held=1                  0:0040 390:0000 600:0020 678:0000 700:0040 740:0000 760:0001 766:0000 920:0001 926:0000

# weapon shop: buy the first of the goods (160), leave
weapon      room=1 bag=7 money=240 held=1 free=1           0:0040 390:0000 600:0010 639:0000 700:0040 740:0000 760:0001 766:0000 920:0001 926:0000 960:0001 966:0000 990:0020 996:0000 1020:0080 1026:0000 1050:0001 1056:0000 1120:0002 1126:0000 1200:0002 1206:0000

# armour shop: buy the first of the goods (160), leave
armour      room=1 bag=7 money=240 held=1 free=1           0:0040 390:0000 600:0010 678:0000 700:0040 740:0000 760:0001 766:0000 920:0001 926:0000 960:0001 966:0000 990:0020 996:0000 1020:0080 1026:0000 1050:0001 1056:0000 1120:0002 1126:0000 1200:0002 1206:0000

# blacksmith, appraiser: open, leave
smith       room=1 bag=6 money=400 held=1 free=1           0:0040 390:0000 600:0010 717:0000 740:0040 780:0000 800:0001 806:0000 960:0001 966:0000 1040:0002 1046:0000 1120:0002 1126:0000
appraiser   room=1 bag=6 money=400 held=1 free=1           0:0040 390:0000 600:0020 717:0000 740:0040 780:0000 800:0001 806:0000 960:0001 966:0000 1040:0002 1046:0000 1120:0002 1126:0000

# storage: put the first record of the bag away, leave
storage     room=1 bag=5 money=400 held=1 free=1           0:0040 390:0000 600:0020 639:0000 700:0040 740:0000 760:0001 766:0000 920:0001 926:0000 960:0001 966:0000 990:0010 996:0000 1020:0010 1026:0000 1050:0010 1056:0000 1080:0010 1086:0000 1110:0010 1116:0000 1140:0001 1146:0000 1220:0002 1226:0000 1300:0002 1306:0000

# the game's own menu (Start) in the hall: the bag, the status page, the window colours, each opened and left
menus       room=1 bag=6 money=400 held=1 free=1           0:0040 390:0000 600:0008 606:0000 660:0001 666:0000 780:0002 786:0000 860:0002 866:0000 1000:0008 1006:0000 1060:0020 1066:0000 1120:0001 1126:0000 1240:0002 1246:0000 1320:0002 1326:0000 1460:0008 1466:0000 1520:0010 1526:0000 1580:0001 1586:0000 1700:0002 1706:0000 1780:0002 1786:0000

# out of the hall and in again, twice (online: a player comes and goes while another one's menu is open)
come_go     room=1 bag=6 money=400 free=1                  0:0040 390:0000 1000:0080 1060:0000 1300:0040 1330:0000 1500:0080 1560:0000 1800:0040 1830:0000
