moved dual geometry puzzle to RogueViz

This commit is contained in:
Zeno Rogue 2022-06-17 01:20:34 +02:00
parent f3f502e65e
commit 9bb9fd572d
6 changed files with 25 additions and 8 deletions

View File

@ -125,7 +125,6 @@ EX bool wrongMode(char flags) {
if(yendor::on) return true;
if(peace::on) return true;
if(tactic::on) return true;
if(dpgen::in) return true;
#if CAP_TOUR
if(tour::on) return true;
#endif

View File

@ -121,7 +121,6 @@
#include "bigstuff.cpp"
#include "multigame.cpp"
#include "inforder.cpp"
#include "dpgen.cpp"
#include "vr.cpp"
#include "intra.cpp"

View File

@ -327,7 +327,6 @@ EX void wandering() {
if(!canmove) return;
if(!gen_wandering) return;
if(racing::on) return;
if(dpgen::in) return;
if(items[itOrbSafety]) return;
pathdata pd(moYeti);
int seepcount = getSeepcount();

View File

@ -136,6 +136,8 @@ EX namespace dual {
hyperpoint which_dir;
EX purehookset hooks_after_move;
int remap_direction(int d, int cg) {
if(WDIM == 2 || cg == currently_loaded) return d;
@ -247,7 +249,7 @@ EX namespace dual {
switch_to(1); forcedmovetype = fm; movepcto(0, subdir, false); forcedmovetype = fmSkip;
switch_to(cg);
reduceOrbPowers();
dpgen::check();
callhooks(hooks_after_move);
return true;
}
addMessage(XLAT("Impossible."));

View File

@ -5,7 +5,7 @@
* \brief dual geometry puzzle generator
*/
#include "hyper.h"
#include "rogueviz.h"
namespace hr {
@ -58,6 +58,8 @@ void solve(cpos at) {
int last_elimit, last_hlimit;
void check();
void launch(int seed, int elimit, int hlimit) {
/* setup */
@ -159,6 +161,10 @@ void launch(int seed, int elimit, int hlimit) {
worst.first->wall = waOpenPlate;
worst.second->wall = waOpenPlate;
rogueviz::rv_hook(dual::hooks_after_move, 100, dpgen::check);
bool b = gen_wandering;
rogueviz::on_cleanup_or_next([b] { gen_wandering = b; });
gen_wandering = false;
}
struct puzzle {
@ -260,7 +266,21 @@ auto sbhook = addHook(hooks_args, 100, [] {
return 0;
}) + addHook(hooks_o_key, 91, [] (o_funcs& v) {
if(in) v.push_back(named_dialog(XLAT("select a puzzle"), show_menu));
});
})
+ addHook_rvslides(205, [] (string s, vector<tour::slide>& v) {
if(s != "mixed") return;
v.push_back(tour::slide{
"dual geometry puzzle", 10, tour::LEGAL::NONE | tour::QUICKSKIP | tour::QUICKGEO,
"Move both characters to marked squares at once!\n"
,
[] (tour::presmode mode) {
slide_action(mode, 'r', "launch the dual geometry puzzle", [] {
pushScreen(show_menu);
});
}
});
})
;
#endif
EX }

View File

@ -376,7 +376,6 @@ EX void initgame() {
truelotus = 0;
asteroids_generated = 0;
asteroid_orbs_generated = 0;
dpgen::in = false;
survivalist = true;
#if CAP_CRYSTAL
crystal::used_compass_inside = false;
@ -1022,7 +1021,6 @@ EX void saveStats(bool emergency IS(false)) {
if(randomPatternsMode) return;
if(daily::on) return;
if(peace::on) return;
if(dpgen::in) return;
if(experimental) return;
if(!gold() && !racing::on) return;