Sly 1:Damage

In Sly 1, the player takes damage on contact with ZAP volumes. Taking damage always results in death, unless you have a lucky charm.

ZAP volumes
In, Zap volumes are placed around level hazards and spawned in by guard attacks. The damage type for a zap volume can be one of several values as dictated by the ZAPK enum.

The  function checks whether Sly is touching a zap volume. If so, his JTS is set to. Subsequently,  is called during his update function to check if the damage is the damage is fatal.

ZAPK
The ZAPK enum controls which animation will play when Sly triggers a zap volume. It has the following possible values.

Lucky charms
The function  is called each time Sly takes damage.


 * It first checks whether the  value on the current game state is greater than zero.
 * It then checks if the infinite charms cheat is enabled.

In either case, the function returns true and the charm is used to save JT from dying. If the player has 0 charms and the cheat is disabled, the function returns false.

May 2002 demo
In the May 2002 Demo build there is a debug flag that makes zap volumes visible. The zap volumes are rendered as red wireframe boxes, and Sly takes damage upon coming into contact with them. The flag is located at address 0x28C174 and it can be set to 1 to make the zap volumes visible.