bow changes mode, disables achievements, displayed in rich presence and bottom line

This commit is contained in:
Zeno Rogue 2023-10-27 22:46:11 +02:00
parent 4ddccfed8e
commit 079094799d
4 changed files with 16 additions and 1 deletions

View File

@ -108,6 +108,7 @@ EX bool wrongMode(char flags) {
if(cheater) return true;
if(casual) return true;
if(flags == rg::global) return false;
if(bow::weapon) return true;
if(flags != rg::special_geometry && flags != rg::special_geometry_nicewalls) {
if(!BITRUNCATED) return true;
@ -636,6 +637,7 @@ EX void achievement_score(int cat, int number) {
#ifdef HAVE_ACHIEVEMENTS
if(cheater) return;
if(casual) return;
if(bow::weapon) return;
LATE( achievement_score(cat, number); )
if(disksize) return;
if(cat == LB_HALLOWEEN) {
@ -744,6 +746,7 @@ EX void achievement_final(bool really_final) {
}
if(cheater) return;
if(casual) return;
if(bow::weapon) return;
#if CAP_TOUR
if(tour::on) return;
@ -867,6 +870,7 @@ EX void achievement_victory(bool hyper) {
#ifdef HAVE_ACHIEVEMENTS
if(cheater) return;
if(casual) return;
if(bow::weapon) return;
if(geometry) return;
if(CHANGED_VARIATION) return;
if(randomPatternsMode) return;
@ -958,6 +962,7 @@ EX string get_rich_presence_text() {
if(inv::on) res += "OSM ";
if(multi::players > 1) res += "multi ";
if(casual) res += "casual ";
if(bow::weapon) res += bow::style == bow::cbBull ? "bow/bull " : "bow/geo ";
if(cheater || among(cwt.at->land, laCanvas, laCA))
return res + "(?)";

View File

@ -698,6 +698,8 @@ EX void drawStats() {
if(peace::on) vers += " peace";
if(racing::on) vers += " racing";
if(daily::on) vers += " strange";
if(bow::weapon && bow::style == bow::cbBull) vers += " b/bull";
if(bow::weapon && bow::style == bow::cbGeodesic) vers += " b/geo";
if(land_structure != default_land_structure())
vers += land_structure_name(true);
if(princess::challenge) vers += " Princess";

View File

@ -438,7 +438,7 @@ EX namespace scores {
/** \brief the amount of boxes reserved for each hr::score item */
#define MAXBOX 500
/** \brief currently used boxes in hr::score */
#define POSSCORE 406
#define POSSCORE 408
/** \brief a struct to keep local score from an earlier game */
struct score {
/** \brief version used */
@ -933,6 +933,9 @@ EX void applyBoxes() {
applyBoxI(itCurseWater, true);
list_invorb();
applyBoxEnum(bow::weapon, "weapon choice");
applyBoxEnum(bow::style, "crossbow style");
if(POSSCORE != boxid) printf("ERROR: %d boxes\n", boxid);
if(isize(invorb)) { println(hlog, "ERROR: Orbs not taken into account"); exit(1); }
}

View File

@ -981,6 +981,11 @@ void save_mode_data(hstream& f) {
if(casual) {
f.write<char>(1);
}
if(bow::weapon) {
f.write<char>(2);
f.write<char>(bow::weapon);
f.write<char>(bow::style);
}
}
EX modecode_t modecode(int mode) {