structs.lisp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ;; This gets created when travelling to a
  2. ;; new sector
  3. (defclass sector ()
  4. ((market
  5. :initarg :market
  6. :accessor market)
  7. (hazards
  8. :initarg :hazards
  9. :accessor hazards
  10. :initform NIL)
  11. (boons
  12. :initarg :boons
  13. :accessor boons
  14. :initform NIL)
  15. (player-ship-obj
  16. :initarg :player-ship-obj
  17. :accessor player-ship-obj
  18. :initform NIL)
  19. (enemy-ships
  20. :initarg :enemy-ships
  21. :accessor enemy-ships
  22. :initform NIL)))
  23. (defclass ship ()
  24. ((armor-val
  25. :initarg :armor-val
  26. :accessor armor-val
  27. :initform 10)
  28. (rep-shield-val
  29. :initarg :rep-shield-val
  30. :accessor rep-shield-val
  31. :initform 10)
  32. (warp-drive-power ; 0 off, 1 on
  33. :initarg :warp-drive-power
  34. :accessor warp-drive-power
  35. :initform 1)
  36. (reactor-str ; 0 - low power, 1 - full power, 2 - overdrive
  37. :initarg :reactor-str
  38. :accessor reactor-str
  39. :initform 1)
  40. (warp-field ; 0 - low power, 1 - full power
  41. :initarg :warp-field
  42. :accessor warp-field
  43. :initform 1)
  44. (weapons
  45. :initarg :weapons
  46. :accessor weapons)
  47. (credits
  48. :initarg :credits
  49. :accessor credits
  50. :initform 1000)
  51. (crew
  52. :initarg :crew
  53. :accessor crew
  54. :initform NIL)
  55. (inventory
  56. :initarg :inventory
  57. :accessor inventory
  58. :initform (make-instance 'player-inventory))))
  59. (defclass ai-ship (ship)
  60. ((name
  61. :initarg :name
  62. :accessor name
  63. :initform NIL)
  64. (ai-type
  65. :initarg :ai-type
  66. :accessor ai-type
  67. :initform NIL)))
  68. (defclass player-inventory ()
  69. ((petrofuel
  70. :initarg :petrofuel
  71. :accessor petrofuel
  72. :initform 20)
  73. (gruel
  74. :initarg :gruel
  75. :accessor gruel
  76. :initform 20)
  77. (spice
  78. :initarg :spice
  79. :accessor spice
  80. :initform 0)
  81. (ammo
  82. :initarg :ammo
  83. :accessor ammo
  84. :initform 20)
  85. (archeotech
  86. :initarg :archeotech
  87. :accessor archeotech
  88. :initform 0)))
  89. (defclass crew ()
  90. ((sanity-val ; Max 100
  91. :initarg :sanity-val
  92. :accessor sanity-val
  93. :initform 100)
  94. (moral-val
  95. :initarg :moral-val
  96. :accessor moral-val
  97. :initform 100)
  98. (crew-members
  99. :initarg :crew-members ; List of *uniq-crew-mem*
  100. :accessor crew-members)))
  101. ;;; Unique crew member that can provide an abstract buff
  102. ;;; or nerf to some internal game system
  103. (defclass uniq-crew-mem ()
  104. ((name
  105. :initarg :name
  106. :accessor name)
  107. (buff
  108. :initarg :buff
  109. :accessor buff
  110. :initform NIL)))
  111. (defclass crew-buff ()
  112. ((name
  113. :initarg :name
  114. :accessor name)
  115. (buff-type
  116. :initarg :buff-type
  117. :accessor buff-type
  118. :initform NIL)
  119. (buff-value
  120. :initarg :buff-value
  121. :accessor buff-value
  122. :initform NIL)))
  123. (defclass weapon ()
  124. ((name
  125. :initarg :name
  126. :accessor name)
  127. (shield-dmg
  128. :initarg :shield-dmg
  129. :accessor shield-dmg)
  130. (hull-dmg
  131. :initarg :hull-dmg
  132. :accessor hull-dmg)
  133. (ammo-cost
  134. :initarg :ammo-cost
  135. :accessor ammo-cost)))
  136. (defclass market ()
  137. ((price-of-petrofuel
  138. :initarg :petrofuel
  139. :accessor price-of-petrofuel
  140. :initform 10)
  141. (price-of-gruel
  142. :initarg :gruel
  143. :accessor price-of-gruel
  144. :initform 5)
  145. (price-of-spice
  146. :initarg :spice
  147. :accessor price-of-spice
  148. :initform 100)
  149. (price-of-ammo
  150. :initarg :ammo
  151. :accessor price-of-ammo
  152. :initform 20)
  153. (price-of-archeotech
  154. :initarg :archeotech
  155. :accessor price-of-archeotech
  156. :initform 2000)))