126 lines
9.5 KiB
JavaScript
126 lines
9.5 KiB
JavaScript
"use strict";
|
|
const SPRITES = [
|
|
{ id: "smile", label: "\u901a\u5e38\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_01_smile.webp" },
|
|
{ id: "angry", label: "\u6012\u308a\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_02_angry.webp" },
|
|
{ id: "teary", label: "\u6d99\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_03_teary.webp" },
|
|
{ id: "jito", label: "\u3058\u3068\u76ee\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_04_jito.webp" },
|
|
{ id: "drool", label: "\u3088\u3060\u308c\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_05_drool.webp" },
|
|
{ id: "cry", label: "\u6ce3\u304d\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_06_cry.webp" },
|
|
{ id: "sleep", label: "\u7720\u308a\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_07_sleep.webp" },
|
|
{ id: "pokan", label: "\u307d\u304b\u3093\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_08_pokan.webp" },
|
|
{ id: "stretch", label: "\u4f38\u3073\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_09_stretch.webp", actionOnly: true },
|
|
{ id: "hurt", label: "\u75db\u304c\u308a\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_10_hurt.webp", actionOnly: true },
|
|
{ id: "weak", label: "\u5f31\u308a\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_11_weak.webp", actionOnly: true },
|
|
{ id: "back", label: "\u5965\u5411\u304d\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_12_back.webp", actionOnly: true },
|
|
{ id: "flee", label: "\u6557\u8d70\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_13_flee.webp", actionOnly: true },
|
|
{ id: "zunda_eat", label: "\u305a\u3093\u3060\u9905\u98df\u3079\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_14_zunda_eat.webp", actionOnly: true },
|
|
{ id: "hurt2", label: "\u75db\u304c\u308a\u305f\u308a\u306a\u30442", path: "assets/sprites/tarinai_15_hurt2.webp", actionOnly: true },
|
|
{ id: "normal_smirk", label: "\u901a\u5e38\u305f\u308a\u306a\u3044\u30fb\u306b\u3084\u308a", path: "assets/sprites/tarinai_16_normal_smirk.webp", displayOnly: true },
|
|
{ id: "normal_tongue", label: "\u4f4e\u30b9\u30c8\u30ec\u30b9\u305f\u308a\u306a\u3044\u30fb\u820c", path: "assets/sprites/tarinai_17_normal_tongue.webp", displayOnly: true },
|
|
{ id: "fear", label: "\u6050\u6016\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_18_fear.webp", actionOnly: true },
|
|
{ id: "flee_fear2", label: "\u6557\u8d70\u6050\u6016\u305f\u308a\u306a\u30442", path: "assets/sprites/tarinai_19_flee_fear2.webp", actionOnly: true },
|
|
{ id: "sleep2", label: "\u7720\u308a\u305f\u308a\u306a\u30442", path: "assets/sprites/tarinai_20_sleep2.webp", actionOnly: true },
|
|
{ id: "normal_happy", label: "\u4f4e\u30b9\u30c8\u30ec\u30b9\u305f\u308a\u306a\u3044\u30fb\u3054\u304d\u3052\u3093", path: "assets/sprites/tarinai_21_normal_happy.webp", displayOnly: true },
|
|
{ id: "fear_blue", label: "\u6050\u6016\u305f\u308a\u306a\u3044\u30fb\u9752\u3056\u3081", path: "assets/sprites/tarinai_22_fear_blue.webp", actionOnly: true },
|
|
{ id: "fear_cry", label: "\u6050\u6016\u305f\u308a\u306a\u3044\u30fb\u6d99", path: "assets/sprites/tarinai_23_fear_cry.webp", actionOnly: true },
|
|
{ id: "stress_dizzy", label: "\u9ad8\u30b9\u30c8\u30ec\u30b9\u305f\u308a\u306a\u3044\u30fb\u3050\u308b\u3050\u308b", path: "assets/sprites/tarinai_24_stress_dizzy.webp", actionOnly: true },
|
|
{ id: "stress_sweat", label: "\u9ad8\u30b9\u30c8\u30ec\u30b9\u305f\u308a\u306a\u3044\u30fb\u6c57", path: "assets/sprites/tarinai_25_stress_sweat.webp", actionOnly: true },
|
|
{ id: "intimidate", label: "\u5a01\u5687\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_26_intimidate.webp", actionOnly: true },
|
|
{ id: "birth_ritual", label: "へこへこたりない", path: "assets/sprites/tarinai_27_birth_ritual.webp", actionOnly: true },
|
|
{ id: "zunchi_slave", label: "\u305a\u3093\u3061\u3069\u308c\u3044", path: "assets/sprites/tarinai_28_zunchi_slave.webp", displayOnly: true },
|
|
{ id: "hungry_70", label: "\u7a7a\u817970\u4ee5\u4e0a\u305f\u308a\u306a\u3044", path: "assets/sprites/tarinai_29_hungry_70.webp", displayOnly: true },
|
|
{ id: "zunchi_slave_alt", label: "\u305a\u3093\u3061\u3069\u308c\u3044 2", path: "assets/sprites/tarinai_30_zunchi_slave_alt.webp", displayOnly: true },
|
|
{ id: "sunbath_1", label: "\u65e5\u5149\u6d74\u305f\u308a\u306a\u3044 1", path: "assets/sprites/tarinai_31_sunbath_01.webp", actionOnly: true },
|
|
{ id: "sunbath_2", label: "\u65e5\u5149\u6d74\u305f\u308a\u306a\u3044 2", path: "assets/sprites/tarinai_32_sunbath_02.webp", actionOnly: true },
|
|
{ id: "sunbath_3", label: "\u65e5\u5149\u6d74\u305f\u308a\u306a\u3044 3", path: "assets/sprites/tarinai_33_sunbath_03.webp", actionOnly: true },
|
|
];
|
|
const DECOR_ASSETS = [
|
|
{ id: "zunchi", path: "assets/objects/zunchi.webp" },
|
|
{ id: "zunchi_02", path: "assets/objects/zunchi_02.webp" },
|
|
{ id: "ant_queen", path: "assets/objects/ant_queen.webp" },
|
|
{ id: "ant_worker", path: "assets/objects/ant_worker.webp" },
|
|
{ id: "genkotsu", path: "assets/objects/genkotsu.webp" },
|
|
{ id: "pushpin", path: "assets/objects/pushpin.webp" },
|
|
{ id: "pushpin_stuck", path: "assets/objects/pushpin_stuck.webp" },
|
|
{ id: "oshibyo", path: "assets/objects/oshibyo.webp" },
|
|
{ id: "oshibyo_stuck", path: "assets/objects/oshibyo_stuck.webp" },
|
|
{ id: "plushie_bear", path: "assets/objects/plushie_bear.png" },
|
|
];
|
|
|
|
const ALPHA_BOUNDS = {
|
|
smile: { x: 18, y: 18, w: 476, h: 432, imageW: 512, imageH: 468 },
|
|
angry: { x: 16, y: 16, w: 480, h: 432, imageW: 512, imageH: 464 },
|
|
teary: { x: 17, y: 17, w: 478, h: 438, imageW: 512, imageH: 472 },
|
|
jito: { x: 18, y: 18, w: 476, h: 451, imageW: 512, imageH: 487 },
|
|
drool: { x: 18, y: 18, w: 476, h: 425, imageW: 512, imageH: 461 },
|
|
cry: { x: 15, y: 15, w: 482, h: 448, imageW: 512, imageH: 478 },
|
|
sleep: { x: 18, y: 18, w: 475, h: 439, imageW: 511, imageH: 475 },
|
|
pokan: { x: 18, y: 18, w: 476, h: 433, imageW: 512, imageH: 469 },
|
|
stretch: { x: 15, y: 15, w: 482, h: 354, imageW: 512, imageH: 384 },
|
|
hurt: { x: 17, y: 21, w: 478, h: 432, imageW: 512, imageH: 468 },
|
|
weak: { x: 53, y: 18, w: 405, h: 435, imageW: 512, imageH: 468 },
|
|
back: { x: 17, y: 21, w: 478, h: 432, imageW: 512, imageH: 468 },
|
|
flee: { x: 17, y: 21, w: 478, h: 432, imageW: 512, imageH: 468 },
|
|
zunda_eat: { x: 17, y: 21, w: 478, h: 432, imageW: 512, imageH: 468 },
|
|
hurt2: { x: 16, y: 20, w: 480, h: 434, imageW: 512, imageH: 468 },
|
|
normal_smirk: { x: 16, y: 20, w: 480, h: 434, imageW: 512, imageH: 468 },
|
|
normal_tongue: { x: 16, y: 20, w: 480, h: 434, imageW: 512, imageH: 468 },
|
|
fear: { x: 16, y: 20, w: 480, h: 434, imageW: 512, imageH: 468 },
|
|
flee_fear2: { x: 16, y: 26, w: 480, h: 428, imageW: 512, imageH: 468 },
|
|
sleep2: { x: 16, y: 21, w: 480, h: 433, imageW: 512, imageH: 468 },
|
|
normal_happy: { x: 16, y: 21, w: 480, h: 433, imageW: 512, imageH: 468 },
|
|
fear_blue: { x: 16, y: 21, w: 480, h: 433, imageW: 512, imageH: 468 },
|
|
fear_cry: { x: 16, y: 21, w: 480, h: 433, imageW: 512, imageH: 468 },
|
|
stress_dizzy: { x: 16, y: 21, w: 480, h: 433, imageW: 512, imageH: 468 },
|
|
stress_sweat: { x: 16, y: 26, w: 480, h: 428, imageW: 512, imageH: 468 },
|
|
intimidate: { x: 98, y: 16, w: 316, h: 438, imageW: 512, imageH: 468 },
|
|
zunchi_slave: { x: 17, y: 22, w: 478, h: 431, imageW: 512, imageH: 468 },
|
|
hungry_70: { x: 0, y: 0, w: 430, h: 366, imageW: 430, imageH: 366 },
|
|
zunchi_slave_alt: { x: 42, y: 22, w: 425, h: 426, imageW: 512, imageH: 468 },
|
|
zunchi: { x: 0, y: 0, w: 236, h: 178, imageW: 236, imageH: 178 },
|
|
zunchi_02: { x: 8, y: 63, w: 220, h: 105, imageW: 236, imageH: 178 },
|
|
ant_queen: { x: 0, y: 0, w: 300, h: 155, imageW: 300, imageH: 155 },
|
|
ant_worker: { x: 0, y: 0, w: 140, h: 72, imageW: 140, imageH: 72 },
|
|
genkotsu: { x: 8, y: 8, w: 220, h: 283, imageW: 236, imageH: 299 },
|
|
sunbath_1: { x: 71, y: 18, w: 369, h: 432, imageW: 512, imageH: 468 },
|
|
sunbath_2: { x: 69, y: 18, w: 374, h: 432, imageW: 512, imageH: 468 },
|
|
sunbath_3: { x: 71, y: 18, w: 369, h: 432, imageW: 512, imageH: 468 },
|
|
plushie_bear: { x: 0, y: 0, w: 150, h: 192, imageW: 150, imageH: 192 },
|
|
};
|
|
|
|
const NEEDS = ["\u98df\u3079\u7269", "\u4ef2\u9593", "\u7720\u308a", "\u52c7\u6c17", "\u6c34", "\u9759\u3051\u3055", "\u3042\u305f\u305f\u304b\u3055", "\u610f\u5473", "\u7a7a\u9593", "\u81ea\u4fe1"];
|
|
|
|
const CONFIG = {
|
|
initialPopulation: 18,
|
|
maxPopulation: Number.MAX_SAFE_INTEGER,
|
|
maxFenceCollisionChecks: 18,
|
|
effectLimit: 78,
|
|
grassLimit: 99,
|
|
grassLimitsByField: { cage: 19, garden: 99, park: 299 },
|
|
worldPadding: 30,
|
|
hungerPerMinute: 36.0,
|
|
lonelinessPerMinute: 7.6,
|
|
energyPerMinute: 8.2,
|
|
stressDecayPerMinute: 10.2,
|
|
reproductionCooldown: 18,
|
|
dayLength: 120,
|
|
childGrowTime: 58,
|
|
fightCooldown: 8,
|
|
lightingQuality: "cinematic",
|
|
weatherChangeMin: 46,
|
|
weatherChangeMax: 96,
|
|
bubbleLimit: 32,
|
|
highPopulationMode: 70,
|
|
ultraPopulationMode: 120,
|
|
};
|
|
const FIELD_TYPES = {
|
|
cage: { id: "cage", label: "\u30b1\u30fc\u30b8", sizeLabel: "\u5c0f", height: "calc(100vh - 140px)", minHeight: "620px", mobileHeight: "66vh", mobileMinHeight: "460px", worldScale: 0.46, population: 12, grass: 16 },
|
|
garden: { id: "garden", label: "\u5ead", sizeLabel: "\u4e2d", height: "calc(100vh - 140px)", minHeight: "620px", mobileHeight: "66vh", mobileMinHeight: "460px", worldScale: 1.0, population: CONFIG.initialPopulation, grass: 34 },
|
|
park: { id: "park", label: "\u516c\u5712", sizeLabel: "\u5927", height: "calc(100vh - 140px)", minHeight: "620px", mobileHeight: "66vh", mobileMinHeight: "460px", worldScale: 2.35, population: 24, grass: 62 },
|
|
};
|
|
const LIGHTING_TUNING = {
|
|
rayAlpha: 0.040,
|
|
nightOverlayAlpha: 0.135,
|
|
goldenOverlayAlpha: 0.045,
|
|
bloomWashAlpha: 0.040,
|
|
};
|