0.2.5-dev: 驭械术师 normal attacks keep the operator's own hit plus one drone hit, the drone multiplier and per-target map reset on redeploy, 洛洛 S2 keeps its lock until a kill or the skill ends (PRs #537 / #536 / #535 by @Xinglan233, ported); hit tiles use the official round-half-to-even with an edge inset (PR #520 by @Cloudnyco, ported); bots softly avoid living teammates' opening factions until they are eliminated (PR #518 by @IceCodeNew, ported with changes); golden: 43 more scenarios move, each named in docs/history/0.2.5.md
This commit is contained in:
1 parent
7fd0478dc0
commit
e0f3771821
41 files changed
+1939
-779
No files matched your search
@@ -10,6 +10,7 @@
|
||||
// test/sim/detmath.test.js scans server/sim/).
|
||||
//
|
||||
// hypot(x, y) √(x² + y²) as Math.sqrt(x*x + y*y), rescaled by exact powers of two outside 2^±500
|
||||
// roundHalfEven(x) nearest integer, ties to even (四舍六入五成双); Math.round and Math.floor, never −0
|
||||
// powi(x, n) xⁿ for an integer n: square-and-multiply in double-double, one final rounding
|
||||
// sin(x), cos(x) fdlibm 5.3 (__kernel_sin / __kernel_cos / __ieee754_rem_pio2)
|
||||
// atan2(y, x) fdlibm (FreeBSD msun e_atan2.c / s_atan.c)
|
||||
@@ -46,6 +47,17 @@ export function hypot(x, y) {
|
||||
return Math.sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
/**
|
||||
* x rounded to an integer, ties to even (2.5 → 2, 3.5 → 4, −2.5 → −2): the rule PRTS 作战机制 gives for the tile of a
|
||||
* target — 受击方坐标经round函数取整(四舍六入五成双)得到其所属格坐标. Math.round rounds ties up (2.5 → 3). Exact; never −0.
|
||||
* @param {number} x
|
||||
*/
|
||||
export function roundHalfEven(x) {
|
||||
const f = Math.floor(x);
|
||||
if (x - f !== 0.5) return Math.round(x) + 0;
|
||||
return (f % 2 === 0 ? f : f + 1) + 0;
|
||||
}
|
||||
|
||||
// ---- integer powers ----------------------------------------------------------------------------------------------
|
||||
|
||||
const SPLIT = 134217729; // 2^27 + 1 (Dekker)
|
||||
|
||||
Reference in new issue
Block a user