1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-03-16 01:59:44 +00:00

destroy missiles and disnakes on fountain

This commit is contained in:
Zeno Rogue
2025-12-06 22:08:22 +01:00
parent 00db50c2fd
commit 1477ca60f6
3 changed files with 7 additions and 1 deletions

View File

@@ -319,6 +319,8 @@ struct entity {
virtual string get_help() { return "No help about this."; }
virtual bool hit_by_missile(missile *m) { return false; }
virtual void on_fountain();
};
struct statdata {
@@ -614,6 +616,7 @@ struct disnake : public snake {
int max_hp() override { return 1; }
void unact() override { destroyed = true; }
int bite() override { return 5; }
void on_fountain() override { destroyed = true; }
};
struct kestrel : public enemy {
@@ -776,6 +779,7 @@ struct missile : public entity {
void hit_wall() override { destroyed = true; }
struct missile* as_missile() override { return this; }
virtual void hs(stater& s) override { entity::hs(s); s.act("power", power, 0); }
void on_fountain() override { destroyed = true; }
};
struct ice_missile : public missile {

View File

@@ -17,6 +17,8 @@ bbox entity::get_pixel_bbox_at(xy p, ld scalex, ld scaley) {
return b;
}
void entity::on_fountain() { hs(fountain_resetter); }
bool entity::visible(room *r) {
auto bb = get_intersect(pixel_to_block(get_pixel_bbox()), room_bb);
for(int y = bb.miny; y < bb.maxy; y++) for(int x = bb.minx; x < bb.maxx; x++) if(r->fov[y][x]) return true;

View File

@@ -12,7 +12,7 @@ xy stable_where;
void regenerate_all() {
m.hs(fountain_resetter);
for(auto& p: powers) p.refill();
for(auto& r: rooms) for(auto& e: r.second.entities) e->hs(fountain_resetter);
for(auto& r: rooms) for(auto& e: r.second.entities) e->on_fountain();
revert_all(fountain_revert);
current_target = nullptr;
shuffle_all();