diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 14:42:09 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-30 14:42:09 -0400 |
| commit | 2736f498f30220b858fc6fac23e7ddc4a597df6d (patch) | |
| tree | 374ceadedb654b00e09dac321620a8320830f734 /gamemode/items/misc_explosive.lua | |
| download | redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.gz redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.bz2 redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.zip | |
Inital commit
Diffstat (limited to 'gamemode/items/misc_explosive.lua')
| -rw-r--r-- | gamemode/items/misc_explosive.lua | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/gamemode/items/misc_explosive.lua b/gamemode/items/misc_explosive.lua new file mode 100644 index 0000000..9584feb --- /dev/null +++ b/gamemode/items/misc_explosive.lua @@ -0,0 +1,114 @@ + +ITEM_EXPLOSIVE = 345 + +function FUNC_OXYGEN( ply, id, client, icon ) + + if icon then return "icon16/arrow_turn_right.png" end + if client then return "Throw" end + + ply:RemoveFromInventory( id ) + ply:EmitSound( Sound( "WeaponFrag.Throw" ) ) + + local oxy = ents.Create( "sent_oxygen" ) + oxy:SetPos( ply:GetItemDropPos() ) + oxy:SetAngles( ply:GetAimVector():Angle() ) + oxy:Spawn() + +end + +function FUNC_DROPOXYGEN( ply, id, drop ) + + + if not drop then return end + + local oxy = ents.Create( "sent_oxygen" ) + oxy:SetSpeed( 10 ) + oxy:SetPos( ply:GetItemDropPos() ) + oxy:SetAngles( ply:GetAimVector():Angle() ) + oxy:Spawn() + + return false // override spawning a prop for this item + +end + +item.Register( { + Name = "Liquid Oxygen", + Description = "Highly explosive liquid oxygen.", + TypeOverride = "sent_oxygen", + Stackable = true, + Type = ITEM_EXPLOSIVE, + Weight = 1.50, + Price = 50, + Rarity = 0.95, + Model = "models/props_phx/misc/potato_launcher_explosive.mdl", + Functions = { FUNC_OXYGEN }, + DropFunction = FUNC_DROPOXYGEN, + CamPos = Vector(24,0,8), + CamOrigin = Vector(0,0,6) +} ) + +item.Register( { + Name = "Gasoline", + TypeOverride = "sent_fuel_gas", + AllowPickup = true, + CollisionOverride = true, + Type = ITEM_EXPLOSIVE, + Rarity = 0.50, + Model = "models/props_junk/gascan001a.mdl", + Functions = {} +} ) + +item.Register( { + Name = "Diesel Fuel", + TypeOverride = "sent_fuel_diesel", + AllowPickup = true, + CollisionOverride = true, + Type = ITEM_EXPLOSIVE, + Rarity = 0.50, + Model = "models/props_junk/metalgascan.mdl", + Functions = {} +} ) + +item.Register( { + Name = "Propane Canister", + TypeOverride = "sent_propane_canister", + AllowPickup = true, + CollisionOverride = true, + Type = ITEM_EXPLOSIVE, + Rarity = 0.50, + Model = "models/props_junk/propane_tank001a.mdl", + Functions = {} +} ) + +item.Register( { + Name = "Propane Tank", + TypeOverride = "sent_propane_tank", + AllowPickup = true, + CollisionOverride = true, + Type = ITEM_EXPLOSIVE, + Rarity = 0.50, + Model = "models/props_junk/propanecanister001a.mdl", + Functions = {} +} ) + +item.Register( { + Name = "Radioactive Waste", + TypeOverride = "sent_barrel_radioactive", + AllowPickup = true, + CollisionOverride = true, + Type = ITEM_EXPLOSIVE, + Rarity = 0.10, + Model = "models/props/de_train/barrel.mdl", + Functions = {} +} ) + +item.Register( { + Name = "Toxic Waste", + TypeOverride = "sent_barrel_biohazard", + AllowPickup = true, + CollisionOverride = true, + Type = ITEM_EXPLOSIVE, + Rarity = 0.10, + Model = "models/props/de_train/barrel.mdl", + Functions = {} +} ) |
