diff --git a/lua/entities/gmod_wire_expression2/core/entity.lua b/lua/entities/gmod_wire_expression2/core/entity.lua index 9b831c7314..a12a13f817 100644 --- a/lua/entities/gmod_wire_expression2/core/entity.lua +++ b/lua/entities/gmod_wire_expression2/core/entity.lua @@ -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() diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index 6558c3a3ab..28849e244c 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -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"