Includes a readme, a zip file containing all four scripts as well as the four scripts seperately for easy viewing
23 lines
601 B
JavaScript
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)
|