billr@saab.CNA.TEK.COM (Bill Randle) (02/23/90)
Submitted-by: Ted Wisniewski <unhd!psc90!pyr4@uunet.uu.net>
Posting-number: Volume 8, Issue 95
Archive-name: castle/Part03
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 3 (of 4)."
# Contents: FILES/open.scr INCLUDE/monst.h magic.c monster.c
# Wrapped by billr@saab on Thu Feb 22 15:57:03 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'FILES/open.scr' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'FILES/open.scr'\"
else
echo shar: Extracting \"'FILES/open.scr'\" \(1432 characters\)
sed "s/^X//" >'FILES/open.scr' <<'END_OF_FILE'
X
X Welcome To The Wizards Castle
X
X o____
XGame By: |T.W.\ Graphics by:
X |____/
X Ted Wisniewski | Laurrianne Olcott &
X |
X | Ted Wisniewski
X |
X #-_-_-_-_-_-_-_-#
X #-_-_-_-_-# | | #-_-_-_-_-#
X | o o | [ [] 0 [] ] | o o |
X | | | | | |
X | |_-___-___-___-| |-___-___-___-_| |
X | ] [ ] [ |
X | ] o o o [ _______ ] o o o [ | ----_________
X_____----- | ] [ ||||||| ] [ |
X | ] [ ||||||| ] [ |
X _-_-|_____]--------------[_|||||||_]--------------[_____|-_-_
X ( (__________------------_____________-------------_________) )
X (for help: castle -h )
END_OF_FILE
if test 1432 -ne `wc -c <'FILES/open.scr'`; then
echo shar: \"'FILES/open.scr'\" unpacked with wrong size!
fi
# end of 'FILES/open.scr'
fi
if test -f 'INCLUDE/monst.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'INCLUDE/monst.h'\"
else
echo shar: Extracting \"'INCLUDE/monst.h'\" \(17938 characters\)
sed "s/^X//" >'INCLUDE/monst.h' <<'END_OF_FILE'
X
X
X
Xtypedef struct
X{
X char monster[15];
X int m_lvl;
X int ability;
X int m_hp;
X int m_scr;
X}monster;
X
X# define DAM 3 /* Bare Hand Damage */
X# define MAX_MON 60
X# define DEAD -1
X
Xmonster m[MAX_MON];
X
Xmonster m_temp;
Xint damag;
X
Xstatic short mon_scr[25][12][27] = {
X
X /*#0 Wizard or Magician */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,44,45,32,32,32,32,
X 96,32,32,32,32,46,32,32,32,32,39,32,35},
X {35,32,32,32,32,32,32,47,124,32,32,32,32,32,
X 32,32,92,32,32,124,32,32,47,32,32,32,35},
X {35,32,32,32,32,47,42,40,124,32,32,32,32,32,
X 32,96,32,46,92,124,47,46,32,39,32,32,35},
X {35,32,32,32,47,47,32,44,32,95,95,95,32,64,
X 45,45,42,32,32,79,32,45,45,45,45,32,35},
X {35,32,32,32,39,40,40,45,45,45,45,64,124,32,
X 32,46,32,39,47,124,92,96,32,46,32,32,35},
X {35,32,32,32,47,32,32,41,44,32,124,92,124,32,
X 32,32,47,32,32,124,32,32,92,32,32,32,35},
X {35,32,32,47,32,32,32,32,40,92,124,32,32,46,
X 32,32,32,32,32,46,32,32,32,32,32,46,35},
X {35,32,47,32,32,32,32,32,32,32,92,32,32,32,
X 32,32,32,32,32,46,32,32,32,32,32,32,35},
X {35,47,32,32,32,32,32,32,32,32,32,124,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,92,47,92,47,92,47,92,47,92,47,47,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #1 Spider */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,47,45,92,32,32,32,47,45,124,32,
X 124,45,92,32,32,47,47,45,92,32,32,32,35},
X {35,32,92,47,32,32,32,92,32,47,32,32,124,32,
X 124,32,32,92,47,47,32,32,32,92,32,32,35},
X {35,32,47,32,92,32,32,32,47,32,32,32,124,32,
X 124,32,32,47,92,32,32,32,32,32,92,32,35},
X {35,47,32,32,32,32,92,47,32,92,32,32,124,32,
X 124,32,47,47,32,92,32,32,32,32,32,92,35},
X {35,32,32,32,32,32,47,32,92,32,92,32,124,95,
X 124,47,47,32,32,32,92,32,32,32,32,32,35},
X {35,95,95,95,95,47,95,95,95,95,92,92,40,94,
X 41,47,95,95,95,95,95,92,95,95,95,95,35},
X {35,32,32,32,47,32,32,32,32,32,32,47,32,123,
X 125,32,32,32,32,32,32,32,92,32,32,32,35},
X {35,32,32,47,32,32,32,32,32,32,124,32,32,32,
X 32,124,32,32,32,32,32,32,32,92,32,32,35},
X {35,95,47,32,32,32,32,32,32,32,32,92,95,95,
X 47,32,32,32,32,32,32,32,32,32,92,95,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /*#2 Dragon fly or Serpent */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,92,92,92,92,32,32,32,32,32,32,92,32,32,
X 124,32,32,32,47,32,32,32,32,32,47,47,35},
X {35,92,45,45,45,92,32,32,32,32,32,32,92,92,
X 124,47,94,47,32,32,32,32,32,47,32,45,35},
X {35,45,45,45,32,32,32,92,32,32,45,45,45,42,
X 124,32,42,32,45,45,45,32,47,32,32,32,35},
X {35,92,45,45,45,32,32,32,92,32,32,32,47,32,
X 94,32,32,32,92,32,32,47,32,32,32,45,35},
X {35,92,92,45,45,45,32,32,92,32,32,40,79,32,
X 32,79,41,124,32,47,32,32,45,45,45,47,35},
X {35,32,32,92,92,92,45,45,45,32,92,32,47,96,
X 45,45,94,47,32,32,32,45,45,47,47,47,35},
X {35,32,32,32,32,92,92,92,45,45,47,32,32,32,
X 32,47,45,45,32,45,47,47,47,47,32,32,35},
X {35,92,124,124,32,32,32,92,92,124,32,32,32,47,
X 45,47,47,47,47,32,32,32,32,32,32,32,35},
X {35,92,32,124,32,32,32,32,32,124,32,32,32,124,
X 95,95,95,32,32,32,32,32,32,32,32,32,35},
X {35,95,92,124,95,32,32,32,32,47,92,32,32,32,
X 92,32,32,92,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #3 Group of civilians or people */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,64,64,
X 32,96,59,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,60,95,
X 32,32,32,92,32,32,32,32,32,32,32,32,35},
X {35,126,126,44,32,32,32,32,32,32,32,32,32,32,
X 32,47,32,32,92,32,32,32,32,32,32,32,35},
X {35,32,64,64,32,32,32,32,32,32,32,32,32,32,
X 47,32,32,32,32,92,32,32,32,32,44,126,35},
X {35,32,95,62,32,32,32,32,44,126,126,59,32,32,
X 32,32,32,32,32,32,32,32,32,32,64,64,35},
X {35,92,32,32,32,32,32,32,64,64,32,96,59,32,
X 32,59,126,126,44,32,32,32,32,32,60,95,35},
X {35,32,92,59,126,126,44,32,60,95,32,32,92,32,
X 59,39,32,64,64,32,32,44,126,126,59,32,35},
X {35,32,59,39,32,64,64,32,32,32,47,32,32,32,
X 47,32,32,95,62,32,32,64,64,32,96,59,35},
X {35,32,47,32,32,95,62,32,32,47,32,32,32,47,
X 32,32,92,32,32,32,32,60,95,32,32,92,35},
X {35,47,32,32,92,32,32,32,32,32,32,32,47,32,
X 32,32,32,92,32,32,32,32,32,47,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /*#4 warrior */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,124,32,32,32,
X 32,32,124,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,124,92,95,33,
X 95,47,124,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,92,47,95,32,
X 95,92,47,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,47,92,32,95,
X 32,47,92,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,44,42,32,42,32,42,46,92,95,
X 47,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,42,39,32,32,32,32,32,32,32,96,42,
X 32,92,95,95,95,32,32,32,32,32,32,32,35},
X {35,32,42,32,32,32,32,32,118,32,32,32,32,32,
X 42,32,32,32,32,92,32,32,32,32,32,32,35},
X {35,32,42,32,32,32,32,62,42,60,32,32,32,32,
X 42,37,32,33,32,124,32,32,32,32,32,32,35},
X {35,32,32,42,32,32,32,32,94,32,32,32,32,42,
X 32,32,32,124,32,124,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #5 priest */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,45,124,45,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,47,32,92,
X 32,32,32,32,32,32,32,46,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,47,45,124,45,
X 92,32,32,96,32,32,32,32,32,32,32,39,35},
X {35,32,32,32,32,32,32,32,32,40,95,95,118,95,
X 95,41,32,32,32,92,32,124,32,47,32,32,35},
X {35,32,32,32,32,32,32,32,32,123,32,64,32,64,
X 41,32,32,42,32,45,40,43,41,45,32,42,35},
X {35,32,32,32,32,32,32,32,33,47,32,32,45,32,
X 92,32,32,32,32,47,32,124,32,92,32,32,35},
X {35,32,32,32,32,32,32,40,42,41,32,32,32,32,
X 32,92,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,124,47,47,32,32,32,
X 32,124,32,39,32,32,32,46,32,32,32,96,35},
X {35,32,32,32,32,32,32,47,45,32,32,32,32,118,
X 92,47,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,47,32,32,32,32,32,32,32,
X 124,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /*#6 Headhunter or Cannibal */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,92,92,92,124,124,
X 124,47,47,47,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,46,32,32,61,61,61,61,
X 61,61,61,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,47,94,92,124,32,79,32,124,
X 32,79,32,124,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,92,32,47,32,92,32,95,95,
X 95,32,47,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,35,32,32,32,95,124,32,
X 124,95,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,40,35,41,32,40,32,32,32,
X 32,32,41,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,35,92,47,47,124,42,32,
X 42,124,92,92,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,35,92,47,40,32,32,42,
X 32,32,41,47,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,35,32,32,32,61,61,61,
X 61,61,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,35,32,32,32,40,32,94,
X 32,41,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X /* #7 Sphinx or Demon */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,41,32,32,32,40,32,32,
X 32,32,32,32,32,32,32,96,32,32,96,40,35},
X {35,32,32,32,32,32,32,124,92,124,47,124,32,32,
X 32,32,32,32,32,32,32,32,96,32,41,96,35},
X {35,32,32,32,32,32,123,96,64,32,64,39,125,32,
X 32,32,32,32,32,32,32,96,32,41,95,96,35},
X {35,32,95,95,32,32,32,40,47,94,92,41,32,32,
X 32,32,32,32,32,32,32,32,32,32,92,95,35},
X {35,40,40,40,92,32,32,124,96,45,39,124,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,64,35},
X {35,32,32,92,32,92,47,56,45,56,45,56,92,32,
X 32,32,95,95,32,32,32,32,32,32,32,96,35},
X {35,32,32,32,92,124,32,96,96,44,39,39,44,32,
X 92,47,32,32,92,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,124,124,32,32,32,32,32,124,47,
X 92,32,92,32,32,92,32,32,32,32,32,32,35},
X {35,32,32,32,32,124,124,92,32,44,32,47,45,45,
X 45,45,41,41,41,92,92,45,45,45,45,45,35},
X {35,32,32,32,40,40,40,124,95,95,95,95,124,32,
X 32,32,32,32,32,32,41,41,41,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #8 Cloud Beast */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,44,44,32,44,32,32,32,32,35},
X {35,32,32,32,32,32,44,44,96,44,44,32,44,96,
X 44,32,44,96,32,39,96,44,32,32,32,32,35},
X {35,32,32,32,44,96,32,64,64,32,32,96,64,64,
X 32,96,39,64,64,32,39,44,96,32,32,32,35},
X {35,32,44,96,39,111,111,96,39,46,32,32,96,39,
X 32,46,32,96,39,32,39,44,96,32,32,32,35},
X {35,96,96,39,32,96,39,32,32,32,32,39,46,32,
X 32,64,64,32,39,39,44,96,32,32,32,32,35},
X {35,32,64,64,46,32,46,32,64,64,32,32,32,32,
X 46,96,39,39,44,96,96,32,32,32,32,32,35},
X {35,32,96,39,32,64,64,32,96,39,32,39,64,64,
X 32,44,44,96,32,32,32,32,32,32,32,32,35},
X {35,32,46,32,32,96,39,39,46,39,32,44,96,39,
X 96,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,64,64,32,39,32,46,44,44,44,96,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,96,96,96,96,96,96,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #9 Devilish Character */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,96,32,32,32,32,40,32,32,32,41,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,123,32,32,32,32,40,32,96,32,47,32,
X 41,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,123,125,32,32,32,44,40,64,32,64,41,
X 96,44,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,40,40,41,41,32,32,96,123,123,45,125,125,
X 96,125,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,92,92,32,32,40,45,123,123,123,125,
X 45,41,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,92,92,47,47,32,123,123,125,32,
X 32,92,92,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,92,92,47,32,32,123,41,32,
X 32,92,47,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,92,92,32,32,125,32,32,
X 32,32,124,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,124,92,92,32,32,32,32,
X 32,32,124,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* # 10 Robot */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,40,92,47,41,32,32,32,32,32,32,118,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,40,41,32,32,32,40,32,32,40,32,41,32,
X 32,41,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,40,41,32,32,124,92,40,32,32,32,41,
X 47,124,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,40,41,32,96,40,32,42,32,42,32,
X 41,39,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,40,41,32,62,32,32,118,32,32,
X 60,32,32,32,32,32,32,47,92,32,32,32,35},
X {35,32,32,32,32,32,40,40,32,32,40,45,41,32,
X 32,41,41,41,41,41,41,32,32,41,32,32,35},
X {35,32,32,32,32,32,32,40,95,32,32,32,32,32,
X 95,41,32,32,32,32,32,92,47,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,40,32,94,32,41,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,40,95,124,95,41,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #11 Griffon */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,41,41,32,32,32,32,32,32,92,92,32,32,32,
X 32,32,32,94,92,41,41,47,94,32,32,32,35},
X {35,41,41,41,41,32,32,32,32,92,92,92,92,32,
X 32,40,47,32,32,68,32,95,68,32,32,32,35},
X {35,41,41,41,41,32,32,95,95,92,92,92,32,92,
X 40,47,32,32,32,32,41,41,41,41,32,32,35},
X {35,41,124,41,39,46,39,32,44,32,92,92,92,32,
X 92,32,32,32,32,92,41,45,39,41,32,32,35},
X {35,32,41,92,39,32,32,32,32,96,32,32,32,92,
X 32,39,32,32,32,124,92,95,32,32,32,32,35},
X {35,32,32,32,124,95,95,95,95,41,41,41,32,32,
X 32,124,95,95,95,95,95,95,41,41,41,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #12 Druid */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,47,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,47,124,
X 32,32,32,32,32,32,39,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,47,32,124,
X 46,32,96,32,46,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,47,40,42,124,
X 32,92,124,47,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,61,61,61,61,61,61,
X 45,45,64,45,45,32,45,32,32,45,32,32,35},
X {35,32,32,32,32,32,32,32,123,64,34,64,96,125,
X 32,47,124,92,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,44,39,45,96,41,96,
X 39,32,36,32,96,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,47,40,32,96,32,39,
X 92,32,36,32,32,32,96,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,47,32,32,41,41,32,32,
X 32,92,36,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,124,32,124,32,32,32,32,32,
X 32,40,36,41,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* #13 Wizard #2 */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,47,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,47,124,
X 32,32,32,32,32,32,39,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,47,32,124,
X 46,32,96,32,46,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,47,40,42,124,
X 32,92,124,47,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,61,61,61,61,61,61,
X 45,45,64,45,45,32,45,32,32,45,32,32,35},
X {35,32,32,32,32,32,32,32,123,64,34,64,96,125,
X 32,47,124,92,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,44,39,45,96,41,96,
X 39,32,36,32,96,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,47,40,32,96,32,39,
X 92,32,36,32,32,32,96,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,47,32,32,41,41,32,32,
X 32,92,36,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,124,32,124,32,32,32,32,32,
X 32,40,36,41,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X
X /* # 14 Fighter */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,92,
X 47,94,92,47,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,33,124,
X 95,118,95,124,33,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,124,
X 111,32,111,124,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,40,
X 39,95,96,41,32,32,32,32,32,32,32,32,35},
X {35,32,32,92,124,47,32,32,32,32,32,95,95,95,
X 47,32,92,95,95,95,32,32,32,32,32,32,35},
X {35,45,45,45,42,45,45,123,40,92,32,124,32,32,
X 95,32,95,32,32,124,32,32,32,32,32,32,35},
X {35,32,32,47,124,92,32,32,32,92,92,124,124,92,
X 86,32,86,47,124,124,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,92,95,124,32,
X 124,32,124,32,124,124,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,47,61,45,45,45,45,45,
X 124,32,124,32,92,47,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,47,32,32,95,95,95,95,46,
X 44,32,32,92,32,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X },
X /* #15 Dragon */
X {
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,32,32,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,32,32,32,32,32,32,44,124,
X 32,32,32,32,32,32,32,32,32,32,32,32,35},
X {35,32,32,32,92,92,32,32,32,32,32,32,124,32,
X 92,32,32,32,32,32,47,32,32,32,32,32,35},
X {35,32,32,32,92,32,92,32,32,32,46,32,32,92,
X 32,46,92,32,32,47,47,32,32,32,32,32,35},
X {35,32,32,32,92,32,32,32,92,40,64,96,34,39,
X 39,64,41,47,32,32,47,32,32,32,32,32,35},
X {35,32,32,32,32,92,32,32,44,96,46,32,96,45,
X 45,39,47,32,32,47,32,32,32,32,32,32,35},
X {35,32,32,32,32,32,92,39,32,32,96,44,40,41,
X 40,41,32,47,32,124,32,32,32,32,32,32,35},
X {35,32,32,32,44,39,32,32,32,32,32,32,34,32,
X 34,92,47,32,32,124,32,32,32,32,32,32,35},
X {35,32,32,32,124,32,32,32,32,32,32,32,32,32,
X 32,32,124,32,47,32,32,32,32,32,32,32,35},
X {35,32,32,40,40,40,32,95,95,95,95,95,95,95,
X 95,47,41,41,41,32,32,32,32,32,32,32,35},
X {35,35,35,35,35,35,35,35,35,35,35,35,35,35,
X 35,35,35,35,35,35,35,35,35,35,35,35,35}
X }
X};
END_OF_FILE
if test 17938 -ne `wc -c <'INCLUDE/monst.h'`; then
echo shar: \"'INCLUDE/monst.h'\" unpacked with wrong size!
fi
# end of 'INCLUDE/monst.h'
fi
if test -f 'magic.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'magic.c'\"
else
echo shar: Extracting \"'magic.c'\" \(13322 characters\)
sed "s/^X//" >'magic.c' <<'END_OF_FILE'
X# include <curses.h>
X# include "INCLUDE/windows.h"
X# include "INCLUDE/castle.h"
X# include "INCLUDE/monst.h"
X/*
X+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X+ +
X+ Routines in this Module: +
X+ +
X+ spells() - Determines the spell chosen and executes it. +
X+ compass() - Creates a magic compass for the player to tell +
X+ which direction he faces. +
X+ spell_counts() - Keeps a running total of the number of moves made +
X+ since the spell was invoked, to determine when it +
X+ should end. +
X+ detect_trap() - Notifies the player if a trap is ahead of him. +
X+ Must be cast by the player. +
X+ fing_fire() - Does damage to a monster that is opposing the player. +
X+ shock_em() - Does shock damage to an opposing monster. +
X+ exp_spell() - Give spell descriptions to the player upon request. +
X+ print_mess() - Prints messages to the player via the message window. +
X+ +
X+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X
X This is a public domain program, I have no objection to modifications
Xmade on it or use for some other reason so long as this notice remains intact.
X
X
X Part of: castle Ted Wisniewski
X Author: Plymouth State College
X Plymouth NH,
X 03264
X Copyright() PSC
X*/
X
Xspells()
X{
X unsigned char spell;
X int row,col,level;
X int temp;
X
X wmove(message_win,0,0);
X print_mess("Cast which spell (a-k). ",0,0);
X wrefresh(message_win);
X spell = getch();
X wclear(message_win);
X wrefresh(message_win);
X switch (spell) {
X case 'a' : /* Spell choice "a" tell where you are. */
X if(char_stats.spellpoints > 0){
X sprintf(buffer,"Dungeon Coordinates are :");
X print_mess(buffer,0,0);
X sprintf(buffer,"row: %d ",p->row);
X print_mess(buffer,1,0);
X sprintf(buffer,"col: %d ",p->col);
X print_mess(buffer,2,0);
X sprintf(buffer,"level: %d ",p->level);
X print_mess(buffer,3,0);
X sprintf(buffer,"Hit any Key to Continue.");
X print_mess(buffer,4,0);
X char_stats.spellpoints--;
X print_stats();
X print_mess("",4,25);
X wrefresh(message_win);
X wgetch(message_win);
X }
X else{
X clr_mess_win();
X wmove(message_win,0,0);
X waddstr(message_win,"Not Enough Spellpoints. ");
X }
X break;
X
X case 'b': /* Turn on the compass. */
X if(char_stats.spellpoints > 1){
X char_stats.spellpoints -= 2;
X print_stats();
X clr_mess_win();
X ct_compass = 100;
X compass();
X p->compass_on = TRUE;
X }
X else{
X clr_mess_win();
X sprintf(buffer,"Not Enough Spellpoints.");
X print_mess(buffer,0,0);
X p->compass_on = FALSE;
X }
X break;
X case 'c': /* teleport player. */
X if(!known[2])
X print_mess("You do not know that spell.",0,0);
X else
X if(char_stats.spellpoints > 2){
X teleport();
X char_stats.spellpoints -= 3;
X print_stats();
X }else{
X clr_mess_win();
X print_mess("Not Enough Spellpoints.",0,0);
X }
X break;
X case 'd': /* Cure some minor damage. */
X if(!known[3])
X print_mess("You do not know that spell.",0,0);
X else
X if(char_stats.spellpoints < 2 ){
X clr_mess_win();
X print_mess("Not Enough Spellpoints.",0,0);
X }
X else{
X clr_mess_win();
X char_stats.spellpoints -= 2;
X print_mess("You feel Better.",0,0);
X if(char_stats.hitpoints + 5 >= char_stats.max_hp){
X char_stats.hitpoints = char_stats.max_hp;
X print_stats();
X }
X else{
X char_stats.hitpoints += 5;
X print_stats();
X }
X }
X wrefresh(message_win);
X break;
X case 'e': /* detect traps on */
X if(!known[4])
X print_mess("You do not know that spell.",0,0);
X else
X if(char_stats.spellpoints < 2 ){
X clr_mess_win();
X print_mess("Not Enough Spellpoints.",0,0);
X }else{
X detect_trap();
X char_stats.spellpoints -= 2;
X print_stats();
X ct_dtrap = 100;
X detect = ON;
X }
X break;
X case 'f': /* hit monster with finger fire */
X if(!known[5])
X print_mess("You do not know that spell.",0,0);
X else
X if(char_stats.spellpoints < 3){
X clr_mess_win();
X print_mess("Not Enough Spellpoints.",0,0);
X }else{
X if(mon_faced)
X fing_fire();
X else
X print_mess("Oops No Monster",0,0);
X char_stats.spellpoints -= 2;
X }
X print_stats();
X break;
X case 'g': if(!known[6])
X print_mess("You Do not Know that Spell.",0,0);
X else
X shock_em(); /* Give the monster a shock */
X break;
X case 'h':
X if(char_stats.spellpoints >= 4 && known[7])
X med_heal();
X else{
X if(!known[8])
X print_mess("You Do not Know that Spell.",0,0);
X else
X print_mess("Not Enough Spellpoints.",0,0);
X }
X break;
X case 'i':
X if(char_stats.spellpoints >= 6 && known[10]){
X switch(p->face){
X case 0: if(p->row != 1)
X p->row--;
X break;
X case 1: if(p->col != 72)
X p->col++;
X break;
X case 2: if(p->row != 22)
X p->row++;
X break;
X case 3: if(p->col != 1)
X p->col--;
X break;
X }
X char_stats.spellpoints -= 6;
X print_stats();
X showit = TRUE;
X }else{
X if(!known[1])
X print_mess("You do not know this spell.",0,0);
X else
X print_mess("Not Enough spellpoints.",0,0);
X wrefresh(message_win);
X }
X break;
X case 'j':
X if(char_stats.spellpoints >= 8 && known[14]){
X if(rand()%100 < (70 + char_stats.level)){
X char_stats.spellpoints -= 8;
X flame();
X print_stats();
X }else{
X print_mess("The Spell Failed.",0,0);
X wrefresh(message_win);
X char_stats.spellpoints -= 4;
X print_stats();
X }
X }
X break;
X case 'k':
X if(char_stats.spellpoints >= 11 && known[16]){
X if(rand()%100 < (70 + char_stats.strength)){
X char_stats.spellpoints -= 11;
X char_stats.hitpoints = char_stats.max_hp;
X print_mess("YOU FEEL GREAT!!",0,0);
X wrefresh(message_win);
X char_stats.spellpoints -= 11;
X print_stats();
X }else{
X print_mess("Your spell did not work.",0,0);
X wrefresh(message_win);
X char_stats.spellpoints -= 6;
X print_stats();
X }
X }
X break;
X
X default:
X clr_mess_win();
X sprintf(buffer,"Selection not found.");
X print_mess(buffer,0,0);
X }
X wrefresh(message_win);
X sleep(1);
X clr_mess_win();
X}
X
Xcompass()
X{
X wmove(compass_win,0,0);
X wprintw(compass_win,"#########");
X wmove(compass_win,1,0);
X wprintw(compass_win,"# N #");
X wmove(compass_win,2,0);
X wprintw(compass_win,"# #");
X wmove(compass_win,3,0);
X wprintw(compass_win,"# #");
X wmove(compass_win,4,0);
X wprintw(compass_win,"#W + E#");
X wmove(compass_win,5,0);
X wprintw(compass_win,"# #");
X wmove(compass_win,6,0);
X wprintw(compass_win,"# #");
X wmove(compass_win,7,0);
X wprintw(compass_win,"# S #");
X wmove(compass_win,8,0);
X wprintw(compass_win,"#########");
X
X switch (p->face) {
X case NORTH:
X wmove(compass_win,2,4);
X waddch(compass_win,'^');
X wmove(compass_win,3,4);
X waddch(compass_win,'|');
X break;
X case EAST:
X wmove(compass_win,4,5);
X waddch(compass_win,'-');
X wmove(compass_win,4,6);
X waddch(compass_win,'>');
X break;
X case SOUTH:
X wmove(compass_win,5,4);
X waddch(compass_win,'|');
X wmove(compass_win,6,4);
X waddch(compass_win,'v');
X break;
X case WEST:
X wmove(compass_win,4,3);
X waddch(compass_win,'-');
X wmove(compass_win,4,2);
X waddch(compass_win,'<');
X break;
X }
X wrefresh(compass_win);
X}
X
Xmed_heal()
X{
X int temp;
X
X temp = ((rand()%5)+1)+11;
X if((char_stats.hitpoints += temp) >= char_stats.max_hp)
X char_stats.hitpoints = char_stats.max_hp;
X print_stats();
X print_mess("You feel Much better.",0,0);
X}
X
Xteleport()
X{
X int row,col;
X clr_mess_win();
X sprintf(buffer,"Teleport to: ");
X print_mess(buffer,0,0);
X sprintf(buffer,"row : ");
X print_mess(buffer,1,0);
X wrefresh(message_win);
X row = getint(1,7);
X sprintf(buffer,"col : ");
X print_mess(buffer,2,0);
X wrefresh(message_win);
X col = getint(2,7);
X wrefresh(message_win);
X if((row < 1) || (col < 1) || (row > 22) || (col > 72)){
X print_mess("Cannot teleport here.",4,0);
X wrefresh(message_win);
X }else
X if(levels[p->level][row][col] == WALL){
X clr_mess_win();
X wrefresh(message_win);
X print_mess("Spell failed.",0,0);
X }else{
X p->row = row;
X p->col = col;
X showit = TRUE;
X run_away = TRUE;
X }
X}
X
Xflame()
X{
X if(mon_faced){
X damag = 15 + make_dam(5,4);
X m_temp.m_hp -= damag;
X sprintf(buffer,"You Toasted him for %d points",damag);
X print_mess(buffer,2,0);
X print_mess("of damage.",3,0);
X wrefresh(message_win);
X }else{
X print_mess("Oops, You are not facing a monster.");
X wrefresh(message_win);
X }
X}
X
Xspell_counts()
X{
X if(ct_compass == 1){
X wclear(compass_win);
X wrefresh(compass_win);
X ct_compass = 0;
X p->compass_on = FALSE;
X }
X else
X ct_compass--;
X
X if(ct_dtrap == 1){
X ct_dtrap = 0;
X detect = OFF;
X }
X else
X ct_dtrap--;
X}
X
Xdetect_trap()
X{
X int row,col;
X
X row = p->row;
X col = p->col;
X switch (p->face){
X case NORTH:
X row--;
X break;
X case EAST :
X col++;
X break;
X case SOUTH:
X row++;
X break;
X case WEST :
X col--;
X break;
X }
X if(levels[p->level][row][col] == TRAP){
X print_mess("Trap Ahead, Beware.",0,0);
X beep();
X }
X if(levels[p->level][row][col] == T_DOOR){
X print_mess("Trap Door Ahead, Beware.",0,0);
X beep();
X }
X if(levels[p->level][row][col] == SPIN)
X print_mess("Spinner Ahead.",0,0);
X if(levels[p->level][row][col] == H_DRAIN)
X print_mess("Something Ahead.",0,0);
X
X wrefresh(message_win);
X}
X
Xfing_fire()
X{
X int damag;
X
X m_temp.m_hp -= damag = (1 * char_stats.level);
X wclear(message_win);
X wrefresh(message_win);
X sprintf(buffer,"He is Fried for %d points.",damag);
X print_mess(buffer,0,0);
X wrefresh(message_win);
X sleep(1);
X}
X
Xshock_em()
X{
X if(char_stats.spellpoints < 5 && mon_faced){
X wclear(message_win);
X print_mess("Not Enough Spellpoints.",0,0);
X }else{
X if(rand()%100 < (75 + char_stats.intelligence)){
X damag = ((rand()%5)+1)+((rand()%5)+1)+((rand()%5)+1)+((rand()%5)+1);
X m_temp.m_hp -= damag;
X char_stats.spellpoints -= 5;
X print_stats();
X wclear(message_win);
X wrefresh(message_win);
X sprintf(buffer,"He is Shocked for %d points.",damag);
X print_mess(buffer,0,0);
X wrefresh(message_win);
X }else{
X print_mess("The Spell Fizzled.",0,0);
X char_stats.spellpoints -= 3;
X print_stats();
X }
X }
X sleep(1);
X}
X
X
Xexp_spell()
X{
X char spell;
X
X wclear(message_win);
X print_mess("Lookup which spell? (a-k) ",1,0);
X wmove(message_win,1,27);
X wrefresh(message_win);
X spell = wgetch(message_win);
X switch(spell){
X case 'a': print_mess("Detect Location : display",2,0);
X print_mess("current dungeon coordinates.",3,0);
X print_mess("Cost is 1 point.",4,0);
X break;
X case 'b': print_mess("Compass : display a magical",2,0);
X print_mess("compass, with limited duration.",3,0);
X print_mess("Cost is 2 points.",4,0);
X break;
X case 'c': print_mess("Teleport self : Move yourself to",2,0);
X print_mess("a new dungeon location. Fails if",3,0);
X print_mess("you try to teleport into a wall.",4,0);
X print_mess("Cost is 3 points.",5,0);
X break;
X case 'd': print_mess("Cure Light Wounds : Heal for",2,0);
X print_mess("Exactly 5 hipoints.",3,0);
X print_mess("Cost is 3 points.",4,0);
X break;
X case 'e': print_mess("Detect : Warns you if something",2,0);
X print_mess("harmful or strange is near",3,0);
X print_mess("Cost is 3 points.",4,0);
X break;
X case 'f': print_mess("Finger fire : Does 1 hitpoint",2,0);
X print_mess("times the casters level in damage",3,0);
X print_mess("to a creature if successful.",4,0);
X print_mess("Cost is 2 points.",5,0);
X break;
X case 'g': print_mess("Shocker : Does 4-20 points of",2,0);
X print_mess("damage to a creature if successful.",3,0);
X print_mess("Cost is 5 points.",4,0);
X break;
X case 'h': print_mess("Cure Medium : Restore 10-15 hitpoints",2,0);
X print_mess("of damage, cost is 4 points.",3,0);
X break;
X case 'i': print_mess("Tunnel: Move through a wall in the ",2,0);
X print_mess("direction you are facing.",3,0);
X print_mess("Cost is 6 points. 10th level spell.",4,0);
X break;
X case 'j': print_mess("Flame: Does 15-35 points of",2,0);
X print_mess("flame damage to a creature if",3,0);
X print_mess("successful. Cost is 8 points.",4,0);
X print_mess("14th level spell.",5,0);
X break;
X case 'k': print_mess("Restore: Heals you to max hitpoints.",2,0);
X print_mess("Cost is 11 points. 16th level spell.",3,0);
X break;
X default: break;
X }
X print_mess("Hit a key to continue. ",6,0);
X wrefresh(message_win);
X wgetch(message_win);
X wclear(message_win);
X wrefresh(message_win);
X}
X
Xprint_mess(ary,y,x)
Xchar *ary;
Xint y,x;
X{
X wmove(message_win,y,x);
X wprintw(message_win,"%s",ary);
X}
END_OF_FILE
if test 13322 -ne `wc -c <'magic.c'`; then
echo shar: \"'magic.c'\" unpacked with wrong size!
fi
# end of 'magic.c'
fi
if test -f 'monster.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'monster.c'\"
else
echo shar: Extracting \"'monster.c'\" \(18840 characters\)
sed "s/^X//" >'monster.c' <<'END_OF_FILE'
X
X
X/* This file contains all routines concerning monsters */
X
X# include <stdio.h>
X# include <curses.h>
X
X# include "INCLUDE/windows.h"
X# include "INCLUDE/monst.h"
X# include "INCLUDE/items.h"
X# include "INCLUDE/castle.h"
X/*
X+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X+ Routines in this Module: +
X+ +
X+ combat() - All combat operations run from here. +
X+ show_monst(mon) - Show the appropriate picture for mon. +
X+ monst() - Set up monster configurations. +
X+ make_dam(R,M) - Calculate damages R = rand_max, M = Multplier +
X+ get_monst() - Choose an appropriate monster for this level. +
X+ monst_att(mon) - Run monster attack routine. +
X+ abil_one(mon) - Have monster hit you for damage. +
X+ abil_two(mon) - Monster drains your strength. +
X+ abil_three(mon) - Monster fries you. +
X+ abil_four(mon) - The monster blasts you with an electric sphere. +
X+ abil_five(mon) - The Creature drains your hitpoints. +
X+ abil_six(mon) - The Creature chokes you for damage. +
X+ abil_seven(mon) - The Creature burns you for damage. +
X+ abil_eight(mon) - The Creature Breaths fire breath at you. +
X+ abil_nine(mon) - The Creature Causes you to gasp for air. +
X+ abil_ten(mon) - The Creature is capable of many of the above. +
X+ abil_twelve(mon)- Does a big hit, not like abil_one which depends +
X+ on monster level. +
X+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
X
X This is a public domain program, I have no objection to modifications
Xmade on it or use for some other reason so long as this notice remains intact.
X
X
X Part of: castle Ted Wisniewski
X Author: Plymouth State College
X Plymouth NH,
X 03264
X Copyright() PSC
X*/
Xcombat()
X{
X int mon,hit,Au,test;
X int run_att = FALSE;
X char get;
X
X run_away = FALSE;
X mon = get_monst(); /* Make more monsters so get_monst */
X m_killed = FALSE; /* can be used. */
X mon_faced = TRUE;
X if(mon == WIN_CRE)
X run_att = TRUE;
X m_temp.m_hp = m[mon].m_hp;
X show_monst(mon);
X clr_mess_win();
X sprintf(buffer,"You face a %s.",m[mon].monster);
X print_mess(buffer,0,0);
X wrefresh(message_win);
X while(!m_killed && !run_away){
X print_mess("F)ight R)un D)efend C)ast U)se L)ookup ",1,0);
X wrefresh(message_win);
X get = wgetch(message_win);
X wmove(message_win,2,0);
X switch (get){
X case 'f' :
X case 'F' : test = (35 + char_stats.dexterity);
X wclear(message_win);
X if(rand()%50 < test){
X m_temp.m_hp -= hit = make_dam(d_val,d_mod);
X wclear(message_win);
X sprintf(buffer,"You did %d points of damage.",hit);
X print_mess(buffer,2,0);
X }else
X print_mess("You Missed Him.",2,0);
X wrefresh(message_win);
X sleep(1);
X if(m_temp.m_hp > DEAD)
X monst_att(mon);
X break;
X case 'c' :
X case 'C' : spells();
X if(!run_away)
X if(m_temp.m_hp > DEAD)
X monst_att(mon);
X break;
X case 'r' :
X case 'R' : if(!run_att)
X if(rand()%18 + 3 < char_stats.dexterity)
X run_away = TRUE;
X else{
X run_att = TRUE;
X print_mess("You can\'t get away!",2,0);
X wrefresh(message_win);
X }
X break;
X case 'l' :
X case 'L' :
X exp_spell();
X break;
X case 'u' :
X case 'U' :
X use_it();
X break;
X case 'd' :
X case 'D' : if(m_temp.m_hp > DEAD){
X char_stats.ac += 4;
X monst_att(mon);
X char_stats.ac -= 4;
X }
X break;
X case RE_DRAW:
X redraw();
X show_monst(mon);
X break;
X default :
X break;
X }
X if(m_temp.m_hp < 0)
X m_killed = TRUE;
X if(char_stats.hitpoints < 0){
X strcpy(tmp.death_by,m[mon].monster);
X death();
X }
X }
X mon_faced = FALSE;
X if(m_killed){
X wclear(message_win);
X sprintf(buffer,"You killed a %s. ",m[mon].monster);
X print_mess(buffer,1,0);
X if(mon == WIN_CRE){
X char_stats.experience += 50000;
X strcpy(tmp.death_by,"Old Age");
X death();
X }
X if(mon == 0)
X mon = 1;
X char_stats.gold += Au = 10 * (rand()%mon + 1);
X sprintf(buffer,"You find %d in Gold. ",Au);
X print_mess(buffer,2,0);
X char_stats.experience += m[mon].m_hp;
X gain_lvl();
X print_stats();
X wrefresh(message_win);
X sleep(1);
X }
X wrefresh(message_win);
X clr_mess_win();
X show_scr();
X}
X
Xshow_monst(m_num)
Xint m_num;
X{
X int row,col;
X
X wmove(view_win,0,0);
X for(row=0;row<=11;row++)
X for(col=0;col<=26;col++)
X wprintw(view_win,"%c",mon_scr[m[m_num].m_scr][row][col]);
X wrefresh(view_win);
X wmove(command_win,0,0);
X wrefresh(command_win);
X}
X
Xmonst()
X{
X /* First Level Monsters */
X
X strcpy(m[0].monster,"Horde");
X m[0].m_lvl = 1; m[0].ability = 1; m[0].m_hp = 2; m[0].m_scr = 3;
X
X strcpy(m[1].monster,"Conjurer 1st");
X m[1].m_lvl = 1; m[1].ability = 1; m[1].m_hp = 4; m[1].m_scr = 0;
X
X strcpy(m[2].monster,"Spider");
X m[2].m_lvl = 1; m[2].ability = 2; m[2].m_hp = 3; m[2].m_scr = 1;
X
X strcpy(m[3].monster,"Magician 1st");
X m[3].m_lvl = 1; m[3].ability = 3; m[3].m_hp = 6; m[3].m_scr = 0;
X
X strcpy(m[4].monster,"Warrior 1st");
X m[4].m_lvl = 1; m[4].ability = 1; m[4].m_hp = 8; m[4].m_scr = 4;
X
X strcpy(m[5].monster,"Priest 1st");
X m[5].m_lvl = 1; m[5].ability = 5; m[5].m_hp = 5; m[5].m_scr = 5;
X
X strcpy(m[6].monster,"Flying Serpent");
X m[6].m_lvl = 1; m[6].ability = 6; m[6].m_hp = 7; m[6].m_scr = 2;
X
X /* Second Level Monsters */
X
X strcpy(m[7].monster,"Cannibal");
X m[7].m_lvl = 2; m[7].ability = 1; m[7].m_hp = 7; m[7].m_scr = 6;
X
X strcpy(m[8].monster,"Illusionist");
X m[8].m_lvl = 2; m[8].ability = 3; m[8].m_hp = 11; m[8].m_scr = 0;
X
X strcpy(m[9].monster,"Priest 2nd");
X m[9].m_lvl = 2; m[9].ability = 5; m[9].m_hp = 12; m[9].m_scr = 5;
X
X strcpy(m[10].monster,"Warrior 2nd");
X m[10].m_lvl = 2; m[10].ability = 1; m[10].m_hp = 13; m[10].m_scr = 4;
X
X strcpy(m[11].monster,"Stinger");
X m[11].m_lvl = 2; m[11].ability = 2; m[11].m_hp = 6; m[11].m_scr = 1;
X
X /* Level 3 monsters */
X
X strcpy(m[12].monster,"Mage 1st");
X m[12].m_lvl = 3; m[12].ability = 3; m[12].m_hp = 17; m[12].m_scr = 0;
X
X strcpy(m[13].monster,"Fire Lion");
X m[13].m_lvl = 3; m[13].ability = 7; m[13].m_hp = 21; m[13].m_scr = 7;
X
X strcpy(m[14].monster,"Swordsman");
X m[14].m_lvl = 3; m[14].ability = 1; m[14].m_hp = 19; m[14].m_scr = 14;
X
X strcpy(m[15].monster,"Brother 1st");
X m[15].m_lvl = 3; m[15].ability = 5; m[15].m_hp = 18; m[15].m_scr = 5;
X
X strcpy(m[16].monster,"Head Banger");
X m[16].m_lvl = 3; m[16].ability = 1; m[16].m_hp = 15; m[16].m_scr = 6;
X
X /* Level 4 monsters */
X
X strcpy(m[17].monster,"Vapor Cloud");
X m[17].m_lvl = 4; m[17].ability = 9; m[17].m_hp = 18; m[17].m_scr = 8;
X
X strcpy(m[18].monster,"Minor Demon");
X m[18].m_lvl = 4; m[18].ability = 8; m[18].m_hp = 22; m[18].m_scr = 9;
X
X strcpy(m[19].monster,"Killer Robot");
X m[19].m_lvl = 4; m[19].ability = 1; m[19].m_hp = 18; m[19].m_scr = 10;
X
X strcpy(m[20].monster,"Griffon");
X m[20].m_lvl = 4; m[20].ability = 1; m[20].m_hp = 20; m[20].m_scr = 11;
X
X /* Level 5 monsters */
X
X strcpy(m[21].monster,"Electric Knight");
X m[21].m_lvl = 5; m[21].ability = 4; m[21].m_hp = 21; m[21].m_scr = 14;
X
X strcpy(m[22].monster,"Red Dragon Fly");
X m[22].m_lvl = 5; m[22].ability = 7; m[22].m_hp = 16; m[22].m_scr = 2;
X
X strcpy(m[23].monster,"Druid ");
X m[23].m_lvl = 5; m[23].ability = 4; m[23].m_hp = 19; m[23].m_scr = 12;
X
X strcpy(m[24].monster,"Master Mage");
X m[24].m_lvl = 5; m[24].ability = 3; m[24].m_hp = 26; m[24].m_scr = 13;
X
X strcpy(m[25].monster,"Wizard");
X m[25].m_lvl = 5; m[25].ability = 10; m[25].m_hp = 34; m[25].m_scr = 13;
X
X strcpy(m[26].monster,"Phantom");
X m[26].m_lvl = 5; m[26].ability = 11; m[26].m_hp = 23; m[26].m_scr = 9;
X
X /* level 6 monsters */
X
X strcpy(m[27].monster,"Ninja");
X m[27].m_lvl = 6; m[27].ability = 13;m[27].m_hp = 25; m[27].m_scr = 14;
X
X strcpy(m[28].monster,"Head Master");
X m[28].m_lvl = 6; m[28].ability = 1; m[28].m_hp = 25; m[28].m_scr = 6;
X
X strcpy(m[29].monster,"High Priest");
X m[29].m_lvl = 6; m[29].ability = 5; m[29].m_hp = 27; m[29].m_scr = 5;
X
X /* level 7 monsters */
X
X strcpy(m[30].monster,"Thunder Cloud");
X m[30].m_lvl = 7; m[30].ability = 4; m[30].m_hp = 27; m[30].m_scr = 8;
X
X strcpy(m[31].monster,"Flame Lion");
X m[31].m_lvl = 7; m[31].ability = 8; m[31].m_hp = 33; m[31].m_scr = 7;
X
X strcpy(m[32].monster,"Smoky Dragon");
X m[32].m_lvl = 7; m[32].ability = 8; m[32].m_hp = 42; m[32].m_scr = 15;
X
X /* level 8 monsters */
X
X strcpy(m[33].monster,"Sleepy Dragon");
X m[33].m_lvl = 8; m[33].ability = 9; m[33].m_hp = 53; m[33].m_scr = 15;
X
X strcpy(m[34].monster,"Wraith");
X m[34].m_lvl = 8; m[34].ability = 11; m[34].m_hp = 39; m[34].m_scr = 9;
X
X /* level 9 monsters */
X
X strcpy(m[35].monster,"Hungry Dragon");
X m[35].m_lvl = 8; m[35].ability = 9; m[35].m_hp = 64; m[35].m_scr = 15;
X
X /* level 10 monster (win creature) */
X
X strcpy(m[36].monster,"The Wiz");
X m[36].m_lvl = 10;m[36].ability = 12;m[36].m_hp = 260;m[36].m_scr = 13;
X
X/* Ideas: Phantasmist, Holy Warder
X*/
X}
X
Xmake_dam(rnd,mult)
Xint rnd,mult;
X{
X int total = 0,x;
X
X for(x=1;x<=mult;x++)
X total += ((rand()%rnd)+1);
Xreturn(total);
X}
X
Xint get_monst()
X{
X int min,max;
X /* min = First monster in level group */
X /* max = Last monster in level group */
X /* returns choice from monsters of the*/
X /* level group. */
X
X switch (p->level){
X case 1: min = 0; /* Relatively Easy */
X max = 7;
X break;
X case 2: min = 6; /* A little Tougher */
X max = 13;
X break;
X case 3: min = 10; /* Moderately Tough */
X max = 20;
X break;
X case 4: min = 16; /* Difficult */
X max = 27;
X break;
X case 5: min = 22; /* Very Difficult */
X max = 32;
X break;
X case 6: min = 29;
X max = 36;
X break;
X }
X return(rand()%((max + 1) - min) + min);
X}
X
Xlose_lvl()
X{
X int hitpt, sppt;
X
X if(char_stats.level < 35)
X if(exp[char_stats.level] > char_stats.experience)
X if(lvl_att[char_stats.level] == TRUE){
X hitpt = rand()%6 + 4;
X sppt = rand()%2 + 1;
X char_stats.hitpoints -= hitpt;
X char_stats.max_hp -= hitpt;
X char_stats.spellpoints -= sppt;
X char_stats.max_spt -= sppt;
X char_stats.level--;
X known[char_stats.level+1] = FALSE;
X lvl_att[char_stats.level+1] = FALSE;
X lvl_att[char_stats.level] = TRUE;
X print_stats();
X }
X}
X
Xuse_it()
X{
X char choice;
X
X start = firstnode;
X do
X {
X wclear(inv_win);
X wmove(inv_win,0,0);
X wprintw(inv_win,"Use which Item?");
X wmove(inv_win,1,0);
X wprintw(inv_win,"N)ext P)rev S)elect");
X wmove(inv_win,3,0);
X wprintw(inv_win,"%s",start->item);
X wmove(inv_win,1,21);
X wrefresh(inv_win);
X switch(choice = getch()){
X case 'n':
X case 'N':
X if(start->next != NULL)
X start = start->next;
X break;
X case 'p':
X case 'P':
X if(start->prev != NULL)
X start = start->prev;
X break;
X case 's':
X case 'S':
X switch (start->item_type){
X case 9:
X if(start->special > 0){
X p->compass_on = TRUE;
X ct_compass = 100;
X compass();
X start->special--;
X choice = ESC;
X }else{
X print_mess("Item Has no more charges.",0,0);
X wrefresh(message_win);
X sleep(1);
X }
X break;
X case 10:
X if(start->special > 0){
X detect_trap();
X ct_dtrap = 100;
X detect = ON;
X start->special--;
X choice = ESC;
X }else{
X print_mess("Item Has no more charges.",0,0);
X wrefresh(message_win);
X sleep(1);
X }
X break;
X case 11:
X if(start->special > 0){
X med_heal();
X start->special--;
X choice = ESC;
X }else{
X print_mess("Item Has no more charges.",0,0);
X wrefresh(message_win);
X sleep(1);
X }
X break;
X case 12:
X if(start->special > 0){
X flame();
X start->special--;
X choice = ESC;
X }else{
X print_mess("Item Has no more charges.",0,0);
X wrefresh(message_win);
X sleep(1);
X }
X break;
X case 13:
X if(start->special > 0){
X teleport();
X start->special--;
X choice = ESC;
X }else{
X print_mess("Item Has no more charges.",0,0);
X wrefresh(message_win);
X sleep(1);
X }
X break;
X default:
X print_mess("You cannot Use that!",0,0);
X wrefresh(message_win);
X break;
X }
X
X }
X }while(choice != ESC);
X wclear(inv_win);
X wrefresh(inv_win);
X}
X
Xmonst_att(mon)
Xint mon;
X{
X int ability;
X
X ability = m[mon].ability;
X wclear(message_win);
X wmove(message_win,0,0);
X switch (ability){
X case 0:
X case 1: abil_one(mon);
X break;
X case 2: abil_two();
X break;
X case 3: abil_three(mon);
X break;
X case 4: abil_four(mon);
X break;
X case 5: abil_five(mon);
X break;
X case 6: abil_six(mon);
X break;
X case 7: abil_seven(mon);
X break;
X case 8: abil_eight(mon);
X break;
X case 9: abil_nine(mon);
X break;
X case 10: abil_ten(mon);
X break;
X case 11: abil_eleven(mon);
X break;
X case 12: abil_twelve(mon);
X break;
X case 13: abil_thirteen(mon);
X break;
X }
X wrefresh(message_win);
X sleep(1);
X}
X
Xabil_one(monst)
Xint monst;
X{
X if(rand()%16 > char_stats.ac){
X char_stats.hitpoints -= damag = make_dam(5,m[monst].m_lvl);
X sprintf(buffer,"He hit you for %d points damage.",damag);
X print_mess(buffer,2,0);
X print_stats();
X }else
X print_mess("He Misses you!",2,0);
X}
X
Xabil_two()
X{
X if(rand()%6 > char_stats.ac){
X if(char_stats.strength > MIN_STAT)
X char_stats.strength--;
X print_mess("Your Strength is drained.",2,0);
X print_stats();
X }else
X print_mess("He misses you.",2,0);
X}
X
Xabil_three(monst)
Xint monst;
X{
X switch (rand()%2 ? 1 : 2){
X case 1: if((rand()%18) + 3 > char_stats.constitution){
X char_stats.hitpoints -= damag = make_dam(5,m[monst].m_lvl);
X sprintf(buffer,"You got fried for %d points damage.",damag);
X print_mess(buffer,2,0);
X print_stats();
X }else
X print_mess("You resist the Spell.",2,0);
X break;
X case 2: abil_one(monst);
X break;
X }
X}
X
Xabil_four(mon)
Xint mon;
X{
X switch(rand()%2 ? 1 : 2){
X case 1: if((rand()%18)+6 > char_stats.constitution){
X char_stats.hitpoints -= damag = make_dam(5,4);
X print_mess("You are blasted by an electric",2,0);
X sprintf(buffer,"sphere for %d points damage.",damag);
X print_mess(buffer,3,0);
X print_stats();
X }else{
X print_mess("You resist the spell.",2,0);
X sleep(1);
X }
X break;
X case 2: abil_three(mon);
X break;
X }
X}
X
Xabil_five(mon)
Xint mon;
X{
X switch(rand()%2 ? 1 : 2){
X case 1: if((rand()%18) + 5 > char_stats.constitution){
X damag = make_dam(m[mon].m_lvl,3);
X char_stats.hitpoints -= damag;
X sprintf(buffer,"You are drained for %d ",damag);
X print_mess(buffer,2,0);
X print_mess("points of damage.",3,0);
X m_temp.m_hp += (damag>>1);
X print_stats();
X }else
X print_mess("You resist the affects.",2,0);
X break;
X case 2: abil_one(mon);
X break;
X }
X}
X
Xabil_six(mon)
Xint mon;
X{
X switch (rand()%2 ? 1 : 2){
X case 1: if((rand()%18) + 3 > char_stats.constitution){
X char_stats.hitpoints -= damag = make_dam(5,m[mon].m_lvl);
X print_mess("You are choked for ",2,0);
X sprintf(buffer,"%d points damage.",damag);
X print_mess(buffer,3,0);
X print_stats();
X }else
X print_mess("You resist the spell.",2,0);
X break;
X case 2: abil_one(mon);
X break;
X }
X}
X
Xabil_seven(mon)
Xint mon;
X{
X switch(rand()%2 ? 1 : 2){
X case 1: if((rand()%18) + 3 > char_stats.intelligence){
X char_stats.hitpoints -= damag = make_dam(5,m[mon].m_lvl);
X sprintf(buffer,"You are burnt for %d ",damag);
X print_mess(buffer,2,0);
X print_mess("points damage.",3,0);
X print_stats();
X }else
X print_mess("The spell does not affect you.",2,0);
X break;
X case 2: abil_one(mon);
X break;
X }
X}
X
Xabil_eight(monst)
Xint monst;
X{
X switch(rand()%2 ? 1 : 2){
X case 1: if((rand()%18)+3 > char_stats.constitution){
X char_stats.hitpoints -= damag = make_dam(8,3);
X print_mess("He Breathes and burns you ",2,0);
X sprintf(buffer,"for %d points damage.",damag);
X print_mess(buffer,3,0);
X print_stats();
X }else
X print_mess("The Spell does not Affect you.",2,0);
X break;
X case 2: abil_one(monst);
X break;
X }
X}
X
Xabil_nine(monst)
Xint monst;
X{
X int tmp;
X
X switch(rand()%2 ? 1 : 2){
X case 1: abil_six(monst);
X break;
X case 2: if((rand()%18)+3 > char_stats.strength){
X tmp = (m[monst].m_lvl + 2);
X char_stats.hitpoints -= damag = (10 + make_dam(5,tmp));
X sprintf(buffer,"You gasp, and take %d points ",damag);
X print_mess(buffer,2,0);
X print_mess("damage due to lack of air.",3,0);
X print_stats();
X }else
X print_mess("You resist the affects.");
X break;
X }
X}
X
Xabil_ten(monst)
Xint monst;
X{
X switch(rand()%3){
X case 0: abil_three(monst);
X break;
X case 1: abil_four(monst);
X break;
X case 2: abil_seven(monst);
X break;
X }
X}
X
Xabil_eleven(monst)
Xint monst;
X{
X switch(rand()%3){
X case 0:
X if(char_stats.ac + 75 < rand()%100){
X char_stats.experience -= (m[monst].m_lvl * 10);
X print_mess("He touches you and drains experience.",2,0);
X lose_lvl();
X print_stats();
X }else
X print_mess("He reaches toward you but misses.",2,0);
X break;
X case 1: abil_five(monst);
X break;
X case 2: abil_one(monst);
X break;
X }
X}
X
Xabil_twelve(monst)
Xint monst;
X{
X switch(rand()%3){
X case 0: abil_thirteen(monst);
X break;
X case 1: char_stats.hitpoints -= damag = make_dam(5,8);
X sprintf(buffer,"He did %d points damage.",damag);
X print_mess(buffer,2,0);
X wrefresh(message_win);
X print_stats();
X break;
X case 2: abil_nine(monst);
X break;
X }
X}
X
Xabil_thirteen(monst)
Xint monst;
X{
X if(rand()%100 > 85){
X char_stats.hitpoints -= damag = (rand()%10) + 10;
X char_stats.dexterity -= 3;
X char_stats.m_dex -= 1;
X sprintf(buffer,"He hit for %d points of damage",damag);
X print_mess(buffer,2,0);
X print_mess("and he also damaged your dexterity.",3,0);
X }else{
X char_stats.hitpoints -= damag = (rand()%10) + 15;
X sprintf(buffer,"You are hit for %d points damage.",damag);
X print_mess(buffer,2,0);
X }
X print_stats();
X wrefresh(message_win);
X}
END_OF_FILE
if test 18840 -ne `wc -c <'monster.c'`; then
echo shar: \"'monster.c'\" unpacked with wrong size!
fi
# end of 'monster.c'
fi
echo shar: End of archive 3 \(of 4\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 4 archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0