Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lua/entities/gmod_wire_expression2/core/entity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,26 @@ e2function number entity:getBodygroups(bgrp_id)
return this:GetBodygroupCount(bgrp_id)
end

E2Lib.registerConstant("BLOOD_DONT_BLEED", DONT_BLEED)
E2Lib.registerConstant("BLOOD_COLOR_RED", BLOOD_COLOR_RED)
E2Lib.registerConstant("BLOOD_COLOR_YELLOW", BLOOD_COLOR_YELLOW)
E2Lib.registerConstant("BLOOD_COLOR_GREEN", BLOOD_COLOR_GREEN)
E2Lib.registerConstant("BLOOD_COLOR_MECH", BLOOD_COLOR_MECH)
E2Lib.registerConstant("BLOOD_COLOR_ANTLION", BLOOD_COLOR_ANTLION)
E2Lib.registerConstant("BLOOD_COLOR_ZOMBIE", BLOOD_COLOR_ZOMBIE)
E2Lib.registerConstant("BLOOD_COLOR_ANTLION_WORKER", BLOOD_COLOR_ANTLION_WORKER)

e2function void entity:setBloodColor(number bloodcolor)
if not IsValid(this) then return self:throw("Invalid entity!", nil) end
if not isOwner(self, this) then return self:throw("You do not own this entity!", nil) end
this:SetBloodColor(math.Clamp(bloodcolor, -1, 6))
end

e2function number entity:getBloodColor()
if not IsValid(this) then return self:throw("Invalid entity!", -1) end
return this:GetBloodColor() or -1
end

--[[******************************************************************************]]

e2function number entity:isPlayerHolding()
Expand Down
2 changes: 2 additions & 0 deletions lua/wire/client/e2descriptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,8 @@ E2Helper.Descriptions["runOnChat(n)"] = "DEPRECATED. Use 'event chat(Player:enti
-- Color
E2Helper.Descriptions["setBodygroup(e:nn)"] = "Group ID, Group SubID\nSets the bodygroups of the given entity"
E2Helper.Descriptions["getBodygroups(e:n)"] = "Group ID\nReturns the number of bodygroups in the Group ID of the given entity"
E2Helper.Descriptions["setBloodColor(e:n)"] = "Sets the blood color of an entity via a number (_BLOOD)."
E2Helper.Descriptions["getBloodColor(e:)"] = "Returns the blood color of an entity as a number (_BLOOD)."
E2Helper.Descriptions["setColor(nnn)"] = "Sets the color of the E2 chip"
E2Helper.Descriptions["setColor(e:vn)"] = "Sets the color (as vector) and alpha (as number) of the entity"
E2Helper.Descriptions["setColor(e:xv4)"] = "Sets the color and alpha (as 4D vector) of the entity"
Expand Down
Loading