duu
This commit is contained in:
parent
88f618cadf
commit
8f9f5b5100
108 changed files with 2139 additions and 1500 deletions
|
|
@ -217,7 +217,7 @@ function createTemperatureComfortActionSpec() {
|
|||
},
|
||||
weight: 42,
|
||||
selectTarget(t, world, ctx = {}) {
|
||||
return world?.findComfortTemperatureSpot?.(t, { force: !!ctx.force, requireComfort: true }) || null;
|
||||
return world?.findComfortTemperatureSpot?.(t, { force: !!ctx.force, requireComfort: false }) || null;
|
||||
},
|
||||
canStart(t, world, ctx = {}) {
|
||||
const felt = world?.feltTemperatureFor?.(t) ?? world?.temperatureAt?.(t.x, t.y, t);
|
||||
|
|
@ -239,7 +239,7 @@ function createTemperatureComfortActionSpec() {
|
|||
t.goIdle?.("\u5FEB\u9069\u306A\u6E29\u5EA6\u306B\u306A\u3063\u305F");
|
||||
return "finished";
|
||||
}
|
||||
const target = t.target && !t.target.dead ? t.target : (ctx.target ?? this.selectTarget(t, world, { force: true, requireComfort: true }));
|
||||
const target = t.target && !t.target.dead ? t.target : (ctx.target ?? this.selectTarget(t, world, { force: true, requireComfort: false }));
|
||||
if (!target) return false;
|
||||
t.target = target;
|
||||
if (distXY(t.x, t.y, target.x, target.y) < Math.max(24, (t.radius || 20) * 0.9)) {
|
||||
|
|
@ -252,7 +252,7 @@ function createTemperatureComfortActionSpec() {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
const next = this.selectTarget(t, world, { force: true, requireComfort: true });
|
||||
const next = this.selectTarget(t, world, { force: true, requireComfort: false });
|
||||
if (!next || distXY(t.x, t.y, next.x, next.y) < Math.max(28, (t.radius || 20))) return "finished";
|
||||
t.target = next;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue