structs.lisp 1.8 KB

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