dungeon-of-the-day/examples/create-graves.js

20 lines
1018 B
JavaScript

const fs = require('fs');
const Charlatan = require('charlatan');
let createGraves = () => {
//ingest verbs
verbs = fs.readFileSync("../.verbs.txt").toString().split("\n");
let name = Charlatan.Name.name();
let prefix = ["Here lies","RIP","","","","Resting place of ","Beloved"]
let reason = ["Made an enemy","Wasn't afraid to be","Tried","Died while","Passed while performing","Tried out","Dissapeared investingating","Wandered off while looking for","Last seen","Loved","Adored","A lifelong fan of","Our favorite at","The best at","Always in our hearts","Keep","Always be","Always","Just","Tried","Couldn't stop","Only ever found","Died","Passed while","Couldn't stop","Forgot to try","Never stopped","We'll always think of you when we're","It's not the same"]
let epitaph = prefix[Math.floor(Math.random() * prefix.length)] + " " + name +"\n"+reason[Math.floor(Math.random() * reason.length)]+" " + verbs[Math.floor(Math.random()*verbs.length)] + ".";
console.log(epitaph);
}
createGraves();