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.
 
 
 
 
 

149 lines
3.5 KiB

  1. import { Place, Choice, Direction } from '../world'
  2. import { ProperNoun, ImproperNoun, MalePronouns, FemalePronouns } from '../language'
  3. import { Encounter } from '../combat'
  4. import * as Creatures from '../creatures'
  5. import * as Items from '../items'
  6. import { LogLine, nilLog } from '../interface'
  7. import { Creature } from '../creature'
  8. function makeParty (): Creature[] {
  9. const fighter = new Creatures.Human(new ProperNoun("Redgar"), MalePronouns, {
  10. stats: {
  11. Toughness: 20,
  12. Power: 20,
  13. Speed: 15,
  14. Willpower: 15,
  15. Charm: 10
  16. }
  17. })
  18. fighter.title = "Lv. 6 Fighter"
  19. fighter.equipment.set(Items.EquipmentSlot.MainHand, new Items.Sword())
  20. const rogue = new Creatures.Human(new ProperNoun('Lidda'), FemalePronouns, {
  21. stats: {
  22. Toughness: 10,
  23. Power: 15,
  24. Speed: 20,
  25. Willpower: 15,
  26. Charm: 20
  27. }
  28. })
  29. rogue.title = "Lv. 5 Rogue"
  30. rogue.equipment.set(Items.EquipmentSlot.MainHand, new Items.Dagger())
  31. const wizard = new Creatures.Human(new ProperNoun('Mialee'), FemalePronouns, {
  32. stats: {
  33. Toughness: 10,
  34. Power: 10,
  35. Speed: 15,
  36. Willpower: 20,
  37. Charm: 25
  38. }
  39. })
  40. wizard.title = "Lv. 6 Wizard"
  41. wizard.equipment.set(Items.EquipmentSlot.MainHand, new Items.Wand())
  42. const cleric = new Creatures.Human(new ProperNoun('Jozan'), MalePronouns, {
  43. stats: {
  44. Toughness: 15,
  45. Power: 15,
  46. Speed: 10,
  47. Willpower: 20,
  48. Charm: 15
  49. }
  50. })
  51. cleric.title = "Lv. 5 Cleric"
  52. cleric.equipment.set(Items.EquipmentSlot.MainHand, new Items.Mace())
  53. return [fighter, cleric, rogue, wizard]
  54. }
  55. export const Town = (): Place => {
  56. const home = new Place(
  57. new ProperNoun('Your home'),
  58. "A very home-y place"
  59. )
  60. const westAve = new Place(
  61. new ImproperNoun('West Avenue'),
  62. "Streets of Sim City"
  63. )
  64. const westRoad = new Place(
  65. new ImproperNoun('road'),
  66. "West of town"
  67. )
  68. const woods = new Place(
  69. new ImproperNoun('woods'),
  70. "Scary woods"
  71. )
  72. const bosses = new Place(
  73. new ProperNoun("BOSS ZONE"),
  74. "Extra scary"
  75. )
  76. woods.choices.push(
  77. new Choice(
  78. "Fight a wolf",
  79. "yolo",
  80. (world, executor) => {
  81. world.encounter = new Encounter(
  82. { name: "You punched a wolf" },
  83. [executor, new Creatures.Wolf()]
  84. )
  85. return new LogLine(`FIGHT TIME`)
  86. }
  87. )
  88. )
  89. woods.choices.push(
  90. new Choice(
  91. "Fight a dragon",
  92. "yolo",
  93. (world, executor) => {
  94. world.encounter = new Encounter(
  95. { name: "You punched a dragon" },
  96. [executor, new Creatures.Dragon()]
  97. )
  98. return new LogLine(`FIGHT TIME`)
  99. }
  100. )
  101. )
  102. const bossEncounters = [
  103. new Encounter(
  104. { name: "Withers & Kenzie" },
  105. makeParty().concat([new Creatures.Withers(), new Creatures.Kenzie()])
  106. ),
  107. new Encounter(
  108. { name: "Goldeneye" },
  109. makeParty().concat([new Creatures.Goldeneye()])
  110. ),
  111. new Encounter(
  112. { name: "Large Wah" },
  113. makeParty().concat([new Creatures.Shingo()])
  114. )
  115. ]
  116. bossEncounters.forEach(encounter => {
  117. bosses.choices.push(
  118. new Choice(
  119. encounter.desc.name,
  120. "Boss fight!",
  121. (world, executor) => {
  122. world.encounter = encounter
  123. return nilLog
  124. }
  125. )
  126. )
  127. })
  128. home.biconnect(Direction.North, westAve)
  129. westAve.biconnect(Direction.West, westRoad)
  130. westRoad.biconnect(Direction.South, woods)
  131. westRoad.biconnect(Direction.North, bosses)
  132. return home
  133. }