mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-21 22:03:36 -07:00
fire arrows aim assist
This commit is contained in:
parent
1a7582d390
commit
892e147b84
2 changed files with 21 additions and 1 deletions
|
@ -442,6 +442,19 @@ void ActorAccessibility_InitActors() {
|
|||
});
|
||||
policy.distance = 1000;
|
||||
ActorAccessibility_AddSupportedActor(ACTOR_EN_WOOD02, policy);
|
||||
ActorAccessibility_InitPolicy(&policy, "Lake Hylia Sun", [](AccessibleActor* actor) {
|
||||
s32 params = actor->actor->params & 0xFF;
|
||||
if (params != 0x40 && params != 0x41 && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) {
|
||||
if (actor->xzDistToPlayer <= 120 && (actor->frameCount & 31) == 0) {
|
||||
ActorAccessibility_PlaySoundForActor(actor, 0, NA_SE_IT_BOW_FLICK);
|
||||
}
|
||||
actor->policy.aimAssist.isProvider = AIM_BOW;
|
||||
} else {
|
||||
actor->policy.aimAssist.isProvider = 0;
|
||||
}
|
||||
});
|
||||
policy.runsAlways = true;
|
||||
ActorAccessibility_AddSupportedActor(ACTOR_SHOT_SUN, policy);
|
||||
ActorAccessibility_InitPolicy(&policy, "Hookshot Pillar", NA_SE_IT_HOOKSHOT_STICK_OBJ);
|
||||
policy.distance = 1000;
|
||||
policy.ydist = 1000;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "soh/ObjectExtension/ObjectExtension.h"
|
||||
|
||||
extern "C" {
|
||||
#include "overlays/actors/ovl_Shot_Sun/z_shot_sun.h"
|
||||
extern PlayState* gPlayState;
|
||||
extern bool freezeGame;
|
||||
extern bool freezeActors;
|
||||
|
@ -410,7 +411,7 @@ void ActorAccessibility_RunAccessibilityForActor(PlayState* play, AccessibleActo
|
|||
return;
|
||||
} else if (actor->isDrawn == 0 && actor->id != ACTOR_EN_HOLL && actor->id != ACTOR_EN_KAKASI2 &&
|
||||
actor->id != ACTOR_EN_IT && actor->id != ACTOR_EN_OKARINA_TAG && actor->id != ACTOR_EN_WONDER_ITEM &&
|
||||
!aa->glossary->GlossaryStarted) {
|
||||
actor->id != ACTOR_SHOT_SUN && !aa->glossary->GlossaryStarted) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -746,6 +747,12 @@ AimAssistProps ActorAccessibility_ProvideAimAssistForActor(AccessibleActor* acto
|
|||
x += Math_SinS(actor->actor->shape.rot.y) * 50;
|
||||
z += Math_CosS(actor->actor->shape.rot.y) * 50;
|
||||
xzDist = sqrtf(SQ(player->actor.world.pos.x - x) + SQ(player->actor.world.pos.z - z));
|
||||
} else if (actor->id == ACTOR_SHOT_SUN) {
|
||||
ShotSun* sun = (ShotSun*)actor->actor;
|
||||
x = sun->hitboxPos.x;
|
||||
z = sun->hitboxPos.z;
|
||||
yHeight = sun->hitboxPos.y + 55;
|
||||
xzDist = sqrtf(SQ(player->actor.world.pos.x - x) + SQ(player->actor.world.pos.z - z));
|
||||
}
|
||||
s32 yIntercept = slope * xzDist + player->actor.focus.pos.y;
|
||||
AimAssistProps aimAssistProps;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue