1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-08 13:25:59 +00:00

dual:: a system to change parameters in one of the two maps, currently used only in ge_land_selection

This commit is contained in:
Zeno Rogue
2019-05-29 15:52:49 +02:00
parent f509dd0db0
commit bc8da03ce0
3 changed files with 46 additions and 4 deletions

View File

@@ -281,6 +281,39 @@ namespace dual {
}
}
void add_choice() {
if(!state) return;
dialog::addSelItem(XLAT("subgame affected"),
XLAT(affect_both ? "both" : main_side == 0 ? "left" : "right"), '`');
dialog::add_action([] () {
affect_both = !affect_both;
if(!affect_both) {
main_side = !main_side;
switch_to(main_side);
}
});
}
void split_or_do(reaction_t what) {
if(split(what)) return;
else what();
}
bool may_split(reaction_t what) {
if(state == 1 && affect_both) {
split(what);
return true;
}
return false;
}
void may_split_or_do(reaction_t what) {
if(state == 1 && affect_both) {
split(what);
}
else what();
}
}
}