aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem
diff options
context:
space:
mode:
authorAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-02-07 19:38:48 -0500
committerAlexander Pickering <Alexander.Pickering@anondomain.site90.net>2016-02-07 19:38:48 -0500
commitf9df323cf660cbe40eab897f5fe5af891ba2b66a (patch)
treec21445ecce2682a3a67391b5d5be2bfa66d90e67 /gamemode/itemsystem
parent02a1f048efa1b6d4132860a1919e127cca1e2167 (diff)
downloadwintersurvival2-f9df323cf660cbe40eab897f5fe5af891ba2b66a.tar.gz
wintersurvival2-f9df323cf660cbe40eab897f5fe5af891ba2b66a.tar.bz2
wintersurvival2-f9df323cf660cbe40eab897f5fe5af891ba2b66a.zip
Finished fireball spell (still needs recipe)
Diffstat (limited to 'gamemode/itemsystem')
-rw-r--r--gamemode/itemsystem/items/spell_fireball.lua26
1 files changed, 24 insertions, 2 deletions
diff --git a/gamemode/itemsystem/items/spell_fireball.lua b/gamemode/itemsystem/items/spell_fireball.lua
index d8bad79..11b12b3 100644
--- a/gamemode/itemsystem/items/spell_fireball.lua
+++ b/gamemode/itemsystem/items/spell_fireball.lua
@@ -17,8 +17,29 @@ ITEM.Recipe = {
ITEM.CD = 1
-function ITEM:DoFireball()
- print("Fully successfull fireball callback")
+function ITEM:DoFireball(pl)
+ print("Fully successfull fireball callback:")
+ print(pl)
+ local aim = pl:GetAimVector()
+ local fireball = {}
+ fireball["model"] = "models/hunter/blocks/cube025x025x025.mdl"
+ fireball["speed"] = 700
+ fireball["drop"] = 50
+ fireball["init"] = function(fb) fb:Ignite(10) end
+
+ local D = ents.Create("ws_projectile")
+ if(fireball.speed) then D.speed = fireball.speed end
+ if(fireball.model) then D.model = fireball.model end
+ if(fireball.drop) then D.drop = fireball.drop end
+ if(fireball.init) then D.init = fireball.init end
+
+ print("D's speed:" .. D.speed)
+
+ D:SetPos(pl:GetShootPos()+aim*50)
+ D:SetOwner(pl)
+ D:SetAngles(aim:Angle())
+ D:Spawn()
+ pl:EmitSound(Sound("physics/flesh/flesh_impact_hard.wav"),100,math.random(90,110))
end
function ITEM:DoFireballFail()
@@ -26,6 +47,7 @@ function ITEM:DoFireballFail()
end
function ITEM:OnPrimary(pl,tr)
+ ParticleEffect("particletest.pcf",pl:GetPos(),pl:GetAngles(),pl)
if (CLIENT) then return end
pl:Cast("Fireball",self.DoFireball)
end