tarinai/js/text_catalog.js

186 lines
12 KiB
JavaScript
Raw Normal View History

2026-06-20 02:07:01 +09:00
"use strict";
const TEXT_CATALOG = {
2026-06-20 20:29:44 +09:00
toolTips: toolTipsFromDefinitions(),
2026-06-20 02:07:01 +09:00
ecologyCards: [
2026-06-20 20:29:44 +09:00
{
title: "\u305f\u308a\u306a\u3044\u3068\u306f",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_01_smile.webp",
2026-06-20 20:29:44 +09:00
text: "\u5ead\u3067\u66ae\u3089\u3059\u5c0f\u3055\u306a\u751f\u304d\u7269\u3002\u7a7a\u8179\u3001\u7720\u6c17\u3001\u6c17\u5206\u3001\u30b9\u30c8\u30ec\u30b9\u3001\u4f53\u529b\u3067\u884c\u52d5\u304c\u5909\u308f\u308b\u3002",
},
{
title: "\u4f53\u529b\u3068\u30b9\u30c8\u30ec\u30b9",
2026-06-21 14:09:35 +09:00
image: "assets/ui/ecology_hp_stress.webp",
2026-06-20 20:29:44 +09:00
text: "\u30d0\u30fc\u306f\u4e0a\u304c\u4f53\u529b\u3001\u4e0b\u304c\u30b9\u30c8\u30ec\u30b9\u3002\u4f53\u529b\u306f\u3051\u304c\u3084\u4e8b\u6545\u3067\u6e1b\u308a\u30010\u3067\u6b7b\u4ea1\u3002\u30b9\u30c8\u30ec\u30b9\u306f\u6050\u6016\u3001\u6df7\u96d1\u3001\u6c5a\u308c\u3001\u3051\u3093\u304b\u3067\u5897\u3048\u3001\u9ad8\u3044\u3068\u884c\u52d5\u304c\u4e71\u308c\u308b\u3002",
},
{
title: "\u66ae\u3089\u3057\u3068\u6b32\u6c42",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_05_drool.webp",
2026-06-20 20:29:44 +09:00
text: "\u98df\u3079\u7269\u3001\u6c34\u3001\u5bdd\u5e8a\u3001\u5de3\u7bb1\u3001\u4ef2\u9593\u3092\u63a2\u3057\u3066\u52d5\u304f\u3002\u96e8\u3001\u6c17\u6e29\u3001\u8349\u3001\u6c5a\u308c\u3001\u9053\u5177\u3082\u72b6\u614b\u306b\u5f71\u97ff\u3059\u308b\u3002",
},
{
title: "\u6027\u683c\u3068\u500b\u6027",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_21_normal_happy.webp",
2026-06-20 20:29:44 +09:00
text: "\u653b\u6483\u6027\u3001\u958b\u653e\u6027\u3001\u793e\u4ea4\u6027\u3001\u795e\u7d4c\u8cea\u6027\u304c\u7d4c\u9a13\u3067\u5c11\u3057\u305a\u3064\u5909\u308f\u308b\u3002\u95be\u5024\u3092\u8d85\u3048\u308b\u3068\u6027\u683c\u30bf\u30b0\u3068\u884c\u52d5\u5dee\u306b\u51fa\u308b\u3002",
},
{
title: "\u5bb6\u65cf\u3068\u95a2\u4fc2",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_27_birth_ritual.webp",
2026-06-20 20:29:44 +09:00
text: "\u89aa\u5b50\u3001\u5171\u540c\u89aa\u3001\u53cb\u9054\u3001\u6575\u5bfe\u3001\u6050\u6016\u3092\u8a18\u9332\u3059\u308b\u3002\u5b50\u306f\u89aa\u306e\u73fe\u5728\u6027\u683c\u3092\u53d7\u3051\u7d99\u304e\u3001\u5bb6\u7cfb\u56f3\u306b\u4e16\u4ee3\u304c\u6b8b\u308b\u3002",
},
{
title: "\u75c5\u6c17\u3068\u6cbb\u7642",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_24_stress_dizzy.webp",
2026-06-20 20:29:44 +09:00
text: "\u305a\u3093\u3061\u75c5\u3001\u306d\u3080\u308a\u75c5\u3001\u7206\u767a\u75c5\u3001\u304d\u305a\u3064\u304d\u75c5\u304c\u3042\u308b\u3002\u75c5\u6c17\u3054\u3068\u306b\u6c34\u3084\u305a\u3093\u3060\u9905\u306a\u3069\u3092\u6c42\u3081\u308b\u3002",
},
{
title: "\u3051\u3093\u304b\u3068\u4e8b\u6545",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_26_intimidate.webp",
2026-06-20 20:29:44 +09:00
text: "\u5a01\u5687\u3001\u6d41\u8840\u3001\u7206\u7af9\u3001\u30dc\u30fc\u30eb\u3001\u843d\u4e0b\u7269\u3067\u50b7\u3064\u304f\u3002\u6b7b\u56e0\u306f\u3051\u3093\u304b\u3001\u98e2\u9913\u3001\u75c5\u6c17\u3001\u4e8b\u6545\u306a\u3069\u306b\u5206\u304b\u308c\u308b\u3002",
},
{
title: "\u9053\u5177\u3068\u4ecb\u5165",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_18_fear.webp",
2026-06-20 20:29:44 +09:00
text: "\u3064\u3064\u304f\u3001\u3064\u307e\u3080\u3001\u9905\u3001\u6c34\u3001\u6d17\u6d44\u3001\u5de3\u7bb1\u3001\u67f5\u3001\u7206\u7af9\u306a\u3069\u3067\u74b0\u5883\u3092\u4f5c\u308b\u3002\u52a9\u3051\u306b\u3082\u5371\u967a\u306b\u3082\u306a\u308b\u3002",
},
{
title: "\u89b3\u5bdf\u306e\u65b9\u6cd5",
2026-06-21 14:09:35 +09:00
image: "assets/sprites/tarinai_11_weak.webp",
2026-06-20 20:29:44 +09:00
text: "\u89b3\u5bdf\u30c4\u30fc\u30eb\u3001\u661f\u30de\u30fc\u30af\u3001\u89b3\u5bdf\u30ed\u30b0\u3001\u5bb6\u7cfb\u56f3\u3001\u6b7b\u56e0\u7d71\u8a08\u304b\u3089\u500b\u4f53\u306e\u5909\u5316\u3092\u8ffd\u3048\u308b\u3002",
},
],
2026-06-20 02:07:01 +09:00
};
2026-06-22 02:03:19 +09:00
TEXT_CATALOG.stateLabels = Object.freeze({
2026-06-24 13:48:22 +09:00
idle: "\u5f85\u6a5f",
seek_food: "\u98df\u3079\u7269\u3078\u5411\u304b\u3046",
seek_bed: "\u5bdd\u5e8a\u3078\u5411\u304b\u3046",
play_ball: "\u30dc\u30fc\u30eb\u904a\u3073",
seek_water: "\u6c34\u3092\u63a2\u3059",
2026-06-25 14:51:58 +09:00
seek_material: "\u6750\u6599\u3092\u63a2\u3059",
seek_enemy: "\u76f8\u624b\u3078\u5411\u304b\u3046",
wander: "\u79fb\u52d5\u4e2d",
build: "\u4f5c\u6210\u4e2d",
2026-06-24 13:48:22 +09:00
zunchi_sick: "\u305a\u3093\u3061\u75c5",
fight_sick: "\u304d\u305a\u3064\u304d\u75c5",
system: "\u305a\u3093\u3061\u75c5",
seek_friend: "\u4ef2\u9593\u3092\u63a2\u3059",
follow_parent: "\u89aa\u306b\u3064\u3044\u3066\u3044\u304f",
cursor_friend: "\u30ab\u30fc\u30bd\u30eb\u306b\u3064\u3044\u3066\u3044\u304f",
cursor_enemy: "\u30ab\u30fc\u30bd\u30eb\u3092\u907f\u3051\u308b",
fight: "\u55a7\u5629\u4e2d",
sleep: "\u7761\u7720\u4e2d",
eat: "\u98df\u4e8b\u4e2d",
panic: "\u30d1\u30cb\u30c3\u30af",
intimidate: "\u5a01\u5687\u4e2d",
birth_ritual: "\u8a95\u751f\u524d",
sunbath: "\u65e5\u5149\u6d74\u4e2d",
ant_attack: "\u30a2\u30ea\u653b\u6483\u4e2d",
ant_intimidate: "\u30a2\u30ea\u5a01\u5687\u4e2d",
frozen: "\u51b7\u51cd\u4e2d",
2026-06-22 02:03:19 +09:00
});
2026-06-25 14:51:58 +09:00
TEXT_CATALOG.behaviorLabels = Object.freeze({
seek_material: "材料を探している",
build_structure: "作成している",
build: "作成している",
seek_enemy: "気になる相手へ向かっている",
wander_lightly: "少し移動している",
eat_food: "食事をしている",
drink_water: "水を飲んでいる",
sleep_in_bed: "寝床で休んでいる",
sleep_anywhere: "休んでいる",
intimidate_enemy: "威嚇している",
panic_escape: "逃げている",
});
TEXT_CATALOG.behaviorLabel = function behaviorLabelFromCatalog(value = "") {
const key = String(value || "");
return TEXT_CATALOG.behaviorLabels?.[key] || TEXT_CATALOG.stateLabels?.[key] || key;
};
TEXT_CATALOG.cleanBehaviorText = function cleanBehaviorText(text = "", fallbackKey = "") {
const raw = String(text || "").trim();
const key = String(fallbackKey || raw || "").trim();
const mapped = TEXT_CATALOG.behaviorLabel(key);
if (!raw) return mapped || "";
if (/^[a-z][a-z0-9_:-]*$/i.test(raw)) return TEXT_CATALOG.behaviorLabel(raw);
return raw;
};
2026-06-22 02:03:19 +09:00
TEXT_CATALOG.targetLabelOverrides = Object.freeze({
2026-06-24 13:48:22 +09:00
system: "\u305a\u3093\u3061\u75c5",
zunchi_sick: "\u305a\u3093\u3061\u75c5",
fight_sick: "\u304d\u305a\u3064\u304d\u75c5",
2026-06-22 02:03:19 +09:00
});
TEXT_CATALOG.targetLabels = TEXT_CATALOG.targetLabelOverrides;
TEXT_CATALOG.stateLabel = function stateLabelFromCatalog(s) {
return TEXT_CATALOG.stateLabels?.[s] || s || "";
};
TEXT_CATALOG.targetLabel = function targetLabelFromCatalog(target) {
2026-06-24 13:48:22 +09:00
if (!target) return "\u306a\u3057";
2026-06-22 02:03:19 +09:00
if (target.name) return target.name;
2026-06-24 13:48:22 +09:00
if (target.kind === "queen") return "\u5973\u738b\u30a2\u30ea";
if (target.kind === "worker") return "\u50cd\u304d\u30a2\u30ea";
2026-06-22 02:03:19 +09:00
if (target.type) {
const type = String(target.type || "");
if (TEXT_CATALOG.targetLabelOverrides?.[type]) return TEXT_CATALOG.targetLabelOverrides[type];
const label = typeof toolLabel === "function" ? toolLabel(type) : "";
return label || type;
}
2026-06-24 13:48:22 +09:00
if (Number.isFinite(target.x) && Number.isFinite(target.y)) return "\u4f4d\u7f6e";
return "\u4e0d\u660e";
2026-06-22 02:03:19 +09:00
};
TEXT_CATALOG.reasonLabel = function reasonLabelFromCatalog(t) {
2026-06-24 13:48:22 +09:00
if (!t) return "\u306a\u3057";
if ((t.pinchThoughtTimer || 0) > 0) return "\u3064\u307e\u307e\u308c\u3066\u3044\u308b";
2026-06-25 14:51:58 +09:00
const behaviorState = typeof currentTarinaiBehavior === "function" ? currentTarinaiBehavior(t) : t?.behavior;
const behaviorLabel = typeof globalThis.behaviorText === "function"
? globalThis.behaviorText(t)
: String(typeof getTarinaiBehaviorText === "function" ? getTarinaiBehaviorText(t) : (behaviorState?.text || behaviorState?.reason || "")).trim();
const cleanedBehaviorLabel = TEXT_CATALOG.cleanBehaviorText(behaviorLabel, behaviorState?.actionId || t.state || "");
if (cleanedBehaviorLabel) return cleanedBehaviorLabel;
2026-06-22 02:03:19 +09:00
const target = TEXT_CATALOG.targetLabel(t.target);
2026-06-24 13:48:22 +09:00
if (t.state === "eat") return target !== "\u306a\u3057" ? `${target}\u3092\u98df\u3079\u3066\u3044\u308b` : "\u98df\u3079\u3066\u3044\u308b";
if (t.state === "sleep") return t.target?.type === "nest_box" ? "\u5de3\u7bb1\u306e\u4e2d\u3067\u4f53\u529b\u3092\u56de\u5fa9\u3057\u3066\u3044\u308b" : "\u4f53\u529b\u3092\u56de\u5fa9\u3057\u3066\u3044\u308b";
if (t.state === "panic") return t.target ? `${target}\u304b\u3089\u9003\u3052\u3066\u3044\u308b` : "\u6016\u304c\u3063\u3066\u3044\u308b";
if (t.state === "intimidate") return target !== "\u306a\u3057" ? `${target}\u3092\u5a01\u5687\u3057\u3066\u3044\u308b` : "\u76f8\u624b\u3092\u5a01\u5687\u3057\u3066\u3044\u308b";
if (t.state === "ant_intimidate") return "\u30a2\u30ea\u3092\u5a01\u5687\u3057\u3066\u3044\u308b";
if (t.state === "ant_attack") return "\u30a2\u30ea\u3092\u653b\u6483\u3057\u3066\u3044\u308b";
if (t.state === "birth_ritual") return t.target?.name ? `${t.target.name}\u3068\u7e41\u6b96\u306e\u524d\u3076\u308c\u3092\u3057\u3066\u3044\u308b` : "\u7e41\u6b96\u306e\u524d\u3076\u308c\u3092\u3057\u3066\u3044\u308b";
if (t.state === "sunbath") return "\u6674\u308c\u305f\u65e5\u306a\u305f\u3067\u30b9\u30c8\u30ec\u30b9\u3092\u4e0b\u3052\u3066\u3044\u308b";
if (t.state === "frozen") return "\u30d5\u30a3\u30fc\u30eb\u30c9\u5916\u3067\u51b7\u51cd\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b";
if (t.state === "seek_food") return target !== "\u306a\u3057" ? `${target}\u3092\u63a2\u3057\u3066\u3044\u308b` : "\u304a\u8179\u304c\u3059\u3044\u3066\u3044\u308b";
if (t.state === "seek_water") return t.explosionDisease ? "\u7206\u767a\u75c5\u3067\u6c34\u3092\u63a2\u3057\u3066\u3044\u308b" : "\u305a\u3093\u3061\u75c5\u3067\u6c34\u3092\u63a2\u3057\u3066\u3044\u308b";
if (t.state === "seek_bed") return target !== "\u306a\u3057" ? `${target}\u3078\u5411\u304b\u3063\u3066\u3044\u308b` : "\u7720\u308b\u5834\u6240\u3092\u63a2\u3057\u3066\u3044\u308b";
if (t.state === "play_ball") return "\u30dc\u30fc\u30eb\u304c\u6c17\u306b\u306a\u3063\u3066\u3044\u308b";
if (t.state === "seek_friend" && (typeof getTarinaiBehaviorId === "function" ? getTarinaiBehaviorId(t) : t.behavior?.id) === "approach_mate") return t.target?.name ? `${t.target.name}\u306b\u7e41\u6b96\u306e\u305f\u3081\u8fd1\u3065\u3044\u3066\u3044\u308b` : "\u7e41\u6b96\u3067\u304d\u308b\u76f8\u624b\u3092\u63a2\u3057\u3066\u3044\u308b";
if (t.state === "seek_friend") return "\u4ef2\u9593\u3092\u63a2\u3057\u3066\u3044\u308b";
if (t.state === "follow_parent") return "\u89aa\u306b\u3064\u3044\u3066\u3044\u304f";
if (t.state === "cursor_friend") return "\u30ab\u30fc\u30bd\u30eb\u306b\u3064\u3044\u3066\u3044\u304f";
if (t.state === "cursor_enemy") return "\u30ab\u30fc\u30bd\u30eb\u3092\u907f\u3051\u3066\u3044\u308b";
if (t.state === "fight") return target !== "\u306a\u3057" ? `${target}\u3068\u55a7\u5629\u3057\u3066\u3044\u308b` : "\u55a7\u5629\u3057\u3066\u3044\u308b";
if (t.state === "fight_sick") return "\u304d\u305a\u3064\u304d\u75c5\u3067\u5f53\u3066\u3082\u306a\u304f\u5f77\u5fa8\u3063\u3066\u3044\u308b";
if (t.state === "zunchi_sick" || t.state === "system") return "\u305a\u3093\u3061\u75c5\u3067\u8abf\u5b50\u304c\u60aa\u3044";
if ((t.hurtTimer || 0) > 0.08) return "\u75db\u307f\u3067\u6df7\u4e71\u3057\u3066\u3044\u308b";
if ((t.fearTimer || 0) > 0.08) return "\u6016\u304c\u3063\u3066\u3044\u308b";
if ((t.grassEatTimer || 0) > 0.04) return "\u8349\u3092\u98df\u3079\u3066\u3044\u308b";
2026-06-23 22:39:20 +09:00
const thought = String(t.thought || "").trim();
if (thought) return thought;
2026-06-24 13:48:22 +09:00
return "\u5468\u56f2\u3092\u898b\u3066\u3044\u308b";
2026-06-22 02:03:19 +09:00
};
function stateLabel(s) { return TEXT_CATALOG.stateLabel(s); }
function targetLabel(target) { return TEXT_CATALOG.targetLabel(target); }
function reasonLabel(t) { return TEXT_CATALOG.reasonLabel(t); }
window.stateLabel = stateLabel;
window.targetLabel = targetLabel;
window.reasonLabel = reasonLabel;
2026-06-20 02:07:01 +09:00
window.TEXT_CATALOG = TEXT_CATALOG;