mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-22 10:52:49 +00:00
ru:: NPCs
This commit is contained in:
parent
0797e540d6
commit
d93f0b0430
@ -177,11 +177,14 @@ struct man : public entity {
|
||||
|
||||
extern man m;
|
||||
|
||||
struct sage : public entity {
|
||||
struct npc : public entity {
|
||||
string sglyph, name;
|
||||
color_t col;
|
||||
string text;
|
||||
double sx() override { return 12; }
|
||||
double sy() override { return 12; }
|
||||
string glyph() override { return hallucinating ? "D" : "A"; }
|
||||
color_t color() override { return hallucinating ? 0xFF0000FF : 0x90FF90FF; }
|
||||
string glyph() override { return sglyph; }
|
||||
color_t color() override { return col; }
|
||||
};
|
||||
|
||||
struct item : public entity {
|
||||
|
@ -118,6 +118,15 @@ void load_room(fhstream& f, cell *c) {
|
||||
b->pickup_message = scanline_noblank(f);
|
||||
r.entities.emplace_back(std::move(b));
|
||||
}
|
||||
else if(cap == "NPC") {
|
||||
auto b = std::make_unique<npc>();
|
||||
sscanf(param.c_str(), "%lf%lf%08x", &b->where_x, &b->where_y, &b->col);
|
||||
s = scanline_noblank(f);
|
||||
b->sglyph = s[0];
|
||||
b->name = s.substr(1);
|
||||
b->text = scanline_noblank(f);
|
||||
r.entities.emplace_back(std::move(b));
|
||||
}
|
||||
else println(hlog, "unknown mapline ", s);
|
||||
}
|
||||
else println(hlog, "unknown mapline ", s);
|
||||
|
Loading…
x
Reference in New Issue
Block a user