diff --git a/src/components/ContainerView.vue b/src/components/ContainerView.vue index a9ef68f..393580f 100644 --- a/src/components/ContainerView.vue +++ b/src/components/ContainerView.vue @@ -15,7 +15,7 @@ import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' import { Creature } from '@/game/creature' import { POV } from '@/game/language' import { Stats, Stat } from '@/game/combat' -import { Container, VoreContainer, Vore } from '@/game/vore' +import { Container, VoreContainer } from '@/game/vore' function wiggle (contents: HTMLElement) { setTimeout(() => wiggle(contents), 3000) @@ -43,8 +43,8 @@ function draw (delta: number, dt: number, total: number, parent: HTMLElement, ca canvas.height = parent.clientHeight ctx.fillStyle = container.fluidColor const fraction = container.fullness / container.capacity - const livingFraction = container.contents.reduce((total: number, prey: Vore) => total + prey.voreStats.Bulk, 0) / container.capacity - const deadFraction = container.digested.reduce((total: number, prey: Vore) => total + prey.voreStats.Bulk, 0) / container.capacity + const livingFraction = container.contents.reduce((total: number, prey: Creature) => total + prey.voreStats.Bulk, 0) / container.capacity + const deadFraction = container.digested.reduce((total: number, prey: Creature) => total + prey.voreStats.Bulk, 0) / container.capacity const liveliness = livingFraction + deadFraction * 0.5 smoothedFraction = smoothedFraction * 0.995 + fraction * 0.005 diff --git a/src/components/ItemView.vue b/src/components/ItemView.vue index 7b84beb..60c700f 100644 --- a/src/components/ItemView.vue +++ b/src/components/ItemView.vue @@ -15,7 +15,7 @@ import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' import { Creature } from '@/game/creature' import { POV } from '@/game/language' import { Stats, Stat } from '@/game/combat' -import { Container, VoreContainer, Vore } from '@/game/vore' +import { Container, VoreContainer } from '@/game/vore' import { Item, ItemKindIcons, ItemKind } from '@/game/items' @Component({ diff --git a/src/components/WalletView.vue b/src/components/WalletView.vue index 05a86d9..2a7fff2 100644 --- a/src/components/WalletView.vue +++ b/src/components/WalletView.vue @@ -9,7 +9,7 @@ import { Component, Prop, Vue, Watch, Emit } from 'vue-property-decorator' import { Creature } from '@/game/creature' import { POV } from '@/game/language' import { Stats, Stat } from '@/game/combat' -import { Container, VoreContainer, Vore } from '@/game/vore' +import { Container, VoreContainer } from '@/game/vore' import { Item, ItemKindIcons, ItemKind, Currency, CurrencyData } from '@/game/items' @Component({ diff --git a/src/game/creature.ts b/src/game/creature.ts index 3be4175..f1a500b 100644 --- a/src/game/creature.ts +++ b/src/game/creature.ts @@ -1,14 +1,21 @@ -import { Damage, Combatant, Stats, Action, Vigor, Side, GroupAction, VisibleStatus, ImplicitStatus, StatusEffect, DamageType, Effective, VoreStat } from './combat' -import { Noun, Pronoun } from './language' -import { LogEntry, LogLines } from './interface' -import { Vore, VoreContainer, VoreType } from './vore' +import { Damage, Combatant, Stats, Action, Vigor, Side, GroupAction, VisibleStatus, ImplicitStatus, StatusEffect, DamageType, Effective, VoreStat, VoreStats } from './combat' +import { Noun, Pronoun, SoloLine, Verb } from './language' +import { LogEntry, LogLines, LogLine } from './interface' +import { VoreContainer, VoreType, Container } from './vore' import { Item, EquipmentSlot, Equipment, ItemKind, Currency } from './items' import { PassAction } from './combat/actions' import { AI, NoAI } from './ai' +import { Mortal } from './entity' + +export class Creature extends Mortal { + containers: Array = [] + otherContainers: Array = [] + + containedIn: Container | null = null + + voreStats: VoreStats -export class Creature extends Vore implements Combatant { actions: Array = []; - containedIn: VoreContainer | null = null; desc = "Some creature"; get effects (): Array { @@ -29,30 +36,53 @@ export class Creature extends Vore implements Combatant { equipment: {[key in EquipmentSlot]?: Equipment } = {} ai: AI = new NoAI() - constructor (name: Noun, kind: Noun, pronouns: Pronoun, stats: Stats, preyPrefs: Set, predPrefs: Set, mass: number) { - super(name, kind, pronouns, stats, preyPrefs, predPrefs, mass) + constructor (name: Noun, kind: Noun, pronouns: Pronoun, stats: Stats, public preyPrefs: Set, public predPrefs: Set, private baseMass: number) { + super(name, kind, pronouns, stats) this.actions.push(new PassAction()) this.side = Side.Heroes - - const baseVoreStats = this.voreStats /* eslint-disable-next-line */ const self = this this.voreStats = { get [VoreStat.Bulk] () { - return baseVoreStats.Bulk + return self.containers.reduce( + (total: number, container: VoreContainer) => { + return total + container.contents.reduce( + (total: number, prey: Creature) => { + return total + prey.voreStats.Bulk + }, + 0 + ) + container.digested.reduce( + (total: number, prey: Creature) => { + return total + prey.voreStats.Bulk + }, + 0 + ) + }, + self.voreStats.Mass + ) }, get [VoreStat.Mass] () { - const base = baseVoreStats.Mass + const base = self.baseMass const adjusted = self.effects.reduce((scale: number, effect: Effective) => effect.scale(scale), base) return adjusted }, set [VoreStat.Mass] (mass: number) { - baseVoreStats.Mass = mass + self.baseMass = mass }, get [VoreStat.PreyCount] () { - return baseVoreStats["Prey Count"] + return self.containers.reduce( + (total: number, container: VoreContainer) => { + return total + container.contents.concat(container.digested).reduce( + (total: number, prey: Creature) => { + return total + 1 + prey.voreStats[VoreStat.PreyCount] + }, + 0 + ) + }, + 0 + ) } } } @@ -160,4 +190,38 @@ export class Creature extends Vore implements Combatant { return targets.some(target => action.allowed(this, target)) }) } + + destroy (): LogEntry { + const line: SoloLine = (victim) => new LogLine( + `${victim.name.capital} ${victim.name.conjugate(new Verb('die'))}` + ) + + const released: Array = this.containers.flatMap(container => { + return container.contents.map(prey => { + prey.containedIn = this.containedIn + if (this.containedIn !== null) { + this.containedIn.contents.push(prey) + } + return prey + }) + }) + + const names = released.reduce((list: Array, prey: Creature) => list.concat([prey.name.toString()]), []).joinGeneral(", ", " and ").join("") + + if (released.length > 0) { + if (this.containedIn === null) { + return new LogLines( + line(this), + new LogLine(names + ` spill out!`) + ) + } else { + return new LogLines( + line(this), + new LogLine(names + ` spill out into ${this.containedIn.owner.name}'s ${this.containedIn.name}!`) + ) + } + } else { + return line(this) + } + } } diff --git a/src/game/creatures/goldeneye.ts b/src/game/creatures/goldeneye.ts index 5ac9fa2..03dce37 100644 --- a/src/game/creatures/goldeneye.ts +++ b/src/game/creatures/goldeneye.ts @@ -1,7 +1,7 @@ import { Creature } from "../creature" import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, FractionDamageFormula, DamageFormula, UniformRandomDamageFormula, CompositionAction, StatusEffect, CompositeDamageFormula } from '../combat' import { MalePronouns, ImproperNoun, Verb, ProperNoun, ToBe, SoloLineArgs } from '../language' -import { VoreType, NormalContainer, Vore, InnerVoreContainer, Container } from '../vore' +import { VoreType, NormalContainer, InnerVoreContainer, Container } from '../vore' import { TransferAction } from '../combat/actions' import { LogEntry, LogLine, LogLines } from '../interface' import { ContainerFullCondition, CapableCondition, EnemyCondition, TogetherCondition } from '../combat/conditions' @@ -13,7 +13,7 @@ class GoldeneyeCrop extends NormalContainer { releaseVerb: Verb = new Verb('free') struggleVerb: Verb = new Verb('struggle', 'struggles', 'struggling', 'struggled') - constructor (owner: Vore) { + constructor (owner: Creature) { super( new ImproperNoun('crop').all, owner, @@ -103,7 +103,7 @@ class GoldeneyeStomach extends InnerVoreContainer { releaseVerb: Verb = new Verb('free') struggleVerb: Verb = new Verb('struggle', 'struggles', 'struggling', 'struggled') - constructor (owner: Vore, crop: GoldeneyeCrop) { + constructor (owner: Creature, crop: GoldeneyeCrop) { super( new ImproperNoun('stomach').all, owner, diff --git a/src/game/creatures/shingo.ts b/src/game/creatures/shingo.ts index d93ebf9..482ec58 100644 --- a/src/game/creatures/shingo.ts +++ b/src/game/creatures/shingo.ts @@ -1,7 +1,7 @@ import { Creature } from "../creature" import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, StatDamageFormula, Stat, Action, DamageFormula, Condition, FractionDamageFormula } 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 { VoreType, Stomach, Bowels, NormalContainer, InnerContainer, VoreContainer, Container } from '../vore' import { AttackAction, TransferAction, FeedAction, StruggleAction, DamageAction } from '../combat/actions' import { LogLine, LogEntry, LogLines } from '../interface' import { ContainsCondition, CapableCondition, EnemyCondition, TargetDrainedVigorCondition } from '../combat/conditions' @@ -50,7 +50,7 @@ class Hand extends NormalContainer { )) } - consumeLine: PairLineArgs = (user, target, args) => { + 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.`) } } @@ -100,7 +100,7 @@ class Paw extends NormalContainer { )) } - consumeLine: PairLineArgs = (user, target, args) => { + 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}.`) } } diff --git a/src/game/creatures/withers.ts b/src/game/creatures/withers.ts index 4702cb6..7d75429 100644 --- a/src/game/creatures/withers.ts +++ b/src/game/creatures/withers.ts @@ -2,7 +2,7 @@ import { Creature } from "../creature" import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction, CombatTest, Stat, DamageFormula, UniformRandomDamageFormula, Action, DamageInstance, StatDamageFormula, VoreStat } from '../combat' import { ImproperNoun, ProperNoun, FemalePronouns, RandomWord, Adjective, Verb, PairLine } from '../language' import { LogLine, LogLines, LogEntry, Newline } from '../interface' -import { VoreType, Stomach, VoreContainer, Vore, NormalContainer, Container } from '../vore' +import { VoreType, Stomach, VoreContainer, NormalContainer, Container } from '../vore' import { AttackAction, FeedAction, TransferAction } from '../combat/actions' import { TogetherCondition, ContainsCondition, EnemyCondition, AllyCondition, PairCondition, CapableCondition } from '../combat/conditions' import { InstantKillEffect, DamageTypeResistanceEffect } from '../combat/effects' @@ -83,7 +83,7 @@ class MawContainer extends NormalContainer { releaseVerb = new Verb('release') struggleVerb = new Verb('struggle', 'struggles', 'struggling', 'struggled') - constructor (owner: Vore, stomach: VoreContainer) { + constructor (owner: Creature, stomach: VoreContainer) { super(new ImproperNoun('maw'), owner, new Set([VoreType.Oral]), 0.05) const transfer = new TransferAction(this, stomach) @@ -121,7 +121,7 @@ class BootContainer extends NormalContainer { releaseVerb = new Verb('dump') struggleVerb = new Verb('struggle', 'struggles', 'struggling', 'struggled') - constructor (owner: Vore) { + constructor (owner: Creature) { super(new ImproperNoun('boot'), owner, new Set(), 0.05) const flex = new FlexToesAction( diff --git a/src/game/vore.ts b/src/game/vore.ts index 8c7546b..8d306f0 100644 --- a/src/game/vore.ts +++ b/src/game/vore.ts @@ -4,6 +4,7 @@ import { LogLines, LogEntry, LogLine, nilLog } from './interface' import { Noun, Pronoun, ImproperNoun, TextLike, Verb, SecondPersonPronouns, PronounAsNoun, FirstPersonPronouns, PairLineArgs, SoloLine, POV, RandomWord } from './language' import { DigestAction, DevourAction, ReleaseAction, StruggleAction, TransferAction } from './combat/actions' import * as Words from './words' +import { Creature } from './creature' export enum VoreType { Oral = "Oral Vore", @@ -19,133 +20,40 @@ export const anyVore = new Set([ VoreType.Unbirth ]) -export abstract class Vore extends Mortal { - containers: Array = [] - otherContainers: Array = [] - - containedIn: Container | null = null - - voreStats: VoreStats - - constructor (name: Noun, kind: Noun, pronouns: Pronoun, baseStats: Stats, public preyPrefs: Set, public predPrefs: Set, private baseMass: number) { - super(name, kind, pronouns, baseStats) - - const containers = this.containers - - // we can't use arrow notation for getters, so we gotta do this - // eslint-disable-next-line - const self = this - - this.voreStats = { - get [VoreStat.Bulk] () { - return containers.reduce( - (total: number, container: VoreContainer) => { - return total + container.contents.reduce( - (total: number, prey: Vore) => { - return total + prey.voreStats.Bulk - }, - 0 - ) + container.digested.reduce( - (total: number, prey: Vore) => { - return total + prey.voreStats.Bulk - }, - 0 - ) - }, - self.voreStats.Mass - ) - }, - get [VoreStat.Mass] () { - return self.baseMass - }, - set [VoreStat.Mass] (mass: number) { - self.baseMass = mass - }, - get [VoreStat.PreyCount] () { - return containers.reduce( - (total: number, container: VoreContainer) => { - return total + container.contents.concat(container.digested).reduce( - (total: number, prey: Vore) => { - return total + 1 + prey.voreStats[VoreStat.PreyCount] - }, - 0 - ) - }, - 0 - ) - } - } - } - - destroy (): LogEntry { - const line: SoloLine = (victim) => new LogLine( - `${victim.name.capital} ${victim.name.conjugate(new Verb('die'))}` - ) - - const released: Array = this.containers.flatMap(container => { - return container.contents.map(prey => { - prey.containedIn = this.containedIn - if (this.containedIn !== null) { - this.containedIn.contents.push(prey) - } - return prey - }) - }) - - const names = released.reduce((list: Array, prey: Vore) => list.concat([prey.name.toString()]), []).joinGeneral(", ", " and ").join("") - - if (released.length > 0) { - if (this.containedIn === null) { - return new LogLines( - line(this), - new LogLine(names + ` spill out!`) - ) - } else { - return new LogLines( - line(this), - new LogLine(names + ` spill out into ${this.containedIn.owner.name}'s ${this.containedIn.name}!`) - ) - } - } else { - return line(this) - } - } -} - export interface Container extends Actionable { name: Noun; - owner: Vore; + owner: Creature; voreTypes: Set; capacity: number; fullness: number; - contents: Array; + contents: Array; describe: () => LogEntry; - canTake: (prey: Vore) => boolean; - consume: (prey: Vore) => LogEntry; - release: (prey: Vore) => LogEntry; - struggle: (prey: Vore) => LogEntry; + canTake: (prey: Creature) => boolean; + consume: (prey: Creature) => LogEntry; + release: (prey: Creature) => LogEntry; + struggle: (prey: Creature) => LogEntry; consumeVerb: Verb; releaseVerb: Verb; struggleVerb: Verb; - consumeLine: PairLineArgs; + consumeLine: PairLineArgs; } export abstract class NormalContainer implements Container { public name: Noun - contents: Array = [] + contents: Array = [] actions: Array = [] consumeVerb = new Verb('trap') releaseVerb = new Verb('release', 'releases', 'releasing', 'released') struggleVerb = new Verb('struggle', 'struggles', 'struggling', 'struggled') - constructor (name: Noun, public owner: Vore, public voreTypes: Set, public capacityFactor: number) { + constructor (name: Noun, public owner: Creature, public voreTypes: Set, public capacityFactor: number) { this.name = name.all this.actions.push(new DevourAction(this)) this.actions.push(new ReleaseAction(this)) @@ -156,23 +64,23 @@ export abstract class NormalContainer implements Container { return this.capacityFactor * this.owner.voreStats.Mass } - consumeLine: PairLineArgs = (user, target, args) => { + consumeLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective} in ${user.pronouns.possessive} ${args.container.name}.`) } - releaseLine: PairLineArgs = (user, target, args) => { + releaseLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.releaseVerb)} ${target.name.objective} up from ${user.pronouns.possessive} ${args.container.name}.`) } - struggleLine: PairLineArgs = (user, target, args) => { + struggleLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.struggleVerb)} within ${target.name.possessive} ${args.container.name}.`) } get fullness (): number { - return Array.from(this.contents.values()).reduce((total: number, prey: Vore) => total + prey.voreStats.Bulk, 0) + return Array.from(this.contents.values()).reduce((total: number, prey: Creature) => total + prey.voreStats.Bulk, 0) } - canTake (prey: Vore): boolean { + canTake (prey: Creature): boolean { const fits = this.capacity - this.fullness >= prey.voreStats.Bulk const permitted = Array.from(this.voreTypes).every(voreType => { @@ -182,7 +90,7 @@ export abstract class NormalContainer implements Container { return fits && permitted } - consume (prey: Vore): LogEntry { + consume (prey: Creature): LogEntry { if (prey.containedIn !== null) { prey.containedIn.contents = prey.containedIn.contents.filter(item => prey !== item) } @@ -191,7 +99,7 @@ export abstract class NormalContainer implements Container { return this.consumeLine(this.owner, prey, { container: this }) } - release (prey: Vore): LogEntry { + release (prey: Creature): LogEntry { prey.containedIn = this.owner.containedIn this.contents = this.contents.filter(victim => victim !== prey) @@ -201,7 +109,7 @@ export abstract class NormalContainer implements Container { return this.releaseLine(this.owner, prey, { container: this }) } - struggle (prey: Vore): LogEntry { + struggle (prey: Creature): LogEntry { return this.struggleLine(prey, this.owner, { container: this }) } @@ -218,7 +126,7 @@ export abstract class NormalContainer implements Container { export class Hand extends NormalContainer { consumeVerb = new Verb("grab") - constructor (owner: Vore, capacity: number) { + constructor (owner: Creature, capacity: number) { super( new ImproperNoun('hand'), owner, @@ -229,7 +137,7 @@ export class Hand extends NormalContainer { } export abstract class InnerContainer extends NormalContainer { - constructor (name: Noun, owner: Vore, voreTypes: Set, capacity: number, private escape: Container) { + constructor (name: Noun, owner: Creature, voreTypes: Set, capacity: number, private escape: Container) { super(name, owner, voreTypes, capacity) this.actions = [] @@ -237,7 +145,7 @@ export abstract class InnerContainer extends NormalContainer { this.actions.push(new StruggleAction(this)) } - release (prey: Vore): LogEntry { + release (prey: Creature): LogEntry { prey.containedIn = this.escape this.contents = this.contents.filter(victim => victim !== prey) return this.releaseLine(this.owner, prey, { container: this }) @@ -245,14 +153,14 @@ export abstract class InnerContainer extends NormalContainer { } export interface VoreContainer extends Container { - digested: Array; + digested: Array; tick: (dt: number) => LogEntry; - digest: (preys: Vore[]) => LogEntry; - absorb: (preys: Vore[]) => LogEntry; + digest: (preys: Creature[]) => LogEntry; + absorb: (preys: Creature[]) => LogEntry; fluidColor: string; - onDigest: (prey: Vore) => LogEntry; - onAbsorb: (prey: Vore) => LogEntry; + onDigest: (prey: Creature) => LogEntry; + onAbsorb: (prey: Creature) => LogEntry; } export abstract class NormalVoreContainer extends NormalContainer implements VoreContainer { @@ -261,10 +169,10 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor struggleVerb = new Verb('struggle', 'struggles', 'struggling', 'struggled') fluidColor = "#00ff0088" - digested: Array = [] - absorbed: Array = [] + digested: Array = [] + absorbed: Array = [] - constructor (name: Noun, owner: Vore, voreTypes: Set, capacity: number, private damage: Damage) { + constructor (name: Noun, owner: Creature, voreTypes: Set, capacity: number, private damage: Damage) { super(name, owner, voreTypes, capacity) this.name = name @@ -273,28 +181,28 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor } get fullness (): number { - return Array.from(this.contents.concat(this.digested, this.absorbed).values()).reduce((total: number, prey: Vore) => total + prey.voreStats.Bulk, 0) + return Array.from(this.contents.concat(this.digested, this.absorbed).values()).reduce((total: number, prey: Creature) => total + prey.voreStats.Bulk, 0) } - consumeLine: PairLineArgs = (user, target, args) => { + consumeLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective}, forcing ${target.pronouns.objective} into ${user.pronouns.possessive} ${args.container.name}.`) } - tickLine: PairLineArgs = (user, target, args) => { + tickLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate(Words.Churns)} ${target.name.objective} in ${user.pronouns.possessive} ${args.container.name}.`) } - digestLine: PairLineArgs = (user, target, args) => { + digestLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital.possessive} ${args.container.name} ${args.container.name.conjugate(new Verb('finish', 'finishes'))} ${Words.Digests.present} ${target.name.objective} down, ${target.pronouns.possessive} ${Words.Struggles.singular} fading away.`) } - absorbLine: PairLineArgs = (user, target, args) => { + absorbLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital.possessive} ${args.container.name} ${args.container.name.conjugate(new Verb('finish', 'finishes'))} ${Words.Absorbs.present} ${target.name.objective}, fully claiming ${target.pronouns.objective}.`) } tick (dt: number): LogEntry { - const justDigested: Array = [] - const justAbsorbed: Array = [] + const justDigested: Array = [] + const justAbsorbed: Array = [] const scaled = this.damage.scale(dt / 60) @@ -345,25 +253,25 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor return new LogLines(tickedEntries, new LogLines(...damageResults), digestedEntries, absorbedEntries) } - absorb (preys: Vore[]): LogEntry { + absorb (preys: Creature[]): LogEntry { return new LogLines(...preys.map(prey => this.absorbLine(this.owner, prey, { container: this }))) } - digest (preys: Vore[]): LogEntry { + digest (preys: Creature[]): LogEntry { return new LogLines(...preys.map(prey => this.digestLine(this.owner, prey, { container: this }))) } - onAbsorb (prey: Vore): LogEntry { + onAbsorb (prey: Creature): LogEntry { return nilLog } - onDigest (prey: Vore): LogEntry { + onDigest (prey: Creature): LogEntry { return nilLog } } export abstract class InnerVoreContainer extends NormalVoreContainer { - constructor (name: Noun, owner: Vore, voreTypes: Set, capacity: number, damage: Damage, private escape: Container) { + constructor (name: Noun, owner: Creature, voreTypes: Set, capacity: number, damage: Damage, private escape: Container) { super(name, owner, voreTypes, capacity, damage) this.actions = [] @@ -372,7 +280,7 @@ export abstract class InnerVoreContainer extends NormalVoreContainer { this.actions.push(new StruggleAction(this)) } - release (prey: Vore): LogEntry { + release (prey: Creature): LogEntry { prey.containedIn = this.escape this.contents = this.contents.filter(victim => victim !== prey) this.escape.consume(prey) @@ -381,18 +289,18 @@ export abstract class InnerVoreContainer extends NormalVoreContainer { } export class Stomach extends NormalVoreContainer { - constructor (owner: Vore, capacity: number, damage: Damage) { + constructor (owner: Creature, capacity: number, damage: Damage) { super(new ImproperNoun('stomach', 'stomachs').all, owner, new Set([VoreType.Oral]), capacity, damage) } - digest (preys: Vore[]): LogEntry { + digest (preys: Creature[]): LogEntry { if (preys.length === 0) { return super.digest(preys) } const heal = new Damage( { - amount: preys.reduce((total: number, next: Vore) => total + next.maxVigors.Health / 5, 0), + amount: preys.reduce((total: number, next: Creature) => total + next.maxVigors.Health / 5, 0), type: DamageType.Heal, target: Vigor.Health } @@ -408,17 +316,17 @@ export class Stomach extends NormalVoreContainer { export class InnerStomach extends InnerVoreContainer { consumeVerb = new Verb('swallow') releaseVerb = new Verb('hork') - constructor (owner: Vore, capacity: number, damage: Damage, escape: VoreContainer) { + constructor (owner: Creature, capacity: number, damage: Damage, escape: VoreContainer) { super(new ImproperNoun('inner stomach', 'inner stomachs').all, owner, new Set([VoreType.Oral]), capacity, damage, escape) } } export class Bowels extends NormalVoreContainer { - constructor (owner: Vore, capacity: number, damage: Damage) { + constructor (owner: Creature, capacity: number, damage: Damage) { super(new ImproperNoun('bowel', 'bowels').plural.all, owner, new Set([VoreType.Anal]), capacity, damage) } - tickLine: PairLineArgs = (user, target, args) => { + tickLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate( new RandomWord([ new Verb('crush', 'crushes'), @@ -431,7 +339,7 @@ export class Bowels extends NormalVoreContainer { export class Cock extends NormalVoreContainer { fluidColor = "#eeeeee66"; - constructor (owner: Vore, capacity: number, damage: Damage) { + constructor (owner: Creature, capacity: number, damage: Damage) { super( new ImproperNoun('cock').all, owner, @@ -441,7 +349,7 @@ export class Cock extends NormalVoreContainer { ) } - tickLine: PairLineArgs = (user, target, args) => { + tickLine: PairLineArgs = (user, target, args) => { return new LogLine(`${user.name.capital} ${user.name.conjugate( new RandomWord([ new Verb('crush', 'crushes'), @@ -454,7 +362,7 @@ export class Cock extends NormalVoreContainer { export class Balls extends InnerVoreContainer { fluidColor = "#eeeeeecc"; - constructor (owner: Vore, capacity: number, damage: Damage, escape: Container) { + constructor (owner: Creature, capacity: number, damage: Damage, escape: Container) { super( new ImproperNoun('ball', 'balls').all.plural, owner, @@ -469,7 +377,7 @@ export class Balls extends InnerVoreContainer { export class Slit extends NormalVoreContainer { fluidColor = "#cccccc99"; - constructor (owner: Vore, capacity: number, damage: Damage) { + constructor (owner: Creature, capacity: number, damage: Damage) { super( new ImproperNoun('slit').all, owner, @@ -483,7 +391,7 @@ export class Slit extends NormalVoreContainer { export class Womb extends InnerVoreContainer { fluidColor = "#ddddddbb"; - constructor (owner: Vore, capacity: number, damage: Damage, escape: Container) { + constructor (owner: Creature, capacity: number, damage: Damage, escape: Container) { super( new ImproperNoun('womb').all, owner, @@ -496,7 +404,7 @@ export class Womb extends InnerVoreContainer { } export function biconnectContainers (outer: VoreContainer, inner: VoreContainer): void { - outer.onDigest = (prey: Vore) => { + outer.onDigest = (prey: Creature) => { outer.digested = outer.digested.filter(victim => victim !== prey) inner.digested.push(prey) return inner.consumeLine(inner.owner, prey, { container: inner })