/[the-feebs-war]/package.lisp
ViewVC logotype

Contents of /package.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16 - (hide annotations)
Sun Feb 17 20:29:26 2008 UTC (6 years, 2 months ago) by gmilare
File size: 5085 byte(s)
1 gmilare 1 ;;; -*- Common Lisp -*-
2    
3 gmilare 14 #| Copyright (c) 2007,2008 Gustavo Henrique Milaré
4 gmilare 1
5     This file is part of The Feebs War.
6    
7     The Feebs War is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 3 of the License, or
10     (at your option) any later version.
11    
12     The Feebs War is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     GNU General Public License for more details.
16    
17     You should have received a copy of the GNU General Public License
18 gmilare 7 along with The Feebs War. If not, see <http://www.gnu.org/licenses/>.
19 gmilare 1 |#
20    
21     ;;; based on Planet of the Feebs
22    
23     ;;; About Planet of the Feebs:
24     ;;
25     ;; Written by Skef Wholey.
26     ;; Modified by Scott Fahlman.
27     ;; Modified by Dan Kuokka.
28     ;; Modified by Jim Healy.
29     ;;
30     ;; Graphics ported to X11 by Fred Gilham 8-FEB-1998.
31    
32    
33 gmilare 14 (defpackage :the-feebs-war
34     (:nicknames :feebs)
35 gmilare 7 (:use :common-lisp)
36 gmilare 1 ;; Export everything we want the players to get their hands on.
37 gmilare 13 (:export ;; Slots accessors
38 gmilare 14 name facing
39     x-position y-position peeking line-of-sight
40     energy-reserve
41     score kills
42     ready-to-fire
43     aborted last-move
44    
45     my-square left-square right-square rear-square
46    
47     ;; Images
48     feeb-image-p feeb-image-name
49     feeb-image-facing feeb-image-peeking
50     fireball-image-p fireball-image-direction
51    
52     ;; Parameters
53     get-feeb-parm change-feeb-parm
54     list-parameter-settings
55    
56     game-length
57    
58     ;; Pontuation
59     points-for-killing points-for-dying
60     points-for-slow-down
61 gmilare 11
62 gmilare 14 ;; Energy
63     flame-energy mushroom-energy carcass-energy
64     maximum-energy
65     starting-energy
66     carcass-rot-probability
67     carcass-guaranteed-lifetime
68    
69     ;; Game quantities
70     maze-x-size
71     maze-y-size
72     number-of-mushrooms
73    
74     ;; Probabilities
75     fireball-guaranteed-lifetime
76     fireball-dissipation-probability
77     fireball-reflection-probability
78     flame-no-recovery-time
79     flame-recovery-probability
80    
81     ;; Difficulty variables
82     slow-feeb-noop-switch
83     slow-feeb-noop-factor
84     reference-time
85     sense-location-p
86     may-get-maze-map-p
87    
88     ;; Settings
89     define-feeb delete-feeb
90     feebs
91     change-layout
92     get-maze-map
93    
94     ;; Constants
95     north south east west
96    
97     ;; Mazes
98     *maze-0* *maze-1* *maze-2*
99     *maze-3* *maze-4* *maze-5*
100     make-template generate-maze
101    
102     ;; Graphics
103     create-graphics
104    
105     ;; Extras
106    
107     ;; Directional arithmetic
108     left-of right-of behind-of
109     relative-facing
110    
111     forward-dx forward-dy
112     left-dx left-dy
113     right-dx right-dy
114     behind-dx behind-dy
115    
116     ;; Others
117     wallp chance
118    
119     ;; Graphics for alpha release
120     simple-play))
121 gmilare 11
122 gmilare 14 (in-package :the-feebs-war)
123 gmilare 13
124    
125 gmilare 16
126 gmilare 1 ;;; Directions
127    
128 gmilare 11 (deftype direction ()
129     `(integer 0 3))
130    
131 gmilare 1 (defconstant north 0)
132     (defconstant east 1)
133     (defconstant south 2)
134     (defconstant west 3)
135    
136    
137     ;;; Parameters that affect strategy of the game.
138    
139     (defvar *number-of-mushroom-sites* 0)
140     (defvar *feeb-parameters* nil)
141    
142    
143     ;;; Setting up the maze.
144    
145     ;;; The default maze.
146     ;;; X represents a wall,
147     ;;; * represents a mushroom patch, and
148     ;;; e is a feeb entry point.
149    
150     (defvar *maze* nil)
151     (defvar *fake-maze* nil)
152    
153 gmilare 13 (defparameter *maze-0*
154 gmilare 1 '("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
155     "Xe * XXXXXXX XXXXXXXXXX"
156     "XXXXX XXXXXXX XXXXXXX * XXXXX"
157     "XXXXX XXXXXXX XXXXXXX XXX XXXXXX"
158     "XXXXX XXX XXX XXXXXXeXXX XXXXXX"
159     "XXXXX XXX XXXX XXXXXXXXXX XXXXXX"
160     "XXXXX XXX XXXX XX XXXXXXX XXXXXX"
161     "XXXXX * XX XX XXXXXXX XXXXXX"
162     "XXXXX XXXX XXX XX* * XXXXXX"
163     "XX *XXXX XXX XX XXXX XXXXXXXXX"
164     "XX XX XXXXeXXX XX XXXX XXXXXXXXX"
165     "XX XX XXXX XXX * * * X"
166     "XX XX XXXX XXXXXXXX XXXXXXXXXXeX"
167     "XXeXX XXXX XXXXXXXX XXXXXXXXXX X"
168     "XX XX * * XXXXXXXX X"
169     "XX XXXXXXXXXXX XXXX XXXXXXXX XXX"
170     "XX eXXXXXXXXXX XXXe XXXXXX XXX"
171     "XX XXXXXXXXXXXXe XXXXXXXXXXX XXX"
172     "XX* XXX XXXXXXX XXXXXXXXXX XXX"
173     "XX X XX XXXXXXXX eXXXXXXXXX XXX"
174     "XX XX X XXXXXXXXX XXXXXXXX XXX"
175     "X XXX * XXXXXX* * X"
176     "X XXXXXX XXX XXXXXX XXXXXXXXXX X"
177     "X XXXXXX XXX XXXXXX X X X"
178     "X XXXXXX XXX XXXXXX X XXXXXX X X"
179     "X * * XX X X *eX X X"
180     "XXXXX XXXX XXXXXXXX X XXX XX X X"
181     "XXXXX XXXX XXXXX *X XXX XX X X"
182     "XXXXX XXXX XXXXX XX X e X X"
183     "XXXXX XXXX e XX XXX*XXXXXX X"
184     "XXXXX XXXXXXXXXXXXX X"
185     "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"))
186    
187 gmilare 13 (defparameter *layout* *maze-0*)
188 gmilare 1
189    
190 gmilare 11 ;;; Map size
191    
192     (defvar *maze-x-size* 32)
193     (defvar *maze-y-size* 32)
194    
195    
196 gmilare 1 ;;; Quantities during the game
197    
198 gmilare 13 (defvar *mushroom-sites* ())
199     (defvar *entry-points* ())
200     (defvar *number-of-entry-points* 0)
201 gmilare 1
202 gmilare 13
203 gmilare 1 ;;; Elements in the maze
204    
205 gmilare 13 (defvar *feebs* ())
206     (defvar *dead-feebs* ())
207     (defvar *fireballs-flying* ())
208     (defvar *carcasses* ())
209 gmilare 1
210 gmilare 13
211 gmilare 11 ;;; Current feeb playing
212 gmilare 14
213 gmilare 13 (defvar *playing-feeb* nil)
214     (defvar *feebs-to-be* ())

  ViewVC Help
Powered by ViewVC 1.1.5