add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

View File

@@ -0,0 +1,313 @@
AddCSLuaFile()
--[[
-----------------------------------------------------------------------------------------------------
Convar Tables
-----------------------------------------------------------------------------------------------------
]]
-- if CLIENT then
-- hook.Add("PopulateToolMenu", "ToolMenu_NMRIHConsumables", function()
-- spawnmenu.AddToolMenuOption("Options", "Craft_Pig", "ToolMenuOption_ConsumablesNMRIH", "NMRIH Consumables", "", "", function(panel)
-- panel:ClearControls()
-- panel:CheckBox("Enable Phalanx Regen?", "convar_consumablesnmrih_eregen", 1, 0, true)
-- panel:CheckBox("Enable Phalanx Cure?", "convar_consumablesnmrih_edelayinf", 1, 0, true)
-- panel:ControlHelp("Requires Infectious Mod to be mounted.")
-- panel:CheckBox("Enable Genetherapy Armor?", "convar_consumablesnmrih_earmor", 1, 0, true)
-- panel:CheckBox("Enable Genetherapy Cure?", "convar_consumablesnmrih_ecureinf", 1, 0, true)
-- panel:ControlHelp("Requires Infectious Mod to be mounted.")
-- end)
-- end)
-- end
-- CreateConVar("convar_consumablesnmrih_eregen", "1", {FCVAR_ARCHIVE}, "Enable Phalanx Regen (0 - disabled, 1 - enabled)")
-- CreateConVar("convar_consumablesnmrih_edelayinf", "1", {FCVAR_ARCHIVE}, "Enable Phalanx Cure (0 - disabled, 1 - enabled)")
-- CreateConVar("convar_consumablesnmrih_earmor", "1", {FCVAR_ARCHIVE}, "Enable Phalanx Regen (0 - disabled, 1 - enabled)")
-- CreateConVar("convar_consumablesnmrih_ecureinf", "1", {FCVAR_ARCHIVE}, "Enable Phalanx Regen (0 - disabled, 1 - enabled)")
--[[
-----------------------------------------------------------------------------------------------------
Ammo Tables
-----------------------------------------------------------------------------------------------------
]]
game.AddAmmoType( {
name = "phalanx",
} )
game.AddAmmoType( {
name = "medkit",
} )
game.AddAmmoType( {
name = "genetherapy",
} )
game.AddAmmoType( {
name = "bandage",
} )
--[[
-----------------------------------------------------------------------------------------------------
Sound Tables
-----------------------------------------------------------------------------------------------------
]]
sound.Add( {
name = "nmrih_consumables_shove",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/shove_01.wav",
"weapons/nmrih/items/shove_02.wav",
"weapons/nmrih/items/shove_03.wav",
"weapons/nmrih/items/shove_04.wav",
"weapons/nmrih/items/shove_05.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_genericfoley",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/clothes_generic_foley_01.wav",
"weapons/nmrih/items/clothes_generic_foley_02.wav",
"weapons/nmrih/items/clothes_generic_foley_03.wav",
"weapons/nmrih/items/clothes_generic_foley_04.wav",
"weapons/nmrih/items/clothes_generic_foley_05.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_capremove",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/genetherapy/genetherapy_cap_remove_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_inject",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/genetherapy/genetherapy_inject_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_remove",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/genetherapy/genetherapy_click_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medkitopen",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/medkit_unzip_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medpillsdraw",
channel = CHAN_ITEM,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/medpills_draw_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medpillsopen",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/medpills_open_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medpillsshake",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/medpills_shake_01.wav",
"weapons/nmrih/items/medkit/medpills_shake_02.wav",
"weapons/nmrih/items/medkit/medpills_shake_03.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medshuffle",
channel = CHAN_ITEM,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/medkit_shuffle_01.wav",
"weapons/nmrih/items/medkit/medkit_shuffle_02.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_stichprep",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/stitching_prepare_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medflesh",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/stitch_fleshy_01.wav",
"weapons/nmrih/items/medkit/stitch_fleshy_02.wav",
"weapons/nmrih/items/medkit/stitch_fleshy_03.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medsnip",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/scissors_snip_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_medtape",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/medkit/tape_unravel_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_pillsdraw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/phalanx/pills_draw_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_pillslid",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/phalanx/pills_lid_twist_01.wav",
"weapons/nmrih/items/phalanx/pills_lid_twist_02.wav",
"weapons/nmrih/items/phalanx/pills_lid_twist_03.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_pillslidfinal",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/phalanx/pills_lid_twist_open_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_pillsshake",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/phalanx/pills_shake_01.wav",
"weapons/nmrih/items/phalanx/pills_shake_02.wav",
"weapons/nmrih/items/phalanx/pills_shake_03.wav",
"weapons/nmrih/items/phalanx/pills_shake_04.wav",
"weapons/nmrih/items/phalanx/pills_shake_05.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_entermouth",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/phalanx/pills_enter_mouth_01.wav",
"weapons/nmrih/items/phalanx/pills_enter_mouth_02.wav",
"weapons/nmrih/items/phalanx/pills_enter_mouth_03.wav",
"weapons/nmrih/items/phalanx/pills_enter_mouth_04.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_pillsgulp",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/phalanx/gulp_01.wav",
"weapons/nmrih/items/phalanx/gulp_02.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_bandageapply",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/bandage/bandage_apply_01.wav",
"weapons/nmrih/items/bandage/bandage_apply_02.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_bandageunravel1",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/bandage/bandage_unravel_01.wav",
}
} )
sound.Add( {
name = "nmrih_consumables_bandageunravel2",
channel = CHAN_WEAPON,
volume = 1.0,
level = 55,
pitch = {95, 100},
sound = {
"weapons/nmrih/items/bandage/bandage_unravel_02.wav",
}
} )

View File

