Simon Watson %!s(int64=2) %!d(string=hai) anos
pai
achega
fadefe266f
Modificáronse 5 ficheiros con 165 adicións e 40 borrados
  1. 47 2
      README.md
  2. 11 0
      ascii-assets.lisp
  3. 3 38
      clwars.lisp
  4. 51 0
      game.lisp
  5. 53 0
      structs.lisp

+ 47 - 2
README.md

@@ -1,3 +1,48 @@
-# clwars
+-*- org-mode -*-
 
-Small text based trading game.
+* clwars
+
+Text based trading/adventure sim.
+
+** Description
+CL-Wars is a text based game made for fun, highly inspired by
+Space Trader, Drug Wars, and WH40k.
+
+In CL-Wars you are a rogue trader on the run from galatic
+security forces, and you must use the tools available to
+you to reach a safe haven on the edge of the galaxy.
+
+** Systems
+*** Systems
+- Ship Systems
+  - Hull Integrity
+    - When 0 game over
+  - Repulsor Shield
+    - Each % of shield integrity reduces damage by some %
+  - Warp Drive
+    - How far you can jump per 1 fuel
+  - Reactors
+    - Powers warp drive and warp field
+    - Will always have some power, but if power is too low
+      you with have to jump without a warp field
+  - Munitions
+    - Ammo for weapons
+  - Warp Field
+    - Jumping without a warp field will have random effects
+- Weapons Systems
+  - Weapons have attributes depending on type
+  - Plasma Weapon
+    - Expensive/high damamge
+  - Beam Weapon
+    - High hull damage, low shield damage
+  - Explosive Weapon
+    - Average hull damage, average shield damage
+- Money
+  - Used to upgrade ship components/crew
+- Crew Systems
+  - Crew needs gruel for food
+  - Crew will be happier if spice is present on the ship
+  - Crew members can give buffs
+    to other parts of the ship
+  - Sanity
+  - Moral

+ 11 - 0
ascii-assets.lisp

@@ -0,0 +1,11 @@
+(defvar *menu-splash* "
+ ▄████████  ▄█        ▄█     █▄     ▄████████    ▄████████    ▄████████ 
+███    ███ ███       ███     ███   ███    ███   ███    ███   ███    ███ 
+███    █▀  ███       ███     ███   ███    ███   ███    ███   ███    █▀  
+███        ███       ███     ███   ███    ███  ▄███▄▄▄▄██▀   ███        
+███        ███       ███     ███ ▀███████████ ▀▀███▀▀▀▀▀   ▀███████████ 
+███    █▄  ███       ███     ███   ███    ███ ▀███████████          ███ 
+███    ███ ███▌    ▄ ███ ▄█▄ ███   ███    ███   ███    ███    ▄█    ███ 
+████████▀  █████▄▄██  ▀███▀███▀    ███    █▀    ███    ███  ▄████████▀  
+           ▀                                    ███    ███              
+")

+ 3 - 38
clwars.lisp

@@ -1,41 +1,6 @@
-(defvar *menu-splash* "
- ▄████████  ▄█        ▄█     █▄     ▄████████    ▄████████    ▄████████ 
-███    ███ ███       ███     ███   ███    ███   ███    ███   ███    ███ 
-███    █▀  ███       ███     ███   ███    ███   ███    ███   ███    █▀  
-███        ███       ███     ███   ███    ███  ▄███▄▄▄▄██▀   ███        
-███        ███       ███     ███ ▀███████████ ▀▀███▀▀▀▀▀   ▀███████████ 
-███    █▄  ███       ███     ███   ███    ███ ▀███████████          ███ 
-███    ███ ███▌    ▄ ███ ▄█▄ ███   ███    ███   ███    ███    ▄█    ███ 
-████████▀  █████▄▄██  ▀███▀███▀    ███    █▀    ███    ███  ▄████████▀  
-           ▀                                    ███    ███              
-")
-
-#||
-# Description
-  CL-Wars is a text based game made for fun, highly inspired by
-  Space Trader and Drug Wars.
-  In CL-Wars you are a rogue trader on the run from galatic
-  security forces, and you must use the tools available to
-  you to reach a safe haven on the edge of the galaxy.
-
-# Systems
-  Stats
-    - Health
-    - Weapons Systems
-  Money
-    - Used to upgrade
-||#
-
-;; Actor in the game,
-;; eg the player, an npc, etc
-(defstruct *actor*
-  inventory ; Something representing goods held
-  health
-  mana)
-
-;; This represents the goods market
-;; as a whole
-(defstruct *market*)
+(load "ascii-assets.lisp")
+(load "structs.lisp")
+(load "game.lisp")
 
 ;; https://stackoverflow.com/questions/4882361/which-command-could-be-used-to-clear-screen-in-clisp
 (defun cls()

+ 51 - 0
game.lisp

@@ -0,0 +1,51 @@
+(defvar *player-ship*)
+(defvar *market*)
+
+
+(defun random-uniq-crew ()
+  (let ((num-attr (random 10))
+	(crew-mem (make-uniq-crew-mem)))
+    
+
+(defun init-game-state ()
+  (progn
+    (setq *market* (make-market :price-of-petrofuel 20
+				:price-of-ammo 10
+				:price-of-archeotech 1000
+				:price-of-spice 50
+				:price-of-gruel 5))
+    (setq *player-ship* (make-player-ship :armor-val 10
+		      :rep-shield-val 10
+		      :warp-drive (list 1 5)
+		      :reactor-str 1
+		      :ammo 20
+		      :warp-field 1
+		      :weapons (list (make-weapon :name "Plamsa"
+						  :shield-dmg 3
+						  :hull-dmg 3
+						  :ammo-cost 5)
+				     (make-weapon :name "Mega Bolter"
+						  :shield-dmg 1
+						  :hull-dmg 2
+						  :ammo-cost 1)
+				     (make-weapon :name "Beam"
+						  :shield-dmg 1
+						  :hull-dmg 3
+						  :ammo-cost 3))
+		      :credits 1000
+		      :crew (make-crew :sanity-val 100
+				       :moral-val 100
+				       :crew-members (list))
+		      :inventory (make-player-inventory :petrofuel 20
+							:gruel 20
+							:spice 0
+							:ammo 20
+							:archeotech 0)))))
+
+
+
+
+
+
+
+

+ 53 - 0
structs.lisp

@@ -0,0 +1,53 @@
+(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
+  ammo
+  warp-field ; 0 - low power, 1 - full power
+  weapons
+  credits
+  crew
+  inventory)
+
+(defstruct player-inventory
+  petrofuel
+  gruel
+  spice
+  ammo
+  archeotech)
+
+(defstruct crew
+  sanity-val ; Max 100
+  moral-val ; Max 100
+  crew-members ; List of *uniq-crew-mem*
+  )
+
+;;; Unique crew member that can provide an abstract buff
+;;; or nerf to some internal game system
+(defstruct uniq-crew-mem
+  armor-buff
+  rep-shield-buff
+  sanity-buff
+  moral-buff
+  warp-drive-buff
+  reactor-str-buff
+  warp-field-buff
+  plasma-buff
+  expl-buff
+  beam-buff
+  credit-buff)
+
+(defstruct weapon
+  name
+  shield-dmg
+  hull-dmg
+  ammo-cost)
+
+(defstruct market
+  price-of-petrofuel
+  price-of-ammo
+  price-of-archeotech
+  price-of-spice
+  price-of-gruel)
+