mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-09-07 04:47:56 +00:00
ru:: icicles
This commit is contained in:
@@ -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;
|
||||
|
@@ -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!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user