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