diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-07 21:30:10 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-07 21:30:10 -0500 |
| commit | 43a6f971730a8441b47a44008a023e5af8cdb91c (patch) | |
| tree | afa57b2b3f0740f96037431863962c15a865b26c /gamemode/itemsystem | |
| parent | 12e7fff3321b4f0c827ddd3bb8dca7f8a58c6fc2 (diff) | |
| parent | 2de3779c361160a956f3da2c8e8a97b6af5d0783 (diff) | |
| download | wintersurvival2-43a6f971730a8441b47a44008a023e5af8cdb91c.tar.gz wintersurvival2-43a6f971730a8441b47a44008a023e5af8cdb91c.tar.bz2 wintersurvival2-43a6f971730a8441b47a44008a023e5af8cdb91c.zip | |
Fix for research table also snapping
Diffstat (limited to 'gamemode/itemsystem')
| -rw-r--r-- | gamemode/itemsystem/items/alter.lua | 15 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/campfire.lua | 15 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/fence.lua | 14 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/floor.lua | 14 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/infuser.lua | 14 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/ramp.lua | 14 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/researchtable.lua | 16 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/shack.lua | 9 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/tent.lua | 8 |
9 files changed, 97 insertions, 22 deletions
diff --git a/gamemode/itemsystem/items/alter.lua b/gamemode/itemsystem/items/alter.lua index 31d1b4f..c661ebb 100644 --- a/gamemode/itemsystem/items/alter.lua +++ b/gamemode/itemsystem/items/alter.lua @@ -1,7 +1,7 @@ ITEM.Name = "Alter"
ITEM.Class = "structure"
-ITEM.Desc = "This allows you to sacrifice your soul for a player."
+ITEM.Desc = "This allows you to sacrifice your soul for a player.\nHold down shift to snap"
ITEM.Model = "models/props_c17/gravestone003a.mdl"
ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_crow.png")
ITEM.Recipe = {
@@ -51,8 +51,17 @@ 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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+
+ drop:SetAngles(Angle(0,Aim,0))
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/campfire.lua b/gamemode/itemsystem/items/campfire.lua index 5cc4987..5295552 100644 --- a/gamemode/itemsystem/items/campfire.lua +++ b/gamemode/itemsystem/items/campfire.lua @@ -1,7 +1,7 @@ ITEM.Name = "Campfire"
ITEM.Class = "structure"
-ITEM.Desc = "Ready to be lit. Some assembly required."
+ITEM.Desc = "Ready to be lit. Some assembly required.\nHold down shift to snap"
ITEM.Model = "models/props_debris/wood_board07a.mdl"
ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_campfire")
ITEM.Recipe = {
@@ -67,8 +67,17 @@ 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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/fence.lua b/gamemode/itemsystem/items/fence.lua index e4a8217..1749713 100644 --- a/gamemode/itemsystem/items/fence.lua +++ b/gamemode/itemsystem/items/fence.lua @@ -1,7 +1,7 @@ ITEM.Name = "Fence"
ITEM.Class = "structure"
-ITEM.Desc = "Some basic wood structure for setting up camps."
+ITEM.Desc = "Some basic wood structure for setting up camps.\nHold down shift to snap"
ITEM.Model = "models/props_debris/wood_board07a.mdl"
ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_fence")
ITEM.Recipe = {
@@ -44,8 +44,16 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then
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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/floor.lua b/gamemode/itemsystem/items/floor.lua index c02815b..7db8999 100644 --- a/gamemode/itemsystem/items/floor.lua +++ b/gamemode/itemsystem/items/floor.lua @@ -1,7 +1,7 @@ ITEM.Name = "Floor"
ITEM.Class = "structure"
-ITEM.Desc = "Some basic wood structure for setting up camps."
+ITEM.Desc = "Some basic wood structure for setting up camps.\nHold down shift to snap"
ITEM.Model = "models/props_debris/wood_board07a.mdl"
ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_fence")
ITEM.Recipe = {
@@ -45,8 +45,16 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then
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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/infuser.lua b/gamemode/itemsystem/items/infuser.lua index d2f72ad..53aedf7 100644 --- a/gamemode/itemsystem/items/infuser.lua +++ b/gamemode/itemsystem/items/infuser.lua @@ -1,6 +1,6 @@ ITEM.Name = "Infuser"
ITEM.Class = "structure"
-ITEM.Desc = "Cast enchantments\nPlace runes nearby to boost magical power and have different effects"
+ITEM.Desc = "Cast enchantments\nPlace runes nearby to boost magical power and have different effects\nHold down shift to snap"
ITEM.Model = "models/props_junk/wood_crate002a.mdl"
ITEM.Icon = Material("settlement/icon_researchtable")
ITEM.Recipe = {
@@ -42,8 +42,16 @@ 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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/ramp.lua b/gamemode/itemsystem/items/ramp.lua index 96e6c27..7b9e5f2 100644 --- a/gamemode/itemsystem/items/ramp.lua +++ b/gamemode/itemsystem/items/ramp.lua @@ -1,7 +1,7 @@ ITEM.Name = "Ramp"
ITEM.Class = "structure"
-ITEM.Desc = "Some basic wood structure for setting up camps."
+ITEM.Desc = "Some basic wood structure for setting up camps.\nHold down shift to snap"
ITEM.Model = "models/props_debris/wood_board07a.mdl"
ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_fence")
ITEM.Recipe = {
@@ -45,8 +45,16 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then
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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/researchtable.lua b/gamemode/itemsystem/items/researchtable.lua index 8c5c9e5..57a209c 100644 --- a/gamemode/itemsystem/items/researchtable.lua +++ b/gamemode/itemsystem/items/researchtable.lua @@ -1,6 +1,10 @@ ITEM.Name = "Research Table"
ITEM.Class = "structure"
+<<<<<<< HEAD ITEM.Desc = "A table that gives hints every 30 seconds to nearby players"
+======= +ITEM.Desc = "A table to find recepies\nHold down shift to snap"
+>>>>>>> building-rotateable ITEM.Model = "models/props_junk/wood_crate001a.mdl"
ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_recipe.png")
ITEM.Recipe = {
@@ -40,8 +44,16 @@ 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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
diff --git a/gamemode/itemsystem/items/shack.lua b/gamemode/itemsystem/items/shack.lua index f66fe38..96790d6 100644 --- a/gamemode/itemsystem/items/shack.lua +++ b/gamemode/itemsystem/items/shack.lua @@ -1,7 +1,7 @@ ITEM.Name = "Shack"
ITEM.Class = "structure"
-ITEM.Desc = "An actual building... how convenient."
+ITEM.Desc = "An actual building... how convenient.\nHold down shift to snap"
ITEM.Model = "models/props_debris/wood_board07a.mdl"
ITEM.Icon = Material("settlement/icon_shack")
ITEM.Recipe = {
@@ -83,6 +83,13 @@ function ITEM:OnPrimary(pl,tr) local Ang = Angle(0,pl:GetAimVector():Angle().y+90,0)
local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Ang.yaw = Ang.yaw - (Ang.yaw%15)
+ 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..2c65eca 100644 --- a/gamemode/itemsystem/items/tent.lua +++ b/gamemode/itemsystem/items/tent.lua @@ -1,7 +1,7 @@ ITEM.Name = "Tent"
ITEM.Class = "structure"
-ITEM.Desc = "Something to duck under."
+ITEM.Desc = "Something to duck under.\nHold down shift to snap"
ITEM.Model = "models/props_debris/wood_board07a.mdl"
ITEM.Icon = Material("settlement/icon_tent")
ITEM.Recipe = {
@@ -50,6 +50,12 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then
local Ang = Angle(0,pl:GetAimVector():Angle().y+90,0)
local Pos = tr.HitPos
+ if(pl:KeyDown(IN_SPEED)) then
+ Pos.x = Pos.x - (Pos.x%20)
+ Pos.y = Pos.y - (Pos.y%20)
+ Pos.z = Pos.z - (Pos.z%20)
+ Ang.yaw = Ang.yaw - (Ang.yaw%15)
+ end
for k,v in pairs(self.Ghost) do
local Off = v.Pos*1
|
