From 444bb762d782ac01f60a35d3d7eaf2e76c3d5e20 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 25 Dec 2018 23:54:34 +0100 Subject: [PATCH] crystal:: added a conduct for doing Camelot without compasses --- crystal.cpp | 2 ++ graph.cpp | 5 ++++- help.cpp | 12 ++++++++++++ system.cpp | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/crystal.cpp b/crystal.cpp index b791e277..87c437ae 100644 --- a/crystal.cpp +++ b/crystal.cpp @@ -22,6 +22,8 @@ bool pure() { bool view_coordinates = false; bool view_east = false; +bool used_compass_inside; + const int MAXDIM = 7; typedef array coord; diff --git a/graph.cpp b/graph.cpp index 295bbdc8..2df4857a 100644 --- a/graph.cpp +++ b/graph.cpp @@ -668,8 +668,11 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int pticks, else if(it == itCompass) { transmatrix V2; - if(geometry == gCrystal) + if(geometry == gCrystal) { + if(crystal::compass_probability <= 0) return true; + if(cwt.at->land == laCamelot && celldistAltRelative(cwt.at) < 0) crystal::used_compass_inside = true; V2 = V * spin(crystal::compass_angle() + M_PI); + } else { cell *c1 = c ? findcompass(c) : NULL; if(c1) { diff --git a/help.cpp b/help.cpp index 63139025..894c6230 100644 --- a/help.cpp +++ b/help.cpp @@ -710,6 +710,18 @@ string generateHelpForLand(eLand l) { ); } + if(l == laCamelot && geometry == gCrystal) { + if(!crystal::used_compass_inside) s += XLAT("\nSpecial conduct (still valid)\n"); + else s += XLAT("\nSpecial conduct failed:\n"); + + s += XLAT( + "Do not use compases.\n\n"); + + s += XLAT("Crystal Camelot is an octahedron in 'pure' 3D crystal geometry (and a similar polytope in other pure crystals), " + "and an Euclidean ball in bitruncated/Goldberg crystals."); + } + + auto lv = land_validity(specialland); if(lv.flags & lv::display_in_help) s += "\n\n" + XLAT(lv.msg); diff --git a/system.cpp b/system.cpp index f93bdab4..8c928ce5 100644 --- a/system.cpp +++ b/system.cpp @@ -267,6 +267,7 @@ void initgame() { timerghost = true; truelotus = 0; survivalist = true; + crystal::used_compass_inside = false; got_survivalist = false; #if CAP_INV if(inv::on) inv::init();