diff --git a/src/game/creatures/withers.ts b/src/game/creatures/withers.ts index 57196b0..9058d10 100644 --- a/src/game/creatures/withers.ts +++ b/src/game/creatures/withers.ts @@ -1,6 +1,6 @@ import { Creature, POV } from '../entity' import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, CombatTest, Stat, DamageFormula, UniformRandomDamageFormula, Action, DamageInstance, StatDamageFormula, VoreStat } from '../combat' -import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective, POVPairArgs, POVSoloArgs, Verb } from '../language' +import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective, POVPairArgs, Verb } from '../language' import { LogLine, LogLines, LogEntry, Newline } from '../interface' import { VoreType, Stomach, VoreContainer, Vore, NormalContainer, Container } from '../vore' import { AttackAction, FeedAction, TransferAction, EatenAction } from '../combat/actions' @@ -304,20 +304,13 @@ class StompAllyAction extends Action { } 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!`)] - ]) + line = (user: Creature, target: Creature) => new LogLine(`${user.name.capital} ${user.name.conjugate(new Verb('scoop'))} ${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`)] - ]) + groupLine = (user: Creature, args: { count: number }) => new LogLine(`${Words.SwallowSound.allCaps}! All ${args.count} of ${user.pronouns.possessive} prey pour down ${user.name.possessive} ${Words.Slick} gullet as ${user.pronouns.subjective} ${user.name.conjugate(Words.Swallows)}; 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)) + return new LogLines(this.line(user, target)) } describe (user: Creature, target: Creature): LogEntry { @@ -328,7 +321,7 @@ class DevourAllAction extends GroupAction { return new LogLines(...targets.filter(target => this.test.test(user, target)).map(target => this.execute(user, target)).concat( [ new Newline(), - this.groupLines.run(user, { count: targets.length }) + this.groupLine(user, { count: targets.length }) ] )) } diff --git a/src/game/language.ts b/src/game/language.ts index 2b51afe..b4f5565 100644 --- a/src/game/language.ts +++ b/src/game/language.ts @@ -48,22 +48,6 @@ export class POVSolo { } } -export class POVSoloArgs { - run (user: K, args: U): LogEntry { - const choice = this.options.find(element => element[0][0] === user.perspective) - - if (choice === undefined) { - return new LogLine("Fen didn't write any text for this...") - } else { - return choice[1](user, args) - } - } - - constructor (private options: Array<[[POV], (user: K, args: U) => LogEntry]>) { - - } -} - enum NounKind { Specific, Nonspecific, @@ -326,6 +310,14 @@ export class Noun extends Word { return result } + + conjugate (verb: Word): Word { + if (this.opt.plural) { + return verb.root + } else { + return verb.singular + } + } } export class ImproperNoun extends Noun { @@ -437,6 +429,7 @@ export class PronounAsNoun extends Noun { constructor (private pronouns: Pronoun, opt: WordOptions = emptyConfig) { super(pronouns.subjective, pronouns.subjective, pronouns.possessive, opt) this.options.nounKind = NounKind.All + this.options.plural = true } configure (opts: WordOptions): Word {