home *** CD-ROM | disk | FTP | other *** search
/ Gamer's Paradise: Logic / Hracuv-raj_Logicke-hry_cd1.bin / QUESTCAM / HATCHLIN.DIR / 00550.ls < prev    next >
Encoding:
Text File  |  1998-02-26  |  12.5 KB  |  330 lines

  1. on TimePasses
  2.   global Hungry, tired, sucky, pacifierflag, cold, bored, happymodifier, wet, happy, draggin, dragChan, dragonChan, oldtoyloc, objsLocList, objsChan, selectedSprite, lastSelectedSprite, whichanim, dancecount, danceFever, stepDancin, musicBoxChan, musicBoxFirst, shownnappie, usingObject, nappieSprite, feedoffx1, feedoffx2, feedoffy1, feedoffy2, feedfallx, feedfally, beirbotal, agol, botalbainne, feedingtime, gothim, startloc, floorlist, threshhold, tickleflag, snugglebuns, rockabilly, fallyplace, lasth, lastv, backdragonchan, frontdragonchan, closingin
  3.   UpdateEmotionalStates()
  4.   ClearClosingInFlag()
  5.   if tickleflag > 0 then
  6.     if the mouseUp or not rollOver(dragonChan) then
  7.       set tickleflag to 0
  8.     end if
  9.     exit
  10.   end if
  11.   if gothim = 1 then
  12.     if the mouseUp then
  13.       set x to the locH of sprite dragChan
  14.       set y to the locV of sprite dragChan + 30
  15.       if y < getAt(fallyplace, 4) then
  16.         if (x > getAt(fallyplace, 1)) and (x < getAt(fallyplace, 3)) then
  17.           set the memberNum of sprite dragonChan to the memberNum of sprite dragChan
  18.           set the locH of sprite dragonChan to x
  19.           set the locV of sprite dragonChan to y
  20.           set startloc to the loc of sprite dragonChan
  21.           set the locH of sprite dragChan to 2000
  22.           set rockabilly to 0
  23.           set gothim to 0
  24.           if dragonChan = frontdragonchan then
  25.             set the memberNum of sprite backdragonchan to the memberNum of sprite dragChan
  26.             set the locH of sprite backdragonchan to the locH of sprite frontdragonchan
  27.             set the locV of sprite backdragonchan to the locV of sprite frontdragonchan
  28.             set the memberNum of sprite frontdragonchan to the number of member "blankie"
  29.             set dragonChan to backdragonchan
  30.           end if
  31.           setanim("drop dragon")
  32.           exit
  33.         end if
  34.       end if
  35.       set floortop to getAt(floorlist, 1)
  36.       set floorbottom to getAt(floorlist, 2)
  37.       set floorleft to getAt(floorlist, 3)
  38.       set floorright to getAt(floorlist, 4)
  39.       if x > (floorright - 20) then
  40.         set x to floorright - 20
  41.       end if
  42.       if x < (floorleft + 20) then
  43.         set x to floorleft + 20
  44.       end if
  45.       if y < (floortop + 25) then
  46.         set y to floortop + 25
  47.       end if
  48.       if y > floorbottom then
  49.         set y to floorbottom - 5
  50.       end if
  51.       set the locH of sprite dragonChan to x
  52.       set the locV of sprite dragonChan to y
  53.       set startloc to the loc of sprite dragonChan
  54.       set the locH of sprite dragChan to 2000
  55.       set rockabilly to 0
  56.       set gothim to 0
  57.       LayerDragon()
  58.       setanim("SIT")
  59.       exit
  60.     else
  61.       if (the mouseH > (lasth + 20)) or (the mouseH < (lasth - 20)) then
  62.         if rockabilly > 0 then
  63.           set rockabilly to rockabilly + 1
  64.           if rockabilly = 30 then
  65.             setanim("Pickup Sleep")
  66.             exit
  67.           end if
  68.         end if
  69.       end if
  70.       set lasth to the mouseH
  71.       set lastv to the mouseV
  72.       set the locH of sprite dragChan to lasth
  73.       set the locV of sprite dragChan to lastv
  74.       exit
  75.     end if
  76.   end if
  77.   if draggin = 1 then
  78.     if the mouseDown then
  79.       set whichobj to getAt(objsList, selectedSprite - objsChan + 1)
  80.       set whatyoureallyreallywant to TauntHim()
  81.       if beirbotal then
  82.         if whichobj = "botal" then
  83.           set newx to the mouseH
  84.           set newy to the mouseV
  85.           if whatyoureallyreallywant = 1 then
  86.             set hresult to ReachForTheSkies(newx, newy)
  87.             if hresult = 1 then
  88.               exit
  89.             end if
  90.           end if
  91.           if (the mouseH > (the locH of sprite dragonChan - feedoffx1)) and (the mouseH < (the locH of sprite dragonChan - feedoffx2)) then
  92.             if (the mouseV > (the locV of sprite dragonChan - feedoffy1)) and (the mouseV < (the locV of sprite dragonChan - feedoffy2)) then
  93.               if agol = 0 then
  94.                 if whatyoureallyreallywant = 1 then
  95.                   set the locH of sprite dragChan to 2000
  96.                   set agol to 1
  97.                   setanim("drink held bottle")
  98.                   exit
  99.                 end if
  100.                 set the locH of sprite dragChan to the mouseH
  101.                 set the locV of sprite dragChan to the mouseV
  102.                 exit
  103.               end if
  104.               set feedingtime to feedingtime + 1
  105.               set happymodifier to happymodifier + 5
  106.               if sucky > 0 then
  107.                 set sucky to sucky - 2
  108.               end if
  109.               if Hungry > 0 then
  110.                 set Hungry to Hungry - 3
  111.               end if
  112.               exit
  113.             end if
  114.           end if
  115.           if agol then
  116.             set the locH of sprite dragChan to the mouseH
  117.             set the locV of sprite dragChan to the mouseV
  118.             set agol to 0
  119.             setanim("take away bottle")
  120.             exit
  121.           else
  122.             set the locH of sprite dragChan to the mouseH
  123.             set the locV of sprite dragChan to the mouseV
  124.             exit
  125.           end if
  126.         end if
  127.       end if
  128.       set newx to the mouseH
  129.       set newy to the mouseV
  130.       set the locH of sprite dragChan to newx
  131.       set the locV of sprite dragChan to newy
  132.       if whatyoureallyreallywant = 1 then
  133.         set hresult to ReachForTheSkies(newx, newy)
  134.         if hresult = 1 then
  135.           exit
  136.         end if
  137.       end if
  138.       if whichobj = "nappie" then
  139.         if rollOver(dragonChan) then
  140.           if whatyoureallyreallywant = 1 then
  141.             if not shownnappie then
  142.               set shownnappie to 1
  143.               if lastSelectedSprite > 0 then
  144.                 set BBB to lastSelectedSprite
  145.                 set lastSelectedSprite to selectedSprite
  146.                 set selectedSprite to BBB
  147.                 ReshelveItem(1)
  148.               end if
  149.               setanim("show diaper")
  150.               exit
  151.             end if
  152.           end if
  153.         end if
  154.       end if
  155.     else
  156.       set newx to the mouseH
  157.       set newy to the mouseV
  158.       set whichobj to getAt(objsList, selectedSprite - objsChan + 1)
  159.       if whichobj = "musicbox" then
  160.         set hresult to 0
  161.         if (newx > getAt(floorlist, 3)) and (newx < getAt(floorlist, 4)) then
  162.           if (newy > getAt(floorlist, 1)) and (newy < getAt(floorlist, 2)) then
  163.             set nodancing to 0
  164.             set danceFever to 1
  165.             set stepDancin to 0
  166.             set wantdat to 1
  167.             set draggin to 0
  168.             set musicBoxChan to selectedSprite
  169.             puppetSprite(musicBoxChan, 1)
  170.             set the memberNum of sprite musicBoxChan to musicBoxFirst
  171.             if the left of sprite dragChan < the left of sprite dragonChan then
  172.               set overlap to the right of sprite dragChan - the left of sprite dragonChan
  173.             else
  174.               set overlap to the right of sprite dragonChan - the left of sprite dragChan
  175.             end if
  176.             if overlap > 0 then
  177.               if the top of sprite dragChan < the top of sprite dragonChan then
  178.                 set overlap to the bottom of sprite dragChan - the top of sprite dragonChan
  179.               else
  180.                 set overlap to the bottom of sprite dragonChan - the top of sprite dragChan
  181.               end if
  182.             end if
  183.             if overlap < 0 then
  184.               set the loc of sprite musicBoxChan to the loc of sprite dragChan
  185.             else
  186.               set blarg to the locH of sprite dragChan
  187.               if (blarg + 100) < getAt(floorlist, 4) then
  188.                 set the locH of sprite musicBoxChan to blarg + 100
  189.                 set the locV of sprite musicBoxChan to the locV of sprite dragChan
  190.               else
  191.                 set the locH of sprite musicBoxChan to blarg - 100
  192.                 set the locV of sprite musicBoxChan to the locV of sprite dragChan
  193.               end if
  194.             end if
  195.             set shelfy to selectedSprite
  196.             put shelfy
  197.             set newmember to getAt(getAt(objsLocList, selectedSprite - objsChan + 1), 2)
  198.             set the memberNum of sprite selectedSprite to newmember
  199.             set bottomoffset to the height of member newmember - getAt(the regPoint of member newmember, 2)
  200.             ShuffleSprites(shelfy, the locV of sprite shelfy, bottomoffset)
  201.             clutterFloor(musicBoxChan, the locH of sprite musicBoxChan, the locV of sprite musicBoxChan)
  202.             set the locH of sprite dragChan to 2000
  203.             if whichanim = "cold sleep (loop)" then
  204.               set selectedSprite to lastSelectedSprite
  205.               set lastSelectedSprite to 0
  206.               setanim("cry b")
  207.               exit
  208.             end if
  209.             case whichanim of
  210.               "sleep a":
  211.                 set selectedSprite to lastSelectedSprite
  212.                 set lastSelectedSprite to 0
  213.                 setanim("wake up")
  214.                 exit
  215.               "sleep b":
  216.                 set selectedSprite to lastSelectedSprite
  217.                 set lastSelectedSprite to 0
  218.                 setanim("bad dream")
  219.                 exit
  220.               "drop dragon", "fallguy", "afterthefall", "I falled", "UnMasked":
  221.                 set selectedSprite to lastSelectedSprite
  222.                 set lastSelectedSprite to 0
  223.                 exit
  224.             end case
  225.             if not usingObject then
  226.               if not closingin then
  227.                 set dancecount to 0
  228.                 if lastSelectedSprite > 0 then
  229.                   set BBB to lastSelectedSprite
  230.                   set lastSelectedSprite to selectedSprite
  231.                   set selectedSprite to BBB
  232.                   ReshelveItem(1)
  233.                 end if
  234.                 set selectedSprite to 0
  235.                 setanim("dance a")
  236.                 exit
  237.               end if
  238.             end if
  239.             set selectedSprite to lastSelectedSprite
  240.             set lastSelectedSprite to 0
  241.             exit
  242.           end if
  243.         end if
  244.       end if
  245.       if beirbotal then
  246.         if whichobj = "botal" then
  247.           set draggin to 0
  248.           if feedingtime > 700 then
  249.             set beirbotal to 0
  250.           end if
  251.           if agol then
  252.             set agol to 0
  253.             set the locH of sprite dragChan to 2000
  254.             set the memberNum of sprite selectedSprite to botalbainne
  255.             set the locH of sprite selectedSprite to the locH of sprite dragonChan - feedfallx
  256.             set the locV of sprite selectedSprite to the locV of sprite dragonChan - feedfally
  257.             set selectedSprite to 0
  258.             setanim("take away bottle")
  259.             exit
  260.           end if
  261.           set blarg to []
  262.           append(blarg, the locH of sprite dragChan)
  263.           append(blarg, the locV of sprite dragChan)
  264.           ReshelveItem(blarg)
  265.           set the locH of sprite dragChan to 2000
  266.           if not usingObject then
  267.             set distx to abs(newx - ((the right of sprite dragonChan + the left of sprite dragonChan) / 2))
  268.             set disty to abs(newy - ((the bottom of sprite dragonChan + the top of sprite dragonChan) / 2))
  269.             if distx > disty then
  270.               set dist to distx
  271.             else
  272.               set dist to disty
  273.             end if
  274.             set hresult to 0
  275.             if dist < 40 then
  276.               if Hungry < threshhold then
  277.                 RejectItem(Hungry)
  278.                 exit
  279.               end if
  280.             end if
  281.           end if
  282.           exit
  283.         end if
  284.       end if
  285.       if whichobj = "nappie" then
  286.         if shownnappie then
  287.           if rollOver(dragonChan) then
  288.             set usingObject to 1
  289.             set draggin to 0
  290.             set the locH of sprite dragChan to 2000
  291.             set selectedSprite to 0
  292.             set shownnappie to 0
  293.             setanim("give diaper")
  294.             exit
  295.           else
  296.             set the locH of sprite dragChan to the mouseH
  297.             set the locV of sprite dragChan to the mouseV
  298.             exit
  299.           end if
  300.         end if
  301.       end if
  302.       set distx to abs(newx - ((the right of sprite dragonChan + the left of sprite dragonChan) / 2))
  303.       set disty to abs(newy - ((the bottom of sprite dragonChan + the top of sprite dragonChan) / 2))
  304.       if distx > disty then
  305.         set dist to distx
  306.       else
  307.         set dist to disty
  308.       end if
  309.       set hresult to 0
  310.       if dist < 40 then
  311.         set hresult to SeeIfHeWantsIt()
  312.         if hresult = 0 then
  313.           set draggin to 0
  314.           ReshelveItem(1)
  315.           set the locH of sprite dragChan to 2000
  316.           exit
  317.         end if
  318.       end if
  319.       if hresult = 0 then
  320.         set draggin to 0
  321.         set blarg to []
  322.         append(blarg, the locH of sprite dragChan)
  323.         append(blarg, the locV of sprite dragChan)
  324.         ReshelveItem(blarg)
  325.         set the locH of sprite dragChan to 2000
  326.       end if
  327.     end if
  328.   end if
  329. end
  330.