- 33
- Posts
- 13
- Years
- Seen Dec 17, 2016
Thirdly, I noticed you discussed stuff about double battles. Did you come to any conclusion about a safe edit to change an attack from hitting 1 to 2 or 3 other Pokemon?
This is a rather late response, but changing an attack to hit both opponents yields no problems if the effect is originally designed to only target a single opponent. It will not work properly if you change the target byte to 0x20 (targeting opponents and partner) unless there is something obvious that I'm missing. You'd have to script a new effect.
And as far as I know, in double battles, moves that hit the entire field (like Earthquake or gen 4 Surf) don't interact properly with certain abilities. Water Absorb, Volt Absorb, and probably Flash Fire halt execution of the move entirely when a target when the ability is hit. Lightningrod seems to do absolutely nothing (technically this is "correct" behavior in later gens if we ignore the extra properties of Lightningrod in later gens).
Here are decompiled BSP scripts for Earthquake and Explosion:
Spoiler:
//EARTHQUAKE
#org 0x1D7B13
attackcanceler
attackstring
ppreduce
selectnexttarget
cmd25
jumpifspecialstatusflag 0x0 0x80 0x1 0x81D7B37
orword 0x2023DD0 0x20000
setbyte 0x2023FD2 0x2
goto 0x81D7B46
#org 0x1D7B37
bicword 0x2023DD0 0x20000
setbyte 0x2023FD2 0x1
accuracycheck 0x81D7B7F 0x0
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D7B17
end
#org 0x1D7B7F
pause 0x20
cmd6
missmessage
resultmessage
waitmessage 0x40
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D7B17
end
// Used Strings
// String 0x130
// =
#org 0x1D7B46
accuracycheck 0x81D7B7F 0x0
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D7B17
end
#org 0x1D7B7F
pause 0x20
cmd6
missmessage
resultmessage
waitmessage 0x40
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D7B17
end
// Used Strings
// String 0x130
// =
Spoiler:
//EXPLOSION
#org 0x1D6A76
attackcanceler
attackstring
ppreduce
faintifabilitynotdamp
setuserhptozero
waitstate
jumpifbyte 0x5 0x2023DCC 0x1 0x81D6A91
call 0x81D6AE7
goto 0x81D6A93
#org 0x1D6A91
attackanimation
waitanimation
cmd25
calculatedamage
accuracycheck 0x81D6ACC 0x0
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D6A93
faintpokemon 0x1 0x0 0x0
end
#org 0x1D6ACC
missmessage
resultmessage
waitmessage 0x40
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D6A93
faintpokemon 0x1 0x0 0x0
end
#org 0x1D6AE7
bicbyte 0x2023DCC 0x1
attackanimation
waitanimation
orbyte 0x2023DCC 0x1
return
#org 0x1D6A93
cmd25
calculatedamage
accuracycheck 0x81D6ACC 0x0
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D6A93
faintpokemon 0x1 0x0 0x0
end
#org 0x1D6ACC
missmessage
resultmessage
waitmessage 0x40
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid 0x81D6A93
faintpokemon 0x1 0x0 0x0
end
I haven't really gone through all of this yet, but clearly the effects are specifically designed to hit all other Pokemon on the field.
EDIT: Oh, as an aside, trying to decompile Teeter Dance causes BSP to crash.
EDIT 2: Here's a script for gen 4 Surf that should work (except for the interaction with Water Absorb):
Spoiler:
//SURF
#dynamic 0x740200
#freespacebyte 0xFF
#include moves.bsh
#org @start
attackcanceler
attackstring
ppreduce
selectnexttarget
#org @offset1
cmd25
jumpifspecialstatusflag 0x0 0x40000 0x1 @offset2 //check for DIVE
orword 0x2023DD0 0x40000
setbyte 0x2023FD2 0x2
goto @offset3
#org @offset2
bicword 0x2023DD0 0x40000
setbyte 0x2023FD2 0x1
#org @offset3
accuracycheck @offset4 0x0
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
printstring 0x130
waitmessage 0x1
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @offset1
end
#org @offset4
pause 0x20
cmd6
missmessage
resultmessage
waitmessage 0x40
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @offset1
end
// Used Strings
// String 0x130
// =
EDIT 3: Ugh, hitting a Protect also stops execution of the above script. Hmm...
EDIT 4: Oh, I figured it out. Turns out that there's nothing wrong with the script, but BSP was compiling an offset incorrectly for some reason.
Last edited: