Reformat and clean up reactor and base scripts

This commit is contained in:
P0nk
2021-09-09 23:38:09 +02:00
parent 3f43fe82d0
commit d9590078f5
231 changed files with 1192 additions and 1075 deletions

View File

@@ -19,6 +19,7 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* @Author Lerk
*
* 9208001.js: Guild Quest - Gatekeeper Puzzle Reactor
@@ -27,7 +28,9 @@
function padWithZeroes(n, width) {
while(n.length < width) n = '0' + n;
while (n.length < width) {
n = '0' + n;
}
return n;
}
@@ -39,17 +42,17 @@ function act() {
var stage = parseInt(eim.getProperty("stage1phase"));
//rm.mapMessage(6,"Stage " + stage);
if (status.equals("display")) {
if(!rm.getReactor().isRecentHitFromAttack()) {
if (!rm.getReactor().isRecentHitFromAttack()) {
var prevCombo = eim.getProperty("stage1combo");
var n = "" + (rm.getReactor().getObjectId() % 1000);
prevCombo += padWithZeroes(n, 3);
eim.setProperty("stage1combo",prevCombo);
eim.setProperty("stage1combo", prevCombo);
if (prevCombo.length == (3 * (stage + 3))) { //end of displaying
eim.setProperty("stage1status","active");
eim.setProperty("stage1status", "active");
rm.mapMessage(5, "The combo has been displayed; Proceed with caution.");
eim.setProperty("stage1guess","");
eim.setProperty("stage1guess", "");
}
}
} else { //active
@@ -57,10 +60,10 @@ function act() {
if (prevGuess.length != (3 * (stage + 3))) {
var n = "" + (rm.getReactor().getObjectId() % 1000);
prevGuess += padWithZeroes(n, 3);
eim.setProperty("stage1guess",prevGuess);
eim.setProperty("stage1guess", prevGuess);
}
//rm.mapMessage(6,"Current Guess: " + prevGuess);
//rm.mapMessage(6,"Current Guess: " + prevGuess);
}
}
}