documentation: core2/ba/physics

This commit is contained in:
Banjo Kazooie
2024-06-16 22:36:36 -05:00
parent 8fe5c3b4d1
commit 092de6aae3
208 changed files with 2342 additions and 2163 deletions

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
extern f32 func_802E4B38(void);
extern f32 ml_mapRange_f(f32, f32, f32, f32, f32);
@@ -53,14 +55,14 @@ void __baanim_update_scaleToHorizontalVelocity(void) {
f32 scale;
scale = (baAnimScale.scalable_duration != 0) ? baAnimScale.duration_scale : 1.0f;
_get_velocity(velocity);
baphysics_get_velocity(velocity);
temp_f12 = ml_mapRange_f(gu_sqrtf(velocity[0]*velocity[0] + velocity[2] * velocity[2]), baAnimScale.velocity_min, baAnimScale.velocity_max, baAnimScale.duration_min * scale, baAnimScale.duration_max * scale);
animctrl_setDuration(playerAnimCtrl, ml_clamp_f(temp_f12, baAnimMinDuration, baAnimMaxDuration));
animctrl_update(playerAnimCtrl);
}
void __baanim_update_scaleToVerticalVelocity(void) {
animctrl_setDuration(playerAnimCtrl, ml_clamp_f(ml_mapRange_f(mlAbsF(_get_vertVelocity()), baAnimScale.velocity_min, baAnimScale.velocity_max, baAnimScale.duration_min, baAnimScale.duration_max), baAnimMinDuration, baAnimMaxDuration));
animctrl_setDuration(playerAnimCtrl, ml_clamp_f(ml_mapRange_f(mlAbsF(baphysics_get_vertical_velocity()), baAnimScale.velocity_min, baAnimScale.velocity_max, baAnimScale.duration_min, baAnimScale.duration_max), baAnimMinDuration, baAnimMaxDuration));
animctrl_update(playerAnimCtrl);
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
#include "prop.h"
#include "SnS.h"
@@ -105,8 +106,8 @@ void __baMarker_8028B7F4(void){
yaw_setIdeal(func_8029B41C());
yaw_setUpdateState(1);
func_8029957C(3);
func_802978DC(2);
func_80297970(0.0f);
baphysics_set_type(BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029151C(0xC);
}
@@ -686,7 +687,7 @@ void __baMarker_resolveCollision(Prop *other_prop){
case MARKER_6B_GLOOPBUBBLE: //L8028CD20
if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){
func_803463D4(ITEM_17_AIR, func_80301DBC(2));
func_803463D4(ITEM_17_AIR, fxairscore_count_to_time(2));
}
break;

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/ba/model.h"
#include "core2/ba/physics.h"
void func_80254008(void);
extern void func_80256E24(f32[3], f32, f32, f32, f32, f32);
@@ -317,7 +318,7 @@ void baModel_80292284(f32 arg0[3], s32 arg1){
arg0[1] += sp44[1];
arg0[2] += sp44[2];
}
func_802976C0(sp38);
baphysics_get_position_change(sp38);
arg0[0] = arg0[0] + sp38[0];
arg0[1] = arg0[1] + sp38[1];
arg0[2] = arg0[2] + sp38[2];

432
src/core2/ba/physics.c Normal file
View File

@@ -0,0 +1,432 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2])
extern f32 ml_sin_deg(f32);
extern f32 ml_dotProduct_vec3f(f32[3], f32[3]);
extern void func_80256D0C(f32, f32, f32, f32, f32, f32 *, f32 *, f32 *);
extern void func_80256E24(f32[3], f32, f32, f32, f32, f32);
extern f32 climbGetRadius(void);
extern f32 func_8029CED0(void);
/* .data */
f32 baphysics_default_gravity = -2700.0f; //defaultGravity
f32 baphysics_default_terminal_velocity = -4000.0f;
/* .bss */
s32 baphysics_type;
f32 s_next_position[3];
f32 s_player_velocity[3]; //velocity?
f32 baphysics_target_velocity[3];
f32 s_delta_position[3];
f32 D_8037C4E4;
f32 s_gravity; //gravity
f32 s_terminal_velocity;
f32 baphysics_target_horizontal_velocity;
f32 baphysics_target_yaw; //angle
f32 baphysics_acceleration;
f32 D_8037C4FC;
f32 D_8037C500;
struct {
u8 state;
//u8 pad1[0x3];
f32 start_position[3];
f32 end_position[3];
f32 duration;
f32 elapsed_time;
} baphysics_goto;
/* .code */
void __baphysics_update_normal(void){
f32 sp84[3];
f32 sp78[3];
f32 sp6C[3];
f32 sp60[3];
f32 sp54[3];
f32 sp48[3];
f32 sp44;
f32 sp40;
func_80256D0C(0.0f, baphysics_target_yaw, 0.0f, 0.0f, baphysics_target_horizontal_velocity, &baphysics_target_velocity[0], &baphysics_target_velocity[1], &baphysics_target_velocity[2]);
sp6C[0] = s_player_velocity[0];\
sp6C[1] = 0.0f;\
sp6C[2] = s_player_velocity[2];
// sp6C[1] = s_player_velocity[1];
ml_vec3f_copy(sp60, baphysics_target_velocity);
sp60[1] = 0.0f;
if(func_80294548()){
func_80294480(sp54);
ml_vec3f_normalize_copy(sp48, sp60);
sp44 = ml_dotProduct_vec3f(sp48, sp54);
sp40 = get_slope_timer();
if(sp44 != 0.0f){
if(sp44 < 0){
//sp44 = 0.0f;
if(func_8028B3B4()){
sp40 = ml_map_f(sp40, 0.0f, 1.0f, sp44*0.5, -1.0f);
}
else{//L80296E3C
sp40 = 0.5*sp44;
}//L80296E54
ml_vec3f_scale(sp60, 1.0 + sp40);
}
else{//L80296E84
sp40 = sp44*0.2;
ml_vec3f_scale(sp60, sp40 + 1.0);
}
}//L80296EBC
}//L80296EBC
ml_vec3f_scale_copy(sp84, sp60, func_8029CED0());
ml_vec3f_scale_copy(sp78, sp6C, func_8029CED0());
ml_vec3f_diff(sp84, sp78);
ml_vec3f_scale(sp84, time_getDelta()/0.0333333);
s_player_velocity[0] += sp84[0];\
s_player_velocity[1] += sp84[1];\
s_player_velocity[2] += sp84[2];
sp6C[0] = s_player_velocity[0];
sp6C[2] = s_player_velocity[2];
ml_vec3f_scale_copy(s_delta_position, sp6C, 1.0f);
if(mlAbsF(s_player_velocity[0]) < 0.0001)
s_player_velocity[0] = 0;
if(mlAbsF(s_player_velocity[2]) < 0.0001)
s_player_velocity[2] = 0;
//update velocity for gravity
s_player_velocity[1] = s_player_velocity[1] + time_getDelta()*s_gravity ;
if(s_player_velocity[1] < s_terminal_velocity)
s_player_velocity[1] = s_terminal_velocity;
//update position
s_delta_position[1] = s_delta_position[1] + s_player_velocity[1];
ml_vec3f_scale(s_delta_position, time_getDelta());
s_next_position[0] += s_delta_position[0];\
s_next_position[1] += s_delta_position[1];\
s_next_position[2] += s_delta_position[2];
}
void __baphysics_update_no_gravity(void){
f32 sp24[3];
//update velocity
ml_vec3f_diff_copy(sp24, baphysics_target_velocity, s_player_velocity);
ml_vec3f_scale(sp24, time_getDelta()*baphysics_acceleration);
if(_SQ3v1(sp24) < 0.02){
ml_vec3f_copy(s_player_velocity, baphysics_target_velocity);
}
else{
s_player_velocity[0] += sp24[0];\
s_player_velocity[1] += sp24[1];\
s_player_velocity[2] += sp24[2];
}
//update position
s_delta_position[0] = s_player_velocity[0];\
s_delta_position[1] = s_player_velocity[1];\
s_delta_position[2] = s_player_velocity[2];
ml_vec3f_scale( s_delta_position, time_getDelta());
s_next_position[0] += s_delta_position[0];\
s_next_position[1] += s_delta_position[1];\
s_next_position[2] += s_delta_position[2];
}
void func_802971DC(void){
s_player_velocity[1] = s_player_velocity[1] + time_getDelta()*s_gravity;
if(s_player_velocity[1] < s_terminal_velocity)
s_player_velocity[1] = s_terminal_velocity;
s_delta_position[0] = s_player_velocity[0];\
s_delta_position[1] = s_player_velocity[1];\
s_delta_position[2] = s_player_velocity[2];
ml_vec3f_scale(s_delta_position, time_getDelta());
s_next_position[0] += s_delta_position[0];\
s_next_position[1] += s_delta_position[1];\
s_next_position[2] += s_delta_position[2];
}
void __baphysics_update_climb(void){
f32 sp34[3];
f32 sp28[3];
climbGetBottom(sp28);
s_next_position[0] = sp28[0];
s_next_position[2] = sp28[2];
func_80256E24(sp34, 0.0f, yaw_get(), 0.0f, 0.0f, -climbGetRadius());
s_player_velocity[2] = 0.0f;
s_next_position[0] += sp34[0];\
s_next_position[1] += sp34[1];\
s_next_position[2] += sp34[2];
s_player_velocity[0] = baphysics_target_velocity[0] = baphysics_target_velocity[2] = s_player_velocity[2];
__baphysics_update_no_gravity();
}
void func_8029737C(void){
s_delta_position[0] = s_player_velocity[0];
s_delta_position[1] = s_player_velocity[1];
s_delta_position[2] = s_player_velocity[2];
ml_vec3f_scale(s_delta_position, time_getDelta());
s_next_position[0] += s_delta_position[0];
s_next_position[1] += s_delta_position[1];
s_next_position[2] += s_delta_position[2];
}
void func_8029740C(void){
s_delta_position[0] = s_player_velocity[0];
s_delta_position[1] = s_player_velocity[1];
s_delta_position[2] = s_player_velocity[2];
ml_vec3f_clear(s_player_velocity);
ml_vec3f_scale(s_delta_position, time_getDelta());
s_next_position[0] += s_delta_position[0];
s_next_position[1] += s_delta_position[1];
s_next_position[2] += s_delta_position[2];
}
void __baphysics_update_goto(void){
f32 sp2C;
switch(baphysics_goto.state){
case 0: //L80297628
break;
case 1: //L802974E8
baphysics_goto.state = 2;
_player_getPosition(baphysics_goto.start_position);
baphysics_goto.elapsed_time = 0.0f;
baphysics_set_velocity(0);
break;
case 2: //L80297510
baphysics_goto.elapsed_time += time_getDelta();
sp2C = ml_map_f(baphysics_goto.elapsed_time, 0.0f, baphysics_goto.duration, 0.0f, 1.0f);
ml_vec3f_copy(s_player_velocity, s_next_position);
s_next_position[0] = ml_interpolate_f(sp2C, baphysics_goto.start_position[0], baphysics_goto.end_position[0]);
s_next_position[1] = ml_interpolate_f(sp2C, baphysics_goto.start_position[1], baphysics_goto.end_position[1]);
s_next_position[2] = ml_interpolate_f(sp2C, baphysics_goto.start_position[2], baphysics_goto.end_position[2]);
ml_vec3f_diff_copy(s_player_velocity, s_next_position, s_player_velocity);
ml_vec3f_scale(s_player_velocity, 1.0/time_getDelta());
if(1.0 == sp2C){
baphysics_set_velocity(0);
baphysics_goto.state = 3;
}
break;
case 3: //L80297628
break;
}
}
void __baphysics_update_transform(void){
f32 temp_f0;
D_8037C500 += time_getDelta();
temp_f0 = func_80257A44(D_8037C500, 1.2f);
temp_f0 = ml_sin_deg(temp_f0*360.0f);
s_next_position[1] = 5.0*temp_f0 + D_8037C4FC;
}
void baphysics_get_position_change(f32 arg0[3]){
ml_vec3f_copy(arg0, s_delta_position);
}
void baphysics_init(void){
baphysics_type = 0;
ml_vec3f_clear(s_player_velocity);
ml_vec3f_clear(baphysics_target_velocity);
ml_vec3f_clear(s_delta_position);
ml_vec3f_clear(s_next_position);
D_8037C4E4 = 0.0f;
baphysics_reset();
}
void baphysics_update(void){
_player_getPosition(s_next_position);
switch(baphysics_type){
case BA_PHYSICS_GOTO: //L80297780
__baphysics_update_goto();
break;
case BA_PHYSICS_TRANSFORM: //L80297790
__baphysics_update_transform();
break;
case BA_PHYSICS_UNK8: //L802977A0
func_8029737C();
break;
case BA_PHYSICS_UNK1: //L802977B0
func_802971DC();
break;
case BA_PHYSICS_NO_GRAVITY: //L802977C0
__baphysics_update_no_gravity();
break;
case BA_PHYSICS_NORMAL: //L802977D0 //bear
baphysics_set_target_yaw(yaw_getIdeal());
__baphysics_update_normal();
break;
case BA_PHYSICS_INVERTED_YAW: //L802977F0 //bird
baphysics_set_target_yaw(mlNormalizeAngle(yaw_getIdeal() + 180.0f));
__baphysics_update_normal();
break;
case BA_PHYSICS_LOCKED_ROTATION: //L80297820
__baphysics_update_normal();
break;
case BA_PHYSICS_UNK4: //L80297830
func_8029740C();
break;
case BA_PHYSICS_AIRBORN: //L80297840
if(0.0f < func_8029B2E8()){
baphysics_set_target_yaw(func_8029B33C());
}
__baphysics_update_normal();
break;
case BA_PHYSICS_CLIMB: //L80297880
__baphysics_update_climb();
break;
case BA_PHYSICS_NONE:
case BA_PHYSICS_FREEZE:
default:
break;
}
player_setPosition(s_next_position);
}
void baphysics_reset_horizontal_velocity(void){
baphysics_set_target_horizontal_velocity(0.0f);
s_player_velocity[0] = s_player_velocity[2] = 0.0f;
}
void baphysics_set_type(BaPhysicsType arg0){
if((arg0 == BA_PHYSICS_TRANSFORM) && (arg0 != baphysics_type)){
D_8037C4FC = s_next_position[1];
D_8037C500 = 0.0f;
}
if(arg0 == BA_PHYSICS_GOTO){
baphysics_goto.state = 1;
}
baphysics_type = arg0;
}
void baphysics_set_target_velocity(f32 src[3]){
if(src)
ml_vec3f_copy(baphysics_target_velocity, src);
else
ml_vec3f_clear(baphysics_target_velocity);
}
void baphysics_set_target_horizontal_velocity(f32 arg0){
baphysics_target_horizontal_velocity = arg0;
}
void baphysics_set_target_yaw(f32 arg0){
baphysics_target_yaw = mlNormalizeAngle(arg0);
}
void baphysics_set_vertical_velocity(f32 arg0){
s_player_velocity[1] = arg0;
}
void baphysics_set_horizontal_velocity(f32 yaw, f32 magnitude) { \
func_80256D0C(0.0f, yaw, 0.0f, 0.0f, magnitude, &s_player_velocity[0], &s_player_velocity[1], &s_player_velocity[2]);
}
void baphysics_set_velocity(f32 src[3]){
if(src)
ml_vec3f_copy(s_player_velocity, src);
else
ml_vec3f_clear(s_player_velocity);
}
f32 baphysics_get_gravity(void){
return s_gravity;
}
BaPhysicsType baphysics_get_type(void){
return baphysics_type;
}
f32 baphysics_get_target_horizontal_velocity(void){
return baphysics_target_horizontal_velocity;
}
f32 baphysics_get_target_vertical_velocity(void){
return baphysics_target_velocity[1];
}
f32 baphysics_get_target_yaw(void){
return baphysics_target_yaw;
}
void baphysics_get_velocity(f32 dst[3]){
ml_vec3f_copy(dst, s_player_velocity);
}
f32 baphysics_get_vertical_velocity(void){
return s_player_velocity[1];
}
f32 baphysics_get_horizontal_velocity(void){
return gu_sqrtf(s_player_velocity[0]*s_player_velocity[0] + s_player_velocity[2]*s_player_velocity[2]);
}
f32 baphysics_get_horizontal_velocity_percentage(void){
f32 horz_vel;
f32 target_vel;
f32 temp_f12;
horz_vel = baphysics_get_horizontal_velocity();
target_vel = baphysics_get_target_horizontal_velocity();
if(horz_vel < target_vel){
temp_f12 = horz_vel/target_vel;
}
else{
temp_f12 = 1.0f;
}
return temp_f12;
}
void baphysics_reset(void){
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
}
void baphysics_set_acceleration(f32 arg0){
baphysics_acceleration = arg0;
}
void baphysics_reset_gravity(void){
baphysics_set_gravity(baphysics_default_gravity);
}
void baphysics_reset_terminal_velocity(void){
baphysics_set_terminal_velocity(baphysics_default_terminal_velocity);
}
void baphysics_set_goto_duration(f32 arg0){
baphysics_goto.duration = arg0;
}
void baphysics_set_goto_position(f32 src[3]) { \
ml_vec3f_copy(baphysics_goto.end_position, src);
}
void baphysics_set_gravity(f32 arg0){
s_gravity = arg0;
}
void baphysics_set_terminal_velocity(f32 arg0){
s_terminal_velocity = arg0;
}
int baphysics_is_slower_than(f32 arg0){
return s_player_velocity[0]*s_player_velocity[0] + s_player_velocity[2]*s_player_velocity[2] <= (arg0*arg0);
}
int baphysics_goto_done(void){
return baphysics_goto.state == 3;
}

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/yaw.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
void func_80293D48(f32,f32);
@@ -41,10 +42,10 @@ void func_8029E48C(void){
f32 sp1C = func_8029B30C();
if(func_8029B300() == 0){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
else{
func_80297970(ml_interpolate_f(sp1C, D_80364960, D_80364964));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364960, D_80364964));
}
}
@@ -79,8 +80,8 @@ int bsant_inSet(s32 move_indx){
void bsant_idle_init(void){
func_8029E554();
baanim_playForDuration_loopSmooth(ASSET_5E_ANIM_BSANT_IDLE, 1.2f);
func_8029C7F4(1,YAW_STATE_1_DEFAULT,1,2);
func_80297970(0.0f);
func_8029C7F4(1,YAW_STATE_1_DEFAULT,1,BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
miscflag_set(3);
@@ -115,7 +116,7 @@ void bsant_idle_end(void){
void bsant_walk_init(void){
func_8029E554();
baanim_playForDuration_loopSmooth(ASSET_5F_ANIM_BSANT_WALK, 0.8f);
func_8029C7F4(2,YAW_STATE_1_DEFAULT,1,2);
func_8029C7F4(2, YAW_STATE_1_DEFAULT,1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_80364960, D_80364964, D_80364968, D_8036496C);
func_802900B4();
}
@@ -133,7 +134,7 @@ void bsant_walk_update(void){
if(animctrl_isAt(aCtrl, 0.2781f))
func_8029E448(1);
if(func_8029B300() == 0 && func_80297C04(1.0f))
if(func_8029B300() == 0 && baphysics_is_slower_than(1.0f))
sp1C = BS_35_ANT_IDLE;
if(func_8028B094())
@@ -161,14 +162,14 @@ void bsant_jump_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 0.4423f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsant.c", 0x17c);
func_8029C7F4(1,YAW_STATE_1_DEFAULT,3,6);
func_8029C7F4(1, YAW_STATE_1_DEFAULT, 3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_8029E48C();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364970);
gravity_set(D_80364974);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364970);
baphysics_set_gravity(D_80364974);
func_8029E3E0();
D_8037D294 = 0;
}
@@ -180,10 +181,10 @@ void bsant_jump_update(void){
f32 sp1C[3];
func_8029E48C();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1])
gravity_reset();
baphysics_reset_gravity();
switch(D_8037D294){
case 0://L8029EA88
@@ -213,7 +214,7 @@ void bsant_jump_update(void){
break;
}//L8029EB38
if(func_8028B2E8()){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
if(func_8029B300() > 0)
sp2C = BS_ANT_WALK;
@@ -225,7 +226,7 @@ void bsant_jump_update(void){
}
void bsant_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
func_8029E4EC();
}
@@ -239,7 +240,7 @@ void bsant_fall_init(void){
animctrl_setStart(aCtrl, 0.4423f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_start(aCtrl, "bsant.c", 0x208);
func_8029C7F4(1,YAW_STATE_1_DEFAULT,3,6);
func_8029C7F4(1, YAW_STATE_1_DEFAULT, 3, BA_PHYSICS_AIRBORN);
D_8037D294 = 0;
}
@@ -252,7 +253,7 @@ void bsant_fall_update(void){
if(D_8037D298)
func_8029E48C();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
switch(D_8037D294){
case 0:
if(func_8028B254(0x5A)){
@@ -300,12 +301,12 @@ static void __bsant_recoil_init(int take_damage){
func_80257F18(sp20, sp2C, &sp38);
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(200.0f);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1,YAW_STATE_1_DEFAULT,2,3);
player_setYVelocity(510.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(200.0f);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1, YAW_STATE_1_DEFAULT, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1200.0f);
baMarker_collisionOff();
func_80292E48();
D_8037D294 = 0;
@@ -336,7 +337,7 @@ static void __bsant_recoil_update(void){
static void __bsant_recoil_end(void){
func_80297CA8();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
func_8029E4EC();
@@ -387,12 +388,12 @@ void bsant_die_init(void){
D_8037D290 = 250.0f;
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(D_8037D290);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1,YAW_STATE_1_DEFAULT,2,3);
player_setYVelocity(510.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(D_8037D290);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1, YAW_STATE_1_DEFAULT, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1200.0f);
pitch_setAngVel(1000.0f, 12.0f);
func_802914CC(0xd);
ncDynamicCamD_func_802BF2C0(30.0f);
@@ -406,7 +407,7 @@ void bsant_die_init(void){
void bsant_die_update(void){
AnimCtrl *aCtrl = baanim_getAnimCtrlPtr();
func_80297970(D_8037D290);
baphysics_set_target_horizontal_velocity(D_8037D290);
func_80299628(0);
switch(D_8037D294){
case 0://L8029F270
@@ -440,7 +441,7 @@ void bsant_die_update(void){
void bsant_die_end(void){
func_8024BD08(0);
gravity_reset();
baphysics_reset_gravity();
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_80291548();
@@ -450,8 +451,8 @@ void bsant_die_end(void){
void func_8029F398(void){
func_8029E554();
baanim_playForDuration_loopSmooth(ASSET_5E_ANIM_BSANT_IDLE, 2.0f);
func_8029C7F4(1,YAW_STATE_1_DEFAULT,3,2);
func_80297970(0.0f);
func_8029C7F4(1, YAW_STATE_1_DEFAULT, 3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029C674();
func_802B3A50();
}

View File

@@ -1,15 +1,11 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_8029797C(f32);
f32 func_80297A64(void);
void func_80297970(f32);
f32 func_80297A7C(void);
s32 func_8029E2E0(s32, f32);
void func_80292864(f32, f32);
void func_802979AC(f32, f32);
void func_8029E3C0(s32, f32);
@@ -36,15 +32,15 @@ void func_8029F4F0(void){
switch(D_8037D2A4){
case 0:
tmp_f = (func_80297A7C() + 180.0f);
tmp_f = (baphysics_get_target_yaw() + 180.0f);
func_80292864(tmp_f - 70.0f, 20.0f);
break;
case 1:
tmp_f = (func_80297A7C() + 180.0f);
tmp_f = (baphysics_get_target_yaw() + 180.0f);
func_80292864(tmp_f - 10.0f, 20.0f);
break;
case 2:
tmp_f = (func_80297A7C() + 180.0f);
tmp_f = (baphysics_get_target_yaw() + 180.0f);
func_80292864(tmp_f + 50.0f, 20.0f);
break;
}
@@ -73,10 +69,10 @@ void bsbarge_init(void){
animctrl_setPlaybackType(plyrMvmnt, ANIMCTRL_ONCE);
animctrl_start(plyrMvmnt, "bsbbarge.c", 0x98);
D_8037D2A4 = 0;
func_8029C7F4(1,1,3,3);
func_8029797C(yaw_getIdeal());
func_80297970(func_80297A64()*0.3);
func_802979AC(yaw_getIdeal(), func_80297A64());
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_target_horizontal_velocity(baphysics_get_target_horizontal_velocity()*0.3);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
func_8029E070(1);
D_8037D2A6 = 0;
D_8037D2A5 = 0;
@@ -127,15 +123,15 @@ void bsbarge_update(void){
animctrl_setDuration(plyrMvmnt, 1.0f);
baanim_setEnd(0.565f);
func_80297970(D_8037D2A0);
func_802979AC(yaw_getIdeal(), func_80297A64());
baphysics_set_target_horizontal_velocity(D_8037D2A0);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
func_8030E760(SFX_2_CLAW_SWIPE, 0.558f, 22000);
D_8037D2A5 = 2;
func_8029F4F0();
D_8037D2A6 = 1;
break;
case 2:
func_80297970(D_8037D2A0);
baphysics_set_target_horizontal_velocity(D_8037D2A0);
if(animctrl_isStopped(plyrMvmnt)){
animctrl_setDuration(plyrMvmnt, 2.0f);
baanim_setEnd(0.6f);
@@ -149,7 +145,7 @@ void bsbarge_update(void){
if(miscflag_isFalse(0xC) || func_8029E384(0)){
D_8037D2A0 -= 80.0f;
}
func_80297970(D_8037D2A0);
baphysics_set_target_horizontal_velocity(D_8037D2A0);
if(D_8037D2A0 < 200.0f){
animctrl_setDuration(plyrMvmnt, 1.5f);
baanim_setEnd(1.0f);
@@ -164,7 +160,7 @@ void bsbarge_update(void){
D_8037D2A0 = 0.0f;
D_8037D2A6 = 0;
}
func_80297970(D_8037D2A0);
baphysics_set_target_horizontal_velocity(D_8037D2A0);
if(animctrl_isAt(plyrMvmnt, 0.9193f))
sp24 = BS_20_LANDING;
break;

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .bss */
u8 D_8037D2E0;
u8 D_8037D2E1;
@@ -9,9 +11,9 @@ u8 D_8037D2E1;
/* .code */
void bseggass_init(void){
baanim_playForDuration_onceSmooth(ASSET_2B_ANIM_BSEGGASS, 1.0f);
func_8029C7F4(1,3,1,3);
func_8029C7F4(1,3,1, BA_PHYSICS_LOCKED_ROTATION);
yaw_setVelocityBounded(350.0f, 14.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029E058(1);
D_8037D2E0 = (D_8037D2E1 = 1);
func_802952A8(5,0);
@@ -60,6 +62,6 @@ void bseggass_update(void) {
void bseggass_end(void){
func_802952A8(5, 1);
gravity_reset();
baphysics_reset_gravity();
func_8029E058(0);
}

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void yaw_setVelocityBounded(f32, f32);
void animctrl_start(AnimCtrl *, char*, s32);
@@ -12,9 +14,9 @@ u8 D_8037D2F1;
/* .code */
void bsegghead_init(void){
baanim_playForDuration_onceSmooth(ASSET_2A_ANIM_BSEGGHEAD, 1.0f);
func_8029C7F4(1,3,1,3);
func_8029C7F4(1,3,1, BA_PHYSICS_LOCKED_ROTATION);
yaw_setVelocityBounded(350.0f, 14.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029E070(1);
D_8037D2F0 = (D_8037D2F1 = 1);
func_802952A8(2,0);
@@ -68,6 +70,6 @@ void bsegghead_update(void) {
void bsegghead_end(void){
func_802952A8(2, 1);
gravity_reset();
baphysics_reset_gravity();
func_8029E070(0);
}

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
f32 func_802A2858(void);
@@ -19,15 +20,15 @@ u8 D_8037D30C;
void bsbflap_init(void) {
baanim_playForDuration_onceSmooth(ASSET_18_ANIM_BSBFLAP_ENTER, 0.3f);
func_8029C7F4(1, 1, 1, 2);
func_8029C7F4(1, 1, 1, BA_PHYSICS_NORMAL);
if (func_8029B2E8() != 0.0f) {
yaw_setIdeal(func_8029B33C());
}
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B6FA8();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(0.0f);
gravity_set(D_80364A14);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(0.0f);
baphysics_set_gravity(D_80364A14);
func_8029E070(1);
miscflag_set(MISC_FLAG_12_HAS_FLAPPED);
func_8029E3C0(0, 2.5f);
@@ -119,9 +120,9 @@ void bsbflap_update(void){
animctrl_setPlaybackType(sp18, ANIMCTRL_LOOP);
animctrl_setStart(sp18, 0.0f);
animctrl_start(sp18, "bsbflap.c", 0xe1);
player_setYVelocity(D_80364A10);
gravity_set(D_80364A14);
func_80297BF8(D_80364A18);
baphysics_set_vertical_velocity(D_80364A10);
baphysics_set_gravity(D_80364A14);
baphysics_set_terminal_velocity(D_80364A18);
D_8037D300 = 1;
}
break;
@@ -144,8 +145,8 @@ void bsbflap_update(void){
if(D_8037D301 == 4)
D_8037D300 = 3;
if(button_released(BUTTON_A)){
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
animctrl_setDuration(sp18, 1.0f);
D_8037D300 = 4;
}
@@ -157,14 +158,14 @@ void bsbflap_update(void){
func_802A28CC();
func_802A298C();
if(button_released(BUTTON_A)){
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
animctrl_setDuration(sp18, 1.0f);
func_80293240(2);
D_8037D300 = 4;
}
else{
func_80297970(func_80297A64() * 0.35);
baphysics_set_target_horizontal_velocity(baphysics_get_target_horizontal_velocity() * 0.35);
}
break;
case 4:
@@ -192,8 +193,8 @@ void bsbflap_update(void){
void bsbflap_end(void) {
ability_use(1);
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
func_8029E090(0, 0.2f);
func_8030DA44(D_8037D30C);
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .data */
const f32 D_80364A20 = 920.0f;
@@ -18,9 +19,9 @@ void _bsbflip_802A2D60(void){
f32 sp1C;
sp1C = func_8029B30C();
if(!func_8029B300())
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
else
func_80297970(ml_interpolate_f(sp1C, D_80364A2C, D_80364A30));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364A2C, D_80364A30));
}
void _bsbflip_802A2DC0(void){
@@ -33,10 +34,10 @@ void _bsbflip_802A2DC0(void){
animctrl_setStart(aCtrl, 0.8566f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsbflip.c", 0x69); //nice
func_802978DC(3);
func_80297970(0.0f);
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_horizontal_velocity(0.0f);
ml_vec3f_clear(sp20);
func_80297A0C(sp20);
baphysics_set_velocity(sp20);
func_8029C5E8();
}
@@ -50,7 +51,7 @@ void bsbflip_init(void){
animctrl_setStart(aCtrl, 0.0f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsbflip.c", 0x80);
func_8029C7F4(1,1,2,3);
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
func_8029B324(0, 0.03f);
func_8029B324(1, 1.0f);
func_8029E070(1);
@@ -79,17 +80,17 @@ void bsbflip_update(void){
yaw_setIdeal(func_8029B33C());
}
yaw_rotateTimed(1.0f);
func_802978DC(6);
func_8029797C(yaw_getIdeal());
func_80297970(200.0f);
func_802979AC(yaw_getIdeal(), func_80297A64());
baphysics_set_type(BA_PHYSICS_AIRBORN);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_target_horizontal_velocity(200.0f);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
}else{//L802A3098
func_802978DC(6);
func_80297970(0.0f);
baphysics_set_type(BA_PHYSICS_AIRBORN);
baphysics_set_target_horizontal_velocity(0.0f);
}
player_setYVelocity(D_80364A20);
gravity_set(D_80364A24);
func_80297BF8(D_80364A28);
baphysics_set_vertical_velocity(D_80364A20);
baphysics_set_gravity(D_80364A24);
baphysics_set_terminal_velocity(D_80364A28);
animctrl_setDuration(aCtrl, 1.9f);
func_8030E4E4(SFX_33_BANJO_AHOO);
D_8037D310 = 1;
@@ -120,7 +121,7 @@ void bsbflip_update(void){
animctrl_setDuration(aCtrl, 0.8f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsbflip.c", 0xee);
func_80297B94();
baphysics_reset_terminal_velocity();
D_8037D310 = 3;
}//L802A320C
if(func_8028B2E8()){
@@ -160,8 +161,8 @@ void bsbflip_update(void){
void bsbflip_end(void){
ability_use(2);
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
func_8029E070(0);
func_8029B0C0();
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
extern void func_8028FDC8(f32);
extern void baModel_setYDisplacement(f32);
@@ -60,8 +61,8 @@ void func_802A3430(void){
void func_802A34C8(void){
if(!bsbfly_inSet(bs_getNextState())){
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
func_8029E070(0);
baModel_setYDisplacement(0.0f);
func_8029CB84();
@@ -134,14 +135,14 @@ int func_802A37F8(void){
void bsbfly_enter_init(void){
baanim_playForDuration_onceSmooth(ASSET_45_ANIM_BSBFLY_ENTER, 1.4f);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
func_80297A0C(0);
func_80297970(0.0f);
gravity_set(-1200.0f);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_velocity(0);
baphysics_set_target_horizontal_velocity(0.0f);
baphysics_set_gravity(-1200.0f);
func_8029E070(1);
func_80299BD4();
D_8037D344 = 0;
@@ -156,14 +157,14 @@ void bsbfly_enter_update(void){
case 0:
if(animctrl_isAt(aCtrl, 0.2416f)){
animctrl_setDuration(aCtrl, 2.4f);
player_setYVelocity(1600.0f);
baphysics_set_vertical_velocity(1600.0f);
func_8030E58C(SFX_C_TAKING_FLIGHT_LIFTOFF, 0.7f);
D_8037D344 = 1;
}
break;
default:
func_802A36D0();
if(_get_vertVelocity() < 0.0f)
if(baphysics_get_vertical_velocity() < 0.0f)
sp1C = BS_24_FLY;
break;
}
@@ -178,18 +179,18 @@ void bsbfly_enter_end(void){
void bsbfly_init(void){
baanim_playForDuration_loopSmooth(ASSET_38_ANIM_BSBFLY, 0.62f);
func_8029C7F4(1,1,3,3);
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
if(miscflag_isTrue(9)){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}else{
func_80297970(600.0f);
baphysics_set_target_horizontal_velocity(600.0f);
}
func_802979AC(yaw_getIdeal(), func_80297A64());
func_8029797C(yaw_getIdeal());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_target_yaw(yaw_getIdeal());
func_8029E070(1);
gravity_set(-300.0f);
func_80297BF8(-99.9f);
baphysics_set_gravity(-300.0f);
baphysics_set_terminal_velocity(-99.9f);
func_802914CC(4);
func_802A3430();
D_8037D320 = 1.0f;
@@ -247,7 +248,7 @@ void bsbfly_update(void){
pitch_setIdeal(sp34);
func_802A3404();
if(sp30){
player_setYVelocity(sp30 * 400.0);
baphysics_set_vertical_velocity(sp30 * 400.0);
}
if(!sp30){
animctrl_setDuration(aCtrl, 0.62f);
@@ -259,19 +260,19 @@ void bsbfly_update(void){
if(animctrl_isAt(aCtrl, 0.1358f)){
func_8030EBC8(SFX_2_CLAW_SWIPE, 0.6f, 0.7f, 0x2710, 0x2ee0);
}
gravity_set(-300.0f);
baphysics_set_gravity(-300.0f);
if(miscflag_isTrue(9)){
func_80297BF8(0.0f);
func_80297A0C(0);
baphysics_set_terminal_velocity(0.0f);
baphysics_set_velocity(0);
sp38 = 0.0f;
}
else if(sp3C <= 80.0f){
func_80297BF8(ml_map_f(sp3C, 60.0f, 80.0f, -99.9f, -1000.33));
gravity_set(ml_map_f(sp3C, 60.0f, 80.0f, -300.0f, -700.0f));
baphysics_set_terminal_velocity(ml_map_f(sp3C, 60.0f, 80.0f, -99.9f, -1000.33));
baphysics_set_gravity(ml_map_f(sp3C, 60.0f, 80.0f, -300.0f, -700.0f));
sp38 = ml_map_f(sp3C, 60.0f, 80.0f, 600.0f, 60.0f);
}
else{
func_80297BF8(ml_map_f(sp3C, 300.0f, 310.0f, -399.99f, -99.9f));
baphysics_set_terminal_velocity(ml_map_f(sp3C, 300.0f, 310.0f, -399.99f, -99.9f));
sp38 = ml_map_f(sp3C, 300.0f, 340.0f, 0.0f, 600.0f);
}//L802A3E18
@@ -281,8 +282,8 @@ void bsbfly_update(void){
if(sp4C != NULL && -1.0 < sp40[1])
sp38 = 0.0f;
func_8029797C(yaw_get());
func_80297970(sp38);
baphysics_set_target_yaw(yaw_get());
baphysics_set_target_horizontal_velocity(sp38);
if(should_beak_bust())
sp54 = BS_F_BBUSTER;
@@ -321,12 +322,12 @@ int bsbfly_bombHitboxActive(void){
void func_802A3F9C(void){
f32 sp1C[3];
baanim_playForDuration_once(ASSET_43_ANIM_BSBFLY_BEAKBOMB_START, 1.0f);
func_8029C7F4(1,1,3,7);
func_8029C7F4(1,1,3,BA_PHYSICS_FREEZE);
func_802A339C(D_8037D338, sp1C, 4200.0f);
yaw_setIdeal(sp1C[1] + 180.0f);
pitch_setIdeal(sp1C[0]);
roll_setIdeal(0.0f);
func_80297A0C(D_8037D338);
baphysics_set_velocity(D_8037D338);
pitch_setIdeal(sp1C[0]);
func_8029E070(1);
func_802914CC(4);
@@ -375,7 +376,7 @@ void func_802A411C(void) {
switch (D_8037D344) {
case 0:
if (animctrl_isAt(sp58, 0.6905f)) {
func_802978DC(8);
baphysics_set_type(BA_PHYSICS_UNK8);
func_802914CC(5);
ncDynamicCam5_func_802BF590(&D_8037D338);
animctrl_setDuration(sp58, 0.05f);
@@ -453,15 +454,15 @@ void func_802A4430(void){
animctrl_setDuration(plyr_animctrl, 0.38f);
animctrl_setPlaybackType(plyr_animctrl, ANIMCTRL_LOOP);
animctrl_start(plyr_animctrl, "bsbfly.c", 0x38a);
func_8029C7F4(1, 1, 3, 3);
func_8029C7F4(1, 1, 3, BA_PHYSICS_LOCKED_ROTATION);
func_8029E070(1);
func_802A3430();
func_80293D74();
func_80294378(1);
roll_setIdeal(0.0f);
pitch_setIdeal(0.0f);
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
baModel_setYDisplacement(0.0f);
func_80299CF4(SFX_31_BANJO_OHHWAAOOO, 1.0f, 0x7fff);
func_80299D2C(SFX_61_CARTOONY_FALL, 1.0f, 0x7fff);
@@ -472,7 +473,7 @@ void func_802A4430(void){
void func_802A4548(void){
s32 next_state = 0;
f32 sp20[3];
_get_velocity(sp20);
baphysics_get_velocity(sp20);
switch(D_8037D344){
case 0://L802A457C
if(func_8028B254(0x5A)){
@@ -528,7 +529,7 @@ void func_802A46C8(void) {
void bsbfly_beakbomb_crash_init(void) {
baanim_playForDuration_once(ASSET_3E_ANIM_BSBFLY_BEAKBOMB_CRASH, 1.4f);
func_8029C7F4(1, 1, 3, 3);
func_8029C7F4(1, 1, 3, BA_PHYSICS_LOCKED_ROTATION);
func_8029E070(1);
FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 32750);
func_80299CF4(SFX_36_BANJO_DOH, 1.0f, 28000);
@@ -552,7 +553,7 @@ void func_802A47E0(void) {
func_80299CF4(SFX_38_BANJO_AYE_1, 1.0f, 22000);
}
if (animctrl_isAt(sp1C, 0.92f)) {
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
if (animctrl_getAnimTimer(sp1C) < 0.8) {
func_802929F8();
@@ -639,17 +640,17 @@ void func_802A4A78(s32 arg0) {
func_80257F18(sp30, sp3C, &sp28);
yaw_setIdeal(mlNormalizeAngle(sp28 + 180.0f));
yaw_applyIdeal();
func_80297970(sp20);
func_8029797C(sp28);
func_802979AC(sp28, func_80297A64());
baphysics_set_target_horizontal_velocity(sp20);
baphysics_set_target_yaw(sp28);
baphysics_set_horizontal_velocity(sp28, baphysics_get_target_horizontal_velocity());
if ((arg0 == 1) && (map_get() == MAP_90_GL_BATTLEMENTS)) {
yaw_setIdeal(mlNormalizeAngle(sp28));
yaw_applyIdeal();
}
func_8029C7F4(1, 1, 2, 3);
player_setYVelocity(800.0f);
gravity_set(sp2C);
func_80297BF8(-4000.0f);
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(800.0f);
baphysics_set_gravity(sp2C);
baphysics_set_terminal_velocity(-4000.0f);
func_8029E070(1);
func_802914CC(4);
ncDynamicCam4_func_802BFE50(12.0f, 10000.0f, 800.0f);
@@ -671,7 +672,7 @@ void func_802A4C34(s32 arg0) {
}
void func_802A4C88(s32 arg0) {
func_80297B3C();
baphysics_reset();
baMarker_collisionOn();
func_80297CA8();
func_8029E070(0);
@@ -716,16 +717,16 @@ void func_802A4D90(void) {
func_80257F18(sp1C, player_position, &sp34);
yaw_setIdeal(mlNormalizeAngle(sp34 + 180.0f));
yaw_applyIdeal();
func_80297970(1300.0f);
func_8029797C(sp34);
func_802979AC(sp34, func_80297A64());
baphysics_set_target_horizontal_velocity(1300.0f);
baphysics_set_target_yaw(sp34);
baphysics_set_horizontal_velocity(sp34, baphysics_get_target_horizontal_velocity());
if (map_get() == MAP_90_GL_BATTLEMENTS) {
yaw_setIdeal(mlNormalizeAngle(sp34));
yaw_applyIdeal();
}
func_8029C7F4(1, 1, 2, 3);
player_setYVelocity(400.0f);
gravity_set(-1800.0f);
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(400.0f);
baphysics_set_gravity(-1800.0f);
baMarker_collisionOff();
func_802914CC(4);
ncDynamicCam4_func_802BFE50(12.0f, 10000.0f, 800.0f);
@@ -748,14 +749,14 @@ void func_802A4EC8(void) {
}
void func_802A4F44(void){
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_802A34C8();
}
void func_802A4F74(void) {
baanim_playForDuration_loopSmooth(ASSET_38_ANIM_BSBFLY, 0.62f);
func_8029C7F4(1, 1, 3, 7);
func_8029C7F4(1, 1, 3, BA_PHYSICS_FREEZE);
func_8029E070(1);
func_802914CC(4);
func_802A3430();
@@ -808,15 +809,15 @@ void func_802A50F8(void){
void func_802A5120(void){
baanim_playForDuration_loop(ASSET_68_ANIM_BSJUMP_TUMBLE, 0.35f);
func_8029C7F4(1,1,3,6);
func_80297970(0.0f);
func_80297A0C(0);
player_setYVelocity(2000.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
baphysics_set_target_horizontal_velocity(0.0f);
baphysics_set_velocity(0);
baphysics_set_vertical_velocity(2000.0f);
func_80299CF4(SFX_63_BANJO_UWAAAAOOH, 1.0f, 32000);
}
void func_802A5190(void){
player_setYVelocity(2000.0f);
baphysics_set_vertical_velocity(2000.0f);
bs_setState(0);
}

View File

@@ -4,6 +4,7 @@
#include "core2/ba/model.h"
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .data */
@@ -39,9 +40,9 @@ void func_802A5208(int arg0){
void func_802A524C(void){
f32 sp1C = func_8029B30C();
if(!func_8029B300())
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
else
func_80297970(ml_interpolate_f(sp1C, D_80364A40, D_80364A44));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364A40, D_80364A44));
}
int bslongleg_inSet(s32 move_indx){
@@ -125,8 +126,8 @@ void bsblongleg_enter_init(void){
__bsblongleg_enterFromTrot();
else
__bsblongleg_enter();
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802A5374();
func_80299BD4();
}
@@ -156,8 +157,8 @@ void bsblongleg_enter_end(void){
void bsblongleg_stand_enter(void){
baanim_playForDuration_loopSmooth(ASSET_41_ANIM_BSLONGLEG_IDLE, 1.0f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
baModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
func_802A5374();
}
@@ -202,7 +203,7 @@ void bsblongleg_walk_init(void){
animctrl_setIndex(aCtrl, ASSET_42_ANIM_BSLONGLEG_WALK);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP);
animctrl_start(aCtrl, "bsblongleg.c", 0x1a1);
func_8029C7F4(2,1,1,2);
func_8029C7F4(2,1,1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_80364A40, D_80364A44, D_80364A48, D_80364A4C);
}
@@ -220,10 +221,10 @@ void bsblongleg_walk_update(void){
func_802A5208(1);
func_802A524C();
if(button_pressed(BUTTON_B) && func_80297A64() == 0.0f)
if(button_pressed(BUTTON_B) && baphysics_get_target_horizontal_velocity() == 0.0f)
stateTimer_clear(STATE_TIMER_2_LONGLEG);
if(!func_8029B300() && func_80297C04(1.0f))
if(!func_8029B300() && baphysics_is_slower_than(1.0f))
next_state = BS_26_LONGLEG_IDLE;
if(player_shouldSlideTrot())
@@ -273,7 +274,7 @@ void bsblongleg_exit_init(void){
func_802A5AB0();
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
func_8029957C(2);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
D_8037D361 = func_8030D90C();
sfxsource_setSfxId(D_8037D361, SFX_2C_PULLING_NOISE);
func_8030E04C(D_8037D361, 1.4f, 0.4f, -1.2f);
@@ -322,14 +323,14 @@ void bsblongleg_jump_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 0.42f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsblongleg.c", 0x27F);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802A524C();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364A50);
gravity_set(D_80364A54);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364A50);
baphysics_set_gravity(D_80364A54);
func_8030E58C(SFX_48_KAZOOIE_RUUH, 0.9f);
D_8037D360 = 0;
}
@@ -342,9 +343,9 @@ void bsblongleg_jump_update(void){
func_802A531C();
func_802A524C();
_get_velocity(&sp34);
baphysics_get_velocity(sp34);
if(button_released(BUTTON_A) && 0.0f < sp34[1])
gravity_reset();
baphysics_reset_gravity();
sp30 = player_getYPosition() - func_80294438();
switch(D_8037D360){
@@ -400,7 +401,7 @@ void bsblongleg_jump_update(void){
}
void bsblongleg_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
func_802A5404();
}
@@ -412,14 +413,14 @@ void bsblongleg_slide_init(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_setStart(aCtrl, 0.0865f);
animctrl_start(aCtrl, "bsblongleg.c", 0x339);
func_8029C7F4(1,1,3,3);
func_8029797C(yaw_getIdeal());
func_802979AC(yaw_getIdeal(), func_80297A64());
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
func_8029E070(1);
func_8029E064(1);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_80299AAC();
D_8037D358 = 1.0f;
}
@@ -437,8 +438,8 @@ void bsblongleg_slide_update(void){
func_80294480(sp30);
func_8025801C(sp30, &sp2C);
func_80299594(1, 0.5f);
func_80297970(ml_map_f(pitch_getIdeal(), 20.0f, 60.0f, 550.0f, 700.0f));
func_8029797C(sp2C);
baphysics_set_target_horizontal_velocity(ml_map_f(pitch_getIdeal(), 20.0f, 60.0f, 550.0f, 700.0f));
baphysics_set_target_yaw(sp2C);
func_8029C22C();
}else{//L802A6304
sp3C = BS_26_LONGLEG_IDLE;
@@ -463,8 +464,8 @@ void func_802A6388(f32 arg0){
void func_802A6394(void){
baanim_playForDuration_loopSmooth(ASSET_41_ANIM_BSLONGLEG_IDLE, 1.0f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802A5374();
baModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
func_8029C674();

View File

@@ -3,6 +3,8 @@
#include "variables.h"
#include "core2/yaw.h"
#include "core2/ba/physics.h"
void baModel_80292048(s32, f32, f32, f32);
void animctrl_start(AnimCtrl *, char *, s32);
@@ -38,11 +40,11 @@ void bsbpeck_init(void){
func_80293240(2);
baanim_playForDuration_onceSmooth(ASSET_1A_ANIM_BSBPECK, 0.2f);
func_8029C7F4(1,YAW_STATE_3_BOUNDED, 1, 6);
func_8029C7F4(1,YAW_STATE_3_BOUNDED, 1, BA_PHYSICS_AIRBORN);
yaw_setVelocityBounded(1200.0f, 10.0f);
func_8029E070(1);
gravity_set(D_80364A60);
player_setYVelocity(D_80364A64);
baphysics_set_gravity(D_80364A60);
baphysics_set_vertical_velocity(D_80364A64);
baModel_80292048(1, -38.0f, 0.0f, 105.0f);
baModel_80292048(0, -38.0f, 0.0f, -7.0f);
baMarker_8028D638(0x23, 0x2A);
@@ -66,7 +68,7 @@ void func_802A664C(void){
}
miscflag_set(MISC_FLAG_5_HAS_PECKED);
func_8030E58C(SFX_42_KAZOOIE_RAH, sp1C);
player_setYVelocity(D_80364A64);
baphysics_set_vertical_velocity(D_80364A64);
D_8037D375++;
}
@@ -76,7 +78,7 @@ void bsbpeck_update(void){
func_802B6FA8();
if(D_8037D377){
func_80297970(func_80297A64() * 0.1);
baphysics_set_target_horizontal_velocity(baphysics_get_target_horizontal_velocity() * 0.1);
}
switch(D_8037D374){
@@ -134,5 +136,5 @@ void bsbpeck_end(void){
baModel_80292048(0, 0.0f, 0.0f, 0.0f);
baMarker_8028D638(0, 0);
func_8029E070(0);
gravity_reset();
baphysics_reset_gravity();
}

View File

@@ -1,6 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"s
#include "variables.h"
#include "core2/ba/physics.h"
/* .data */
const f32 D_80364A70 = 1250.0f;
@@ -21,14 +23,14 @@ void bsbshock_charge_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 0.1061f);
animctrl_setPlaybackType(aCtrl,1);
animctrl_start(aCtrl, "bsbshock.c", 0x61);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B6FA8();
func_802979AC(yaw_getIdeal(), func_80297A64());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
func_8029E064(1);
func_8029E070(1);
func_80299BD4();
@@ -55,9 +57,9 @@ void bsbshock_charge_update(void){
func_8029C348();
}
func_802B6FA8();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1]){
gravity_reset();
baphysics_reset_gravity();
}
switch(D_8037D381){
@@ -89,7 +91,7 @@ void bsbshock_charge_update(void){
D_8037D380 = 0;
}//L802A6CF4
if(func_8028B2E8())
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
else{//L802A6D18
if(should_flap())
@@ -102,7 +104,7 @@ void bsbshock_charge_update(void){
sp2C = BS_BSHOCK_JUMP;
if(animctrl_isAt(aCtrl, 0.5551f)){
player_setYVelocity(180.0f);
baphysics_set_vertical_velocity(180.0f);
baModel_80292158(0.0f);
func_80298528(50.0f);
}
@@ -132,16 +134,16 @@ void bsbshock_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 1.0f);
animctrl_setPlaybackType(aCtrl,1);
animctrl_start(aCtrl, "bsbshock.c", 0x13a);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B6FA8();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364A70);
gravity_set(D_80364A74);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364A70);
baphysics_set_gravity(D_80364A74);
func_8030E484(SFX_E_SHOCKSPRING_BOING);
func_8029E064(1);
func_8029E070(1);
@@ -157,12 +159,12 @@ void bsbshock_update(void){
AnimCtrl * aCtrl = baanim_getAnimCtrlPtr();
func_802B6FA8();
_get_velocity(sp20);
baphysics_get_velocity(sp20);
if(animctrl_isAt(aCtrl, 0.7f))
func_8030E484(SFX_53_BANJO_HUIII);
if(button_released(BUTTON_A) && 0.0f < sp20[1])
gravity_reset();
baphysics_reset_gravity();
if(D_8037D381 == 0){
func_8029C348();
@@ -186,7 +188,7 @@ void bsbshock_update(void){
void bsbshock_end(void){
if(bs_getNextState() != BS_11_BPECK)
gravity_reset();
baphysics_reset_gravity();
func_8029E064(0);
func_8029E070(0);

View File

@@ -3,6 +3,8 @@
#include "variables.h"
#include "core2/ba/model.h"
#include "core2/ba/physics.h"
extern f32 func_8029494C(void);
extern f32 func_8029B2D0(void);
@@ -17,12 +19,12 @@ u8 D_8037D396;
f32 D_8037D398;
void func_802A7140() {
func_8029C7F4(1, 3, 3, 9);
func_8029C7F4(1, 3, 3, BA_PHYSICS_NO_GRAVITY);
}
f32 func_802A716C() {
f32 sp24[3];
_get_velocity(sp24);
baphysics_get_velocity(sp24);
ml_map_f(gu_sqrtf((sp24[0] * sp24[0]) + (sp24[1] * sp24[1]) + (sp24[2] * sp24[2])), 50.0f, 200.0f, 0.0f, 1.0f);
}
@@ -71,14 +73,14 @@ void func_802A744C(void) {
func_8035644C(FILEPROG_AC_DIVE_OILY_WATER);
}
roll_setAngularVelocity(30.0f, 0.9f);
gravity_set(0.0f);
func_80297BF8(-399.99f);
baphysics_set_gravity(0.0f);
baphysics_set_terminal_velocity(-399.99f);
func_8029B324(0, 0.03f);
func_8029B324(1, 1.0f);
func_8029E070(1);
func_80294378(3);
baModel_setYDisplacement(60.0f);
func_80297B64(2.0f);
baphysics_set_acceleration(2.0f);
}
@@ -102,8 +104,8 @@ void func_802A75B0(void) {
if (!bsbswim_inSet(bs_getNextState())) {
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_80297B94();
gravity_reset();
baphysics_reset_terminal_velocity();
baphysics_reset_gravity();
func_8029B0C0();
func_8029E070(0);
func_80294378(1);
@@ -114,9 +116,9 @@ void func_802A75B0(void) {
void func_802A762C() {
baanim_playForDuration_loopSmooth(0x70, 2.0f);
func_802A7140();
func_80297930(0);
baphysics_set_target_velocity(0);
func_802A744C();
func_80297B64(0.4f);
baphysics_set_acceleration(0.4f);
}
void func_802A7674() {
@@ -162,7 +164,7 @@ void func_802A7738(void) {
func_802A7140();
func_802A744C();
D_8037D390 = 0.0f;
func_80297B64(1.0f);
baphysics_set_acceleration(1.0f);
func_802906A4(2);
}
@@ -174,8 +176,8 @@ void func_802A77D8(void) {
sp34 = pitch_get();
sp30 = yaw_get();
func_80256E24(sp24, sp34, sp30, 0.0f, 0.0f, D_8037D390);
func_80297930(sp24);
func_80297A0C(sp24);
baphysics_set_target_velocity(sp24);
baphysics_set_velocity(sp24);
}
void func_802A7838(void) {
@@ -237,7 +239,7 @@ void func_802A7A54() {
func_802A7140();
func_802A744C();
D_8037D390 = 120.0f;
func_80297B64(2.0f);
baphysics_set_acceleration(2.0f);
func_802906A4(2);
}
@@ -291,10 +293,10 @@ void func_802A7BD0(void) {
func_80257F18(sp24, sp30, &sp3C);
yaw_setIdeal(mlNormalizeAngle(sp3C));
yaw_applyIdeal();
func_80297970(func_802987D4());
func_8029797C(sp3C);
func_802979AC(sp3C, func_80297A64());
func_8029C7F4(1, 1, 2, 3);
baphysics_set_target_horizontal_velocity(func_802987D4());
baphysics_set_target_yaw(sp3C);
baphysics_set_horizontal_velocity(sp3C, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
baMarker_collisionOff();
func_80292E48();
func_802A744C();
@@ -333,7 +335,7 @@ void bsSwim_dive_init(void) {
baanim_playForDuration_once(ASSET_3C_ANIM_BSSWIM_DIVE_ENTER, 1.0f);
func_802A7140();
yaw_setVelocityBounded(500.0f, 5.0f);
func_80297930(0);
baphysics_set_target_velocity(0);
func_802A744C();
pitch_setAngVel(200.0f, 2.5f);
func_80299BD4();
@@ -357,7 +359,7 @@ void func_802A7E2C(void) {
sp34 = pitch_get();
sp30 = yaw_get();
func_80256E24(sp24, sp34, sp30, 0.0f, 0.0f, 800.0f);
func_80297A0C(sp24);
baphysics_set_velocity(sp24);
func_8029E3C0(1, 0.8f);
D_8037D396 = TRUE;
}
@@ -394,9 +396,9 @@ void func_802A7F6C(void) {
baanim_playForDuration_loopSmooth(ASSET_B9_ANIM_BSSWIM_DIE, 0.7f);
func_802A7140();
func_802A744C();
func_80297B64(1.0f);
func_80297930(0);
func_80297A0C(0);
baphysics_set_acceleration(1.0f);
baphysics_set_target_velocity(0);
baphysics_set_velocity(0);
pitch_setIdeal(275.0f);
roll_setIdeal(0.0f);
D_8037D396 = 0;
@@ -415,8 +417,8 @@ void func_802A8098(void) {
next_state = 0;
func_80256E24(sp40, -90.0f, 0.0f, 0.0f, 0.0f, 100.0f);
func_80297930(sp40);
func_80297A0C(sp40);
baphysics_set_target_velocity(sp40);
baphysics_set_velocity(sp40);
func_8029E22C(1);
if( func_8029E284(1, 0.2f)
|| func_8029E284(1, 0.8f)
@@ -437,7 +439,7 @@ void func_802A8098(void) {
next_state = BS_2D_SWIM_IDLE;
}
if (func_8029E314(1, 1.55f)) {
player_setYVelocity(-50.0f);
baphysics_set_vertical_velocity(-50.0f);
}
if (func_8029E284(1, 1.9f)) {
func_802914CC(0xD);
@@ -487,8 +489,8 @@ void func_802A8330(void) {
void func_802A83C0(void) {
baanim_playForDuration_loopSmooth(0x70, 2.0f);
func_802A7140();
func_80297930(0);
func_80297B64(0.4f);
baphysics_set_target_velocity(0);
baphysics_set_acceleration(0.4f);
func_802A744C();
func_802A8330();
}
@@ -535,10 +537,10 @@ void func_802A846C(void) {
animctrl_start(temp_s0, "bsbswim.c", 0x41E);
}
D_8037D398 = ml_map_f(sp28, 40.0f, 1000.0f, -300.0f, -1200.0f);
player_setYVelocity(D_8037D398);
func_8029C7F4(1, 3, 3, 9);
baphysics_set_vertical_velocity(D_8037D398);
func_8029C7F4(1, 3, 3, BA_PHYSICS_NO_GRAVITY);
func_802A744C();
func_802978DC(6);
baphysics_set_type(BA_PHYSICS_AIRBORN);
}
void func_802A85EC(void) {
@@ -554,7 +556,7 @@ void func_802A85EC(void) {
particleEmitter_emitN(sp34, 1);
if (D_8037D398 < 0.0f) {
D_8037D398 += ml_max_f(mlAbsF(D_8037D398) * 0.1, 50.0f);
player_setYVelocity(D_8037D398);
baphysics_set_vertical_velocity(D_8037D398);
}
if (func_8028B2E8()) {
next_state = BS_2D_SWIM_IDLE;
@@ -562,7 +564,7 @@ void func_802A85EC(void) {
if (!player_inWater()) {
next_state = BS_1_IDLE;
}
if (_get_vertVelocity() >= 0.0f) {
if (baphysics_get_vertical_velocity() >= 0.0f) {
next_state = BS_2D_SWIM_IDLE;
}
bs_setState(next_state);

View File

@@ -3,8 +3,9 @@
#include "variables.h"
#include "core2/ba/model.h"
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
#include "core2/statetimer.h"
/* .data */
f32 D_80364A90 = 30.0f;
@@ -42,7 +43,7 @@ void func_802A880C(s32 arg0){
void func_802A8850(void){
if( button_pressed(BUTTON_B)
&& stateTimer_isActive(STATE_TIMER_3_TURBO_TALON)
&& func_80297A64() == 0.0f
&& baphysics_get_target_horizontal_velocity() == 0.0f
){
stateTimer_clear(STATE_TIMER_3_TURBO_TALON);
}
@@ -90,10 +91,10 @@ f32 func_802A8984(void){
void func_802A89D4(void){
f32 sp24 = func_8029B30C();
if(!func_8029B300()){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
else{
func_80297970(ml_interpolate_f(sp24, func_802A8900(), func_802A88B0()));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp24, func_802A8900(), func_802A88B0()));
}
}
@@ -213,8 +214,8 @@ enum bs_e func_802A8D84(enum bs_e arg0){
void bsbtrot_enter_init(void){
func_802A8AD8();
baanim_playForDuration_onceSmooth(ASSET_16_ANIM_BSBTROT_ENTER, 1.0f);
func_8029C7F4(1,1,2,2);
func_80297970(0.0f);
func_8029C7F4(1,1,2, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802A8A40();
func_80299BD4();
func_802952A8(0,0);
@@ -242,8 +243,8 @@ void bsbtrot_enter_end(void){
void bsbtrot_stand_init(void){
baanim_playForDuration_loopSmooth(ASSET_26_ANIM_BSBTROT_IDLE, 1.2f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802A8A40();
}
@@ -272,7 +273,7 @@ void func_802A9054(void){
f32 tmp = 1.0f;
baanim_setVelocityMapRanges(func_802A8900(), func_802A88B0(), func_802A8984(), func_802A8934());
if(func_8028B394()){
tmp = ml_map_f(func_80297AF0(), 0.0f, 1.0f, 0.6f, 0.9f);
tmp = ml_map_f(baphysics_get_horizontal_velocity_percentage(), 0.0f, 1.0f, 0.6f, 0.9f);
baanim_scaleDuration(tmp);
}
else{
@@ -282,7 +283,7 @@ void func_802A9054(void){
void bsbtrot_walk_init(void){
baanim_playForDuration_loopSmooth(func_802A9030(), 0.53f);
func_8029C7F4(2,1,1,2);
func_8029C7F4(2,1,1, BA_PHYSICS_NORMAL);
func_802A8A40();
func_802A9054();
}
@@ -312,7 +313,7 @@ void bsbtrot_walk_update(void){
if(animctrl_isAt(aCtrl, 0.2115f) || animctrl_isAt(aCtrl, 0.7115f))
func_802A87C0();
}
if(!func_8029B300() && func_80297C04(1.0f))
if(!func_8029B300() && baphysics_is_slower_than(1.0f))
sp1C = BS_15_BTROT_IDLE;
if(func_8028B094())
@@ -355,15 +356,15 @@ void bsbtrot_jump_init(void){
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(3);
func_802978DC(6);
baphysics_set_type(BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802A89D4();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364ABC);
gravity_set(D_80364AC0);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364ABC);
baphysics_set_gravity(D_80364AC0);
func_8030E484(SFX_48_KAZOOIE_RUUH);
D_8037D3A4 = 0;
}
@@ -377,13 +378,13 @@ void bsbtrot_jump_update(void){
func_802A87C0();
if(miscflag_isTrue(0xF))
func_802978A4();
baphysics_reset_horizontal_velocity();
else
func_802A89D4();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1])
gravity_reset();
baphysics_reset_gravity();
switch(D_8037D3A4){
case 0://L802A9530
@@ -411,13 +412,13 @@ void bsbtrot_jump_update(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
func_8029957C(1);
D_8037D3A4 = 3;
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_8029C22C();
}
break;
case 3://L802A9660
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_802A9320();
func_80299628(1);
@@ -430,7 +431,7 @@ void bsbtrot_jump_update(void){
func_8029C22C();
break;
case 4://L802A96F0
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_802A9320();
@@ -444,7 +445,7 @@ void bsbtrot_jump_update(void){
func_8029C22C();
break;
case 5://L802A9780
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_802A9320();
func_80299628(1);
@@ -474,14 +475,14 @@ void bsbtrot_jump_update(void){
}
void bsbtrot_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
func_802A8BB0();
}
void bsbtrot_exit_init(void){
baanim_playForDuration_onceSmooth(ASSET_7_ANIM_BSBTROT_EXIT, 0.6f);
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
void bsbtrot_exit_update(void){
@@ -504,14 +505,14 @@ void bsbtrot_slide_init(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_start(aCtrl, "bsbtrot.c", 0x382);
func_802A8A40();
func_8029C7F4(1,1,3,3);
func_8029797C(yaw_getIdeal());
func_802979AC(yaw_getIdeal(), func_80297A64());
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
func_8029E070(1);
func_8029E064(1);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_80299AAC();
D_8037D3A0 = 1.0f;
}
@@ -530,8 +531,8 @@ void bsbtrot_slide_update(void){
func_80294480(sp30);
func_8025801C(sp30, &sp2C);
func_80299628(1);
func_80297970(ml_map_f(pitch_getIdeal(), 20.0f, 60.0f, 550.0f, 700.0f));
func_8029797C(sp2C);
baphysics_set_target_horizontal_velocity(ml_map_f(pitch_getIdeal(), 20.0f, 60.0f, 550.0f, 700.0f));
baphysics_set_target_yaw(sp2C);
func_8029C22C();
}else{
sp3C = BS_15_BTROT_IDLE;
@@ -572,10 +573,10 @@ void bsbtrot_fall_init(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_start(aCtrl, "bsbtrot.c", 0x400);
func_802A8A40();
func_8029C7F4(1,1,3,6);
func_8029797C(yaw_getIdeal());
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
baphysics_set_target_yaw(yaw_getIdeal());
func_802A89D4();
func_802979AC(yaw_getIdeal(), func_80297A64());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
D_8037D3A4 = 0;
}
@@ -588,11 +589,11 @@ void bsbtrot_fall_update(void){
func_802A87C0();
if(miscflag_isTrue(0xf))
func_802978A4();
baphysics_reset_horizontal_velocity();
else
func_802A89D4();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
switch (D_8037D3A4){
case 0://L802A9D90
if(func_8028B254(0x8C)){
@@ -610,7 +611,7 @@ void bsbtrot_fall_update(void){
animctrl_setDuration(aCtrl, 0.9f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
func_8029957C(1);
if(220.0f < func_80297A64()){
if(220.0f < baphysics_get_target_horizontal_velocity()){
func_80299AAC();
}
func_8029C22C();
@@ -618,7 +619,7 @@ void bsbtrot_fall_update(void){
}
break;
case 2://L802A9E78
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_802A9320();
@@ -632,7 +633,7 @@ void bsbtrot_fall_update(void){
func_8029C22C();
break;
case 3://L802A9F08
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_802A9320();
@@ -646,7 +647,7 @@ void bsbtrot_fall_update(void){
func_8029C22C();
break;
case 4://802A9F98
if(220.0f < func_80297A64())
if(220.0f < baphysics_get_target_horizontal_velocity())
func_80299AAC();
func_802A9320();
@@ -679,8 +680,8 @@ void bsbtrot_fall_end(void){
void bsbtrot_unk79_init(void){
baanim_playForDuration_loopSmooth(ASSET_26_ANIM_BSBTROT_IDLE, 1.2f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802A8A40();
baModel_setDirection(PLAYER_MODEL_DIR_KAZOOIE);
func_8029C674();
@@ -715,14 +716,14 @@ void bsbtrot_ow_init(void){
func_80257F18(sp24, sp30, &sp3C);
yaw_setIdeal(mlNormalizeAngle(sp3C + 180.0f));\
yaw_applyIdeal();
func_80297970(func_802987D4());
func_8029797C(sp3C);
func_802979AC(sp3C, func_80297A64());
func_8029C7F4(1,1,2,3);
baphysics_set_target_horizontal_velocity(func_802987D4());
baphysics_set_target_yaw(sp3C);
baphysics_set_horizontal_velocity(sp3C, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
if(func_802987B4() == 2)
func_802978DC(6);
player_setYVelocity(func_802987C4());
gravity_set(func_802987E4());
baphysics_set_type(BA_PHYSICS_AIRBORN);
baphysics_set_vertical_velocity(func_802987C4());
baphysics_set_gravity(func_802987E4());
baMarker_collisionOff();
func_80292E48();
}
@@ -749,7 +750,7 @@ void bsbtrot_ow_update(void){
void bsbtrot_ow_end(void){
func_80297CA8();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
func_802A8BB0();

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
const f32 D_80364AD0 = 80.0f;
const f32 D_80364AD4 = 425.0f;
@@ -19,9 +20,9 @@ u8 D_8037D3B4;
void func_802AA400(void){
f32 sp1C = func_8029B30C();
if(!func_8029B300()){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}else{
func_80297970(ml_interpolate_f(sp1C, D_80364AD0, D_80364AD4));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364AD0, D_80364AD4));
}
}
@@ -79,8 +80,8 @@ void func_802AA58C(enum bs_e *arg0){
void bsbwhirl_enter_init(void){
baanim_playForDuration_onceSmooth(ASSET_22_ANIM_BSWHIRL_EXIT, 0.5f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029B324(0, 0.03f);
func_8029B324(1, 1.0f);
func_8029E070(1);
@@ -107,8 +108,8 @@ void bsbwhirl_enter_end(void){
void bsbwhirl_stand_init(void){
baanim_playForDuration_loopSmooth(ASSET_23_ANIM_BSWONDERWING_IDLE, 1.0f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
}
void bsbwhirl_stand_update(void){
@@ -134,8 +135,7 @@ void bsbwhirl_stand_end(void){
void bsbwhirl_walk_init(void){
baanim_playForDuration_loopSmooth(ASSET_11_ANIM_BSWHIRL_WALK, 0.53f);
baanim_setVelocityMapRanges(D_80364AD0, D_80364AD4, D_80364AD8, D_80364ADC);
func_8029C7F4(2,1,1,2);
func_8029C7F4(2,1,1, BA_PHYSICS_NORMAL);
}
void bsbwhirl_walk_update(void){
@@ -145,7 +145,7 @@ void bsbwhirl_walk_update(void){
func_8029AD28(0.97f, 3);
func_802AA400();
if(!func_8029B300() && func_80297C04(1.0f))
if(!func_8029B300() && baphysics_is_slower_than(1.0f))
sp1C = BS_1B_WONDERWING_IDLE;
if(button_released(BUTTON_Z))
@@ -180,15 +180,15 @@ void bsbwhirl_jump_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 0.4495f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsbwhirl.c", 0x181);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3,BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802AA400();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364AE0);
gravity_set(D_80364AE4);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364AE0);
baphysics_set_gravity(D_80364AE4);
func_80299B58(0.91f, 1.09f);
D_8037D3B4 = 0;
}
@@ -200,9 +200,9 @@ void bsbwhirl_jump_update(void){
__bsbwhirl_spawnSparkle();
func_802AA400();
_get_velocity(&sp1C);
baphysics_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1])
gravity_reset();
baphysics_reset_gravity();
switch(D_8037D3B4){
case 0://L802AAB48
@@ -236,7 +236,7 @@ void bsbwhirl_jump_update(void){
}
void bsbwhirl_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
__bsbwhirl_end();
}
@@ -252,7 +252,7 @@ void bsbwhirl_exit_init(void){
animctrl_start(aCtrl, "bsbwhirl.c", 0x201);
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
func_8029957C(2);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
comusic_8025AB44(COMUSIC_25_USING_GOLD_FEATHERS, 0.0f, 0xFA0);
}
@@ -285,8 +285,8 @@ void bsbwhirl_drone_end(void){
void func_802AADBC(void){
baanim_playForDuration_loopSmooth(ASSET_23_ANIM_BSWONDERWING_IDLE, 1.0f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029C674();
}

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/*.data*/
const f32 D_80364990 = 400.0f;
const f32 D_80364994 = -800.0f;
@@ -62,11 +64,11 @@ void bsbbuster_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 0.35f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsbbuster.c", 0x81);
func_8029C7F4(1,1,3,6);
gravity_set(0.0f);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
baphysics_set_gravity(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
ml_vec3f_clear(sp20);
func_80297A0C(sp20);
baphysics_set_velocity(sp20);
func_8029E070(1);
func_802A02B4(0);
D_8037D2B9 = 0;
@@ -101,16 +103,16 @@ void bsbbuster_update(void){
case 1://8029FE24
D_8037D2B0 -= time_getDelta();
if(D_8037D2B0 <= 0.0f){
gravity_reset();
func_80297BF8(D_803649A8);
gravity_set(D_803649A4);
player_setYVelocity(D_803649A0);
baphysics_reset_gravity();
baphysics_set_terminal_velocity(D_803649A8);
baphysics_set_gravity(D_803649A4);
baphysics_set_vertical_velocity(D_803649A0);
D_8037D2B7 = 1;
D_8037D2BA = 2;
}
break;
case 2://8029FEA0
if(D_8037D2B5 == 0 && _get_vertVelocity() < 0.0f){
if(D_8037D2B5 == 0 && baphysics_get_vertical_velocity() < 0.0f){
func_8030E760(SFX_45_KAZOOIE_HUGHH, 1.2f, 0x7530);
D_8037D2B5++;
}
@@ -137,9 +139,9 @@ void bsbbuster_update(void){
func_802BB3DC( 0, 45.0f, 0.71f);
func_8029AE74(0);
func_8029FB30();
func_80297A0C(0);
gravity_set(0.0f);
func_80297970(0.0f);
baphysics_set_velocity(0);
baphysics_set_gravity(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
D_8037D2B7 = 2;
D_8037D2B8 = 1;
D_8037D2B0 = 0.09f;
@@ -160,11 +162,11 @@ void bsbbuster_update(void){
D_8037D2B0 -= time_getDelta();
if(D_8037D2B0 <= 0.0f){
if(D_8037D2BB){
player_setYVelocity(D_80364990);
gravity_set(D_80364994);
baphysics_set_vertical_velocity(D_80364990);
baphysics_set_gravity(D_80364994);
}else{
player_setYVelocity(D_80364998);
gravity_set(D_8036499C);
baphysics_set_vertical_velocity(D_80364998);
baphysics_set_gravity(D_8036499C);
}
animctrl_setSubRange(aCtrl, 0.0f, 0.7299f);
@@ -196,8 +198,8 @@ void bsbbuster_update(void){
}//L802A024C
void bsbbuster_end(void){
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
func_8029E070(0);
D_8037D2B7 = 0;
D_8037D2B8 = 0;

View File

@@ -2,20 +2,18 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_80354030(f32*, f32);
f32 func_8029B2E8(void);
f32 func_8029B33C(void);
void func_8029797C(f32);
void func_80297970(f32);
void baModel_setYDisplacement(f32);
void func_80297BF8(f32);
void ncDynamicCam4_func_802BFE50(f32, f32, f32);
void yaw_setVelocityBounded(f32, f32);
f32 func_8029B2D0(void);
f32 func_8029B2DC(void);
f32 func_80297A64(void);
void func_802979AC(f32, f32);
void func_8028FDC8(f32);
void func_80290B40(f32);
void func_80290A6C(void);
@@ -45,13 +43,13 @@ void func_802A04F0(void){
void func_802A0590(void){
func_802A0340();
baanim_playForDuration_onceSmooth(0x1df, 1.5f);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f){
yaw_setIdeal(func_8029B33C());
}
func_8029797C(yaw_getIdeal());
func_80297970(0.0f);
gravity_set(-1200.0f);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_target_horizontal_velocity(0.0f);
baphysics_set_gravity(-1200.0f);
D_8037D2C0 = 0;
}
@@ -64,7 +62,7 @@ void func_802A0630(void){
case 0:
if(!animctrl_isAt(mvmnt, 0.266f))
break;
player_setYVelocity(1600.0f);
baphysics_set_vertical_velocity(1600.0f);
func_8030E58C(SFX_C_TAKING_FLIGHT_LIFTOFF, 0.7f);
D_8037D2C0 = 1;
break;
@@ -72,7 +70,7 @@ void func_802A0630(void){
func_802A04F0();
if(animctrl_isStopped(mvmnt))
baanim_playForDuration_loopSmooth(ASSET_1DC_ANIM_BEE_FLY, 0.38f);
if(_get_vertVelocity() < 0.0f)
if(baphysics_get_vertical_velocity() < 0.0f)
next_state = BS_BEE_FLY;
break;
}
@@ -98,8 +96,8 @@ void _bsbeefly_end(void){
roll_setIdeal(0.0f);
pitch_setIdeal(0.0f);
func_80291548();
gravity_reset();
func_80297B94();
baphysics_reset_gravity();
baphysics_reset_terminal_velocity();
func_8028FFBC(0);
func_8029099C();
}
@@ -111,8 +109,8 @@ void func_802A07F8(void){
yaw_setUpdateState(3);
roll_setAngularVelocity(500.0f, 2.0f);
func_802A0724();
gravity_set(-300.0f);
func_80297BF8(-99.9f);
baphysics_set_gravity(-300.0f);
baphysics_set_terminal_velocity(-99.9f);
func_8028FEF0();
func_8028FFBC(1);
func_802909C4();
@@ -153,13 +151,13 @@ void bsbeefly_enter(void){
mvmnt = bs_getPrevState();
baanim_playForDuration_loopSmooth(ASSET_1DC_ANIM_BEE_FLY, 0.38);
func_8029C7F4(1, 1, 3, 3);
func_8029C7F4(1, 1, 3, BA_PHYSICS_LOCKED_ROTATION);
if(miscflag_isTrue(9))
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
else
func_80297970(600.0f);
func_802979AC(yaw_getIdeal(), func_80297A64());
func_8029797C(yaw_getIdeal());
baphysics_set_target_horizontal_velocity(600.0f);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_target_yaw(yaw_getIdeal());
func_802914CC(4);
func_802A07F8();
if(mvmnt != 0x8b){
@@ -200,7 +198,7 @@ void bsbeefly_update(void){
sp40 += *sp24;
sp3C = pitch_get();
sp30 = 0.0f;
if(_get_vertVelocity() < 0.0f){
if(baphysics_get_vertical_velocity() < 0.0f){
if(sp3C < 300.0f){
sp30 = ml_map_f(sp3C, 0.0f, 80.0f, 0.0f, 0.23f);
}
@@ -228,7 +226,7 @@ void bsbeefly_update(void){
pitch_setIdeal(sp40);
func_802A0750();
if(sp44 != 0){
player_setYVelocity(sp44*400.0);
baphysics_set_vertical_velocity(sp44*400.0);
func_802A04F0();
}
if((s32)sp24 == (s32)&D_803649C4){
@@ -238,23 +236,23 @@ void bsbeefly_update(void){
break;
}//L802A0DF0
if(miscflag_isTrue(9)){
func_80297BF8(0.0f);
func_80297A0C(0);
baphysics_set_terminal_velocity(0.0f);
baphysics_set_velocity(0);
sp38 = 0.0f;
}else{
if(sp3C <= 80.0f){
func_80297BF8(ml_map_f(sp3C, 60.0f, 80.0f, -99.9, -1266.66));
baphysics_set_terminal_velocity(ml_map_f(sp3C, 60.0f, 80.0f, -99.9, -1266.66));
sp38 = ml_map_f(sp3C, 60.0f, 80.0f, 600.0f, 60.0f);
}else{
func_80297BF8(ml_map_f(sp3C, 300.0f, 310.0f, -399.99, -99.9));
baphysics_set_terminal_velocity(ml_map_f(sp3C, 300.0f, 310.0f, -399.99, -99.9));
sp38 = ml_map_f(sp3C, 300.0f, 340.0f, 0.0f, 600.0f);
}
}
func_8029797C(yaw_get());
baphysics_set_target_yaw(yaw_get());
if(button_held(9)){
sp38 += (f64)sp38;
}
func_80297970(sp38);
baphysics_set_target_horizontal_velocity(sp38);
if(func_8028B2E8() && !player_inWater())
sp4C = BS_85_BEE_IDLE;
func_8028FFF0();

View File

@@ -2,13 +2,12 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
f32 func_8029B41C(void);
void func_8029E3C0(s32, f32);
void func_80299628(s32);
void yaw_applyIdeal(void);
void func_8029797C(f32);
f32 func_80297A64(void);
void func_802979AC(f32, f32);
void ncDynamicCamD_func_802BF2C0(f32);
f32 baanim_getTimer(void);
@@ -51,18 +50,18 @@ void func_802A1020(void){
sp1c = func_8029B30C();
if(func_8029B300() == 0){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
else{
func_80297970(ml_interpolate_f(sp1c, D_803649E0, D_803649E4));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1c, D_803649E0, D_803649E4));
}
}
void func_802A1080(void){
func_802A0340();
baanim_playForDuration_loopSmooth(ASSET_1DE_ANIM_BEE_IDLE,3.0f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802900B4();
}
@@ -97,7 +96,7 @@ void func_802A117C(void){
void func_802A11A4(void){
func_802A0340();
baanim_playForDuration_loopSmooth(ASSET_1DD_ANIM_BEE_WALK, 0.38f);
func_8029C7F4(2,1,1,2);
func_8029C7F4(2,1,1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_803649E0, D_803649E4, D_803649E8, D_803649EC);
func_802900B4();
}
@@ -110,7 +109,7 @@ void func_802A1214(void){
func_802A1020();
func_8029AD28(0.94f, 4);
func_8029AD28(0.44f, 3);
if(func_8029B300() == 0 && func_80297C04(1.0f))
if(func_8029B300() == 0 && baphysics_is_slower_than(1.0f))
s0 = BS_85_BEE_IDLE;
if(func_8028B094())
@@ -143,15 +142,15 @@ void func_802A12FC(void){
animctrl_setDuration(s0, 1.2f);
animctrl_setPlaybackType(s0, ANIMCTRL_ONCE);
animctrl_start(s0, "bsbeemain.c", 0x15b);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f){
yaw_setIdeal(func_8029B33C());
}
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802A1020();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_803649F0);
gravity_set(D_803649F4);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_803649F0);
baphysics_set_gravity(D_803649F4);
func_802A0FB4();
D_8037D2D4 = 0;
}
@@ -164,9 +163,9 @@ void func_802A1438(void){
sp2c = 0;
sp28 = baanim_getAnimCtrlPtr();
func_802A1020();
_get_velocity(sp1c);
baphysics_get_velocity(sp1c);
if(button_released(BUTTON_A) && (0.0f < sp1c[1])){
gravity_reset();
baphysics_reset_gravity();
}
switch (D_8037D2D4)
{
@@ -198,7 +197,7 @@ void func_802A1438(void){
case 3:
func_80299628(0);
if(animctrl_isStopped(sp28)){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
sp2c = BS_85_BEE_IDLE;
}
break;
@@ -222,7 +221,7 @@ void func_802A1438(void){
void func_802A163C(void){
func_802A02C0();
gravity_reset();
baphysics_reset_gravity();
}
void func_802A1664(void){
@@ -237,7 +236,7 @@ void func_802A1664(void){
animctrl_setSubRange(s0, 0, 0.51f);
animctrl_setPlaybackType(s0, ANIMCTRL_ONCE);
animctrl_start(s0, "bsbeemain.c", 0x1e2);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
D_8037D2D4 = 0;
}
@@ -250,7 +249,7 @@ void func_802A170C(void){
sp28 = baanim_getAnimCtrlPtr();
func_80299628(0);
func_802A1020();
_get_velocity(sp1c);
baphysics_get_velocity(sp1c);
switch(D_8037D2D4){
case 0:
if(func_8028B254(0x82)){
@@ -262,7 +261,7 @@ void func_802A170C(void){
func_80299628(0);
if(func_8028B2E8()){
func_802A0F90();
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
baanim_setEndAndDuration(1.0f, 0.7f);
D_8037D2D4 = 2;
}
@@ -270,7 +269,7 @@ void func_802A170C(void){
case 2:
func_80299628(0);
if(animctrl_isStopped(sp28)){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
sp2c = BS_85_BEE_IDLE;
}
break;
@@ -325,12 +324,12 @@ void func_802A18E8(s32 arg0){
func_80257F18(sp20, sp2C, &sp38);
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(200.0f);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1, 1, 2, 3);
player_setYVelocity(510.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(200.0f);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1200.0f);
baMarker_collisionOff();
func_80292E48();
D_8037D2D4 = 0;
@@ -363,7 +362,7 @@ void func_802A1A50(void){
void func_802A1B28(void){
func_80297CA8();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
func_802A02C0();
@@ -409,18 +408,18 @@ void bsbeemain_die_init(void){
animctrl_setDuration(sp3C, 1.7f);
animctrl_setPlaybackType(sp3C, ANIMCTRL_ONCE);
animctrl_start(sp3C, "bsbeemain.c", 0x2ef);
func_8029C7F4(1,1,2,3);
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
_player_getPosition(sp2C);
func_80294980(sp20);
func_80257F18(sp20, sp2C, &sp38);
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
D_8037D2D0 = 250.f;
func_80297970(D_8037D2D0);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
player_setYVelocity(420.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(D_8037D2D0);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(420.0f);
baphysics_set_gravity(-1200.0f);
pitch_setAngVel(1000.0f, 12.0f);
baMarker_collisionOff();
func_80292E48();
@@ -433,7 +432,7 @@ void bsbeemain_die_init(void){
}
void func_802A1DD8(void){
func_80297970(D_8037D2D0);
baphysics_set_target_horizontal_velocity(D_8037D2D0);
func_80299628(0);
switch(D_8037D2D4){
case 0:
@@ -442,7 +441,7 @@ void func_802A1DD8(void){
baanim_setEnd(0.7453f);
FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000);
FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000);
player_setYVelocity(400.0f);
baphysics_set_vertical_velocity(400.0f);
D_8037D2D4 = 1;
break;
case 1:
@@ -471,7 +470,7 @@ void func_802A1DD8(void){
void func_802A1F2C(void){
func_8024BD08(0);
gravity_reset();
baphysics_reset_gravity();
func_80291548();
func_80292EA4();
func_802A02C0();
@@ -480,8 +479,8 @@ void func_802A1F2C(void){
void func_802A1F6C(void){
func_802A0340();
baanim_playForDuration_loopSmooth(ASSET_1DE_ANIM_BEE_IDLE, 3.0f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029C674();
func_802B3A50();
}
@@ -518,8 +517,8 @@ void func_802A2098(void){
miscflag_clear(0x1A);
baanim_playForDuration_loopSmooth(ASSET_1DE_ANIM_BEE_IDLE, 3.0f);
yaw_setIdeal(func_8029B41C());
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8024BD08(0);
func_8025A2FC(0, 0xFA0);
func_8025A6EC(COMUSIC_42_NOTEDOOR_OPENING_FANFARE, -1);

View File

@@ -4,6 +4,7 @@
#include "bsint.h"
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .data */
const f32 D_80364AF0 = 30.0f;
@@ -14,9 +15,9 @@ const f32 D_80364AFC = 0.4f;
void func_802AAE80(void){
f32 sp1C = func_8029B30C();
if(func_8029B300() == 0)
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
else
func_80297970(ml_interpolate_f(sp1C, D_80364AF0, D_80364AF4));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364AF0, D_80364AF4));
}
void func_802AAEE0(void){
@@ -34,8 +35,8 @@ void bscarry_idle_init(void){
animctrl_setIndex(aCtrl, ASSET_72_ANIM_BSCARRY_IDLE);
animctrl_setDuration(aCtrl, 1.2f);
animctrl_start(aCtrl, "bscarry.c", 0x6f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
}
@@ -63,7 +64,7 @@ void bscarry_walk_init(void){
animctrl_setDuration(aCtrl, 0.8f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP);
animctrl_start(aCtrl, "bscarry.c", 0xac);
func_8029C7F4(2,1,1,2);
func_8029C7F4(2,1,1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_80364AF0, D_80364AF4, D_80364AF8, D_80364AFC);
}
@@ -72,7 +73,7 @@ void bscarry_walk_update(void){
func_8029AD28(0.4f, 4);
func_8029AD28(0.9f, 3);
func_802AAE80();
if(func_8029B300() == 0 && func_80297C04(1.0f))
if(func_8029B300() == 0 && baphysics_is_slower_than(1.0f))
sp1C = BS_3A_CARRY_IDLE;
if(carriedobj_getMarker() == NULL)

View File

@@ -1,7 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_802915CC(f32);
@@ -17,9 +17,9 @@ int bsclaw_hitboxActive(void){
void bsclaw_init(void){
baanim_playForDuration_once(ASSET_5_ANIM_BSPUNCH, 1.3f);
func_8029C7F4(1,1,3,3);
func_8029797C(yaw_getIdeal());
func_80297970(160.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_target_horizontal_velocity(160.0f);
func_802915CC(80.0f);
_bsclawHitboxActive = 0;
}
@@ -37,7 +37,7 @@ void bsclaw_update(void){
|| animctrl_isAt(aCtrl, 0.5788f)
|| (0.4788 < sp24 && sp24 < 0.6788);
if(animctrl_isAt(aCtrl, 0.5788f))
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029AD28(0.08f, 3);
func_8029AD28(0.34f, 4);

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .bss */
u8 D_8037D3D0;
@@ -24,7 +25,7 @@ void func_802AB5C0(void){
sp2C[0] = 0.0f;
sp2C[1] = f2;
sp2C[2] = 0.0f;
func_80297930(sp2C);
baphysics_set_target_velocity(sp2C);
}
void func_802AB654(void){
@@ -33,8 +34,8 @@ void func_802AB654(void){
yaw_setVelocityBounded(500.0f, 15.0f);
func_8029B324(0, 0.03f);
func_8029B324(1, 1.0f);
func_802978DC(0xA);
func_80297B64(10.0f);
baphysics_set_type(BA_PHYSICS_CLIMB);
baphysics_set_acceleration(10.0f);
func_80294378(5);
func_80293D48(80.0f, 10.0f);
func_802914CC(0x10);
@@ -45,7 +46,7 @@ void func_802AB6F0(void){
func_80291548();
func_8029B0C0();
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
func_802978DC(2);
baphysics_set_type(BA_PHYSICS_NORMAL);
func_80294378(1);
func_80293D74();
}
@@ -56,7 +57,7 @@ void func_802AB750(f32 arg0, f32 arg1){
}
int func_802AB788(void){
return (0.0f < mlAbsF(func_80297A70())) || (yaw_get() != yaw_getIdeal());
return (0.0f < mlAbsF(baphysics_get_target_vertical_velocity())) || (yaw_get() != yaw_getIdeal());
}
int bsclimb_inSet(s32 move_indx){
@@ -160,15 +161,15 @@ void bsclimb_move_update(void){
func_80299D2C(SFX_D3_JINXIE_SNIFFLING_1, 0.87f, 22000);
}//L802ABB84
if(!func_802AB788() && _get_vertVelocity() < 30.0f)
if(!func_802AB788() && baphysics_get_vertical_velocity() < 30.0f)
next_state = BS_4F_CLIMB_IDLE;
_player_getPosition(plyr_pos);
if(func_80297A70() < 0.0f && climbGetBottomY() == plyr_pos[1])
if(baphysics_get_target_vertical_velocity() < 0.0f && climbGetBottomY() == plyr_pos[1])
next_state = BS_1_IDLE;
if( func_8029825C() == 2
&& 0.0f < func_80297A70()
&& 0.0f < baphysics_get_target_vertical_velocity()
&& climbGetTopY() == plyr_pos[1]
){
next_state = BS_51_CLIMB_EXIT;
@@ -194,7 +195,7 @@ void func_802ABCCC(void){
baanim_playForDuration_loopSmooth(ASSET_B2_ANIM_BSCLIMB_IDLE_2, 2.64f);
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
func_802AB654();
func_802978DC(7);
baphysics_set_type(BA_PHYSICS_FREEZE);
}
//bsclimb_unknown_9E_update

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
int bscroc_inSet(enum bs_e state);
@@ -68,10 +69,10 @@ void func_802ABE70(void){
void func_802ABF54(void){
f32 sp1C = func_8029B30C();
if(func_8029B300() == 0){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}
else{
func_80297970(ml_interpolate_f(sp1C, bsCrocMinWalkVelocity, __bscroc_getMaxVelocity()));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, bsCrocMinWalkVelocity, __bscroc_getMaxVelocity()));
}
}
@@ -103,8 +104,8 @@ int bscroc_inSet(enum bs_e state){
void bscroc_idle_init(void){
baanim_playForDuration_loopSmooth(0xe1, 1.0f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
func_80293D48(50.0f, 25.0f);
@@ -144,7 +145,7 @@ void bscroc_idle_end(void){
void bscroc_walk_init(void){
baanim_playForDuration_loopStartingAt(ASSET_E0_ANIM_BSCROC_WALK, 0.8f, 0.4f);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ, 1, 1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(bsCrocMinWalkVelocity, bsCrocMaxWalkVelocity, bsCrocSlowestWalkDuration, bsCrocFastestWalkDuration);
func_802900B4();
}
@@ -158,7 +159,7 @@ void bscroc_walk_update(void){
func_8029AD28(0.1f, 4);
func_8029AD28(0.6f, 3);
if(func_8029B300() == 0 && func_80297C04(1.0f))
if(func_8029B300() == 0 && baphysics_is_slower_than(1.0f))
next_state = BS_5E_CROC_IDLE;
if(func_8028B094())
@@ -189,15 +190,15 @@ void bscroc_jump_init(void){
animctrl_setStart(aCtrl, 0.1f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bscroc.c", 0x1ac);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f){
yaw_setIdeal(func_8029B33C());
}
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802ABF54();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(bsCrocInitialJumpVelocity);
gravity_set(bsCrocGravity);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(bsCrocInitialJumpVelocity);
baphysics_set_gravity(bsCrocGravity);
__bscroc_jumpSfx();
D_8037D3EC = 0;
}
@@ -209,9 +210,9 @@ void bscroc_jump_update(void){
func_802ABE70();
func_802ABF54();
_get_velocity(player_velocity);
baphysics_get_velocity(player_velocity);
if(button_released(BUTTON_A) && 0.0f < player_velocity[1])
gravity_reset();
baphysics_reset_gravity();
switch(D_8037D3EC){
case 0:
@@ -243,7 +244,7 @@ void bscroc_jump_update(void){
case 3:
func_80299628(0);
if(animctrl_isStopped(aCtrl)){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
sp2C = BS_5E_CROC_IDLE;
}
break;
@@ -264,7 +265,7 @@ void bscroc_jump_update(void){
}
void bscroc_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
func_802ABFBC();
}
@@ -277,7 +278,7 @@ void bscroc_fall_init(void){
animctrl_setDuration(aCtrl, 0.7f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_start(aCtrl, "bscroc.c", 0x235);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
D_8037D3EC = 0;
}
@@ -289,7 +290,7 @@ void bscroc_fall_update(void){
func_802ABE70();
func_80299628(0);
func_802ABF54();
_get_velocity(player_velocity);
baphysics_get_velocity(player_velocity);
switch(D_8037D3EC){
case 0:
@@ -301,7 +302,7 @@ void bscroc_fall_update(void){
case 1:
if(func_8028B2E8()){
func_8029AE48();
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
baanim_setEndAndDuration(1.0f, 1.0f);
D_8037D3EC = 2;
}
@@ -348,12 +349,12 @@ static void __bscroc_recoil_init(s32 damage){
func_80257F18(sp20, player_position, &sp38);
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(200.0f);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1,1,2,3);
player_setYVelocity(510.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(200.0f);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1200.0f);
baMarker_collisionOff();
func_80292E48();
D_8037D3EC = 0;
@@ -383,7 +384,7 @@ static void __bscroc_recoil_update(void){
void __bscroc_recoil_end(void){
func_80297CA8();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
func_802ABFBC();
@@ -427,18 +428,18 @@ void bscroc_die_init(void){
animctrl_setDuration(aCtrl, 1.7f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bscroc.c", 0x32b);
func_8029C7F4(1,1,2,3);
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
_player_getPosition(player_position);
func_80294980(sp20);
func_80257F18(sp20, player_position, &sp38);
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
D_8037D3E0 = 250.0f;
func_80297970(D_8037D3E0);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
player_setYVelocity(420.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(D_8037D3E0);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(420.0f);
baphysics_set_gravity(-1200.0f);
pitch_setAngVel(1000.0f, 12.0f);
baMarker_collisionOff();
func_80292E48();
@@ -453,7 +454,7 @@ void bscroc_die_init(void){
void bscroc_die_update(void){
enum bs_e next_state = 0;
func_802ABE70();
func_80297970(D_8037D3E0);
baphysics_set_target_horizontal_velocity(D_8037D3E0);
func_80299628(0);
switch(D_8037D3EC){
case 0:
@@ -461,7 +462,7 @@ void bscroc_die_update(void){
baanim_setEnd(0.7453f);
FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000);
FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000);
player_setYVelocity(400.0f);
baphysics_set_vertical_velocity(400.0f);
D_8037D3EC = 1;
}
break;
@@ -490,7 +491,7 @@ void bscroc_die_update(void){
void bscroc_die_end(void){
func_8024BD08(0);
gravity_reset();
baphysics_reset_gravity();
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_80291548();
@@ -507,12 +508,12 @@ static void func_802ACF58(void){
sp2C = func_8028B2E8() ? 500.0f : 400.0f;
func_802589E4(sp20, yaw_get(), sp2C);
sp20[1] = 200.0f;
func_80297A0C(sp20);
baphysics_set_velocity(sp20);
}
void bscroc_bite_init(void){
baanim_playForDuration_loopStartingAt(ASSET_122_ANIM_BSCROC_BITE, 0.25f, 0.2f);
func_8029C7F4(1,1,1,3);
func_8029C7F4(1,1,1, BA_PHYSICS_LOCKED_ROTATION);
func_802ACF58();
D_8037D3F4 = 0;
_bscrocHitboxActive = TRUE;
@@ -561,8 +562,8 @@ void bscroc_bite_end(void){
void bscroc_eat_bad_init(void){
baanim_playForDuration_once(ASSET_123_ANIM_BSCROC_EAT_BAD, 2.41f);
func_8029C7F4(1,1,2,3);
func_80297970(0.0f);
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_horizontal_velocity(0.0f);
}
void bscroc_eat_bad_update(void){
@@ -612,7 +613,7 @@ void func_802AD318(void){
void bscroc_eat_good_init(void){
baanim_playForDuration_loopSmooth(ASSET_122_ANIM_BSCROC_BITE, 0.25f);
func_8029C7F4(1,1,1,2);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baModel_setPostDraw(func_802AD2A8);
D_8037D3E8 = assetcache_get(func_80294974());
D_8037D3F0 = 1.0f;
@@ -668,8 +669,8 @@ void bscroc_eat_good_end(void){
void func_802AD56C(void){
baanim_playForDuration_loopSmooth(ASSET_E1_ANIM_BSCROC_IDLE, 1.0f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029C674();
func_802B3A50();
}

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .bss */
f32 D_8037D400;
@@ -62,16 +63,16 @@ void bscrouch_init(void){
yaw_setVelocityBounded(350.0f, 14.0f);
func_8029957C(7);
func_8029932C(8.0f);
func_802978DC(3);
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
func_8029E3C0(0, 0.7f);
func_8029E3C0(1, 0.2f);
_get_velocity(&sp28);
baphysics_get_velocity(sp28);
D_8037D400 = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]);
if(140.0f < D_8037D400)
func_80299AAC();
if(func_8025801C(sp28, &sp20))
func_8029797C(sp20);
baphysics_set_target_yaw(sp20);
D_8037D404 = 0;
}
@@ -88,7 +89,7 @@ void bscrouch_update(void){
func_8029E1A8(1);
sp30 = ml_map_f(func_8029E270(0), 0.0f, 0.3f, 0.0f, D_8037D400);
func_80297970(sp30);
baphysics_set_target_horizontal_velocity(sp30);
if(220.0f < sp30)
func_802929F8();
if(160.0f < sp30)

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .bss */
f32 D_8037D410;
@@ -41,15 +42,15 @@ void bsdie_init(void){
D_8037D410 = 250.0f;
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(D_8037D410);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
baphysics_set_target_horizontal_velocity(D_8037D410);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(2);
func_802978DC(3);
player_setYVelocity(510.0f);
gravity_set(-1400.0f);
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1400.0f);
pitch_setAngVel(1000.0f, 12.0f);
func_8029E070(1);
func_8029151C(0xd);
@@ -64,14 +65,14 @@ void bsdie_init(void){
void bsdie_update(void){
AnimCtrl *aCtrl = baanim_getAnimCtrlPtr();
enum bs_e sp28 = 0;
func_80297970(D_8037D410);
baphysics_set_target_horizontal_velocity(D_8037D410);
func_80299628(0);
switch(D_8037D414){
case 0://L802AE0B8
if(_bsdie_802ADE00()){
animctrl_setSubRange(aCtrl, 0.0f, 1.0f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
player_setYVelocity(400.0f);
baphysics_set_vertical_velocity(400.0f);
func_80299DB8();
FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.0f, 18000);
rumbleManager_80250D94(1.0f, 1.0f, 0.4f);
@@ -124,7 +125,7 @@ void bsdie_update(void){
void bsdie_end(void){
func_8024BD08(0);
gravity_reset();
baphysics_reset_gravity();
func_8029E070(0);
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);

View File

@@ -1,6 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
enum bsdroneenter_state_e{
BSDRONEENTER_SUBSTATE_0_UNINITIALIZED,
@@ -108,7 +110,7 @@ void bsDroneEnter_init(void) {
func_8029BCF8(&anim_id, &anim_duration);
baanim_playForDuration_loopSmooth(anim_id, anim_duration);
func_8029C7F4(1, 1, 3, 7);
func_8029C7F4(1, 1, 3, BA_PHYSICS_FREEZE);
func_80294378(6);
__bsDroneEnter_init();
bsDroneEnterSubstate = BSDRONEENTER_SUBSTATE_0_UNINITIALIZED;

View File

@@ -2,7 +2,8 @@
#include "functions.h"
#include "variables.h"
void func_80297BB8(f32);
#include "core2/ba/physics.h"
/* .bss */
u8 D_8037D440;
@@ -34,11 +35,11 @@ void func_802AEB60(s32 arg0){
}
void func_802AEC08(void){
func_802978A4();
baphysics_reset_horizontal_velocity();
}
void func_802AEC28(void){
func_802978A4();
baphysics_reset_horizontal_velocity();
if(func_8028B2E8() || player_inWater())
func_802AEB60(2);
}
@@ -52,9 +53,9 @@ void func_802AEC78(void){
func_8029BC60(&sp1C, &sp2C);
baanim_playForDuration_loopSmooth(sp1C, sp2C);
func_802925F8(&sp20, &sp2C);
func_80297BC4(&sp20);
func_80297BB8(sp2C);
func_8029C7F4(1,1,3,0xC);
baphysics_set_goto_position(&sp20);
baphysics_set_goto_duration(sp2C);
func_8029C7F4(1,1,3,BA_PHYSICS_GOTO);
func_8029436C(1);
D_8037D441 = 0;
}
@@ -64,7 +65,7 @@ void func_802AECE4(void){
f32 sp20[3];
AnimCtrl *aCtrl = baanim_getAnimCtrlPtr();
_get_velocity(&sp20);
baphysics_get_velocity(sp20);
if(func_8025801C(sp20, &sp2C)){
yaw_setIdeal(sp2C);
}
@@ -77,7 +78,7 @@ void func_802AECE4(void){
animctrl_start(aCtrl, "bsdronegoto.c", 0x9d);
}
if(func_80297C48() && D_8037D441 == 0){
if(baphysics_goto_done() && D_8037D441 == 0){
D_8037D441++;
func_80292768();
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
extern f32 func_8029B2D0(void);
@@ -18,9 +19,9 @@ void bsDroneLook_init(void) {
func_80299D2C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.2f, 12000);
func_8029BCF8(&anim_id, &anim_duration);
baanim_playForDuration_loopSmooth(anim_id, anim_duration);
func_8029C7F4(1, 1, 3, 2);
func_80297970(0.0f);
func_80297A0C(0);
func_8029C7F4(1, 1, 3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
baphysics_set_velocity(0);
ncDynamicCamera_enterFirstPerson();
__bsDroneLook_getEyePos(eye_position);
ncFirstPersonCamera_setZoomedOutPosition(eye_position);
@@ -42,6 +43,7 @@ void bsDroneLook_update(void) {
next_state = 0;
dt = time_getDelta();
if (ncFirstPersonCamera_getState() == 2) {
//camera is in "idle" state
ncFirstPersonCamera_getZoomedInRotation(eye_rotation);
eye_rotation[0] -= func_8029B2DC() * 90.0f * dt;
eye_rotation[1] -= func_8029B2D0() * 90.0f * dt;
@@ -49,10 +51,13 @@ void bsDroneLook_update(void) {
eye_rotation[0] = (eye_rotation[0] > 180.0f) ? ml_max_f(305.0f, eye_rotation[0]) : ml_min_f(70.0f, eye_rotation[0]);
ncFirstPersonCamera_setZoomedOutRotation(eye_rotation);
yaw_setIdeal(eye_rotation[1] + 180.0f);
exit_first_person = FALSE;
// 1st person cancelled via input
if (button_pressed(BUTTON_B) || button_pressed(BUTTON_A) || button_pressed(BUTTON_C_UP)) {
exit_first_person = TRUE;
}
// 1st person cancelled via entering water
if (player_inWater()) {
if (player_getTransformation() == TRANSFORM_1_BANJO && func_8028EE84() == BSWATERGROUP_0_NONE) {
exit_first_person += TRUE;

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .bss */
struct {
ParticleEmitter *unk0;
@@ -93,7 +95,7 @@ void bsDroneVanish_init(void){
func_8029BCF8(&anim_id, &anim_duration);
baanim_playForDuration_loopSmooth(anim_id, anim_duration);
func_8029C7F4(1,1,3,7);
func_8029C7F4(1,1,3, BA_PHYSICS_FREEZE);
func_80294378(6);
__bsDroneVanish_init();
D_8037D468 = 0;

View File

@@ -1,10 +1,11 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
extern void player_setYPosition(f32);
extern void yaw_applyIdeal(void);
extern void func_802978DC(int);
extern f32 func_80257A44(f32, f32);
extern f32 cosf(f32);
extern f32 ml_remainder_f(f32, f32);
@@ -260,14 +261,14 @@ static void __bsdronexform_setState(int next_state){
func_802AFBA0(180.0f);
func_802AFBAC(0.04f);
func_802B01B0(0.05f);
func_802978DC(7);
baphysics_set_type(BA_PHYSICS_FREEZE);
func_8029E3C0(0, 2.8f);
FUNC_8030E624(SFX_17E_MUMBO_TRANSFORMATION_01, 1.0f, 15000);
break;
case 2:// 802B02A8
func_8029E3C0(0, 0.5f);
func_802978DC(0xb);
baphysics_set_type(BA_PHYSICS_TRANSFORM);
break;
case 3:// 802B02C4
@@ -314,7 +315,7 @@ static void __bsdronexform_setState(int next_state){
case 9:// 802B0438
D_8037D470.unk1C = 0;
func_8029E3C0(0, 0.7f);
func_802978DC(7);
baphysics_set_type(BA_PHYSICS_FREEZE);
break;
}
}
@@ -324,9 +325,9 @@ void bsdronexform_init(void){
enum asset_e sp18;
func_8029BCAC(&sp18, &sp1C);
baanim_playForDuration_loopSmooth(sp18, sp1C);
func_8029C7F4(1,1,3,7);
func_80297A0C(0);
func_80297930(0);
func_8029C7F4(1,1,3, BA_PHYSICS_FREEZE);
baphysics_set_velocity(0);
baphysics_set_target_velocity(0);
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_80294378(6);

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .bss */
u8 D_8037D4B0;
u8 D_8037D4B1;
@@ -28,8 +30,8 @@ void bsjig_jiggy_init(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsjig.c", 0x7f);
yaw_setIdeal(func_8029B41C()); //face camera
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8024BD08(0);
func_8025A2FC(0,0xfa0);
tmp = (item_getCount(ITEM_E_JIGGY) == 9);
@@ -169,8 +171,8 @@ void bsjig_notedoor_init(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsjig.c", 0x14d);
yaw_setIdeal(func_8029B41C());
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
if(bs_getPrevState() != BS_44_JIG_JIGGY){
func_8024BD08(0);
func_8025A2FC(0,0xfa0);

View File

@@ -5,10 +5,9 @@
#include "core2/ba/model.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
f32 func_80294438(void);
void func_8029797C(f32);
void func_802979AC(f32, f32);
f32 func_80297A64(void);
void func_80299B58(f32, f32);
f32 func_8029B2E8(void);
f32 func_8029B33C(void);
@@ -59,19 +58,19 @@ void bsjump_init(void){
animctrl_setSubRange(aCtrl, 0.0f, 0.5042f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bsjump.c", 0x95);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f){
yaw_setIdeal(func_8029B33C());
}
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B6FA8();
func_802979AC(yaw_getIdeal(), func_80297A64());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
if(D_8037D4C1){
player_setYVelocity(D_80364CE4);
baphysics_set_vertical_velocity(D_80364CE4);
} else {
player_setYVelocity(D_80364CD0);
baphysics_set_vertical_velocity(D_80364CD0);
}
gravity_set(D_80364CD4);
baphysics_set_gravity(D_80364CD4);
D_8037D4C0 = 0;
if(D_8037D4C2){
func_8030E6D4(SFX_33_BANJO_AHOO);
@@ -91,14 +90,14 @@ void bsjump_update(void){
func_8029C348();
if(miscflag_isTrue(0xf)){
func_802978A4();
baphysics_reset_horizontal_velocity();
}else{
func_802B6FA8();
}
_get_velocity(velocity);
baphysics_get_velocity(velocity);
if((button_released(BUTTON_A) && 0.0f < velocity[1] && !D_8037D4C2) || !can_control_jump_height()){
gravity_reset();
baphysics_reset_gravity();
}
switch(D_8037D4C0){
@@ -166,15 +165,15 @@ void bsjump_end(void){
ability_use(0);
if(bs_getNextState() != BS_11_BPECK)
gravity_reset();
baphysics_reset_gravity();
}
void bsjump_fall_init(void){
AnimCtrl *aCtrl = baanim_getAnimCtrlPtr();
int sp20;
if(miscflag_isTrue(7) && 700.0f < _get_vertVelocity())
player_setYVelocity(700.0f);
if(miscflag_isTrue(7) && 700.0f < baphysics_get_vertical_velocity())
baphysics_set_vertical_velocity(700.0f);
sp20 = (bs_getPrevState() == BS_12_BFLIP)? 0 : 1;
animctrl_reset(aCtrl);
@@ -183,7 +182,7 @@ void bsjump_fall_init(void){
animctrl_setTransitionDuration(aCtrl, 0.3f);
animctrl_setDuration(aCtrl, 0.38f);
animctrl_start(aCtrl, "bsjump.c", 0x188);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
D_8037D4C0 = 0;
}
@@ -193,11 +192,11 @@ void bsjump_fall_update(void){
f32 player_velocity[3];
if(miscflag_isTrue(0xf))
func_802978A4();
baphysics_reset_horizontal_velocity();
else
func_802B6FA8();
_get_velocity(player_velocity);
baphysics_get_velocity(player_velocity);
switch(D_8037D4C0){
case 0://L802B17B8
@@ -264,12 +263,12 @@ void func_802B1928(void) {
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(3);
func_802978DC(3);
func_8029797C(yaw_getIdeal());
func_80297970(60.0f);
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364CDC);
gravity_set(D_80364CE0);
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_target_horizontal_velocity(60.0f);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364CDC);
baphysics_set_gravity(D_80364CE0);
func_80294378(6);
D_8037D4C0 = 0;
func_802B1100();
@@ -282,7 +281,7 @@ void func_802B1A54(void) {
next_state = 0;
anim_ctrl = baanim_getAnimCtrlPtr();
_get_velocity(velocity);
baphysics_get_velocity(velocity);
if (velocity[1] < 0.0f) {
func_80294378(1);
}
@@ -321,7 +320,7 @@ void func_802B1A54(void) {
void func_802B1BCC(void){
func_80294378(1);
gravity_reset();
baphysics_reset_gravity();
}
void func_802B1BF4(void) {
@@ -345,9 +344,9 @@ void func_802B1BF4(void) {
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(3);
func_802978DC(6);
func_80297970(0.0f);
func_80297A0C(0);
baphysics_set_type(BA_PHYSICS_AIRBORN);
baphysics_set_target_horizontal_velocity(0.0f);
baphysics_set_velocity(0);
D_8037D4C0 = 0;
baMarker_collisionOff();
}
@@ -359,7 +358,7 @@ void func_802B1CF8(void) {
next_state = 0;
anim_ctrl = baanim_getAnimCtrlPtr();
_get_velocity(velocity);
baphysics_get_velocity(velocity);
switch (D_8037D4C0) {
case 0:
if (func_8028B254(90)) {
@@ -388,7 +387,7 @@ bool bsjump_jumpingFromWater(void){
void bsjump_tumble_init(void){
baanim_playForDuration_loop(ASSET_68_ANIM_BSJUMP_TUMBLE, 0.35f);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
baModel_setYDisplacement(60.0f);
if(func_80293234() == 1){
func_8029E3C0(0, 0.5f);

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_802B37DC(void);
/* .bss */
@@ -54,7 +56,7 @@ void bsow_update(void) {
if (func_8028B2E8() != 0) {
sp1C = BS_2_WALK_SLOW;
}
if ((player_inWater() != 0) && (_get_vertVelocity() <= 0.0f)) {
if ((player_inWater() != 0) && (baphysics_get_vertical_velocity() <= 0.0f)) {
sp1C = BS_4C_LANDING_IN_WATER;
}
@@ -65,7 +67,7 @@ void bsow_end(void){
func_802B35DC();
func_802B1FD0(0);
func_80297CA8();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
}

View File

@@ -4,6 +4,7 @@
#include "core2/ba/model.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
extern void baanim_playForDuration_loop(s32, f32);
extern void func_8029AD68(f32, s32);
@@ -43,10 +44,10 @@ void func_802B223C(void) {
sp1C = func_8029B30C();
if (func_8029B300() == 0) {
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
return;
}
func_80297970(ml_interpolate_f(sp1C, D_80364CF0, D_80364CF4));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364CF0, D_80364CF4));
}
void func_802B229C(void) {
@@ -74,8 +75,8 @@ int bspumpkin_inSet(s32 move_indx){
void bspumpkin_idle_init(void) {
baanim_playForDuration_loop(ASSET_A0_ANIM_BSPUMPKIN_WALK, 0.8f);
func_8029C7F4(1, 1, 1, 2);
func_80297970(0.0f);
func_8029C7F4(1, 1, 1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
func_80293D48(50.0f, 25.0f);
@@ -118,7 +119,7 @@ void bspumpkin_walk_init(void) {
animctrl_setDuration(anim_ctrl, 0.8f);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP);
animctrl_start(anim_ctrl, "bspumpkin.c", 0x11D);
func_8029C7F4(2, 1, 1, 2);
func_8029C7F4(2, 1, 1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_80364CF0, D_80364CF4, D_80364CF8, D_80364CFC);
func_802900B4();
}
@@ -130,7 +131,7 @@ void bspumpkin_walk_update(void) {
next_state = 0;
func_802B223C();
func_8029AD68(0.3f, 4);
if ((func_8029B300() == 0) && func_80297C04(1.0f)) {
if ((func_8029B300() == 0) && baphysics_is_slower_than(1.0f)) {
next_state = BS_48_PUMPKIN_IDLE;
}
if (func_8028B094()) {
@@ -157,15 +158,15 @@ void bspumpkin_jump_init(void) {
animctrl_setDuration(anim_ctrl, 1.2f);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE);
animctrl_start(anim_ctrl, "bspumpkin.c", 0x16C);
func_8029C7F4(1, 1, 3, 6);
func_8029C7F4(1, 1, 3, BA_PHYSICS_AIRBORN);
if (func_8029B2E8() != 0.0f) {
yaw_setIdeal(func_8029B33C());
}
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B223C();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364D00);
gravity_set(D_80364D04);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364D00);
baphysics_set_gravity(D_80364D04);
func_802B21D0();
D_8037D4E0 = 0;
}
@@ -178,13 +179,13 @@ void bspumpkin_jump_update(void) {
next_state = 0;
anim_ctrl = baanim_getAnimCtrlPtr();
func_802B223C();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
if (button_released(BUTTON_A) && sp1C[1] > 0.0f) {
gravity_reset();
baphysics_reset_gravity();
}
switch (D_8037D4E0) {
case 0:
if (_get_vertVelocity() < 0.0f) {
if (baphysics_get_vertical_velocity() < 0.0f) {
if (func_8028B254(130)) {
func_80292E48();
animctrl_setDuration(anim_ctrl, 0.7f);
@@ -218,7 +219,7 @@ void bspumpkin_jump_update(void) {
case 3:
if (animctrl_isStopped(anim_ctrl)) {
func_80292EA4();
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
next_state = BS_48_PUMPKIN_IDLE;
}
break;
@@ -236,7 +237,7 @@ void bspumpkin_jump_update(void) {
void bspumpkin_jump_end(void){
func_80292EA4();
gravity_reset();
baphysics_reset_gravity();
func_802B229C();
}
@@ -251,7 +252,7 @@ void bspumpkin_fall_init(void) {
animctrl_setDuration(anim_ctrl, 0.7f);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_STOPPED);
animctrl_start(anim_ctrl, "bspumpkin.c", 0x1F1);
func_8029C7F4(1, 1, 3, 6);
func_8029C7F4(1, 1, 3, BA_PHYSICS_AIRBORN);
D_8037D4E0 = 0;
}
@@ -266,7 +267,7 @@ void bspumpkin_fall_update(void) {
if (D_8037D4E4) {
func_802B223C();
}
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
switch (D_8037D4E0) {
case 0:
if (func_8028B254(130)) {
@@ -278,7 +279,7 @@ void bspumpkin_fall_update(void) {
case 1:
if (func_8028B2E8()) {
func_8029AE48();
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f);
animctrl_setDuration(anim_ctrl, 1.2f);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE);
@@ -306,7 +307,7 @@ void func_802B2BF0(void) {
func_8029656C(D_8037D4E8);
func_8028FAB0(D_8037D4E8);
baanim_playForDuration_loop(ASSET_A0_ANIM_BSPUMPKIN_WALK, 0.8f);
func_8029C7F4(1, 1, 2, 7);
func_8029C7F4(1, 1, 2, BA_PHYSICS_FREEZE);
func_80294378(6);
func_8029E3C0(0, 0.0f);
}
@@ -357,12 +358,12 @@ void __bspumpkin_bounce_init(s32 arg0) {
func_80257F18(sp20, plyr_pos, &sp38);
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(200.0f);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1, 1, 2, 3);
player_setYVelocity(510.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(200.0f);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1200.0f);
baMarker_collisionOff();
func_80292E48();
D_8037D4E0 = 0;
@@ -394,7 +395,7 @@ void __bspumpkin_bounce_update(void) {
void __bspumpkin_bounce_end(void) {
func_80297CA8();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
func_802B229C();
@@ -446,12 +447,12 @@ void bspumpkin_die_init(void) {
D_8037D4F4 = 250.0f;
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(D_8037D4F4);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1, 1, 2, 3);
player_setYVelocity(510.0f);
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(D_8037D4F4);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(510.0f);
baphysics_set_gravity(-1200.0f);
pitch_setAngVel(1000.0f, 12.0f);
func_802914CC(0xD);
ncDynamicCamD_func_802BF2C0(30.0f);
@@ -463,7 +464,7 @@ void bspumpkin_die_init(void) {
}
void bspumpkin_die_update(void){
func_80297970(D_8037D4F4);
baphysics_set_target_horizontal_velocity(D_8037D4F4);
func_80299628(0);
switch(D_8037D4E0){
case 0://L802B3284
@@ -485,7 +486,7 @@ void bspumpkin_die_update(void){
case 2://L802B3300
if(baanim_isStopped()) {
player_setYVelocity(400.0f);
baphysics_set_vertical_velocity(400.0f);
baanim_setEnd(0.355f);
D_8037D4E0 = 3;
}
@@ -524,7 +525,7 @@ void bspumpkin_die_update(void){
void bspumpkin_die_end(void) {
func_802B229C();
func_8024BD08(0);
gravity_reset();
baphysics_reset_gravity();
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_80292EA4();
@@ -533,8 +534,8 @@ void bspumpkin_die_end(void) {
void func_802B34A0(void) {
baanim_playForDuration_loopSmooth(0xA0, 0.8f);
func_8029C7F4(1, 1, 3, 2);
func_80297970(0.0f);
func_8029C7F4(1, 1, 3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029C674();
func_802B3A50();
}

View File

@@ -2,9 +2,10 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
extern f32 func_80296548(void);
extern f32 func_8029653C(void);
extern f32 func_80297A4C(void);
extern f32 func_8029B56C(f32, f32, f32, f32);
/* .bss */
@@ -18,7 +19,7 @@ void func_802B35D0(s32 arg0){
void func_802B35DC(void) {
if (D_8037D500 == 1) {
func_80297A0C(0);
baphysics_set_velocity(0);
}
}
@@ -37,31 +38,31 @@ void func_802B360C(void) {
func_80257F18(sp38, sp2C, &sp28);
if ((sp1C == 0xE) || (sp1C == 0x10)) {
func_802B35D0(1);
func_8029C7F4(1, 1, 2, 1);
func_8029C7F4(1, 1, 2, BA_PHYSICS_UNK1);
yaw_setIdeal(mlNormalizeAngle(sp28));
gravity_set(func_80296548());
baphysics_set_gravity(func_80296548());
sp20 = func_8029653C();
sp24 = func_8029B56C(sp2C[1], sp38[1], sp20, func_80297A4C());
sp24 = func_8029B56C(sp2C[1], sp38[1], sp20, baphysics_get_gravity());
ml_vec3f_diff_copy(sp44, sp38, sp2C);
D_8037D504 = sp24;
sp44[0] /= sp24;
sp44[1] /= sp24;
sp44[2] /= sp24;
sp44[1] = sp20;
func_80297A0C(sp44);
baphysics_set_velocity(sp44);
func_8029E3C0(6, sp24);
} else {
func_802B35D0(0);
func_80298760(sp1C);
yaw_setIdeal(mlNormalizeAngle(sp28 + 180.0f));
func_80297970(func_802987D4());
func_8029797C(sp28);
func_802979AC(sp28, func_80297A64());
player_setYVelocity(func_802987C4());
gravity_set(func_802987E4());
func_8029C7F4(1, 1, 2, 3);
baphysics_set_target_horizontal_velocity(func_802987D4());
baphysics_set_target_yaw(sp28);
baphysics_set_horizontal_velocity(sp28, baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(func_802987C4());
baphysics_set_gravity(func_802987E4());
func_8029C7F4(1, 1, 2, BA_PHYSICS_LOCKED_ROTATION);
if (func_802987B4() == 2) {
func_802978DC(6);
baphysics_set_type(BA_PHYSICS_AIRBORN);
}
}
yaw_applyIdeal();
@@ -72,11 +73,11 @@ void func_802B37DC(void) {
if (D_8037D500 != 0) {
if ((D_8037D500 == 1) && func_8029E1A8(6)) {
_get_velocity(velocity);
baphysics_get_velocity(velocity);
velocity[0] = 0.0f;
velocity[2] = 0.0f;
func_80297A0C(velocity);
func_80297970(0.0f);
baphysics_set_velocity(velocity);
baphysics_set_target_horizontal_velocity(0.0f);
}
} else if (func_802987B4() == 2) {
func_802B6FA8();
@@ -132,6 +133,6 @@ void func_802B3954(void) {
void func_802B3A20(void) {
func_802B35DC();
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
}

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_802B3A50(void) {
f32 sp34;
@@ -40,8 +41,8 @@ void func_802B3AAC(enum asset_e anim_id, f32 anim_duration) {
} else {
baanim_playForDuration_loopSmooth(anim_id, anim_duration);
}
func_8029C7F4(1, 1, 3, 2);
func_80297970(0.0f);
func_8029C7F4(1, 1, 3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802B3A50();
}

View File

@@ -1,6 +1,8 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
ActorMarker *bssled_gSledMarker;
@@ -25,8 +27,8 @@ void func_802B3F60(void){
void bssled_init(void){
func_802B3F20();
baanim_playForDuration_loopSmooth(ASSET_228_ANIM_BANJO_SLED, 1.8f);
func_8029C7F4(1, 1, 3, 7);
func_80297970(0.0f);
func_8029C7F4(1, 1, 3, BA_PHYSICS_FREEZE);
baphysics_set_target_horizontal_velocity(0.0f);
func_80294A8C(0);
func_80294378(6);
}

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .bss */
s32 D_8037D520;
s32 D_8037D524;
@@ -66,11 +68,11 @@ void bsslide_init(void){
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_setDuration(aCtrl, 1.0f);
animctrl_start(aCtrl, "bsslide.c", 0x7f);
func_8029C7F4(1,1,3,3);
func_8029797C(yaw_getIdeal());
func_802979AC(yaw_getIdeal() ,func_80297A64());
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_horizontal_velocity(yaw_getIdeal() ,baphysics_get_target_horizontal_velocity());
pitch_setAngVel(800.0f, 8.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_80299AAC();
D_8037D524 = 0;
D_8037D528 = 1.0f;
@@ -95,10 +97,10 @@ void bsslide_update(void){
yaw_setIdeal(sp2C);
pitch_setIdeal(sp28);
}
func_80297970(ml_map_f(sp28,20.0f, 60.0f, 550.0f, 700.0f));
func_8029797C(sp2C);
baphysics_set_target_horizontal_velocity(ml_map_f(sp28,20.0f, 60.0f, 550.0f, 700.0f));
baphysics_set_target_yaw(sp2C);
}else{
func_80297970(500.0f);
baphysics_set_target_horizontal_velocity(500.0f);
}
func_802B40D0();
}else{//L802B44C4

View File

@@ -3,6 +3,8 @@
#include "variables.h"
#include "bsint.h"
#include "core2/ba/physics.h"
void func_80292900(f32, f32);
void rumbleManager_80250D94(f32, f32, f32);
@@ -21,7 +23,7 @@ void func_802B4570(void) {
void bssplat_init(void){
s32 sp1C;
baanim_playForDuration_onceSmooth(ASSET_149_ANIM_BSSPLAT, 1.1f);
func_8029C7F4(1,1,3,3);
func_8029C7F4(1,1,3, BA_PHYSICS_LOCKED_ROTATION);
func_802931DC(&sp1C);
func_803463D4(ITEM_14_HEALTH, -sp1C);
if(func_8029CEB0() == 4){
@@ -45,12 +47,12 @@ void bssplat_init(void){
void bssplat_update(void){
enum bs_e sp1C = 0;
AnimCtrl *aCtrl = baanim_getAnimCtrlPtr();
func_80297970(ml_max_f(0.0f, func_80297A64() - 15.0f));
baphysics_set_target_horizontal_velocity(ml_max_f(0.0f, baphysics_get_target_horizontal_velocity() - 15.0f));
switch (D_8037D530)
{
case 0://L802B4760
if(140.0f < func_80297A64())
if(140.0f < baphysics_get_target_horizontal_velocity())
func_802929F8();
if(func_8028B094())

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "bsint.h"
#include "core2/statetimer.h"
#include "core2/ba/physics.h"
extern f32 func_8029B2E8(void);
void yaw_setVelocityBounded(f32, f32);
@@ -91,8 +92,8 @@ void bsstand_init(void){
climbRelease();
baanim_playForDuration_once(ASSET_6F_ANIM_BSSTAND_IDLE, 5.5f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802900B4();
D_8037D540 = 0;
D_8037D544 = 0;
@@ -279,8 +280,8 @@ void bsstand_end(void){
//bsStand_Land_init
void bsstand_landing_init(void){
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
}
//bsStand_Land_update

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .bss */
s32 D_8037D560;
@@ -15,8 +17,8 @@ void func_802B5FD0(void) {
animctrl_setDuration(anim_ctrl, 1.8f);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP);
animctrl_start(anim_ctrl, "bssurf.c", 0x33);
func_8029C7F4(1, 1, 3, 2);
func_80297970(0.0f);
func_8029C7F4(1, 1, 3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
D_8037D560 = 1;
}

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
extern void func_80295328(s32, f32);
@@ -66,10 +67,10 @@ void func_802B55DC(void) {
sp1C = func_8029B30C();
if (func_8029B300() == 0) {
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
return;
}
func_80297970(ml_interpolate_f(sp1C, bsSwimHorzVelocityMin, bsSwimHorzVelocityMax));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, bsSwimHorzVelocityMin, bsSwimHorzVelocityMax));
}
void func_802B563C(void) {
@@ -78,8 +79,8 @@ void func_802B563C(void) {
} else if (map_get() == MAP_46_CCW_WINTER) {
func_8035644C(FILEPROG_DD_HAS_TOUCHED_ICY_WATER);
}
gravity_set(100.0f);
func_80297BF8(133.33f);
baphysics_set_gravity(100.0f);
baphysics_set_terminal_velocity(133.33f);
func_8029B324(0, 0.03f);
func_8029B324(1, 1.0f);
func_80294378(3);
@@ -88,8 +89,8 @@ void func_802B563C(void) {
void func_802B56D4(void) {
if (!bsswim_inset(bs_getNextState())) {
func_80297B94();
gravity_reset();
baphysics_reset_terminal_velocity();
baphysics_reset_gravity();
func_8029B0C0();
func_80294378(1);
}
@@ -138,9 +139,9 @@ void func_802B5774(void) {
animctrl_setDuration(anim_ctrl, 1.2f);
animctrl_start(anim_ctrl, "bsswim.c", 0xFD);
}
func_8029C7F4(1, 3, 3, 2);
func_8029C7F4(1, 3, 3, BA_PHYSICS_NORMAL);
yaw_setVelocityBounded(500.0f, 5.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_802B563C();
bsSwimCurrentAnimation = 0;
}
@@ -212,7 +213,7 @@ void func_802B5B18(void) {
yaw_setUpdateState(3);
yaw_setVelocityBounded(500.0f, 5.0f);
func_8029957C(1);
func_802978DC(2);
baphysics_set_type(BA_PHYSICS_NORMAL);
}
void func_802B5C40(void) {
@@ -280,9 +281,9 @@ void func_802B5E30(void) {
void func_802B5E8C(void) {
baanim_playForDuration_loopSmooth(0x57, 1.2f);
func_8029C7F4(1, 3, 3, 2);
func_8029C7F4(1, 3, 3, BA_PHYSICS_NORMAL);
yaw_setVelocityBounded(500.0f, 5.0f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
func_802B563C();
func_802B5E30();
}

View File

@@ -2,6 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
#include "core2/yaw.h"
/* .bss */
@@ -26,8 +27,8 @@ void bstalk_init(void){
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(YAW_STATE_1_DEFAULT);
func_8029957C(3);
func_802978DC(2);
func_80297970(0.0f);
baphysics_set_type(BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
bsTalkStayInState = TRUE;
}

View File

@@ -3,6 +3,7 @@
#include "variables.h"
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
extern ActorMarker *carriedobj_getMarker(void);
@@ -22,9 +23,9 @@ void bsthrow_init(void){
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(3);
func_802978DC(3);
func_80297970(0.0f);
func_80297A0C(0);
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_target_horizontal_velocity(0.0f);
baphysics_set_velocity(0);
D_8037D580 = 0;
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_80292E80(s32, f32);
@@ -9,8 +10,8 @@ void ncDynamicCamD_func_802BF2C0(f32);
void func_802B6270(void){
baanim_playForDuration_once(ASSET_77_ANIM_BSTIMEOUT, 3.2f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_802914CC(0xd);
yaw_setIdeal(func_8029B41C() + 35.0f);
ncDynamicCamD_func_802BF2C0(80.0f);
@@ -50,8 +51,8 @@ void func_802B63F8(void){
func_8029C848(aCtrl);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP);
animctrl_start(aCtrl, "bstimeout.c", 0x7e);
func_8029C7F4(1,1,3,7);
func_80297970(0.0f);
func_8029C7F4(1,1,3,BA_PHYSICS_FREEZE);
baphysics_set_target_horizontal_velocity(0.0f);
func_802914CC(0xd);
yaw_setIdeal(func_8029B41C() + 35.0f);
ncDynamicCamD_func_802BF2C0(80.0f);

View File

@@ -2,9 +2,10 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .data */
f32 D_8037D590;
f32 bsturn_starting_horizontal_velocity;
s32 D_8037D594;
/* .code */
@@ -21,9 +22,9 @@ void bsturn_init(void){
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(2);
func_802978DC(3);
_get_velocity(&sp28);
D_8037D590 = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]);
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
baphysics_get_velocity(sp28);
bsturn_starting_horizontal_velocity = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]);
func_8030EBC8(SFX_19_BANJO_LANDING_08, 0.95f, 1.05f, 0x7530, 0x7d00);
D_8037D594 = 0;
}
@@ -31,7 +32,7 @@ void bsturn_init(void){
void bsturn_update(void){
enum bs_e sp2C = 0;
func_80297970(ml_map_f(animctrl_getAnimTimer(baanim_getAnimCtrlPtr()), 0.18f, 1.0f, D_8037D590, 0.0f));
baphysics_set_target_horizontal_velocity(ml_map_f(animctrl_getAnimTimer(baanim_getAnimCtrlPtr()), 0.18f, 1.0f, bsturn_starting_horizontal_velocity, 0.0f));
D_8037D594++;
if(!(D_8037D594 < 6))
@@ -39,13 +40,13 @@ void bsturn_update(void){
switch(D_8037D594){
case -1://L802B68DC
func_802927E0(func_80297A7C() - 10.0f, _get_horzVelocity()*0.88);
func_802927E0(baphysics_get_target_yaw() - 10.0f, baphysics_get_horizontal_velocity()*0.88);
break;
case 0://L802B691C
func_802927E0(func_80297A7C(), _get_horzVelocity());
func_802927E0(baphysics_get_target_yaw(), baphysics_get_horizontal_velocity());
break;
case 1://L802B6940
func_802927E0(func_80297A7C() + 10.0f, _get_horzVelocity()*0.88);
func_802927E0(baphysics_get_target_yaw() + 10.0f, baphysics_get_horizontal_velocity()*0.88);
break;
}//L802B6978

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
/* .bss */
f32 D_8037D5A0;
u8 D_8037D5A4;
@@ -25,11 +25,11 @@ void bstwirl_init(void){
baanim_setUpdateType(BAANIM_UPDATE_1_NORMAL);
yaw_setUpdateState(1);
func_8029957C(3);
func_8029797C(yaw_getIdeal());
func_802979AC(yaw_getIdeal(), func_80297A64());
func_802978DC(3);
D_8037D5A0 = func_80297A64();
func_80297970(600.0f);
baphysics_set_target_yaw(yaw_getIdeal());
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_type(BA_PHYSICS_LOCKED_ROTATION);
D_8037D5A0 = baphysics_get_target_horizontal_velocity();
baphysics_set_target_horizontal_velocity(600.0f);
func_80299CF4(SFX_32_BANJO_EGHEE, 1.0f, 0x6590);
_bstwirlHitboxActive = TRUE;
func_8029E3C0(0, 0.01f);
@@ -54,7 +54,7 @@ void bstwirl_update(void){
}
if(animctrl_isAt(aCtrl, 0.8011f)){
animctrl_setDuration(aCtrl, 2.5f);
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
_bstwirlHitboxActive = 0;
D_8037D5A4 = 3;
}

View File

@@ -3,18 +3,15 @@
#include "variables.h"
#include "animation.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
void baanim_setDurationRange(f32, f32);
f32 _get_horzVelocity(void);
void func_802927E0(f32, f32);
f32 func_8029B2E8(void);
int func_80297C04(f32);
void func_8029AD28(f32, s32);
f32 func_80297AF0(void);
void baanim_scaleDuration(f32);
f32 func_8029B30C(void);
f32 ml_interpolate_f(f32, f32, f32);
f32 func_80297A64(void);
void func_80299594(s32, f32);
// .data
@@ -49,27 +46,27 @@ void func_802B6D00(void){
sp18 = func_8029B300();
if(func_8028B128()){
if(sp18 == 0){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
}else{//L802B6D48
func_80297970(ml_interpolate_f(func_8029B2E8(), bsWalkMinMudVelocity, bsWalkMaxMudVelocity));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(func_8029B2E8(), bsWalkMinMudVelocity, bsWalkMaxMudVelocity));
}
}
else{//L802B6D78
switch(sp18){
case 0://802B6D98
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
break;
case 1://802B6DAC
func_80297970(ml_interpolate_f(sp1C, bsWalkMinCreepVelocity, bsWalkCreepSlowWalkVelocityThreshold));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, bsWalkMinCreepVelocity, bsWalkCreepSlowWalkVelocityThreshold));
break;
case 2://802B6DD0
func_80297970(ml_interpolate_f(sp1C, bsWalkCreepSlowWalkVelocityThreshold, bsWalkSlowWalkWalkVelocityThreshold));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, bsWalkCreepSlowWalkVelocityThreshold, bsWalkSlowWalkWalkVelocityThreshold));
break;
case 3://802B6DF4
func_80297970(ml_interpolate_f(sp1C, bsWalkSlowWalkWalkVelocityThreshold, bsWalkWalkFastWalkVelocityThreshold));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, bsWalkSlowWalkWalkVelocityThreshold, bsWalkWalkFastWalkVelocityThreshold));
break;
case 4://802B6E18
func_80297970(ml_interpolate_f(sp1C, bsWalkWalkFastWalkVelocityThreshold, bsWalkMaxFastWalkVelocity));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, bsWalkWalkFastWalkVelocityThreshold, bsWalkMaxFastWalkVelocity));
break;
}
}//L802B6E34
@@ -77,7 +74,7 @@ void func_802B6D00(void){
void func_802B6E44(void){
if(func_8028B394()){
baanim_scaleDuration(ml_map_f(func_80297AF0(), 0.0f, 1.0f, 0.5f, 0.9f));
baanim_scaleDuration(ml_map_f(baphysics_get_horizontal_velocity_percentage(), 0.0f, 1.0f, 0.5f, 0.9f));
}else{
baanim_scaleDuration(1.0f);
}
@@ -98,7 +95,7 @@ int func_802B6EF4(void){
s32 func_802B6F20(s32 arg0){
if(button_pressed(BUTTON_B)){
if( bsWalkWalkFastWalkVelocityThreshold < func_80297A64()){
if( bsWalkWalkFastWalkVelocityThreshold < baphysics_get_target_horizontal_velocity()){
if(can_roll())
arg0 = BS_ROLL;
}else{//L802B6F74
@@ -132,7 +129,7 @@ void bswalk_creep_init(void){
animctrl_setStart(anim_ctrl, start_position);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP);
animctrl_start(anim_ctrl, "bswalk.c", 0xe4);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setDurationRange(0.3f, 1.5f);
baanim_setVelocityMapRanges(bsWalkMinCreepVelocity, bsWalkCreepSlowWalkVelocityThreshold, bsWalkSlowestCreepDuration, bsWalkFastestCreepDuration);
}
@@ -149,7 +146,7 @@ void bswalk_creep_update(void){
func_802B6D00();
switch(func_8029B300()){
case 0://L802B7160
if(func_80297C04(1.0f))
if(baphysics_is_slower_than(1.0f))
next_state = BS_1_IDLE;
break;
case 2://L802B7180
@@ -205,7 +202,7 @@ void bswalk_slow_init(void){
animctrl_setStart(anim_ctrl, start_position);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP);
animctrl_start(anim_ctrl, "bswalk.c", 0x168);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setDurationRange(0.3f, 1.5f);
baanim_setVelocityMapRanges(bsWalkCreepSlowWalkVelocityThreshold, bsWalkSlowWalkWalkVelocityThreshold, bsWalkSlowestSlowWalkDuration, bsWalkFastestSlowWalkDuration);
}
@@ -222,7 +219,7 @@ void bswalk_slow_upate(void){
func_802B6D00();
switch(func_8029B300()){
case 0://L802B7160
if(func_80297C04(3.0f))
if(baphysics_is_slower_than(3.0f))
next_state = BS_1_IDLE;
break;
case 1://L802B7180
@@ -283,7 +280,7 @@ void bswalk_init(void){
animctrl_setStart(anim_ctrl, start_position);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP);
animctrl_start(anim_ctrl, "bswalk.c", 0x1ed);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setDurationRange(0.3f, 1.5f);
baanim_setVelocityMapRanges(bsWalkSlowWalkWalkVelocityThreshold, bsWalkWalkFastWalkVelocityThreshold, bsWalkSlowestWalkDuration, bsWalkFastestWalkDuration);
func_802B6EB0(0.3f);
@@ -300,7 +297,7 @@ void bswalk_update(void){
case 0:
case 1:
case 2:
if(func_80297C04(bsWalkSlowWalkWalkVelocityThreshold) && func_802B6EF4())
if(baphysics_is_slower_than(bsWalkSlowWalkWalkVelocityThreshold) && func_802B6EF4())
next_state = BS_2_WALK_SLOW;
break;
case 4:
@@ -310,7 +307,7 @@ void bswalk_update(void){
if(func_8028B128())
next_state = BS_WALK_MUD;
if(func_8028B4C4() && bsWalkSkidVelocity < _get_horzVelocity()){
if(func_8028B4C4() && bsWalkSkidVelocity < baphysics_get_horizontal_velocity()){
next_state = BS_SKID;
}
@@ -347,7 +344,7 @@ void bswalk_fast_init(void){
switch(bs_getPrevState()){
case 1:
case 2://L802B780C
if(_get_horzVelocity() < 200.0f){
if(baphysics_get_horizontal_velocity() < 200.0f){
func_802927E0(0.0f, 0.0f);
}
break;
@@ -367,7 +364,7 @@ void bswalk_fast_init(void){
animctrl_setStart(anim_ctrl, sp28);
animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP);
animctrl_start(anim_ctrl, "bswalk.c", 0x27d);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setDurationRange(0.3f, 1.5f);
baanim_setVelocityMapRanges(bsWalkWalkFastWalkVelocityThreshold, bsWalkMaxFastWalkVelocity, bsWalkSlowestFastWalkDuration, bsWalkFastestFastWalkDuration);
pitch_setAngVel(1000.0f, 12.0f);
@@ -386,7 +383,7 @@ void bswalk_fast_update(void){
func_802B6D00();
switch(func_8029B300()){
case 0://L802B79EC
if(func_80297C04(18.0f))
if(baphysics_is_slower_than(18.0f))
next_state = BS_1_IDLE;
if(func_80294F78())
@@ -395,7 +392,7 @@ void bswalk_fast_update(void){
break;
case 1:
case 2://L802B7A28
if(func_80297C04(bsWalkSlowWalkWalkVelocityThreshold))
if(baphysics_is_slower_than(bsWalkSlowWalkWalkVelocityThreshold))
next_state = BS_2_WALK_SLOW;
if(func_80294F78())
@@ -403,7 +400,7 @@ void bswalk_fast_update(void){
break;
case 3://L802B7A60
if(func_80297C04(bsWalkWalkFastWalkVelocityThreshold) && func_802B6EF4())
if(baphysics_is_slower_than(bsWalkWalkFastWalkVelocityThreshold) && func_802B6EF4())
next_state = BS_WALK;
if(func_80294F78())
@@ -413,7 +410,7 @@ void bswalk_fast_update(void){
if(func_8028B128())
next_state = BS_WALK_MUD;
if(func_8028B4C4() && bsWalkSkidVelocity < _get_horzVelocity()){
if(func_8028B4C4() && bsWalkSkidVelocity < baphysics_get_horizontal_velocity()){
next_state = BS_SKID;
}
@@ -446,7 +443,7 @@ void bswalk_fast_end(void){
void bswalk_mud_init(void){
baanim_playForDuration_loopSmooth(ASSET_B_ANIM_BSWALK_MUD, 0.43f);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setDurationRange(0.3f, 1.5f);
baanim_setVelocityMapRanges(bsWalkMinMudVelocity, bsWalkMaxMudVelocity, bsWalkSlowestMudDuration, bsWalkFastestMudDuration);
}

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
extern void func_8029AD68(f32, s32);
extern f32 ml_dotProduct_vec3f(f32[3], f32[3]);
@@ -44,10 +46,10 @@ void func_802B7E6C(void) {
sp1C = func_8029B30C();
if (func_8029B300() == 0) {
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
return;
}
func_80297970(ml_interpolate_f(sp1C, D_80364DC0, D_80364DC4));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp1C, D_80364DC0, D_80364DC4));
}
void func_802B7ECC(void) {
@@ -70,7 +72,7 @@ void func_802B7F28(void) {
sp3C = D_80364DDC;
sp40 = func_8029B30C();
func_802B7ECC();
_get_velocity(sp20);
baphysics_get_velocity(sp20);
sp20[1] = 0.0f;
if (900.0 < sp20[0] * sp20[0] + sp20[1] * sp20[1] + sp20[2] * sp20[2]) {
ml_vec3f_normalize(sp20);
@@ -80,10 +82,10 @@ void func_802B7F28(void) {
}
}
if (func_8029B300() == 0) {
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
return;
}
func_80297970(ml_interpolate_f(sp40, sp38, sp3C));
baphysics_set_target_horizontal_velocity(ml_interpolate_f(sp40, sp38, sp3C));
}
void func_802B8048(void){
@@ -141,8 +143,8 @@ int bswalrus_inSet(enum bs_e state){
void bswalrus_idle_init(void){
baanim_playForDuration_loopSmooth(ASSET_11F_ANIM_BSWALRUS_IDLE, 4.0f);
func_8029C7F4(1,1,1,2);
func_80297970(0.0f);
func_8029C7F4(1,1,1, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
pitch_setAngVel(1000.0f, 12.0f);
roll_setAngularVelocity(1000.0f, 12.0f);
func_80293D48(50.0f, 25.0f);
@@ -179,7 +181,7 @@ void bswalrus_idle_end(void){
void bswalrus_walk_init(void){
baanim_playForDuration_loopSmooth(ASSET_120_ANIM_BSWALRUS_WALK, 0.8f);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_80364DC0, D_80364DC4, D_80364DC8, D_80364DCC);
func_802900B4();
func_802B8110();
@@ -192,7 +194,7 @@ void bswalrus_walk_update(void){
func_802B7E6C();
func_8029AD68(0.3f, 4);
if(func_8029B300() == 0 && func_80297C04(1.0f))
if(func_8029B300() == 0 && baphysics_is_slower_than(1.0f))
next_state = BS_67_WALRUS_IDLE;
if(func_8028B094())
@@ -220,14 +222,14 @@ void bswalrus_jump_init(void){
animctrl_setStart(aCtrl, 0.1);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bswalrus.c", 0x1f8);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B7E6C();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364DD0);
gravity_set(D_80364DD4);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364DD0);
baphysics_set_gravity(D_80364DD4);
func_802B7E00();
func_802B8110();
D_8037D5C8 = 0;
@@ -239,9 +241,9 @@ void bswalrus_jump_update(void){
f32 sp1C[3];
func_802B7E6C();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1])
gravity_reset();
baphysics_reset_gravity();
switch(D_8037D5C8){
case 0://L802B86D8
@@ -279,7 +281,7 @@ void bswalrus_jump_update(void){
case 3://L802B880C
func_80299628(0);
if(animctrl_isStopped(aCtrl)){
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
next_state = BS_67_WALRUS_IDLE;
}
break;
@@ -297,7 +299,7 @@ void bswalrus_jump_update(void){
}
void bswalrus_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
func_802B8048();
}
@@ -309,7 +311,7 @@ void bswalrus_fall_init(void){
animctrl_setDuration(aCtrl, 0.7f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_start(aCtrl, "bswalrus.c", 0x284);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
func_802B8110();
D_8037D5C8 = 0;
}
@@ -321,7 +323,7 @@ void bswalrus_fall_update(void){
func_80299628(0);
func_802B7E6C();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
switch (D_8037D5C8)
{
@@ -335,7 +337,7 @@ void bswalrus_fall_update(void){
case 1://L802B89E0
if(func_8028B2E8()){
func_8029AE48();
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
animctrl_setSubRange(aCtrl, 0.0f, 1.0f);
animctrl_setDuration(aCtrl, 1.0f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
@@ -381,12 +383,12 @@ static void __bswalrus_recoil_init(s32 damage){
func_80257F18(sp24, sp30, &sp3C);
yaw_setIdeal(mlNormalizeAngle(sp3C + 180.0f));
yaw_applyIdeal();
func_80297970(func_802987D4());
func_8029797C(sp3C);
func_802979AC(sp3C, func_80297A64());
func_8029C7F4(1,1,2,3);
player_setYVelocity(func_802987C4());
gravity_set(func_802987E4());
baphysics_set_target_horizontal_velocity(func_802987D4());
baphysics_set_target_yaw(sp3C);
baphysics_set_horizontal_velocity(sp3C, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(func_802987C4());
baphysics_set_gravity(func_802987E4());
baMarker_collisionOff();
func_80292E48();
func_802B8110();
@@ -404,7 +406,7 @@ static void __bswalrus_recoil_update(void){
}
static void __bswalrus_recoil_end(void){
gravity_reset();
baphysics_reset_gravity();
baMarker_collisionOn();
func_80292EA4();
func_802B8048();
@@ -455,12 +457,12 @@ void bswalrus_die_init(void){
D_8037D5C4 = 250.0f;
yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f));
yaw_applyIdeal();
func_80297970(D_8037D5C4);
func_8029797C(sp38);
func_802979AC(sp38, func_80297A64());
func_8029C7F4(1,1,2,3);
player_setYVelocity(420.0f); //B)
gravity_set(-1200.0f);
baphysics_set_target_horizontal_velocity(D_8037D5C4);
baphysics_set_target_yaw(sp38);
baphysics_set_horizontal_velocity(sp38, baphysics_get_target_horizontal_velocity());
func_8029C7F4(1,1,2, BA_PHYSICS_LOCKED_ROTATION);
baphysics_set_vertical_velocity(420.0f); //B)
baphysics_set_gravity(-1200.0f);
pitch_setAngVel(1000.0f, 12.0f);
func_802914CC(0xd);
ncDynamicCamD_func_802BF2C0(30.0f);
@@ -477,7 +479,7 @@ void bswalrus_die_init(void){
void bswalrus_die_update(void){
enum bs_e next_state = 0;
func_80297970(D_8037D5C4);
baphysics_set_target_horizontal_velocity(D_8037D5C4);
func_80299628(0);
switch(D_8037D5C8){
case 0://L802B8F54
@@ -485,7 +487,7 @@ void bswalrus_die_update(void){
baanim_setEnd(1.0f);
FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000);
FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000);
player_setYVelocity(400.0f);
baphysics_set_vertical_velocity(400.0f);
D_8037D5C8 = 2;
}
break;
@@ -507,7 +509,7 @@ void bswalrus_die_update(void){
void bswalrus_die_end(void){
func_8024BD08(0);
gravity_reset();
baphysics_reset_gravity();
pitch_setIdeal(0.0f);
roll_setIdeal(0.0f);
func_80291548();
@@ -530,8 +532,8 @@ void bswalrus_drone_end(void){
void func_802B90D0(void){
baanim_playForDuration_loopSmooth(ASSET_19E_ANIM_BSWALRUS_SLED, 0.8f);
func_8029C7F4(1,1,3,2);
func_80297970(0.0f);
func_8029C7F4(1,1,3, BA_PHYSICS_NORMAL);
baphysics_set_target_horizontal_velocity(0.0f);
func_8029C674();
func_802B813C();
func_802B3A50();
@@ -555,7 +557,7 @@ void func_802B917C(void){
void bswalrus_sled_init(void){
baanim_playForDuration_loopSmooth(ASSET_19E_ANIM_BSWALRUS_SLED, 0.8f);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1,2);
func_8029C7F4(BAANIM_UPDATE_2_SCALE_HORZ,1,1, BA_PHYSICS_NORMAL);
baanim_setVelocityMapRanges(D_80364DC0, D_80364DC4, D_80364DE0, D_80364DE4);
func_802900B4();
func_802B813C();
@@ -565,7 +567,7 @@ void bswalrus_sled_update(void){
enum bs_e next_state = 0;
f32 sp20[3];
if(50.0f < _get_horzVelocity()){
if(50.0f < baphysics_get_horizontal_velocity()){
if(func_8023DB4C(1)){
baModel_80292554(&sp20);
}else{
@@ -601,14 +603,14 @@ void bswalrus_sled_jump_init(void){
animctrl_setStart(aCtrl, 0.14f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE);
animctrl_start(aCtrl, "bswalrus.c", 0x477);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
if(func_8029B2E8() != 0.0f)
yaw_setIdeal(func_8029B33C());
func_8029797C(yaw_getIdeal());
baphysics_set_target_yaw(yaw_getIdeal());
func_802B7F28();
func_802979AC(yaw_getIdeal(), func_80297A64());
player_setYVelocity(D_80364DD0);
gravity_set(D_80364DD4);
baphysics_set_horizontal_velocity(yaw_getIdeal(), baphysics_get_target_horizontal_velocity());
baphysics_set_vertical_velocity(D_80364DD0);
baphysics_set_gravity(D_80364DD4);
func_802B7E00();
func_802B813C();
D_8037D5C8 = 0;
@@ -620,10 +622,10 @@ void bswalrus_sled_jump_update(void){
f32 sp1C[3];
func_802B7F28();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
if(button_released(BUTTON_A) && 0.0f < sp1C[1])
gravity_reset();
baphysics_reset_gravity();
switch (D_8037D5C8)
{
@@ -657,7 +659,7 @@ void bswalrus_sled_jump_update(void){
}
void bswalrus_sled_jump_end(void){
gravity_reset();
baphysics_reset_gravity();
func_802B80D0();
}
@@ -669,7 +671,7 @@ void func_802B95A0(void){
animctrl_setDuration(aCtrl, 1.0f);
animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED);
animctrl_start(aCtrl, "bswalrus.c", 0x4e2);
func_8029C7F4(1,1,3,6);
func_8029C7F4(1,1,3, BA_PHYSICS_AIRBORN);
func_802B813C();
D_8037D5C8 = 0;
}
@@ -681,7 +683,7 @@ void func_802B963C(void){
func_80299628(0);
func_802B7E6C();
_get_velocity(sp1C);
baphysics_get_velocity(sp1C);
switch (D_8037D5C8)
{
case 0://L802B9694
@@ -693,7 +695,7 @@ void func_802B963C(void){
case 1://L802B96C0
if(func_8028B2E8()){
func_8029AE48();
func_80297970(0.0f);
baphysics_set_target_horizontal_velocity(0.0f);
D_8037D5C8 = 2;
}
break;
@@ -724,8 +726,8 @@ void func_802B976C(void){
void bswalrus_timeout_init(void) {
baanim_playForDuration_once(ASSET_1A9_ANIM_BSWALRUS_LOSS, 3.2f);
func_8029C7F4(1, 1, 3, 7);
func_80297970(0.0f);
func_8029C7F4(1, 1, 3, BA_PHYSICS_FREEZE);
baphysics_set_target_horizontal_velocity(0.0f);
func_802914CC(0xD);
ncDynamicCamD_func_802BF2C0(60.0f);
func_8025A58C(0, 4000);

View File

@@ -2,6 +2,8 @@
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
/* .bss */
u8 D_8037D5D0;
@@ -14,11 +16,11 @@ void func_802B9980(s32 arg0){
case 1: //L802B99B8
func_802BB3DC(0, 30.0f, 0.6f);
func_8030E58C(SFX_82_METAL_BREAK, 0.8f);
player_setYVelocity(400.0f);
baphysics_set_vertical_velocity(400.0f);
break;
case 2: //L802B99F4
func_802BB3DC(0, 10.0f, 0.6f);
player_setYVelocity(300.0f);
baphysics_set_vertical_velocity(300.0f);
break;
case 3: //L802B9A20
func_8029E3C0(0, 0.01f);
@@ -45,7 +47,7 @@ void func_802B9AAC(void){
void func_802B9ACC(void){
baanim_playForDuration_once(ASSET_281_ANIM_WISHYWASHY_DOOOH, 40.0f);
func_8029C7F4(1, 1, 3, 2);
func_8029C7F4(1, 1, 3, BA_PHYSICS_NORMAL);
func_802900B4();
func_802B9980(0);
}

View File

@@ -23,7 +23,7 @@ void func_802CE7E0(ActorMarker *marker, ActorMarker *other){
Actor *actor = marker_getActor(marker);
FUNC_8030E8B4(SFX_11_WOOD_BREAKING_1, 1.0f, 28000, actor->position, 300, 3000);
FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.0f, 28000, actor->position, 300, 3000);
func_80328A84(actor, 2);
subaddie_set_state(actor, 2);
actor_playAnimationOnce(actor);
marker->collidable = FALSE;
actor->unk138_27 = 3;

View File

@@ -52,19 +52,19 @@ void func_802C5EB8(Actor *this){
}
else{
if(func_80329530(this, 1200) && func_803292E0(this)){
func_80328A84(this, 8);
subaddie_set_state(this, 8);
}
}
}
void func_802C5F44(Actor *this){
if(!func_80329530(this, 1200) || !func_803292E0(this)){
func_80328B8C(this, 1, 0.16f, 1);
subaddie_set_state_with_direction(this, 1, 0.16f, 1);
}
}
void func_802C5F94(Actor *this){
func_80328A84(this, 2);
subaddie_set_state(this, 2);
func_802C5E80(this);
func_80328CEC(this, (s32)this->yaw_ideal, 135, 175);
this->unk38_31 = 150;
@@ -87,14 +87,14 @@ void func_802C60AC(ActorMarker *marker, ActorMarker *other_marker){
&& func_803294F0(actor, 80, func_80329784(actor))
){
animctrl_setPlaybackType(actor->animctrl, ANIMCTRL_ONCE);
func_80328A84(actor, 5);
subaddie_set_state(actor, 5);
func_8030E58C(SFX_1E_HITTING_AN_ENEMY_2, 1.0f);
}
}
void func_802C6150(ActorMarker *marker, ActorMarker *other_marker){
Actor *actor = marker_getActor(marker);
func_80328AC8(actor, 0xC);
subaddie_set_state_forward(actor, 0xC);
func_8030E878(SFX_2B_BULL_MOO_1, randf2(1.28f, 1.37f), 32000, actor->position, 0.0f, 2000.0f);
}
@@ -104,7 +104,7 @@ void func_802C61C0(ActorMarker *marker, ActorMarker *other_marker){
&& actor->state != 0xe
&& actor->state != 0xf
){
func_80328AC8(actor, 0xd);
subaddie_set_state_forward(actor, 0xd);
FUNC_8030E8B4(SFX_143_BULL_DAMAGE, 1.0f, 16000, actor->position, 0, 2000);
FUNC_8030E8B4(SFX_143_BULL_DAMAGE, 1.0f, 16000, actor->position, 0, 2000);
}
@@ -147,7 +147,7 @@ void func_802C6240(Actor *this){
func_802C5FF8(this);
if( func_8032863C(this->animctrl, 0.65f, 0.99f) >= 2
&& !func_80328A2C(this, 0.0f, -1, 0.45f)
&& func_80328BD4(this, 2, 0.0f, -1, 0.58f)
&& subaddie_maybe_set_state_position_direction(this, 2, 0.0f, -1, 0.58f)
){
func_80328CEC(this, (s32)this->yaw, 10, 45);
func_802C5E80(this);
@@ -165,11 +165,11 @@ void func_802C6240(Actor *this){
func_80328CEC(this, (s32)this->yaw_ideal, 10, 20);
if(!(func_8023DB5C() & 0x7))
func_80328BD4(this, 1, 0.16f, 1, 0.02f);
subaddie_maybe_set_state_position_direction(this, 1, 0.16f, 1, 0.02f);
if( !(func_8023DB5C() & 0xf)
&& func_80329078(this, (s32)this->yaw_ideal, 150)
&& func_80328B38(this, 3, 0.13f)
&& subaddie_maybe_set_state(this, 3, 0.13f)
){
this->unk28 = randf2(7.1f, 8.4f);
}
@@ -181,17 +181,17 @@ void func_802C6240(Actor *this){
this->yaw_ideal = func_80329784(this);
func_80328FB0(this, 4.0f);
if(func_80329480(this))
func_80328A84(this, 6);
subaddie_set_state(this, 6);
break;
case 0x3: //L802C6620
func_80328FB0(this, 3.0f);
if(! func_80329030(this, 0) && func_80329480(this)){
func_80328CEC(this, (s32)this->yaw, 120, 180);
func_80328A84(this, 2);
subaddie_set_state(this, 2);
func_802C5E80(this);
}
if(!(func_8023DB5C() & 0xf) && func_80328B38(this, 2, 0.08f))
if(!(func_8023DB5C() & 0xf) && subaddie_maybe_set_state(this, 2, 0.08f))
func_802C5E80(this);
func_802C5EB8(this);
break;
@@ -200,7 +200,7 @@ void func_802C6240(Actor *this){
animctrl_setDuration(this->animctrl, D_80366010[6].duration - (3 - this->unk10_12)*0.1085);
this->yaw_ideal = (f32)func_80329784(this);
if(!func_803294B4(this, 0x21)){
func_80328A84(this, 8);
subaddie_set_state(this, 8);
}
func_802C5F44(this);
if(actor_animationIsAt(this, 0.35f) && func_8028EE84() != BSWATERGROUP_2_UNDERWATER){
@@ -211,7 +211,7 @@ void func_802C6240(Actor *this){
func_802C5F94(this);
if(this->unk10_12 == 0 || (this->unk10_12 < 3 && func_80329530(this, 300))){
func_80328A84(this, 9);
subaddie_set_state(this, 9);
this->unk28 = 13.0f;
}
break;
@@ -232,7 +232,7 @@ void func_802C6240(Actor *this){
if(func_80329530(this, 320)){
if(func_80329078(this, (s32)this->yaw_ideal,200)){
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE);
func_80328A84(this, 4);
subaddie_set_state(this, 4);
this->unk28 += 5.7;
tmp_a0 = this->unk44_31;
if(this->unk44_31 == 0){
@@ -261,7 +261,7 @@ void func_802C6240(Actor *this){
func_80329878(this, func_80329530(this, 250)? 0.8: 1.2);
if(0.0f == this->unk28){
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
func_80328B8C(this, 1, 0.65f, 1);
subaddie_set_state_with_direction(this, 1, 0.65f, 1);
func_8030DA44(this->unk44_31);
this->unk44_31 = 0;
func_8030E484(SFX_19_BANJO_LANDING_08);
@@ -282,7 +282,7 @@ void func_802C6240(Actor *this){
case 0xc: //L802C6BDC
actor_playAnimationOnce(this);
if(actor_animationIsAt(this, 0.95f)){
func_80328B8C(this, 1, 0.65f, 1);
subaddie_set_state_with_direction(this, 1, 0.65f, 1);
actor_loopAnimation(this);
}
break;
@@ -290,7 +290,7 @@ void func_802C6240(Actor *this){
case 0xd: //L802C6C28
actor_playAnimationOnce(this);
if(actor_animationIsAt(this, 0.95f)){
func_80328B8C(this, 0xe, 0.99f, 1);
subaddie_set_state_with_direction(this, 0xe, 0.99f, 1);
this->unk60 = 4.0f;
}
break;
@@ -300,7 +300,7 @@ void func_802C6240(Actor *this){
this->unk60 -= time_getDelta();
if(this->unk60 <= 0.0f){
this->unk166 = 0x63;
func_80328AC8(this, 0xF);
subaddie_set_state_forward(this, 0xF);
}
break;
@@ -308,7 +308,7 @@ void func_802C6240(Actor *this){
case 0xf: //L802C6CD4
actor_playAnimationOnce(this);
if(actor_animationIsAt(this, 0.95f)){
func_80328B8C(this, 1, 0.65f, 1);
subaddie_set_state_with_direction(this, 1, 0.65f, 1);
actor_loopAnimation(this);
}
break;

View File

@@ -13,6 +13,10 @@ BKAnimationList *model_getAnimationList(BKModelBin *arg0);
extern void func_8034BB08(s32);
extern void func_803458E4(f32[4], f32[4], f32[4], f32);
#define CH_BOTTLES_BONUS_PUZZLE_HEIGHT (4)
#define CH_BOTTLES_BONUS_PUZZLE_WIDTH (5)
#define CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT (CH_BOTTLES_BONUS_PUZZLE_HEIGHT * CH_BOTTLES_BONUS_PUZZLE_WIDTH)
/* .extern symbols??? */
extern u8 D_8037DCC0[7];
extern u8 D_8037DCC7;
@@ -74,7 +78,7 @@ ActorAnimationInfo chBottlesBonusAnimations[] ={
f32 D_80368250 = 0.999388993f;
s32 D_80368254[20] = {
s32 D_80368254[CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT] = {
0x3C, 0x3D, 0x3F, 0x40,
0x42, 0x41, 0x43, 0x3A,
0x32, 0x30, 0x2E, 0x3E,
@@ -106,37 +110,37 @@ Struct_core2_560F0_1 *D_8037DEB8;
Struct_core2_560F0_1 *D_8037DEBC;
Struct_core2_560F0_1 *D_8037DEC0;
Struct_core2_560F0_1 *D_8037DEC4;
f32 D_8037DEC8[20];
f32 D_8037DF18[20];
f32 D_8037DEC8[CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT];
f32 D_8037DF18[CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT];
s32 chBottleBonusPuzzleIndex;
f32 D_8037DF70[3];
f32 D_8037DF80[3];
s32 D_8037DF90[20];
s32 D_8037DF90[CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT];
/* .code */
void chBottlesBonus_func_802DD080(Gfx **gfx, Mtx **mtx) {
f32 sp24[3];
f32 sp18[3];
f32 vp_position[3];
f32 vp_rotation[3];
func_8024E258();
func_8024CE60(50.0f, 2000.0f);
if (getGameMode() == GAME_MODE_A_SNS_PICTURE) {
sp18[0] = 0.0f;
sp18[1] = 0.0f;
sp18[2] = 0.0f;
sp24[0] = 0.0f;
sp24[1] = 0.0f;
sp24[2] = 400.0f;
vp_rotation[0] = 0.0f;
vp_rotation[1] = 0.0f;
vp_rotation[2] = 0.0f;
vp_position[0] = 0.0f;
vp_position[1] = 0.0f;
vp_position[2] = 400.0f;
} else {
sp24[0] = 248.4125;
sp24[1] = 328.9;
sp24[2] = -186.4;
sp18[0] = 0.0f;
sp18[1] = 270.0f;
sp18[2] = 0.0f;
vp_position[0] = 248.4125;
vp_position[1] = 328.9;
vp_position[2] = -186.4;
vp_rotation[0] = 0.0f;
vp_rotation[1] = 270.0f;
vp_rotation[2] = 0.0f;
}
viewport_setPosition(sp24);
viewport_setRotation(sp18);
viewport_setPosition(vp_position);
viewport_setRotation(vp_rotation);
viewport_update();
func_8024C904(gfx, mtx);
}
@@ -153,7 +157,7 @@ Actor *chBottlesBonus_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx)
void *sp50;
sp6C = marker_getActor(marker);
sp50 = func_8030C704();
sp50 = func_8030C704(); //grabs frame as texture?
if ((sp50 == NULL) || (getGameMode() != GAME_MODE_8_BOTTLES_BONUS))
return sp6C;
@@ -287,18 +291,18 @@ void chBottlesBonus_func_802DD8AC(BoneTransformList *arg0, s32 arg1) {
spD0 = func_8033DDB8();
if (D_8037DEB0 == 0) {
D_8037DEB0 = 1;
for(i = 0; i < 20; i++){
for(i = 0; i < CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT; i++){
func_8033A57C(arg0, D_80368254[i], D_8037DEC4[i].unkC);
boneTransformList_getBoneScale(arg0, D_80368254[i], D_8037DEC4[i].unk1C);
chBottlesBonus_func_802DD778(arg0, i, D_8037DEC4[i].unk0);
chBottlesBonusCursor_func_802DF460(i + 20, chBottlesBonusMarker, D_8037DEC4[i].unk0);
chBottlesBonusCursor_func_802DF460(i + CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT, chBottlesBonusMarker, D_8037DEC4[i].unk0);
}
}
if((actor->state == 4 || actor->state == 5)){
if (D_8037DEB4 == 0) {
D_8037DEB4 = 1;
for(i = 0; i < 20; i++){
for(i = 0; i < CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT; i++){
func_8033A57C(arg0, D_80368254[i], D_8037DEB8[i].unkC);
boneTransformList_getBoneScale(arg0, D_80368254[i], D_8037DEB8[i].unk1C);
chBottlesBonus_func_802DD778(arg0, i, D_8037DEB8[i].unk0);
@@ -315,7 +319,7 @@ void chBottlesBonus_func_802DD8AC(BoneTransformList *arg0, s32 arg1) {
}
}
for(i = 0; i < 20; i++){
for(i = 0; i < CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT; i++){
spD8[0] = 1.0f;
spD8[1] = 1.0f;
spD8[2] = 1.0f;
@@ -466,18 +470,18 @@ void chBottlesBonus_update(Actor *this) {
func_8034CF74(local, 0, D_8037DEAC, 0xF0);
}
func_8028746C(this->animctrl, chBottlesBonus_func_802DD8AC);
for(phi_s0 = 0; phi_s0 < 0x14; phi_s0++){
for(phi_s0 = 0; phi_s0 < CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT; phi_s0++){
func_8034DFB0(func_8034C2C4(this->marker, phi_s0 + 0x190), D_803682B4, D_803682A4, 0.0f);
}
D_8037DEB8 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1));
D_8037DEBC = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1));
D_8037DEC0 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1));
D_8037DEC4 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1));
D_8037DEB8 = (Struct_core2_560F0_1 *) malloc(CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT*sizeof(Struct_core2_560F0_1));
D_8037DEBC = (Struct_core2_560F0_1 *) malloc(CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT*sizeof(Struct_core2_560F0_1));
D_8037DEC0 = (Struct_core2_560F0_1 *) malloc(CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT*sizeof(Struct_core2_560F0_1));
D_8037DEC4 = (Struct_core2_560F0_1 *) malloc(CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT*sizeof(Struct_core2_560F0_1));
}
func_8034CF90(local, D_8037DEAC, 0xF0);
sp48 = chBottlesBonusCursor_func_802E06B4() - 1;
cursor_state = chBottlesBonusCursor_getState();
for(phi_s0_2 = 0; phi_s0_2 < 0x14; phi_s0_2++){
for(phi_s0_2 = 0; phi_s0_2 < CH_BOTTLES_BONUS_PUZZLE_PIECE_COUNT; phi_s0_2++){
sp40 = D_8037DF90[phi_s0_2];
temp_v0_2 = func_8034C2C4(this->marker, phi_s0_2 + 0x190);
if ((phi_s0_2 == sp48) && (cursor_state == 1) && !chBottlesBonusCursor_func_802E0538(phi_s0_2)) {
@@ -506,7 +510,7 @@ void chBottlesBonus_update(Actor *this) {
func_8025A6EC(COMUSIC_98_BBONUS_PIECES_SHUFFLE, -1);
comusic_8025AB44(COMUSIC_95_BBONUS_A, 0, 2000);
func_8025AABC(COMUSIC_95_BBONUS_A);
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_playAnimationOnce(this);
}
break;
@@ -535,7 +539,7 @@ void chBottlesBonus_update(Actor *this) {
}
}
break;
case 5:
case 5: //lose
break;
}//L802DE9A0
}
@@ -550,7 +554,7 @@ void __chBottlesBonus_spawn(void){
}
}
void chBottlesBonus_Spawn(s32 arg0, s32 arg1){
void chBottlesBonus_spawn(s32 arg0, s32 arg1){
if(chBottlesBonusMarker == NULL){
__spawnQueue_add_0(__chBottlesBonus_spawn);
}
@@ -579,7 +583,7 @@ s32 chBottlesBonus_getState(void){
return actor->state;
}
f32 *chBottlesBonus_func_802DEAF8(s32 arg0){
f32 *chBottlesBonus_get_piece_distance_vec4f(s32 arg0){ //returns distance vector of puzzle piece id
return D_8037DEBC[arg0].unkC;
}

View File

@@ -60,9 +60,9 @@ ActorInfo D_80368418 = {
};
/* .bss */
ActorMarker *chBottlesBonusSursorMarker;
ActorMarker *chBottlesBonusCursorMarker;
f32 D_8037E068[20][2];
Struct_core2_584D0_0 D_8037E248[20];
Struct_core2_584D0_0 D_8037E248[20]; //puzzle pieces
u8 pad_8037E478[0x140];
s32 D_8037E5B8;
struct {
@@ -124,7 +124,7 @@ bool chBottlesBonusCursor_checkPuzzleCompletion(void) {
for(i = 0; i < 20 && D_8037E5C0.is_completed != 0; i++){
if((D_8037E248[i].state != 3)
|| (i != D_8037E248[i].piece_id)
|| !vec4f_isAlmostZero(chBottlesBonus_func_802DEAF8(i))
|| !vec4f_isAlmostZero(chBottlesBonus_get_piece_distance_vec4f(i))
) {
D_8037E5C0.is_completed = FALSE;
}
@@ -132,10 +132,10 @@ bool chBottlesBonusCursor_checkPuzzleCompletion(void) {
if (D_8037E5C0.is_completed) {
item_set(ITEM_6_HOURGLASS, FALSE);
timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_94_BBONUS, 0, 2000);
timedFunc_set_2(0.3f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 22000);
timedFunc_set_0(1.5f, chBottlesBonusCursor_func_802DF99C);
timedFunc_set_0(1.0f, chBottlesBonus_completedPuzzle);
timedFunc_set_3(0.25f, (GenFunction_3)comusic_8025AB44, COMUSIC_94_BBONUS, 0, 2000);
timedFunc_set_2(0.3f, (GenFunction_2)func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 22000);
timedFunc_set_0(1.5f, (GenFunction_0)chBottlesBonusCursor_func_802DF99C);
timedFunc_set_0(1.0f, (GenFunction_0)chBottlesBonus_completedPuzzle);
}
return D_8037E5C0.is_completed;
}
@@ -145,9 +145,9 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
Actor *this;
f32 sp3C;
this = marker_getActorAndRotation(chBottlesBonusSursorMarker, &rotation);
this = marker_getActorAndRotation(chBottlesBonusCursorMarker, rotation);
modelRender_preDraw((GenFunction_1)actor_predrawMethod, (s32)this);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)chBottlesBonusSursorMarker);
modelRender_postDraw((GenFunction_1)actor_postdrawMethod, (s32)chBottlesBonusCursorMarker);
modelRender_setDepthMode(MODEL_RENDER_DEPTH_FULL);
actor_setOpacity(this, 0xB9);
func_8024E030(this->position, D_8037E5C0.unk18);
@@ -157,7 +157,7 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
(s32)sp3C, (s32)sp3C,
D_803A5D00[func_8024BDA0()]
);
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, func_80330B1C(chBottlesBonusSursorMarker));
modelRender_draw(gfx, mtx, this->position, rotation, this->scale, NULL, func_80330B1C(chBottlesBonusCursorMarker));
func_8024E030(this->position, D_8037E5C0.unk10);
if (this->state == 1) {
D_8037E5C0.unk10[0] -= 24.0f;
@@ -170,8 +170,8 @@ void chBottlesBonusCursor_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) {
ActorMarker *chBottlesBonusCursor_spawn(void){
Actor *this = func_8032813C(0x2B4, D_80368400, 0);
chBottlesBonusSursorMarker = this->marker;
return chBottlesBonusSursorMarker;
chBottlesBonusCursorMarker = this->marker;
return chBottlesBonusCursorMarker;
}
void chBottlesBonusCursor_func_802DF928(s32 indx) {
@@ -197,7 +197,7 @@ void chBottlesBonusCursor_freeMethod(Actor *this) {
gameFile_load(func_8034BAFC());
func_80347AA8();
}
chBottlesBonusSursorMarker = 0;
chBottlesBonusCursorMarker = 0;
}
void chBottlesBonusCursor_update(Actor *this) {
@@ -225,8 +225,8 @@ void chBottlesBonusCursor_update(Actor *this) {
D_8037E5B8 = -1;
D_8037E5C0.prev_button = sp5C->button;
D_8037E5C0.is_completed = 0;
timedFunc_set_2(3.0f, func_8025A6EC, COMUSIC_94_BBONUS, 0x5DC0);
timedFunc_set_1(3.0f, func_8025AABC, COMUSIC_94_BBONUS);
timedFunc_set_2(3.0f, (GenFunction_2)func_8025A6EC, COMUSIC_94_BBONUS, 0x5DC0);
timedFunc_set_1(3.0f, (GenFunction_1)func_8025AABC, COMUSIC_94_BBONUS);
for(i = 0; i < 20; i++){
bzero(&D_8037E248[i], sizeof(Struct_core2_584D0_0));
D_8037E068[40 + i][0] = D_8037E068[40 + i][1] = 0.0f;
@@ -275,7 +275,7 @@ void chBottlesBonusCursor_update(Actor *this) {
chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0);
chBottlesBonus_func_802DEA74(D_8037E5C0.unk0);
func_8030E58C(SFX_12D_CAMERA_ZOOM_CLOSEST, 0.9f);
func_80328B8C(this, 3, 0.0f, 1);
subaddie_set_state_with_direction(this, 3, 0.0f, 1);
actor_playAnimationOnce(this);
}
if((sp5C->button & R_CBUTTONS) && !(D_8037E5C0.prev_button & R_CBUTTONS)){
@@ -283,7 +283,7 @@ void chBottlesBonusCursor_update(Actor *this) {
chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0);
chBottlesBonus_func_802DEA74(D_8037E5C0.unk0);
func_8030E58C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.0f);
func_80328B8C(this, 4, 0.0f, 1);
subaddie_set_state_with_direction(this, 4, 0.0f, 1);
actor_playAnimationOnce(this);
}
}
@@ -303,7 +303,7 @@ void chBottlesBonusCursor_update(Actor *this) {
chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0);
chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0);
func_8025A6EC(COMUSIC_96_BBONUS_PICKUP_PIECE, -1);
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
}
}
@@ -312,7 +312,7 @@ void chBottlesBonusCursor_update(Actor *this) {
) {
if (D_8037E248[D_8037E5B8 - 41].state == 3) {
if( D_8037E5B8 - 41 != D_8037E248[D_8037E5B8 - 41].piece_id
|| !vec4f_isAlmostZero(chBottlesBonus_func_802DEAF8(D_8037E5B8 - 41))
|| !vec4f_isAlmostZero(chBottlesBonus_get_piece_distance_vec4f(D_8037E5B8 - 41))
) {
D_8037E5C0.unk0 = D_8037E5B8 - 41;
chBottlesBonus_func_802DEA50(D_8037E5C0.unk0);
@@ -320,7 +320,7 @@ void chBottlesBonusCursor_update(Actor *this) {
held_piece->state = 2;
chBottlesBonusCursor_func_802DF928(D_8037E5C0.unk0);
func_8030E484(SFX_112_TINKER_ATTENTION);
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
}
}
}
@@ -330,7 +330,7 @@ void chBottlesBonusCursor_update(Actor *this) {
case 2://L802E029C
if((sp5C->button & B_BUTTON) && !(D_8037E5C0.prev_button & B_BUTTON)){
held_piece->state = 0;
func_80328B8C(this, 5, 0.0f, 1);
subaddie_set_state_with_direction(this, 5, 0.0f, 1);
func_8025A6EC(COMUISC_97_BBONUS_DROP_PIECE, -1);
chBottlesBonus_func_802DEA50(D_8037E5C0.unk0);
D_8037E5C0.unk0 = -1;
@@ -341,64 +341,71 @@ void chBottlesBonusCursor_update(Actor *this) {
if ((D_8037E5B8 >= 21) && (D_8037E5B8 < 41)) {
held_piece->state = 3;
held_piece->piece_id = D_8037E5B8 - 21;
if ((D_8037E5C0.unk0 == held_piece->piece_id) && vec4f_isAlmostZero(chBottlesBonus_func_802DEAF8(D_8037E5C0.unk0))) {
if ((D_8037E5C0.unk0 == held_piece->piece_id) && vec4f_isAlmostZero(chBottlesBonus_get_piece_distance_vec4f(D_8037E5C0.unk0))) {
//placed correctly
sp44 = COMUSIC_2B_DING_B;
func_80328B8C(this, 6, 0.0f, 1);
subaddie_set_state_with_direction(this, 6, 0.0f, 1);
actor_playAnimationOnce(this);
} else {
//placed incorrectly
sp44 = COMUSIC_2C_BUZZER;
func_80328B8C(this, 1, 0.0f, 1);
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
}
if (chBottlesBonusCursor_checkPuzzleCompletion()) {
func_80328B8C(this, 8, 0.0f, 1);
subaddie_set_state_with_direction(this, 8, 0.0f, 1);
actor_playAnimationOnce(this);
}
timedFunc_set_2(0.25f, func_8025A6EC, sp44, 26000);
timedFunc_set_2(0.25f, (GenFunction_2)func_8025A6EC, sp44, 26000);
chBottlesBonus_func_802DEA50(D_8037E5C0.unk0);
D_8037E5C0.unk0 = -1;
}
}
break;
//rotate CCW
case 3://L802E0420
if (animctrl_isStopped(this->animctrl) ) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
break;
//rotate CW
case 4://L802E0450
if (animctrl_isStopped(this->animctrl) ) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
break;
case 7://L802E0480
if (animctrl_isStopped(this->animctrl) ) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
break;
case 5://L802E04B0
func_80328B8C(this, 1, 0.0f, 1);
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
break;
//placing correct piece
case 6://L802E04CC
if (actor_animationIsAt(this, 0.5f) != 0) {
FUNC_8030E624(SFX_6C_LOCKUP_CLOSING, 1.0f, 24000);
}
if (animctrl_isStopped(this->animctrl) != 0) {
func_80328B8C(this, 1, 0.0f, 1);
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
actor_loopAnimation(this);
}
break;
//puzzle complete
case 8://L802E0510
break;
case 9://L802E0510
break;
}
@@ -413,7 +420,7 @@ s32 chBottlesBonusCursor_func_802E0538(s32 indx){
s32 chBottlesBonusCursor_getState(void){
Actor *this;
this = marker_getActor(chBottlesBonusSursorMarker);
this = marker_getActor(chBottlesBonusCursorMarker);
return this->state;
}
@@ -423,13 +430,13 @@ s32 chBottlesBonusCursor_func_802E0588(s32 indx){
f32 *chBottlesBonusCursor_func_802E05AC(s32 indx) {
if (indx == D_8037E5C0.unk0) {
D_8037E5F8[0] = D_8036840C[0] + marker_getActor(chBottlesBonusSursorMarker)->position[0];
D_8037E5F8[1] = D_8036840C[1] + marker_getActor(chBottlesBonusSursorMarker)->position[1];
D_8037E5F8[2] = D_8036840C[2] + marker_getActor(chBottlesBonusSursorMarker)->position[2];
D_8037E5F8[0] = D_8036840C[0] + marker_getActor(chBottlesBonusCursorMarker)->position[0];
D_8037E5F8[1] = D_8036840C[1] + marker_getActor(chBottlesBonusCursorMarker)->position[1];
D_8037E5F8[2] = D_8036840C[2] + marker_getActor(chBottlesBonusCursorMarker)->position[2];
} else {
ml_vec3f_assign(&D_8037E5F8, 0, 0, 0);
ml_vec3f_assign(D_8037E5F8, 0, 0, 0);
}
return &D_8037E5F8;
return D_8037E5F8;
}
f32 *chBottlesBonusCursor_func_802E0664(s32 indx){
@@ -451,7 +458,7 @@ bool chBottlesBonusCursor_isPuzzleCompleted(void){
void chBottlesBonusCursor_lose(void){
Actor *this;
this = marker_getActor(chBottlesBonusSursorMarker);
func_80328B8C(this, 9, 0.0f, 1);
this = marker_getActor(chBottlesBonusCursorMarker);
subaddie_set_state_with_direction(this, 9, 0.0f, 1);
actor_playAnimationOnce(this);
}

View File

@@ -68,7 +68,7 @@ void func_802D77D4(Actor *this) {
case 1:
func_802D76E0(this, sp30);
ml_vec3f_copy(local->unk0, sp30);
func_80328A84(this, 2);
subaddie_set_state(this, 2);
return;
case 2:

View File

@@ -47,7 +47,7 @@ void chCollectible_setState(Actor *arg0, s32 next_state){
actor_collisionOn(arg0);
break;
}
func_80328A84(arg0, next_state);
subaddie_set_state(arg0, next_state);
}
void func_802D8C98(Actor *this, s32 arg1) {

View File

@@ -50,14 +50,14 @@ void __chCrab_802CB078(Actor *this) {
&& ( (this->modelCacheIndex == ACTOR_F2_BLACK_SNIPPET) || func_803292E0(this))
) {
this->unk28 = 0.0f;
func_80328A84(this, 3U);
subaddie_set_state(this, 3U);
}
}
}
}
void __chCrab_802CB140(Actor *this) {
func_80328A84(this, 2U);
subaddie_set_state(this, 2U);
__chCrab_802CB040(this);
func_80328CEC(this, (s32) this->yaw_ideal, 135, 175);
this->unk38_31 = 150;
@@ -70,7 +70,7 @@ void __chCrab_touch(ActorMarker *marker, ActorMarker *other){
if ((this->state == 4) && func_803294F0(this, 80, func_80329784(this))) {
FUNC_8030E8B4(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 28000, this->position, 950, 1900);
__chCrab_802CB140(this);
func_80328A84(this, 1);
subaddie_set_state(this, 1);
}
}
@@ -79,7 +79,7 @@ void __chCrab_ow(ActorMarker *marker, ActorMarker *other) {
this = marker_getActor(marker);
this->unk60 = 3.0f;
func_80328A84(this, 6);
subaddie_set_state(this, 6);
actor_playAnimationOnce(this);
if (marker->unk14_20 == MARKER_13_SNIPPET) {
FUNC_8030E8B4(SFX_6E_VILE_EGH, 2.0f, 26000, this->position, 950, 1900);
@@ -292,14 +292,14 @@ void chCrab_update(Actor *this) {
}
if (levelSpecificFlags_get(0xE)) {
if ((this->state != 8) && (this->state != 9)) {
func_80328B8C(this, (this->unk138_24) ? 8 : 9, 0.0f, 1);
subaddie_set_state_with_direction(this, (this->unk138_24) ? 8 : 9, 0.0f, 1);
this->unk138_24 = FALSE;
}
}
switch(this->state){
case 1: //L802CBE30
if (func_80328B38(this, 2, 0.03f)) {
if (subaddie_maybe_set_state(this, 2, 0.03f)) {
__chCrab_802CB040(this);
}
__chCrab_802CB078(this);
@@ -307,7 +307,7 @@ void chCrab_update(Actor *this) {
case 9: //L802CBE6C
if (!levelSpecificFlags_get(0xE)) {
func_80328B8C(this, 3, 0.0f, 1);
subaddie_set_state_with_direction(this, 3, 0.0f, 1);
}
break;
@@ -318,7 +318,7 @@ void chCrab_update(Actor *this) {
) {
func_80328CEC(this, (s32) this->yaw, 90, 150);
}
func_80328BD4(this, 1, 0.0f, 1, 0.0075f);
subaddie_maybe_set_state_position_direction(this, 1, 0.0f, 1, 0.0075f);
__chCrab_802CB078(this);
break;
@@ -326,7 +326,7 @@ void chCrab_update(Actor *this) {
this->yaw_ideal = (f32) func_80329784(this);
func_80328FB0(this, 4.0f);
if (func_80329480(this)) {
func_80328A84(this, 4);
subaddie_set_state(this, 4);
this->unk28 = 12.0f;
}
break;
@@ -335,10 +335,10 @@ void chCrab_update(Actor *this) {
this->yaw_ideal = func_80329784(this) + 90.0;
func_80328FB0(this, 4.0f);
if (func_80329480(this)) {
func_80328A84(this, 9);
subaddie_set_state(this, 9);
this->unk28 = 12.0f;
} else if (!levelSpecificFlags_get(0xE)) {
func_80328B8C(this, 3, 0.0f, 1);
subaddie_set_state_with_direction(this, 3, 0.0f, 1);
}
break;
@@ -355,7 +355,7 @@ void chCrab_update(Actor *this) {
case 5: //L802CC0AC
this->unk60 = MAX(0.0, this->unk60 - sp30);
if (this->unk60 == 0.0f) {
func_80328A84(this, 7);
subaddie_set_state(this, 7);
actor_playAnimationOnce(this);
if (this->marker->unk14_20 == 0x16B) {
this->marker->unk14_20 = MARKER_13_SNIPPET;
@@ -371,7 +371,7 @@ void chCrab_update(Actor *this) {
if (this->unk60 == 0.0f) {
func_80326310(this);
} else {
func_80328A84(this, 5);
subaddie_set_state(this, 5);
actor_loopAnimation(this);
}
}
@@ -379,7 +379,7 @@ void chCrab_update(Actor *this) {
case 7: //L802CC1E8
if (animctrl_isStopped(this->animctrl)) {
func_80328A84(this, 1);
subaddie_set_state(this, 1);
actor_loopAnimation(this);
}
break;

View File

@@ -315,7 +315,7 @@ void func_802C4C14(Actor *this){
func_802C7478(this);
if(!sp80){
if(this->state != 1){
func_80328A84(this, 1);
subaddie_set_state(this, 1);
}
}
else{//L802C4D24
@@ -373,7 +373,7 @@ void func_802C4C14(Actor *this){
}
}
func_802C4768(sp84);
func_80328A84(this, 2);
subaddie_set_state(this, 2);
break;
case 5://L802C5040
if(D_8037DD2C == 0 &&
@@ -383,7 +383,7 @@ void func_802C4C14(Actor *this){
func_802C4AC8(sp84);
func_8025A6EC(COMUSIC_2B_DING_B, 22000);
}
func_80328A84(this, 2);
subaddie_set_state(this, 2);
func_8031877C(chGameSelectTopZoombox);
func_80318284(chGameSelectTopZoombox, 2, &D_8037DCE0);
D_8037DD34 = 0.0f;
@@ -417,7 +417,7 @@ void func_802C4C14(Actor *this){
func_8031877C(chGameSelectTopZoombox);
func_803183A4(chGameSelectTopZoombox, (&D_80365DFC)[func_8031B5B0()]);
D_8037DD2C = 1;
func_80328A84(this, 5);
subaddie_set_state(this, 5);
}
else{//L802C5240
func_8025A6EC(COMUSIC_2C_BUZZER, 22000);
@@ -445,16 +445,16 @@ void func_802C4C14(Actor *this){
func_8030E540(SFX_8F_SNOWBALL_FLYING);
break;
}//L802C5394
func_80328A84(this, 4);
subaddie_set_state(this, 4);
levelSpecificFlags_set(sp84 + 0x35, 1);
}
else{//L802C53B4
func_8030E484(SFX_3EA_UNKNOWN);
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}
}else{//L802C53D0
func_8030E510(SFX_4F_BANJO_WAHOO, 28000);
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}//L802C53E8
if(sp84 == 0)
func_802C75A0(this, 2);

View File

@@ -76,7 +76,7 @@ void func_8035B1CC(ActorMarker *this_marker, ActorMarker *other_marker){
sp30 = this->scale;
func_8030E878(SFX_121_AWAWAU, 1.3f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
func_8030E878(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
func_80328B8C(this, 6, 0.01f, 1);
subaddie_set_state_with_direction(this, 6, 0.01f, 1);
actor_playAnimationOnce(this);
actor_collisionOff(this);
func_80326310(this);
@@ -88,7 +88,7 @@ void func_8035B2C4(ActorMarker *this_marker, ActorMarker *other_marker){
f32 sp30 = this->scale;
func_8030E878(SFX_121_AWAWAU, 1.3f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
func_8030E878(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
func_80328B8C(this, 6, 0.01f, 1);
subaddie_set_state_with_direction(this, 6, 0.01f, 1);
actor_playAnimationOnce(this);
actor_collisionOff(this);
func_8035AFE0(sp30, this->position, 8, ASSET_700_SPRITE_DUST, D_80372C6C);
@@ -160,21 +160,21 @@ void func_8035B56C(Actor *this){
void func_8035B674(Actor *this){
ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local;
func_80328B8C(this, 1, 0.01f, 1);
subaddie_set_state_with_direction(this, 1, 0.01f, 1);
actor_loopAnimation(this);
local->unk0 = randf2(1.0f, 4.5f);
}
void func_8035B6CC(Actor *this){
func_80328B8C(this, 2, 0.01f, 1);
subaddie_set_state_with_direction(this, 2, 0.01f, 1);
actor_playAnimationOnce(this);
this->unk28 = 1.0f;
func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
}
void func_8035B75C(Actor *this){
func_80328B8C(this, 3, 0.01f, 1);
subaddie_set_state_with_direction(this, 3, 0.01f, 1);
actor_loopAnimation(this);
this->unk28 = func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE) ? 0.0 : 12.0;
func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f);
@@ -183,7 +183,7 @@ void func_8035B75C(Actor *this){
void func_8035B824(Actor *this){
ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local;
func_80328B8C(this, 4, 0.01f, 1);
subaddie_set_state_with_direction(this, 4, 0.01f, 1);
actor_loopAnimation(this);
func_80328CEC(this, (s32)this->yaw_ideal, 0xA, 0x1E);
this->unk28 = 4.0f;
@@ -193,7 +193,7 @@ void func_8035B824(Actor *this){
}
void func_8035B8A8(Actor *this){
func_80328B8C(this, 5, 0.01f, 1);
subaddie_set_state_with_direction(this, 5, 0.01f, 1);
actor_loopAnimation(this);
func_80328CEC(this, (s32)this->yaw_ideal, 0xE1, 0x87);
}
@@ -314,12 +314,12 @@ void func_8035BD48(Actor *this){
marker_despawn(this->marker);
}
else{//L8035BE04
func_80328B8C(this, 1, 0.01f, 1);
subaddie_set_state_with_direction(this, 1, 0.01f, 1);
actor_setOpacity(this, 0);
}
}
else{//L8035BE2C
func_80328B8C(this, 3, 0.01f, 1);
subaddie_set_state_with_direction(this, 3, 0.01f, 1);
actor_setOpacity(this, 0xff);
}
}//L8035BE50
@@ -331,7 +331,7 @@ void func_8035BD48(Actor *this){
marker_despawn(this->marker);
}
else if(mapSpecificFlags_getClear(3)){
func_80328B8C(this, 3, 0.01f, 1);
subaddie_set_state_with_direction(this, 3, 0.01f, 1);
}
break;
case 3: //L8035BECC
@@ -360,7 +360,7 @@ void func_8035BD48(Actor *this){
marker_despawn(this->marker);
}
else{
func_80328B8C(this, 1, 0.01f, 1);
subaddie_set_state_with_direction(this, 1, 0.01f, 1);
timedFunc_set_2(randf2(5.0f, 10.0f), mapSpecificFlags_set, 3, TRUE);
}
}

View File

@@ -56,7 +56,7 @@ void chgloop_update(Actor *this){
case 2://L802D14DC
actor_loopAnimation(this);
if(this->unk54 != 0.0f)
func_80328A84(this, 4);
subaddie_set_state(this, 4);
if( !mapSpecificFlags_get(2)
&& func_80329530(this, 350)
@@ -69,7 +69,7 @@ void chgloop_update(Actor *this){
case 4://L802D1558
actor_playAnimationOnce(this);
if(this->unk54 == 0.0f)
func_80328A84(this, 2);
subaddie_set_state(this, 2);
if(actor_animationIsAt(this, 0.6f)){
if(this->marker->unk14_21){

View File

@@ -97,14 +97,14 @@ void func_8035EE48(Actor *this){
}
void func_8035EE80(Actor *this){
func_80328A84(this, 3);
subaddie_set_state(this, 3);
actor_loopAnimation(this);
this->unk28 = 10.5f;
func_8035EE48(this);
}
void func_8035EEC0(Actor *this){
func_80328A84(this, 4);
subaddie_set_state(this, 4);
actor_loopAnimation(this);
this->unk28 = 9.0f;
func_8035EE48(this);
@@ -130,7 +130,7 @@ void func_8035EF9C(ActorMarker *marker, ActorMarker *other_marker) {
this = marker_getActor(marker);
local = (ActorLocal_core2_D7D10 *)&this->local;
this->velocity[2] = 0.0f;
func_80328B8C(this, 7, 0.02f, 1);
subaddie_set_state_with_direction(this, 7, 0.02f, 1);
actor_playAnimationOnce(this);
local->unk0 = 2;
actor_collisionOff(this);
@@ -149,7 +149,7 @@ void func_8035F048(ActorMarker *marker, ActorMarker *other_marker) {
FUNC_8030E8B4(SFX_F9_GRUNTLING_NOISE_1, 1.2f, 22000, this->position, 1750, 3500);
FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, this->position, 1750, 3500);
this->velocity[2] = 0.0f;
func_80328B8C(this, 6, 0.02f, 1);
subaddie_set_state_with_direction(this, 6, 0.02f, 1);
actor_playAnimationOnce(this);
local->unk0 = 2;
func_8035EE48(this);
@@ -199,7 +199,7 @@ void func_8035F138(Actor *this) {
}
animctrl_setAnimTimer(this->animctrl, 0.0f);
if (func_80329530(this, (s32) (this->scale * 650.0f)) && func_803292E0(this)) {
func_80328A84(this, 2U);
subaddie_set_state(this, 2U);
actor_playAnimationOnce(this);
this->unk1C[1] = 1.0f;
this->unk44_31 = func_8030ED2C(SFX_2C_PULLING_NOISE, 3);
@@ -251,7 +251,7 @@ void func_8035F138(Actor *this) {
}
this->unk38_31 -= sp2C;
if (func_8035ED60(this)) {
func_80328B8C(this, 5, 0.99f, 0);
subaddie_set_state_with_direction(this, 5, 0.99f, 0);
actor_playAnimationOnce(this);
this->unk28 = 0.0f;
this->unk1C[1] = 1.9f;
@@ -275,7 +275,7 @@ void func_8035F138(Actor *this) {
func_8030DBB4(this->unk44_31, this->unk1C[1]);
}
if (animctrl_getAnimTimer(this->animctrl) <= 0.02) {
func_80328B8C(this, 1, 0.02f, 1);
subaddie_set_state_with_direction(this, 1, 0.02f, 1);
actor_playAnimationOnce(this);
this->unk28 = 0.0f;
func_8035EE48(this);

View File

@@ -232,20 +232,20 @@ void __chicecube_die(ActorMarker *marker, ActorMarker *other_marker){
}
void func_8035A998(Actor *this){
func_80328B8C(this, 1, 0.0001f, 1);
subaddie_set_state_with_direction(this, 1, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk38_31 = 0;
}
void func_8035A9E0(Actor *this){
func_80328B8C(this, 3, animctrl_getAnimTimer(this->animctrl), 1);
subaddie_set_state_with_direction(this, 3, animctrl_getAnimTimer(this->animctrl), 1);
actor_loopAnimation(this);
this->unk38_31 = 1;
this->unk28 = 0.0f;
}
void func_8035AA40(Actor *this){
func_80328B8C(this, 5, 0.9999f, 0);
subaddie_set_state_with_direction(this, 5, 0.9999f, 0);
actor_playAnimationOnce(this);
this->unk38_31 = 1;
}
@@ -305,7 +305,7 @@ void chicecube_update(Actor *this){
if( func_80359DF4(this, 900)
|| (this->unkF4_8 == 2 && func_803203FC(UNKFLAGS1_C1_IN_FINAL_CHARACTER_PARADE))
){
func_80328B8C(this, 2, 0.0001f, 1);
subaddie_set_state_with_direction(this, 2, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk38_31 = 0x1;
}
@@ -330,7 +330,7 @@ void chicecube_update(Actor *this){
}
func_8035A694(this);
if(!func_80359DF4(this, 1300)){
func_80328B8C(this, 4, animctrl_getAnimTimer(this->animctrl), 1);
subaddie_set_state_with_direction(this, 4, animctrl_getAnimTimer(this->animctrl), 1);
actor_loopAnimation(this);
this->unk38_31 = 1;
}

View File

@@ -142,7 +142,7 @@ void chjiggy_update(Actor *this){
marker_despawn(this->marker);
}
else{
func_80328A84(this, 2);
subaddie_set_state(this, 2);
switch(chjiggy_getJiggyId(this)){
case JIGGY_17_CC_CLANKER_RAISED: //L802C7EF8
case JIGGY_49_CCW_EYRIE:// L802C7EF8

View File

@@ -81,15 +81,15 @@ void chJigsawDance_setState(Actor * this, u32 arg1){
switch(arg1){
case 3:
if(this->state == 1){
func_80328A84(this, 2);
subaddie_set_state(this, 2);
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE);
}
break;
case 2:
func_80328A84(this, 3);
subaddie_set_state(this, 3);
break;
case 1:
func_80328A84(this, 4);
subaddie_set_state(this, 4);
break;
case 4:
player_getPosition(this->position);
@@ -100,7 +100,7 @@ void chJigsawDance_setState(Actor * this, u32 arg1){
animctrl_start(this->animctrl, "chjigsawdance.c", 0x97);
break;
case 5:
func_80328A84(this, 5);
subaddie_set_state(this, 5);
this->marker->propPtr->unk8_4 = 0;
break;
}

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void func_80328B8C(Actor *, s32, f32 , s32);
extern void subaddie_set_state_with_direction(Actor *, s32, f32 , s32);
extern f32 func_80309B24(f32*);
extern void func_80329904(ActorMarker*, s32, f32*);
extern void func_80326310(Actor *);
@@ -50,7 +50,7 @@ void __chJinjo_802CDBA8(ActorMarker *this, ActorMarker *other){
func_80311480(__chJinjo_getMeetDialogId(actorPtr->marker->unk14_20), 4, 0, 0, 0, 0);
fileProgressFlag_set(FILEPROG_E_JINJO_TEXT, 1);
}
func_80328B8C(actorPtr, 6, 0.0f , -1);
subaddie_set_state_with_direction(actorPtr, 6, 0.0f , -1);
if(func_803463D4(ITEM_12_JINJOS, 1 << (this->unk14_20 + 6) ) == 0x1f)
localPtr->unk4 = 1;
actor_loopAnimation(actorPtr);
@@ -128,9 +128,9 @@ void chJinjo_update(Actor * this){
case 1:
if(randf() < 0.015){
if(sp60){
func_80328B8C(this, 3, 0.0f, -1);
subaddie_set_state_with_direction(this, 3, 0.0f, -1);
}else{
func_80328B8C(this, 2, 0.0f, -1);
subaddie_set_state_with_direction(this, 2, 0.0f, -1);
}
actor_playAnimationOnce(this);
}//L802CDF24
@@ -139,13 +139,13 @@ void chJinjo_update(Actor * this){
case 2: /* 46FA0 802CDF30 3C053F7D */
case 3:
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 1, 0.0f, -1);
subaddie_set_state_with_direction(this, 1, 0.0f, -1);
}
break;
case 4: /* 46FD8 802CDF68 3C053F7D */
if(actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 1, 0.0f, -1);
subaddie_set_state_with_direction(this, 1, 0.0f, -1);
}else{//L802CDF9C
tmp_f0 = this->yaw;
if(sp66 >= 0){
@@ -165,7 +165,7 @@ void chJinjo_update(Actor * this){
case 6:/* 47094 802CE024 02002025 */
__chJinjo_802CDC9C(this, sp66);
if(actor_animationIsAt(this, 0.0f) && --(local->unk0) == 0){
func_80328B8C(this, 7, 0.0f, -1);
subaddie_set_state_with_direction(this, 7, 0.0f, -1);
actor_playAnimationOnce(this);
if(local->unk4){
sp40[0] = this->position_x;
@@ -270,14 +270,14 @@ void chJinjo_update(Actor * this){
if(sp50){
if(actor_animationIsAt(this, 0.96f) || actor_animationIsAt(this, 0.99f)){
func_80328B8C(this, 8, 0.0f, -1);
subaddie_set_state_with_direction(this, 8, 0.0f, -1);
actor_playAnimationOnce(this);
}
}
break;
}//L802CE5F0
if(this->state < 4 && !(((sp66 >= 0)? sp66: -sp66) <= 0x1000)){
func_80328B8C(this, 4, 0.0f, -1);
subaddie_set_state_with_direction(this, 4, 0.0f, -1);
actor_playAnimationOnce(this);
}//L802CE630
if(!func_803114B0()){

View File

@@ -117,9 +117,9 @@ void func_802D9530(Actor *this){
Actor *other = subaddie_getLinkedActor(this);
if(this->unk100 && other){
if(this->unk100->unk14_20 == 0xB8)
func_80328B8C(other, 3, 0.0001f, 1);
subaddie_set_state_with_direction(other, 3, 0.0001f, 1);
}
func_80328B8C(this, 4, 0.0001f, 1);
subaddie_set_state_with_direction(this, 4, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
@@ -131,7 +131,7 @@ void func_802D9530(Actor *this){
void func_802D9600(Actor * this){
animctrl_setSmoothTransition(this->animctrl, 0);
func_80328B8C(this, 1, 0.0001f, 1);
subaddie_set_state_with_direction(this, 1, 0.0001f, 1);
this->marker->propPtr->unk8_3 = 0;
}
@@ -232,11 +232,11 @@ int func_802D997C(Actor *this){
void func_802D9ADC(Actor *this){
Actor *other = subaddie_getLinkedActor(this);
if(this->unk100 && other && this->unk100->unk14_20 == 0xB8){
func_80328B8C(other, 2, 0.0001f, 1);
subaddie_set_state_with_direction(other, 2, 0.0001f, 1);
}
this->marker->propPtr->unk8_3 = 1;
animctrl_setSmoothTransition(this->animctrl, TRUE);
func_80328B8C(this, 2, 0.0001f, 1);
subaddie_set_state_with_direction(this, 2, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
@@ -248,14 +248,14 @@ void func_802D9ADC(Actor *this){
}
void func_802D9BD8(Actor *this){
func_80328A84(this, 5);
subaddie_set_state(this, 5);
func_802D9658(this);
func_8028F94C(2, this->position);
func_802D997C(this);
}
void func_802D9C1C(Actor *this){
func_80328B8C(this, 3, 0.0001f, 1);
subaddie_set_state_with_direction(this, 3, 0.0001f, 1);
actor_loopAnimation(this);
}
@@ -310,7 +310,7 @@ void func_802D9D60(Actor *this){
if(this->unk100){
other = subaddie_getLinkedActor(this);
if(other && this->unk100->unk14_20 == 0xB8){
func_80328A84(other, 1);
subaddie_set_state(other, 1);
}
}
}

View File

@@ -79,7 +79,7 @@ void func_802DA740(Actor *this){
break;
case 2: //L802DA7C4
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 1, 0.0001f, 1);
subaddie_set_state_with_direction(this, 1, 0.0001f, 1);
}
else{
if(local->unk0 && actor_animationIsAt(this, 0.05f)){
@@ -89,7 +89,7 @@ void func_802DA740(Actor *this){
break;
case 3: //L802DA838
if(actor_animationIsAt(this, 0.9999f)){
func_80328B8C(this, 1, 0.0001f, 1);
subaddie_set_state_with_direction(this, 1, 0.0001f, 1);
}
else if(local->unk0){
if(actor_animationIsAt(this, 0.3f)){

View File

@@ -23,7 +23,7 @@ ActorInfo D_80368174 = {
};
/* .bss */
ActorMarker *D_8037DE90;
ActorMarker *chOverlayNoController_marker;
/* .code */
Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){
@@ -53,7 +53,7 @@ Actor *chOverlayNoController_draw(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vt
}
void chOverlayNoController_freeMethod(Actor *this){
D_8037DE90 = NULL;
chOverlayNoController_marker = NULL;
}
void chOverlayNoController_update(Actor *this) {
@@ -61,24 +61,24 @@ void chOverlayNoController_update(Actor *this) {
this->initialized = TRUE;
this->depth_mode = MODEL_RENDER_DEPTH_NONE;
actor_collisionOff(this);
func_80328B8C(this, 1, 0.0f, 1);
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
actor_playAnimationOnce(this);
marker_setFreeMethod(this->marker, chOverlayNoController_freeMethod);
}
if (animctrl_isStopped(this->animctrl) != 0) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
}
void __chOverlayNoController_spawn(void){
if(D_8037DE90 == NULL){
D_8037DE90 = func_8032813C(ACTOR_1DF_NO_CONTROLLER_OVERLAY, D_80368168, 0)->marker;
if(chOverlayNoController_marker == NULL){
chOverlayNoController_marker = func_8032813C(ACTOR_1DF_NO_CONTROLLER_OVERLAY, D_80368168, 0)->marker;
}
}
void chOverlayNoController_spawn(s32 arg0, s32 arg1){
if(D_8037DE90 == NULL){
if(chOverlayNoController_marker == NULL){
__spawnQueue_add_0(__chOverlayNoController_spawn);
}
}
@@ -86,7 +86,7 @@ void chOverlayNoController_spawn(s32 arg0, s32 arg1){
void chOverlayNoController_func_802DD040(s32 arg0, s32 arg1) {
ActorMarker *temp_a0;
temp_a0 = D_8037DE90;
temp_a0 = chOverlayNoController_marker;
if (temp_a0 != 0) {
func_80326310(marker_getActor(temp_a0));
}

View File

@@ -2,7 +2,7 @@
#include "functions.h"
#include "variables.h"
extern void func_80328B8C(Actor *, s32, f32, s32);
extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
extern void actor_predrawMethod(Actor *);
extern void actor_postdrawMethod(ActorMarker *);
extern Actor *func_8032813C(enum actor_e id, f32[3], s32);
@@ -72,13 +72,13 @@ void chOverlayPressStart_update(Actor *this){
this->initialized = 1;
this->depth_mode = MODEL_RENDER_DEPTH_NONE;
actor_collisionOff(this);
func_80328B8C(this, 1, 0.0f, 1);
subaddie_set_state_with_direction(this, 1, 0.0f, 1);
actor_playAnimationOnce(this);
marker_setFreeMethod(this->marker, chOverlayPressStart_func_802DCC78);
}
if(animctrl_isStopped(this->animctrl)){
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
}

View File

@@ -36,13 +36,13 @@ void chShrapnel_func_802D0A38(Actor *this){
else{
if(func_80329530(this, 600) && func_803292E0(this)){
this->unk28 = 0.0f;
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
}
}
}
void chShrapnel_func_802D0AB8(Actor *this) {
func_80328B8C(this, 1, 0.0f, 0);
subaddie_set_state_with_direction(this, 1, 0.0f, 0);
chShrapnel_func_802D0A00(this);
func_80328CEC(this, (s32) this->yaw_ideal, 0x87, 0xAF);
this->unk38_31 = 0x1E;
@@ -167,7 +167,7 @@ void chshrapnel_update(Actor *this) {
func_80328FB0(this, 4.0f);
if (func_80329480(this)) {
if (250.0 > ABS(player_position[1] - this->unk1C[1])) {
func_80328A84(this, 3);
subaddie_set_state(this, 3);
actor_loopAnimation(this);
FUNC_8030E8B4(SFX_C4_TWINKLY_MUNCHER_GRR, 0.6f, 32750, this->position, 1250, 2500);
this->unk28 = 4.0f;

View File

@@ -70,7 +70,7 @@ void __chSnowball_collisionCallback(Actor *this, bool water_collision) {
func_8030E878(SFX_F_SMALL_WATER_SPLASH, randf2(0.8f, 1.2f), 32000, this->position, 1250.0f, 2500.0f);
actor_collisionOff(this);
func_80326310(this);
func_80328A84(this, 2U);
subaddie_set_state(this, 2U);
}
else{
func_8030E878(SFX_2F_ORANGE_SPLAT, 1.0f, 32000, this->position, 1250.0f, 2500.0f);

View File

@@ -4,7 +4,7 @@
extern int func_802592C4(f32[3], f32[3], f32);
extern void func_802EFA20(ParticleEmitter *, f32, f32);
extern void func_80328B8C(Actor *, s32, f32, s32);
extern void subaddie_set_state_with_direction(Actor *, s32, f32, s32);
extern void func_80328FB0(Actor *, f32);
extern void func_803300C0(ActorMarker *, void *);
@@ -133,13 +133,13 @@ void __chSnowman_spawnSnowballParticles(f32 position[3], s32 count){
void __chSnowman_enterIdle(Actor *this){
ActorLocal_chSirSlush *local = (ActorLocal_chSirSlush *) &this->local;
func_80328B8C(this, CHSNOWMAN_STATE_1_IDLE, 0.01f, 1);
subaddie_set_state_with_direction(this, CHSNOWMAN_STATE_1_IDLE, 0.01f, 1);
actor_loopAnimation(this);
local->unk4 = 0.4f;
}
void __chSnowman_enterDeath(Actor *this){
func_80328B8C(this, CHSNOWMAN_STATE_3_DIE, 0.01f, 1);
subaddie_set_state_with_direction(this, CHSNOWMAN_STATE_3_DIE, 0.01f, 1);
actor_playAnimationOnce(this);
}
@@ -272,7 +272,7 @@ void chSnowman_update(Actor *this){
&& func_8028EE84() != BSWATERGROUP_2_UNDERWATER
&& !__chSnowman_CCW_playerInProtectedZone()
){
func_80328B8C(this, CHSNOWMAN_STATE_2_ATTACK, 0.01f, 1);
subaddie_set_state_with_direction(this, CHSNOWMAN_STATE_2_ATTACK, 0.01f, 1);
actor_playAnimationOnce(this);
}
}

View File

@@ -27,7 +27,7 @@ void chSnowmanHat_update(Actor *this){
this->pitch -= 360.0f;
if(this->position_y <= func_80309724(this->position)){
func_80328A84(this, 2);
subaddie_set_state(this, 2);
FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 32750, this->position, 2250, 4500);
}
break;

View File

@@ -121,7 +121,7 @@ void __chTermite_ow(ActorMarker *marker, ActorMarker *other_marker){
Actor *this;
this = marker_getActor(marker);
func_80328AC8(this, 6);
subaddie_set_state_forward(this, 6);
}
void __chTermite_die(ActorMarker *marker, ActorMarker *other_marker){
@@ -187,7 +187,7 @@ void chTermite_update(Actor *this) {
}
switch (this->state) {
case 1:
if (func_80328BD4(this, 2, 0.0f, 1, 0.06f)) {
if (subaddie_maybe_set_state_position_direction(this, 2, 0.0f, 1, 0.06f)) {
__chTermite_updateRandomRotationSpeed(this);
__chTermite_updateRandomSpeed(this);
this->unk28 = 0.0f;
@@ -222,11 +222,11 @@ void chTermite_update(Actor *this) {
}
__chTermite_updateAnimationSpeed(this);
func_80329030(this, 0);
func_80328BD4(this, 1, 0.0f, 1, 0.047f);
subaddie_maybe_set_state_position_direction(this, 1, 0.0f, 1, 0.047f);
return;
case 6:
if (actor_animationIsAt(this, 0.95f) != 0) {
func_80328AC8(this, 1);
subaddie_set_state_forward(this, 1);
}
break;
}

View File

@@ -67,7 +67,7 @@ void chtrainers_update(Actor *this){
this->velocity[0] = this->yaw;
this->velocity[1] = 0.0f;
this->unk10_12 = !func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE) && !func_803203FC(0x1);
func_80328A84(this, 0);
subaddie_set_state(this, 0);
}
if(!func_803203FC(0xF) && ability_isUnlocked(ABILITY_11_TURBO_TALON)){
@@ -92,14 +92,14 @@ void chtrainers_update(Actor *this){
case 1://L802CA630
this->velocity[2] -= time_getDelta();
if(this->velocity[2] <= 0.0f){
func_80328A84(this, 2);
subaddie_set_state(this, 2);
}
break;
case 2://L802CA670
if(player_stateTimer_get(STATE_TIMER_3_TURBO_TALON) == 0.0f){
this->velocity[2] = 1.0f;
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}
break;
@@ -107,7 +107,7 @@ void chtrainers_update(Actor *this){
this->velocity[2] -= time_getDelta();
if(this->velocity[2] <= 0.0f){
this->unk10_12 = 1;
func_80328A84(this, 0);
subaddie_set_state(this, 0);
}
break;
}//L802CA6F8
@@ -122,7 +122,7 @@ f32 chtrainers_getDuration(Actor *this){
}
void chtrainers_pickup(Actor *this){
func_80328A84(this, 1);
subaddie_set_state(this, 1);
this->velocity[2] = 1.0f;
this->unk10_12 = 0;
}

View File

@@ -42,7 +42,7 @@ void chwadingboots_update(Actor *this){
this->initialized = TRUE;
this->velocity[0] = this->yaw;
this->unk10_12 = !func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE) && !func_803203FC(0x1);
func_80328A84(this, 0);
subaddie_set_state(this, 0);
}
if(!func_803203FC(0x10) && ability_isUnlocked(ABILITY_E_WADING_BOOTS)){
@@ -78,14 +78,14 @@ void chwadingboots_update(Actor *this){
case 1://L802D6D34
this->velocity[1] -= time_getDelta();
if(this->velocity[1] <= 0.0f){
func_80328A84(this, 2);
subaddie_set_state(this, 2);
}
break;
case 2://L802D6D74
if(player_stateTimer_get(STATE_TIMER_2_LONGLEG) == 0.0f){
this->velocity[1] = 1.5f;
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}
break;
@@ -93,7 +93,7 @@ void chwadingboots_update(Actor *this){
this->velocity[1] -= time_getDelta();
if(this->velocity[1] <= 0.0f){
this->unk10_12 = 1;
func_80328A84(this, 0);
subaddie_set_state(this, 0);
}
break;
}//L802D6DFC
@@ -108,7 +108,7 @@ f32 chwadingboots_802D6E4C(Actor *this){
}
void chwadingboots_802D6E54(Actor *this){
func_80328A84(this, 1);
subaddie_set_state(this, 1);
this->velocity[1] = 1.5f;
this->unk10_12 = 0;
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
extern void func_802F494C(void *, f32);
extern void func_802F4884(void *, s32, f32);
@@ -43,7 +44,7 @@ void func_8029AA3C(void){
else
func_8029C304(2);
sp30 = ml_map_f(_get_horzVelocity(), 0.0f, 500.0f, 70.0f, 250.0f);
sp30 = ml_map_f(baphysics_get_horizontal_velocity(), 0.0f, 500.0f, 70.0f, 250.0f);
func_8028E9C4(D_8037D194, sp34);
sp34[1] = func_80294500();
pCtrl = func_802F4094(sp34, 8.0f);

View File

@@ -4,6 +4,7 @@
#include "core2/yaw.h"
#include "core2/statetimer.h"
#include "core2/ba/anim.h"
#include "core2/ba/physics.h"
f32 func_8024DDD8(f32[3], f32);
extern void func_8024E71C(s32, f32*);
@@ -623,12 +624,12 @@ void func_8029C22C(void) {
return;
D_80364620 = D_80364620 ? FALSE : TRUE;
if (_get_horzVelocity() > 100.0f) {
if (baphysics_get_horizontal_velocity() > 100.0f) {
if (D_80364620) {
func_80292864(func_80297A7C() - 20.0f, 20.0f);
func_80292864(baphysics_get_target_yaw() - 20.0f, 20.0f);
}
else{
func_80292864(func_80297A7C() + 20.0f, 20.0f);
func_80292864(baphysics_get_target_yaw() + 20.0f, 20.0f);
}
}
}
@@ -660,7 +661,7 @@ void func_8029C3E8(f32 arg0, f32 arg1) {
f32 sp28;
_player_getPosition(sp30);
sp28 = ml_map_f(_get_horzVelocity(), 0.0f, 1000.0f, arg0, arg1);
sp28 = ml_map_f(baphysics_get_horizontal_velocity(), 0.0f, 1000.0f, arg0, arg1);
sp2C = player_getYaw();
func_802589E4(sp3C, sp2C, sp28);
sp3C[1] = 0.0f;
@@ -764,11 +765,11 @@ enum bs_e func_8029C780(void){
return BS_5_JUMP;
}
void func_8029C7F4(enum baanim_update_type_e arg0, enum yaw_state_e yaw_state, s32 arg2, s32 arg3){
void func_8029C7F4(enum baanim_update_type_e arg0, enum yaw_state_e yaw_state, s32 arg2, BaPhysicsType arg3){
baanim_setUpdateType(arg0);
yaw_setUpdateState(yaw_state);
func_8029957C(arg2);
func_802978DC(arg3);
baphysics_set_type(arg3);
}
void func_8029C834(enum map_e map_id, s32 exit_id){

View File

@@ -4,46 +4,66 @@
#include "animation.h"
typedef struct animation_file_cache_s{
AnimationFile *ptr;
u16 exp_timer:15;
u16 persist:1;
u8 pad6[2];
}AnimationFileCache;
AnimationFile *animBinCache_get(enum asset_e assest_id);
/* .data */
s16 D_803635C0[] = {0x1, 0x3, 0x5, 0xC, 0xE, 0x17, 0x18, 0x19, 0x1A, 0x1C, 0x1D, 0};
s16 animBinCache_persistantList[] = {
ASSET_1_ANIM_BSCROUCH_ENTER,
ASSET_3_ANIM_BSWALK,
ASSET_5_ANIM_BSPUNCH,
ASSET_C_ANIM_BSWALK_RUN,
ASSET_E_ANIM_BSTURN,
ASSET_17_ANIM_BSBFLAP,
ASSET_18_ANIM_BSBFLAP_ENTER,
ASSET_19_ANIM_BSBPECK_ENTER,
ASSET_1A_ANIM_BSBPECK,
ASSET_1C_ANIM_BSBBARGE,
ASSET_1D_ANIM_BSBBUSTER,
0
};
/* .bss */
AnimationFileCache D_8037A8C0[0x2CA];
AnimationFileCache animBinCache[0x2CA];
/* .code */
void func_802884E0(void){
static void __animBinCache_initPersistent(void){
s16 *phi_v0;
for( phi_v0 = D_803635C0; *phi_v0 != 0; phi_v0++){
D_8037A8C0[*phi_v0].unk4_0 = 1;
for( phi_v0 = animBinCache_persistantList; *phi_v0 != 0; phi_v0++){
animBinCache[*phi_v0].persist = 1;
}
}
void animBinCache_loadAll(void){
static void __animBinCache_loadAll(void){
s32 i;
for(i = 0; i < 0x2CA; i++){
if(D_8037A8C0[i].unk4_0){
if(animBinCache[i].persist){
animBinCache_get(i);
}
}
}
AnimationFile *animBinCache_get(enum asset_e asset_id){
if(!D_8037A8C0[asset_id].unk0){
D_8037A8C0[asset_id].unk0 = (AnimationFile *) assetcache_get(asset_id);
if(animBinCache[asset_id].ptr == NULL){
animBinCache[asset_id].ptr = (AnimationFile *) assetcache_get(asset_id);
}
D_8037A8C0[asset_id].unk4_15 = 30;
return D_8037A8C0[asset_id].unk0;
animBinCache[asset_id].exp_timer = 30;
return animBinCache[asset_id].ptr;
}
void animBinCache_free(void){
s32 i;
for(i = 0; i < 0x2CA; i++){
if(D_8037A8C0[i].unk0){
assetcache_release(D_8037A8C0[i].unk0);
if(animBinCache[i].ptr){
assetcache_release(animBinCache[i].ptr);
}
}
}
@@ -51,30 +71,35 @@ void animBinCache_free(void){
void animBinCache_init(void){
s32 i = 0;
for(i = 0; i < 0x2CA; i++){
D_8037A8C0[i].unk0 = NULL;
D_8037A8C0[i].unk4_15 = 0;
D_8037A8C0[i].unk4_0 = 0;
animBinCache[i].ptr = NULL;
animBinCache[i].exp_timer = 0;
animBinCache[i].persist = 0;
}
func_802884E0();
animBinCache_loadAll();
__animBinCache_initPersistent();
__animBinCache_loadAll();
}
void func_8028873C(s32 arg0){
void animBinCache_flushStale(s32 persistant){
s32 i;
if(arg0){
if(persistant){
for(i = 0; i < 0x2CA; i++){
if(D_8037A8C0[i].unk0 && D_8037A8C0[i].unk4_0 && (D_8037A8C0[i].unk4_15 < 30)){
assetcache_release(D_8037A8C0[i].unk0);
D_8037A8C0[i].unk0 = NULL;
D_8037A8C0[i].unk4_0 = 0;
if( (animBinCache[i].ptr != NULL)
&& (animBinCache[i].persist)
&& (animBinCache[i].exp_timer < 30)
){
assetcache_release(animBinCache[i].ptr);
animBinCache[i].ptr = NULL;
animBinCache[i].persist = 0;
}
}
}
else{
} else {
for(i = 0; i < 0x2CA; i++){
if(D_8037A8C0[i].unk0 && !D_8037A8C0[i].unk4_0 && (D_8037A8C0[i].unk4_15 < 30)){
assetcache_release(D_8037A8C0[i].unk0);
D_8037A8C0[i].unk0 = NULL;
if( (animBinCache[i].ptr != NULL)
&& !animBinCache[i].persist
&& (animBinCache[i].exp_timer < 30)
){
assetcache_release(animBinCache[i].ptr);
animBinCache[i].ptr = NULL;
if(func_80254BC4(1))
break;
}
@@ -82,13 +107,13 @@ void func_8028873C(s32 arg0){
}
}
void func_80288834(void){
void animBinCache_update(void){
s32 i;
for(i = 0; i < 0x2CA; i++){
if(D_8037A8C0[i].unk0 && !D_8037A8C0[i].unk4_0){
if(--D_8037A8C0[i].unk4_15 == 0){
assetcache_release(D_8037A8C0[i].unk0);
D_8037A8C0[i].unk0 = NULL;
if((animBinCache[i].ptr != NULL) && !animBinCache[i].persist){
if(--animBinCache[i].exp_timer == 0){
assetcache_release(animBinCache[i].ptr);
animBinCache[i].ptr = NULL;
}
}
}

View File

@@ -29,13 +29,13 @@ bool func_802BAC1C(void) {
}
void func_802BAC58(void) {
f32 sp34[3];
f32 sp28[3];
f32 vp_position[3];
f32 vp_rotation[3];
f32 sp1C[3];
viewport_getPosition(sp34);
viewport_getRotation(sp28);
func_802BEA4C(sp28, sp34, 150.0f, sp1C);
viewport_getPosition(vp_position);
viewport_getRotation(vp_rotation);
func_802BEA4C(vp_rotation, vp_position, 150.0f, sp1C);
if (D_8037D810 == NULL) {
D_8037D810 = func_8032FBE4(sp1C, func_802BABC0, 1, 0x15D);
}

View File

@@ -42,11 +42,11 @@ void func_802BE940(void)
D_8037DA30[2] = sp24[2];
}
void func_802BEA4C(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3]) {
void func_802BEA4C(f32 rotation[3], f32 position[3], f32 arg2, f32 dest[3]) {
f32 sp24[3];
func_80256E24(sp24, arg0[0], arg0[1], 0.0f, 0.0f, -arg2);
ml_vec3f_add(arg3, sp24, arg1);
func_80256E24(sp24, rotation[0], rotation[1], 0.0f, 0.0f, -arg2);
ml_vec3f_add(dest, sp24, position);
}

View File

@@ -4,6 +4,8 @@
#include "prop.h"
#include "core2/statetimer.h"
#include "core2/ba/physics.h"
extern f32 func_8024DDD8(f32[3], f32);
extern int func_80259254(f32 vec[3], f32 x, f32 z, f32 val);
@@ -203,11 +205,11 @@ int player_shouldSlideTrot(void){
}
bool func_8028B254(s32 arg0) {
return (func_8028B2E8() || (_get_vertVelocity() < 0.0f && (player_getYPosition() - func_80294438()) < (f32) arg0));
return (func_8028B2E8() || (baphysics_get_vertical_velocity() < 0.0f && (player_getYPosition() - func_80294438()) < (f32) arg0));
}
int func_8028B2E8(void){
return D_8037BF60 && _get_vertVelocity() < 0.0f;
return D_8037BF60 && baphysics_get_vertical_velocity() < 0.0f;
}
int player_isSliding(void){
@@ -296,7 +298,7 @@ void func_8028B59C(void) {
if (map_get() == MAP_6_TTC_NIPPERS_SHELL) {
D_8037BF61 = FALSE;
}
if (!sp24 && D_8037BF61 && (_get_vertVelocity() < -40.0)) {
if (!sp24 && D_8037BF61 && (baphysics_get_vertical_velocity() < -40.0)) {
func_8029C0D0();
func_8030E58C(0xF, 0.7f);
}

View File

@@ -250,7 +250,7 @@ void chBeeSwarm_802CF518(Actor *this) {
&& func_8028EE84() == BSWATERGROUP_0_NONE
&& player_getTransformation() != TRANSFORM_6_BEE
) {
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}
}
@@ -259,7 +259,7 @@ void chBeeSwarm_802CF57C(Actor *this) {
local = (ActorLocal_core2_47BD0 *) &this->local;
if (!func_803292E0(this) || !func_80329530(this, 900) || func_8028EE84() != BSWATERGROUP_0_NONE) {
func_80328A84(this, 5);
subaddie_set_state(this, 5);
func_802CEF54(this, local->unkC, 100.0f);
}
}
@@ -375,7 +375,7 @@ void chBeeSwarm_update(Actor *this) {
if (this->unk100 != NULL) {
fileProgressFlag_set(FILEPROG_D_BEEHIVE_TEXT, TRUE);
}
func_80328A84(this, (this->unk100 != NULL) ? 1 : 2);
subaddie_set_state(this, (this->unk100 != NULL) ? 1 : 2);
this->unk60 = 0.0f;
chBeeSwarm_802CF040(this);
this->unk38_0 = func_803203FC(1) | func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE);
@@ -415,7 +415,7 @@ void chBeeSwarm_update(Actor *this) {
this->unk1C[2] = this->position[2] + sp7C[2] * 37.5;
if (this->state != 6) {
local->unk6 = this->state;
func_80328A84(this, 6);
subaddie_set_state(this, 6);
}
}
chBeeSwarm_802CF1C8(this->unk1C, this->position, this->velocity, this->unk28, 100.0f, 0, &spA0);
@@ -437,7 +437,7 @@ void chBeeSwarm_update(Actor *this) {
if (this->state != 7) {
local->unk7 = this->state;
local->unk4 = local->unk0;
func_80328A84(this, 7);
subaddie_set_state(this, 7);
}
}
}
@@ -453,7 +453,7 @@ void chBeeSwarm_update(Actor *this) {
fileProgressFlag_set(FILEPROG_8F_MET_BEE_INFESTED_BEEHIVE, TRUE);
}
if (chBeeSwarm_802CF5E4(this)) {
func_80328A84(this, 2U);
subaddie_set_state(this, 2U);
}
if (ml_distance_vec3f(this->position, this->unk1C) < 50.0f) {
func_802CEF54(this, local->unkC, 100.0f);
@@ -473,7 +473,7 @@ void chBeeSwarm_update(Actor *this) {
this->unk28 = 400.0f;
if (ml_distance_vec3f(this->position, this->unk1C) < 100.0f) {
func_802CEF54(this, spB4, 50.0f);
func_80328A84(this, 4);
subaddie_set_state(this, 4);
}
chBeeSwarm_802CF57C(this);
break;
@@ -500,19 +500,19 @@ void chBeeSwarm_update(Actor *this) {
func_802CEF54(this, (s32 *) spB4, 50.0f);
}
if (ml_distance_vec3f(this->position, spB4) > 100.0f) {
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}
chBeeSwarm_802CF57C(this);
break;
case 5:
if (ml_distance_vec3f(this->position, this->unk1C) < 50.0f) {
func_80328A84(this, 2);
subaddie_set_state(this, 2);
}
chBeeSwarm_802CF518(this);
break;
case 6:
if (ml_distance_vec3f(this->position, this->unk1C) < 50.0f) {
func_80328A84(this, local->unk6);
subaddie_set_state(this, local->unk6);
}
break;
case 7:
@@ -525,7 +525,7 @@ void chBeeSwarm_update(Actor *this) {
if (local->unk0 < local->unk4) {
local->unk0++;
} else {
func_80328A84(this, local->unk7);
subaddie_set_state(this, local->unk7);
}
}
break;

View File

@@ -124,7 +124,7 @@ void chMumbo_func_802D18B4(Actor *this) {
player_is_within_range = chMumbo_withinHorzDistToPlayer(0, -107, 188);
}
if(player_is_within_range || func_803203FC(1) || func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)){
func_80328AC8(this, 2);
subaddie_set_state_forward(this, 2);
if( !fileProgressFlag_get(FILEPROG_11_HAS_MET_MUMBO)
|| (!fileProgressFlag_get(FILEPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE) && this->unk38_0)
) {
@@ -166,7 +166,7 @@ static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s3
func_803463D4(ITEM_1C_MUMBO_TOKEN, -this->unk38_31);
this->unk38_31 = 0;
}
func_80328B8C(this, 5, 0.0f, 1);
subaddie_set_state_with_direction(this, 5, 0.0f, 1);
return;
case ASSET_DB0_DIALOG_MUMBO_MISTAKE_0: //L802D1AF8
@@ -180,14 +180,14 @@ static void __chMumbo_textCallback(ActorMarker *caller, enum asset_e text_id, s3
}
case ASSET_DAE_DIALOG_MUMBO_TREX_START: //L802D1B48
func_80328B8C(this, 5, 0.0f, 1);
subaddie_set_state_with_direction(this, 5, 0.0f, 1);
return;
default: //L802D1B64
gcpausemenu_80314AC8(1);
break;
}
func_80328A84(this, 4);
subaddie_set_state(this, 4);
}
void chMumbo_func_802D1B8C(Actor *this, enum transformation_e transform_id) {
@@ -206,7 +206,7 @@ void chMumbo_func_802D1B8C(Actor *this, enum transformation_e transform_id) {
return;
}
gcpausemenu_80314AC8(1);
func_80328A84(this, 4U);
subaddie_set_state(this, 4U);
return;
}
func_80311480(ASSET_D90_DIALOG_MUMBO_MAGIC_PAID_FOR, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL);
@@ -232,10 +232,10 @@ void chMumbo_update(Actor *this) {
this->unk60 = 0.0f;
if (chMumbo_func_802D181C(0x201)) {
this->unk60 = 1.0f;
func_80328A84(this, 7U);
subaddie_set_state(this, 7U);
} else if (chMumbo_func_802D181C(0x202)) {
this->unk60 = 2.0f;
func_80328A84(this, 8U);
subaddie_set_state(this, 8U);
}
}
@@ -281,7 +281,7 @@ void chMumbo_update(Actor *this) {
&& !func_803203FC(1)
&& !func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)
) {
func_80328A84(this, 3);
subaddie_set_state(this, 3);
func_80311480(ASSET_D8F_DIALOG_MUMBO_MEET, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL);
fileProgressFlag_set(FILEPROG_11_HAS_MET_MUMBO, TRUE);
break;
@@ -292,13 +292,13 @@ void chMumbo_update(Actor *this) {
&& !func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)
&& this->unk38_0
){
func_80328A84(this, 3);
subaddie_set_state(this, 3);
func_80311480(ASSET_DAA_DIALOG_MUMBO_HAS_ENOUGH_TOKENS, 0xE, this->position, this->marker, __chMumbo_textCallback, NULL);
fileProgressFlag_set(FILEPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE, TRUE);
break;
}
func_80328A84(this, 4);
subaddie_set_state(this, 4);
}
break;
@@ -334,7 +334,7 @@ void chMumbo_update(Actor *this) {
func_80311480(ASSET_DAE_DIALOG_MUMBO_TREX_START, 6, NULL, this->marker, __chMumbo_textCallback, NULL);
fileProgressFlag_set(FILEPROG_BA_HAS_SEEN_TREX_TEXT, 1);
this->unk138_24 = TRUE;
func_80328A84(this, 3);
subaddie_set_state(this, 3);
} else if (
sp44
&& map_get() != MAP_7A_GL_CRYPT
@@ -347,13 +347,13 @@ void chMumbo_update(Actor *this) {
this->unk10_12 = D_8037DDF0;
D_8037DDF0 = 7;
fileProgressFlag_setN(FILEPROG_BB_MUMBO_MISTAKE_INDEX, ++sp40, 2);
func_80328A84(this, 5);
subaddie_set_state(this, 5);
} else {
if (this->unk38_31) {
func_8025A6EC(SFX_2B_BULL_MOO_1, 28000);
func_803463D4(ITEM_1C_MUMBO_TOKEN, -this->unk38_31);
}
func_80328A84(this, 5);
subaddie_set_state(this, 5);
}
gcpausemenu_80314AC8(0);
@@ -412,17 +412,17 @@ void chMumbo_update(Actor *this) {
}
func_8025A7DC(COMUSIC_1D_MUMBO_TRANSFORMATION);
if (player_getTransformation() != TRANSFORM_1_BANJO) {
func_80328A84(this, 3);
subaddie_set_state(this, 3);
chMumbo_func_802D1B8C(this, D_8037DDF0);
break;
}
if (this->unk138_24) {
func_80328A84(this, 3);
subaddie_set_state(this, 3);
func_80311480(ASSET_DAF_DIALOG_MUMBO_TREX_MISTAKE, 6, NULL, this->marker, __chMumbo_textCallback, NULL);
break;
}
gcpausemenu_80314AC8(1);
func_80328A84(this, 4);
subaddie_set_state(this, 4);
}
break;
@@ -460,7 +460,7 @@ void chMumbo_update(Actor *this) {
if (randf() < 0.4) {
temp_f12 = (randf() - 0.5) * 0.95300000000000007 * 2;
this->unk1C[0] = temp_f12 + ((temp_f12 >= 0.0f) ? 0.476 : -0.476);
func_80328AEC(this, 9);
subaddie_set_state_looped(this, 9);
break;
}
if (0.6 < randf()) {
@@ -471,7 +471,7 @@ void chMumbo_update(Actor *this) {
case 9: //L802D2920
this->yaw += this->unk1C[0];
if (actor_animationIsAt(this, 0.99f)) {
func_80328AEC(this, 8);
subaddie_set_state_looped(this, 8);
}
break;
}

View File

@@ -158,7 +158,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) {
case 0xA0:
case 0xFF:
func_8030E540(SFX_82_METAL_BREAK);
func_80328A84(sp2C, 4);
subaddie_set_state(sp2C, 4);
break;
case 0x17D:
@@ -172,7 +172,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) {
case MARKER_109_BREAKABLE_BRICK_WALL:
func_8030E6D4(SFX_114_BRICKWALL_BREAKING);
func_8030E510(SFX_11_WOOD_BREAKING_1, 28000);
func_80328AEC(sp2C, 9);
subaddie_set_state_looped(sp2C, 9);
fileProgressFlag_set((sp2C->unkF4_8 == 1) ? FILEPROG_C8_LAIR_BRICKWALL_TO_WADINGBOOTS_BROKEN : FILEPROG_C9_LAIR_BRICKWALL_TO_SHOCKJUMP_PAD_BROKEN, TRUE);
break;
@@ -185,7 +185,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) {
case MARKER_224_BREAKABLE_FLOOR_COBWEB:
func_8025A70C(COMUSIC_2B_DING_B);
func_8030E6A4(SFX_129_SWOOSH, (sp2C->scale < 0.45) ? 1.0 : 0.8, 0x7FF8);
func_80328AEC(sp2C, 0xC);
subaddie_set_state_looped(sp2C, 0xC);
func_802D2FB0(sp2C, 8, -0x3C, 0xC8, 2.0f, 0xFA, 0x3C, 0x64);
fileProgressFlag_set((sp2C->unkF4_8== 1) ? FILEPROG_CB_LAIR_COBWEB_OVER_FLIGHTPAD_BROKEN : FILEPROG_CC_LAIR_COBWEB_OVER_GREEN_CAULDRON_BROKEN, 1);
break;
@@ -193,7 +193,7 @@ void func_802D31AC(ActorMarker *arg0, ActorMarker * arg1) {
case MARKER_225_BREAKABLE_WALL_COBWEB:
func_8025A70C(COMUSIC_2B_DING_B);
func_8030E540(SFX_129_SWOOSH);
func_80328AEC(sp2C, 0xF);
subaddie_set_state_looped(sp2C, 0xF);
func_802D2FB0(sp2C, 0xE, -0x3C, 0xC8, 2.0f, 0xFA, 0x3C, 0x64);
fileProgressFlag_set(FILEPROG_CA_COBWEB_BLOCKING_PURPLE_CAULDRON_BROKEN, 1);
break;
@@ -508,7 +508,7 @@ void func_802D4388(Actor *this){
switch(this->state){
case 0x12: //L802D4468
if(this->unk38_0 && mapSpecificFlags_get(0x1F)){
func_80328B8C(this, 0x13, 0.0f, 1);
subaddie_set_state_with_direction(this, 0x13, 0.0f, 1);
actor_playAnimationOnce(this);
func_8030E6D4(SFX_90_SWITCH_PRESS);
}
@@ -516,20 +516,20 @@ void func_802D4388(Actor *this){
case 0x13: //L802D44B0
if(0.66 <= animctrl_getAnimTimer(this->animctrl)){
func_80328B8C(this, 0x14, 0.66f, 0);
subaddie_set_state_with_direction(this, 0x14, 0.66f, 0);
}
break;
case 0x14: //L802D44F0
if(!this->unk38_0 || !mapSpecificFlags_get(0x1F)){
func_80328B8C(this, 0x15, 0.66f, 0);
subaddie_set_state_with_direction(this, 0x15, 0.66f, 0);
actor_playAnimationOnce(this);
}
break;
case 0x15: //L802D4534
if(animctrl_getAnimTimer(this->animctrl) < 0.03){
func_80328B8C(this, 0x12, 0.0f, 1);
subaddie_set_state_with_direction(this, 0x12, 0.0f, 1);
}
break;
}//L802D456C
@@ -564,7 +564,7 @@ void func_802D4680(Actor *this){
switch(this->state){
case 0:
if(150.0f < func_80258640(this->position, sp1C)){
func_80328A84(this, 1);
subaddie_set_state(this, 1);
D_803676AC = 0;
}
break;
@@ -628,7 +628,7 @@ void func_802D4928(Actor *this, s32 arg1, s32 arg2, s32 arg3) {
)
&& (arg2 != this->state)
) {
func_80328B8C(this, arg2, 0.0f, 1);
subaddie_set_state_with_direction(this, arg2, 0.0f, 1);
actor_playAnimationOnce(this);
}
if( ( (((arg1 & 0xC00000) == 0) && !mapSpecificFlags_get(arg1 - 0))
@@ -637,7 +637,7 @@ void func_802D4928(Actor *this, s32 arg1, s32 arg2, s32 arg3) {
)
&& (arg2 == this->state)
) {
func_80328B8C(this, arg3, 0.0f, 1);
subaddie_set_state_with_direction(this, arg3, 0.0f, 1);
actor_playAnimationOnce(this);
}
}
@@ -658,7 +658,7 @@ void func_802D4AC0(Actor *this, s32 arg1, s32 arg2) {
if( (((arg1 & 0x800000) && (fileProgressFlag_get(arg1 + 0xFF800000))) || ((arg1 & 0x400000) && (func_803203FC(arg1 + 0xFFC00000))))
&& (fileProgressFlag_get(arg2)) && (this->animctrl == NULL)
) {
func_80328B8C(this, 8, 0.0f, 1);
subaddie_set_state_with_direction(this, 8, 0.0f, 1);
}
func_802D4A9C(this, arg1);
}

View File

@@ -171,7 +171,7 @@ void func_802D7DE8(ActorMarker *marker, f32 arg1[3]) {
}
}
func_8028F010(this->modelCacheIndex);
func_80328A84(this, 4);
subaddie_set_state(this, 4);
var_f12 = this->position[1];
var_f14 = 28.0f;
var_f18 = 0.0f;
@@ -196,7 +196,7 @@ void func_802D8030(Actor *this){
local = (s32*)&this->local;
*local = 1;
this->marker->unkC = __chLevelCollectible_collide;
func_80328A84(this, 2);
subaddie_set_state(this, 2);
}
void __chLevelCollectible_returnObj(Actor *this) {
@@ -252,7 +252,7 @@ void __chLevelCollectible_returnObj(Actor *this) {
}
}
this->unk138_22 = this->unk138_21 = 0;
func_80328A84(this, 2);
subaddie_set_state(this, 2);
}
switch (this->marker->unk14_20) {
case MARKER_1FD_BLUE_PRESENT_COLLECTIBLE:
@@ -327,7 +327,7 @@ void chLevelCollectible_update(Actor *this){
}
if(this->unk138_22){
func_8028F7D4(0.0f, 0.0f);
func_80328A84(this, 3);
subaddie_set_state(this, 3);
}
}//L802D85DC

View File

@@ -89,7 +89,7 @@ void func_802DAE10(Actor *this){
void func_802DAE40(Actor *this) {
func_80328A84(this, 2);
subaddie_set_state(this, 2);
func_802DAE10(this);
func_80328CEC(this, (s32) this->yaw_ideal, (s32) (this->yaw + 160.0f) % 360, (s32) (this->yaw + 200.0f) % 360);
this->unk38_31 = 0x5A;
@@ -142,13 +142,13 @@ bool func_802DAFBC(Actor *this) {
} else if (temp_v0 & 8) {
func_802DAE10(this);
this->unk38_31 = 0x5A;
func_80328B8C(this, 2, sp44, 1);
subaddie_set_state_with_direction(this, 2, sp44, 1);
func_80328CEC(this, (s32) this->yaw_ideal, 0xB3, 0xB4);
this->unk38_0 = TRUE;
} else {
func_802DAE10(this);
this->unk38_31 = 0x5A;
func_80328B8C(this, 8, sp44, 1);
subaddie_set_state_with_direction(this, 8, sp44, 1);
func_80328CEC(this, (s32) this->yaw_ideal, 120, 180);
}
return TRUE;
@@ -156,13 +156,13 @@ bool func_802DAFBC(Actor *this) {
void func_802DB220(Actor *this) {
if (func_80329530(this, 900) && func_803292E0(this)) {
func_80328A84(this, 6);
subaddie_set_state(this, 6);
}
}
void func_802DB264(Actor *this) {
if (!func_80329530(this, 900) || !func_803292E0(this)) {
func_80328A84(this, 1);
subaddie_set_state(this, 1);
}
}
@@ -219,7 +219,7 @@ void func_802DB440(ActorMarker *marker, ActorMarker *other_marker) {
void func_802DB4E0(ActorMarker *marker, s32 arg1){
Actor * actor = marker_getActor(marker);
func_80328B8C(actor, 9, 0.0f, 1);
subaddie_set_state_with_direction(actor, 9, 0.0f, 1);
actor_playAnimationOnce(actor);
actor_collisionOff(actor);
actor->unk60 = randf2(3.0f, 6.0f);
@@ -248,7 +248,7 @@ void func_802DB5A0(Actor *this) {
local->unk38 = 0;
this->unk16C_4 = TRUE;
if (func_803203FC(UNKFLAGS1_1F_IN_CHARACTER_PARADE)) {
func_80328A84(this, 2U);
subaddie_set_state(this, 2U);
return;
}
}
@@ -261,7 +261,7 @@ void func_802DB5A0(Actor *this) {
switch(this->state){
case 1://L802DB6B8
if (func_80328B38(this, 2, 0.58f)) {
if (subaddie_maybe_set_state(this, 2, 0.58f)) {
func_80328CEC(this, (s32) this->yaw, 0xA, 0x2D);
func_802DAE10(this);
}
@@ -274,7 +274,7 @@ void func_802DB5A0(Actor *this) {
if (phi_f14 >= 1.0) {
phi_f14 -= 1.0;
}
func_80328B8C(this, 2, phi_f14, 1);
subaddie_set_state_with_direction(this, 2, phi_f14, 1);
this->yaw_ideal = this->yaw;
func_802DAE10(this);
}
@@ -288,12 +288,12 @@ void func_802DB5A0(Actor *this) {
func_80328CEC(this, this->yaw_ideal, 0xA, 0x14);
}
if (!(func_8023DB5C() & 7)) {
func_80328B38(this, 1, 0.02f);
subaddie_maybe_set_state(this, 1, 0.02f);
}
if( !(func_8023DB5C() & 0xF)
&& func_80329078(this, (s32) this->yaw_ideal, 0x96)
) {
if (func_80328B38(this, 3, 0.13f) != 0) {
if (subaddie_maybe_set_state(this, 3, 0.13f) != 0) {
this->unk28 = randf2((f32)local->unk8, (f32)local->unk9);
}
}
@@ -308,7 +308,7 @@ void func_802DB5A0(Actor *this) {
func_80328FB0(this, 4.0f);
if (func_80329480(this)) {
this->unk10_12 = local->unkC_31;
func_80328A84(this, 4);
subaddie_set_state(this, 4);
func_802DB2AC(this);
}
break;
@@ -316,7 +316,7 @@ void func_802DB5A0(Actor *this) {
case 3://L802DB930
func_80328FB0(this, 3.0f);
func_802DB3B0(this);
if (!(func_8023DB5C() & 0xF) && (func_80328B38(this, 2, 0.08f))) {
if (!(func_8023DB5C() & 0xF) && (subaddie_maybe_set_state(this, 2, 0.08f))) {
func_802DAE10(this);
}
func_802DB220(this);
@@ -329,7 +329,7 @@ void func_802DB5A0(Actor *this) {
}
this->yaw_ideal = (f32) func_80329784(this);
if (!func_803294B4(this, 0x21)) {
func_80328A84(this, 6);
subaddie_set_state(this, 6);
}
func_802DB264(this);
if (actor_animationIsAt(this, 0.5f) != 0) {
@@ -340,7 +340,7 @@ void func_802DB5A0(Actor *this) {
if( (this->unk10_12 == 0)
|| (this->unk10_12 < local->unkC_31 && func_80329530(this, 0xFA))
) {
func_80328A84(this, 7);
subaddie_set_state(this, 7);
this->unk28 = (f32)local->unkA;
this->unk38_31 = 0;
}
@@ -374,7 +374,7 @@ void func_802DB5A0(Actor *this) {
this->unk60 -= time_getDelta();
break;
}
func_80328B8C(this, 0xA, 0.0f, 1);
subaddie_set_state_with_direction(this, 0xA, 0.0f, 1);
actor_playAnimationOnce(this);
break;
@@ -383,7 +383,7 @@ void func_802DB5A0(Actor *this) {
func_802DB354(this);
}
if (animctrl_isStopped(this->animctrl)) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
actor_collisionOn(this);
}

View File

@@ -100,7 +100,7 @@ void func_802DEE1C(Actor *this) {
sp4C = map_getLevel(map_get());
sp44 = sp4C == D_8037DFE4;
if (sp44) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
switch(sp4C){
@@ -126,7 +126,7 @@ void func_802DEE1C(Actor *this) {
switch(this->state){
case 1:
if (animctrl_isStopped(this->animctrl)) {
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
break;
@@ -140,7 +140,7 @@ void func_802DEE1C(Actor *this) {
case 2:
if(gctransition_8030BDC0()) {
func_80328B8C(this, 5, 0.0f, 1);
subaddie_set_state_with_direction(this, 5, 0.0f, 1);
}
break;
@@ -172,7 +172,7 @@ void func_802DF0C8(void) {
sp1C = marker_getActor(D_8037DFE0);
if (sp1C->state != 3) {
func_80328B8C(sp1C, 3, 0.0f, 1);
subaddie_set_state_with_direction(sp1C, 3, 0.0f, 1);
actor_playAnimationOnce(sp1C);
}
}

View File

@@ -69,7 +69,7 @@ void func_802E0CE0(Actor *this) {
}
}
}
func_80328B8C(this, 3, 0.0f, -1);
subaddie_set_state_with_direction(this, 3, 0.0f, -1);
}
}
@@ -84,7 +84,7 @@ bool func_802E0DC0(f32 arg0[3]){
void func_802E0E88(Actor *this){
this->unk28 = 2.0f;
func_80328B8C(this, 5, 0.0f, -1);
subaddie_set_state_with_direction(this, 5, 0.0f, -1);
actor_playAnimationOnce(this);
}
@@ -111,7 +111,7 @@ void func_802E0F60(ActorMarker *marker, ActorMarker *other){
this = marker_getActor(marker);
actor_collisionOff(this);
FUNC_8030E8B4(SFX_179_GRUNTY_DAMAGE, 0.6f, 32750, this->position, 300, 3000);
func_80328B8C(this, 9, 0.0f, 1);
subaddie_set_state_with_direction(this, 9, 0.0f, 1);
actor_playAnimationOnce(this);
}
@@ -128,7 +128,7 @@ void func_802E1010(ActorMarker *marker, ActorMarker *other){
Actor *this;
this = marker_getActor(marker);
func_80328B8C(this, 8, 0.0f, 1);
subaddie_set_state_with_direction(this, 8, 0.0f, 1);
actor_playAnimationOnce(this);
}
@@ -190,7 +190,7 @@ void chsnacker_update(Actor *this) {
switch(this->state){
case 1: //802E12C8
if (func_80328BD4(this, 2, 0.0f, 1, 0.03f) != 0) {
if (subaddie_maybe_set_state_position_direction(this, 2, 0.0f, 1, 0.03f) != 0) {
func_802E0CD0(this);
}
func_802E0CE0(this);
@@ -203,7 +203,7 @@ void chsnacker_update(Actor *this) {
if (func_80329480(this) != 0) {
func_80328CEC(this, (s32) this->yaw, 0x5A, 0x96);
}
func_80328BD4(this, 1, 0.0f, 1, 0.0075f);
subaddie_maybe_set_state_position_direction(this, 1, 0.0f, 1, 0.0075f);
func_802E0CE0(this);
break;
@@ -214,7 +214,7 @@ void chsnacker_update(Actor *this) {
func_80328FB0(this, 4.0f);
func_80328FF0(this, 3.0f);
if (func_80329480(this)) {
func_80328B8C(this, 4, 0.0f, 1);
subaddie_set_state_with_direction(this, 4, 0.0f, 1);
this->unk28 = 9.0f;
}
break;
@@ -237,7 +237,7 @@ void chsnacker_update(Actor *this) {
func_802E0CD0(this);
func_80328CEC(this, (s32) this->yaw_ideal, 0x87, 0xAF);
this->unk38_31 = 0x78;
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
func_8032CA80(this, (D_8037E62C) ? 15 : 9);
@@ -246,7 +246,7 @@ void chsnacker_update(Actor *this) {
case 8: //802E15BC
if (animctrl_isStopped(this->animctrl)) {
func_802E0CD0(this);
func_80328B8C(this, 2, 0.0f, 1);
subaddie_set_state_with_direction(this, 2, 0.0f, 1);
actor_loopAnimation(this);
}
break;

View File

@@ -163,7 +163,7 @@ BKVertexList *vtxList_clone(BKVertexList *vtxList){
list_size = sizeof(BKVertexList) + vtxList->count*sizeof(Vtx);
out_v0 = (BKVertexList *) malloc(list_size);
func_80254630(out_v0, vtxList, list_size);
wmemcpy(out_v0, vtxList, list_size);
return out_v0;
}

View File

@@ -257,7 +257,7 @@ void *func_802F2AEC(void) {
}
temp_v0->unk0 = 0;
temp_v0->unk4 = 0;
D_80380A58 = heap_get_size() - func_8025496C();
D_80380A58 = heap_get_size() - heap_get_occupied_size();
return temp_v0;
}
@@ -302,7 +302,7 @@ void func_802F2D8C(Struct64s *arg0) {
Struct65s *var_s0;
if ((arg0 != NULL) && (arg0->unk4 != 0)) {
D_80380A58 = heap_get_size() - func_8025496C();
D_80380A58 = heap_get_size() - heap_get_occupied_size();
for(var_s0 = arg0->unk0; var_s0 < arg0->unk0 + arg0->unk4; var_s0++){
if (var_s0->unk23 & 1) {
if (var_s0->unk10(var_s0->unk0, (f32)var_s0->unk20, var_s0->unkC) == 0) {

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
extern Actor *func_8032813C(enum actor_e, f32[3], s32);
@@ -75,10 +76,10 @@ enum hitbox_e func_8028DB14(ActorMarker *arg0){
break;
case BS_5_JUMP://8028DCD8
case BS_3D_FALL_TUMBLING:
if(_get_vertVelocity() < 0.0f && !func_8028B2E8())
if(baphysics_get_vertical_velocity() < 0.0f && !func_8028B2E8())
return HITBOX_A_FAST_FALLING;
case BS_2F_FALL://8028DD10
if(_get_vertVelocity() < -1400.0f && !func_8028B2E8())
if(baphysics_get_vertical_velocity() < -1400.0f && !func_8028B2E8())
return HITBOX_A_FAST_FALLING;
default://8028DD4C
return HITBOX_0_NONE;

View File

@@ -5,6 +5,7 @@
#include "prop.h"
#include "enums.h"
#include "core2/ba/physics.h"
extern bool player_isInHorizontalRadius(f32[3], f32);
@@ -539,7 +540,7 @@ BKCollisionTri *func_8028EF48(void){
}
void player_getVelocity(f32 dst[3]){
_get_velocity(dst);
baphysics_get_velocity(dst);
}
f32 func_8028EF88(void){
@@ -683,7 +684,7 @@ void func_8028F3D8(f32 arg0[3], f32 arg1, void(*arg2)(ActorMarker *), ActorMarke
}
void func_8028F408(f32 arg0[3]){
func_80297BC4(arg0);
baphysics_set_goto_position(arg0);
}
bool func_8028F428(s32 arg0, ActorMarker *marker) {

View File

@@ -101,7 +101,7 @@ void func_802F9114(void){
void func_802F9134(s32 gfx){
D_80369284 = D_80369284 - 1;
if(gfx < D_80369284){
func_80254630(D_80369280->unk1C + gfx, D_80369280->unk1C + D_80369284, sizeof(struct4Ds));
wmemcpy(D_80369280->unk1C + gfx, D_80369280->unk1C + D_80369284, sizeof(struct4Ds));
}
}

View File

@@ -2197,44 +2197,43 @@ bool func_803082D8(Cube *arg0, s32 *arg1, bool arg2, bool arg3) {
#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803083B0.s")
#else
s32 func_803083B0(s32 arg0) {
s32 temp_v0;
s32 var_v0;
bool var_a2;
Cube *var_s0;
static s32 D_80382140;
static Cube *D_80382144;
if (arg0 == -1) {
D_80382144 = D_80381FA0.cube_list;
var_s0 = D_80381FA0.cube_list;
D_80382144 = var_s0;
D_80382140 = 0;
return 0;
}
var_s0 = D_80382144;
if (D_80382140 < D_80382144->prop2Cnt) {
temp_v0 = func_803082D8(var_s0, &D_80382140, (arg0 < 0) ^ 1, arg0 & 1);
if (D_80381FA0.cube_list && D_80381FA0.cube_list && D_80381FA0.cube_list );
var_v0 = func_803082D8(var_s0, &D_80382140, arg0 >= 0, arg0 & 1);
if (D_80382140 != 0) {
return temp_v0;
}
}
D_80382140 = 0;
loop_6:
loop_7:
var_s0++;
if (var_s0 >= D_80381FA0.cube_list + D_80381FA0.cubeCnt) {
D_80382144 = var_s0;
return -1;
}
if (0 < var_s0->prop2Cnt) {
var_v0 = func_803082D8(var_s0, &D_80382140, (arg0 < 0) ^ 1, arg0 & 1);
if (D_80382140 != 0) {
D_80382144 = var_s0;
return var_v0;
}
goto loop_6;
}
goto loop_7;
return -1;
D_80382140 = 0;
while(D_80382140 == 0) {
do{
var_s0++;
if (var_s0 >= D_80381FA0.cube_list + D_80381FA0.cubeCnt) {
D_80382144 = var_s0;
return -1;
}
}while (0 >= var_s0->prop2Cnt);
var_v0 = func_803082D8(var_s0, &D_80382140, arg0 >= 0, arg0 & 1);
}
D_80382144 = var_s0;
return var_v0;
}
#endif

View File

@@ -80,7 +80,7 @@ void func_8030C204(void){
void func_8030C27C(void){
switch(getGameMode()){
case GAME_MODE_8_BOTTLES_BONUS:
chBottlesBonus_Spawn(0, 0);
chBottlesBonus_spawn(0, 0);
break;
case GAME_MODE_A_SNS_PICTURE:
func_802DF090(0, 0);

View File

@@ -142,7 +142,7 @@ void __chMinigame_setState(Actor *this, u32 arg1) {
timedFunc_set_3(2.0f, (GenFunction_3)func_802E4078, MAP_8E_GL_FURNACE_FUN, 1, 1);
break;
}
func_80328A84(this, arg1);
subaddie_set_state(this, arg1);
}
void __chMinigame_free(Actor *this){

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "actor.h"
#include "prop.h"
@@ -29,7 +30,7 @@ extern void __spawnQueue_add_5(GenFunction_5, s32, s32, s32, s32, s32);
void func_8032A6A8(Actor *arg0);
void func_8032ACA8(Actor *arg0);
void func_8032B5C0(ActorMarker *arg0, ActorMarker *arg1, struct5Cs *arg2);
void func_80328B8C(Actor * this, s32 arg1, f32 arg2, s32 arg3);
void subaddie_set_state_with_direction(Actor * this, s32 arg1, f32 arg2, s32 arg3);
void func_8032BB88(Actor *this, s32 arg1, s32 arg2);
int subaddie_playerIsWithinSphere(Actor *this, s32 dist);
extern void func_8033A4A0(enum asset_e mode_id, f32, f32);
@@ -757,7 +758,7 @@ void func_803272D0(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *)){
func_803270B8(arg0, arg1, arg2, arg3, NULL);
}
Actor *actor_new(s32 (* position)[3], s32 yaw, ActorInfo* actorInfo, u32 flags){
Actor *actor_new(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){
ActorAnimationInfo * sp54;
s32 i;
f32 sp44[3];
@@ -778,9 +779,9 @@ Actor *actor_new(s32 (* position)[3], s32 yaw, ActorInfo* actorInfo, u32 flags){
D_80383390->unk10_25 = 0;
D_80383390->unk10_18 = 0;
D_80383390->state = actorInfo->startAnimation;
D_80383390->position_x = (f32)(*position)[0];
D_80383390->position_y = (f32)(*position)[1];
D_80383390->position_z = (f32)(*position)[2];
D_80383390->position_x = (f32)position[0];
D_80383390->position_y = (f32)position[1];
D_80383390->position_z = (f32)position[2];
D_80383390->unkF4_8 = 0;
D_80383390->yaw = (f32) yaw;
D_80383390->yaw_ideal = (f32) yaw;
@@ -907,112 +908,112 @@ Actor *actor_new(s32 (* position)[3], s32 yaw, ActorInfo* actorInfo, u32 flags){
for(i = 0; i < 0x0C; i++){
((s32 *)D_80383390->unkBC)[i] = 0;
}
if(flags & 1){
if(flags & ACTOR_FLAG_UNKNOWN_0){
D_80383390->unk10_25 = func_80306DDC(position) + 1;
if(D_80383390->unk10_25 == 0){
D_80383390->unk10_25 = 0;
}else{
sp44[0] = (f32)(*position)[0];
sp44[1] = (f32)(*position)[1];
sp44[2] = (f32)(*position)[2];
sp44[0] = (f32)position[0];
sp44[1] = (f32)position[1];
sp44[2] = (f32)position[2];
D_80383390->unk10_18 = func_80307258(&sp44, D_80383390->unk10_25 - 1, 0) + 1;
}
}//L80327D30
if(flags & 4){
if(flags & ACTOR_FLAG_UNKNOWN_2){
D_80383390->unk10_1 = 0;
}
if(flags & 8){
if(flags & ACTOR_FLAG_UNKNOWN_3){
D_80383390->unkF4_30 = 1;
}
if(flags & 2){
if(flags & ACTOR_FLAG_UNKNOWN_1){
D_80383390->marker->unk44 = 1;
}
else if(flags & 0x40){
else if(flags & ACTOR_FLAG_UNKNOWN_6){
D_80383390->marker->unk44 = func_8034A2C8();
}
if(flags & 0x1000){
if(flags & ACTOR_FLAG_UNKNOWN_12){
func_8033F738(D_80383390->marker);
func_8034BFF8(D_80383390->marker);
}
D_80383390->unk148 = 0;
if(flags & 0x800){
if(flags & ACTOR_FLAG_UNKNOWN_11){
D_80383390->unk148 = skeletalAnim_new();
}
if(flags & 0x4000){
if(flags & ACTOR_FLAG_UNKNOWN_14){
D_80383390->marker->unk50 = func_803406B0();
}
if(flags & 0x10){
if(flags & ACTOR_FLAG_UNKNOWN_4){
D_80383390->unk124_31 = -1;
}
if(flags & 0x80){
if(flags & ACTOR_FLAG_UNKNOWN_7){
D_80383390->unkF4_22 = 1;
}
if(flags & 0x80000){
if(flags & ACTOR_FLAG_UNKNOWN_19){
D_80383390->unk58_1 = 1;
}
if(flags & 0x100){
if(flags & ACTOR_FLAG_UNKNOWN_8){
D_80383390->unk130 = func_803255FC;
}
if(flags & 0x200){
if(flags & ACTOR_FLAG_UNKNOWN_9){
D_80383390->marker->unk40_21 = 1;
}
if(flags & 0x8000){
if(flags & ACTOR_FLAG_UNKNOWN_15){
D_80383390->marker->unk40_20 = 1;
}
if(flags & 0x20000){
if(flags & ACTOR_FLAG_UNKNOWN_17){
D_80383390->marker->unk40_22 = 1;
}
if(flags & 0x400000){
if(flags & ACTOR_FLAG_UNKNOWN_22){
D_80383390->marker->unk40_19 = 1;
}
if(flags & 0x10000){
if(flags & ACTOR_FLAG_UNKNOWN_16){
D_80383390->unk138_9 = 1;
}
if(flags & 0x40000){
if(flags & ACTOR_FLAG_UNKNOWN_18){
D_80383390->unk138_8 = 1;
}
if(flags & 0x200000){
if(flags & ACTOR_FLAG_UNKNOWN_21){
D_80383390->unk138_25 = 1;
}
if(flags & 0x800000){
if(flags & ACTOR_FLAG_UNKNOWN_23){
D_80383390->unk16C_3 = 1;
}
if(flags & 0x1000000){
if(flags & ACTOR_FLAG_UNKNOWN_24){
D_80383390->unk16C_2 = 1;
}
if(flags & 0x2000000){
if(flags & ACTOR_FLAG_UNKNOWN_25){
D_80383390->unk16C_1 = 1;
}
if(flags & 0x4000000){
if(flags & ACTOR_FLAG_UNKNOWN_26){
D_80383390->unk17C_31 = 1;
}
if(flags & 0x2000){
if(flags & ACTOR_FLAG_UNKNOWN_13){
D_80383390->unk138_29 = 1;
}
if(flags & 0x100000){
if(flags & ACTOR_FLAG_UNKNOWN_20){
D_80383390->unk58_2 = 0;
}
@@ -1151,30 +1152,30 @@ void func_80328478(f32 arg0[3], f32 arg1, f32 arg2){
arg0[2] += sp1C[2];
}
bool func_80328508(Actor *arg0, s32 arg1)
static bool __subaddie_set_state(Actor *this, s32 state)
{
ActorAnimationInfo *animInfo;
s32 index;
arg0->state = arg1;
if (arg0->unk18 == 0)
this->state = state;
if (this->unk18 == 0)
return FALSE;
animInfo = arg0->unk18 + arg1;
animInfo = this->unk18 + state;
index = animInfo->index;
if (1);
if (index != 0){
if (arg0->animctrl == NULL){
arg0->animctrl = animctrl_new(0);
animctrl_reset(arg0->animctrl);
if (this->animctrl == NULL){
this->animctrl = animctrl_new(0);
animctrl_reset(this->animctrl);
}
animctrl_setIndex(arg0->animctrl, animInfo->index);
animctrl_setDuration(arg0->animctrl, animInfo->duration);
animctrl_setDirection(arg0->animctrl, mvmt_dir_forwards);
animctrl_setIndex(this->animctrl, animInfo->index);
animctrl_setDuration(this->animctrl, animInfo->duration);
animctrl_setDirection(this->animctrl, mvmt_dir_forwards);
}
else if (arg0->animctrl) {
animctrl_setPlaybackType(arg0->animctrl, ANIMCTRL_STOPPED);
animctrl_setDirection(arg0->animctrl, mvmt_dir_forwards);
else if (this->animctrl) {
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED);
animctrl_setDirection(this->animctrl, mvmt_dir_forwards);
}
return TRUE;
}
@@ -1281,41 +1282,41 @@ int func_80328A2C(Actor *this, f32 arg1, s32 direction, f32 probability){
}
}
void func_80328A84(Actor * arg0, u32 arg1){
if(func_80328508(arg0, arg1) && arg0->animctrl){
animctrl_start(arg0->animctrl, "subaddie.c", 0X6CA);
void subaddie_set_state(Actor * this, u32 arg1){
if(__subaddie_set_state(this, arg1) && this->animctrl){
animctrl_start(this->animctrl, "subaddie.c", 0X6CA);
}
}
void func_80328AC8(Actor * arg0, s32 arg1){
func_80328B8C(arg0, arg1, 0.0f, 1);
void subaddie_set_state_forward(Actor * this, s32 arg1){
subaddie_set_state_with_direction(this, arg1, 0.0f, 1);
}
void func_80328AEC(Actor * arg0, u32 arg1){
if(func_80328508(arg0, arg1) && arg0->animctrl){
animctrl_setPlaybackType(arg0->animctrl, ANIMCTRL_LOOP);
func_803289EC(arg0, 0.0f, 1);
void subaddie_set_state_looped(Actor * this, u32 arg1){
if(__subaddie_set_state(this, arg1) && this->animctrl){
animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP);
func_803289EC(this, 0.0f, 1);
}
}
/* actor - maybe plays actor's animation with set probability */
int func_80328B38(Actor *this, s32 myAnimId, f32 chance){
int subaddie_maybe_set_state(Actor *this, s32 myAnimId, f32 chance){
if(randf() < chance){
func_80328A84(this, myAnimId);
subaddie_set_state(this, myAnimId);
return 1;
}
return 0;
}
void func_80328B8C(Actor * this, s32 myAnimId, f32 arg2, s32 direction){
if(func_80328508(this, myAnimId) && this->animctrl)
void subaddie_set_state_with_direction(Actor * this, s32 myAnimId, f32 arg2, s32 direction){
if(__subaddie_set_state(this, myAnimId) && this->animctrl)
func_803289EC(this, arg2, direction);
}
int func_80328BD4(Actor * this, s32 myAnimId, f32 arg2, s32 arg3, f32 arg4){
if(randf() < arg4){
if(func_80328508(this, myAnimId) && this->animctrl){
func_803285E8(this, arg2, arg3);
int subaddie_maybe_set_state_position_direction(Actor * this, s32 myAnimId, f32 start_position, s32 direction, f32 probability){
if(randf() < probability){
if(__subaddie_set_state(this, myAnimId) && this->animctrl){
func_803285E8(this, start_position, direction);
animctrl_start(this->animctrl, "subaddie.c", 0x705);
}
return 1;
@@ -1323,14 +1324,14 @@ int func_80328BD4(Actor * this, s32 myAnimId, f32 arg2, s32 arg3, f32 arg4){
return 0;
}
void func_80328C64(Actor * this, int arg1){
void subaddie_set_ideal_yaw(Actor * this, int arg1){
int retVal = arg1;
while(retVal < 0) retVal += 0x168;
while(retVal >= 0x168) retVal -= 0x168;
this->yaw_ideal = retVal;
}
void func_80328CA8(Actor *arg0, s32 angle) {
void func_80328CA8(Actor *this, s32 angle) {
s32 fixedAngle = angle;
while (fixedAngle < 0) {
fixedAngle += 360;
@@ -1338,7 +1339,7 @@ void func_80328CA8(Actor *arg0, s32 angle) {
while (fixedAngle >= 360) {
fixedAngle -= 360;
}
arg0->unk6C = fixedAngle;
this->unk6C = fixedAngle;
}
void func_80328CEC(Actor * this, s32 arg1, s32 min, s32 max){
@@ -1346,7 +1347,7 @@ void func_80328CEC(Actor * this, s32 arg1, s32 min, s32 max){
int abs;
f12 = (randf() - 0.5)*(max - min)*2;
abs = (0.0f <= f12) ? min : -min;
func_80328C64(this, abs + (arg1 + f12));
subaddie_set_ideal_yaw(this, abs + (arg1 + f12));
}
f32 func_80328DAC(Actor *this){
@@ -1574,11 +1575,11 @@ s32 func_8032970C(Actor *this){
return (s32) DIST_SQ_VEC3F(this->position, sp24);
}
s32 func_80329784(Actor *arg0){
s32 func_80329784(Actor *this){
f32 sp1C[3];
func_8028E964(sp1C);
return (s32)func_80257204(arg0->position[0], arg0->position[2], sp1C[0], sp1C[2]);
return (s32)func_80257204(this->position[0], this->position[2], sp1C[0], sp1C[2]);
}
s32 func_803297C8(Actor *arg0, f32 arg1[3]){
@@ -2225,7 +2226,7 @@ void func_8032B5C0(ActorMarker *arg0, ActorMarker *arg1, struct5Cs *arg2) {
s32 sp68;
s32 sp64;
s32 var_v0;
f32 sp5C;
f32 player_yaw;
f32 sp50[3];
s32 sp4C;
NodeProp *sp48;
@@ -2282,7 +2283,7 @@ void func_8032B5C0(ActorMarker *arg0, ActorMarker *arg1, struct5Cs *arg2) {
this->unk164[sp64] = 0x63;
}
if ((sp64 == 2) && (sp70 != 0)) {
sp5C = player_getYaw();
player_yaw = player_getYaw();
sp3C[0] = (s32) this->position[0];
sp3C[1] = (s32) this->position[1];
sp3C[2] = (s32) this->position[2];
@@ -2291,15 +2292,15 @@ void func_8032B5C0(ActorMarker *arg0, ActorMarker *arg1, struct5Cs *arg2) {
}
func_8032EE0C(func_8032B38C, this);
if (((s32)arg0->unk44 < 0) && ((sp50[0] != 0.0f) || (sp50[1] != 0.0f) || (sp50[2] != 0.0f))) {
__spawnQueue_add_5((GenFunction_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, sp5C));
__spawnQueue_add_5((GenFunction_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, player_yaw));
} else if (this->unk16C_3 && func_803048E0(sp3C, &sp4C, &sp48, 3, (s32) (func_8033229C(arg0) * 4.0f))) {
sp50[0] = (f32) sp48->x;
sp50[1] = (f32) sp48->y;
sp50[2] = (f32) sp48->z;
__spawnQueue_add_5((GenFunction_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, sp5C));
__spawnQueue_add_5((GenFunction_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, sp50[0]), reinterpret_cast(s32, sp50[1]), reinterpret_cast(s32, sp50[2]), reinterpret_cast(s32, player_yaw));
} else {
sp38 = this->position[1] + func_8033229C(arg0);
__spawnQueue_add_5((GenFunction_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, sp38), reinterpret_cast(s32, this->position[2]), reinterpret_cast(s32, sp5C));
__spawnQueue_add_5((GenFunction_5)func_802C4260, sp70 + 0x15, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, sp38), reinterpret_cast(s32, this->position[2]), reinterpret_cast(s32, player_yaw));
}
func_8032EE20();
}

View File

@@ -1,6 +1,7 @@
#include <ultra64.h>
#include "functions.h"
#include "variables.h"
#include "core2/ba/physics.h"
void func_80291930(s32);
@@ -20,7 +21,7 @@ void func_80291930(s32 arg0){
func_8029C984();
bs_setState(BS_5A_LOADZONE);
baModel_setVisible(FALSE);
func_802978DC(7);
baphysics_set_type(BA_PHYSICS_FREEZE);
func_8029151C(6);
}
}

Some files were not shown because too many files have changed in this diff Show More