From 079094799d33e8709233337e640f15616a3e566e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 27 Oct 2023 22:46:11 +0200 Subject: [PATCH] bow changes mode, disables achievements, displayed in rich presence and bottom line --- achievement.cpp | 5 +++++ hud.cpp | 2 ++ system.cpp | 5 ++++- yendor.cpp | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/achievement.cpp b/achievement.cpp index 6b0443ab..1fc27434 100644 --- a/achievement.cpp +++ b/achievement.cpp @@ -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 + "(?)"; diff --git a/hud.cpp b/hud.cpp index f1fecd80..a99f271d 100644 --- a/hud.cpp +++ b/hud.cpp @@ -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"; diff --git a/system.cpp b/system.cpp index 522ecf14..292b1890 100644 --- a/system.cpp +++ b/system.cpp @@ -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); } } diff --git a/yendor.cpp b/yendor.cpp index b23520a0..354418cb 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -981,6 +981,11 @@ void save_mode_data(hstream& f) { if(casual) { f.write(1); } + if(bow::weapon) { + f.write(2); + f.write(bow::weapon); + f.write(bow::style); + } } EX modecode_t modecode(int mode) {