import { Creature } from "../creature" import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, StatDamageFormula, Stat, Action, DamageFormula } from '../combat' import { ImproperNoun, ProperNoun, FemalePronouns, MalePronouns, Verb, PairLineArgs, PairLine, TextLike } from '../language' import { VoreType, Stomach, Bowels, NormalContainer, InnerContainer, VoreContainer, Container, Vore } from '../vore' import { AttackAction, TransferAction, FeedAction, StruggleAction, DamageAction } from '../combat/actions' import { LogLine, LogEntry, LogLines } from '../interface' import { ContainsCondition, CapableCondition, EnemyCondition } from '../combat/conditions' import { StatTest } from '../combat/tests' export class TrappedAction extends DamageAction { protected test: StatTest constructor (name: TextLike, desc: TextLike, protected verb: Verb, protected damage: DamageFormula, container: Container) { super( name, desc, damage, [new CapableCondition(), new ContainsCondition(container), new EnemyCondition()] ) this.test = new StatTest(Stat.Power) } describe (user: Creature, target: Creature): LogEntry { return new LogLine(`Chew on ${target.name}. `, this.damage.describe(user, target), '. ', this.test.explain(user, target)) } successLine: PairLineArgs = (user, target, args) => new LogLine( `${user.name.capital} ${user.name.conjugate(this.verb)} ${target.name.objective} for `, target.effectiveDamage(args.damage).renderShort() ) failLine: PairLine = (user, target) => new LogLine( `${user.name.capital} can't quite get ${user.pronouns.possessive} teeth around ${target.name.objective}.` ) } class Hand extends NormalContainer { consumeVerb: Verb = new Verb('grab', 'grabs', 'grabbing', 'grabbed') releaseVerb: Verb = new Verb('release', 'releases', 'releasing', 'released') struggleVerb: Verb = new Verb('squirm', 'squirms', 'squirming', 'squirmed') constructor (owner: Creature) { super(new ImproperNoun('hand', 'hands'), owner, new Set(), 100) this.actions.push(new TrappedAction( "Grip", "Give your victim the squeeze", new Verb( 'squeeze' ), new ConstantDamageFormula( new Damage( { amount: 200, target: Vigor.Health, type: DamageType.Crush } ) ), this )) } consumeLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective} up in ${user.pronouns.possessive} ${args.container.name}, giving ${target.pronouns.objective} a firm squeeze in ${user.pronouns.possessive} fingers.`) } } class Paw extends NormalContainer { consumeVerb: Verb = new Verb('pin', 'pins', 'pinning', 'pinbed') releaseVerb: Verb = new Verb('release', 'releases', 'releasing', 'released') struggleVerb: Verb = new Verb('squirm', 'squirms', 'squirming', 'squirmed') constructor (owner: Creature) { super(new ImproperNoun('paw', 'paws'), owner, new Set([VoreType.Oral]), 100) this.actions.push(new TrappedAction( "Smother", "Bury your victim under your toes", new Verb( 'smother' ), new ConstantDamageFormula( new Damage( { amount: 10, target: Stat.Toughness, type: DamageType.Crush }, { amount: 10, target: Stat.Power, type: DamageType.Crush }, { amount: 10, target: Stat.Speed, type: DamageType.Crush } ) ), this )) } consumeLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective} beneath ${user.pronouns.possessive} ${args.container.name}.`) } } class Maw extends NormalContainer { consumeVerb: Verb = new Verb('grab', 'grabs', 'grabbing', 'grabbed') releaseVerb: Verb = new Verb('release', 'releases', 'releasing', 'released') struggleVerb: Verb = new Verb('squirm', 'squirms', 'squirming', 'squirmed') constructor (owner: Creature) { super(new ImproperNoun('maw', 'maws'), owner, new Set([VoreType.Oral]), 100) this.actions = [] this.actions.push(new StruggleAction(this)) this.actions.push(new TrappedAction( "Chew", "Chew on your victim", new Verb( 'bite down on', 'bites down on', 'biting down on', 'bit down on' ), new ConstantDamageFormula( new Damage( { amount: 200, target: Vigor.Health, type: DamageType.Crush } ) ), this )) } } export class Shingo extends Creature { constructor () { super( new ProperNoun('Shingo'), new ImproperNoun('red panda', 'red pandas'), MalePronouns, { Toughness: 40, Power: 50, Speed: 30, Willpower: 30, Charm: 60 }, new Set(), new Set([VoreType.Oral]), 3000 ) this.actions.push( new AttackAction( new StatDamageFormula( [ { fraction: 0.5, stat: Stat.Power, target: Vigor.Health, type: DamageType.Crush } ] ) ) ) this.side = Side.Monsters const stomach = new Stomach(this, 50, new Damage( { amount: 200, type: DamageType.Acid, target: Vigor.Health }, { amount: 100, type: DamageType.Crush, target: Vigor.Stamina }, { amount: 100, type: DamageType.Dominance, target: Vigor.Resolve } )) this.containers.push(stomach) this.otherActions.push(new FeedAction(stomach)) const hand = new Hand(this) const maw = new Maw(this) this.otherContainers.push(hand) this.otherContainers.push(maw) const stuff = new TransferAction(hand, maw) stuff.verb = new Verb('stuff') stuff.line = (user, target, args) => new LogLine( `${user.name.capital} ${user.name.conjugate(stuff.verb)} ${target.name.objective} into ${user.pronouns.possessive} ${args.to.name}!` ) this.actions.push(stuff) const gulp = new TransferAction(maw, stomach) gulp.verb = new Verb('gulp') gulp.line = (user, target, args) => new LogLine( `${user.name.capital} ${user.name.conjugate(gulp.verb)} ${target.name.objective} down ${user.pronouns.possessive} tight, inescapable gullet, sending ${target.pronouns.objective} down to ${user.pronouns.possessive} ${args.to.name}` ) this.actions.push(gulp) this.otherContainers.push(new Paw(this)) } }