Use act() in reactor scripts where possible, provide empty act() otherwise

"function hit()" has triggered on each reactor hit,
while "function act()" is only triggered once it's destroyed or reached an end state
This commit is contained in:
P0nk
2022-08-31 21:33:50 +02:00
parent 298457a007
commit ea76880b7f
10 changed files with 25 additions and 14 deletions

View File

@@ -26,4 +26,6 @@
function hit() {
var map = rm.getMap();
map.moveEnvironment("trap" + rm.getReactor().getName()[5], 1);
}
}
function act() {}

View File

@@ -25,6 +25,6 @@
* Neo City Trash Can
*/
function hit() {
function act() {
rm.dropItems(true, 2, 5, 10, 1);
}

View File

@@ -25,6 +25,6 @@
* Neo City Trash Can
*/
function hit() {
function act() {
rm.dropItems(true, 2, 5, 10, 1);
}

View File

@@ -26,4 +26,6 @@
function hit() {
rm.sprayItems();
}
}
function act() {}

View File

@@ -2,8 +2,6 @@
Yulete's Lab: Making the Reagent
*/
function hit() {
if (rm.getReactor().getState() == 4) {
rm.dropItems();
}
function act() {
rm.dropItems();
}

View File

@@ -40,4 +40,6 @@ function hit() {
rm.getMap().getReactorByName(reactname).hitReactor(rm.getClient());
}
}
}
}
function act() {}

View File

@@ -20,11 +20,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*2618000.js - MagatiaPQ Beaker
/*2618001.js - MagatiaPQ Door
*@author Ronan
*/
function hit() {
function act() {
var eim = rm.getEventInstance();
var isAlcadno = eim.getIntProperty("isAlcadno");

View File

@@ -20,11 +20,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*2618000.js - MagatiaPQ Beaker
/*2618002.js - MagatiaPQ Door
*@author Ronan
*/
function hit() {
function act() {
var eim = rm.getEventInstance();
var isAlcadno = eim.getIntProperty("isAlcadno");

View File

@@ -26,4 +26,9 @@
function hit() {
rm.dropItems();
}
function act() {
// There's a timeout of 3 seconds to revert back from state 1 to 0.
// Reactor is destroyed (state 2) and triggers this if dropping two Magic Devices at once, which shouldn't really happen.
}

View File

@@ -39,4 +39,6 @@ function hit() {
//spawnJrBoss(mapObj.getMonsterById(8820023));
mapObj.killMonster(8820000);
}
}
function act() {}