|
@@ -1,40 +1,83 @@
|
|
|
-(defstruct player-ship
|
|
|
- armor-val
|
|
|
- rep-shield-val
|
|
|
- warp-drive ; tuple, first ele is power state (0,1), second is fuel cost
|
|
|
- reactor-str ; 0 - low power, 1 - full power, 2 - overdrive
|
|
|
- warp-field ; 0 - low power, 1 - full power
|
|
|
- weapons
|
|
|
- credits
|
|
|
- crew
|
|
|
- inventory)
|
|
|
+(defclass player-ship ()
|
|
|
+ ((armor-val
|
|
|
+ :initarg :armor-val
|
|
|
+ :accessor armor-val
|
|
|
+ :initform 10)
|
|
|
+ (rep-shield-val
|
|
|
+ :initarg :rep-shield-val
|
|
|
+ :accessor rep-shield-val
|
|
|
+ :initform 10)
|
|
|
+ (warp-drive-power ; 0 off, 1 on
|
|
|
+ :initarg :warp-drive-power
|
|
|
+ :accessor warp-drive-power
|
|
|
+ :initform 1)
|
|
|
+ (reactor-str ; 0 - low power, 1 - full power, 2 - overdrive
|
|
|
+ :initarg :reactor-str
|
|
|
+ :accessor reactor-str
|
|
|
+ :initform 1)
|
|
|
+ (warp-field ; 0 - low power, 1 - full power
|
|
|
+ :initarg :warp-field
|
|
|
+ :accessor warp-field
|
|
|
+ :initform 1)
|
|
|
+ (weapons
|
|
|
+ :initarg :weapons
|
|
|
+ :accessor weapons)
|
|
|
+ (credits
|
|
|
+ :initarg :credits
|
|
|
+ :accessor credits
|
|
|
+ :initform 1000)
|
|
|
+ (crew
|
|
|
+ :initarg :crew
|
|
|
+ :accessor crew)
|
|
|
+ (inventory
|
|
|
+ :initarg :inventory
|
|
|
+ :accessor inventory)))
|
|
|
|
|
|
-(defstruct player-inventory
|
|
|
- petrofuel
|
|
|
- gruel
|
|
|
- spice
|
|
|
- ammo
|
|
|
- archeotech)
|
|
|
+(defclass player-inventory ()
|
|
|
+ ((petrofuel
|
|
|
+ :initarg :petrofuel
|
|
|
+ :accessor petrofuel
|
|
|
+ :initform 20)
|
|
|
+ (gruel
|
|
|
+ :initarg :gruel
|
|
|
+ :accessor gruel
|
|
|
+ :initform 20)
|
|
|
+ (spice
|
|
|
+ :initarg :spice
|
|
|
+ :accessor spice
|
|
|
+ :initform 0)
|
|
|
+ (ammo
|
|
|
+ :initarg :ammo
|
|
|
+ :accessor ammo
|
|
|
+ :initform 20)
|
|
|
+ (archeotech
|
|
|
+ :initarg :archeotech
|
|
|
+ :accessor archeotech
|
|
|
+ :initform 0)))
|
|
|
|
|
|
-(defstruct crew
|
|
|
- sanity-val ; Max 100
|
|
|
- moral-val
|
|
|
- crew-members) ; List of *uniq-crew-mem*
|
|
|
+(defclass crew ()
|
|
|
+ ((sanity-val ; Max 100
|
|
|
+ :initarg :sanity-val
|
|
|
+ :accessor sanity-val
|
|
|
+ :initform 100)
|
|
|
+ (moral-val
|
|
|
+ :initarg :moral-val
|
|
|
+ :accessor moral-val
|
|
|
+ :initform 100)
|
|
|
+ (crew-members
|
|
|
+ :initarg :crew-members ; List of *uniq-crew-mem*
|
|
|
+ :accessor crew-members)))
|
|
|
|
|
|
;;; Unique crew member that can provide an abstract buff
|
|
|
;;; or nerf to some internal game system
|
|
|
-(defstruct uniq-crew-mem
|
|
|
- name
|
|
|
- armor-buff
|
|
|
- rep-shield-buff
|
|
|
- sanity-buff
|
|
|
- warp-drive-buff
|
|
|
- reactor-str-buff
|
|
|
- warp-field-buff
|
|
|
- plasma-buff
|
|
|
- expl-buff
|
|
|
- beam-buff
|
|
|
- credit-buff)
|
|
|
+(defclass uniq-crew-mem ()
|
|
|
+ ((name
|
|
|
+ :initarg :name
|
|
|
+ :accessor name)
|
|
|
+ (buff
|
|
|
+ :initarg :buff
|
|
|
+ :accessor buff
|
|
|
+ :initform NIL)))
|
|
|
|
|
|
;; Crew name generators
|
|
|
(defvar *name-prefixes*
|
|
@@ -82,27 +125,61 @@
|
|
|
"Quintus"
|
|
|
"Decimus"))
|
|
|
|
|
|
-(defun make-crew-mem-name ()
|
|
|
+(defun make-crew-mem-name (name-prefixes name-values)
|
|
|
+ "Expects a list of strings to use as prefixes for a name, and a list
|
|
|
+ of possible names"
|
|
|
(let ((name (nth (random (length *name-values*)) *name-values*))
|
|
|
(prefix (nth (random (length *name-prefixes*)) *name-prefixes*)))
|
|
|
(concatenate 'string prefix " " name)))
|
|
|
|
|
|
-(defstruct weapon
|
|
|
- name
|
|
|
- shield-dmg
|
|
|
- hull-dmg
|
|
|
- ammo-cost)
|
|
|
+(defclass weapon ()
|
|
|
+ ((name
|
|
|
+ :initarg :name
|
|
|
+ :accessor name)
|
|
|
+ (shield-dmg
|
|
|
+ :initarg :shield-dmg
|
|
|
+ :accessor sheild-dmg)
|
|
|
+ (hull-dmg
|
|
|
+ :initarg :hull-dmg
|
|
|
+ :accessor hull-dmg)
|
|
|
+ (ammo-cost
|
|
|
+ :initarg :ammo-cost
|
|
|
+ :accessor ammo-cost)))
|
|
|
+
|
|
|
+(defclass market ()
|
|
|
+ ((price-of-petrofuel
|
|
|
+ :initarg :price-of-petrofuel
|
|
|
+ :accessor price-of-petrofuel
|
|
|
+ :initform 10)
|
|
|
+ (price-of-gruel
|
|
|
+ :initarg :gruel
|
|
|
+ :accessor price-of-gruel
|
|
|
+ :initform 5)
|
|
|
+ (price-of-spice
|
|
|
+ :initarg :spice
|
|
|
+ :accessor price-of-spice
|
|
|
+ :initform 100)
|
|
|
+ (price-of-ammo
|
|
|
+ :initarg :ammo
|
|
|
+ :accessor price-of-ammo
|
|
|
+ :initform 20)
|
|
|
+ (price-of-archeotech
|
|
|
+ :initarg :archeotech
|
|
|
+ :accessor price-of-archeotech
|
|
|
+ :initform 2000)))
|
|
|
|
|
|
-(defstruct market
|
|
|
- price-of-petrofuel
|
|
|
- price-of-ammo
|
|
|
- price-of-archeotech
|
|
|
- price-of-spice
|
|
|
- price-of-gruel)
|
|
|
|
|
|
;; This gets created when travelling to a
|
|
|
;; new sector
|
|
|
-(defstruct sector
|
|
|
- market ; contains market struct
|
|
|
- hazards ; Contains hazard for sector
|
|
|
- boons) ; Contains boon for sector
|
|
|
+(defclass sector ()
|
|
|
+ ((market
|
|
|
+ :initarg :market
|
|
|
+ :accessor market)
|
|
|
+ (hazards
|
|
|
+ :initarg :hazards
|
|
|
+ :accessor hazards
|
|
|
+ :initform NIL)
|
|
|
+ (boons
|
|
|
+ :initarg :boons
|
|
|
+ :accessor boons
|
|
|
+ :initform NIL)))
|