Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SpellEffect_Boost:
- move.b (a5),d0
- jsr GetStatusEffects
- move.w d1,d3
- ori.w #STATUSEFFECT_BOOST,d1
- jsr SetStatusEffects
- andi.w #STATUSEFFECT_BOOST,d3
- beq.s @WriteScriptCommands
- moveq #8,d2
- bsr.w ApplyRandomEffectiveness
- @WriteScriptCommands:
- move.w d1,d5
- jsr GetMaxHP
- move.w d1,d2
- jsr GetCurrentHP
- sub.w d1,d2
- move.w BATTLEACTION_OFFSET_ITEM_OR_SPELL(a3),d1
- jsr FindSpellDefAddress
- clr.w d6
- move.b SPELLDEF_OFFSET_POWER(a0),d6
- cmpi.b #255,d6
- bne.s @AdjustSpellPower
- move.w d2,d6
- bra.s @CapRecovery
- @AdjustSpellPower:
- bsr.w AdjustSpellPower
- @CapRecovery:
- cmp.w d6,d2
- bcc.s @HPCaculated
- move.w d2,d6
- @HPCaculated:
- move.w d5,d1
- btst #COMBATANT_BIT_ENEMY,d0
- bne.s @EnemyReaction
- executeAllyReaction d6,#0,d1,#2 ; HP change (signed), MP change (signed), Status Effects, Flags
- bra.s @BattleMessage
- @EnemyReaction:
- executeEnemyReaction d6,#0,d1,#2 ; HP change (signed), MP change (signed), Status Effects, Flags
- @BattleMessage:
- displayMessage #MESSAGE_BATTLE_RECOVERED_HIT_POINTS,d0,#0,d6
- bsr.w GiveStatusEffectSpellsEXP
- jsr GetBaseAGI
- mulu.w #3,d1
- lsr.l #3,d1
- displayMessage #MESSAGE_BATTLE_BOOST_SPELL_AGI_INCREASE,d0,#0,d1
- ; Message, Combatant, Item or Spell, Number
- jsr GetBaseDEF
- mulu.w #3,d1
- lsr.l #3,d1
- displayMessage #MESSAGE_BATTLE_BOOST_SPELL_DEF_INCREASE,d0,#0,d1
- ; Message, Combatant, Item or Spell, Number
- rts
- ; End of function SpellEffect_Boost
Advertisement
Add Comment
Please, Sign In to add comment