Explicitly list the random breath types
This commit is contained in:
@@ -1657,6 +1657,7 @@ extern boolean resist_conflict(struct monst *);
|
|||||||
extern boolean mon_knows_traps(struct monst *, int);
|
extern boolean mon_knows_traps(struct monst *, int);
|
||||||
extern void mon_learns_traps(struct monst *, int);
|
extern void mon_learns_traps(struct monst *, int);
|
||||||
extern void mons_see_trap(struct trap *);
|
extern void mons_see_trap(struct trap *);
|
||||||
|
extern int get_atkdam_type(int);
|
||||||
|
|
||||||
/* ### monmove.c ### */
|
/* ### monmove.c ### */
|
||||||
|
|
||||||
|
|||||||
@@ -1416,4 +1416,16 @@ mons_see_trap(struct trap *ttmp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
get_atkdam_type(int adtyp)
|
||||||
|
{
|
||||||
|
if (adtyp == AD_RBRE) {
|
||||||
|
static const int rnd_breath_typ[] = {
|
||||||
|
AD_MAGM, AD_FIRE, AD_COLD, AD_SLEE,
|
||||||
|
AD_DISN, AD_ELEC, AD_DRST, AD_ACID };
|
||||||
|
return rnd_breath_typ[rn2(SIZE(rnd_breath_typ))];
|
||||||
|
}
|
||||||
|
return adtyp;
|
||||||
|
}
|
||||||
|
|
||||||
/*mondata.c*/
|
/*mondata.c*/
|
||||||
|
|||||||
+1
-2
@@ -893,8 +893,7 @@ breathwep_name(int typ)
|
|||||||
int
|
int
|
||||||
breamm(struct monst* mtmp, struct attack* mattk, struct monst* mtarg)
|
breamm(struct monst* mtmp, struct attack* mattk, struct monst* mtarg)
|
||||||
{
|
{
|
||||||
/* if new breath types are added, change AD_ACID to max type */
|
int typ = get_atkdam_type(mattk->adtyp);
|
||||||
int typ = (mattk->adtyp == AD_RBRE) ? rnd(AD_ACID) : mattk->adtyp ;
|
|
||||||
|
|
||||||
if (m_lined_up(mtarg, mtmp)) {
|
if (m_lined_up(mtarg, mtmp)) {
|
||||||
if (mtmp->mcan) {
|
if (mtmp->mcan) {
|
||||||
|
|||||||
Reference in New Issue
Block a user