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.
 
 
 
 
 

171 lines
3.8 KiB

  1. <template>
  2. <div id="app">
  3. <Header />
  4. <div id="main-area">
  5. <transition name="component-fade" mode='out-in'>
  6. <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" />
  7. </transition>
  8. </div>
  9. </div>
  10. </template>
  11. <script lang="ts">
  12. import { Component, Vue, Prop, Emit } from 'vue-property-decorator'
  13. import Header from './components/Header.vue'
  14. import Combat from './components/Combat.vue'
  15. import Explore from './components/Explore.vue'
  16. import Profile from './components/Profile.vue'
  17. import * as Creatures from '@/game/creatures'
  18. import * as Items from '@/game/items'
  19. import { Creature } from '@/game/creature'
  20. import { ProperNoun, TheyPronouns, FemalePronouns, MalePronouns, ImproperNoun, POV } from '@/game/language'
  21. import { Place, Direction, World, Choice } from '@/game/world'
  22. import { Encounter, Side } from './game/combat'
  23. import { LogLine, nilLog } from './game/interface'
  24. import { InstantKillEffect } from './game/combat/effects'
  25. import moment from 'moment'
  26. import { Town } from './game/maps/town'
  27. @Component({
  28. components: {
  29. Combat, Header, Explore, Profile
  30. },
  31. data () {
  32. return {
  33. world: null,
  34. profileOn: false,
  35. props: {
  36. Explore: {
  37. world: this
  38. }
  39. }
  40. }
  41. }
  42. })
  43. export default class App extends Vue {
  44. constructor () {
  45. super()
  46. }
  47. get mode () {
  48. if (this.$data.world.encounter !== null) {
  49. return "Combat"
  50. } else if (this.$data.profileOn) {
  51. return "Profile"
  52. } else {
  53. return "Explore"
  54. }
  55. }
  56. @Emit('startFight')
  57. startFight (encounter: Encounter) {
  58. this.$data.world.encounter = encounter
  59. }
  60. created () {
  61. const player = new Creatures.Wolf()
  62. player.perspective = POV.Second
  63. player.side = Side.Heroes
  64. player.equipment.set(Items.EquipmentSlot.MainHand, new Items.Sword())
  65. player.items.push(new Items.Sword())
  66. player.items.push(new Items.Mace())
  67. player.items.push(new Items.Dagger())
  68. player.items.push(new Items.Sword())
  69. this.$data.world = new World(player)
  70. player.location = Town()
  71. }
  72. }
  73. </script>
  74. <style>
  75. body, html {
  76. background: #181818;
  77. width: 100%;
  78. height: 100%;
  79. overflow-x: hidden;
  80. }
  81. html {
  82. font-size: calc(0.75em + 1vmin);
  83. }
  84. #app {
  85. position: relative;
  86. font-family: Avenir, Helvetica, Arial, sans-serif;
  87. -webkit-font-smoothing: antialiased;
  88. -moz-osx-font-smoothing: grayscale;
  89. text-align: center;
  90. color: #ddd;
  91. background: #111;
  92. width: 100%;
  93. margin: auto;
  94. height: 100%;
  95. display: flex;
  96. flex-direction: column;
  97. }
  98. #main-area {
  99. position: relative;
  100. flex: 10;
  101. overflow-x: hidden;
  102. overflow-y: hidden;
  103. }
  104. .tippy-box {
  105. text-align: center;
  106. border-radius: 10px;
  107. }
  108. .tippy-box .tooltip-title {
  109. font-size: 18pt;
  110. font-family: sans-serif;
  111. }
  112. .tippy-box .tooltip-body {
  113. font-size: 12pt;
  114. font-family: sans-serif;
  115. }
  116. *::-webkit-scrollbar {
  117. height: 12px;
  118. }
  119. *::-webkit-scrollbar-button {
  120. width: 0px;
  121. height: 0px;
  122. }
  123. *::-webkit-scrollbar-thumb {
  124. background: #e1e1e1;
  125. border: 0px none #ffffff;
  126. border-radius: 50px;
  127. }
  128. *::-webkit-scrollbar-thumb:hover {
  129. background: #ffffff;
  130. }
  131. *::-webkit-scrollbar-thumb:active {
  132. background: #000000;
  133. }
  134. *::-webkit-scrollbar-track {
  135. background: #00000000;
  136. border: 0px none #ffffff;
  137. border-radius: 50px;
  138. }
  139. *::-webkit-scrollbar-track:hover {
  140. background: #666666;
  141. }
  142. *::-webkit-scrollbar-track:active {
  143. background: #333333;
  144. }
  145. *::-webkit-scrollbar-corner {
  146. background: transparent;
  147. }
  148. .component-fade-enter-active, .component-fade-leave-active {
  149. transition: opacity .3s ease;
  150. }
  151. .component-fade-enter, .component-fade-leave-to
  152. /* .component-fade-leave-active below version 2.1.8 */ {
  153. opacity: 0;
  154. }
  155. </style>