1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-22 17:37:39 +00:00

ru:: a better implementation of next/current stats

This commit is contained in:
Zeno Rogue
2025-05-19 12:19:42 +02:00
parent 1c4746d6d0
commit 131206f1e5
6 changed files with 34 additions and 28 deletions

View File

@@ -37,6 +37,12 @@ void check_fountains() {
swap(on_fountain, next_on_fountain);
}
void statdata::reset() {
stats = m.base_stats;
coyote_time = 0;
jump_control = 0;
}
void man::act() {
kino();
@@ -45,20 +51,17 @@ void man::act() {
stable_where = where;
}
current_stats = next_stats;
next_stats = base_stats;
current = next;
next.reset();
auto dat = get_dat();
coyote_time = next_coyote_time; next_coyote_time = 0;
jump_control = next_jump_control; next_jump_control = 0;
if(on_floor) on_floor_when = gframeid;
fallthru = false;
handle_powers(dat);
if((on_floor || jump_control || wallhug) && !on_ice) {
if((on_floor || current.jump_control || wallhug) && !on_ice) {
vel.x = zero_vel.x + dat.dx * dat.d * dat.modv * 2.5;
}