1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-23 01:47:39 +00:00

ru:: shops

This commit is contained in:
Zeno Rogue
2025-05-11 01:37:14 +02:00
parent 30e0adef50
commit 5bd984e508
5 changed files with 155 additions and 9 deletions

View File

@@ -120,6 +120,17 @@ void load_room(fhstream& f, cell *c) {
b->pickup_message = scanline_noblank(f);
r.entities.emplace_back(std::move(b));
}
else if(cap == "SHOPITEM") {
auto b = std::make_unique<shopitem>();
b->qty = 1; b->qty1 = 0;
sscanf(param.c_str(), "%lf%lf%d%d%d", &b->where.x, &b->where.y, &b->price, &b->qty, &b->qty1);
s = scanline_noblank(f);
b->id = -1;
for(int i=0; i<isize(powers); i++) if(powers[i].name == s) b->id = i;
if(b->id == -1) println(hlog, "error: unknown item name ", s), b->id = 0;
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);
@@ -129,6 +140,13 @@ void load_room(fhstream& f, cell *c) {
b->text = scanline_noblank(f);
r.entities.emplace_back(std::move(b));
}
else if(cap == "TRADER") {
auto b = std::make_unique<trader>();
sscanf(param.c_str(), "%lf%lf", &b->where.x, &b->where.y);
b->name = scanline_noblank(f);
b->text = scanline_noblank(f);
r.entities.emplace_back(std::move(b));
}
else if(cap == "BOAR") {
auto b = std::make_unique<boar>();
sscanf(param.c_str(), "%lf%lf", &b->where.x, &b->where.y);