global ganserlist, ganserloclist, gseikai, gpeacech, gbattinglist
on initquiz
set gseikai to 0
set ganserflg to 0
set gpeacech to 0
set ganserloclist to []
set gbattinglist to [1: 0, 2: 0, 3: 0, 4: 0, 5: 0]
end
on setpalam1
set ganserlist to [1: 19, 2: 22, 3: 23, 4: 20, 5: 21]
end
on setpalam2
set ganserlist to [1: 20, 2: 23, 3: 22, 4: 19, 5: 21]
end
on setpalam3
set ganserlist to [1: 23, 2: 22, 3: 21, 4: 19, 5: 20]
end
on setpalam4
set ganserlist to [1: 23, 2: 19, 3: 21, 4: 22, 5: 20]
end
on setstage1
repeat with n = 19 to 23
set the cursor of sprite n to [member "yubiP", member "yubiPM"]
set h to the locH of sprite n
set v to the locV of sprite n
set poslist to [h, v]
addAt(ganserloclist, poslist)
puppetSprite(n, 1)
set the moveableSprite of sprite n to 1
end repeat
end
on peacescdown
set gpeacech to clickOn()
if the moveableSprite of sprite gpeacech then
set the cursor of sprite gpeacech to [member "yubiG", member "yubiGM"]
end if
end
on peacescup
repeat with n = 31 to 35
if sprite gpeacech within n then
if getaProp(gbattinglist, n - 30) <> gpeacech then
set batsprite to getaProp(gbattinglist, n - 30)
set locl to getAt(ganserloclist, n - 30)
set the locH of sprite batsprite to getAt(locl, 1)
set the locV of sprite batsprite to getAt(locl, 2)
set the moveableSprite of sprite batsprite to 1
set the cursor of sprite batsprite to [member "yubiP", member "yubiPM"]
end if
if the moveableSprite of sprite gpeacech then
puppetSound(3, "poof")
end if
setaProp(gbattinglist, n - 30, gpeacech)
set the rect of sprite gpeacech to the rect of sprite (n - 6)
set the moveableSprite of sprite gpeacech to 0
set the cursor of sprite gpeacech to 0
cursor(0)
exit repeat
next repeat
end if
set locl to getAt(ganserloclist, gpeacech - 18)
set the locH of sprite gpeacech to getAt(locl, 1)
set the locV of sprite gpeacech to getAt(locl, 2)
set the cursor of sprite gpeacech to [member "yubiP", member "yubiPM"]
end repeat
updateStage()
end
on stage
if not (the moveableSprite of sprite 19 or the moveableSprite of sprite 20 or the moveableSprite of sprite 21 or the moveableSprite of sprite 22 or the moveableSprite of sprite 23) then