From 62734bbfc5bdc044adff6bdddb89fe9ca997e712 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 1 Mar 2020 02:34:27 +0100 Subject: [PATCH] charge help, and fixed a bug in help in weird geometry warped cells --- complex.cpp | 4 +++- help.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/complex.cpp b/complex.cpp index e3d95b28..9f94170d 100644 --- a/complex.cpp +++ b/complex.cpp @@ -192,9 +192,11 @@ EX namespace elec { EX bool havecharge, haveelec, havethunder; EX bool afterOrb; // extra charge from the Orb of Lightning + #if HDR enum eCharge { ecCharged, ecGrounded, ecIsolator, ecConductor }; + #endif bool conduct(eCharge cf, eCharge ct) { if(ct == ecIsolator) return false; @@ -202,7 +204,7 @@ EX namespace elec { return ct != cf; } - eCharge getCharge(cell *c) { + EX eCharge getCharge(cell *c) { bool ao = afterOrb && c->ligon; /* not yet generated */ diff --git a/help.cpp b/help.cpp index 94f90256..e4278f02 100644 --- a/help.cpp +++ b/help.cpp @@ -935,7 +935,16 @@ EX void describeMouseover() { appendHelp(string("\n\n") + XLAT(warpdesc)); if(S7 != 7 || !BITRUNCATED) if(c->item != itOrb37) - help += "\n\n" + other_geometry() + forbidden_unmarked(); + appendHelp("\n\n" + other_geometry() + forbidden_unmarked()); + } + + if(isElectricLand(c) || isElectricLand(cwt.at->land)) { + using namespace elec; + eCharge ch = getCharge(c); + if(ch == ecCharged) appendHelp("\n\nThis cell is charged."); + if(ch == ecGrounded) appendHelp("\n\nThis cell is grounded."); + if(ch == ecConductor) appendHelp("\n\nThis cell is currently conductive."); + if(ch == ecIsolator) appendHelp("\n\nThis cell is currently not conductive."); } } else {