# Plan 6 Task 5: a joined battle against ONE trainer (kind 3, SINGLE) pays that trainer's own prize and flags only that trainer. The
# trainer is GABBY & TY 1 (51), whose record is a double battle: the one-trainer prize is x2 (pk_coop_prize_single: 816 x 2 = 1632, what the
# game pays for that trainer alone), not the two-trainer sum. The bridge still runs the tower's two-trainer link multi (a second AI trainer,
# CALVIN 318, stands in at the other side - the single-trainer battle's own enemy party is a later task's), but the battle's result is a
# SINGLE one: one trainer id (51), no second (flags b1 clear), 1632 paid on each core, only trainer 51's flag set (318's stays clear).
#
# want: PASS linkwait 2
# want: PASS linkresultwait
# want: link: result a 16 01 01 00 00 33 00 00 00 60 06 00 00 00 00 00 00
# want: link: result b 16 01 01 00 00 33 00 00 00 60 06 00 00 00 00 00 00
# want: PASS link money
# want: PASS linkflag 51 = 1 (core a)
# want: PASS linkflag 318 = 0 (core a)
# want: PASS linkflag 51 = 1 (core b)
# want: PASS linkflag 318 = 0 (core b)
pair $PARTNER_SAVE
on b
@boot
poke16 0x02024542 999
poke16 0x02024544 999
on a
poke16 0x02024542 999
poke16 0x02024544 999
linkmoneymark 0
coopbegin 1 3 51 318
on b
linkmoneymark 0
coopbegin 0 3 51 318
linkwait 2 1500
on a
waitmem32 0x03005D60 0x08057589 3000
on b
waitmem32 0x03005D68 0x08057589 3000
on a
poke8 0x0202433A 1
hold A 4
linkrun 40
hold A 4
linkrun 40
hold A 4
linkrun 40
on b
hold A 4
linkrun 40
hold A 4
linkrun 40
hold A 4
linkrun 40
linkresultwait 4000
on a
linkresult a
linkmoneyexpect 0 1632
linkflag 51 1
linkflag 318 0
coopexpectfree 1
on b
linkresult b
linkmoneyexpect 0 1632
linkflag 51 1
linkflag 318 0
coopexpectfree 1
