- 218
- Posts
- 11
- Years
- Seen Nov 12, 2021
Imposter :
Emerald
Read me:
When I say "don't use it if X", it's because it is already covered in X.
The battle script comes first (don't use it if you want to implement Mega evolution):
Switch in Check (remove the bolded lines if you don't have the primal/mega weather) (don't use if you want mega evolution):
Transform doesn't work on a substitute:
Perhaps it's not the better way to do it, any suggestion is welcome.
Shouldn't we edit the transform command too ? In the case you get intimidate or something
Spoiler:
Emerald
Spoiler:
Read me:
Spoiler:
When I say "don't use it if X", it's because it is already covered in X.
The battle script comes first (don't use it if you want to implement Mega evolution):
Spoiler:
Code:
#org 0xKKKKKK
transformdataexecution
attackanimation
waitanimation
printfromtable 0x85CC8D4
waitmessage 0x40
end3
Switch in Check (remove the bolded lines if you don't have the primal/mega weather) (don't use if you want mega evolution):
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global checkswitchin
Start:
ldrb r3, [r5]
cmp r1, r3
blo CheckIfSwitchInAbility
mov r0, r10
strb r0, [r2]
CheckIfSwitchInAbility:
ldrb r0, [r7]
cmp r0, #0x2
bne CheckCloudNine
Drizzle:
ldr r2, FreeRam
ldrb r1, [r2]
cmp r1, #0x00
bne NoSwitchInAbility
ldr r1, =(0x08042B78+1)
bx r1
CheckCloudNine:
cmp r0, #0x0D
bne CheckIntimidate
b AirLockCloudNine
CheckIntimidate:
cmp r0, #0x16
bne CheckTrace
Intimidate:
ldr r1, =(0x08042C08+1)
bx r1
CheckTrace:
cmp r0, #0x24
bne CheckSandStream
Trace:
ldr r1, =(0x08042C68+1)
bx r1
CheckSandStream:
cmp r0, #0x2D
bne CheckForecast
SandStream:
ldr r2, FreeRam
ldrb r1, [r2]
cmp r1, #0x00
bne NoSwitchInAbility
ldr r1, =(0x08042BA8+1)
bx r1
CheckForecast:
cmp r0, #0x3B
bne CheckDrought
ForeCast:
ldr r1, =(0x08042C3C+1)
bx r1
CheckDrought:
cmp r0, #0x46
bne CheckAirLock
Drought:
ldr r2, FreeRam
ldrb r1, [r2]
cmp r1, #0x00
bne NoSwitchInAbility
ldr r1, =(0x08042BD8+1)
bx r1
CheckAirLock:
cmp r0, #0x4D
bne CheckDelta
AirLockCloudNine:
ldr r2, FreeRam
ldrb r1, [r2]
cmp r1, #0x00
bne NoSwitchInAbility
ldr r1, =(0x08042CA4+1)
bx r1
[b]CheckDelta:
cmp r0, #0xC0 /*Number of your ability Delta Stream*/
bne CheckDeso
UpdateStrongWind:
ldr r0, CurrentWeather
mov r1, #0
strb r1, [r0]
ldr r0, FreeRam
ldrb r1, [r0]
cmp r1, #0xC0 /*Number of your ability Delta Stream*/
beq NoSwitchInAbility
mov r1, #0xC0 /*Number of your ability Delta Stream*/
strb r1, [r0]
ldr r0, BattleScript
bl ExecuteScript
ldr r1, =(0x08042A72+1)
bx r1
CheckDeso:
cmp r0, #0xBF /*Number of your ability Desolate Land*/
bne CheckPrimo
UpdateDesolate:
ldr r2, FreeRam
mov r0, #0xBF /*Number of your ability Desolate Land*/
strb r0, [r2]
ldr r2, =(0x08042BD8+1)
bx r2
CheckPrimo:
cmp r0, #0xBE /*Number of your ability Primordial Sea*/
bne CheckImposter
UpdatePrimordial:
ldr r2, FreeRam
mov r0, #0xBE /*Number of your ability Primordial Sea*/
strb r0, [r2]
ldr r2, =(0x08042B78+1)
bx r2[/b]
CheckImposter:
cmp r0, #0x97 /*Number of your ability Imposter*/
beq Imposter
NoSwitchInAbility:
ldr r1, =(0x08042A7E+1)
bx r1
ExecuteScript:
ldr r1, =(0x08042BEE+1)
bx r1
Imposter:
mov r0, r10
ldr r1, BankUser
b CheckTargetAndStore
Store:
ldr r0, BankTarget
strb r4, [r0]
pop {r0-r4}
mov r0, r10
strb r0, [r1]
Next:
ldr r0, CurrentMove
mov r1, #0x90 /*Index number of Transform move*/
strh r1, [r0]
ldr r0, CurrentMove2
strh r1, [r0]
ldr r0, BattleScriptImposter
bl ExecuteScript
ldr r1, =(0x08042A72+1)
bx r1
PopNoSwitch:
pop {r0-r4}
b NoSwitchInAbility
CheckTargetAndStore:
push {r0, r1}
ldr r0, NPokeOnField
ldrb r1, [r0]
cmp r1, #2
beq Simple
pop {r0, r1}
cmp r0, #0
beq ThreeTarget
cmp r0, #2
beq OneTarget
cmp r0, #1
beq TwoTarget
mov r0, #0
b CheckTarget
ThreeTarget:
mov r0, #3
b CheckTarget
TwoTarget:
mov r0, #2
b CheckTarget
OneTarget:
mov r0, #1
b CheckTarget
Simple:
pop {r0, r1}
cmp r0, #0
beq OneTarget
mov r0, #0
CheckTarget:
push {r0-r4}
ldr r1, BattleData
mov r2, #0x58
mov r4, r0
mul r0, r2
add r0, r1
add r0, #0x28
ldrh r3, [r0]
cmp r3, #0
beq PopNoSwitch
add r0, #0x28
ldr r3, [r0]
ldr r2, TransformSubStatut
and r3, r2
cmp r3, #0
bne PopNoSwitch
ldr r2, InvulnStatut
mov r0, r4
ldr r3, CheckInvulnerableStatut
lsl r0, #2
add r0, r3
ldr r3, [r0]
and r3, r2
cmp r3, #0
bne PopNoSwitch
b Store
.align 2
InvulnStatut: .word 0x400C0
TransformSubStatut: .word 0x1200000
NPokeOnField: .word 0x0202406C
BattleData: .word 0x02024084
BankUser: .word 0x0202420B
CurrentMove: .word 0x020241EA
CurrentMove2: .word 0x020241EC
BankTarget: .word 0x0202420C
BattleScript: .word 0x08A21E80
CurrentWeather: .word 0x020243CC
FreeRam: .word 0x0203E331
ActiveBSPointer: .word 0x02024214
BattleScriptImposter: .word 0x08KKKKKK /*BattleScript imposter*/
CheckInvulnerableStatut: .word 0x020242AC
/*00 4B 18 47 xx+1 xx xx 08 at 08042A20*/
Transform doesn't work on a substitute:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global altertransform2
Start:
mov r5, r7
add r5, #0x50
add r0, r0, r5
ldr r0, [r0]
ldr r4, TransformSubStatut
and r4, r0
cmp r4, #0
bne Fail
ldr r2, Return
bx r2
Fail:
ldr r2, ReturnFail
bx r2
.align 2
TransformSubStatut: .word 0x1200000
Return: .word 0x08052088+1
ReturnFail: .word 0x080520A2+1
/*00 4D 28 47 xx+1 xx xx 08 at 08052080*/
Perhaps it's not the better way to do it, any suggestion is welcome.
3. New Switch-in Ability System
Shouldn't we edit the transform command too ? In the case you get intimidate or something
Last edited: