;;; -*- Common Lisp -*- #| Copyright (c) 2007,2008 Gustavo Henrique Milaré This file is part of The Feebs War. The Feebs War is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The Feebs War is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with The Feebs War. If not, see . |# ;;; based on Planet of the Feebs ;;; About Planet of the Feebs: ;; ;; Written by Skef Wholey. ;; Modified by Scott Fahlman. ;; Modified by Dan Kuokka. ;; Modified by Jim Healy. ;; ;; Graphics ported to X11 by Fred Gilham 8-FEB-1998. (defpackage :the-feebs-war (:nicknames :feebs) (:use :common-lisp) ;; Export everything we want the players to get their hands on. (:export ;; Slots accessors name facing x-position y-position peeking line-of-sight energy-reserve score kills ready-to-fire aborted last-move my-square left-square right-square rear-square ;; Images feeb-image-p feeb-image-name feeb-image-facing feeb-image-peeking fireball-image-p fireball-image-direction ;; Parameters get-feeb-parm change-feeb-parm list-parameter-settings game-length ;; Pontuation points-for-killing points-for-dying points-for-slow-down ;; Energy flame-energy mushroom-energy carcass-energy maximum-energy starting-energy carcass-rot-probability carcass-guaranteed-lifetime ;; Game quantities maze-x-size maze-y-size number-of-mushrooms ;; Probabilities fireball-guaranteed-lifetime fireball-dissipation-probability fireball-reflection-probability flame-no-recovery-time flame-recovery-probability ;; Difficulty variables slow-feeb-noop-switch slow-feeb-noop-factor reference-time sense-location-p may-get-maze-map-p ;; Settings define-feeb delete-feeb feebs change-layout get-maze-map ;; Constants north south east west ;; Mazes *maze-0* *maze-1* *maze-2* *maze-3* *maze-4* *maze-5* make-template generate-maze ;; Graphics create-graphics ;; Extras ;; Directional arithmetic left-of right-of behind-of relative-facing forward-dx forward-dy left-dx left-dy right-dx right-dy behind-dx behind-dy ;; Others wallp chance ;; Graphics for alpha release simple-play)) (in-package :the-feebs-war) ;;; Directions (deftype direction () `(integer 0 3)) (defconstant north 0) (defconstant east 1) (defconstant south 2) (defconstant west 3) ;;; Parameters that affect strategy of the game. (defvar *number-of-mushroom-sites* 0) (defvar *feeb-parameters* nil) ;;; Setting up the maze. ;;; The default maze. ;;; X represents a wall, ;;; * represents a mushroom patch, and ;;; e is a feeb entry point. (defvar *maze* nil) (defvar *fake-maze* nil) (defparameter *maze-0* '("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "Xe * XXXXXXX XXXXXXXXXX" "XXXXX XXXXXXX XXXXXXX * XXXXX" "XXXXX XXXXXXX XXXXXXX XXX XXXXXX" "XXXXX XXX XXX XXXXXXeXXX XXXXXX" "XXXXX XXX XXXX XXXXXXXXXX XXXXXX" "XXXXX XXX XXXX XX XXXXXXX XXXXXX" "XXXXX * XX XX XXXXXXX XXXXXX" "XXXXX XXXX XXX XX* * XXXXXX" "XX *XXXX XXX XX XXXX XXXXXXXXX" "XX XX XXXXeXXX XX XXXX XXXXXXXXX" "XX XX XXXX XXX * * * X" "XX XX XXXX XXXXXXXX XXXXXXXXXXeX" "XXeXX XXXX XXXXXXXX XXXXXXXXXX X" "XX XX * * XXXXXXXX X" "XX XXXXXXXXXXX XXXX XXXXXXXX XXX" "XX eXXXXXXXXXX XXXe XXXXXX XXX" "XX XXXXXXXXXXXXe XXXXXXXXXXX XXX" "XX* XXX XXXXXXX XXXXXXXXXX XXX" "XX X XX XXXXXXXX eXXXXXXXXX XXX" "XX XX X XXXXXXXXX XXXXXXXX XXX" "X XXX * XXXXXX* * X" "X XXXXXX XXX XXXXXX XXXXXXXXXX X" "X XXXXXX XXX XXXXXX X X X" "X XXXXXX XXX XXXXXX X XXXXXX X X" "X * * XX X X *eX X X" "XXXXX XXXX XXXXXXXX X XXX XX X X" "XXXXX XXXX XXXXX *X XXX XX X X" "XXXXX XXXX XXXXX XX X e X X" "XXXXX XXXX e XX XXX*XXXXXX X" "XXXXX XXXXXXXXXXXXX X" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")) (defparameter *layout* *maze-0*) ;;; Map size (defvar *maze-x-size* 32) (defvar *maze-y-size* 32) ;;; Quantities during the game (defvar *mushroom-sites* ()) (defvar *entry-points* ()) (defvar *number-of-entry-points* 0) ;;; Elements in the maze (defvar *feebs* ()) (defvar *dead-feebs* ()) (defvar *fireballs-flying* ()) (defvar *carcasses* ()) ;;; Current feeb playing (defvar *playing-feeb* nil) (defvar *feebs-to-be* ())