@@ -0,0 +1,645 @@
AddCSLuaFile()
--[[
-----------------------------------------------------------------------------------------------------
Subcategories
-----------------------------------------------------------------------------------------------------
]]
-- list.Set("WeaponTreeIcons", "EFT", "logo16/logo_eftmedkit_16.png")
list.Set("WeaponTreeIcons", "EFT.Drugs", "logo16/logo_eftdrug_16.png")
list.Set("WeaponTreeIcons", "EFT.Stimulants", "logo16/logo_eftstim_16.png")
list.Set("WeaponTreeIcons", "EFT.Medkits", "logo16/logo_eftmedkit_16.png")
list.Set("WeaponTreeIcons", "EFT.Injury Treatment", "logo16/logo_eftinjury_16.png")
list.Set("WeaponTreeThumbnails", "EFT.Drugs", "entities/weapon_eft_augmentin.png")
list.Set("WeaponTreeThumbnails", "EFT.Stimulants", "entities/weapon_eft_injectoradrenaline.png")
list.Set("WeaponTreeThumbnails", "EFT.Medkits", "entities/weapon_eft_afak.png")
list.Set("WeaponTreeThumbnails", "EFT.Injury Treatment", "entities/weapon_eft_surgicalkit.png")
--[[
-----------------------------------------------------------------------------------------------------
Particle Cache
-----------------------------------------------------------------------------------------------------
]]
-- if CLIENT then
-- game.AddParticles("particles/ep2/antlion_gib_02.pcf")
-- PrecacheParticleSystem("antlion_gib_02_slime")
-- PrecacheParticleSystem("antlion_gib_02_juice")
-- end
--[[
-----------------------------------------------------------------------------------------------------
Convars
-----------------------------------------------------------------------------------------------------
]]
-- if CLIENT then
-- CreateClientConVar("cl_eftmeds_quick", "0", true, false)
-- end
--[[
-----------------------------------------------------------------------------------------------------
Ammo Tables
-----------------------------------------------------------------------------------------------------
]]
game.AddAmmoType( {
name = "carfirstaidkit",
} )
game.AddAmmoType( {
name = "salewafirstaidkit",
} )
game.AddAmmoType( {
name = "cattourniquet",
} )
game.AddAmmoType( {
name = "augmentin",
} )
game.AddAmmoType( {
name = "grizzlykit",
} )
game.AddAmmoType( {
name = "surgicalkit",
} )
game.AddAmmoType( {
name = "alusplint",
} )
game.AddAmmoType( {
name = "afak",
} )
game.AddAmmoType( {
name = "injectoradrenaline",
} )
game.AddAmmoType( {
name = "morphine",
} )
game.AddAmmoType( {
name = "l1",
} )
game.AddAmmoType( {
name = "trimadol",
} )
game.AddAmmoType( {
name = "propital",
} )
game.AddAmmoType( {
name = "etg",
} )
game.AddAmmoType( {
name = "tg12",
} )
game.AddAmmoType( {
name = "anaglin",
} )
game.AddAmmoType( {
name = "esmarch",
} )
--[[
-----------------------------------------------------------------------------------------------------
Sound Tables
-----------------------------------------------------------------------------------------------------
]]
----
----------------------------------------------------------------------------------------- Other
--------------------------------------- Grizzly
sound.Add( {
name = "MedsGrizzly.Draw",
channel = CHAN_ITEM,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/grizzly/item_medkit_grizzly_00_draw.wav",
}
} )
sound.Add( {
name = "MedsGrizzly.Open",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/grizzly/item_medkit_grizzly_01_open.wav",
}
} )
sound.Add( {
name = "MedsGrizzly.Take",
channel = CHAN_ITEM,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/grizzly/item_medkit_grizzly_02_medtake.wav",
}
} )
--------------------------------------- Bandage
sound.Add( {
name = "MedsBandage.Open",
channel = CHAN_ITEM,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/bandage/item_bandage_01_open.wav",
}
} )
sound.Add( {
name = "MedsBandage.Take",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/bandage/item_bandage_02_bandagetake.wav",
}
} )
sound.Add( {
name = "MedsBandage.Use",
channel = CHAN_WEAPON,
volume = 0.4,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/bandage/item_bandage_03_use.wav",
}
} )
sound.Add( {
name = "MedsBandage.End",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/bandage/item_bandage_04_end.wav",
}
} )
--------------------------------------- Medkit
sound.Add( {
name = "MedsMedkit.Draw",
channel = CHAN_ITEM,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_00_draw.wav",
}
} )
sound.Add( {
name = "MedsMedkit.Open",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_01_open.wav",
}
} )
sound.Add( {
name = "MedsMedkit.Take",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_02_takesyringe.wav",
}
} )
sound.Add( {
name = "MedsMedkit.Kolpa",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_03_kolpachok.wav",
}
} )
sound.Add( {
name = "MedsMedkit.Injection",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_04_injection.wav",
}
} )
sound.Add( {
name = "MedsMedkit.Throw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_05_throwsyringe.wav",
}
} )
sound.Add( {
name = "MedsMedkit.Putaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/medkit/item_medkit_ai_06_putaway.wav",
}
} )
--------------------------------------- Pills
sound.Add( {
name = "MedsBlister.Draw",
channel = CHAN_BODY,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/pills/item_pillsblister_00_draw.wav",
}
} )
sound.Add( {
name = "MedsBlister.Open",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 100},
sound = {
"weapons/eft/pills/item_pillsblister_01_open.wav",
}
} )
sound.Add( {
name = "MedsPillsBottle.Draw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 110},
sound = {
"weapons/eft/pills/item_pillsbottle_00_draw.wav",
}
} )
sound.Add( {
name = "MedsPillsBottle.Open",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 100},
sound = {
"weapons/eft/pills/item_pillsbottle_01_open.wav",
}
} )
sound.Add( {
name = "MedsPillsBottle.Pilltake",
channel = CHAN_ITEM,
volume = 1.0,
level = 65,
pitch = {95, 100},
sound = {
"weapons/eft/pills/item_pillsbottle_02_pilltake.wav",
}
} )
sound.Add( {
name = "MedsPillsBottle.Use",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 100},
sound = {
"weapons/eft/pills/item_pillsbottle_03_use.wav",
}
} )
sound.Add( {
name = "MedsPillsBottle.Close",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 100},
sound = {
"weapons/eft/pills/item_pillsbottle_04_close.wav",
}
} )
sound.Add( {
name = "MedsPillsBottle.Putaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/pills/item_pillsbottle_05_putaway.wav",
}
} )
--------------------------------------- Salewa
sound.Add( {
name = "MedsSalewa.Draw",
channel = CHAN_ITEM,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/salewa/item_medkit_salewa_00_draw.wav",
}
} )
sound.Add( {
name = "MedsSalewa.Open",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/salewa/item_medkit_salewa_01_open.wav",
}
} )
sound.Add( {
name = "MedsSalewa.Bandage",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/salewa/item_medkit_salewa_02_bandagetake.wav",
}
} )
sound.Add( {
name = "MedsSalewa.Use",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/salewa/item_medkit_salewa_03_use.wav",
}
} )
sound.Add( {
name = "MedsSalewa.End",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/salewa/item_medkit_salewa_04_end.wav",
}
} )
--------------------------------------- CAT
sound.Add( {
name = "MedsCat.Draw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/cat/item_cat_00_draw.wav",
}
} )
sound.Add( {
name = "MedsCat.Use",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/cat/item_cat_01_use.wav",
}
} )
sound.Add( {
name = "MedsCat.Fasten",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/cat/item_cat_02_fasten.wav",
}
} )
sound.Add( {
name = "MedsCat.Putaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/cat/item_cat_03_putaway.wav",
}
} )
--------------------------------------- Medkit
sound.Add( {
name = "MedsSurgical.Draw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_00_draw.wav",
}
} )
sound.Add( {
name = "MedsSurgical.SicDraw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_01_scissors_draw.wav",
}
} )
sound.Add( {
name = "MedsSurgical.SciUse",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_02_scissors_use.wav",
}
} )
sound.Add( {
name = "MedsSurgical.SciPutaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_03_scissors_putaway.wav",
}
} )
sound.Add( {
name = "MedsSurgical.PickDraw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_04_picker_draw.wav",
}
} )
sound.Add( {
name = "MedsSurgical.PickUse",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_05_picker_use.wav",
}
} )
sound.Add( {
name = "MedsSurgical.PickPutaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_06_picker_putaway.wav",
}
} )
sound.Add( {
name = "MedsSurgical.StaplerDraw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_07_stapler_draw.wav",
}
} )
sound.Add( {
name = "MedsSurgical.StaperUse",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_08_stapler_use.wav",
}
} )
sound.Add( {
name = "MedsSurgical.StaplerPutaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_09_stapler_putaway.wav",
}
} )
sound.Add( {
name = "MedsSurgical.Close",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_10_close.wav",
}
} )
sound.Add( {
name = "MedsSurgical.Button1",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_11_close_button.wav",
}
} )
sound.Add( {
name = "MedsSurgical.Button2",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_12_close_button.wav",
}
} )
sound.Add( {
name = "MedsSurgical.Putaway",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/surgicalkit/item_surgicalkit_13_putaway.wav",
}
} )
--------------------------------------- Splint
sound.Add( {
name = "MedsSplint.Start",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/splint/item_splint_00_start.wav",
}
} )
sound.Add( {
name = "MedsSplint.Middle",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/splint/item_splint_01_middle.wav",
}
} )
sound.Add( {
name = "MedsSplint.End",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/splint/item_splint_02_end.wav",
}
} )
--------------------------------------- Splint
sound.Add( {
name = "MedsInjector.Draw",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/injector/item_injector_00_draw.wav",
}
} )
sound.Add( {
name = "MedsInjector.Open",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/injector/item_injector_01_kolpachok.wav",
}
} )
sound.Add( {
name = "MedsInjector.Use",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/injector/item_injector_02_injection.wav",
}
} )
sound.Add( {
name = "MedsInjector.End",
channel = CHAN_WEAPON,
volume = 1.0,
level = 65,
pitch = {95, 115},
sound = {
"weapons/eft/injector/item_injector_03_putaway.wav",
}
} )

