瀏覽代碼

Add test descriptions to CompositionActions

vintage
Fen Dweller 5 年之前
父節點
當前提交
305e29ed64
共有 2 個檔案被更改,包括 9 行新增1 行删除
  1. +3
    -1
      src/game/combat.ts
  2. +6
    -0
      src/game/combat/consequences.ts

+ 3
- 1
src/game/combat.ts 查看文件

@@ -408,7 +408,9 @@ export class CompositionAction extends Action {


describe (user: Creature, target: Creature): LogEntry { describe (user: Creature, target: Creature): LogEntry {
return new LogLines( return new LogLines(
...this.consequences.map(consequence => consequence.describePair(user, target))
...this.consequences.map(consequence => consequence.describePair(user, target)).concat(
super.describe(user, target)
)
) )
} }
} }


+ 6
- 0
src/game/combat/consequences.ts 查看文件

@@ -92,4 +92,10 @@ export class StatusConsequence extends Consequence {
apply (user: Creature, target: Creature): LogEntry { apply (user: Creature, target: Creature): LogEntry {
return target.applyEffect(this.statusMaker()) return target.applyEffect(this.statusMaker())
} }

describePair (user: Creature, target: Creature): LogEntry {
return new LogLine(
`Applies a ${this.statusMaker().name} effect.`
)
}
} }

Loading…
取消
儲存