1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-02-02 04:09:16 +00:00

movegen in -cmove

This commit is contained in:
Zeno Rogue 2020-04-05 10:48:05 +02:00
parent 8eba146750
commit 974a98e32c

View File

@ -559,10 +559,19 @@ EX void viewall() {
/** perform a move for the -cmove command */ /** perform a move for the -cmove command */
int cheat_move_gen = 7;
void cheat_move(char c) { void cheat_move(char c) {
using arg::cheat; using arg::cheat;
if(c >= '0' && c <= '9') cheat(), cwt += (c - '0'); if(c >= '0' && c <= '9' && cheat_move_gen == -1) cheat_move_gen = (c - '0');
else if(c == 's') cheat(), cwt += wstep, playermoved = false; else if(c >= '0' && c <= '9') cheat(), cwt += (c - '0');
else if(c == 's') {
cheat();
cwt += wstep;
playermoved = false;
setdist(cwt.at, cheat_move_gen, cwt.peek());
if(geometry_supports_cdata()) getCdata(cwt.at, 0);
}
else if(c == 'r') cheat(), cwt += rev; else if(c == 'r') cheat(), cwt += rev;
else if(c == 'm') cheat(), cwt += wmirror; else if(c == 'm') cheat(), cwt += wmirror;
else if(c == 'z') cheat(), cwt.spin = 0, cwt.mirrored = false; else if(c == 'z') cheat(), cwt.spin = 0, cwt.mirrored = false;
@ -570,6 +579,7 @@ void cheat_move(char c) {
else if(c == 'E') centering = eCentering::edge, fullcenter(); else if(c == 'E') centering = eCentering::edge, fullcenter();
else if(c == 'V') centering = eCentering::vertex, fullcenter(); else if(c == 'V') centering = eCentering::vertex, fullcenter();
else if(c == 'a') cheat(), history::save_end(); else if(c == 'a') cheat(), history::save_end();
else if(c == 'g') cheat_move_gen = -1;
else println(hlog, "unknown move command: ", c); else println(hlog, "unknown move command: ", c);
} }