mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-26 15:12:48 +00:00
a message on spikes hurt
This commit is contained in:
parent
0ffb805ce8
commit
82bc85ee60
@ -221,6 +221,10 @@ struct entity {
|
||||
|
||||
virtual void attacked(int s) {}
|
||||
|
||||
virtual void spiked() {
|
||||
reduce_hp(10);
|
||||
}
|
||||
|
||||
virtual string glyph() = 0;
|
||||
virtual color_t color() = 0;
|
||||
|
||||
@ -283,6 +287,12 @@ struct man : public entity {
|
||||
string get_help() override { return "This is you."; }
|
||||
|
||||
void on_kill() override;
|
||||
|
||||
virtual void spiked() {
|
||||
entity::spiked();
|
||||
addMessage("OUCH! These spikes hurt!");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
extern man m;
|
||||
|
@ -97,7 +97,7 @@ void entity::apply_walls() {
|
||||
|
||||
auto pain_effect = [&] {
|
||||
if(!hurt_by_spikes()) return false;
|
||||
reduce_hp(10);
|
||||
spiked();
|
||||
vel.x = -vel.x; vel.y = -vel.y; apply_grav();
|
||||
return true;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user