xref: /netbsd-src/games/hack/hack.monst.c (revision 72db7ca91297c7ce829030479befd7248c559e0c)
1*72db7ca9Schristos /*	$NetBSD: hack.monst.c,v 1.7 2011/08/16 09:26:22 christos Exp $	*/
23ea4a95cSchristos 
302ded532Smycroft /*
41c7f94e5Sjsm  * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
51c7f94e5Sjsm  * Amsterdam
61c7f94e5Sjsm  * All rights reserved.
71c7f94e5Sjsm  *
81c7f94e5Sjsm  * Redistribution and use in source and binary forms, with or without
91c7f94e5Sjsm  * modification, are permitted provided that the following conditions are
101c7f94e5Sjsm  * met:
111c7f94e5Sjsm  *
121c7f94e5Sjsm  * - Redistributions of source code must retain the above copyright notice,
131c7f94e5Sjsm  * this list of conditions and the following disclaimer.
141c7f94e5Sjsm  *
151c7f94e5Sjsm  * - Redistributions in binary form must reproduce the above copyright
161c7f94e5Sjsm  * notice, this list of conditions and the following disclaimer in the
171c7f94e5Sjsm  * documentation and/or other materials provided with the distribution.
181c7f94e5Sjsm  *
191c7f94e5Sjsm  * - Neither the name of the Stichting Centrum voor Wiskunde en
201c7f94e5Sjsm  * Informatica, nor the names of its contributors may be used to endorse or
211c7f94e5Sjsm  * promote products derived from this software without specific prior
221c7f94e5Sjsm  * written permission.
231c7f94e5Sjsm  *
241c7f94e5Sjsm  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
251c7f94e5Sjsm  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
261c7f94e5Sjsm  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
271c7f94e5Sjsm  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
281c7f94e5Sjsm  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
291c7f94e5Sjsm  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
301c7f94e5Sjsm  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
311c7f94e5Sjsm  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
321c7f94e5Sjsm  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
331c7f94e5Sjsm  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
341c7f94e5Sjsm  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
351c7f94e5Sjsm  */
361c7f94e5Sjsm 
371c7f94e5Sjsm /*
381c7f94e5Sjsm  * Copyright (c) 1982 Jay Fenlason <hack@gnu.org>
391c7f94e5Sjsm  * All rights reserved.
401c7f94e5Sjsm  *
411c7f94e5Sjsm  * Redistribution and use in source and binary forms, with or without
421c7f94e5Sjsm  * modification, are permitted provided that the following conditions
431c7f94e5Sjsm  * are met:
441c7f94e5Sjsm  * 1. Redistributions of source code must retain the above copyright
451c7f94e5Sjsm  *    notice, this list of conditions and the following disclaimer.
461c7f94e5Sjsm  * 2. Redistributions in binary form must reproduce the above copyright
471c7f94e5Sjsm  *    notice, this list of conditions and the following disclaimer in the
481c7f94e5Sjsm  *    documentation and/or other materials provided with the distribution.
491c7f94e5Sjsm  * 3. The name of the author may not be used to endorse or promote products
501c7f94e5Sjsm  *    derived from this software without specific prior written permission.
511c7f94e5Sjsm  *
521c7f94e5Sjsm  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
531c7f94e5Sjsm  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
541c7f94e5Sjsm  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
551c7f94e5Sjsm  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
561c7f94e5Sjsm  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
571c7f94e5Sjsm  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
581c7f94e5Sjsm  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
591c7f94e5Sjsm  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
601c7f94e5Sjsm  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
611c7f94e5Sjsm  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6202ded532Smycroft  */
6302ded532Smycroft 
643ea4a95cSchristos #include <sys/cdefs.h>
6502ded532Smycroft #ifndef lint
66*72db7ca9Schristos __RCSID("$NetBSD: hack.monst.c,v 1.7 2011/08/16 09:26:22 christos Exp $");
6702ded532Smycroft #endif				/* not lint */
6861f28255Scgd 
6961f28255Scgd #include "hack.h"
703ea4a95cSchristos #include "extern.h"
7161f28255Scgd #include "def.eshk.h"
7261f28255Scgd 
73ab8b6343Sjsm const struct permonst mons[CMNUM + 2] = {
7461f28255Scgd 	{"bat", 'B', 1, 22, 8, 1, 4, 0},
7561f28255Scgd 	{"gnome", 'G', 1, 6, 5, 1, 6, 0},
7661f28255Scgd 	{"hobgoblin", 'H', 1, 9, 5, 1, 8, 0},
7761f28255Scgd 	{"jackal", 'J', 0, 12, 7, 1, 2, 0},
7861f28255Scgd 	{"kobold", 'K', 1, 6, 7, 1, 4, 0},
7961f28255Scgd 	{"leprechaun", 'L', 5, 15, 8, 1, 2, 0},
8061f28255Scgd 	{"giant rat", 'r', 0, 12, 7, 1, 3, 0},
8161f28255Scgd 	{"acid blob", 'a', 2, 3, 8, 0, 0, 0},
8261f28255Scgd 	{"floating eye", 'E', 2, 1, 9, 0, 0, 0},
8361f28255Scgd 	{"homunculus", 'h', 2, 6, 6, 1, 3, 0},
8461f28255Scgd 	{"imp", 'i', 2, 6, 2, 1, 4, 0},
8561f28255Scgd 	{"orc", 'O', 2, 9, 6, 1, 8, 0},
8661f28255Scgd 	{"yellow light", 'y', 3, 15, 0, 0, 0, 0},
8761f28255Scgd 	{"zombie", 'Z', 2, 6, 8, 1, 8, 0},
8861f28255Scgd 	{"giant ant", 'A', 3, 18, 3, 1, 6, 0},
8961f28255Scgd 	{"fog cloud", 'f', 3, 1, 0, 1, 6, 0},
9061f28255Scgd 	{"nymph", 'N', 6, 12, 9, 1, 2, 0},
9161f28255Scgd 	{"piercer", 'p', 3, 1, 3, 2, 6, 0},
9261f28255Scgd 	{"quasit", 'Q', 3, 15, 3, 1, 4, 0},
9361f28255Scgd 	{"quivering blob", 'q', 3, 1, 8, 1, 8, 0},
9461f28255Scgd 	{"violet fungi", 'v', 3, 1, 7, 1, 4, 0},
9561f28255Scgd 	{"giant beetle", 'b', 4, 6, 4, 3, 4, 0},
9661f28255Scgd 	{"centaur", 'C', 4, 18, 4, 1, 6, 0},
9761f28255Scgd 	{"cockatrice", 'c', 4, 6, 6, 1, 3, 0},
9861f28255Scgd 	{"gelatinous cube", 'g', 4, 6, 8, 2, 4, 0},
9961f28255Scgd 	{"jaguar", 'j', 4, 15, 6, 1, 8, 0},
10061f28255Scgd 	{"killer bee", 'k', 4, 14, 4, 2, 4, 0},
10161f28255Scgd 	{"snake", 'S', 4, 15, 3, 1, 6, 0},
10261f28255Scgd 	{"freezing sphere", 'F', 2, 13, 4, 0, 0, 0},
10361f28255Scgd 	{"owlbear", 'o', 5, 12, 5, 2, 6, 0},
10461f28255Scgd 	{"rust monster", 'R', 10, 18, 3, 0, 0, 0},
10561f28255Scgd 	{"scorpion", 's', 5, 15, 3, 1, 4, 0},
10661f28255Scgd 	{"tengu", 't', 5, 13, 5, 1, 7, 0},
10761f28255Scgd 	{"wraith", 'W', 5, 12, 5, 1, 6, 0},
10861f28255Scgd #ifdef NOWORM
10961f28255Scgd 	{"wumpus", 'w', 8, 3, 2, 3, 6, 0},
11061f28255Scgd #else
11161f28255Scgd 	{"long worm", 'w', 8, 3, 5, 1, 4, 0},
1123ea4a95cSchristos #endif	/* NOWORM */
11361f28255Scgd 	{"large dog", 'd', 6, 15, 4, 2, 4, 0},
11461f28255Scgd 	{"leocrotta", 'l', 6, 18, 4, 3, 6, 0},
11561f28255Scgd 	{"mimic", 'M', 7, 3, 7, 3, 4, 0},
11661f28255Scgd 	{"troll", 'T', 7, 12, 4, 2, 7, 0},
11761f28255Scgd 	{"unicorn", 'u', 8, 24, 5, 1, 10, 0},
11861f28255Scgd 	{"yeti", 'Y', 5, 15, 6, 1, 6, 0},
11961f28255Scgd 	{"stalker", 'I', 8, 12, 3, 4, 4, 0},
12061f28255Scgd 	{"umber hulk", 'U', 9, 6, 2, 2, 10, 0},
12161f28255Scgd 	{"vampire", 'V', 8, 12, 1, 1, 6, 0},
12261f28255Scgd 	{"xorn", 'X', 8, 9, -2, 4, 6, 0},
12361f28255Scgd 	{"xan", 'x', 7, 18, -2, 2, 4, 0},
12461f28255Scgd 	{"zruty", 'z', 9, 8, 3, 3, 6, 0},
12561f28255Scgd 	{"chameleon", ':', 6, 5, 6, 4, 2, 0},
12661f28255Scgd 	{"dragon", 'D', 10, 9, -1, 3, 8, 0},
12761f28255Scgd 	{"ettin", 'e', 10, 12, 3, 2, 8, 0},
12861f28255Scgd 	{"lurker above", '\'', 10, 3, 3, 0, 0, 0},
12961f28255Scgd 	{"nurse", 'n', 11, 6, 0, 1, 3, 0},
13061f28255Scgd 	{"trapper", ',', 12, 3, 3, 0, 0, 0},
13161f28255Scgd 	{"purple worm", 'P', 15, 9, 6, 2, 8, 0},
13261f28255Scgd 	{"demon", '&', 10, 12, -4, 1, 4, 0},
13361f28255Scgd 	{"minotaur", 'm', 15, 15, 6, 4, 10, 0},
13461f28255Scgd 	{"shopkeeper", '@', 12, 18, 0, 4, 8, sizeof(struct eshk)}
13561f28255Scgd };
13661f28255Scgd 
137ab8b6343Sjsm const struct permonst pm_ghost = {"ghost", ' ', 10, 3, -5, 1, 1, sizeof(plname)};
138ab8b6343Sjsm const struct permonst pm_wizard = {
13961f28255Scgd 	"wizard of Yendor", '1', 15, 12, -2, 1, 12, 0
14061f28255Scgd };
14161f28255Scgd #ifdef MAIL
142ab8b6343Sjsm const struct permonst pm_mail_daemon = {"mail daemon", '2', 100, 1, 10, 0, 0, 0};
1433ea4a95cSchristos #endif	/* MAIL */
144ab8b6343Sjsm const struct permonst pm_eel = {"giant eel", ';', 15, 6, -3, 3, 6, 0};
145*72db7ca9Schristos 
146*72db7ca9Schristos void *
monster_private(struct monst * mon)147*72db7ca9Schristos monster_private(struct monst *mon)
148*72db7ca9Schristos {
149*72db7ca9Schristos 	return mon->mextra;
150*72db7ca9Schristos }
151