mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
Merge branch 'main' into main
This commit is contained in:
commit
f078017a2b
|
|
@ -4,3 +4,4 @@
|
|||
.public IsItemValid
|
||||
.public ITEM_DATA_TABLE_PTRS
|
||||
.public ItemZInit
|
||||
.public SetActiveInventory
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
#pragma once
|
||||
.public GravityIsActive
|
||||
.public IsTypeAffectedByGravity
|
||||
|
|
|
|||
|
|
@ -68,107 +68,3 @@ _0200EBB8:
|
|||
_0200EBC8: .word BABY_EXCLUSIVE_ITEM_PAIRS
|
||||
arm_func_end ReturnEggExclusiveItem
|
||||
|
||||
arm_func_start SetActiveInventoryToMain
|
||||
SetActiveInventoryToMain: ; 0x0200EBCC
|
||||
ldr ip, _0200EBD8 ; =SetActiveInventory
|
||||
mov r0, #0
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_0200EBD8: .word SetActiveInventory
|
||||
arm_func_end SetActiveInventoryToMain
|
||||
|
||||
arm_func_start AllInventoriesZInit
|
||||
AllInventoriesZInit: ; 0x0200EBDC
|
||||
stmdb sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, lr}
|
||||
mov sl, #0
|
||||
ldr r6, _0200EC44 ; =BAG_ITEMS_PTR_MIRROR
|
||||
mov r7, sl
|
||||
mov fp, sl
|
||||
mov r4, #6
|
||||
mov r5, #0x12c
|
||||
_0200EBF8:
|
||||
mul sb, sl, r5
|
||||
mov r8, fp
|
||||
_0200EC00:
|
||||
ldr r0, [r6]
|
||||
add r0, r0, sb
|
||||
mla r0, r8, r4, r0
|
||||
bl ItemZInit
|
||||
add r8, r8, #1
|
||||
cmp r8, #0x32
|
||||
blt _0200EC00
|
||||
ldr r0, [r6]
|
||||
add r0, r0, sl, lsl #2
|
||||
add r0, r0, #0x1000
|
||||
add sl, sl, #1
|
||||
str r7, [r0, #0x394]
|
||||
cmp sl, #3
|
||||
blt _0200EBF8
|
||||
mov r0, r7
|
||||
bl SetActiveInventory
|
||||
ldmia sp!, {r3, r4, r5, r6, r7, r8, sb, sl, fp, pc}
|
||||
.align 2, 0
|
||||
_0200EC44: .word BAG_ITEMS_PTR_MIRROR
|
||||
arm_func_end AllInventoriesZInit
|
||||
|
||||
arm_func_start SpecialEpisodeInventoryZInit
|
||||
SpecialEpisodeInventoryZInit: ; 0x0200EC48
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
ldr r5, _0200EC8C ; =BAG_ITEMS_PTR_MIRROR
|
||||
mov r6, #0
|
||||
mov r4, #6
|
||||
_0200EC58:
|
||||
ldr r0, [r5]
|
||||
add r0, r0, #0x12c
|
||||
mla r0, r6, r4, r0
|
||||
bl ItemZInit
|
||||
add r6, r6, #1
|
||||
cmp r6, #0x32
|
||||
blt _0200EC58
|
||||
ldr r0, _0200EC8C ; =BAG_ITEMS_PTR_MIRROR
|
||||
mov r1, #0
|
||||
ldr r0, [r0]
|
||||
add r0, r0, #0x1000
|
||||
str r1, [r0, #0x398]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_0200EC8C: .word BAG_ITEMS_PTR_MIRROR
|
||||
arm_func_end SpecialEpisodeInventoryZInit
|
||||
|
||||
arm_func_start RescueInventoryZInit
|
||||
RescueInventoryZInit: ; 0x0200EC90
|
||||
stmdb sp!, {r4, r5, r6, lr}
|
||||
ldr r5, _0200ECD4 ; =BAG_ITEMS_PTR_MIRROR
|
||||
mov r6, #0
|
||||
mov r4, #6
|
||||
_0200ECA0:
|
||||
ldr r0, [r5]
|
||||
add r0, r0, #0x258
|
||||
mla r0, r6, r4, r0
|
||||
bl ItemZInit
|
||||
add r6, r6, #1
|
||||
cmp r6, #0x32
|
||||
blt _0200ECA0
|
||||
ldr r0, _0200ECD4 ; =BAG_ITEMS_PTR_MIRROR
|
||||
mov r1, #0
|
||||
ldr r0, [r0]
|
||||
add r0, r0, #0x1000
|
||||
str r1, [r0, #0x39c]
|
||||
ldmia sp!, {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_0200ECD4: .word BAG_ITEMS_PTR_MIRROR
|
||||
arm_func_end RescueInventoryZInit
|
||||
|
||||
arm_func_start SetActiveInventory
|
||||
SetActiveInventory: ; 0x0200ECD8
|
||||
ldr r2, _0200ECF8 ; =BAG_ITEMS_PTR_MIRROR
|
||||
mov r1, #0x12c
|
||||
ldr r3, [r2]
|
||||
strb r0, [r3, #0x388]
|
||||
ldr r2, [r2]
|
||||
mla r1, r0, r1, r2
|
||||
str r1, [r2, #0x384]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0200ECF8: .word BAG_ITEMS_PTR_MIRROR
|
||||
arm_func_end SetActiveInventory
|
||||
|
|
|
|||
|
|
@ -1,41 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "main_0200ED1C.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start SetMoneyCarried
|
||||
SetMoneyCarried: ; 0x0200ED1C
|
||||
ldr r1, _0200ED50 ; =0x0001869F
|
||||
cmp r0, r1
|
||||
movgt r0, r1
|
||||
bgt _0200ED34
|
||||
cmp r0, #0
|
||||
movlt r0, #0
|
||||
_0200ED34:
|
||||
ldr r1, _0200ED54 ; =BAG_ITEMS_PTR_MIRROR
|
||||
ldr r2, [r1]
|
||||
ldrb r1, [r2, #0x388]
|
||||
add r1, r2, r1, lsl #2
|
||||
add r1, r1, #0x1000
|
||||
str r0, [r1, #0x394]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0200ED50: .word 0x0001869F
|
||||
_0200ED54: .word BAG_ITEMS_PTR_MIRROR
|
||||
arm_func_end SetMoneyCarried
|
||||
|
||||
arm_func_start AddMoneyCarried
|
||||
AddMoneyCarried: ; 0x0200ED58
|
||||
ldr r1, _0200ED7C ; =BAG_ITEMS_PTR_MIRROR
|
||||
ldr ip, _0200ED80 ; =SetMoneyCarried
|
||||
ldr r2, [r1]
|
||||
ldrb r1, [r2, #0x388]
|
||||
add r1, r2, r1, lsl #2
|
||||
add r1, r1, #0x1000
|
||||
ldr r1, [r1, #0x394]
|
||||
add r0, r0, r1
|
||||
bx ip
|
||||
.align 2, 0
|
||||
_0200ED7C: .word BAG_ITEMS_PTR_MIRROR
|
||||
_0200ED80: .word SetMoneyCarried
|
||||
arm_func_end AddMoneyCarried
|
||||
|
|
@ -3,50 +3,6 @@
|
|||
|
||||
.text
|
||||
|
||||
arm_func_start GetSpawnThreshold
|
||||
GetSpawnThreshold: ; 0x02052B44
|
||||
ldr r2, _02052B5C ; =MONSTER_DATA_TABLE_PTR
|
||||
mov r1, #0x44
|
||||
ldr r2, [r2]
|
||||
smlabb r0, r0, r1, r2
|
||||
ldrb r0, [r0, #0x31]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02052B5C: .word MONSTER_DATA_TABLE_PTR
|
||||
arm_func_end GetSpawnThreshold
|
||||
|
||||
arm_func_start NeedsItemToSpawn
|
||||
NeedsItemToSpawn: ; 0x02052B60
|
||||
ldr r2, _02052B88 ; =MONSTER_DATA_TABLE_PTR
|
||||
mov r1, #0x44
|
||||
ldr r2, [r2]
|
||||
smlabb r0, r0, r1, r2
|
||||
ldrb r0, [r0, #0x1a]
|
||||
tst r0, #0x80
|
||||
movne r0, #1
|
||||
moveq r0, #0
|
||||
and r0, r0, #0xff
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02052B88: .word MONSTER_DATA_TABLE_PTR
|
||||
arm_func_end NeedsItemToSpawn
|
||||
|
||||
arm_func_start GetExclusiveItem
|
||||
GetExclusiveItem: ; 0x02052B8C
|
||||
ldr r2, _02052BB4 ; =MONSTER_DATA_TABLE_PTR
|
||||
mov r3, r1, lsr #0x1f
|
||||
ldr ip, [r2]
|
||||
mov r2, #0x44
|
||||
rsb r1, r3, r1, lsl #30
|
||||
smlabb r2, r0, r2, ip
|
||||
add r0, r3, r1, ror #30
|
||||
add r0, r2, r0, lsl #1
|
||||
ldrsh r0, [r0, #0x34]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_02052BB4: .word MONSTER_DATA_TABLE_PTR
|
||||
arm_func_end GetExclusiveItem
|
||||
|
||||
arm_func_start GetFamilyIndex
|
||||
GetFamilyIndex: ; 0x02052BB8
|
||||
ldr r2, _02052BD0 ; =MONSTER_DATA_TABLE_PTR
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_02301E88.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start IsTypeAffectedByGravity
|
||||
IsTypeAffectedByGravity: ; 0x02301E88
|
||||
stmdb sp!, {r3, lr}
|
||||
cmp r1, #0xa
|
||||
bne _02301EA4
|
||||
bl GravityIsActive
|
||||
cmp r0, #0
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, pc}
|
||||
_02301EA4:
|
||||
mov r0, #1
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end IsTypeAffectedByGravity
|
||||
|
||||
arm_func_start HasTypeAffectedByGravity
|
||||
HasTypeAffectedByGravity: ; 0x02301EAC
|
||||
stmdb sp!, {r3, lr}
|
||||
ldr r3, [r0, #0xb4]
|
||||
cmp r1, #0
|
||||
moveq r0, #0
|
||||
ldmeqia sp!, {r3, pc}
|
||||
ldrb r2, [r3, #0x5e]
|
||||
cmp r2, r1
|
||||
bne _02301ED4
|
||||
bl IsTypeAffectedByGravity
|
||||
ldmia sp!, {r3, pc}
|
||||
_02301ED4:
|
||||
ldrb r2, [r3, #0x5f]
|
||||
cmp r2, r1
|
||||
movne r0, #0
|
||||
ldmneia sp!, {r3, pc}
|
||||
bl IsTypeAffectedByGravity
|
||||
ldmia sp!, {r3, pc}
|
||||
arm_func_end HasTypeAffectedByGravity
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "overlay_29_02318A90.inc"
|
||||
|
||||
.text
|
||||
|
||||
arm_func_start ov29_02318A90
|
||||
ov29_02318A90: ; 0x02318A90
|
||||
stmdb sp!, {r3, r4, r5, lr}
|
||||
mov r5, r0
|
||||
mov r4, r1
|
||||
bl IsMonster__02318AB0
|
||||
cmp r0, #0
|
||||
ldrne r0, [r5, #0xb4]
|
||||
#ifdef JAPAN
|
||||
strneb r4, [r0, #0x10a]
|
||||
#else
|
||||
strneb r4, [r0, #0x10b]
|
||||
#endif
|
||||
ldmia sp!, {r3, r4, r5, pc}
|
||||
arm_func_end ov29_02318A90
|
||||
|
|
@ -8,4 +8,10 @@ bool8 LevitateIsActive(struct entity* entity);
|
|||
// Checks if a monster is a given type.
|
||||
bool8 MonsterIsType(struct entity *entity, enum type_id type_id);
|
||||
|
||||
// Checks if the type affected by Gravity
|
||||
bool8 IsTypeAffectedByGravity(struct entity *entity, enum type_id type);
|
||||
|
||||
// Checks if the monster has a type affected by Gravity
|
||||
bool8 HasTypeAffectedByGravity(struct entity* entity, enum type_id type);
|
||||
|
||||
#endif //PMDSKY_DUNGEON_LOGIC_3_H
|
||||
|
|
|
|||
|
|
@ -1596,7 +1596,7 @@ enum exclusive_item_effect_id {
|
|||
|
||||
#define GROUND_ITEM_TOOLBOX_INDEX 0x80
|
||||
#define HELD_ITEM_TOOLBOX_INDEX 0x81
|
||||
#define INVENTORY_SIZE 52
|
||||
#define INVENTORY_SIZE 50
|
||||
#define NUMBER_OF_ITEM_IDS (ITEM_UNNAMED_0x577 + 1)
|
||||
|
||||
// Item info
|
||||
|
|
@ -1634,12 +1634,25 @@ struct item_volatile {
|
|||
};
|
||||
|
||||
struct bag_items_inner {
|
||||
/* 0x0 */ struct item bag_items[INVENTORY_SIZE];
|
||||
/* 0x0 */ struct item bag_items[INVENTORY_SIZE];
|
||||
// NOTE: I don't know why we have to do the subtraction - Seth
|
||||
};
|
||||
|
||||
#define MAIN_INVENTORY_INDEX 0
|
||||
#define SPECIAL_EPISODE_INVENTORY_INDEX 1
|
||||
#define RESCUE_INVENTORY_INDEX 2
|
||||
#define NUM_INVENTORIES 3
|
||||
|
||||
struct bag_items {
|
||||
u8 fill0[0x384];
|
||||
// Indexes:
|
||||
// 0x0 - Main, default
|
||||
// 0x1 - Special Episode
|
||||
// 0x2 - Rescue
|
||||
/* 0x0 */ struct bag_items_inner inventories[NUM_INVENTORIES];
|
||||
/* 0x384 */ struct bag_items_inner *bag_items;
|
||||
/* 0x388 */ u8 active_inventory_idx;
|
||||
u8 fill2[0x1009];
|
||||
u32 maybeMoney[NUM_INVENTORIES]; // indexed with an u8, uses same indexes as Inventory
|
||||
};
|
||||
|
||||
struct bulk_item
|
||||
|
|
|
|||
|
|
@ -1,15 +1,29 @@
|
|||
#ifndef PMDSKY_MAIN_0200ECFC_H
|
||||
#define PMDSKY_MAIN_0200ECFC_H
|
||||
|
||||
typedef struct {
|
||||
u8 fill1[0x388];
|
||||
u8 unk388;
|
||||
u8 fill2[0x1009];
|
||||
u32 maybeMoney[]; // Unknown size, but indexed with an u8
|
||||
} bag_items;
|
||||
// Set the active inventory to the main inventory
|
||||
void SetActiveInventoryToMain(void);
|
||||
|
||||
// Init all inventories, all money the player is carrying, and set default active inventory
|
||||
void AllInventoriesZInit(void);
|
||||
|
||||
// Init the special episode inventory and money the player is carrying
|
||||
void SpecialEpisodeInventoryZInit(void);
|
||||
|
||||
// Init the rescue inventory and money the player is carrying
|
||||
void RescueInventoryZInit(void);
|
||||
|
||||
// Set the active inventory to the current index
|
||||
void SetActiveInventory(s8 index);
|
||||
|
||||
// Gets the amount of money the player is carrying.
|
||||
// return: value
|
||||
u32 GetMoneyCarried(void);
|
||||
|
||||
// Sets the amount of money the player is carrying.
|
||||
void SetMoneyCarried(s32 amount);
|
||||
|
||||
// Adds the amount of to the money the player is carrying.
|
||||
void AddMoneyCarried(s32 amount);
|
||||
|
||||
#endif //PMDSKY_MAIN_0200ECFC_H
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
#ifndef PMDSKY_MAIN_02052B28_H
|
||||
#define PMDSKY_MAIN_02052B28_H
|
||||
|
||||
#include "util.h"
|
||||
|
||||
s32 GetIqGroup(s16 monster_id);
|
||||
u8 GetSpawnThreshold(s16 monster_id);
|
||||
bool8 NeedsItemToSpawn(s16 monster_id);
|
||||
s16 GetExclusiveItem(s16 monster_id, s32 item_index);
|
||||
|
||||
#endif //PMDSKY_MAIN_02052B28_H
|
||||
|
|
|
|||
|
|
@ -5,15 +5,19 @@
|
|||
|
||||
extern struct monster_data_table *MONSTER_DATA_TABLE_PTR;
|
||||
|
||||
struct monster_evolution_parameters {
|
||||
s16 pre_evolution_idx; // 0x8: The pre-evolution of the monster.
|
||||
u16 evolution_method; // 0xA: The evolution method required to evolve to this Pokemon from the pre-evo specified in PreEvoIndex. Null if unused.
|
||||
u16 evolution_param_1; // 0xC: The first parameter for the evolution method. Null if unused.
|
||||
u16 evolution_param_2; // 0xE: The second parameter for the evolution method. Null if unused.
|
||||
};
|
||||
|
||||
struct monster_data_table_entry {
|
||||
u16 entity_id; // 0x0: A entity-unique ID to identify the entity in both of its 2 entries. Seems to match pokedex number.
|
||||
u16 unk_0x2; // 0x2: Unknown. Pokemon with the same category string have the same value in here.
|
||||
s16 pokedex_number; // 0x4: The national Pokedex number, as displayed in Chimecho Assembly.
|
||||
s16 base_movement_speed; // 0x6: The base movement speed in dungeons.
|
||||
s16 pre_evolution_idx; // 0x8: The pre-evolution of the monster.
|
||||
u16 evolution_method; // 0xA: The evolution method required to evolve to this Pokemon from the pre-evo specified in PreEvoIndex. Null if unused.
|
||||
u16 evolution_param_1; // 0xC: The first parameter for the evolution method. Null if unused.
|
||||
u16 evolution_param_2; // 0xE: The second parameter for the evolution method. Null if unused.
|
||||
struct monster_evolution_parameters evolution_param;
|
||||
u16 sprite_index; // 0x10: The index of the entity's sprite. It's the index inside the three Pokemon sprite files inside the "/MONSTER/" directory!
|
||||
u8 gender; // 0x12: Gender of this particular entity entry.
|
||||
u8 body_size; // 0x13: The body size of the Pokemon. Used when determining how many Pokemon fits in the party.
|
||||
|
|
@ -36,12 +40,12 @@ struct monster_data_table_entry {
|
|||
u8 shadow_size; // 0x2E: The size of the Pokemon's shadow.
|
||||
u8 spawn_asleep_chance; // 0x2F: The percent chance that a Pokemon will spawn asleep. Most of the time 0x8.
|
||||
u8 hp_regeneration; // 0x30: The rate at which a Pokemon regenerates HP. Always 0x64.
|
||||
s8 unk_0x31; // 0x31: Unknown.
|
||||
s8 spawn_threshold; // 0x31:
|
||||
s16 base_form_idx; // 0x32: The base evolutionary stage of the Pokemon. Seems to always be between 0 and 600.
|
||||
s16 exclusive_item_1; // 0x34: The first 1-star exclusive item for this Pokemon. Null if NA.
|
||||
s16 exclusive_item_2; // 0x36: The second 1-star exclusive item for this Pokemon. Null if NA.
|
||||
s16 exclusive_item_3; // 0x38: The 2-star exclusive item for this Pokemon. Null if NA.
|
||||
s16 exclusive_item_4; // 0x3A: The 3-star exclusive item for this Pokemon. Null if NA.
|
||||
s16 exclusive_item[4]; // 0x34: The first 1-star exclusive item for this Pokemon
|
||||
// 0x36: The second 1-star exclusive item for this Pokemon. Null if NA.
|
||||
// 0x38: The 2-star exclusive item for this Pokemon. Null if NA.
|
||||
// 0x3A: The 3-star exclusive item for this Pokemon. Null if NA.
|
||||
s16 unk_0x3c; // 0x3C: Unknown.
|
||||
s16 unk_0x3e; // 0x3E: Unknown. Often 0xF.
|
||||
s16 unk_0x40; // 0x40: Unknown.
|
||||
|
|
|
|||
|
|
@ -7,4 +7,7 @@
|
|||
// In particular, this checks for Gravity and Magnet Rise.
|
||||
bool8 IsFloating(struct entity *entity);
|
||||
|
||||
void ov29_02318A90(struct entity* entity, s8 value);
|
||||
|
||||
|
||||
#endif //PMDSKY_OVERLAY_29_02318A4C_H
|
||||
|
|
|
|||
3
main.lsf
3
main.lsf
|
|
@ -42,7 +42,6 @@ Static main
|
|||
Object src/item_util_1.o
|
||||
Object asm/main_0200EB30.o
|
||||
Object src/main_0200ECFC.o
|
||||
Object asm/main_0200ED1C.o
|
||||
Object src/main_0200EDC0.o
|
||||
Object asm/main_0200EDFC.o
|
||||
Object src/exclusive_item.o
|
||||
|
|
@ -501,7 +500,6 @@ Overlay OVY_29
|
|||
Object src/dungeon_pokemon_attributes.o
|
||||
Object asm/overlay_29_02301D84.o
|
||||
Object src/dungeon_logic_3.o
|
||||
Object asm/overlay_29_02301E88.o
|
||||
Object src/dungeon_pokemon_attributes_1.o
|
||||
Object asm/overlay_29_023021F0.o
|
||||
Object src/dungeon_logic_5.o
|
||||
|
|
@ -559,7 +557,6 @@ Overlay OVY_29
|
|||
Object src/dungeon_statuses.o
|
||||
Object asm/overlay_29_02317844.o
|
||||
Object src/overlay_29_02318A4C.o
|
||||
Object asm/overlay_29_02318A90.o
|
||||
Object src/overlay_29_02318AB0.o
|
||||
Object asm/overlay_29_02318AD4.o
|
||||
Object src/overlay_29_02318D34.o
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ void AiDecideUseItem(struct entity *entity)
|
|||
else if (IqSkillIsEnabled(entity, IQ_ITEM_MASTER))
|
||||
{
|
||||
s32 thrown_ai_flag;
|
||||
for (s32 toolbox_index = 1; toolbox_index < INVENTORY_SIZE; toolbox_index++)
|
||||
for (s32 toolbox_index = 1; toolbox_index < INVENTORY_SIZE + 2; toolbox_index++)
|
||||
{
|
||||
u8 selected_toolbox_index;
|
||||
if (toolbox_index == 1)
|
||||
|
|
|
|||
|
|
@ -28,3 +28,26 @@ bool8 MonsterIsType(struct entity *entity, enum type_id type_id)
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 IsTypeAffectedByGravity(struct entity *entity, enum type_id type)
|
||||
{
|
||||
if ((type == TYPE_FLYING) && (GravityIsActive())) {
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 HasTypeAffectedByGravity(struct entity* entity, enum type_id type)
|
||||
{
|
||||
struct monster* info;
|
||||
|
||||
info = GetEntInfo(entity);
|
||||
if (type == TYPE_NONE)
|
||||
return FALSE;
|
||||
if (info->types[0] == type)
|
||||
return IsTypeAffectedByGravity(entity, type);
|
||||
if (info->types[1] != type)
|
||||
return FALSE;
|
||||
else
|
||||
return IsTypeAffectedByGravity(entity, type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,77 @@
|
|||
#include "main_0200ECFC.h"
|
||||
#include "item.h"
|
||||
|
||||
extern bag_items* BAG_ITEMS_PTR_MIRROR;
|
||||
extern struct bag_items* BAG_ITEMS_PTR_MIRROR;
|
||||
|
||||
extern void ItemZInit(struct item *item);
|
||||
|
||||
void SetActiveInventoryToMain(void)
|
||||
{
|
||||
SetActiveInventory(MAIN_INVENTORY_INDEX);
|
||||
}
|
||||
|
||||
void AllInventoriesZInit(void)
|
||||
{
|
||||
for(int inventory_index = MAIN_INVENTORY_INDEX; inventory_index < NUM_INVENTORIES; inventory_index++)
|
||||
{
|
||||
for(int bag_index = 0; bag_index < INVENTORY_SIZE; bag_index++)
|
||||
{
|
||||
ItemZInit(&BAG_ITEMS_PTR_MIRROR->inventories[inventory_index].bag_items[bag_index]);
|
||||
}
|
||||
BAG_ITEMS_PTR_MIRROR->maybeMoney[inventory_index] = 0;
|
||||
}
|
||||
|
||||
SetActiveInventory(MAIN_INVENTORY_INDEX);
|
||||
}
|
||||
|
||||
void SpecialEpisodeInventoryZInit(void)
|
||||
{
|
||||
for(int index = 0; index < INVENTORY_SIZE; index++)
|
||||
{
|
||||
ItemZInit(&BAG_ITEMS_PTR_MIRROR->inventories[SPECIAL_EPISODE_INVENTORY_INDEX].bag_items[index]);
|
||||
}
|
||||
BAG_ITEMS_PTR_MIRROR->maybeMoney[SPECIAL_EPISODE_INVENTORY_INDEX] = 0;
|
||||
}
|
||||
|
||||
|
||||
void RescueInventoryZInit(void)
|
||||
{
|
||||
for(int index = 0; index < INVENTORY_SIZE; index++)
|
||||
{
|
||||
ItemZInit(&BAG_ITEMS_PTR_MIRROR->inventories[RESCUE_INVENTORY_INDEX].bag_items[index]);
|
||||
}
|
||||
BAG_ITEMS_PTR_MIRROR->maybeMoney[RESCUE_INVENTORY_INDEX] = 0;
|
||||
}
|
||||
|
||||
|
||||
void SetActiveInventory(s8 index)
|
||||
{
|
||||
BAG_ITEMS_PTR_MIRROR->active_inventory_idx = index;
|
||||
BAG_ITEMS_PTR_MIRROR->bag_items = &BAG_ITEMS_PTR_MIRROR->inventories[index];
|
||||
}
|
||||
|
||||
u32 GetMoneyCarried(void)
|
||||
{
|
||||
int tmp = BAG_ITEMS_PTR_MIRROR->unk388;
|
||||
int tmp = BAG_ITEMS_PTR_MIRROR->active_inventory_idx;
|
||||
return BAG_ITEMS_PTR_MIRROR->maybeMoney[tmp];
|
||||
}
|
||||
|
||||
void SetMoneyCarried(s32 amount)
|
||||
{
|
||||
s32 var_r0;
|
||||
|
||||
var_r0 = amount;
|
||||
if (var_r0 > 99999) {
|
||||
var_r0 = 99999;
|
||||
} else if (var_r0 < 0) {
|
||||
var_r0 = 0;
|
||||
}
|
||||
|
||||
BAG_ITEMS_PTR_MIRROR->maybeMoney[BAG_ITEMS_PTR_MIRROR->active_inventory_idx] = var_r0;
|
||||
}
|
||||
|
||||
void AddMoneyCarried(s32 amount)
|
||||
{
|
||||
SetMoneyCarried(amount + BAG_ITEMS_PTR_MIRROR->maybeMoney[BAG_ITEMS_PTR_MIRROR->active_inventory_idx]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ bool8 CanEvolve(s16 monster_id)
|
|||
|
||||
s16 GetMonsterPreEvolution(s16 monster_id)
|
||||
{
|
||||
return MONSTER_DATA_TABLE_PTR->entries[monster_id].pre_evolution_idx;
|
||||
return MONSTER_DATA_TABLE_PTR->entries[monster_id].evolution_param.pre_evolution_idx;
|
||||
}
|
||||
|
||||
u8 GetBaseOffensiveStat(s16 monster_id, u8 stat_idx)
|
||||
|
|
|
|||
|
|
@ -5,3 +5,18 @@ s32 GetIqGroup(s16 monster_id)
|
|||
{
|
||||
return MONSTER_DATA_TABLE_PTR->entries[monster_id].iq_group;
|
||||
}
|
||||
|
||||
u8 GetSpawnThreshold(s16 monster_id)
|
||||
{
|
||||
return MONSTER_DATA_TABLE_PTR->entries[monster_id].spawn_threshold;
|
||||
}
|
||||
|
||||
bool8 NeedsItemToSpawn(s16 monster_id)
|
||||
{
|
||||
return MONSTER_DATA_TABLE_PTR->entries[monster_id].flags & 0b10000000 ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
s16 GetExclusiveItem(s16 monster_id, s32 item_index)
|
||||
{
|
||||
return MONSTER_DATA_TABLE_PTR->entries[monster_id].exclusive_item[item_index % 4];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "overlay_29_02318A4C.h"
|
||||
#include "dungeon_util_static.h"
|
||||
#include "overlay_29_02315118.h"
|
||||
#include "overlay_29_02318AB0.h"
|
||||
#include "overlay_29_0233836C.h"
|
||||
|
||||
bool8 IsFloating(struct entity *entity)
|
||||
|
|
@ -16,3 +17,9 @@ bool8 IsFloating(struct entity *entity)
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ov29_02318A90(struct entity* entity, s8 value)
|
||||
{
|
||||
if (IsMonster__02318AB0(entity))
|
||||
GetEntInfo(entity)->two_turn_move_invincible = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ extern s32 GetMoneyStored();
|
|||
extern s32 GetLanguageType();
|
||||
extern enum game_mode GetGameMode();
|
||||
extern s32 GetNotifyNote();
|
||||
extern s32 AddMoneyCarried(s32 arg0);
|
||||
extern s32 SetMoneyCarried(s32 arg0);
|
||||
extern s32 SetMoneyStored(s32 arg0);
|
||||
extern s32 SetNotifyNote(s32 arg0);
|
||||
extern void InitDungeonListScriptVars();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user