diff options
21 files changed, 119 insertions, 104 deletions
diff --git a/content/sound/Axe Hit-SoundBible.com-2003027449.wav b/content/sound/Axe Hit-SoundBible.com-2003027449.wav Binary files differnew file mode 100644 index 0000000..68545bb --- /dev/null +++ b/content/sound/Axe Hit-SoundBible.com-2003027449.wav diff --git a/content/sound/Splitting Wood-SoundBible.com-472830800.wav b/content/sound/Splitting Wood-SoundBible.com-472830800.wav Binary files differnew file mode 100644 index 0000000..db725f1 --- /dev/null +++ b/content/sound/Splitting Wood-SoundBible.com-472830800.wav diff --git a/content/sound/Woodcutting-J_Blow-2014925903.wav b/content/sound/Woodcutting-J_Blow-2014925903.wav Binary files differnew file mode 100644 index 0000000..3ff3262 --- /dev/null +++ b/content/sound/Woodcutting-J_Blow-2014925903.wav diff --git a/content/sound/stephan_schutze-anvil_impact-1135611152.wav b/content/sound/stephan_schutze-anvil_impact-1135611152.wav Binary files differnew file mode 100644 index 0000000..2152918 --- /dev/null +++ b/content/sound/stephan_schutze-anvil_impact-1135611152.wav diff --git a/content/sound/stephan_schutze-anvil_impact_1x-894647867.wav b/content/sound/stephan_schutze-anvil_impact_1x-894647867.wav Binary files differnew file mode 100644 index 0000000..f6d60f9 --- /dev/null +++ b/content/sound/stephan_schutze-anvil_impact_1x-894647867.wav diff --git a/content/sound/swoosh1.wav b/content/sound/swoosh1.wav Binary files differnew file mode 100644 index 0000000..91ceeed --- /dev/null +++ b/content/sound/swoosh1.wav diff --git a/content/sound/swoosh2.mp3 b/content/sound/swoosh2.mp3 Binary files differnew file mode 100644 index 0000000..312a12b --- /dev/null +++ b/content/sound/swoosh2.mp3 diff --git a/content/sound/swoosh3.wav b/content/sound/swoosh3.wav Binary files differnew file mode 100644 index 0000000..1723c4e --- /dev/null +++ b/content/sound/swoosh3.wav diff --git a/content/sound/swoosh4.wav b/content/sound/swoosh4.wav Binary files differnew file mode 100644 index 0000000..bd42737 --- /dev/null +++ b/content/sound/swoosh4.wav diff --git a/content/sound/swoosh5.wav b/content/sound/swoosh5.wav Binary files differnew file mode 100644 index 0000000..c82e1d9 --- /dev/null +++ b/content/sound/swoosh5.wav diff --git a/entities/entities/art_droppeditem/init.lua b/entities/entities/art_droppeditem/init.lua index a403dd0..effc96b 100644 --- a/entities/entities/art_droppeditem/init.lua +++ b/entities/entities/art_droppeditem/init.lua @@ -15,16 +15,21 @@ function ENT:Initialize() assert(self.Item ~= nil, "Attempted to drop something without .Item set!") self.ItemName = self.Item.Name self.ItemData = self.Item.Data - if self.Item.onDropped then - self:SetColor(Color(0,0,0,0)) - local od = self.Item.onDropped - if od ~= nil then - timer.Simple(1,function() - if self and self.Item then - od(self.Item,self) - end - end) - end + local phoney = itm.GetItemFromData(self.ItemName,self.ItemData) + print("About to check for onDropped",phoney,phoney.onDropped) + PrintTable(phoney) + if phoney.onDropped ~= nil then + timer.Simple(1,function() + phoney:onDropped(self) + self:SetColor(Color(0,0,0,0)) + end) + -- print("Item had onDropped") + -- self:SetColor(Color(0,0,0,0)) + -- timer.Simple(0,function() + -- if self and self.Item then + -- self.Item:onDropped(self) + -- end + -- end) end print("Dropped item spawned at", self:GetPos()) self:DrawShadow(false) diff --git a/entities/entities/info_huntablespawn/cl_init.lua b/entities/entities/info_huntablespawn/cl_init.lua index f851bf9..ec800fb 100644 --- a/entities/entities/info_huntablespawn/cl_init.lua +++ b/entities/entities/info_huntablespawn/cl_init.lua @@ -10,60 +10,4 @@ function ENT:Draw() --self:DrawModel() render.SetColorMaterial() render.DrawSphere( self:GetPos(), 10, 30, 30, Color( 255, 0, 0, 100 ) ) - -end - -/*--------------------------------------------------------- - Name: DrawTranslucent - Desc: Draw translucent ----------------------------------------------------------*/ -function ENT:DrawTranslucent() - - // This is here just to make it backwards compatible. - // You shouldn't really be drawing your model here unless it's translucent - - --self:Draw() - -end - -/*--------------------------------------------------------- - Name: BuildBonePositions - Desc: ----------------------------------------------------------*/ -function ENT:BuildBonePositions( NumBones, NumPhysBones ) - - // You can use this section to position the bones of - // any animated model using self:SetBonePosition( BoneNum, Pos, Angle ) - - // This will override any animation data and isn't meant as a - // replacement for animations. We're using this to position the limbs - // of ragdolls. - -end - - - -/*--------------------------------------------------------- - Name: SetRagdollBones - Desc: ----------------------------------------------------------*/ -function ENT:SetRagdollBones( bIn ) - - // If this is set to true then the engine will call - // DoRagdollBone (below) for each ragdoll bone. - // It will then automatically fill in the rest of the bones - - self.m_bRagdollSetup = bIn - -end - - -/*--------------------------------------------------------- - Name: DoRagdollBone - Desc: ----------------------------------------------------------*/ -function ENT:DoRagdollBone( PhysBoneNum, BoneNum ) - - // self:SetBonePosition( BoneNum, Pos, Angle ) - end diff --git a/entities/entities/info_huntablespawn/init.lua b/entities/entities/info_huntablespawn/init.lua index 9fa7f7e..709c019 100644 --- a/entities/entities/info_huntablespawn/init.lua +++ b/entities/entities/info_huntablespawn/init.lua @@ -1,6 +1,7 @@ --[[ This entity gives townies things to do ]] +print("hello test") AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) diff --git a/entities/entities/info_huntablespawn/shared.lua b/entities/entities/info_huntablespawn/shared.lua index 8b42e7f..05d3819 100644 --- a/entities/entities/info_huntablespawn/shared.lua +++ b/entities/entities/info_huntablespawn/shared.lua @@ -1,23 +1,8 @@ ENT.Base = "base_entity" -//WS stuff -ENT.Drops = nil -ENT.OnDammage = nil -ENT.Speed = 0 -ENT.Model = nil - -ENT.Behave = nil -ENT.Act = nil - /*--------------------------------------------------------- Name: OnRemove Desc: Called just before entity is deleted ---------------------------------------------------------*/ function ENT:OnRemove() end - -function ENT:DoActivity(npc) - if not self.onActivity() then - print("Node without activity, this might be an error!") - end -end diff --git a/entities/entities/info_townienode/shared.lua b/entities/entities/info_townienode/shared.lua index ca23db4..e16aff4 100644 --- a/entities/entities/info_townienode/shared.lua +++ b/entities/entities/info_townienode/shared.lua @@ -1,14 +1,5 @@ ENT.Base = "base_entity" -//WS stuff asdfs -ENT.Drops = nil -ENT.OnDammage = nil -ENT.Speed = 0 -ENT.Model = nil - -ENT.Behave = nil -ENT.Act = nil - /*--------------------------------------------------------- Name: OnRemove Desc: Called just before entity is deleted diff --git a/gamemode/core/combat/cl_damage.lua b/gamemode/core/combat/cl_damage.lua new file mode 100644 index 0000000..fee8175 --- /dev/null +++ b/gamemode/core/combat/cl_damage.lua @@ -0,0 +1,71 @@ +--Displays numbers for damage + +local drawables = { + [1] = { + starttime = CurTime(), + ammt = 5, + startpos = LocalPlayer():GetEyeTrace().HitPos + } +} + +net.Receive("art_damage_ent",function() + print("Notified of damage") + local who = net.ReadEntity() + local dmg = net.ReadDouble() + + --A random vector in the entity + local aa,bb = who:WorldSpaceAABB() + local mr = math.random + local rx,ry,rz = mr(aa.x,bb.x),mr(aa.y,bb.y),mr(aa.z,bb.z) + local drawinfo = { + starttime = CurTime(), + ammt = dmg, + startpos = Vector(rx,ry,rz) + } + + --Max 255 drawables at once + drawables[#drawables+1 % 255] = drawinfo +end) + +hook.Add( "PostDrawOpaqueRenderables", "art_damage_draw", function() + local trace = LocalPlayer():GetEyeTrace() + local angle = trace.HitNormal:Angle() + + local lpp,sp = LocalPlayer():GetPos(),trace.HitPos + local to = lpp - sp + local matang = to:Angle() + + matang.r = 90 + matang.y = matang.y+90 + matang.p = 0 + + render.DrawLine( trace.HitPos, trace.HitPos + 8 * angle:Forward(), Color( 255, 0, 0 ), true ) + render.DrawLine( trace.HitPos, trace.HitPos + 8 * -angle:Right(), Color( 0, 255, 0 ), true ) + render.DrawLine( trace.HitPos, trace.HitPos + 8 * angle:Up(), Color( 0, 0, 255 ), true ) + + surface.SetFont( "Trebuchet24" ) + local lpp = LocalPlayer():GetPos() + for k,v in pairs(drawables) do + local ct = CurTime() + local delta = ct - v.starttime + local alpha = 255 * (math.log(v.ammt) - (delta/2)) + if alpha < 1 then + drawables[k] = nil + continue + end + local lam = math.log(v.ammt) + local lad = (20/lam) + local opx = math.sin(delta) * lad + local opy = math.cos(delta) * lad + local dpos = v.startpos + Vector(opx,opy,delta*100*(1/v.ammt)+20) + local matang = (lpp - dpos):Angle() + matang.r = 90 + matang.y = matang.y + 90 + matang.p = 0 + surface.SetTextColor( 255, 255, 255, alpha ) + cam.Start3D2D( dpos, matang, lam ) + surface.SetTextPos(0,0) + surface.DrawText(tostring(v.ammt)) + cam.End3D2D() + end +end ) diff --git a/gamemode/core/combat/sv_damage.lua b/gamemode/core/combat/sv_damage.lua new file mode 100644 index 0000000..654dd82 --- /dev/null +++ b/gamemode/core/combat/sv_damage.lua @@ -0,0 +1,10 @@ +--Displays littler numbers when something takes damage + +util.AddNetworkString("art_damage_ent") + +hook.Add("EntityTakeDamage","art_damage_numbers",function(ent,dmg) + net.Start("art_damage_ent") + net.WriteEntity(ent) + net.WriteDouble(dmg:GetDamage()) + net.Broadcast() +end) diff --git a/gamemode/core/combat/sv_weaponswing.lua b/gamemode/core/combat/sv_weaponswing.lua index 29afd7a..f754000 100644 --- a/gamemode/core/combat/sv_weaponswing.lua +++ b/gamemode/core/combat/sv_weaponswing.lua @@ -86,6 +86,11 @@ function ws.doSwing(weapon,ply,callback) for k,v in pairs(hitthings) do callback(v) end + if #hitthings == 0 then + if weapon.onMiss then + weapon:onMiss(ply) + end + end end) end diff --git a/gamemode/core/npc/sv_huntingspawner.lua b/gamemode/core/npc/sv_huntingspawner.lua index 283b27f..d13ec36 100644 --- a/gamemode/core/npc/sv_huntingspawner.lua +++ b/gamemode/core/npc/sv_huntingspawner.lua @@ -4,28 +4,30 @@ local track = nrequire("core/inventory/sv_invtracker.lua") local itm = nrequire("core/inventory/item.lua") local o = {} - +local playerhunted = {} local huntablenodes = {} function o.CreateSpawnNode(tbl) huntablenodes[#huntablenodes+1] = tbl local e = ents.Create("info_huntablespawn") e:SetPos(tbl.Position) + e:Spawn() end local function SpawnMonsterFor(ply,zone) --Check what hunting ground we're in - print("I want to attack",ply) + --print("I want to attack",ply) if zone == nil then return end - print("I am in a zone!") + --print("I am in a zone!") local possiblenpcs = zone.npctbl - PrintTable(possiblenpcs) + --PrintTable(possiblenpcs) local randnum = math.random(0,100) - print("Random num was",randnum) + --print("Random num was",randnum) local npctype for k,v in pairs(possiblenpcs) do randnum = randnum - v - print("Subtracting ", v , " for ",k) + --print("Subtracting ", v , " for ",k) + --print(randnum) if randnum < 0 then npctype = k break @@ -36,14 +38,14 @@ local function SpawnMonsterFor(ply,zone) print(ply,"got lucky this time...") return end - print("I will spawn a ",npctype,"to attack ",ply,"!") + --print("I will spawn a ",npctype,"to attack ",ply,"!") --Find a place for the npc to spawn that's out of sight! local potentialspots = ents.FindInSphere( ply:GetPos(), 4000 ) for k,v in pairs(potentialspots) do - print("Checking spot",v) + --print("Checking spot",v) if v:GetClass() ~= "info_huntablespawn" then - print("Was not an info_huntablespawn") + --print("Was not an info_huntablespawn") potentialspots[k] = nil else local tr = util.TraceLine({ @@ -63,11 +65,12 @@ local function SpawnMonsterFor(ply,zone) --Choose a random spot! local spawnpos = a[math.random(1,#a)] - print("I want to spawn a monster at", spawnpos) + --print("I want to spawn a monster at", spawnpos) if spawnpos == nil then - print("Couldn't find a spot to spawn an NPC around",ply,"at",ply:GetPos(),"make sure there are enough info_huntablespawn entities around in little corners and stuff") + --print("Couldn't find a spot to spawn an NPC around",ply,"at",ply:GetPos(),"make sure there are enough info_huntablespawn entities around in little corners and stuff") return end + --Do a trace up to hit the skybox, local npc = ents.Create(npctype) npc:SetPos(spawnpos:GetPos()) @@ -110,7 +113,7 @@ hook.Add("OnNPCKilled","droplootforexnpcs",function(npc,attacker,inflictor) if rng < itemchance then local drop = itm.GetItemByName(itemname) print("Createing a drop of",drop) - track.CreateDroppedItem(drop, self:GetPos()+Vector(math.random(20),math.random(20),20)) + track.CreateDroppedItem(drop, npc:GetPos()+Vector(math.random(20),math.random(20),20)) end end end) diff --git a/gamemode/core/npc/sv_npcsystem.lua b/gamemode/core/npc/sv_npcsystem.lua index 0b250ac..1051c64 100644 --- a/gamemode/core/npc/sv_npcsystem.lua +++ b/gamemode/core/npc/sv_npcsystem.lua @@ -87,7 +87,7 @@ local function loadMap() local foldername = "artery/maps/" .. mapname ExecuteOnFolder(foldername,true,function(path) - --print("I want to run",path) + print("I want to run",path) local filetxt = file.Read(path,"DATA") --print("File text is", filetxt) CompileString(filetxt,path)() diff --git a/gamemode/utility/svg/cl_svg.lua b/gamemode/utility/svg/cl_svg.lua index 1ab37bb..6f34390 100644 --- a/gamemode/utility/svg/cl_svg.lua +++ b/gamemode/utility/svg/cl_svg.lua @@ -68,7 +68,7 @@ function svg.MaterialFromSVG(spath,background,foreground) end html:SetHTML(string.format([[ <style>%s%sbody{overflow:hidden}</style><body>%s</body> -]],background and bgf or "",fgf and foreground or "",svgdata)) +]],background and bgf or "",foreground and fgf or "",svgdata)) local mat = {} toprocess[#toprocess + 1] = {mat,html} return mat |
