Skip to content
Open
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
Binary file modified rectests/65K6P.REC
Binary file not shown.
Binary file modified rectests/AIR-HIT.REC
Binary file not shown.
Binary file modified rectests/ELECTRA-EXROLLTHNDR-WALLBOUNCE.REC
Binary file not shown.
Binary file modified rectests/FLAIL_454P.REC
Binary file not shown.
Binary file modified rectests/JAG-THROW-LAND.REC
Binary file not shown.
Binary file modified rectests/KEEP-WALKING-AFTER-JAG-STANDING-THROW.REC
Binary file not shown.
Binary file modified rectests/NOVA-1P.REC
Binary file not shown.
Binary file modified rectests/POWERPLANT-WALL-SPLAT.REC
Binary file not shown.
Binary file modified rectests/PROJECTILE-KNOCKBACK.REC
Binary file not shown.
Binary file modified rectests/SUPERJUMP.REC
Binary file not shown.
11 changes: 0 additions & 11 deletions src/game/objects/har.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ void har_set_ani(object *obj, int animation_id, int repeat) {
}
object_set_repeat(obj, repeat);
object_set_stride(obj, 1);
object_dynamic_tick(obj);
// update this so mx/my have correct origins
obj->start = obj->pos;
h->damage_done = 0;
Expand Down Expand Up @@ -316,7 +315,6 @@ void har_walk_to(object *obj, int destination) {
object_set_repeat(obj, 1);
object_set_stride(obj, 1);
h->walk_destination = destination;
object_dynamic_tick(obj);
// update this so mx/my have correct origins
obj->start = obj->pos;
}
Expand Down Expand Up @@ -555,7 +553,6 @@ void har_move(object *obj) {
object_set_animation(enemy_obj, &af_get_move(enemy_har->af_data, ANIM_DAMAGE)->ani);
object_set_repeat(enemy_obj, 0);
object_set_custom_string(enemy_obj, str_c(&move->footer_string));
object_dynamic_tick(enemy_obj);

h->walk_destination = -1;
h->walk_done_anim = 0;
Expand Down Expand Up @@ -877,7 +874,6 @@ void har_take_damage(object *obj, const str *string, float damage, float stun) {
object_set_custom_string(obj, str_c(string));
log_debug("HAR %s animation set to %s", har_get_name(h->id), str_c(string));
}
object_dynamic_tick(obj);

// XXX hack - if the first frame has the 'k' tag, treat it as some vertical knockback
// we can't do this in player.c because it breaks the jaguar leap, which also uses the 'k' tag.
Expand Down Expand Up @@ -929,7 +925,6 @@ static void har_spawn_oil(object *obj, vec2i pos, int amount, int layer) {
object_set_stl(scrap, object_get_stl(obj));
object_set_gravity(scrap, har_sparks_random_gravity(obj));
object_set_layers(scrap, LAYER_SCRAP);
object_dynamic_tick(scrap);
scrap_create(scrap);
game_state_add_object(obj->gs, scrap, layer, 0, 0);
}
Expand Down Expand Up @@ -972,7 +967,6 @@ void har_spawn_scrap(object *obj, vec2i pos, int amount) {
object_set_pal_limit(obj, object_get_pal_limit(obj));
object_set_layers(scrap, LAYER_SCRAP);
object_set_group(scrap, GROUP_SCRAP);
object_dynamic_tick(scrap);
object_set_shadow(scrap, 1);
scrap_create(scrap);
game_state_add_object(obj->gs, scrap, RENDER_LAYER_TOP, 0, 0);
Expand All @@ -995,7 +989,6 @@ void har_block(object *obj, vec2i hit_coord, uint8_t block_stun) {
snprintf(stun_str, sizeof(stun_str), "A%d", block_stun);
object_set_custom_string(obj, stun_str);
object_set_repeat(obj, 0);
object_dynamic_tick(obj);
// blocking spark
if(h->damage_received) {
// don't make another scrape
Expand All @@ -1011,8 +1004,6 @@ void har_block(object *obj, vec2i hit_coord, uint8_t block_stun) {
object_set_repeat(scrape, 0);
object_set_gravity(scrape, 0);
object_set_layers(scrape, LAYER_SCRAP);
object_dynamic_tick(scrape);
object_dynamic_tick(scrape);
game_state_play_sound(obj->gs, 3, 0.7f, 0.5f, 1.0f);
game_state_add_object(obj->gs, scrape, RENDER_LAYER_MIDDLE, 0, 0);
h->damage_received = 1;
Expand Down Expand Up @@ -1975,7 +1966,6 @@ void har_tick(object *obj) {
object_set_custom_string(nobj, "bs100A1-bf0A15");
object_add_animation_effects(nobj, EFFECT_SHADOW);
object_set_direction(nobj, object_get_direction(obj));
object_dynamic_tick(nobj);
game_state_add_object(obj->gs, nobj, RENDER_LAYER_BOTTOM, 0, 0);
}
}
Expand Down Expand Up @@ -2306,7 +2296,6 @@ int har_act(object *obj, int act_type) {
object_set_animation(enemy_obj, &af_get_move(enemy_har->af_data, ANIM_DAMAGE)->ani);
object_set_repeat(enemy_obj, 0);
object_set_custom_string(enemy_obj, str_c(&move->footer_string));
object_dynamic_tick(enemy_obj);
}

if(h->state == STATE_NONE) {
Expand Down
2 changes: 1 addition & 1 deletion src/game/protos/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void object_dynamic_tick(object *obj) {
// Run animation player LAST, so that we have operated what we want on the current tick.
if(obj->cur_animation != NULL && obj->halt == 0) {
for(int i = 0; i < obj->stride; i++) {
player_run(obj);
player_run(obj, true);
}
}
}
Expand Down
25 changes: 14 additions & 11 deletions src/game/protos/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ void player_reload_with_str(object *obj, const char *custom_str) {
}

// Set player state
player_reset(obj);
obj->animation_state.reverse = 0;
obj->slide_state.timer = 0;
obj->slide_state.vel = vec2f_create(0, 0);
Expand All @@ -65,6 +64,7 @@ void player_reload_with_str(object *obj, const char *custom_str) {
obj->q_counter = 0;
obj->q_val = 0;
obj->can_hit = 0;
player_reset(obj);
}

void player_reload(object *obj) {
Expand All @@ -77,6 +77,7 @@ void player_reset(object *obj) {
obj->animation_state.finished = 0;
obj->animation_state.previous = -1;
obj->animation_state.disable_d = 0;
player_run(obj, false);
}

int player_frame_isset(const object *obj, const char *tag) {
Expand Down Expand Up @@ -183,7 +184,7 @@ void player_describe_mp_flags(const sd_script_frame *frame, int mp) {
}
#endif /* DEBUGMODE */

void player_run(object *obj) {
void player_run(object *obj, bool tick) {
// Some vars for easier life
player_animation_state *state = &obj->animation_state;
player_sprite_state *rstate = &obj->sprite_state;
Expand All @@ -198,7 +199,7 @@ void player_run(object *obj) {
if(frame == NULL) {
if(state->repeat) {
player_reset(obj);
frame = sd_script_get_frame_at(&state->parser, state->current_tick);
return;
} else {
state->finished = 1;
if(obj->finish != NULL) {
Expand Down Expand Up @@ -724,15 +725,17 @@ void player_run(object *obj) {
}

// Animation ticks
state->previous_tick = state->current_tick;
if(state->reverse) {
state->current_tick--;
} else {
state->current_tick++;
}
if(tick) {
state->previous_tick = state->current_tick;
if(state->reverse) {
state->current_tick--;
} else {
state->current_tick++;
}

// Sprite ticks
rstate->timer++;
// Sprite ticks
rstate->timer++;
}

// All done.
return;
Expand Down
2 changes: 1 addition & 1 deletion src/game/protos/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void player_reload_with_str(object *obj, const char *str);
void player_reset(object *obj);
int player_frame_isset(const object *obj, const char *tag);
int player_frame_get(const object *obj, const char *tag);
void player_run(object *obj);
void player_run(object *obj, bool tick);
void player_set_repeat(object *obj, int repeat);
int player_get_repeat(const object *obj);
void player_next_frame(object *obj);
Expand Down
1 change: 0 additions & 1 deletion src/game/scenes/arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,6 @@ void arena_dynamic_tick(scene *scene, int paused) {
object_set_layers(scrap, LAYER_SCRAP);
object_set_shadow(scrap, 1);
object_set_group(scrap, GROUP_SCRAP);
object_dynamic_tick(scrap);
scrap_create(scrap);
game_state_add_object(gs, scrap, RENDER_LAYER_TOP, 0, 0);
}
Expand Down
5 changes: 0 additions & 5 deletions src/game/scenes/mechlab.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ bool mechlab_find_last_player(scene *scene) {
object_create(local->mech, scene->gs, vec2i_create(0, 0), vec2f_create(0, 0));
object_set_animation(local->mech, initial_har_ani);
object_set_repeat(local->mech, 1);
object_dynamic_tick(local->mech);
sd_pilot *old_pilot = game_player_get_pilot(p1);
if(&p1->chr->pilot != old_pilot) {
game_player_set_pilot(p1, &p1->chr->pilot);
Expand All @@ -122,7 +121,6 @@ void mechlab_load_har(scene *scene, sd_pilot *pilot) {
object_create(local->mech, scene->gs, vec2i_create(0, 0), vec2f_create(0, 0));
object_set_animation(local->mech, initial_har_ani);
object_set_repeat(local->mech, 1);
object_dynamic_tick(local->mech);
}

void mechlab_set_selling(scene *scene, bool selling) {
Expand All @@ -142,7 +140,6 @@ void mechlab_set_hint(scene *scene, const char *hint) {

static void mechlab_mech_finished_cb(object *obj) {
player_reset(obj);
player_run(obj);
object_set_halt(obj, 1);
}

Expand Down Expand Up @@ -255,7 +252,6 @@ void mechlab_update(scene *scene) {
object_create(local->mech, scene->gs, vec2i_create(0, 0), vec2f_create(0, 0));
object_set_animation(local->mech, initial_har_ani);
object_set_repeat(local->mech, 1);
object_dynamic_tick(local->mech);
}
switch(local->dashtype) {
// Dashboard with the gauges etc.
Expand Down Expand Up @@ -440,7 +436,6 @@ void mechlab_select_dashboard(scene *scene, dashboard_type type) {
object_create(local->mech, scene->gs, vec2i_create(0, 0), vec2f_create(0, 0));
object_set_animation(local->mech, initial_har_ani);
object_set_repeat(local->mech, 1);
object_dynamic_tick(local->mech);

gui_frame_set_root(local->dashboard, lab_dash_newplayer_create(scene, &local->nw));
gui_frame_layout(local->dashboard);
Expand Down
Loading