aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem
diff options
context:
space:
mode:
authorAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-01-04 13:26:04 -0500
committerAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-01-04 13:26:04 -0500
commit698b6eedf1d6d2806c77895775bcf8245ce02229 (patch)
treedd408a93a59c2484cb97e3be95b9d26b14d30cda /gamemode/itemsystem
parentad6b6494ace327d04c71fdc8f74e2b2f26033d6a (diff)
downloadwintersurvival2-698b6eedf1d6d2806c77895775bcf8245ce02229.tar.gz
wintersurvival2-698b6eedf1d6d2806c77895775bcf8245ce02229.tar.bz2
wintersurvival2-698b6eedf1d6d2806c77895775bcf8245ce02229.zip
Added building snap
Diffstat (limited to 'gamemode/itemsystem')
-rw-r--r--gamemode/itemsystem/items/alter.lua8
-rw-r--r--gamemode/itemsystem/items/campfire.lua8
-rw-r--r--gamemode/itemsystem/items/fence.lua8
-rw-r--r--gamemode/itemsystem/items/floor.lua8
-rw-r--r--gamemode/itemsystem/items/infuser.lua8
-rw-r--r--gamemode/itemsystem/items/ramp.lua8
-rw-r--r--gamemode/itemsystem/items/researchtable.lua8
-rw-r--r--gamemode/itemsystem/items/shack.lua6
-rw-r--r--gamemode/itemsystem/items/tent.lua5
9 files changed, 60 insertions, 7 deletions
diff --git a/gamemode/itemsystem/items/alter.lua b/gamemode/itemsystem/items/alter.lua
index 31d1b4f..b60d30b 100644
--- a/gamemode/itemsystem/items/alter.lua
+++ b/gamemode/itemsystem/items/alter.lua
@@ -52,7 +52,13 @@ function ITEM:OnPrimary(pl,tr)
if (tr.Hit) then
local drop = ents.Create("ws_alter")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/campfire.lua b/gamemode/itemsystem/items/campfire.lua
index 5cc4987..f6ec4e6 100644
--- a/gamemode/itemsystem/items/campfire.lua
+++ b/gamemode/itemsystem/items/campfire.lua
@@ -68,7 +68,13 @@ function ITEM:OnPrimary(pl,tr)
if (tr.Hit and tr.HitWorld) then
local drop = ents.Create("ws_campfire")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/fence.lua b/gamemode/itemsystem/items/fence.lua
index e4a8217..d472aaa 100644
--- a/gamemode/itemsystem/items/fence.lua
+++ b/gamemode/itemsystem/items/fence.lua
@@ -45,7 +45,13 @@ function ITEM:OnPrimary(pl,tr)
local drop = ents.Create("ws_prop")
drop:SetModel("models/props_wasteland/wood_fence02a.mdl")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/floor.lua b/gamemode/itemsystem/items/floor.lua
index c02815b..82eb3ec 100644
--- a/gamemode/itemsystem/items/floor.lua
+++ b/gamemode/itemsystem/items/floor.lua
@@ -46,7 +46,13 @@ function ITEM:OnPrimary(pl,tr)
local drop = ents.Create("ws_prop")
drop:SetModel("models/props_wasteland/wood_fence02a.mdl")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,90))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/infuser.lua b/gamemode/itemsystem/items/infuser.lua
index d2f72ad..260e8fd 100644
--- a/gamemode/itemsystem/items/infuser.lua
+++ b/gamemode/itemsystem/items/infuser.lua
@@ -43,7 +43,13 @@ function ITEM:OnPrimary(pl,tr)
if (tr.Hit) then
local drop = ents.Create("ws_infuser")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/ramp.lua b/gamemode/itemsystem/items/ramp.lua
index 96e6c27..9d6fd2b 100644
--- a/gamemode/itemsystem/items/ramp.lua
+++ b/gamemode/itemsystem/items/ramp.lua
@@ -46,7 +46,13 @@ function ITEM:OnPrimary(pl,tr)
local drop = ents.Create("ws_prop")
drop:SetModel("models/props_wasteland/wood_fence02a.mdl")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,45))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/researchtable.lua b/gamemode/itemsystem/items/researchtable.lua
index 4b05cf2..b347828 100644
--- a/gamemode/itemsystem/items/researchtable.lua
+++ b/gamemode/itemsystem/items/researchtable.lua
@@ -41,7 +41,13 @@ function ITEM:OnPrimary(pl,tr)
if (tr.Hit) then
local drop = ents.Create("ws_researchtable")
drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0))
- drop:SetPos(tr.HitPos)
+ local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/shack.lua b/gamemode/itemsystem/items/shack.lua
index f66fe38..9090fb3 100644
--- a/gamemode/itemsystem/items/shack.lua
+++ b/gamemode/itemsystem/items/shack.lua
@@ -83,6 +83,12 @@ function ITEM:OnPrimary(pl,tr)
local Ang = Angle(0,pl:GetAimVector():Angle().y+90,0)
local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
+
for k,v in pairs(self.Ghost) do
local Off = v.Pos*1
Off:Rotate(Ang)
diff --git a/gamemode/itemsystem/items/tent.lua b/gamemode/itemsystem/items/tent.lua
index 1d5a1b5..3cbb207 100644
--- a/gamemode/itemsystem/items/tent.lua
+++ b/gamemode/itemsystem/items/tent.lua
@@ -50,6 +50,11 @@ function ITEM:OnPrimary(pl,tr)
if (tr.Hit) then
local Ang = Angle(0,pl:GetAimVector():Angle().y+90,0)
local Pos = tr.HitPos
+ if(GM:KeyPress(pl,IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ end
for k,v in pairs(self.Ghost) do
local Off = v.Pos*1