pull request #801 - triggering landmines \
by monsters is based on their weight Pull request from entrez: instead of straight 2/3 chance for a monster to trigger a landmine, base the chance on monster's weight. Closes #801
This commit is contained in:
+6
-2
@@ -2243,8 +2243,11 @@ trapeffect_landmine(
|
|||||||
struct permonst *mptr = mtmp->data;
|
struct permonst *mptr = mtmp->data;
|
||||||
coordxy tx = trap->tx, ty = trap->ty;
|
coordxy tx = trap->tx, ty = trap->ty;
|
||||||
|
|
||||||
if (rn2(3))
|
/* heavier monsters are more likely to set off a land mine; on the
|
||||||
return Trap_Effect_Finished; /* monsters usually don't set it off */
|
other hand, any mon lighter than the trigger weight is immune. */
|
||||||
|
#define MINE_TRIGGER_WT (WT_ELF / 2)
|
||||||
|
if (rn2(mtmp->data->cwt + 1) < MINE_TRIGGER_WT)
|
||||||
|
return Trap_Effect_Finished;
|
||||||
if (is_flyer(mptr)) {
|
if (is_flyer(mptr)) {
|
||||||
boolean already_seen = trap->tseen;
|
boolean already_seen = trap->tseen;
|
||||||
|
|
||||||
@@ -2293,6 +2296,7 @@ trapeffect_landmine(
|
|||||||
}
|
}
|
||||||
return Trap_Effect_Finished;
|
return Trap_Effect_Finished;
|
||||||
}
|
}
|
||||||
|
#undef MINE_TRIGGER_WT
|
||||||
|
|
||||||
static int
|
static int
|
||||||
trapeffect_rolling_boulder_trap(
|
trapeffect_rolling_boulder_trap(
|
||||||
|
|||||||
Reference in New Issue
Block a user