Modern: the traffic access has four stages
The Modern interface shows four stages for the traffic access, the original has three. A Modern world (WorldLayout::traffic_stages = 4) keeps the condition byte in steps of 64 (64, 128, 192, 255) and offers a build up to stage 3; every stage weighs as one original stage. New careers convert the original start table, older Modern saves are converted on load (traffic_scale). Classic data keeps three stages; the Classic equivalence is unchanged. Also: the live ticker takes the matches from the desk day on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fda4b72967
commit
0046ab90d0
18 files changed
+154
-16
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "modern/game/traffic.hpp"
|
||||
#include "modern/game/modern_state.hpp"
|
||||
#include "modern/game/weekly.hpp"
|
||||
#include "modern/game/club_player_detail.hpp"
|
||||
@@ -171,7 +172,7 @@ int facility_rating(ModernState& g, int manager, int* second, WatcomRandom* rand
|
||||
const uint8_t v = rec.b(size_t(i));
|
||||
if (v == 0) continue;
|
||||
int level;
|
||||
if (i < 0xe || i == 0x10 || i == 0x11) level = i == 0 ? (v - 1) / 0x55 + 1 : 1;
|
||||
if (i < 0xe || i == 0x10 || i == 0x11) level = i == 0 ? traffic_stage(v) : 1;
|
||||
else level = rec.b(size_t(i) + 0x2e) & 7;
|
||||
sum += (level & 0xFF) * kFacility[i * 5];
|
||||
}
|
||||
@@ -365,7 +366,7 @@ void facility_ageing(ModernState& g, int manager, GameRandom& game, WatcomRandom
|
||||
if (weeks == 0 && rec.b(size_t(i)) != 0 && rec.b(0x1e + size_t(i)) == 0) {
|
||||
uint8_t& v = rec.b(size_t(i));
|
||||
v--;
|
||||
if ((i == 0 && v % 0x55 == 0) || rec.b(0x1e + size_t(i)) + v == 0) {
|
||||
if ((i == 0 && traffic_stage_boundary(v)) || rec.b(0x1e + size_t(i)) + v == 0) {
|
||||
if (i < 0xe) {
|
||||
message = true;
|
||||
} else if (i < 0x16) {
|
||||
@@ -388,7 +389,7 @@ void facility_ageing(ModernState& g, int manager, GameRandom& game, WatcomRandom
|
||||
uint8_t& build = rec.b(0x1e + size_t(i));
|
||||
if (build != 0 && --build == 0) {
|
||||
uint8_t& v = rec.b(size_t(i));
|
||||
if (i == 0) v = uint8_t((v == 0 ? 1 : (v - 1) / 0x55 + 2) * 0x55);
|
||||
if (i == 0) v = traffic_after_build(v);
|
||||
else v = uint8_t(rand.range(kFacility[i * 5 + 2], kFacility[i * 5 + 3]) << 2);
|
||||
if (i > 0xd) {
|
||||
rec.b(0x2e + size_t(i)) = uint8_t((rec.b(0x2e + size_t(i)) >> 4) & 7);
|
||||
|
||||
Reference in new issue
Block a user