0.2.5-dev: 耶拉 S2 (both forms) and 荒芜拉普兰德 S1 keep the operator's own hit next to the drone hit — only drone-only skills skip it (review fix of the funnel port); golden: more funnel scenarios move, attributed in docs/history/0.2.5.md
This commit is contained in:
1 parent
e0f3771821
commit
a451ddcf6b
15 files changed
+597
-384
No files matched your search
+6
-4
@@ -319,10 +319,12 @@ export function resolveHit(b, u, prof, target, info, x, y) {
|
||||
let mulT = skillMul;
|
||||
if (prof.dmgMul) { const m = typeof prof.dmgMul === 'function' ? prof.dmgMul(b, u, target) : prof.dmgMul; if (Number.isFinite(m)) mulT *= m; }
|
||||
const funnelMul = prof.funnelMul ? prof.funnelMul(b, u, target) : 1;
|
||||
const attachedFunnel = !!prof.funnelMul && (!info.isSkill || prof.funnelBodyHits > 0);
|
||||
// Unreleased drones are additional damage (PRTS 驭械术师), not a replacement for the caster's attack. A volley
|
||||
// shares one talent roll and attackId; extra drones never duplicate the body. Released skill paths stay separate.
|
||||
// Unreleased drones are additional damage on the caster's attack (PRTS 驭械术师), including a skill that only
|
||||
// buffs or retargets that attack. `info.isSkill` is set for every attack or targeting override, so it must not
|
||||
// decide this. `funnelBodyHits === 0` is the drone-only opt-out (the ramp stays inside the hits, no body).
|
||||
// A volley shares one talent roll and attackId; extra drones never duplicate the body.
|
||||
// [ASSUMED] Body instances precede additions at the existing projectile impact; a multi-hit volley keeps one ramp.
|
||||
const attachedFunnel = !!prof.funnelMul && prof.funnelBodyHits !== 0;
|
||||
if (!attachedFunnel) mulT *= funnelMul;
|
||||
const hits = prof.hitsFn ? prof.hitsFn(b, u, info) : Math.max(1, prof.hits || 1);
|
||||
// `hitDmgMul` (professions.js header): each instance's 伤害倍率 — the DamageInfo `mul`, after DEF / RES — and only the
|
||||
@@ -330,7 +332,7 @@ export function resolveHit(b, u, prof, target, info, x, y) {
|
||||
const split = Number.isFinite(prof.hitDmgMul) && prof.hitDmgMul > 0 ? prof.hitDmgMul : null;
|
||||
let dealtMain = 0;
|
||||
if (attachedFunnel && info.index === 0) {
|
||||
const bodyHits = Math.max(1, prof.funnelBodyHits || 1);
|
||||
const bodyHits = Math.max(1, prof.funnelBodyHits > 0 ? prof.funnelBodyHits : 1);
|
||||
for (let h = 0; h < bodyHits && target.alive; h++) {
|
||||
dealtMain += b.dealDamage(u, target, { amount: atk * scale * mulT, type: baseType,
|
||||
isAttack: true, isSkill: info.isSkill, tags: prof.tags || [], attackId });
|
||||
|
||||
@@ -2,42 +2,136 @@
|
||||
// Conventions of the tier-3 kits: ../shared/tier3.js; kit contract and rules: ../README.md.
|
||||
|
||||
import { COLS } from '../../../constants.js';
|
||||
import { canTargetEnemy, sortEnemyTargets } from '../../../targeting.js';
|
||||
import { num, defOf, talentBb, altSkills, statSkill, funnelMap, installFunnelPrune } from '../shared/tier3.js';
|
||||
|
||||
export const DRONE_TAG = 'kjera:drone';
|
||||
|
||||
// One step of the per-target ramp. Two drones that hit the same enemy in the same tick share the step (funnelMap).
|
||||
function stepMap(ramp, id, time, f) {
|
||||
const prev = ramp.get(id);
|
||||
if (prev && prev.t === time) return prev.s;
|
||||
const s = prev == null ? f.init : Math.min(f.max, prev.s + f.delta);
|
||||
ramp.set(id, { s, t: time });
|
||||
return s;
|
||||
}
|
||||
|
||||
function acquire(battle, unit, rel) {
|
||||
const prof = unit.profile;
|
||||
const ok = (e) => !!e && e.alive && canTargetEnemy(unit, e, prof);
|
||||
const cands = battle.enemiesInKeys(unit.rangeKeys, unit, prof);
|
||||
for (const e of battle.blockedTargets(unit, prof)) if (!cands.includes(e)) cands.push(e);
|
||||
sortEnemyTargets(battle, unit, cands, prof.priority);
|
||||
const usable = cands.filter(ok);
|
||||
const held = new Set();
|
||||
for (const d of rel.drones) {
|
||||
if (d.lock && ok(d.lock)) held.add(d.lock);
|
||||
else { d.lock = null; d.scale = null; }
|
||||
}
|
||||
for (const d of rel.drones) {
|
||||
if (d.lock) continue;
|
||||
const e = usable.find((x) => !held.has(x)) ?? usable[0] ?? rel.drones.find((x) => x.lock)?.lock ?? null;
|
||||
if (!e) continue;
|
||||
held.add(e);
|
||||
d.lock = e;
|
||||
d.scale = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 心随意动 (skchr_kjera_2, docs/research/03-operators.md): release `1 + attack@cnt` drones that stay locked until the
|
||||
* enemy dies or the skill ends, ATK +, and a cold roll on her own attack and on each drone hit. The body keeps its
|
||||
* ordinary attack inside her range; the unreleased addition is off while the drones are out.
|
||||
* `restart` (hidden form): each drone begins at the trait's initial scale and is not written back.
|
||||
* Otherwise the drones continue the per-target ramp and that map is restored when the skill ends.
|
||||
* [ASSUMED] The released drones use the trait ramp (init / +delta / cap). Her blackboard has no drone scale.
|
||||
* [ASSUMED] No flight delay. A lock that can no longer be targeted is dropped and the drone retargets. Stun and
|
||||
* disarm do not pause the released drones (the skill tick still runs).
|
||||
*/
|
||||
export function kjeraRelease(bb, { restart = false, announce = false } = {}) {
|
||||
const n = 1 + Math.max(0, Math.floor(num(bb['attack@cnt'], 0)));
|
||||
const prob = num(bb['attack@prob'], 0), cold = num(bb['attack@cold'], 0);
|
||||
return {
|
||||
skill: {
|
||||
kind: 'duration',
|
||||
mods: { atkPct: num(bb.atk) },
|
||||
onStart({ battle, unit }) {
|
||||
const key = typeof unit.profile.funnelMul === 'function' ? 'funnelMul' : 'dmgMul';
|
||||
const mul = unit.profile[key];
|
||||
unit.profile = { ...unit.profile, [key]: null };
|
||||
const ramp = restart ? null : new Map();
|
||||
if (ramp && unit.trait.funnelMap) {
|
||||
for (const [id, v] of unit.trait.funnelMap) ramp.set(id, { s: v.s, t: v.t });
|
||||
}
|
||||
unit.mem.kjeraRel = {
|
||||
key, mul, restart, ramp, cd: 0,
|
||||
target: unit.trait.funnelTarget ?? null,
|
||||
scale: unit.trait.funnelScale,
|
||||
drones: Array.from({ length: n }, () => ({ lock: null, scale: null })),
|
||||
};
|
||||
if (announce) battle.fx('drones', { x: unit.x, y: unit.y, id: unit.id, n });
|
||||
},
|
||||
onTick({ battle, unit, dt }) {
|
||||
const rel = unit.mem.kjeraRel;
|
||||
if (!rel || !unit.alive || !unit.skill?.active) return;
|
||||
rel.cd = Math.max(0, rel.cd - dt);
|
||||
acquire(battle, unit, rel);
|
||||
if (!rel.drones.some((d) => d.lock) || rel.cd > 1e-9) return;
|
||||
rel.cd = unit.s.interval;
|
||||
const f = unit.profile.funnel || { init: 0.2, delta: 0.15, max: 1.1 };
|
||||
for (const d of rel.drones) {
|
||||
if (!d.lock || !d.lock.alive) continue;
|
||||
const scale = rel.restart
|
||||
? (d.scale = d.scale == null ? f.init : Math.min(f.max, d.scale + f.delta))
|
||||
: stepMap(rel.ramp, d.lock.id, battle.time, f);
|
||||
battle.fx('drone', { x: d.lock.x, y: d.lock.y, id: unit.id });
|
||||
battle.dealDamage(unit, d.lock, {
|
||||
amount: unit.s.atk * unit.s.atkScaleMul * scale, type: 'arts',
|
||||
isSkill: true, isAttack: false, tags: ['skill', 'drone', DRONE_TAG],
|
||||
});
|
||||
if (d.lock.alive && cold > 0 && battle.rng.chance(prob)) {
|
||||
battle.applyStatus(d.lock, 'cold', { duration: cold, source: unit });
|
||||
}
|
||||
}
|
||||
},
|
||||
onEnd({ unit }) {
|
||||
const rel = unit.mem.kjeraRel;
|
||||
unit.mem.kjeraRel = null;
|
||||
if (!rel) return;
|
||||
unit.trait.funnelTarget = rel.target;
|
||||
unit.trait.funnelScale = rel.scale;
|
||||
if (rel.ramp) unit.trait.funnelMap = rel.ramp;
|
||||
if (unit.profile && rel.key) unit.profile = { ...unit.profile, [rel.key]: rel.mul };
|
||||
},
|
||||
},
|
||||
install(battle, unit) {
|
||||
// 自身攻击: one cold roll on the ordinary body hit. Drone hits roll in onTick, so they are not rolled again.
|
||||
battle.on('damaged', (ctx) => {
|
||||
if (!unit.mem.kjeraRel || ctx.source !== unit || !ctx.target?.alive || !ctx.dmg) return;
|
||||
if (!ctx.dmg.isAttack || ctx.dmg.isSkill) return;
|
||||
const tags = ctx.dmg.tags || [];
|
||||
if (tags.includes('addition') || tags.includes('funnel') || tags.includes(DRONE_TAG)) return;
|
||||
if (!(cold > 0) || !battle.rng.chance(prob)) return;
|
||||
battle.applyStatus(ctx.target, 'cold', { duration: cold, source: unit });
|
||||
}, { owner: unit });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
// ---- 3_20 耶拉 · 驭械术师 — S2 心随意动: +1 drone (2 locks; a lone enemy gets both), ATK +, cold procs; 低眉: ATK +
|
||||
// (more with ≥cnt ground tiles in range)
|
||||
// (more with ≥cnt ground tiles in range). S1 攻击力强化·γ型: ATK + only (one unreleased drone, the trait ramp).
|
||||
chess_char_3_20_a: (bb, chess, def) => {
|
||||
const d = defOf(chess, def);
|
||||
const t0 = talentBb(d, 0);
|
||||
const extra = Math.floor(num(bb['attack@cnt'], 0));
|
||||
const prob = num(bb['attack@prob'], 0), cold = num(bb['attack@cold'], 0);
|
||||
const kit = {
|
||||
const rel = kjeraRelease(bb, { restart: false });
|
||||
return {
|
||||
trait: { funnelMul: funnelMap },
|
||||
skill: {
|
||||
kind: 'duration',
|
||||
mods: { atkPct: num(bb.atk) },
|
||||
attack: { onHit({ battle, unit, target }) {
|
||||
if (target && target.alive && cold > 0 && battle.rng.chance(prob)) battle.applyStatus(target, 'cold', { duration: cold, source: unit });
|
||||
} },
|
||||
},
|
||||
// S1 攻击力强化·γ型: ATK + (one drone, the trait ramp as usual)
|
||||
skill: rel.skill,
|
||||
skills: altSkills(chess, d, bb, { 'skcom_atk_up[3]': statSkill }),
|
||||
install(battle, unit) {
|
||||
installFunnelPrune(battle, unit);
|
||||
// "浮游单元+1": every drone locks an enemy — with fewer enemies in range than drones, the spare drone joins a
|
||||
// lock (both attack it, each hit rolls the cold proc; they ramp in parallel, see funnelMap)
|
||||
if (extra > 0) {
|
||||
battle.on('beforeAttack', (ctx) => {
|
||||
if (ctx.attacker !== unit || !unit.skill?.active || !ctx.targets.length) return;
|
||||
const n = 1 + extra;
|
||||
if (ctx.targets.length >= n) return;
|
||||
const base = ctx.targets.slice();
|
||||
const out = base.slice();
|
||||
for (let i = 0; out.length < n; i++) out.push(base[i % base.length]);
|
||||
ctx.targets = out;
|
||||
}, { owner: unit, priority: -50 });
|
||||
}
|
||||
rel.install(battle, unit);
|
||||
},
|
||||
talents: [{ install(battle, unit) {
|
||||
battle.on('deploy', (ctx) => {
|
||||
@@ -52,7 +146,5 @@ export default {
|
||||
}, { owner: unit });
|
||||
} }],
|
||||
};
|
||||
if (extra > 0) kit.skill.targeting = { maxTargets: 1 + extra };
|
||||
return kit;
|
||||
},
|
||||
};
|
||||
@@ -2,35 +2,18 @@
|
||||
// Conventions of the tier-4 kits: ../shared/tier4.js; kit contract and rules: ../README.md.
|
||||
|
||||
import { COLS } from '../../../constants.js';
|
||||
import { canTargetEnemy } from '../../../targeting.js';
|
||||
import { num, tbb, skillActive, withDefaults } from '../shared/tier4.js';
|
||||
import { num, tbb, withDefaults } from '../shared/tier4.js';
|
||||
import { kjeraRelease } from './chess_char_3_20-kjera.js';
|
||||
|
||||
export default withDefaults({
|
||||
// ===== 耶拉 (funnel, hidden) S2 心随意动 — +1 drone locking targets, ATK up, chance to chill; talent 低眉
|
||||
// ===== 耶拉 (funnel, hidden) S2 心随意动 — +1 drone locking targets, ATK up, chance to chill; talent 低眉.
|
||||
// Each released drone restarts at the trait's initial scale (it does not continue the pre-skill ramp) and those
|
||||
// scales are not written back onto the single trait ramp. The body stays an ordinary in-range attack.
|
||||
chess_char_4_03_a: (bb, chess, def) => {
|
||||
const t0 = tbb(def, 0);
|
||||
const n = 1 + Math.max(0, Math.floor(num(bb['attack@cnt'], 1)));
|
||||
const prob = num(bb['attack@prob'], 0), cold = num(bb['attack@cold'], 0);
|
||||
const funnel = (unit) => unit.profile.funnel || { init: 0.2, delta: 0.15, max: 1.1 };
|
||||
const rel = kjeraRelease(bb, { restart: true, announce: true });
|
||||
return {
|
||||
skill: {
|
||||
kind: 'duration',
|
||||
mods: { atkPct: num(bb.atk) },
|
||||
targeting: { maxTargets: n },
|
||||
attack: {
|
||||
// every drone ramps on its own locked target (trait init/delta/max): the multipliers are queued per target
|
||||
// by the beforeAttack hook below (two drones on the same enemy ramp independently)
|
||||
funnelMul: (battle, unit, target) => {
|
||||
const q = unit.mem.kjeraQueue && unit.mem.kjeraQueue.get(target.id);
|
||||
return q && q.length ? q.shift() : funnel(unit).init;
|
||||
},
|
||||
onHit({ battle, unit, target }) {
|
||||
if (target && target.alive && cold > 0 && battle.rng.chance(prob)) battle.applyStatus(target, 'cold', { duration: cold, source: unit });
|
||||
},
|
||||
},
|
||||
onStart({ battle, unit }) { unit.mem.kjeraDrones = []; unit.mem.kjeraQueue = new Map(); battle.fx('drones', { x: unit.x, y: unit.y, id: unit.id, n }); },
|
||||
onEnd({ unit }) { unit.mem.kjeraDrones = []; unit.mem.kjeraQueue = null; },
|
||||
},
|
||||
skill: rel.skill,
|
||||
talents: [{ install(battle, unit) { // 低眉: ATK +10 %, +16 % with ≥ 2 ground tiles in range
|
||||
battle.on('deploy', (c) => {
|
||||
if (c.unit !== unit) return;
|
||||
@@ -40,38 +23,7 @@ export default withDefaults({
|
||||
battle.addBuff(unit, { key: 'kjera:t1', mods: { atkPct: v } });
|
||||
}, { owner: unit });
|
||||
} }],
|
||||
install(battle, unit) {
|
||||
// n drones, each locked on its enemy until that enemy dies (while at least one enemy is in her range). A free
|
||||
// drone takes an enemy no other drone holds, else doubles up on the best target (a lone enemy/boss gets both).
|
||||
battle.on('beforeAttack', (c) => {
|
||||
if (c.attacker !== unit || !skillActive(unit)) return;
|
||||
const ok = (e) => !!e && e.alive && canTargetEnemy(unit, e, { canHitFly: true });
|
||||
const cands = c.targets.filter(ok);
|
||||
const drones = unit.mem.kjeraDrones || (unit.mem.kjeraDrones = []);
|
||||
const held = new Set();
|
||||
for (let i = 0; i < n; i++) { if (drones[i] && ok(drones[i].e)) held.add(drones[i].e); else drones[i] = null; }
|
||||
for (let i = 0; i < n; i++) {
|
||||
if (drones[i]) continue;
|
||||
const e = cands.find((x) => !held.has(x)) ?? cands[0] ?? drones.find((d) => d)?.e;
|
||||
if (!e) continue;
|
||||
held.add(e);
|
||||
drones[i] = { e, scale: null };
|
||||
}
|
||||
const f = funnel(unit);
|
||||
const q = unit.mem.kjeraQueue || (unit.mem.kjeraQueue = new Map());
|
||||
const out = [];
|
||||
for (const d of drones) {
|
||||
if (!d) continue;
|
||||
d.scale = d.scale == null ? f.init : Math.min(f.max, d.scale + f.delta);
|
||||
out.push(d.e);
|
||||
const l = q.get(d.e.id);
|
||||
if (l) l.push(d.scale); else q.set(d.e.id, [d.scale]);
|
||||
}
|
||||
if (out.length) c.targets = out;
|
||||
}, { owner: unit, priority: 10 });
|
||||
// queued multipliers of shots that never landed (target died mid-flight) are dropped with the target
|
||||
battle.on('death', (c) => { if (c.unit.side === 'enemy' && unit.mem.kjeraQueue) unit.mem.kjeraQueue.delete(c.unit.id); }, { owner: unit });
|
||||
},
|
||||
install(battle, unit) { rel.install(battle, unit); },
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -124,8 +124,10 @@ function whitw2(bb, chess, def) {
|
||||
|
||||
const skills = {
|
||||
// S1 慵怠者悲鸣: passive 浮游单元+1 (trait: one more hit per attack); toggled on: ATK +atk and the drones lock a random
|
||||
// non-moving enemy anywhere on the field (re-locking when it moves or falls; install), else her range. The whole-field
|
||||
// grid only selects those targets — no rangeId, no 攻击范围 in the text — so the card keeps her 3-1 (showOwnRange)
|
||||
// non-moving enemy anywhere on the field (re-locking when it moves or falls; install), else her range. The toggle
|
||||
// retargets her attack; the text does not say she stops attacking, so the body and both unreleased additions stay.
|
||||
// The whole-field grid only selects those targets — no rangeId, no 攻击范围 in the text — so the card keeps her 3-1
|
||||
// (showOwnRange)
|
||||
skchr_whitw2_1: {
|
||||
kind: 'toggle',
|
||||
// [ASSUMED] her drones lock enemies only (install): 白铁's 铁钳号 alone does not open S1 / S2 (skills.js allyTargetsOk)
|
||||
@@ -143,6 +145,8 @@ function whitw2(bb, chess, def) {
|
||||
...(skillGridW ? { targeting: { rangeGrid: skillGridW } } : {}),
|
||||
attack: {
|
||||
hits: 1,
|
||||
// The skill names the released drones, not a second hit from her. 0 keeps the ramp inside these hits.
|
||||
funnelBodyHits: 0,
|
||||
funnelMul(battle, unit, target) {
|
||||
const f = unit.profile?.funnel || { init: 0.2, delta: 0.15, max: 1.1 };
|
||||
const m = unit.mem.hunt;
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
// noHeal bool (cannot be healed by others) blockFly bool onHitStatus {key, duration, value}
|
||||
// dmgMul(battle, unit, target) → number afterHit(battle, unit, target, {dealt,x,y})
|
||||
// funnelMul(battle, unit, target) → number (drone ramp, separate from the caster's attack multiplier)
|
||||
// funnelBodyHits n (an unreleased skill attack's body hit count; default normal attack: one, drones: `hits`)
|
||||
// funnelBodyHits n (body hits kept beside that ramp. Omit it for one. 0: drone-only, ramp folded into the hits,
|
||||
// no body — 荒芜拉普兰德 S2. >0: that many body hits — 至简 S2. Not keyed off the skill flag)
|
||||
// canAttack(battle, unit) → bool afterAttack(battle, unit, targets)
|
||||
// skipEnemy(enemy) → bool (an enemy the unit never selects — targeting.js canTargetEnemy; 嵯峨 "不攻击重伤单位")
|
||||
// healThrough(healer, ally) → bool (a healer that selects and heals that ally through its 禁疗 — Battle
|
||||
|
||||
Reference in new issue
Block a user