mirror of
https://github.com/pret/pokeruby.git
synced 2026-08-28 21:34:41 -05:00
Effort Ribbon: Well, you tried.
This commit is contained in:
@@ -6,171 +6,6 @@
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start sub_810F488
|
||||
sub_810F488: @ 810F488
|
||||
push {lr}
|
||||
ldr r1, _0810F4A0 @ =gSpecialVar_0x8004
|
||||
ldr r0, _0810F4A4 @ =0x00000277
|
||||
strh r0, [r1]
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0810F4A8
|
||||
movs r0, 0x1
|
||||
b _0810F4AA
|
||||
.align 2, 0
|
||||
_0810F4A0: .4byte gSpecialVar_0x8004
|
||||
_0810F4A4: .4byte 0x00000277
|
||||
_0810F4A8:
|
||||
movs r0, 0
|
||||
_0810F4AA:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_810F488
|
||||
|
||||
thumb_func_start sub_810F4B0
|
||||
sub_810F4B0: @ 810F4B0
|
||||
push {lr}
|
||||
ldr r1, _0810F4C8 @ =gSpecialVar_0x8004
|
||||
movs r0, 0x9E
|
||||
lsls r0, 2
|
||||
strh r0, [r1]
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0810F4CC
|
||||
movs r0, 0x1
|
||||
b _0810F4CE
|
||||
.align 2, 0
|
||||
_0810F4C8: .4byte gSpecialVar_0x8004
|
||||
_0810F4CC:
|
||||
movs r0, 0
|
||||
_0810F4CE:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_810F4B0
|
||||
|
||||
thumb_func_start sub_810F4D4
|
||||
sub_810F4D4: @ 810F4D4
|
||||
push {lr}
|
||||
ldr r1, _0810F4EC @ =gSpecialVar_0x8004
|
||||
ldr r0, _0810F4F0 @ =0x00000279
|
||||
strh r0, [r1]
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0810F4F4
|
||||
movs r0, 0x1
|
||||
b _0810F4F6
|
||||
.align 2, 0
|
||||
_0810F4EC: .4byte gSpecialVar_0x8004
|
||||
_0810F4F0: .4byte 0x00000279
|
||||
_0810F4F4:
|
||||
movs r0, 0
|
||||
_0810F4F6:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_810F4D4
|
||||
|
||||
thumb_func_start sub_810F4FC
|
||||
sub_810F4FC: @ 810F4FC
|
||||
push {lr}
|
||||
ldr r1, _0810F514 @ =gSpecialVar_0x8004
|
||||
ldr r0, _0810F518 @ =0x0000027a
|
||||
strh r0, [r1]
|
||||
bl FlagGet
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _0810F51C
|
||||
movs r0, 0x1
|
||||
b _0810F51E
|
||||
.align 2, 0
|
||||
_0810F514: .4byte gSpecialVar_0x8004
|
||||
_0810F518: .4byte 0x0000027a
|
||||
_0810F51C:
|
||||
movs r0, 0
|
||||
_0810F51E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_810F4FC
|
||||
|
||||
thumb_func_start LeadMonHasEffortRibbon
|
||||
LeadMonHasEffortRibbon: @ 810F524
|
||||
push {lr}
|
||||
bl GetLeadMonIndex
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, _0810F548 @ =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x47
|
||||
movs r2, 0
|
||||
bl GetMonData
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
pop {r1}
|
||||
bx r1
|
||||
.align 2, 0
|
||||
_0810F548: .4byte gPlayerParty
|
||||
thumb_func_end LeadMonHasEffortRibbon
|
||||
|
||||
thumb_func_start GivLeadMonEffortRibbon
|
||||
GivLeadMonEffortRibbon: @ 810F54C
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
movs r0, 0x2A
|
||||
bl IncrementGameStat
|
||||
ldr r0, _0810F580 @ =0x0000083b
|
||||
bl FlagSet
|
||||
movs r1, 0x1
|
||||
mov r0, sp
|
||||
strb r1, [r0]
|
||||
bl GetLeadMonIndex
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, _0810F584 @ =gPlayerParty
|
||||
adds r0, r1
|
||||
movs r1, 0x47
|
||||
mov r2, sp
|
||||
bl SetMonData
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0810F580: .4byte 0x0000083b
|
||||
_0810F584: .4byte gPlayerParty
|
||||
thumb_func_end GivLeadMonEffortRibbon
|
||||
|
||||
thumb_func_start GetLeadMonEVCount
|
||||
GetLeadMonEVCount: @ 810F588
|
||||
push {lr}
|
||||
bl GetLeadMonIndex
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x64
|
||||
muls r0, r1
|
||||
ldr r1, _0810F5AC @ =gPlayerParty
|
||||
adds r0, r1
|
||||
bl GetMonEVCount
|
||||
lsls r0, 16
|
||||
ldr r1, _0810F5B0 @ =0x01fd0000
|
||||
cmp r0, r1
|
||||
bhi _0810F5B4
|
||||
movs r0, 0
|
||||
b _0810F5B6
|
||||
.align 2, 0
|
||||
_0810F5AC: .4byte gPlayerParty
|
||||
_0810F5B0: .4byte 0x01fd0000
|
||||
_0810F5B4:
|
||||
movs r0, 0x1
|
||||
_0810F5B6:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end GetLeadMonEVCount
|
||||
|
||||
thumb_func_start sub_810F5BC
|
||||
sub_810F5BC: @ 810F5BC
|
||||
push {lr}
|
||||
|
||||
1
include/pokemon.h
Normal file → Executable file
1
include/pokemon.h
Normal file → Executable file
@@ -510,5 +510,6 @@ void sub_8040B8C(void);
|
||||
void SetWildMonHeldItem(void);
|
||||
u8 *sub_8040D08();
|
||||
bool32 sub_8040D3C(u16 species, u8 *name, u8 language);
|
||||
u16 GetMonEVCount(struct Pokemon *);
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
||||
@@ -1779,3 +1779,74 @@ u8 sub_810F424(void)
|
||||
}
|
||||
return gUnknown_083F83EC[v0 % 12];
|
||||
}
|
||||
|
||||
bool8 sub_810F488(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = 0x277;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_810F4B0(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = 0x278;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_810F4D4(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = 0x279;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_810F4FC(void)
|
||||
{
|
||||
u16 *specVar = &gSpecialVar_0x8004;
|
||||
u16 flag = 0x27a;
|
||||
*specVar = flag;
|
||||
if (!FlagGet(flag))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 LeadMonHasEffortRibbon(void)
|
||||
{
|
||||
return GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_EFFORT_RIBBON, NULL);
|
||||
}
|
||||
|
||||
void GivLeadMonEffortRibbon(void)
|
||||
{
|
||||
bool8 ribbonSet;
|
||||
IncrementGameStat(GAME_STAT_RECEIVED_RIBBONS);
|
||||
FlagSet(SYS_RIBBON_GET);
|
||||
ribbonSet = TRUE;
|
||||
SetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_EFFORT_RIBBON, &ribbonSet);
|
||||
}
|
||||
|
||||
bool8 GetLeadMonEVCount(void)
|
||||
{
|
||||
if (GetMonEVCount(&gPlayerParty[GetLeadMonIndex()]) >= 510)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user