Пример #1
0
const char *
eroded_text(const char *engr, int cnt, unsigned seed) {
    int len = strlen(engr);

    char buf[len + 1];
    strcpy(buf, engr);
    wipeout_text(buf, cnt, seed);

    return msg_from_string(buf);
}
Пример #2
0
char *random_engraving(char *outbuf)
{
	const char *rumor;

	/* a random engraving may come from the "rumors" file,
	   or from the list above */
	if (!rn2(4) || !(rumor = getrumor(0, outbuf, TRUE)) || !*rumor)
	    strcpy(outbuf, random_mesg[rn2(SIZE(random_mesg))]);

	wipeout_text(outbuf, (int)(strlen(outbuf) / 4), 0);
	return outbuf;
}
Пример #3
0
void wipe_engr_at(struct level *lev, xchar x, xchar y, xchar cnt)
{
	struct engr *ep = engr_at(lev, x,y);

	/* Headstones are indelible */
	if (ep && ep->engr_type != HEADSTONE){
	    if (ep->engr_type != BURN || is_ice(lev, x, y)) {
		if (ep->engr_type != DUST && ep->engr_type != ENGR_BLOOD) {
			cnt = rn2(1 + 50/(cnt+1)) ? 0 : 1;
		}
		wipeout_text(ep->engr_txt, (int)cnt, 0);
		while (ep->engr_txt[0] == ' ')
			ep->engr_txt++;
		if (!ep->engr_txt[0]) del_engr(ep, lev);
	    }
	}
}