View File

@@ -0,0 +1,35 @@
local AffectedEffects = { "Fatigue", "DarkVision", "Stunned" }
StatusEffects.OnPainkillers = {
Name = "On Painkillers",
Icon = "SEF_Icons/SEF_onpainkillers.png",
Desc = "You're on painkillers, some debuffs are delayed.",
Type = "BUFF",
EffectBegin = function(ent)
if not ent.GetTime then
ent.GetTime = {}
end
for _, effectName in ipairs(AffectedEffects) do
ent.GetTime[effectName] = 0
end
ent.GetTimeOnPainkillers = 0 + ent:GetTimeLeft("OnPainkillers")
end,
Effect = function(ent, time)
for _, effectName in ipairs(AffectedEffects) do
if ent:HaveEffect(effectName) then
local remainingTime = ent:GetTimeLeft(effectName)
ent.GetTime[effectName] = remainingTime + ent.GetTime[effectName]
-- print(effectName .. " remaining time: " .. remainingTime)
ent:RemoveEffect(effectName)
end
end
end,
EffectEnd = function(ent)
-- print("Remaining time for DarkVision: " .. (ent.GetTime["DarkVision"] or "Not found"))
for _, effectName in ipairs(AffectedEffects) do
if ent.GetTime[effectName] ~= 0 then
ent:ApplyEffect(effectName, ent.GetTime[effectName] - ent.GetTimeOnPainkillers)
end
end
end
}

View File

