Browse Source

Check tests on composition actions before executing them; add ctf to Geta

master
Fen Dweller 5 years ago
parent
commit
8b99920481
2 changed files with 52 additions and 7 deletions
  1. +8
    -3
      src/game/combat.ts
  2. +44
    -4
      src/game/creatures/geta.ts

+ 8
- 3
src/game/combat.ts View File

@@ -379,9 +379,14 @@ export class CompositionAction extends Action {
}

execute (user: Creature, target: Creature): LogEntry {
return new LogLines(
...this.consequences.filter(consequence => consequence.applicable(user, target)).map(consequence => consequence.apply(user, target))
)
const failReason = this.tests.find(test => !test.test.test(user, target))
if (failReason !== undefined) {
return failReason.fail(user, target)
} else {
return new LogLines(
...this.consequences.filter(consequence => consequence.applicable(user, target)).map(consequence => consequence.apply(user, target))
)
}
}

describe (user: Creature, target: Creature): LogEntry {


+ 44
- 4
src/game/creatures/geta.ts View File

@@ -5,8 +5,9 @@ import { VoreType, Stomach, Bowels, Cock, Balls, anyVore, Slit, Womb, biconnectC
import { AttackAction, TransferAction, FeedAction, DevourAction } from '../combat/actions'
import { StatusConsequence, LogConsequence, DamageConsequence, ArbitraryConsequence } from '../combat/consequences'
import { SizeEffect, DamageTypeResistanceEffect, InstantKillEffect } from '../combat/effects'
import { LogLine } from '../interface'
import { LogLine, nilLog } from '../interface'
import { TogetherCondition, MassRatioCondition, ContainsCondition } from '../combat/conditions'
import { ChanceTest } from '../combat/tests'

export class Geta extends Creature {
constructor () {
@@ -43,14 +44,51 @@ export class Geta extends Creature {

const cock = new Cock(this, 10, new Damage(
{ amount: 10, type: DamageType.Crush, target: Vigor.Health },
{ amount: 30, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 30, type: DamageType.Dominance, target: Vigor.Resolve }
{ amount: 50, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 150, type: DamageType.Dominance, target: Vigor.Resolve }
))

cock.digestLine = (user, target, args) => {
return new LogLine(`${user.name.capital.possessive} ${args.container.name} throbs as it abruptly absorbs ${target.name.objective}, transforming ${target.name.objective} into more of ${user.pronouns.possessive} meaty shaft.`)
}

cock.actions.push(
new CompositionAction(
"Clench",
"Try to crush the life from your cock-snack",
{
conditions: [
new ContainsCondition(cock)
],
tests: [
{
test: new ChanceTest(0.5),
fail: (user, target) => new LogLine(
`${user.name.capital.possessive} cock clenches hard around ${target.name.objective}, but ${target.pronouns.subjective} ${target.name.conjugate(new Verb("avoid"))} being crushed.`
)
}
],
consequences: [
new LogConsequence(
(user, target) => new LogLine(
`${user.name.capital} ${user.name.conjugate(new Verb('let'))} out a lustful moan as ${user.pronouns.subjective} crushes the life from ${target.name.possessive} body with a flex of ${user.pronouns.possessive} shaft.`
)
),
new StatusConsequence(
() => new InstantKillEffect()
),
new ArbitraryConsequence(
(user, target) => cock.tick(0)
)
]
}
)
)

const balls = new Balls(this, 10, new Damage(
{ amount: 50, type: DamageType.Acid, target: Vigor.Health },
{ amount: 25, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 150, type: DamageType.Dominance, target: Vigor.Resolve }
{ amount: 50, type: DamageType.Dominance, target: Vigor.Resolve }
), cock)

this.containers.push(balls)
@@ -58,6 +96,8 @@ export class Geta extends Creature {

biconnectContainers(cock, balls)

cock.onDigest = (prey) => nilLog

const shrinkAction = new CompositionAction(
"Shrink",
"Zap!",


Loading…
Cancel
Save