change npc defaults

This commit is contained in:
Kolby Nottingham 2024-05-13 11:47:35 -07:00
parent 74156d118d
commit c579366e7a
2 changed files with 6 additions and 3 deletions

View file

@ -80,12 +80,15 @@ export class NPCContoller {
}
async setGoal(name=null, quantity=1) {
this.data.curr_goal = null;
this.last_goals = {};
if (name) {
this.data.curr_goal = {name: name, quantity: quantity};
return;
}
if (!this.data.do_set_goal) return;
let past_goals = {...this.last_goals};
for (let goal in this.data.goals) {
if (past_goals[goal.name] === undefined) past_goals[goal.name] = true;

View file

@ -4,8 +4,8 @@ export class NPCData {
this.curr_goal = null;
this.built = {};
this.home = null;
this.do_routine = true;
this.do_set_goal = true;
this.do_routine = false;
this.do_set_goal = false;
}
toObject() {