aaa
This commit is contained in:
parent
f1c3af2b89
commit
2636d580a8
75 changed files with 3890 additions and 1084 deletions
|
|
@ -18,10 +18,6 @@ function updateFirecracker(item, dt, worldRef) {
|
|||
const FIRE_PANIC_INTERVAL = 1.20;
|
||||
const FIRE_WATER_INTERVAL = 0.16;
|
||||
const FIRE_CLUSTER_SCAN_INTERVAL = 0.45;
|
||||
const FIRE_INTERACTION_BUDGET_DESKTOP = 18;
|
||||
const FIRE_INTERACTION_BUDGET_MOBILE = 10;
|
||||
const FIRE_MAX_ACTIVE_DESKTOP = 72;
|
||||
const FIRE_MAX_ACTIVE_MOBILE = 44;
|
||||
const GRASS_FIRE_EXTINGUISH_RATE = 0.56;
|
||||
const NEST_BOX_FIRE_EVACUATE_AFTER = 10.0;
|
||||
const NEST_BOX_FIRE_MIN_LIFE = 14.0;
|
||||
|
|
@ -40,7 +36,8 @@ function updateFirecracker(item, dt, worldRef) {
|
|||
|
||||
function pushFireEffect(worldRef, x, y, size = 12, seed = null) {
|
||||
if (!worldRef?.effects || typeof Effect !== "function") return;
|
||||
if ((worldRef.effects.length || 0) > 180) return;
|
||||
const effectCap = Math.max(1, Number(global.TarinaiPerf?.performanceProfile?.().effectCap || 220));
|
||||
if ((worldRef.effects.length || 0) >= effectCap) return;
|
||||
const a = global.deterministicAngle(worldRef, "fire-effect-angle", seed || x, y, worldRef.time || 0);
|
||||
const speed = global.deterministicRange(worldRef, "fire-effect-speed", 3, 15, seed || x, y);
|
||||
worldRef.effects.push(new Effect("flame", x, y, {
|
||||
|
|
@ -55,10 +52,9 @@ function updateFirecracker(item, dt, worldRef) {
|
|||
function fireInteractionBudget(worldRef) {
|
||||
const frame = Math.floor((Number(worldRef?.time || 0) || 0) * 60);
|
||||
if (!worldRef._fireInteractionBudget || worldRef._fireInteractionBudget.frame !== frame) {
|
||||
const mobile = Boolean(global.TarinaiInputMode?.snapshot?.().touchFirst || (global.innerWidth || 9999) <= 760);
|
||||
worldRef._fireInteractionBudget = {
|
||||
frame,
|
||||
remaining: mobile ? FIRE_INTERACTION_BUDGET_MOBILE : FIRE_INTERACTION_BUDGET_DESKTOP,
|
||||
remaining: Math.max(1, Number(global.TarinaiPerf?.performanceProfile?.().fireInteractionBudget || 14)),
|
||||
};
|
||||
}
|
||||
return worldRef._fireInteractionBudget;
|
||||
|
|
@ -442,8 +438,7 @@ function updateFirecracker(item, dt, worldRef) {
|
|||
}
|
||||
|
||||
function activeFireLimit() {
|
||||
const mobile = Boolean(global.TarinaiInputMode?.snapshot?.().touchFirst || (global.innerWidth || 9999) <= 760);
|
||||
return mobile ? FIRE_MAX_ACTIVE_MOBILE : FIRE_MAX_ACTIVE_DESKTOP;
|
||||
return Math.max(1, Number(global.TarinaiPerf?.performanceProfile?.().activeFireLimit || 60));
|
||||
}
|
||||
|
||||
function activeFires(worldRef) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue