Reformat and clean up reactor and base scripts
This commit is contained in:
@@ -26,7 +26,9 @@
|
||||
*/
|
||||
|
||||
function padWithZeroes(n, width) {
|
||||
while(n.length < width) n = '0' + n;
|
||||
while (n.length < width) {
|
||||
n = '0' + n;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -37,17 +39,17 @@ function act() {
|
||||
if (status != null && !status.equals("waiting")) {
|
||||
var stage = parseInt(eim.getProperty("stage1phase"));
|
||||
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
|
||||
@@ -55,8 +57,8 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user