1.8 KiB
1.8 KiB
Darklord.js — startBloodSpread() (satır 1151)
Parça 1/2 · sonraki
function startBloodSpread(c, p, cfg)
{
var pos = p.getPosition();
var role = roleByPlayer(p.getName());
var runId = nowMs();
cfg = cfg || {
blockId: BLOOD_SPREAD_DEFAULT_BLOCK,
radius: BLOOD_POOL_RADIUS,
durationSeconds: BLOOD_POOL_LIFE_MS / 1000,
permanent: false
};
var radiusValue = Math.max(1, Math.floor(Number(cfg.radius || BLOOD_POOL_RADIUS)));
var pool = {
active: true,
owner: p.getName(),
ownerRp: role ? role.rp : p.getName(),
x: pos.x,
y: pos.y,
z: pos.z,
dim: getDimensionSafe(p),
createdAt: nowMs(),
expiresAt: cfg.permanent ? 9999999999999 : nowMs() + BLOOD_POOL_LIFE_MS,
runId: runId,
blockId: cfg.blockId || BLOOD_SPREAD_DEFAULT_BLOCK,
radius: radiusValue,
permanent: Boolean(cfg.permanent),
durationMs: Math.max(3000, Number(cfg.durationSeconds || 30) * 1000),
saved: [],
savedMap: {},
spreadDone: false,
restoring: false,
restoreIndex: null,
holdUntil: 0,
scanR: 0,
scanDx: 0,
scanDz: 0,
scanReady: false,
generatedDone: false,
frontier: [],
frontierMap: {},
visited: {},
visitedCount: 0,
organicSeed: Math.floor(Math.random() * 9000000),
pulse: 0,
soundPulse: 0
};
setBloodPool(p.getName(), pool);
setBloodPoolRun(p.getName(), runId);
play(p.getWorld(), "minecraft:block.fire.extinguish", pos.x, pos.y + 0.1, pos.z, 1.1, 0.42);