Seen January 10th, 2017
Posted April 21st, 2016
180 posts
5.5 Years
I've made a fully functional Close Combat effect for FireRed, with the animation varying when one stat is already at its minimum (i.e. only lowering one), when both aren't at their minimum (i.e. lowering both) and when both are at their minimum (i.e. skipping the drops altogether). This does use ASM but I've since been told that it could be done with the jumpifstat command. I'm going to post this anyway. You'll need to have the battle script callasm command, too.
Could you please double-check your Close Combat asm. It does not work with Thumb.

I'm not good at asm but a quick look at the stuff down at the bottom (Align 2) has pointers defined which are not in the code (.UserBank) and (.LowerBothBS) and in the main itself there is .CurrentMonIndex which is not down in the Align 2. list.

Would you mind re-checking it with your notes and confirming with Thumb that it works for you?


Oh right this thread exists.
I've also ported Sucker Punch to Emerald:
Spoiler:
.Align 2
.UserBank: .word 0x0202420B
.TargetBank: .word 0x0202420C
.BattleStruct: .word 0x02024084
.BasePower: .word 0x02024400
.TurnOrder: .word 0x0202407E
.MonsMoved: .word 0x02024082
.MovesUsed: .word 0x02024274
.MoveTable: .word 0x08XXXXXX
.CurrentScript: .word 0x02024214
.FailScript: .word 0x082D9F15


However, I can't manage to get "The Moved Failed" in my script. It just shows "XX Used Sucker Punch" and then nothing (everything works fine, just that this textstring doesn't come up). I've tried to add Resultmessage and missmessage after the callasm, but neither of that worked.

This is my script (Uses Quick Attack effect spot):

Spoiler:
#org @start
jumpifhalfword 0x0 0x20241EA 0x[MoveHex] @SPunch
goto 0x82D8A00

#org @SPunch
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
callasm 0x8[Offset of asm +1]
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c BANK_TARGET
waitstate
graphicalhpupdate BANK_TARGET
datahpupdate BANK_TARGET
critmessage
waitmessage DELAY_1SECOND
resultmessage
waitmessage DELAY_1SECOND
fainpokemon BANK_TARGET 0x0 0x0 
setbyte 0x2024488
cmd49 0x0 0x0
end


Do I need to add a printstring somewhere? Sorry if noobish question.