1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-18 06:30:41 +00:00

bringris:: BSHIFT achievement

This commit is contained in:
Zeno Rogue 2024-08-24 16:09:58 +02:00
parent 8a0ff206d5
commit ca23a13fc5

View File

@ -680,6 +680,27 @@ bool shape_conflict(cellwalker cw) {
return false; return false;
} }
bool check_bshift(cellwalker c0, cellwalker c1) {
if(c0.at->type != 6) return false;
auto shape0 = build_from(piecelist[shape_id].code, c0);
auto shape1 = build_from(piecelist[shape_id].code, c1);
for(int i=0; i<isize(shape0); i++) {
if(isNeighbor(shape0[i].at, c0.at))
if(isNeighbor(shape1[i].at, c1.at))
if(shape0[i].at != shape1[i].at)
if(!isNeighbor(shape0[i].at, shape1[i].at)) {
cell *cfound = nullptr;
forCellEx(c, shape0[i].at) if(isNeighbor(c, shape1[i].at)) {
cfound = c;
}
if(!cfound) continue;
if(!cfound->wall) continue;
if(shape1[i].at->cmove(up_dir())->wall) return true;
}
}
return false;
}
ld current_move_time_limit() { ld current_move_time_limit() {
// return 50000 * pow(.9, completed) + 10000. / (1 + completed); // return 50000 * pow(.9, completed) + 10000. / (1 + completed);
return 3500 * pow(.995, completed * isize(level)); return 3500 * pow(.995, completed * isize(level));
@ -1007,6 +1028,7 @@ void shift_block(int dir, bool camera_only) {
if(camera_only || !shape_conflict(at1)) { if(camera_only || !shape_conflict(at1)) {
// playSound(cwt.at, "hit-crush1"); // playSound(cwt.at, "hit-crush1");
if(check_bshift(at, at1)) rv_achievement("BSHIFT");
at = at1; at = at1;
if(solnil) { if(solnil) {
pView = pView * currentmap->adj(cwt.at, nilmap(dir)); pView = pView * currentmap->adj(cwt.at, nilmap(dir));