瀏覽代碼

Add optional words

master
Fen Dweller 5 年之前
父節點
當前提交
b59f185bf8
共有 5 個文件被更改,包括 65 次插入10 次删除
  1. +1
    -1
      src/game/combat/actions.ts
  2. +19
    -1
      src/game/creatures/characters/inazuma.ts
  3. +32
    -0
      src/game/language.ts
  4. +1
    -1
      src/game/vore.ts
  5. +12
    -7
      src/game/words.ts

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

@@ -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 }
)
],


+ 19
- 1
src/game/creatures/characters/inazuma.ts 查看文件

@@ -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.`)
)]


+ 32
- 0
src/game/language.ts 查看文件

@@ -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)


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

@@ -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}.`)
)
}


+ 12
- 7
src/game/words.ts 查看文件

@@ -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")
])

Loading…
取消
儲存