diff --git a/lua/entities/gmod_wire_expression2/core/entity.lua b/lua/entities/gmod_wire_expression2/core/entity.lua index ad01bf0ea4..663ee1bb3b 100644 --- a/lua/entities/gmod_wire_expression2/core/entity.lua +++ b/lua/entities/gmod_wire_expression2/core/entity.lua @@ -450,6 +450,16 @@ e2function number entity:isNPC() if this:IsNPC() then return 1 else return 0 end end +e2function number entity:isNextBot() + if not IsValid(this) then return self:throw("Invalid entity!", 0) end + if this:IsNextBot() then return 1 else return 0 end +end + +e2function number entity:isRagdoll() + if not IsValid(this) then return self:throw("Invalid entity!", 0) end + if this:IsRagdoll() then return 1 else return 0 end +end + e2function number entity:isVehicle() if not IsValid(this) then return self:throw("Invalid entity!", 0) end if this:IsVehicle() then return 1 else return 0 end @@ -587,6 +597,18 @@ e2function number entity:isAsleep() if phys:IsAsleep() then return 1 else return 0 end end +e2function number entity:isGravityEnabled() + if not validPhysics(this) then return self:throw("Invalid entity!", 0) end + local phys = this:GetPhysicsObject() + if phys:IsGravityEnabled() then return 1 else return 0 end +end + +e2function number entity:isPenetrating() + if not validPhysics(this) then return self:throw("Invalid entity!", 0) end + local phys = this:GetPhysicsObject() + if phys:IsPenetrating() then return 1 else return 0 end +end + --[[******************************************************************************]] __e2setcost(30) -- temporary diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index e5a1a386bf..77a9e5f178 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -151,6 +151,18 @@ e2function number entity:isFlashlightOn() return this:FlashlightIsOn() and 1 or 0 end +e2function number entity:isSpeaking() + if not IsValid(this) then return self:throw("Invalid entity!", 0) end + if not this:IsPlayer() then return self:throw("Expected a Player but got Entity", 0) end + return this:IsSpeaking() and 1 or 0 +end + +e2function number entity:isBot() + if not IsValid(this) then return self:throw("Invalid entity!", 0) end + if not this:IsPlayer() then return self:throw("Expected a Player but got Entity", 0) end + return this:IsBot() and 1 or 0 +end + -------------------------------------------------------------------------------- e2function number entity:frags() diff --git a/lua/entities/gmod_wire_expression2/core/weapon.lua b/lua/entities/gmod_wire_expression2/core/weapon.lua index ff1295e5bf..1ed134604d 100644 --- a/lua/entities/gmod_wire_expression2/core/weapon.lua +++ b/lua/entities/gmod_wire_expression2/core/weapon.lua @@ -40,11 +40,7 @@ end e2function array entity:weapons() if not IsValid(this) then return {} end if not this:IsPlayer() then return {} end - local ret = {} - for k,v in pairs(this:GetWeapons()) do - ret[#ret + 1] = v - end - return ret + return this:GetWeapons() end [nodiscard] diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index d936659436..d0093edf3c 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -283,7 +283,12 @@ E2Helper.Descriptions["isPlayer(e:)"] = "Is the entity a player?" E2Helper.Descriptions["isOnFire(e:)"] = "Is the entity on fire?" E2Helper.Descriptions["isWeapon(e:)"] = "Is the entity a weapon?" E2Helper.Descriptions["isNPC(e:)"] = "Is the entity a NPC?" +E2Helper.Descriptions["isNextBot(e:)"] = "Is the entity a NextBot?" +E2Helper.Descriptions["isRagdoll(e:)"] = "Is the entity a ragdoll?" E2Helper.Descriptions["isFrozen(e:)"] = "Is the entity frozen?" +E2Helper.Descriptions["isAsleep(e:)"] = "Is the entity asleep?" +E2Helper.Descriptions["isPenetrating(e:)"] = "Is the entity penetrating another entity?" +E2Helper.Descriptions["isGravityEnabled(e:)"] = "Is gravity enabled for the entity?" E2Helper.Descriptions["isVehicle(e:)"] = "Is the entity a vehicle?" E2Helper.Descriptions["inVehicle(e:)"] = "Is the player in a vehicle?" E2Helper.Descriptions["isWorld(e:)"] = "Is the entity the world?" @@ -296,6 +301,8 @@ E2Helper.Descriptions["isSuperAdmin(e:)"] = "Is the player a super admin?" E2Helper.Descriptions["isAlive(e:)"] = "Is the player or NPC alive?" E2Helper.Descriptions["isCrouch(e:)"] = "Is the player crouching?" E2Helper.Descriptions["isFlashlightOn(e:)"] = "Returns 1 if the player has flashlight on, 0 otherwise" +E2Helper.Descriptions["isSpeaking(e:)"] = "Returns 1 if the player speaks, 0 otherwise" +E2Helper.Descriptions["isBot(e:)"] = "Returns 1 if the player is a bot, 0 otherwise" E2Helper.Descriptions["isTyping(e:)"] = "Is the player typing a message in chat?" E2Helper.Descriptions["isValid(e:)"] = "Returns 1 if the entity is valid, 0 otherwise" E2Helper.Descriptions["isValidPhysics(e:)"] = "Returns 1 if the entity has valid physics (players don't)"