浏览代码

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),
` 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([
@@ -277,8 +285,8 @@ export class DigestAction extends SelfAction {
}

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 {
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
prey.takeDamage(this.damage.scale(dt / 3600))
const end = prey.health

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

if (start > -100 && end <= -100) {
absorbed.push(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 => {
return prey.health > -100


正在加载...
取消
保存