Degreezy

Boost + Heal

May 22nd, 2021 (edited)
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. SpellEffect_Boost:
  2.  
  3. move.b (a5),d0
  4. jsr GetStatusEffects
  5. move.w d1,d3
  6. ori.w #STATUSEFFECT_BOOST,d1
  7. jsr SetStatusEffects
  8. andi.w #STATUSEFFECT_BOOST,d3
  9. beq.s @WriteScriptCommands
  10. moveq #8,d2
  11. bsr.w ApplyRandomEffectiveness
  12. @WriteScriptCommands:
  13. move.w d1,d5
  14. jsr GetMaxHP
  15. move.w d1,d2
  16. jsr GetCurrentHP
  17. sub.w d1,d2
  18. move.w BATTLEACTION_OFFSET_ITEM_OR_SPELL(a3),d1
  19. jsr FindSpellDefAddress
  20. clr.w d6
  21. move.b SPELLDEF_OFFSET_POWER(a0),d6
  22. cmpi.b #255,d6
  23. bne.s @AdjustSpellPower
  24. move.w d2,d6
  25. bra.s @CapRecovery
  26. @AdjustSpellPower:
  27.  
  28. bsr.w AdjustSpellPower
  29. @CapRecovery:
  30.  
  31. cmp.w d6,d2
  32. bcc.s @HPCaculated
  33. move.w d2,d6
  34.  
  35. @HPCaculated:
  36. move.w d5,d1
  37. btst #COMBATANT_BIT_ENEMY,d0
  38. bne.s @EnemyReaction
  39. executeAllyReaction d6,#0,d1,#2 ; HP change (signed), MP change (signed), Status Effects, Flags
  40. bra.s @BattleMessage
  41. @EnemyReaction:
  42.  
  43. executeEnemyReaction d6,#0,d1,#2 ; HP change (signed), MP change (signed), Status Effects, Flags
  44. @BattleMessage:
  45. displayMessage #MESSAGE_BATTLE_RECOVERED_HIT_POINTS,d0,#0,d6
  46. bsr.w GiveStatusEffectSpellsEXP
  47. jsr GetBaseAGI
  48. mulu.w #3,d1
  49. lsr.l #3,d1
  50. displayMessage #MESSAGE_BATTLE_BOOST_SPELL_AGI_INCREASE,d0,#0,d1
  51. ; Message, Combatant, Item or Spell, Number
  52. jsr GetBaseDEF
  53. mulu.w #3,d1
  54. lsr.l #3,d1
  55. displayMessage #MESSAGE_BATTLE_BOOST_SPELL_DEF_INCREASE,d0,#0,d1
  56. ; Message, Combatant, Item or Spell, Number
  57. rts
  58.  
  59. ; End of function SpellEffect_Boost
  60.  
Advertisement
Add Comment
Please, Sign In to add comment