import { Creature, POV } from '../entity' import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction } from '../combat' import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective, POVPairArgs, POVSoloArgs } from '../language' import { LogLine, LogLines, LogEntry, Newline } from '../interface' import { VoreType, Stomach, Container, Vore } from '../vore' import { AttackAction, FeedAction } from '../combat/actions' import { TogetherCondition } from '../combat/conditions' import { InstantKill } from '../combat/effects' import * as Words from '../words' 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!`)] ]) groupLines = new POVSoloArgs([ [[POV.First], (user, args) => new LogLine(`${Words.SwallowSound.allCaps}! All ${args.count} of your prey pour down your ${Words.Slick} throat. They're just ${user.kind.all} chow now`)], [[POV.Third], (user, args) => new LogLine(`${Words.SwallowSound.allCaps}! All ${args.count} of ${user.pronouns.possessive} prey pour down ${user.name}'s ${Words.Slick} gullet as ${user.pronouns.subjective} ${Words.Swallows.singular}; they're just ${user.kind.all} chow now`)] ]) 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 Newline(), this.groupLines.run(user, { count: targets.length }) ] )) } 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: 300, type: DamageType.Acid, target: Vigor.Health }, { amount: 200, type: DamageType.Crush, target: Vigor.Stamina }, { amount: 200, type: DamageType.Dominance, target: Vigor.Resolve } )) stomach.tickLines = new POVPairArgs([ [[POV.First, POV.Third], (user, target, args) => new LogLine(`Your stomach ${Words.Churns.singular} ${target.name} for `, args.damage.renderShort())], [[POV.Third, POV.First], (user, target, args) => new LogLine(`${user.name.capital}'s stomach ${Words.Churns.singular} you for `, args.damage.renderShort())], [[POV.Third, POV.Third], (user, target, args) => new LogLine(`${user.name.capital} ${Words.Churns.singular} ${target.name} for `, args.damage.renderShort())] ]) stomach.digestLines = new POVPair([ [[POV.First, POV.Third], (user, target) => new LogLine(`Your stomach ${Words.Digests.singular} ${target.name}`)], [[POV.Third, POV.First], (user, target) => new LogLine(`${user.name.capital}'s stomach ${Words.Digests.singular} you`)], [[POV.Third, POV.Third], (user, target) => new LogLine(`${target.name.capital}'s squirms fade as the ${target.kind.all} is ${Words.Digests.past} by the ${user.kind}'s ${stomach.name}.`)] ]) this.containers.push(stomach) this.otherActions.push(new FeedAction(stomach)) this.groupActions.push(new DevourAllAction(stomach)) } }