home *** CD-ROM | disk | FTP | other *** search
/ Hope PC Multimedia SuperPack 2 / HOMEPC.iso / TAROT / DOWNLOAD / VT3.ZIP / C1.DXR / 00193.ls < prev    next >
Encoding:
Text File  |  1995-11-02  |  10.0 KB  |  327 lines

  1. on startMovie
  2.   global userName, MaxChars, BackSnds, chanvols, mouseUp, qQuestion, DivType, logged, MaxCard, t, mouseUp, author, rIndex, mouseUp, moviePath, usrFileLocation, PlayBS, CardsDealt, tmpVar, CardCoord, FieldNames, UsrDivToneSet, UsrDivColourSet, UsrDivMeanSet, CCcards, Instruct, Sound_Level, Prnt, AnimPath, Cnt, Opt, PrntArray, CPosition, Snd1Max, Snd2Max
  3.   set DivType to "Celtic Cross"
  4.   set MaxChars to 10
  5.   set logged to 0
  6.   set MaxCard to 10
  7.   set rIndex to 1
  8.   set moviePath to the moviePath
  9.   if machineType = 256 then
  10.     openXLib("FILEIO")
  11.   end if
  12.   if CreateTables() = -1 then
  13.     alert("Fatal Error creating Virtual Tarot reference tables!")
  14.   end if
  15.   set UsrDivToneSet to 1
  16.   set UsrDivColourSet to 1
  17.   set UsrDivMeanSet to 1
  18.   set Instruct to 0
  19.   set Prnt to 0
  20.   set Cnt to 0
  21.   set Opt to 0
  22.   set PlayBS to 1
  23.   set author to "Foster"
  24.   set BackSnds to ArrayFactory(mnew)
  25.   set chanvols to ArrayFactory(mnew)
  26.   set CardCoord to ArrayFactory(mnew)
  27.   set FieldNames to ArrayFactory(mnew)
  28.   chanvols(mput, 1, the volume of sound 1)
  29.   chanvols(mput, 2, the volume of sound 2)
  30.   set usrFileLocation to "UnInitialized"
  31.   set moviePath to the moviePath
  32.   set CardsDealt to 1
  33.   set tmpVar to 5
  34.   set CCcards to "0,0,0,0,0,0,0,0,0,0"
  35.   set PrntArray to ArrayFactory(mnew)
  36.   set CPosition to ArrayFactory(mnew)
  37.   CardCoord(mput, 1, "163,230")
  38.   CardCoord(mput, 2, "220,275")
  39.   CardCoord(mput, 3, "163,361")
  40.   CardCoord(mput, 4, "63,230")
  41.   CardCoord(mput, 5, "163,98")
  42.   CardCoord(mput, 6, "310,230")
  43.   CardCoord(mput, 7, "440,361")
  44.   CardCoord(mput, 8, "560,275")
  45.   CardCoord(mput, 9, "440,184")
  46.   CardCoord(mput, 10, "560,98")
  47.   CPosition(mput, 1, "CELTIC1")
  48.   CPosition(mput, 2, "CELTIC2")
  49.   CPosition(mput, 3, "CELTIC3")
  50.   CPosition(mput, 4, "CELTIC4")
  51.   CPosition(mput, 5, "CELTIC5")
  52.   CPosition(mput, 6, "CELTIC6")
  53.   CPosition(mput, 7, "CELTIC7")
  54.   CPosition(mput, 8, "CELTIC8")
  55.   CPosition(mput, 9, "CELTIC9")
  56.   CPosition(mput, 10, "CELTIC10")
  57.   if the machineType = 256 then
  58.     BackSnds(mput, 1, "Themes\CCross1")
  59.     BackSnds(mput, 2, "Themes\CCross1")
  60.     BackSnds(mput, 3, "Themes\CCross1")
  61.     BackSnds(mput, 4, "Themes\CCross1")
  62.   else
  63.     BackSnds(mput, 1, "Themes:CCross1")
  64.     BackSnds(mput, 2, "Themes:CCross1")
  65.     BackSnds(mput, 3, "Themes:CCross1")
  66.     BackSnds(mput, 4, "Themes:CCross1")
  67.   end if
  68.   InitSnd()
  69.   PlayBackSnds()
  70. end
  71.  
  72. on idle
  73.   if soundBusy(1) <> 1 then
  74.     PlaySound(1, "Silence", 0, 1)
  75.   end if
  76.   if soundBusy(2) <> 1 then
  77.     PlayBackSnds()
  78.   end if
  79. end
  80.  
  81. on Z q
  82.   put the locH of sprite q && the locV of sprite q
  83. end
  84.  
  85. on RevealCard CardIndex
  86.   global CardCoord, CCcards
  87.   set C to 22
  88.   set H to 23
  89.   puppetSprite(C, 1)
  90.   puppetSprite(H, 1)
  91.   set coord to CardCoord(mget, CardIndex)
  92.   set Card to item CardIndex of CCcards
  93.   set the castNum of sprite C to the number of cast Card
  94.   set the locH of sprite C to value(item 1 of coord)
  95.   set the locV of sprite C to value(item 2 of coord)
  96.   set the locH of sprite H to value(item 1 of coord)
  97.   set the locV of sprite H to value(item 2 of coord)
  98.   puppetTransition(50, 1, 16, 1)
  99.   updateStage()
  100.   PlayCardVocal(CardIndex, 0)
  101. end
  102.  
  103. on CCrandomCard
  104.   global rIndex, CCindexes, CardsDealt, MaxCard, CdNames, Cnt, Opt, DigO
  105.   set DigO to 1
  106.   if ((Cnt = 2) and (Opt = 2)) or Trumps then
  107.     set Modulo to 22
  108.   else
  109.     if (Cnt = 2) or DigO then
  110.       set Modulo to 78
  111.     else
  112.       set Modulo to 156
  113.     end if
  114.   end if
  115.   set rIndex to (random(Modulo) + the lastClick) mod Modulo
  116.   if CardsDealt = 10 then
  117.     set name to line rIndex of CdNames
  118.     if (name contains "Knight") or (name contains "Page") or (name contains "Queen") or (name contains "King") then
  119.       set rIndex to 0
  120.     end if
  121.   end if
  122.   repeat while (CCindexes contains string(rIndex)) or (CCindexes contains string(rIndex mod 78)) or (CCindexes contains string(rIndex + 78)) or ((rIndex mod 78) = 0) or (rIndex = 0)
  123.     set rIndex to (random(Modulo) + the lastClick) mod Modulo
  124.     if CardsDealt = 10 then
  125.       set name to line rIndex of CdNames
  126.       if (name contains "Knight") or (name contains "Page") or (name contains "Queen") or (name contains "King") then
  127.         set rIndex to 0
  128.       end if
  129.     end if
  130.   end repeat
  131.   PutCard("Move", MaxCard)
  132. end
  133.  
  134. on PutCard move, MaxCard
  135.   global CardsDealt, CardCoord, CardList, CCcards, CCindexes, CdNames, DigWaite, IllDigWaite, DigFoster, IllDigFoster, author, Dignified, rIndex, sndFile, ClrFile, UsrDivToneSet, Cnt
  136.   if CardsDealt <= MaxCard then
  137.     cursor(4)
  138.     if move = "Move" then
  139.       if CardsDealt = 1 then
  140.         go(marker(CardsDealt + 1))
  141.       else
  142.         go(marker(CardsDealt))
  143.       end if
  144.     end if
  145.     puppetSprite(CardsDealt + 10, 0)
  146.     puppetSprite(CardsDealt + 10, 1)
  147.     set CardName to line rIndex of CdNames
  148.     set tmp to char 1 to the number of chars in CardName - 2 of CardName
  149.     set the castNum of sprite (CardsDealt + 10) to the number of cast CardName
  150.     puppetTransition(26, 1, 128, 1)
  151.     if move = "Move" then
  152.       go(the frame + 1)
  153.     end if
  154.     set the locH of sprite (CardsDealt + 10) to value(item 1 of CardCoord(mget, CardsDealt))
  155.     set the locV of sprite (CardsDealt + 10) to value(item 2 of CardCoord(mget, CardsDealt))
  156.     puppetTransition(26, 1, 128, 1)
  157.     updateStage()
  158.     put rIndex into item CardsDealt of CCindexes
  159.     put CardName into item CardsDealt of CCcards
  160.     PlayCardVocal(CardsDealt, 0)
  161.     if UsrDivToneSet and ((rIndex < 23) or ((rIndex mod 78) < 23)) then
  162.       set the volume of sound 1 to 255
  163.       Sound_Color(value(item CardsDealt of CCindexes), 0)
  164.     end if
  165.     set CardsDealt to CardsDealt + 1
  166.     set Cnt to the controlDown
  167.     if move = "Move" then
  168.       if CardsDealt <= MaxCard then
  169.         go(label("idle") + 1)
  170.         cursor(-1)
  171.       else
  172.         go("Fini")
  173.       end if
  174.     end if
  175.   else
  176.     go("intro")
  177.   end if
  178. end
  179.  
  180. on ToggleSound
  181.   global UsrDivToneSet
  182.   if UsrDivToneSet = 1 then
  183.     set UsrDivToneSet to 0
  184.     set the locH of sprite 4 to -500
  185.     set the locV of sprite 4 to -500
  186.   else
  187.     set the locH of sprite 4 to 321
  188.     set the locV of sprite 4 to 457
  189.     set UsrDivToneSet to 1
  190.   end if
  191. end
  192.  
  193. on ToggleColour
  194.   global UsrDivColourSet
  195.   if UsrDivColourSet = 1 then
  196.     set UsrDivColourSet to 0
  197.     set the locH of sprite 3 to -500
  198.     set the locV of sprite 3 to -500
  199.   else
  200.     set UsrDivColourSet to 1
  201.     set the locH of sprite 3 to 399
  202.     set the locV of sprite 3 to 457
  203.   end if
  204. end
  205.  
  206. on ToggleVoice
  207.   global UsrDivMeanSet
  208.   if UsrDivMeanSet = 1 then
  209.     set UsrDivMeanSet to 0
  210.     set the locH of sprite 5 to -500
  211.     set the locV of sprite 5 to -500
  212.   else
  213.     set the locH of sprite 5 to 246
  214.     set the locV of sprite 5 to 457
  215.     set UsrDivMeanSet to 1
  216.   end if
  217. end
  218.  
  219. on CreateTables
  220.   global moviePath, sndFile, ClrFile, CardList, CdNames, CardMeanWaite, DigWaite, IllDigWaite, CardMeanFoster, DigFoster, IllDigFoster
  221.   set fileObj to FileIO(mnew, "read", moviePath & "SndFile")
  222.   if objectp(fileObj) = 0 then
  223.     alert("Error reading Sound File" && moviePath && fileObj)
  224.     return -1
  225.   end if
  226.   set sndFile to fileObj(mReadFile)
  227.   fileObj(mdispose)
  228.   set fileObj to FileIO(mnew, "read", moviePath & "ClrFile")
  229.   if objectp(fileObj) = 0 then
  230.     alert("Error reading Colour File" && moviePath && fileObj)
  231.     return -1
  232.   end if
  233.   set ClrFile to fileObj(mReadFile)
  234.   fileObj(mdispose)
  235.   if the machineType = 256 then
  236.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\CDWaite")
  237.   else
  238.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:CDWaite")
  239.   end if
  240.   if objectp(fileObj) = 0 then
  241.     alert("Error reading Waite Meaning File")
  242.     return -1
  243.   end if
  244.   set CardMeanWaite to fileObj(mReadFile)
  245.   fileObj(mdispose)
  246.   if the machineType = 256 then
  247.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\DWaite")
  248.   else
  249.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:DWaite")
  250.   end if
  251.   if objectp(fileObj) = 0 then
  252.     alert("Error reading Waite Dignified File")
  253.     return -1
  254.   end if
  255.   set DigWaite to fileObj(mReadFile)
  256.   fileObj(mdispose)
  257.   if the machineType = 256 then
  258.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\IDWaite")
  259.   else
  260.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:IDWaite")
  261.   end if
  262.   if objectp(fileObj) = 0 then
  263.     alert("Error reading Waite Ill-Dignified File")
  264.     return -1
  265.   end if
  266.   set IllDigWaite to fileObj(mReadFile)
  267.   fileObj(mdispose)
  268.   if the machineType = 256 then
  269.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\CDFoster")
  270.   else
  271.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:CDFoster")
  272.   end if
  273.   if objectp(fileObj) = 0 then
  274.     alert("Error reading Foster Meaning File")
  275.     return -1
  276.   end if
  277.   set CardMeanFoster to fileObj(mReadFile)
  278.   fileObj(mdispose)
  279.   if the machineType = 256 then
  280.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\DFoster")
  281.   else
  282.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:DFoster")
  283.   end if
  284.   if objectp(fileObj) = 0 then
  285.     alert("Error reading Foster Dignified File")
  286.     return -1
  287.   end if
  288.   set DigFoster to fileObj(mReadFile)
  289.   fileObj(mdispose)
  290.   if the machineType = 256 then
  291.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\IDFoster")
  292.   else
  293.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:IDFoster")
  294.   end if
  295.   if objectp(fileObj) = 0 then
  296.     alert("Error reading Foster Ill-Dignified File")
  297.     return -1
  298.   end if
  299.   set IllDigFoster to fileObj(mReadFile)
  300.   fileObj(mdispose)
  301.   if the machineType = 256 then
  302.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\CardNmes")
  303.   else
  304.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:CardNmes")
  305.   end if
  306.   if objectp(fileObj) = 0 then
  307.     alert("Error reading CardNames File" && moviePath && fileObj)
  308.     return -1
  309.   end if
  310.   set CardList to fileObj(mReadFile)
  311.   fileObj(mdispose)
  312.   if the machineType = 256 then
  313.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings\CdNames")
  314.   else
  315.     set fileObj to FileIO(mnew, "read", moviePath & "Meanings:CdNames")
  316.   end if
  317.   if objectp(fileObj) = 0 then
  318.     alert("Error reading CdNames File" && moviePath && fileObj)
  319.     return -1
  320.   end if
  321.   set CdNames to fileObj(mReadFile)
  322.   fileObj(mdispose)
  323.   return 
  324. end
  325.  
  326. factory ArrayFactory
  327.