|  | import { Creature, Entity } from '../entity'
import { Stat, Damage, DamageType, Vigor, ConstantDamageFormula, Side } from '../combat'
import { ProperNoun, TheyPronouns, ImproperNoun, FemalePronouns, Verb, POV, PairLineArgs, PairLine } from '../language'
import { VoreType, Stomach, InnerStomach, VoreContainer } from '../vore'
import { LogLine, LogLines, LogEntry, FAElem, CompositeLog, ImgElem } from '../interface'
import { AttackAction, EatenAction, TransferAction, FeedAction } from '../combat/actions'
import { InstantKillEffect } from '../combat/effects'
import * as Words from '../words'
class BellyCrushAction extends AttackAction {
  constructor (_damage: Damage) {
    super({
      calc (user) { return _damage.scale(user.voreStats.Bulk / 25) },
      describe (user) { return new LogLine('Deal ', _damage.scale(user.voreStats.Bulk / 25).renderShort(), ` with your ${user.voreStats.Bulk} `, new FAElem('fas fa-weight-hanging')) },
      explain (user) { return new LogLine('Deal ', _damage.scale(user.voreStats.Bulk / 25).renderShort(), ` with your ${user.voreStats.Bulk} `, new FAElem('fas fa-weight-hanging')) }
    })
    this.name = 'Belly Crush'
    this.desc = 'Use your weight!'
  }
  describe (user: Creature, target: Creature): LogEntry {
    return new LogLine(`Crush ${target.name} under your gut. `, this.damage.describe(user, target))
  }
  successLine: PairLineArgs<Creature, { damage: Damage }> = (user, target, args) => new LogLines(new LogLine(
      `${user.name.capital} ${user.name.conjugate(new Verb('crush', 'crushes'))} on ${target.name.objective} with ${user.pronouns.possessive} belly for `,
      target.effectiveDamage(args.damage).renderShort()
  ), new ImgElem('./media/cafat/images/belly-crush.webp'))
}
class BelchAction extends AttackAction {
  constructor (damage: Damage) {
    super(new ConstantDamageFormula(damage))
    this.name = 'Belch'
    this.desc = 'Drain your foe\'s stats with a solid BELCH'
  }
  successLine: PairLineArgs<Creature, { damage: Damage }> = (user, target, args) => new LogLines(
    new LogLine(
      `${user.name.capital} ${user.name.conjugate(new Verb('belch', 'belches'))} on ${target.name.objective} for `,
      target.effectiveDamage(args.damage).renderShort()
    ),
    new ImgElem('./media/cafat/images/belch.webp')
  )
}
class CrushAction extends EatenAction {
  constructor (private _container: VoreContainer) {
    super(_container, "Crush", "Crush 'em!")
    this.desc = "Crush somebody in your gut"
  }
  describe (user: Creature, target: Creature): LogEntry {
    return new LogLine(`Crush ${target.name} in your ${this.container.name} for massive, unavoidable damage.`)
  }
  execute (user: Creature, target: Creature): LogEntry {
    return new LogLines(this.line(user, target, { container: this._container }), target.applyEffect(new InstantKillEffect()))
  }
  line: PairLineArgs<Creature, { container: VoreContainer }> = (user, target, args) => new LogLine(
    `${user.name.capital.possessive} ${args.container.name} ${Words.Brutally} ${user.name.conjugate(new Verb('crush', 'crushes'))} ${target.name.objective}; ${user.pronouns.subjective} ${user.pronouns.conjugate(new Verb('belch', 'belches'))} as ${user.pronouns.possessive} gut lets out a fatal CRUNCH `,
    new ImgElem('./media/cafat/images/crunch.webp')
  )
}
export class Cafat extends Creature {
  constructor () {
    super(new ProperNoun('Cafat'), new ImproperNoun('taur', 'taurs'), [TheyPronouns, FemalePronouns][Math.floor(Math.random() * 2)], {
      [Stat.Toughness]: 30,
      [Stat.Power]: 30,
      [Stat.Speed]: 15,
      [Stat.Willpower]: 25,
      [Stat.Charm]: 20
    }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 150)
    this.side = Side.Monsters
    const stomach = new Stomach(this, 100, new Damage(
      { amount: 20, type: DamageType.Acid, target: Vigor.Health },
      { amount: 10, type: DamageType.Crush, target: Vigor.Stamina },
      { amount: 10, type: DamageType.Dominance, target: Vigor.Resolve }
    ))
    stomach.name = new ImproperNoun("upper stomach", "upper stomachs").all
    this.containers.push(stomach)
    const lowerStomach = new InnerStomach(this, 100, new Damage(
      { amount: 40, type: DamageType.Acid, target: Vigor.Health },
      { amount: 20, type: DamageType.Crush, target: Vigor.Stamina },
      { amount: 20, type: DamageType.Dominance, target: Vigor.Resolve }
    ), stomach)
    lowerStomach.name = new ImproperNoun("lower stomach", "lower stomachs").all
    const crush = new CrushAction(lowerStomach)
    lowerStomach.actions.push(crush)
    this.containers.push(lowerStomach)
    const transfer = new TransferAction(stomach, lowerStomach)
    transfer.verb = new Verb('gulp')
    this.actions.push(transfer)
    this.actions.push(new TransferAction(lowerStomach, stomach))
    this.actions.push(new AttackAction(new ConstantDamageFormula(new Damage({ amount: 40, type: DamageType.Crush, target: Vigor.Health }))))
    this.actions.push(new BellyCrushAction(new Damage({ amount: 10, type: DamageType.Crush, target: Vigor.Health }, { amount: 10, type: DamageType.Dominance, target: Vigor.Resolve })))
    this.actions.push(new BelchAction(new Damage(
      { amount: 10, target: Stat.Toughness, type: DamageType.Acid },
      { amount: 10, target: Stat.Power, type: DamageType.Acid },
      { amount: 10, target: Stat.Speed, type: DamageType.Acid },
      { amount: 10, target: Stat.Willpower, type: DamageType.Acid },
      { amount: 10, target: Stat.Charm, type: DamageType.Acid }
    )))
    this.otherActions.push(new FeedAction(stomach))
  }
}
 |