home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1997 #2 / amigaacscoverdisc / games / alienbreed3d2 / source_4000 / multifall.s < prev    next >
Text File  |  1997-01-31  |  9KB  |  658 lines

  1.  
  2. PLR1_fall
  3.  move.l PLR1s_tyoff,d0
  4.  move.l PLR1s_yoff,d1
  5.  move.l PLR1s_yvel,d2
  6.  
  7.  cmp.l d1,d0
  8.  bgt .aboveground
  9.  beq.s .onground
  10.  
  11.  st SLOWDOWN
  12.  
  13. ; we are under the ground.
  14.  
  15. ; move.l #0,d2
  16.  sub.l d1,d0
  17.  cmp.l #-512,d0
  18.  bge.s .notoobig
  19.  move.l #-512,d0
  20. .notoobig:
  21.  add.l d0,d1
  22.  
  23.  bra CARRYON
  24.  
  25. .onground:
  26.  move.w PLR1_FloorSpd,d2
  27.  ext.l d2
  28.  asl.l #6,d2
  29.  
  30.  move.l #PLR1_Obj,a4
  31.  move.w DAMAGEWHENHIT,d3
  32.  sub.w #100,d3
  33.  ble.s .nodam
  34.  add.b d3,damagetaken(a4)
  35. .nodam
  36.  
  37.  st SLOWDOWN
  38.  move.w #0,DAMAGEWHENHIT
  39.  
  40.  move.w ADDTOBOBBLE,d3
  41.  move.w d3,d4
  42.  add.w PLR1_bobble,d3
  43.  and.w #8190,d3
  44.  move.w d3,PLR1_bobble
  45.  add.w PLR1_clumptime,d4
  46.  move.w d4,d3
  47.  and.w #4095,d4
  48.  move.w d4,PLR1_clumptime
  49.  and.w #-4096,d3
  50.  beq.s .noclump
  51.  
  52.  bsr PLR1clump
  53.  
  54. .noclump
  55.  
  56.  
  57.  move.l #-1024,JUMPSPD
  58.  
  59.  move.l PLR1_Roompt,a2
  60.  move.l ToZoneWater(a2),d0
  61.  cmp.l d0,d1
  62.  blt.s .notinwater
  63.  
  64.  move.l #-512,JUMPSPD
  65.  
  66. .notinwater:
  67.  
  68.  tst.w PLAYERONEHEALTH
  69.  ble.s .nothrust
  70.  
  71.  move.l #KeyMap,a5
  72.  moveq #0,d7
  73.  move.b jump_key,d7
  74.  tst.b (a5,d7.w)
  75.  beq.s .nothrust
  76.  move.l JUMPSPD,d2
  77. .nothrust:
  78.  
  79.  tst.l d2
  80.  ble.s .nodown
  81.  
  82.  moveq #0,d2
  83. .nodown:
  84.  add.l d2,d1
  85.  bra CARRYON
  86.  
  87. .aboveground
  88.  
  89.  clr.b SLOWDOWN
  90.  
  91.  tst.w PLAYERONEJETPACK
  92.  beq.s .nofly
  93.  
  94.  tst.w PLAYERONEFUEL
  95.  beq.s .nofly
  96.  
  97.  cmp.w #250,PLAYERONEFUEL
  98.  ble.s .okfuel
  99.  
  100.  move.w #250,PLAYERONEFUEL
  101.  
  102. .okfuel:
  103.  
  104.  st SLOWDOWN
  105.  move.l #-128,JUMPSPD
  106.  move.l #KeyMap,a5
  107.  moveq #0,d7
  108.  move.b jump_key,d7
  109.  tst.b (a5,d7.w)
  110.  beq.s .nofly
  111.  sub.w #1,PLAYERONEFUEL
  112.  add.l JUMPSPD,d2
  113.  move.w #0,DAMAGEWHENHIT
  114.  move.w #40,d3
  115.  add.w PLR1_bobble,d3
  116.  and.w #8190,d3
  117.  move.w d3,PLR1_bobble
  118. .nofly:
  119.  
  120.  move.l d0,d3
  121.  sub.l d1,d3
  122.  cmp.l #16*64,d3
  123.  bgt.s .nonearmove
  124.  
  125.  st SLOWDOWN
  126.  
  127. .nonearmove:
  128.  
  129.  
  130. ; need to fall down (possibly).
  131.  
  132.  add.l d2,d1
  133.  cmp.l d1,d0
  134.  bgt.s .stillabove
  135.  
  136.  move.w DAMAGEWHENHIT,d3
  137.  sub.w #100,d3
  138.  ble.s .nodam2
  139.  move.l PLR1_Obj,a4
  140.  add.b d3,damagetaken(a4)
  141. .nodam2
  142.  move.w #0,DAMAGEWHENHIT
  143.  
  144.  move.w PLR1_FloorSpd,d2
  145.  ext.l d2
  146.  asl.l #6,d2
  147.  
  148.  bra CARRYON
  149.  
  150. .stillabove:
  151.  add.l #64,d2
  152.  add.w #1,DAMAGEWHENHIT
  153.  
  154.  move.l PLR1_Roompt,a2
  155.  move.l ToZoneWater(a2),d0
  156.  cmp.l d0,d1
  157.  blt.s CARRYON
  158.  
  159.  cmp.l oldheight,d0
  160.  blt.s .nosplash
  161.  
  162.  movem.l d0-d7/a0-a6,-(a7)
  163.  move.w #6,Samplenum
  164.  move.w #0,Noisex
  165.  move.w #100,Noisez
  166.  move.w #80,Noisevol
  167.  move.w #$fff8,IDNUM
  168.  clr.b notifplaying
  169.  jsr MakeSomeNoise
  170.  movem.l (a7)+,d0-d7/a0-a6
  171.  
  172. .nosplash:
  173.  
  174.  st SLOWDOWN
  175.  move.w #0,DAMAGEWHENHIT
  176.  cmp.l #512,d2 
  177.  blt.s CARRYON 
  178.  move.l #512,d2     ; reached terminal velocity.
  179. CARRYON:
  180.  
  181.  move.l PLR1_Roompt,a2
  182.  move.l ToZoneRoof(a2),d3
  183.  tst.b PLR1_StoodInTop
  184.  beq.s .okbot
  185.  move.l ToUpperRoof(a2),d3
  186. .okbot:
  187.  
  188.  add.l #10*256,d3
  189.  cmp.l d1,d3
  190.  blt.s .okroof
  191.  move.l d3,d1
  192.  tst.l d2
  193.  bge.s .okroof
  194.  moveq #0,d2
  195. .okroof:
  196.  
  197.  move.l d2,PLR1s_yvel
  198.  move.l d1,PLR1s_yoff
  199.  
  200.  rts
  201.  
  202. ARSE:
  203.  
  204.  sub.l d1,d0
  205.  slt.s CANJUMP
  206.  bgt.s .aboveground
  207.  beq.s .notfast
  208.  sub.l #512,d2
  209.  blt.s .notfast
  210.  move.l #0,d2
  211. .notfast:
  212.  add.l d2,d1
  213.  sub.l d2,d0
  214.  blt.s .pastitall
  215.  move.l #0,d2
  216.  move.l PLR1s_tyoff,d1
  217.  bra.s .pastitall
  218.  
  219. .aboveground:
  220.  add.l d2,d1
  221.  add.l #64,d2
  222.  
  223.  move.l #-1024,JUMPSPD
  224.  
  225.  move.l PLR1_Roompt,a2
  226.  move.l ToZoneWater(a2),d0
  227.  cmp.l d0,d1
  228.  blt.s .pastitall
  229.  
  230.  move.l #-512,JUMPSPD
  231.  cmp.l #256*2,d2
  232.  blt.s .pastitall
  233.  move.l #256*2,d2
  234.  
  235. .pastitall:
  236.  
  237.  move.l d2,PLR1s_yvel
  238.  move.l d1,PLR1s_yoff
  239.  
  240.  move.l #KeyMap,a5
  241.  tst.b $1d(a5)
  242.  beq.s nothrust2
  243.  tst.b CANJUMP
  244.  beq.s nothrust2
  245.  move.l JUMPSPD,PLR1s_yvel
  246. nothrust2:
  247.  
  248.  move.l PLR1_Roompt,a5
  249.  move.l ToZoneRoof(a5),d0
  250.  tst.b PLR1_StoodInTop
  251.  beq.s .usebottom
  252.  move.l ToUpperRoof(a5),d0
  253. .usebottom:
  254.  
  255.  move.l PLR1s_yoff,d1
  256.  move.l PLR1s_yvel,d2
  257.  
  258.  sub.l PLR1s_height,d1
  259.  sub.l #10*256,d1
  260.  cmp.l d1,d0
  261.  blt.s .notinroof
  262.  move.l d0,d1
  263.  tst.l d2
  264.  bge.s .notinroof
  265.  moveq #0,d2
  266. .notinroof
  267.  add.l #10*256,d1
  268.  add.l PLR1s_height,d1
  269.  move.l d1,PLR1s_yoff
  270.  
  271.  move.l d2,PLR1s_yvel
  272.  
  273.  rts
  274.  
  275. PLR2_fall
  276.  move.l PLR2s_tyoff,d0
  277.  move.l PLR2s_yoff,d1
  278.  move.l PLR2s_yvel,d2
  279.  
  280.  cmp.l d1,d0
  281.  bgt .aboveground
  282.  beq.s .onground
  283.  
  284.  st SLOWDOWN
  285. ; we are under the ground.
  286.  
  287.  move.l #0,d2
  288.  sub.l d1,d0
  289.  cmp.l #-512,d0
  290.  bge.s .notoobig
  291.  move.l #-512,d0
  292. .notoobig:
  293.  add.l d0,d1
  294.  
  295.  bra CARRYON2
  296.  
  297. .onground:
  298.  
  299.  move.w DAMAGEWHENHIT,d3
  300.  sub.w #100,d3
  301.  ble.s .nodam
  302.  move.l PLR2_Obj,a4
  303.  add.b d3,damagetaken(a4)
  304. .nodam
  305.  move.w #0,DAMAGEWHENHIT
  306.  
  307.  st SLOWDOWN
  308.  
  309.  move.w ADDTOBOBBLE,d3
  310.  move.w d3,d4
  311.  add.w PLR2_bobble,d3
  312.  and.w #8190,d3
  313.  move.w d3,PLR2_bobble
  314.  add.w PLR2_clumptime,d4
  315.  move.w d4,d3
  316.  and.w #4095,d4
  317.  move.w d4,PLR2_clumptime
  318.  and.w #-4096,d3
  319.  beq.s .noclump
  320.  
  321.  bsr PLR2clump
  322.  
  323. .noclump
  324.  
  325.  move.l #-1024,JUMPSPD
  326.  
  327.  move.l PLR2_Roompt,a2
  328.  move.l ToZoneWater(a2),d0
  329.  cmp.l d0,d1
  330.  blt.s .notinwater
  331.  
  332.  move.l #-512,JUMPSPD
  333.  
  334. .notinwater:
  335.  
  336.  tst.w PLAYERTWOHEALTH
  337.  ble.s .nothrust
  338.  move.l #KeyMap,a5
  339.  moveq #0,d7
  340.  move.b jump_key,d7
  341.  tst.b (a5,d7.w)
  342.  beq.s .nothrust
  343.  move.l JUMPSPD,d2
  344. .nothrust:
  345.  
  346.  tst.l d2
  347.  ble.s .nodown
  348.  
  349.  moveq #0,d2
  350. .nodown:
  351.  add.l d2,d1
  352.  bra CARRYON2
  353.  
  354. .aboveground
  355.  
  356.  clr.b SLOWDOWN
  357. ; need to fall down (possibly).
  358.  
  359.  tst.w PLAYERTWOJETPACK
  360.  beq.s .nofly
  361.  
  362.  tst.w PLAYERTWOFUEL
  363.  beq.s .nofly
  364.  
  365.  cmp.w #250,PLAYERTWOFUEL
  366.  ble.s .okfuel
  367.  
  368.  move.w #250,PLAYERTWOFUEL
  369.  
  370. .okfuel:
  371.  
  372.  st SLOWDOWN
  373.  
  374.  move.l #-128,JUMPSPD
  375.  move.l #KeyMap,a5
  376.  moveq #0,d7
  377.  move.b jump_key,d7
  378.  tst.b (a5,d7.w)
  379.  beq.s .nofly
  380.  add.l JUMPSPD,d2
  381.  move.w #0,DAMAGEWHENHIT
  382.  sub.w #1,PLAYERTWOFUEL
  383.  move.w #40,d3
  384.  add.w PLR2_bobble,d3
  385.  and.w #8190,d3
  386.  move.w d3,PLR2_bobble
  387.  
  388. .nofly:
  389.  
  390.  move.l d1,oldheight
  391.  
  392.  add.l d2,d1
  393.  cmp.l d1,d0
  394.  bgt.s .stillabove
  395.  
  396.  move.w DAMAGEWHENHIT,d3
  397.  sub.w #100,d3
  398.  ble.s .nodam2
  399.  move.l PLR2_Obj,a4
  400.  add.b d3,damagetaken(a4)
  401. .nodam2
  402.  move.w #0,DAMAGEWHENHIT
  403.  
  404.  move.l #0,d2
  405.  bra CARRYON2
  406.  
  407. .stillabove:
  408.  add.l #64,d2
  409.  
  410.  add.w #1,DAMAGEWHENHIT
  411.  
  412.  move.l PLR2_Roompt,a2
  413.  move.l ToZoneWater(a2),d0
  414.  cmp.l d0,d1
  415.  blt.s CARRYON2
  416.  
  417.  cmp.l oldheight,d0
  418.  blt.s .nosplash
  419.  
  420.  movem.l d0-d7/a0-a6,-(a7)
  421.  move.w #6,Samplenum
  422.  move.w #0,Noisex
  423.  move.w #100,Noisez
  424.  move.w #80,Noisevol
  425.  move.w #$fff8,IDNUM
  426.  clr.b notifplaying
  427.  jsr MakeSomeNoise
  428.  movem.l (a7)+,d0-d7/a0-a6
  429.  
  430. .nosplash:
  431.  
  432.  
  433.  st SLOWDOWN
  434.  move.w #0,DAMAGEWHENHIT
  435.  
  436.  cmp.l #512,d2
  437.  blt.s CARRYON2
  438.  
  439.  move.l #512,d2 
  440.  
  441. CARRYON2:
  442.  
  443.  move.l PLR2_Roompt,a2
  444.  move.l ToZoneRoof(a2),d3
  445.  tst.b PLR2_StoodInTop
  446.  beq.s .okbot
  447.  move.l ToUpperRoof(a2),d3
  448. .okbot:
  449.  
  450.  add.l #10*256,d3
  451.  cmp.l d1,d3
  452.  blt.s .okroof
  453.  move.l d3,d1
  454.  tst.l d2
  455.  bge.s .okroof
  456.  moveq #0,d2
  457. .okroof:
  458.  
  459.  move.l d2,PLR2s_yvel
  460.  move.l d1,PLR2s_yoff
  461.  
  462.  rts
  463.  
  464. PLR3_fall:
  465.  move.l PLR3s_tyoff,d0
  466.  move.l PLR3s_yoff,d1
  467.  move.l PLR3s_yvel,d2
  468.  
  469.  cmp.l d1,d0
  470.  bgt .aboveground
  471.  beq.s .onground
  472.  
  473.  st SLOWDOWN
  474. ; we are under the ground.
  475.  
  476.  move.l #0,d2
  477.  sub.l d1,d0
  478.  cmp.l #-512,d0
  479.  bge.s .notoobig
  480.  move.l #-512,d0
  481. .notoobig:
  482.  add.l d0,d1
  483.  
  484.  bra CARRYON3
  485.  
  486. .onground:
  487.  
  488.  move.w DAMAGEWHENHIT,d3
  489.  sub.w #100,d3
  490.  ble.s .nodam
  491.  move.l PLR3_Obj,a4
  492.  add.b d3,damagetaken(a4)
  493. .nodam
  494.  move.w #0,DAMAGEWHENHIT
  495.  
  496.  st SLOWDOWN
  497.  
  498.  move.w ADDTOBOBBLE,d3
  499.  move.w d3,d4
  500.  add.w PLR3_bobble,d3
  501.  and.w #8190,d3
  502.  move.w d3,PLR3_bobble
  503.  add.w PLR3_clumptime,d4
  504.  move.w d4,d3
  505.  and.w #4095,d4
  506.  move.w d4,PLR3_clumptime
  507.  and.w #-4096,d3
  508.  beq.s .noclump
  509.  
  510.  bsr PLR3clump
  511.  
  512. .noclump
  513.  
  514.  move.l #-1024,JUMPSPD
  515.  
  516.  move.l PLR3_Roompt,a2
  517.  move.l ToZoneWater(a2),d0
  518.  cmp.l d0,d1
  519.  blt.s .notinwater
  520.  
  521.  move.l #-512,JUMPSPD
  522.  
  523. .notinwater:
  524.  
  525.  tst.w PLAYERTHREEHEALTH
  526.  ble.s .nothrust
  527.  move.l #KeyMap,a5
  528.  moveq #0,d7
  529.  move.b jump_key,d7
  530.  tst.b (a5,d7.w)
  531.  beq.s .nothrust
  532.  move.l JUMPSPD,d2
  533. .nothrust:
  534.  
  535.  tst.l d2
  536.  ble.s .nodown
  537.  
  538.  moveq #0,d2
  539. .nodown:
  540.  add.l d2,d1
  541.  bra CARRYON3
  542.  
  543. .aboveground
  544.  
  545.  clr.b SLOWDOWN
  546. ; need to fall down (possibly).
  547.  
  548.  tst.w PLAYERTHREEJETPACK
  549.  beq.s .nofly
  550.  
  551.  tst.w PLAYERTHREEFUEL
  552.  beq.s .nofly
  553.  
  554.  cmp.w #250,PLAYERTHREEFUEL
  555.  ble.s .okfuel
  556.  
  557.  move.w #250,PLAYERTHREEFUEL
  558.  
  559. .okfuel:
  560.  
  561.  st SLOWDOWN
  562.  
  563.  move.l #-128,JUMPSPD
  564.  move.l #KeyMap,a5
  565.  moveq #0,d7
  566.  move.b jump_key,d7
  567.  tst.b (a5,d7.w)
  568.  beq.s .nofly
  569.  add.l JUMPSPD,d2
  570.  move.w #0,DAMAGEWHENHIT
  571.  sub.w #1,PLAYERTWOFUEL
  572.  move.w #40,d3
  573.  add.w PLR3_bobble,d3
  574.  and.w #8190,d3
  575.  move.w d3,PLR3_bobble
  576.  
  577. .nofly:
  578.  
  579.  move.l d1,oldheight
  580.  
  581.  add.l d2,d1
  582.  cmp.l d1,d0
  583.  bgt.s .stillabove
  584.  
  585.  move.w DAMAGEWHENHIT,d3
  586.  sub.w #100,d3
  587.  ble.s .nodam3
  588.  move.l PLR3_Obj,a4
  589.  add.b d3,damagetaken(a4)
  590. .nodam3
  591.  move.w #0,DAMAGEWHENHIT
  592.  
  593.  move.l #0,d2
  594.  bra CARRYON3
  595.  
  596. .stillabove:
  597.  add.l #64,d2
  598.  
  599.  add.w #1,DAMAGEWHENHIT
  600.  
  601.  move.l PLR3_Roompt,a2
  602.  move.l ToZoneWater(a2),d0
  603.  cmp.l d0,d1
  604.  blt.s CARRYON3
  605.  
  606.  cmp.l oldheight,d0
  607.  blt.s .nosplash
  608.  
  609.  movem.l d0-d7/a0-a6,-(a7)
  610.  move.w #6,Samplenum
  611.  move.w #0,Noisex
  612.  move.w #100,Noisez
  613.  move.w #80,Noisevol
  614.  move.w #$fff8,IDNUM
  615.  clr.b notifplaying
  616.  jsr MakeSomeNoise
  617.  movem.l (a7)+,d0-d7/a0-a6
  618.  
  619. .nosplash:
  620.  
  621.  
  622.  st SLOWDOWN
  623.  move.w #0,DAMAGEWHENHIT
  624.  
  625.  cmp.l #512,d2
  626.  blt.s CARRYON3
  627.  
  628.  move.l #512,d2 
  629.  
  630. CARRYON3:
  631.  
  632.  move.l PLR3_Roompt,a2
  633.  move.l ToZoneRoof(a2),d3
  634.  tst.b PLR3_StoodInTop
  635.  beq.s .okbot
  636.  move.l ToUpperRoof(a2),d3
  637. .okbot:
  638.  
  639.  add.l #10*256,d3
  640.  cmp.l d1,d3
  641.  blt.s .okroof
  642.  move.l d3,d1
  643.  tst.l d2
  644.  bge.s .okroof
  645.  moveq #0,d2
  646. .okroof:
  647.  
  648.  move.l d2,PLR3s_yvel
  649.  move.l d1,PLR3s_yoff
  650.  
  651.  rts
  652.  
  653.  
  654. CANJUMP: dc.w 0
  655. JUMPSPD: dc.l 0
  656. SLOWDOWN: dc.w 0
  657. DAMAGEWHENHIT: dc.w 0
  658. oldheight: dc.l 0