- generate error if main screen is not at least 80x25

- showlfstats() - implement text wrap and scrolling on Effects screen
- If a monster slips and IQ >= animal, tiptoe next turn.
This commit is contained in:
Rob Pearce 2016-06-02 14:50:03 +10:00
parent 3fb91ba6e1
commit c30a1c4b94
5 changed files with 341 additions and 315 deletions

2
defs.h
View File

@ -3578,6 +3578,8 @@ enum FLAG {
// v0 = max time allowed to rest before checkout
// v1 = total time rested
// text = obid of hotel
F_SLIPPEDLASTTURN, // this monster slipped the previous turn, and will try to tiptoe
// on its next move.
F_SWARM, // this lf is a swarm, its maxattacks are reduced
// based on its remaining hp pct.
F_SWIMEVASION, // +v0 evasion if swimming

670
io.c

File diff suppressed because it is too large Load Diff

3
io.h
View File

@ -105,6 +105,7 @@ void dumpcols(void);
void dumpskills(void);
void dumpspells(void);
void dumpweps(void);
int effectline(int *stopnow, int *count, int offset, int *nextoffset, int headinglines, WINDOW *win, int *y, int *x, int newlineindent, char *format, ... );
void forceredraw(void);
enum COLOUR getattrcolour(enum ATTRBRACKET brack);
char getchoice(prompt_t *prompt);
@ -164,3 +165,5 @@ int warnabout(char *what);
int real_warnabout(char *what, int lifetime, int doquestion);
void wingame(void);
char wrapprint(WINDOW *win, int *y, int *x, int newlineindent, char *format, ... );
char wrapprint_nomore(WINDOW *win, int *y, int *x, int newlineindent, char *format, ... );
char real_wrapprint(WINDOW *win, int *y, int *x, int pager, int newlineindent, char *format, ... );

7
lf.c
View File

@ -22908,6 +22908,13 @@ int slipon(lifeform_t *lf, object_t *o) {
if (isplayer(lf)) {
real_warnabout("(use 'm-tiptoe' to walk carefully)", PERMENANT, B_FALSE);
} else {
// most monsters who slipped will tiptoe next turn, if it is still slippery here.
if (getattrbracket(getattr(lf, A_IQ), A_IQ, NULL) >= IQ_ANIMAL) {
if (getslipperyness(lf->cell, NULL)) {
addflag(lf->flags, F_SLIPPEDLASTTURN, B_TRUE, NA, NA, NULL);
}
}
}
if (o) {

12
move.c
View File

@ -2017,7 +2017,19 @@ int movetowards(lifeform_t *lf, cell_t *dst, int dirtype, int strafe) {
if (db) {
dblog(".oO { dir from %d,%d -> %d,%d is %s }", lf->cell->x, lf->cell->y, dst->x, dst->y, getdirname(dir));
}
if (isplayer(lf)) {
rv = trymove(lf, dir, B_TRUE, strafe);
} else {
flag_t *f;
f = lfhasflag(lf, F_SLIPPEDLASTTURN);
if (f) {
killflag(f);
rv = trysneak(lf, dir);
} else {
rv = trymove(lf, dir, B_TRUE, strafe);
}
}
} else {
if (db) dblog(".oO { dir from %d,%d -> %d,%d is DT_NONE ! }", lf->cell->x, lf->cell->y, dst->x, dst->y);
}