Browse Source

Add test descriptions to CompositionActions

master
Fen Dweller 5 years ago
parent
commit
305e29ed64
2 changed files with 9 additions and 1 deletions
  1. +3
    -1
      src/game/combat.ts
  2. +6
    -0
      src/game/combat/consequences.ts

+ 3
- 1
src/game/combat.ts View File

@@ -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 View File

@@ -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…
Cancel
Save