Guest User

Untitled

a guest
Jan 12th, 2018
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. ;;
  2. ; ITEMID_10 ($10) (Bow)
  3. ;
  4. _parentItemCode_bow:
  5. ld e,Item.state ; $4fdd
  6. ld a,(de) ; $4fdf
  7. rst_jumpTable ; $4fe0
  8.  
  9. .dw @state0
  10. ;.dw @state1
  11.  
  12. @state0:
  13. call _isLinkUnderwater ; $4fe5
  14. jp nz,_clearParentItem ; $4fe8
  15.  
  16. ld a,(w1ParentItem2.id) ; $4feb
  17. cp ITEMID_SWITCH_HOOK ; $4fee
  18. jp z,_clearParentItem ; $4ff0
  19.  
  20. ld a,(wLinkSwimmingState) ; $4ff3
  21. or a ; $4ff6
  22. jp nz,_clearParentItem ; $4ff7
  23.  
  24. call _parentItemLoadAnimationAndIncState ; $4ffa
  25. ld a,$01 ; $4ffd
  26. ld e,Item.state ; $4fff
  27. ld (de),a ; $5001
  28.  
  29. ; Try to create the physical boomerang object, delete self on failure
  30. ;dec a ; $5002
  31. ld c,a ; $5003
  32. ;ld e,Item.id ; $5004
  33. ;ld a,(de) ; $5006
  34. ld b,$20 ; $5007
  35. ld e,$01 ; $5008
  36. ld hl,wNumEmberSeeds
  37. ld a,(hl)
  38. cp $00
  39. jp nz, midstate
  40. ld a,SND_ERROR
  41. call playSound
  42. jp _clearParentItem
  43.  
  44. midstate:
  45. sub $01
  46. daa
  47. ld (wNumEmberSeeds),a
  48. call itemCreateChildWithID ; $500a
  49. jp c,_clearParentItem ; $500d
  50.  
  51. ; Calculate angle for newly created boomerang
  52. ld a,(wLinkAngle) ; $5010
  53. bit 7,a ; $5013
  54. jr z,+ ; $5015
  55. ld a,(w1Link.direction) ; $5017
  56. swap a ; $501a
  57. rrca ; $501c
  58. +
  59. ld l,Item.angle ; $501d
  60. ld (hl),a ; $501f
  61. ld l,Item.var34 ; $5020
  62. ld (hl),a ; $5022
  63. ret ; $5023
  64.  
  65. @state1:
  66. ld e,Item.animParameter ; $5024
  67. ld a,(de) ; $5026
  68. rlca ; $5027
  69. jp nc,specialObjectUpdateAnimCounter ; $5028
  70. jp _clearParentItem ; $502b
Advertisement
Add Comment
Please, Sign In to add comment