Просмотр исходного кода

Add transfer descriptions; clean up some grammar errors

master
Fen Dweller 3 лет назад
Родитель
Сommit
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) {
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 { DamageType, Side, Stat, StatDamageFormula, Vigor } from '@/game/combat'
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 {
constructor () {
@@ -41,12 +43,14 @@ export default class Werewolf extends Creature {

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

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

this.side = Side.Monsters


+ 18
- 2
src/game/vore.ts Просмотреть файл

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

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}.`)
)
}
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)
}
@@ -263,7 +269,7 @@ export abstract class DefaultContainer implements Container {
}

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 {
@@ -388,7 +394,11 @@ export class Stomach extends DefaultContainer {
export class Throat extends DefaultContainer {
fluid = {
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"),
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([
new Verb("swallow"),
new Verb("gulp"),
new Verb("consume", "consumes", "consuming", "consumed")
new Verb("gulp")
])

export const Churns = new RandomWord([


Загрузка…
Отмена
Сохранить