mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-26 15:32:19 +00:00
rogueviz:: ads:: in dsgame, better score handling -- ignore nan, keep highest
This commit is contained in:
parent
36e0d8bba2
commit
c8db1ccb1b
@ -405,15 +405,16 @@ bool ds_turn(int idelta) {
|
||||
current.T = lorentz(3, 2, -tc) * current.T;
|
||||
|
||||
auto& mshift = main_rock->pt_main.shift;
|
||||
if(mshift) {
|
||||
if(mshift && !isnan(mshift)) {
|
||||
#if RVCOL
|
||||
constexpr ld win_time = 60;
|
||||
if(current.shift < win_time && (current.shift + mshift) >= win_time && !game_over && no_param_change)
|
||||
if(pdata.score[0] < win_time && (current.shift + mshift) >= win_time && !game_over && no_param_change)
|
||||
rogueviz::rv_achievement("DSGAME");
|
||||
#endif
|
||||
current.shift += mshift;
|
||||
current.T = current.T * lorentz(2, 3, mshift);
|
||||
mshift = 0;
|
||||
pdata.score[0] = max(pdata.score[0], current.shift);
|
||||
}
|
||||
fixmatrix(current.T);
|
||||
|
||||
|
@ -81,7 +81,7 @@ struct player_data {
|
||||
int ammo;
|
||||
ld fuel;
|
||||
ld oxygen;
|
||||
int score[score_types];
|
||||
ld score[score_types];
|
||||
};
|
||||
|
||||
ld ads_how_much_invincibility = TAU / 4;
|
||||
|
@ -19,7 +19,6 @@ void fill_gamedata() {
|
||||
char buf[128]; strftime(buf, 128, "%c", localtime(&timer)); cur.timerend = buf;
|
||||
cur.seconds = int(timer - timerstart);
|
||||
for(int a=0; a<3; a++) cur.scores[a] = pdata.score[a];
|
||||
if(main_rock) cur.scores[0] = current.shift;
|
||||
shstream hs;
|
||||
print(hs, main_rock ? "2 " : "1 ");
|
||||
print(hs, DS_(simspeed), " ", DS_(accel), " ", DS_(how_much_invincibility), " ", vid.creature_scale, " ", DS_(missile_rapidity));
|
||||
|
@ -107,7 +107,7 @@ void display(int id, int y, ld val, ld maxv, ld tank, ld unit) {
|
||||
|
||||
if(maxv == 0) {
|
||||
string s;
|
||||
if(main_rock) s = hr::format(tformat, current.shift);
|
||||
if(main_rock) s = hr::format(tformat, pdata.score[0]);
|
||||
else s = its(val + .5);
|
||||
|
||||
queuestr(sta, ctr, 0, 20, s, col >> 8, 1, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user