|
|
|
@@ -1,8 +1,8 @@ |
|
|
|
import { Mortal } from './entity' |
|
|
|
import { Damage, DamageType, Stats, Actionable, Action, Vigor, VoreStats, VisibleStatus, VoreStat, DamageInstance } from './combat' |
|
|
|
import { LogLines, LogEntry, LogLine } from './interface' |
|
|
|
import { LogLines, LogEntry, LogLine, nilLog } from './interface' |
|
|
|
import { Noun, Pronoun, ImproperNoun, TextLike, Verb, SecondPersonPronouns, PronounAsNoun, FirstPersonPronouns, PairLineArgs, SoloLine, POV } from './language' |
|
|
|
import { DigestAction, DevourAction, ReleaseAction, StruggleAction } from './combat/actions' |
|
|
|
import { DigestAction, DevourAction, ReleaseAction, StruggleAction, TransferAction } from './combat/actions' |
|
|
|
import * as Words from './words' |
|
|
|
|
|
|
|
export enum VoreType { |
|
|
|
@@ -230,7 +230,11 @@ export interface VoreContainer extends Container { |
|
|
|
digested: Array<Vore>; |
|
|
|
tick: (dt: number) => LogEntry; |
|
|
|
digest: (preys: Vore[]) => LogEntry; |
|
|
|
absorb: (preys: Vore[]) => LogEntry; |
|
|
|
fluidColor: string; |
|
|
|
|
|
|
|
onDigest: (prey: Vore) => LogEntry; |
|
|
|
onAbsorb: (prey: Vore) => LogEntry; |
|
|
|
} |
|
|
|
|
|
|
|
export abstract class NormalVoreContainer extends NormalContainer implements VoreContainer { |
|
|
|
@@ -287,6 +291,7 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor |
|
|
|
prey.destroyed = true |
|
|
|
this.digested.push(prey) |
|
|
|
justDigested.push(prey) |
|
|
|
this.onDigest(prey) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
@@ -307,6 +312,7 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor |
|
|
|
if (prey.voreStats.Mass === 0) { |
|
|
|
this.absorbed.push(prey) |
|
|
|
justAbsorbed.push(prey) |
|
|
|
this.onAbsorb(prey) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
@@ -332,6 +338,14 @@ export abstract class NormalVoreContainer extends NormalContainer implements Vor |
|
|
|
digest (preys: Vore[]): LogEntry { |
|
|
|
return new LogLines(...preys.map(prey => this.digestLine(this.owner, prey, { container: this }))) |
|
|
|
} |
|
|
|
|
|
|
|
onAbsorb (prey: Vore): LogEntry { |
|
|
|
return nilLog |
|
|
|
} |
|
|
|
|
|
|
|
onDigest (prey: Vore): LogEntry { |
|
|
|
return nilLog |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export abstract class InnerVoreContainer extends NormalVoreContainer { |
|
|
|
@@ -448,3 +462,24 @@ export class Womb extends InnerVoreContainer { |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export function biconnectContainers (outer: VoreContainer, inner: VoreContainer): void { |
|
|
|
outer.onDigest = (prey: Vore) => { |
|
|
|
outer.digested = outer.digested.filter(victim => victim !== prey) |
|
|
|
return inner.consume(prey) |
|
|
|
} |
|
|
|
|
|
|
|
outer.actions.push( |
|
|
|
new TransferAction( |
|
|
|
outer, |
|
|
|
inner |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
inner.actions.push( |
|
|
|
new TransferAction( |
|
|
|
inner, |
|
|
|
outer |
|
|
|
) |
|
|
|
) |
|
|
|
} |