@@ -0,0 +1,215 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_afak" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "AFAK First Aid Kit"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals up to 30HP
Cures Bleeding
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Medkits"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/afak/v_meds_afak.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/afak/w_meds_afak.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "afak"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 400
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 30
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_afak"
local ID_PRIMARYAMMO = "afak"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
if owner:HaveEffect("Bleeding") then
owner:RemoveEffect("Bleeding")
owner:RemoveAmmo(30, ID_PRIMARYAMMO)
end
end
if INI_VIVO == true then
math.Round(OJSWounds:HealHP(owner, self.MaxHeal, VarHealHealth), 0)
if (OJSWounds:HasStatusWholeBody(owner, "Bleed")) then
OJSWounds:HealBleed(owner)
owner:RemoveAmmo(30, ID_PRIMARYAMMO)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(VarHealHealth, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IniAnimBandage = 1
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
timer.Simple(0.6, function() -- Audio Timer
if IsValid(self) and IsValid(self.Owner) then
if owner:GetActiveWeapon():GetClass() == ID_WEAPON then owner:EmitSound("MedsGrizzly.Open") end
end
end)
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if SERVER then
if self.IniHeal == 1 and self.IdleTimer <= CurTime() then -- Initialize Heal
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:Heal(owner)
end
if self.IniAnimBandage == 1 and self.AnimTimes <= 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
if math.random(1,2) == 1 then
self:SendWeaponAnim(ACT_VM_RECOIL2)
else
self:SendWeaponAnim(ACT_VM_HITRIGHT)
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimBandage == 1 and self.AnimTimes == 2 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_RECOIL3)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
end
-- if SERVER then return end
-- if GetConVar("cl_eftmeds_quick"):GetBool() then
-- LocalPlayer():ConCommand("+attack")
-- if self.IniHeal == 1 then
-- print("hi")
-- end
-- end
end
function SWEP:Holster()
if CLIENT then LocalPlayer():ConCommand("-attack") end
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -4, 3)
local offsetAng = Angle(-0, -0, -180)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,179 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_alusplint" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Aluminium Splint"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Cures Fatigue
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Injury Treatment"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/alusplint/v_meds_alusplint.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/alusplint/w_meds_alusplint.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "alusplint"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 5
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_alusplint"
local ID_PRIMARYAMMO = "alusplint"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
owner:RemoveEffect("Fatigue")
end
if INI_VIVO == true then
OJSWounds:HealFracture(owner)
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
timer.Simple(1.5, function() -- Audio Timer
if IsValid(self) and IsValid(self.Owner) then
if owner:GetActiveWeapon():GetClass() == "weapon_eft_alusplint" then owner:EmitSound("MedsSplint.Middle") end
end
end)
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(0, -5, -0)
local offsetAng = Angle(-90, 180, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,191 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_alusplint" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Anaglin"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Gives On Painkillers, 95s
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Drugs"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/anaglin/v_meds_anaglin.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/anaglin/w_meds_anaglin.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "anaglin"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 4
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_anaglin"
local ID_PRIMARYAMMO = "anaglin"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
OJSWounds:HealPain(owner)
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("OnPainkillers", 5)
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
owner:ApplyEffect("OnPainkillers", 95)
end
if INI_VIVO == true then
OJSWounds:AddStatus(owner,"Head","Painkillers", 95, 1)
for i=1,7 do
OJSWounds:HealPain(owner)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(4, -3, -2)
local offsetAng = Angle(-90, 180, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,178 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_augmentin" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Augmentin Antibiotic's"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Gives Tenacity (20%)
Cures Dark Vision
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Drugs"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/augmentin/v_meds_augmentin.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/augmentin/w_meds_augmentin.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "augmentin"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 5
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_augmentin"
local ID_PRIMARYAMMO = "augmentin"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
owner:ApplyEffect("Tenacity", 155, 20)
owner:ApplyEffect("OnPainkillers", 155)
owner:RemoveEffect("DarkVision")
end
if INI_VIVO == true then
OJSWounds:AddStatus(owner,"Head","Painkillers", 155, 1)
for i=1,7 do
OJSWounds:HealPain(owner)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(0, -5, -0)
local offsetAng = Angle(-90, 180, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,246 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_carfirstaidkit" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Car First Aid Kit"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals up to 35HP
Cures Bleeding
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Medkits"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/automedkit/v_meds_automedkit.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/automedkit/w_meds_automedkit.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "carfirstaidkit"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 220
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 35
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_automedkit"
local ID_PRIMARYAMMO = "carfirstaidkit"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.IniAnimPills = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
if owner:HaveEffect("Bleeding") then
owner:RemoveEffect("Bleeding")
owner:RemoveAmmo(50, ID_PRIMARYAMMO)
end
end
if INI_VIVO == true then
math.Round(OJSWounds:HealHP(owner, self.MaxHeal, VarHealHealth), 0)
if (OJSWounds:HasStatusWholeBody(owner, "Bleed")) then
OJSWounds:HealBleed(owner)
owner:RemoveAmmo(50, ID_PRIMARYAMMO)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(VarHealHealth, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
local RndAnim = math.random(1,3)
if (InitializeSEF == true and owner:HaveEffect("Bleeding")) or (INI_VIVO == true and (OJSWounds:HasStatusWholeBody(owner, "Bleed"))) then
self:SendWeaponAnim(ACT_VM_MISSRIGHT)
self.IniAnimBandage = 1
elseif RndAnim == 1 then
self:SendWeaponAnim(ACT_VM_MISSRIGHT)
self.IniAnimBandage = 1
elseif RndAnim == 2 then
self:SendWeaponAnim(ACT_VM_PULLBACK_HIGH)
self.IniAnimSyringe = 1
else
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IniAnimPills = 1
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
timer.Simple(0.55, function() -- Audio Timer
if IsValid(self) and IsValid(self.Owner) then
if owner:GetActiveWeapon():GetClass() == "weapon_eft_automedkit" then owner:EmitSound("MedsGrizzly.Open") end
end
end)
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if SERVER then
if self.IniHeal == 1 and self.IdleTimer <= CurTime() then -- Initialize Heal
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.IniAnimPills = 0
self.AnimTimes = 0
self.IniHeal = 0
self:Heal(owner)
end
if self.IniAnimBandage == 1 and self.AnimTimes <= 2 and self.IdleTimer <= CurTime() then -- Bandage Sequence
if math.random(1,2) == 1 then
self:SendWeaponAnim(ACT_VM_MISSRIGHT2)
else
self:SendWeaponAnim(ACT_VM_MISSCENTER)
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimBandage == 1 and self.AnimTimes == 3 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_MISSCENTER2)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
if self.IniAnimSyringe == 1 and self.AnimTimes <= 2 and self.IdleTimer <= CurTime() then -- Syringe Sequence
self:SendWeaponAnim(ACT_VM_PULLBACK)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimSyringe == 1 and self.AnimTimes == 3 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_PULLBACK_LOW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
if self.IniAnimPills == 1 and self.AnimTimes <= 1 and self.IdleTimer <= CurTime() then -- Syringe Sequence
if self.AnimTimes == 0 then
self:SendWeaponAnim(ACT_VM_RECOIL3)
else
self:SendWeaponAnim(ACT_VM_RECOIL2)
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimPills == 1 and self.AnimTimes == 2 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_PICKUP)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -5, 3)
local offsetAng = Angle(-0, 0, 180)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,187 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_cat" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "CAT hemostatic tourniquet"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Cures Bleeding
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Injury Treatment"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/cat/v_meds_cat.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/cat/w_meds_cat.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "cattourniquet"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 90
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_cat"
local ID_PRIMARYAMMO = "cattourniquet"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.IniAnimPills = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
owner:RemoveEffect("Bleeding")
end
if INI_VIVO == true then
if (OJSWounds:HasStatusWholeBody(owner, "Bleed")) then
OJSWounds:HealBleed(owner)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(ID_PRIMARYAMMO) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniHeal == 1 and self.IdleTimer <= CurTime() then -- Initialize Heal
self.IniHeal = 0
self.IniAnimBandage = 0
self:Heal(owner)
end
if self.IniAnimBandage == 1 and self.AnimTimes <= 0 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self:SendWeaponAnim(ACT_VM_RECOIL2)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimBandage == 1 and self.AnimTimes == 1 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_RECOIL3)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(0, -5, -0)
local offsetAng = Angle(-90, 180, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,245 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_grizzly" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Grizzly Medical Kit"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals up to 90HP
Cures Bleeding
Cures Concussion
Cures Fatigue
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Medkits"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/grizzly/v_meds_grizzly.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/grizzly/w_meds_grizzly.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "grizzlykit"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1800
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 90
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_grizzly"
local ID_PRIMARYAMMO = "grizzlykit"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.IniAnimPills = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
if owner:HaveEffect("Bleeding") then
owner:RemoveEffect("Bleeding")
owner:RemoveAmmo(40, ID_PRIMARYAMMO)
end
if owner:HaveEffect("Fatigue") then
owner:RemoveEffect("Fatigue")
owner:SoftRemoveEffect("Fatigue")
owner:RemoveAmmo(50, ID_PRIMARYAMMO)
end
owner:RemoveEffect("Concussion")
end
if INI_VIVO == true then
math.Round(OJSWounds:HealHP(owner, self.MaxHeal, VarHealHealth), 0)
OJSWounds:HealPain(owner)
if (OJSWounds:HasStatusWholeBody(owner, "Bleed")) then
OJSWounds:HealBleed(owner)
owner:RemoveAmmo(40, ID_PRIMARYAMMO)
end
if (OJSWounds:HasStatusWholeBody(owner, "Fractured")) then
OJSWounds:HealFracture(owner)
owner:RemoveAmmo(50, ID_PRIMARYAMMO)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(VarHealHealth, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
local RndAnim = math.random(1,2)
if InitializeSEF == true and owner:HaveEffect("Bleeding") or (INI_VIVO == true and (OJSWounds:HasStatusWholeBody(owner, "Bleed"))) then
self:SendWeaponAnim(ACT_VM_MISSRIGHT)
self.IniAnimBandage = 1
elseif RndAnim == 1 then
self:SendWeaponAnim(ACT_VM_MISSRIGHT)
self.IniAnimBandage = 1
elseif RndAnim == 2 then
self:SendWeaponAnim(ACT_VM_PULLBACK_HIGH)
self.IniAnimSyringe = 1
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
timer.Simple(0.4, function() -- Audio Timer
if IsValid(self) and IsValid(self.Owner) then
if owner:GetActiveWeapon():GetClass() == "weapon_eft_grizzly" then owner:EmitSound("MedsGrizzly.Open") end
end
end)
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if SERVER then
if self.IniHeal == 1 and self.IdleTimer <= CurTime() then -- Initialize Heal
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.AnimTimes = 0
self.IniHeal = 0
self:Heal(owner)
end
if self.IniAnimBandage == 1 and self.AnimTimes <= 2 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self:SendWeaponAnim(ACT_VM_MISSRIGHT2)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimBandage == 1 and self.AnimTimes == 3 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_MISSCENTER2)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
if self.IniAnimSyringe == 1 and self.AnimTimes <= 0 and self.IdleTimer <= CurTime() then -- Syringe Sequence
self:SendWeaponAnim(ACT_VM_PULLBACK)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimSyringe == 1 and self.AnimTimes == 1 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_PICKUP)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimSyringe == 1 and self.AnimTimes == 2 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_PULLBACK)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimSyringe == 1 and self.AnimTimes == 3 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_PULLBACK_LOW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
self.IniHeal = 1
end
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -7, 5)
local offsetAng = Angle(-0, -0, -180)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,177 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_eftadrenaline" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Adrenaline"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals 15HP over 15s
Gives Haste 65s
Gives Vulnerability 60s
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Stimulants"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/injector/v_meds_injector.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/injector/w_meds_injector.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "injectoradrenaline"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local ID_WEAPON = "weapon_eft_injectoradrenaline"
local ID_PRIMARYAMMO = "injectoradrenaline"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
else
INI_SEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
timer.Simple(0.05, function()
if IsValid(self) and IsValid(self.Owner) then
local vm = self.Owner:GetViewModel()
if IsValid(vm) then
vm:SetSkin(7)
end
end
end)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("Haste", 65, 40)
owner:ApplyEffect("Vuln", 60)
owner:ApplyEffect("Healing", 15, 1, 1)
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(7)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -1, 2)
local offsetAng = Angle(-180, 0, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,177 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_eTG" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "eTG-Change Regenerative"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals 45HP over 90s
Removes 10HP
Cures Concussion
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Stimulants"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/injector/v_meds_injector.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/injector/w_meds_injector.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "etg"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local ID_WEAPON = "weapon_eft_injectoretg"
local ID_PRIMARYAMMO = "etg"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
else
INI_SEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
timer.Simple(0.05, function()
if IsValid(self) and IsValid(self.Owner) then
local vm = self.Owner:GetViewModel()
if IsValid(vm) then
vm:SetSkin(5)
end
end
end)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("Healing", 90, 1, 2)
owner:ApplyEffect("Wither", 5, 2, 1)
owner:RemoveEffect("Concussion")
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(5)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -1, 2)
local offsetAng = Angle(-180, 0, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,178 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_L1" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "L1 Norepinephrine"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Gives Tenacity 3s, 35%
Gives Exhausted 60s
Cures Dark Vision
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Stimulants"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/injector/v_meds_injector.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/injector/w_meds_injector.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "l1"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local ID_WEAPON = "weapon_eft_injectorl1"
local ID_PRIMARYAMMO = "l1"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
else
INI_SEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
timer.Simple(0.05, function()
if IsValid(self) and IsValid(self.Owner) then
local vm = self.Owner:GetViewModel()
if IsValid(vm) then
vm:SetSkin(4)
end
end
end)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("Exhaust", 93)
owner:ApplyEffect("Tenacity", 3, 35)
owner:RemoveEffect("DarkVision")
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(4)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -1, 2)
local offsetAng = Angle(-180, 0, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,179 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_morphine" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Morphine"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Gives Endurance 305s, 15%
Gives Hindered 120s, -30u
Cures Concussion
Cures Dark Vision
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Drugs"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/injector/v_meds_injector.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/injector/w_meds_injector.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "morphine"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local ID_WEAPON = "weapon_eft_injectormorphine"
local ID_PRIMARYAMMO = "morphine"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
else
INI_SEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
timer.Simple(0.05, function()
if IsValid(self) and IsValid(self.Owner) then
local vm = self.Owner:GetViewModel()
if IsValid(vm) then
vm:SetSkin(1)
end
end
end)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("Endurance", 305, 15)
owner:ApplyEffect("Hindered", 120, 30)
owner:RemoveEffect("Concussion")
owner:RemoveEffect("DarkVision")
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(1)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -1, 2)
local offsetAng = Angle(-180, 0, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,175 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_propital" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Propital Regenerative Stimulant"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals 100HP over 300s
Gives Dark Vision 20s
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Stimulants"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/injector/v_meds_injector.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/injector/w_meds_injector.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "propital"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local ID_WEAPON = "weapon_eft_injectorpropital"
local ID_PRIMARYAMMO = "propital"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
else
INI_SEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
timer.Simple(0.05, function()
if IsValid(self) and IsValid(self.Owner) then
local vm = self.Owner:GetViewModel()
if IsValid(vm) then
vm:SetSkin(9)
end
end
end)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("Healing", 300, 1, 3)
owner:ApplyEffect("DarkVision", 20)
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(9)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -1, 2)
local offsetAng = Angle(-180, 0, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,175 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_TG12" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "xTG-12 Antidote"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Cures Poison
Gives Wither -5HP over 60s
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Stimulants"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/injector/v_meds_injector.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/injector/w_meds_injector.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "tg12"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local ID_WEAPON = "weapon_eft_injectortg12"
local ID_PRIMARYAMMO = "tg12"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
else
INI_SEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
timer.Simple(0.05, function()
if IsValid(self) and IsValid(self.Owner) then
local vm = self.Owner:GetViewModel()
if IsValid(vm) then
vm:SetSkin(13)
end
end
end)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:ApplyEffect("Wither", 60, 1, 12)
owner:RemoveEffect("Poison")
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(13)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(3, -1, 2)
local offsetAng = Angle(-180, 0, 0)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,221 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_salewa" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Salewa First Aid Kit"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals up to 45HP
Cures Bleeding
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Medkits"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/salewa/v_meds_salewa.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/salewa/w_meds_salewa.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "salewafirstaidkit"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 400
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 45
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_salewa"
local ID_PRIMARYAMMO = "salewafirstaidkit"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.IniAnimPills = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
if owner:HaveEffect("Bleeding") then
owner:RemoveEffect("Bleeding")
owner:RemoveAmmo(45, ID_PRIMARYAMMO)
end
end
if INI_VIVO == true then
math.Round(OJSWounds:HealHP(owner, self.MaxHeal, VarHealHealth), 0)
if (OJSWounds:HasStatusWholeBody(owner, "Bleed")) then
OJSWounds:HealBleed(owner)
owner:RemoveAmmo(45, ID_PRIMARYAMMO)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(VarHealHealth, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 or self.IniAnimSyringe == 1 or self.IniAnimPills == 1 then return end
local RndAnim = math.random(1,2)
if (INI_SEF == true and owner:HaveEffect("Bleeding")) or (INI_VIVO == true and (OJSWounds:HasStatusWholeBody(owner, "Bleed"))) then
self:SendWeaponAnim(ACT_VM_MISSRIGHT)
self.IniAnimBandage = 1
elseif RndAnim == 1 then
self:SendWeaponAnim(ACT_VM_MISSRIGHT)
self.IniAnimBandage = 1
elseif RndAnim == 2 then
self:SendWeaponAnim(ACT_VM_PULLBACK_HIGH)
self.IniAnimSyringe = 1
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if SERVER then
if self.IniHeal == 1 and self.IdleTimer <= CurTime() then -- Initialize Heal
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.AnimTimes = 0
self.IniHeal = 0
self:Heal(owner)
end
if self.IniAnimBandage == 1 and self.AnimTimes <= 2 and self.IdleTimer <= CurTime() then -- Bandage Sequence
if math.random(1,2) == 1 then
self:SendWeaponAnim(ACT_VM_MISSRIGHT2)
else
self:SendWeaponAnim(ACT_VM_MISSCENTER)
end
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimBandage == 1 and self.AnimTimes == 3 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_MISSCENTER2)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
if self.IniAnimSyringe == 1 and self.AnimTimes <= 6 and self.IdleTimer <= CurTime() then -- Syringe Sequence
self:SendWeaponAnim(ACT_VM_PULLBACK)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.AnimTimes = self.AnimTimes + 1
elseif self.IniAnimSyringe == 1 and self.AnimTimes == 7 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_PULLBACK_LOW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniHeal = 1
end
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(4, -4, 5)
local offsetAng = Angle(-0, -90, -180)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,194 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/vgui_surgicalkit" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "CMS Surgical Kit"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Cures Broken
]]
SWEP.Category = "EFT"
SWEP.Category1 = "EFT"
SWEP.Category2 = "Injury Treatment"
SWEP.ViewModelFOV = 85
SWEP.ViewModel = "models/weapons/sweps/eft/surgicalkit/v_meds_surgicalkit.mdl"
SWEP.WorldModel = "models/weapons/sweps/eft/surgicalkit/w_meds_surgicalkit.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 5
SWEP.SlotPos = 7
SWEP.DrawAmmo = true
SWEP.SwayScale = 0.15
SWEP.BobScale = 0.75
SWEP.Primary.Ammo = "surgicalkit"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 5
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.MaxHeal = 0
local INI_SEF = false
local INI_VIVO = false
local ID_WEAPON = "weapon_eft_surgicalkit"
local ID_PRIMARYAMMO = "surgicalkit"
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
INI_SEF = true
end
local FilePathVIVO = "lua/autorun/ojsshared.lua"
if file.Exists(FilePathVIVO, "GAME") then
INI_VIVO = true
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self.IniAnimBandage = 0
self.IniAnimSyringe = 0
self.IniAnimPills = 0
self.AnimTimes = 0
self.IniHeal = 0
self:SendWeaponAnim(ACT_VM_IDLE)
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then
owner:StripWeapon(ID_WEAPON)
owner:SelectWeapon(owner:GetPreviousWeapon())
end
return true
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
if IsValid(self) then
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then -- Heal logic
if INI_SEF == true then
owner:RemoveEffect("Broken")
owner:RemoveEffect("Deathsdoorrecovery")
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
end
self:Deploy()
end
end
function SWEP:Heal(owner)
local owner = self:GetOwner()
local VarMissingHealth = owner:GetMaxHealth() - owner:Health()
local VarGetHealth = math.min(VarMissingHealth, owner:GetAmmoCount(ID_PRIMARYAMMO))
local VarHealHealth = math.min(VarGetHealth, self.MaxHeal)
if IsValid(owner) and SERVER and owner:GetActiveWeapon():GetClass() == ID_WEAPON then
if INI_SEF == true then
owner:RemoveEffect("Broken")
owner:RemoveEffect("Deathsdoorrecovery")
end
if INI_VIVO == true then
if (OJSWounds:HasBlackoutWholeBody(owner)) then
OJSWounds:HealBlackout(owner)
end
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + VarHealHealth))
end
owner:RemoveAmmo(1, ID_PRIMARYAMMO)
self:Deploy()
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
if self.IniAnimBandage == 1 then return end
self:SendWeaponAnim(ACT_VM_RECOIL1)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.IniAnimBandage = 1
end
function SWEP:SecondaryAttack()
end
function SWEP:Think()
if self.IniAnimBandage == 1 and self.IdleTimer <= CurTime() then -- Bandage Sequence
self.IniAnimBandage = 0
self.AnimTimes = 0
self.IniHeal = 0
self:Heal(owner)
end
end
function SWEP:Holster()
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end
if CLIENT then -- Worldmodel offset
local WorldModel = ClientsideModel(SWEP.WorldModel)
WorldModel:SetSkin(0)
WorldModel:SetNoDraw(true)
function SWEP:DrawWorldModel()
local owner = self:GetOwner()
if (IsValid(owner)) then
local offsetVec = Vector(4, -1, -1)
local offsetAng = Angle(-90, 180, -90)
local boneid = owner:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
if !boneid then return end
local matrix = owner:GetBoneMatrix(boneid)
if !matrix then return end
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
WorldModel:SetPos(newPos)
WorldModel:SetAngles(newAng)
WorldModel:SetupBones()
else
WorldModel:SetPos(self:GetPos())
WorldModel:SetAngles(self:GetAngles())
self:DrawModel()
end
WorldModel:DrawModel()
end
end

