… | |
… | |
1262 | { |
1262 | { |
1263 | if (op->stats.maxhp > op->stats.hp |
1263 | if (op->stats.maxhp > op->stats.hp |
1264 | && op->stats.maxhp > 0 |
1264 | && op->stats.maxhp > 0 |
1265 | && (op->type == PLAYER |
1265 | && (op->type == PLAYER |
1266 | || op->type == DOOR // does not work, have maxhp 0 |
1266 | || op->type == DOOR // does not work, have maxhp 0 |
1267 | || QUERY_FLAG (op, FLAG_MONSTER) || QUERY_FLAG (op, FLAG_ALIVE) || QUERY_FLAG (op, FLAG_GENERATOR))) |
1267 | || QUERY_FLAG (op, FLAG_MONSTER) |
|
|
1268 | || QUERY_FLAG (op, FLAG_ALIVE) |
|
|
1269 | || QUERY_FLAG (op, FLAG_GENERATOR))) |
1268 | { |
1270 | { |
1269 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1271 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1270 | stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge |
1272 | stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge |
1271 | } |
1273 | } |
1272 | |
1274 | |
1273 | if (op->msg && op->msg[0] == '@') |
1275 | if (op->has_dialogue ()) |
1274 | flags |= 1; |
1276 | flags |= 1; |
1275 | |
1277 | |
1276 | if (op->type == PLAYER) |
1278 | if (op->type == PLAYER) |
1277 | player = op->count; |
1279 | player = op == ob ? pl->ob->count |
|
|
1280 | : op == pl->ob ? ob->count |
|
|
1281 | : op->count; |
1278 | } |
1282 | } |
1279 | |
1283 | |
1280 | if (lastcell.stat_hp != stat_hp) |
1284 | if (lastcell.stat_hp != stat_hp) |
1281 | { |
1285 | { |
1282 | lastcell.stat_hp = stat_hp; |
1286 | lastcell.stat_hp = stat_hp; |