| @@ -187,7 +187,7 @@ export class StruggleAction extends Action { | |||
| new CompositionTest( | |||
| [ | |||
| new OpposedStatScorer( | |||
| { Power: 100, Agility: 1, Bulk: 0.05 }, | |||
| { Power: 1, Agility: 1, Bulk: 0.05 }, | |||
| { Toughness: 1, Reflexes: 1, Mass: 0.05 } | |||
| ) | |||
| ], | |||
| @@ -4,8 +4,9 @@ import { PairCondition, TogetherCondition } from '@/game/combat/conditions' | |||
| import { ConsumeConsequence, DamageConsequence, DrainConsequence, StatusConsequence } from '@/game/combat/consequences' | |||
| import { LogGroupConsequence } from '@/game/combat/groupConsequences' | |||
| import { PreyTargeter, SideTargeter, SoloTargeter } from '@/game/combat/targeters' | |||
| import { CompositionTest, OpposedStatScorer, TestCategory } from '@/game/combat/tests' | |||
| import { Creature } from '@/game/creature' | |||
| import { LogLine } from '@/game/interface' | |||
| import { LogLine, nilLog } from '@/game/interface' | |||
| import { ImproperNoun, MalePronouns, ProperNoun } from '@/game/language' | |||
| import { anyVore, Stomach } from '@/game/vore' | |||
| @@ -48,6 +49,23 @@ export default class Inazuma extends Creature { | |||
| conditions: [new PairCondition(), new TogetherCondition()], | |||
| targeters: [new SideTargeter()], | |||
| consequences: [new ConsumeConsequence(stomach)], | |||
| tests: [new CompositionTest( | |||
| [ | |||
| new OpposedStatScorer( | |||
| { | |||
| Power: 0.5, | |||
| Agility: 0.75 | |||
| }, | |||
| { | |||
| Power: 0.5, | |||
| Reflexes: 0.75 | |||
| } | |||
| ) | |||
| ], | |||
| () => nilLog, | |||
| TestCategory.Vore, | |||
| 0 | |||
| )], | |||
| groupConsequences: [new LogGroupConsequence( | |||
| (user, targets) => new LogLine(`With a mighty GULP!, all ${targets.length} of ${user.name.possessive} prey are swallowed down.`) | |||
| )] | |||
| @@ -210,6 +210,24 @@ export abstract class Word { | |||
| } | |||
| } | |||
| export class OptionalWord extends Word { | |||
| constructor (public word: Word, private chance = 0.5, private suffix = " ") { | |||
| super(word.opt) | |||
| } | |||
| configure (opts: WordOptions): Word { | |||
| return new OptionalWord(this.word.configure(opts), this.chance, this.suffix) | |||
| } | |||
| toString (): string { | |||
| if (Math.random() < this.chance) { | |||
| return this.word + this.suffix | |||
| } else { | |||
| return "" | |||
| } | |||
| } | |||
| } | |||
| export class RandomWord extends Word { | |||
| private history: { last: number } | |||
| constructor (public choices: Array<Word>, opt: WordOptions = emptyConfig, history: { last: number } = { last: -1 }) { | |||
| @@ -329,6 +347,20 @@ export class Adjective extends Word { | |||
| } | |||
| } | |||
| export class Adverb extends Word { | |||
| constructor (private adverb: string, opt: WordOptions = emptyConfig) { | |||
| super(opt) | |||
| } | |||
| configure (opt: WordOptions): Word { | |||
| return new Adverb(this.adverb, opt) | |||
| } | |||
| toString (): string { | |||
| return this.adverb | |||
| } | |||
| } | |||
| export class Verb extends Word { | |||
| constructor (private _root: string, private _singular: string = _root + "s", private _present: string = _root + "ing", private _past: string = _root + "ed", private _pastParticiple: string = _past, public opt: WordOptions = emptyConfig) { | |||
| super(opt) | |||
| @@ -211,7 +211,7 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor | |||
| consumeLine (user: Creature, target: Creature) { | |||
| return new RandomEntry( | |||
| new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective}, forcing ${target.pronouns.objective} ${this.consumePreposition} ${user.pronouns.possessive} ${this.name}.`), | |||
| new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective}, ${Words.Force.present} ${target.pronouns.objective} ${this.consumePreposition} ${user.pronouns.possessive} ${this.name}.`), | |||
| new LogLine(`${user.name.capital} ${user.name.conjugate(new Verb("pounce"))} on ${target.name.objective} and ${user.name.conjugate(this.consumeVerb)} ${target.pronouns.objective}, ${Words.Force.present} ${target.pronouns.objective} ${this.consumePreposition} ${user.pronouns.possessive} ${this.name}.`) | |||
| ) | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| import { RandomWord, ImproperNoun, Adjective, Verb } from '@/game/language' | |||
| import { RandomWord, ImproperNoun, Adjective, Verb, Adverb } from '@/game/language' | |||
| export const Have = new Verb( | |||
| "have", | |||
| @@ -74,12 +74,12 @@ export const Bulge = new RandomWord([ | |||
| ]) | |||
| export const Brutally = new RandomWord([ | |||
| new Adjective('brutally'), | |||
| new Adjective('viciously'), | |||
| new Adjective('callously'), | |||
| new Adjective('savagely'), | |||
| new Adjective('ruthlessly'), | |||
| new Adjective('mercilessly') | |||
| new Adverb('brutally'), | |||
| new Adverb('viciously'), | |||
| new Adverb('callously'), | |||
| new Adverb('savagely'), | |||
| new Adverb('ruthlessly'), | |||
| new Adverb('mercilessly') | |||
| ]) | |||
| export const Fatal = new RandomWord([ | |||
| @@ -115,3 +115,8 @@ export const Flaunt = new RandomWord([ | |||
| new Verb("flaunt"), | |||
| new Verb("show off", "shows off", "showing off", "shown off") | |||
| ]) | |||
| export const Sloppily = new RandomWord([ | |||
| new Adverb("sloppily"), | |||
| new Adverb("messily") | |||
| ]) | |||