Level temperature affects monster generation
Hot levels generate more fire-resistant monsters, cold levels cold-resistant ones.
This commit is contained in:
@@ -1332,6 +1332,7 @@ demons cannot be frightened by showing them their reflection
|
|||||||
HP regeneration formula has changed, primarily to be less fast in the endgame
|
HP regeneration formula has changed, primarily to be less fast in the endgame
|
||||||
riding negates stealth unless the steed is flying
|
riding negates stealth unless the steed is flying
|
||||||
previous hero rising as undead in bones retains intrinsics
|
previous hero rising as undead in bones retains intrinsics
|
||||||
|
level temperature affects monster generation
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
Fixes to 3.7.0-x General Problems Exposed Via git Repository
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
static boolean uncommon(int);
|
static boolean uncommon(int);
|
||||||
static int align_shift(struct permonst *);
|
static int align_shift(struct permonst *);
|
||||||
|
static int temperature_shift(struct permonst *);
|
||||||
static boolean mk_gen_ok(int, unsigned, unsigned);
|
static boolean mk_gen_ok(int, unsigned, unsigned);
|
||||||
static boolean wrong_elem_type(struct permonst *);
|
static boolean wrong_elem_type(struct permonst *);
|
||||||
static void m_initgrp(struct monst *, coordxy, coordxy, int, mmflags_nht);
|
static void m_initgrp(struct monst *, coordxy, coordxy, int, mmflags_nht);
|
||||||
@@ -1606,6 +1607,17 @@ align_shift(register struct permonst *ptr)
|
|||||||
return alshift;
|
return alshift;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* return larger value if monster prefers the level temperature */
|
||||||
|
static int
|
||||||
|
temperature_shift(struct permonst *ptr)
|
||||||
|
{
|
||||||
|
if (gl.level.flags.temperature
|
||||||
|
&& pm_resistance(ptr, (gl.level.flags.temperature > 0)
|
||||||
|
? MR_FIRE : MR_COLD))
|
||||||
|
return 3;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* select a random monster type */
|
/* select a random monster type */
|
||||||
struct permonst *
|
struct permonst *
|
||||||
rndmonst(void)
|
rndmonst(void)
|
||||||
@@ -1663,6 +1675,7 @@ rndmonst_adj(int minadj, int maxadj)
|
|||||||
* potentially steal its spot.
|
* potentially steal its spot.
|
||||||
*/
|
*/
|
||||||
weight = (int) (ptr->geno & G_FREQ) + align_shift(ptr);
|
weight = (int) (ptr->geno & G_FREQ) + align_shift(ptr);
|
||||||
|
weight += temperature_shift(ptr);
|
||||||
if (weight < 0 || weight > 127) {
|
if (weight < 0 || weight > 127) {
|
||||||
impossible("bad weight in rndmonst for mndx %d", mndx);
|
impossible("bad weight in rndmonst for mndx %d", mndx);
|
||||||
weight = 0;
|
weight = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user