finished fldeff_strength + lots of clean up
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ sub_8097898: @ 8097898
|
|||||||
cmp r0, 0x1
|
cmp r0, 0x1
|
||||||
beq _080978E0
|
beq _080978E0
|
||||||
movs r0, 0x5F
|
movs r0, 0x5F
|
||||||
bl npc_before_player_of_type
|
bl CheckObjectGraphicsInFrontOfPlayer
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r0, 24
|
lsrs r0, 24
|
||||||
cmp r0, 0x1
|
cmp r0, 0x1
|
||||||
|
|||||||
@@ -1,111 +0,0 @@
|
|||||||
.include "asm/macros.inc"
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
thumb_func_start sub_80D07EC
|
|
||||||
sub_80D07EC: @ 80D07EC
|
|
||||||
push {r4,lr}
|
|
||||||
movs r0, 0x8
|
|
||||||
bl TestPlayerAvatarFlags
|
|
||||||
lsls r0, 24
|
|
||||||
cmp r0, 0
|
|
||||||
bne _080D0808
|
|
||||||
movs r0, 0x61
|
|
||||||
bl npc_before_player_of_type
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
cmp r0, 0x1
|
|
||||||
beq _080D080C
|
|
||||||
_080D0808:
|
|
||||||
movs r0, 0
|
|
||||||
b _080D0826
|
|
||||||
_080D080C:
|
|
||||||
ldr r4, _080D082C @ =gSpecialVar_Result
|
|
||||||
bl GetCursorSelectionMonId
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
strh r0, [r4]
|
|
||||||
ldr r1, _080D0830 @ =gFieldCallback2
|
|
||||||
ldr r0, _080D0834 @ =FieldCallback_PrepareFadeInFromMenu
|
|
||||||
str r0, [r1]
|
|
||||||
ldr r1, _080D0838 @ =gPostMenuFieldCallback
|
|
||||||
ldr r0, _080D083C @ =sub_80D0840
|
|
||||||
str r0, [r1]
|
|
||||||
movs r0, 0x1
|
|
||||||
_080D0826:
|
|
||||||
pop {r4}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
.align 2, 0
|
|
||||||
_080D082C: .4byte gSpecialVar_Result
|
|
||||||
_080D0830: .4byte gFieldCallback2
|
|
||||||
_080D0834: .4byte FieldCallback_PrepareFadeInFromMenu
|
|
||||||
_080D0838: .4byte gPostMenuFieldCallback
|
|
||||||
_080D083C: .4byte sub_80D0840
|
|
||||||
thumb_func_end sub_80D07EC
|
|
||||||
|
|
||||||
thumb_func_start sub_80D0840
|
|
||||||
sub_80D0840: @ 80D0840
|
|
||||||
push {lr}
|
|
||||||
bl GetCursorSelectionMonId
|
|
||||||
ldr r1, _080D0858 @ =gFieldEffectArguments
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
str r0, [r1]
|
|
||||||
ldr r0, _080D085C @ =gUnknown_81BE16E
|
|
||||||
bl ScriptContext1_SetupScript
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.align 2, 0
|
|
||||||
_080D0858: .4byte gFieldEffectArguments
|
|
||||||
_080D085C: .4byte gUnknown_81BE16E
|
|
||||||
thumb_func_end sub_80D0840
|
|
||||||
|
|
||||||
thumb_func_start sub_80D0860
|
|
||||||
sub_80D0860: @ 80D0860
|
|
||||||
push {lr}
|
|
||||||
bl oei_task_add
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
ldr r2, _080D0894 @ =gTasks
|
|
||||||
lsls r1, r0, 2
|
|
||||||
adds r1, r0
|
|
||||||
lsls r1, 3
|
|
||||||
adds r1, r2
|
|
||||||
ldr r2, _080D0898 @ =sub_80D08A8
|
|
||||||
lsrs r0, r2, 16
|
|
||||||
strh r0, [r1, 0x18]
|
|
||||||
strh r2, [r1, 0x1A]
|
|
||||||
ldr r0, _080D089C @ =gFieldEffectArguments
|
|
||||||
ldr r1, [r0]
|
|
||||||
movs r0, 0x64
|
|
||||||
muls r0, r1
|
|
||||||
ldr r1, _080D08A0 @ =gPlayerParty
|
|
||||||
adds r0, r1
|
|
||||||
ldr r1, _080D08A4 @ =gStringVar1
|
|
||||||
bl GetMonNickname
|
|
||||||
movs r0, 0
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
.align 2, 0
|
|
||||||
_080D0894: .4byte gTasks
|
|
||||||
_080D0898: .4byte sub_80D08A8
|
|
||||||
_080D089C: .4byte gFieldEffectArguments
|
|
||||||
_080D08A0: .4byte gPlayerParty
|
|
||||||
_080D08A4: .4byte gStringVar1
|
|
||||||
thumb_func_end sub_80D0860
|
|
||||||
|
|
||||||
thumb_func_start sub_80D08A8
|
|
||||||
sub_80D08A8: @ 80D08A8
|
|
||||||
push {lr}
|
|
||||||
movs r0, 0x28
|
|
||||||
bl FieldEffectActiveListRemove
|
|
||||||
bl EnableBothScriptContexts
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
thumb_func_end sub_80D08A8
|
|
||||||
|
|
||||||
.align 2, 0 @ Don't pad with nop.
|
|
||||||
+4
-4
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start npc_before_player_of_type
|
thumb_func_start CheckObjectGraphicsInFrontOfPlayer
|
||||||
npc_before_player_of_type: @ 80C97A8
|
CheckObjectGraphicsInFrontOfPlayer: @ 80C97A8
|
||||||
push {r4,r5,lr}
|
push {r4,r5,lr}
|
||||||
adds r5, r0, 0
|
adds r5, r0, 0
|
||||||
lsls r5, 24
|
lsls r5, 24
|
||||||
@@ -46,7 +46,7 @@ _080C97F6:
|
|||||||
pop {r4,r5}
|
pop {r4,r5}
|
||||||
pop {r1}
|
pop {r1}
|
||||||
bx r1
|
bx r1
|
||||||
thumb_func_end npc_before_player_of_type
|
thumb_func_end CheckObjectGraphicsInFrontOfPlayer
|
||||||
|
|
||||||
thumb_func_start oei_task_add
|
thumb_func_start oei_task_add
|
||||||
oei_task_add: @ 80C97FC
|
oei_task_add: @ 80C97FC
|
||||||
@@ -283,7 +283,7 @@ _080C99D4: .4byte gPlayerAvatar
|
|||||||
SetUpFieldMove_RockSmash: @ 80C99D8
|
SetUpFieldMove_RockSmash: @ 80C99D8
|
||||||
push {lr}
|
push {lr}
|
||||||
movs r0, 0x60
|
movs r0, 0x60
|
||||||
bl npc_before_player_of_type
|
bl CheckObjectGraphicsInFrontOfPlayer
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r0, 24
|
lsrs r0, 24
|
||||||
cmp r0, 0x1
|
cmp r0, 0x1
|
||||||
|
|||||||
@@ -3566,7 +3566,7 @@ SeafoamIslands_B1F_EventScript_1BE11D:: @ 81BE11D
|
|||||||
VictoryRoad_2F_EventScript_1BE11D:: @ 81BE11D
|
VictoryRoad_2F_EventScript_1BE11D:: @ 81BE11D
|
||||||
.incbin "baserom.gba", 0x1BE11D, 0x51
|
.incbin "baserom.gba", 0x1BE11D, 0x51
|
||||||
|
|
||||||
gUnknown_81BE16E:: @ 81BE16E
|
EventScript_FldEffStrength:: @ 81BE16E
|
||||||
.incbin "baserom.gba", 0x1BE16E, 0x149
|
.incbin "baserom.gba", 0x1BE16E, 0x149
|
||||||
|
|
||||||
gUnknown_81BE2B7:: @ 81BE2B7
|
gUnknown_81BE2B7:: @ 81BE2B7
|
||||||
|
|||||||
@@ -1144,4 +1144,6 @@ extern const u8 gUnknown_81BB084[];
|
|||||||
extern const u8 gUnknown_81BB0DF[];
|
extern const u8 gUnknown_81BB0DF[];
|
||||||
extern const u8 gUnknown_81BB156[];
|
extern const u8 gUnknown_81BB156[];
|
||||||
|
|
||||||
|
extern const u8 EventScript_FldEffStrength[];
|
||||||
|
|
||||||
#endif //GUARD_EVENT_SCRIPTS_H
|
#endif //GUARD_EVENT_SCRIPTS_H
|
||||||
|
|||||||
+20
-1
@@ -1,11 +1,30 @@
|
|||||||
#ifndef GUARD_FLDEFF_H
|
#ifndef GUARD_FLDEFF_H
|
||||||
#define GUARD_FLDEFF_H
|
#define GUARD_FLDEFF_H
|
||||||
|
|
||||||
// rock smash
|
bool8 CheckObjectGraphicsInFrontOfPlayer(u8 graphicsId);
|
||||||
u8 oei_task_add(void);
|
u8 oei_task_add(void);
|
||||||
|
|
||||||
|
// rock smash
|
||||||
|
|
||||||
|
// berrytree
|
||||||
|
void nullsub_56(void);
|
||||||
|
|
||||||
// poison
|
// poison
|
||||||
void FldEffPoison_Start(void);
|
void FldEffPoison_Start(void);
|
||||||
bool32 FldEffPoison_IsActive(void);
|
bool32 FldEffPoison_IsActive(void);
|
||||||
|
|
||||||
|
// strength
|
||||||
|
bool8 SetUpFieldMove_Strength(void);
|
||||||
|
bool8 sub_80D0860(void);
|
||||||
|
|
||||||
|
// teleport
|
||||||
|
bool8 SetUpFieldMove_Teleport(void);
|
||||||
|
bool8 FldEff_UseTeleport(void);
|
||||||
|
|
||||||
|
// softboiled
|
||||||
|
bool8 hm_prepare_dive_probably(void);
|
||||||
|
void sub_80E56DC(u8 taskId);
|
||||||
|
void sub_80E5724(u8 taskId);
|
||||||
|
|
||||||
|
|
||||||
#endif // GUARD_FLDEFF_H
|
#endif // GUARD_FLDEFF_H
|
||||||
|
|||||||
+1
-1
@@ -190,7 +190,7 @@ SECTIONS {
|
|||||||
asm/battle_records.o(.text);
|
asm/battle_records.o(.text);
|
||||||
asm/evolution_scene.o(.text);
|
asm/evolution_scene.o(.text);
|
||||||
src/coins.o(.text);
|
src/coins.o(.text);
|
||||||
asm/fldeff_strength.o(.text);
|
src/fldeff_strength.o(.text);
|
||||||
asm/battle_transition.o(.text);
|
asm/battle_transition.o(.text);
|
||||||
asm/battle_controller_link_partner.o(.text);
|
asm/battle_controller_link_partner.o(.text);
|
||||||
asm/battle_message.o(.text);
|
asm/battle_message.o(.text);
|
||||||
|
|||||||
+10
-9
@@ -4,11 +4,12 @@
|
|||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
#include "constants/songs.h"
|
#include "constants/songs.h"
|
||||||
|
#include "fldeff.h"
|
||||||
|
|
||||||
void sub_80E57E8(u8 taskId);
|
static void sub_80E57E8(u8 taskId);
|
||||||
void sub_80E583C(u8 taskId);
|
static void sub_80E583C(u8 taskId);
|
||||||
void sub_80E58A0(u8 taskId);
|
static void sub_80E58A0(u8 taskId);
|
||||||
void sub_80E5934(u8 taskId);
|
static void sub_80E5934(u8 taskId);
|
||||||
|
|
||||||
extern const u8 gUnknown_84169F8[];
|
extern const u8 gUnknown_84169F8[];
|
||||||
extern const u8 gUnknown_8416F27[];
|
extern const u8 gUnknown_8416F27[];
|
||||||
@@ -61,13 +62,13 @@ void sub_80E5724(u8 taskId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80E57E8(u8 taskId)
|
static void sub_80E57E8(u8 taskId)
|
||||||
{
|
{
|
||||||
PlaySE(SE_KAIFUKU);
|
PlaySE(SE_KAIFUKU);
|
||||||
sub_8120760(taskId, gUnknown_203B0A0.unkA, 1, GetMonData(&gPlayerParty[gUnknown_203B0A0.unk9], MON_DATA_MAX_HP) / 5, sub_80E583C);
|
sub_8120760(taskId, gUnknown_203B0A0.unkA, 1, GetMonData(&gPlayerParty[gUnknown_203B0A0.unk9], MON_DATA_MAX_HP) / 5, sub_80E583C);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80E583C(u8 taskId)
|
static void sub_80E583C(u8 taskId)
|
||||||
{
|
{
|
||||||
GetMonNickname(&gPlayerParty[gUnknown_203B0A0.unkA], gStringVar1);
|
GetMonNickname(&gPlayerParty[gUnknown_203B0A0.unkA], gStringVar1);
|
||||||
StringExpandPlaceholders(gStringVar4, gUnknown_8416F27);
|
StringExpandPlaceholders(gStringVar4, gUnknown_8416F27);
|
||||||
@@ -76,7 +77,7 @@ void sub_80E583C(u8 taskId)
|
|||||||
gTasks[taskId].func = sub_80E58A0;
|
gTasks[taskId].func = sub_80E58A0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80E58A0(u8 taskId)
|
static void sub_80E58A0(u8 taskId)
|
||||||
{
|
{
|
||||||
if (sub_8120370() != TRUE)
|
if (sub_8120370() != TRUE)
|
||||||
{
|
{
|
||||||
@@ -91,7 +92,7 @@ void sub_80E58A0(u8 taskId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80E5900(u8 taskId)
|
static void sub_80E5900(u8 taskId)
|
||||||
{
|
{
|
||||||
if (sub_8120370() != TRUE)
|
if (sub_8120370() != TRUE)
|
||||||
{
|
{
|
||||||
@@ -100,7 +101,7 @@ void sub_80E5900(u8 taskId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_80E5934(u8 taskId)
|
static void sub_80E5934(u8 taskId)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
sub_81202F8(gUnknown_84169F8, 0);
|
sub_81202F8(gUnknown_84169F8, 0);
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "field_player_avatar.h"
|
||||||
|
#include "field_effect.h"
|
||||||
|
#include "party_menu.h"
|
||||||
|
#include "event_data.h"
|
||||||
|
#include "script.h"
|
||||||
|
#include "fldeff.h"
|
||||||
|
#include "event_scripts.h"
|
||||||
|
|
||||||
|
static void FldEff_UseStrength(void);
|
||||||
|
static void sub_80D08A8(void);
|
||||||
|
|
||||||
|
bool8 SetUpFieldMove_Strength(void)
|
||||||
|
{
|
||||||
|
if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING) || CheckObjectGraphicsInFrontOfPlayer(0x61) != TRUE)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gSpecialVar_Result = GetCursorSelectionMonId();
|
||||||
|
gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu;
|
||||||
|
gPostMenuFieldCallback = FldEff_UseStrength;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void FldEff_UseStrength(void)
|
||||||
|
{
|
||||||
|
gFieldEffectArguments[0] = GetCursorSelectionMonId();
|
||||||
|
ScriptContext1_SetupScript(EventScript_FldEffStrength);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool8 sub_80D0860(void)
|
||||||
|
{
|
||||||
|
u8 taskId = oei_task_add();
|
||||||
|
gTasks[taskId].data[8] = (u32)sub_80D08A8 >> 16;
|
||||||
|
gTasks[taskId].data[9] = (u32)sub_80D08A8;
|
||||||
|
GetMonNickname(&gPlayerParty[gFieldEffectArguments[0]], gStringVar1);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sub_80D08A8(void)
|
||||||
|
{
|
||||||
|
FieldEffectActiveListRemove(FLDEFF_USE_STRENGTH);
|
||||||
|
EnableBothScriptContexts();
|
||||||
|
}
|
||||||
+1
-1
@@ -612,7 +612,7 @@ void sub_815A540(void)
|
|||||||
s16 x, y;
|
s16 x, y;
|
||||||
|
|
||||||
PlayerGetDestCoords(&x, &y);
|
PlayerGetDestCoords(&x, &y);
|
||||||
if (!MetatileBehavior_IsSurfable(MapGridGetMetatileBehaviorAt(x, y)) && TestPlayerAvatarFlags(0x08))
|
if (!MetatileBehavior_IsSurfable(MapGridGetMetatileBehaviorAt(x, y)) && TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))
|
||||||
{
|
{
|
||||||
struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
struct MapObject *mapObject = &gMapObjects[gPlayerAvatar.mapObjectId];
|
||||||
SetPlayerAvatarTransitionFlags(0x01);
|
SetPlayerAvatarTransitionFlags(0x01);
|
||||||
|
|||||||
Reference in New Issue
Block a user