Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
UnkFloatFunc001.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "npc.h"
3
4// Similar to CosInterpMinMax
5API_CALLABLE(N(UnkFloatFunc001)) {
6 Bytecode* args = script->ptrReadPos;
7 s32 a1 = *args++;
8 s32 var0 = evt_get_variable(script, a1);
9 s32 a2 = *args++;
10 f32 var1 = evt_get_float_variable(script, *args++);
11 f32 var2 = evt_get_float_variable(script, *args++);
12 s32 var3 = evt_get_variable(script, *args++);
13 s32 var4 = evt_get_variable(script, *args++);
14 f32 temp = evt_get_float_variable(script, *args++);
15 f32 diff = (var2 - var1) / 2;
16
17 if (var4 != 0 && var3 < var0) {
18 var0 = var3;
19 evt_set_variable(script, a1, var3);
20 }
21
22 evt_set_float_variable(script, a2, (var1 + diff) - (diff * cos_deg(((var0 * 180.0f) / var3) + temp)));
23 return ApiStatus_DONE2;
24}
#define cos_deg
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
f32 evt_set_float_variable(Evt *script, Bytecode var, f32 value)
Definition evt.c:1977
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930