Browse Source

Add dire wolves; add a basic game-over system

It just sends you back home for now.
master
Fen Dweller 5 years ago
parent
commit
2a4823c9d8
6 changed files with 117 additions and 90 deletions
  1. +8
    -2
      src/App.vue
  2. +14
    -3
      src/components/Combat.vue
  3. +2
    -2
      src/game/creatures.ts
  4. +0
    -82
      src/game/creatures/wolf.ts
  5. +74
    -0
      src/game/creatures/wolves.ts
  6. +19
    -1
      src/game/maps/town.ts

+ 8
- 2
src/App.vue View File

@@ -3,7 +3,7 @@
<Header :version="version" />
<div id="main-area">
<transition name="component-fade" mode='out-in'>
<component @profile="$data.profileOn = true" @exit="$data.profileOn = false" @leave-combat="$data.world.encounter = null" v-bind:is="mode" :world="$data.world" :encounter="$data.world.encounter" />
<component @profile="$data.profileOn = true" @exit="$data.profileOn = false" @give-in="gameOver()" @leave-combat="$data.world.encounter = null" v-bind:is="mode" :world="$data.world" :encounter="$data.world.encounter" />
</transition>
</div>
</div>
@@ -33,6 +33,7 @@ import { Town } from './game/maps/town'
data () {
return {
world: null,
home: null,
profileOn: false,
props: {
Explore: {
@@ -74,8 +75,13 @@ export default class App extends Vue {
player.items.push(new Items.Mace())
player.items.push(new Items.Dagger())
this.$data.world = new World(player)
this.$data.home = Town()
player.location = this.$data.home
}

player.location = Town()
gameOver () {
this.$data.world.encounter = null
this.$data.world.player.location = this.$data.home
}
}
</script>


+ 14
- 3
src/components/Combat.vue View File

@@ -42,10 +42,13 @@
</div>
<div v-show="actionDescVisible && encounter.winner === null" class="action-description">
</div>
<button @click="$emit('leave-combat')" v-if="encounter.winner !== null" class="exit-combat">
<button @click="$emit('give-in')" v-if="playerDigested" class="give-in">
Give In
</button>
<button @click="$emit('leave-combat')" v-if="!playerDigested && encounter.winner !== null" class="exit-combat">
Exit Combat
</button>
<button @click="continuing = true; pickNext()" v-if="encounter.winner !== null && !continuing" class="continue-combat">
<button @click="continuing = true; pickNext()" v-if="!playerDigested && encounter.winner !== null && !continuing" class="continue-combat">
Continue
</button>
</div>
@@ -87,6 +90,10 @@ export default class Combat extends Vue {

Side = Side

get playerDigested () {
return this.world.player.destroyed && this.world.player.containedIn !== null
}

get running () {
if (this.encounter.winner === null || (this.$data.continuing === true && this.encounter.totalWinner === null)) {
return true
@@ -310,7 +317,8 @@ export default class Combat extends Vue {
}

.exit-combat,
.continue-combat {
.continue-combat,
.give-in {
width: 100%;
padding: 4pt;
flex: 0 1;
@@ -322,6 +330,9 @@ export default class Combat extends Vue {
font-size: 36px;
}

.give-in {
grid-area: 2 / main-col-start / main-row-start / main-col-end;
}
.exit-combat {
grid-area: 2 / main-col-start / main-row-start / 3;
}


+ 2
- 2
src/game/creatures.ts View File

@@ -1,4 +1,4 @@
import { Wolf } from './creatures/wolf'
import { Wolf, DireWolf } from './creatures/wolves'
import { Player } from './creatures/player'
import { Cafat } from './creatures/cafat'
import { Human } from './creatures/human'
@@ -11,4 +11,4 @@ import { Kuro } from './creatures/kuro'
import { Geta } from './creatures/geta'
import { Werewolf } from './creatures/werewolf'

export { Wolf, Player, Cafat, Human, Withers, Kenzie, Dragon, Shingo, Goldeneye, Kuro, Geta, Werewolf }
export { Wolf, DireWolf, Player, Cafat, Human, Withers, Kenzie, Dragon, Shingo, Goldeneye, Kuro, Geta, Werewolf }

+ 0
- 82
src/game/creatures/wolf.ts View File

@@ -1,82 +0,0 @@
import { Creature } from "../creature"
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, StatDamageFormula, Stat } from '../combat'
import { MalePronouns, ImproperNoun, ProperNoun, ObjectPronouns, FemalePronouns, TheyPronouns, Verb } from '../language'
import { VoreType, Stomach, Bowels, Cock, Balls, anyVore, Slit, Womb, biconnectContainers } from '../vore'
import { AttackAction, TransferAction, FeedAction } from '../combat/actions'
import { Human } from '../creatures'

export class Wolf extends Creature {
constructor () {
super(
new ImproperNoun('wolf', 'wolves'),
new ImproperNoun('wolf', 'wolves'),
[MalePronouns, FemalePronouns, TheyPronouns][Math.floor(Math.random() * 3)],
{ Toughness: 20, Power: 20, Reflexes: 20, Agility: 20, Willpower: 20, Charm: 20 },
anyVore,
anyVore,
25
)
this.actions.push(
new AttackAction(
new StatDamageFormula([
{ fraction: 1, stat: Stat.Power, target: Vigor.Health, type: DamageType.Pierce },
{ fraction: 0.5, stat: Stat.Power, target: Vigor.Health, type: DamageType.Crush }
]),
new Verb("bite")
)
)

this.side = Side.Monsters

const stomach = new Stomach(this, 2, new ConstantDamageFormula(new Damage(
{ amount: 60, type: DamageType.Acid, target: Vigor.Health },
{ amount: 30, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 30, type: DamageType.Dominance, target: Vigor.Resolve }
)))
this.containers.push(stomach)

const bowels = new Bowels(this, 2, new ConstantDamageFormula(new Damage(
{ amount: 30, type: DamageType.Crush, target: Vigor.Health },
{ amount: 60, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 60, type: DamageType.Dominance, target: Vigor.Resolve }
)))

this.containers.push(bowels)

this.actions.push(new TransferAction(bowels, stomach))

this.otherActions.push(new FeedAction(stomach))

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

const balls = new Balls(this, 2, new ConstantDamageFormula(new Damage(
{ amount: 30, type: DamageType.Crush, target: Vigor.Health },
{ amount: 60, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 60, type: DamageType.Dominance, target: Vigor.Resolve }
)), cock)

const slit = new Slit(this, 2, new ConstantDamageFormula(new Damage(
{ amount: 30, type: DamageType.Crush, target: Vigor.Health },
{ amount: 60, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 60, type: DamageType.Dominance, target: Vigor.Resolve }
)))

const womb = new Womb(this, 2, new ConstantDamageFormula(new Damage(
{ amount: 30, type: DamageType.Crush, target: Vigor.Health },
{ amount: 60, type: DamageType.Crush, target: Vigor.Stamina },
{ amount: 60, type: DamageType.Dominance, target: Vigor.Resolve }
)), slit)

this.containers.push(balls)
this.containers.push(cock)
this.containers.push(womb)
this.containers.push(slit)

biconnectContainers(cock, balls)
biconnectContainers(slit, womb)
}
}

+ 74
- 0
src/game/creatures/wolves.ts View File

@@ -0,0 +1,74 @@
import { Creature } from "../creature"
import { Damage, DamageType, ConstantDamageFormula, Vigor, Side, StatDamageFormula, Stat } from '../combat'
import { MalePronouns, ImproperNoun, FemalePronouns, TheyPronouns, Verb } from '../language'
import { Stomach, Bowels, anyVore } from '../vore'
import { AttackAction, TransferAction } from '../combat/actions'
import { VoreAI } from '../ai'

export class Wolf extends Creature {
constructor () {
super(
new ImproperNoun('wolf', 'wolves'),
new ImproperNoun('wolf', 'wolves'),
[MalePronouns, FemalePronouns, TheyPronouns][Math.floor(Math.random() * 3)],
{ Toughness: 15, Power: 20, Reflexes: 25, Agility: 25, Willpower: 5, Charm: 10 },
anyVore,
anyVore,
25
)

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

this.actions.push(
new AttackAction(
new StatDamageFormula([
{ fraction: 1, stat: Stat.Power, target: Vigor.Health, type: DamageType.Pierce },
{ fraction: 1, stat: Stat.Power, target: Vigor.Health, type: DamageType.Crush }
]),
new Verb("bite")
)
)

const stomach = new Stomach(this, 2, new StatDamageFormula([
{ fraction: 3, stat: Stat.Toughness, target: Vigor.Health, type: DamageType.Acid },
{ fraction: 2, stat: Stat.Power, target: Vigor.Stamina, type: DamageType.Crush },
{ fraction: 1, stat: Stat.Charm, target: Vigor.Resolve, type: DamageType.Dominance }
]))
this.containers.push(stomach)
}
}

export class DireWolf extends Creature {
constructor () {
super(
new ImproperNoun('dire wolf', 'dire wolves'),
new ImproperNoun('dire wolf', 'dire wolves'),
[MalePronouns, FemalePronouns, TheyPronouns][Math.floor(Math.random() * 3)],
{ Toughness: 25, Power: 40, Reflexes: 35, Agility: 45, Willpower: 15, Charm: 20 },
anyVore,
anyVore,
75
)

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

this.actions.push(
new AttackAction(
new StatDamageFormula([
{ fraction: 1, stat: Stat.Power, target: Vigor.Health, type: DamageType.Pierce },
{ fraction: 1, stat: Stat.Power, target: Vigor.Health, type: DamageType.Crush }
]),
new Verb("bite")
)
)

const stomach = new Stomach(this, 2, new StatDamageFormula([
{ fraction: 3, stat: Stat.Toughness, target: Vigor.Health, type: DamageType.Acid },
{ fraction: 2, stat: Stat.Power, target: Vigor.Stamina, type: DamageType.Crush },
{ fraction: 1, stat: Stat.Charm, target: Vigor.Resolve, type: DamageType.Dominance }
]))
this.containers.push(stomach)
}
}

+ 19
- 1
src/game/maps/town.ts View File

@@ -137,6 +137,24 @@ export const Town = (): Place => {
)
)

woods.choices.push(
new Choice(
"Fight a dire wolf",
"yolo",
(world, executor) => {
world.encounter = new Encounter(
{
name: "You punched a dire wolf",
intro: (world: World) => new LogLine(`You punched a dire wolf. The wolf is angry.`)
},
[executor, new Creatures.DireWolf()]
)

return new LogLine(`FIGHT TIME`)
}
)
)

woods.choices.push(
new Choice(
"Fight a werewolf",
@@ -411,11 +429,11 @@ export const Town = (): Place => {
)

home.biconnect(Direction.South, debug)
debug.biconnect(Direction.South, bosses)
home.biconnect(Direction.North, westAve)
westAve.biconnect(Direction.West, westRoad)
westAve.biconnect(Direction.North, alley)
westRoad.biconnect(Direction.South, woods)
westRoad.biconnect(Direction.North, bosses)
square.biconnect(Direction.East, eastAve)
square.biconnect(Direction.West, westAve)
square.biconnect(Direction.North, northAve)


Loading…
Cancel
Save