Feast 2.0!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

172 lines
4.1 KiB

  1. <template>
  2. <div id="app">
  3. <Header version="pre-alpha" @selectEncounter="selectEncounter" :encounters="encounters" />
  4. <Combat v-show="$data.encounter === encounter" v-for="(encounter, index) in encounters" :key="'encounter-' + index" :encounter="encounter" />
  5. </div>
  6. </template>
  7. <script lang="ts">
  8. import { Component, Vue, Prop, Emit } from 'vue-property-decorator'
  9. import Combat from './components/Combat.vue'
  10. import Header from './components/Header.vue'
  11. import * as Creatures from '@/game/creatures'
  12. import * as Items from '@/game/items'
  13. import { Creature } from '@/game/creature'
  14. import { ProperNoun, TheyPronouns, FemalePronouns, MalePronouns, ImproperNoun } from '@/game/language'
  15. import { Encounter } from './game/combat'
  16. @Component({
  17. components: {
  18. Combat, Header
  19. },
  20. data () {
  21. return {
  22. encounter: null,
  23. encounters: null
  24. }
  25. }
  26. })
  27. export default class App extends Vue {
  28. constructor () {
  29. super()
  30. }
  31. @Emit('selectEncounter')
  32. selectEncounter (encounter: Encounter) {
  33. this.$data.encounter = encounter
  34. }
  35. created () {
  36. this.$data.encounters = []
  37. this.$data.encounters.push(new Encounter({ name: 'Boss Fight' }, this.makeParty().concat([new Creatures.Withers(), new Creatures.Kenzie()])))
  38. this.$data.encounters.push(new Encounter({ name: 'Cafat' }, this.makeParty().concat([new Creatures.Cafat(), new Creatures.Wolf()])))
  39. this.$data.encounters.push(new Encounter({ name: 'Dragon' }, this.makeParty().concat([new Creatures.Dragon()])))
  40. this.$data.encounters.push(new Encounter({ name: 'Large Wah' }, this.makeParty().concat([new Creatures.Shingo()])))
  41. this.$data.encounter = this.$data.encounters[0]
  42. }
  43. makeParty (): Creature[] {
  44. const fighter = new Creatures.Human(new ProperNoun("Redgar"), MalePronouns, {
  45. stats: {
  46. Toughness: 20,
  47. Power: 20,
  48. Speed: 15,
  49. Willpower: 15,
  50. Charm: 10
  51. }
  52. })
  53. fighter.title = "Lv. 6 Fighter"
  54. fighter.items.push(Items.Sword)
  55. const rogue = new Creatures.Human(new ProperNoun('Lidda'), FemalePronouns, {
  56. stats: {
  57. Toughness: 10,
  58. Power: 15,
  59. Speed: 20,
  60. Willpower: 15,
  61. Charm: 20
  62. }
  63. })
  64. rogue.title = "Lv. 5 Rogue"
  65. rogue.items.push(Items.Dagger)
  66. const wizard = new Creatures.Human(new ProperNoun('Mialee'), FemalePronouns, {
  67. stats: {
  68. Toughness: 10,
  69. Power: 10,
  70. Speed: 15,
  71. Willpower: 20,
  72. Charm: 25
  73. }
  74. })
  75. wizard.title = "Lv. 6 Wizard"
  76. wizard.items.push(Items.Wand)
  77. const cleric = new Creatures.Human(new ProperNoun('Jozan'), MalePronouns, {
  78. stats: {
  79. Toughness: 15,
  80. Power: 15,
  81. Speed: 10,
  82. Willpower: 20,
  83. Charm: 15
  84. }
  85. })
  86. cleric.title = "Lv. 5 Cleric"
  87. cleric.items.push(Items.Mace)
  88. return [fighter, cleric, rogue, wizard]
  89. }
  90. }
  91. </script>
  92. <style>
  93. body, html {
  94. background: #181818;
  95. width: 100%;
  96. height: 100%;
  97. overflow-x: hidden;
  98. }
  99. #app {
  100. font-family: Avenir, Helvetica, Arial, sans-serif;
  101. -webkit-font-smoothing: antialiased;
  102. -moz-osx-font-smoothing: grayscale;
  103. text-align: center;
  104. color: #ddd;
  105. background: #111;
  106. width: 100%;
  107. margin: auto;
  108. height: 100%;
  109. display: flex;
  110. flex-direction: column;
  111. }
  112. .tippy-box {
  113. text-align: center;
  114. border-radius: 10px;
  115. }
  116. .tippy-box .tooltip-title {
  117. font-size: 18pt;
  118. font-family: sans-serif;
  119. }
  120. .tippy-box .tooltip-body {
  121. font-size: 12pt;
  122. font-family: sans-serif;
  123. }
  124. *::-webkit-scrollbar {
  125. height: 12px;
  126. }
  127. *::-webkit-scrollbar-button {
  128. width: 0px;
  129. height: 0px;
  130. }
  131. *::-webkit-scrollbar-thumb {
  132. background: #e1e1e1;
  133. border: 0px none #ffffff;
  134. border-radius: 50px;
  135. }
  136. *::-webkit-scrollbar-thumb:hover {
  137. background: #ffffff;
  138. }
  139. *::-webkit-scrollbar-thumb:active {
  140. background: #000000;
  141. }
  142. *::-webkit-scrollbar-track {
  143. background: #00000000;
  144. border: 0px none #ffffff;
  145. border-radius: 50px;
  146. }
  147. *::-webkit-scrollbar-track:hover {
  148. background: #666666;
  149. }
  150. *::-webkit-scrollbar-track:active {
  151. background: #333333;
  152. }
  153. *::-webkit-scrollbar-corner {
  154. background: transparent;
  155. }
  156. </style>