Module CorsixTH.CorsixTH.Lua.entities.machine
An `Object` which needs occasional repair (to prevent explosion).
Functions
| Machine:calculateSmoke (room) | Calculates whether smoke gets displayed for this machine (and if so, how much) |
| Machine:getRemainingUses () | Calculates the number of times the machine can be used before crashing (unless repaired first) |
| Machine:isBreaking () | Returns true if a machine is smoking/needs repair |
| Machine:machineUsed (room) | Call on machine use. |
| Machine:replaceMachine (cost) | Replace this machine (make it pretend it's brand new) |
| Machine:setRepairing (handyman) | Tells the machine to start showing the icon that it needs repair. |
Functions
- Machine:calculateSmoke (room)
-
Calculates whether smoke gets displayed for this machine (and if so, how much)
Parameters:
- room Do nothing if the room has already crashed
- Machine:getRemainingUses ()
- Calculates the number of times the machine can be used before crashing (unless repaired first)
- Machine:isBreaking ()
- Returns true if a machine is smoking/needs repair
- Machine:machineUsed (room)
-
Call on machine use. Handles crashing the machine & queueing repairs
Parameters:
- room Do nothing if the room has already crashed
- Machine:replaceMachine (cost)
-
Replace this machine (make it pretend it's brand new)
Parameters:
- cost (int) Cost to replace the machine
- Machine:setRepairing (handyman)
-
Tells the machine to start showing the icon that it needs repair.
also lock the room from patient entering
Parameters:
- handyman The handyman heading to this machine. nil if repairing is finished