View File

@@ -0,0 +1,230 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/item_bandages" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Bandage"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals 20HP
]]
SWEP.Category = "NMRIH"
SWEP.ViewModelFOV = 65
SWEP.ViewModel = "models/weapons/nmrih/items/bandage/v_item_bandages.mdl"
SWEP.WorldModel = "models/weapons/nmrih/items/bandage/w_bandages.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 0
SWEP.SlotPos = 5
SWEP.DrawAmmo = true
SWEP.Primary.Ammo = "bandage"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.HitDistance = 90
SWEP.PrimaryCD = 1
SWEP.PrimaryHitTime = 0.1
local HealAmount = 20
local ArmorAmount = 0
local InitializeSEF = false
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
InitializeSEF = true
else
InitializeSEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self:SendWeaponAnim(ACT_VM_DRAW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 0
self.InitializeHealing = 0
self.vmcamera = nil
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then owner:StripWeapon("weapon_nmrih_bandage") end -- Reminder
return true
end
local function Heal(owner, weapon)
local activeWeapon = owner:GetActiveWeapon()
if IsValid(weapon) then
if IsValid(owner) and SERVER and activeWeapon:GetClass() == "weapon_nmrih_bandage" then -- Reminder
if InitializeSEF == true then
owner:ApplyEffect("Healing", 1, 20, 1)
owner:RemoveEffect("Bleeding")
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + HealAmount))
owner:SetArmor(math.min(owner:GetMaxArmor(), owner:Armor() + ArmorAmount))
end
owner:RemoveAmmo(1, "bandage") -- Reminder
-- owner:EmitSound("nil")
weapon:Deploy()
end
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:SetNextPrimaryFire(CurTime() + self.Owner:GetViewModel():SequenceDuration() + 0)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.InitializeHealing = 1
self.Idle = 1
end
function SWEP:SecondaryAttack()
local owner = self:GetOwner()
local dmginfo = DamageInfo()
local tr = util.TraceLine( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mask = MASK_SHOT_HULL
} )
if ( !IsValid( tr.Entity ) ) then
tr = util.TraceHull( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mins = Vector( -10, -10, -8 ),
maxs = Vector( 10, 10, 8 ),
mask = MASK_SHOT_HULL
} )
end
if self.InitializeHealing == 1 then return end
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self:SendWeaponAnim(ACT_VM_HITCENTER)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self:SetNextSecondaryFire(CurTime() + 0.9)
self.Idle = 0
self.Sprint = 0
self.Walk = 0
timer.Create("TimerHitWhen", self.PrimaryHitTime, 1, function() -- Impact Timer
if SERVER then
if ( SERVER and IsValid( tr.Entity ) and ( tr.Entity:IsNPC() or tr.Entity:IsPlayer() or tr.Entity:Health() > 0 ) ) then
dmginfo:SetDamage(10)
dmginfo:SetAttacker(self.Owner)
dmginfo:SetInflictor(self)
dmginfo:SetDamageType(DMG_CRUSH)
tr.Entity:TakeDamageInfo(dmginfo)
end
end
end)
end
function SWEP:Reload()
local owner = self:GetOwner()
local trace = owner:GetEyeTrace()
if self.Give == 1 then return end
if IsValid(trace.Entity) and trace.Entity:IsPlayer() then
local targetPlayer = trace.Entity
self:SendWeaponAnim(ACT_VM_THROW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 1
owner:RemoveAmmo(1, "bandage")
if CLIENT then return end
timer.Create("TimerNMRIHBandageGive", 1.2, 1, function()
if targetPlayer:HasWeapon("weapon_nmrih_bandage") then
targetPlayer:GiveAmmo( 1, "bandage")
else
targetPlayer:Give("weapon_nmrih_bandage")
end
-- print(owner:Nick() .. " gave a bandage to " .. targetPlayer:Nick())
self:Deploy()
end)
end
end
function SWEP:Think()
local owner = self.Owner
if self.InitializeHealing == 1 and self.IdleTimer <= CurTime() then
if IsValid(self) then
Heal(owner, self)
end
end
if self.InitializeHealing == 1 then return end
if (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT) and owner:KeyDown(IN_SPEED)) then -- If Sprinting
if self.Sprint == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_SPRINT_IDLE)
self.Sprint = 1
self.Walk = 0
self.Idle = 0
end
elseif (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT)) then -- If Walking
if self.Walk == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_IDLE_LOWERED)
self.Walk = 1
self.Sprint = 0
self.Idle = 0
end
elseif self.Idle == 0 and self.IdleTimer <= CurTime() then -- Idle Sequence
self:SendWeaponAnim(ACT_VM_IDLE)
self.Idle = 1
self.Sprint = 0
self.Walk = 0
end
end
function SWEP:Holster()
timer.Remove("TimerHitWhen")
timer.Remove("TimerNMRIHBandageGive")
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end

