瀏覽代碼

Fix some text; make digestion only affect one container

master
Fen Dweller 5 年之前
父節點
當前提交
7ccfafc628
共有 3 個檔案被更改,包括 18 行新增7 行删除
  1. +12
    -4
      src/game/combat.ts
  2. +1
    -1
      src/game/creatures/wolf.ts
  3. +5
    -2
      src/game/vore.ts

+ 12
- 4
src/game/combat.ts 查看文件

@@ -164,8 +164,16 @@ export class AttackAction extends TogetherAction {
new FormatText(`${args.damage}`, FormatOpt.Damage), new FormatText(`${args.damage}`, FormatOpt.Damage),
` damage` ` damage`
)], )],
[[POV.Third, POV.First], (user, target, args) => new LogLines(`${user.name.capital} hits you for ${args.damage} damage`)],
[[POV.Third, POV.Third], (user, target, args) => new LogLines(`${user.name.capital} hits ${target.name.capital} for ${args.damage} damage`)]
[[POV.Third, POV.First], (user, target, args) => new LogLine(
`${user.name.capital} smacks you for `,
new FormatText(`${args.damage}`, FormatOpt.Damage),
` damage`
)],
[[POV.Third, POV.Third], (user, target, args) => new LogLine(
`${user.name.capital} smacks ${target.name} for `,
new FormatText(`${args.damage}`, FormatOpt.Damage),
` damage`
)]
]) ])


protected failLines: POVPair<Entity, Entity> = new POVPair([ protected failLines: POVPair<Entity, Entity> = new POVPair([
@@ -277,8 +285,8 @@ export class DigestAction extends SelfAction {
} }


execute (user: Creature, target: Creature): LogEntry { execute (user: Creature, target: Creature): LogEntry {
const results = new CompositeLog(...user.containers.map(container => container.tick(60)))
return new CompositeLog(this.lines.run(user, target), results)
const results = this.container.tick(60)
return new CompositeLog(results)
} }
} }




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

@@ -5,7 +5,7 @@ import { VoreType, Stomach, Bowels } from '../vore'


class BiteAction extends AttackAction { class BiteAction extends AttackAction {
constructor () { constructor () {
super(new Damage({ amount: 10, type: DamageType.Pierce }))
super(new Damage({ amount: 10, type: DamageType.Slash }))
} }
} }




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

@@ -89,15 +89,18 @@ abstract class NormalContainer implements Container {
const start = prey.health const start = prey.health
prey.takeDamage(this.damage.scale(dt / 3600)) prey.takeDamage(this.damage.scale(dt / 3600))
const end = prey.health const end = prey.health

if (start > 0 && end <= 0) { if (start > 0 && end <= 0) {
digested.push(prey) digested.push(prey)
} else if (start > -100 && end <= -100) {
}

if (start > -100 && end <= -100) {
absorbed.push(prey) absorbed.push(prey)
} }
}) })


const digestedEntries = new CompositeLog(...digested.map(prey => this.digest(prey))) const digestedEntries = new CompositeLog(...digested.map(prey => this.digest(prey)))
const absorbedEntries = new CompositeLog(...digested.map(prey => this.absorb(prey)))
const absorbedEntries = new CompositeLog(...absorbed.map(prey => this.absorb(prey)))


this.contents = this.contents.filter(prey => { this.contents = this.contents.filter(prey => {
return prey.health > -100 return prey.health > -100


Loading…
取消
儲存