home *** CD-ROM | disk | FTP | other *** search
- on LoadTempGame
- global tSNAME, tUNAME, CALL_F, tTWNS, tJOBS, tAction, J, tRANS, tWANS, DTQR, DTQW, tKARM, tSEX, tCASH, PNM, tYY, tMM, tDD, tDAYS, tDEPDD, tAFDD, tTRAVEL, tARRIVE_CASH, tPHONE_M, tAUKT_JOBS
- if the machineType = 256 then
- openXLib(the pathName & "FILEIO.DLL")
- set FILE to FileIO(mnew, "?read", "bpd")
- else
- if the machineType <> 256 then
- set FILE to FileIO(mnew, "?read", "BPdr")
- end if
- end if
- if not objectp(FILE) then
- ErrorH(FILE)
- exit
- end if
- set S to FILE(mReadLine)
- if not S contains "BackPacker Game - version 1.0" then
- ErrorH(999)
- exit
- end if
- set tSNAME to FILE(mReadLine)
- delete char length(tSNAME) of tSNAME
- set tUNAME to FILE(mReadLine)
- delete char length(tUNAME) of tUNAME
- set tSEX to value(FILE(mReadLine))
- set tCASH to value(FILE(mReadLine))
- set tEXCF to value(FILE(mReadLine))
- set tAction to value(FILE(mReadLine))
- set tLIVC to value(FILE(mReadLine))
- set RRFCC to value(FILE(mReadLine))
- set tYY to value(FILE(mReadLine))
- set tMM to value(FILE(mReadLine))
- set tDD to value(FILE(mReadLine))
- set tDTQR to value(FILE(mReadLine))
- set tDTQW to value(FILE(mReadLine))
- set tLQNO to value(FILE(mReadLine))
- set tRANS to value(FILE(mReadLine))
- set tWANS to value(FILE(mReadLine))
- set tKARM to value(FILE(mReadLine))
- set tDAYS to value(FILE(mReadLine))
- set tDEPDD to value(FILE(mReadLine))
- set tAFDD to value(FILE(mReadLine))
- set tTRAVEL to value(FILE(mReadLine))
- set tARRIVE_CASH to value(FILE(mReadLine))
- set tPHONE_M to value(FILE(mReadLine))
- set tAUKT_JOBS to value(FILE(mReadLine))
- set tGameFileName to FILE(mFileName)
- FILE(mdispose)
- if the machineType = 256 then
- closeXLib(the pathName & "FILEIO.DLL")
- end if
- if not CodeMachine("Decode", RRFCC) then
- ErrorH(666)
- exit
- end if
- set tLPDAY to tDAYS
- MakeTempLists()
- pause()
- continue()
- go(the frame + 1)
- end
-
- on ErrorH ErrMess
- if ErrMess = -43 then
- nothing()
- else
- if ErrMess = -49 then
- alert("Cannot replace old files!")
- else
- if ErrMess < 0 then
- alert("Problem reading the file!")
- else
- if ErrMess = 666 then
- alert("This BackPacker document is corrupt and cannot be used!")
- else
- if ErrMess = 999 then
- alert("This is not a compatible BackPacker document!")
- end if
- end if
- end if
- end if
- end if
- end
-
- on CodeMachine Message, readnumber
- global tCASH, tSEX, tSNAME, tAction, tDAYS, tKARM, tUNAME, tYY, tTRAVEL, tPHONE_M
- if tSNAME <> EMPTY then
- set ASCII to charToNum(char 1 of tSNAME)
- else
- set ASCII to 9
- end if
- if (count(tAction) < 20) and (tCASH < 4000) then
- set codenumber to tYY + (length(tSNAME) * integer(tCASH)) + tSEX + integer(tKARM) + count(tAction) - getAt(tAction, 1) + 129 + ASCII + (3435 * tDAYS) - tTRAVEL + tPHONE_M
- else
- if ((tDAYS + count(tAction)) >= 19) and ((tDAYS + count(tAction)) < 45) then
- set codenumber to length(tSNAME) + (integer(tCASH) * tSEX) + integer(tKARM) + count(tAction) - getAt(tAction, 3) + 469 - (2 * tPHONE_M) - (456 * tDAYS) - (24 * tTRAVEL)
- else
- if (length(tUNAME) + integer(tCASH / 1000)) > 10 then
- set codenumber to (tDAYS * integer(tCASH) * 67) + 9 + count(tAction) + ASCII + (2 * tYY) - integer(tKARM) + (tTRAVEL * tPHONE_M) + integer(tKARM)
- else
- if (tPHONE_M < 1500) and (tCASH > 3000) then
- set codenumber to (tDAYS * integer(tCASH) * 63) + 9 + count(tAction) + tYY + (19 * integer(tKARM)) - (320 * tTRAVEL) - tPHONE_M
- else
- set codenumber to (tDAYS * integer(tCASH) * 60) + count(tAction) + tYY + (19 * integer(tKARM)) - (302 * tTRAVEL) - tPHONE_M + 56
- end if
- end if
- end if
- end if
- if Message = "code" then
- return codenumber
- else
- if Message = "decode" then
- if readnumber = codenumber then
- return 1
- else
- return 0
- end if
- end if
- end if
- end
-