mirror of
https://github.com/pret/pmd-sky.git
synced 2026-08-05 02:37:05 -05:00
Decomp BaseFormsEqual
This commit is contained in:
parent
c49eb69081
commit
999df284ff
|
|
@ -1,6 +0,0 @@
|
|||
#pragma once
|
||||
.public FemaleToMaleForm
|
||||
.public GetBaseFormBurmyWormadamShellosGastrodonCherrim
|
||||
.public GetBaseFormCastformDeoxysCherrim
|
||||
.public GetDexNumber
|
||||
.public IsUnown
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "main_02054CD8.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start BaseFormsEqual
|
||||
BaseFormsEqual: ; 0x02054CD8
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
mov r4, r1
|
||||
bl FemaleToMaleForm
|
||||
mov r5, r0
|
||||
mov r0, r4
|
||||
bl FemaleToMaleForm
|
||||
mov r4, r0
|
||||
mov r0, r5
|
||||
bl GetBaseFormCastformDeoxysCherrim
|
||||
mov r5, r0
|
||||
mov r0, r4
|
||||
bl GetBaseFormCastformDeoxysCherrim
|
||||
mov r6, r0
|
||||
cmp r5, r6
|
||||
moveq r0, #1
|
||||
ldmeqia sp!, {r4, r5, r6, pc}
|
||||
mov r0, r5
|
||||
bl IsUnown
|
||||
cmp r0, #0
|
||||
beq _02054D3C
|
||||
mov r0, r6
|
||||
bl IsUnown
|
||||
cmp r0, #0
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r4, r5, r6, pc}
|
||||
_02054D3C:
|
||||
mov r0, r5
|
||||
bl GetBaseFormBurmyWormadamShellosGastrodonCherrim
|
||||
mov r4, r0
|
||||
mov r0, r6
|
||||
bl GetBaseFormBurmyWormadamShellosGastrodonCherrim
|
||||
ldr r1, _02054DB8 ; =0x000001BF
|
||||
cmp r4, r1
|
||||
cmpeq r0, r1
|
||||
beq _02054D8C
|
||||
ldr r1, _02054DBC ; =0x000001C2
|
||||
cmp r4, r1
|
||||
cmpeq r0, r1
|
||||
beq _02054D8C
|
||||
ldr r1, _02054DC0 ; =0x000001CE
|
||||
cmp r4, r1
|
||||
cmpeq r0, r1
|
||||
beq _02054D8C
|
||||
cmp r4, #0x1d0
|
||||
cmpeq r0, #0x1d0
|
||||
bne _02054D94
|
||||
_02054D8C:
|
||||
mov r0, #0
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
_02054D94:
|
||||
mov r0, r5
|
||||
bl GetDexNumber
|
||||
mov r4, r0
|
||||
mov r0, r6
|
||||
bl GetDexNumber
|
||||
cmp r4, r0
|
||||
moveq r0, #1
|
||||
movne r0, #0
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_02054DB8: .word 0x000001BF
|
||||
_02054DBC: .word 0x000001C2
|
||||
_02054DC0: .word 0x000001CE
|
||||
arm_func_end BaseFormsEqual
|
||||
|
|
@ -5,5 +5,6 @@
|
|||
#include "util.h"
|
||||
|
||||
enum monster_id GetBaseFormCastformDeoxysCherrim(enum monster_id monster_id);
|
||||
bool8 BaseFormsEqual(enum monster_id monster1, enum monster_id monster2);
|
||||
|
||||
#endif //PMDSKY_MAIN_02054C24_H
|
||||
|
|
|
|||
1
main.lsf
1
main.lsf
|
|
@ -152,7 +152,6 @@ Static main
|
|||
Object asm/main_02054AD4.o
|
||||
Object src/main_02054BE0.o
|
||||
Object src/main_02054C24.o
|
||||
Object asm/main_02054CD8.o
|
||||
Object src/main_02054DC4.o
|
||||
Object asm/main_02054E4C.o
|
||||
Object src/main_02058C3C.o
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
#include "main_02054C24.h"
|
||||
|
||||
extern enum monster_id FemaleToMaleForm(enum monster_id);
|
||||
extern enum monster_id GetBaseFormBurmyWormadamShellosGastrodonCherrim(enum monster_id);
|
||||
extern s16 GetDexNumber(enum monster_id);
|
||||
extern bool8 IsDeoxys(enum monster_id monster_id);
|
||||
extern bool8 IsUnown(enum monster_id);
|
||||
|
||||
enum monster_id GetBaseFormCastformDeoxysCherrim(enum monster_id monster_id)
|
||||
{
|
||||
|
|
@ -21,3 +25,36 @@ enum monster_id GetBaseFormCastformDeoxysCherrim(enum monster_id monster_id)
|
|||
}
|
||||
return monster_id;
|
||||
}
|
||||
|
||||
bool8 BaseFormsEqual(enum monster_id monster1, enum monster_id monster2)
|
||||
{
|
||||
monster1 = FemaleToMaleForm(monster1);
|
||||
monster2 = FemaleToMaleForm(monster2);
|
||||
|
||||
monster1 = GetBaseFormCastformDeoxysCherrim(monster1);
|
||||
monster2 = GetBaseFormCastformDeoxysCherrim(monster2);
|
||||
|
||||
if (monster1 == monster2) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (IsUnown(monster1) && IsUnown(monster2)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
enum monster_id monster1Base = GetBaseFormBurmyWormadamShellosGastrodonCherrim(monster1);
|
||||
enum monster_id monster2Base = GetBaseFormBurmyWormadamShellosGastrodonCherrim(monster2);
|
||||
|
||||
if ((monster1Base == MONSTER_BURMY_SANDY && monster2Base == MONSTER_BURMY_SANDY) ||
|
||||
(monster1Base == MONSTER_WORMADAM_SANDY && monster2Base == MONSTER_WORMADAM_SANDY) ||
|
||||
(monster1Base == MONSTER_SHELLOS_EAST && monster2Base == MONSTER_SHELLOS_EAST) ||
|
||||
(monster1Base == MONSTER_GASTRODON_EAST && monster2Base == MONSTER_GASTRODON_EAST)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (GetDexNumber(monster1) == GetDexNumber(monster2)) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user