Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/location/bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,18 @@ def _businessDialogue(self):
"with the morning. Wages come out of your purse, not this "
"account, so keep enough on you to cover them."
)
# totalWagesPaid is money the player has paid out, so it's quoted as
# a payroll, never as something the crew earned (#282).
if business.currentTier(self.player) >= 3:
return (
"A whole Fishing Fleet, paying out $%d in wages so far? "
"You could retire a wealthy soul if you keep banking those "
"profits!" % self.stats.totalWagesPaid
"A whole Fishing Fleet, with $%d paid out in wages so far? "
"Bank what's left once the crew are paid and you could retire "
"a wealthy soul!" % self.stats.totalWagesPaid
)
return (
"Your crew's brought in $%d in wages paid out so far - quite the "
"little enterprise! Don't let it all burn a hole in your pocket, "
"park some of it here and let it earn interest." % self.stats.totalWagesPaid
"Your crew have drawn $%d in wages so far - quite the little "
"enterprise! Keep enough in your purse for payday, and park the "
"rest here to earn interest." % self.stats.totalWagesPaid
)

def run(self):
Expand Down
20 changes: 20 additions & 0 deletions tests/location/test_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,26 @@ def test_npc_business_dialogue_fleet_tier():
assert "retire a wealthy soul" in bankInstance._businessDialogue()


@pytest.mark.parametrize("tier", [1, 3])
def test_npc_business_dialogue_quotes_wages_as_a_cost_not_income(tier):
# prepare - totalWagesPaid is money paid out to the crew, so Margaret
# mustn't call it something the crew brought in, or the player's profits
# (#282)
bankInstance = createBank()
boats.addBoat(bankInstance.player, tier)
bankInstance.player.workers = 2
bankInstance.stats.totalWagesPaid = 240

# call
response = bankInstance._businessDialogue()

# check
assert "$240" in response
assert "paid out in wages" in response or "drawn $240 in wages" in response
assert "brought in" not in response
assert "profits" not in response


@pytest.mark.parametrize("tier", [1, 3])
def test_npc_business_dialogue_quotes_no_wages_before_the_first_payday(tier):
# prepare - hired today, so no morning has paid them yet
Expand Down
Loading