Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/1EC20.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ void func_8002ED80(struct EngineObj* arg0)
void func_8002ED98(struct EngineObj* arg0)
{
func_800129F0(8);
arg0->unk2 = 0;
arg0->unk1++;
arg0->unk2 = 0;
}

// engine_state_3_update_funcs state 7
Expand Down
2 changes: 1 addition & 1 deletion src/main/1FD10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

void func_8002F510(struct EngineObj* arg0)
{
arg0->unk3 = 0;
arg0->unk2++;
arg0->unk3 = 0;
}

void func_8002F524(struct EngineObj* arg0)
Expand Down
12 changes: 6 additions & 6 deletions src/main/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ void func_80027850(void)

void func_80027908(struct BackgroundObj* arg0)
{
arg0->unk47 = 2;
arg0->unk48 = 8;
arg0->unk2C = 0x60;
arg0->unk2E = 0xC0;
arg0->unk30 = 0xA0;
arg0->unk32 = 0xA0;
arg0->unk14.val = arg0->x_pos.val;
arg0->unk18.val = arg0->y_pos.val;
arg0->unk24 = arg0->unk1C;
arg0->unk26 = arg0->unk1E;
arg0->unk28 = arg0->unk20;
arg0->unk2A = arg0->unk22;
arg0->unk47 = 2;
arg0->unk48 = 8;
arg0->unk2C = 0x60;
arg0->unk2E = 0xC0;
arg0->unk30 = 0xA0;
arg0->unk32 = 0xA0;
arg0->unk4++;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/character_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ void character_select_state_4(struct EngineObj* arg0)
arg0->character_state.bytes[1] |= 0x80;
}
} else if (!(arg0->character_state.bytes[1] & 0x7F)) {
arg0->unk1++;
arg0->unk2 = 0;
arg0->unk4 = 20; // how long to wait on green background before fading out
arg0->unk1++;
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/effects/effect_24_boss_warning.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ void boss_warning_advance_tiles(struct EffectObj* self)

effect = boss_warning_tiles[self->ext.effect_24.unk1B];
effect->unk5++;
if (++self->ext.effect_24.unk1B == 0x16) {
self->ext.effect_24.unk1B++;
if (self->ext.effect_24.unk1B == 0x16) {
old_unk5 = self->unk5;
self->ext.effect_24.timer = 0x3C;
self->unk5 = old_unk5 + 1;
self->ext.effect_24.timer = 0x3C;
if (engine_obj.stage == 0) {
func_8001653C();
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/game_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ void func_8001D698(struct GameInfo* arg0)
arg0->mode = 0;
arg0->unk2 = 0;
arg0->unk3 = 0;
if (++arg0->unkC == 4) {
arg0->unkC++;
if (arg0->unkC == 4) {
arg0->unkC = 0;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/items/item_19_data_capsule.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ void data_capsule_idle(struct ItemObj* arg0)
void data_capsule_attached_init(struct ItemObj* arg0)
{
arg0->state = 1;
arg0->on_screen = 1;
arg0->unk5 = 0;
arg0->unk6 = 0;
arg0->unk7 = 0;
arg0->on_screen = 1;
arg0->unk18.val = arg0->x_pos.val;
arg0->unk1C.val = arg0->y_pos.val;
arg0->unk54 = 0;
arg0->unk50 = 0;
arg0->unk68 = NULL;
Expand All @@ -67,8 +69,6 @@ void data_capsule_attached_init(struct ItemObj* arg0)
arg0->unk28 = 0;
arg0->unk2C = 0;
arg0->unk16 = 4;
arg0->unk18.val = arg0->x_pos.val;
arg0->unk1C.val = arg0->y_pos.val;
set_animation(arg0, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/layers/layer_04_volcano_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ void volcano_camera_update(struct LayerObj* arg0)

void volcano_camera_init(struct LayerObj* arg0)
{
arg0->state++;
arg0->unk5 = 1;
arg0->bg_offset = 2;
arg0->state++;
background_objects[0].unk2E = 0xA0;
background_objects[0].unk2C = 0x50;
volcano_camera_main(arg0);
Expand Down
3 changes: 1 addition & 2 deletions src/main/mains/main_02_item_carrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,10 @@ void item_carrier_leave_start(struct MainObj* self)
{
if ((self->y_pos.val > g_Player.y_pos.val)) {
self->unk6 = 1;
self->unk7 = 0;
} else {
self->unk6 = 2;
self->unk7 = 0;
}
self->unk7 = 0;
}

void item_carrier_leave_up(struct MainObj* self)
Expand Down
2 changes: 1 addition & 1 deletion src/main/mains/main_04_drill_copter.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ void drill_copter_drop(struct MainObj* self)

void drill_copter_drop_start(struct MainObj* self)
{
self->unk6++;
self->unk7C = 0x1E;
self->air_state = -1;
self->unk6++;
set_animation(self, 4);
func_8001540C(2, 8, self);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/mains/main_08_eregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ void eregion_recoil_start(struct MainObj* self)
set_animation(self, 0xA);
self->x_speed = self->x_pos.i.hi;
if (self->animation_step.fields.frame_index == 0x1C || self->animation_step.fields.frame_index == 0x1D) {
s32 x_speed = (s16)self->x_speed;
self->x_pos.i.hi = self->unk15 != 0 ? x_speed - 0x16 : x_speed + 0x16;
s16 x_speed = self->x_speed;
self->x_pos.i.hi = x_speed + (self->unk15 != 0 ? -0x16 : 0x16);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/mains/main_34_highway_trooper.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void highway_trooper_attack_fire(struct MainObj* self)
void highway_trooper_attack_ready_jump(struct MainObj* self)
{
if (self->animation_step.fields.event == 2) {
if (self->unk2 == self->animation_step.fields.event) {
if (self->unk2 == 2) {
self->terrain_box = &highway_trooper_terrain_box;
}
self->unk6++;
Expand Down
5 changes: 1 addition & 4 deletions src/main/mains/main_49_train_soldier.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ void train_soldier_despawn(struct MainObj* self)
{
if (SP_CUR_MAIN_OBJ->ext.main_49.unk86 == 0) {
despawn_object(OBJECT_HEADER(self));
return;
}

if (self->unk2 == 9) {
} else if (self->unk2 == 9) {
despawn_object(OBJECT_HEADER(self));
} else {
despawn_object_permanently(OBJECT_HEADER(self));
Expand Down
4 changes: 2 additions & 2 deletions src/main/mains/main_56_jet_stingray.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,10 @@ void jet_stingray_leap_start(struct MainObj* self)
void jet_stingray_leap_fall(struct MainObj* self)
{
if (self->y_speed > 0) {
self->y_speed = 0;
self->gravity = -FIXED(0.8125);
self->unk6++;
self->ext.main_56.flags &= ~2;
self->y_speed = 0;
self->gravity = -FIXED(0.8125);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/mains/main_57_frost_walrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void frost_walrus_breath_launch(struct MainObj* self)
{
animate_object(ANIMATED_OBJECT(self));
if (self->animation_step.fields.event == 1) {
self->ext.main_57.shot->unk8C.word = self->animation_step.fields.event;
self->ext.main_57.shot->unk8C.word = 1;
spawn_debris(0xA, frost_walrus_breath_debris, self->ext.main_57.shot);
}
if (self->animation_step.fields.event == 2) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/mains/main_60_storm_owl.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,10 +563,10 @@ void storm_owl_feather_volley_start(struct MainObj* self)
{
animate_object(ANIMATED_OBJECT(self));
set_animation(self, 3);
self->unk15 = self->ext.main_60.corner >= 2 ? 0 : 0x40;
self->unk7C = 0x1C;
self->collision_data = (const u16*)D_80107B78;
self->ext.main_60.shot_count = 0;
self->unk15 = self->ext.main_60.corner < 2 ? 0x40 : 0;
self->unk6++;
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/mains/main_61_split_mushroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,8 @@ void split_mushroom_spore_rain_recover(struct MainObj* self)

void split_mushroom_spore_rain_finish(struct MainObj* self)
{
u16 timer;
animate_object(ANIMATED_OBJECT(self));
timer = --self->unk7C;
if ((timer << 16) == 0) {
if (--self->unk7C == 0) {
self->y_speed = 0;
if (self->unk2 == 0) {
self->unk7C = 6;
Expand Down
2 changes: 1 addition & 1 deletion src/main/mains/main_64_cyber_peacock.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ void cyber_peacock_start_teleport(struct MainObj* self)
void cyber_peacock_teleport_start(struct MainObj* self)
{
cyber_peacock_start_teleport(self);
self->unk7 = 0;
self->unk6++;
self->unk7 = 0;
set_animation(self, 2);
self->ext.main_64.skip_attack = 0;
}
Expand Down
13 changes: 5 additions & 8 deletions src/main/mains/main_68_sigma.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,8 @@ void sigma_death(struct MainObj* self)

void sigma_cloak_stagger_start(struct MainObj* self)
{
self->unk42 &= 0x7FFF;
self->unk4B = -1;
self->unk42 &= 0x7FFF;
self->unk5++;
self->unk7C = 0x40;
self->unk7E = 4;
Expand Down Expand Up @@ -947,11 +947,8 @@ void sigma_cloak_stagger_fade(struct MainObj* self)

void sigma_cloak_stagger_finish(struct MainObj* self)
{
s16 timer = self->unk7C;
self->on_screen = 0;
timer--;
self->unk7C = timer;
if (timer == 0) {
if (--self->unk7C == 0) {
self->state = 1;
self->unk5 = 2;
self->unk6 = 0;
Expand Down Expand Up @@ -1055,18 +1052,18 @@ void sigma_reveal_dialogue(struct MainObj* self)

void sigma_reveal_fill_health(struct MainObj* self)
{
u16 temp_v0;
s16 temp_v0;

if (self->hp < 0x30) {
temp_v0 = --self->unk7C;
if ((temp_v0 << 0x10) == 0) {
if (temp_v0 == 0) {
func_8001540C(0, 0xE, 0);
self->unk7C = 2;
}
self->hp = (s8)((u8)self->hp + 1);
} else {
self->unk7C = 0x5A;
self->unk5 = (s8)((u8)self->unk5 + 1);
self->unk7C = 0x5A;
}
is_on_screen(BASE_OBJECT(self));
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/mains/main_69_colonel.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ void colonel_spawn(struct MainObj* self)
void colonel_spawn_warning(struct MainObj* self)
{
struct EffectObj* effect;
u8 value;

value = self->unk2;
self->ext.main_69.state.bytes.variant = value;
if (value == 1) {
self->ext.main_69.state.bytes.variant = self->unk2;
if (self->ext.main_69.state.bytes.variant == 1) {
self->unk5++;
} else {
effect = find_free_effect_obj();
Expand Down
19 changes: 7 additions & 12 deletions src/main/mains/main_72_unused_ride_armor.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,28 @@

void unused_ride_armor_init(struct MainObj* self)
{
s32 x_pos;
s32 y_pos;

x_pos = self->x_pos.val;
y_pos = self->y_pos.val;
self->state = 1;
self->unk5 = 2;
self->unk6 = 0;
self->unk7 = 0;
self->unk7C = 0;
self->on_screen = 0;
self->hp = 0x18;
self->contact_damage = 6;
self->invincibility_timer = 0;
self->unk18.val = self->x_pos.val;
self->unk1C.val = self->y_pos.val;
self->animation_table = (const u8* const*)unused_ride_armor_animations;
self->hurt_box = (const u8*)&unused_ride_armor_hit_box;
self->attack_box = (const u8*)&unused_ride_armor_hit_box;
self->terrain_box = &unused_ride_armor_terrain_box;
self->collision_data = (const u16*)D_80108184;
self->unk6 = 0;
self->unk7 = 0;
self->unk7C = 0;
self->on_screen = 0;
self->invincibility_timer = 0;
self->air_state = 0;
self->x_speed = 0;
self->y_speed = 0;
self->x_accel = 0;
self->gravity = 0;
self->unk16 = 5;
self->unk18.val = x_pos;
self->unk1C.val = y_pos;
}

void unused_ride_armor_face_player(struct MainObj* self)
Expand Down
2 changes: 1 addition & 1 deletion src/main/mains/main_75_general.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void general_punch_rings(struct MainObj* self)

void general_punch_wait_return(struct MainObj* self)
{
if ((general_fists[0]->timer == 0x80) && (general_fists[1]->timer == general_fists[0]->timer)) {
if ((general_fists[0]->timer == 0x80) && (general_fists[1]->timer == 0x80)) {
self->unk6++;
general_fists[0]->state++;
general_fists[1]->state++;
Expand Down
4 changes: 1 addition & 3 deletions src/main/misc/misc_05_pod_effect.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ void pod_effect_animate(struct MiscObj* self)

animate_object(ANIMATED_OBJECT(self));
if (self->unk2 == 0) {
if (self->animation_step.fields.event != 0) {
self->state = 5;
} else if (self->animation_step.fields.relative_step < 0) {
if ((self->animation_step.fields.event != 0) || (self->animation_step.fields.relative_step < 0)) {
self->state = 5;
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/main/misc/misc_11_blink_marker.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ void blink_marker_main(struct MiscObj* self)
if (FLICKER_ENABLED) {
self->on_screen ^= 1;
}
if (self->on_screen == 0) {
return;
if (self->on_screen != 0) {
is_on_screen(BASE_OBJECT(self));
}
} else {
animate_object(ANIMATED_OBJECT(self));
is_on_screen(BASE_OBJECT(self));
}
is_on_screen(BASE_OBJECT(self));
}

void blink_marker_despawn(struct MiscObj* self)
Expand Down
2 changes: 1 addition & 1 deletion src/main/misc/misc_14_frame_ghost.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ void frame_ghost_init(register struct MiscObj* self)
u8 state;

source = self->ext.pointer.unk50;
state = self->state + 1;
self->unk40 = source->unk40;
self->unk42 = source->unk42 & 0x7FFF;
self->animation_table = source->animation_table;
self->unk3C = source->unk3C;
self->bg_offset = source->bg_offset;
self->unk15 = 0;
self->unk16 = 7;
state = self->state + 1;
self->state = state;
set_animation_frame(ANIMATED_OBJECT(self), 2, self->unk2);
self->unk7 = 0xA;
Expand Down
3 changes: 1 addition & 2 deletions src/main/misc/misc_33_cyberspace_warp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ void cyberspace_warp_despawn(struct MiscObj* self)

void cyberspace_warp_fade(struct MiscObj* self)
{

animate_object(ANIMATED_OBJECT(self));
if (--self->ext.misc_33.timer == 0) {
self->state++;
self->unk5 = 0;
self->unk6 = 0;
self->state++;
}
if (func_8002B160(BASE_OBJECT(self)) == 0) {
is_on_screen(BASE_OBJECT(self));
Expand Down
Loading
Loading