feedback7: merge fb7-tick — whole-frame attack intervals and time-SP costs take exactly that many frames, 1 s = 30 not 31 (PR #402 by @Cloudnyco, ported onto 0.2.2: 1e-9 on the ally / enemy attack countdown, the 双眼皮 turret and 寒檀's icicles, gainSp / _normalize; PRTS 作战机制 帧对齐); golden: every family moves (281 of 283, end-result flips in §27.61); union OK
This commit is contained in:
commit
e1b75e1308
21 files changed
+5008
-4776
No files matched your search
@@ -34,7 +34,7 @@
|
||||
// keeps those tiles NONE (grid.js DEPLOY_REFUSED_TILES), so automatic placements never use them [ASSUMED].
|
||||
|
||||
import { COLS, ROWS } from '../constants.js';
|
||||
import { performAttack } from '../ai.js';
|
||||
import { performAttack, attackCountdown } from '../ai.js';
|
||||
import { sortEnemyTargets } from '../targeting.js';
|
||||
import { DIR_VEC, normDir, oppositeDir } from '../dir.js';
|
||||
import { hypot } from '../detmath.js';
|
||||
@@ -241,7 +241,7 @@ const TURRET_PROFILE = Object.freeze({ attack: 'ranged', dmgType: 'arts', projec
|
||||
function tickTurret(battle, u, dt) {
|
||||
const T = u.mem.turret;
|
||||
if (!u.alive || !T) return;
|
||||
T.cd -= dt;
|
||||
T.cd = attackCountdown(T.cd, dt); // (the engine's attack countdown: a whole number of ticks takes exactly that many)
|
||||
if (T.cd > 0 || u.s.flags.stun) return;
|
||||
const L = u.ownerId != null ? topLayers(battle, u.ownerId) : 0;
|
||||
const bonus = Math.min(L * T.aspdPer, T.aspdMax);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Conventions of the tier-5 kits: ../shared/tier5.js; kit contract and rules: ../README.md.
|
||||
|
||||
import { COLS } from '../../../constants.js';
|
||||
import { attackCountdown } from '../../../ai.js';
|
||||
import { toLocal } from '../../../dir.js';
|
||||
import { num, talent, skillGrid, batPct, mods, lazySkills, whileOn } from '../shared/tier5.js';
|
||||
|
||||
@@ -33,7 +34,7 @@ export default {
|
||||
attack: { noAttack: true },
|
||||
onStart({ unit }) { unit.mem.iceCd = 0; unit.mem.iceRow = 0; },
|
||||
onTick({ battle, unit, dt }) {
|
||||
unit.mem.iceCd -= dt;
|
||||
unit.mem.iceCd = attackCountdown(unit.mem.iceCd, dt); // (the engine's attack countdown, PR #402)
|
||||
if (unit.mem.iceCd > 0 || !unit.canAct || unit.s.flags.disarm) return;
|
||||
if (!battle.enemiesInKeys(unit.rangeKeys, unit, { canHitFly: true }).length) return;
|
||||
unit.mem.iceCd = unit.s.interval;
|
||||
|
||||
Reference in new issue
Block a user