Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
watt.c File Reference

Go to the source code of this file.

Enumerations

enum  {
  SHINING_STATE_INIT = 40 , SHINING_STATE_DELAY = 41 , SHINING_STATE_BEGIN = 20 , SHINING_STATE_GATHER = 21 ,
  SHINING_STATE_HOLDING = 1 , SHINING_STATE_RELEASE = 2
}
 

Functions

void force_player_anim (AnimID)
 
voidsync_held_position (void)
 
voidupdate_player_carry_anim (void)
 
voidcreate_static_effect (Npc *npc)
 
voiddispose_static_effect (void)
 
voidreset_static_effect (s32 type)
 
voidinit (Npc *npc)
 
voidtry_cancel_tweester (Npc *watt)
 
voidpre_battle (Npc *watt)
 
voidpost_battle (Npc *watt)
 

Variables

EvtScript EVS_WorldWatt_TakeOut
 
EvtScript EVS_WorldWatt_Update
 
EvtScript EVS_WorldWatt_UseAbility
 
EvtScript EVS_WorldWatt_PutAway
 
EvtScript EVS_WorldWatt_EnterMap
 

Enumeration Type Documentation

◆ anonymous enum

Enumerator
SHINING_STATE_INIT 
SHINING_STATE_DELAY 
SHINING_STATE_BEGIN 
SHINING_STATE_GATHER 
SHINING_STATE_HOLDING 
SHINING_STATE_RELEASE 

Definition at line 22 of file watt.c.

22 {
23 // next two states lock input for a few frames, during which the ability can be canceled
30};
@ SHINING_STATE_HOLDING
Definition watt.c:28
@ SHINING_STATE_BEGIN
Definition watt.c:26
@ SHINING_STATE_DELAY
Definition watt.c:25
@ SHINING_STATE_GATHER
Definition watt.c:27
@ SHINING_STATE_INIT
Definition watt.c:24
@ SHINING_STATE_RELEASE
Definition watt.c:29

Function Documentation

◆ force_player_anim()

void force_player_anim ( AnimID anim)

Definition at line 905 of file 77480.c.

905 {
907
908 playerStatus->anim = anim;
909 playerStatus->animNotifyValue = 0;
911}
PlayerStatus gPlayerStatus
Definition 77480.c:39
BSS s32 PopupMenu_SelectedIndex

◆ sync_held_position()

void N sync_held_position ( void )

Definition at line 552 of file watt.c.

552 {
554 Npc* new_var2;
557 f32 offsetScale, angle;
558 f32 spriteFacingAngle;
559 s32 angleOffset;
560
562 spriteFacingAngle = gPlayerStatusPtr->spriteFacingAngle;
563 if ((spriteFacingAngle < 90.0f) || (spriteFacingAngle > 270.0f)) {
565 angleOffset = -5;
566 offsetScale = 0.6f;
567 } else {
568 angleOffset = 5;
569 offsetScale = 0.6f;
570 }
571 } else {
573 angleOffset = 5;
574 offsetScale = 0.6f;
575 } else {
576 angleOffset = -5;
577 offsetScale = 0.6f;
578 }
579 }
580
581 angle = DEG_TO_RAD(camera->curYaw + 270.0f - gPlayerStatusPtr->spriteFacingAngle + angleOffset);
582
586
591
594 }
595}
AnimID trueAnimation
Encoding back-facing sprite.
@ PARTNER_ACTION_NONE
Definition enums.h:2932
f32 cos_rad(f32 x)
Definition 43F0.c:716
f32 sin_rad(f32 x)
Definition 43F0.c:712
Npc * wPartnerNpc
Definition partners.c:43
#define DEG_TO_RAD(deg)
Definition macros.h:138
@ SPRITE_ID_BACK_FACING
Definition sprite.h:13
Vec3f pos
PlayerStatus * gPlayerStatusPtr
PartnerStatus gPartnerStatus
Definition partners.c:42
Camera gCameras[4]
Definition cam_main.c:17

◆ update_player_carry_anim()

void N update_player_carry_anim ( void )

Definition at line 537 of file watt.c.

537 {
540 AnimID anim;
541
542 if (playerStatus->runSpeed <= currentSpeed) {
544 } else if (playerStatus->walkSpeed <= currentSpeed) {
546 } else {
548 }
550}
u32 AnimID
void suggest_player_anim_allow_backward(AnimID anim)
Definition 77480.c:894
PlayerStatus gPlayerStatus
Definition 77480.c:39

◆ create_static_effect()

void N create_static_effect ( Npc * npc)

Definition at line 32 of file watt.c.

32 {
33 if (!(npc->flags & NPC_FLAG_INVISIBLE)) {
34 if (N(StaticEffect) == NULL) {
35 N(StaticEffect) = fx_static_status(0, npc->pos.x, npc->pos.y + 13.0f, npc->pos.z, 0.9f, 5, 0);
36 }
37 }
38}
@ NPC_FLAG_INVISIBLE
Definition enums.h:2999
s32 flags

Referenced by post_battle().

◆ dispose_static_effect()

void N dispose_static_effect ( void )

Definition at line 40 of file watt.c.

40 {
41 if (N(StaticEffect) != NULL) {
42 N(StaticEffect)->data.staticStatus->timeLeft = 1;
43 N(StaticEffect) = NULL;
44 }
45}

Referenced by pre_battle().

◆ reset_static_effect()

void N reset_static_effect ( s32 type)

Definition at line 49 of file watt.c.

49 {
50 EffectInstance* effect = N(StaticEffect);
53 s32 count;
54 s32 i;
55
56 part->type = type;
57 invisTime = N(EffectAnimLengths)[type] * 0.5f;
58 count = effect->numParts - 1;
59
60 part++;
61 for (i = 1; i < count; i++, part++) {
62 part->frame = -1.0f - (invisTime * (i & 1));
63 }
64}
EffectInstanceDataPtr data
Definition effects.h:2605
struct StaticStatusFXData * staticStatus
Definition effects.h:2579

◆ init()

void N init ( Npc * npc)

Definition at line 66 of file watt.c.

66 {
67 npc->collisionHeight = 24;
68 npc->collisionDiameter = 24;
69 N(D_802BE308) = FALSE;
70 N(D_802BE300) = FALSE;
73 N(StaticEffect) = NULL;
74}
s16 collisionDiameter
s16 collisionHeight

◆ try_cancel_tweester()

void N try_cancel_tweester ( Npc * watt)

Definition at line 214 of file watt.c.

214 {
217 watt->flags = N(TweesterPhysicsPtr)->prevFlags;
220 }
221}
@ TWEESTER_PARTNER_INIT
Definition enums.h:2475
void partner_clear_player_tracking(Npc *partner)
Definition partners.c:2436
Entity * TweesterTouchingPartner
Definition 7B440.c:5

◆ pre_battle()

void N pre_battle ( Npc * watt)

Definition at line 467 of file watt.c.

467 {
469
470 if (N(IsPlayerHolding)) {
472 partnerStatus->shouldResumeAbility = TRUE;
474 }
475
477}
void N dispose_static_effect(void)
Definition watt.c:40

◆ post_battle()

void N post_battle ( Npc * watt)

Definition at line 479 of file watt.c.

479 {
481
482 if (partnerStatus->shouldResumeAbility) {
486 }
487}
s32 partner_use_ability(void)
Definition partners.c:964
void N create_static_effect(Npc *npc)
Definition watt.c:32

Variable Documentation

◆ EVS_WorldWatt_TakeOut

EvtScript EVS_WorldWatt_TakeOut
Initial value:
= {
}
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Return
Kills the current EVT thread.
Definition macros.h:217

Definition at line 90 of file watt.c.

90 {
91 Call(N(TakeOut))
92 Return
93 End
94};

◆ EVS_WorldWatt_Update

EvtScript EVS_WorldWatt_Update
Initial value:
= {
}

Definition at line 208 of file watt.c.

208 {
209 Call(N(Update))
210 Return
211 End
212};

◆ EVS_WorldWatt_UseAbility

EvtScript EVS_WorldWatt_UseAbility
Initial value:

Definition at line 433 of file watt.c.

433 {
434 Call(N(UseAbility))
435 Return
436 End
437};

◆ EVS_WorldWatt_PutAway

EvtScript EVS_WorldWatt_PutAway
Initial value:
= {
}

Definition at line 461 of file watt.c.

461 {
462 Call(N(PutAway))
463 Return
464 End
465};

◆ EVS_WorldWatt_EnterMap

EvtScript EVS_WorldWatt_EnterMap
Initial value:
= {
}

Definition at line 597 of file watt.c.

597 {
598 Call(N(EnterMap))
599 Return
600 End
601};