476 lines
11 KiB
C
476 lines
11 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);
|
|
|
|
/* 43AD8 8016DBD8 */
|
|
u8 class_get_field_0x2c(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].field_0x2c;
|
|
|
|
return CLASS_DATA[arg1].field_0x2c;
|
|
}
|
|
|
|
/* 43B2C 8016DC2C */
|
|
u8 class_get_ability_front(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].ability_front;
|
|
|
|
return CLASS_DATA[arg1].ability_front;
|
|
}
|
|
|
|
/* 43B80 8016DC80 */
|
|
u8 class_get_ability_front_hitcount(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].ability_front_hitcount;
|
|
|
|
return CLASS_DATA[arg1].ability_front_hitcount;
|
|
}
|
|
|
|
/* 43BD4 8016DCD4 */
|
|
u8 class_get_ability_middle(u8 arg0, u8 arg1) {
|
|
s32 var_v0;
|
|
|
|
if (CLASS_DATA[arg0].field_0x45 != arg1) {
|
|
var_v0 = arg1 * 9;
|
|
} else {
|
|
var_v0 = CLASS_DATA[arg0].field_0x45 * 9;
|
|
}
|
|
return *(&CLASS_DATA->ability_middle + (var_v0 * 8));
|
|
}
|
|
|
|
/* 43C20 8016DD20 */
|
|
u8 class_get_ability_middle_hitcount(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].ability_middle_hitcount;
|
|
|
|
return CLASS_DATA[arg1].ability_middle_hitcount;
|
|
}
|
|
|
|
/* 43C74 8016DD74 */
|
|
u8 class_get_ability_back(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].ability_back;
|
|
|
|
return CLASS_DATA[arg1].ability_back;
|
|
}
|
|
|
|
/* 43CC8 8016DDC8 */
|
|
u8 class_get_ability_back_hitcount(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].ability_back_hitcount;
|
|
|
|
return CLASS_DATA[arg1].ability_back_hitcount;
|
|
}
|
|
|
|
/* 43D1C 8016DE1C */
|
|
u8 class_get_field_0x4(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].field_0x4;
|
|
|
|
return CLASS_DATA[arg1].field_0x4;
|
|
}
|
|
|
|
/* 43D70 8016DE70 */
|
|
u8 class_get_gender(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].gender;
|
|
|
|
return CLASS_DATA[arg1].gender;
|
|
}
|
|
|
|
/* 43DC4 8016DEC4 */
|
|
u8 class_get_leadership_rank(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].leadership_rank;
|
|
|
|
return CLASS_DATA[arg1].leadership_rank;
|
|
}
|
|
|
|
/* 43E18 8016DF18 */
|
|
u8 class_get_global_flag(u8 arg0, u8 arg1) {
|
|
u8 var_a1;
|
|
|
|
var_a1 = arg1;
|
|
if (D_8018ECE4[arg0].field_0x0 & 0x80) {
|
|
if (CLASS_DATA[arg0].field_0x45 == var_a1) {
|
|
var_a1 = arg0;
|
|
}
|
|
}
|
|
return D_8018ECE4[var_a1].field_0x0 & 0x3F;
|
|
}
|
|
|
|
/* 43E88 8016DF88 */
|
|
ItemId class_get_item_upper_left(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].item_upper_left;
|
|
|
|
return CLASS_DATA[arg1].item_upper_left;
|
|
}
|
|
|
|
/* 43EDC 8016DFDC */
|
|
ItemId class_get_item_upper_right(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].item_upper_right;
|
|
|
|
return CLASS_DATA[arg1].item_upper_right;
|
|
}
|
|
|
|
/* 43F30 8016E030 */
|
|
ItemId class_get_item_lower_left(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].item_lower_left;
|
|
|
|
return CLASS_DATA[arg1].item_lower_left;
|
|
}
|
|
|
|
/* 43F84 8016E084 */
|
|
ItemId class_get_item_lower_right(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].item_lower_right;
|
|
|
|
return CLASS_DATA[arg1].item_lower_right;
|
|
}
|
|
|
|
/* 43FD8 8016E0D8 */
|
|
char* class_get_ability_front_name(u8 arg0, u8 arg1) {
|
|
u8 var_v0;
|
|
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1) {
|
|
var_v0 = CLASS_DATA[arg0].ability_front;
|
|
} else {
|
|
var_v0 = CLASS_DATA[arg1].ability_front;
|
|
}
|
|
|
|
return ability_get_name(var_v0);
|
|
}
|
|
|
|
/* 44040 8016E140 */
|
|
char* class_get_ability_middle_name(u8 arg0, u8 arg1) {
|
|
// Possible a C macro wrapping?
|
|
do {
|
|
char* ret = ability_get_name(CLASS_DATA[arg1].ability_middle);
|
|
return ret;
|
|
} while(0);
|
|
}
|
|
|
|
/* 44074 8016E174 */
|
|
char* class_get_ability_back_name(u8 arg0, u8 arg1) {
|
|
u8 var_v0;
|
|
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1) {
|
|
var_v0 = CLASS_DATA[arg0].ability_back;
|
|
} else {
|
|
var_v0 = CLASS_DATA[arg1].ability_back;
|
|
}
|
|
|
|
return ability_get_name(var_v0);
|
|
}
|
|
|
|
/* 440DC 8016E1DC */
|
|
char* class_get_name(u8 arg0, u8 arg1) {
|
|
if (CLASS_DATA[arg0].field_0x45 == arg1)
|
|
return CLASS_DATA[arg0].name;
|
|
|
|
return CLASS_DATA[arg1].name;
|
|
}
|
|
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E230);
|
|
|
|
INCLUDE_ASM(const s32, "item", func_8016E338);
|
|
|
|
/* 44340 8016E440 */
|
|
char* ability_get_name(u8 index) {
|
|
return ABILITY_DATA[index].name;
|
|
}
|
|
|
|
/* 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(ItemId index) {
|
|
return ITEM_DATA[index].field_0x1b;
|
|
}
|
|
|
|
/* 45498 8016F598 */
|
|
u8 func_8016F598(ItemId index) {
|
|
return ITEM_DATA[index].field_0x1c;
|
|
}
|
|
|
|
/* 454B0 8016F5B0 */
|
|
char* item_get_name(ItemId index) {
|
|
return ITEM_DATA[index].name;
|
|
}
|
|
|
|
/* 454C8 8016F5C8 */
|
|
ItemType item_get_type(ItemId index) {
|
|
return ITEM_DATA[index].type;
|
|
}
|
|
|
|
/* 454E0 8016F5E0 */
|
|
Element item_get_element(ItemId 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(ItemId index) {
|
|
return ITEM_DATA[index].field_0x6;
|
|
}
|
|
|
|
/* 4552C 8016F62C */
|
|
u16 item_get_field_0x4(ItemId index) {
|
|
return ITEM_DATA[index].field_0x8;
|
|
}
|
|
|
|
/* 45544 8016F644 */
|
|
s8 item_get_field_0xc(ItemId index) {
|
|
return ITEM_DATA[index].field_0x10;
|
|
}
|
|
|
|
/* 4555C 8016F65C */
|
|
s8 item_get_strength(ItemId index) {
|
|
s8 ret;
|
|
if (index == ITEM_ID_GALLANT_DOLL) {
|
|
ret = CHARACTER_SLOT[0].strength / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].strength;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 455AC 8016F6AC */
|
|
s8 item_get_vitality(ItemId index) {
|
|
s8 ret;
|
|
if (index == ITEM_ID_GALLANT_DOLL) {
|
|
ret = CHARACTER_SLOT[0].vitality / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].vitality;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 455FC 8016F6FC */
|
|
s8 item_get_intelligence(ItemId index) {
|
|
s8 ret;
|
|
if (index == ITEM_ID_GALLANT_DOLL) {
|
|
ret = CHARACTER_SLOT[0].intelligence / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].intelligence;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 4564C 8016F74C */
|
|
s8 item_get_mentality(ItemId index) {
|
|
s8 ret;
|
|
if (index == ITEM_ID_GALLANT_DOLL) {
|
|
ret = CHARACTER_SLOT[0].mentality / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].mentality;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 4569C 8016F79C */
|
|
s8 item_get_agility(ItemId index) {
|
|
s8 ret;
|
|
if (index == ITEM_ID_GALLANT_DOLL) {
|
|
ret = CHARACTER_SLOT[0].agility / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].agility;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 456EC 8016F7EC */
|
|
s8 item_get_dexterity(ItemId index) {
|
|
s8 ret;
|
|
if (index == ITEM_ID_GALLANT_DOLL) {
|
|
ret = CHARACTER_SLOT[0].dexterity / 20;
|
|
} else {
|
|
ret = ITEM_DATA[index].dexterity;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
/* 4573C 8016F83C */
|
|
s8 item_get_resistance_strike(ItemId index) {
|
|
return ITEM_DATA[index].res_strike;
|
|
}
|
|
|
|
/* 45754 8016F854 */
|
|
s8 item_get_resistance_wind(ItemId index) {
|
|
return ITEM_DATA[index].res_wind;
|
|
}
|
|
|
|
/* 4576C 8016F86C */
|
|
s8 item_get_resistance_fire(ItemId index) {
|
|
return ITEM_DATA[index].res_fire;
|
|
}
|
|
|
|
/* 45784 8016F884 */
|
|
s8 item_get_resistance_earth(ItemId index) {
|
|
return ITEM_DATA[index].res_earth;
|
|
}
|
|
|
|
/* 4579C 8016F89C */
|
|
s8 item_get_resistance_water(ItemId index) {
|
|
return ITEM_DATA[index].res_water;
|
|
}
|
|
|
|
/* 457B4 8016F8B4 */
|
|
s8 item_get_resistance_holy(ItemId index) {
|
|
return ITEM_DATA[index].res_holy;
|
|
}
|
|
|
|
/* 457CC 8016F8CC */
|
|
s8 item_get_resistance_dark(ItemId index) {
|
|
return ITEM_DATA[index].res_dark;
|
|
}
|
|
|
|
/* 457E4 8016F8E4 */
|
|
u32 item_get_field_0x14_b68(ItemId index) {
|
|
return ITEM_DATA[index].field_0x18 >> 6;
|
|
}
|
|
|
|
/* 45800 8016F900 */
|
|
u32 item_get_field_0x14_b46(ItemId index) {
|
|
return (ITEM_DATA[index].field_0x18 >> 4) & 3;
|
|
}
|
|
|
|
/* 45820 8016F920 */
|
|
u32 item_get_field_0x14_b24(ItemId index) {
|
|
return (ITEM_DATA[index].field_0x18 >> 2) & 3;
|
|
}
|
|
|
|
/* 45840 8016F940 */
|
|
u32 item_get_field_0x14_b12(ItemId 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);
|