mirror of
https://github.com/zeldaret/tp
synced 2026-07-05 05:39:43 -04:00
various fixes / matches (#2052)
* some fixes in d/s, d_item, d_shop * fix for dKankyo_DayProc weak generation * d_cc_uty fix * some d_name / d_com_inf_game / f_op_actor_mng matches * fix some player inline virtuals * remove asm
This commit is contained in:
+162
-232
@@ -1,47 +1,16 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/cc/d_cc_uty
|
||||
//
|
||||
/**
|
||||
* d_cc_uty.cpp
|
||||
* Collider Utilties
|
||||
*/
|
||||
|
||||
#include "d/cc/d_cc_uty.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "Z2AudioLib/Z2Creature.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/d_procname.h"
|
||||
#include "d/s/d_s_play.h"
|
||||
#include "dol2asm.h"
|
||||
#include "f_op/f_op_actor_mng.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void pl_cut_LRC__Fi();
|
||||
extern "C" void cc_pl_cut_bit_get__Fv();
|
||||
extern "C" static void getMapInfo__FSc();
|
||||
extern "C" static void getHitId__FP8cCcD_Obji();
|
||||
extern "C" void def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c();
|
||||
extern "C" static void at_power_get__FP11dCcU_AtInfo();
|
||||
extern "C" void at_power_check__FP11dCcU_AtInfo();
|
||||
extern "C" void cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo();
|
||||
extern "C" bool checkCutJumpCancelTurn__9daPy_py_cCFv();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void getHitSeID__12dCcD_GObjInfFUci();
|
||||
extern "C" void dCcD_GetGObjInf__FP8cCcD_Obj();
|
||||
extern "C" void checkMasterSwordEquip__9daPy_py_cFv();
|
||||
extern "C" void GetAc__8cCcD_ObjFv();
|
||||
extern "C" void cM_atan2s__Fff();
|
||||
extern "C" void cM_rndFX__Ff();
|
||||
extern "C" void _savegpr_25();
|
||||
extern "C" void _restgpr_25();
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
bool daPy_py_c::checkWoodSwordEquip() {
|
||||
return dComIfGs_getSelectEquipSword() == WOOD_STICK;
|
||||
}
|
||||
@@ -50,9 +19,8 @@ BOOL daPy_py_c::checkNowWolf() {
|
||||
return dComIfGp_getLinkPlayer()->i_checkWolf();
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803AC418-803AC500 009538 00E8+00 1/1 0/0 0/0 .data plCutLRC */
|
||||
SECTION_DATA static int plCutLRC[58] = {
|
||||
static int plCutLRC[58] = {
|
||||
0, //
|
||||
0, // CUT_VERTICAL
|
||||
1, // CUT_STAB
|
||||
@@ -124,33 +92,35 @@ int pl_cut_LRC(int index) {
|
||||
|
||||
/* 800873D4-800874C4 081D14 00F0+00 1/1 0/0 14/14 .text cc_pl_cut_bit_get__Fv */
|
||||
u16 cc_pl_cut_bit_get() {
|
||||
daPy_py_c* link = (daPy_py_c*)dComIfGp_getPlayer(0);
|
||||
daPy_py_c* player_p = (daPy_py_c*)dComIfGp_getPlayer(0);
|
||||
|
||||
u16 bit = 0;
|
||||
if (link->getCutType() == daPy_py_c::CUT_TYPE_NM_VERTICAL) {
|
||||
if (player_p->getCutType() == daPy_py_c::CUT_TYPE_NM_VERTICAL) {
|
||||
bit = 0x1;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_NM_STAB) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_NM_STAB) {
|
||||
bit = 0x2;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_COMBO_STAB) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_COMBO_STAB) {
|
||||
bit = 0x200;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_NM_RIGHT) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_NM_RIGHT) {
|
||||
bit = 0x4;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_NM_LEFT) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_NM_LEFT) {
|
||||
bit = 0x8;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_FINISH_LEFT) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_FINISH_LEFT) {
|
||||
bit = 0x20;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_FINISH_VERTICAL) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_FINISH_VERTICAL) {
|
||||
bit = 0x40;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_TURN_RIGHT || link->getCutType() == 9 ||
|
||||
link->getCutType() == 43 ||
|
||||
link->getCutType() == daPy_py_c::CUT_TYPE_LARGE_TURN_RIGHT) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_TURN_RIGHT ||
|
||||
player_p->getCutType() == 9 || player_p->getCutType() == 43 ||
|
||||
player_p->getCutType() == daPy_py_c::CUT_TYPE_LARGE_TURN_RIGHT)
|
||||
{
|
||||
bit = 0x80;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_TURN_LEFT ||
|
||||
link->getCutType() == daPy_py_c::CUT_TYPE_LARGE_TURN_LEFT) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_TURN_LEFT ||
|
||||
player_p->getCutType() == daPy_py_c::CUT_TYPE_LARGE_TURN_LEFT)
|
||||
{
|
||||
bit = 0x800;
|
||||
} else if (link->getCutType() == daPy_py_c::CUT_TYPE_JUMP) {
|
||||
} else if (player_p->getCutType() == daPy_py_c::CUT_TYPE_JUMP) {
|
||||
bit = 0x100;
|
||||
} else if (link->getCutType() == 40 || link->getCutType() == 41) {
|
||||
} else if (player_p->getCutType() == 40 || player_p->getCutType() == 41) {
|
||||
bit = 0x400;
|
||||
}
|
||||
|
||||
@@ -170,31 +140,31 @@ static int getMapInfo(s8 param_0) {
|
||||
}
|
||||
|
||||
/* 800874F0-80087514 081E30 0024+00 2/2 0/0 0/0 .text getHitId__FP8cCcD_Obji */
|
||||
static u32 getHitId(cCcD_Obj* p_obj, int useReboundSE) {
|
||||
dCcD_GObjInf* dObj = static_cast<dCcD_GObjInf*>(p_obj);
|
||||
return dObj->getHitSeID(dObj->GetAtSe(), useReboundSE);
|
||||
static u32 getHitId(cCcD_Obj* i_ccObj, int i_useReboundSe) {
|
||||
dCcD_GObjInf* dObj = static_cast<dCcD_GObjInf*>(i_ccObj);
|
||||
return dObj->getHitSeID(dObj->GetAtSe(), i_useReboundSe);
|
||||
}
|
||||
|
||||
/* 80087514-80087594 081E54 0080+00 0/0 0/0 47/47 .text
|
||||
* def_se_set__FP10Z2CreatureP8cCcD_ObjUlP10fopAc_ac_c */
|
||||
void def_se_set(Z2Creature* p_sound, cCcD_Obj* p_collider, u32 map_info, fopAc_ac_c* p_actor) {
|
||||
if (p_sound != NULL) {
|
||||
int useReboundSE;
|
||||
if (p_actor != NULL && fopAcM_checkStatus(p_actor, 0x280000)) {
|
||||
useReboundSE = false;
|
||||
void def_se_set(Z2Creature* i_sound, cCcD_Obj* i_ccObj, u32 i_mapInfo, fopAc_ac_c* i_actor) {
|
||||
if (i_sound != NULL) {
|
||||
int useReboundSe;
|
||||
if (i_actor != NULL && fopAcM_checkStatus(i_actor, 0x280000)) {
|
||||
useReboundSe = false;
|
||||
} else {
|
||||
useReboundSE = true;
|
||||
useReboundSe = true;
|
||||
}
|
||||
p_sound->startCollisionSE(getHitId(p_collider, useReboundSE), map_info);
|
||||
i_sound->startCollisionSE(getHitId(i_ccObj, useReboundSe), i_mapInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/* 80087594-80087A58 081ED4 04C4+00 1/1 0/0 0/0 .text at_power_get__FP11dCcU_AtInfo */
|
||||
static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
u8 power = p_info->mpCollider->GetAtAtp();
|
||||
static u8 at_power_get(dCcU_AtInfo* i_AtInfo) {
|
||||
u8 power = i_AtInfo->mpCollider->GetAtAtp();
|
||||
|
||||
if (p_info->mPowerType == 0) {
|
||||
if (p_info->mpCollider->ChkAtType(0x10000000)) {
|
||||
if (i_AtInfo->mPowerType == 0) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(0x10000000)) {
|
||||
power = 0;
|
||||
} else if (power == 1) {
|
||||
power = 1;
|
||||
@@ -207,8 +177,8 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 4) {
|
||||
power = 200;
|
||||
}
|
||||
} else if (p_info->mPowerType == 6) {
|
||||
if (p_info->mpCollider->ChkAtType(0x10000000)) {
|
||||
} else if (i_AtInfo->mPowerType == 6) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(0x10000000)) {
|
||||
power = 0;
|
||||
} else if (power == 1) {
|
||||
power = 1;
|
||||
@@ -219,10 +189,10 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 3) {
|
||||
power *= 10;
|
||||
}
|
||||
} else if (p_info->mPowerType == 4) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
} else if (i_AtInfo->mPowerType == 4) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
power = 200;
|
||||
} else if (p_info->mpCollider->ChkAtType(0x10000000)) {
|
||||
} else if (i_AtInfo->mpCollider->ChkAtType(0x10000000)) {
|
||||
power = 0;
|
||||
} else if (power == 1) {
|
||||
power = 1;
|
||||
@@ -235,8 +205,8 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 4) {
|
||||
power = 200;
|
||||
}
|
||||
} else if (p_info->mPowerType == 5) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_ARROW)) {
|
||||
} else if (i_AtInfo->mPowerType == 5) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_ARROW)) {
|
||||
power = 0;
|
||||
} else if (power == 1) {
|
||||
power = 1;
|
||||
@@ -245,8 +215,8 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 3) {
|
||||
power = 4;
|
||||
}
|
||||
} else if (p_info->mPowerType == 2) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
} else if (i_AtInfo->mPowerType == 2) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
power = 200;
|
||||
} else if (power == 1) {
|
||||
power = 1;
|
||||
@@ -259,14 +229,14 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 4) {
|
||||
power = 200;
|
||||
}
|
||||
} else if (p_info->mPowerType == 1) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_IRON_BALL) || power >= 4) {
|
||||
} else if (i_AtInfo->mPowerType == 1) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_IRON_BALL) || power >= 4) {
|
||||
power = 200;
|
||||
} else {
|
||||
power *= 10;
|
||||
}
|
||||
} else if (p_info->mPowerType == 3) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_IRON_BALL) || power >= 4) {
|
||||
} else if (i_AtInfo->mPowerType == 3) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_IRON_BALL) || power >= 4) {
|
||||
power = 200;
|
||||
} else if (power == 1) {
|
||||
power = 10;
|
||||
@@ -275,10 +245,10 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 3) {
|
||||
power = 40;
|
||||
}
|
||||
} else if (p_info->mPowerType == 7) {
|
||||
if (p_info->mpCollider->ChkAtType(0x420008)) {
|
||||
} else if (i_AtInfo->mPowerType == 7) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(0x420008)) {
|
||||
power = 50;
|
||||
} else if (p_info->mpCollider->ChkAtType(AT_TYPE_ARROW)) {
|
||||
} else if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_ARROW)) {
|
||||
power = 27;
|
||||
} else if (power == 1) {
|
||||
power = 1;
|
||||
@@ -291,7 +261,7 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 4) {
|
||||
power = 200;
|
||||
}
|
||||
} else if (p_info->mPowerType == 8) {
|
||||
} else if (i_AtInfo->mPowerType == 8) {
|
||||
if (power == 1) {
|
||||
power = 3;
|
||||
} else if (power == 2) {
|
||||
@@ -301,11 +271,11 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 3) {
|
||||
power *= 10;
|
||||
}
|
||||
} else if (p_info->mPowerType == 9 || p_info->mPowerType == 10) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
} else if (i_AtInfo->mPowerType == 9 || i_AtInfo->mPowerType == 10) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
power = 0;
|
||||
}
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
power = 19;
|
||||
}
|
||||
|
||||
@@ -320,8 +290,8 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 4) {
|
||||
power = 200;
|
||||
}
|
||||
} else if (p_info->mPowerType == 11) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
} else if (i_AtInfo->mPowerType == 11) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
power = 0;
|
||||
}
|
||||
|
||||
@@ -334,7 +304,7 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
} else if (power >= 4) {
|
||||
power = 100;
|
||||
}
|
||||
} else if (p_info->mPowerType == 12) {
|
||||
} else if (i_AtInfo->mPowerType == 12) {
|
||||
if (power == 1) {
|
||||
power = 10;
|
||||
} else if (power == 2) {
|
||||
@@ -351,237 +321,197 @@ static u8 at_power_get(dCcU_AtInfo* p_info) {
|
||||
|
||||
/* 80087A58-80087C04 082398 01AC+00 1/1 0/0 38/38 .text at_power_check__FP11dCcU_AtInfo
|
||||
*/
|
||||
fopAc_ac_c* at_power_check(dCcU_AtInfo* p_info) {
|
||||
if (p_info->mpCollider == NULL) {
|
||||
fopAc_ac_c* at_power_check(dCcU_AtInfo* i_AtInfo) {
|
||||
if (i_AtInfo->mpCollider == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p_info->mpActor = p_info->mpCollider->GetAc();
|
||||
p_info->mHitType = 12;
|
||||
p_info->mAttackPower = 0;
|
||||
p_info->mHitBit = 0;
|
||||
i_AtInfo->mpActor = i_AtInfo->mpCollider->GetAc();
|
||||
i_AtInfo->mHitType = 12;
|
||||
i_AtInfo->mAttackPower = 0;
|
||||
i_AtInfo->mHitBit = 0;
|
||||
|
||||
if (p_info->mpActor != NULL) {
|
||||
p_info->mAttackPower = at_power_get(p_info);
|
||||
if (i_AtInfo->mpActor != NULL) {
|
||||
i_AtInfo->mAttackPower = at_power_get(i_AtInfo);
|
||||
|
||||
s16 ac_name = fopAcM_GetName(p_info->mpActor);
|
||||
s16 ac_name = fopAcM_GetName(i_AtInfo->mpActor);
|
||||
if (ac_name == PROC_ALINK || ac_name == PROC_ALINK) {
|
||||
if (p_info->mpCollider->ChkAtType(0x8000) ||
|
||||
p_info->mpCollider->ChkAtType(AT_TYPE_IRON_BALL)) {
|
||||
p_info->mHitType = HIT_TYPE_LINK_HEAVY_ATTACK;
|
||||
if (i_AtInfo->mpCollider->ChkAtType(0x8000) ||
|
||||
i_AtInfo->mpCollider->ChkAtType(AT_TYPE_IRON_BALL))
|
||||
{
|
||||
i_AtInfo->mHitType = HIT_TYPE_LINK_HEAVY_ATTACK;
|
||||
} else {
|
||||
p_info->mHitType = HIT_TYPE_LINK_NORMAL_ATTACK;
|
||||
p_info->mHitBit = cc_pl_cut_bit_get();
|
||||
i_AtInfo->mHitType = HIT_TYPE_LINK_NORMAL_ATTACK;
|
||||
i_AtInfo->mHitBit = cc_pl_cut_bit_get();
|
||||
}
|
||||
} else if (ac_name == PROC_NBOMB) {
|
||||
p_info->mHitType = HIT_TYPE_BOMB;
|
||||
p_info->mHitBit = 0x10000000;
|
||||
i_AtInfo->mHitType = HIT_TYPE_BOMB;
|
||||
i_AtInfo->mHitBit = 0x10000000;
|
||||
} else if (ac_name == PROC_BOOMERANG) {
|
||||
p_info->mHitType = HIT_TYPE_BOOMERANG;
|
||||
p_info->mHitBit = 0x40000000;
|
||||
i_AtInfo->mHitType = HIT_TYPE_BOOMERANG;
|
||||
i_AtInfo->mHitBit = 0x40000000;
|
||||
} else if (ac_name == PROC_ARROW) {
|
||||
p_info->mHitType = HIT_TYPE_ARROW;
|
||||
p_info->mHitBit = 0x80000000;
|
||||
i_AtInfo->mHitType = HIT_TYPE_ARROW;
|
||||
i_AtInfo->mHitBit = 0x80000000;
|
||||
}
|
||||
}
|
||||
|
||||
p_info->mHitStatus = 0;
|
||||
if (p_info->mpCollider->ChkAtType(0x40) || p_info->mpCollider->ChkAtType(AT_TYPE_BOOMERANG) ||
|
||||
p_info->mpCollider->ChkAtType(AT_TYPE_SLINGSHOT) ||
|
||||
p_info->mpCollider->ChkAtType(AT_TYPE_SHIELD_ATTACK)) {
|
||||
p_info->mHitType = HIT_TYPE_STUN;
|
||||
} else if (p_info->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
p_info->mHitBit = 0x1000;
|
||||
i_AtInfo->mHitStatus = 0;
|
||||
if (i_AtInfo->mpCollider->ChkAtType(0x40) ||
|
||||
i_AtInfo->mpCollider->ChkAtType(AT_TYPE_BOOMERANG) ||
|
||||
i_AtInfo->mpCollider->ChkAtType(AT_TYPE_SLINGSHOT) ||
|
||||
i_AtInfo->mpCollider->ChkAtType(AT_TYPE_SHIELD_ATTACK))
|
||||
{
|
||||
i_AtInfo->mHitType = HIT_TYPE_STUN;
|
||||
} else if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT)) {
|
||||
i_AtInfo->mHitBit = 0x1000;
|
||||
} else {
|
||||
s16 ac_name = fopAcM_GetName(p_info->mpActor);
|
||||
s16 ac_name = fopAcM_GetName(i_AtInfo->mpActor);
|
||||
if (ac_name == PROC_ALINK || ac_name == PROC_ALINK) {
|
||||
if (dCcD_GetGObjInf(p_info->mpCollider)->GetAtSpl() == 1) {
|
||||
p_info->mHitStatus = 1;
|
||||
if (dCcD_GetGObjInf(i_AtInfo->mpCollider)->GetAtSpl() == 1) {
|
||||
i_AtInfo->mHitStatus = 1;
|
||||
}
|
||||
} else if (p_info->mAttackPower >= 3) {
|
||||
p_info->mHitStatus = 1;
|
||||
} else if (i_AtInfo->mAttackPower >= 3) {
|
||||
i_AtInfo->mHitStatus = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return p_info->mpActor;
|
||||
return i_AtInfo->mpActor;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80452798-804527A0 000D98 0004+04 1/1 0/0 0/0 .sdata2 @4212 */
|
||||
SECTION_SDATA2 static f32 lit_4212[1 + 1 /* padding */] = {
|
||||
0.0f,
|
||||
/* padding */
|
||||
0.0f,
|
||||
};
|
||||
|
||||
/* 804527A0-804527A8 000DA0 0008+00 1/1 0/0 0/0 .sdata2 @4213 */
|
||||
SECTION_SDATA2 static f64 lit_4213 = 0.5;
|
||||
|
||||
/* 804527A8-804527B0 000DA8 0008+00 1/1 0/0 0/0 .sdata2 @4214 */
|
||||
SECTION_SDATA2 static f64 lit_4214 = 3.0;
|
||||
|
||||
/* 804527B0-804527B8 000DB0 0008+00 1/1 0/0 0/0 .sdata2 @4215 */
|
||||
SECTION_SDATA2 static u8 lit_4215[8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
|
||||
/* 804527B8-804527BC 000DB8 0004+00 1/1 0/0 0/0 .sdata2 @4216 */
|
||||
SECTION_SDATA2 static f32 lit_4216 = 100.0f;
|
||||
|
||||
/* 804527BC-804527C0 000DBC 0004+00 1/1 0/0 0/0 .sdata2 @4217 */
|
||||
SECTION_SDATA2 static f32 lit_4217 = 4000.0f;
|
||||
|
||||
/* 804527C0-804527C8 000DC0 0004+04 1/1 0/0 0/0 .sdata2 @4218 */
|
||||
SECTION_SDATA2 static f32 lit_4218[1 + 1 /* padding */] = {
|
||||
10000.0f,
|
||||
/* padding */
|
||||
0.0f,
|
||||
};
|
||||
|
||||
/* 80087C04-80088134 082544 0530+00 0/0 0/0 84/84 .text cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo
|
||||
*/
|
||||
// data padding issues (?)
|
||||
#ifdef NONMATCHING
|
||||
fopAc_ac_c* cc_at_check(fopAc_ac_c* p_enemy, dCcU_AtInfo* p_info) {
|
||||
daPy_py_c* link = (daPy_py_c*)dComIfGp_getPlayer(0);
|
||||
p_info->mpActor = at_power_check(p_info);
|
||||
fopAc_ac_c* cc_at_check(fopAc_ac_c* i_enemy, dCcU_AtInfo* i_AtInfo) {
|
||||
daPy_py_c* player_p = (daPy_py_c*)dComIfGp_getPlayer(0);
|
||||
i_AtInfo->mpActor = at_power_check(i_AtInfo);
|
||||
|
||||
f32 x_diff;
|
||||
f32 z_diff;
|
||||
if (p_info->mpActor != NULL) {
|
||||
cXyz tmp = p_info->mpActor->speed;
|
||||
if (i_AtInfo->mpActor != NULL) {
|
||||
cXyz tmp = i_AtInfo->mpActor->speed;
|
||||
tmp.y = 0.0f;
|
||||
if (tmp.abs() > 100.0f) {
|
||||
f32 x = p_info->mpActor->speed.x;
|
||||
f32 z = p_info->mpActor->speed.z;
|
||||
p_info->mHitDirection = cM_atan2s(-x, -z) + (s16)cM_rndFX(4000.0f);
|
||||
f32 x = i_AtInfo->mpActor->speed.x;
|
||||
f32 z = i_AtInfo->mpActor->speed.z;
|
||||
i_AtInfo->mHitDirection = cM_atan2s(-x, -z) + (s16)cM_rndFX(4000.0f);
|
||||
} else {
|
||||
if (fopAcM_GetName(p_info->mpActor) == PROC_BOOMERANG) {
|
||||
x_diff = p_enemy->current.pos.x - link->current.pos.x;
|
||||
z_diff = p_enemy->current.pos.z - link->current.pos.z;
|
||||
p_info->mHitDirection = cM_atan2s(-x_diff, -z_diff) + (s16)cM_rndFX(10000.0f);
|
||||
if (fopAcM_GetName(i_AtInfo->mpActor) == PROC_BOOMERANG) {
|
||||
x_diff = i_enemy->current.pos.x - player_p->current.pos.x;
|
||||
z_diff = i_enemy->current.pos.z - player_p->current.pos.z;
|
||||
i_AtInfo->mHitDirection = cM_atan2s(-x_diff, -z_diff) + (s16)cM_rndFX(10000.0f);
|
||||
} else {
|
||||
x_diff = p_enemy->current.pos.x - p_info->mpActor->current.pos.x;
|
||||
z_diff = p_enemy->current.pos.z - p_info->mpActor->current.pos.z;
|
||||
p_info->mHitDirection = cM_atan2s(-x_diff, -z_diff);
|
||||
x_diff = i_enemy->current.pos.x - i_AtInfo->mpActor->current.pos.x;
|
||||
z_diff = i_enemy->current.pos.z - i_AtInfo->mpActor->current.pos.z;
|
||||
i_AtInfo->mHitDirection = cM_atan2s(-x_diff, -z_diff);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_info->mHitType == HIT_TYPE_LINK_NORMAL_ATTACK &&
|
||||
link->getCutType() == daPy_py_c::CUT_TYPE_HEAD_JUMP) {
|
||||
p_info->mHitDirection = link->shape_angle.y;
|
||||
if (i_AtInfo->mHitType == HIT_TYPE_LINK_NORMAL_ATTACK &&
|
||||
player_p->getCutType() == daPy_py_c::CUT_TYPE_HEAD_JUMP)
|
||||
{
|
||||
i_AtInfo->mHitDirection = player_p->shape_angle.y;
|
||||
}
|
||||
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) &&
|
||||
fopAcM_checkStatus(p_enemy, 0x380000)) {
|
||||
p_info->mAttackPower = 0;
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) &&
|
||||
fopAcM_checkStatus(i_enemy, 0x380000))
|
||||
{
|
||||
i_AtInfo->mAttackPower = 0;
|
||||
}
|
||||
|
||||
if (static_cast<dCcD_GObjInf*>(p_info->mpCollider)->GetAtMtrl() == 4) {
|
||||
if (fopAcM_GetName(p_enemy) == PROC_B_GND) {
|
||||
p_info->mAttackPower = 0;
|
||||
} else if (fopAcM_GetName(p_enemy) != PROC_B_ZANT) {
|
||||
p_info->mAttackPower = 100;
|
||||
if (static_cast<dCcD_GObjInf*>(i_AtInfo->mpCollider)->GetAtMtrl() == 4) {
|
||||
if (fopAcM_GetName(i_enemy) == PROC_B_GND) {
|
||||
i_AtInfo->mAttackPower = 0;
|
||||
} else if (fopAcM_GetName(i_enemy) != PROC_B_ZANT) {
|
||||
i_AtInfo->mAttackPower = 100;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_info->mHitType == HIT_TYPE_LINK_NORMAL_ATTACK) {
|
||||
if (i_AtInfo->mHitType == HIT_TYPE_LINK_NORMAL_ATTACK) {
|
||||
if (!daPy_py_c::checkNowWolf()) {
|
||||
if (link->checkMasterSwordEquip()) {
|
||||
p_info->mAttackPower *= 2;
|
||||
if (player_p->checkMasterSwordEquip()) {
|
||||
i_AtInfo->mAttackPower *= 2;
|
||||
}
|
||||
|
||||
if (daPy_py_c::checkWoodSwordEquip()) {
|
||||
p_info->mAttackPower /= 2;
|
||||
i_AtInfo->mAttackPower /= 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (link->getSwordAtUpTime()) {
|
||||
p_info->mAttackPower *= 2;
|
||||
p_info->mHitStatus = 1;
|
||||
if (player_p->getSwordAtUpTime()) {
|
||||
i_AtInfo->mAttackPower *= 2;
|
||||
i_AtInfo->mHitStatus = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_info->mAttackPower != 0) {
|
||||
p_enemy->mHealth -= p_info->mAttackPower;
|
||||
if (i_AtInfo->mAttackPower != 0) {
|
||||
i_enemy->mHealth -= i_AtInfo->mAttackPower;
|
||||
}
|
||||
|
||||
s8 pause_time = 0;
|
||||
if (p_info->mAttackPower != 0 && p_enemy->mHealth <= 0) {
|
||||
p_info->mHitStatus = 2;
|
||||
p_enemy->mHealth = 0;
|
||||
if (i_AtInfo->mAttackPower != 0 && i_enemy->mHealth <= 0) {
|
||||
i_AtInfo->mHitStatus = 2;
|
||||
i_enemy->mHealth = 0;
|
||||
}
|
||||
|
||||
int uvar8;
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) &&
|
||||
!fopAcM_checkStatus(p_enemy, 0x280000)) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_HOOKSHOT) &&
|
||||
!fopAcM_checkStatus(i_enemy, 0x280000))
|
||||
{
|
||||
uvar8 = 1;
|
||||
} else {
|
||||
uvar8 = 0;
|
||||
}
|
||||
|
||||
if (p_info->mpSound != NULL) {
|
||||
if (p_info->field_0x18 != 0) {
|
||||
p_info->mpSound->startCollisionSE(getHitId(p_info->mpCollider, uvar8),
|
||||
p_info->field_0x18);
|
||||
if (i_AtInfo->mpSound != NULL) {
|
||||
if (i_AtInfo->field_0x18 != 0) {
|
||||
i_AtInfo->mpSound->startCollisionSE(getHitId(i_AtInfo->mpCollider, uvar8),
|
||||
i_AtInfo->field_0x18);
|
||||
} else {
|
||||
p_info->mpSound->startCollisionSE(getHitId(p_info->mpCollider, uvar8),
|
||||
getMapInfo(p_info->mHitStatus));
|
||||
i_AtInfo->mpSound->startCollisionSE(getHitId(i_AtInfo->mpCollider, uvar8),
|
||||
getMapInfo(i_AtInfo->mHitStatus));
|
||||
}
|
||||
}
|
||||
|
||||
if (p_info->mHitStatus != 0) {
|
||||
if (i_AtInfo->mHitStatus != 0) {
|
||||
pause_time = 5;
|
||||
} else {
|
||||
if (p_info->mAttackPower > 1) {
|
||||
if (i_AtInfo->mAttackPower > 1) {
|
||||
pause_time = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_MIDNA_LOCK) ||
|
||||
((daPy_py_c*)dComIfGp_getPlayer(0))->checkHorseRide()) {
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_MIDNA_LOCK) ||
|
||||
((daPy_py_c*)dComIfGp_getPlayer(0))->checkHorseRide())
|
||||
{
|
||||
// actor is Bulblin or Horseback Ganon
|
||||
if ((fopAcM_GetName(p_enemy) == PROC_E_RD &&
|
||||
((s8*)p_enemy)[0x129a] != 0) ||
|
||||
fopAcM_GetName(p_enemy) == PROC_B_GND) {
|
||||
if ((fopAcM_GetName(i_enemy) == PROC_E_RD && ((s8*)i_enemy)[0x129a] != 0) ||
|
||||
fopAcM_GetName(i_enemy) == PROC_B_GND)
|
||||
{
|
||||
pause_time = 3;
|
||||
} else {
|
||||
pause_time = 0;
|
||||
}
|
||||
}
|
||||
|
||||
s16 ac_name = fopAcM_GetName(p_enemy);
|
||||
s16 ac_name = fopAcM_GetName(i_enemy);
|
||||
// actor is Stalkin, Chu, Keese, Shadow Keese, Shadow Vermin, Baby Gohma, or Rat
|
||||
if (ac_name == PROC_E_BS || ac_name == PROC_E_SM2 || ac_name == PROC_E_BA ||
|
||||
ac_name == PROC_E_YK || ac_name == PROC_E_YG || ac_name == PROC_E_GM ||
|
||||
ac_name == PROC_E_MS) {
|
||||
ac_name == PROC_E_MS)
|
||||
{
|
||||
pause_time = 0;
|
||||
}
|
||||
|
||||
if ((p_info->mHitType == HIT_TYPE_LINK_NORMAL_ATTACK ||
|
||||
p_info->mpCollider->ChkAtType(AT_TYPE_THROW_OBJ)) &&
|
||||
!link->checkCutJumpCancelTurn()) {
|
||||
if (p_info->mpCollider->ChkAtType(AT_TYPE_THROW_OBJ)) {
|
||||
if ((i_AtInfo->mHitType == HIT_TYPE_LINK_NORMAL_ATTACK ||
|
||||
i_AtInfo->mpCollider->ChkAtType(AT_TYPE_THROW_OBJ)) &&
|
||||
!player_p->checkCutJumpCancelTurn())
|
||||
{
|
||||
if (i_AtInfo->mpCollider->ChkAtType(AT_TYPE_THROW_OBJ)) {
|
||||
pause_time = 4;
|
||||
}
|
||||
dScnPly_c::setPauseTimer(pause_time);
|
||||
}
|
||||
}
|
||||
|
||||
return p_info->mpActor;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm fopAc_ac_c* cc_at_check(fopAc_ac_c* param_0, dCcU_AtInfo* param_1) {
|
||||
nofralloc
|
||||
#include "asm/d/cc/d_cc_uty/cc_at_check__FP10fopAc_ac_cP11dCcU_AtInfo.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 80088134-8008813C 082A74 0008+00 0/0 1/0 0/0 .text checkCutJumpCancelTurn__9daPy_py_cCFv */
|
||||
int daPy_py_c::checkCutJumpCancelTurn() const {
|
||||
return 0;
|
||||
return i_AtInfo->mpActor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user