Includes a readme, a zip file containing all four scripts as well as the four scripts seperately for easy viewing
23 lines
634 B
JavaScript
23 lines
634 B
JavaScript
const modifier = (text) => {
|
|
console.log("Input: " + text)
|
|
/*
|
|
history text needs placing in a seperate var
|
|
to the actual history list, as history is read-only.
|
|
*/
|
|
let hist = concatenateHistoryText(history);
|
|
let stop = playerDied(hist);
|
|
if (stop) {
|
|
/*
|
|
prevent the input from generating text with stop=true and
|
|
stops it from being added to context by setting it to null
|
|
*/
|
|
text = null;
|
|
//puts this message above the action buttons and textbox
|
|
state.message = "You have died and your adventure is at an end.";
|
|
} else {
|
|
delete state.message;
|
|
}
|
|
return { text, stop }
|
|
}
|
|
|
|
modifier(text)
|