Sfoglia il codice sorgente

Add test descriptions to CompositionActions

vintage
Fen Dweller 5 anni fa
parent
commit
305e29ed64
2 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. +3
    -1
      src/game/combat.ts
  2. +6
    -0
      src/game/combat/consequences.ts

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

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

describe (user: Creature, target: Creature): LogEntry {
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 Vedi File

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

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

Loading…
Annulla
Salva