Split engulfer explosion message into separate function
This commit is contained in:
125
src/explode.c
125
src/explode.c
@@ -5,6 +5,7 @@
|
|||||||
#include "hack.h"
|
#include "hack.h"
|
||||||
|
|
||||||
static int explosionmask(struct monst *, uchar, char);
|
static int explosionmask(struct monst *, uchar, char);
|
||||||
|
static void engulfer_explosion_msg(uchar, char);
|
||||||
|
|
||||||
/* Note: Arrays are column first, while the screen is row first */
|
/* Note: Arrays are column first, while the screen is row first */
|
||||||
static const int explosion[3][3] = {
|
static const int explosion[3][3] = {
|
||||||
@@ -113,6 +114,70 @@ explosionmask(
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
engulfer_explosion_msg(uchar adtyp, char olet)
|
||||||
|
{
|
||||||
|
const char *adj = (char *) 0;
|
||||||
|
|
||||||
|
if (digests(u.ustuck->data)) {
|
||||||
|
switch (adtyp) {
|
||||||
|
case AD_FIRE:
|
||||||
|
adj = "heartburn";
|
||||||
|
break;
|
||||||
|
case AD_COLD:
|
||||||
|
adj = "chilly";
|
||||||
|
break;
|
||||||
|
case AD_DISN:
|
||||||
|
if (olet == WAND_CLASS)
|
||||||
|
adj = "irradiated by pure energy";
|
||||||
|
else
|
||||||
|
adj = "perforated";
|
||||||
|
break;
|
||||||
|
case AD_ELEC:
|
||||||
|
adj = "shocked";
|
||||||
|
break;
|
||||||
|
case AD_DRST:
|
||||||
|
adj = "poisoned";
|
||||||
|
break;
|
||||||
|
case AD_ACID:
|
||||||
|
adj = "an upset stomach";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
adj = "fried";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pline("%s gets %s!", Monnam(u.ustuck), adj);
|
||||||
|
} else {
|
||||||
|
switch (adtyp) {
|
||||||
|
case AD_FIRE:
|
||||||
|
adj = "toasted";
|
||||||
|
break;
|
||||||
|
case AD_COLD:
|
||||||
|
adj = "chilly";
|
||||||
|
break;
|
||||||
|
case AD_DISN:
|
||||||
|
if (olet == WAND_CLASS)
|
||||||
|
adj = "overwhelmed by pure energy";
|
||||||
|
else
|
||||||
|
adj = "perforated";
|
||||||
|
break;
|
||||||
|
case AD_ELEC:
|
||||||
|
adj = "shocked";
|
||||||
|
break;
|
||||||
|
case AD_DRST:
|
||||||
|
adj = "intoxicated";
|
||||||
|
break;
|
||||||
|
case AD_ACID:
|
||||||
|
adj = "burned";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
adj = "fried";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pline("%s gets slightly %s!", Monnam(u.ustuck), adj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Note: I had to choose one of three possible kinds of "type" when writing
|
/* Note: I had to choose one of three possible kinds of "type" when writing
|
||||||
* this function: a wand type (like in zap.c), an adtyp, or an object type.
|
* this function: a wand type (like in zap.c), an adtyp, or an object type.
|
||||||
* Wand types get complex because they must be converted to adtyps for
|
* Wand types get complex because they must be converted to adtyps for
|
||||||
@@ -433,65 +498,7 @@ explode(
|
|||||||
str = hallu_buf;
|
str = hallu_buf;
|
||||||
}
|
}
|
||||||
if (engulfing_u(mtmp)) {
|
if (engulfing_u(mtmp)) {
|
||||||
const char *adj = (char *) 0;
|
engulfer_explosion_msg(adtyp, olet);
|
||||||
|
|
||||||
if (digests(u.ustuck->data)) {
|
|
||||||
switch (adtyp) {
|
|
||||||
case AD_FIRE:
|
|
||||||
adj = "heartburn";
|
|
||||||
break;
|
|
||||||
case AD_COLD:
|
|
||||||
adj = "chilly";
|
|
||||||
break;
|
|
||||||
case AD_DISN:
|
|
||||||
if (olet == WAND_CLASS)
|
|
||||||
adj = "irradiated by pure energy";
|
|
||||||
else
|
|
||||||
adj = "perforated";
|
|
||||||
break;
|
|
||||||
case AD_ELEC:
|
|
||||||
adj = "shocked";
|
|
||||||
break;
|
|
||||||
case AD_DRST:
|
|
||||||
adj = "poisoned";
|
|
||||||
break;
|
|
||||||
case AD_ACID:
|
|
||||||
adj = "an upset stomach";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
adj = "fried";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pline("%s gets %s!", Monnam(u.ustuck), adj);
|
|
||||||
} else {
|
|
||||||
switch (adtyp) {
|
|
||||||
case AD_FIRE:
|
|
||||||
adj = "toasted";
|
|
||||||
break;
|
|
||||||
case AD_COLD:
|
|
||||||
adj = "chilly";
|
|
||||||
break;
|
|
||||||
case AD_DISN:
|
|
||||||
if (olet == WAND_CLASS)
|
|
||||||
adj = "overwhelmed by pure energy";
|
|
||||||
else
|
|
||||||
adj = "perforated";
|
|
||||||
break;
|
|
||||||
case AD_ELEC:
|
|
||||||
adj = "shocked";
|
|
||||||
break;
|
|
||||||
case AD_DRST:
|
|
||||||
adj = "intoxicated";
|
|
||||||
break;
|
|
||||||
case AD_ACID:
|
|
||||||
adj = "burned";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
adj = "fried";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
pline("%s gets slightly %s!", Monnam(u.ustuck), adj);
|
|
||||||
}
|
|
||||||
} else if (cansee(xx, yy)) {
|
} else if (cansee(xx, yy)) {
|
||||||
if (mtmp->m_ap_type)
|
if (mtmp->m_ap_type)
|
||||||
seemimic(mtmp);
|
seemimic(mtmp);
|
||||||
|
|||||||
Reference in New Issue
Block a user