Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions game/public/brain/brainGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,17 +367,10 @@ class BrainGame {
}

getWorldEventByName = (e) => {
if (this.world?.events) {
const eventKeys = Object.keys(this.world.events)
for (let i = 0; i < eventKeys.length; i++) {
if (eventKeys[i].toLowerCase() === e.toLowerCase()) {
return eventKeys[i]
}
}
// If no match, return null
return null
if (this.world?.events.has(e)) {
return this.world.events[e]
}
else return null
return null
}

doWorldEvent = (e) => {
Expand Down
9 changes: 4 additions & 5 deletions game/public/brain/gen/world/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ class World {
// }

// Events (these should all be strings to house chat commands)
this.events = {
worldStart: "",
gameStart: "",
gameEnd: "",
this.events = new Map()
this.events["worldStart"] = ""
this.events["gameStart"] = ""
this.events["gameEnd"] = ""
// playerDie: ""
// ...
}

this.getWorldSeed = () => { return this._wSeed }

Expand Down