home *** CD-ROM | disk | FTP | other *** search
/ ATComputers Catalog / AutoCont+ATcomp.bin / Data / Data.dxr / Internal_3_Processing.ls < prev    next >
Encoding:
Text File  |  2003-07-28  |  9.3 KB  |  325 lines

  1. global gVolume, gBTime, gATime, gProcessTime, gSoundTime, gSoundName, gRunChangePath, gCountPart, gPartMember, gPlay, gLevel, gLNum, gAllPath, gSqAnim, gVSprite, gPause, gVideoBig, gNaviPath, gNaviPath1, gNaviPath2, gNaviPath3, gNaviPath4, gNaviPath5, gNaviPath2_, gNaviPath3_, gNaviPath4_, gMenuPath, gMenuPath1, gMenuPath2, gMenuPath3, gMenuPath4, gMenuPath5, gMenuPath2_, gMenuPath3_, gMenuPath4_, maxProc, Section
  2.  
  3. on Process PlayState, timing
  4.   case PlayState of
  5.     0:
  6.       if timing <> 1 then
  7.         gProcessTime = the ticks
  8.         case gLNum[1] of
  9.           VOID:
  10.             gPause = 300
  11.           otherwise:
  12.             gPause = 120
  13.         end case
  14.       else
  15.         if (gProcessTime + gPause) < the ticks then
  16.           gProcessTime = the ticks
  17.           put "Koniec pauzy:" & gPause & " PATH:" & gLNum & " Frame:" & the frame
  18.           AutoAction()
  19.           result = 1
  20.         else
  21.           result = 0
  22.         end if
  23.         return result
  24.       end if
  25.     1:
  26.       if timing <> 1 then
  27.         gCountPart = gCountPart + 1
  28.         char1 = string(gLNum[1])
  29.         char2 = string(gLNum[2])
  30.         char3 = string(gLNum[3])
  31.         gPartMember = char1 & char2 & char3 & "-" & gCountPart
  32.         if member(gPartMember).number <> -1 then
  33.           member("ShowMember").picture = member(gPartMember).picture
  34.         else
  35.           put "Chyba obrazok: " & gPartMember & " !!!"
  36.           AutoAction()
  37.         end if
  38.         if gCountPart = 1 then
  39.           gSoundName = string(gLNum[1] & gLNum[2] & gLNum[3])
  40.           gSoundTime = member(gSoundName).duration
  41.           if member(gSoundName).number <> -1 then
  42.             AudioInt(gSoundName)
  43.           end if
  44.           put "Spustenie zvuku - Part:" & gSoundTime / 6000 & " SoundTime:" & gSoundTime & " PATH:" & gLNum & " Frame:" & the frame
  45.         end if
  46.         put "PROCESS 1 - zamena obrazku na: " & gPartMember & "(" & gCountPart & ")" & " Frame:" & the frame
  47.       else
  48.         maxProc = gSoundTime / 6000
  49.         soundTime = sound(2).currentTime
  50.         if (gSoundTime = soundTime) or not soundBusy(2) then
  51.           gCountPart = 0
  52.           put "Ukoncenie zvuku - Part:" & maxProc & " SoundTime:" & gSoundTime & " PATH:" & gLNum & " Frame:" & the frame
  53.           AutoAction()
  54.           result = 1
  55.         else
  56.           Section = gSoundTime / maxProc
  57.           if soundTime >= (Section * gCountPart) then
  58.             if soundTime <= gSoundTime then
  59.               put "Koniec sekcie - skok na dalsi obrazok cislo:" & gCountPart + 1 & " Frame:" & the frame
  60.             else
  61.               gCountPart = 0
  62.               put "Ukoncenie zvuku - Part:" & maxProc & " SoundTime:" & gSoundTime & "(" & soundTime & ")" & " PATH:" & gLNum & " gPlay:" & gPlay & " gCountPart" & gCountPart & " Frame:" & the frame
  63.               AutoAction()
  64.             end if
  65.             result = 1
  66.           else
  67.             result = 0
  68.           end if
  69.         end if
  70.         return result
  71.       end if
  72.     2:
  73.       if timing <> 1 then
  74.         put "PROCESS 2 running" & " Frame:" & the frame
  75.         gCountPart = 999
  76.         case gLNum[1] of
  77.           2:
  78.             gPartMember = "Physikus"
  79.           3:
  80.             case gLNum[2] of
  81.               VOID:
  82.                 gPartMember = "Chemicus"
  83.               8:
  84.                 gPartMember = "Ch_atmosfera"
  85.             end case
  86.           4:
  87.             case gLNum[2] of
  88.               VOID:
  89.                 gPartMember = "Bioscopia"
  90.               7:
  91.                 gPartMember = "Bio_atmosfera"
  92.             end case
  93.           otherwise:
  94.             gPartMember = "VOIDmember"
  95.         end case
  96.         if gPartMember <> 0 then
  97.           sprite(gVSprite).member = member(gPartMember)
  98.           gProcessTime = member(gPartMember).duration
  99.           sprite(gVSprite).movieRate = 1
  100.           sprite(gVSprite).volume = gVolume
  101.           sprite(gVSprite).width = 530
  102.           sprite(gVSprite).height = 298
  103.           case gPartMember of
  104.             "Bioscopia", "Bio_atmosfera":
  105.               sprite(gVSprite).locV = sprite(gVSprite).locV - 1
  106.             "Chemicus", "Ch_atmosfera":
  107.               sprite(gVSprite).width = 530
  108.               sprite(gVSprite).height = 352
  109.               sprite(gVSprite).locV = sprite(gVSprite).locV - 28
  110.           end case
  111.           updateStage()
  112.           put "VIDEO:" & gPartMember & " Duration:" & member(gPartMember).duration & " Frame:" & the frame
  113.         else
  114.           if (gPartMember = "Chemicus") or (gPartMember = "Ch_atmosfera") then
  115.             gVideoBig[4] = "GODOWN"
  116.           end if
  117.           AutoAction()
  118.           go(the frame + 2)
  119.         end if
  120.       else
  121.         actualTime = sprite(gVSprite).movieTime
  122.         if actualTime < (gProcessTime - 20) then
  123.           result = 0
  124.         else
  125.           sprite(gVSprite).movieRate = 0
  126.           updateStage()
  127.           gProcessTime = 0
  128.           put "VIDEO skoncilo" & " Frame:" & the frame
  129.           if (gPartMember = "Chemicus") or (gPartMember = "Ch_atmosfera") then
  130.             gVideoBig[4] = "GODOWN"
  131.           end if
  132.           AutoAction()
  133.           result = 1
  134.         end if
  135.         return result
  136.       end if
  137.     3:
  138.       if timing <> 1 then
  139.         gProcessTime = the ticks
  140.         case gLNum[1] of
  141.           6:
  142.             gPause = 1500
  143.           otherwise:
  144.             gPause = 1200
  145.         end case
  146.         gCountPart = 1
  147.         char1 = string(gLNum[1])
  148.         char2 = string(gLNum[2])
  149.         char3 = string(gLNum[3])
  150.         gPartMember = char1 & char2 & char3 & "-1"
  151.         if member(gPartMember).number <> -1 then
  152.           member("ShowMember").picture = member(gPartMember).picture
  153.           put "PROCESS 4 - flash:" & gPartMember & " Pauza:" & gPause & " Frame:" & the frame
  154.         else
  155.           put "Chyba flash: " & gPartMember & " !!!"
  156.           AutoAction()
  157.         end if
  158.       else
  159.         if (gProcessTime + gPause) < the ticks then
  160.           gProcessTime = the ticks
  161.           put "Koniec pauzy:" & gPause & " PATH:" & gLNum & " Frame:" & the frame
  162.           AutoAction()
  163.           result = 1
  164.         else
  165.           result = 0
  166.         end if
  167.         return result
  168.       end if
  169.     4:
  170.       if timing <> 1 then
  171.         gProcessTime = the ticks
  172.         case gLNum[1] of
  173.           6:
  174.             gPause = 1500
  175.           otherwise:
  176.             gPause = 1200
  177.         end case
  178.         gCountPart = 1
  179.         char1 = string(gLNum[1])
  180.         char2 = string(gLNum[2])
  181.         char3 = string(gLNum[3])
  182.         gPartMember = char1 & char2 & char3 & "-1"
  183.         if member(gPartMember).number <> -1 then
  184.           sprite(gVSprite).member = member(gPartMember)
  185.           put "PROCESS 4 - flash:" & gPartMember & " Pauza:" & gPause & " Frame:" & the frame
  186.         else
  187.           put "Chyba flash: " & gPartMember & " !!!"
  188.           AutoAction()
  189.         end if
  190.       else
  191.         if (gProcessTime + gPause) < the ticks then
  192.           gProcessTime = the ticks
  193.           put "Koniec pauzy:" & gPause & " PATH:" & gLNum & " Frame:" & the frame
  194.           AutoAction()
  195.           result = 1
  196.         else
  197.           result = 0
  198.         end if
  199.         return result
  200.       end if
  201.   end case
  202. end
  203.  
  204. on CheckProc
  205.   case PlayState() of
  206.     0:
  207.       result = Process(0, 1)
  208.     1:
  209.       result = Process(1, 1)
  210.     2:
  211.       result = Process(2, 1)
  212.     3:
  213.       result = Process(3, 1)
  214.     4:
  215.       result = Process(4, 1)
  216.   end case
  217.   return result
  218. end
  219.  
  220. on PlayState
  221.   case gLNum[1] of
  222.     VOID:
  223.       result = 0
  224.     2:
  225.       case gLNum[2] of
  226.         VOID:
  227.           result = 2
  228.         8:
  229.           result = 3
  230.         otherwise:
  231.           result = 1
  232.       end case
  233.     4:
  234.       case gLNum[2] of
  235.         VOID:
  236.           result = 2
  237.         7:
  238.           result = 2
  239.         8:
  240.           result = 3
  241.         otherwise:
  242.           result = 1
  243.       end case
  244.     3:
  245.       case gLNum[2] of
  246.         VOID:
  247.           result = 2
  248.         8:
  249.           result = 2
  250.         9:
  251.           result = 3
  252.         otherwise:
  253.           result = 1
  254.       end case
  255.     6:
  256.       result = 4
  257.     otherwise:
  258.       case gLNum[2] of
  259.         VOID:
  260.           result = 0
  261.         otherwise:
  262.           result = 1
  263.       end case
  264.   end case
  265.   return result
  266. end
  267.  
  268. on AutoAction
  269.   if gLNum = gAllPath.getLast() then
  270.     nextPath = gAllPath[2]
  271.   else
  272.     nextPath = gAllPath[gAllPath.getOne(gLNum) + 1]
  273.   end if
  274.   put "AUTOACTION-PATH:" & nextPath & " OldPATH:" & gLNum & " Frame:" & the frame
  275.   ChangePath(nextPath[1], nextPath[2], nextPath[3])
  276. end
  277.  
  278. on jump level1
  279.   case level1 of
  280.     1:
  281.       go("Vyuk")
  282.     2:
  283.       go("Phys")
  284.     3:
  285.       go("Chem")
  286.     4:
  287.       go("Bio")
  288.     5:
  289.       go("Proc")
  290.     6:
  291.       go("Data")
  292.   end case
  293. end
  294.  
  295. on progressBar me, reset
  296.   if reset = 1 then
  297.     sprite(me.spriteNum).locH = 572
  298.   else
  299.     if gPlay <> 2 then
  300.       case PlayState() of
  301.         1:
  302.           if gSoundName = VOID then
  303.             gSoundName = string(gLNum[1] & gLNum[2] & gLNum[3])
  304.           end if
  305.           if soundBusy(2) then
  306.             if gCountPart = 1 then
  307.               gSoundTime = member(gSoundName).duration
  308.             end if
  309.             soundTime = sound(2).currentTime
  310.             sprite(me.spriteNum).locH = 572 + (soundTime / gSoundTime * 200)
  311.           else
  312.             sprite(me.spriteNum).locH = 572
  313.           end if
  314.         2:
  315.           actualTime = sprite(gVSprite).movieTime.float
  316.           if actualTime < (gProcessTime - 20) then
  317.             sprite(me.spriteNum).locH = 572 + (actualTime / gProcessTime * 200)
  318.           else
  319.             sprite(me.spriteNum).locH = 572
  320.           end if
  321.       end case
  322.     end if
  323.   end if
  324. end
  325.