浏览代码

Add transfer descriptions; clean up some grammar errors

master
Fen Dweller 3 年前
父节点
当前提交
49361d5ece
共有 4 个文件被更改,包括 28 次插入11 次删除
  1. +1
    -3
      src/game/combat/actions.ts
  2. +8
    -4
      src/game/creatures/monsters/werewolf.ts
  3. +18
    -2
      src/game/vore.ts
  4. +1
    -2
      src/game/words.ts

+ 1
- 3
src/game/combat/actions.ts 查看文件

@@ -322,9 +322,7 @@ export class TransferAction extends Action {
) )
} }


line: PairLineArgs<Creature, { from: Container; to: Connection }> = (user, target, args) => new LogLine(
`${user.name.capital} ${user.name.conjugate(this.verb)} ${target.name.objective} from ${user.pronouns.possessive} ${args.from.name} to ${user.pronouns.possessive} ${args.to.destination.name}`
)
line: PairLineArgs<Creature, { from: Container; to: Connection }> = (user, target, args) => this.to.description(this.from, this.to.destination, target)


allowed (user: Creature, target: Creature) { allowed (user: Creature, target: Creature) {
if (target.containedIn === this.from && this.from.contents.includes(target)) { if (target.containedIn === this.from && this.from.contents.includes(target)) {


+ 8
- 4
src/game/creatures/monsters/werewolf.ts 查看文件

@@ -1,8 +1,10 @@
import { VoreAI } from '@/game/ai' import { VoreAI } from '@/game/ai'
import { DamageType, Side, Stat, StatDamageFormula, Vigor } from '@/game/combat' import { DamageType, Side, Stat, StatDamageFormula, Vigor } from '@/game/combat'
import { Creature } from '@/game/creature' import { Creature } from '@/game/creature'
import { ImproperNoun, MalePronouns, ObjectPronouns } from '@/game/language'
import { anyVore, ConnectionDirection, Stomach, Throat } from '@/game/vore'
import { LogEntry, LogLine } from '@/game/interface'
import { ImproperNoun, MalePronouns, ObjectPronouns, Preposition, Verb } from '@/game/language'
import { anyVore, ConnectionDirection, Container, Stomach, Throat, transferDescription } from '@/game/vore'
import * as Words from '@/game/words'


export default class Werewolf extends Creature { export default class Werewolf extends Creature {
constructor () { constructor () {
@@ -41,12 +43,14 @@ export default class Werewolf extends Creature {


throat.connect({ throat.connect({
destination: stomach, destination: stomach,
direction: ConnectionDirection.Deeper
direction: ConnectionDirection.Deeper,
description: transferDescription(Words.Swallow, new Preposition("down"))
}) })


stomach.connect({ stomach.connect({
destination: throat, destination: throat,
direction: ConnectionDirection.Shallower
direction: ConnectionDirection.Shallower,
description: transferDescription(new Verb("hork"), new Preposition("up"))
}) })


this.side = Side.Monsters this.side = Side.Monsters


+ 18
- 2
src/game/vore.ts 查看文件

@@ -52,6 +52,7 @@ export enum ConnectionDirection {
export type Connection = { export type Connection = {
destination: Container; destination: Container;
direction: ConnectionDirection; direction: ConnectionDirection;
description: (to: Container, from: Container, prey: Creature) => LogEntry;
} }


export interface Container extends Actionable { export interface Container extends Actionable {
@@ -237,6 +238,11 @@ export abstract class DefaultContainer implements Container {
new LogLine(`${this.fluid.name.capital} ${this.fluid.sloshVerb.singular} around ${prey.name.objective}.`) new LogLine(`${this.fluid.name.capital} ${this.fluid.sloshVerb.singular} around ${prey.name.objective}.`)
) )
} }
if (this.wall) {
lines.push(
new LogLine(`The ${this.wall.color} walls ${prey.name.conjugate(Words.Clench)} over ${prey.name.objective} like a vice.`)
)
}


return new LogLine(...lines) return new LogLine(...lines)
} }
@@ -263,7 +269,7 @@ export abstract class DefaultContainer implements Container {
} }


digestLine (user: Creature, target: Creature): LogEntry { digestLine (user: Creature, target: Creature): LogEntry {
return new LogLine(`${user.name.capital.possessive} ${this.name} ${this.name.conjugate(new Verb('finish', 'finishes'))} ${Words.Digest.present} ${target.name.objective} down, ${target.pronouns.possessive} ${Words.Struggle.singular} fading away as ${target.pronouns.subjective} ${target.pronouns.conjugate(Words.Succumb)}.`)
return new LogLine(`${user.name.capital.possessive} ${this.name} finishes ${Words.Digest.present} ${target.name.objective} down, ${target.pronouns.possessive} ${Words.Struggle.singular} fading away as ${target.pronouns.subjective} ${target.pronouns.conjugate(Words.Succumb)}.`)
} }


absorbLine (user: Creature, target: Creature): LogEntry { absorbLine (user: Creature, target: Creature): LogEntry {
@@ -388,7 +394,11 @@ export class Stomach extends DefaultContainer {
export class Throat extends DefaultContainer { export class Throat extends DefaultContainer {
fluid = { fluid = {
color: new Adjective("clear"), color: new Adjective("clear"),
name: new Noun("saliva"),
name: new RandomWord([
new Noun("saliva"),
new Noun("drool"),
new Noun("slobber")
]),
sound: new Verb("squish", "squishes"), sound: new Verb("squish", "squishes"),
sloshVerb: new Verb("slosh", "sloshes", "sloshing", "sloshed") sloshVerb: new Verb("slosh", "sloshes", "sloshing", "sloshed")
} }
@@ -407,3 +417,9 @@ export class Throat extends DefaultContainer {
])) ]))
} }
} }

export function transferDescription (verb: Word, preposition: Preposition): ((from: Container, to: Container, prey: Creature) => LogEntry) {
return (from: Container, to: Container, prey: Creature) => {
return new LogLine(`${from.owner.name.capital} ${verb.singular} ${prey.name.objective} ${preposition} ${to.consumePreposition} ${from.owner.name.possessive} ${to.name}.`)
}
}

+ 1
- 2
src/game/words.ts 查看文件

@@ -21,8 +21,7 @@ export const Slick = new RandomWord([


export const Swallow = new RandomWord([ export const Swallow = new RandomWord([
new Verb("swallow"), new Verb("swallow"),
new Verb("gulp"),
new Verb("consume", "consumes", "consuming", "consumed")
new Verb("gulp")
]) ])


export const Churns = new RandomWord([ export const Churns = new RandomWord([


正在加载...
取消
保存