structs.lisp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. (defstruct player-ship
  2. armor-val
  3. rep-shield-val
  4. warp-drive ; tuple, first ele is power state (0,1), second is fuel cost
  5. reactor-str ; 0 - low power, 1 - full power, 2 - overdrive
  6. warp-field ; 0 - low power, 1 - full power
  7. weapons
  8. credits
  9. crew
  10. inventory)
  11. (defstruct player-inventory
  12. petrofuel
  13. gruel
  14. spice
  15. ammo
  16. archeotech)
  17. (defstruct crew
  18. sanity-val ; Max 100
  19. crew-members) ; List of *uniq-crew-mem*
  20. ;;; Unique crew member that can provide an abstract buff
  21. ;;; or nerf to some internal game system
  22. (defstruct uniq-crew-mem
  23. name
  24. armor-buff
  25. rep-shield-buff
  26. sanity-buff
  27. warp-drive-buff
  28. reactor-str-buff
  29. warp-field-buff
  30. plasma-buff
  31. expl-buff
  32. beam-buff
  33. credit-buff)
  34. ;; Crew name generators
  35. (defvar *name-prefixes*
  36. (list "Precepitor"
  37. "Auriga"
  38. "Basileus"
  39. "Pontiff"
  40. "Palatine"
  41. "Centurion"
  42. "Conjugator"
  43. "Principus"
  44. "Executor"
  45. "Commonus"
  46. "Gothicus"
  47. "Augusta"
  48. "Calligraphus"
  49. "Imperator"
  50. "Consul"
  51. "Signifier"
  52. "Tribune"
  53. "Praetorian"
  54. "Prefect"))
  55. (defvar *name-values*
  56. (list "Atticus"
  57. "Aurelia"
  58. "Cassius"
  59. "Maximus"
  60. "Aurelius"
  61. "Magnus"
  62. "Lucius"
  63. "Augustus"
  64. "Caeser"
  65. "Remus"
  66. "Julius"
  67. "Octavius"
  68. "Cato"
  69. "Tiberius"
  70. "Nero"
  71. "Romulus"
  72. "Septimus"
  73. "Cicero"
  74. "Cyprian"
  75. "Justus"
  76. "Quintus"
  77. "Decimus"))
  78. (defun make-crew-mem-name ()
  79. (let ((name (nth (random (length *name-values*)) *name-values*))
  80. (prefix (nth (random (length *name-prefixes*)) *name-prefixes*)))
  81. (concatenate 'string prefix " " name)))
  82. (defstruct weapon
  83. name
  84. shield-dmg
  85. hull-dmg
  86. ammo-cost)
  87. (defstruct market
  88. price-of-petrofuel
  89. price-of-ammo
  90. price-of-archeotech
  91. price-of-spice
  92. price-of-gruel)
  93. ;; This gets created when travelling to a
  94. ;; new sector
  95. (defstruct sector
  96. market ; contains market struct
  97. hazards ; Contains hazard for sector
  98. boons) ; Contains boon for sector