From ccf6dd058216e5db5e2994bd3adaeda81d59dcb6 Mon Sep 17 00:00:00 2001 From: Peisong Xiao Date: Sat, 13 Jul 2024 15:43:21 -0400 Subject: [PATCH] corrected colors --- src/characters.cc | 4 ++-- src/characters.h | 2 +- src/game.h | 2 -- src/map.h | 5 ----- src/potion.cc | 4 ++-- src/potion.h | 2 +- src/vampire.h | 3 +-- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/characters.cc b/src/characters.cc index b3473b6..af80e33 100644 --- a/src/characters.cc +++ b/src/characters.cc @@ -13,9 +13,9 @@ void character::start_turn() { base_hit_rate = {1, 1}; } -void character::print(display *out, bool color, bool player) { +void character::print(display *out, bool player) { out->print_char(pos, player ? '@' : CHARACTER_REP[race], - COLOR_PAIR(COLOR_BLACK_ON_WHITE)); + player ? COLOR_PAIR(COLOR_BLUE) : COLOR_PAIR(COLOR_RED)); } enum race character::get_race() const { diff --git a/src/characters.h b/src/characters.h index 5393126..db75525 100644 --- a/src/characters.h +++ b/src/characters.h @@ -40,7 +40,7 @@ public: const fraction hitrate) = 0; // overload for different races - virtual void print(display *out, bool color = false, bool player = false); + virtual void print(display *out, bool player = false); result apply_effects(); void discard_level_effects(); diff --git a/src/game.h b/src/game.h index 27198ab..fd83ece 100644 --- a/src/game.h +++ b/src/game.h @@ -18,7 +18,6 @@ private: logger *log; RNG *rng; - // IMPORTANT: during player generation, std::unique_ptr player; public: game(const feature enabled_features, @@ -28,7 +27,6 @@ public: RNG *new_rng); game_status run(); private: - int getcmd() const; }; #endif diff --git a/src/map.h b/src/map.h index 1e348ab..675a490 100644 --- a/src/map.h +++ b/src/map.h @@ -96,11 +96,6 @@ private: room &room2); bool overlap_y(room &room1, room &room2); - // has anything between the two - bool between_x(room &room1, - room &room2); - bool between_y(room &room1, - room &room2); void jitter(RNG *rng, std::vector &rooms); diff --git a/src/potion.cc b/src/potion.cc index 38bf023..2026021 100644 --- a/src/potion.cc +++ b/src/potion.cc @@ -41,6 +41,6 @@ potion &potion::operator=(potion &&p) { return *this; } -void potion::print(display *out, bool color) { - out->print_char(pos, 'P'); +void potion::print(display *out) { + out->print_char(pos, 'P', COLOR_PAIR(COLOR_GREEN)); } diff --git a/src/potion.h b/src/potion.h index 9dcc92e..1ad618f 100644 --- a/src/potion.h +++ b/src/potion.h @@ -33,7 +33,7 @@ public: position get_pos() const; void set_pos(const position &npos); - virtual void print(display *out, bool color = false); + virtual void print(display *out); }; typedef std::vector potion_list; diff --git a/src/vampire.h b/src/vampire.h index 7a68922..acb1a01 100644 --- a/src/vampire.h +++ b/src/vampire.h @@ -2,9 +2,8 @@ #define __VAMPIRE_H__ #include "characters.h" -const int GAIN_HP = 5; - class vampire final: public character { + static const int GAIN_HP = 5; public: vampire(RNG *rng, const position &pos); virtual result attack(const direction dir,