Skip to content

Commit 4aff0a0

Browse files
committed
more bath bribe clarifications
1 parent eb66327 commit 4aff0a0

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/towns/bath-house.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
Every town with a bathhouse has 4 councillors which can be bribed.
55

66
### Attendance
7-
Between 0 and 4 bribable councillors are present in the bath house.
7+
Between 0 and 4 bribable councillors attend the bath house.
88
The bath house panel has an array of attendance selection timestamps at offset `0xd4`, whose entries denote when the attendance in a given town will be updated.
99
These timestamps are updated to `now + 0x100` when
1010
- the bath house window is closed.
1111
- fast forward is activated.
1212
- the options screen is opened.
1313
- any window is opened after the bath house window has just been closed.
1414

15+
The pool of attending councillors is updated when the bath house window is opened and the selection timestamp is smaller than `now`.
1516
Therefore, continuously opening an individual bath house locks the current attendance.
1617

1718
Attendance is decided as follows:
@@ -39,14 +40,14 @@ It defines the following *bribe base factors* for each rank:
3940

4041
The bribe result is calculated as follows:
4142
```python
42-
def calculate_expected_bribe(rank: int, already_bribed: bool):
43+
def calculate_expected_bribe(rank: int, rand: int, already_bribed: bool):
4344
price = 500 * (rand % 11 + 4 * BRIBE_BASE_FACTORS[rank] + 16)
4445
if already_bribed:
4546
price *= 2
4647
return price
4748

48-
def calculate_bribe_result(amount: int, rank: int, already_bribed: bool):
49-
price = calculcate_expected_bribe(rank, already_bribed)
49+
def calculate_bribe_result(amount: int, rank: int, rand: int, already_bribed: bool):
50+
price = calculcate_expected_bribe(rank, rand, already_bribed)
5051
if amount < price:
5152
return BribeResult.OK
5253
elif amount >= price * 1.5:
@@ -55,6 +56,19 @@ def calculate_bribe_result(amount: int, rank: int, already_bribed: bool):
5556
return BribeResult.FAILED
5657
```
5758

59+
For unbribed councillors, this produces the following minimum and maximum bribes:
60+
61+
|Rank|Min|Max|
62+
|-|-|-|
63+
|Shopkeeper|8000|13000|
64+
|Trader|10000|15000|
65+
|Merchant|12000|17000|
66+
|Travelling Merchant|14000|19000|
67+
|Councillor|18000|23000|
68+
|Patrician|22000|27000|
69+
|Mayor|28000|33000|
70+
|Alderman|38000|43000|
71+
5872
### Result
5973
The result can be identified by the councillor's response:
6074

@@ -76,7 +90,7 @@ The current status of a councillor can be inferred by his lines:
7690
|Bribed by other merchant|*"Ah! You're here as well, John Doe? I have only very recently spoken to one of your competitors."*|
7791
|Not bribed by anyone, annoyed|*"Are you there again?! Let me have my bath in peace, please."*|
7892

79-
**The annoyance of the councillor with a given index is bugged and saved globally, as discussed in the Known Bugs chapter.**
93+
**The annoyance of a councillor with a given index is bugged and saved globally, as discussed in the Known Bugs chapter.**
8094

8195
### Limits
8296
The success operation has a check which probably should prevent a merchant from bribing more than 2 councillors in one town.

0 commit comments

Comments
 (0)