diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-03-07 19:08:07 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-03-07 19:08:07 -0500 |
| commit | 2ee250838adf01f1b4558b6afa7791bfbb1d583b (patch) | |
| tree | f65f28120f8cd5abaf213087ad9e4b90f2fdcf97 /gamemode | |
| parent | 8a02f6693c40d99ab359065d53e8c22ef8554948 (diff) | |
| download | wintersurvival2-2ee250838adf01f1b4558b6afa7791bfbb1d583b.tar.gz wintersurvival2-2ee250838adf01f1b4558b6afa7791bfbb1d583b.tar.bz2 wintersurvival2-2ee250838adf01f1b4558b6afa7791bfbb1d583b.zip | |
Added half-versions of floor and ramps
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/itemsystem/items/floor.lua | 9 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/floorhalf.lua | 66 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/ramp.lua | 7 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/ramphalf.lua | 66 |
4 files changed, 137 insertions, 11 deletions
diff --git a/gamemode/itemsystem/items/floor.lua b/gamemode/itemsystem/items/floor.lua index 7db8999..21216f3 100644 --- a/gamemode/itemsystem/items/floor.lua +++ b/gamemode/itemsystem/items/floor.lua @@ -10,9 +10,6 @@ ITEM.Recipe = { ["Wood"] = 3,
["Sap"] = 1,
},
- Tools = {
- ["Crystal"] = 1,
- },
}
ITEM.Structure = {
@@ -21,13 +18,13 @@ ITEM.Structure = { Model = "models/props_junk/Rock001a.mdl",
Size = Vector(0.5,0.5,0.5),
Pos = Vector(4,-3,-1),
- Ang = Angle(0,0,0),
+ Ang = Angle(0,0,90),
},
}
ITEM.Ghost = {
{
- Model = "models/props_wasteland/wood_fence02a.mdl",
+ Model = "models/props_wasteland/wood_fence01a.mdl",
Size = Vector(1,1,1),
Pos = Vector(0,0,0),
Ang = Angle(0,0,90),
@@ -44,7 +41,7 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then
local drop = ents.Create("ws_prop")
- drop:SetModel("models/props_wasteland/wood_fence02a.mdl")
+ drop:SetModel("models/props_wasteland/wood_fence01a.mdl")
local Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
local Pos = tr.HitPos
if(pl:KeyDown(IN_SPEED)) then
diff --git a/gamemode/itemsystem/items/floorhalf.lua b/gamemode/itemsystem/items/floorhalf.lua new file mode 100644 index 0000000..5cc740a --- /dev/null +++ b/gamemode/itemsystem/items/floorhalf.lua @@ -0,0 +1,66 @@ + +ITEM.Name = "Half Floor" +ITEM.Class = "structure" +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 = { + Resources = { + ["Floor"] = 2, + }, + Tools = { + ["Axe"] = 1, + }, +} + +ITEM.Structure = { + { + Bone = "ValveBiped.Bip01_R_Hand", + Model = "models/props_junk/Rock001a.mdl", + Size = Vector(0.5,0.5,0.5), + Pos = Vector(4,-3,-1), + Ang = Angle(0,0,90), + }, +} + +ITEM.Ghost = { + { + Model = "models/props_wasteland/wood_fence02a.mdl", + Size = Vector(1,1,1), + Pos = Vector(0,0,0), + Ang = Angle(0,0,90), + }, +} + +ITEM.Range = 200 +ITEM.CD = 0.5 + +function ITEM:OnPrimary(pl,tr) + if (CLIENT) then return end + + if (!pl:CanPlaceStructure(tr)) then pl:GhostStructure(self.Name) return end + + if (tr.Hit) then + local drop = ents.Create("ws_prop") + drop:SetModel("models/props_wasteland/wood_fence02a.mdl") + 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() + + if (pl:HasItem(self.Name)) then pl:RemoveItem(self.Name,1) + else pl:UnEquipWeaponSlot(pl.Select,true) end + + pl:GhostRemove() + else + pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(90,110)) + end +end diff --git a/gamemode/itemsystem/items/ramp.lua b/gamemode/itemsystem/items/ramp.lua index 7b9e5f2..3b497de 100644 --- a/gamemode/itemsystem/items/ramp.lua +++ b/gamemode/itemsystem/items/ramp.lua @@ -10,9 +10,6 @@ ITEM.Recipe = { ["Log"] = 1,
["Sap"] = 1,
},
- Tools = {
- ["Crystal"] = 1,
- },
}
ITEM.Structure = {
@@ -27,7 +24,7 @@ ITEM.Structure = { ITEM.Ghost = {
{
- Model = "models/props_wasteland/wood_fence02a.mdl",
+ Model = "models/props_wasteland/wood_fence01a.mdl",
Size = Vector(1,1,1),
Pos = Vector(0,0,0),
Ang = Angle(0,0,45),
@@ -44,7 +41,7 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then
local drop = ents.Create("ws_prop")
- drop:SetModel("models/props_wasteland/wood_fence02a.mdl")
+ drop:SetModel("models/props_wasteland/wood_fence01a.mdl")
local Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
local Pos = tr.HitPos
if(pl:KeyDown(IN_SPEED)) then
diff --git a/gamemode/itemsystem/items/ramphalf.lua b/gamemode/itemsystem/items/ramphalf.lua new file mode 100644 index 0000000..0abc692 --- /dev/null +++ b/gamemode/itemsystem/items/ramphalf.lua @@ -0,0 +1,66 @@ + +ITEM.Name = "Half Ramp" +ITEM.Class = "structure" +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 = { + Resources = { + ["Ramp"] = 1, + }, + Tools = { + ["Axe"] = 1, + }, +} + +ITEM.Structure = { + { + Bone = "ValveBiped.Bip01_R_Hand", + Model = "models/props_junk/Rock002a.mdl", + Size = Vector(0.5,0.5,0.5), + Pos = Vector(4,-3,-1), + Ang = Angle(0,0,0), + }, +} + +ITEM.Ghost = { + { + Model = "models/props_wasteland/wood_fence02a.mdl", + Size = Vector(1,1,1), + Pos = Vector(0,0,0), + Ang = Angle(0,0,45), + }, +} + +ITEM.Range = 200 +ITEM.CD = 0.5 + +function ITEM:OnPrimary(pl,tr) + if (CLIENT) then return end + + if (!pl:CanPlaceStructure(tr)) then pl:GhostStructure(self.Name) return end + + if (tr.Hit) then + local drop = ents.Create("ws_prop") + drop:SetModel("models/props_wasteland/wood_fence02a.mdl") + 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() + + if (pl:HasItem(self.Name)) then pl:RemoveItem(self.Name,1) + else pl:UnEquipWeaponSlot(pl.Select,true) end + + pl:GhostRemove() + else + pl:EmitSound(Sound("weapons/iceaxe/iceaxe_swing1.wav"),100,math.random(90,110)) + end +end |
