@program pxslots.muf 1 1000 d i $include $lib/alynna lvar temp lvar slot1 lvar slot2 lvar slot3 : slot ( -- i ) random 100 % temp ! temp @ 98 >= if 1 exit then temp @ 95 >= if 2 exit then temp @ 90 >= if 3 exit then temp @ 80 >= if 4 exit then temp @ 70 >= if 5 exit then temp @ 50 >= if 6 exit then temp @ 30 >= if 7 exit then temp @ 0 >= if 8 exit then ; : slotval ( i -- i ) temp ! temp @ 1 = if 50 exit then temp @ 2 = if 30 exit then temp @ 3 = if 20 exit then temp @ 4 = if 10 exit then temp @ 5 = if 5 exit then temp @ 6 = if 3 exit then temp @ 7 = if 2 exit then temp @ 8 = if 1 exit then ; : slottxt ( i -- i ) temp ! temp @ 1 = if "7====Seven====7" exit then temp @ 2 = if "--====Bar====--" exit then temp @ 3 = if "+--|Vulpix|---+" exit then temp @ 4 = if "*---Pikachu---*" exit then temp @ 5 = if "#-Jigglypuff--#" exit then temp @ 6 = if "(--Pokeball---)" exit then temp @ 7 = if "@---Poliwag---@" exit then temp @ 8 = if "!---Cherry----!" exit then ; : main me @ name "Alynna" smatch not if me @ "_slottime" getprop dup if dup int? if systime over - 5 < if me @ "The machine is resetting (5 seconds)..." notify exit then then then then slot slot1 ! slot slot2 ! slot slot3 ! $iflib $lib/rp me @ "yen" getstat toint 5 >= if me @ "yen" over over getstat 5 - setstat str "You insert 5 yen and pull the lever!" cat "Slots" pretty tellme else str "You dont have enough yen. " cat "Slots" pretty tellme then $endif ( show it ) str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat "Slots" pretty tellme ( check for 3 winnings ) slot1 @ slot2 @ = slot2 @ slot3 @ = and if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! 3 in a row! " me @ " wins *" slot1 @ slotval 10 * "* yen!" cat "Slots" pretty tellhere $iflib $lib/rp me @ "yen" over over getstat slot1 @ slotval 10 * + setstat $endif else ( check for 2 winnings ) slot1 @ slot2 @ = slot1 @ 6 <= and if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! 2 in a row! " me @ " wins *" slot1 @ slotval 3 * "* yen!" cat "Slots" pretty tellhere $iflib $lib/rp me @ "yen" over over getstat slot1 @ slotval 3 * + setstat $endif else ( check for 1 winnings ) slot1 @ 4 <= if str slot1 @ slottxt " " slot2 @ slottxt " " slot3 @ slottxt cat me @ name pretty tellhere str "WIN! " me @ " wins *" slot1 @ slotval "* yen!" cat "Slots" pretty tellhere $iflib $lib/rp me @ "yen" over over getstat slot1 @ slotval 1 * + setstat $endif then then then me @ "_slottime" systime setprop ; . c q