feedback5 O8: two additive engine rules for the 自选 kits — a 屏障 of one damage type and a profile's own target exclusion

- buffs.js makeBuff / damage.js absorbShields: a shield buff with `shieldType` ('phys' | 'arts' | 'true' | 'elemental')
  absorbs that damage type only (夜莺 S2 法术护盾 "屏障能吸收…法术伤害"); a shield without a type absorbs every type as
  before (PRTS 术语释义 屏障 "若无特殊说明,屏障可吸收全种类伤害"); shields are still spent oldest first.
- targeting.js canTargetEnemy: a profile's `skipEnemy(e)` (a kit trait) keeps such an enemy out of the unit's normal
  targets, its block targets and its skill-trigger target condition (嵯峨 劝善 "嵯峨不攻击重伤单位").
- docs/SIM.md §3 / §4 / §8, professions.js profile field list.
No content uses either yet: golden unchanged (roster 49, bonds 46, fields 22, matches 17, standins 10, diy 6 match).
Test: test/sim/feedback5-o8-engine.test.js (2).
This commit is contained in:
sganggs committed 2026-10-05 23:55:13 +08:00
1 parent 742f478526
commit db7a177164
6 files changed
+115 -12

No files matched your search

+6 -1
View File
@@ -74,7 +74,11 @@ export function enemyStealthed(e) {
return false;
}
/** Can `attacker` (ally) target enemy `e` at all (ignoring range)? */
/**
* Can `attacker` (ally) target enemy `e` at all (ignoring range)? A profile's own exclusion `skipEnemy(e)` (a kit trait:
* 嵯峨 劝善 "嵯峨不攻击重伤单位") keeps such an enemy out of the unit's normal targets, the enemies it blocks
* (blockedTargets) and the target condition of its skill triggers (they pass `unit.profile`).
*/
export function canTargetEnemy(attacker, e, profile) {
if (!e.alive || e.hidden || !e.deployed) return false;
const f = e.s.flags;
@@ -82,6 +86,7 @@ export function canTargetEnemy(attacker, e, profile) {
if (f.stealth && enemyStealthed(e)) return false;
if (e.isFlying && !(profile && profile.canHitFly)) return false;
if (profile && profile.groundOnly && e.isFlying) return false;
if (profile && typeof profile.skipEnemy === 'function' && profile.skipEnemy(e)) return false;
return true;
}