Merge `class.c`, `ability.c` and `equipment.c` into `_ob_fierce_selection`
Refactor class function names
This commit is contained in:
parent
4fec5e1726
commit
9d2e65d8fb
|
|
@ -82,37 +82,29 @@ typedef struct {
|
|||
|
||||
ASSERT_SIZE(ClassData, 0x48);
|
||||
|
||||
// This can be removed when all class data has been decompiled.
|
||||
typedef union {
|
||||
u32 raw[18];
|
||||
ClassData class_data;
|
||||
} ClassData_u;
|
||||
|
||||
ASSERT_SIZE(ClassData_u, 0x48);
|
||||
|
||||
extern ClassData_u obClassData[];
|
||||
extern ClassData obClassData[];
|
||||
extern EquipmentId (*FP_CLASS_GET_ITEM_1[4])(u8, u8);
|
||||
|
||||
extern u8 class_get_field_0x2c(u8 portrait, u8 class);
|
||||
extern u8 class_get_ability_front(u8 portrait, u8 class);
|
||||
extern u8 class_get_ability_front_hitcount(u8 portrait, u8 class);
|
||||
extern u8 class_get_ability_middle(u8 portrait, u8 class);
|
||||
extern u8 class_get_ability_middle_hitcount(u8 portrait, u8 class);
|
||||
extern u8 class_get_ability_back(u8 portrait, u8 class);
|
||||
extern u8 class_get_ability_back_hitcount(u8 portrait, u8 class);
|
||||
extern u8 obClassGetAbilityFront(u8 portrait, u8 class);
|
||||
extern u8 obClassGetAbilityFrontHits(u8 portrait, u8 class);
|
||||
extern u8 obClassGetAbilityMiddle(u8 portrait, u8 class);
|
||||
extern u8 obClassGetAbilityMiddleHits(u8 portrait, u8 class);
|
||||
extern u8 obClassGetAbilityBack(u8 portrait, u8 class);
|
||||
extern u8 obClassGetAbilityBackHits(u8 portrait, u8 class);
|
||||
extern u8 class_get_field_0x4(u8 portrait, u8 class);
|
||||
extern u8 class_get_gender(u8 portrait, u8 class);
|
||||
extern u8 class_get_leadership_rank(u8 portrait, u8 class);
|
||||
extern u8 obClassGetGender(u8 portrait, u8 class);
|
||||
extern u8 obClassGetLeadershipRank(u8 portrait, u8 class);
|
||||
extern u8 class_get_global_flag(u8 portrait, u8 class);
|
||||
|
||||
extern EquipmentId class_get_item_upper_left(u8 portrait, u8 class);
|
||||
extern EquipmentId class_get_item_upper_right(u8 portrait, u8 class);
|
||||
extern EquipmentId class_get_item_lower_left(u8 portrait, u8 class);
|
||||
extern EquipmentId class_get_item_lower_right(u8 portrait, u8 class);
|
||||
extern EquipmentId obClassGetItemUpperLeft(u8 portrait, u8 class);
|
||||
extern EquipmentId obClassGetItemUpperRight(u8 portrait, u8 class);
|
||||
extern EquipmentId obClassGetItemLowerLeft(u8 portrait, u8 class);
|
||||
extern EquipmentId obClassGetItemLowerRight(u8 portrait, u8 class);
|
||||
|
||||
extern char* class_get_ability_front_name(u8 portrait, u8 class);
|
||||
extern char* class_get_ability_middle_name(u8 portrait, u8 class);
|
||||
extern char* class_get_ability_back_name(u8 portrait, u8 class);
|
||||
extern char* class_get_name(u8 portrait, u8 class);
|
||||
extern char* obClassGetAbilityFrontName(u8 portrait, u8 class);
|
||||
extern char* obClassGetAbilityMiddleName(u8 portrait, u8 class);
|
||||
extern char* obClassGetAbilityBackName(u8 portrait, u8 class);
|
||||
extern char* obClassGetName(u8 portrait, u8 class);
|
||||
|
||||
#endif // __CLASS_H__
|
||||
|
|
@ -385,26 +385,26 @@ FP_CLASS_GET_ITEM_1 = 0x8018B494; // rom:0x61394 size:16 type:u32
|
|||
|
||||
obClassData = 0x80187C14; // rom:0x5DB14 size:0x2E68 type:u32
|
||||
class_get_field_0x2c = 0x8016DBD8; // rom:0x43AD8
|
||||
class_get_ability_front = 0x8016DC2C; // rom:0x43B2C
|
||||
class_get_ability_front_hitcount = 0x8016DC80; // rom:0x43B80
|
||||
class_get_ability_middle = 0x8016DCD4; // rom:0x43BD4
|
||||
class_get_ability_middle_hitcount = 0x8016DD20; // rom:0x43C20
|
||||
class_get_ability_back = 0x8016DD74; // rom:0x43C74
|
||||
class_get_ability_back_hitcount = 0x8016DDC8; // rom:0x43CC8
|
||||
obClassGetAbilityFront = 0x8016DC2C; // rom:0x43B2C
|
||||
obClassGetAbilityFrontHits = 0x8016DC80; // rom:0x43B80
|
||||
obClassGetAbilityMiddle = 0x8016DCD4; // rom:0x43BD4
|
||||
obClassGetAbilityMiddleHits = 0x8016DD20; // rom:0x43C20
|
||||
obClassGetAbilityBack = 0x8016DD74; // rom:0x43C74
|
||||
obClassGetAbilityBackHits = 0x8016DDC8; // rom:0x43CC8
|
||||
class_get_field_0x4 = 0x8016DE1C; // rom:0x43D1C
|
||||
class_get_gender = 0x8016DE70; // rom:0x43D70
|
||||
class_get_leadership_rank = 0x8016DEC4; // rom:0x43DC4
|
||||
obClassGetGender = 0x8016DE70; // rom:0x43D70
|
||||
obClassGetLeadershipRank = 0x8016DEC4; // rom:0x43DC4
|
||||
class_get_global_flag = 0x8016DF18; // rom:0x43E18
|
||||
class_get_item_upper_left = 0x8016DF88; // rom:0x43E88
|
||||
class_get_item_upper_right = 0x8016DFDC; // rom:0x43EDC
|
||||
class_get_item_lower_left = 0x8016E030; // rom:0x43F30
|
||||
class_get_item_lower_right = 0x8016E084; // rom:0x43F84
|
||||
class_get_ability_front_name = 0x8016E0D8; // rom:0x43FD8
|
||||
class_get_ability_middle_name = 0x8016E140; // rom:0x44040
|
||||
class_get_ability_back_name = 0x8016E174; // rom:0x44074
|
||||
class_get_name = 0x8016E1DC; // rom:0x440DC
|
||||
class_get_ability = 0x8016E230; // rom:0x44130
|
||||
class_get_ability_hitcount = 0x8016E338; // rom:0x44238
|
||||
obClassGetItemUpperLeft = 0x8016DF88; // rom:0x43E88
|
||||
obClassGetItemUpperRight = 0x8016DFDC; // rom:0x43EDC
|
||||
obClassGetItemLowerLeft = 0x8016E030; // rom:0x43F30
|
||||
obClassGetItemLowerRight = 0x8016E084; // rom:0x43F84
|
||||
obClassGetAbilityFrontName = 0x8016E0D8; // rom:0x43FD8
|
||||
obClassGetAbilityMiddleName = 0x8016E140; // rom:0x44040
|
||||
obClassGetAbilityBackName = 0x8016E174; // rom:0x44074
|
||||
obClassGetName = 0x8016E1DC; // rom:0x440DC
|
||||
obClassGetAbility = 0x8016E230; // rom:0x44130
|
||||
obClassGetAbilityHits = 0x8016E338; // rom:0x44238
|
||||
|
||||
// CLASS_NAME_DRAGON_MASTER = 0x80190230; // type:asciz
|
||||
// obClassNameDanika = 0x8018FED0;
|
||||
|
|
|
|||
114
src/ability.c
114
src/ability.c
|
|
@ -1,114 +0,0 @@
|
|||
#include "ability.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "equipment.h"
|
||||
#include "class.h"
|
||||
|
||||
/* 44340 8016E440 */
|
||||
char* obAbilityGetName(u8 index) {
|
||||
return obAbilityData[index].name;
|
||||
}
|
||||
|
||||
/* 44358 8016E458 */
|
||||
u8 ability_get_field_0x4(u8 index) {
|
||||
return obAbilityData[index].field_0x4;
|
||||
}
|
||||
|
||||
/* 44370 8016E470 */
|
||||
Element obAbilityGetElement(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) {
|
||||
u16 item_index;
|
||||
|
||||
if (obAbilityData[index].element != ELEMENT_INVALID && obAbilityData[index].element != 0xF)
|
||||
return obAbilityData[index].element;
|
||||
|
||||
if (obAbilityData[index].field_0x4 == 3) {
|
||||
item_index = obEquipmentGetFirstSpellbook(arg1, arg2, arg3, arg4);
|
||||
} else {
|
||||
item_index = obEquipmentGetFirstWeapon(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
if (item_index == 0)
|
||||
return ELEMENT_PHYSICAL;
|
||||
|
||||
return obEquipmentGetElement(item_index);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", func_8016E50C);
|
||||
|
||||
// INCLUDE_ASM(const s32, "ability", func_8016EA34);
|
||||
|
||||
/* 44934 8016EA34 */
|
||||
u8 func_8016EA34(u8 portrait, u8 class, u8 arg2)
|
||||
{
|
||||
if (obClassData[portrait].field_0x45 != class)
|
||||
portrait = class;
|
||||
|
||||
portrait = (obClassData[portrait].field_0x42 != 0xFF && arg2 < obClassData[portrait].field_0x42) ?
|
||||
obClassData[portrait].field_0x41 :
|
||||
(obClassData[portrait].field_0x44 != 0xFF && arg2 < obClassData[portrait].field_0x44) ?
|
||||
obClassData[portrait].field_0x43 : portrait;
|
||||
|
||||
return portrait;
|
||||
}
|
||||
|
||||
|
||||
/* 449EC 8016EAEC */
|
||||
u16 character_get_item(CharacterSlot* character, u8 slot) {
|
||||
u16 item_id;
|
||||
|
||||
item_id = 0;
|
||||
switch(slot) {
|
||||
case 0:
|
||||
item_id = character->item_upper_left;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
item_id = character->item_upper_right;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
item_id = character->item_lower_left;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
item_id = character->item_lower_right;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item_id == 0) {
|
||||
item_id = FP_CLASS_GET_ITEM_1[slot](character->portrait, character->class);
|
||||
}
|
||||
return item_id;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", __character_handle_levelup);
|
||||
|
||||
INCLUDE_ASM(const s32, "ability", __character_initialise);
|
||||
|
||||
/* 453E0 8016F4E0 */
|
||||
char *obItemGetName(u16 arg0) {
|
||||
return obItemData[arg0].name;
|
||||
}
|
||||
|
||||
/* 45400 8016F500 */
|
||||
u8 item_get_field_0x4(u16 arg0) {
|
||||
return obItemData[arg0].field_0x4;
|
||||
}
|
||||
|
||||
/* 45420 8016F520 */
|
||||
u8 item_get_field_0x5(u16 arg0) {
|
||||
return obItemData[arg0].field_0x5;
|
||||
}
|
||||
|
||||
/* 45440 8016F540 */
|
||||
u8 item_get_field_0x8(u16 arg0) {
|
||||
return obItemData[arg0].field_0x8;
|
||||
}
|
||||
|
||||
/* 45460 8016F560 */
|
||||
u8 item_get_field_0x9(u16 arg0) {
|
||||
return obItemData[arg0].field_0x9;
|
||||
}
|
||||
|
||||
265
src/class.c
265
src/class.c
|
|
@ -1,265 +0,0 @@
|
|||
#include "class.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "ability.h"
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D200);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D254);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D2A8);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D2FC);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D350);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D3A4);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D3F8);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D44C);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D4A0);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D4F4);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D548);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D59C);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D5F0);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D644);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D698);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D6EC);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D740);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D794);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D7E8);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D83C);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D890);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D8E4);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D938);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D98C);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016D9E0);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016DA34);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016DA88);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016DADC);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016DB30);
|
||||
|
||||
INCLUDE_ASM(const s32, "class", func_8016DB84);
|
||||
|
||||
/* 43AD8 8016DBD8 */
|
||||
u8 class_get_field_0x2c(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].field_0x2c;
|
||||
|
||||
return obClassData[class].field_0x2c;
|
||||
}
|
||||
|
||||
/* 43B2C 8016DC2C */
|
||||
u8 class_get_ability_front(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_front;
|
||||
|
||||
return obClassData[class].ability_front;
|
||||
}
|
||||
|
||||
/* 43B80 8016DC80 */
|
||||
u8 class_get_ability_front_hitcount(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_front_hitcount;
|
||||
|
||||
return obClassData[class].ability_front_hitcount;
|
||||
}
|
||||
|
||||
/* 43BD4 8016DCD4 */
|
||||
u8 class_get_ability_middle(u8 portrait, u8 class) {
|
||||
s32 var_v0;
|
||||
|
||||
if (obClassData[portrait].field_0x45 != class) {
|
||||
var_v0 = class * 9;
|
||||
} else {
|
||||
var_v0 = obClassData[portrait].field_0x45 * 9;
|
||||
}
|
||||
return *(&obClassData->ability_middle + (var_v0 * 8));
|
||||
}
|
||||
|
||||
/* 43C20 8016DD20 */
|
||||
u8 class_get_ability_middle_hitcount(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_middle_hitcount;
|
||||
|
||||
return obClassData[class].ability_middle_hitcount;
|
||||
}
|
||||
|
||||
/* 43C74 8016DD74 */
|
||||
u8 class_get_ability_back(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_back;
|
||||
|
||||
return obClassData[class].ability_back;
|
||||
}
|
||||
|
||||
/* 43CC8 8016DDC8 */
|
||||
u8 class_get_ability_back_hitcount(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_back_hitcount;
|
||||
|
||||
return obClassData[class].ability_back_hitcount;
|
||||
}
|
||||
|
||||
/* 43D1C 8016DE1C */
|
||||
u8 class_get_field_0x4(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].field_0x4;
|
||||
|
||||
return obClassData[class].field_0x4;
|
||||
}
|
||||
|
||||
/* 43D70 8016DE70 */
|
||||
u8 class_get_gender(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].gender;
|
||||
|
||||
return obClassData[class].gender;
|
||||
}
|
||||
|
||||
/* 43DC4 8016DEC4 */
|
||||
u8 class_get_leadership_rank(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].leadership_rank;
|
||||
|
||||
return obClassData[class].leadership_rank;
|
||||
}
|
||||
|
||||
/* 43E18 8016DF18 */
|
||||
u8 class_get_global_flag(u8 portrait, u8 class) {
|
||||
u8 var_a1;
|
||||
|
||||
var_a1 = class;
|
||||
if (D_8018ECE4[portrait].field_0x0 & 0x80) {
|
||||
if (obClassData[portrait].field_0x45 == var_a1) {
|
||||
var_a1 = portrait;
|
||||
}
|
||||
}
|
||||
return D_8018ECE4[var_a1].field_0x0 & 0x3F;
|
||||
}
|
||||
|
||||
/* 43E88 8016DF88 */
|
||||
EquipmentId class_get_item_upper_left(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_upper_left;
|
||||
|
||||
return obClassData[class].item_upper_left;
|
||||
}
|
||||
|
||||
/* 43EDC 8016DFDC */
|
||||
EquipmentId class_get_item_upper_right(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_upper_right;
|
||||
|
||||
return obClassData[class].item_upper_right;
|
||||
}
|
||||
|
||||
/* 43F30 8016E030 */
|
||||
EquipmentId class_get_item_lower_left(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_lower_left;
|
||||
|
||||
return obClassData[class].item_lower_left;
|
||||
}
|
||||
|
||||
/* 43F84 8016E084 */
|
||||
EquipmentId class_get_item_lower_right(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_lower_right;
|
||||
|
||||
return obClassData[class].item_lower_right;
|
||||
}
|
||||
|
||||
/* 43FD8 8016E0D8 */
|
||||
char* class_get_ability_front_name(u8 portrait, u8 class) {
|
||||
u8 var_v0;
|
||||
|
||||
if (obClassData[portrait].field_0x45 == class) {
|
||||
var_v0 = obClassData[portrait].ability_front;
|
||||
} else {
|
||||
var_v0 = obClassData[class].ability_front;
|
||||
}
|
||||
|
||||
return obAbilityGetName(var_v0);
|
||||
}
|
||||
|
||||
/* 44040 8016E140 */
|
||||
char* class_get_ability_middle_name(u8 portrait, u8 class) {
|
||||
// Possible a C macro wrapping?
|
||||
do {
|
||||
char* ret = obAbilityGetName(obClassData[class].ability_middle);
|
||||
return ret;
|
||||
} while(0);
|
||||
}
|
||||
|
||||
/* 44074 8016E174 */
|
||||
char* class_get_ability_back_name(u8 portrait, u8 class) {
|
||||
u8 var_v0;
|
||||
|
||||
if (obClassData[portrait].field_0x45 == class) {
|
||||
var_v0 = obClassData[portrait].ability_back;
|
||||
} else {
|
||||
var_v0 = obClassData[class].ability_back;
|
||||
}
|
||||
|
||||
return obAbilityGetName(var_v0);
|
||||
}
|
||||
|
||||
/* 440DC 8016E1DC */
|
||||
char* class_get_name(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].name;
|
||||
|
||||
return obClassData[class].name;
|
||||
}
|
||||
|
||||
/* 44130 8016E230 */
|
||||
u8 class_get_ability(u8 portrait, u8 class, u8 row)
|
||||
{
|
||||
if (obClassData[portrait].field_0x45 != class)
|
||||
portrait = class;
|
||||
|
||||
if (row == 0) {
|
||||
return obClassData[portrait].ability_front != 0xFF ? obClassData[portrait].ability_front : obClassData[class].ability_front;
|
||||
} else if (row == 1) {
|
||||
return obClassData[portrait].ability_middle != 0xFF ? obClassData[portrait].ability_middle : obClassData[class].ability_middle;
|
||||
} else {
|
||||
return obClassData[portrait].ability_back != 0xFF ? obClassData[portrait].ability_back : obClassData[class].ability_back;
|
||||
}
|
||||
}
|
||||
|
||||
/* 44238 8016E338 */
|
||||
u8 class_get_ability_hitcount(u8 portrait, u8 class, u8 row) {
|
||||
if (obClassData[portrait].field_0x45 != class)
|
||||
portrait = class;
|
||||
|
||||
if (row == 0) {
|
||||
return obClassData[portrait].ability_front_hitcount != 0xFF ? obClassData[portrait].ability_front_hitcount : obClassData[class].ability_front_hitcount;
|
||||
} else if (row == 1) {
|
||||
return obClassData[portrait].ability_middle_hitcount != 0xFF ? obClassData[portrait].ability_middle_hitcount : obClassData[class].ability_middle_hitcount;
|
||||
} else {
|
||||
return obClassData[portrait].ability_back_hitcount != 0xFF ? obClassData[portrait].ability_back_hitcount : obClassData[class].ability_back_hitcount;
|
||||
}
|
||||
}
|
||||
232
src/equipment.c
232
src/equipment.c
|
|
@ -1,232 +0,0 @@
|
|||
#include "equipment.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "element.h"
|
||||
|
||||
/* 45480 8016F580 */
|
||||
u8 equipment_get_field_0x1b(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x1b;
|
||||
}
|
||||
|
||||
/* 45498 8016F598 */
|
||||
u8 equipment_get_field_0x1c(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x1c;
|
||||
}
|
||||
|
||||
/* 454B0 8016F5B0 */
|
||||
char* obEquipmentGetName(EquipmentId index) {
|
||||
return obEquipmentData[index].name;
|
||||
}
|
||||
|
||||
/* 454C8 8016F5C8 */
|
||||
EquipmentType obEquipmentGetType(EquipmentId index) {
|
||||
return obEquipmentData[index].type;
|
||||
}
|
||||
|
||||
/* 454E0 8016F5E0 */
|
||||
Element obEquipmentGetElement(EquipmentId index) {
|
||||
Element element;
|
||||
|
||||
element = obEquipmentData[index].element;
|
||||
if (element == ELEMENT_UNKNOWN_0x10) {
|
||||
element = CHARACTER_SLOT[0].element;
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
/* 45514 8016F614 */
|
||||
u8 equipment_get_field_0x6(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x6;
|
||||
}
|
||||
|
||||
/* 4552C 8016F62C */
|
||||
u16 obEquipmentGetBuyPrice(EquipmentId index) {
|
||||
return obEquipmentData[index].buy_price;
|
||||
}
|
||||
|
||||
/* 45544 8016F644 */
|
||||
s8 equipment_get_field_0x10(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x10;
|
||||
}
|
||||
|
||||
/* 4555C 8016F65C */
|
||||
s8 obEquipmentGetStrength(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].strength / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].strength;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 455AC 8016F6AC */
|
||||
s8 obEquipmentGetVitality(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].vitality / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].vitality;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 455FC 8016F6FC */
|
||||
s8 obEquipmentGetIntelligence(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].intelligence / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].intelligence;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 4564C 8016F74C */
|
||||
s8 obEquipmentGetMentality(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].mentality / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].mentality;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 4569C 8016F79C */
|
||||
s8 obEquipmentGetAgility(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].agility / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].agility;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 456EC 8016F7EC */
|
||||
s8 obEquipmentGetDexterity(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].dexterity / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].dexterity;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 4573C 8016F83C */
|
||||
s8 obEquipmentGetResistanceStrike(EquipmentId index) {
|
||||
return obEquipmentData[index].res_strike;
|
||||
}
|
||||
|
||||
/* 45754 8016F854 */
|
||||
s8 obEquipmentGetResistanceWind(EquipmentId index) {
|
||||
return obEquipmentData[index].res_wind;
|
||||
}
|
||||
|
||||
/* 4576C 8016F86C */
|
||||
s8 obEquipmentGetResistanceFire(EquipmentId index) {
|
||||
return obEquipmentData[index].res_fire;
|
||||
}
|
||||
|
||||
/* 45784 8016F884 */
|
||||
s8 obEquipmentGetResistanceEarth(EquipmentId index) {
|
||||
return obEquipmentData[index].res_earth;
|
||||
}
|
||||
|
||||
/* 4579C 8016F89C */
|
||||
s8 obEquipmentGetResistanceWater(EquipmentId index) {
|
||||
return obEquipmentData[index].res_water;
|
||||
}
|
||||
|
||||
/* 457B4 8016F8B4 */
|
||||
s8 obEquipmentGetResistanceVirtue(EquipmentId index) {
|
||||
return obEquipmentData[index].res_holy;
|
||||
}
|
||||
|
||||
/* 457CC 8016F8CC */
|
||||
s8 obEquipmentGetResistanceBane(EquipmentId index) {
|
||||
return obEquipmentData[index].res_dark;
|
||||
}
|
||||
|
||||
/* 457E4 8016F8E4 */
|
||||
u8 equipment_get_field_0x18_b68(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x18 >> 6;
|
||||
}
|
||||
|
||||
/* 45800 8016F900 */
|
||||
u8 equipment_get_field_0x18_b46(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x18 >> 4) & 3;
|
||||
}
|
||||
|
||||
/* 45820 8016F920 */
|
||||
u8 equipment_get_field_0x18_b24(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x18 >> 2) & 3;
|
||||
}
|
||||
|
||||
/* 45840 8016F940 */
|
||||
u8 equipment_get_field_0x18_b12(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x18 & 3;
|
||||
}
|
||||
|
||||
/* 4585C 8016F95C */
|
||||
u8 equipment_get_field_0x19_b68(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x19 >> 6;
|
||||
}
|
||||
|
||||
/* 45878 8016F978 */
|
||||
u8 equipment_get_field_0x19_b46(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x19 >> 4) & 3;
|
||||
}
|
||||
|
||||
/* 45898 8016F998 */
|
||||
u8 equipment_get_field_0x19_b24(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x19 >> 2) & 3;
|
||||
}
|
||||
|
||||
/* 458B8 8016F9B8 */
|
||||
u8 equipment_get_field_0x19_b12(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x19 & 3;
|
||||
}
|
||||
|
||||
/* 458D4 8016F9D4 */
|
||||
u8 equipment_get_field_0x1a_b7(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x1a >> 7;
|
||||
}
|
||||
|
||||
/* 458F0 8016F9F0 */
|
||||
bool obEquipmentIsWeapon(EquipmentId index) {
|
||||
s32 type = obEquipmentData[index].type;
|
||||
|
||||
if (type != 0) {
|
||||
if (type < EQUIPMENT_TYPE_SMALL_SHIELD) {
|
||||
return true;
|
||||
}
|
||||
if (type == EQUIPMENT_TYPE_FAN) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "equipment", obEquipmentGetFirstWeapon);
|
||||
|
||||
/* 45A50 8016FB50 */
|
||||
EquipmentId obEquipmentGetFirstSpellbook(EquipmentId arg0, EquipmentId arg1, EquipmentId arg2, EquipmentId arg3) {
|
||||
if (obEquipmentData[arg0].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg0;
|
||||
|
||||
if (obEquipmentData[arg1].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg1;
|
||||
|
||||
if (obEquipmentData[arg2].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg2;
|
||||
|
||||
if (obEquipmentData[arg3].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
#include "common.h"
|
||||
|
||||
#include "class.h"
|
||||
#include "ability.h"
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016D200);
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016D254);
|
||||
|
|
@ -60,139 +63,536 @@ INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016DB30);
|
|||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016DB84);
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_field_0x2c);
|
||||
/* 43AD8 8016DBD8 */
|
||||
u8 class_get_field_0x2c(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].field_0x2c;
|
||||
|
||||
return obClassData[class].field_0x2c;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_front);
|
||||
/* 43B2C 8016DC2C */
|
||||
u8 obClassGetAbilityFront(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_front;
|
||||
|
||||
return obClassData[class].ability_front;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_front_hitcount);
|
||||
/* 43B80 8016DC80 */
|
||||
u8 obClassGetAbilityFrontHits(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_front_hitcount;
|
||||
|
||||
return obClassData[class].ability_front_hitcount;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_middle);
|
||||
/* 43BD4 8016DCD4 */
|
||||
u8 obClassGetAbilityMiddle(u8 portrait, u8 class) {
|
||||
s32 var_v0;
|
||||
|
||||
if (obClassData[portrait].field_0x45 != class) {
|
||||
var_v0 = class * 9;
|
||||
} else {
|
||||
var_v0 = obClassData[portrait].field_0x45 * 9;
|
||||
}
|
||||
return *(&obClassData->ability_middle + (var_v0 * 8));
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_middle_hitcount);
|
||||
/* 43C20 8016DD20 */
|
||||
u8 obClassGetAbilityMiddleHits(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_middle_hitcount;
|
||||
|
||||
return obClassData[class].ability_middle_hitcount;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_back);
|
||||
/* 43C74 8016DD74 */
|
||||
u8 obClassGetAbilityBack(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_back;
|
||||
|
||||
return obClassData[class].ability_back;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_back_hitcount);
|
||||
/* 43CC8 8016DDC8 */
|
||||
u8 obClassGetAbilityBackHits(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].ability_back_hitcount;
|
||||
|
||||
return obClassData[class].ability_back_hitcount;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_field_0x4);
|
||||
/* 43D1C 8016DE1C */
|
||||
u8 class_get_field_0x4(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].field_0x4;
|
||||
|
||||
return obClassData[class].field_0x4;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_gender);
|
||||
/* 43D70 8016DE70 */
|
||||
u8 obClassGetGender(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].gender;
|
||||
|
||||
return obClassData[class].gender;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_leadership_rank);
|
||||
/* 43DC4 8016DEC4 */
|
||||
u8 obClassGetLeadershipRank(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].leadership_rank;
|
||||
|
||||
return obClassData[class].leadership_rank;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_global_flag);
|
||||
/* 43E18 8016DF18 */
|
||||
u8 class_get_global_flag(u8 portrait, u8 class) {
|
||||
u8 var_a1;
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_item_upper_left);
|
||||
var_a1 = class;
|
||||
if (D_8018ECE4[portrait].field_0x0 & 0x80) {
|
||||
if (obClassData[portrait].field_0x45 == var_a1) {
|
||||
var_a1 = portrait;
|
||||
}
|
||||
}
|
||||
return D_8018ECE4[var_a1].field_0x0 & 0x3F;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_item_upper_right);
|
||||
/* 43E88 8016DF88 */
|
||||
EquipmentId obClassGetItemUpperLeft(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_upper_left;
|
||||
|
||||
return obClassData[class].item_upper_left;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_item_lower_left);
|
||||
/* 43EDC 8016DFDC */
|
||||
EquipmentId obClassGetItemUpperRight(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_upper_right;
|
||||
|
||||
return obClassData[class].item_upper_right;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_item_lower_right);
|
||||
/* 43F30 8016E030 */
|
||||
EquipmentId obClassGetItemLowerLeft(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_lower_left;
|
||||
|
||||
return obClassData[class].item_lower_left;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_front_name);
|
||||
/* 43F84 8016E084 */
|
||||
EquipmentId obClassGetItemLowerRight(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].item_lower_right;
|
||||
|
||||
return obClassData[class].item_lower_right;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_middle_name);
|
||||
/* 43FD8 8016E0D8 */
|
||||
char* obClassGetAbilityFrontName(u8 portrait, u8 class) {
|
||||
u8 var_v0;
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_back_name);
|
||||
if (obClassData[portrait].field_0x45 == class) {
|
||||
var_v0 = obClassData[portrait].ability_front;
|
||||
} else {
|
||||
var_v0 = obClassData[class].ability_front;
|
||||
}
|
||||
|
||||
return obAbilityGetName(var_v0);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_name);
|
||||
/* 44040 8016E140 */
|
||||
char* obClassGetAbilityMiddleName(u8 portrait, u8 class) {
|
||||
// Possible a C macro wrapping?
|
||||
do {
|
||||
char* ret = obAbilityGetName(obClassData[class].ability_middle);
|
||||
return ret;
|
||||
} while(0);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability);
|
||||
/* 44074 8016E174 */
|
||||
char* obClassGetAbilityBackName(u8 portrait, u8 class) {
|
||||
u8 var_v0;
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", class_get_ability_hitcount);
|
||||
if (obClassData[portrait].field_0x45 == class) {
|
||||
var_v0 = obClassData[portrait].ability_back;
|
||||
} else {
|
||||
var_v0 = obClassData[class].ability_back;
|
||||
}
|
||||
|
||||
return obAbilityGetName(var_v0);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obAbilityGetName);
|
||||
/* 440DC 8016E1DC */
|
||||
char* obClassGetName(u8 portrait, u8 class) {
|
||||
if (obClassData[portrait].field_0x45 == class)
|
||||
return obClassData[portrait].name;
|
||||
|
||||
return obClassData[class].name;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", ability_get_field_0x4);
|
||||
/* 44130 8016E230 */
|
||||
u8 obClassGetAbility(u8 portrait, u8 class, u8 row)
|
||||
{
|
||||
if (obClassData[portrait].field_0x45 != class)
|
||||
portrait = class;
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obAbilityGetElement);
|
||||
if (row == 0) {
|
||||
return obClassData[portrait].ability_front != 0xFF ? obClassData[portrait].ability_front : obClassData[class].ability_front;
|
||||
} else if (row == 1) {
|
||||
return obClassData[portrait].ability_middle != 0xFF ? obClassData[portrait].ability_middle : obClassData[class].ability_middle;
|
||||
} else {
|
||||
return obClassData[portrait].ability_back != 0xFF ? obClassData[portrait].ability_back : obClassData[class].ability_back;
|
||||
}
|
||||
}
|
||||
|
||||
/* 44238 8016E338 */
|
||||
u8 obClassGetAbilityHits(u8 portrait, u8 class, u8 row) {
|
||||
if (obClassData[portrait].field_0x45 != class)
|
||||
portrait = class;
|
||||
|
||||
if (row == 0) {
|
||||
return obClassData[portrait].ability_front_hitcount != 0xFF ? obClassData[portrait].ability_front_hitcount : obClassData[class].ability_front_hitcount;
|
||||
} else if (row == 1) {
|
||||
return obClassData[portrait].ability_middle_hitcount != 0xFF ? obClassData[portrait].ability_middle_hitcount : obClassData[class].ability_middle_hitcount;
|
||||
} else {
|
||||
return obClassData[portrait].ability_back_hitcount != 0xFF ? obClassData[portrait].ability_back_hitcount : obClassData[class].ability_back_hitcount;
|
||||
}
|
||||
}
|
||||
|
||||
/* 44340 8016E440 */
|
||||
char* obAbilityGetName(u8 index) {
|
||||
return obAbilityData[index].name;
|
||||
}
|
||||
|
||||
/* 44358 8016E458 */
|
||||
u8 ability_get_field_0x4(u8 index) {
|
||||
return obAbilityData[index].field_0x4;
|
||||
}
|
||||
|
||||
/* 44370 8016E470 */
|
||||
Element obAbilityGetElement(u8 index, u16 arg1, u16 arg2, s32 arg3, u16 arg4) {
|
||||
u16 item_index;
|
||||
|
||||
if (obAbilityData[index].element != ELEMENT_INVALID && obAbilityData[index].element != 0xF)
|
||||
return obAbilityData[index].element;
|
||||
|
||||
if (obAbilityData[index].field_0x4 == 3) {
|
||||
item_index = obEquipmentGetFirstSpellbook(arg1, arg2, arg3, arg4);
|
||||
} else {
|
||||
item_index = obEquipmentGetFirstWeapon(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
if (item_index == 0)
|
||||
return ELEMENT_PHYSICAL;
|
||||
|
||||
return obEquipmentGetElement(item_index);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016E50C);
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016EA34);
|
||||
/* 44934 8016EA34 */
|
||||
u8 func_8016EA34(u8 portrait, u8 class, u8 arg2)
|
||||
{
|
||||
if (obClassData[portrait].field_0x45 != class)
|
||||
portrait = class;
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", character_get_item);
|
||||
portrait = (obClassData[portrait].field_0x42 != 0xFF && arg2 < obClassData[portrait].field_0x42) ?
|
||||
obClassData[portrait].field_0x41 :
|
||||
(obClassData[portrait].field_0x44 != 0xFF && arg2 < obClassData[portrait].field_0x44) ?
|
||||
obClassData[portrait].field_0x43 : portrait;
|
||||
|
||||
return portrait;
|
||||
}
|
||||
|
||||
/* 449EC 8016EAEC */
|
||||
u16 character_get_item(CharacterSlot* character, u8 slot) {
|
||||
u16 item_id;
|
||||
|
||||
item_id = 0;
|
||||
switch(slot) {
|
||||
case 0:
|
||||
item_id = character->item_upper_left;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
item_id = character->item_upper_right;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
item_id = character->item_lower_left;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
item_id = character->item_lower_right;
|
||||
break;
|
||||
}
|
||||
|
||||
if (item_id == 0) {
|
||||
item_id = FP_CLASS_GET_ITEM_1[slot](character->portrait, character->class);
|
||||
}
|
||||
return item_id;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", __character_handle_levelup);
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", __character_initialise);
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obItemGetName);
|
||||
/* 453E0 8016F4E0 */
|
||||
char *obItemGetName(u16 arg0) {
|
||||
return obItemData[arg0].name;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", item_get_field_0x4);
|
||||
/* 45400 8016F500 */
|
||||
u8 item_get_field_0x4(u16 arg0) {
|
||||
return obItemData[arg0].field_0x4;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", item_get_field_0x5);
|
||||
/* 45420 8016F520 */
|
||||
u8 item_get_field_0x5(u16 arg0) {
|
||||
return obItemData[arg0].field_0x5;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", item_get_field_0x8);
|
||||
/* 45440 8016F540 */
|
||||
u8 item_get_field_0x8(u16 arg0) {
|
||||
return obItemData[arg0].field_0x8;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", item_get_field_0x9);
|
||||
/* 45460 8016F560 */
|
||||
u8 item_get_field_0x9(u16 arg0) {
|
||||
return obItemData[arg0].field_0x9;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x1b);
|
||||
/* 45480 8016F580 */
|
||||
u8 equipment_get_field_0x1b(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x1b;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x1c);
|
||||
/* 45498 8016F598 */
|
||||
u8 equipment_get_field_0x1c(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x1c;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetName);
|
||||
/* 454B0 8016F5B0 */
|
||||
char* obEquipmentGetName(EquipmentId index) {
|
||||
return obEquipmentData[index].name;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetType);
|
||||
/* 454C8 8016F5C8 */
|
||||
EquipmentType obEquipmentGetType(EquipmentId index) {
|
||||
return obEquipmentData[index].type;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetElement);
|
||||
/* 454E0 8016F5E0 */
|
||||
Element obEquipmentGetElement(EquipmentId index) {
|
||||
Element element;
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x6);
|
||||
element = obEquipmentData[index].element;
|
||||
if (element == ELEMENT_UNKNOWN_0x10) {
|
||||
element = CHARACTER_SLOT[0].element;
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetBuyPrice);
|
||||
/* 45514 8016F614 */
|
||||
u8 equipment_get_field_0x6(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x6;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x10);
|
||||
/* 4552C 8016F62C */
|
||||
u16 obEquipmentGetBuyPrice(EquipmentId index) {
|
||||
return obEquipmentData[index].buy_price;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetStrength);
|
||||
/* 45544 8016F644 */
|
||||
s8 equipment_get_field_0x10(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x10;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetVitality);
|
||||
/* 4555C 8016F65C */
|
||||
s8 obEquipmentGetStrength(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].strength / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].strength;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetIntelligence);
|
||||
/* 455AC 8016F6AC */
|
||||
s8 obEquipmentGetVitality(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].vitality / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].vitality;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetMentality);
|
||||
/* 455FC 8016F6FC */
|
||||
s8 obEquipmentGetIntelligence(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].intelligence / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].intelligence;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetAgility);
|
||||
/* 4564C 8016F74C */
|
||||
s8 obEquipmentGetMentality(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].mentality / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].mentality;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetDexterity);
|
||||
/* 4569C 8016F79C */
|
||||
s8 obEquipmentGetAgility(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].agility / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].agility;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceStrike);
|
||||
/* 456EC 8016F7EC */
|
||||
s8 obEquipmentGetDexterity(EquipmentId index) {
|
||||
s8 ret;
|
||||
if (index == EQUIPMENT_ID_GALLANT_DOLL) {
|
||||
ret = CHARACTER_SLOT[0].dexterity / 20;
|
||||
} else {
|
||||
ret = obEquipmentData[index].dexterity;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceWind);
|
||||
/* 4573C 8016F83C */
|
||||
s8 obEquipmentGetResistanceStrike(EquipmentId index) {
|
||||
return obEquipmentData[index].res_strike;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceFire);
|
||||
/* 45754 8016F854 */
|
||||
s8 obEquipmentGetResistanceWind(EquipmentId index) {
|
||||
return obEquipmentData[index].res_wind;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceEarth);
|
||||
/* 4576C 8016F86C */
|
||||
s8 obEquipmentGetResistanceFire(EquipmentId index) {
|
||||
return obEquipmentData[index].res_fire;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceWater);
|
||||
/* 45784 8016F884 */
|
||||
s8 obEquipmentGetResistanceEarth(EquipmentId index) {
|
||||
return obEquipmentData[index].res_earth;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceVirtue);
|
||||
/* 4579C 8016F89C */
|
||||
s8 obEquipmentGetResistanceWater(EquipmentId index) {
|
||||
return obEquipmentData[index].res_water;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetResistanceBane);
|
||||
/* 457B4 8016F8B4 */
|
||||
s8 obEquipmentGetResistanceVirtue(EquipmentId index) {
|
||||
return obEquipmentData[index].res_holy;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x18_b68);
|
||||
/* 457CC 8016F8CC */
|
||||
s8 obEquipmentGetResistanceBane(EquipmentId index) {
|
||||
return obEquipmentData[index].res_dark;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x18_b46);
|
||||
/* 457E4 8016F8E4 */
|
||||
u8 equipment_get_field_0x18_b68(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x18 >> 6;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x18_b24);
|
||||
/* 45800 8016F900 */
|
||||
u8 equipment_get_field_0x18_b46(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x18 >> 4) & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x18_b12);
|
||||
/* 45820 8016F920 */
|
||||
u8 equipment_get_field_0x18_b24(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x18 >> 2) & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x19_b68);
|
||||
/* 45840 8016F940 */
|
||||
u8 equipment_get_field_0x18_b12(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x18 & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x19_b46);
|
||||
/* 4585C 8016F95C */
|
||||
u8 equipment_get_field_0x19_b68(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x19 >> 6;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x19_b24);
|
||||
/* 45878 8016F978 */
|
||||
u8 equipment_get_field_0x19_b46(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x19 >> 4) & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x19_b12);
|
||||
/* 45898 8016F998 */
|
||||
u8 equipment_get_field_0x19_b24(EquipmentId index) {
|
||||
return (obEquipmentData[index].field_0x19 >> 2) & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", equipment_get_field_0x1a_b7);
|
||||
/* 458B8 8016F9B8 */
|
||||
u8 equipment_get_field_0x19_b12(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x19 & 3;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentIsWeapon);
|
||||
/* 458D4 8016F9D4 */
|
||||
u8 equipment_get_field_0x1a_b7(EquipmentId index) {
|
||||
return obEquipmentData[index].field_0x1a >> 7;
|
||||
}
|
||||
|
||||
/* 458F0 8016F9F0 */
|
||||
bool obEquipmentIsWeapon(EquipmentId index) {
|
||||
s32 type = obEquipmentData[index].type;
|
||||
|
||||
if (type != 0) {
|
||||
if (type < EQUIPMENT_TYPE_SMALL_SHIELD) {
|
||||
return true;
|
||||
}
|
||||
if (type == EQUIPMENT_TYPE_FAN) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetFirstWeapon);
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", obEquipmentGetFirstSpellbook);
|
||||
/* 45A50 8016FB50 */
|
||||
EquipmentId obEquipmentGetFirstSpellbook(EquipmentId arg0, EquipmentId arg1, EquipmentId arg2, EquipmentId arg3) {
|
||||
if (obEquipmentData[arg0].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg0;
|
||||
|
||||
if (obEquipmentData[arg1].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg1;
|
||||
|
||||
if (obEquipmentData[arg2].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg2;
|
||||
|
||||
if (obEquipmentData[arg3].type == EQUIPMENT_TYPE_SPELLBOOK)
|
||||
return arg3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(const s32, "segment_obdata/_ob_fierce_selection", func_8016FBE0);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue