fadefe266fd9bd7a3ad4dc5a1d8a01e7d0bd6811
commit fadefe266fd9bd7a3ad4dc5a1d8a01e7d0bd6811
Author: Simon Watson <spw01@protonmail.com>
Date: Tue Aug 31 22:51:34 2021 -0400

Basics

diff --git a/README.md b/README.md
index 037aa20..901761d 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,48 @@
-# clwars
+-*- org-mode -*-

-Small text based trading game.
\ No newline at end of file
+* 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
diff --git a/ascii-assets.lisp b/ascii-assets.lisp
new file mode 100644
index 0000000..2a2ebb8
--- /dev/null
+++ b/ascii-assets.lisp
@@ -0,0 +1,11 @@
+(defvar *menu-splash* "
+ ▄████████ ▄█ ▄█ █▄ ▄████████ ▄████████ ▄████████
+███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███
+███ █▀ ███ ███ ███ ███ ███ ███ ███ ███ █▀
+███ ███ ███ ███ ███ ███ ▄███▄▄▄▄██▀ ███
+███ ███ ███ ███ ▀███████████ ▀▀███▀▀▀▀▀ ▀███████████
+███ █▄ ███ ███ ███ ███ ███ ▀███████████ ███
+███ ███ ███▌ ▄ ███ ▄█▄ ███ ███ ███ ███ ███ ▄█ ███
+████████▀ █████▄▄██ ▀███▀███▀ ███ █▀ ███ ███ ▄████████▀
+ ▀ ███ ███
+")
diff --git a/clwars.lisp b/clwars.lisp
index e808967..1d05871 100644
--- a/clwars.lisp
+++ b/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()
diff --git a/game.lisp b/game.lisp
new file mode 100644
index 0000000..f0ab0fd
--- /dev/null
+++ b/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)))))
+
+
+
+
+
+
+
+
diff --git a/structs.lisp b/structs.lisp
new file mode 100644
index 0000000..0317b96
--- /dev/null
+++ b/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)
+