import { Creature, POV } from '../entity' import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction } from '../combat' import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective } from '../language' import { LogLine, LogLines, LogEntry } from '../interface' import { VoreType, Stomach, Container } from '../vore' import { AttackAction, FeedAction } from '../combat/actions' import { TogetherCondition } from '../combat/conditions' import { InstantKill } from '../combat/effects' const huge = new RandomWord([ new Adjective('massive'), new Adjective('colossal'), new Adjective('big ol\''), new Adjective('heavy'), new Adjective('crushing'), new Adjective('huge') ]) class BiteAction extends AttackAction { constructor () { super(new ConstantDamageFormula(new Damage({ amount: 50, type: DamageType.Slash, target: Vigor.Health }))) this.name = "Bite" } } class StompAction extends GroupAction { lines: POVPair = new POVPair([ [[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You flatten ${target.name} under your foot!`)], [[POV.Third, POV.First], (user: Creature) => new LogLine(`${user.name.capital} flattens you under ${user.pronouns.possessive} ${huge} foot!`)], [[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} flattens ${target.name} under ${user.pronouns.possessive} ${huge} foot!`)] ]) execute (user: Creature, target: Creature): LogEntry { return new LogLines(this.lines.run(user, target), new InstantKill().apply(target)) } describe (user: Creature, target: Creature): LogEntry { return new LogLine('Stomp one sucker') } describeGroup (user: Creature, targets: Array): LogEntry { return new LogLine('Stomp all ', targets.length.toString(), ' of \'em!') } constructor () { super('Stomp', 'STOMP!', [ new TogetherCondition() ]) } } class DevourAllAction extends GroupAction { lines: POVPair = new POVPair([ [[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You scoop up ${target.name}!`)], [[POV.Third, POV.First], (user: Creature) => new LogLine(`${user.name.capital} scoops you up!`)], [[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} scoops ${target.name} up!`)] ]) execute (user: Creature, target: Creature): LogEntry { this.container.consume(target) return new LogLines(this.lines.run(user, target)) } describe (user: Creature, target: Creature): LogEntry { return new LogLine('Stomp one sucker') } executeGroup (user: Creature, targets: Array): LogEntry { return new LogLines(...targets.map(target => this.execute(user, target)).concat( [new LogLine(`All ${targets.length} of them are ${user.kind} chow now`)] )) } describeGroup (user: Creature, targets: Array): LogEntry { return new LogLine('Eat all ', targets.length.toString(), ' of \'em!') } constructor (private container: Container) { super('Devour All', 'GULP!', [ new TogetherCondition() ]) } } export class Withers extends Creature { constructor () { super( new ProperNoun('Withers'), new ImproperNoun('hellhound', 'hellhounds'), FemalePronouns, { Toughness: 60, Power: 70, Speed: 40, Willpower: 60, Charm: 120 }, new Set(), new Set([VoreType.Oral]), 5000) this.actions.push(new BiteAction()) this.groupActions.push(new StompAction()) this.side = Side.Monsters const stomach = new Stomach(this, 50, new Damage( { amount: 30, type: DamageType.Acid, target: Vigor.Health }, { amount: 20, type: DamageType.Crush, target: Vigor.Stamina }, { amount: 20, type: DamageType.Dominance, target: Vigor.Resolve } )) this.containers.push(stomach) this.otherActions.push(new FeedAction(stomach)) this.groupActions.push(new DevourAllAction(stomach)) } }