mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-15 06:10:58 -04:00
Document Actor Ocarina Interaction (#1748)
* ocarina interaction * cleanup * 0x * document zora exception * add comment
This commit is contained in:
+22
-15
@@ -2109,42 +2109,49 @@ PlayerItemAction Player_GetExchangeItemAction(PlayState* play) {
|
||||
return player->exchangeItemAction;
|
||||
}
|
||||
|
||||
s32 func_800B8718(Actor* actor, GameState* gameState) {
|
||||
if (actor->flags & ACTOR_FLAG_20000000) {
|
||||
actor->flags &= ~ACTOR_FLAG_20000000;
|
||||
/**
|
||||
* When a given ocarina interaction offer is accepted, Player will set `ACTOR_FLAG_OCARINA_INTERACTION` for that actor.
|
||||
* An exception is made for EN_ZOT, see `Player_ActionHandler_13`.
|
||||
* This function serves to acknowledge that the offer was accepted by Player, and notifies the actor
|
||||
* that it should proceed with its own internal processes for handling further interactions.
|
||||
*
|
||||
* @return true if the ocarina interaction offer was accepted, false otherwise
|
||||
*/
|
||||
s32 Actor_OcarinaInteractionAccepted(Actor* actor, GameState* gameState) {
|
||||
if (actor->flags & ACTOR_FLAG_OCARINA_INTERACTION) {
|
||||
actor->flags &= ~ACTOR_FLAG_OCARINA_INTERACTION;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Similar to Actor_OfferTalkExchange
|
||||
s32 func_800B874C(Actor* actor, PlayState* play, f32 xzRange, f32 yRange) {
|
||||
s32 Actor_OfferOcarinaInteraction(Actor* actor, PlayState* play, f32 xzRange, f32 yRange) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((player->actor.flags & ACTOR_FLAG_20000000) || Player_InCsMode(play) ||
|
||||
(yRange < fabsf(actor->playerHeightRel)) || ((player->unk_A94 < actor->xzDistToPlayer)) ||
|
||||
if ((player->actor.flags & ACTOR_FLAG_OCARINA_INTERACTION) || Player_InCsMode(play) ||
|
||||
(yRange < fabsf(actor->playerHeightRel)) || ((player->ocarinaInteractionDistance < actor->xzDistToPlayer)) ||
|
||||
(xzRange < actor->xzDistToPlayer)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
player->unk_A90 = actor;
|
||||
player->unk_A94 = actor->xzDistToPlayer;
|
||||
player->ocarinaInteractionActor = actor;
|
||||
player->ocarinaInteractionDistance = actor->xzDistToPlayer;
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 func_800B8804(Actor* actor, PlayState* play, f32 xzRange) {
|
||||
return func_800B874C(actor, play, xzRange, 20.0f);
|
||||
s32 Actor_OfferOcarinaInteractionNearby(Actor* actor, PlayState* play, f32 xzRange) {
|
||||
return Actor_OfferOcarinaInteraction(actor, play, xzRange, 20.0f);
|
||||
}
|
||||
|
||||
s32 func_800B882C(Actor* actor, PlayState* play) {
|
||||
s32 Actor_OfferOcarinaInteractionColChkInfoCylinder(Actor* actor, PlayState* play) {
|
||||
f32 cylRadius = actor->colChkInfo.cylRadius + 50.0f;
|
||||
|
||||
return func_800B8804(actor, play, cylRadius);
|
||||
return Actor_OfferOcarinaInteractionNearby(actor, play, cylRadius);
|
||||
}
|
||||
|
||||
s32 func_800B886C(Actor* actor, PlayState* play) {
|
||||
if (!(GET_PLAYER(play)->actor.flags & ACTOR_FLAG_20000000)) {
|
||||
s32 Actor_NoOcarinaInteraction(Actor* actor, PlayState* play) {
|
||||
if (!(GET_PLAYER(play)->actor.flags & ACTOR_FLAG_OCARINA_INTERACTION)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user