0.2.4-dev: round-29 community fixes and the official shared card pool
- Shared card pool and item stock as in the official mode (the owner's request, from the 路标档案馆 video and public notes): solo low-tier exceptions, co-op operators x2, shared item stock with special-item exceptions, normal / advanced occupancy 1 / 2, re-check on buy, 机变 exhaustion, release on consume / destroy / elimination; 整备 never exceeds stock; invariant held <= cap. - 突袭: one taunt-first reselect right after a revive (the owner's rule); ordinary polls and redeploys keep the 0.2.3 rule; a revive on an enemy's tile stays. #475: online boss / hidden-boss Raid may land on the empty half (owner-limited scope). - 浊心斯卡蒂 S1 x 坚守 no longer bounce redirected damage, and the two shares conserve the hit (idea of PR #464 by @HappyTanuki). - Operator fixes adapted from PRs by @Xinglan233 (#459 哈洛德 S2 elemental trigger, #460 涤火杰西卡 shield on the four adjacent tiles, #461 家族徽章 first hit after stealth, #462 松果 S2 regrow per deploy); 克莱门莎 S2 splash 1.1 / 100% ATK and air auto-trigger (#467); 白面 copying 歌蕾蒂娅 / 余 skips the three-member condition (#473, the owner's video). - 香槟炸弹 is not chosen by friendly auras / heals (PR #468 / #476 by @Siornya); 琳琅诗怀雅 coin balance (PR #450 by @IceCodeNew); Touch prep display (PR #451 by @YinqiMargatroid); lobby header (PR #471 by @YuriRestia); Japanese UI terms (PR #448 by @scutkane). - AI-only boss countdown grace, render-failure cache / recovery without restarting a battle, device units kept on a same-field re-entry, DIY detail / skill previews, large-text result buttons. - golden: battle families equal 0.2.3 except diy-135 / diy-136 (克莱门莎); all 18 release matches move through the shared pool, every flip named in docs/history/0.2.4.md §29.12; two coverage scenarios added.
This commit is contained in:
1 parent
1db8e51023
commit
6bfc08270c
129 files changed
+3477
-1011
No files matched your search
@@ -122,6 +122,48 @@ export function isHpLoss(dmg) {
|
||||
return !!dmg && Array.isArray(dmg.tags) && dmg.tags.includes('hpLoss');
|
||||
}
|
||||
|
||||
/**
|
||||
* Record one redirect ratio of the pre-redirect hit and leave the victim the rest.
|
||||
* Each recorded ratio is a share of that hit; the victim keeps `1 − sum`. Two redirects therefore
|
||||
* add up with the part the victim still takes. [ASSUMED] 浊心斯卡蒂 S1 and 坚守 do not say how they
|
||||
* combine; multiplying the two remainders drops the product of the ratios. A sum of 1 or more leaves
|
||||
* the victim with none of this hit (the same loss a single 100 % redirect already has, because the
|
||||
* HP that arrives is 0 and no share is dealt).
|
||||
* @param {object} dmg normalised DamageInfo
|
||||
* @param {number} ratio
|
||||
*/
|
||||
export function applyRedirectCut(dmg, ratio) {
|
||||
const r = ratio < 0 ? 0 : ratio > 1 ? 1 : Number(ratio) || 0;
|
||||
if (!(r > 0) || !dmg) return 0;
|
||||
const prev = Array.isArray(dmg.redirectCuts) ? dmg.redirectCuts : (dmg.redirectCuts = []);
|
||||
let prevSum = 0;
|
||||
for (const x of prev) prevSum += x;
|
||||
const prevKeep = prevSum >= 1 ? 0 : 1 - prevSum;
|
||||
prev.push(r);
|
||||
const nextSum = prevSum + r;
|
||||
const nextKeep = nextSum >= 1 ? 0 : 1 - nextSum;
|
||||
if (prevKeep > 1e-12) dmg.mul *= nextKeep / prevKeep;
|
||||
else dmg.mul *= 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* This redirect's share of the HP that reached the victim, taken from the pre-redirect amount.
|
||||
* @param {number} amount HP removed from the victim after every redirect cut
|
||||
* @param {number} own this redirect's ratio
|
||||
* @param {number[]|undefined} cuts every ratio recorded on the hit
|
||||
*/
|
||||
export function redirectShare(amount, own, cuts) {
|
||||
const list = Array.isArray(cuts) ? cuts : [];
|
||||
let sum = 0;
|
||||
for (const x of list) sum += x;
|
||||
const o = own > 0 ? own : 0;
|
||||
if (!(amount > 0) || !(o > 0) || !(sum > 0)) return 0;
|
||||
const keep = 1 - sum;
|
||||
if (keep > 1e-12) return amount / keep * o;
|
||||
return amount * (o / sum);
|
||||
}
|
||||
|
||||
/** 沉睡 (ba.sleep "无敌且无法行动"): only attackers whose profile has `hitSleep` (or `ignoreSleep` damage) reach a sleeper. */
|
||||
function sleepBlocks(target, source, dmg) {
|
||||
return !!target.s.flags.sleep && !dmg.ignoreSleep && !(source && source.profile && source.profile.hitSleep);
|
||||
|
||||
Reference in new issue
Block a user