瀏覽代碼

Add a 'kind' property (e.g. species)

master
Fen Dweller 5 年之前
父節點
當前提交
25925e6ab5
共有 7 個檔案被更改,包括 35 行新增33 行删除
  1. +2
    -2
      src/game/creatures/human.ts
  2. +2
    -2
      src/game/creatures/player.ts
  3. +10
    -10
      src/game/creatures/withers.ts
  4. +1
    -1
      src/game/creatures/wolf.ts
  5. +3
    -2
      src/game/entity.ts
  6. +16
    -16
      src/game/language.ts
  7. +1
    -0
      src/game/vore.ts

+ 2
- 2
src/game/creatures/human.ts 查看文件

@@ -1,6 +1,6 @@
import { Creature } from '../entity'
import { Damage, DamageType, ConstantDamageFormula, Vigor, Stats, Vigors } from '../combat'
import { MalePronouns, Noun, Pronoun } from '../language'
import { MalePronouns, Noun, Pronoun, ImproperNoun } from '../language'
import { VoreType } from '../vore'
import { AttackAction } from '../combat/actions'

@@ -19,7 +19,7 @@ export class Human extends Creature {
} else {
stats = options.stats
}
super(name, pronouns, stats, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25)
super(name, new ImproperNoun('human', 'humans'), pronouns, stats, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25)
this.actions.push(new AttackAction(new ConstantDamageFormula(
new Damage(
{ amount: 20, target: Vigor.Health, type: DamageType.Slash }


+ 2
- 2
src/game/creatures/player.ts 查看文件

@@ -1,12 +1,12 @@
import { Creature, POV } from '../entity'
import { ProperNoun, TheyPronouns } from '../language'
import { ProperNoun, TheyPronouns, ImproperNoun } from '../language'
import { Stat, Damage, DamageType, Vigor, ConstantDamageFormula } from '../combat'
import { Stomach, Bowels, VoreType } from '../vore'
import { AttackAction } from '../combat/actions'

export class Player extends Creature {
constructor () {
super(new ProperNoun('The Dude'), TheyPronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 50)
super(new ProperNoun('The Dude'), new ImproperNoun('player', 'players'), TheyPronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 50)

this.actions.push(new AttackAction(new ConstantDamageFormula(new Damage({ type: DamageType.Pierce, amount: 20, target: Vigor.Health }, { type: DamageType.Pierce, amount: 20, target: Vigor.Stamina }))))



+ 10
- 10
src/game/creatures/withers.ts 查看文件

@@ -1,10 +1,9 @@
import { Creature, POV, Entity } from '../entity'
import { Stat, Damage, DamageType, ConstantDamageFormula, Vigor, Side, PairAction, CombatTest, GroupAction } from '../combat'
import { MalePronouns, ImproperNoun, POVPair, POVPairArgs, ProperNoun, TheyPronouns, FemalePronouns, RandomWord, Adjective } from '../language'
import { Creature, POV } from '../entity'
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, GroupAction } from '../combat'
import { ImproperNoun, POVPair, ProperNoun, FemalePronouns, RandomWord, Adjective } from '../language'
import { LogLine, LogLines, LogEntry } from '../interface'
import { VoreType, Stomach, Bowels, Container } from '../vore'
import { StatTest } from '../combat/tests'
import { AttackAction, TransferAction, FeedAction } from '../combat/actions'
import { VoreType, Stomach, Container } from '../vore'
import { AttackAction, FeedAction } from '../combat/actions'
import { TogetherCondition } from '../combat/conditions'
import { InstantKill } from '../combat/effects'

@@ -27,7 +26,7 @@ class BiteAction extends AttackAction {
class StompAction extends GroupAction {
lines: POVPair<Creature, Creature> = new POVPair([
[[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You flatten ${target.name} under your foot!`)],
[[POV.Third, POV.First], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} flattens you under ${user.pronouns.possessive} ${huge} foot!`)],
[[POV.Third, POV.First], (user: Creature) => new LogLine(`${user.name.capital} flattens you under ${user.pronouns.possessive} ${huge} foot!`)],
[[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} flattens ${target.name} under ${user.pronouns.possessive} ${huge} foot!`)]
])

@@ -53,7 +52,7 @@ class StompAction extends GroupAction {
class DevourAllAction extends GroupAction {
lines: POVPair<Creature, Creature> = new POVPair([
[[POV.First, POV.Third], (user: Creature, target: Creature) => new LogLine(`You scoop up ${target.name}!`)],
[[POV.Third, POV.First], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} scoops you up!`)],
[[POV.Third, POV.First], (user: Creature) => new LogLine(`${user.name.capital} scoops you up!`)],
[[POV.Third, POV.Third], (user: Creature, target: Creature) => new LogLine(`${user.name.capital} scoops ${target.name} up!`)]
])

@@ -68,7 +67,7 @@ class DevourAllAction extends GroupAction {

executeGroup (user: Creature, targets: Array<Creature>): LogEntry {
return new LogLines(...targets.map(target => this.execute(user, target)).concat(
[new LogLine('GULP!')]
[new LogLine(`All ${targets.length} of them are ${user.kind} chow now`)]
))
}

@@ -87,8 +86,9 @@ export class Withers extends Creature {
constructor () {
super(
new ProperNoun('Withers'),
new ImproperNoun('hellhound', 'hellhounds'),
FemalePronouns,
{ Toughness: 60, Power: 100, Speed: 40, Willpower: 60, Charm: 120 },
{ Toughness: 60, Power: 70, Speed: 40, Willpower: 60, Charm: 120 },
new Set(),
new Set([VoreType.Oral]),
5000)


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

@@ -44,7 +44,7 @@ class HypnoAction extends AttackAction {

export class Wolf extends Creature {
constructor () {
super(new ImproperNoun('wolf', 'wolves'), MalePronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25)
super(new ImproperNoun('wolf', 'wolves'), new ImproperNoun('wolf', 'wolves'), MalePronouns, { Toughness: 20, Power: 20, Speed: 20, Willpower: 20, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 25)
this.actions.push(new BiteAction())
this.actions.push(new HypnoAction())



+ 3
- 2
src/game/entity.ts 查看文件

@@ -1,5 +1,5 @@
import { DamageType, Damage, Combatant, Stats, Action, Vigor, VoreStats, VoreStat, Stat, Side, GroupAction } from './combat'
import { Noun, Pronoun } from './language'
import { Noun, Pronoun, Adjective, ImproperNoun } from './language'
import { LogEntry, LogLine } from './interface'
import { Vore, Container, VoreType } from './vore'

@@ -12,6 +12,7 @@ export interface Entity {
}

export interface Mortal extends Entity {
kind: Noun;
vigors: {[key in Vigor]: number};
maxVigors: {[key in Vigor]: number};
disabled: boolean;
@@ -57,7 +58,7 @@ export class Creature extends Vore implements Combatant {

containedIn: Container|null = null;

constructor (public name: Noun, public pronouns: Pronoun, public stats: Stats, public preyPrefs: Set<VoreType>, public predPrefs: Set<VoreType>, mass: number) {
constructor (public name: Noun, public kind: Noun, public pronouns: Pronoun, public stats: Stats, public preyPrefs: Set<VoreType>, public predPrefs: Set<VoreType>, mass: number) {
super()
const containers = this.containers
this.baseStats = Object.keys(Stat).reduce((base: any, key) => { base[key] = stats[key as Stat]; return base }, {})


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

@@ -117,52 +117,52 @@ export abstract class Word {
// These functions are pure; they don't mutate the original object.
// This is necessary to avoid causing chaos.

get capital (): Word {
get capital (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.capital = true
return this.configure(opts)
return this.configure(opts) as this
}

get plural (): Word {
get plural (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.plural = true
return this.configure(opts)
return this.configure(opts) as this
}

get proper (): Word {
get proper (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.proper = true
return this.configure(opts)
return this.configure(opts) as this
}

get improper (): Word {
get improper (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.proper = false
return this.configure(opts)
return this.configure(opts) as this
}

get specific (): Word {
get specific (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.kind = NounKind.Specific
return this.configure(opts)
return this.configure(opts) as this
}

get nonspecific (): Word {
get nonspecific (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.kind = NounKind.Nonspecific
return this.configure(opts)
return this.configure(opts) as this
}

get all (): Word {
get all (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.kind = NounKind.All
return this.configure(opts)
return this.configure(opts) as this
}

get uncountable (): Word {
get uncountable (): this {
const opts: WordOptions = Object.assign({}, this.opt)
opts.count = false
return this.configure(opts)
return this.configure(opts) as this
}
}



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

@@ -13,6 +13,7 @@ export enum VoreType {

export abstract class Vore implements Mortal {
abstract name: Noun;
abstract kind: Noun;
abstract pronouns: Pronoun;
abstract perspective: POV;
abstract vigors: {[key in Vigor]: number};


Loading…
取消
儲存