five-on-it / packages/ai/src/wanted / commitCrime
Function: commitCrime()
commitCrime(
w,crime,tick,maxStars?):boolean
Defined in: packages/ai/src/wanted.ts:412
Charges a crime to its player's Wanted level: the Heat rises (gunfire and shots at a police car at most once per WANTED's rate, speeding once per its own), the stars with it up to five, and the crime's place is where the police think the player is. An escalation by a player at five stars or more, with the Heat at 90 or more after it, adds a star (one per WANTED.escalateTicks); above five the Heat is at its cap. Nothing goes past the room's maxStars (nor the Heat past what holds them). Returns whether it counted.
Parameters
w
crime
tick
number
maxStars?
number = MAX_STARS
Returns
boolean