View File

@@ -0,0 +1,227 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/item_gene_therapy" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Genetherapy"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
]]
SWEP.Category = "NMRIH"
SWEP.ViewModelFOV = 65
SWEP.ViewModel = "models/weapons/nmrih/items/genetherapy/v_item_genetherapy.mdl"
SWEP.WorldModel = "models/weapons/nmrih/items/genetherapy/w_genetherapy.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 0
SWEP.SlotPos = 5
SWEP.DrawAmmo = true
SWEP.Primary.Ammo = "genetherapy"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.HitDistance = 90
SWEP.PrimaryHitTime = 0.1
local HealAmount = 0
local ArmorAmount = 50
local InitializeSEF = false
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
InitializeSEF = true
else
InitializeSEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self:SendWeaponAnim(ACT_VM_DRAW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 0
self.InitializeHealing = 0
self.vmcamera = nil
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then owner:StripWeapon("weapon_nmrih_genetherapy") end -- Reminder
return true
end
local function Heal(owner, weapon)
local activeWeapon = owner:GetActiveWeapon()
if IsValid(weapon) then
if IsValid(owner) and SERVER and activeWeapon:GetClass() == "weapon_nmrih_genetherapy" then -- Reminder
if InitializeSEF == true then
owner:ApplyEffect("Tenacity", math.huge)
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + HealAmount))
owner:SetArmor(math.min(owner:GetMaxArmor(), owner:Armor() + ArmorAmount))
end
owner:RemoveAmmo(1, "genetherapy") -- Reminder
-- owner:EmitSound("nil")
weapon:Deploy()
end
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:SetNextPrimaryFire(CurTime() + self.Owner:GetViewModel():SequenceDuration() + 0)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.InitializeHealing = 1
self.Idle = 1
end
function SWEP:SecondaryAttack()
local owner = self:GetOwner()
local dmginfo = DamageInfo()
local tr = util.TraceLine( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mask = MASK_SHOT_HULL
} )
if ( !IsValid( tr.Entity ) ) then
tr = util.TraceHull( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mins = Vector( -10, -10, -8 ),
maxs = Vector( 10, 10, 8 ),
mask = MASK_SHOT_HULL
} )
end
if self.InitializeHealing == 1 then return end
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self:SendWeaponAnim(ACT_VM_HITCENTER)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self:SetNextSecondaryFire(CurTime() + 0.9)
self.Idle = 0
self.Sprint = 0
self.Walk = 0
timer.Create("TimerHitWhen", self.PrimaryHitTime, 1, function() -- Impact Timer
if SERVER then
if ( SERVER and IsValid( tr.Entity ) and ( tr.Entity:IsNPC() or tr.Entity:IsPlayer() or tr.Entity:Health() > 0 ) ) then
dmginfo:SetDamage(10)
dmginfo:SetAttacker(self.Owner)
dmginfo:SetInflictor(self)
dmginfo:SetDamageType(DMG_CRUSH)
tr.Entity:TakeDamageInfo(dmginfo)
end
end
end)
end
function SWEP:Reload()
local owner = self:GetOwner()
local trace = owner:GetEyeTrace()
if self.Give == 1 then return end
if IsValid(trace.Entity) and trace.Entity:IsPlayer() then
local targetPlayer = trace.Entity
self:SendWeaponAnim(ACT_VM_THROW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 1
owner:RemoveAmmo(1, "genetherapy")
if CLIENT then return end
timer.Create("TimerNMRIHBandageGive", 1.2, 1, function()
if targetPlayer:HasWeapon("weapon_nmrih_genetherapy") then
targetPlayer:GiveAmmo( 1, "genetherapy")
else
targetPlayer:Give("weapon_nmrih_genetherapy")
end
-- print(owner:Nick() .. " gave a bandage to " .. targetPlayer:Nick())
self:Deploy()
end)
end
end
function SWEP:Think()
local owner = self.Owner
if self.InitializeHealing == 1 and self.IdleTimer <= CurTime() then
if IsValid(self) then
Heal(owner, self)
end
end
if self.InitializeHealing == 1 then return end
if (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT) and owner:KeyDown(IN_SPEED)) then -- If Sprinting
if self.Sprint == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_SPRINT_IDLE)
self.Sprint = 1
self.Walk = 0
self.Idle = 0
end
elseif (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT)) then -- If Walking
if self.Walk == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_IDLE_LOWERED)
self.Walk = 1
self.Sprint = 0
self.Idle = 0
end
elseif self.Idle == 0 and self.IdleTimer <= CurTime() then -- Idle Sequence
self:SendWeaponAnim(ACT_VM_IDLE)
self.Idle = 1
self.Sprint = 0
self.Walk = 0
end
end
function SWEP:Holster()
timer.Remove("TimerHitWhen")
timer.Remove("TimerNMRIHBandageGive")
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end

