mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-02 08:49:59 -05:00
sub_8041108
This commit is contained in:
parent
6602a686ba
commit
601a9db41e
|
|
@ -6,474 +6,6 @@
|
|||
.text
|
||||
|
||||
|
||||
thumb_func_start sub_8040DA0
|
||||
sub_8040DA0:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x1C
|
||||
adds r7, r0, 0
|
||||
mov r8, r1
|
||||
bl sub_804143C
|
||||
mov r9, r0
|
||||
movs r0, 0
|
||||
str r0, [sp, 0x14]
|
||||
ldr r1, [r7, 0x70]
|
||||
mov r10, r1
|
||||
movs r0, 0x4
|
||||
ldrsh r5, [r1, r0]
|
||||
mov r1, r8
|
||||
ldrh r4, [r1, 0x2]
|
||||
adds r0, r7, 0
|
||||
bl GetApparentWeather
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
mov r2, r9
|
||||
bl sub_80412E0
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r5, 0
|
||||
bl sub_800EA44
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
str r0, [sp, 0x18]
|
||||
mov r0, sp
|
||||
adds r1, r7, 0
|
||||
mov r2, r8
|
||||
mov r3, r9
|
||||
bl sub_8041038
|
||||
mov r0, sp
|
||||
movs r1, 0x1
|
||||
bl sub_800E838
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08040E0E
|
||||
mov r1, r8
|
||||
ldrh r0, [r1, 0x2]
|
||||
cmp r0, 0x52
|
||||
bne _08040E24
|
||||
_08040E0E:
|
||||
ldr r0, _08040E1C
|
||||
ldr r0, [r0]
|
||||
ldr r1, _08040E20
|
||||
adds r0, r1
|
||||
ldr r6, [r0]
|
||||
b _08040E26
|
||||
.align 2, 0
|
||||
_08040E1C: .4byte gDungeon
|
||||
_08040E20: .4byte 0x000181f8
|
||||
_08040E24:
|
||||
adds r6, r7, 0
|
||||
_08040E26:
|
||||
adds r0, r6, 0
|
||||
bl EntityIsValid
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08040E34
|
||||
adds r6, r7, 0
|
||||
_08040E34:
|
||||
mov r1, sp
|
||||
ldr r0, [r6, 0xC]
|
||||
cmp r0, 0
|
||||
bge _08040E3E
|
||||
adds r0, 0xFF
|
||||
_08040E3E:
|
||||
asrs r0, 8
|
||||
strh r0, [r1, 0x4]
|
||||
mov r1, sp
|
||||
ldr r0, [r6, 0x10]
|
||||
cmp r0, 0
|
||||
bge _08040E4C
|
||||
adds r0, 0xFF
|
||||
_08040E4C:
|
||||
asrs r0, 8
|
||||
strh r0, [r1, 0x6]
|
||||
adds r0, r6, 0
|
||||
bl sub_8042768
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
bne _08040E5E
|
||||
b _08041026
|
||||
_08040E5E:
|
||||
adds r0, r7, 0
|
||||
mov r1, r8
|
||||
bl sub_80414C0
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08040E6E
|
||||
b _08041026
|
||||
_08040E6E:
|
||||
mov r0, r8
|
||||
ldrh r1, [r0, 0x2]
|
||||
movs r0, 0x94
|
||||
lsls r0, 1
|
||||
cmp r1, r0
|
||||
bne _08040ED0
|
||||
movs r0, 0x7
|
||||
bl DungeonRandInt
|
||||
ldr r1, _08040EB8
|
||||
str r0, [r1]
|
||||
ldr r1, _08040EBC
|
||||
ldr r2, [r1]
|
||||
ldr r1, _08040EC0
|
||||
adds r4, r2, r1
|
||||
subs r1, 0x4
|
||||
adds r2, r1
|
||||
ldr r3, _08040EC4
|
||||
lsls r1, r0, 2
|
||||
adds r1, r3
|
||||
ldr r1, [r1]
|
||||
str r1, [r2]
|
||||
str r1, [r4]
|
||||
ldr r1, _08040EC8
|
||||
adds r0, 0x4
|
||||
str r0, [r1]
|
||||
ldr r0, _08040ECC
|
||||
ldr r1, [r0]
|
||||
adds r0, r6, 0
|
||||
bl LogMessageByIdWithPopupCheckUser
|
||||
movs r1, 0xD2
|
||||
lsls r1, 1
|
||||
adds r0, r6, 0
|
||||
bl sub_80421C0
|
||||
b _08040EF0
|
||||
.align 2, 0
|
||||
_08040EB8: .4byte gUnknown_202F224
|
||||
_08040EBC: .4byte gDungeon
|
||||
_08040EC0: .4byte 0x00018204
|
||||
_08040EC4: .4byte gUnknown_8106A8C
|
||||
_08040EC8: .4byte gFormatArgs
|
||||
_08040ECC: .4byte gPtrMagnitudeMessage
|
||||
_08040ED0:
|
||||
cmp r1, 0x76
|
||||
bne _08040EF0
|
||||
ldr r0, _08040F70
|
||||
ldr r0, [r0]
|
||||
ldr r1, _08040F74
|
||||
adds r2, r0, r1
|
||||
subs r1, 0x4
|
||||
adds r0, r1
|
||||
movs r1, 0xC
|
||||
str r1, [r0]
|
||||
str r1, [r2]
|
||||
movs r1, 0xD2
|
||||
lsls r1, 1
|
||||
adds r0, r6, 0
|
||||
bl sub_80421C0
|
||||
_08040EF0:
|
||||
mov r0, r10
|
||||
movs r1, 0x4
|
||||
ldrsh r5, [r0, r1]
|
||||
mov r0, r8
|
||||
ldrh r4, [r0, 0x2]
|
||||
adds r0, r7, 0
|
||||
bl GetApparentWeather
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
mov r2, r9
|
||||
bl sub_80412E0
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r5, 0
|
||||
bl sub_800E790
|
||||
adds r1, r0, 0
|
||||
ldr r0, _08040F78
|
||||
cmp r1, r0
|
||||
beq _08040F2A
|
||||
lsls r0, r1, 16
|
||||
lsrs r0, 16
|
||||
bl PlaySoundEffect
|
||||
_08040F2A:
|
||||
ldr r1, [sp, 0x18]
|
||||
cmp r1, 0x63
|
||||
bne _08040F7C
|
||||
adds r0, r6, 0
|
||||
bl sub_8042768
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08041026
|
||||
mov r0, r10
|
||||
adds r0, 0x46
|
||||
ldrb r4, [r0]
|
||||
mov r0, sp
|
||||
adds r1, r7, 0
|
||||
mov r2, r8
|
||||
mov r3, r9
|
||||
bl sub_8041108
|
||||
movs r6, 0x7
|
||||
movs r5, 0x7
|
||||
_08040F52:
|
||||
subs r4, 0x1
|
||||
ands r4, r6
|
||||
adds r0, r7, 0
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
bl sub_806CDD4
|
||||
movs r0, 0x2
|
||||
movs r1, 0x15
|
||||
bl sub_803E708
|
||||
subs r5, 0x1
|
||||
cmp r5, 0
|
||||
bge _08040F52
|
||||
b _08041026
|
||||
.align 2, 0
|
||||
_08040F70: .4byte gDungeon
|
||||
_08040F74: .4byte 0x00018204
|
||||
_08040F78: .4byte 0x000003e5
|
||||
_08040F7C:
|
||||
ldr r0, [sp, 0x18]
|
||||
cmp r0, 0x62
|
||||
bne _08040FC2
|
||||
adds r0, r6, 0
|
||||
bl sub_8042768
|
||||
lsls r0, 24
|
||||
cmp r0, 0
|
||||
beq _08041026
|
||||
mov r0, r10
|
||||
adds r0, 0x46
|
||||
ldrb r4, [r0]
|
||||
mov r0, sp
|
||||
adds r1, r7, 0
|
||||
mov r2, r8
|
||||
mov r3, r9
|
||||
bl sub_8041108
|
||||
movs r6, 0x7
|
||||
movs r5, 0x8
|
||||
_08040FA4:
|
||||
ands r4, r6
|
||||
adds r0, r7, 0
|
||||
movs r1, 0
|
||||
adds r2, r4, 0
|
||||
bl sub_806CDD4
|
||||
movs r0, 0x2
|
||||
movs r1, 0x15
|
||||
bl sub_803E708
|
||||
adds r4, 0x1
|
||||
subs r5, 0x1
|
||||
cmp r5, 0
|
||||
bge _08040FA4
|
||||
b _08041026
|
||||
_08040FC2:
|
||||
mov r0, r10
|
||||
adds r0, 0x46
|
||||
ldrb r2, [r0]
|
||||
adds r0, r7, 0
|
||||
ldr r1, [sp, 0x18]
|
||||
bl sub_806CDD4
|
||||
adds r0, r7, 0
|
||||
adds r0, 0x21
|
||||
movs r1, 0
|
||||
strb r1, [r0]
|
||||
movs r5, 0
|
||||
adds r6, r0, 0
|
||||
b _08040FE6
|
||||
_08040FDE:
|
||||
ldrb r0, [r6]
|
||||
cmp r0, 0
|
||||
bne _08041022
|
||||
adds r5, 0x1
|
||||
_08040FE6:
|
||||
cmp r5, 0x77
|
||||
bgt _08041022
|
||||
movs r0, 0x59
|
||||
bl sub_803E46C
|
||||
ldr r4, [r7, 0x40]
|
||||
ldr r1, [sp, 0x18]
|
||||
cmp r1, 0x9
|
||||
bne _08040FFC
|
||||
movs r0, 0x2
|
||||
orrs r4, r0
|
||||
_08040FFC:
|
||||
movs r0, 0x2
|
||||
ands r0, r4
|
||||
cmp r0, 0
|
||||
beq _0804101A
|
||||
ldr r0, [sp, 0x14]
|
||||
cmp r0, 0
|
||||
bne _0804101A
|
||||
mov r0, sp
|
||||
adds r1, r7, 0
|
||||
mov r2, r8
|
||||
mov r3, r9
|
||||
bl sub_8041108
|
||||
movs r1, 0x1
|
||||
str r1, [sp, 0x14]
|
||||
_0804101A:
|
||||
movs r0, 0x1
|
||||
ands r4, r0
|
||||
cmp r4, 0
|
||||
beq _08040FDE
|
||||
_08041022:
|
||||
movs r0, 0
|
||||
strb r0, [r6]
|
||||
_08041026:
|
||||
add sp, 0x1C
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8040DA0
|
||||
|
||||
thumb_func_start sub_8041038
|
||||
sub_8041038:
|
||||
push {r4-r7,lr}
|
||||
mov r7, r10
|
||||
mov r6, r9
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
sub sp, 0x4
|
||||
adds r6, r0, 0
|
||||
adds r7, r1, 0
|
||||
mov r8, r2
|
||||
mov r10, r3
|
||||
ldr r0, [r7, 0x70]
|
||||
mov r9, r0
|
||||
ldrh r4, [r2, 0x2]
|
||||
adds r0, r7, 0
|
||||
bl GetApparentWeather
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
mov r2, r10
|
||||
bl sub_80412E0
|
||||
lsls r0, 16
|
||||
lsrs r0, 16
|
||||
str r0, [sp]
|
||||
bl sub_800ECB8
|
||||
movs r1, 0x2
|
||||
ldrsh r0, [r0, r1]
|
||||
cmp r0, 0
|
||||
beq _080410F4
|
||||
mov r0, r9
|
||||
movs r1, 0x4
|
||||
ldrsh r5, [r0, r1]
|
||||
mov r0, r8
|
||||
ldrh r4, [r0, 0x2]
|
||||
adds r0, r7, 0
|
||||
bl GetApparentWeather
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
mov r2, r10
|
||||
bl sub_80412E0
|
||||
adds r1, r0, 0
|
||||
lsls r1, 16
|
||||
lsrs r1, 16
|
||||
adds r0, r5, 0
|
||||
bl sub_800E710
|
||||
adds r2, r0, 0
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
cmp r2, r0
|
||||
beq _080410BE
|
||||
adds r0, r6, 0
|
||||
adds r0, 0x8
|
||||
adds r1, r7, 0
|
||||
adds r1, 0x28
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
bl sub_800569C
|
||||
b _080410C2
|
||||
_080410BE:
|
||||
movs r0, 0
|
||||
str r0, [r6, 0x8]
|
||||
_080410C2:
|
||||
mov r1, sp
|
||||
ldrh r1, [r1]
|
||||
strh r1, [r6]
|
||||
mov r1, r9
|
||||
ldrh r0, [r1, 0x4]
|
||||
strh r0, [r6, 0x2]
|
||||
ldr r0, [r7, 0xC]
|
||||
cmp r0, 0
|
||||
bge _080410D6
|
||||
adds r0, 0xFF
|
||||
_080410D6:
|
||||
asrs r0, 8
|
||||
strh r0, [r6, 0x4]
|
||||
ldr r0, [r7, 0x10]
|
||||
cmp r0, 0
|
||||
bge _080410E2
|
||||
adds r0, 0xFF
|
||||
_080410E2:
|
||||
asrs r0, 8
|
||||
strh r0, [r6, 0x6]
|
||||
mov r0, r9
|
||||
adds r0, 0x46
|
||||
ldrb r0, [r0]
|
||||
str r0, [r6, 0xC]
|
||||
movs r0, 0
|
||||
str r0, [r6, 0x10]
|
||||
b _080410F6
|
||||
_080410F4:
|
||||
strh r0, [r6]
|
||||
_080410F6:
|
||||
add sp, 0x4
|
||||
pop {r3-r5}
|
||||
mov r8, r3
|
||||
mov r9, r4
|
||||
mov r10, r5
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8041038
|
||||
|
||||
thumb_func_start sub_8041108
|
||||
sub_8041108:
|
||||
push {r4-r7,lr}
|
||||
adds r6, r0, 0
|
||||
adds r7, r1, 0
|
||||
adds r5, r3, 0
|
||||
ldrh r4, [r2, 0x2]
|
||||
adds r0, r7, 0
|
||||
bl GetApparentWeather
|
||||
adds r1, r0, 0
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
adds r2, r5, 0
|
||||
bl sub_80412E0
|
||||
lsls r0, 16
|
||||
lsrs r4, r0, 16
|
||||
adds r0, r4, 0
|
||||
bl sub_800ECB8
|
||||
movs r2, 0x2
|
||||
ldrsh r1, [r0, r2]
|
||||
ldrh r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _08041162
|
||||
cmp r1, 0
|
||||
beq _08041162
|
||||
adds r0, r6, 0
|
||||
bl sub_8041500
|
||||
adds r0, r4, 0
|
||||
bl sub_800EEF8
|
||||
bl sub_800EF64
|
||||
movs r0, 0x5A
|
||||
bl sub_803E46C
|
||||
adds r0, r6, 0
|
||||
bl sub_800E52C
|
||||
adds r1, r7, 0
|
||||
movs r2, 0x1
|
||||
bl sub_8042DD4
|
||||
_08041162:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_8041108
|
||||
|
||||
thumb_func_start sub_8041168
|
||||
sub_8041168:
|
||||
|
|
|
|||
|
|
@ -1,27 +1,26 @@
|
|||
#include "global.h"
|
||||
#include "code_800558C.h"
|
||||
#include "code_800C9CC.h"
|
||||
#include "code_80118A4.h"
|
||||
#include "dungeon_message.h"
|
||||
#include "dungeon_random.h"
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_music.h"
|
||||
#include "file_system.h"
|
||||
#include "play_time.h"
|
||||
#include "cpu.h"
|
||||
#include "dungeon.h"
|
||||
#include "game_options.h"
|
||||
#include "bg_palette_buffer.h"
|
||||
#include "code_8009804.h"
|
||||
#include "code_800E9E4.h"
|
||||
#include "dungeon_generation.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "trap.h"
|
||||
#include "text.h"
|
||||
#include "code_804267C.h"
|
||||
#include "weather.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "constants/move_id.h"
|
||||
|
||||
struct UnkStruct_8040094
|
||||
{
|
||||
u16 unk0;
|
||||
u16 unk2;
|
||||
DungeonPos unk4;
|
||||
DungeonPos unk8;
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
};
|
||||
|
||||
extern u8 sub_800EC94(s32 param_1);
|
||||
extern s32 sub_800E710(s32 a0, u16 a1);
|
||||
|
|
@ -30,12 +29,34 @@ extern void sub_800EEC8(u16 r0);
|
|||
extern void sub_800EF64(void);
|
||||
extern void sub_8042DD4(s32 a0, Entity *a1, s32 a2);
|
||||
extern void sub_803E46C(u32);
|
||||
extern u8 sub_800EA44(s32 species, u16 a2);
|
||||
extern s32 sub_800E790(s32 species, u16 a2);
|
||||
extern void sub_806CDD4(Entity *entity, u8, u32 direction);
|
||||
void sub_8041500(struct UnkStruct_8040094 *a0);
|
||||
extern s32 sub_800E52C(struct UnkStruct_8040094 *a0);
|
||||
extern s32 sub_800EA84(struct UnkStruct_8040094 *a0);
|
||||
extern bool8 sub_800E838(struct UnkStruct_8040094 *a0, s32 a1);
|
||||
extern bool8 sub_800E9A8(s32 a0);
|
||||
extern void sub_803EA10(void);
|
||||
extern void sub_803E708(s32, u32);
|
||||
extern void sub_800EEF8(u16 a0);
|
||||
|
||||
extern u8 gUnknown_203B40D;
|
||||
extern s16 gUnknown_2026E4E;
|
||||
extern s32 gDungeonBrightness;
|
||||
extern s32 gUnknown_202F224;
|
||||
|
||||
extern const u8 *const gPtrMagnitudeMessage;
|
||||
extern const s32 gUnknown_8106A8C[];
|
||||
|
||||
u16 sub_80412E0(u16 moveId, u8 weather, bool32 a2);
|
||||
bool32 sub_804143C(Entity *entity, Move *move);
|
||||
bool8 sub_80414C0(Entity *entity, Move *move);
|
||||
bool8 sub_804141C(u16 moveIdy, u8 weather, bool32 a2);
|
||||
bool8 sub_804141C(u16 moveId, u8 weather, bool32 a2);
|
||||
void sub_8040C4C(Entity *entity, Move *move, bool32 a2);
|
||||
void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2);
|
||||
void sub_8041108(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2);
|
||||
void sub_80421C0(Entity *pokemon, u16);
|
||||
|
||||
bool8 sub_8040BB0(Entity *entity, Move *move, bool8 a2)
|
||||
{
|
||||
|
|
@ -56,30 +77,11 @@ bool8 sub_8040BB0(Entity *entity, Move *move, bool8 a2)
|
|||
return r9;
|
||||
}
|
||||
|
||||
struct UnkStruct_202EDE8
|
||||
{
|
||||
u16 unk0;
|
||||
u16 unk2;
|
||||
DungeonPos unk4;
|
||||
DungeonPos unk8;
|
||||
s32 unkC;
|
||||
s32 unk10;
|
||||
};
|
||||
|
||||
void sub_8041500(struct UnkStruct_202EDE8 *a0);
|
||||
extern s32 sub_800EA84(struct UnkStruct_202EDE8 *a0);
|
||||
extern bool8 sub_800E9A8(s32 a0);
|
||||
extern void sub_803EA10(void);
|
||||
|
||||
extern u8 gUnknown_203B40D;
|
||||
extern s16 gUnknown_2026E4E;
|
||||
extern s32 gDungeonBrightness;
|
||||
|
||||
void sub_8040C4C(Entity *entity, Move *move, bool32 a2)
|
||||
{
|
||||
u8 savedUnkVar;
|
||||
s32 r4;
|
||||
struct UnkStruct_202EDE8 sp;
|
||||
struct UnkStruct_8040094 sp;
|
||||
u16 r9 = sub_80412E0(move->id, GetApparentWeather(entity), a2);
|
||||
EntityInfo *entInfo = GetEntInfo(entity);
|
||||
bool8 r8 = sub_800EC94(move->id);
|
||||
|
|
@ -130,4 +132,145 @@ void sub_8040C4C(Entity *entity, Move *move, bool32 a2)
|
|||
gUnknown_203B40D = savedUnkVar;
|
||||
}
|
||||
|
||||
void sub_8040DA0(Entity *entity, Move *move)
|
||||
{
|
||||
s32 i;
|
||||
s32 soundEffectId;
|
||||
Entity *anotherEntity;
|
||||
struct UnkStruct_8040094 sp;
|
||||
bool32 r9 = sub_804143C(entity, move);
|
||||
bool8 var_28 = FALSE;
|
||||
EntityInfo *entInfo = GetEntInfo(entity);
|
||||
u8 var_24 = sub_800EA44(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), r9));
|
||||
|
||||
sub_8041038(&sp, entity, move, r9);
|
||||
if (sub_800E838(&sp, 1)) {
|
||||
anotherEntity = gDungeon->unk181e8.cameraTarget;
|
||||
}
|
||||
else if (move->id == MOVE_SILVER_WIND) {
|
||||
anotherEntity = gDungeon->unk181e8.cameraTarget;
|
||||
}
|
||||
else {
|
||||
anotherEntity = entity;
|
||||
}
|
||||
|
||||
if (!EntityIsValid(anotherEntity)) {
|
||||
anotherEntity = entity;
|
||||
}
|
||||
|
||||
sp.unk4.x = anotherEntity->pixelPos.x / 256;
|
||||
sp.unk4.y = anotherEntity->pixelPos.y / 256;
|
||||
|
||||
if (!sub_8042768(anotherEntity))
|
||||
return;
|
||||
if (sub_80414C0(entity, move))
|
||||
return;
|
||||
|
||||
if (move->id == MOVE_MAGNITUDE) {
|
||||
gUnknown_202F224 = DungeonRandInt(7);
|
||||
gDungeon->unk181e8.unk18204 = gDungeon->unk181e8.unk18200 = gUnknown_8106A8C[gUnknown_202F224];
|
||||
gFormatArgs[0] = gUnknown_202F224 + 4;
|
||||
LogMessageByIdWithPopupCheckUser(anotherEntity, gPtrMagnitudeMessage);
|
||||
sub_80421C0(anotherEntity, 0x1A4);
|
||||
}
|
||||
else if (move->id == MOVE_EARTHQUAKE) {
|
||||
gDungeon->unk181e8.unk18204 = gDungeon->unk181e8.unk18200 = 12;
|
||||
sub_80421C0(anotherEntity, 0x1A4);
|
||||
}
|
||||
|
||||
soundEffectId = sub_800E790(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), r9));
|
||||
if (soundEffectId != 0x3E5) {
|
||||
PlaySoundEffect((u16) soundEffectId);
|
||||
}
|
||||
|
||||
if (var_24 == 99) {
|
||||
if (sub_8042768(anotherEntity)) {
|
||||
s32 direction = entInfo->action.direction;
|
||||
sub_8041108(&sp, entity, move, r9);
|
||||
for (i = 0; i < NUM_DIRECTIONS; i++) {
|
||||
direction--;
|
||||
direction &= DIRECTION_MASK;
|
||||
sub_806CDD4(entity, 0, direction);
|
||||
sub_803E708(2, 0x15);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (var_24 == 98) {
|
||||
if (sub_8042768(anotherEntity)) {
|
||||
s32 direction = entInfo->action.direction;
|
||||
sub_8041108(&sp, entity, move, r9);
|
||||
for (i = 0; i < NUM_DIRECTIONS + 1; i++) {
|
||||
direction &= DIRECTION_MASK;
|
||||
sub_806CDD4(entity, 0, direction);
|
||||
sub_803E708(2, 0x15);
|
||||
direction++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
sub_806CDD4(entity, var_24, entInfo->action.direction);
|
||||
entity->unk21 = 0;
|
||||
for (i = 0; i < 120; i++) {
|
||||
u32 unk;
|
||||
|
||||
sub_803E46C(0x59);
|
||||
unk = entity->axObj.axdata.sub1.unk10;
|
||||
if (var_24 == 9) {
|
||||
unk |= 2;
|
||||
}
|
||||
|
||||
if ((unk & 2) && !var_28) {
|
||||
sub_8041108(&sp, entity, move, r9);
|
||||
var_28 = TRUE;
|
||||
}
|
||||
if (unk & 1)
|
||||
break;
|
||||
if (entity->unk21 != 0)
|
||||
break;
|
||||
}
|
||||
entity->unk21 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8041038(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2)
|
||||
{
|
||||
EntityInfo *entInfo = GetEntInfo(entity);
|
||||
u16 var_24 = sub_80412E0(move->id, GetApparentWeather(entity), a2);
|
||||
|
||||
if (sub_800ECB8(var_24)->unk2 != 0) {
|
||||
s32 r2 = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), a2));
|
||||
|
||||
if (r2 != -1) {
|
||||
sub_800569C(&a0->unk8, &entity->axObj.axdata, r2);
|
||||
}
|
||||
else {
|
||||
a0->unk8 = (DungeonPos) {0};
|
||||
}
|
||||
|
||||
a0->unk0 = var_24;
|
||||
a0->unk2 = entInfo->apparentID;
|
||||
a0->unk4.x = entity->pixelPos.x / 256;
|
||||
a0->unk4.y = entity->pixelPos.y / 256;
|
||||
a0->unkC = entInfo->action.direction;
|
||||
a0->unk10 = 0;
|
||||
}
|
||||
else {
|
||||
a0->unk0 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8041108(struct UnkStruct_8040094 *a0, Entity *entity, Move *move, bool32 a2)
|
||||
{
|
||||
u16 r4 = sub_80412E0(move->id, GetApparentWeather(entity), a2);
|
||||
s32 var = sub_800ECB8(r4)->unk2;
|
||||
|
||||
if (a0->unk0 != 0 && var != 0) {
|
||||
sub_8041500(a0);
|
||||
sub_800EEF8(r4);
|
||||
sub_800EF64();
|
||||
sub_803E46C(0x5A);
|
||||
sub_8042DD4(sub_800E52C(a0), entity, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user