… | |
… | |
1062 | { |
1062 | { |
1063 | if (op->stats.maxhp > op->stats.hp |
1063 | if (op->stats.maxhp > op->stats.hp |
1064 | && op->stats.maxhp > 0 |
1064 | && op->stats.maxhp > 0 |
1065 | && (op->type == PLAYER |
1065 | && (op->type == PLAYER |
1066 | || op->type == DOOR // does not work, have maxhp 0 |
1066 | || op->type == DOOR // does not work, have maxhp 0 |
1067 | || QUERY_FLAG (op, FLAG_MONSTER) |
1067 | || op->flag [FLAG_MONSTER] |
1068 | || QUERY_FLAG (op, FLAG_ALIVE) |
1068 | || op->flag [FLAG_ALIVE] |
1069 | || QUERY_FLAG (op, FLAG_GENERATOR))) |
1069 | || op->flag [FLAG_GENERATOR])) |
1070 | { |
1070 | { |
1071 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1071 | stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; |
1072 | stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge |
1072 | stat_width = op->arch->max_x - op->arch->x; //TODO: should be upper-left edge |
1073 | } |
1073 | } |
1074 | |
1074 | |