Allow spiders to spin webs
Revisited this feature, and the chance of a spider spinning a web depends now on the number of webs already present on the level. For a giant spider to spin a web in the middle of a room with no supports, the limit of existing webs is 4, next to one support 9, next to two supports 14, and so on. Cave spider limits are much lower.
This commit is contained in:
16
src/trap.c
16
src/trap.c
@@ -5399,6 +5399,22 @@ t_at(register int x, register int y)
|
||||
return (struct trap *) 0;
|
||||
}
|
||||
|
||||
/* return number of traps of type ttyp on this level */
|
||||
int
|
||||
count_traps(int ttyp)
|
||||
{
|
||||
int ret = 0;
|
||||
struct trap *trap = g.ftrap;
|
||||
|
||||
while (trap) {
|
||||
if (trap->ttyp == ttyp)
|
||||
ret++;
|
||||
trap = trap->ntrap;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
deltrap(register struct trap* trap)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user