]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/hack.mkmaze.c
1 /* $NetBSD: hack.mkmaze.c,v 1.5 2001/03/25 20:44:01 jsm Exp $ */
4 * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
9 __RCSID("$NetBSD: hack.mkmaze.c,v 1.5 2001/03/25 20:44:01 jsm Exp $");
14 #include "def.mkroom.h" /* not really used */
15 const struct permonst hell_hound
=
16 {"hell hound", 'd', 12, 14, 2, 3, 6, 0};
24 boolean al
= (dlevel
>= 30 && !flags
.made_amulet
);
26 for (x
= 2; x
< COLNO
- 1; x
++)
27 for (y
= 2; y
< ROWNO
- 1; y
++)
28 levl
[x
][y
].typ
= (x
% 2 && y
% 2) ? 0 : HWALL
;
32 zx
= 2 * (COLNO
/ 4) - 1;
33 zy
= 2 * (ROWNO
/ 4) - 1;
34 for (x
= zx
- 2; x
< zx
+ 4; x
++)
35 for (y
= zy
- 2; y
<= zy
+ 2; y
++) {
37 (y
== zy
- 2 || y
== zy
+ 2 || x
== zx
- 2 || x
== zx
+ 3) ? POOL
:
38 (y
== zy
- 1 || y
== zy
+ 1 || x
== zx
- 1 || x
== zx
+ 2) ? HWALL
:
41 (void) mkobj_at(AMULET_SYM
, zx
, zy
);
42 flags
.made_amulet
= 1;
44 if ((mtmp
= makemon(&hell_hound
, zx
, zy
)) != NULL
)
46 if ((mtmp
= makemon(PM_WIZARD
, zx
+ 1, zy
)) != NULL
) {
48 flags
.no_of_wizards
= 1;
55 (void) mksobj_at(WAN_WISHING
, zx
, zy
);
56 (void) mkobj_at(ROCK_SYM
, zx
, zy
); /* put a rock on top of
60 for (x
= 2; x
< COLNO
- 1; x
++)
61 for (y
= 2; y
< ROWNO
- 1; y
++) {
62 switch (levl
[x
][y
].typ
) {
64 levl
[x
][y
].scrsym
= '-';
67 levl
[x
][y
].scrsym
= '.';
71 for (x
= rn1(8, 11); x
; x
--) {
73 (void) mkobj_at(rn2(2) ? GEM_SYM
: 0, mm
.x
, mm
.y
);
75 for (x
= rn1(10, 2); x
; x
--) {
77 (void) mkobj_at(ROCK_SYM
, mm
.x
, mm
.y
);
80 (void) makemon(PM_MINOTAUR
, mm
.x
, mm
.y
);
81 for (x
= rn1(5, 7); x
; x
--) {
83 (void) makemon((struct permonst
*) 0, mm
.x
, mm
.y
);
85 for (x
= rn1(6, 7); x
; x
--) {
87 mkgold(0L, mm
.x
, mm
.y
);
89 for (x
= rn1(6, 7); x
; x
--)
90 mktrap(0, 1, (struct mkroom
*) 0);
92 levl
[(xupstair
= mm
.x
)][(yupstair
= mm
.y
)].scrsym
= '<';
93 levl
[xupstair
][yupstair
].typ
= STAIRS
;
94 xdnstair
= ydnstair
= 0;
103 levl
[x
][y
].typ
= ROOM
;
106 for (a
= 0; a
< 4; a
++)
113 levl
[x
][y
].typ
= ROOM
;
147 if (x
< 3 || y
< 3 || x
> COLNO
- 3 || y
> ROWNO
- 3 || levl
[x
][y
].typ
!= 0)
157 mm
.x
= 3 + 2 * rn2(COLNO
/ 2 - 2);
158 mm
.y
= 3 + 2 * rn2(ROWNO
/ 2 - 2);