a
This commit is contained in:
parent
d163ceb291
commit
f6d7412744
94 changed files with 3836 additions and 1226 deletions
|
|
@ -5,10 +5,10 @@
|
|||
// helpers and the item scheduler both read this single policy instead of
|
||||
// duplicating item-type timing rules.
|
||||
(function (global) {
|
||||
const REALTIME_ITEM_TYPES = new Set(["ball", "balloon", "fan", "genkotsu", "firecracker", "flame_firecracker", "sticky_bomb", "robot_cleaner"]);
|
||||
const REALTIME_ITEM_TYPES = new Set(["oil", "bear_trap", "leakage_device", "poison_gas_can", "poison_gas", "ball", "balloon", "fan", "genkotsu", "firecracker", "flame_firecracker", "sticky_bomb", "robot_cleaner"]);
|
||||
const PIN_ITEM_TYPES = new Set(["pushpin", "oshibyo"]);
|
||||
const SCHEDULED_ITEM_TYPES = Object.freeze([
|
||||
"ball", "balloon", "fan", "genkotsu", "firecracker", "flame_firecracker", "sticky_bomb", "fire", "pushpin", "oshibyo",
|
||||
"oil", "bear_trap", "leakage_device", "poison_gas_can", "poison_gas", "ball", "balloon", "fan", "genkotsu", "firecracker", "flame_firecracker", "sticky_bomb", "fire", "pushpin", "oshibyo",
|
||||
"plushie", "grass_bed", "zunchi", "robot_cleaner", "duplicator", "water", "trace", "splat", "ant_corpse", "food",
|
||||
"sweet", "love_mochi", "fight_mochi", "sleep_drug", "first_aid", "sedative", "laxative", "protein", "niteropu", "ammo", "mystery_drug", "mercury", "giant_drug", "dwarf_drug", "zunda_juice",
|
||||
"stone", "bed", "nest_box", "pipe", "toilet", "rain_shelter", "ant_nest", "signboard", "fence_v", "fence_h", "bounce_fence", "bounce_fence_v", "gate_fence", "one_way_fence", "rotator", "poison_block", "reciprocator", "rope", "rod", "spring", "wire", "insulated_wire", "pressure_switch",
|
||||
|
|
@ -38,9 +38,11 @@
|
|||
Number(item.lastShotAt || -999) || -999
|
||||
);
|
||||
if (now - lastActiveAt < 0.35) return true;
|
||||
// Fan wind is a continuous force. Scheduling it as an idle item turns the
|
||||
// accumulated dt into periodic gusts, so fans must remain in the realtime lane.
|
||||
if (item.type === "fan") return true;
|
||||
// Fan wind and bear-trap contact are continuous interactions. Scheduling
|
||||
// them as idle items can turn movement/contact into periodic samples and
|
||||
// let a moving object pass completely through between checks.
|
||||
if (item.type === "fan" || item.type === "bear_trap") return true;
|
||||
if (item.type === "poison_gas_can") return Number(item.fuseTimer ?? 5) > 0;
|
||||
if (item.type === "firecracker" || item.type === "flame_firecracker" || item.type === "sticky_bomb") return Boolean(item.fuseTimer > 0 || item.armed || item.active);
|
||||
if (item.type === "robot_cleaner") return Boolean(item.active || item.cleanerActive || item.targetId || item.targetRef || item.state === "clean" || item.state === "return");
|
||||
if (PIN_ITEM_TYPES.has(item.type)) return Boolean(item.pinState && item.pinState !== "idle" && item.pinState !== "ground");
|
||||
|
|
@ -50,6 +52,7 @@
|
|||
|
||||
function idleRealtimeInterval(item) {
|
||||
if (!item) return Infinity;
|
||||
if (item.type === "oil" || item.type === "bear_trap" || item.type === "leakage_device" || item.type === "poison_gas_can" || item.type === "poison_gas") return 0.18;
|
||||
if (item.type === "ball" || item.type === "balloon") return 0.24;
|
||||
if (item.type === "fan") return 0.60;
|
||||
if (item.type === "genkotsu") return 0.45;
|
||||
|
|
@ -89,8 +92,8 @@
|
|||
if (item.type === "grass") return Infinity;
|
||||
if (item.type === "duplicator") return adjustedInterval(0.5);
|
||||
if (item.type === "water") return adjustedInterval(1.8);
|
||||
if (item.type === "trace" || item.type === "splat") return adjustedInterval(1.2);
|
||||
if (item.type === "ant_corpse") return adjustedInterval(3.5);
|
||||
if (item.type === "trace" || item.type === "splat") return adjustedInterval(2.8);
|
||||
if (item.type === "ant_corpse") return adjustedInterval(5.5);
|
||||
if (typeof global.isServingFoodType === "function" && global.isServingFoodType(item.type)) return adjustedInterval(5.0);
|
||||
if (isServingFoodType(item.type)) return adjustedInterval(5.0);
|
||||
return Infinity;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue