mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-22 06:02:07 +02:00
change npc defaults
This commit is contained in:
parent
74156d118d
commit
c579366e7a
2 changed files with 6 additions and 3 deletions
|
@ -80,12 +80,15 @@ export class NPCContoller {
|
||||||
}
|
}
|
||||||
|
|
||||||
async setGoal(name=null, quantity=1) {
|
async setGoal(name=null, quantity=1) {
|
||||||
|
this.data.curr_goal = null;
|
||||||
this.last_goals = {};
|
this.last_goals = {};
|
||||||
if (name) {
|
if (name) {
|
||||||
this.data.curr_goal = {name: name, quantity: quantity};
|
this.data.curr_goal = {name: name, quantity: quantity};
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this.data.do_set_goal) return;
|
||||||
|
|
||||||
let past_goals = {...this.last_goals};
|
let past_goals = {...this.last_goals};
|
||||||
for (let goal in this.data.goals) {
|
for (let goal in this.data.goals) {
|
||||||
if (past_goals[goal.name] === undefined) past_goals[goal.name] = true;
|
if (past_goals[goal.name] === undefined) past_goals[goal.name] = true;
|
||||||
|
|
|
@ -4,8 +4,8 @@ export class NPCData {
|
||||||
this.curr_goal = null;
|
this.curr_goal = null;
|
||||||
this.built = {};
|
this.built = {};
|
||||||
this.home = null;
|
this.home = null;
|
||||||
this.do_routine = true;
|
this.do_routine = false;
|
||||||
this.do_set_goal = true;
|
this.do_set_goal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
toObject() {
|
toObject() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue