Browse Source

Add a bit of documentation

master
Fen Dweller 5 years ago
parent
commit
a5dac4e0ad
2 changed files with 7 additions and 0 deletions
  1. +4
    -0
      src/game/combat.ts
  2. +3
    -0
      src/game/combat/perks.ts

+ 4
- 0
src/game/combat.ts View File

@@ -244,6 +244,9 @@ export class UniformRandomDamageFormula implements DamageFormula {
} }
} }


/**
* A [[DamageFormula]] that uses the attacker's stats
*/
export class StatDamageFormula implements DamageFormula { export class StatDamageFormula implements DamageFormula {
constructor (private factors: Array<{ stat: Stat|VoreStat; fraction: number; type: DamageType; target: Vigor|Stat }>) { constructor (private factors: Array<{ stat: Stat|VoreStat; fraction: number; type: DamageType; target: Vigor|Stat }>) {


@@ -592,6 +595,7 @@ export class Effective {
return [] return []
} }
} }

/** /**
* A displayable status effect * A displayable status effect
*/ */


+ 3
- 0
src/game/combat/perks.ts View File

@@ -7,6 +7,9 @@ import { DamageConsequence, LogConsequence } from './consequences'
import { LogLine } from '../interface' import { LogLine } from '../interface'
import * as Words from '../words' import * as Words from '../words'


/**
* A Perk is like a permanent status effect for a creature.
*/
export abstract class Perk extends Effective { export abstract class Perk extends Effective {
constructor (public name: TextLike, public desc: TextLike) { constructor (public name: TextLike, public desc: TextLike) {
super() super()


Loading…
Cancel
Save