ソースを参照

Add text that displays when your turn starts while eaten; add a werewolf

master
Fen Dweller 3年前
コミット
22e4331550
6個のファイルの変更91行の追加3行の削除
  1. +7
    -2
      .eslintrc.js
  2. +9
    -0
      src/components/Combat.vue
  3. +39
    -0
      src/game/creatures/monsters/werewolf.ts
  4. +21
    -0
      src/game/maps/town.ts
  5. +9
    -1
      src/game/vore.ts
  6. +6
    -0
      src/game/words.ts

+ 7
- 2
.eslintrc.js ファイルの表示

@@ -6,7 +6,7 @@ module.exports = {
extends: [
'plugin:vue/essential',
'@vue/standard',
'@vue/typescript/recommended'
'@vue/typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020
@@ -18,6 +18,11 @@ module.exports = {
'@typescript-eslint/no-unused-vars': 'off',
'quotes': 'off',
'function-paren-newline': ['error', 'multiline-arguments'],
'@typescript-eslint/member-ordering': ['warn']
'@typescript-eslint/member-ordering': ['warn'],
'indent': 'off',
'@typescript-eslint/indent': [
'error',
2
],
}
}

+ 9
- 0
src/components/Combat.vue ファイルの表示

@@ -222,6 +222,15 @@ export default class Combat extends Vue {
} else {
this.executedRight(this.encounter.currentMove.ai.decide(this.encounter.currentMove, this.encounter))
}
} else {
if (this.encounter.currentMove.containedIn) {
this.writeLog(
this.encounter.currentMove.containedIn.statusLine(
this.encounter.currentMove.containedIn.owner,
this.encounter.currentMove
)
)
}
}
}
}


+ 39
- 0
src/game/creatures/monsters/werewolf.ts ファイルの表示

@@ -0,0 +1,39 @@
import { VoreAI } from '@/game/ai'
import { DamageType, Side, Stat, StatDamageFormula, Vigor } from '@/game/combat'
import { Creature } from '@/game/creature'
import { ImproperNoun, ObjectPronouns } from '@/game/language'
import { anyVore, Goo, Stomach } from '@/game/vore'

export default class Werewolf extends Creature {
constructor () {
super(
new ImproperNoun("werewolf", "werewolves"),
new ImproperNoun("werewolf", "werewolves"),
ObjectPronouns,
{
Power: 45,
Toughness: 30,
Agility: 25,
Reflexes: 25,
Charm: 10,
Willpower: 15
},
anyVore,
anyVore,
75
)

const stomach = new Stomach(
this,
50,
new StatDamageFormula([
{ fraction: 1, stat: Stat.Toughness, type: DamageType.Acid, target: Vigor.Health }
])
)

this.addVoreContainer(stomach)

this.side = Side.Monsters
this.ai = new VoreAI(this)
}
}

+ 21
- 0
src/game/maps/town.ts ファイルの表示

@@ -12,6 +12,7 @@ import { DeliciousPerk } from '@/game/combat/perks'
import Inazuma from '../creatures/characters/inazuma'
import Human from '../creatures/human'
import Slime from '../creatures/monsters/slime'
import Werewolf from '../creatures/monsters/werewolf'

function makeParty (): Creature[] {
const fighter = new Human(new ProperNoun("Redgar"), MalePronouns, {
@@ -340,6 +341,26 @@ export const Town = (): Place => {
)
)

woods.choices.push(
new Choice(
"Fight a werewolf",
"Go fight a werewolf",
(world, executor) => {
const enemy = new Werewolf()
enemy.location = world.player.location
const encounter = new Encounter(
{
name: "Fight some tasty nerd",
intro: () => new LogLine(`A werewolf draws near!`)
},
[world.player, enemy].concat(world.party)
)
world.encounter = encounter
return nilLog
}
)
)

debug.choices.push(
new Choice(
"Add money",


+ 9
- 1
src/game/vore.ts ファイルの表示

@@ -1,6 +1,6 @@
import { Damage, DamageType, Actionable, Action, Vigor, DamageInstance, DamageFormula } from '@/game/combat'
import { LogLines, LogEntry, LogLine, nilLog, RandomEntry } from '@/game/interface'
import { Noun, ImproperNoun, Verb, RandomWord, Word, Preposition } from '@/game/language'
import { Noun, ImproperNoun, Verb, RandomWord, Word, Preposition, ToBe } from '@/game/language'
import { RubAction, DevourAction, ReleaseAction, StruggleAction, TransferAction } from '@/game/combat/actions'
import * as Words from '@/game/words'
import { Creature } from '@/game/creature'
@@ -53,6 +53,8 @@ export interface Container extends Actionable {

consumeLine (user: Creature, target: Creature): LogEntry;

statusLine (user: Creature, target: Creature): LogEntry;

}

export abstract class NormalContainer implements Container {
@@ -82,6 +84,12 @@ export abstract class NormalContainer implements Container {
return new LogLine(`${user.name.capital} ${user.name.conjugate(this.consumeVerb)} ${target.name.objective} ${this.consumePreposition} ${user.pronouns.possessive} ${this.name}.`)
}

statusLine (user: Creature, target: Creature): LogEntry {
return new LogLine(
`${target.name.capital} ${target.name.conjugate(new ToBe())} ${Words.Stuck} inside ${user.name.possessive} ${this.name}.`
)
}

releaseLine (user: Creature, target: Creature): LogEntry {
return new LogLine(`${user.name.capital} ${user.name.conjugate(this.releaseVerb)} ${target.name.objective} ${this.releasePreposition} ${user.pronouns.possessive} ${this.name}.`)
}


+ 6
- 0
src/game/words.ts ファイルの表示

@@ -120,3 +120,9 @@ export const Sloppily = new RandomWord([
new Adverb("sloppily"),
new Adverb("messily")
])

export const Stuck = new RandomWord([
new Adjective("stuck"),
new Adjective("trapped"),
new Adjective("imprisoned")
])

読み込み中…
キャンセル
保存