mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-06-09 14:22:13 +00:00
ru:: short platforms
This commit is contained in:
@@ -532,6 +532,14 @@ struct horoplatform : public moving_platform {
|
||||
}
|
||||
};
|
||||
|
||||
struct length_platform : public moving_platform {
|
||||
unique_ptr<moving_platform> base; int len;
|
||||
virtual int width() { return len; }
|
||||
xy location_at(ld t) { return base->location_at(t); }
|
||||
string get_name() override { return "short " + base->get_name(); }
|
||||
string get_help() override { return base->get_help(); }
|
||||
};
|
||||
|
||||
struct cycloid_platform : public moving_platform {
|
||||
moving_platform *base;
|
||||
ld period, shift;
|
||||
|
||||
@@ -370,6 +370,17 @@ void load_room(fhstream& f, cell *c) {
|
||||
p = &*b;
|
||||
r.entities.emplace_back(std::move(b));
|
||||
}
|
||||
else if(cap == "LENGTH") {
|
||||
int len = get_int();
|
||||
for(auto& p: last_platform) {
|
||||
auto& f = find_entity(r, p);
|
||||
auto b = std::make_unique<length_platform>();
|
||||
b->len = len;
|
||||
p = &*b;
|
||||
b->base = std::move(as_platform(f));
|
||||
f = std::move(b);
|
||||
}
|
||||
}
|
||||
else if(cap == "SAW") for(auto p: last_platform) {
|
||||
auto& f = find_entity(r, p);
|
||||
auto b = std::make_unique<saw>(); nam(*b);
|
||||
|
||||
Reference in New Issue
Block a user