aa
This commit is contained in:
parent
f941200504
commit
ad2cc76429
34 changed files with 616 additions and 365 deletions
|
|
@ -11,6 +11,27 @@ if (!it || it.dead) return false;
|
|||
const d = it?.type === "duplicator" ? foodInteractionDistance(tarinai, it) : dist(tarinai, it);
|
||||
const contactReach = foodInteractionReach(tarinai, it, "food") + (it === tarinai.target && foodActionActive && it?.type !== "duplicator" ? 4 : 0);
|
||||
if (d > contactReach) return false;
|
||||
|
||||
if (it.type === "slave_chain" || it.type === "golden_crown") {
|
||||
const itemLabel = typeof toolLabel === "function" ? toolLabel(it.type) : (it.type === "slave_chain" ? "奴隷の鎖" : "黄金の冠");
|
||||
if (it.type === "slave_chain") {
|
||||
tarinai.isTarinaiChampion = false;
|
||||
tarinai.tarinaiChampionSince = 0;
|
||||
tarinai.becomeZunchiSlave?.({ locked: true, forcedItem: true });
|
||||
tarinai.bubble("鎖", 2.4, "rgba(74,64,56,0.82)");
|
||||
tarinai.world?.log?.(`${tarinai.name}は${itemLabel}に触れてずんちどれいになった。`, "event", { participants: [tarinai], sound: false });
|
||||
} else {
|
||||
tarinai.becomeTarinaiChampion?.({ force: true, forcePersonality: true, forcedItem: true });
|
||||
tarinai.bubble("王", 2.4, "rgba(166,112,22,0.84)");
|
||||
tarinai.world?.log?.(`${tarinai.name}は${itemLabel}に触れてたりない王になった。`, "event", { participants: [tarinai], sound: false });
|
||||
}
|
||||
global.TarinaiStructureLifecycle?.deleteItem?.(tarinai.world, it, { reason: `consumed-${it.type}`, userReason: `${itemLabel}が使われた`, wake: false, panicOwner: false });
|
||||
tarinai.world?.recordFamily?.(tarinai);
|
||||
tarinai.world?.markFamilyTreeDirty?.(`consume-${it.type}`);
|
||||
if (global.uiCache) global.uiCache.selectedSnapshot = "";
|
||||
return true;
|
||||
}
|
||||
|
||||
if (it.type === "water") {
|
||||
tarinai.thought = "\u6c34\u3092\u6d74\u3073\u3066\u843d\u3061\u7740\u3044\u3066\u3044\u308b";
|
||||
tarinai.target = it;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue