Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
PlayLavaBubbleFlightSound.inc.c
Go to the documentation of this file.
1
#include "common.h"
2
3
API_CALLABLE(N(
PlayLavaBubbleFlightSound
)) {
4
Actor
* actor =
get_actor
(
script
->owner1.actorID);
5
f32
distX
;
6
f32
distY
;
7
f32
distZ
;
8
f32
dist;
9
10
if
(
isInitialCall
) {
11
distX
= actor->
state
.
goalPos
.
x
- actor->
curPos
.
x
;
12
distY
= actor->
state
.
goalPos
.
y
- actor->
curPos
.
y
;
13
distZ
= actor->
state
.
goalPos
.
z
- actor->
curPos
.
z
;
14
dist =
sqrtf
(
SQ
(
distX
) +
SQ
(
distY
) +
SQ
(
distZ
));
15
script
->functionTemp[0] = ((dist / actor->
state
.
speed
) * 0.5f) + 1.0f;
16
sfx_play_sound_at_position
(
SOUND_EMBER_FLY
,
SOUND_SPACE_DEFAULT
, actor->
curPos
.
x
, actor->
curPos
.
y
, actor->
curPos
.
z
);
17
}
18
19
if
(
script
->functionTemp[0]-- > 0) {
20
return
ApiStatus_BLOCK
;
21
}
22
23
sfx_play_sound_at_position
(
SOUND_EMBER_FLY
|
SOUND_ID_TRIGGER_CHANGE_SOUND
,
SOUND_SPACE_DEFAULT
, actor->
curPos
.
x
, actor->
curPos
.
y
, actor->
curPos
.
z
);
24
return
ApiStatus_DONE2
;
25
}
PopupMenu_SelectedIndex
BSS s32 PopupMenu_SelectedIndex
Definition
8a860_len_3f30.c:84
Actor::state
ActorState state
Definition
common_structs.h:1859
ActorState::goalPos
Vec3f goalPos
Definition
common_structs.h:1823
Vec3f::z
f32 z
Definition
common_structs.h:103
Actor::curPos
Vec3f curPos
Definition
common_structs.h:1867
ActorState::speed
f32 speed
Definition
common_structs.h:1830
Vec3f::x
f32 x
Definition
common_structs.h:101
Vec3f::y
f32 y
Definition
common_structs.h:102
Actor
Definition
common_structs.h:1855
sfx_play_sound_at_position
#define sfx_play_sound_at_position
Definition
effect_shims.h:73
sqrtf
#define sqrtf
Definition
effect_shims.h:60
SOUND_ID_TRIGGER_CHANGE_SOUND
@ SOUND_ID_TRIGGER_CHANGE_SOUND
Definition
enums.h:532
SOUND_EMBER_FLY
@ SOUND_EMBER_FLY
Definition
enums.h:1163
SOUND_SPACE_DEFAULT
@ SOUND_SPACE_DEFAULT
Definition
enums.h:1737
ApiStatus_DONE2
#define ApiStatus_DONE2
Definition
evt.h:118
ApiStatus_BLOCK
#define ApiStatus_BLOCK
Definition
evt.h:116
get_actor
Actor * get_actor(s32 actorID)
Definition
actor_api.c:155
SQ
#define SQ(x)
Definition
macros.h:170
src
common
PlayLavaBubbleFlightSound.inc.c
Generated by
1.10.0