338 lines
7.4 KiB
C
338 lines
7.4 KiB
C
#include "common.h"
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D200);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D254);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D2A8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D2FC);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D350);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D3A4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D3F8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D44C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D4A0);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D4F4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D548);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D59C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D5F0);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D644);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D698);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D6EC);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D740);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D794);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D7E8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D83C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D890);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D8E4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D938);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D98C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016D9E0);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DA34);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DA88);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DADC);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DB30);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DB84);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DBD8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DC2C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DC80);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DCD4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DD20);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DD74);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DDC8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DE1C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DE70);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DEC4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DF18);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DF88);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016DFDC);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E030);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E084);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E0D8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E140);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E174);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E1DC);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E230);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E338);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E440);
|
|
|
|
/* 44358 8016E458 */
|
|
u8 func_8016E458(u8 index) {
|
|
return ABILITY_DATA[index].field_0x0;
|
|
}
|
|
|
|
/* 44370 8016E470 */
|
|
Element ability_get_element(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) {
|
|
u16 item_index;
|
|
|
|
if (ABILITY_DATA[index].element != ELEMENT_INVALID && ABILITY_DATA[index].element != 0xF)
|
|
return ABILITY_DATA[index].element;
|
|
|
|
if (ABILITY_DATA[index].field_0x0 == 3) {
|
|
item_index = func_8016FB50(arg1, arg2, arg3, arg4);
|
|
} else {
|
|
item_index = func_8016FA34(arg1, arg2, arg3, arg4);
|
|
}
|
|
|
|
if (item_index == 0)
|
|
return 0;
|
|
|
|
return item_get_element(item_index);
|
|
}
|
|
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E50C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016EA34);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016EAEC);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016EBA4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F11C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F4E0);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F500);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F520);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F540);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F560);
|
|
|
|
/* 45480 8016F580 */
|
|
u8 func_8016F580(u16 index) {
|
|
return ITEM_DATA[index].field_0x1b;
|
|
}
|
|
|
|
/* 45498 8016F598 */
|
|
u8 func_8016F598(u16 index) {
|
|
return ITEM_DATA[index].field_0x1c;
|
|
}
|
|
|
|
/* 454B0 8016F5B0 */
|
|
char* item_get_name(u16 index) {
|
|
return ITEM_DATA[index].name;
|
|
}
|
|
|
|
/* 454C8 8016F5C8 */
|
|
ItemType item_get_type(u16 index) {
|
|
return ITEM_DATA[index].type;
|
|
}
|
|
|
|
/* 454E0 8016F5E0 */
|
|
Element item_get_element(u16 index) {
|
|
Element element;
|
|
|
|
element = ITEM_DATA[index].element;
|
|
if (element == ELEMENT_UNKNOWN_0x10) {
|
|
element = CHARACTER_SLOT[0].element;
|
|
}
|
|
return element;
|
|
}
|
|
|
|
/* 45514 8016F614 */
|
|
u8 item_get_field_0x2(u16 index) {
|
|
return ITEM_DATA[index].field_0x6;
|
|
}
|
|
|
|
/* 4552C 8016F62C */
|
|
u16 item_get_field_0x4(u16 index) {
|
|
return ITEM_DATA[index].field_0x8;
|
|
}
|
|
|
|
/* 45544 8016F644 */
|
|
s8 item_get_field_0xc(u16 index) {
|
|
return ITEM_DATA[index].field_0x10;
|
|
}
|
|
|
|
/* 4555C 8016F65C */
|
|
s8 item_get_strength(u16 index) {
|
|
s8 ret;
|
|
if (index == 132) {
|
|
ret = CHARACTER_SLOT[0].strength / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].strength;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 455AC 8016F6AC */
|
|
s8 item_get_vitality(u16 index) {
|
|
s8 ret;
|
|
if (index == 132) {
|
|
ret = CHARACTER_SLOT[0].vitality / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].vitality;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 455FC 8016F6FC */
|
|
s8 item_get_intelligence(u16 index) {
|
|
s8 ret;
|
|
if (index == 132) {
|
|
ret = CHARACTER_SLOT[0].intelligence / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].intelligence;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 4564C 8016F74C */
|
|
s8 item_get_mentality(u16 index) {
|
|
s8 ret;
|
|
if (index == 132) {
|
|
ret = CHARACTER_SLOT[0].mentality / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].mentality;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 4569C 8016F79C */
|
|
s8 item_get_agility(u16 index) {
|
|
s8 ret;
|
|
if (index == 132) {
|
|
ret = CHARACTER_SLOT[0].agility / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].agility;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 456EC 8016F7EC */
|
|
s8 item_get_dexterity(u16 index) {
|
|
s8 ret;
|
|
if (index == 132) {
|
|
ret = CHARACTER_SLOT[0].dexterity / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].dexterity;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 4573C 8016F83C */
|
|
s8 item_get_resistance_strike(u16 index) {
|
|
return ITEM_DATA[index].res_strike;
|
|
}
|
|
|
|
/* 45754 8016F854 */
|
|
s8 item_get_resistance_wind(u16 index) {
|
|
return ITEM_DATA[index].res_wind;
|
|
}
|
|
|
|
/* 4576C 8016F86C */
|
|
s8 item_get_resistance_fire(u16 index) {
|
|
return ITEM_DATA[index].res_fire;
|
|
}
|
|
|
|
/* 45784 8016F884 */
|
|
s8 item_get_resistance_earth(u16 index) {
|
|
return ITEM_DATA[index].res_earth;
|
|
}
|
|
|
|
/* 4579C 8016F89C */
|
|
s8 item_get_resistance_water(u16 index) {
|
|
return ITEM_DATA[index].res_water;
|
|
}
|
|
|
|
/* 457B4 8016F8B4 */
|
|
s8 item_get_resistance_holy(u16 index) {
|
|
return ITEM_DATA[index].res_holy;
|
|
}
|
|
|
|
/* 457CC 8016F8CC */
|
|
s8 item_get_resistance_dark(u16 index) {
|
|
return ITEM_DATA[index].res_dark;
|
|
}
|
|
|
|
/* 457E4 8016F8E4 */
|
|
u32 item_get_field_0x14_b68(u16 index) {
|
|
return ITEM_DATA[index].field_0x18 >> 6;
|
|
}
|
|
|
|
/* 45800 8016F900 */
|
|
u32 item_get_field_0x14_b46(u16 index) {
|
|
return (ITEM_DATA[index].field_0x18 >> 4) & 3;
|
|
}
|
|
|
|
/* 45820 8016F920 */
|
|
u32 item_get_field_0x14_b24(u16 index) {
|
|
return (ITEM_DATA[index].field_0x18 >> 2) & 3;
|
|
}
|
|
|
|
/* 45840 8016F940 */
|
|
u32 item_get_field_0x14_b12(u16 index) {
|
|
return ITEM_DATA[index].field_0x18 & 3;
|
|
}
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F95C);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F978);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F998);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F9B8);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F9D4);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016F9F0);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016FA34);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016FB50);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016FBE0);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016FCEC);
|