diff --git a/src/App.vue b/src/App.vue index d6c0288..67d775f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,8 +26,6 @@ export default class App extends Vue { constructor () { super() - console.log(new Creatures.Cafat()) - const fighter = new Creatures.Human(new ProperNoun("Redgar"), MalePronouns, { stats: { Toughness: 20, @@ -77,7 +75,8 @@ export default class App extends Vue { const kenzie = new Creatures.Kenzie() const cafat = new Creatures.Cafat() const wolf = new Creatures.Wolf() - const combatants = [fighter, withers, wizard, rogue, cleric, kenzie, cafat, wolf] + const dragon = new Creatures.Dragon() + const combatants = [fighter, wizard, rogue, cleric, withers, kenzie, cafat, wolf, dragon] this.encounter = new Encounter(combatants) console.log(this.encounter) } diff --git a/src/components/Combat.vue b/src/components/Combat.vue index 95ae9bc..4e4accb 100644 --- a/src/components/Combat.vue +++ b/src/components/Combat.vue @@ -188,6 +188,21 @@ export default class Combat extends Vue { if (leftStats !== null) { leftStats.scrollTo(leftStats.getBoundingClientRect().width * 2, 0) } + this.encounter.nextMove() + + if (this.encounter.currentMove.side === Side.Heroes) { + this.$data.left = this.encounter.currentMove + } else if (this.encounter.currentMove.side === Side.Monsters) { + this.$data.right = this.encounter.currentMove + } + + // scroll to the newly selected creature + this.$nextTick(() => { + const creature: HTMLElement|null = this.$el.querySelector("[data-current-turn]") + if (creature !== null) { + creature.scrollIntoView() + } + }) } } diff --git a/src/game/creatures.ts b/src/game/creatures.ts index e78ee50..6061b21 100644 --- a/src/game/creatures.ts +++ b/src/game/creatures.ts @@ -4,5 +4,5 @@ import { Cafat } from './creatures/cafat' import { Human } from './creatures/human' import { Withers } from './creatures/withers' import { Kenzie } from './creatures/kenzie' - -export { Wolf, Player, Cafat, Human, Withers, Kenzie } +import { Dragon } from './creatures/dragon' +export { Wolf, Player, Cafat, Human, Withers, Kenzie, Dragon } diff --git a/src/game/creatures/dragon.ts b/src/game/creatures/dragon.ts new file mode 100644 index 0000000..f72dc2c --- /dev/null +++ b/src/game/creatures/dragon.ts @@ -0,0 +1,44 @@ +import { Creature } from "../creature" +import { Damage, DamageType, ConstantDamageFormula, Vigor, Side } from '../combat' +import { MalePronouns, ImproperNoun, FemalePronouns, Verb } from '../language' +import { VoreType, Stomach, Bowels } from '../vore' +import { AttackAction, TransferAction, FeedAction } from '../combat/actions' + +export class Dragon extends Creature { + constructor () { + super(new ImproperNoun('dragon', 'dragons'), new ImproperNoun('wolf', 'wolves'), FemalePronouns, { Toughness: 35, Power: 35, Speed: 15, Willpower: 30, Charm: 20 }, new Set([VoreType.Oral, VoreType.Anal]), new Set([VoreType.Oral, VoreType.Anal]), 300) + this.actions.push( + new AttackAction( + new ConstantDamageFormula( + new Damage( + { amount: 20, type: DamageType.Pierce, target: Vigor.Health } + ) + ), + new Verb("bite", "bites", "biting", "bit") + ) + ) + + this.side = Side.Monsters + + const stomach = new Stomach(this, 50, new Damage( + { amount: 40, type: DamageType.Acid, target: Vigor.Health }, + { amount: 20, type: DamageType.Crush, target: Vigor.Stamina }, + { amount: 20, type: DamageType.Dominance, target: Vigor.Resolve } + )) + + this.containers.push(stomach) + + const bowels = new Bowels(this, 50, new Damage( + { amount: 10, type: DamageType.Crush, target: Vigor.Health }, + { amount: 25, type: DamageType.Crush, target: Vigor.Stamina }, + { amount: 50, type: DamageType.Dominance, target: Vigor.Resolve } + )) + + this.containers.push(bowels) + + this.actions.push(new TransferAction(bowels, stomach)) + this.actions.push(new TransferAction(stomach, bowels)) + + this.otherActions.push(new FeedAction(stomach)) + } +}