stable
This commit is contained in:
parent
86226ccc94
commit
077d4ab9ac
71 changed files with 2905 additions and 1063 deletions
|
|
@ -101,11 +101,19 @@ function continueBuildPlan(t, world, dt) {
|
|||
t.setActionState?.("build", { target: material, reason: `${label}\u3092\u4f5c\u3063\u3066\u3044\u308b`, sleeping: false });
|
||||
if (plan.timer > 0) return true;
|
||||
consumeGrassMaterial(material, plan.type === "grass_bed" ? 4 : 1);
|
||||
const spot = findStructureBuildSpot(t, world, plan.type);
|
||||
const spot = plan.type === "plushie"
|
||||
? { x: t.x, y: t.y - Math.max(28, (t.radius || 24) * 1.28) }
|
||||
: findStructureBuildSpot(t, world, plan.type);
|
||||
const structure = globalThis.StructureRegistry.create(plan.type, t, spot.x, spot.y, world);
|
||||
if (!structure) {
|
||||
return stopFailedBuildPlan(t, world, plan.type, "\u4f5c\u308b\u5834\u6240\u304c\u898b\u3064\u304b\u3089\u306a\u3044");
|
||||
}
|
||||
if (plan.type === "plushie") {
|
||||
structure.carriedById = t.id;
|
||||
structure.onHead = true;
|
||||
structure.x = t.x;
|
||||
structure.y = t.y - Math.max(28, (t.radius || 24) * 1.28);
|
||||
}
|
||||
world.addItem?.(structure, `build:${plan.type}`) || world.items.push(structure);
|
||||
world.drawListDirty = true;
|
||||
structure.use?.(t, world);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue