Shared definition of the cw_emptyration entity of the Ration Factory plugin, with the networked water, supplements
and full flags and IsFull.
Originally written for the Iron Wall community.
Summary
Methods
breens_water or citizen_supplements item entity the packet still lacks.Methods
ENT:CheckFull()
server gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/init.lua:102Marks the packet full once it holds both the water and the supplements.
ENT:Draw()
client gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/cl_init.lua:34Draws the packet's model.
ENT:Explode()
server gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/init.lua:39Plays the effect and sound of the packet breaking apart.
ENT:HUDPaintTargetID(x, y, alpha)
client gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/cl_init.lua:9Draws what the packet contains and whether it is ready when the player looks at it.
Parameters
- x
- y
- alpha
ENT:Initialize()
server gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/init.lua:14Sets up the empty ration packet with 25 health and nothing inside.
ENT:IsFull()
shared gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/shared.lua:25Returns whether the packet holds both water and supplements.
Returns
- Boolean Whether the packet is full
ENT:OnTakeDamage(damageInfo)
server gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/init.lua:57Takes damage off the packet's health and breaks it when the health runs out.
Parameters
- damageInfo
ENT:SetupDataTables()
shared gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/shared.lua:16Sets up the networked flags for the water, the supplements and the full state.
ENT:Touch(ent)
server gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/init.lua:69Absorbs a touching breens_water or citizen_supplements item entity the packet still lacks.
The item is flagged as it is absorbed: it only disappears at the end of the tick, and could fill a second packet that touches it until then.
Parameters
- ent
ENT:UpdateTransmitState()
server gamemodes/cwhl2rp/plugins/rationfactory/plugin/entities/entities/cw_emptyration/init.lua:52Makes the packet always transmit to clients.