View File

@@ -0,0 +1,228 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/item_first_aid" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "First Aid"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
Heals 100HP
]]
SWEP.Category = "NMRIH"
SWEP.ViewModelFOV = 65
SWEP.ViewModel = "models/weapons/nmrih/items/medkit/v_item_firstaid.mdl"
SWEP.WorldModel = "models/weapons/nmrih/items/medkit/w_firstaidkit.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 0
SWEP.SlotPos = 5
SWEP.DrawAmmo = true
SWEP.Primary.Ammo = "medkit"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.HitDistance = 90
SWEP.PrimaryCD = 1
SWEP.PrimaryHitTime = 0.1
local HealAmount = 100
local ArmorAmount = 0
local InitializeSEF = false
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
InitializeSEF = true
else
InitializeSEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self:SendWeaponAnim(ACT_VM_DRAW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 0
self.InitializeHealing = 0
self.vmcamera = nil
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then owner:StripWeapon("weapon_nmrih_medkit") end -- Reminder
return true
end
local function Heal(owner, weapon)
local activeWeapon = owner:GetActiveWeapon()
if IsValid(weapon) then
if IsValid(owner) and SERVER and activeWeapon:GetClass() == "weapon_nmrih_medkit" then -- Reminder
if InitializeSEF == true then
owner:ApplyEffect("Healing", 1, 100, 1)
owner:RemoveEffect("Bleeding")
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + HealAmount))
owner:SetArmor(math.min(owner:GetMaxArmor(), owner:Armor() + ArmorAmount))
end
owner:RemoveAmmo(1, "medkit") -- Reminder
-- owner:EmitSound("nil")
weapon:Deploy()
end
end
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:SetNextPrimaryFire(CurTime() + self.Owner:GetViewModel():SequenceDuration() + 0)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.InitializeHealing = 1
self.Idle = 1
end
function SWEP:SecondaryAttack()
local owner = self:GetOwner()
local dmginfo = DamageInfo()
local tr = util.TraceLine( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mask = MASK_SHOT_HULL
} )
if ( !IsValid( tr.Entity ) ) then
tr = util.TraceHull( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mins = Vector( -10, -10, -8 ),
maxs = Vector( 10, 10, 8 ),
mask = MASK_SHOT_HULL
} )
end
if self.InitializeHealing == 1 then return end
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self:SendWeaponAnim(ACT_VM_HITCENTER)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self:SetNextSecondaryFire(CurTime() + 0.9)
self.Idle = 0
self.Sprint = 0
self.Walk = 0
timer.Create("TimerHitWhen", self.PrimaryHitTime, 1, function() -- Impact Timer
if SERVER then
if ( SERVER and IsValid( tr.Entity ) and ( tr.Entity:IsNPC() or tr.Entity:IsPlayer() or tr.Entity:Health() > 0 ) ) then
dmginfo:SetDamage(10)
dmginfo:SetAttacker(self.Owner)
dmginfo:SetInflictor(self)
dmginfo:SetDamageType(DMG_CRUSH)
tr.Entity:TakeDamageInfo(dmginfo)
end
end
end)
end
function SWEP:Reload()
local owner = self:GetOwner()
local trace = owner:GetEyeTrace()
if self.Give == 1 then return end
if IsValid(trace.Entity) and trace.Entity:IsPlayer() then
local targetPlayer = trace.Entity
self:SendWeaponAnim(ACT_VM_THROW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 1
owner:RemoveAmmo(1, "medkit")
if CLIENT then return end
timer.Create("TimerNMRIHMedkitGive", 1.2, 1, function()
if targetPlayer:HasWeapon("weapon_nmrih_medkit") then
targetPlayer:GiveAmmo( 1, "medkit")
else
targetPlayer:Give("weapon_nmrih_medkit")
end
-- print(owner:Nick() .. " gave a bandage to " .. targetPlayer:Nick())
self:Deploy()
end)
end
end
function SWEP:Think()
local owner = self.Owner
if self.InitializeHealing == 1 and self.IdleTimer <= CurTime() then
if IsValid(self) then
Heal(owner, self)
end
end
if self.InitializeHealing == 1 then return end
if (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT) and owner:KeyDown(IN_SPEED)) then -- If Sprinting
if self.Sprint == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_SPRINT_IDLE)
self.Sprint = 1
self.Walk = 0
self.Idle = 0
end
elseif (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT)) then -- If Walking
if self.Walk == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_IDLE_LOWERED)
self.Walk = 1
self.Sprint = 0
self.Idle = 0
end
elseif self.Idle == 0 and self.IdleTimer <= CurTime() then -- Idle Sequence
self:SendWeaponAnim(ACT_VM_IDLE)
self.Idle = 1
self.Sprint = 0
self.Walk = 0
end
end
function SWEP:Holster()
timer.Remove("TimerHitWhen")
timer.Remove("TimerNMRIHMedkitGive")
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end

