소스 검색

Add a dragon. Fix wrong selection when starting combat

master
Fen Dweller 5 년 전
부모
커밋
9fcd044363
4개의 변경된 파일63개의 추가작업 그리고 5개의 파일을 삭제
  1. +2
    -3
      src/App.vue
  2. +15
    -0
      src/components/Combat.vue
  3. +2
    -2
      src/game/creatures.ts
  4. +44
    -0
      src/game/creatures/dragon.ts

+ 2
- 3
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)
}


+ 15
- 0
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()
}
})
}
}
</script>


+ 2
- 2
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 }

+ 44
- 0
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))
}
}

불러오는 중...
취소
저장