This repository has been archived on 2025-02-27. You can view files and clone it, but cannot push or open issues or pull requests.
AIDScripting/contributed/adventure mode/outputModifier.js
Branleaf b3cee885bf
Adding my Adventure Mode/Death Detection script
Includes a readme, a zip file containing all four scripts as well as the four scripts seperately for easy viewing
2021-10-21 03:36:06 +01:00

23 lines
601 B
JavaScript

const modifier = (text) => {
/*
history text needs placing in a seperate var
to the actual history list, as history is read-only.
*/
let hist = concatenateHistoryText(history) + " " + text;
dead = playerDied(hist);
if (dead) {
/*
shows a death message above action icons and
adds the classic line to the end of output
*/
state.message = "- You have died! -";
text += "\n- YOU DIED! GAME OVER! -";
} else {
delete state.message;
}
// You must return an object with the text property defined.
return { text }
}
// Don't modify this part
modifier(text)