aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/itemsystem/weapons_common.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-08-27 17:08:46 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-08-27 17:08:46 -0400
commit9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a (patch)
treed65b57e144317e5b49ccdd549b2f97c61d54bd1d /gamemode/shared/itemsystem/weapons_common.lua
parentd4f197a35c207c9891d3f4dc5e9708af48c935de (diff)
downloadartery-9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a.tar.gz
artery-9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a.tar.bz2
artery-9adcb3c73a8d0e7ecfe66b30da630c6c2e67f03a.zip
Moved prayers to their own system
Diffstat (limited to 'gamemode/shared/itemsystem/weapons_common.lua')
-rw-r--r--gamemode/shared/itemsystem/weapons_common.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/gamemode/shared/itemsystem/weapons_common.lua b/gamemode/shared/itemsystem/weapons_common.lua
index 5da9b9a..6e73318 100644
--- a/gamemode/shared/itemsystem/weapons_common.lua
+++ b/gamemode/shared/itemsystem/weapons_common.lua
@@ -1,7 +1,9 @@
ART = ART or {}
-
+--- Finds the direction a player is moveing.
+-- @param player The player to find the move direction of
+-- @return The string "forward", "backward", "right", or "left"
function ART.playermovedir(player)
local vel = player:GetVelocity():GetNormalized()
vel.z = 0
@@ -17,8 +19,14 @@ function ART.playermovedir(player)
return swings[1][2]
end
-local positionset = {}
+local positionset = {}
+--- The arc swing of a weapon.
+-- Finds anything that a weapon should hit in it's swing, and calls a function on it.
+-- @param player The player that's swinging the weapon
+-- @param tiems A table of times that the trace calculations should be done at, this table needs to be the same length as the positions table
+-- @param positions The position offsets from the player that swung that should be the start/end points of the arc
+-- @param onhit A function to call on any entities that were hit in the swing of the weapon.
function ART.swingarc(player,times,positions,onhit)
local positionpoints = {}
table.insert(positionset,positionpoints)