Log inGet started
Package

heat.module

README.md

heat

How wanted the suspect is: one number, cut into named levels by data.

Heat only rises through named offences (cfg.heat.offences) and, while a pursuit lasts, by a slow tick. It only
falls while nobody is looking, after a grace period. Level changes are moments (returned and emitted).

  local Heat = require("~.modules.heat")
  local heat = Heat.new(cfg.heat, hub?)          -- hub (pursuitKit.modules.hub) is optional
  heat:add("seen")                               -- points for a named offence; returns points added
  heat:addPoints(5, "scripted")                  -- raw points
  heat:tick(dt, "pursuit" | "clear" | other)     -- pursuit ticks up, clear decays after the grace, others hold
  heat:escaped()                                 -- applies cfg.heat.escape.factor
  heat.value   heat:level()   heat:levelName()   heat:fraction()   -- 0-based level; share of the way to the next
  heat:setDecayFactor(1.5)                       -- a host rule (friendly ground cools faster)

Events on the hub: "heat" { value, level, name, delta, offence }, "heatLevel" { from, to, name }.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.