Geekboy

Untitled

Jan 6th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Player bullet handlers
  2. ;
  3. ;PBT located at $8D00
  4. ;First 64 bytes is PBT's FBT, all are filled with values indicating player
  5. ;bullet's LSB base location (multiples of 3 starting at $8D40
  6. ;Last 64*3 bytes is PBT's actual bullet data entries, described below, but
  7. ;is up to called routine's interpretation.
  8. ;
  9. ;FBT's location is in (pbtfreebullet). If bit 6 is ever set, then the FBT
  10. ;is full.
  11. ;
  12. ;Important note: Character's X and Y positions are not stored as normal. There
  13. ;are two bits of accuracy at the start so you're going to have to right-shift
  14. ;twice to get the actual X,Y positions.
  15. ;
  16. ;Y = YYYY YYSS , where S is subpixel data
  17. ;X = XXXX XXSS , where S is subpixel data
  18. ;
  19.  
  20. ;Player bullet structure (3 bytes)
  21. ;+0 : YTTTTTTT, T=Timer 0-127, Y=1 if focused shot
  22. ;+1 : Y position if applicable
  23. ;+2 : X position if applicable
  24.  
  25. ;The routine that is being called must be able to distinguish between
  26. ;unfocused and focused modes, since there won't be seperation at
  27. ;this stage of the routine call.
  28. ;
  29. ;Several things to edit.
  30. ;(1) PBTPlayerRoutineTables : How bullets are created. Below it are links.
  31. ;(2) PBTPlayerTypeTables : Types of bullets and how they move
  32. ;
  33. ;You can make creative use of the game timers to tell bullets apart
  34. ;(gametimer1) by creating only certain ones on certain slices of masked time.
  35. ;A good mask might be like %00000111 so you get 8 different time slices on
  36. ;each processing. Also pay attention to firing delays or you might not ever
  37. ;get a single bullet out.
  38. ;
  39. ;Other than that, good luck. You're gonna need it.
  40.  
  41.  
  42. #DEFINE PBTSHOT(xofs,yofs,count) call PBTCreate \ .db xofs,yofs,count
  43.  
  44.  
  45.  
  46. PlayerShoot:
  47.  ld a,(characterID)
  48.  add a,a
  49.  ld e,a
  50.  ld d,0
  51.  ld hl,PBTPlayerRoutineTables
  52.  add hl,de
  53.  ld e,(hl)
  54.  inc hl
  55.  ld d,(hl)
  56.  ld hl,charweapon1
  57.  bit isfocused,(iy+danmakuflags)
  58.  jr z,_
  59.  inc hl
  60.  inc de
  61.  inc de  ;if focused, charweapon2, and inc pointer to a focused standpoint
  62. _:
  63.  ld a,(hl)
  64.  add a,a
  65.  add a,a  ;x4 for weapon power thing
  66.  ld L,a
  67.  ld h,0
  68.  add hl,de
  69.  ld a,(hl)
  70.  inc hl
  71.  ld h,(hl)
  72.  ld L,a
  73.  jp (hl)
  74.  
  75. PBTMainDraw:
  76.  xor a
  77.  call PBTFillBulletDetails
  78.  ld (itemp1),sp
  79.  ld sp,$8D40
  80.  ld a,64
  81. PBTMainDrawLoop:
  82.  ex af,af'
  83. dec sp
  84. pop af
  85. pop de
  86. cp $FF
  87. jp z,PBTMainDrawRet
  88. ld hl,(itemp2) ;unfocused
  89. bit 7,a
  90. jr z,_
  91. ld hl,(itemp3) ;focused
  92. _:
  93. jp (hl)        ;routine being jumped to MUST keep B intact
  94. PBTMainDrawRet:
  95. ex af,af'
  96.  dec a
  97.  jr nz,PBTMainDrawLoop
  98.  ld sp,(itemp1)
  99.  ret
  100.  
  101. PBTMainMove:
  102.  ld a,4
  103.  call PBTFillBulletDetails
  104.  ld (itemp1),sp
  105.  ld sp,$8D40
  106.  ld a,64
  107. PBTMainMoveLoop:
  108.  ex af,af'
  109. dec sp
  110. pop af   ;A=tCCCCCCC, where t=type, C=counter
  111. pop de   ;E=Ypos ; D=Xpos (no accuracy bits, negative values may be used)
  112. cp $FF
  113. jp z,PBTMainMoveRet
  114. ld hl,(itemp2) ;unfocused
  115. bit 7,a
  116. jr z,_
  117. ld hl,(itemp3) ;focused
  118. _:
  119. jp (hl)        ;routine being jumped to MUST keep B intact
  120. PBTMainMoveRet:
  121. ex af,af'
  122.  dec a
  123.  jr nz,PBTMainMoveLoop
  124.  ld sp,(itemp1)
  125.  ret
  126. PBTNoCreate:
  127.  pop hl
  128.  inc hl
  129.  inc hl
  130.  inc hl
  131.  jp (hl)
  132. PBTCreate: ;in: macro'd. Xofs,Yofs,Count
  133.  ld hl,pbtfreebullet
  134.  bit 6,(hl)
  135.  jp nz,PBTNoCreate     ;stop routine if over 64 bullets
  136.  ld a,(hl) ;1.read
  137.  inc (hl)  ;2.increment
  138.  ld L,a
  139.  ld h,$8D
  140.  ld L,(hl) ;got bullet position
  141.  push hl
  142.  pop ix
  143.  ld de,(chary)
  144.  srl e \ srl e ;y
  145.  srl d \ srl d ;x
  146.  pop hl
  147.  ld a,d
  148.  add a,(hl)
  149.  inc hl
  150.  ld (ix+2),a
  151.  ld a,e
  152.  add a,(hl)
  153.  inc hl
  154.  ld (ix+1),a
  155.  ld a,(mdanmaku)  ;isfocused == bit 1. Need to shift to bit 7.
  156.  rrca
  157.  rrca
  158.  and $80
  159.  or (hl) ;combining new counter with focused mask
  160.  inc hl
  161.  ld (ix+0),a
  162.  jp (hl)
  163.  
  164. PBTCreate2: ;D=Xofs,E=Yofs,A=Count
  165.  push af
  166.   ld hl,pbtfreebullet
  167.   bit 6,(hl)
  168.   jr z,_        ;stop routine if over 64 bullets. Jump past if no stop.
  169.  pop af
  170.  ret
  171. _:
  172.   ld a,(hl) ;1.read
  173.   inc (hl)  ;2.increment
  174.   ld L,a
  175.   ld h,$8D
  176.   ld L,(hl) ;got bullet position
  177.   push hl
  178.   pop ix
  179.   ld a,(charx)
  180.   srl a \ srl a
  181.   add a,d
  182.   ld (ix+2),a
  183.   ld a,(chary)
  184.   srl a \ srl a
  185.   add a,e
  186.   ld (ix+1),a
  187.   ld a,(mdanmaku)
  188.   rrca
  189.   rrca
  190.   and $80
  191.  pop bc
  192.  or b    ;combining masks for b7=focused, b0-b6=counter
  193.  ld (ix+0),a
  194.  ret
  195.  
  196.  
  197.  
  198. PBTDestroy: ;must be called in MOVE routine b4 SP is changed to save values
  199.  ld hl,-3
  200.  add hl,sp
  201.  ld (hl),$FF
  202.  ex de,hl
  203.  ld hl,pbtfreebullet
  204.  dec (hl)  ;1.decrement
  205.  ld L,(hl) ;2.write
  206.  ld h,$8D
  207.  ld (hl),e
  208.  jp PBTMainMoveRet
  209.  
  210. PBTFillBulletDetails:
  211.  ld c,a
  212.  ld b,0   ;offset (0 if render cycle, 4 if move/collide cycle)
  213.  ld a,(characterID)
  214.  add a,a
  215.  ld hl,PBTPlayerTypeTables
  216.  add a,L
  217.  ld L,a
  218.  jr nc,$+3
  219.  inc h
  220.  ld e,(hl)
  221.  inc hl
  222.  ld d,(hl) ;got address to character's bullet table in DE
  223.  ld a,(charweapon1)  ;unfocused weapon type
  224.  add a,a  ;x2
  225.  add a,a  ;x4
  226.  add a,a  ;x8  ;weapon power type now available.
  227.  add a,e
  228.  ld L,a
  229.  ld h,d
  230.  jr nc,_
  231.  inc h
  232. _:
  233.  add hl,bc
  234.  ld a,(hl)
  235.  inc hl
  236.  ld h,(hl)
  237.  ld L,a
  238.  ld (itemp2),hl  ;unfocused weapon type in itemp2 variable
  239.  ld a,(charweapon2)  ;focused weapon type
  240.  add a,a  ;x2
  241.  add a,a  ;x4
  242.  add a,a  ;x8
  243.  add a,2  ;+more offset for focused type
  244.  add a,e
  245.  ld L,a
  246.  ld h,d
  247.  jr nc,_
  248.  inc h
  249. _:
  250.  add hl,bc
  251.  ld a,(hl)
  252.  inc hl
  253.  ld h,(hl)
  254.  ld L,a
  255.  ld (itemp3),hl  ;focused weapon type in itemp3 variable
  256.  ret
  257.  
  258. ;-----------------------------------------------------------------------------
  259. ;PLAYER BULLET CREATION TABLES
  260. ;
  261.  
  262.  
  263. PBTPlayerRoutineTables:
  264. .dw PBTPRT00  ;Devblock  (ChID0) DO NOT CHANGE THESE ENTRIES
  265. .dw PBTPRT01  ;Iambian   (ChID1)
  266. .dw PBTPRT02  ;Netham45  (ChID2)
  267. .dw PBTPRT03  ;???       (ChID3)
  268. .dw PBTPRT04  ;???       (ChID4)
  269. .dw PBTPRT05  ;???       (ChID5)
  270. .dw PBTPRT06  ;Netham45L (ChID6)
  271. .dw PBTPRT07  ;???       (ChID7)
  272.  
  273. PBTPRT00:  ;Devblock  (ChID0)
  274. .dw DevBlockUnfPwr1   ;direct links to the routines that is about to be used
  275. .dw DevBlockFocPwr1
  276. .dw DevBlockUnfPwr2   ;direct links to the routines that is about to be used
  277. .dw DevBlockFocPwr2
  278. PBTPRT01:  ;Iambian   (ChID1)
  279. .dw IambianClaw ; Unfocused attack pwr1
  280. .dw IambianFire            ;  Focused attack pwr1
  281. .dw IambianClaw          ;  pwr2
  282. .dw IambianFire           ;  pwr2
  283. PBTPRT02:  ;Netham45  (ChID2)
  284. .dw TestRoutineUnFocPwr1
  285. .dw TestRoutineFocusPwr1
  286. .dw TestRoutineUnFocPwr2
  287. .dw TestRoutineFocusPwr2
  288. PBTPRT03:  ;???       (ChID3)
  289. .dw TestRoutineUnFocPwr1
  290. .dw TestRoutineFocusPwr1
  291. .dw TestRoutineUnFocPwr2
  292. .dw TestRoutineFocusPwr2
  293. PBTPRT04:  ;???       (ChID4)
  294. .dw TestRoutineUnFocPwr1
  295. .dw TestRoutineFocusPwr1
  296. .dw TestRoutineUnFocPwr2
  297. .dw TestRoutineFocusPwr2
  298. PBTPRT05:  ;Nanami    (ChID5)
  299. .dw NanamiP1U
  300. .dw NanamiP1F
  301. .dw NanamiP2U
  302. .dw NanamiP2F
  303. PBTPRT06:  ;Netham45L (ChID6)
  304. .dw ShotHyperdrive
  305. .dw TestRoutineFocusPwr1
  306. .dw TestRoutineUnFocPwr2
  307. .dw TestRoutineFocusPwr2
  308. PBTPRT07:  ;???       (ChID7)
  309. .dw TestRoutineUnFocPwr1
  310. .dw TestRoutineFocusPwr1
  311. .dw TestRoutineUnFocPwr2
  312. .dw TestRoutineFocusPwr2
  313.  
  314.  
  315. ;-----------------------------------------------------------------------------
  316. ;PLAYER BULLET RENDER/MOVE/COLLISION TABLES
  317. ;
  318.  
  319. PBTPlayerTypeTables:
  320. .dw PBTPTT00  ;Devblock  (ChID0) DO NOT CHANGE THESE ENTRIES
  321. .dw PBTPTT01  ;Iambian   (ChID1)
  322. .dw PBTPTT02  ;Netham45  (ChID2)
  323. .dw PBTPTT03  ;???       (ChID3)
  324. .dw PBTPTT04  ;???       (ChID4)
  325. .dw PBTPTT05  ;Nanami    (ChID5)
  326. .dw PBTPTT06  ;Netham45L (ChID6)
  327. .dw PBTPTT07  ;???       (ChID7)
  328.  
  329. ;SO FAR EVERY ENTRY IN THIS TABLE IS DUMMY ENTRIES. FILL IN WITH ACTUAL
  330. ;DATA CONNECTED TO ASSEMBLY ROUTINES WHENEVER YOU ARE READY TO CODE THIS
  331. ;HORRIBLE MESS.
  332. PBTPTT00:         ;Devblock  (ChID0)
  333. .dw PBTShot00Draw ;-Unfocused shot power 1 render
  334. .dw PBTShot00Draw ;-Focused   shot power 1 render
  335. .dw PBTShot00Move ;-Unfocused shot power 1 move/collide/remove
  336. .dw PBTShot00Move ;-Focused   shot power 1 move/collide/remove
  337. .dw PBTShot00Draw ;-Unfocused shot power 2 render
  338. .dw PBTShot00Draw ;-Focused   shot power 2 render
  339. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  340. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  341. PBTPTT01:         ;Iambian   (ChID1)
  342. .dw PBTShot01DrawIam ;-Unfocused shot power 1 render
  343. .dw PBTShot00DrawIam ;-Focused   shot power 1 render
  344. .dw PBTCLAWMove    ;-Unfocused shot power 1 move/collide/remove
  345. .dw PBMoveANG ;-Focused   shot power 1 move/collide/remove
  346. .dw PBTShot01DrawIam ;-Unfocused shot power 2 render
  347. .dw PBTShot00DrawIam ;-Focused   shot power 2 render
  348. .dw PBTCLAWMove ;-Unfocused shot power 2 move/collide/remove
  349. .dw PBMoveANG;-Focused   shot power 2 move/collide/remove
  350. PBTPTT02:         ;Netham45  (ChID2)
  351. .dw PBTShot00Draw ;-Unfocused shot power 1 render
  352. .dw PBTShot00Draw ;-Focused   shot power 1 render
  353. .dw PBTShot00Move ;-Unfocused shot power 1 move/collide/remove
  354. .dw PBTShot00Move ;-Focused   shot power 1 move/collide/remove
  355. .dw PBTShot00Draw ;-Unfocused shot power 2 render
  356. .dw PBTShot00Draw ;-Focused   shot power 2 render
  357. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  358. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  359. PBTPTT03:         ;???       (ChID3)
  360. .dw PBTShot00Draw ;-Unfocused shot power 1 render
  361. .dw PBTShot00Draw ;-Focused   shot power 1 render
  362. .dw PBTShot00Move ;-Unfocused shot power 1 move/collide/remove
  363. .dw PBTShot00Move ;-Focused   shot power 1 move/collide/remove
  364. .dw PBTShot00Draw ;-Unfocused shot power 2 render
  365. .dw PBTShot00Draw ;-Focused   shot power 2 render
  366. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  367. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  368. PBTPTT04:         ;???       (ChID4)
  369. .dw PBTShot00Draw ;-Unfocused shot power 1 render
  370. .dw PBTShot00Draw ;-Focused   shot power 1 render
  371. .dw PBTShot00Move ;-Unfocused shot power 1 move/collide/remove
  372. .dw PBTShot00Move ;-Focused   shot power 1 move/collide/remove
  373. .dw PBTShot00Draw ;-Unfocused shot power 2 render
  374. .dw PBTShot00Draw ;-Focused   shot power 2 render
  375. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  376. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  377. PBTPTT05:         ;Nanami    (ChID5)PB00MoveCollide: ;dummy routine
  378. .dw PBTShot00Drawiam ;-Unfocused shot power 1 render
  379. .dw PBTShot00Drawiam ;-Focused   shot power 1 render
  380. .dw nanamiTest ;-Unfocused shot power 1 move/collide/remove
  381. .dw nanamitest ;-Focused   shot power 1 move/collide/remove
  382. .dw PBTShot00Drawiam ;-Unfocused shot power 2 render
  383. .dw PBTShot00Drawiam ;-Focused   shot power 2 render
  384. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  385. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  386. PBTPTT06:         ;Netham45L (ChID6)
  387. .dw PBTShot00Draw ;-Unfocused shot power 1 render
  388. .dw PBTShot00Draw ;-Focused   shot power 1 render
  389. .dw PBTShot00Move ;-Unfocused shot power 1 move/collide/remove
  390. .dw PBTShot00Move ;-Focused   shot power 1 move/collide/remove
  391. .dw PBTShot00Draw ;-Unfocused shot power 2 render
  392. .dw PBTShot00Draw ;-Focused   shot power 2 render
  393. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  394. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  395. PBTPTT07:         ;???       (ChID7)PB00Draw         ;dummy routine
  396. .dw PBTShot00Draw ;-Unfocused shot power 1 render
  397. .dw PBTShot00Draw ;-Focused   shot power 1 render
  398. .dw PBTShot00Move ;-Unfocused shot power 1 move/collide/remove
  399. .dw PBTShot00Move ;-Focused   shot power 1 move/collide/remove
  400. .dw PBTShot00Draw ;-Unfocused shot power 2 render
  401. .dw PBTShot00Draw ;-Focused   shot power 2 render
  402. .dw PBTShot00Move ;-Unfocused shot power 2 move/collide/remove
  403. .dw PBTShot00Move ;-Focused   shot power 2 move/collide/remove
  404.  
  405. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  406. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  407. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  408. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  409.  
  410. ;=============================================================================
  411. ;CHARACTER FIRING CODE (what happens when you push the fire button)
  412. ;
  413.  
  414. DevBlockUnfPwr1:  ;These routines pretty much all do the same thing
  415. TestRoutineUnFocPwr1:
  416. TestRoutineUnFocPwr2:
  417. DevBlockUnfPwr2:
  418. ;This routine fires a single centered shot on even cycles and
  419. ;two side shots on odd cycles, every other game cycle
  420.  ld hl,firedelay
  421.  dec (hl)
  422.  ret nz
  423.  ld (hl),2  ;FIRE DELAY FOR STANDARD SHOT IS TWO
  424.  ld hl,charweapondat
  425.  inc (hl)
  426.  bit 0,(hl)  ;check to see if even or odd. Using it to alternate bullet sets
  427.  ld hl,(chary)
  428.  jp z,_      ;jump to two side bullets thing
  429.  PBTSHOT(3,-1,126) ;xofs,yofs,cnt. centered bullet
  430.  ret
  431. _:
  432.  PBTSHOT(0,-1,126) ;left side
  433.  PBTSHOT(6,-1,126) ;right side
  434.  ret
  435.  
  436. DevBlockFocPwr1:  ;Again, these routines all pretty much do the same thing
  437. DevBlockFocPwr2:
  438. TestRoutineFocusPwr1:
  439. TestRoutineFocusPwr2:
  440. ;This routine fires two centered shots every game cycle
  441. ;
  442.  ld hl,firedelay
  443.  dec (hl)
  444.  ret nz
  445.  ld (hl),1  ;ONE GAME CYCLE. THIS CYCLING PROBABLY ISN'T NEEDED THO.
  446.  PBTSHOT(2,-1,126) ;left center
  447.  PBTSHOT(4,-1,126) ;right center
  448.  ret
  449.  
  450.  
  451. ShotHyperdrive:
  452.  PBTSHOT(3,-1,126)
  453.  PBTSHOT(3,-1,126)
  454.  PBTSHOT(3,-1,126)
  455.  PBTSHOT(3,-1,126)
  456.  PBTSHOT(3,-1,126)
  457.  PBTSHOT(3,-1,126)
  458.  PBTSHOT(3,-1,126)
  459.  PBTSHOT(3,-1,126)
  460.  
  461.  ret
  462.  
  463. ;==========================================================
  464. ;============Dragons attacks===============================
  465.  
  466. IambianClaw:
  467. ;Fires a 2 waves straight forward
  468. ;Pwr 2 attack fires 6 waves spaced out in a 15degree arc
  469.  ld a,(firedelay)         ;load a with fire delay
  470. ;    1 Good we can fire again
  471. ;    0 nope already shot a bullet wait till next keypress
  472.  or a          ;if z quit because we have already shot a bullet and not let go of the key      
  473.  ret z         ; ^
  474.  xor a         ; zero a
  475.  ld (firedelay),a ; and load it back into fire delay so that we do not shoot again
  476.  ld a,(pbtfreebullet)  ; load a with amount of bullets on the PBT
  477.  cp 3          ; if greater than 3 QUIT
  478.  ret nc        ; ^  
  479. ;PBTSHOT(xofs,yofs,count)
  480. ;PBTSHOT(1,1,126)
  481.  ld a,120         ;load up teh cannon sire
  482.  LD d,1           ; Account for wind
  483.  ld e,1           ; AIM
  484.  call pbtcreate2  ; FIRE!!!!! BLAM BANG BANG BOOM
  485.  
  486.  ret              ; Till the next fight good sir *tips hat*
  487.  
  488.  
  489. IambianFire:
  490.  
  491.  ld hl,firedelay
  492.  dec (hl)
  493.  ret nz
  494.  ld (hl),1  ;FIRE DELAY FOR STANDARD SHOT IS TWO
  495.  
  496.  call FormatDragonFire
  497.  and %01111110
  498.  CALL PBTCREATE2
  499.  
  500.  call FormatDragonFire
  501.  and %01101111
  502.  CALL PBTCREATE2
  503.  
  504.  call FormatDragonFire
  505.  and %01011111
  506.  CALL PBTCREATE2
  507.  
  508.  call FormatDragonFire
  509.  and %01101111
  510.  CALL PBTCREATE2
  511.  
  512.  
  513.  
  514.  ret
  515.  
  516. FormatDragonFire:
  517.  LD D,3
  518.  LD E,-1
  519.     ld  hl,lfsrseed1
  520.     ld  a,(hl)
  521.     rrca
  522.     ld  (hl),a
  523.     jp nc,+_
  524.     xor %00111000
  525.     ld  (hl),a
  526. _:
  527.     set 6,a
  528.  ret
  529. ;=======================end dragons attacks===================================
  530. ;=============================================================================
  531.  
  532.  
  533. ;=============================================================================
  534. ;==========================Nanami's Attacks===================================
  535. NanamiP1U:
  536.  ; This attack sends a single shot out in a arch with the shape of
  537.  ;                _----_
  538.  ;               |      |
  539.  ;                \    /
  540.  ;                 \  /
  541.  ;                  \/
  542.  ;                   X
  543.  ; where X is nanami
  544.  ; it follows this path unless 2nd is released in which it takes the most linear path back to nanmi from its current
  545.  ; position
  546.  ;
  547.  ; This attack also starts the arc in a different direction based on which direction you were traveling last
  548.  ;
  549.  ; This has a look up table at Nanami45LUT that is aligned on the LUT page
  550.  ; This LUT contains the offsets from the firing position of nanami that makes it have this proper arc
  551.  ; by doing it this way its much faster and causes less of a headache.
  552.  ; When second is released we will be having the bullet come back to nanami this will be done with a arctan look up.
  553.  ; going to see if i cant get away with reusing some of iambians enimy routines here have to lookinto the track function
  554.  ; - 5 minutes later -
  555.  ; we can use the call r.arctan to get the angle and return it in C
  556.  ;
  557.  ; TTl of bullet.
  558.  ; i have no clue how to do this other than doing blatant collision detection with your self ask iambian
  559.  
  560.  ; LUT is organized as such
  561.  ; 2 bytes per pair
  562.  ; a pair consists of a counbt and a angle/2
  563.  ; so
  564.  ; .db 20,45
  565.  ; would move the bullet at a 90D angle for 20 game cycles
  566.  ; angle/2 is because we can not fit more than 127 different angles in the counter var i am using
  567.  ; char weapon dat serve a few purposes.
  568.  ; bit 7 is our left/right indicator
  569.  ; and the lower 7 bits are angle ttl
  570.  ; it set move left if reset move right
  571. ; [22:50:17] <+Iambian> If we really want this thing to be like fukken amazing, I suggest a particle trail :)
  572. ; [22:50:32] <+Iambian> A particle trail made of bullets
  573. ; [22:50:32] <@geekbozu> or a rotating thing
  574. ; [;22:50:35] <@geekbozu> and done
  575. ; [22:50:36] <@geekbozu> totally done
  576. ; [22:50:49] <@geekbozu> have to think of how to do that tho...
  577. ; [22:50:52] <@geekbozu> eh not to hard
  578. ; [22:50:54] <+Iambian> Bullets that can so totally damage the enemy
  579. ; [22:51:25] <@geekbozu> uhm consequences of calling the pbtbullet create routien while in bullet movement code?
  580. ; [22:51:47] <+Iambian> Without preserving SP? Epic fail.
  581. ; [22:51:59] <@geekbozu> well yeah presering sp obviously
  582. ; [22:52:12] <@geekbozu> (same trick as used to call the sprite routien)
  583. ; [22:52:25] <+Iambian> Yeah, well that should work.
  584. ; [22:52:37] <+Iambian> For creating the trail...
  585. ; [22:52:43] * @geekbozu adds some comments to his noteblock
  586. ; [22:53:22] <@geekbozu> also i intend to just create bullets at semi random intervals with semi random velocities that are slower than the orb
  587. ; [22:53:26] <@geekbozu> and it should make a nice effect
  588. ; [22:53:37] <+Iambian> I suggest getting the current angle that the thing is heading in, negating that so it goes in the opposite direction, then adding an angle that is plus or minus some amount. Probably similar to how the dragonfire is done, except the revised full-range code should be used
  589. ; [22:53:55] <@geekbozu> yeah more or less what i am thinking
  590. ; [22:54:07] <@geekbozu> but thats at a later date
Advertisement
Add Comment
Please, Sign In to add comment