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:
Pasi Kallinen
2021-06-23 22:42:29 +03:00
parent a9134fd8b9
commit 8dfe963652
4 changed files with 74 additions and 0 deletions

View File

@@ -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)
{