/* * pop_guard.c — состояние стража (W1/W2). См. pop_guard.h. * Логика — в банке (guards.c), отрисовка — из главного цикла. */ #include "pop_guard.h" pop_char_t Guard; uint8_t guardhp_curr, guardhp_max; int8_t guardhp_delta; uint8_t pop_guard_present(void) { return (uint8_t)(Guard.charid != 0 && Guard.alive < 0 && guardhp_curr != 0); } void pop_guard_reset(void) { Guard.charid = 0; Guard.alive = 0; Guard.direction = 0; guardhp_curr = 0; guardhp_delta = 0; } /* kill guard cheat (seg000:786): * if (Guard.charid != charid_4_skeleton) { * guardhp_delta = -guardhp_curr; * Guard.alive = 0; * } * Скелета чит не убивает — он и в оригинале бессмертен. */ void pop_guard_kill(void) { if (Guard.charid == CHARID_4_SKELETON) return; if (!pop_guard_present()) return; guardhp_delta = (int8_t)-guardhp_curr; guardhp_curr = 0; Guard.alive = 0; }