Console: show the three stages of the traffic access
ListPeriphery called the traffic access built only at stage 3 (condition byte 171 and above, the offer limit) and hid stages 1 and 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5ea213feb1
commit
ad1968420b
1 file changed
+7
-3
@@ -320,8 +320,12 @@ void Console::register_money_commands() {
|
||||
std::vector<std::vector<std::string>> rows;
|
||||
for (size_t o = 0; o < 14; ++o) {
|
||||
const bool building = s.days[o] != 0;
|
||||
const bool built = o == 0 ? s.level[o] >= 0xab : s.level[o] != 0; // as dispatch_stadium checks
|
||||
rows.push_back({std::to_string(o), text(kPeripheryNames + int(o)), building ? "building" : built ? "built" : "-",
|
||||
// The traffic access (object 0) has three stages: each finished build raises its
|
||||
// condition byte to the next multiple of 85 (85, 170, 255; ageing lowers it), and an
|
||||
// offer exists below 171. The other objects are built once.
|
||||
std::string state = s.level[o] != 0 ? "built" : "-";
|
||||
if (o == 0 && s.level[0] != 0) state = "stage " + std::to_string((s.level[0] - 1) / 85 + 1) + " of 3";
|
||||
rows.push_back({std::to_string(o), text(kPeripheryNames + int(o)), building ? "building" : state,
|
||||
std::to_string(s.days[o])});
|
||||
}
|
||||
emit_table({"Object", "Name", "State", "Days"}, rows);
|
||||
@@ -411,7 +415,7 @@ void Console::register_money_commands() {
|
||||
emit('+', "ticket price: " + std::to_string(desk().ticket_price));
|
||||
});
|
||||
|
||||
add({"Stadium.Periphery", "ListPeriphery", {}, "the 14 objects: built, building, days", false}, [show_periphery](const Values&) { show_periphery(); });
|
||||
add({"Stadium.Periphery", "ListPeriphery", {}, "the 14 objects: built (traffic access: stage 1-3), building, days", false}, [show_periphery](const Values&) { show_periphery(); });
|
||||
auto periphery = [this, stadium, stadium_request, dispatch_stadium](int object, int32_t price, bool build) {
|
||||
try {
|
||||
dispatch_stadium(stadium_request(stadium(), build ? ui::StadiumRequestKind::build_periphery : ui::StadiumRequestKind::decline_periphery,
|
||||
|
||||
Reference in new issue
Block a user