From d017a3cd36dacdcbd6a62640a85b8715540d82e5 Mon Sep 17 00:00:00 2001 From: Max Roncace Date: Fri, 27 Feb 2026 13:20:39 -0500 Subject: d_a_alink debug improvements (#3112) --- src/d/actor/d_a_alink.cpp | 1560 ++++++++++++++++++++++++--------------------- 1 file changed, 819 insertions(+), 741 deletions(-) (limited to 'src/d/actor/d_a_alink.cpp') diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index f0041d01d6..e6f8548bef 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -63,8 +63,6 @@ BOOL daAlink_c::getE3Zhint() { return false; } -#include "d/actor/d_a_alink_HIO.inc" - #if DEBUG static BOOL l_debugMode; #endif @@ -85,6 +83,11 @@ static const char l_cWShdArcName[] = "CWShd"; static const char l_sWShdArcName[] = "SWShd"; +#include "d/actor/d_a_alink_HIO.inc" + +static const f32 l_boardSlopeAngleMin = 910.0f; +static const f32 l_boardSlopeRowAngleMin = 2000.0f; + static const char l_arcName[] = "Alink"; const char* daAlink_c::getAlinkArcName() { @@ -96,8 +99,9 @@ static void daAlink_tgHitCallback(fopAc_ac_c* i_tgActor, dCcD_GObjInf* i_tgObjIn static_cast(i_tgActor)->tgHitCallback(i_atActor, i_tgObjInf, i_atObjInf); } -static void daAlink_coHitCallback(fopAc_ac_c* i_coActorA, dCcD_GObjInf* i_coObjInfA, fopAc_ac_c* i_coActorB, - dCcD_GObjInf* i_coObjInfB) { +static void daAlink_coHitCallback(fopAc_ac_c* i_coActorA, dCcD_GObjInf* i_coObjInfA, + fopAc_ac_c* i_coActorB, dCcD_GObjInf* i_coObjInfB) { + UNUSED(i_coActorB); UNUSED(i_coObjInfB); static_cast(i_coActorA)->coHitCallback(i_coActorB, i_coObjInfA); } @@ -142,459 +146,6 @@ static char const l_defaultGetEventName[16] = "DEFAULT_GETITEM"; static char l_peepEventName[10] = "PEEP_HOLE"; -daAlink_procInitTable daAlink_c::m_procInitTable[] = { - { &daAlink_c::procPreActionUnequip, 0x21 }, - { &daAlink_c::procServiceWait, 0x10000085 }, - { &daAlink_c::procTiredWait, 0x10001185 }, - { &daAlink_c::procWait, 0x10001185 }, - { &daAlink_c::procMove, 0x10001184 }, - { &daAlink_c::procAtnMove, 0x10001184 }, - { &daAlink_c::procAtnActorWait, 0x10001185 }, - { &daAlink_c::procAtnActorMove, 0x10001184 }, - { &daAlink_c::procWaitTurn, 0x10001085 }, - { &daAlink_c::procMoveTurn, 0x10001084 }, - { &daAlink_c::procSideStep, 0x10001186 }, - { &daAlink_c::procSideStepLand, 0x10001185 }, - { &daAlink_c::procSlide, 0x0 }, - { &daAlink_c::procSlideLand, 0x4 }, - { &daAlink_c::procFrontRoll, 0x8200 }, - { &daAlink_c::procFrontRollCrash, 0x2 }, - { &daAlink_c::procFrontRollSuccess, 0x0 }, - { &daAlink_c::procSideRoll, 0x8000 }, - { &daAlink_c::procBackJump, 0x8001086 }, - { &daAlink_c::procBackJumpLand, 0x1185 }, - { &daAlink_c::procSlip, 0x0 }, - { &daAlink_c::procAutoJump, 0x1006 }, - { &daAlink_c::procDiveJump, 0x2 }, - { &daAlink_c::procRollJump, 0x2 }, - { &daAlink_c::procFall, 0x1006 }, - { &daAlink_c::procLand, 0x1005 }, - { &daAlink_c::procSmallJump, 0x1000 }, - { &daAlink_c::procStepMove, 0x10001184 }, - { &daAlink_c::procCrouch, 0x800001 }, - { &daAlink_c::procGuardSlip, 0x60000000 }, - { &daAlink_c::procGuardAttack, 0x100 }, - { &daAlink_c::procGuardBreak, 0x100 }, - { &daAlink_c::procTurnMove, 0x8000 }, - { &daAlink_c::procCutNormal, 0x20000300 }, - { &daAlink_c::procCutFinish, 0x20000320 }, - { &daAlink_c::procCutFinishJumpUp, 0x102 }, - { &daAlink_c::procCutFinishJumpUpLand, 0x100 }, - { &daAlink_c::procCutReverse, 0x200 }, - { &daAlink_c::procCutJump, 0x8000202 }, - { &daAlink_c::procCutJumpLand, 0x8000201 }, - { &daAlink_c::procCutTurn, 0x200 }, - { &daAlink_c::procCutTurnCharge, 0x101 }, - { &daAlink_c::procCutTurnMove, 0x101 }, - { &daAlink_c::procCutDown, 0x8000022 }, - { &daAlink_c::procCutDownLand, 0x8002001 }, - { &daAlink_c::procCutHead, 0x222 }, - { &daAlink_c::procCutHeadLand, 0x201 }, - { &daAlink_c::procCutLargeJumpCharge, 0x101 }, - { &daAlink_c::procCutLargeJump, 0x200 }, - { &daAlink_c::procCutLargeJumpLand, 0x201 }, - { &daAlink_c::procDamage, 0x8 }, - { &daAlink_c::procLargeDamageUp, 0xa008008 }, - { &daAlink_c::procLandDamage, 0x9 }, - { &daAlink_c::procCrawlStart, 0x300a000 }, - { &daAlink_c::procCrawlMove, 0xb00e000 }, - { &daAlink_c::procCrawlAutoMove, 0xf00a000 }, - { &daAlink_c::procCrawlEnd, 0x300a000 }, - { &daAlink_c::procPullMove, 0x202000 }, - { &daAlink_c::procHorseRide, 0x4002400 }, - { &daAlink_c::procHorseGetOff, 0x4002400 }, - { &daAlink_c::procHorseWait, 0x10003585 }, - { &daAlink_c::procHorseTurn, 0x2500 }, - { &daAlink_c::procHorseJump, 0x2502 }, - { &daAlink_c::procHorseLand, 0x2500 }, - { &daAlink_c::procHorseSubjectivity, 0x60003404 }, - { &daAlink_c::procHorseCut, 0x2500 }, - { &daAlink_c::procHorseCutChargeReady, 0x2500 }, - { &daAlink_c::procHorseCutTurn, 0x2500 }, - { &daAlink_c::procHorseDamage, 0x2408 }, - { &daAlink_c::procHorseBowSubject, 0x60003404 }, - { &daAlink_c::procHorseBowMove, 0x60003404 }, - { &daAlink_c::procHorseGrabMove, 0x3404 }, - { &daAlink_c::procHorseBoomerangSubject, 0x60003404 }, - { &daAlink_c::procHorseBoomerangMove, 0x60003404 }, - { &daAlink_c::procHorseHookshotSubject, 0x60003404 }, - { &daAlink_c::procHorseHookshotMove, 0x60003404 }, - { &daAlink_c::procHorseBottleDrink, 0x2401 }, - { &daAlink_c::procHorseComeback, 0x2409 }, - { &daAlink_c::procHorseKandelaarPour, 0x2401 }, - { &daAlink_c::procHorseRun, 0x2400 }, - { &daAlink_c::procHorseHang, 0x2400 }, - { &daAlink_c::procHorseGetKey, 0x2401 }, - { &daAlink_c::procHorseLookDown, 0x2401 }, - { &daAlink_c::procBoarRun, 0x2400 }, - { &daAlink_c::procSwordUnequipSp, 0x1 }, - { &daAlink_c::procHangStart, 0x4041 }, - { &daAlink_c::procHangFallStart, 0x4041 }, - { &daAlink_c::procHangUp, 0x4041 }, - { &daAlink_c::procHangWait, 0x4041 }, - { &daAlink_c::procHangMove, 0x4040 }, - { &daAlink_c::procHangClimb, 0x4040 }, - { &daAlink_c::procHangWallCatch, 0x4040 }, - { &daAlink_c::procHangReady, 0x1 }, - { &daAlink_c::procHangLeverDown, 0x21 }, - { &daAlink_c::procBowSubject, 0x20001005 }, - { &daAlink_c::procBowMove, 0x20001004 }, - { &daAlink_c::procBoomerangSubject, 0x30001005 }, - { &daAlink_c::procBoomerangMove, 0x30001004 }, - { &daAlink_c::procBoomerangCatch, 0x1001 }, - { &daAlink_c::procCopyRodSubject, 0x30001005 }, - { &daAlink_c::procCopyRodMove, 0x30001004 }, - { &daAlink_c::procCopyRodSwing, 0x1 }, - { &daAlink_c::procCopyRodRevive, 0x1 }, - { &daAlink_c::procLadderUpStart, 0x10000 }, - { &daAlink_c::procLadderUpEnd, 0x10000 }, - { &daAlink_c::procLadderDownStart, 0x10000 }, - { &daAlink_c::procLadderDownEnd, 0x10000 }, - { &daAlink_c::procLadderMove, 0x10000 }, - { &daAlink_c::procGrabReady, 0x100001 }, - { &daAlink_c::procGrabUp, 0x100001 }, - { &daAlink_c::procGrabMiss, 0x100001 }, - { &daAlink_c::procGrabThrow, 0x100201 }, - { &daAlink_c::procGrabPut, 0x100001 }, - { &daAlink_c::procGrabWait, 0x1105 }, - { &daAlink_c::procGrabRebound, 0x100001 }, - { &daAlink_c::procGrabStand, 0x1 }, - { &daAlink_c::procInsectCatch, 0x21 }, - { &daAlink_c::procPickUp, 0x100001 }, - { &daAlink_c::procPickPut, 0x100001 }, - { &daAlink_c::procStEscape, 0x1 }, - { &daAlink_c::procDkCaught, 0x4000000 }, - { &daAlink_c::procSwimUp, 0x40000 }, - { &daAlink_c::procSwimWait, 0x40105 }, - { &daAlink_c::procSwimMove, 0x40104 }, - { &daAlink_c::procSwimDive, 0x40000 }, - { &daAlink_c::procSwimHookshotSubject, 0x20041005 }, - { &daAlink_c::procSwimHookshotMove, 0x20041004 }, - { &daAlink_c::procSwimDamage, 0x40008 }, - { &daAlink_c::procClimbUpStart, 0x10000 }, - { &daAlink_c::procClimbDownStart, 0x10000 }, - { &daAlink_c::procClimbMoveUpDown, 0x10000 }, - { &daAlink_c::procClimbMoveSide, 0x10000 }, - { &daAlink_c::procClimbWait, 0x10000 }, - { &daAlink_c::procClimbToRoof, 0x10000 }, - { &daAlink_c::procRoofHangStart, 0x10 }, - { &daAlink_c::procRoofHangWait, 0x11 }, - { &daAlink_c::procRoofHangFrontMove, 0x10 }, - { &daAlink_c::procRoofHangSideMove, 0x10 }, - { &daAlink_c::procRoofHangTurn, 0x10 }, - { &daAlink_c::procRoofSwitchHang, 0x2030 }, - { &daAlink_c::procCanoeRide, 0x4002400 }, - { &daAlink_c::procCanoeJumpRide, 0x4002400 }, - { &daAlink_c::procCanoeGetOff, 0x4002400 }, - { &daAlink_c::procCanoeWait, 0x14003504 }, - { &daAlink_c::procCanoeRow, 0x4002504 }, - { &daAlink_c::procCanoePaddleShift, 0x4002504 }, - { &daAlink_c::procCanoePaddlePut, 0x4002400 }, - { &daAlink_c::procCanoePaddleGrab, 0x4002400 }, - { &daAlink_c::procCanoeRodGrab, 0x4002400 }, - { &daAlink_c::procCanoeFishingWait, 0x44002404 }, - { &daAlink_c::procCanoeFishingReel, 0x44002500 }, - { &daAlink_c::procCanoeFishingGet, 0x4002400 }, - { &daAlink_c::procCanoeSubjectivity, 0x64002404 }, - { &daAlink_c::procCanoeBowSubject, 0x64003404 }, - { &daAlink_c::procCanoeBowMove, 0x64003404 }, - { &daAlink_c::procCanoeGrabMove, 0x4103404 }, - { &daAlink_c::procCanoeBoomerangSubject, 0x64003404 }, - { &daAlink_c::procCanoeBoomerangMove, 0x64003404 }, - { &daAlink_c::procCanoeHookshotSubject, 0x64003404 }, - { &daAlink_c::procCanoeHookshotMove, 0x64003404 }, - { &daAlink_c::procCanoeBottleDrink, 0x2401 }, - { &daAlink_c::procCanoeKandelaarPour, 0x2401 }, - { &daAlink_c::procFishingCast, 0x2101 }, - { &daAlink_c::procFishingFood, 0x2001 }, - { &daAlink_c::procSpinnerReady, 0x2002 }, - { &daAlink_c::procSpinnerWait, 0x2500 }, - { &daAlink_c::procBoardRide, 0x22 }, - { &daAlink_c::procBoardWait, 0x10001504 }, - { &daAlink_c::procBoardRow, 0x1504 }, - { &daAlink_c::procBoardTurn, 0x1504 }, - { &daAlink_c::procBoardJump, 0x1406 }, - { &daAlink_c::procBoardSubjectivity, 0x60000404 }, - { &daAlink_c::procBoardCut, 0x504 }, - { &daAlink_c::procBoardCutTurn, 0x400 }, - { &daAlink_c::procFmChainUp, 0x101 }, - { &daAlink_c::procFmChainStrongPull, 0x1001 }, - { &daAlink_c::procDoorOpen, 0x4000 }, - { &daAlink_c::procMonkeyMove, 0x800 }, - { &daAlink_c::procDemoBoomerangCatch, 0x10000101 }, - { &daAlink_c::procBottleDrink, 0x2001 }, - { &daAlink_c::procBottleOpen, 0x2001 }, - { &daAlink_c::procBottleSwing, 0x21 }, - { &daAlink_c::procBottleGet, 0x1 }, - { &daAlink_c::procKandelaarSwing, 0x1 }, - { &daAlink_c::procKandelaarPour, 0x2001 }, - { &daAlink_c::procGrassWhistleGet, 0x21 }, - { &daAlink_c::procGrassWhistleWait, 0x2001 }, - { &daAlink_c::procHawkCatch, 0x1 }, - { &daAlink_c::procHawkSubject, 0x20000021 }, - { &daAlink_c::procFloorDownRebound, 0x10001185 }, - { &daAlink_c::procGoronRideWait, 0x101 }, - { &daAlink_c::procGoatMove, 0x4002121 }, - { &daAlink_c::procGoatCatch, 0x400a021 }, - { &daAlink_c::procGoatStroke, 0x2121 }, - { &daAlink_c::procGoronMove, 0x101 }, - { &daAlink_c::procDemoCommon, 0x1 }, - { &daAlink_c::procHookshotSubject, 0x20001005 }, - { &daAlink_c::procHookshotMove, 0x20001004 }, - { &daAlink_c::procHookshotFly, 0x6002 }, - { &daAlink_c::procHookshotRoofWait, 0x6802 }, - { &daAlink_c::procHookshotRoofShoot, 0x6902 }, - { &daAlink_c::procHookshotRoofBoots, 0x6902 }, - { &daAlink_c::procHookshotWallWait, 0x6802 }, - { &daAlink_c::procHookshotWallShoot, 0x6902 }, - { &daAlink_c::procMagneBootsFly, 0x2 }, - { &daAlink_c::procBootsEquip, 0x1103 }, - { &daAlink_c::procSumouReady, 0xa000 }, - { &daAlink_c::procSumouMove, 0xa000 }, - { &daAlink_c::procSumouSideMove, 0xa000 }, - { &daAlink_c::procSumouAction, 0xa000 }, - { &daAlink_c::procSumouStagger, 0xa000 }, - { &daAlink_c::procSumouWinLose, 0x2002 }, - { &daAlink_c::procSumouShiko, 0xa000 }, - { &daAlink_c::procLookUp, 0x101 }, - { &daAlink_c::procLookUpToGetItem, 0x101 }, - { &daAlink_c::procHandPat, 0x101 }, - { &daAlink_c::procIronBallSubject, 0x20001005 }, - { &daAlink_c::procIronBallMove, 0x20001004 }, - { &daAlink_c::procIronBallThrow, 0x20000000 }, - { &daAlink_c::procIronBallReturn, 0x1 }, - { &daAlink_c::procBossBodyHang, 0x6029 }, - { &daAlink_c::procOctaIealSpit, 0x42008 }, - { &daAlink_c::procScreamWait, 0x1 }, - { &daAlink_c::procGoatStopReady, 0x1 }, - { &daAlink_c::procZoraMove, 0xe000 }, - { &daAlink_c::procLookAroundTurn, 0x1 }, - { &daAlink_c::procTradeItemOut, 0x80121 }, - { &daAlink_c::procNotUseItem, 0x2021 }, - { &daAlink_c::procSwordReady, 0x1 }, - { &daAlink_c::procSwordPush, 0x1 }, - { &daAlink_c::procGanonFinish, 0xe000 }, - { &daAlink_c::procCutFastReady, 0x1 }, - { &daAlink_c::procMasterSwordStick, 0x6001 }, - { &daAlink_c::procMasterSwordPull, 0x6001 }, - { &daAlink_c::procDungeonWarpReady, 0x2021 }, - { &daAlink_c::procDungeonWarp, 0x6003 }, - { &daAlink_c::procDungeonWarpSceneStart, 0x6003 }, - { &daAlink_c::procWolfHowlDemo, 0x800021 }, - { &daAlink_c::procWolfServiceWait, 0x1001 }, - { &daAlink_c::procWolfTiredWait, 0x1101 }, - { &daAlink_c::procWolfMidnaRideShock, 0x1 }, - { &daAlink_c::procWolfWait, 0x1101 }, - { &daAlink_c::procWolfMove, 0x1100 }, - { &daAlink_c::procWolfDash, 0x1100 }, - { &daAlink_c::procWolfDashReverse, 0x2 }, - { &daAlink_c::procWolfWaitTurn, 0x1001 }, - { &daAlink_c::procWolfAtnActorMove, 0x1100 }, - { &daAlink_c::procWolfSideStep, 0x1102 }, - { &daAlink_c::procWolfSideStepLand, 0x1101 }, - { &daAlink_c::procWolfBackJump, 0x1002 }, - { &daAlink_c::procWolfBackJumpLand, 0x1001 }, - { &daAlink_c::procWolfHowl, 0x1 }, - { &daAlink_c::procWolfAutoJump, 0x1002 }, - { &daAlink_c::procWolfFall, 0x1002 }, - { &daAlink_c::procWolfLand, 0x1001 }, - { &daAlink_c::procWolfSit, 0x800101 }, - { &daAlink_c::procWolfLieStart, 0x1000100 }, - { &daAlink_c::procWolfLieMove, 0x1000100 }, - { &daAlink_c::procWolfLieAutoMove, 0x5002000 }, - { &daAlink_c::procWolfHangReady, 0x1001 }, - { &daAlink_c::procWolfStepMove, 0x10001100 }, - { &daAlink_c::procWolfHangWallCatch, 0x10005040 }, - { &daAlink_c::procWolfHangFallStart, 0x10005041 }, - { &daAlink_c::procWolfDamage, 0x8 }, - { &daAlink_c::procWolfLargeDamageUp, 0x12008008 }, - { &daAlink_c::procWolfLandDamage, 0x9 }, - { &daAlink_c::procWolfScreamWait, 0x1 }, - { &daAlink_c::procWolfSlip, 0x10001000 }, - { &daAlink_c::procWolfSlipTurn, 0x10001000 }, - { &daAlink_c::procWolfSlipTurnLand, 0x10001000 }, - { &daAlink_c::procWolfSlideReady, 0x10008000 }, - { &daAlink_c::procWolfSlide, 0x1000 }, - { &daAlink_c::procWolfSlideLand, 0x1000 }, - { &daAlink_c::procWolfWaitSlip, 0x1100 }, - { &daAlink_c::procWolfSlopeStart, 0x1000 }, - { &daAlink_c::procWolfRopeMove, 0x23100 }, - { &daAlink_c::procWolfRopeHang, 0x10023000 }, - { &daAlink_c::procWolfRopeTurn, 0x10023000 }, - { &daAlink_c::procWolfRopeStagger, 0x10023000 }, - { &daAlink_c::procWolfRopeSubjectivity, 0x23001 }, - { &daAlink_c::procWolfTagJump, 0x1022 }, - { &daAlink_c::procWolfTagJumpLand, 0x120 }, - { &daAlink_c::procWolfRollAttackCharge, 0x100 }, - { &daAlink_c::procWolfRollAttackMove, 0x100 }, - { &daAlink_c::procWolfJumpAttack, 0x2 }, - { &daAlink_c::procWolfJumpAttackKick, 0x2 }, - { &daAlink_c::procWolfJumpAttackSlideLand, 0x0 }, - { &daAlink_c::procWolfJumpAttackNormalLand, 0x0 }, - { &daAlink_c::procWolfWaitAttack, 0x0 }, - { &daAlink_c::procWolfRollAttack, 0x0 }, - { &daAlink_c::procWolfDownAttack, 0x22 }, - { &daAlink_c::procWolfDownAtLand, 0x8002021 }, - { &daAlink_c::procWolfDownAtMissLand, 0x0 }, - { &daAlink_c::procWolfLockAttack, 0x2002 }, - { &daAlink_c::procWolfLockAttackTurn, 0x0 }, - { &daAlink_c::procWolfSwimUp, 0x40000 }, - { &daAlink_c::procWolfSwimWait, 0x40101 }, - { &daAlink_c::procWolfSwimMove, 0x40100 }, - { &daAlink_c::procWolfSwimEndWait, 0x1001 }, - { &daAlink_c::procWolfGrabUp, 0x100001 }, - { &daAlink_c::procWolfGrabPut, 0x100001 }, - { &daAlink_c::procWolfGrabThrow, 0x100001 }, - { &daAlink_c::procWolfChainUp, 0x1 }, - { &daAlink_c::procWolfPush, 0x20 }, - { &daAlink_c::procWolfChainReady, 0x20000 }, - { &daAlink_c::procWolfChainWait, 0x10020000 }, - { &daAlink_c::procWolfDig, 0xa020 }, - { &daAlink_c::procWolfDigThrough, 0xe000 }, - { &daAlink_c::procWolfAttackReverse, 0x2 }, - { &daAlink_c::procWolfEnemyThrow, 0x0 }, - { &daAlink_c::procWolfEnemyHangBite, 0xe002 }, - { &daAlink_c::procWolfGiantPuzzle, 0x100 }, - { &daAlink_c::procWolfCargoCarry, 0x400e022 }, - { &daAlink_c::procWolfGetSmell, 0xe021 }, - { &daAlink_c::procDemoCommon, 0x1 }, - { &daAlink_c::procWolfSnowEscape, 0xa000 }, - { &daAlink_c::procWolfGanonCatch, 0x4002021 }, - { &daAlink_c::procCoToolDemo, 0x8000 }, - { &daAlink_c::procCoSubjectivity, 0x20001005 }, - { &daAlink_c::procCoSwimSubjectivity, 0x20041001 }, - { &daAlink_c::procCoPeepSubjectivity, 0x2000200b }, - { &daAlink_c::procCoPolyDamage, 0x9 }, - { &daAlink_c::procCoElecDamage, 0x9 }, - { &daAlink_c::procCoPushPullWait, 0x202001 }, - { &daAlink_c::procCoPushMove, 0x202000 }, - { &daAlink_c::procCoTalk, 0x80101 }, - { &daAlink_c::procCoOpenTreasure, 0xe001 }, - { &daAlink_c::procCoUnequip, 0x1 }, - { &daAlink_c::procCoGetItem, 0x800e001 }, - { &daAlink_c::procCoTurnBack, 0x1 }, - { &daAlink_c::procCoLookWait, 0x1101 }, - { &daAlink_c::procDemoCommon, 0x200001 }, - { &daAlink_c::procDemoCommon, 0x200000 }, - { &daAlink_c::procCoMetamorphose, 0x8001 }, - { &daAlink_c::procCoMetamorphoseOnly, 0x6001 }, - { &daAlink_c::procCoWarp, 0x1 }, - { &daAlink_c::procCoDead, 0xa009 }, - { &daAlink_c::procCoFogDead, 0xa009 }, - { &daAlink_c::procCoLookAround, 0x0 }, - { &daAlink_c::procDemoCommon, 0xe000 }, - { &daAlink_c::procCoSandWallHit, 0xa }, - { &daAlink_c::procCoLavaReturn, 0x42009 }, - { &daAlink_c::procCoSwimFreezeReturn, 0x42009 }, - { &daAlink_c::procCoGetReadySit, 0xa001 }, - { &daAlink_c::procCoTwGate, 0xe002 }, - { &daAlink_c::procCoLargeDamage, 0xa }, - { &daAlink_c::procCoLargeDamageWall, 0xa }, - { &daAlink_c::procCoNod, 0x80001 }, - { &daAlink_c::procDemoCommon, 0x80001 }, - { &daAlink_c::procCoGlare, 0x80001 }, - { &daAlink_c::procCoHorseCallWait, 0x1 }, - { &daAlink_c::procDemoCommon, 0x1 }, -}; - -daAlink_procFunc daAlink_c::m_demoInitTable[] = { - NULL, - NULL, - NULL, - NULL, - NULL, - &daAlink_c::commonWaitTurnInit, - NULL, - NULL, - NULL, - NULL, - &daAlink_c::procCoOpenTreasureInit, - &daAlink_c::procCoGetItemInit, - &daAlink_c::procCoUnequipInit, - &daAlink_c::commonGrabPutInit, - NULL, - NULL, - NULL, - NULL, - NULL, - &daAlink_c::procMonkeyMoveInit, - &daAlink_c::procCoLookAroundInit, - NULL, - NULL, - NULL, - NULL, - &daAlink_c::procCoTurnBackInit, - NULL, - NULL, - &daAlink_c::procDemoBoomerangCatchInit, - &daAlink_c::procHawkCatchInit, - &daAlink_c::procSwordUnequipSpInit, - NULL, - &daAlink_c::procCoDemoPushPullWaitInit, - &daAlink_c::procCoDemoPushMoveInit, - &daAlink_c::procBossAtnWaitInit, - &daAlink_c::procDoorOpenInit, - NULL, - &daAlink_c::procTradeItemOutInit, - NULL, - &daAlink_c::procKandelaarSwingInit, - &daAlink_c::procFrontRollInit, - &daAlink_c::procCrouchInit, - NULL, - NULL, - NULL, - NULL, - &daAlink_c::procCoCaughtInit, - &daAlink_c::procLookUpInit, - &daAlink_c::procLookUpToGetItemInit, - &daAlink_c::procHandPatInit, - &daAlink_c::procWolfMidnaRideShockInit, - &daAlink_c::procSumouShikoInit, - &daAlink_c::procCoFogDeadInit, - &daAlink_c::procWolfSmellWaitInit, - NULL, - NULL, - &daAlink_c::procWolfCargoCarryInit, - &daAlink_c::procCoMetamorphoseInit, - &daAlink_c::procCoMetamorphoseInit, - &daAlink_c::procHorseGetKeyInit, - &daAlink_c::procCoNodInit, - &daAlink_c::procCoGlareInit, - &daAlink_c::procCoEyeAwayInit, - &daAlink_c::procGoatStopReadyInit, - &daAlink_c::procCoGetReadySitInit, - NULL, - &daAlink_c::procCoTwGateInit, - &daAlink_c::procFmChainStrongPullInit, - &daAlink_c::procWolfSnowEscapeInit, - &daAlink_c::procZoraMoveInit, - &daAlink_c::procCoMetamorphoseOnlyInit, - &daAlink_c::procCoMetamorphoseOnlyInit, - &daAlink_c::procLookAroundTurnInit, - NULL, - &daAlink_c::procCoQuakeWaitInit, - &daAlink_c::procGuardAttackInit, - &daAlink_c::procSwordReadyInit, - &daAlink_c::procDungeonWarpInit, - &daAlink_c::procDungeonWarpSceneStartInit, - &daAlink_c::procMasterSwordStickInit, - &daAlink_c::procMasterSwordPullInit, - &daAlink_c::procCutDownInit, - NULL, - &daAlink_c::procCutHeadInit, - NULL, - NULL, - &daAlink_c::procCutLargeJumpInit, - &daAlink_c::procCutFastReadyInit, - &daAlink_c::procCopyRodReviveInit, - &daAlink_c::procSwordPushInit, - &daAlink_c::procGanonFinishInit, - NULL, - NULL, - &daAlink_c::procHorseLookDownInit, - NULL, -}; - static f32 const l_crawlStartFrontOffset[3] = {0.0f, 30.0f, 112.0f}; static Vec const l_crawlFrontOffset = {0.0f, 30.0f, 80.0f}; @@ -1454,59 +1005,468 @@ daAlink_FaceTexData const daAlink_c::m_faceTexDataTable[] = { {dRes_ID_ALANM_BTP_WL_FC_e, dRes_ID_ALANM_BTK_WL_FA_e}, }; -#include "d/actor/d_a_alink_link.inc" - -#include "d/actor/d_a_alink_cut.inc" - -#include "d/actor/d_a_alink_damage.inc" - -#include "d/actor/d_a_alink_guard.inc" - -#include "d/actor/d_a_alink_bow.inc" - -#include "d/actor/d_a_alink_boom.inc" - -#include "d/actor/d_a_alink_copyrod.inc" - -#include "d/actor/d_a_alink_hvyboots.inc" +const daAlink_procInitTable daAlink_c::m_procInitTable[] = { + { &daAlink_c::procPreActionUnequip, 0x21 }, + { &daAlink_c::procServiceWait, 0x10000085 }, + { &daAlink_c::procTiredWait, 0x10001185 }, + { &daAlink_c::procWait, 0x10001185 }, + { &daAlink_c::procMove, 0x10001184 }, + { &daAlink_c::procAtnMove, 0x10001184 }, + { &daAlink_c::procAtnActorWait, 0x10001185 }, + { &daAlink_c::procAtnActorMove, 0x10001184 }, + { &daAlink_c::procWaitTurn, 0x10001085 }, + { &daAlink_c::procMoveTurn, 0x10001084 }, + { &daAlink_c::procSideStep, 0x10001186 }, + { &daAlink_c::procSideStepLand, 0x10001185 }, + { &daAlink_c::procSlide, 0x0 }, + { &daAlink_c::procSlideLand, 0x4 }, + { &daAlink_c::procFrontRoll, 0x8200 }, + { &daAlink_c::procFrontRollCrash, 0x2 }, + { &daAlink_c::procFrontRollSuccess, 0x0 }, + { &daAlink_c::procSideRoll, 0x8000 }, + { &daAlink_c::procBackJump, 0x8001086 }, + { &daAlink_c::procBackJumpLand, 0x1185 }, + { &daAlink_c::procSlip, 0x0 }, + { &daAlink_c::procAutoJump, 0x1006 }, + { &daAlink_c::procDiveJump, 0x2 }, + { &daAlink_c::procRollJump, 0x2 }, + { &daAlink_c::procFall, 0x1006 }, + { &daAlink_c::procLand, 0x1005 }, + { &daAlink_c::procSmallJump, 0x1000 }, + { &daAlink_c::procStepMove, 0x10001184 }, + { &daAlink_c::procCrouch, 0x800001 }, + { &daAlink_c::procGuardSlip, 0x60000000 }, + { &daAlink_c::procGuardAttack, 0x100 }, + { &daAlink_c::procGuardBreak, 0x100 }, + { &daAlink_c::procTurnMove, 0x8000 }, + { &daAlink_c::procCutNormal, 0x20000300 }, + { &daAlink_c::procCutFinish, 0x20000320 }, + { &daAlink_c::procCutFinishJumpUp, 0x102 }, + { &daAlink_c::procCutFinishJumpUpLand, 0x100 }, + { &daAlink_c::procCutReverse, 0x200 }, + { &daAlink_c::procCutJump, 0x8000202 }, + { &daAlink_c::procCutJumpLand, 0x8000201 }, + { &daAlink_c::procCutTurn, 0x200 }, + { &daAlink_c::procCutTurnCharge, 0x101 }, + { &daAlink_c::procCutTurnMove, 0x101 }, + { &daAlink_c::procCutDown, 0x8000022 }, + { &daAlink_c::procCutDownLand, 0x8002001 }, + { &daAlink_c::procCutHead, 0x222 }, + { &daAlink_c::procCutHeadLand, 0x201 }, + { &daAlink_c::procCutLargeJumpCharge, 0x101 }, + { &daAlink_c::procCutLargeJump, 0x200 }, + { &daAlink_c::procCutLargeJumpLand, 0x201 }, + { &daAlink_c::procDamage, 0x8 }, + { &daAlink_c::procLargeDamageUp, 0xa008008 }, + { &daAlink_c::procLandDamage, 0x9 }, + { &daAlink_c::procCrawlStart, 0x300a000 }, + { &daAlink_c::procCrawlMove, 0xb00e000 }, + { &daAlink_c::procCrawlAutoMove, 0xf00a000 }, + { &daAlink_c::procCrawlEnd, 0x300a000 }, + { &daAlink_c::procPullMove, 0x202000 }, + { &daAlink_c::procHorseRide, 0x4002400 }, + { &daAlink_c::procHorseGetOff, 0x4002400 }, + { &daAlink_c::procHorseWait, 0x10003585 }, + { &daAlink_c::procHorseTurn, 0x2500 }, + { &daAlink_c::procHorseJump, 0x2502 }, + { &daAlink_c::procHorseLand, 0x2500 }, + { &daAlink_c::procHorseSubjectivity, 0x60003404 }, + { &daAlink_c::procHorseCut, 0x2500 }, + { &daAlink_c::procHorseCutChargeReady, 0x2500 }, + { &daAlink_c::procHorseCutTurn, 0x2500 }, + { &daAlink_c::procHorseDamage, 0x2408 }, + { &daAlink_c::procHorseBowSubject, 0x60003404 }, + { &daAlink_c::procHorseBowMove, 0x60003404 }, + { &daAlink_c::procHorseGrabMove, 0x3404 }, + { &daAlink_c::procHorseBoomerangSubject, 0x60003404 }, + { &daAlink_c::procHorseBoomerangMove, 0x60003404 }, + { &daAlink_c::procHorseHookshotSubject, 0x60003404 }, + { &daAlink_c::procHorseHookshotMove, 0x60003404 }, + { &daAlink_c::procHorseBottleDrink, 0x2401 }, + { &daAlink_c::procHorseComeback, 0x2409 }, + { &daAlink_c::procHorseKandelaarPour, 0x2401 }, + { &daAlink_c::procHorseRun, 0x2400 }, + { &daAlink_c::procHorseHang, 0x2400 }, + { &daAlink_c::procHorseGetKey, 0x2401 }, + { &daAlink_c::procHorseLookDown, 0x2401 }, + { &daAlink_c::procBoarRun, 0x2400 }, + { &daAlink_c::procSwordUnequipSp, 0x1 }, + { &daAlink_c::procHangStart, 0x4041 }, + { &daAlink_c::procHangFallStart, 0x4041 }, + { &daAlink_c::procHangUp, 0x4041 }, + { &daAlink_c::procHangWait, 0x4041 }, + { &daAlink_c::procHangMove, 0x4040 }, + { &daAlink_c::procHangClimb, 0x4040 }, + { &daAlink_c::procHangWallCatch, 0x4040 }, + { &daAlink_c::procHangReady, 0x1 }, + { &daAlink_c::procHangLeverDown, 0x21 }, + { &daAlink_c::procBowSubject, 0x20001005 }, + { &daAlink_c::procBowMove, 0x20001004 }, + { &daAlink_c::procBoomerangSubject, 0x30001005 }, + { &daAlink_c::procBoomerangMove, 0x30001004 }, + { &daAlink_c::procBoomerangCatch, 0x1001 }, + { &daAlink_c::procCopyRodSubject, 0x30001005 }, + { &daAlink_c::procCopyRodMove, 0x30001004 }, + { &daAlink_c::procCopyRodSwing, 0x1 }, + { &daAlink_c::procCopyRodRevive, 0x1 }, + { &daAlink_c::procLadderUpStart, 0x10000 }, + { &daAlink_c::procLadderUpEnd, 0x10000 }, + { &daAlink_c::procLadderDownStart, 0x10000 }, + { &daAlink_c::procLadderDownEnd, 0x10000 }, + { &daAlink_c::procLadderMove, 0x10000 }, + { &daAlink_c::procGrabReady, 0x100001 }, + { &daAlink_c::procGrabUp, 0x100001 }, + { &daAlink_c::procGrabMiss, 0x100001 }, + { &daAlink_c::procGrabThrow, 0x100201 }, + { &daAlink_c::procGrabPut, 0x100001 }, + { &daAlink_c::procGrabWait, 0x1105 }, + { &daAlink_c::procGrabRebound, 0x100001 }, + { &daAlink_c::procGrabStand, 0x1 }, + { &daAlink_c::procInsectCatch, 0x21 }, + { &daAlink_c::procPickUp, 0x100001 }, + { &daAlink_c::procPickPut, 0x100001 }, + { &daAlink_c::procStEscape, 0x1 }, + { &daAlink_c::procDkCaught, 0x4000000 }, + { &daAlink_c::procSwimUp, 0x40000 }, + { &daAlink_c::procSwimWait, 0x40105 }, + { &daAlink_c::procSwimMove, 0x40104 }, + { &daAlink_c::procSwimDive, 0x40000 }, + { &daAlink_c::procSwimHookshotSubject, 0x20041005 }, + { &daAlink_c::procSwimHookshotMove, 0x20041004 }, + { &daAlink_c::procSwimDamage, 0x40008 }, + { &daAlink_c::procClimbUpStart, 0x10000 }, + { &daAlink_c::procClimbDownStart, 0x10000 }, + { &daAlink_c::procClimbMoveUpDown, 0x10000 }, + { &daAlink_c::procClimbMoveSide, 0x10000 }, + { &daAlink_c::procClimbWait, 0x10000 }, + { &daAlink_c::procClimbToRoof, 0x10000 }, + { &daAlink_c::procRoofHangStart, 0x10 }, + { &daAlink_c::procRoofHangWait, 0x11 }, + { &daAlink_c::procRoofHangFrontMove, 0x10 }, + { &daAlink_c::procRoofHangSideMove, 0x10 }, + { &daAlink_c::procRoofHangTurn, 0x10 }, + { &daAlink_c::procRoofSwitchHang, 0x2030 }, + { &daAlink_c::procCanoeRide, 0x4002400 }, + { &daAlink_c::procCanoeJumpRide, 0x4002400 }, + { &daAlink_c::procCanoeGetOff, 0x4002400 }, + { &daAlink_c::procCanoeWait, 0x14003504 }, + { &daAlink_c::procCanoeRow, 0x4002504 }, + { &daAlink_c::procCanoePaddleShift, 0x4002504 }, + { &daAlink_c::procCanoePaddlePut, 0x4002400 }, + { &daAlink_c::procCanoePaddleGrab, 0x4002400 }, + { &daAlink_c::procCanoeRodGrab, 0x4002400 }, + { &daAlink_c::procCanoeFishingWait, 0x44002404 }, + { &daAlink_c::procCanoeFishingReel, 0x44002500 }, + { &daAlink_c::procCanoeFishingGet, 0x4002400 }, + { &daAlink_c::procCanoeSubjectivity, 0x64002404 }, + { &daAlink_c::procCanoeBowSubject, 0x64003404 }, + { &daAlink_c::procCanoeBowMove, 0x64003404 }, + { &daAlink_c::procCanoeGrabMove, 0x4103404 }, + { &daAlink_c::procCanoeBoomerangSubject, 0x64003404 }, + { &daAlink_c::procCanoeBoomerangMove, 0x64003404 }, + { &daAlink_c::procCanoeHookshotSubject, 0x64003404 }, + { &daAlink_c::procCanoeHookshotMove, 0x64003404 }, + { &daAlink_c::procCanoeBottleDrink, 0x2401 }, + { &daAlink_c::procCanoeKandelaarPour, 0x2401 }, + { &daAlink_c::procFishingCast, 0x2101 }, + { &daAlink_c::procFishingFood, 0x2001 }, + { &daAlink_c::procSpinnerReady, 0x2002 }, + { &daAlink_c::procSpinnerWait, 0x2500 }, + { &daAlink_c::procBoardRide, 0x22 }, + { &daAlink_c::procBoardWait, 0x10001504 }, + { &daAlink_c::procBoardRow, 0x1504 }, + { &daAlink_c::procBoardTurn, 0x1504 }, + { &daAlink_c::procBoardJump, 0x1406 }, + { &daAlink_c::procBoardSubjectivity, 0x60000404 }, + { &daAlink_c::procBoardCut, 0x504 }, + { &daAlink_c::procBoardCutTurn, 0x400 }, + { &daAlink_c::procFmChainUp, 0x101 }, + { &daAlink_c::procFmChainStrongPull, 0x1001 }, + { &daAlink_c::procDoorOpen, 0x4000 }, + { &daAlink_c::procMonkeyMove, 0x800 }, + { &daAlink_c::procDemoBoomerangCatch, 0x10000101 }, + { &daAlink_c::procBottleDrink, 0x2001 }, + { &daAlink_c::procBottleOpen, 0x2001 }, + { &daAlink_c::procBottleSwing, 0x21 }, + { &daAlink_c::procBottleGet, 0x1 }, + { &daAlink_c::procKandelaarSwing, 0x1 }, + { &daAlink_c::procKandelaarPour, 0x2001 }, + { &daAlink_c::procGrassWhistleGet, 0x21 }, + { &daAlink_c::procGrassWhistleWait, 0x2001 }, + { &daAlink_c::procHawkCatch, 0x1 }, + { &daAlink_c::procHawkSubject, 0x20000021 }, + { &daAlink_c::procFloorDownRebound, 0x10001185 }, + { &daAlink_c::procGoronRideWait, 0x101 }, + { &daAlink_c::procGoatMove, 0x4002121 }, + { &daAlink_c::procGoatCatch, 0x400a021 }, + { &daAlink_c::procGoatStroke, 0x2121 }, + { &daAlink_c::procGoronMove, 0x101 }, + { &daAlink_c::procDemoCommon, 0x1 }, + { &daAlink_c::procHookshotSubject, 0x20001005 }, + { &daAlink_c::procHookshotMove, 0x20001004 }, + { &daAlink_c::procHookshotFly, 0x6002 }, + { &daAlink_c::procHookshotRoofWait, 0x6802 }, + { &daAlink_c::procHookshotRoofShoot, 0x6902 }, + { &daAlink_c::procHookshotRoofBoots, 0x6902 }, + { &daAlink_c::procHookshotWallWait, 0x6802 }, + { &daAlink_c::procHookshotWallShoot, 0x6902 }, + { &daAlink_c::procMagneBootsFly, 0x2 }, + { &daAlink_c::procBootsEquip, 0x1103 }, + { &daAlink_c::procSumouReady, 0xa000 }, + { &daAlink_c::procSumouMove, 0xa000 }, + { &daAlink_c::procSumouSideMove, 0xa000 }, + { &daAlink_c::procSumouAction, 0xa000 }, + { &daAlink_c::procSumouStagger, 0xa000 }, + { &daAlink_c::procSumouWinLose, 0x2002 }, + { &daAlink_c::procSumouShiko, 0xa000 }, + { &daAlink_c::procLookUp, 0x101 }, + { &daAlink_c::procLookUpToGetItem, 0x101 }, + { &daAlink_c::procHandPat, 0x101 }, + { &daAlink_c::procIronBallSubject, 0x20001005 }, + { &daAlink_c::procIronBallMove, 0x20001004 }, + { &daAlink_c::procIronBallThrow, 0x20000000 }, + { &daAlink_c::procIronBallReturn, 0x1 }, + { &daAlink_c::procBossBodyHang, 0x6029 }, + { &daAlink_c::procOctaIealSpit, 0x42008 }, + { &daAlink_c::procScreamWait, 0x1 }, + { &daAlink_c::procGoatStopReady, 0x1 }, + { &daAlink_c::procZoraMove, 0xe000 }, + { &daAlink_c::procLookAroundTurn, 0x1 }, + { &daAlink_c::procTradeItemOut, 0x80121 }, + { &daAlink_c::procNotUseItem, 0x2021 }, + { &daAlink_c::procSwordReady, 0x1 }, + { &daAlink_c::procSwordPush, 0x1 }, + { &daAlink_c::procGanonFinish, 0xe000 }, + { &daAlink_c::procCutFastReady, 0x1 }, + { &daAlink_c::procMasterSwordStick, 0x6001 }, + { &daAlink_c::procMasterSwordPull, 0x6001 }, + { &daAlink_c::procDungeonWarpReady, 0x2021 }, + { &daAlink_c::procDungeonWarp, 0x6003 }, + { &daAlink_c::procDungeonWarpSceneStart, 0x6003 }, + { &daAlink_c::procWolfHowlDemo, 0x800021 }, + { &daAlink_c::procWolfServiceWait, 0x1001 }, + { &daAlink_c::procWolfTiredWait, 0x1101 }, + { &daAlink_c::procWolfMidnaRideShock, 0x1 }, + { &daAlink_c::procWolfWait, 0x1101 }, + { &daAlink_c::procWolfMove, 0x1100 }, + { &daAlink_c::procWolfDash, 0x1100 }, + { &daAlink_c::procWolfDashReverse, 0x2 }, + { &daAlink_c::procWolfWaitTurn, 0x1001 }, + { &daAlink_c::procWolfAtnActorMove, 0x1100 }, + { &daAlink_c::procWolfSideStep, 0x1102 }, + { &daAlink_c::procWolfSideStepLand, 0x1101 }, + { &daAlink_c::procWolfBackJump, 0x1002 }, + { &daAlink_c::procWolfBackJumpLand, 0x1001 }, + { &daAlink_c::procWolfHowl, 0x1 }, + { &daAlink_c::procWolfAutoJump, 0x1002 }, + { &daAlink_c::procWolfFall, 0x1002 }, + { &daAlink_c::procWolfLand, 0x1001 }, + { &daAlink_c::procWolfSit, 0x800101 }, + { &daAlink_c::procWolfLieStart, 0x1000100 }, + { &daAlink_c::procWolfLieMove, 0x1000100 }, + { &daAlink_c::procWolfLieAutoMove, 0x5002000 }, + { &daAlink_c::procWolfHangReady, 0x1001 }, + { &daAlink_c::procWolfStepMove, 0x10001100 }, + { &daAlink_c::procWolfHangWallCatch, 0x10005040 }, + { &daAlink_c::procWolfHangFallStart, 0x10005041 }, + { &daAlink_c::procWolfDamage, 0x8 }, + { &daAlink_c::procWolfLargeDamageUp, 0x12008008 }, + { &daAlink_c::procWolfLandDamage, 0x9 }, + { &daAlink_c::procWolfScreamWait, 0x1 }, + { &daAlink_c::procWolfSlip, 0x10001000 }, + { &daAlink_c::procWolfSlipTurn, 0x10001000 }, + { &daAlink_c::procWolfSlipTurnLand, 0x10001000 }, + { &daAlink_c::procWolfSlideReady, 0x10008000 }, + { &daAlink_c::procWolfSlide, 0x1000 }, + { &daAlink_c::procWolfSlideLand, 0x1000 }, + { &daAlink_c::procWolfWaitSlip, 0x1100 }, + { &daAlink_c::procWolfSlopeStart, 0x1000 }, + { &daAlink_c::procWolfRopeMove, 0x23100 }, + { &daAlink_c::procWolfRopeHang, 0x10023000 }, + { &daAlink_c::procWolfRopeTurn, 0x10023000 }, + { &daAlink_c::procWolfRopeStagger, 0x10023000 }, + { &daAlink_c::procWolfRopeSubjectivity, 0x23001 }, + { &daAlink_c::procWolfTagJump, 0x1022 }, + { &daAlink_c::procWolfTagJumpLand, 0x120 }, + { &daAlink_c::procWolfRollAttackCharge, 0x100 }, + { &daAlink_c::procWolfRollAttackMove, 0x100 }, + { &daAlink_c::procWolfJumpAttack, 0x2 }, + { &daAlink_c::procWolfJumpAttackKick, 0x2 }, + { &daAlink_c::procWolfJumpAttackSlideLand, 0x0 }, + { &daAlink_c::procWolfJumpAttackNormalLand, 0x0 }, + { &daAlink_c::procWolfWaitAttack, 0x0 }, + { &daAlink_c::procWolfRollAttack, 0x0 }, + { &daAlink_c::procWolfDownAttack, 0x22 }, + { &daAlink_c::procWolfDownAtLand, 0x8002021 }, + { &daAlink_c::procWolfDownAtMissLand, 0x0 }, + { &daAlink_c::procWolfLockAttack, 0x2002 }, + { &daAlink_c::procWolfLockAttackTurn, 0x0 }, + { &daAlink_c::procWolfSwimUp, 0x40000 }, + { &daAlink_c::procWolfSwimWait, 0x40101 }, + { &daAlink_c::procWolfSwimMove, 0x40100 }, + { &daAlink_c::procWolfSwimEndWait, 0x1001 }, + { &daAlink_c::procWolfGrabUp, 0x100001 }, + { &daAlink_c::procWolfGrabPut, 0x100001 }, + { &daAlink_c::procWolfGrabThrow, 0x100001 }, + { &daAlink_c::procWolfChainUp, 0x1 }, + { &daAlink_c::procWolfPush, 0x20 }, + { &daAlink_c::procWolfChainReady, 0x20000 }, + { &daAlink_c::procWolfChainWait, 0x10020000 }, + { &daAlink_c::procWolfDig, 0xa020 }, + { &daAlink_c::procWolfDigThrough, 0xe000 }, + { &daAlink_c::procWolfAttackReverse, 0x2 }, + { &daAlink_c::procWolfEnemyThrow, 0x0 }, + { &daAlink_c::procWolfEnemyHangBite, 0xe002 }, + { &daAlink_c::procWolfGiantPuzzle, 0x100 }, + { &daAlink_c::procWolfCargoCarry, 0x400e022 }, + { &daAlink_c::procWolfGetSmell, 0xe021 }, + { &daAlink_c::procDemoCommon, 0x1 }, + { &daAlink_c::procWolfSnowEscape, 0xa000 }, + { &daAlink_c::procWolfGanonCatch, 0x4002021 }, + { &daAlink_c::procCoToolDemo, 0x8000 }, + { &daAlink_c::procCoSubjectivity, 0x20001005 }, + { &daAlink_c::procCoSwimSubjectivity, 0x20041001 }, + { &daAlink_c::procCoPeepSubjectivity, 0x2000200b }, + { &daAlink_c::procCoPolyDamage, 0x9 }, + { &daAlink_c::procCoElecDamage, 0x9 }, + { &daAlink_c::procCoPushPullWait, 0x202001 }, + { &daAlink_c::procCoPushMove, 0x202000 }, + { &daAlink_c::procCoTalk, 0x80101 }, + { &daAlink_c::procCoOpenTreasure, 0xe001 }, + { &daAlink_c::procCoUnequip, 0x1 }, + { &daAlink_c::procCoGetItem, 0x800e001 }, + { &daAlink_c::procCoTurnBack, 0x1 }, + { &daAlink_c::procCoLookWait, 0x1101 }, + { &daAlink_c::procDemoCommon, 0x200001 }, + { &daAlink_c::procDemoCommon, 0x200000 }, + { &daAlink_c::procCoMetamorphose, 0x8001 }, + { &daAlink_c::procCoMetamorphoseOnly, 0x6001 }, + { &daAlink_c::procCoWarp, 0x1 }, + { &daAlink_c::procCoDead, 0xa009 }, + { &daAlink_c::procCoFogDead, 0xa009 }, + { &daAlink_c::procCoLookAround, 0x0 }, + { &daAlink_c::procDemoCommon, 0xe000 }, + { &daAlink_c::procCoSandWallHit, 0xa }, + { &daAlink_c::procCoLavaReturn, 0x42009 }, + { &daAlink_c::procCoSwimFreezeReturn, 0x42009 }, + { &daAlink_c::procCoGetReadySit, 0xa001 }, + { &daAlink_c::procCoTwGate, 0xe002 }, + { &daAlink_c::procCoLargeDamage, 0xa }, + { &daAlink_c::procCoLargeDamageWall, 0xa }, + { &daAlink_c::procCoNod, 0x80001 }, + { &daAlink_c::procDemoCommon, 0x80001 }, + { &daAlink_c::procCoGlare, 0x80001 }, + { &daAlink_c::procCoHorseCallWait, 0x1 }, + { &daAlink_c::procDemoCommon, 0x1 }, +}; -#include "d/actor/d_a_alink_bomb.inc" +daAlink_procFunc daAlink_c::m_demoInitTable[] = { + NULL, + NULL, + NULL, + NULL, + NULL, + &daAlink_c::commonWaitTurnInit, + NULL, + NULL, + NULL, + NULL, + &daAlink_c::procCoOpenTreasureInit, + &daAlink_c::procCoGetItemInit, + &daAlink_c::procCoUnequipInit, + &daAlink_c::commonGrabPutInit, + NULL, + NULL, + NULL, + NULL, + NULL, + &daAlink_c::procMonkeyMoveInit, + &daAlink_c::procCoLookAroundInit, + NULL, + NULL, + NULL, + NULL, + &daAlink_c::procCoTurnBackInit, + NULL, + NULL, + &daAlink_c::procDemoBoomerangCatchInit, + &daAlink_c::procHawkCatchInit, + &daAlink_c::procSwordUnequipSpInit, + NULL, + &daAlink_c::procCoDemoPushPullWaitInit, + &daAlink_c::procCoDemoPushMoveInit, + &daAlink_c::procBossAtnWaitInit, + &daAlink_c::procDoorOpenInit, + NULL, + &daAlink_c::procTradeItemOutInit, + NULL, + &daAlink_c::procKandelaarSwingInit, + &daAlink_c::procFrontRollInit, + &daAlink_c::procCrouchInit, + NULL, + NULL, + NULL, + NULL, + &daAlink_c::procCoCaughtInit, + &daAlink_c::procLookUpInit, + &daAlink_c::procLookUpToGetItemInit, + &daAlink_c::procHandPatInit, + &daAlink_c::procWolfMidnaRideShockInit, + &daAlink_c::procSumouShikoInit, + &daAlink_c::procCoFogDeadInit, + &daAlink_c::procWolfSmellWaitInit, + NULL, + NULL, + &daAlink_c::procWolfCargoCarryInit, + &daAlink_c::procCoMetamorphoseInit, + &daAlink_c::procCoMetamorphoseInit, + &daAlink_c::procHorseGetKeyInit, + &daAlink_c::procCoNodInit, + &daAlink_c::procCoGlareInit, + &daAlink_c::procCoEyeAwayInit, + &daAlink_c::procGoatStopReadyInit, + &daAlink_c::procCoGetReadySitInit, + NULL, + &daAlink_c::procCoTwGateInit, + &daAlink_c::procFmChainStrongPullInit, + &daAlink_c::procWolfSnowEscapeInit, + &daAlink_c::procZoraMoveInit, + &daAlink_c::procCoMetamorphoseOnlyInit, + &daAlink_c::procCoMetamorphoseOnlyInit, + &daAlink_c::procLookAroundTurnInit, + NULL, + &daAlink_c::procCoQuakeWaitInit, + &daAlink_c::procGuardAttackInit, + &daAlink_c::procSwordReadyInit, + &daAlink_c::procDungeonWarpInit, + &daAlink_c::procDungeonWarpSceneStartInit, + &daAlink_c::procMasterSwordStickInit, + &daAlink_c::procMasterSwordPullInit, + &daAlink_c::procCutDownInit, + NULL, + &daAlink_c::procCutHeadInit, + NULL, + NULL, + &daAlink_c::procCutLargeJumpInit, + &daAlink_c::procCutFastReadyInit, + &daAlink_c::procCopyRodReviveInit, + &daAlink_c::procSwordPushInit, + &daAlink_c::procGanonFinishInit, + NULL, + NULL, + &daAlink_c::procHorseLookDownInit, + NULL, +}; static f32 l_autoUpHeight = 30.010000228881836f; static f32 l_autoDownHeight = -30.010000228881836f; -#include "d/actor/d_a_alink_grab.inc" - -#include "d/actor/d_a_alink_sumou.inc" - -#include "d/actor/d_a_alink_horse.inc" - -#include "d/actor/d_a_alink_canoe.inc" - -#include "d/actor/d_a_alink_crawl.inc" - static f32 l_ladderAnmBaseTransY = 102.00054168701172f; -#include "d/actor/d_a_alink_hang.inc" - -#include "d/actor/d_a_alink_swim.inc" - -#include "d/actor/d_a_alink_iceleaf.inc" - -#include "d/actor/d_a_alink_hook.inc" - -#include "d/actor/d_a_alink_spinner.inc" - -#include "d/actor/d_a_alink_bottle.inc" - -#include "d/actor/d_a_alink_kandelaar.inc" - -#include "d/actor/d_a_alink_whistle.inc" - static dCcD_SrcCyl l_cylSrc = { { - {0, {{AT_TYPE_WOLF_ATTACK, 3, 0x1A}, {0xD8FFFDFF, 5}, 0x73}}, + {0, {{AT_TYPE_WOLF_ATTACK, 3, 0x1A}, {(s32)0xD8FFFDFF, 5}, 0x73}}, {dCcD_SE_WOLF_BITE, 3, 1, 0, {1}}, {dCcD_SE_NONE, 6, 0, 0, {0}}, {0}, @@ -1522,7 +1482,7 @@ static dCcD_SrcCyl l_cylSrc = { static dCcD_SrcSph l_sphSrc = { { - {0, {{AT_TYPE_NORMAL_SWORD, 3, 0x1A}, {0xD8FBFDFF, 5}, 0x73}}, + {0, {{AT_TYPE_NORMAL_SWORD, 3, 0x1A}, {(s32)0xD8FBFDFF, 5}, 0x73}}, {dCcD_SE_SWORD, 3, 1, 0, {1}}, {dCcD_SE_NONE, 6, 0, 0, {0}}, {0}, @@ -1940,6 +1900,50 @@ static dJntColData_c l_wolfJntColData[] = { }, }; +#include "d/actor/d_a_alink_link.inc" + +#include "d/actor/d_a_alink_cut.inc" + +#include "d/actor/d_a_alink_damage.inc" + +#include "d/actor/d_a_alink_guard.inc" + +#include "d/actor/d_a_alink_bow.inc" + +#include "d/actor/d_a_alink_boom.inc" + +#include "d/actor/d_a_alink_copyrod.inc" + +#include "d/actor/d_a_alink_hvyboots.inc" + +#include "d/actor/d_a_alink_bomb.inc" + +#include "d/actor/d_a_alink_grab.inc" + +#include "d/actor/d_a_alink_sumou.inc" + +#include "d/actor/d_a_alink_horse.inc" + +#include "d/actor/d_a_alink_canoe.inc" + +#include "d/actor/d_a_alink_crawl.inc" + +#include "d/actor/d_a_alink_hang.inc" + +#include "d/actor/d_a_alink_swim.inc" + +#include "d/actor/d_a_alink_iceleaf.inc" + +#include "d/actor/d_a_alink_hook.inc" + +#include "d/actor/d_a_alink_spinner.inc" + +#include "d/actor/d_a_alink_bottle.inc" + +#include "d/actor/d_a_alink_kandelaar.inc" + +#include "d/actor/d_a_alink_whistle.inc" + #include "d/actor/d_a_alink_ironball.inc" #include "d/actor/d_a_alink_demo.inc" @@ -2012,24 +2016,24 @@ void daAlink_matAnm_c::calc(J3DMaterial* i_material) const { if (!daAlink_getAlinkActorClass()->checkStatusWindowDraw()) { for (u32 i = 0; i < 8; i++) { if (getTexMtxAnm(i).getAnmFlag()) { - J3DTexMtxInfo* info = &i_material->getTexGenBlock()->getTexMtx(i)->getTexMtxInfo(); + J3DTextureSRTInfo* srt = &i_material->getTexGenBlock()->getTexMtx(i)->getTexMtxInfo().mSRT; if (m_morf_frame != 0) { if (!mSetFlag) { f32 var_f31 = 1.0f / (m_morf_frame + 1); - info->mSRT.mTranslationX = field_0xf4 * (1.0f - var_f31) + info->mSRT.mTranslationX * var_f31; - info->mSRT.mTranslationY = field_0xf8 * (1.0f - var_f31) + info->mSRT.mTranslationY * var_f31; + srt->mTranslationX = field_0xf4 * (1.0f - var_f31) + srt->mTranslationX * var_f31; + srt->mTranslationY = field_0xf8 * (1.0f - var_f31) + srt->mTranslationY * var_f31; mSetFlag = 1; } else { - info->mSRT.mTranslationX = field_0xf4; - info->mSRT.mTranslationY = field_0xf8; + srt->mTranslationX = field_0xf4; + srt->mTranslationY = field_0xf8; } } else if (m_eye_move_flg) { - info->mSRT.mTranslationX = mNowOffsetX; - info->mSRT.mTranslationY = mNowOffsetY; + srt->mTranslationX = mNowOffsetX; + srt->mTranslationY = mNowOffsetY; } - field_0xf4 = info->mSRT.mTranslationX; - field_0xf8 = info->mSRT.mTranslationY; + field_0xf4 = srt->mTranslationX; + field_0xf8 = srt->mTranslationY; } } } @@ -2433,7 +2437,8 @@ bool daAlink_c::modelCallBack(int i_jointNo) { } static int daAlink_modelCallBack(J3DJoint* i_joint, int param_1) { - int jntNo = i_joint->getJntNo(); + J3DJoint* joint = i_joint; + int jntNo = joint->getJntNo(); daAlink_c* i_this = (daAlink_c*)j3dSys.getModel()->getUserArea(); if (param_1 == 0) { @@ -2491,7 +2496,8 @@ int daAlink_c::headModelCallBack(int i_jointNo) { } static int daAlink_headModelCallBack(J3DJoint* i_joint, int param_1) { - int joint_no = i_joint->getJntNo(); + J3DJoint* joint = i_joint; + int joint_no = joint->getJntNo(); daAlink_c* i_this = (daAlink_c*)j3dSys.getModel()->getUserArea(); if (param_1 == 0) { @@ -2514,7 +2520,8 @@ int daAlink_c::wolfModelCallBack(int i_jointNo) { } static int daAlink_wolfModelCallBack(J3DJoint* i_joint, int param_1) { - int joint_no = i_joint->getJntNo(); + J3DJoint* joint = i_joint; + int joint_no = joint->getJntNo(); daAlink_c* i_this = (daAlink_c*)j3dSys.getModel()->getUserArea(); if (param_1 == 0) { @@ -2538,6 +2545,9 @@ void daAlink_c::setHatAngle() { cXyz sp9C; cXyz sp90; + f32 sp40; + f32 sp3C; + int sp38; if (checkNoResetFlg2(daPy_FLG2(FLG2_UNK_100000 | FLG2_UNK_80000))) { sp38 = 0; @@ -2546,6 +2556,7 @@ void daAlink_c::setHatAngle() { } mDoMtx_multVecZero(mpLinkHatModel->getAnmMtx(sp38), &spA8); + sp3C = field_0x34e0.y - mpLinkHatModel->getAnmMtx(0)[1][3]; BOOL sp34; if (!checkEndResetFlg1(ERFLG1_UNK_80000) @@ -2556,7 +2567,6 @@ void daAlink_c::setHatAngle() { sp34 = FALSE; } - f32 sp40; dKyw_get_AllWind_vec(&spA8, &spB4, &sp40); if (checkModeFlg(0x40000) || checkEndResetFlg1(ERFLG1_UNK_80000)) { @@ -2569,6 +2579,8 @@ void daAlink_c::setHatAngle() { f32 var_f28; f32 temp_f26 = 25.0f * (sp40 * sp40); + s16 sp18; + s16 sp16; s16 sp14 = field_0x3060; s16 sp12 = field_0x3062; cXyz sp84 = eyePos - field_0x34e0; @@ -2578,10 +2590,12 @@ void daAlink_c::setHatAngle() { mDoMtx_multVecZero(mpLinkHatModel->getAnmMtx(0), &sp90); sp90 = field_0x34e0 - sp90; mDoMtx_multVecSR(mMagneBootInvMtx, &sp90, &sp90); + sp3C = sp90.y; } field_0x3062 = sp84.atan2sX_Z(); + s16 sp10; s16 spE; if (mProcID == PROC_GOAT_CATCH) { mDoMtx_multVecSR(mpLinkModel->getAnmMtx(1), &cXyz::BaseY, &sp90); @@ -2601,14 +2615,14 @@ void daAlink_c::setHatAngle() { field_0x3060 = sp84.atan2sY_XZ(); } - f32 temp_f1 = sp84.absXZ(); - if (temp_f1 < 0.01f) { + f32 var_f31 = sp84.absXZ(); + if (var_f31 < 0.01f) { var_f29 = cM_ssin(spE); var_f28 = cM_scos(spE); } else { - f32 temp_f31 = 1.0f / temp_f1; - var_f29 = sp84.x * temp_f31; - var_f28 = sp84.z * temp_f31; + var_f31 = 1.0f / var_f31; + var_f29 = sp84.x * var_f31; + var_f28 = sp84.z * var_f31; } s16 spC; @@ -2653,11 +2667,11 @@ void daAlink_c::setHatAngle() { } if (fabsf(sp9C.x) < 0.01f) { - sp9C.x = (f32) 0.0f; + sp9C.x = 0.0f; } if (fabsf(sp9C.z) < 0.01f) { - sp9C.z = (f32) 0.0f; + sp9C.z = 0.0f; } if (checkMagneBootsOn()) { @@ -2672,9 +2686,6 @@ void daAlink_c::setHatAngle() { mDoMtx_stack_c::multVecSR(&cXyz::BaseY, &sp78); mDoMtx_stack_c::multVec(&cXyz::BaseX, &sp6C); - s16 sp18; - s16 sp16; - int sp30; if (sp6C.y < mDoMtx_stack_c::get()[1][3] && !checkUnderMove0BckNoArc(ANM_DIE)) { sp30 = cM_atan2s(-sp78.y, -sp78.absXZ()); @@ -2693,7 +2704,7 @@ void daAlink_c::setHatAngle() { sp16 = *temp_r28; f32 temp_f27 = (sp9C.z * var_f28) + (sp9C.x * var_f29); - s16 sp10 = cM_atan2s(sp9C.y, -temp_f27); + sp10 = cM_atan2s(sp9C.y, -temp_f27); int sp24 = cLib_minMaxLimit(sp10 - field_0x3060, -0x3800, 0x3800); sp10 = (sp24 + field_0x3060); @@ -2728,9 +2739,10 @@ void daAlink_c::setHatAngle() { sp2C++; sp28++; - for (int i = 1; i < 3; i++, temp_r29++, temp_r28++, sp2C++, sp28++) { - temp_r29[0] -= ((s16)(temp_r29[-1] - sp18) >> 1); - temp_r28[0] -= ((s16)(temp_r28[-1] - sp16) >> 1); + int i; + for (i = 1; i < 3; i++, temp_r29++, temp_r28++, sp2C++, sp28++) { + ANGLE_SUB_2(temp_r29[0], ((s16)(temp_r29[-1] - sp18) >> 1)); + ANGLE_SUB_2(temp_r28[0], ((s16)(temp_r28[-1] - sp16) >> 1)); sp18 = temp_r29[0]; sp16 = temp_r28[0]; @@ -2746,7 +2758,7 @@ void daAlink_c::setHatAngle() { sp10 += temp_r29[0]; if (sp10 < sp30) { - temp_r29[0] += (sp30 - sp10); + ANGLE_ADD_2(temp_r29[0], sp30 - sp10); sp10 = sp30; } @@ -2770,7 +2782,7 @@ void daAlink_c::setHatAngle() { s16 sp8 = 1500.0f + (4060.0f * var_f30); field_0x3064 += sp8; - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { field_0x3066[i] = var_f25 * cM_deg2s(((i + 1) * 4)) * cM_scos((field_0x3064 - ((i + 3) * sp8))); } @@ -2788,6 +2800,8 @@ void daAlink_c::setHairAngle(cXyz* param_0, f32 param_1, f32 param_2) { f32 temp_f27 = param_0->absXZ(); if (var_f31 < 1.0f || temp_f27 < 1.0f) { + int dummy; // force stack pointer into r31 for debug + calcHairAngle(&field_0x302c[1]); calcHairAngle(&field_0x3040[1]); calcHairAngle(&field_0x302c[2]); @@ -2904,6 +2918,7 @@ bool daAlink_c::checkActorPosAngle(fopAc_ac_c* i_actor, cXyz** o_ppos) { } cXyz* daAlink_c::getNeckAimPos(cXyz* param_0, int* param_1, int param_2) { + cXyz* sp1C; fopAc_ac_c* look_actor = NULL; s16 spA = field_0x311c; field_0x311c = 0; @@ -2970,7 +2985,7 @@ cXyz* daAlink_c::getNeckAimPos(cXyz* param_0, int* param_1, int param_2) { field_0x28fc = fopAcM_GetID(lock_actor); } } else { - field_0x30f8 -= 1; + field_0x30f8--; } } } else { @@ -2984,7 +2999,6 @@ cXyz* daAlink_c::getNeckAimPos(cXyz* param_0, int* param_1, int param_2) { look_actor = dCam_getBody()->GetForceLockOnActor(); } - cXyz* sp1C; if (checkActorPosAngle(look_actor, &sp1C)) { return sp1C; } @@ -3293,7 +3307,7 @@ void daAlink_c::setEyeMove(cXyz* param_0, s16 param_1, s16 param_2) { var_f31 = 0.0f; } else if (!checkEventRun() && checkModeFlg(1) && checkNoResetFlg1(FLG1_UNK_2000) && (checkNoUpperAnime() || checkGrabAnime()) && (mProcID == PROC_WAIT || mProcID == PROC_GRAB_WAIT || mProcID == PROC_CROUCH || mProcID == PROC_HORSE_WAIT || mProcID == PROC_WOLF_WAIT)) { if (temp_r28 != 0) { - field_0x2fa7 = temp_r28 - 1; + field_0x2fa7 = --temp_r28; field_0x3418 = sp18; field_0x341c = sp14; } else if (0.0f != sp18 || 0.0f != sp14) { @@ -3487,12 +3501,12 @@ void daAlink_c::setMoveSlantAngle() { if (mProcID == PROC_WOLF_SWIM_MOVE) { if (var_r29 >= 0) { - var_r29 -= 0x100; + ANGLE_SUB_2(var_r29, 0x100); if (var_r29 < 0) { var_r29 = 0; } } else { - var_r29 += 0x100; + ANGLE_ADD_2(var_r29, 0x100); if (var_r29 > 0) { var_r29 = 0; } @@ -3500,7 +3514,7 @@ void daAlink_c::setMoveSlantAngle() { } var_r29 = cLib_minMaxLimit((s16)var_r29, -0x300, 0x300); - var_r29 *= 8; + var_r29 <<= 3; } else { var_r28 = 0; var_r29 = 0; @@ -3516,13 +3530,13 @@ void daAlink_c::setMoveSlantAngle() { cLib_addCalcAngleS(&field_0x2fec, var_r29, 4, 1200, 200); } } else if (mProcID != PROC_CAUGHT) { - shape_angle.z = (field_0x2fee >> 1); - mBodyAngle.z = shape_angle.z; + shape_angle.z = field_0x2fee >> 1; + mBodyAngle.z = (s16)shape_angle.z; if (mProcID == PROC_MOVE || mProcID == PROC_WAIT) { var_r29 = (s16)(shape_angle.y - mPrevAngleY) * 2; if (mProcID == PROC_WAIT) { - var_r29 *= 2; + var_r29 <<= 1; } var_r29 = cLib_minMaxLimit((s16)var_r29, -0xC00, 0xC00); @@ -3536,9 +3550,9 @@ void daAlink_c::setMoveSlantAngle() { } int daAlink_c::setArmMatrix() { + static const u16 armJointTable[] = {0x0007,0x000C}; static Vec const arm1Vec = {29.0f, 0.0f, 0.0f}; static Vec const arm2Vec = {26.5f, 0.0f, 0.0f}; - static const u16 armJointTable[] = {0x0007,0x000C}; daAlink_footData_c* var_r29 = mFootData2; @@ -3602,16 +3616,17 @@ int daAlink_c::setArmMatrix() { } int daAlink_c::setFootMatrix() { + static const u16 footJointTable[] = {0x0012, 0x0017}; static Vec const leg1Vec = {30.0f, 0.0f, 0.0f}; static Vec const leg2Vec = {39.363499f, 0.0f, 0.0f}; static Vec const footVec = {14.18f, 0.0f, 0.0f}; - static const u16 footJointTable[] = {0x0012, 0x0017}; daAlink_footData_c* var_r30 = mFootData1; int i; + int j; for (i = 0; i < 2; i++, var_r30++) { - for (int j = 0; j < 3; j++) { + for (j = 0; j < 3; j++) { cMtx_copy(mpLinkModel->getAnmMtx(j + footJointTable[i]), var_r30->field_0x14[j]); } @@ -3627,14 +3642,15 @@ int daAlink_c::setFootMatrix() { if (mProcID == PROC_HORSE_GETOFF) { current.angle.y = shape_angle.y; if (field_0x2fc0 == 0) { - shape_angle.y -= 0x4000; + ANGLE_SUB_2(shape_angle.y, 0x4000); } else { - shape_angle.y += 0x4000; + ANGLE_ADD_2(shape_angle.y, 0x4000); } } + u16 temp_r29; for (i = 0; i < 2; i++, var_r30++) { - u16 temp_r29 = footJointTable[i]; + temp_r29 = footJointTable[i]; setMatrixWorldAxisRot(mpLinkModel->getAnmMtx(temp_r29), var_r30->field_0x6, 0, 0, 0, NULL); mDoMtx_stack_c::multVec(&leg1Vec, &sp10); @@ -3645,8 +3661,8 @@ int daAlink_c::setFootMatrix() { temp_r29++; setMatrixWorldAxisRot(mpLinkModel->getAnmMtx(temp_r29), var_r30->field_0x2, 0, 0, 0, &sp10); - temp_r29++; mDoMtx_stack_c::multVec(&footVec, &sp10); + temp_r29++; setMatrixWorldAxisRot(mpLinkModel->getAnmMtx(temp_r29), var_r30->field_0x2, 0, 0, 0, &sp10); } @@ -3741,22 +3757,23 @@ int daAlink_c::setLegAngle(f32 param_0, daAlink_footData_c* param_1, s16* param_ } cXyz sp50 = sp5C - spA4; - f32 temp_f1 = sp50.abs2(); - if (cM3d_IsZero(temp_f1)) { + f32 var_f31 = sp50.abs2(); + if (cM3d_IsZero(var_f31)) { return 0; } - f32 temp_f28 = sp74.abs2(); - f32 temp_f26 = sp68.abs2(); + f32 var_f29; + f32 var_f28 = sp74.abs2(); + f32 var_f26 = sp68.abs2(); - if (JMAFastSqrt(temp_f28) + JMAFastSqrt(temp_f26) <= JMAFastSqrt(temp_f1)) { + if (JMAFastSqrt(var_f28) + JMAFastSqrt(var_f26) <= JMAFastSqrt(var_f31)) { return 0; } - f32 temp_f27 = ((temp_f1 + temp_f28) - temp_f26) / (2.0f * temp_f1); - cXyz sp44 = spA4 + (sp50 * temp_f27); + f32 var_f27 = ((var_f31 + var_f28) - var_f26) / (2.0f * var_f31); + cXyz sp44 = spA4 + (sp50 * var_f27); - f32 var_f30 = temp_f28 - (temp_f27 * (temp_f1 * temp_f27)); + f32 var_f30 = var_f28 - (var_f27 * (var_f31 * var_f27)); if (var_f30 < 0.0f) { var_f30 = 0.0f; } @@ -3774,20 +3791,24 @@ int daAlink_c::setLegAngle(f32 param_0, daAlink_footData_c* param_1, s16* param_ sp80.set(-sp50.y, sp50.x, 0.0f); } - f32 temp_f1_2 = sp80.abs(); - if (cM3d_IsZero(temp_f1_2)) { + var_f29 = sp80.abs(); + if (cM3d_IsZero(var_f29)) { return 0; } - cXyz sp38 = sp44 + (sp80 * (var_f30 / temp_f1_2)); + var_f29 = var_f30 / var_f29; + cXyz sp38 = sp44 + (sp80 * var_f29); cXyz sp2C = sp38 - spA4; cXyz sp20 = sp5C - sp38; + s16 temp_r30; + s16 var_r29; + s16 temp_r0; if (param_4 != 0) { - s16 temp_r30 = cM_atan2s(sp2C.y, sp2C.z); - s16 var_r29 = cM_atan2s(sp20.y, sp20.z); - s16 temp_r0 = var_r29 - temp_r30; + temp_r30 = cM_atan2s(sp2C.y, sp2C.z); + var_r29 = cM_atan2s(sp20.y, sp20.z); + temp_r0 = var_r29 - temp_r30; if (checkWolf()) { if (temp_r0 < 0) { @@ -3804,11 +3825,11 @@ int daAlink_c::setLegAngle(f32 param_0, daAlink_footData_c* param_1, s16* param_ *param_2 = cM_atan2s(sp74.y, sp74.z) - temp_r30; *param_3 = cM_atan2s(sp68.y, sp68.z) - var_r29; } else { - s16 temp_r30_2 = cM_atan2s(sp2C.x, sp2C.y); - s16 temp_r29 = cM_atan2s(sp20.x, sp20.y); + temp_r30 = cM_atan2s(sp2C.x, sp2C.y); + var_r29 = cM_atan2s(sp20.x, sp20.y); - *param_2 = cM_atan2s(sp74.x, sp74.y) - temp_r30_2; - *param_3 = cM_atan2s(sp68.x, sp68.y) - temp_r29; + *param_2 = cM_atan2s(sp74.x, sp74.y) - temp_r30; + *param_3 = cM_atan2s(sp68.x, sp68.y) - var_r29; } return 1; @@ -4049,6 +4070,7 @@ JKRHeap* daAlink_c::setItemHeap() { * The latter 3 digits are the resource ID */ void daAlink_c::setIdxMask(u16* o_arcNo, u16* o_resIdx) { + UNUSED(o_resIdx); if (*o_arcNo == 0xFFFF) { u16 arc_id = (*o_resIdx >> 12) & 0xF; *o_resIdx &= 0xFFF; @@ -4513,16 +4535,16 @@ void daAlink_c::playerInit() { m_nSwordBtk->searchUpdateMaterialID(modelData); modelData->entryTexMtxAnimator(m_nSwordBtk); - J3DModelData* modelData2 = mpSwMModel->getModelData(); + modelData = mpSwMModel->getModelData(); m_mSwordBtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, dRes_ID_ALINK_BTK_AL_SWM_e); JUT_ASSERT(4767, m_mSwordBtk); - m_mSwordBtk->searchUpdateMaterialID(modelData2); - modelData2->entryTexMtxAnimator(m_mSwordBtk); + m_mSwordBtk->searchUpdateMaterialID(modelData); + modelData->entryTexMtxAnimator(m_mSwordBtk); m_mSwordBrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, dRes_ID_ALINK_BRK_AL_SWM_e); JUT_ASSERT(4774, m_mSwordBrk != NULL); - m_mSwordBrk->searchUpdateMaterialID(modelData2); - modelData2->entryTevRegAnimator(m_mSwordBrk); + m_mSwordBrk->searchUpdateMaterialID(modelData); + modelData->entryTevRegAnimator(m_mSwordBrk); mWaterY = -G_CM3D_F_INF; field_0x33b8 = -G_CM3D_F_INF; @@ -4585,8 +4607,9 @@ void daAlink_c::playerInit() { field_0x2f96 = -1; field_0x2f97 = -1; - for (int i = 0; i < 16; i++) { - mShieldArrowIDs[i] = fpcM_ERROR_PROCESS_ID_e; + int i2; + for (i2 = 0; i2 < 16; i2++) { + mShieldArrowIDs[i2] = fpcM_ERROR_PROCESS_ID_e; } mAtnActorID = fpcM_ERROR_PROCESS_ID_e; @@ -4616,6 +4639,10 @@ void daAlink_c::playerInit() { } } +void dummy(fopAc_ac_c* i_this) { + fopAcM_RegisterCreateID(i_this, "ALINK"); +} + BOOL daAlink_c::checkHorseStart(u32 i_lastMode, int i_startMode) { return i_lastMode == 1 || i_startMode == 2 || i_lastMode == 8; } @@ -4785,7 +4812,7 @@ int daAlink_c::setStartProcInit() { mMoveAngle = shape_angle.y; if (last_mode == 3) { - shape_angle.y += 0x8000; + ANGLE_ADD_2(shape_angle.y, 0x8000); current.angle.y = shape_angle.y; mPrevAngleY = shape_angle.y; } @@ -5493,6 +5520,7 @@ void daAlink_c::setBodyPartPos() { static Vec const boardLocalEyeFromRoot = {9.5f, 47.0f, 24.5f}; static Vec const horseLocalEyeFromRoot = {1.75f, 55.0f, 25.5f}; static Vec const canoeLocalEyeFromRoot = {0.0f, 55.0f, 25.0f}; + static Vec const wlLocalEyeFromRoot = {0.0f, -6.0f, 85.5f}; if (checkWolf()) { cMtx_multVec(mpLinkModel->getAnmMtx(4), &wlLocalEye, &eyePos); @@ -5570,7 +5598,6 @@ int daAlink_c::setRollJump(f32 i_speedH, f32 i_speedV, s16 i_angle) { } void daAlink_c::setAttentionPos() { - static Vec const wlLocalEyeFromRoot = {0.0f, -6.0f, 85.5f}; static Vec const normalOffset = {0.0f, 150.0f, 0.0f}; static Vec const crawlOffset = {0.0f, 40.0f, 30.0f}; static Vec const crouchOffset = {0.0f, 95.0f, 0.0f}; @@ -6228,6 +6255,8 @@ void daAlink_c::setWolfAtCollision() { mTgCyls[i].OnAtSetBit(); } } + + (void)0; } else { mAtCyl.MoveCAt(sp8); } @@ -6608,7 +6637,8 @@ void daAlink_c::cancelLockAt() { void daAlink_c::setCollisionPos() { cXyz sp74; mDoMtx_multVecZero(mpLinkModel->getAnmMtx(0), &sp74); - cXyz sp68 = (sp74 + mHeadTopPos) * 0.5f; + cXyz sp68; + sp68 = (sp74 + mHeadTopPos) * 0.5f; f32 var_f31; if (sp74.y > mHeadTopPos.y) { @@ -6628,30 +6658,29 @@ void daAlink_c::setCollisionPos() { mTgCyls[2].SetH(var_f31); sp68 = (((mLeftFootPos + mRightFootPos) * 0.5f) + sp74) * 0.5f; - f32 var_f0 = mLeftFootPos.y > mRightFootPos.y ? mRightFootPos.y : mLeftFootPos.y; + f32 var_f30 = mLeftFootPos.y > mRightFootPos.y ? mRightFootPos.y : mLeftFootPos.y; - f32 var_f31_2; - if (sp74.y > var_f0) { - sp68.y = var_f0; - var_f31_2 = sp74.y - var_f0; + if (sp74.y > var_f30) { + sp68.y = var_f30; + var_f31 = sp74.y - var_f30; } else { sp68.y = sp74.y; - var_f31_2 = var_f0 - sp74.y; + var_f31 = var_f30 - sp74.y; } - if (var_f31_2 < 60.0f) { - sp68.y -= 0.5f * (60.0f - var_f31_2); - var_f31_2 = 60.0f; + if (var_f31 < 60.0f) { + sp68.y -= 0.5f * (60.0f - var_f31); + var_f31 = 60.0f; } mTgCyls[0].SetC(sp68); - mTgCyls[0].SetH(var_f31_2); + mTgCyls[0].SetH(var_f31); sp68 = (mTgCyls[0].GetC() + mTgCyls[2].GetC()) * 0.5f; - f32 temp_f31 = 0.5f * (mTgCyls[0].GetH() + mTgCyls[2].GetH()); + var_f31 = 0.5f * (mTgCyls[0].GetH() + mTgCyls[2].GetH()); mTgCyls[1].SetC(sp68); - mTgCyls[1].SetH(temp_f31); + mTgCyls[1].SetH(var_f31); field_0x3454 = field_0x3834.y; } @@ -7689,6 +7718,8 @@ void daAlink_c::setBlendMoveAnime(f32 i_morf) { field_0x2f97 = 6; } } + + (void)0; } else if (var_f31 < mpHIO->mMove.m.mRunChangeRate) { var_f28 = (var_f31 - mpHIO->mMove.m.mWalkChangeRate) / (mpHIO->mMove.m.mRunChangeRate - mpHIO->mMove.m.mWalkChangeRate); setDoubleAnime(var_f28, var_f29, sp2C, var_r28, sp18, 1, i_morf); @@ -8543,8 +8574,8 @@ void daAlink_c::setFrontWallType() { sp40 = linchk_tri.getSignedLenPos(¤t.pos); field_0x34ec.set(current.pos.x - (sp40 * linchk_tri.mNormal.x), current.pos.y, current.pos.z - (sp40 * linchk_tri.mNormal.z)); - int temp_r3 = dComIfG_Bgsp().GetWallCode(mLinkLinChk); - if (temp_r3 != 4 && temp_r3 != 5) { + wall_code = dComIfG_Bgsp().GetWallCode(mLinkLinChk); + if (wall_code != 4 && wall_code != 5) { line_start_pos.x = current.pos.x; line_start_pos.z = current.pos.z; line_end_pos.x = line_start_pos.x - (2.0f * sp40 * linchk_tri.mNormal.x); @@ -8607,6 +8638,7 @@ void daAlink_c::setFrontWallType() { field_0x27fc = dComIfG_Bgsp().GetActorPointer(mLinkLinChk); } + f32 sp38; if (checkNoResetFlg0(daPy_FLG0(FLG0_WATER_IN_MOVE | FLG0_SWIM_UP))) { if (var_r29 == 6 && !checkModeFlg(0x40002)) { setDoStatus(BUTTON_STATUS_ENTER); @@ -8641,7 +8673,7 @@ void daAlink_c::setFrontWallType() { line_start_pos.set(field_0x34ec.x - (15.0f * linchk_tri.mNormal.x), 150.0f + sp34, field_0x34ec.z - (15.0f * linchk_tri.mNormal.z)); mLinkGndChk.SetPos(&line_start_pos); - f32 sp38 = dComIfG_Bgsp().GroundCross(&mLinkGndChk); + sp38 = dComIfG_Bgsp().GroundCross(&mLinkGndChk); if (sp38 >= current.pos.y && dBgS_CheckBGroundPoly(mLinkGndChk)) { cM3dGPla spB8; @@ -8750,7 +8782,7 @@ void daAlink_c::setFrontWallType() { line_start_pos.set(field_0x34ec.x - (1.5f * linchk_tri.mNormal.x), body_height + (0.01f + hang_height), field_0x34ec.z - (1.5f * linchk_tri.mNormal.z)); mLinkGndChk.SetPos(&line_start_pos); - f32 sp38 = dComIfG_Bgsp().GroundCross(&mLinkGndChk); + sp38 = dComIfG_Bgsp().GroundCross(&mLinkGndChk); if (-G_CM3D_F_INF != sp38 && fabsf(sp1C - sp38) < l_autoUpHeight) { found_gnd_tri = dComIfG_Bgsp().GetTriPla(mLinkGndChk, &gndchk_tri); @@ -9314,8 +9346,7 @@ void daAlink_c::setStickData() { mDemo.setMoveAngle(getSceneExitMoveAngle()); if (checkHorseRide()) { - s16 angle = mDemo.getMoveAngle(); - dComIfGp_getHorseActor()->changeDemoMoveAngle(angle); + dComIfGp_getHorseActor()->changeDemoMoveAngle(mDemo.getMoveAngle()); } } else { mStickValue = 0.0f; @@ -9381,47 +9412,47 @@ void daAlink_c::setStickData() { } if (mDoCPd_c::getTrigB(PAD_1)) { - mItemTrigger |= BTN_B; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_B; } if (mDoCPd_c::getTrigA(PAD_1)) { - mItemTrigger |= BTN_A; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_A; } if (mDoCPd_c::getTrigX(PAD_1)) { - mItemTrigger |= BTN_X; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_X; } if (mDoCPd_c::getTrigY(PAD_1)) { - mItemTrigger |= BTN_Y; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_Y; } if (mDoCPd_c::getTrigZ(PAD_1)) { - mItemTrigger |= BTN_Z; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_Z; } if (mDoCPd_c::getTrigL(PAD_1)) { - mItemTrigger |= BTN_L; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_L; } if (mDoCPd_c::getTrigLockR(PAD_1)) { - mItemTrigger |= BTN_R; + mItemTrigger |= (daAlink_ITEM_BTN)BTN_R; } if (mDoCPd_c::getHoldA(PAD_1)) { - mItemButton |= BTN_A; + mItemButton |= (daAlink_ITEM_BTN)BTN_A; } if (mDoCPd_c::getHoldB(PAD_1)) { - mItemButton |= BTN_B; + mItemButton |= (daAlink_ITEM_BTN)BTN_B; } if (mDoCPd_c::getHoldX(PAD_1)) { - mItemButton |= BTN_X; + mItemButton |= (daAlink_ITEM_BTN)BTN_X; } if (mDoCPd_c::getHoldY(PAD_1)) { - mItemButton |= BTN_Y; + mItemButton |= (daAlink_ITEM_BTN)BTN_Y; } if (mDoCPd_c::getHoldZ(PAD_1)) { - mItemButton |= BTN_Z; + mItemButton |= (daAlink_ITEM_BTN)BTN_Z; } if (mDoCPd_c::getHoldL(PAD_1)) { - mItemButton |= BTN_L; + mItemButton |= (daAlink_ITEM_BTN)BTN_L; } if (mDoCPd_c::getHoldLockR(PAD_1)) { - mItemButton |= BTN_R; + mItemButton |= (daAlink_ITEM_BTN)BTN_R; } if (checkHeavyStateOn(TRUE, TRUE) && @@ -9682,7 +9713,7 @@ s16 daAlink_c::getShapeAngleYAtnActor() { } if (checkWolfShapeReverse()) { - var_r29 += 0x8000; + ANGLE_ADD_2(var_r29, 0x8000); } } else { var_r29 = shape_angle.y; @@ -9799,8 +9830,9 @@ void daAlink_c::setNormalSpeedF(f32 i_speed, f32 i_deceleration) { ) { dBgS_AcchCir* acch_cir = mAcchCir; + int i; if (mLinkAcch.ChkWallHit()) { - for (int i = 0; i < 3; i++, acch_cir++) { + for (i = 0; i < 3; i++, acch_cir++) { if (acch_cir->ChkWallHit()) { var_r29 = (current.angle.y + 0x8000) - acch_cir->GetWallAngleY(); break; @@ -9810,7 +9842,10 @@ void daAlink_c::setNormalSpeedF(f32 i_speed, f32 i_deceleration) { field_0x30fc = 3; field_0x30fa = cM_atan2s(field_0x342c, field_0x3430); var_r29 = (current.angle.y + 0x8000) - field_0x30fa; - } else if (field_0x30fc == 1 && mGrabItemAcKeep.getActor() != NULL && current.pos.abs2(field_0x3540) < 1.0f && dComIfG_Bgsp().ChkPolySafe(mPolyInfo4)) { + } else if (field_0x30fc == 1 && + mGrabItemAcKeep.getActor() != NULL && + current.pos.abs2(field_0x3540) < 1.0f && + dComIfG_Bgsp().ChkPolySafe(mPolyInfo4)) { field_0x30fc = 3; } @@ -9823,16 +9858,16 @@ void daAlink_c::setNormalSpeedF(f32 i_speed, f32 i_deceleration) { } if (checkNoResetFlg1(FLG1_UNK_20000000)) { - s16 temp_r29 = (current.angle.y + 0x8000) - field_0x3092; + var_r29 = (current.angle.y + 0x8000) - field_0x3092; - int temp_r3_2 = abs(temp_r29); + int temp_r3_2 = abs(var_r29); if (temp_r3_2 < 0x4000) { if (checkModeFlg(0x40000)) { - max_speed *= 1.0f - (0.8f * cM_scos(temp_r29)); + max_speed *= 1.0f - (0.8f * cM_scos(var_r29)); } else if (temp_r3_2 < 0x600) { max_speed = 0.0f; } else { - max_speed *= 1.0f - cM_scos(temp_r29); + max_speed *= 1.0f - cM_scos(var_r29); } if (!checkWolf() && !checkMagneBootsOn()) { @@ -9891,7 +9926,9 @@ void daAlink_c::setSpeedAndAngleNormal() { dBgS_AcchCir* acchCir = mAcchCir; for (int i = 0; i < 3; i++, acchCir++) { if (acchCir->ChkWallHit()) { - abs((s16)((current.angle.y + 0x8000) - acchCir->GetWallAngleY())); + if (abs((s16)((current.angle.y + 0x8000) - acchCir->GetWallAngleY())) < 0x4000) { + var_r26 = true; + } break; } } @@ -9994,34 +10031,34 @@ void daAlink_c::setSpeedAndAngleNormal() { void daAlink_c::setSpeedAndAngleAtn() { int var_r29 = field_0x2f98; + s16 angleRate; + s16 angleMaxStep; + s16 angleMinStep; + + f32 speed; + f32 acceleration; + f32 deceleration; + if (checkInputOnR()) { - s16 temp_r0 = mMoveAngle - shape_angle.y; - f32 temp_f27 = cM_ssin(temp_r0); - f32 temp_f29 = cM_scos(temp_r0); + s16 var_r24 = mMoveAngle - shape_angle.y; + f32 var_f27 = cM_ssin(var_r24); + f32 var_f31 = cM_scos(var_r24); - if (mTargetedActor == NULL && !checkGoatStopGame() && (temp_f29 <= -0.99f || temp_f29 >= 0.99f)) { - if (temp_f29 <= -0.99f) { + if (mTargetedActor == NULL && !checkGoatStopGame() && (var_f31 <= -0.99f || var_f31 >= 0.99f)) { + if (var_f31 <= -0.99f) { var_r29 = 1; } else { var_r29 = 0; } - } else if (temp_f29 < -0.866f) { + } else if (var_f31 < -0.866f) { var_r29 = 1; - } else if (temp_f27 > 0.0f) { + } else if (var_f27 > 0.0f) { var_r29 = 2; - } else if (temp_f27 < 0.0f) { + } else if (var_f27 < 0.0f) { var_r29 = 3; } } - s16 angleRate; - s16 angleMaxStep; - s16 angleMinStep; - - f32 acceleration; - f32 deceleration; - f32 speed; - if (mTargetedActor != NULL) { angleRate = mpHIO->mAtnMove.m.mTurnAngleRate; angleMaxStep = mpHIO->mAtnMove.m.mMaxTurnAngle; @@ -10038,7 +10075,7 @@ void daAlink_c::setSpeedAndAngleAtn() { if (var_r29 == 0) { if (checkInputOnR()) { if (getDirectionFromCurrentAngle() == DIR_BACKWARD) { - current.angle.y += 0x8000; + ANGLE_ADD_2(current.angle.y, 0x8000); mNormalSpeed *= -1.0f; } if (checkZeroSpeedF()) { @@ -10065,7 +10102,7 @@ void daAlink_c::setSpeedAndAngleAtn() { if (checkInputOnR()) { if (getDirectionFromCurrentAngle() == DIR_BACKWARD) { - current.angle.y += 0x8000; + ANGLE_ADD_2(current.angle.y, 0x8000); mNormalSpeed *= -1.0f; } @@ -10228,6 +10265,7 @@ void daAlink_c::decideCommonDoStatus() { } else if (mFastShotTime != 0) { setDoStatus(BUTTON_STATUS_BACK); } + (void)0; } else if (checkWolf()) { if (checkDownAttackState()) { setDoStatusEmphasys(BUTTON_STATUS_FINISH); @@ -10270,6 +10308,7 @@ void daAlink_c::decideCommonDoStatus() { { setDoStatus(BUTTON_STATUS_NONE); } + (void)0; } else { int direction = getDirectionFromShapeAngle(); f32 frontRollRate = getFrontRollRate(); @@ -10369,6 +10408,7 @@ void daAlink_c::decideDoStatus() { if (field_0x2f91 == 7 || field_0x2f91 == 8 || field_0x2f91 == 6 || field_0x2f91 == 9) { setDoStatus(BUTTON_STATUS_UNK_32); } + (void)0; } else { if (searchFmChainPos()) { setChainGrabStatus(BUTTON_STATUS_UNK_150); @@ -11913,7 +11953,12 @@ void daAlink_c::swordUnequip() { anm_speed = mpHIO->mCut.m.mUnequipAnm.mSpeed; } - u16 anm_id = checkReinRide() ? (u16)dRes_ID_ALANM_BCK_WAITHATOHS_e : (u16)dRes_ID_ALANM_BCK_WAITATOS_e; + u16 anm_id; + if (checkReinRide()) { + anm_id = (u16)dRes_ID_ALANM_BCK_WAITHATOHS_e; + } else { + anm_id = (u16)dRes_ID_ALANM_BCK_WAITATOS_e; + } setUpperAnime(anm_id, UPPER_2, anm_speed, mpHIO->mCut.m.mUnequipAnm.mStartFrame, mpHIO->mCut.m.mUnequipAnm.mEndFrame, @@ -12819,6 +12864,7 @@ void daAlink_c::transAnimeProc(cXyz* param_0, f32 param_1, f32 param_2) { } void daAlink_c::setFootSpeed() { + int i; cXyz sp18[2]; f32 var_f31; @@ -12846,12 +12892,12 @@ void daAlink_c::setFootSpeed() { } else { var_f31 = 0.0f; - for (int i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { sp18[i] = current.pos; } } - for (int i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { field_0x37b0[i] = sp18[i]; } @@ -12899,7 +12945,7 @@ void daAlink_c::posMove() { speedF *= mpHIO->mSwim.m.mFloatUpSwimSpeedRate; } - f32 var_f31 = speedF; + f32 sp28 = speedF; speedF *= cM_scos(var_r26); if (var_r26 < 0 && !checkBoardRide() && !checkModeFlg(MODE_SWIMMING)) { @@ -12928,20 +12974,20 @@ void daAlink_c::posMove() { cM3dGPla plane; dComIfG_Bgsp().GetTriPla(mLinkAcch.m_gnd, &plane); - f32 temp_f0 = cM_sht2d(cM_atan2s(plane.mNormal.absXZ(), plane.mNormal.y)); + f32 sp24 = cM_sht2d(cM_atan2s(plane.mNormal.absXZ(), plane.mNormal.y)); - if (temp_f0 >= mpHIO->mSlide.m.mLV2MinibossFloorWeakSlideAngle && - temp_f0 <= mpHIO->mSlide.m.mLV2MinibossFloorSlideAngle) + if (sp24 >= mpHIO->mSlide.m.mLV2MinibossFloorWeakSlideAngle && + sp24 <= mpHIO->mSlide.m.mLV2MinibossFloorSlideAngle) { - temp_f0 = ((temp_f0 - mpHIO->mSlide.m.mLV2MinibossFloorWeakSlideAngle) * + f32 sp20 = ((sp24 - mpHIO->mSlide.m.mLV2MinibossFloorWeakSlideAngle) * mpHIO->mSlide.m.mLV2MinibossFloorWeakSlideSpeed) / (mpHIO->mSlide.m.mLV2MinibossFloorSlideAngle - mpHIO->mSlide.m.mLV2MinibossFloorWeakSlideAngle); plane.mNormal.y = 0.0f; plane.mNormal.normalizeZP(); - speed.x += temp_f0 * plane.mNormal.x; - speed.z += temp_f0 * plane.mNormal.z; + speed.x += sp20 * plane.mNormal.x; + speed.z += sp20 * plane.mNormal.z; } } } @@ -12971,7 +13017,7 @@ void daAlink_c::posMove() { } } } else if (!checkEquipHeavyBoots() && getZoraSwim()) { - speed.y = -var_f31 * cM_ssin(var_r26); + speed.y = -sp28 * cM_ssin(var_r26); } else if ((checkBootsOrArmorHeavy() && mProcID != PROC_DEAD) || mProcID == PROC_SWIM_DIVE) { speed.y += gravity; @@ -13026,7 +13072,13 @@ void daAlink_c::posMove() { } setIceSlipSpeed(); - var_f31 = current.pos.y; + f32 sp1C = current.pos.y; + + f32 sp18; + f32 sp14; + f32 sp10; + f32 sp0C; + f32 sp08; if (!checkModeFlg(0x400) || checkBoardRide()) { if (checkMagneBootsOn()) { @@ -13034,7 +13086,7 @@ void daAlink_c::posMove() { mDoMtx_stack_c::YrotM(current.angle.y); Vec spFC = {0.0f, 0.0f, 0.0f}; - spFC.z = speedF; + sp08 = spFC.z = speedF; mDoMtx_stack_c::multVecSR(&spFC, &speed); current.pos += speed; current.pos.x += field_0x342c; @@ -13055,7 +13107,7 @@ void daAlink_c::posMove() { } if (getSumouMode() && mProcID != PROC_SUMOU_WIN_LOSE) { - current.pos.y = var_f31 - 1.0f; + current.pos.y = sp1C - 1.0f; speed.y = gravity; } @@ -13078,11 +13130,11 @@ void daAlink_c::posMove() { } if (mLinkAcch.ChkGroundHit() && dComIfG_Bgsp().ChkPolySafe(mLinkAcch.m_gnd)) { - s16 angle1 = getGroundAngle(&mLinkAcch.m_gnd, 0); - current.pos.z += field_0x35c4.z * cM_scos(angle1); + s16 angle = getGroundAngle(&mLinkAcch.m_gnd, 0); + current.pos.z += field_0x35c4.z * cM_scos(angle); - s16 angle2 = getGroundAngle(&mLinkAcch.m_gnd, 0x4000); - current.pos.x += field_0x35c4.x * cM_scos(angle2); + angle = getGroundAngle(&mLinkAcch.m_gnd, 0x4000); + current.pos.x += field_0x35c4.x * cM_scos(angle); if (checkZeroSpeedF() && field_0x35c4.abs2() > SQUARE(3.0f)) { seStartOnlyReverbLevel(Z2SE_AL_ICE_SLIP); @@ -13101,29 +13153,31 @@ void daAlink_c::posMove() { current.pos += field_0x3594; } } else if (checkOctaIealSpecialCollect()) { - f32 temp_f1 = getHookshotTopPos()->abs(current.pos); + sp18 = getHookshotTopPos()->abs(current.pos); current.pos += *mCcStts.GetCCMoveP(); - f32 temp_f31 = getHookshotTopPos()->abs(current.pos); - if (temp_f31 > temp_f1) { - current.pos.y += temp_f31 - temp_f1; + sp14 = getHookshotTopPos()->abs(current.pos); + if (sp14 > sp18) { + current.pos.y += sp14 - sp18; } + + (void)0; } else if (!eventRunning && (mProcID == PROC_HANG_MOVE || mProcID == PROC_CLIMB_MOVE_SIDE || mProcID == PROC_CLIMB_MOVE_UPDOWN || mProcID == PROC_CLIMB_WAIT || mProcID == PROC_HANG_WAIT)) { - f32 temp_f31 = mCcStts.GetCCMoveP()->absXZ(); + f32 var_f29 = mCcStts.GetCCMoveP()->absXZ(); var_r27 = TRUE; - if (temp_f31 > 1.0f) { - s16 var_r23 = (s16)(mCcStts.GetCCMoveP()->atan2sX_Z() - shape_angle.y); - if (var_r23 >= 0) { - current.pos.x += temp_f31 * temp_f29; - current.pos.z -= temp_f31 * temp_f30; + if (var_f29 > 1.0f) { + s16 var_r23 = mCcStts.GetCCMoveP()->atan2sX_Z(); + if ((s16)(var_r23 - shape_angle.y) >= 0) { + current.pos.x += var_f29 * temp_f29; + current.pos.z -= var_f29 * temp_f30; } else { - current.pos.x -= temp_f31 * temp_f29; - current.pos.z += temp_f31 * temp_f30; + current.pos.x -= var_f29 * temp_f29; + current.pos.z += var_f29 * temp_f30; } } } @@ -13131,12 +13185,12 @@ void daAlink_c::posMove() { if (checkModeFlg(MODE_SWIMMING) && checkNoResetFlg0(FLG0_SWIM_UP)) { cXyz sp84 = current.pos - field_0x3798; - f32 temp_f3 = sp84.absXZ() * cM_ssin(getGroundAngle(&mLinkAcch.m_wtr, sp84.atan2sX_Z())); - if (temp_f3 < 0.0f) { - temp_f3 = 0.0f; + sp10 = sp84.absXZ() * cM_ssin(getGroundAngle(&mLinkAcch.m_wtr, sp84.atan2sX_Z())); + if (sp10 < 0.0f) { + sp10 = 0.0f; } - if (!(current.pos.y > mWaterY + l_autoUpHeight + temp_f3) && mProcID != PROC_SWIM_DIVE) { + if (!(current.pos.y > mWaterY + l_autoUpHeight + sp10) && mProcID != PROC_SWIM_DIVE) { current.pos.y = mWaterY; } } @@ -13154,11 +13208,10 @@ void daAlink_c::posMove() { sp78 = cXyz::Zero; } - f32 var_f0; if (checkModeFlg(MODE_PLAYER_FLY)) { - var_f0 = 1.0f; + sp0C = 1.0f; } else { - var_f0 = cM_scos(field_0x2ff0); + sp0C = cM_scos(field_0x2ff0); } if (!checkRootTransZClearMode()) { @@ -13169,8 +13222,8 @@ void daAlink_c::posMove() { sp78.x = 0.0f; } - field_0x3464 = var_f0 * (sp78.z * temp_f30 + sp78.x * temp_f29); - field_0x3468 = var_f0 * (sp78.z * temp_f29 - sp78.x * temp_f30); + field_0x3464 = sp0C * (sp78.z * temp_f30 + sp78.x * temp_f29); + field_0x3468 = sp0C * (sp78.z * temp_f29 - sp78.x * temp_f30); if (checkMagneBootsOn()) { cXyz spD8; @@ -13209,16 +13262,14 @@ void daAlink_c::posMove() { if (commonLineCheck(&spC0, &spB4)) { dComIfG_Bgsp().GetTriPla(mLinkLinChk, &plane); - f32 temp_f31 = spB4.abs(mLinkLinChk.GetCross()); + f32 var_f28 = spB4.abs(mLinkLinChk.GetCross()); mDoMtx_multVecSR(mMagneBootInvMtx, &plane.mNormal, &spCC); if (cBgW_CheckBWall(spCC.y)) { - f32 temp_f1 = spCC.absXZ(); - - f32 div = temp_f31 / temp_f1; - spCC.x *= div; + var_f28 /= spCC.absXZ(); + spCC.x *= var_f28; spCC.y = 0.0f; - spCC.z *= div; + spCC.z *= var_f28; mDoMtx_multVecSR(mMagneBootMtx, &spCC, &spCC); current.pos += spCC; @@ -13226,7 +13277,7 @@ void daAlink_c::posMove() { } } - var_r27 += 0x2000; + ANGLE_ADD_2(var_r27, 0x2000); } } else if (var_r27) { cXyz sp9C = cXyz::Zero; @@ -13361,7 +13412,7 @@ bool daAlink_c::startPeepChange() { dComIfGs_setTurnRestart(current.pos, shape_angle.y, fopAcM_GetRoomNo(this), param); } - dStage_changeScene(mPeepExitID, 0.0f, mode, fopAcM_GetRoomNo(this), + dStage_changeScene(mPeepExitID, 0.0f, mode, (int)fopAcM_GetRoomNo(this), shape_angle.y, -1); return 1; } @@ -13419,7 +13470,7 @@ void daAlink_c::setLastSceneMode(u32* o_mode) { } if (mSwordUpTimer != 0) { - *o_mode |= (mSwordUpTimer & 0xFFFE) << 0xA; + *o_mode |= (mSwordUpTimer / 2) << 11; } } @@ -13747,7 +13798,7 @@ int daAlink_c::checkSceneChange(int i_exitID) { } else { if (mExitID != 0x3F) { isScnChange = dStage_changeScene(mExitID & 0xFF, exit_speed, exit_mode, - fopAcM_GetRoomNo(this), shape_angle.y, -1); + (int)fopAcM_GetRoomNo(this), shape_angle.y, -1); if (isScnChange) { onNoResetFlg2(FLG2_SCENE_CHANGE_START); if (mpScnChg != NULL && fopAcM_GetName(mpScnChg) == PROC_SCENE_EXIT) { @@ -13760,7 +13811,7 @@ int daAlink_c::checkSceneChange(int i_exitID) { } } else { isScnChange = dStage_changeSceneExitId(mLinkAcch.m_gnd, exit_speed, exit_mode, - fopAcM_GetRoomNo(this), shape_angle.y); + (int)fopAcM_GetRoomNo(this), shape_angle.y); field_0x2f58 = dPath_GetRoomPath(dComIfG_Bgsp().GetRoomPathId(mLinkAcch.m_gnd), fopAcM_GetRoomNo(this)); } @@ -13921,6 +13972,7 @@ BOOL daAlink_c::checkSightLine(f32 i_maxDist, cXyz* o_sightPos) { line_start_pos = &mItemAcKeep.getActor()->current.pos; } + BOOL isLineCross; s16 temp_r27 = shape_angle.y + mBodyAngle.y; f32 temp_f31 = cM_scos(mBodyAngle.x); sp3C.set(temp_f31 * cM_ssin(temp_r27), -cM_ssin(mBodyAngle.x), temp_f31 * cM_scos(temp_r27)); @@ -13958,7 +14010,7 @@ BOOL daAlink_c::checkSightLine(f32 i_maxDist, cXyz* o_sightPos) { linechk->Set(line_start_pos, o_sightPos, this); - BOOL isLineCross = dComIfG_Bgsp().LineCross(linechk); + isLineCross = dComIfG_Bgsp().LineCross(linechk); if (isLineCross) { *o_sightPos = linechk->GetCross(); onResetFlg0(RFLG0_ITEM_SIGHT_BG_HIT); @@ -13968,7 +14020,13 @@ BOOL daAlink_c::checkSightLine(f32 i_maxDist, cXyz* o_sightPos) { } void daAlink_c::setMetamorphoseModel(BOOL i_isChangeToWolf) { - J3DAnmTransform* bck = (J3DAnmTransform*)mAnmHeap9.loadDataIdx(i_isChangeToWolf ? (u16)dRes_ID_ALANM_BCK_WFCHANGEATOW_e : (u16)dRes_ID_ALANM_BCK_WFCHANGEWTOA_e); + u16 var_r30; + if (i_isChangeToWolf) { + var_r30 = (u16)dRes_ID_ALANM_BCK_WFCHANGEATOW_e; + } else { + var_r30 = (u16)dRes_ID_ALANM_BCK_WFCHANGEWTOA_e; + } + J3DAnmTransform* bck = (J3DAnmTransform*)mAnmHeap9.loadDataIdx(var_r30); JKRHeap* heap = setItemHeap(); mHeldItemModel = initModel(loadAramBmd(dRes_ID_ALANM_BMD_AL_WF_e, 0x6000), 0); @@ -14487,7 +14545,7 @@ int daAlink_c::checkNewItemChange(u8 i_selItemIdx) { cXyz sp20; s16 var_r30 = 0; - for (int i = 0; i < 4; i++, var_r30 += 0x2000) { + for (int i = 0; i < 4; i++, ANGLE_ADD_2(var_r30, 0x2000)) { sp2C.x = sp38.x + cM_ssin(var_r30) * 120.0f; sp2C.z = sp38.z + cM_scos(var_r30) * 120.0f; @@ -14542,6 +14600,8 @@ int daAlink_c::checkNewItemChange(u8 i_selItemIdx) { { return ITEM_PROC_PICK_PUT; } + + (void)0; } } } else if (sel_item != fpcNm_ITEM_NONE && mEquipItem != sel_item) { @@ -14695,11 +14755,12 @@ void daAlink_c::setLight() { u16 effName; dPa_levelEcallBack* callbackp; + JPABaseEmitter* emitterp; if (checkKandelaarSwingAnime() || mProcID == PROC_KANDELAAR_SWING) { effName = ID_ZI_J_KANTERA_SWINGFIRE; callbackp = &field_0x2f20; - JPABaseEmitter* emitterp = dComIfGp_particle_getEmitter(field_0x31c4); + emitterp = dComIfGp_particle_getEmitter(field_0x31c4); if (emitterp != NULL && emitterp->getEmitterCallBackPtr() == NULL) { emitterp->stopDrawParticle(); } @@ -14770,34 +14831,29 @@ void daAlink_c::setLight() { cXyz spB8; f32 var_f27; if (field_0x33fc > 0.0f) { - GXColor spF0 = {0x00, 0x00, 0x00, 0xFF}; - spF0.r = light_m->mColorR; - spF0.g = light_m->mColorG; - spF0.b = light_m->mColorB; + GXColor sp30 = {(u8)light_m->mColorR, (u8)light_m->mColorG, (u8)light_m->mColorB, 0xFF}; - Vec spC4 = {0.0f, 0.0f, 0.0f}; - spC4.y = light_m->mYOffset; - spC4.z = light_m->mZOffset; + Vec sp5C = {0.0f, light_m->mYOffset, light_m->mZOffset}; f32 var_f26; if ((uintptr_t)light_m == (uintptr_t)&mpHIO->mWolf.mLight.m) { cXyz spD0 = eyePos - field_0x34e0; - s16 sp104 = spD0.atan2sY_XZ(); - s16 sp106 = spD0.atan2sX_Z(); + s16 sp1C = spD0.atan2sY_XZ(); + s16 sp1A = spD0.atan2sX_Z(); mDoMtx_stack_c::transS(eyePos); - mDoMtx_stack_c::ZXYrotM(sp104, sp106, 0); - mDoMtx_stack_c::multVec(&spC4, &spB8); + mDoMtx_stack_c::ZXYrotM(sp1C, sp1A, 0); + mDoMtx_stack_c::multVec(&sp5C, &spB8); - var_f27 = cM_sht2d((s16)-(sp104 + mBodyAngle.x)) * 0.5f; - var_f26 = cM_sht2d(-sp106); + var_f27 = cM_sht2d((s16)(-sp1C - mBodyAngle.x)) * 0.5f; + var_f26 = cM_sht2d(-sp1A); } else { if (var_r28) { spB8 = (mSwordTopPos + field_0x3498) * 0.5f; - spF0.r = var_f30 * 150.0f; - spF0.g = var_f30 * 174.0f; - spF0.b = var_f30 * 141.0f; + sp30.r = var_f30 * 150.0f; + sp30.g = var_f30 * 174.0f; + sp30.b = var_f30 * 141.0f; } else { spB8 = mKandelaarFlamePos; } @@ -14806,7 +14862,7 @@ void daAlink_c::setLight() { var_f26 = cM_sht2d(-shape_angle.y); } - dKy_WolfEyeLight_set(&spB8, var_f27 + light_m->mXAngle, var_f26, (light_m->mWidth * field_0x33fc) / light_m->mPower, &spF0, field_0x33fc, light_m->mAngleAttenuationType, light_m->mDistanceAttenuationType); + dKy_WolfEyeLight_set(&spB8, var_f27 + light_m->mXAngle, var_f26, (light_m->mWidth * field_0x33fc) / light_m->mPower, &sp30, field_0x33fc, light_m->mAngleAttenuationType, light_m->mDistanceAttenuationType); } } @@ -14868,6 +14924,8 @@ void daAlink_c::changeWarpMaterial(daAlink_c::daAlink_WARP_MAT_MODE i_matMode) { } void daAlink_c::commonProcInit(daAlink_c::daAlink_PROC i_procID) { + int i; + if (mProcID == PROC_TOOL_DEMO) { speed.y = 0.0f; resetDemoBck(); @@ -14879,7 +14937,7 @@ void daAlink_c::commonProcInit(daAlink_c::daAlink_PROC i_procID) { changeWarpMaterial(WARP_MAT_MODE_1); } } else if (mProcID == PROC_GRAB_STAND) { - for (int i = 0; i < 2; i++) { + for (i = 0; i < 2; i++) { field_0x312a[i] = csXyz::Zero; field_0x3136[i] = csXyz::Zero; } @@ -14924,7 +14982,7 @@ void daAlink_c::commonProcInit(daAlink_c::daAlink_PROC i_procID) { resetWolfEnemyBiteAll(); } else if (checkWolfShapeReverse()) { setOldRootQuaternion(0, -0x8000, 0); - shape_angle.y += 0x8000; + ANGLE_ADD_2(shape_angle.y, 0x8000); field_0x2fe4 = shape_angle.y; shape_angle.x = -shape_angle.x; mPrevAngleY = shape_angle.y; @@ -15096,8 +15154,6 @@ void daAlink_c::commonProcInit(daAlink_c::daAlink_PROC i_procID) { field_0x2f99 = 0x50; } - int i; - if (checkModeFlg(MODE_NO_COLLISION) || mProcID == PROC_STEP_MOVE || mProcID == PROC_WOLF_TAG_JUMP) { mLinkAcch.OffLineCheck(); mLinkAcch.OnLineCheckNone(); @@ -15986,7 +16042,12 @@ int daAlink_c::procFrontRollInit() { BOOL is_dive_jump = mProcID == PROC_DIVE_JUMP; commonProcInit(PROC_FRONT_ROLL); - f32 roll_anm_speed = is_dive_jump ? 6.0f : mpHIO->mFrontRoll.m.mRollAnm.mStartFrame; + f32 roll_anm_speed; + if (is_dive_jump) { + roll_anm_speed = 6.0f; + } else { + roll_anm_speed = mpHIO->mFrontRoll.m.mRollAnm.mStartFrame; + } setSingleAnime(ANM_FRONT_ROLL, mpHIO->mFrontRoll.m.mRollAnm.mSpeed, roll_anm_speed, mpHIO->mFrontRoll.m.mRollAnm.mEndFrame, @@ -16143,7 +16204,7 @@ int daAlink_c::procFrontRollCrashInit() { speed.y *= mpHIO->mItem.mIronBoots.m.mWaterVelocityY; } - current.angle.y -= -0x8000; + ANGLE_ADD_2(current.angle.y, 0x8000); setFrontRollCrashShock(mRollCrashFlg); voiceStart(Z2SE_AL_V_ZENTEN_FAIL); onResetFlg0(RFLG0_FRONT_ROLL_CRASH); @@ -16382,7 +16443,7 @@ int daAlink_c::procBackJumpInit(int param_0) { } if (is_prev_ganonFinish) { - shape_angle.y -= -0x8000; + ANGLE_ADD_2(shape_angle.y, 0x8000); setOldRootQuaternion(0, -0x8000, 0); field_0x2060->getOldFrameTransInfo(0)->mTranslate.z += 55.0f; onNoResetFlg3(FLG3_UNK_4000000); @@ -16399,6 +16460,8 @@ int daAlink_c::procBackJumpInit(int param_0) { } int daAlink_c::procBackJump() { + daPy_frameCtrl_c* temp = mUnderFrameCtrl; + if (mProcVar0.field_0x3008 != 0) { mProcVar0.field_0x3008--; } else { @@ -16487,7 +16550,7 @@ int daAlink_c::procSlip() { if (checkZeroSpeedF()) { if (checkInputOnR()) { current.angle.y = shape_angle.y + 0x8000; - shape_angle.y += 0x100; + ANGLE_ADD_2(shape_angle.y, 0x100); mNormalSpeed = mMaxSpeed * 0.5f; procMoveTurnInit(0); } else { @@ -17633,7 +17696,9 @@ int daAlink_c::execute() { l_autoDownHeight = -l_autoUpHeight; #endif - if (checkNoResetFlg2(FLG2_UNK_1) && mEquipItem != fpcNm_ITEM_KANTERA && checkItemSetButton(fpcNm_ITEM_KANTERA) == 2) { + if (checkNoResetFlg2(FLG2_UNK_1) != FALSE && + mEquipItem != fpcNm_ITEM_KANTERA && + checkItemSetButton(fpcNm_ITEM_KANTERA) == 2) { offKandelaarModel(); } @@ -18131,9 +18196,7 @@ int daAlink_c::execute() { mDoMtx_stack_c::transS(old_pos); mDoMtx_stack_c::YrotM(shape_angle.y); - Vec tmp = {0.0f, 0.0f, 0.0f}; - tmp.x = ti.mTranslate.x; - tmp.z = ti.mTranslate.z; + Vec tmp = {ti.mTranslate.x, 0.0f, ti.mTranslate.z}; mDoMtx_stack_c::multVec(&tmp, ¤t.pos); speed.y = 0.0f; @@ -18521,8 +18584,9 @@ int daAlink_c::execute() { } if (!checkWolf()) { + u8 tmp; for (u8 i = 0; i < 2; i++) { - u8 tmp = (i + 1) % 2; + tmp = (i + 1) % 2; if (dComIfGp_getSelectItem(i) == fpcNm_ITEM_EMPTY_BOTTLE && (mUseButtonFlags & (1 << i)) && dComIfGp_getSelectItem(tmp) == fpcNm_ITEM_EMPTY_BOTTLE) { @@ -18677,7 +18741,7 @@ int daAlink_c::execute() { shape_angle.y = getMagneBootsLocalAngleY(shape_angle.y, 0); } else if (checkModeFlg(MODE_VINE_CLIMB)) { field_0x3108 = shape_angle.y; - shape_angle.y += field_0x308c; + ANGLE_ADD_2(shape_angle.y, field_0x308c); } else if (checkCargoCarry() && mCargoCarryAcKeep.getActor() != NULL) { field_0x3108 = shape_angle.y; shape_angle.y = mCargoCarryAcKeep.getActor()->shape_angle.y; @@ -18845,9 +18909,11 @@ bool daAlink_c::checkItemDraw() { int daAlink_c::initShadowScaleLight() { dKy_shadow_mode_set(4); + f32 var_f27; if (checkWolf()) { - f32 temp_f26 = 0.5f * mTgCyls[0].GetH(); - mTgCyls[0].GetC(); + var_f27 = mTgCyls[0].GetC().y + 0.5f * mTgCyls[0].GetH(); + } else { + var_f27 = field_0x3834.y; } cXyz sp20(tevStr.mLightPosWorld.x - field_0x3834.x, tevStr.mLightPosWorld.y - field_0x3454, tevStr.mLightPosWorld.z - field_0x3834.z); @@ -18919,9 +18985,9 @@ int daAlink_c::moveShadowScaleLight() { s16 temp_r0 = field_0x2ff6 - field_0x2ff8; if (abs(temp_r0) < 0x4000) { if (temp_r0 >= 0) { - field_0x2ff8 -= 0x4000; + ANGLE_SUB_2(field_0x2ff8, 0x4000); } else { - field_0x2ff8 += 0x4000; + ANGLE_ADD_2(field_0x2ff8, 0x4000); } if (cLib_distanceAngleS(field_0x2ff8, field_0x2ffa) < 0x100) { @@ -19023,6 +19089,7 @@ void daAlink_c::shadowDraw() { dComIfGd_addRealShadow(shadowID, mShieldModel); } + fopAc_ac_c* actor; if (checkWolf()) { if (checkMidnaRide() && !checkCloudSea() && !midna->checkShadowNoDraw() && !midna->checkShadowModelDraw()) { dComIfGd_addRealShadow(shadowID, mpWlMidnaModel); @@ -19054,10 +19121,12 @@ void daAlink_c::shadowDraw() { if (mEquipItem == fpcNm_ITEM_IRONBALL) { if (mItemVar0.field_0x3018 == 0 || mItemVar0.field_0x3018 == 8) { dComIfGd_addRealShadow(shadowID, mHeldItemModel); - } else { - if (fopAcM_gc_c::gndCheck(&mIronBallBgChkPos)) { - field_0x32d4 = dComIfGd_setShadow(field_0x32d4, 0, mHeldItemModel, &mIronBallCenterPos, 150.0f, 32.0f, mIronBallBgChkPos.y, fopAcM_gc_c::getGroundY(), *fopAcM_gc_c::getGroundCheck(), &tevStr, 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); - } + } else if (fopAcM_gc_c::gndCheck(&mIronBallBgChkPos)) { + field_0x32d4 = + dComIfGd_setShadow(field_0x32d4, 0, mHeldItemModel, + &mIronBallCenterPos, 150.0f, 32.0f, mIronBallBgChkPos.y, + fopAcM_gc_c::getGroundY(), *fopAcM_gc_c::getGroundCheck(), &tevStr, + 0, 1.0f, dDlst_shadowControl_c::getSimpleTex()); } } else { changeHookshotDrawModel(); @@ -19068,7 +19137,9 @@ void daAlink_c::shadowDraw() { dComIfGd_addRealShadow(shadowID, mpHookTipModel); } - if (mEquipItem == fpcNm_ITEM_W_HOOKSHOT && !checkPlayerGuardAndAttack() && !checkNoResetFlg0(FLG0_UNK_2)) { + if (mEquipItem == fpcNm_ITEM_W_HOOKSHOT && + !checkPlayerGuardAndAttack() && + !checkNoResetFlg0(FLG0_UNK_2)) { dComIfGd_addRealShadow(shadowID, field_0x0710); if (!dComIfGp_checkPlayerStatus1(0, 0x10000)) { @@ -19092,24 +19163,25 @@ void daAlink_c::shadowDraw() { } if (checkSpinnerRide()) { - fopAc_ac_c* spinnerActor = fopAcM_SearchByID(mRideAcKeep.getID()); - if (spinnerActor != NULL) { - dComIfGd_addRealShadow(shadowID, spinnerActor->model); + actor = fopAcM_SearchByID(mRideAcKeep.getID()); + if (actor != NULL) { + dComIfGd_addRealShadow(shadowID, actor->model); } } } if (mGrabItemAcKeep.getID() != fpcM_ERROR_PROCESS_ID_e) { - fopAc_ac_c* grabActor = fopAcM_SearchByID(mGrabItemAcKeep.getID()); - if (grabActor != NULL && grabActor->model != NULL) { - dComIfGd_addRealShadow(shadowID, grabActor->model); + actor = fopAcM_SearchByID(mGrabItemAcKeep.getID()); + if (actor != NULL && actor->model != NULL) { + dComIfGd_addRealShadow(shadowID, actor->model); } } - if (dComIfGp_checkPlayerStatus1(0, 0x10000) && mCargoCarryAcKeep.getID() != fpcM_ERROR_PROCESS_ID_e) { - fopAc_ac_c* carryActor = fopAcM_SearchByID(mCargoCarryAcKeep.getID()); - if (carryActor != NULL && carryActor->model != NULL) { - dComIfGd_addRealShadow(shadowID, carryActor->model); + if (dComIfGp_checkPlayerStatus1(0, 0x10000) && + mCargoCarryAcKeep.getID() != fpcM_ERROR_PROCESS_ID_e) { + actor = fopAcM_SearchByID(mCargoCarryAcKeep.getID()); + if (actor != NULL && actor->model != NULL) { + dComIfGd_addRealShadow(shadowID, actor->model); } } } @@ -19372,7 +19444,11 @@ int daAlink_c::draw() { field_0x06f0->hide(); +#if PLATFORM_SHIELD + if (mProcID == PROC_HOOKSHOT_WALL_SHOOT || mProcID == PROC_HOOKSHOT_SUBJECT) { +#else if (checkHookshotReadyMaterialOffMode()) { +#endif for (u16 i = 0; i < mFallVoiceInit; i++) { if (!(field_0x32cc & (1 << i))) { field_0x064C->getMaterialNodePointer(i)->getShape()->hide(); @@ -19384,7 +19460,11 @@ int daAlink_c::draw() { modelDraw(mpLinkModel, isPlayerNoDraw); if (dComIfGp_checkCameraAttentionStatus(field_0x317c, 0x20)) { +#if PLATFORM_SHIELD + if (mProcID == PROC_HOOKSHOT_WALL_SHOOT || mProcID == PROC_HOOKSHOT_SUBJECT) { +#else if (checkHookshotReadyMaterialOffMode()) { +#endif for (u16 i = 0; i < mFallVoiceInit; i++) { if (!(field_0x32cc & (1 << i))) { field_0x064C->getMaterialNodePointer(i)->getShape()->show(); @@ -19508,9 +19588,7 @@ int daAlink_c::draw() { if (checkEquipHeavyBoots()) { GXColorS10 color = tevStr.TevColor; for (int i = 0; i < 2; i++) { - JPABaseEmitter* emitter_p = dComIfGp_particle_getEmitter(field_0x3228[i][0]); - - if (emitter_p != NULL) { + if (dComIfGp_particle_getEmitter(field_0x3228[i][0]) != NULL) { tevStr.TevColor.r = 5; tevStr.TevColor.g = tevStr.TevColor.r; tevStr.TevColor.b = tevStr.TevColor.r; @@ -19583,7 +19661,7 @@ daAlink_c::~daAlink_c() { } static int daAlink_Delete(daAlink_c* i_this) { - fpc_ProcID id = fopAcM_GetID(i_this); + fopAcM_RegisterDeleteID(i_this, "ALINK"); if (i_this->getClothesChangeWaitTimer() != 0) { i_this->loadModelDVD(); @@ -19604,7 +19682,7 @@ static actor_method_class l_daAlink_Method = { }; actor_process_profile_definition g_profile_ALINK = { - fpcLy_CURRENT_e, + (u32)fpcLy_CURRENT_e, 5, fpcPi_CURRENT_e, PROC_ALINK, -- cgit v1.2.3