View File

@@ -0,0 +1,241 @@
if CLIENT then
SWEP.WepSelectIcon = surface.GetTextureID( "vgui/hud/item_pills" )
SWEP.BounceWeaponIcon = true
SWEP.DrawWeaponInfoBox = true
end
SWEP.PrintName = "Phalanx"
SWEP.Author = "Craft_Pig"
SWEP.Purpose =
[[
]]
SWEP.Category = "NMRIH"
SWEP.ViewModelFOV = 65
SWEP.ViewModel = "models/weapons/nmrih/items/phalanx/v_item_phalanx.mdl"
SWEP.WorldModel = "models/weapons/nmrih/items/phalanx/w_phalanx.mdl"
SWEP.UseHands = true
SWEP.DrawCrosshair = false
SWEP.Spawnable = true
SWEP.Slot = 0
SWEP.SlotPos = 5
SWEP.DrawAmmo = true
SWEP.Primary.Ammo = "phalanx"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = 1
SWEP.Primary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.HitDistance = 90
SWEP.PrimaryCD = 1
SWEP.PrimaryHitTime = 0.1
local HealAmount = 1
local ArmorAmount = 0
local RegenAmount = 3
local RegenDuration = 10
local InitializeSEF = false
function SWEP:Initialize()
self:SetHoldType("slam")
local FilePathSEF = "lua/SEF/SEF_Functions.lua"
if file.Exists(FilePathSEF, "GAME") then
InitializeSEF = true
else
InitializeSEF = false
end
end
function SWEP:Deploy()
local owner = self:GetOwner()
self:SendWeaponAnim(ACT_VM_DRAW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 0
self.InitializeHealing = 0
self.vmcamera = nil
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then owner:StripWeapon("weapon_nmrih_phalanx") end -- Reminder
return true
end
local function Heal(owner, weapon)
local activeWeapon = owner:GetActiveWeapon()
if IsValid(weapon) then
if IsValid(owner) and SERVER and activeWeapon:GetClass() == "weapon_nmrih_phalanx" then -- Reminder
if InitializeSEF == true then
owner:ApplyEffect("Healing", 10, 1, 0.32)
owner:ApplyEffect("Tenacity", 10)
else
owner:SetHealth(math.min(owner:GetMaxHealth(), owner:Health() + HealAmount))
owner:SetArmor(math.min(owner:GetMaxArmor(), owner:Armor() + ArmorAmount))
end
owner:RemoveAmmo(1, "phalanx") -- Reminder
-- owner:EmitSound("nil")
weapon:Deploy()
end
end
end
local function Regenerate(owner, weapon)
timer.Create("TimerHealthRegenPainkillersSCPSL", 0.5, RegenDuration, function()
if IsValid(owner) and owner:Alive() then
owner:SetHealth(math.min(owner:Health() + RegenAmount, owner:GetMaxHealth()))
else
timer.Remove("TimerHealthRegenPainkillersSCPSL")
end
end)
end
function SWEP:PrimaryAttack()
local owner = self.Owner
if owner:GetAmmoCount(self.Primary.Ammo) == 0 then return end
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:SetNextPrimaryFire(CurTime() + self.Owner:GetViewModel():SequenceDuration() + 0)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.InitializeHealing = 1
self.Idle = 1
end
function SWEP:SecondaryAttack()
local owner = self:GetOwner()
local dmginfo = DamageInfo()
local tr = util.TraceLine( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mask = MASK_SHOT_HULL
} )
if ( !IsValid( tr.Entity ) ) then
tr = util.TraceHull( {
start = owner:GetShootPos(),
endpos = owner:GetShootPos() + owner:GetAimVector() * self.HitDistance,
filter = owner,
mins = Vector( -10, -10, -8 ),
maxs = Vector( 10, 10, 8 ),
mask = MASK_SHOT_HULL
} )
end
if self.InitializeHealing == 1 then return end
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self:SendWeaponAnim(ACT_VM_HITCENTER)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self:SetNextSecondaryFire(CurTime() + 0.9)
self.Idle = 0
self.Sprint = 0
self.Walk = 0
timer.Create("TimerHitWhen", self.PrimaryHitTime, 1, function() -- Impact Timer
if SERVER then
if ( SERVER and IsValid( tr.Entity ) and ( tr.Entity:IsNPC() or tr.Entity:IsPlayer() or tr.Entity:Health() > 0 ) ) then
dmginfo:SetDamage(10)
dmginfo:SetAttacker(self.Owner)
dmginfo:SetInflictor(self)
dmginfo:SetDamageType(DMG_CRUSH)
tr.Entity:TakeDamageInfo(dmginfo)
end
end
end)
end
function SWEP:Reload()
local owner = self:GetOwner()
local trace = owner:GetEyeTrace()
if self.Give == 1 then return end
if IsValid(trace.Entity) and trace.Entity:IsPlayer() then
local targetPlayer = trace.Entity
self:SendWeaponAnim(ACT_VM_THROW)
self.IdleTimer = CurTime() + self.Owner:GetViewModel():SequenceDuration()
self.Idle = 0
self.Sprint = 0
self.Walk = 0
self.Give = 1
owner:RemoveAmmo(1, "phalanx")
if CLIENT then return end
timer.Create("TimerNMRIHPhalanxGive", 1.2, 1, function()
if targetPlayer:HasWeapon("weapon_nmrih_phalanx") then
targetPlayer:GiveAmmo( 1, "phalanx")
else
targetPlayer:Give("weapon_nmrih_phalanx")
end
-- print(owner:Nick() .. " gave a bandage to " .. targetPlayer:Nick())
self:Deploy()
end)
end
end
function SWEP:Think()
local owner = self.Owner
if self.InitializeHealing == 1 and self.IdleTimer <= CurTime() then
if IsValid(self) then
Heal(owner, self)
if InitializeSEF == false then Regenerate(owner, weapon) end
end
end
if self.InitializeHealing == 1 then return end
if (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT) and owner:KeyDown(IN_SPEED)) then -- If Sprinting
if self.Sprint == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_SPRINT_IDLE)
self.Sprint = 1
self.Walk = 0
self.Idle = 0
end
elseif (owner:KeyDown(IN_FORWARD + IN_BACK + IN_MOVELEFT + IN_MOVERIGHT)) then -- If Walking
if self.Walk == 0 and self.IdleTimer <= CurTime() then
self:SendWeaponAnim(ACT_VM_IDLE_LOWERED)
self.Walk = 1
self.Sprint = 0
self.Idle = 0
end
elseif self.Idle == 0 and self.IdleTimer <= CurTime() then -- Idle Sequence
self:SendWeaponAnim(ACT_VM_IDLE)
self.Idle = 1
self.Sprint = 0
self.Walk = 0
end
end
function SWEP:Holster()
timer.Remove("TimerHitWhen")
timer.Remove("TimerNMRIHPhalanxGive")
return true
end
function SWEP:PostDrawViewModel( vm )
local attachment = vm:GetAttachment(1)
if attachment then
self.vmcamera = vm:GetAngles() - attachment.Ang
else
self.vmcamera = Angle(0, 0, 0)
end
end
function SWEP:CalcView( ply, pos, ang, fov )
self.vmcamera = self.vmcamera or Angle(0, 0, 0)
return pos, ang + self.vmcamera, fov
end