1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-07 04:47:56 +00:00

ru:: icicles

This commit is contained in:
Zeno Rogue
2025-08-04 23:50:55 +02:00
parent dd14600837
commit 120698379f
4 changed files with 50 additions and 0 deletions

View File

@@ -652,6 +652,19 @@ struct guineapig : public enemy {
int max_hp() { return 300; }
};
struct icicle : public enemy {
bool falling;
vector<xy> fallframes;
xy siz() override { return {10, 10}; }
string glyph() override { return "|"; }
color_t color() override { return 0xA0A0F0FF; }
void act() override;
string get_name() override { return "icicle"; }
string get_help() override { return "A dangerous looking icicle."; }
int base_xp() { return 1; }
int max_hp() { return 1; }
};
struct hint : public entity {
string hint_text;
int state;

View File

@@ -792,4 +792,30 @@ void disnake::act() {
}
}
void icicle::act() {
fallthru = true;
if(fallframes.empty()) {
while(isize(fallframes) < 9999) {
fallframes.push_back(where);
kino();
if(on_floor) break;
}
regenerate();
}
if(!falling) {
auto w = m.where;
for(auto f: fallframes) {
if(intersect(get_pixel_bbox_at(f), m.get_pixel_bbox_at(w))) falling = true;
w += m.vel;
}
}
if(falling) {
kino();
if(on_floor) existing = false;
}
if(intersect(get_pixel_bbox(), m.get_pixel_bbox())) {
if(m.reduce_hp(50)) addMessage("An icicle falls on you!");
}
}
}

View File

@@ -1557,6 +1557,10 @@ MAP
################################################################################
#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b#b
ROPE 300 0 0.7 50 5 0 60
ICICLE 60 60
ICICLE 552 63
ICICLE 597 118
ICICLE 577 151
OK
MOVE 1 Swinging Rope Room

View File

@@ -231,6 +231,13 @@ void load_room(fhstream& f, cell *c) {
b->respawn = b->where; b->respawn_spindir = b->spindir; b->postfix();
r.entities.emplace_back(std::move(b));
}
else if(cap == "ICICLE") {
auto b = std::make_unique<icicle>();
sscanf(param.c_str(), "%lf%lf", &b->where.x, &b->where.y);
b->falling = false; b->vel = xy{0,0};
b->respawn = b->where; b->postfix();
r.entities.emplace_back(std::move(b));
}
else if(cap == "VTRAP") {
auto b = std::make_unique<vtrap>();
sscanf(param.c_str(), "%lf%lf", &b->where.x, &b->where.y);