Skip to content

five-on-it / packages/sim/src/cash

packages/sim/src/cash ​

Cash (GAME_DESIGN §14): one purse per player, a number of dollars the room keeps for as long as it lasts (SimWorld.cash, by client id). Everything that pays or charges goes through it: a mission's reward pays into it (the server's missions), the cash items a player picks up (off the ground, out of a crate, a trunk or a body's pockets) are counted into it rather than into a slot, and the garages (a respray, storing a car), the shops and the police's fines take from it. So a player has one Cash, the wallet the HUD shows.

Cash still lies around as an item (a mission hides banknotes in a locker, a guard carries them): only a player's own hands turn it into Cash. The server is the judge: what the clients predict of it is put right by the inventory message.

Variables ​

Functions ​