home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
various
/
amosgold.amos
/
amosgold.amosSourceCode
next >
Wrap
AMOS Source Code
|
1993-01-08
|
11KB
|
501 lines
'* POKER MACHINE *
'* WRITTEN IN AMOS BASIC V1.2 *
'* BY PETER CRAVEN MAY 1991 *
'* P.O. Box 561 WEIPA *
'* Qld. 4874 *
Set Buffer 18
Unpack 2 To 0
Unpack 3 To 1
Limit Mouse 128,42 To 440,294
Double Buffer
Colour 13,822
Flash 3,"(B22,10)(FF0,10)"
Dim REEL$(15),HELD(5),HOLDBOB(15),REELSTOP(15),RSTOP$(15),LINE(3),RESULT(5,3),AJPOT$(8),BJPOT$(8),CJPOT$(8),APAYT(8),BPAYT(8),CPAYT(8),LINE$(3)
Global REEL$(),HELD(),HOLDBOB(),REELSTOP(),LINE(),RESULT(),SIT,HOLDOPTION,MZ,LASTHELD
Global AJPOT$(),BJPOT$(),CJPOT$(),LINE$(),RSTOP$(),WIN,GO,GAME,NOHOLD
Global APAYT(),BPAYT(),CPAYT(),CREDIT,REELSHELD
Gr Writing 0
For K=1 To 3
Hot Spot 8+K,0,128
Next K
Bob 16,277,203,9
Proc CREATEZONES
Proc HOWTO
HOLDOPTION=0 : LASTHELD=0 : CREDIT=100 : GAME=0 : FIRST=1
For K=1 To 3
LINE(K)=0
Next K
Proc SCORES
Proc REELSTARTPOS
Proc CHANSET
RESTART:
GAME=0
Proc SCOREBOARD
Proc HOLDREEL
Proc LINESELECT
Proc REELSET
If FIRST=0
Proc REELPOSITION
End If
FIRST=0
Do
Proc GAMEPLAY["NO"]
GO=LINE(1)+LINE(2)+LINE(3)
Exit If GO>0 and REELSHELD<5
If REELSHELD=5
Ink 3,7
Text 70,214,"CANNOT HOLD ALL REELS!!"
Wait 100
Cls 7,70,204 To 264,215
End If
If GO=0
Ink 3,7
Text 95,214,"NO COINS PLAYED!!"
Wait 100
Cls 7,94,204 To 240,215
End If
Loop
GAME=1
Proc SPINRESULT
Proc LIMIT
Proc HANDLE
Proc SPIN
Proc TESTBOB
Proc PAYOUT
Add CREDIT,WIN
Proc SCOREBOARD
If WIN>0
Ink 3
Paint 1,1
Wait 100
Ink 13
Paint 1,1
End If
Do
K=Mouse Key
Exit If K=1
If K=2
Proc CHART
End If
Loop
Proc RESET
Goto RESTART
Procedure RESET
LASTHELD=0 : REELSHELD=0
For K=1 To 3
LINE$(K)=""
LINE(K)=0
Next K
For K=1 To 15
HOLDBOB(K)=0
Next K
For K=1 To 5
If HELD(K)=1 Then LASTHELD=1
HELD(K)=0
Next K
If WIN=0 and LASTHELD=0 and NOHOLD=0
HOLDOPTION=1
Else HOLDOPTION=0
End If
WIN=0 : NOHOLD=0
End Proc
Procedure CHANSET
For K=1 To 15
Channel K To Bob K
Next K
End Proc
Procedure SPIN
For K=1 To 15
If HOLDBOB(K)<>1
Anim K,RSTOP$(K)
End If
Anim On
Next K
Wait SIT+5
End Proc
Procedure REELSTARTPOS
For K=1 To 8
Hot Spot K,0,0
Next K
For K=1 To 15
Read X,Y,I
Bob K,X,Y,I
Next K
Data 73,59,6,73,95,4,73,131,2
Data 109,59,8,109,95,2,109,131,7
Data 145,59,2,145,95,5,145,131,4
Data 181,59,2,181,95,8,181,131,6
Data 217,59,4,217,95,6,217,131,2
End Proc
Procedure HANDLE
Channel 0 To Bob 16
HANDLE$="A 1,(9,10)(10,10)(11,8)(10,6)(9,10)"
Amal 0,HANDLE$
Amal On
Wait 10
End Proc
Procedure SPINRESULT
Randomize Timer
For K=1 To 5
RSTOP=(Rnd(19)+1)*5
For M=1 To 3
REELSTOP((K-1)*3+M)=RSTOP
Next M
Next K
For K=1 To 15
RSTOP$(K)=Left$(REEL$(K),REELSTOP(K))
Next K
For K=1 To 5
If HELD(K)=0
For N=K To 5
If HELD(N)=0
For M=1 To 3
H=(N-1)*3+M
RSTOP$(H)=REEL$(H)+RSTOP$(H)
Next M
End If
Next N
End If
Next K
For K=1 To 15
RSTOP$(K)=RSTOP$(K)+Right$(RSTOP$(K),5)
Next K
End Proc
Procedure TESTBOB
For L=1 To 3
For C=1 To 5
K=(C-1)*3+L
RESULT(C,L)=I Bob(K)
Next C
Next L
End Proc
Procedure HOLDREEL
Set Paint 1
Ink 12,,9
Bar 69,176 To 251,200
Ink 9
For K=1 To 5
Box 71+(K-1)*36,178 To 105+(K-1)*36,198
If HOLDOPTION=1
Ink 9
Text 73+(K-1)*36,190,"HOLD"
End If
Next K
End Proc
Procedure LINESELECT
Ink 11
Bar 4,56 To 44,166
Ink 9
For K=1 To 3
Box 6,58+(K-1)*36 To 42,92+(K-1)*36
Text 8,78+(K-1)*36,"LINE"
Next K
End Proc
Procedure GAMEPLAY[SPIN$]
While SPIN$="NO"
MC=Mouse Key
MZ=Mouse Zone
If MZ=9 and MC>0
SPIN$="GO"
End If
If MC>0 and(MZ=1 or MZ=2 or MZ=3)
Proc LINES
End If
If MC>0 and MZ>=4 and MZ<=8 and HOLDOPTION=1
Proc HOLD
End If
If MZ=10 and MC>0
Proc CHART
End If
Wend
End Proc
Procedure CREATEZONES
Reserve Zone 12
For K=1 To 3
Set Zone K,6,58+(K-1)*36 To 42,92+(K-1)*36
Next K
For K=1 To 5
Set Zone K+3,71+(K-1)*36,178 To 105+(K-1)*36,198
Next K
Set Zone 9,272,72 To 304,200
Set Zone 10,50,8 To 270,36
End Proc
Procedure LINES
If LINE(MZ)=1
LINE(MZ)=0
K=11 : N=9
Inc CREDIT
Else
LINE(MZ)=1
K=24 : N=0
Dec CREDIT
End If
Cls K,7,59+(MZ-1)*36 To 42,92+(MZ-1)*36
Ink N : Text 8,78+(MZ-1)*36,"LINE"
Proc SCOREBOARD
End Proc
Procedure SCORES
For K=1 To 8
Read AJPOT$(K)
Next K
For K=1 To 8
BJPOT$(K)=Left$(AJPOT$(K),4)
Next K
For K=1 To 8
CJPOT$(K)=Left$(AJPOT$(K),3)
Next K
For K=1 To 8
Read APAYT(K)
Next K
For K=1 To 8
Read BPAYT(K)
Next K
For K=1 To 8
Read CPAYT(K)
Next K
Data "11111","22222","33333","44444","55555","66666","77777","88888"
Data 3000,500,5000,4000,300,2000,1000,150
Data 200,50,500,500,25,150,75,25
Data 50,15,100,75,10,25,15,10
End Proc
Procedure PAYOUT
SCATS=0
For L=1 To 3
For C=1 To 5
LINE$(L)=LINE$(L)+Str$(RESULT(C,L))-" "
Next C
Next L
For L=1 To 3
LL$=LINE$(L)
For K=1 To 8
If LL$=(AJPOT$(K)) and(APAYT(K)>WIN) and(LINE(L)=1)
WIN=APAYT(K)
End If
If LL$=(AJPOT$(K)) and(LINE(L))=0
NOHOLD=1
End If
Next K
Next L
If WIN>0
Pop Proc
End If
For L=1 To 3
LL$=Left$(LINE$(L),4)
For K=1 To 8
If LL$=(BJPOT$(K)) and(BPAYT(K)>WIN) and(LINE(L)=1)
WIN=BPAYT(K)
End If
If LL$=(BJPOT$(K)) and(LINE(L))=0
NOHOLD=1
End If
Next K
Next L
If WIN>0
Pop Proc
End If
For L=1 To 3
LL$=Right$(LINE$(L),4)
For K=1 To 8
If LL$=(BJPOT$(K)) and(BPAYT(K)>WIN) and(LINE(L)=1)
WIN=BPAYT(K)
End If
If LL$=(BJPOT$(K)) and(LINE(L))=0
NOHOLD=1
End If
Next K
Next L
If WIN>0
Pop Proc
End If
For L=1 To 3
LL$=Left$(LINE$(L),3)
For K=1 To 8
If LL$=(CJPOT$(K)) and(CPAYT(K)>WIN) and(LINE(L)=1)
WIN=CPAYT(K)
End If
If LL$=(CJPOT$(K)) and(LINE(L))=0
NOHOLD=1
End If
Next K
Next L
If WIN>0
Pop Proc
End If
For L=1 To 3
LL$=Right$(LINE$(L),3)
For K=1 To 8
If LL$=(CJPOT$(K)) and(CPAYT(K)>WIN) and(LINE(L)=1)
WIN=CPAYT(K)
End If
If LL$=(CJPOT$(K)) and(LINE(L))=0
NOHOLD=1
End If
Next K
Next L
For DWN=1 To 5
For ROW=1 To 3
D=RESULT(DWN,ROW)
If D=3
Inc SCATS
End If
Next ROW
Next DWN
If GO=3
If SCATS=5 and WIN<40
WIN=25
End If
If SCATS=4 and WIN<15
WIN=15
End If
End If
If SCATS>3 and GO<3
NOHOLD=1
End If
If WIN>0
Pop Proc
End If
For L=1 To 3
LL$=Left$(LINE$(L),2) : LR$=Right$(LINE$(L),2)
If(LL$="88") and(LINE(L)=1)
WIN=5
End If
If(LR$="88") and(LINE(L)=1)
WIN=5
End If
If(LR$="88") and(LINE(L)=0)
NOHOLD=1
End If
If(LL$="88") and(LINE(L)=0)
NOHOLD=1
End If
Next L
End Proc
Procedure LIMIT
N=6 : LASTREEL=0
While LASTREEL=0
Dec N
If HELD(N)=0 Then LASTREEL=N
Wend
NOHELDS=5-REELSHELD
SIT=4+80*NOHELDS+((REELSTOP(LASTREEL*3))/5)*4
End Proc
Procedure HOLD
M=MZ-3
If HELD(M)=0
HELD(M)=1
Inc REELSHELD
K=23 : N=0
Else HELD(M)=0
K=12 : N=9
Dec REELSHELD
End If
Cls K,72+(M-1)*36,179 To 105+(M-1)*36,198
Ink N : Text 73+(M-1)*36,190,"HOLD"
For K=1 To 5
For N=1 To 3
M=N+(K-1)*3
If HELD(K)=1
HOLDBOB(M)=1
Else HOLDBOB(M)=0
End If
Next N
Next K
End Proc
Procedure SCOREBOARD
WIN$=Str$(WIN)-" "
CREDIT$=Str$(CREDIT)-" "
If WIN=0
If GAME=0
WIN$=""
Else WIN$="---"
End If
End If
Cls 0,98,222 To 136,232
Ink 3 : Text 135-Len(WIN$)*8,230,WIN$
Cls 0,190,222 To 252,232
Ink 5 : Text 250-Len(CREDIT$)*8,230,CREDIT$
End Proc
Procedure CHART
Screen To Back 1
Limit Mouse 128,48 To 148,68
While MCLICK=0
MCLICK=Mouse Click
Wend
Screen To Back 0
Limit Mouse
End Proc
Procedure HOWTO
HOLDOPTION=1
Proc LINESELECT
Proc HOLDREEL
Ink 19
Set Text 1
Text 116,66,"HOW TO PLAY"
Set Text 4
Ink 4 : Text 72,78,"To Select LINE" : Ink 5 : Text 86,86,"Click boxes at left"
Ink 4 : Text 72,98,"To Select HOLD" : Ink 5 : Text 86,106,"Click boxes below"
Ink 4 : Text 72,118,"To View Odds Screen" : Ink 5 : Text 86,126,"click AMOS GOLD"
Ink 4 : Text 72,138,"To Spin the reels" : Ink 5 : Text 86,146,"click Handle"
Set Text 1
Ink 26 : Text 110,160,"PRESS ANY KEY"
Set Text 0
While HOW$=""
HOW$=Inkey$
MZ=Mouse Zone
MC=Mouse Key
If MZ=9 and MC=1
Proc HANDLE
End If
If MZ=10 and MC=1
Proc CHART
End If
If MZ>0 and MZ<4 and MC=1
Proc LINES
Wait 20
End If
If MZ>3 and MZ<9 and MC=1
Proc HOLD
Wait 20
End If
Wend
For K=1 To 5
HELD(K)=0
Next K
For K=1 To 15
HOLDBOB(K)=0
Next K
Def Scroll 11,72,58 To 249,110,-2,-3
Def Scroll 12,71,109 To 249,164,2,3
For K=1 To 20
Scroll 11 : Scroll 12
Next K
End Proc
Procedure REELSET
REEL$(1)="(6,4)(2,4)(5,4)(1,4)(2,4)(7,4)(8,4)(7,4)(5,4)(3,4)(8,4)(4,4)(7,4)(1,4)(3,4)(6,4)(5,4)(8,4)(2,4)(4,4)"
REEL$(2)="(4,4)"+Left$(REEL$(1),95)
REEL$(3)="(2,4)"+Left$(REEL$(2),95)
'
REEL$(4)="(8,4)(6,4)(3,4)(5,4)(2,4)(1,4)(7,4)(2,4)(8,4)(5,4)(6,4)(8,4)(4,4)(1,4)(5,4)(6,4)(8,4)(5,4)(7,4)(2,4)"
REEL$(5)="(2,4)"+Left$(REEL$(4),95)
REEL$(6)="(7,4)"+Left$(REEL$(5),95)
'
REEL$(7)="(2,4)(8,4)(1,4)(6,4)(7,4)(3,4)(5,4)(4,4)(5,4)(2,4)(8,4)(7,4)(8,4)(2,4)(7,4)(6,4)(1,4)(5,4)(4,4)(5,4)"
REEL$(8)="(5,4)"+Left$(REEL$(7),95)
REEL$(9)="(4,4)"+Left$(REEL$(8),95)
'
REEL$(10)="(2,4)(7,4)(5,4)(8,4)(6,4)(5,4)(1,4)(4,4)(8,4)(6,4)(5,4)(8,4)(2,4)(7,4)(1,4)(2,4)(5,4)(3,4)(6,4)(8,4)"
REEL$(11)="(8,4)"+Left$(REEL$(10),95)
REEL$(12)="(6,4)"+Left$(REEL$(11),95)
'
REEL$(13)="(4,4)(2,4)(8,4)(5,4)(6,4)(3,4)(1,4)(7,4)(4,4)(8,4)(3,4)(5,4)(7,4)(8,4)(7,4)(2,4)(1,4)(5,4)(2,4)(6,4)"
REEL$(14)="(6,4)"+Left$(REEL$(13),95)
REEL$(15)="(2,4)"+Left$(REEL$(14),95)
End Proc
Procedure REELPOSITION
REELCYCLE=Len(REEL$(1))
For K=1 To 15
L$=Right$(REEL$(K),REELCYCLE-(REELSTOP(K)-5))
R$=Left$(REEL$(K),REELSTOP(K)-5)
REEL$(K)=L$+R$
Next K
End Proc