Feast 2.0!
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

172 wiersze
3.8 KiB

  1. <template>
  2. <div id="app">
  3. <Header :version="version" />
  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. version: "pre-alpha"
  41. }
  42. }
  43. })
  44. export default class App extends Vue {
  45. constructor () {
  46. super()
  47. }
  48. get mode () {
  49. if (this.$data.world.encounter !== null) {
  50. return "Combat"
  51. } else if (this.$data.profileOn) {
  52. return "Profile"
  53. } else {
  54. return "Explore"
  55. }
  56. }
  57. @Emit('startFight')
  58. startFight (encounter: Encounter) {
  59. this.$data.world.encounter = encounter
  60. }
  61. created () {
  62. const player = new Creatures.Player()
  63. player.perspective = POV.Second
  64. player.side = Side.Heroes
  65. player.equipment[Items.EquipmentSlot.MainHand] = new Items.Sword()
  66. player.equipment[Items.EquipmentSlot.Head] = new Items.Helmet()
  67. player.items.push(new Items.HealthPotion())
  68. player.items.push(new Items.Mace())
  69. player.items.push(new Items.Dagger())
  70. this.$data.world = new World(player)
  71. player.location = Town()
  72. }
  73. }
  74. </script>
  75. <style>
  76. body, html {
  77. background: #181818;
  78. width: 100%;
  79. height: 100%;
  80. overflow-x: hidden;
  81. }
  82. html {
  83. font-size: calc(0.75em + 1vmin);
  84. }
  85. #app {
  86. position: relative;
  87. font-family: Avenir, Helvetica, Arial, sans-serif;
  88. -webkit-font-smoothing: antialiased;
  89. -moz-osx-font-smoothing: grayscale;
  90. text-align: center;
  91. color: #ddd;
  92. background: #111;
  93. width: 100%;
  94. margin: auto;
  95. height: 100%;
  96. display: flex;
  97. flex-direction: column;
  98. }
  99. #main-area {
  100. position: relative;
  101. flex: 10;
  102. overflow-x: hidden;
  103. overflow-y: hidden;
  104. }
  105. .tippy-box {
  106. text-align: center;
  107. border-radius: 10px;
  108. }
  109. .tippy-box .tooltip-title {
  110. font-size: 18pt;
  111. font-family: sans-serif;
  112. }
  113. .tippy-box .tooltip-body {
  114. font-size: 12pt;
  115. font-family: sans-serif;
  116. }
  117. *::-webkit-scrollbar {
  118. height: 12px;
  119. }
  120. *::-webkit-scrollbar-button {
  121. width: 0px;
  122. height: 0px;
  123. }
  124. *::-webkit-scrollbar-thumb {
  125. background: #e1e1e1;
  126. border: 0px none #ffffff;
  127. border-radius: 50px;
  128. }
  129. *::-webkit-scrollbar-thumb:hover {
  130. background: #ffffff;
  131. }
  132. *::-webkit-scrollbar-thumb:active {
  133. background: #000000;
  134. }
  135. *::-webkit-scrollbar-track {
  136. background: #00000000;
  137. border: 0px none #ffffff;
  138. border-radius: 50px;
  139. }
  140. *::-webkit-scrollbar-track:hover {
  141. background: #666666;
  142. }
  143. *::-webkit-scrollbar-track:active {
  144. background: #333333;
  145. }
  146. *::-webkit-scrollbar-corner {
  147. background: transparent;
  148. }
  149. .component-fade-enter-active, .component-fade-leave-active {
  150. transition: opacity .3s ease;
  151. }
  152. .component-fade-enter, .component-fade-leave-to
  153. /* .component-fade-leave-active below version 2.1.8 */ {
  154. opacity: 0;
  155. }
  156. </style>