Lines Matching refs:monster
1 /* $NetBSD: monster.c,v 1.20 2021/05/02 12:50:45 rillig Exp $ */
4 * monster.c Larn is copyrighted 1986 by Noah Morgan.
9 * createmonster(monstno) Function to create a monster next to the player
27 * nospell(x,monst)Routine to return 1 if a spell doesn't affect a monster
41 * ifblind(x,y)Routine to put "monster" or the monster name into lastmosnt
44 * tdirect(spnum) Routine to teleport away a monster
60 * hitmonster(x,y) Function to hit a monster at the designated coordinates
63 * hitm(x,y,amt) Function to just hit a monster at a given coordinates
66 * hitplayer(x,y) Function for the monster to hit the player from (x,y)
69 * dropsomething(monst) Function to create an object when a monster dies
98 * genmonst() Function to ask for monster and genocide from game
103 __RCSID("$NetBSD: monster.c,v 1.20 2021/05/02 12:50:45 rillig Exp $");
113 char type; /* 0=item, 1=monster */
114 char id; /* item number or monster number */
115 short arg; /* the type of item or hitpoints of monster */
137 * createmonster(monstno) Function to create a monster next to the player
140 * Enter with the monster number (1 to MAXMONST+8)
147 if (mon < 1 || mon > MAXMONST + 8) { /* check for monster number
154 while (monster[mon].genocided && mon < MAXMONST)
164 hitp[x][y] = monster[mon].hitpoints;
185 * if monst==TRUE check for no monster at this location
337 case 4: /* charm monster */
450 hitp[i][j] = monster[GNOMEKING].hitpoints;
456 hitp[i][j] = monster[DEMONPRINCE].hitpoints;
513 return; /* scare monster */
517 return; /* hold monster */
677 monster
680 * Subroutine to return 1 if the spell can't affect the monster
682 * Enter with the spell number in x, and the monster number in monst.
694 lprintf(spelmes[tmp], monster[monst].name);
699 * fullhit(xx) Function to return full damage against a monster (aka web)
702 * Function to return hp damage to monster due to a number of full hits
722 * Routine to ask for a direction to a spell and then hit the monster
830 if ((m = mitem[x][y])) { /* is there a monster there? */
891 hitp[x][y] = monster[GNOMEKING].hitpoints;
907 * ifblind(x,y) Routine to put "monster" or the monster name into lastmosnt
910 * Subroutine to copy the word "monster" into lastmonst if the player is blind
911 * Enter with the coordinates (x,y) of the monster
922 p = "monster";
925 p = monster[lastnum].name;
931 * tdirect(spnum) Routine to teleport away a monster
934 * Routine to ask for a direction to a spell and then teleport away monster
967 * Routine to cast a spell and then hit the monster in all directions
1082 * Subroutine to polymorph a monster and ask for the direction its in
1105 while (monster[m = mitem[x][y] = rnd(MAXMONST + 7)].genocided);
1106 hitp[x][y] = monster[m].hitpoints;
1107 show1cell(x, y); /* show the new monster */
1111 * hitmonster(x,y) Function to hit a monster at the designated coordinates
1114 * This routine is used for a bash & slash type attack on a monster
1115 * Enter with the coordinates of the monster in (x,y).
1129 tmp = monster[monst].armorclass + c[LEVEL] + c[DEXTERITY] +
1145 if (flag) /* if the monster was hit */
1163 * hitm(x,y,amt) Function to just hit a monster at a given coordinates
1166 * Returns the number of hitpoints the monster absorbed
1167 * This routine is used to specifically damage a monster at a location (x,y)
1186 c[HOLDMONST] = 0; /* hit a monster breaks hold monster spell */
1197 /* invincible monster fix is here */
1198 if (hitp[x][y] > monster[monst].hitpoints)
1199 hitp[x][y] = monster[monst].hitpoints;
1205 raiseexperience((long) monster[monst].experience);
1206 amt = monster[monst].gold;
1219 * hitplayer(x,y) Function for the monster to hit the player from (x,y)
1222 * Function for the monster to hit the player with monster at location x,y
1257 if (rnd(30) + 5 * monster[mster].level - c[CHARISMA] < 30) {
1264 dam = monster[mster].damage;
1265 dam += rnd((int) ((dam < 1) ? 1 : dam)) + monster[mster].level;
1268 if (monster[mster].attack > 0)
1270 if (spattack(monster[mster].attack, x, y)) {
1294 * dropsomething(monst) Function to create an object when a monster dies
1298 * Enter with the monster number
1477 * of the monster that is special attacking
1480 * atckno monster effect
1483 * 1 rust monster eat armor
1725 if (*(p = &mitem[i][j])) { /* if a monster there */
1727 k += monster[*p].experience;
1730 lprintf("\nThe %s barely escapes being annihilated!", monster[*p].name);
1776 lprintf("\nThe %s dispels the sphere!", monster[m].name);
1784 lprintf("\nThe %s causes cancellation of the sphere!", monster[m].name);
1896 * genmonst() Function to ask for monster and genocide from game
1898 * This is done by setting a flag in the monster[] structure
1905 lprcat("\nGenocide what monster? ");
1908 for (j = 0; j < MAXMONST; j++) /* search for the monster type */
1910 monster[j].genocided = 1; /* genocided from game */
1911 lprintf(" There will be no more %s's", monster[j].name);