fix: 准备阶段显示外勤医疗预备干员 (#315)
This commit is contained in:
1 parent
3b57f72704
commit
9db9f3ceea
9 files changed
+132
-15
No files matched your search
@@ -236,10 +236,29 @@ export class MatchViews {
|
||||
return p ? { charId: p.charId, skillIndex: p.skillIndex, uniEquipId: p.uniEquipId } : undefined;
|
||||
}
|
||||
|
||||
/** The 外勤医疗 reserve medic already standing on each player's field in preparation. Touch replaces it only at
|
||||
* battleStart, so the prep view always uses the reserve medic, regardless of the current elite count. The stage's
|
||||
* normal-board slot is transformed to the correct half of a boss field by _onBossHalf / the client prep camera. */
|
||||
prepMapChars(ps) {
|
||||
if (!ps?.alive || this.phase !== PHASE.PREP || !this.order.some((p) => p.alive && p.bandId === 'band_amedic')) return [];
|
||||
const id = 'char_605_cmedic';
|
||||
const slot = this.stage?.mapChars?.find((m) => m?.key === id && Array.isArray(m.pos) && m.pos[0] >= 9 && m.pos[0] <= 12
|
||||
&& m.pos[1] >= 0 && m.pos[1] <= 10 && !/multi_only/.test(String(m.alias)));
|
||||
const rec = this.gd.token(id);
|
||||
if (!slot || !rec) return [];
|
||||
const dir = slot.dir || 'RIGHT';
|
||||
return [{
|
||||
id: -ps.seat - 1, uid: -ps.seat - 1, kind: 'token', side: 'ally', ownerId: ps.playerId, defId: id,
|
||||
area: 'board', name: rec.name || id, tier: 1, golden: false,
|
||||
spine: rec.assets?.spine || id, avatar: rec.assets?.avatar || id,
|
||||
x: slot.pos[1], y: slot.pos[0], dir, facing: dir === 'LEFT' ? -1 : 1, maxHp: rec.stats?.maxHp || 1,
|
||||
}];
|
||||
}
|
||||
|
||||
/** UnitInfo of a player's board pieces on their (board) tiles — a prep scout's board, the boss partner's (bossMateView).
|
||||
* `area: 'board'` (a bench unit says 'hand' / 'temp': prepFieldMeta). */
|
||||
_prepBoardUnits(ps) {
|
||||
const units = [];
|
||||
const units = this.prepMapChars(ps);
|
||||
// the player's own view of the data (0.2.0 自选编队: its slotted DIY slots are its operators — player/diy.js)
|
||||
const gd = ps.gd || this.gd;
|
||||
for (const { r, c, piece } of boardOrder(ps.board)) {
|
||||
|
||||
@@ -88,6 +88,8 @@ export class PlayerViews {
|
||||
hand: this.hand.map((p) => (p ? this.pieceView(p) : null)),
|
||||
temp: this.temp.map((p) => (p ? this.pieceView(p) : null)),
|
||||
board,
|
||||
// The stage's 外勤医疗 reserve medic is present during prep, but is not a draggable board piece.
|
||||
prepMapChars: this.m.prepMapChars(this),
|
||||
deployCap: this.deployCap,
|
||||
deployCount: this.deployCount,
|
||||
// + the mode-off bonds it has members of (`off: true`, the strip's grey 本局禁用 discs — bondsMeta.offBondCounts)
|
||||
|
||||
Reference in new issue
Block a user