3#include "../src/world/partners.h"
5#define NAMESPACE world_goompa
8 partner->collisionHeight = 24;
9 partner->collisionDiameter = 20;
12API_CALLABLE(N(TakeOut)) {
13 Npc* goompa = script->owner2.npc;
35API_CALLABLE(N(Update)) {
37 Npc* goompa = script->owner2.npc;
38 f32 sinAngle, cosAngle, liftoffVelocity;
56 switch (N(TweesterPhysicsPtr)->state) {
58 N(TweesterPhysicsPtr)->state++;
59 N(TweesterPhysicsPtr)->prevFlags = goompa->
flags;
63 N(TweesterPhysicsPtr)->angularVel = 6.0f;
64 N(TweesterPhysicsPtr)->liftoffVelPhase = 50.0f;
65 N(TweesterPhysicsPtr)->countdown = 120;
67 goompa->
flags &= ~NPC_FLAG_GRAVITY;
70 goompa->
pos.
x = entity->
pos.
x + (sinAngle * N(TweesterPhysicsPtr)->radius);
71 goompa->
pos.
z = entity->
pos.
z - (cosAngle * N(TweesterPhysicsPtr)->radius);
72 N(TweesterPhysicsPtr)->angle =
clamp_angle(N(TweesterPhysicsPtr)->angle - N(TweesterPhysicsPtr)->angularVel);
74 if (N(TweesterPhysicsPtr)->radius > 20.0f) {
75 N(TweesterPhysicsPtr)->radius--;
76 }
else if (N(TweesterPhysicsPtr)->radius < 19.0f) {
77 N(TweesterPhysicsPtr)->radius++;
80 liftoffVelocity =
sin_rad(
DEG_TO_RAD(N(TweesterPhysicsPtr)->liftoffVelPhase)) * 3.0f;
81 N(TweesterPhysicsPtr)->liftoffVelPhase += 3.0f;
83 if (N(TweesterPhysicsPtr)->liftoffVelPhase > 150.0f) {
84 N(TweesterPhysicsPtr)->liftoffVelPhase = 150.0f;
87 goompa->
pos.
y += liftoffVelocity;
89 N(TweesterPhysicsPtr)->angularVel += 0.8;
91 if (N(TweesterPhysicsPtr)->angularVel > 40.0f) {
92 N(TweesterPhysicsPtr)->angularVel = 40.0f;
95 if (--N(TweesterPhysicsPtr)->countdown == 0) {
96 N(TweesterPhysicsPtr)->state++;
100 goompa->
flags = N(TweesterPhysicsPtr)->prevFlags;
101 N(TweesterPhysicsPtr)->countdown = 30;
102 N(TweesterPhysicsPtr)->state++;
108 if (--N(TweesterPhysicsPtr)->countdown == 0) {
126 goompa->
flags = N(TweesterPhysicsPtr)->prevFlags;
132API_CALLABLE(N(UseAbility)) {
142API_CALLABLE(N(PutAway)) {
143 Npc* goompa = script->owner2.npc;
@ TWEESTER_PARTNER_ATTRACT
@ TWEESTER_PARTNER_RELEASE
@ NPC_FLAG_IGNORE_WORLD_COLLISION
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
void partner_walking_update_motion(Npc *partner)
void partner_clear_player_tracking(Npc *partner)
void partner_walking_update_player_tracking(Npc *partner)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
void partner_walking_enable(Npc *partner, s32 val)
void sin_cos_rad(f32 rad, f32 *outSinTheta, f32 *outCosTheta)
s32 partner_init_get_out(Npc *npc)
s32 partner_init_put_away(Npc *partner)
s32 partner_put_away(Npc *partner)
s32 partner_get_out(Npc *partner)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define Return
Kills the current EVT thread.
Entity * TweesterTouchingPartner
EvtScript EVS_WorldGoompa_TakeOut
void N init(Npc *partner)
EvtScript EVS_WorldGoompa_PutAway
EvtScript EVS_WorldGoompa_UseAbility
EvtScript EVS_WorldGoompa_Update
void N try_cancel_tweester(Npc *goompa)