mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-16 13:23:46 +03:00
Upload
This commit is contained in:
340
addons/tfa_base/CHANGELOG.md
Normal file
340
addons/tfa_base/CHANGELOG.md
Normal file
@@ -0,0 +1,340 @@
|
||||
# This is an archive of changelog messages from `tfa_loader.lua`. For proper changes list refer to the Git history.
|
||||
## 4.7.1.0
|
||||
* Fixed bullet force value being completely ignored in favor of autocalculated one
|
||||
* Various inspection menu improvements (localized weapon type, multiline description with word wrap)
|
||||
* Fixed attachments not syncing properly from NPCs and other players
|
||||
* Fixed skins not updating on worldmodels
|
||||
|
||||
## 4.7.0.5
|
||||
* Fixed attachments not being synchronized properly from server in multiplayer
|
||||
|
||||
## 4.7.0.4
|
||||
* Updated low and last ammo sounds, added more types (including unused ones, examples are in the weapon template) and improved autodection.
|
||||
|
||||
## 4.7.0.3
|
||||
* Fixed legacy weapons patcher giving an error when weapon's code couldn't be read
|
||||
|
||||
## 4.7.0.2
|
||||
* Fixed ironsights position evaluator generating errors in some cases
|
||||
* Fixed flat reticle not being scaled by screen height when it's not scaled by aim progress
|
||||
* Added chat reminder to clueless users who only installed the base without any weapons
|
||||
|
||||
## 4.7.0.1
|
||||
* Added TFA_Bullet_Penetrate hook
|
||||
* Fixed 3D scoped weapons being zoomed in too much
|
||||
* Fixed ironsights toggle convar not working properly
|
||||
|
||||
## 4.7.0.0
|
||||
* Semi-Breaking change: Implemented gun revision tracking (but should be backward compatible)
|
||||
* Tickrate independent RPM (for all your roleplaying at 10 ticks needs)
|
||||
* Stencil sights native support (with 2D, model and quad reticles)
|
||||
* Ironsights position resolver (WIP)
|
||||
* Additional SCK features (translucency workaround toggle and attachment parent point)
|
||||
* Weapons now emit sound hints (for engine NPCs)
|
||||
* Primary.DisplaySpread / Primary.DisplayIronSpread toggle
|
||||
* Spread recovery delay (per weapon, not present by default)
|
||||
* Default attachments option (equipped on deselect)
|
||||
* Various fixes, QoL changes and improvements (check commit history on GitLab)
|
||||
* Expanded documentation (lua/tfa/documentation and template)
|
||||
|
||||
## 4.6.1.1
|
||||
* Fixed idle animation not updating correctly for ironsights
|
||||
* Fixed inspection screen not appearing in some circumstances
|
||||
* Improved flashlight toggle prediction
|
||||
* Fixed some grenades throwing an error if "ready" animation is missing
|
||||
|
||||
## 4.6.1.0
|
||||
* BaseClass tables are now unpacked to current weapon class (fixes TFA NMRIH Chainsaw)
|
||||
* Reorganized weapon base files
|
||||
* Added responsive ironsights mode (click to toggle, hold to hold)
|
||||
* Fixed being unable to reload if timescale value is too high
|
||||
* Fixed centering of triangular crosshair
|
||||
* Range is now converted to LUT automatically, removed legacy range option
|
||||
* Fixed damage falloff range display
|
||||
|
||||
## 4.6.0.7
|
||||
* Fixed crouching state not being recognized without holding a key
|
||||
* Fixed bullet ballistics. Again.
|
||||
|
||||
## 4.6.0.6
|
||||
* Added viewmodel viewpunch toggle settings
|
||||
* Fixed crashing when addons call SWEP:Initialize out of order
|
||||
* Fixed bullet ballistics for NPCs not working
|
||||
* Fixed procedural reloads
|
||||
* Sped up ironsights/scope FOV change
|
||||
|
||||
## 4.6.0.5
|
||||
* Added a workaround for old weapons that override SWEP:Think function without baseclass call
|
||||
|
||||
## 4.6.0.4
|
||||
* Fixed nZombies weapons sharing ammo types
|
||||
|
||||
## 4.6.0.3
|
||||
* Fixed viewmodel snapping to idle position on procedural holster end
|
||||
|
||||
## 4.6.0.2
|
||||
* Fixed nZombies compatibility (only original nZ version was tested)
|
||||
|
||||
## 4.6.0.1
|
||||
* Fixed shotgun spread not working properly with ballistics enabled
|
||||
* Fixed some weapons failing to initialize missing attachments table
|
||||
* Fixed DoAmmoCheck error when weapon stripping is enabled
|
||||
|
||||
## 4.6.0.0
|
||||
* HUGE optimization and prediction improvements
|
||||
* Better recoil and viewpunch, all configurable
|
||||
* New nearly-empty (and empty) magazine click sounds
|
||||
* Proper NPC support (custom tracers/projectiles, random attachments)
|
||||
* Redone Inspection GUI (scaled fonts and elements, hooks, overrides)
|
||||
* Improved damage falloff (LUT falloff with variable calculation methods)
|
||||
* ADS reload animation support (like in CAWODOOTY! favorite gaem!!!)
|
||||
* Hybrid blowback animation (allowing model animation to play)
|
||||
* Crouched viewmodel offset position
|
||||
* Full sequence-based weapons support
|
||||
* Silenced empty/last fire animation support
|
||||
* Each animation can contain values for each case (like in SWEP.PumpAction, etc)
|
||||
* New viewmodel position/angles interpolation techniques
|
||||
|
||||
## 4.5.8.0
|
||||
* Added material proxy for tinting envmaps with ambient lighting (TFA_CubemapTint)
|
||||
* Added option to debug currently playing anination (Admin-only)
|
||||
|
||||
## 4.5.7.1
|
||||
* Fixed networked menu not working in Local/P2P servers
|
||||
|
||||
## 4.5.7.0
|
||||
* Added localization support. English and Russian locales are bundled by default.
|
||||
* Fixed weapons not spawning in TTT (by Anairkoen Schno)
|
||||
* Blocked new ammo pickups (SMG grenades) from being pocketed in DarkRP
|
||||
|
||||
## 4.5.6.0
|
||||
* Added ammo entities for SMG grenades (1 and 5 grenades for small and large pickups)
|
||||
* Server settings menu now work in multiplayer (rewritten to use networked controls)
|
||||
|
||||
## 4.5.5.1
|
||||
* Fixed non-ballistics bullet tracers for akimbo weapons
|
||||
* Added bash damage display to inspection screen (when available)
|
||||
|
||||
## 4.5.5.0
|
||||
* Added TFA_BulletPenetration hook, called when bullet hits/penetrates a surface
|
||||
* Reverted ironsights FOV compensation changes - new compensation only applies to viewmodels now
|
||||
* Exposed more variables to stat cache (various sounds, sck elements bodygroups)
|
||||
* Fixed performance degradation when player holds a non-TFA weapon in singleplayer
|
||||
* Added muzzleflash smoke toggle convar (Q -> Options -> Performance -> Use Muzzle Flash Smoke)
|
||||
|
||||
## 4.5.4.0
|
||||
* Started work on new RT scope attachment base
|
||||
* Fixed silenced weapon shaking when Siminov's SWEP packs are installed
|
||||
* Added toggle for melee door destruction
|
||||
* Fixed customization keybind not opening the menu
|
||||
* Fixed viewmodel floating away with low MoveSpeed values
|
||||
* Fixed ironsights FOV compensation to be more consistent on all FOV values
|
||||
* Added SWEP.IronViewModelFOV parameter - SWEP.ViewModelFOV will be set to this when aiming down the sights
|
||||
|
||||
## 4.5.3.1
|
||||
* Added icons for ammo entities
|
||||
|
||||
## 4.5.3.0
|
||||
* Fixed presets in settings menu not working
|
||||
* Various Lua animation fixes
|
||||
* Added customization menu idle animation (and transitions) support
|
||||
|
||||
## 4.5.2.0
|
||||
* Added keybinds! (Menu can be found at Q -> Options -> Keybinds)
|
||||
* Added looping fire support
|
||||
* Fixed shell casings scrape sounds (huge thanks to gmod_silent material for not working properly!)
|
||||
|
||||
## 4.5.1.1
|
||||
* Fixed bugs with level transition and for bullets fired after player's death
|
||||
* Fixed looped fire sounds not working properly in P2P/listen servers
|
||||
|
||||
## 4.5.1.0
|
||||
* Flashlights rework: added support for QC attachments of SCK elements and custom on/off sounds
|
||||
* Added TFA.AddSound function (simple wrapper for sound.Add)
|
||||
* Looping fire sound now updates correctly if changed while playing
|
||||
|
||||
## 4.5.0.3
|
||||
* Fixed resetting viewmodel skin after switching weapon
|
||||
* Fixed Ironsights DoF blurring whole screen for 2D-scoped weapons
|
||||
* Fixed ballistics ConVars (dev branch is now safe to use again)
|
||||
|
||||
## 4.5.0.2
|
||||
* Fixed the bug with first spawned weapon after map load not working
|
||||
|
||||
## 4.5.0.1
|
||||
* Inspection VGUI now doesn't block the screen with mat_dxlevel < 90
|
||||
* Ironsights convar now works properly again
|
||||
* Base explosives now can have custom bounce sound (ENT.BounceSound)
|
||||
* Crysis-like triangular crosshair, can be enabled in the "HUD / Crosshair" section
|
||||
|
||||
## 4.5.0.0
|
||||
* Weapons can now have a working flashlight
|
||||
* Changed laser dot to appear as projected texture
|
||||
* Added attachment callbacks
|
||||
* Safety position is now separated from sprint one
|
||||
* Melee blocking works again
|
||||
* Base explosives now properly damage helicopters and gunships
|
||||
* Added jamming mechanics
|
||||
* Added CS:GO-like low ammo sound effect
|
||||
* Added bodygroup names support
|
||||
* Attachments can now have their own attach/detach sound
|
||||
* Added walk animations support (similar to sprint animations)
|
||||
* Bonemods are now working properly with blowback enabled
|
||||
* Fixed laser drawing behing worldmodel
|
||||
* Looped gunfire sound support added (Experimental)
|
||||
|
||||
## 4.4.2.1
|
||||
* Changelog can be toggled off with sv_tfa_changelog
|
||||
|
||||
## 4.4.2.0
|
||||
* New laser dots
|
||||
* Better ejection effects
|
||||
* AI melee support
|
||||
|
||||
## 4.4.1.0
|
||||
* Patch: New smoke effects on muzzles and shells, which should hopefully eat less fps and look better
|
||||
|
||||
## 4.4.0.0
|
||||
* Entire base linted
|
||||
* Fewer global variables
|
||||
* TFA attachment table moved to TFA.Attachments.Atts -- this will need an update to autopatching mods
|
||||
|
||||
## 4.3.8.1
|
||||
* PATCH - Exploit regarding new C-Menu fix, viewmodel viewpunch made into a cvar ( it'll go down with recoil if disabled )
|
||||
|
||||
## 4.3.8.0
|
||||
* Reticules/lasers now colorable in context menu
|
||||
* Hold E as you hit your inspection key to access the context menu as normal
|
||||
|
||||
## 4.3.7.0
|
||||
* Attachment UI now allows rows to affect the same category, and will break apart exceedingly large rows
|
||||
* Legacy attachment UI removed
|
||||
|
||||
## 4.3.6.0
|
||||
* Muzzles + smoke updated, the latter taken from CS:GO
|
||||
|
||||
## 4.3.5.2
|
||||
* Fixed shells networking
|
||||
* Fixed RT scope resolution autodetect
|
||||
* Added RT scope material proxy
|
||||
|
||||
## 4.3.5.1
|
||||
* Fixed weapon bounce in new viewbob, increased intensity, smooth eye focus
|
||||
|
||||
## 4.3.5.0
|
||||
* Cancelling an empty reload on a closed bolt weapon will play the first deploy and cock the gun upon next draw
|
||||
|
||||
## 4.3.4.1
|
||||
* Fixed console spam with dropped weapons
|
||||
* Added ability to disable door destruction (thanks to Ralph)
|
||||
|
||||
## 4.3.4.0
|
||||
* Viewbob tweaks
|
||||
|
||||
## 4.3.2.3
|
||||
* More violent shell ejection; shell angle determined by eye angles
|
||||
|
||||
## 4.3.2.2
|
||||
* Shells resized AGAIN and double-checked for accuracy this time using OBBMaxs()-OBBMins()
|
||||
|
||||
## 4.3.2.1
|
||||
* SWEP.LuaShellEffect = "" disables the new tfa_shell stuff
|
||||
* Shells resized using actual math
|
||||
|
||||
## 4.3.2.0
|
||||
* Added ability to override new shell effects
|
||||
* Fixed serverside modules/external files loader
|
||||
* Fixed LookupAttachment error for externally registered weapons
|
||||
* Fixed scope background blur working in thirdperson
|
||||
|
||||
## 4.3.1.0
|
||||
* Shell hotfixes
|
||||
* Weapons no longer have airboat damage type, finally fixing ragdolls
|
||||
|
||||
## 4.3.0.0
|
||||
* New shell ejection effects
|
||||
* New shell models (Soldier11's)
|
||||
* RT Scope Blur
|
||||
* New clientside options on the performance and scope panels
|
||||
|
||||
## 4.2.8.0
|
||||
* Numerous bugfixes
|
||||
* Notably: FOV fixed in overlay-style scopes + shotgun timing fixes
|
||||
|
||||
## 4.2.7.9
|
||||
* Inspection panel tweaks and performance fixes
|
||||
* New font for ammo hud and inspection panel
|
||||
* Fixed ironsight sway direction for flipped viewmodels
|
||||
|
||||
## 4.2.7.8
|
||||
* Unload functions added
|
||||
|
||||
## 4.2.7.4
|
||||
* ERROR SPAM HOTFIX
|
||||
|
||||
## 4.2.7.3
|
||||
* Silenced inspection added ( ACT_VM_FIDGET_SILENCED = ACT_VM_FIDGET_SILENCED or ACT_RPG_FIDGET_UNLOADED )
|
||||
* Have a one-time invitation to my Discord: https://discord.gg/Gxqx67n
|
||||
|
||||
## 4.2.6.5
|
||||
* Added laser-dot trail convar ( thanks Yura )
|
||||
|
||||
## 4.2.6.4
|
||||
* Fixed Yura's crosshair nitpick
|
||||
|
||||
## 4.2.6.2
|
||||
* Melee base prediction fixes
|
||||
|
||||
## 4.2.6.1
|
||||
* Knife prediction improvements ( general melee to follow )
|
||||
|
||||
## 4.1.7.0
|
||||
* Bind detection system added
|
||||
|
||||
## 4.0.1.0
|
||||
* TFA Base Rewrite
|
||||
* Numerous hotfixes, including ADS, sprint anims, etc.
|
||||
* DarkRP "fp" table no longer overwritten
|
||||
* External status support added
|
||||
* Reload sounds added
|
||||
|
||||
## 3.05.2.0
|
||||
* Doors fixed for DarkRP ( probably )
|
||||
* Silenced weapon inspection fixed
|
||||
* Idle animation timing improved
|
||||
* C-Key inspection fixed
|
||||
* Weapon stripping fixed
|
||||
* CVAR sv_tfa_door_respawn added
|
||||
|
||||
## 3.05.0.0
|
||||
* Basic GMDUSK integration
|
||||
* Shotgun door-bust tweaked, improved, and fixed for DarkRP (hopefully)
|
||||
* Scopes fixed for DarkRP ( hopefully )
|
||||
|
||||
## 3.01.2.0
|
||||
* New group prompt added
|
||||
* Introduced bare-basics multilanguage support
|
||||
* Migrated global functions to a table
|
||||
* Miscelaneous quality of life improvements
|
||||
|
||||
## 3.01.1.0
|
||||
* Added new cvars of mp_tfa_precach. Enable these to increase loading times but reduce lag and weapon spawn time.
|
||||
* Use console autocomplete instead of bothering me for the exact names!
|
||||
* Bugfix in setupmove fixed
|
||||
* Conflict message improved, displaying exact filepath for a conflicting tfa_loader
|
||||
* Lua particle handling fixed on invalid viewmodels
|
||||
* Other misc. bugfixes
|
||||
|
||||
## 3.0.0.1
|
||||
* Shock damage no longer removes props
|
||||
* Fixed rendertargets
|
||||
* Further improved performance
|
||||
|
||||
## 3.0.0.0
|
||||
* Entire TFA Base linted and micro-optimized
|
||||
* Performance holding a TFA Base gun is better compared to a HL2 gun
|
||||
|
||||
## 2.88.0.0
|
||||
* Added SWEP.Primary.AmmoConsumption
|
||||
* Added extra revolver ejecteffect
|
||||
* Misc. bugfixes
|
||||
21
addons/tfa_base/LICENSE
Normal file
21
addons/tfa_base/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 TFA Base Devs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
25
addons/tfa_base/README.md
Normal file
25
addons/tfa_base/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# TFA Base
|
||||
A customizable, modular, feature-rich weapon base for Garry's Mod.
|
||||
|
||||
# How to use
|
||||
## As a user
|
||||
* Install a [workshop version](https://steamcommunity.com/sharedfiles/filedetails/?id=415143062) (stable)
|
||||
* Clone the repository into `addons` folder (unstable, no support)
|
||||
## As a developer
|
||||
* For making weapons: check out the [weapon template](lua/weapons/tfa_base_template/shared.lua)
|
||||
* For making attachments: see the [base attachment](lua/tfa/att/base.lua) for reference
|
||||
|
||||
# Copyright stuff
|
||||
* All base code is licensed under [MIT](https://opensource.org/licenses/MIT), unless otherwise stated in the code file. The only exception to the license is [GMod's Steam Workshop Rules](https://wiki.facepunch.com/gmod/Steam_Workshop_Rules), which forbids reuploading addons in there.
|
||||
* Сustom assets (made by base contributors) is licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
|
||||
|
||||
# Credits
|
||||
* INCONCEIVABLE — Assets for scope overlays
|
||||
* Clavus — SWEP Construction Kit code and reference
|
||||
* Wystan — Attachments models
|
||||
* 『クリスチャン』 — Nearly-empty click sounds
|
||||
* Valve — Shell casings models
|
||||
|
||||
# Contact us
|
||||
* [Discord](https://discord.com/invite/Gxqx67n)
|
||||
* [Steam Group](https://steamcommunity.com/groups/tfa-mods)
|
||||
15
addons/tfa_base/addon.json
Normal file
15
addons/tfa_base/addon.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"title" : "TFA Base",
|
||||
"type" : "Weapon",
|
||||
"tags" : [ "fun", "realism" ],
|
||||
"ignore" :
|
||||
[
|
||||
"*.psd",
|
||||
"*.vcproj",
|
||||
"*.svn*",
|
||||
"*.git*",
|
||||
"*.json",
|
||||
"*.bat",
|
||||
"*.gma"
|
||||
]
|
||||
}
|
||||
82
addons/tfa_base/genluahashes.py
Normal file
82
addons/tfa_base/genluahashes.py
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
# Copyright (c) 2018-2021 TFA Base Devs
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
import os, zlib
|
||||
|
||||
targetPath = "lua/autorun/!tfa_base_crc_check.lua"
|
||||
|
||||
hashCheckCode = '''if CLIENT then return end
|
||||
|
||||
local hashes = {{
|
||||
{hashes}
|
||||
}}
|
||||
|
||||
local function check_and_compare_files()
|
||||
for file_name, crc_stored in pairs(hashes) do
|
||||
if string.sub(file_name, 1, 4) == "lua/" then
|
||||
file_name = string.sub(file_name, 5)
|
||||
end
|
||||
|
||||
local file_contents = file.Read(file_name, "LUA")
|
||||
|
||||
if not file_contents or file_contents == "" then
|
||||
print("[TFA Base] (CRC) An error occured while reading file '" .. file_name .. "'")
|
||||
|
||||
goto CONTINUE
|
||||
end
|
||||
|
||||
local crc_local = util.CRC(file_contents)
|
||||
|
||||
if not crc_local then
|
||||
print("[TFA Base] (CRC) Unable to calculate checksum for file '" .. file_name .. "'")
|
||||
elseif crc_local ~= crc_stored then
|
||||
print("[TFA Base] (CRC) Checksum diff for '" .. file_name .. "': expected " .. tostring(crc_stored) .. ", got " .. tostring(crc_local))
|
||||
end
|
||||
|
||||
::CONTINUE::
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("InitPostEntity", "TFABase_CRCIntegrityCheck", check_and_compare_files)'''
|
||||
|
||||
if __name__ == '__main__':
|
||||
if os.path.exists(targetPath):
|
||||
os.remove(targetPath)
|
||||
|
||||
hashes = {}
|
||||
|
||||
for root, dirs, files in os.walk("lua"):
|
||||
for file in files:
|
||||
if file.endswith("___basecrc.lua"):
|
||||
continue
|
||||
|
||||
if file.endswith(".lua"):
|
||||
fileName = os.path.join(root, file)
|
||||
with open(fileName, "rb") as f:
|
||||
hashes[fileName.replace("\\", "/")] = zlib.crc32(f.read())
|
||||
|
||||
hashesStr = ''
|
||||
for filename in hashes:
|
||||
hashesStr = hashesStr + '\t["' + filename + '"] = "' + str(hashes[filename]) + '",\n'
|
||||
|
||||
hashesFile = open(targetPath, 'w')
|
||||
hashesFile.write(hashCheckCode.format(hashes=hashesStr))
|
||||
hashesFile.close()
|
||||
1
addons/tfa_base/icon.jpg
Normal file
1
addons/tfa_base/icon.jpg
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
After Width: | Height: | Size: 4 B |
1
addons/tfa_base/id.txt
Normal file
1
addons/tfa_base/id.txt
Normal file
@@ -0,0 +1 @@
|
||||
415143062
|
||||
36
addons/tfa_base/lua/autorun/tfa_base_autorun.lua
Normal file
36
addons/tfa_base/lua/autorun/tfa_base_autorun.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if SERVER then
|
||||
AddCSLuaFile()
|
||||
end
|
||||
|
||||
include("tfa/framework/tfa_loader.lua")
|
||||
56
addons/tfa_base/lua/effects/tfa_bullet_impact/init.lua
Normal file
56
addons/tfa_base/lua/effects/tfa_bullet_impact/init.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
function EFFECT:Init(data)
|
||||
local posoffset = data:GetOrigin()
|
||||
local emitter = ParticleEmitter(posoffset)
|
||||
|
||||
if TFA.GetGasEnabled() then
|
||||
local p = emitter:Add("sprites/heatwave", posoffset)
|
||||
p:SetVelocity(50 * data:GetNormal() + 0.5 * VectorRand())
|
||||
p:SetAirResistance(200)
|
||||
p:SetStartSize(math.random(12.5, 17.5))
|
||||
p:SetEndSize(2)
|
||||
p:SetDieTime(math.Rand(0.15, 0.225))
|
||||
p:SetRoll(math.Rand(-180, 180))
|
||||
p:SetRollDelta(math.Rand(-0.75, 0.75))
|
||||
end
|
||||
|
||||
emitter:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
return false
|
||||
end
|
||||
72
addons/tfa_base/lua/effects/tfa_dust_impact/init.lua
Normal file
72
addons/tfa_base/lua/effects/tfa_dust_impact/init.lua
Normal file
@@ -0,0 +1,72 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
function EFFECT:Init(data)
|
||||
local ply = data:GetEntity()
|
||||
local ent
|
||||
|
||||
if IsValid(ply) and ply:IsPlayer() then
|
||||
ent = ply:GetActiveWeapon()
|
||||
end
|
||||
|
||||
local sfac = (IsValid(ent) and ent.Primary and ent.Primary.Damage) and math.sqrt(ent.Primary.Damage / 30) or 1
|
||||
local sfac_sqrt = math.sqrt(sfac)
|
||||
local posoffset = data:GetOrigin()
|
||||
local forward = data:GetNormal()
|
||||
local emitter = ParticleEmitter(posoffset)
|
||||
|
||||
for i = 0, math.Round(8 * sfac) do
|
||||
local p = emitter:Add("particle/particle_smokegrenade", posoffset)
|
||||
p:SetVelocity(90 * math.sqrt(i) * forward)
|
||||
p:SetAirResistance(400)
|
||||
p:SetStartAlpha(math.Rand(255, 255))
|
||||
p:SetEndAlpha(0)
|
||||
p:SetDieTime(math.Rand(0.75, 1) * (1 + math.sqrt(i) / 3))
|
||||
local iclamped = math.Clamp(i, 1, 8)
|
||||
local iclamped_sqrt = math.sqrt(iclamped / 8) * 8
|
||||
p:SetStartSize(math.Rand(1, 1) * sfac_sqrt * iclamped_sqrt)
|
||||
p:SetEndSize(math.Rand(1.5, 1.75) * sfac_sqrt * iclamped)
|
||||
p:SetRoll(math.Rand(-25, 25))
|
||||
p:SetRollDelta(math.Rand(-0.05, 0.05))
|
||||
p:SetColor(255, 255, 255)
|
||||
p:SetLighting(true)
|
||||
end
|
||||
|
||||
emitter:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
return false
|
||||
end
|
||||
87
addons/tfa_base/lua/effects/tfa_metal_impact/init.lua
Normal file
87
addons/tfa_base/lua/effects/tfa_metal_impact/init.lua
Normal file
@@ -0,0 +1,87 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local gravity_cv = GetConVar("sv_gravity")
|
||||
EFFECT.VelocityRandom = 0.25
|
||||
EFFECT.VelocityMin = 95
|
||||
EFFECT.VelocityMax = 125
|
||||
EFFECT.ParticleCountMin = 4
|
||||
EFFECT.ParticleCountMax = 7
|
||||
EFFECT.ParticleLife = 1.3
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.StartPos = data:GetOrigin()
|
||||
self.Dir = data:GetNormal()
|
||||
self.LifeTime = 0.1
|
||||
self.DieTime = CurTime() + self.LifeTime
|
||||
self.PartMult = 0.2
|
||||
self.Grav = Vector(0, 0, -gravity_cv:GetFloat())
|
||||
self.SparkLife = 1
|
||||
local emitter = ParticleEmitter(self.StartPos)
|
||||
local partcount = math.random(self.ParticleCountMin, self.ParticleCountMax)
|
||||
|
||||
--Sparks
|
||||
for _ = 1, partcount do
|
||||
local part = emitter:Add("effects/yellowflare", self.StartPos)
|
||||
part:SetVelocity(Lerp(self.VelocityRandom, self.Dir, VectorRand()) * math.Rand(self.VelocityMin, self.VelocityMax))
|
||||
part:SetDieTime(math.Rand(0.25, 1) * self.SparkLife)
|
||||
part:SetStartAlpha(255)
|
||||
part:SetStartSize(math.Rand(2, 4))
|
||||
part:SetEndSize(0)
|
||||
part:SetRoll(0)
|
||||
part:SetGravity(self.Grav)
|
||||
part:SetCollide(true)
|
||||
part:SetBounce(0.55)
|
||||
part:SetAirResistance(0.5)
|
||||
part:SetStartLength(0.2)
|
||||
part:SetEndLength(0)
|
||||
part:SetVelocityScale(true)
|
||||
part:SetCollide(true)
|
||||
end
|
||||
|
||||
--Impact
|
||||
local part = emitter:Add("effects/yellowflare", self.StartPos)
|
||||
part:SetStartAlpha(255)
|
||||
part:SetStartSize(15 * self.PartMult)
|
||||
part:SetDieTime(self.LifeTime * 1)
|
||||
part:SetEndSize(0)
|
||||
part:SetEndAlpha(0)
|
||||
part:SetRoll(math.Rand(0, 360))
|
||||
emitter:Finish()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
return false
|
||||
end
|
||||
155
addons/tfa_base/lua/effects/tfa_muzzle_smoketrail/init.lua
Normal file
155
addons/tfa_base/lua/effects/tfa_muzzle_smoketrail/init.lua
Normal file
@@ -0,0 +1,155 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local vector_origin = Vector()
|
||||
|
||||
local smokecol = Color(225, 225, 225, 200)
|
||||
local smokemat = Material("trails/smoke")
|
||||
smokemat:SetInt("$nocull", 1)
|
||||
|
||||
function EFFECT:AddPart()
|
||||
local pos, rawdat, norm
|
||||
pos = self.startpos
|
||||
norm = self.startnormal
|
||||
|
||||
if self.targent and self.targatt then
|
||||
--pos = self:GetTracerShootPos(self.startpos, self.targent, self.targatt)
|
||||
rawdat = self.targent:GetAttachment(self.targatt)
|
||||
|
||||
if rawdat then
|
||||
pos = rawdat.Pos
|
||||
norm = rawdat.Ang:Forward()
|
||||
end
|
||||
end
|
||||
|
||||
local p = {}
|
||||
p.position = pos
|
||||
p.normal = norm
|
||||
p.velocity = p.normal * 5
|
||||
p.startlife = CurTime()
|
||||
p.lifetime = self.lifetime
|
||||
p.radius = self.radius
|
||||
|
||||
if self.vparticles then
|
||||
table.insert(self.vparticles, #self.vparticles + 1, p)
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:ProcessFakeParticles()
|
||||
self.stepcount = self.stepcount + 1
|
||||
|
||||
if self.vparticles then
|
||||
if CurTime() < self.emittime and self.stepcount % self.partinterval == 0 then
|
||||
self:AddPart()
|
||||
end
|
||||
|
||||
for k, v in ipairs(self.vparticles) do
|
||||
v.position = v.position + v.velocity * FrameTime()
|
||||
v.velocity = v.velocity + self.grav * FrameTime()
|
||||
|
||||
if CurTime() > v.startlife + v.lifetime then
|
||||
--print("Curtime:"..CurTime())
|
||||
--print("Lifetime:"..v.lifetime)
|
||||
--print("CTime:"..v.startlife)
|
||||
table.remove(self.vparticles, k)
|
||||
end
|
||||
end
|
||||
|
||||
if #self.vparticles <= 0 then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local cv_gr = GetConVar("sv_gravity")
|
||||
|
||||
function EFFECT:Init(ef)
|
||||
self.lifetime = 1
|
||||
self.stepcount = 0
|
||||
self.partinterval = 3
|
||||
self.emittime = CurTime() + 3
|
||||
self.targent = ef:GetEntity()
|
||||
self.targatt = ef:GetAttachment()
|
||||
self.startpos = ef:GetOrigin()
|
||||
self.startnormal = ef:GetNormal()
|
||||
self.radius = ef:GetRadius()
|
||||
self.grav = Vector(0, 0, cv_gr:GetFloat() * 0.2)
|
||||
self.randfac = 1
|
||||
|
||||
if not self.startpos then
|
||||
self.startpos = vector_origin
|
||||
|
||||
if LocalPlayer():IsValid() then
|
||||
self.startpos = LocalPlayer():GetShootPos()
|
||||
end
|
||||
end
|
||||
|
||||
if not self.startnormal then
|
||||
self.startnormal = vector_origin
|
||||
end
|
||||
|
||||
if not self.radius or self.radius == 0 then
|
||||
self.radius = 1
|
||||
end
|
||||
|
||||
self.vparticles = {}
|
||||
self:AddPart()
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if self.vparticles and #self.vparticles <= 0 then return false end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:DrawBeam()
|
||||
render.StartBeam(#self.vparticles)
|
||||
|
||||
for k, v in ipairs(self.vparticles) do
|
||||
local alphac = ColorAlpha(smokecol, (1 - (CurTime() - v.startlife) / v.lifetime) * 64)
|
||||
render.AddBeam(v.position, v.radius * (1 - k / #self.vparticles), k / #self.vparticles, alphac)
|
||||
end
|
||||
|
||||
render.EndBeam()
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
self:ProcessFakeParticles()
|
||||
|
||||
if self.vparticles and #self.vparticles >= 2 then
|
||||
render.SetMaterial(smokemat)
|
||||
self:DrawBeam()
|
||||
end
|
||||
end
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_cryo/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_cryo/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.1
|
||||
EFFECT.XFlashSize = 1
|
||||
EFFECT.FlashSize = 1
|
||||
EFFECT.SmokeSize = 0
|
||||
EFFECT.SparkSize = 1.5
|
||||
EFFECT.HeatSize = 1.5
|
||||
EFFECT.Color = Color(162,192,255)
|
||||
EFFECT.ColorSprites = true
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_energy/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_energy/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.15
|
||||
EFFECT.XFlashSize = 1
|
||||
EFFECT.FlashSize = 1
|
||||
EFFECT.SmokeSize = 0
|
||||
EFFECT.SparkSize = 1.25
|
||||
EFFECT.HeatSize = 1
|
||||
EFFECT.Color = Color(128,192,255)
|
||||
EFFECT.ColorSprites = true
|
||||
133
addons/tfa_base/lua/effects/tfa_muzzleflash_gauss/init.lua
Normal file
133
addons/tfa_base/lua/effects/tfa_muzzleflash_gauss/init.lua
Normal file
@@ -0,0 +1,133 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local blankvec = Vector(0, 0, 0)
|
||||
|
||||
local vector_origin = Vector()
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.Position = blankvec
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
self.WeaponEntOG = self.WeaponEnt
|
||||
self.Attachment = data:GetAttachment()
|
||||
self.Dir = data:GetNormal()
|
||||
local owent
|
||||
|
||||
if IsValid(self.WeaponEnt) then
|
||||
owent = self.WeaponEnt:GetOwner()
|
||||
end
|
||||
|
||||
if not IsValid(owent) then
|
||||
owent = self.WeaponEnt:GetParent()
|
||||
end
|
||||
|
||||
if IsValid(owent) and owent:IsPlayer() then
|
||||
if owent ~= LocalPlayer() or owent:ShouldDrawLocalPlayer() then
|
||||
self.WeaponEnt = owent:GetActiveWeapon()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
else
|
||||
self.WeaponEnt = owent:GetViewModel()
|
||||
local theirweapon = owent:GetActiveWeapon()
|
||||
|
||||
if IsValid(theirweapon) and theirweapon.ViewModelFlip or theirweapon.ViewModelFlipped then
|
||||
self.Flipped = true
|
||||
end
|
||||
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
end
|
||||
end
|
||||
|
||||
if IsValid(self.WeaponEntOG) and self.WeaponEntOG.MuzzleAttachment then
|
||||
self.Attachment = self.WeaponEnt:LookupAttachment(self.WeaponEntOG.MuzzleAttachment)
|
||||
|
||||
if not self.Attachment or self.Attachment <= 0 then
|
||||
self.Attachment = 1
|
||||
end
|
||||
|
||||
if self.WeaponEntOG:GetStatL("IsAkimbo") then
|
||||
self.Attachment = 2 - self.WeaponEntOG:GetAnimCycle()
|
||||
end
|
||||
end
|
||||
|
||||
local angpos = self.WeaponEnt:GetAttachment(self.Attachment)
|
||||
|
||||
if not angpos or not angpos.Pos then
|
||||
angpos = {
|
||||
Pos = vector_origin,
|
||||
Ang = angle_zero
|
||||
}
|
||||
end
|
||||
|
||||
if self.Flipped then
|
||||
local tmpang = (self.Dir or angpos.Ang:Forward()):Angle()
|
||||
local localang = self.WeaponEnt:WorldToLocalAngles(tmpang)
|
||||
localang.y = localang.y + 180
|
||||
localang = self.WeaponEnt:LocalToWorldAngles(localang)
|
||||
--localang:RotateAroundAxis(localang:Up(),180)
|
||||
--tmpang:RotateAroundAxis(tmpang:Up(),180)
|
||||
self.Dir = localang:Forward()
|
||||
end
|
||||
|
||||
-- Keep the start and end Pos - we're going to interpolate between them
|
||||
self.Position = self:GetTracerShootPos(angpos.Pos, self.WeaponEnt, self.Attachment)
|
||||
self.Norm = self.Dir
|
||||
self.vOffset = self.Position
|
||||
local dir = self.Norm
|
||||
local dlight
|
||||
|
||||
if IsValid(self.WeaponEnt) then
|
||||
dlight = DynamicLight(self.WeaponEnt:EntIndex())
|
||||
else
|
||||
dlight = DynamicLight(0)
|
||||
end
|
||||
|
||||
local fadeouttime = 0.2
|
||||
|
||||
if (dlight) then
|
||||
dlight.Pos = self.Position + dir * 1 - dir:Angle():Right() * 5
|
||||
dlight.r = 25
|
||||
dlight.g = 200
|
||||
dlight.b = 255
|
||||
dlight.Brightness = 4.0
|
||||
dlight.size = 96
|
||||
dlight.decay = 1000
|
||||
dlight.DieTime = CurTime() + fadeouttime
|
||||
end
|
||||
|
||||
ParticleEffectAttach("tfa_muzzle_gauss", PATTACH_POINT_FOLLOW, self.WeaponEnt, data:GetAttachment())
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_generic/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_generic/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.075
|
||||
EFFECT.XFlashSize = 0.5
|
||||
EFFECT.FlashSize = 0.8
|
||||
EFFECT.SmokeSize = 1
|
||||
EFFECT.SparkSize = 1
|
||||
EFFECT.HeatSize = 1
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.125
|
||||
EFFECT.XFlashSize = 0
|
||||
EFFECT.FlashSize = 1
|
||||
EFFECT.SmokeSize = 2
|
||||
EFFECT.SparkSize = 2
|
||||
EFFECT.HeatSize = 2
|
||||
EFFECT.Color = Color(255, 128, 64)
|
||||
EFFECT.ColorSprites = false
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_pistol/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_pistol/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.07
|
||||
EFFECT.XFlashSize = 0.5
|
||||
EFFECT.FlashSize = 0.8
|
||||
EFFECT.SmokeSize = 1
|
||||
EFFECT.SparkSize = 1
|
||||
EFFECT.HeatSize = 1
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.1
|
||||
EFFECT.XFlashSize = 0
|
||||
EFFECT.FlashSize = 1
|
||||
EFFECT.SmokeSize = 2
|
||||
EFFECT.SparkSize = 1
|
||||
EFFECT.HeatSize = 1.25
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_rifle/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_rifle/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.1
|
||||
EFFECT.XFlashSize = 1
|
||||
EFFECT.FlashSize = 1
|
||||
EFFECT.SmokeSize = 1
|
||||
EFFECT.SparkSize = 1
|
||||
EFFECT.HeatSize = 1
|
||||
EFFECT.Color = Color(255, 192, 64)
|
||||
EFFECT.ColorSprites = false
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_shotgun/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_shotgun/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.125
|
||||
EFFECT.XFlashSize = 0
|
||||
EFFECT.FlashSize = 1.3
|
||||
EFFECT.SmokeSize = 2
|
||||
EFFECT.SparkSize = 1.5
|
||||
EFFECT.HeatSize = 2
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
@@ -0,0 +1,42 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.1
|
||||
EFFECT.XFlashSize = 0
|
||||
EFFECT.FlashSize = 0.1
|
||||
EFFECT.SmokeSize = 2
|
||||
EFFECT.SparkSize = 1
|
||||
EFFECT.HeatSize = 1
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_smg/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_smg/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.075
|
||||
EFFECT.XFlashSize = 1
|
||||
EFFECT.FlashSize = 1
|
||||
EFFECT.SmokeSize = 1
|
||||
EFFECT.SparkSize = 1
|
||||
EFFECT.HeatSize = 1
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
41
addons/tfa_base/lua/effects/tfa_muzzleflash_sniper/init.lua
Normal file
41
addons/tfa_base/lua/effects/tfa_muzzleflash_sniper/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.125
|
||||
EFFECT.XFlashSize = 1.5
|
||||
EFFECT.FlashSize = 1.2
|
||||
EFFECT.SmokeSize = 2
|
||||
EFFECT.SparkSize = 1.3
|
||||
EFFECT.HeatSize = 2
|
||||
EFFECT.Color = Color(255, 225, 128)
|
||||
EFFECT.ColorSprites = false
|
||||
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("tfa/muzzleflash_base.lua")
|
||||
|
||||
EFFECT.Life = 0.125
|
||||
EFFECT.XFlashSize = 2
|
||||
EFFECT.FlashSize = 2
|
||||
EFFECT.SmokeSize = 0
|
||||
EFFECT.SparkSize = 1.45
|
||||
EFFECT.HeatSize = 2
|
||||
EFFECT.Color = Color(128,192,255)
|
||||
EFFECT.ColorSprites = true
|
||||
105
addons/tfa_base/lua/effects/tfa_muzzlesmoke/init.lua
Normal file
105
addons/tfa_base/lua/effects/tfa_muzzlesmoke/init.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local ang
|
||||
local limit_particle_cv = GetConVar("cl_tfa_fx_muzzlesmoke_limited")
|
||||
local SMOKEDELAY = 1.5
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
self.WeaponEntOG = self.WeaponEnt
|
||||
if limit_particle_cv:GetBool() and self.WeaponEnt:GetOwner() ~= LocalPlayer() then return end
|
||||
self.Attachment = data:GetAttachment()
|
||||
local smokepart = "smoke_trail_tfa"
|
||||
local delay = self.WeaponEnt.GetStatL and self.WeaponEnt:GetStatL("SmokeDelay") or self.WeaponEnt.SmokeDelay
|
||||
|
||||
if self.WeaponEnt.SmokeParticle then
|
||||
smokepart = self.WeaponEnt.SmokeParticle
|
||||
elseif self.WeaponEnt.SmokeParticles then
|
||||
smokepart = self.WeaponEnt.SmokeParticles[self.WeaponEnt.DefaultHoldType or self.WeaponEnt.HoldType] or smokepart
|
||||
end
|
||||
|
||||
self.Position = self:GetTracerShootPos(data:GetOrigin(), self.WeaponEnt, self.Attachment)
|
||||
|
||||
if IsValid(self.WeaponEnt:GetOwner()) then
|
||||
if self.WeaponEnt:GetOwner() == LocalPlayer() then
|
||||
if not self.WeaponEnt:IsFirstPerson() then
|
||||
ang = self.WeaponEnt:GetOwner():EyeAngles()
|
||||
ang:Normalize()
|
||||
--ang.p = math.max(math.min(ang.p,55),-55)
|
||||
self.Forward = ang:Forward()
|
||||
else
|
||||
self.WeaponEnt = self.WeaponEnt:GetOwner():GetViewModel()
|
||||
end
|
||||
--ang.p = math.max(math.min(ang.p,55),-55)
|
||||
else
|
||||
ang = self.WeaponEnt:GetOwner():EyeAngles()
|
||||
ang:Normalize()
|
||||
self.Forward = ang:Forward()
|
||||
end
|
||||
end
|
||||
|
||||
if TFA.GetMZSmokeEnabled == nil or TFA.GetMZSmokeEnabled() then
|
||||
local e = self.WeaponEnt
|
||||
local w = self.WeaponEntOG
|
||||
local a = self.Attachment
|
||||
local tn = "tfasmokedelay_" .. w:EntIndex() .. "_" .. a
|
||||
local sp = smokepart
|
||||
|
||||
if timer.Exists(tn) then
|
||||
timer.Remove(tn)
|
||||
end
|
||||
|
||||
e.SmokePCF = e.SmokePCF or {}
|
||||
local _a = w:GetStatL("IsAkimbo") and a or 1
|
||||
|
||||
if IsValid(e.SmokePCF[_a]) then
|
||||
e.SmokePCF[_a]:StopEmission()
|
||||
end
|
||||
|
||||
timer.Create(tn, delay or SMOKEDELAY, 1, function()
|
||||
if not IsValid(e) then return end
|
||||
e.SmokePCF[_a] = CreateParticleSystem(e, sp, PATTACH_POINT_FOLLOW, a)
|
||||
|
||||
if IsValid(e.SmokePCF[_a]) then
|
||||
e.SmokePCF[_a]:StartEmission()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
163
addons/tfa_base/lua/effects/tfa_penetrate/init.lua
Normal file
163
addons/tfa_base/lua/effects/tfa_penetrate/init.lua
Normal file
@@ -0,0 +1,163 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local PenetColor = Color(255, 255, 255, 255)
|
||||
local PenetMat = Material("trails/smoke")
|
||||
local PenetMat2 = Material("effects/yellowflare")
|
||||
local cv_gv = GetConVar("sv_gravity")
|
||||
local cv_sl = GetConVar("cl_tfa_fx_impact_ricochet_sparklife")
|
||||
|
||||
--local cv_sc = GetConVar("cl_tfa_fx_impact_ricochet_sparks")
|
||||
local DFX = {
|
||||
["AR2Tracer"] = true,
|
||||
["Tracer"] = true,
|
||||
["GunshipTracer"] = true,
|
||||
["GaussTracer"] = true,
|
||||
["AirboatGunTracer"] = true,
|
||||
["AirboatGunHeavyTracer"] = true
|
||||
}
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.StartPos = data:GetOrigin()
|
||||
self.Dir = data:GetNormal()
|
||||
self.Dir:Normalize()
|
||||
self.Len = 32
|
||||
self.EndPos = self.StartPos + self.Dir * self.Len
|
||||
self.LifeTime = 0.75
|
||||
self.DieTime = CurTime() + self.LifeTime
|
||||
self.Thickness = 1
|
||||
self.Grav = Vector(0, 0, -cv_gv:GetFloat())
|
||||
self.PartMult = data:GetRadius()
|
||||
self.SparkLife = cv_sl:GetFloat()
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
|
||||
if self.WeaponEnt.TracerPCF then
|
||||
local traceres = util.QuickTrace(self.StartPos, self.Dir * 9999999, Entity(math.Round(data:GetScale())))
|
||||
self.EndPos = traceres.HitPos or self.StartPos
|
||||
local efn = self.WeaponEnt.TracerName
|
||||
local spos = self.StartPos
|
||||
local cnt = math.min(math.Round(data:GetMagnitude()), 6000)
|
||||
|
||||
timer.Simple(cnt / 1000000, function()
|
||||
TFA.ParticleTracer(efn, spos, traceres.HitPos or spos, false)
|
||||
end)
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local tn = self.WeaponEnt.BulletTracerName
|
||||
|
||||
if tn and tn ~= "" and not DFX[tn] then
|
||||
local fx = EffectData()
|
||||
fx:SetStart(self.StartPos)
|
||||
local traceres = util.QuickTrace(self.StartPos, self.Dir * 9999999, Entity(math.Round(data:GetScale())))
|
||||
self.EndPos = traceres.HitPos or self.StartPos
|
||||
fx:SetOrigin(self.EndPos)
|
||||
fx:SetEntity(self.WeaponEnt)
|
||||
fx:SetMagnitude(1)
|
||||
util.Effect(tn, fx)
|
||||
SafeRemoveEntityDelayed(self, 0)
|
||||
--Sparks
|
||||
--Impact
|
||||
|
||||
return
|
||||
else
|
||||
local emitter = ParticleEmitter(self.StartPos)
|
||||
--[[
|
||||
for i = 1, cv_sc:GetFloat() * self.PartMult * 0.1 do
|
||||
local part = emitter:Add("effects/yellowflare", self.StartPos)
|
||||
part:SetVelocity((self.Dir + VectorRand() * 0.5) * math.Rand(75, 185))
|
||||
part:SetDieTime(math.Rand(0.25, 1) * self.SparkLife)
|
||||
part:SetStartAlpha(255)
|
||||
part:SetStartSize(math.Rand(2, 4))
|
||||
part:SetEndSize(0)
|
||||
part:SetRoll(0)
|
||||
part:SetGravity(self.Grav)
|
||||
part:SetCollide(true)
|
||||
part:SetBounce(0.55)
|
||||
part:SetAirResistance(0.5)
|
||||
part:SetStartLength(0.2)
|
||||
part:SetEndLength(0)
|
||||
part:SetVelocityScale(true)
|
||||
part:SetCollide(true)
|
||||
end
|
||||
]]
|
||||
--
|
||||
local part = emitter:Add("effects/select_ring", self.StartPos)
|
||||
part:SetStartAlpha(225)
|
||||
part:SetStartSize(1)
|
||||
part:SetDieTime(self.LifeTime / 5)
|
||||
part:SetEndSize(0)
|
||||
part:SetEndAlpha(0)
|
||||
part:SetRoll(math.Rand(0, 360))
|
||||
part:SetColor(200, 200, 200)
|
||||
part = emitter:Add("effects/select_ring", self.StartPos)
|
||||
part:SetStartAlpha(255)
|
||||
part:SetStartSize(1.5 * self.PartMult)
|
||||
part:SetDieTime(self.LifeTime / 6)
|
||||
part:SetEndSize(0)
|
||||
part:SetEndAlpha(0)
|
||||
part:SetRoll(math.Rand(0, 360))
|
||||
part:SetColor(200, 200, 200)
|
||||
emitter:Finish()
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if self.DieTime and (CurTime() > self.DieTime) then return false end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
if self.DieTime then
|
||||
local fDelta = (self.DieTime - CurTime()) / self.LifeTime
|
||||
fDelta = math.Clamp(fDelta, 0, 1)
|
||||
render.SetMaterial(PenetMat)
|
||||
local color = ColorAlpha(PenetColor, 32 * fDelta)
|
||||
local precision = 16
|
||||
local i = 1
|
||||
|
||||
while i <= precision do
|
||||
render.DrawBeam(self.StartPos + self.Dir * self.Len * ((i - 1) / precision), self.StartPos + self.Dir * self.Len * (i / precision), self.Thickness * fDelta * (1 - i / precision), 0.5, 0.5, color)
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
render.SetMaterial(PenetMat2)
|
||||
i = 1
|
||||
|
||||
while i <= precision do
|
||||
render.DrawBeam(self.StartPos + self.Dir * self.Len * ((i - 1) / precision), self.StartPos + self.Dir * self.Len * (i / precision), self.Thickness / 3 * 2 * fDelta * (1 - i / precision), 0.5, 0.5, color)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
121
addons/tfa_base/lua/effects/tfa_ricochet/init.lua
Normal file
121
addons/tfa_base/lua/effects/tfa_ricochet/init.lua
Normal file
@@ -0,0 +1,121 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local RicochetColor = Color(255, 255, 255, 255)
|
||||
local RicochetIDOffset = 33
|
||||
local RicochetMat = Material("effects/yellowflare")
|
||||
local cv_gv = GetConVar("sv_gravity")
|
||||
local cv_sl = GetConVar("cl_tfa_fx_impact_ricochet_sparklife")
|
||||
local cv_sc = GetConVar("cl_tfa_fx_impact_ricochet_sparks")
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.StartPos = data:GetOrigin()
|
||||
self.Dir = data:GetNormal()
|
||||
self.Dir:Normalize()
|
||||
self.Len = 128
|
||||
self.EndPos = self.StartPos + self.Dir * self.Len
|
||||
self.LifeTime = 0.1
|
||||
self.DieTime = CurTime() + self.LifeTime
|
||||
self.Grav = Vector(0, 0, -cv_gv:GetFloat())
|
||||
self.PartMult = data:GetMagnitude()
|
||||
self.SparkLife = cv_sl:GetFloat()
|
||||
local emitter = ParticleEmitter(self.StartPos)
|
||||
|
||||
--Sparks
|
||||
for _ = 1, cv_sc:GetInt() * self.PartMult do
|
||||
local part = emitter:Add("effects/yellowflare", self.StartPos)
|
||||
part:SetVelocity((self.Dir + VectorRand() * 0.5) * math.Rand(75, 185))
|
||||
part:SetDieTime(math.Rand(0.25, 1) * self.SparkLife)
|
||||
part:SetStartAlpha(255)
|
||||
part:SetStartSize(math.Rand(2, 4))
|
||||
part:SetEndSize(0)
|
||||
part:SetRoll(0)
|
||||
part:SetGravity(self.Grav)
|
||||
part:SetCollide(true)
|
||||
part:SetBounce(0.55)
|
||||
part:SetAirResistance(0.5)
|
||||
part:SetStartLength(0.2)
|
||||
part:SetEndLength(0)
|
||||
part:SetVelocityScale(true)
|
||||
part:SetCollide(true)
|
||||
end
|
||||
|
||||
--Impact
|
||||
local part = emitter:Add("effects/yellowflare", self.StartPos)
|
||||
part:SetStartAlpha(225)
|
||||
part:SetStartSize(64)
|
||||
part:SetDieTime(self.LifeTime)
|
||||
part:SetEndSize(0)
|
||||
part:SetEndAlpha(0)
|
||||
part:SetRoll(math.Rand(0, 360))
|
||||
part = emitter:Add("effects/yellowflare", self.StartPos)
|
||||
part:SetStartAlpha(255)
|
||||
part:SetStartSize(30 * self.PartMult)
|
||||
part:SetDieTime(self.LifeTime * 1.5)
|
||||
part:SetEndSize(0)
|
||||
part:SetEndAlpha(0)
|
||||
part:SetRoll(math.Rand(0, 360))
|
||||
emitter:Finish()
|
||||
local dlight = DynamicLight(LocalPlayer():EntIndex() + RicochetIDOffset)
|
||||
|
||||
if (dlight) then
|
||||
dlight.Pos = self.StartPos
|
||||
dlight.r = 255
|
||||
dlight.g = 225
|
||||
dlight.b = 185
|
||||
dlight.Brightness = 2.75 * self.PartMult
|
||||
dlight.size = 48
|
||||
--dlight.DieTime = CurTime() + self.DieTime*0.7
|
||||
dlight.Decay = 1000 / math.max(0.01, math.min(self.SparkLife * 0.66, 1))
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if self.DieTime and (CurTime() > self.DieTime) then return false end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
if self.DieTime then
|
||||
local fDelta = (self.DieTime - CurTime()) / self.LifeTime
|
||||
fDelta = math.Clamp(fDelta, 0, 1)
|
||||
render.SetMaterial(RicochetMat)
|
||||
local color = ColorAlpha(RicochetColor, 255 * fDelta)
|
||||
local precision = 16
|
||||
local i = 1
|
||||
|
||||
while i <= precision do
|
||||
render.DrawBeam(self.StartPos + self.Dir * self.Len * ((i - 1) / precision), self.StartPos + self.Dir * self.Len * (i / precision), 8 * fDelta * (1 - i / precision), 0.5, 0.5, color)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
261
addons/tfa_base/lua/effects/tfa_shell/init.lua
Normal file
261
addons/tfa_base/lua/effects/tfa_shell/init.lua
Normal file
@@ -0,0 +1,261 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
EFFECT.Velocity = {120, 160}
|
||||
EFFECT.VelocityRand = {-15, 40}
|
||||
EFFECT.VelocityAngle = Vector(1,1,10)
|
||||
EFFECT.VelocityRandAngle = Vector(10,10,5)
|
||||
|
||||
local modelReplaceLookup = {
|
||||
["models/hdweapons/rifleshell.mdl"] = "models/tfa/rifleshell.mdl",
|
||||
["models/hdweapons/rifleshell_hd.mdl"] = "models/tfa/rifleshell.mdl",
|
||||
["models/weapons/rifleshell_hd.mdl"] = "models/tfa/rifleshell.mdl",
|
||||
["models/hdweapons/shell.mdl"] = "models/tfa/pistolshell.mdl",
|
||||
["models/hdweapons/shell_hd.mdl"] = "models/tfa/pistolshell.mdl",
|
||||
["models/weapons/shell_hd.mdl"] = "models/tfa/pistolshell.mdl",
|
||||
["models/hdweapons/shotgun_shell.mdl"] = "models/tfa/shotgunshell.mdl",
|
||||
["models/hdweapons/shotgun_shell_hd.mdl"] = "models/tfa/shotgunshell.mdl",
|
||||
["models/weapons/shotgun_shell_hd.mdl"] = "models/tfa/shotgunshell.mdl",
|
||||
}
|
||||
|
||||
EFFECT.ShellPresets = {
|
||||
["sniper"] = {"models/tfa/rifleshell.mdl", math.pow(0.487 / 1.236636, 1 / 3), 90}, --1.236636 is shell diameter, then divide base diameter into that for 7.62x54mm
|
||||
["rifle"] = {"models/tfa/rifleshell.mdl", math.pow(0.4709 / 1.236636, 1 / 3), 90}, --1.236636 is shell diameter, then divide base diameter into that for standard nato rifle
|
||||
["pistol"] = {"models/tfa/pistolshell.mdl", math.pow(0.391 / 0.955581, 1 / 3), 90}, --0.955581 is shell diameter, then divide base diameter into that for 9mm luger
|
||||
["smg"] = {"models/tfa/pistolshell.mdl", math.pow(.476 / 0.955581, 1 / 3), 90}, --.45 acp
|
||||
["shotgun"] = {"models/tfa/shotgunshell.mdl", 1, 90}
|
||||
}
|
||||
|
||||
EFFECT.SoundFiles = {Sound(")player/pl_shell1.wav"), Sound(")player/pl_shell2.wav"), Sound(")player/pl_shell3.wav")}
|
||||
EFFECT.SoundFilesSG = {Sound(")weapons/fx/tink/shotgun_shell1.wav"), Sound(")weapons/fx/tink/shotgun_shell2.wav"), Sound(")weapons/fx/tink/shotgun_shell3.wav")}
|
||||
EFFECT.SoundLevel = {45, 55}
|
||||
EFFECT.SoundPitch = {80, 120}
|
||||
EFFECT.SoundVolume = {0.85, 0.95}
|
||||
EFFECT.LifeTime = 15
|
||||
EFFECT.FadeTime = 0.5
|
||||
EFFECT.SmokeTime = {3, 3}
|
||||
EFFECT.SmokeParticle = "tfa_ins2_weapon_shell_smoke"
|
||||
local cv_eject
|
||||
local cv_life
|
||||
local upVec = Vector(0,0,1)
|
||||
|
||||
function EFFECT:ComputeSmokeLighting()
|
||||
if not self.PCFSmoke then return end
|
||||
local licht = render.ComputeLighting(self:GetPos() + upVec * 2, upVec)
|
||||
local lichtFloat = math.Clamp((licht.r + licht.g + licht.b) / 3, 0, TFA.Particles.SmokeLightingClamp) / TFA.Particles.SmokeLightingClamp
|
||||
local lichtFinal = LerpVector(lichtFloat, TFA.Particles.SmokeLightingMin, TFA.Particles.SmokeLightingMax)
|
||||
self.PCFSmoke:SetControlPoint(1, lichtFinal)
|
||||
end
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.IsTFAShell = true
|
||||
|
||||
if not cv_eject then
|
||||
cv_eject = GetConVar("cl_tfa_fx_ejectionsmoke")
|
||||
end
|
||||
|
||||
if not cv_life then
|
||||
cv_life = GetConVar("cl_tfa_fx_ejectionlife")
|
||||
end
|
||||
|
||||
if cv_life then
|
||||
self.LifeTime = cv_life:GetFloat()
|
||||
end
|
||||
|
||||
self.StartTime = CurTime()
|
||||
self.Emitter = ParticleEmitter(self:GetPos())
|
||||
self.SmokeDelta = 0
|
||||
|
||||
if cv_eject:GetBool() then
|
||||
self.SmokeDeath = self.StartTime + math.Rand(self.SmokeTime[1], self.SmokeTime[2])
|
||||
else
|
||||
self.SmokeDeath = -1
|
||||
end
|
||||
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
self.WeaponEntOG = self.WeaponEnt
|
||||
if self.WeaponEntOG.LuaShellEffect and self.WeaponEntOG.LuaShellEffect == "" then return end
|
||||
self.Attachment = data:GetAttachment()
|
||||
self.Dir = data:GetNormal()
|
||||
self.DirAng = data:GetNormal():Angle()
|
||||
self.OriginalOrigin = data:GetOrigin()
|
||||
local owent = self.WeaponEnt:GetOwner()
|
||||
|
||||
if self.LifeTime <= 0 or not IsValid(owent) then
|
||||
self.StartTime = -1000
|
||||
self.SmokeDeath = -1000
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if owent:IsPlayer() and owent == GetViewEntity() and not owent:ShouldDrawLocalPlayer() then
|
||||
self.WeaponEnt = owent:GetViewModel()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
end
|
||||
|
||||
local model, scale, yaw = self:FindModel(self.WeaponEntOG)
|
||||
model = self.WeaponEntOG:GetStatL("ShellModel") or self.WeaponEntOG:GetStatL("LuaShellModel") or model
|
||||
model = modelReplaceLookup[model] or model
|
||||
scale = self.WeaponEntOG:GetStatL("ShellScale") or self.WeaponEntOG:GetStatL("LuaShellScale") or scale
|
||||
yaw = self.WeaponEntOG:GetStatL("ShellYaw") or self.WeaponEntOG:GetStatL("LuaShellYaw") or yaw
|
||||
|
||||
if model:lower():find("shotgun") then
|
||||
self.Shotgun = true
|
||||
end
|
||||
|
||||
self:SetModel(model)
|
||||
self:SetModelScale(scale, 0)
|
||||
self:SetPos(data:GetOrigin())
|
||||
local mdlang = self.DirAng * 1
|
||||
mdlang:RotateAroundAxis(mdlang:Up(), yaw)
|
||||
local owang = IsValid(owent) and owent:EyeAngles() or mdlang
|
||||
self:SetAngles(owang)
|
||||
self:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
self:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
|
||||
self:SetCollisionBounds(self:OBBMins(), self:OBBMaxs())
|
||||
self:PhysicsInitBox(self:OBBMins(), self:OBBMaxs())
|
||||
local velocity = self.Dir * math.Rand(self.Velocity[1], self.Velocity[2]) + owang:Forward() * math.Rand(self.VelocityRand[1], self.VelocityRand[2])
|
||||
|
||||
if IsValid(owent) then
|
||||
velocity = velocity + owent:GetVelocity()
|
||||
end
|
||||
|
||||
local physObj = self:GetPhysicsObject()
|
||||
|
||||
if physObj:IsValid() then
|
||||
physObj:SetDamping(0.1, 1)
|
||||
physObj:SetMass(5)
|
||||
physObj:SetMaterial("gmod_silent")
|
||||
physObj:SetVelocity(velocity)
|
||||
local localVel = velocity:Length() * self.WeaponEnt:WorldToLocalAngles(velocity:Angle()):Forward()
|
||||
physObj:AddAngleVelocity(localVel.y * self.VelocityAngle)
|
||||
physObj:AddAngleVelocity(VectorRand() * velocity:Length() * self.VelocityRandAngle * 0.5)
|
||||
end
|
||||
|
||||
local ss = self.WeaponEntOG:GetStatL("ShellSound") or self.WeaponEntOG:GetStatL("LuaShellSound")
|
||||
|
||||
if ss then
|
||||
self.ImpactSound = ss
|
||||
else
|
||||
self.ImpactSound = self.Shotgun and self.SoundFilesSG[math.random(1, #self.SoundFiles)] or self.SoundFiles[math.random(1, #self.SoundFiles)]
|
||||
end
|
||||
|
||||
self.setup = true
|
||||
end
|
||||
|
||||
function EFFECT:FindModel(wep)
|
||||
if not IsValid(wep) then return unpack(self.ShellPresets["rifle"]) end
|
||||
local ammotype = (wep.Primary.Ammo or wep:GetPrimaryAmmoType()):lower()
|
||||
local guntype = (wep.Type or wep:GetHoldType()):lower()
|
||||
|
||||
if guntype:find("sniper") or ammotype:find("sniper") or guntype:find("dmr") then
|
||||
return unpack(self.ShellPresets["sniper"])
|
||||
elseif guntype:find("rifle") or ammotype:find("rifle") then
|
||||
return unpack(self.ShellPresets["rifle"])
|
||||
elseif ammotype:find("pist") or guntype:find("pist") then
|
||||
return unpack(self.ShellPresets["pistol"])
|
||||
elseif ammotype:find("smg") or guntype:find("smg") then
|
||||
return unpack(self.ShellPresets["smg"])
|
||||
elseif ammotype:find("buckshot") or ammotype:find("shotgun") or guntype:find("shot") then
|
||||
return unpack(self.ShellPresets["shotgun"])
|
||||
end
|
||||
|
||||
return unpack(self.ShellPresets["rifle"])
|
||||
end
|
||||
|
||||
function EFFECT:BounceSound()
|
||||
sound.Play(self.ImpactSound, self:GetPos(), math.Rand(self.SoundLevel[1], self.SoundLevel[2]), math.Rand(self.SoundPitch[1], self.SoundPitch[2]), math.Rand(self.SoundVolume[1], self.SoundVolume[2]))
|
||||
end
|
||||
|
||||
function EFFECT:PhysicsCollide(data)
|
||||
if self:WaterLevel() > 0 then return end
|
||||
|
||||
if TFA.GetEJSmokeEnabled() and not self.PCFSmoke and CurTime() < self.SmokeDeath then
|
||||
self.PCFSmoke = CreateParticleSystem(self, self.SmokeParticle, PATTACH_POINT_FOLLOW, 1)
|
||||
if IsValid(self.PCFSmoke) then
|
||||
self:ComputeSmokeLighting()
|
||||
self.PCFSmoke:StartEmission()
|
||||
else
|
||||
self.PCFSmoke = nil
|
||||
end
|
||||
end
|
||||
|
||||
if data.Speed > 60 then
|
||||
self:BounceSound()
|
||||
local impulse = (data.OurOldVelocity - 2 * data.OurOldVelocity:Dot(data.HitNormal) * data.HitNormal) * 0.33
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if phys:IsValid() then
|
||||
phys:ApplyForceCenter(impulse)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if CurTime() > self.SmokeDeath and self.PCFSmoke then
|
||||
self.PCFSmoke:StopEmission()
|
||||
self.PCFSmoke = nil
|
||||
else
|
||||
self:ComputeSmokeLighting()
|
||||
end
|
||||
|
||||
if self:WaterLevel() > 0 and not self.WaterSplashed then
|
||||
self.WaterSplashed = true
|
||||
local ef = EffectData()
|
||||
ef:SetOrigin(self:GetPos())
|
||||
ef:SetScale(1)
|
||||
util.Effect("watersplash", ef)
|
||||
end
|
||||
|
||||
if CurTime() > self.StartTime + self.LifeTime then
|
||||
if self.Emitter then
|
||||
self.Emitter:Finish()
|
||||
end
|
||||
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
if not self.setup then return end
|
||||
self:SetColor(ColorAlpha(color_white, (1 - math.Clamp(CurTime() - (self.StartTime + self.LifeTime - self.FadeTime), 0, self.FadeTime) / self.FadeTime) * 255))
|
||||
self:SetupBones()
|
||||
self:DrawModel()
|
||||
end
|
||||
|
||||
hook.Add("EntityEmitSound", "TFA_BlockShellScrapeSound", function(sndData)
|
||||
if IsValid(sndData.Entity) and sndData.Entity.IsTFAShell and sndData.SoundName:find("scrape") then
|
||||
return false
|
||||
end
|
||||
end)
|
||||
121
addons/tfa_base/lua/effects/tfa_shell_legacy/init.lua
Normal file
121
addons/tfa_base/lua/effects/tfa_shell_legacy/init.lua
Normal file
@@ -0,0 +1,121 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local vector_origin = Vector()
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
self.WeaponEntOG = self.WeaponEnt
|
||||
self.Attachment = data:GetAttachment()
|
||||
self.Dir = data:GetNormal()
|
||||
local owent = self.WeaponEnt:GetOwner()
|
||||
|
||||
if not IsValid(owent) then
|
||||
owent = self.WeaponEnt:GetParent()
|
||||
end
|
||||
|
||||
if IsValid(owent) and owent:IsPlayer() then
|
||||
if owent ~= LocalPlayer() or owent:ShouldDrawLocalPlayer() then
|
||||
self.WeaponEnt = owent:GetActiveWeapon()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
else
|
||||
self.WeaponEnt = owent:GetViewModel()
|
||||
local theirweapon = owent:GetActiveWeapon()
|
||||
|
||||
if IsValid(theirweapon) and theirweapon.ViewModelFlip or theirweapon.ViewModelFlipped then
|
||||
self.Flipped = true
|
||||
end
|
||||
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
end
|
||||
end
|
||||
|
||||
if IsValid(self.WeaponEntOG) and self.WeaponEntOG.ShellAttachment then
|
||||
self.Attachment = self.WeaponEnt:LookupAttachment(self.WeaponEntOG.ShellAttachment)
|
||||
|
||||
if not self.Attachment or self.Attachment <= 0 then
|
||||
self.Attachment = 2
|
||||
end
|
||||
|
||||
if self.WeaponEntOG:GetStatL("IsAkimbo") then
|
||||
self.Attachment = 4 - self.WeaponEntOG:GetAnimCycle()
|
||||
end
|
||||
|
||||
if self.WeaponEntOG.ShellAttachmentRaw then
|
||||
self.Attachment = self.WeaponEntOG.ShellAttachmentRaw
|
||||
end
|
||||
end
|
||||
|
||||
local angpos = self.WeaponEnt:GetAttachment(self.Attachment)
|
||||
|
||||
if not angpos or not angpos.Pos then
|
||||
angpos = {
|
||||
Pos = vector_origin,
|
||||
Ang = angle_zero
|
||||
}
|
||||
end
|
||||
|
||||
if self.Flipped then
|
||||
local tmpang = (self.Dir or angpos.Ang:Forward()):Angle()
|
||||
local localang = self.WeaponEnt:WorldToLocalAngles(tmpang)
|
||||
localang.y = localang.y + 180
|
||||
localang = self.WeaponEnt:LocalToWorldAngles(localang)
|
||||
--localang:RotateAroundAxis(localang:Up(),180)
|
||||
--tmpang:RotateAroundAxis(tmpang:Up(),180)
|
||||
self.Dir = localang:Forward()
|
||||
end
|
||||
|
||||
-- Keep the start and end Pos - we're going to interpolate between them
|
||||
self.Pos = self:GetTracerShootPos(angpos.Pos, self.WeaponEnt, self.Attachment)
|
||||
self.Norm = angpos.Ang:Forward() --angpos.Ang:Forward()
|
||||
--print(self.Norm)
|
||||
self.Magnitude = data:GetMagnitude()
|
||||
self.Scale = data:GetScale()
|
||||
local fx = EffectData()
|
||||
fx:SetOrigin(self.Pos)
|
||||
fx:SetStart(self.Pos)
|
||||
fx:SetEntity(self.WeaponEnt)
|
||||
fx:SetAttachment(self.Attachment)
|
||||
fx:SetNormal(self.Norm)
|
||||
fx:SetAngles(self.Norm:Angle())
|
||||
fx:SetScale(self.Scale)
|
||||
fx:SetMagnitude(self.Magnitude)
|
||||
local se = (self.WeaponEntOG.LuaShellEffect or self.WeaponEntOG.Blowback_Shell_Effect) or "ShellEject"
|
||||
util.Effect(se, fx)
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
120
addons/tfa_base/lua/effects/tfa_shelleject_smoke/init.lua
Normal file
120
addons/tfa_base/lua/effects/tfa_shelleject_smoke/init.lua
Normal file
@@ -0,0 +1,120 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local vector_origin = Vector()
|
||||
|
||||
EFFECT.SmokeParticle = "tfa_ins2_shell_eject"
|
||||
local upVec = Vector(0, 0, 1)
|
||||
|
||||
function EFFECT:ComputeSmokeLighting(part, pos)
|
||||
if not IsValid(part) then return end
|
||||
local licht = render.ComputeLighting(pos + upVec * 2, upVec)
|
||||
local lichtFloat = math.Clamp((licht.r + licht.g + licht.b) / 3, 0, TFA.Particles.SmokeLightingClamp) / TFA.Particles.SmokeLightingClamp
|
||||
local lichtFinal = LerpVector(lichtFloat, TFA.Particles.SmokeLightingMin, TFA.Particles.SmokeLightingMax)
|
||||
lichtFinal.x = math.sqrt(math.Clamp(lichtFinal.x-0.2,0,0.8)) / 0.8
|
||||
lichtFinal.y = math.sqrt(math.Clamp(lichtFinal.y-0.2,0,0.8)) / 0.8
|
||||
lichtFinal.z = math.sqrt(math.Clamp(lichtFinal.z-0.2,0,0.8)) / 0.8
|
||||
part:SetControlPoint(1, lichtFinal)
|
||||
end
|
||||
|
||||
function EFFECT:Init(data)
|
||||
if not TFA.GetEJSmokeEnabled() then return end
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
self.WeaponEntOG = self.WeaponEnt
|
||||
self.Attachment = data:GetAttachment()
|
||||
local owent = self.WeaponEnt:GetOwner()
|
||||
|
||||
if not IsValid(owent) then
|
||||
owent = self.WeaponEnt:GetParent()
|
||||
end
|
||||
|
||||
if IsValid(owent) and owent:IsPlayer() then
|
||||
if owent ~= LocalPlayer() or owent:ShouldDrawLocalPlayer() then
|
||||
self.WeaponEnt = owent:GetActiveWeapon()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
else
|
||||
self.WeaponEnt = owent:GetViewModel()
|
||||
local theirweapon = owent:GetActiveWeapon()
|
||||
|
||||
if IsValid(theirweapon) and theirweapon.ViewModelFlip or theirweapon.ViewModelFlipped then
|
||||
self.Flipped = true
|
||||
end
|
||||
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
end
|
||||
end
|
||||
|
||||
if IsValid(self.WeaponEntOG) and self.WeaponEntOG.ShellAttachment then
|
||||
self.Attachment = self.WeaponEnt:LookupAttachment(self.WeaponEntOG.ShellAttachment)
|
||||
|
||||
if not self.Attachment or self.Attachment <= 0 then
|
||||
self.Attachment = 2
|
||||
end
|
||||
|
||||
if self.WeaponEntOG:GetStatL("IsAkimbo") then
|
||||
self.Attachment = 3 + self.WeaponEntOG:GetAnimCycle()
|
||||
end
|
||||
|
||||
if self.WeaponEntOG.ShellAttachmentRaw then
|
||||
self.Attachment = self.WeaponEntOG.ShellAttachmentRaw
|
||||
end
|
||||
end
|
||||
|
||||
local angpos = self.WeaponEnt:GetAttachment(self.Attachment)
|
||||
|
||||
if not angpos or not angpos.Pos then
|
||||
angpos = {
|
||||
Pos = vector_origin,
|
||||
Ang = angle_zero
|
||||
}
|
||||
end
|
||||
|
||||
local PCFSmoke = CreateParticleSystem(self.WeaponEnt, self.SmokeParticle, PATTACH_POINT_FOLLOW, self.Attachment)
|
||||
|
||||
if IsValid(PCFSmoke) then
|
||||
self:ComputeSmokeLighting(PCFSmoke, angpos.Pos)
|
||||
PCFSmoke:StartEmission()
|
||||
|
||||
timer.Simple(0.2, function()
|
||||
if IsValid(PCFSmoke) then
|
||||
PCFSmoke:StopEmission(false,true)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return false
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
end
|
||||
86
addons/tfa_base/lua/effects/tfa_tracer_cryo/init.lua
Normal file
86
addons/tfa_base/lua/effects/tfa_tracer_cryo/init.lua
Normal file
@@ -0,0 +1,86 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
EFFECT.Mat = Material("effects/laser_tracer")
|
||||
EFFECT.Col1 = Color(255, 255, 255, 255) --Color(225,225,225,225)
|
||||
EFFECT.Col2 = Color(65, 128, 255, 200)
|
||||
EFFECT.Speed = 1024*3
|
||||
EFFECT.TracerLength = 128
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Init( data table )
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:Init(data)
|
||||
self.Position = data:GetStart()
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
self.Attachment = data:GetAttachment()
|
||||
|
||||
if IsValid(self.WeaponEnt) and self.WeaponEnt.GetMuzzleAttachment then
|
||||
self.Attachment = self.WeaponEnt:GetMuzzleAttachment()
|
||||
end
|
||||
|
||||
-- Keep the start and end pos - we're going to interpolate between them
|
||||
self.StartPos = self:GetTracerShootPos(self.Position, self.WeaponEnt, self.Attachment)
|
||||
self.EndPos = data:GetOrigin()
|
||||
self.Normal = (self.EndPos - self.StartPos):GetNormalized()
|
||||
self.Length = (self.EndPos - self.StartPos):Length()
|
||||
--self.Alpha = 255
|
||||
self.Life = 0
|
||||
self.MaxLife = self.Length / self.Speed
|
||||
self:SetRenderBoundsWS(self.StartPos, self.EndPos, Vector(1000,1000,1000))
|
||||
self.CurPos = self.StartPos
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
THINK
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:Think()
|
||||
self.Life = self.Life + FrameTime() * (1 / self.MaxLife)
|
||||
--self.Alpha = 255 * ( 1 - self.Life )
|
||||
|
||||
return self.Life < 1
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Draw the effect
|
||||
-----------------------------------------------------------]]
|
||||
local lerpedcol = Color(225, 225, 225, 225)
|
||||
|
||||
function EFFECT:Render()
|
||||
render.SetMaterial(self.Mat)
|
||||
lerpedcol.r = Lerp(self.Life, self.Col1.r, self.Col2.r)
|
||||
lerpedcol.g = Lerp(self.Life, self.Col1.g, self.Col2.g)
|
||||
lerpedcol.b = Lerp(self.Life, self.Col1.b, self.Col2.b)
|
||||
lerpedcol.a = Lerp(self.Life, self.Col1.a, self.Col2.a)
|
||||
local startbeampos = LerpVector(self.Life, self.StartPos, self.EndPos)
|
||||
local endbeampos = LerpVector(self.Life + self.TracerLength / self.Length, self.StartPos, self.EndPos)
|
||||
render.DrawBeam(startbeampos, endbeampos, 8, 0, 1, lerpedcol)
|
||||
end
|
||||
154
addons/tfa_base/lua/effects/tfa_tracer_gauss/init.lua
Normal file
154
addons/tfa_base/lua/effects/tfa_tracer_gauss/init.lua
Normal file
@@ -0,0 +1,154 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local vector_origin = Vector()
|
||||
|
||||
EFFECT.Thickness = 16
|
||||
EFFECT.Life = 0.25
|
||||
EFFECT.RotVelocity = 30
|
||||
EFFECT.InValid = false
|
||||
local Mat_Impact = Material("effects/combinemuzzle2")
|
||||
local Mat_Beam = Material("effects/tool_tracer")
|
||||
local Mat_TracePart = Material("effects/select_ring")
|
||||
|
||||
function EFFECT:Init(data)
|
||||
self.Position = data:GetStart()
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
self.Attachment = data:GetAttachment()
|
||||
|
||||
if IsValid(self.WeaponEnt) and self.WeaponEnt.GetMuzzleAttachment then
|
||||
self.Attachment = self.WeaponEnt:GetMuzzleAttachment()
|
||||
end
|
||||
|
||||
local owent
|
||||
|
||||
if IsValid(self.WeaponEnt) then
|
||||
owent = self.WeaponEnt:GetOwner()
|
||||
|
||||
if not IsValid(owent) then
|
||||
owent = self.WeaponEnt:GetParent()
|
||||
end
|
||||
end
|
||||
|
||||
if IsValid(owent) and owent:IsPlayer() then
|
||||
if owent ~= LocalPlayer() or owent:ShouldDrawLocalPlayer() then
|
||||
self.WeaponEnt = owent:GetActiveWeapon()
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
else
|
||||
self.WeaponEnt = owent:GetViewModel()
|
||||
local theirweapon = owent:GetActiveWeapon()
|
||||
|
||||
if IsValid(theirweapon) and theirweapon.ViewModelFlip or theirweapon.ViewModelFlipped then
|
||||
self.Flipped = true
|
||||
end
|
||||
|
||||
if not IsValid(self.WeaponEnt) then return end
|
||||
end
|
||||
end
|
||||
|
||||
local angpos
|
||||
|
||||
if IsValid(self.WeaponEnt) then
|
||||
angpos = self.WeaponEnt:GetAttachment(self.Attachment)
|
||||
end
|
||||
|
||||
if not angpos or not angpos.Pos then
|
||||
angpos = {
|
||||
Pos = vector_origin,
|
||||
Ang = angle_zero
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
if self.Flipped then
|
||||
local tmpang = (self.Dir or angpos.Ang:Forward()):Angle()
|
||||
local localang = self.WeaponEnt:WorldToLocalAngles(tmpang)
|
||||
localang.y = localang.y + 180
|
||||
localang = self.WeaponEnt:LocalToWorldAngles(localang)
|
||||
--localang:RotateAroundAxis(localang:Up(),180)
|
||||
--tmpang:RotateAroundAxis(tmpang:Up(),180)
|
||||
self.Dir = localang:Forward()
|
||||
end
|
||||
|
||||
-- Keep the start and end Pos - we're going to interpolate between them
|
||||
if IsValid(owent) and self.Position:Distance(owent:EyePos()) > 72 then
|
||||
self.WeaponEnt = nil
|
||||
end
|
||||
|
||||
self.StartPos = self:GetTracerShootPos(self.WeaponEnt and angpos.Pos or self.Position, self.WeaponEnt, self.Attachment)
|
||||
self.EndPos = data:GetOrigin()
|
||||
self.Entity:SetRenderBoundsWS(self.StartPos, self.EndPos)
|
||||
self.Normal = (self.EndPos - self.StartPos):GetNormalized()
|
||||
self.StartTime = 0
|
||||
self.LifeTime = self.Life
|
||||
self.data = data
|
||||
self.rot = 0
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
if self.InValid then return false end
|
||||
self.LifeTime = self.LifeTime - FrameTime()
|
||||
self.StartTime = self.StartTime + FrameTime()
|
||||
|
||||
return self.LifeTime > 0
|
||||
end
|
||||
|
||||
local beamcol = table.Copy(color_white)
|
||||
local beamcol2 = Color(0, 225, 255, 255)
|
||||
|
||||
function EFFECT:Render()
|
||||
if self.InValid then return false end
|
||||
self.StartPos = self:GetTracerShootPos(self.StartPos, self.WeaponEnt, self.Attachment)
|
||||
local startPos = self.StartPos
|
||||
local endPos = self.EndPos
|
||||
local tracerpos
|
||||
beamcol.a = self.LifeTime / self.Life * 255
|
||||
self.rot = self.rot + FrameTime() * self.RotVelocity
|
||||
render.SetMaterial(Mat_Impact)
|
||||
render.DrawSprite(endPos, 12, 12, ColorAlpha(color_white, beamcol.a))
|
||||
render.SetMaterial(Mat_TracePart)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life - 0.1, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot - 60)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life - 0.05, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot - 30)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life + 0.05, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot + 30)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life + 0.1, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot + 60)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life + 0.15, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot + 30)
|
||||
tracerpos = Lerp(math.Clamp(self.LifeTime / self.Life + 0.2, 0, 1), endPos, startPos)
|
||||
render.DrawQuadEasy(tracerpos, self.Normal, 12, 12, beamcol2, self.rot + 60)
|
||||
render.SetMaterial(Mat_Beam)
|
||||
render.DrawBeam(startPos, endPos, self.Thickness, 0 + beamcol.a / 128, endPos:Distance(startPos) / 64 + beamcol.a / 128, beamcol)
|
||||
end
|
||||
86
addons/tfa_base/lua/effects/tfa_tracer_incendiary/init.lua
Normal file
86
addons/tfa_base/lua/effects/tfa_tracer_incendiary/init.lua
Normal file
@@ -0,0 +1,86 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
EFFECT.Mat = Material("effects/laser_tracer")
|
||||
EFFECT.Col1 = Color(255, 90, 25, 200) --Color(225,225,225,225)
|
||||
EFFECT.Col2 = Color(225, 25, 25, 200)
|
||||
EFFECT.Speed = 8192
|
||||
EFFECT.TracerLength = 128
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Init( data table )
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:Init(data)
|
||||
self.Position = data:GetStart()
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
self.Attachment = data:GetAttachment()
|
||||
|
||||
if IsValid(self.WeaponEnt) and self.WeaponEnt.GetMuzzleAttachment then
|
||||
self.Attachment = self.WeaponEnt:GetMuzzleAttachment()
|
||||
end
|
||||
|
||||
-- Keep the start and end pos - we're going to interpolate between them
|
||||
self.StartPos = self:GetTracerShootPos(self.Position, self.WeaponEnt, self.Attachment)
|
||||
self.EndPos = data:GetOrigin()
|
||||
self.Normal = (self.EndPos - self.StartPos):GetNormalized()
|
||||
self.Length = (self.EndPos - self.StartPos):Length()
|
||||
--self.Alpha = 255
|
||||
self.Life = 0
|
||||
self.MaxLife = self.Length / self.Speed
|
||||
self:SetRenderBoundsWS(self.StartPos, self.EndPos)
|
||||
self.CurPos = self.StartPos
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
THINK
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:Think()
|
||||
self.Life = self.Life + FrameTime() * (1 / self.MaxLife)
|
||||
--self.Alpha = 255 * ( 1 - self.Life )
|
||||
|
||||
return self.Life < 1
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Draw the effect
|
||||
-----------------------------------------------------------]]
|
||||
local lerpedcol = Color(225, 225, 225, 225)
|
||||
|
||||
function EFFECT:Render()
|
||||
render.SetMaterial(self.Mat)
|
||||
lerpedcol.r = Lerp(self.Life, self.Col1.r, self.Col2.r)
|
||||
lerpedcol.g = Lerp(self.Life, self.Col1.g, self.Col2.g)
|
||||
lerpedcol.b = Lerp(self.Life, self.Col1.b, self.Col2.b)
|
||||
lerpedcol.a = Lerp(self.Life, self.Col1.a, self.Col2.a)
|
||||
local startbeampos = Lerp(self.Life, self.StartPos, self.EndPos)
|
||||
local endbeampos = Lerp(self.Life + self.TracerLength / self.Length, self.StartPos, self.EndPos)
|
||||
render.DrawBeam(startbeampos, endbeampos, 8, 0, 1, lerpedcol)
|
||||
end
|
||||
86
addons/tfa_base/lua/effects/tfa_tracer_plasma/init.lua
Normal file
86
addons/tfa_base/lua/effects/tfa_tracer_plasma/init.lua
Normal file
@@ -0,0 +1,86 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
EFFECT.Mat = Material("effects/laser_tracer")
|
||||
EFFECT.Col1 = Color(128, 255, 255) --Color(225,225,225,225)
|
||||
EFFECT.Col2 = Color(97, 218, 255)
|
||||
EFFECT.Speed = 4096
|
||||
EFFECT.TracerLength = 128
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Init( data table )
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:Init(data)
|
||||
self.Position = data:GetStart()
|
||||
self.WeaponEnt = data:GetEntity()
|
||||
self.Attachment = data:GetAttachment()
|
||||
|
||||
if IsValid(self.WeaponEnt) and self.WeaponEnt.GetMuzzleAttachment then
|
||||
self.Attachment = self.WeaponEnt:GetMuzzleAttachment()
|
||||
end
|
||||
|
||||
-- Keep the start and end pos - we're going to interpolate between them
|
||||
self.StartPos = self:GetTracerShootPos(self.Position, self.WeaponEnt, self.Attachment)
|
||||
self.EndPos = data:GetOrigin()
|
||||
self.Normal = (self.EndPos - self.StartPos):GetNormalized()
|
||||
self.Length = (self.EndPos - self.StartPos):Length()
|
||||
--self.Alpha = 255
|
||||
self.Life = 0
|
||||
self.MaxLife = self.Length / self.Speed
|
||||
self:SetRenderBoundsWS(self.StartPos, self.EndPos)
|
||||
self.CurPos = self.StartPos
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
THINK
|
||||
-----------------------------------------------------------]]
|
||||
function EFFECT:Think()
|
||||
self.Life = self.Life + FrameTime() * (1 / self.MaxLife)
|
||||
--self.Alpha = 255 * ( 1 - self.Life )
|
||||
|
||||
return self.Life < 1
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
Draw the effect
|
||||
-----------------------------------------------------------]]
|
||||
local lerpedcol = Color(225, 225, 225, 225)
|
||||
|
||||
function EFFECT:Render()
|
||||
render.SetMaterial(self.Mat)
|
||||
lerpedcol.r = Lerp(self.Life, self.Col1.r, self.Col2.r)
|
||||
lerpedcol.g = Lerp(self.Life, self.Col1.g, self.Col2.g)
|
||||
lerpedcol.b = Lerp(self.Life, self.Col1.b, self.Col2.b)
|
||||
lerpedcol.a = Lerp(self.Life, self.Col1.a, self.Col2.a)
|
||||
local startbeampos = Lerp(self.Life, self.StartPos, self.EndPos)
|
||||
local endbeampos = Lerp(self.Life + self.TracerLength / self.Length, self.StartPos, self.EndPos)
|
||||
render.DrawBeam(startbeampos, endbeampos, 8, 0, 1, lerpedcol)
|
||||
end
|
||||
242
addons/tfa_base/lua/entities/tfa_ammo_base.lua
Normal file
242
addons/tfa_base/lua/entities/tfa_ammo_base.lua
Normal file
@@ -0,0 +1,242 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "base_anim"
|
||||
ENT.PrintName = "AmmoBase"
|
||||
ENT.Category = "TFA Ammunition"
|
||||
ENT.Spawnable = false
|
||||
ENT.AdminSpawnable = false
|
||||
ENT.Class = ""
|
||||
ENT.MyModel = "models/props_junk/popcan01a.mdl"
|
||||
ENT.ImpactSound = "Default.ImpactSoft"
|
||||
ENT.AmmoCount = 100
|
||||
ENT.AmmoType = "357"
|
||||
ENT.TextPosition = Vector(-2.5, -3.3, 4)
|
||||
ENT.TextAngles = Vector(48, -90, 0)
|
||||
ENT.TextColor = Color(240, 35, 35, 255)
|
||||
ENT.DrawText = false
|
||||
ENT.ShouldDrawShadow = true
|
||||
ENT.ImpactSound = "Default.ImpactSoft"
|
||||
ENT.DamageThreshold = 80
|
||||
ENT.ExplosionOffset = Vector(0, 0, 10)
|
||||
ENT.Damage = 30
|
||||
ENT.TextOffX = 30
|
||||
ENT.TextOffY = -20
|
||||
ENT.TextScale = 1
|
||||
|
||||
if SERVER then
|
||||
AddCSLuaFile()
|
||||
|
||||
function ENT:SpawnFunction(ply, tr, classname)
|
||||
if (not tr.Hit) then return end
|
||||
local pos = tr.HitPos + tr.HitNormal * 4
|
||||
local ent = ents.Create(classname)
|
||||
ent:SetPos(pos)
|
||||
ent:Spawn()
|
||||
ent:Activate()
|
||||
ent.Class = classname
|
||||
ent.Spawner = ply
|
||||
|
||||
return ent
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
local model = self.MyModel
|
||||
self.Class = self:GetClass()
|
||||
self:SetModel(model)
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:DrawShadow(self.ShouldDrawShadow)
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetHealth(self.DamageThreshold)
|
||||
self:SetNW2Bool("ShouldRemove", false)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(data, physobj)
|
||||
if (data.Speed > 60 and data.DeltaTime > 0.2) then
|
||||
self:EmitSound(self.ImpactSound)
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use(activator, caller)
|
||||
if IsValid(activator) and activator:IsPlayer() then
|
||||
activator:GiveAmmo(self.AmmoCount, self.AmmoType)
|
||||
self:SetNW2Bool("ShouldRemove", true)
|
||||
end
|
||||
end
|
||||
|
||||
local bul = {}
|
||||
local randvec = Vector(0, 0, 0)
|
||||
bul.Tracer = 3
|
||||
bul.Num = 1
|
||||
bul.TracerName = "Tracer"
|
||||
bul.Spread = Vector(0, 0, 0)
|
||||
|
||||
local cv_dc = GetConVar("sv_tfa_ammo_detonation_chain")
|
||||
local cv_dm = GetConVar("sv_tfa_ammo_detonation_mode")
|
||||
function ENT:OnTakeDamage(dmginfo)
|
||||
if not IsValid(self) then return end
|
||||
local at = dmginfo:GetInflictor()
|
||||
local shouldtakedamage = true
|
||||
|
||||
if IsValid(at) then
|
||||
local base = at.Base
|
||||
|
||||
if (base and string.find(base, "tfa_ammo_base")) or string.find(at:GetClass(), "tfa_ammo_") and not cv_dc:GetBool() then
|
||||
shouldtakedamage = false
|
||||
end
|
||||
end
|
||||
|
||||
if dmginfo:GetDamage() < 1 then
|
||||
shouldtakedamage = false
|
||||
end
|
||||
|
||||
self.Attacker = at
|
||||
|
||||
if shouldtakedamage then
|
||||
self:SetHealth(self:Health() - dmginfo:GetDamage())
|
||||
end
|
||||
|
||||
self:EmitSound(self.ImpactSound)
|
||||
local phy = self:GetPhysicsObject()
|
||||
|
||||
if IsValid(phy) then
|
||||
local f = dmginfo:GetDamageForce()
|
||||
local p = dmginfo:GetDamagePosition()
|
||||
|
||||
if f and p then
|
||||
phy:ApplyForceOffset(f / 4, p)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if self:GetNW2Bool("ShouldRemove", false) then
|
||||
self:Remove()
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
if not cv_dc:GetBool() then return true end
|
||||
|
||||
if self:Health() <= 0 then
|
||||
self:EmitSound(self.ImpactSound)
|
||||
local adm = cv_dm:GetInt()
|
||||
bul.AmmoType = self.AmmoType
|
||||
bul.Damage = self.Damage
|
||||
bul.Force = math.Max(self.Damage / 25, 0.1)
|
||||
bul.Attacker = self
|
||||
|
||||
if IsValid(self.Attacker) then
|
||||
bul.Attacker = self.Attacker
|
||||
end
|
||||
|
||||
local upang = self:GetAngles():Up()
|
||||
bul.Dir = upang + randvec * 0.75
|
||||
local numbuls = math.random(math.Round(self.AmmoCount * 0.25), math.Round(self.AmmoCount * 0.75))
|
||||
local i = 1
|
||||
|
||||
if adm == 2 then
|
||||
bul.Damage = bul.Damage / 2
|
||||
end
|
||||
|
||||
bul.Dir = (upang + randvec * 0.75):GetNormalized()
|
||||
bul.Src = self:GetPos()
|
||||
self:FireBullets(bul)
|
||||
|
||||
if adm ~= 1 then
|
||||
while i <= math.Clamp(numbuls, 1, 35) do
|
||||
randvec.x = math.Rand(-1, 1)
|
||||
randvec.y = math.Rand(-1, 1)
|
||||
randvec.z = math.Rand(-1, 1)
|
||||
bul.Dir = (upang + randvec * 0.75):GetNormalized()
|
||||
bul.Src = self:GetPos()
|
||||
self:FireBullets(bul)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin(self:GetPos())
|
||||
effectdata:SetMagnitude(0.1)
|
||||
effectdata:SetScale(0.5)
|
||||
|
||||
if adm == 1 then
|
||||
bul.Damage = bul.Damage * 3 / 4
|
||||
end
|
||||
|
||||
if adm > 0 then
|
||||
util.BlastDamage(bul.Attacker, bul.Attacker, bul.Src, (bul.Damage * 6 + 128) / 2, bul.Damage * 2)
|
||||
util.Effect("Explosion", effectdata)
|
||||
end
|
||||
|
||||
if adm ~= 1 then
|
||||
util.Effect("cball_explode", effectdata)
|
||||
end
|
||||
|
||||
self:SetNW2Bool("ShouldRemove", true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
function ENT:Initialize()
|
||||
self.Class = self:GetClass()
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
|
||||
if self.TextPosition and self.TextAngles and self.DrawText then
|
||||
local pos = self:GetPos() + (self:GetUp() * self.TextPosition.z) + (self:GetRight() * self.TextPosition.x) + (self:GetForward() * self.TextPosition.y)
|
||||
local ang = self:GetAngles()
|
||||
ang:RotateAroundAxis(ang:Right(), self.TextAngles.x)
|
||||
ang:RotateAroundAxis(ang:Up(), self.TextAngles.y)
|
||||
ang:RotateAroundAxis(ang:Forward(), self.TextAngles.z)
|
||||
|
||||
if not self.Text then
|
||||
self.Text = string.upper(self.AmmoType)
|
||||
end
|
||||
|
||||
cam.Start3D2D(pos, ang, .07 * self.TextScale)
|
||||
draw.SimpleText(self.Text, "DermaLarge", self.TextOffX, self.TextOffY, self.TextColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
cam.End3D2D()
|
||||
end
|
||||
end
|
||||
end
|
||||
40
addons/tfa_base/lua/entities/tfa_exp_base/cl_init.lua
Normal file
40
addons/tfa_base/lua/entities/tfa_exp_base/cl_init.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
|
||||
function ENT:IsTranslucent()
|
||||
return true
|
||||
end
|
||||
110
addons/tfa_base/lua/entities/tfa_exp_base/init.lua
Normal file
110
addons/tfa_base/lua/entities/tfa_exp_base/init.lua
Normal file
@@ -0,0 +1,110 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
|
||||
ENT.DefaultModel = Model("models/weapons/w_eq_fraggrenade.mdl")
|
||||
|
||||
ENT.Damage = 100
|
||||
ENT.Delay = 3
|
||||
|
||||
function ENT:Initialize()
|
||||
local mdl = self:GetModel()
|
||||
|
||||
if not mdl or mdl == "" or mdl == "models/error.mdl" then
|
||||
self:SetModel(self.DefaultModel)
|
||||
end
|
||||
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
|
||||
local phys = self:GetPhysicsObject()
|
||||
if IsValid(phys) then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self:SetFriction(self.Delay)
|
||||
self.killtime = CurTime() + self.Delay
|
||||
self:DrawShadow(true)
|
||||
|
||||
if not self.Inflictor and self:GetOwner():IsValid() and self:GetOwner():GetActiveWeapon():IsValid() then
|
||||
self.Inflictor = self:GetOwner():GetActiveWeapon()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if self.killtime < CurTime() then
|
||||
self:Explode()
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
self:NextThink(CurTime())
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
ENT.ExplosionSound = "BaseExplosionEffect.Sound"
|
||||
|
||||
function ENT:DoExplosionEffect()
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetOrigin(self:GetPos())
|
||||
|
||||
util.Effect("HelicopterMegaBomb", effectdata)
|
||||
util.Effect("Explosion", effectdata)
|
||||
|
||||
self:EmitSoundNet(self.ExplosionSound)
|
||||
end
|
||||
|
||||
function ENT:Explode()
|
||||
if not IsValid(self.Inflictor) then
|
||||
self.Inflictor = self
|
||||
end
|
||||
|
||||
self.Damage = self.mydamage or self.Damage
|
||||
|
||||
local dmg = DamageInfo()
|
||||
dmg:SetInflictor(self.Inflictor)
|
||||
dmg:SetAttacker(IsValid(self:GetOwner()) and self:GetOwner() or self)
|
||||
dmg:SetDamage(self.Damage)
|
||||
dmg:SetDamageType(bit.bor(DMG_BLAST, DMG_AIRBOAT))
|
||||
|
||||
util.BlastDamageInfo(dmg, self:GetPos(), math.pow( self.Damage / 100, 0.75) * 200)
|
||||
|
||||
util.ScreenShake(self:GetPos(), self.Damage * 20, 255, self.Damage / 200, math.pow(self.Damage / 100, 0.75) * 400)
|
||||
|
||||
self:DoExplosionEffect()
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
62
addons/tfa_base/lua/entities/tfa_exp_base/shared.lua
Normal file
62
addons/tfa_base/lua/entities/tfa_exp_base/shared.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Base Explosive"
|
||||
ENT.Author = ""
|
||||
ENT.Contact = ""
|
||||
ENT.Purpose = ""
|
||||
ENT.Instructions = ""
|
||||
ENT.DoNotDuplicate = true
|
||||
ENT.DisableDuplicator = true
|
||||
|
||||
local sp = game.SinglePlayer()
|
||||
|
||||
function ENT:EmitSoundNet(sound)
|
||||
if CLIENT or sp then
|
||||
if sp and not IsFirstTimePredicted() then return end
|
||||
|
||||
self:EmitSound(sound)
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
local filter = RecipientFilter()
|
||||
filter:AddPAS(self:GetPos())
|
||||
if IsValid(self:GetOwner()) then
|
||||
filter:RemovePlayer(self:GetOwner())
|
||||
end
|
||||
|
||||
net.Start("tfaSoundEvent", true)
|
||||
net.WriteEntity(self)
|
||||
net.WriteString(sound)
|
||||
net.Send(filter)
|
||||
end
|
||||
41
addons/tfa_base/lua/entities/tfa_exp_contact.lua
Normal file
41
addons/tfa_base/lua/entities/tfa_exp_contact.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
ENT.Base = "tfa_exp_base"
|
||||
ENT.PrintName = "Contact Explosive"
|
||||
|
||||
function ENT:PhysicsCollide(data, phys)
|
||||
if data.Speed > 60 then
|
||||
self.killtime = -1
|
||||
end
|
||||
end
|
||||
127
addons/tfa_base/lua/entities/tfa_exp_rocket.lua
Normal file
127
addons/tfa_base/lua/entities/tfa_exp_rocket.lua
Normal file
@@ -0,0 +1,127 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
ENT.Base = "tfa_exp_base"
|
||||
ENT.PrintName = "Rocket-Propelled Explosive"
|
||||
|
||||
-- EDITABLE PARAMETERS -- START
|
||||
|
||||
ENT.LaunchSound = "" -- none, replace to enable
|
||||
ENT.PropelSound = Sound("Missile.Accelerate") -- looped propel sound
|
||||
|
||||
ENT.BaseSpeed = 500 -- base rocket speed, in units
|
||||
|
||||
ENT.AccelerationTime = 0.25 -- time in seconds to accelerate to max speed
|
||||
ENT.MaxSpeed = 1500 -- maximum speed, works if AccelerationTime > 0
|
||||
|
||||
ENT.HasTrail = true -- create trail
|
||||
|
||||
-- EDITABLE PARAMETERS -- END
|
||||
|
||||
ENT.AccelProgress = 0
|
||||
|
||||
ENT.DefaultModel = Model("models/weapons/w_missile.mdl")
|
||||
ENT.Delay = 10
|
||||
|
||||
DEFINE_BASECLASS(ENT.Base)
|
||||
|
||||
-- Creates HL2 rocket trail by default, feel free to copy and edit to your needs
|
||||
function ENT:CreateRocketTrail()
|
||||
if not SERVER then return end
|
||||
|
||||
local rockettrail = ents.Create("env_rockettrail")
|
||||
rockettrail:DeleteOnRemove(self)
|
||||
|
||||
rockettrail:SetPos(self:GetPos())
|
||||
rockettrail:SetAngles(self:GetAngles())
|
||||
rockettrail:SetParent(self)
|
||||
rockettrail:SetMoveType(MOVETYPE_NONE)
|
||||
rockettrail:AddSolidFlags(FSOLID_NOT_SOLID)
|
||||
|
||||
rockettrail:SetSaveValue("m_Opacity", 0.2)
|
||||
rockettrail:SetSaveValue("m_SpawnRate", 100)
|
||||
rockettrail:SetSaveValue("m_ParticleLifetime", 0.5)
|
||||
rockettrail:SetSaveValue("m_StartColor", Vector(0.65, 0.65, 0.65))
|
||||
rockettrail:SetSaveValue("m_EndColor", Vector(0, 0, 0))
|
||||
rockettrail:SetSaveValue("m_StartSize", 8)
|
||||
rockettrail:SetSaveValue("m_EndSize", 32)
|
||||
rockettrail:SetSaveValue("m_SpawnRadius", 4)
|
||||
rockettrail:SetSaveValue("m_MinSpeed", 2)
|
||||
rockettrail:SetSaveValue("m_MaxSpeed", 16)
|
||||
rockettrail:SetSaveValue("m_nAttachment", 0)
|
||||
rockettrail:SetSaveValue("m_flDeathTime", CurTime() + 999)
|
||||
|
||||
rockettrail:Activate()
|
||||
rockettrail:Spawn()
|
||||
end
|
||||
|
||||
function ENT:Initialize(...)
|
||||
BaseClass.Initialize(self, ...)
|
||||
|
||||
self:EmitSoundNet(self.PropelSound)
|
||||
|
||||
if self.LaunchSound and self.LaunchSound ~= "" then
|
||||
self:EmitSoundNet(self.LaunchSound)
|
||||
end
|
||||
|
||||
self:SetFriction(0)
|
||||
self:SetLocalAngularVelocity(angle_zero)
|
||||
|
||||
self:SetMoveType(bit.bor(MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE))
|
||||
self:SetLocalVelocity(self:GetForward() * self.BaseSpeed)
|
||||
|
||||
if self.HasTrail then
|
||||
self:CreateRocketTrail()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think(...)
|
||||
if self.AccelerationTime > 0 and self.AccelProgress < 1 then
|
||||
self.LastAccelThink = self.LastAccelThink or CurTime()
|
||||
self.AccelProgress = Lerp((CurTime() - self.LastAccelThink) / self.AccelerationTime, self.AccelProgress, 1)
|
||||
end
|
||||
|
||||
self:SetLocalVelocity(self:GetForward() * Lerp(self.AccelProgress, self.BaseSpeed, self.MaxSpeed))
|
||||
|
||||
return BaseClass.Think(self, ...)
|
||||
end
|
||||
|
||||
function ENT:Explode(...)
|
||||
self:StopSound(self.PropelSound)
|
||||
|
||||
return BaseClass.Explode(self, ...)
|
||||
end
|
||||
|
||||
function ENT:Touch()
|
||||
self.killtime = -1
|
||||
end
|
||||
48
addons/tfa_base/lua/entities/tfa_exp_timed.lua
Normal file
48
addons/tfa_base/lua/entities/tfa_exp_timed.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
ENT.Base = "tfa_exp_base"
|
||||
ENT.PrintName = "Timed Explosive"
|
||||
|
||||
ENT.BounceSound = Sound("HEGrenade.Bounce")
|
||||
|
||||
function ENT:PhysicsCollide(data, phys)
|
||||
if data.Speed > 60 then
|
||||
if self.BounceSound then
|
||||
self:EmitSoundNet(self.BounceSound)
|
||||
end
|
||||
|
||||
local impulse = (data.OurOldVelocity - 2 * data.OurOldVelocity:Dot(data.HitNormal) * data.HitNormal) * 0.25
|
||||
phys:ApplyForceCenter(impulse)
|
||||
end
|
||||
end
|
||||
36
addons/tfa_base/lua/entities/tfa_thrown_blade/cl_init.lua
Normal file
36
addons/tfa_base/lua/entities/tfa_thrown_blade/cl_init.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
207
addons/tfa_base/lua/entities/tfa_thrown_blade/init.lua
Normal file
207
addons/tfa_base/lua/entities/tfa_thrown_blade/init.lua
Normal file
@@ -0,0 +1,207 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
local mdl = self:GetModel()
|
||||
|
||||
if not mdl or mdl == "" or string.find(mdl, "error") then
|
||||
self:SetModel("models/weapons/w_knife_t.mdl")
|
||||
end
|
||||
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
self:NextThink(CurTime() + 1)
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:SetMass(10)
|
||||
end
|
||||
|
||||
for _, v in pairs(self.HitSounds) do
|
||||
for _, o in pairs(v) do
|
||||
util.PrecacheSound(o)
|
||||
end
|
||||
end
|
||||
|
||||
local bounds = self:OBBMaxs() - self:OBBMins()
|
||||
|
||||
if bounds.z > bounds.x and bounds.z > bounds.y then
|
||||
self.up = true
|
||||
elseif bounds.y > bounds.x and bounds.y > bounds.z then
|
||||
self.right = true
|
||||
end
|
||||
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
self.mydamage = self.mydamage or 40
|
||||
|
||||
self.DestroyTime = CurTime() + 30
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if CurTime() > self.DestroyTime then
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Stick()
|
||||
self.DestroyTime = CurTime() + 60
|
||||
timer.Simple(0,function()
|
||||
if IsValid(self) then
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
self:GetPhysicsObject():EnableMotion(false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(data, phys)
|
||||
timer.Simple(0,function()
|
||||
if not IsValid(self) then return end
|
||||
local owner = self:GetOwner()
|
||||
self:SetOwner(nil)
|
||||
local fwdang = self:GetAngles()
|
||||
local fwdvec
|
||||
|
||||
if self.up then
|
||||
fwdvec = fwdang:Up()
|
||||
elseif self.right then
|
||||
fwdvec = fwdang:Right()
|
||||
else
|
||||
fwdvec = fwdang:Forward()
|
||||
end
|
||||
|
||||
local ent = data.HitEntity
|
||||
if not IsValid(ent) and not (ent and ent:IsWorld()) then return end
|
||||
local dmg = self.mydamage * math.sqrt(data.Speed / 1500)
|
||||
|
||||
if dmg > 5 and ent and not ent:IsWorld() then
|
||||
local dmginfo = DamageInfo()
|
||||
dmginfo:SetDamage(dmg)
|
||||
dmginfo:SetDamagePosition(data.HitPos)
|
||||
dmginfo:SetDamageForce(data.OurOldVelocity)
|
||||
dmginfo:SetInflictor(self)
|
||||
dmginfo:SetDamageType(DMG_SLASH)
|
||||
local att = self:GetPhysicsAttacker()
|
||||
|
||||
if not IsValid(att) then
|
||||
att = owner
|
||||
end
|
||||
|
||||
if not IsValid(att) then
|
||||
att = self
|
||||
end
|
||||
|
||||
dmginfo:SetAttacker(att)
|
||||
ent:TakeDamageInfo(dmginfo)
|
||||
end
|
||||
|
||||
local traceres = util.QuickTrace(self:GetPos(), data.OurOldVelocity, self)
|
||||
if not traceres.HitPos then return end
|
||||
|
||||
if data.Speed > 50 then
|
||||
local soundtbl
|
||||
|
||||
if self.HitSounds[traceres.MatType] then
|
||||
soundtbl = self.HitSounds[traceres.MatType]
|
||||
else
|
||||
soundtbl = self.HitSounds[MAT_DIRT]
|
||||
end
|
||||
|
||||
local snd = soundtbl[math.random(1, #soundtbl)]
|
||||
self:EmitSound(snd)
|
||||
end
|
||||
|
||||
local dp = traceres.HitNormal:Dot(fwdvec)
|
||||
|
||||
if dp >= -0.3 then
|
||||
local fx = EffectData()
|
||||
fx:SetOrigin(data.HitPos)
|
||||
fx:SetMagnitude(1)
|
||||
fx:SetScale((data.Speed / 1500 * (dp + 0.6)) / 5)
|
||||
util.Effect("Sparks", fx)
|
||||
end
|
||||
|
||||
local canstick = data.Speed > 250 and dp < (-1 + data.Speed / 1000 * 0.3)
|
||||
|
||||
if ent:IsWorld() and canstick then
|
||||
util.Decal("ManhackCut", traceres.HitPos + traceres.HitNormal, traceres.HitPos - traceres.HitNormal)
|
||||
self:EmitSound(self.ImpactSound)
|
||||
self:SetPos(traceres.HitPos + traceres.HitNormal * 12)
|
||||
local tmpang = data.HitNormal:Angle()
|
||||
tmpang:RotateAroundAxis(tmpang:Right(), 270)
|
||||
--self:SetAngles(tmpang)
|
||||
local fx = EffectData()
|
||||
fx:SetOrigin(data.HitPos)
|
||||
fx:SetMagnitude(2)
|
||||
fx:SetScale(0.1)
|
||||
util.Effect("Sparks", fx)
|
||||
self:Stick()
|
||||
elseif IsValid(ent) then
|
||||
if not (ent:IsPlayer() or ent:IsNPC() or ent:GetClass() == "prop_ragdoll") then
|
||||
if canstick then
|
||||
util.Decal("ManhackCut", data.HitPos + data.HitNormal, data.HitPos - data.HitNormal)
|
||||
end
|
||||
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
else
|
||||
local fx = EffectData()
|
||||
fx:SetOrigin(data.HitPos)
|
||||
util.Effect("BloodImpact", fx)
|
||||
self:GetPhysicsObject():SetVelocity(-(data.OurOldVelocity / 8))
|
||||
end
|
||||
if IsValid(self) then
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
end
|
||||
end
|
||||
|
||||
if canstick then
|
||||
self:GetPhysicsObject():SetVelocity(-(data.OurOldVelocity / 16))
|
||||
end
|
||||
|
||||
self:GetPhysicsObject():AddAngleVelocity(-self:GetPhysicsObject():GetAngleVelocity() / 3)
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:Use(ply, caller)
|
||||
local classname = self:GetNW2String("ClassName")
|
||||
if not classname or classname == "" then return end
|
||||
|
||||
if ply:IsPlayer() and ply:GetWeapon(classname) == NULL then
|
||||
ply:Give(classname)
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
45
addons/tfa_base/lua/entities/tfa_thrown_blade/shared.lua
Normal file
45
addons/tfa_base/lua/entities/tfa_thrown_blade/shared.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Thrown Blade"
|
||||
ENT.Author = ""
|
||||
ENT.Contact = ""
|
||||
ENT.Purpose = ""
|
||||
ENT.Instructions = ""
|
||||
ENT.DoNotDuplicate = true
|
||||
|
||||
ENT.HitSounds = {
|
||||
[MAT_DIRT] = {Sound("physics/metal/metal_grenade_impact_hard1.wav"), Sound("physics/metal/metal_grenade_impact_hard2.wav"), Sound("physics/metal/metal_grenade_impact_hard3.wav")},
|
||||
[MAT_FLESH] = {Sound("physics/flesh/flesh_impact_bullet1.wav"), Sound("physics/flesh/flesh_impact_bullet2.wav"), Sound("physics/flesh/flesh_impact_bullet3.wav")}
|
||||
}
|
||||
|
||||
ENT.ImpactSound = Sound("weapons/blades/impact.mp3")
|
||||
54
addons/tfa_base/lua/entities/tfbow_arrow/cl_init.lua
Normal file
54
addons/tfa_base/lua/entities/tfbow_arrow/cl_init.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("shared.lua")
|
||||
local cv_ht = GetConVar("host_timescale")
|
||||
|
||||
function ENT:Draw()
|
||||
local ang, tmpang
|
||||
tmpang = self:GetAngles()
|
||||
ang = tmpang
|
||||
|
||||
if not self.roll then
|
||||
self.roll = 0
|
||||
end
|
||||
|
||||
local phobj = self:GetPhysicsObject()
|
||||
|
||||
if IsValid(phobj) then
|
||||
self.roll = self.roll + phobj:GetVelocity():Length() / 3600 * cv_ht:GetFloat()
|
||||
end
|
||||
|
||||
ang:RotateAroundAxis(ang:Forward(), self.roll)
|
||||
self:SetAngles(ang)
|
||||
self:DrawModel() -- Draw the model.
|
||||
self:SetAngles(tmpang)
|
||||
end
|
||||
34
addons/tfa_base/lua/entities/tfbow_arrow/init.lua
Normal file
34
addons/tfa_base/lua/entities/tfbow_arrow/init.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile("cl_init.lua") -- Make sure clientside
|
||||
AddCSLuaFile("shared.lua") -- and shared scripts are sent.
|
||||
include("shared.lua")
|
||||
278
addons/tfa_base/lua/entities/tfbow_arrow/shared.lua
Normal file
278
addons/tfa_base/lua/entities/tfbow_arrow/shared.lua
Normal file
@@ -0,0 +1,278 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local vector_origin = Vector()
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "TFBow Arrow"
|
||||
ENT.Author = "TheForgottenArchitect"
|
||||
ENT.Contact = "Don't"
|
||||
ENT.Purpose = "Arrow Entity"
|
||||
ENT.Instructions = "Spawn this with a velocity, get rich"
|
||||
|
||||
local function GetBoneCenter(ent, bone)
|
||||
local bonechildren = ent:GetChildBones(bone)
|
||||
|
||||
if #bonechildren <= 0 then
|
||||
return ent:GetBonePosition(bone)
|
||||
else
|
||||
local bonepos = ent:GetBonePosition(bone)
|
||||
local tmppos = bonepos
|
||||
|
||||
if tmppos then
|
||||
for i = 1, #bonechildren do
|
||||
local childpos = ent:GetBonePosition(bonechildren[i])
|
||||
|
||||
if childpos then
|
||||
tmppos = (tmppos + childpos) / 2
|
||||
end
|
||||
end
|
||||
else
|
||||
return ent:GetPos()
|
||||
end
|
||||
|
||||
return tmppos
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:GetClosestBonePos(ent, pos)
|
||||
local i, count, dist, ppos, cbone
|
||||
i = 1
|
||||
count = ent:GetBoneCount()
|
||||
cbone = 0
|
||||
dist = 99999999
|
||||
ppos = ent:GetPos()
|
||||
|
||||
while (i < count) do
|
||||
local bonepos = GetBoneCenter(ent, i)
|
||||
|
||||
if bonepos:Distance(pos) < dist then
|
||||
dist = bonepos:Distance(pos)
|
||||
cbone = i
|
||||
ppos = bonepos
|
||||
end
|
||||
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
return ppos, cbone
|
||||
end
|
||||
|
||||
local cv_al = GetConVar("sv_tfa_arrow_lifetime")
|
||||
local cv_ht = GetConVar("host_timescale")
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
if not IsValid(self.myowner) then
|
||||
self.myowner = self:GetOwner()
|
||||
|
||||
if not IsValid(self.myowner) then
|
||||
self.myowner = self
|
||||
end
|
||||
end
|
||||
|
||||
timer.Simple(0, function()
|
||||
if self.model then
|
||||
self:SetModel(self.model)
|
||||
end
|
||||
end)
|
||||
|
||||
if cv_al:GetInt() ~= -1 then
|
||||
timer.Simple( cv_al:GetFloat() + 5, function()
|
||||
if IsValid(self) then
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
|
||||
if self.velocity then
|
||||
phys:SetVelocityInstantaneous(self.velocity)
|
||||
end
|
||||
|
||||
phys:EnableCollisions(false)
|
||||
self:StartMotionController()
|
||||
self:PhysicsUpdate(phys, 0.1 * cv_ht:GetFloat() )
|
||||
end
|
||||
end
|
||||
|
||||
self:SetNW2Vector("lastpos", self:GetPos())
|
||||
|
||||
if not self.mydamage then
|
||||
self.mydamage = 60
|
||||
end
|
||||
|
||||
if not self.gun then
|
||||
if IsValid(self:GetOwner()) and self:GetOwner():IsPlayer() then
|
||||
self:UpdateGun()
|
||||
else
|
||||
timer.Simple(0, function()
|
||||
if IsValid(self) and IsValid(self:GetOwner()) and self:GetOwner():IsPlayer() then
|
||||
self:UpdateGun()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:UpdateGun()
|
||||
local wep = self:GetOwner():GetActiveWeapon()
|
||||
|
||||
if IsValid(wep) then
|
||||
self.gun = wep:GetClass()
|
||||
end
|
||||
end
|
||||
|
||||
local wl,tracedata,tr
|
||||
|
||||
local cv_fm = GetConVar("sv_tfa_force_multiplier")
|
||||
|
||||
function ENT:HitCB(a,b,c)
|
||||
c:SetDamageType(bit.bor(DMG_NEVERGIB, DMG_CLUB))
|
||||
|
||||
if IsValid(self) and IsValid(self:GetOwner()) then
|
||||
if b.HitWorld then
|
||||
local arrowstuck = ents.Create("tfbow_arrow_stuck")
|
||||
arrowstuck:SetModel(self:GetModel())
|
||||
arrowstuck.gun = self.gun
|
||||
arrowstuck:SetPos(tr.HitPos)
|
||||
local phys = self:GetPhysicsObject()
|
||||
arrowstuck:SetAngles((phys:GetVelocity()):Angle())
|
||||
arrowstuck:Spawn()
|
||||
else
|
||||
if IsValid(b.Entity) then
|
||||
if (not b.Entity:IsWorld()) then
|
||||
local arrowstuck = ents.Create("tfbow_arrow_stuck_clientside")
|
||||
arrowstuck:SetModel(self:GetModel())
|
||||
arrowstuck:SetPos(tr.HitPos)
|
||||
local ang = self:GetAngles()
|
||||
arrowstuck.gun = self.gun
|
||||
arrowstuck:SetAngles(ang)
|
||||
arrowstuck.targent = tr.Entity
|
||||
arrowstuck.targphysbone = tr.PhysicsBone
|
||||
arrowstuck:Spawn()
|
||||
else
|
||||
local arrowstuck = ents.Create("tfbow_arrow_stuck")
|
||||
arrowstuck:SetModel(self:GetModel())
|
||||
arrowstuck.gun = self.gun
|
||||
arrowstuck:SetPos(tr.HitPos)
|
||||
arrowstuck:SetAngles(self:GetAngles())
|
||||
arrowstuck:Spawn()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self:Remove()
|
||||
elseif IsValid(self) then
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
wl = self:WaterLevel()
|
||||
|
||||
if not self.prevwaterlevel then
|
||||
self.prevwaterlevel = wl
|
||||
end
|
||||
|
||||
if self.prevwaterlevel ~= wl and wl - self.prevwaterlevel >= 1 then
|
||||
--print(wl)
|
||||
local ef = EffectData()
|
||||
ef:SetOrigin(self:GetPos())
|
||||
util.Effect("watersplash", ef)
|
||||
end
|
||||
|
||||
self.prevwaterlevel = wl
|
||||
|
||||
if wl >= 2 then
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if IsValid(phys) then
|
||||
phys:SetVelocity(phys:GetVelocity() * math.sqrt(9 / 10))
|
||||
end
|
||||
end
|
||||
|
||||
tracedata = {}
|
||||
tracedata.start = self:GetNW2Vector("lastpos", self:GetPos())
|
||||
tracedata.endpos = self:GetPos()
|
||||
tracedata.mask = MASK_SOLID
|
||||
tracedata.filter = {self.myowner, self:GetOwner(), self}
|
||||
tr = util.TraceLine(tracedata)
|
||||
|
||||
--self:SetAngles((((tracedata.endpos-tracedata.start):GetNormalized()+self:GetAngles():Forward())/2):Angle())
|
||||
if (tr.Hit and tr.Fraction < 1 and tr.Fraction > 0) then
|
||||
debugoverlay.Line(tracedata.start, tr.HitPos, 10, Color(255, 0, 0, 255), true)
|
||||
debugoverlay.Cross(tr.HitPos, 5, 10, Color(255, 0, 0, 255), true)
|
||||
|
||||
if SERVER then
|
||||
--[[
|
||||
local bul ={}
|
||||
bul.Attacker=self:GetOwner() and self:GetOwner() or self:GetOwner()
|
||||
bul.Spread=vector_origin
|
||||
bul.Src=tracedata.start
|
||||
bul.Force=self.mydamage*0.25*GetConVarNumber("sv_tfbow_force_multiplier",1)
|
||||
bul.Damage=self.mydamage
|
||||
bul.Tracer = 0 -- Show a tracer on every x bullets
|
||||
bul.TracerName = "None"
|
||||
bul.Dir=((tr.HitPos-bul.Src):GetNormalized())
|
||||
|
||||
bul.Attacker:FireBullets( bul )
|
||||
]]
|
||||
--
|
||||
local bul = {}
|
||||
bul.Attacker = self:GetOwner() and self:GetOwner() or self:GetOwner()
|
||||
bul.Spread = vector_origin
|
||||
bul.Src = tracedata.start
|
||||
bul.Force = self.mydamage * 0.25 * cv_fm:GetFloat()
|
||||
bul.Damage = self.mydamage
|
||||
bul.Tracer = 0 -- Show a tracer on every x bullets
|
||||
bul.TracerName = "None"
|
||||
bul.Dir = (tr.HitPos - bul.Src):GetNormalized()
|
||||
|
||||
bul.Callback = function(a, b, c)
|
||||
self:HitCB(a,b,c)
|
||||
end
|
||||
|
||||
bul.Attacker:FireBullets(bul)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
self:SetNW2Vector("lastpos", self:GetPos())
|
||||
end
|
||||
36
addons/tfa_base/lua/entities/tfbow_arrow_stuck/cl_init.lua
Normal file
36
addons/tfa_base/lua/entities/tfbow_arrow_stuck/cl_init.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel() -- Draw the model.
|
||||
end
|
||||
34
addons/tfa_base/lua/entities/tfbow_arrow_stuck/init.lua
Normal file
34
addons/tfa_base/lua/entities/tfbow_arrow_stuck/init.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile("cl_init.lua") -- Make sure clientside
|
||||
AddCSLuaFile("shared.lua") -- and shared scripts are sent.
|
||||
include("shared.lua")
|
||||
85
addons/tfa_base/lua/entities/tfbow_arrow_stuck/shared.lua
Normal file
85
addons/tfa_base/lua/entities/tfbow_arrow_stuck/shared.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "TFBow Arrow Stuck"
|
||||
ENT.Author = "TheForgottenArchitect"
|
||||
ENT.Contact = "Don't"
|
||||
ENT.Purpose = "Arrow Entity"
|
||||
ENT.Instructions = "Arrow that's stuck in ground"
|
||||
|
||||
local cv_al = GetConVar("sv_tfa_arrow_lifetime")
|
||||
|
||||
function ENT:Initialize()
|
||||
if SERVER then
|
||||
if cv_al:GetInt() ~= -1 then
|
||||
timer.Simple( cv_al:GetFloat(), function()
|
||||
if IsValid(self) then
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:SetMass(2)
|
||||
end
|
||||
|
||||
if IsValid(self) and self.SetUseType then
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
end
|
||||
end
|
||||
|
||||
if (self:GetModel() and self:GetModel() == "") then
|
||||
self:SetModel("models/weapons/w_tfa_arrow.mdl")
|
||||
end
|
||||
|
||||
self:SetOwner(nil)
|
||||
self.PhysicsCollide = function() end
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Sleep()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Use(activator, caller)
|
||||
if activator:IsPlayer() and activator:GetWeapon(self.gun) then
|
||||
activator:GiveAmmo(1, activator:GetWeapon(self.gun):GetPrimaryAmmoType(), false)
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,40 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Draw()
|
||||
if IsValid( self:GetParent() ) then
|
||||
self:GetParent():SetupBones()
|
||||
end
|
||||
self:SetupBones()
|
||||
self:DrawModel()
|
||||
end
|
||||
@@ -0,0 +1,44 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Use( activator, caller, usetype, val )
|
||||
if activator:IsPlayer() and activator:GetWeapon(self.gun) ~= nil then
|
||||
activator:GiveAmmo(1, activator:GetWeapon(self.gun):GetPrimaryAmmoType(), false)
|
||||
self:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:PhysicsCollide(data, phys)
|
||||
end
|
||||
@@ -0,0 +1,228 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Sawblade"
|
||||
ENT.Author = ""
|
||||
ENT.Contact = ""
|
||||
ENT.Purpose = ""
|
||||
ENT.Instructions = ""
|
||||
ENT.DoNotDuplicate = true
|
||||
ENT.DisableDuplicator = true
|
||||
|
||||
ENT.glitchthreshold = 24 --threshold distance from bone to reset pos
|
||||
ENT.glitchthresholds = {}
|
||||
ENT.glitchthresholds["ValveBiped.Bip01_Head1"] = 8
|
||||
ENT.glitchthresholds["ValveBiped.Bip01_Head"] = 8
|
||||
ENT.glitchthresholds["ValveBiped.Bip01_R_Hand"] = 1
|
||||
ENT.glitchthresholds["ValveBiped.Bip01_L_Hand"] = 1
|
||||
ENT.glitchthresholds["ValveBiped.Bip01_Spine2"] = 40
|
||||
|
||||
ENT.Hull = 1.5 --Expand hull to make it easier to grab
|
||||
ENT.PredictCL = false
|
||||
ENT.UseMod = false --Experimentally modify the parent's Use func
|
||||
|
||||
local cv_al = GetConVar("sv_tfa_arrow_lifetime")
|
||||
local nzombies
|
||||
|
||||
local function GetBoneCenter(ent, bone)
|
||||
local bonechildren = ent:GetChildBones(bone)
|
||||
|
||||
if #bonechildren <= 0 then
|
||||
return ent:GetBonePosition(bone)
|
||||
else
|
||||
local bonepos = ent:GetBonePosition(bone)
|
||||
local tmppos = bonepos
|
||||
|
||||
if tmppos then
|
||||
for i = 1, #bonechildren do
|
||||
local childpos = ent:GetBonePosition(bonechildren[i])
|
||||
|
||||
if childpos then
|
||||
tmppos = (tmppos + childpos) / 2
|
||||
end
|
||||
end
|
||||
else
|
||||
return ent:GetPos()
|
||||
end
|
||||
|
||||
return tmppos
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
|
||||
if nzombies == nil then
|
||||
nzombies = nZombies or NZ or NZombies or engine.ActiveGamemode() == "nzombies"
|
||||
end
|
||||
|
||||
local mdl = self:GetModel()
|
||||
|
||||
if not mdl or mdl == "" or mdl == "models/error.mdl" then
|
||||
self:SetModel("models/weapons/w_tfa_arrow.mdl")
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
|
||||
local mins = (self:OBBMins() and self:OBBMins() or Vector(0, 0, 0)) - Vector(1, 1, 1)
|
||||
local maxs = (self:OBBMaxs() and self:OBBMaxs() or Vector(0, 0, 0)) + Vector(1, 1, 1)
|
||||
self:PhysicsInitBox(mins * self.Hull, maxs * self.Hull)
|
||||
--self:PhysicsInit( SOLID_VPHYSICS )
|
||||
--self:SetSolid( SOLID_VPHYSICS )
|
||||
self:SetMoveType( MOVETYPE_VPHYSICS )
|
||||
local phys = self:GetPhysicsObject()
|
||||
|
||||
if (phys:IsValid()) then
|
||||
phys:Wake()
|
||||
phys:SetMass(2)
|
||||
phys:EnableGravity(false)
|
||||
phys:EnableCollisions(false)
|
||||
end
|
||||
|
||||
if self.SetUseType then
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
end
|
||||
|
||||
if cv_al:GetInt() ~= -1 then
|
||||
timer.Simple( cv_al:GetFloat(), function()
|
||||
if IsValid(self) then
|
||||
self:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
self:SetUseType( SIMPLE_USE )
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
self:TargetEnt( true )
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
self:SetPredictable(false)
|
||||
end
|
||||
|
||||
if (self:GetModel() and self:GetModel() == "") then
|
||||
self:SetModel("models/weapons/w_tfa_arrow.mdl")
|
||||
end
|
||||
|
||||
self:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
|
||||
self:DrawShadow(true)
|
||||
end
|
||||
|
||||
function ENT:TargetEnt( init )
|
||||
if self.targent and IsValid(self.targent) then
|
||||
if init then
|
||||
local ent, bone, bonepos, bonerot
|
||||
ent = self.targent
|
||||
bone = self.targent:TranslatePhysBoneToBone(self.targphysbone)
|
||||
self.targbone = bone
|
||||
|
||||
if not ent:GetBoneCount() or ent:GetBoneCount() <= 1 or string.find(ent:GetModel(), "door") then
|
||||
bonepos = ent:GetPos()
|
||||
bonerot = ent:GetAngles()
|
||||
self.enthasbones = false
|
||||
else
|
||||
if ent.SetupBones then
|
||||
ent:SetupBones()
|
||||
end
|
||||
|
||||
bonepos, bonerot = ent:GetBonePosition(bone)
|
||||
self.enthasbones = true
|
||||
end
|
||||
|
||||
if self.enthasbones == true then
|
||||
local gpos = self:GetPos()
|
||||
local bonepos2 = GetBoneCenter(ent, bone)
|
||||
local tmpgts = self.glitchthresholds[ent:LookupBone(bone)] or self.glitchthreshold
|
||||
|
||||
while gpos:Distance(bonepos2) > tmpgts do
|
||||
self:SetPos((gpos + bonepos2) / 2)
|
||||
gpos = (gpos + bonepos2) / 2
|
||||
end
|
||||
end
|
||||
|
||||
if not bonepos then
|
||||
bonepos = ent:GetPos()
|
||||
bonerot = ent:GetAngles()
|
||||
end
|
||||
|
||||
self.posoff, self.angoff = WorldToLocal(self:GetPos(), self:GetAngles(), bonepos, bonerot)
|
||||
end
|
||||
self:FollowBone( self.targent, self.targbone or -1 )
|
||||
self:SetOwner( self.targent )
|
||||
self:SetLocalPos( self.posoff )
|
||||
self:SetLocalAngles( self.angoff )
|
||||
self.HTE = true
|
||||
if SERVER and self.PredictCL then
|
||||
timer.Simple(0.05,function()
|
||||
if IsValid(self) then
|
||||
net.Start("tfaArrowFollow")
|
||||
net.WriteEntity( self )
|
||||
net.WriteEntity( self.targent )
|
||||
net.WriteInt( self.targbone, 8 )
|
||||
net.WriteVector( self.posoff )
|
||||
net.WriteAngle( self.angoff )
|
||||
net.Broadcast()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Think()
|
||||
if CLIENT and not self.PredictCL then return end
|
||||
if IsValid(self.targent) and self.targent.Health and self.targent:Health() <= 0 and self.targent.GetRagdollEntity then
|
||||
local rag = self.targent:GetRagdollEntity()
|
||||
if IsValid(rag) then
|
||||
self.targent = rag
|
||||
self:TargetEnt( false )
|
||||
end
|
||||
end
|
||||
local par = self:GetParent()
|
||||
if IsValid(par) and self.UseMod and not par.HasUseMod then
|
||||
par.HasUseMod = true
|
||||
par.ArrowUseOld = par.ArrowUseOld or par.Use
|
||||
par.Use = function( parent, ... )
|
||||
for _,v in pairs( par:GetChildren() ) do
|
||||
if v.Use then v:Use(...) end
|
||||
end
|
||||
parent:Use( ... )
|
||||
end
|
||||
par:SetUseType( SIMPLE_USE )
|
||||
end
|
||||
if SERVER and not self.HTE then
|
||||
self:TargetEnt( true )
|
||||
end
|
||||
self:NextThink(CurTime())
|
||||
return true
|
||||
end
|
||||
366
addons/tfa_base/lua/tfa/3dscoped_base.lua
Normal file
366
addons/tfa_base/lua/tfa/3dscoped_base.lua
Normal file
@@ -0,0 +1,366 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
local SWEP = {}
|
||||
|
||||
local BaseClass = baseclass.Get("tfa_gun_base")
|
||||
|
||||
local scopecvar = GetConVar("cl_tfa_3dscope")
|
||||
local scopeshadowcvar = GetConVar("cl_tfa_3dscope_overlay")
|
||||
|
||||
local sp = game.SinglePlayer()
|
||||
|
||||
function SWEP:Do3DScope()
|
||||
if scopecvar then
|
||||
return scopecvar:GetBool()
|
||||
else
|
||||
if self:OwnerIsValid() and self:GetOwner().GetInfoNum then
|
||||
return self:GetOwner():GetInfoNum("cl_tfa_3dscope", 1) == 1
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Do3DScopeOverlay()
|
||||
if scopeshadowcvar then
|
||||
return scopeshadowcvar:GetBool()
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:UpdateScopeType(force)
|
||||
if not self.HasInitialized then return end
|
||||
|
||||
local target = self.Secondary_TFA or self.Secondary
|
||||
|
||||
if self.Scoped_3D and force then
|
||||
self.Scoped = true
|
||||
self.Scoped_3D = false
|
||||
|
||||
if target.ScopeZoom_Backup then
|
||||
target.ScopeZoom = target.ScopeZoom_Backup
|
||||
else
|
||||
target.ScopeZoom = 90 / self:GetStatRawL("Secondary.OwnerFOV") -- M9K/Older TFA Base compatibility
|
||||
end
|
||||
|
||||
if self.BoltAction_3D then
|
||||
self.BoltAction = true
|
||||
self.BoltAction_3D = nil
|
||||
|
||||
self:ClearStatCache("BoltAction")
|
||||
end
|
||||
|
||||
self:SetStatRawL("Secondary.OwnerFOV", 90 / self:GetStatRawL("Secondary.ScopeZoom"))
|
||||
self.IronSightsSensitivity = 1
|
||||
end
|
||||
|
||||
if self:Do3DScope() then
|
||||
self.Scoped = false
|
||||
self.Scoped_3D = true
|
||||
|
||||
if not target.ScopeZoom_Backup then
|
||||
target.ScopeZoom_Backup = target.ScopeZoom
|
||||
end
|
||||
|
||||
if self.BoltAction then
|
||||
self.BoltAction_3D = true
|
||||
self.BoltAction = self.BoltAction_Forced or false
|
||||
self.Primary.DisableChambering = true
|
||||
self.FireModeName = "tfa.firemode.bolt"
|
||||
end
|
||||
|
||||
if target.ScopeZoom and target.ScopeZoom > 0 then
|
||||
if CLIENT then
|
||||
self.RTScopeFOV = 90 / target.ScopeZoom * (target.ScopeScreenScale or 0.392592592592592)
|
||||
end
|
||||
|
||||
-- target.IronFOV_Backup = self:GetStatRawL("Secondary.OwnerFOV", 70)
|
||||
-- self:SetStatRawL("Secondary.OwnerFOV", 70)
|
||||
-- self:ClearStatCacheL("Secondary.OwnerFOV")
|
||||
|
||||
if CLIENT then
|
||||
self.IronSightsSensitivity = self:Get3DSensitivity()
|
||||
end
|
||||
|
||||
target.ScopeZoom = false
|
||||
end
|
||||
else
|
||||
self.Scoped = true
|
||||
self.Scoped_3D = false
|
||||
|
||||
if target.ScopeZoom_Backup then
|
||||
target.ScopeZoom = target.ScopeZoom_Backup
|
||||
else
|
||||
target.ScopeZoom = 4
|
||||
end
|
||||
|
||||
if self.BoltAction_3D then
|
||||
self.BoltAction = true
|
||||
self.BoltAction_3D = nil
|
||||
|
||||
self:ClearStatCache("BoltAction")
|
||||
end
|
||||
|
||||
self:SetStatRawL("Secondary.OwnerFOV", 90 / target.ScopeZoom)
|
||||
self.IronSightsSensitivity = 1
|
||||
|
||||
self:ClearStatCacheL("Secondary.OwnerFOV")
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Initialize(...)
|
||||
local unsetA = self.Primary_TFA == nil
|
||||
local unsetB = self.Secondary_TFA == nil
|
||||
|
||||
self.Primary_TFA = self.Primary_TFA or self.Primary
|
||||
self.Secondary_TFA = self.Secondary_TFA or self.Secondary
|
||||
self:UpdateScopeType()
|
||||
|
||||
if unsetA then
|
||||
self.Primary_TFA = nil
|
||||
end
|
||||
|
||||
if unsetB then
|
||||
self.Secondary_TFA = nil
|
||||
end
|
||||
|
||||
BaseClass.Initialize(self, ...)
|
||||
|
||||
timer.Simple(0, function()
|
||||
if IsValid(self) and self:OwnerIsValid() then
|
||||
self:UpdateScopeType()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function SWEP:Deploy(...)
|
||||
if SERVER and self:OwnerIsValid() and sp then
|
||||
self:CallOnClient("UpdateScopeType", "")
|
||||
end
|
||||
|
||||
self:UpdateScopeType()
|
||||
|
||||
timer.Simple(0, function()
|
||||
if IsValid(self) and self:OwnerIsValid() then
|
||||
self:UpdateScopeType()
|
||||
end
|
||||
end)
|
||||
|
||||
return BaseClass.Deploy(self,...)
|
||||
end
|
||||
|
||||
local flipcv = GetConVar("cl_tfa_viewmodel_flip")
|
||||
local cd = {}
|
||||
local crosscol = Color(255, 255, 255, 255)
|
||||
SWEP.RTOpaque = true
|
||||
|
||||
local cv_cc_r = GetConVar("cl_tfa_hud_crosshair_color_r")
|
||||
local cv_cc_g = GetConVar("cl_tfa_hud_crosshair_color_g")
|
||||
local cv_cc_b = GetConVar("cl_tfa_hud_crosshair_color_b")
|
||||
local cv_cc_a = GetConVar("cl_tfa_hud_crosshair_color_a")
|
||||
|
||||
SWEP.defaultscrvec = Vector()
|
||||
|
||||
function SWEP:RTCode(rt, scrw, scrh)
|
||||
local legacy = self.ScopeLegacyOrientation
|
||||
local rttw = ScrW()
|
||||
local rtth = ScrH()
|
||||
|
||||
if not self:VMIV() then return end
|
||||
|
||||
if not self.myshadowmask then
|
||||
self.myshadowmask = surface.GetTextureID(self.ScopeShadow or "vgui/scope_shadowmask_test")
|
||||
end
|
||||
|
||||
if not self.myreticule then
|
||||
self.myreticule = Material(self.ScopeReticule or "scope/gdcw_scopesightonly")
|
||||
end
|
||||
|
||||
if not self.mydirt then
|
||||
self.mydirt = Material(self.ScopeDirt or "vgui/scope_dirt")
|
||||
end
|
||||
|
||||
local vm = self.OwnerViewModel
|
||||
|
||||
if not self.LastOwnerPos then
|
||||
self.LastOwnerPos = self:GetOwner():GetShootPos()
|
||||
end
|
||||
|
||||
local owoff = self:GetOwner():GetShootPos() - self.LastOwnerPos
|
||||
|
||||
self.LastOwnerPos = self:GetOwner():GetShootPos()
|
||||
|
||||
local scrpos
|
||||
|
||||
if self.RTScopeAttachment and self.RTScopeAttachment > 0 then
|
||||
vm:SetupBones()
|
||||
local att = vm:GetAttachment( self.RTScopeAttachment or 1 )
|
||||
if not att then return end
|
||||
local pos = att.Pos - owoff
|
||||
cam.Start3D()
|
||||
cam.End3D()
|
||||
scrpos = pos:ToScreen()
|
||||
else
|
||||
self.defaultscrvec.x = scrw / 2
|
||||
self.defaultscrvec.y = scrh / 2
|
||||
scrpos = self.defaultscrvec
|
||||
end
|
||||
|
||||
scrpos.x = scrpos.x - scrw / 2 + self.ScopeOverlayTransforms[1]
|
||||
scrpos.y = scrpos.y - scrh / 2 + self.ScopeOverlayTransforms[2]
|
||||
scrpos.x = scrpos.x / scrw * 1920
|
||||
scrpos.y = scrpos.y / scrw * 1920
|
||||
scrpos.x = math.Clamp(scrpos.x, -1024, 1024)
|
||||
scrpos.y = math.Clamp(scrpos.y, -1024, 1024)
|
||||
--scrpos.x = scrpos.x * ( 2 - self:GetIronSightsProgress()*1 )
|
||||
--scrpos.y = scrpos.y * ( 2 - self:GetIronSightsProgress()*1 )
|
||||
scrpos.x = scrpos.x * self.ScopeOverlayTransformMultiplier
|
||||
scrpos.y = scrpos.y * self.ScopeOverlayTransformMultiplier
|
||||
|
||||
if not self.scrpos then
|
||||
self.scrpos = scrpos
|
||||
end
|
||||
|
||||
self.scrpos.x = math.Approach(self.scrpos.x, scrpos.x, (scrpos.x - self.scrpos.x) * FrameTime() * 10)
|
||||
self.scrpos.y = math.Approach(self.scrpos.y, scrpos.y, (scrpos.y - self.scrpos.y) * FrameTime() * 10)
|
||||
scrpos = self.scrpos
|
||||
render.OverrideAlphaWriteEnable(true, true)
|
||||
surface.SetDrawColor(color_white)
|
||||
surface.DrawRect(-512, -512, 1024, 1024)
|
||||
render.OverrideAlphaWriteEnable(true, true)
|
||||
|
||||
local ang = legacy and self:GetOwner():EyeAngles() or vm:GetAngles()
|
||||
|
||||
if self.RTScopeAttachment and self.RTScopeAttachment > 0 then
|
||||
vm:SetupBones()
|
||||
local AngPos = vm:GetAttachment( self.RTScopeAttachment )
|
||||
|
||||
if AngPos then
|
||||
ang = AngPos.Ang
|
||||
|
||||
if flipcv:GetBool() then
|
||||
ang.y = -ang.y
|
||||
end
|
||||
|
||||
for _, v in pairs(self.ScopeAngleTransforms) do
|
||||
if v[1] == "P" then
|
||||
ang:RotateAroundAxis(ang:Right(), v[2])
|
||||
elseif v[1] == "Y" then
|
||||
ang:RotateAroundAxis(ang:Up(), v[2])
|
||||
elseif v[1] == "R" then
|
||||
ang:RotateAroundAxis(ang:Forward(), v[2])
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local isang = self:GetStatL("IronSightsAngle") * self:GetIronSightsProgress()
|
||||
|
||||
ang:RotateAroundAxis(ang:Forward(), -isang.z)
|
||||
ang:RotateAroundAxis(ang:Right(), -isang.x)
|
||||
ang:RotateAroundAxis(ang:Up(), -isang.y)
|
||||
|
||||
ang:RotateAroundAxis(ang:Forward(), isang.z)
|
||||
end
|
||||
|
||||
cd.angles = ang
|
||||
cd.origin = self:GetOwner():GetShootPos()
|
||||
|
||||
if not self.RTScopeOffset then
|
||||
self.RTScopeOffset = {0, 0}
|
||||
end
|
||||
|
||||
if not self.RTScopeScale then
|
||||
self.RTScopeScale = {1, 1}
|
||||
end
|
||||
|
||||
local rtow, rtoh = self.RTScopeOffset[1], self.RTScopeOffset[2]
|
||||
local rtw, rth = rttw * self.RTScopeScale[1], rtth * self.RTScopeScale[2]
|
||||
|
||||
cd.x = 0
|
||||
cd.y = 0
|
||||
cd.w = rtw
|
||||
cd.h = rth
|
||||
cd.fov = self.RTScopeFOV
|
||||
cd.drawviewmodel = false
|
||||
cd.drawhud = false
|
||||
render.Clear(0, 0, 0, 255, true, true)
|
||||
render.SetScissorRect(0 + rtow, 0 + rtoh, rtw + rtow, rth + rtoh, true)
|
||||
|
||||
if self:GetIronSightsProgress() > 0.01 and self.Scoped_3D then
|
||||
render.RenderView(cd)
|
||||
end
|
||||
|
||||
render.SetScissorRect(0, 0, rtw, rth, false)
|
||||
render.OverrideAlphaWriteEnable(false, true)
|
||||
cam.Start2D()
|
||||
draw.NoTexture()
|
||||
surface.SetTexture(self.myshadowmask)
|
||||
surface.SetDrawColor(color_white)
|
||||
|
||||
if self:Do3DScopeOverlay() then
|
||||
surface.DrawTexturedRect(scrpos.x + rtow - rtw / 2, scrpos.y + rtoh - rth / 2, rtw * 2, rth * 2)
|
||||
end
|
||||
|
||||
if self.ScopeReticule_CrossCol then
|
||||
crosscol.r = cv_cc_r:GetFloat()
|
||||
crosscol.g = cv_cc_g:GetFloat()
|
||||
crosscol.b = cv_cc_b:GetFloat()
|
||||
crosscol.a = cv_cc_a:GetFloat()
|
||||
surface.SetDrawColor(crosscol)
|
||||
end
|
||||
|
||||
surface.SetMaterial(self.myreticule)
|
||||
local tmpborderw = rtw * (1 - self.ScopeReticule_Scale[1]) / 2
|
||||
local tmpborderh = rth * (1 - self.ScopeReticule_Scale[2]) / 2
|
||||
surface.DrawTexturedRect(rtow + tmpborderw, rtoh + tmpborderh, rtw - tmpborderw * 2, rth - tmpborderh * 2)
|
||||
surface.SetDrawColor(color_black)
|
||||
draw.NoTexture()
|
||||
|
||||
if self:Do3DScopeOverlay() then
|
||||
surface.DrawRect(scrpos.x - 2048 + rtow, -1024 + rtoh, 2048, 2048)
|
||||
surface.DrawRect(scrpos.x + rtw + rtow, -1024 + rtoh, 2048, 2048)
|
||||
surface.DrawRect(-1024 + rtow, scrpos.y - 2048 + rtoh, 2048, 2048)
|
||||
surface.DrawRect(-1024 + rtow, scrpos.y + rth + rtoh, 2048, 2048)
|
||||
end
|
||||
|
||||
surface.SetDrawColor(ColorAlpha(color_black, 255 - 255 * (math.Clamp(self:GetIronSightsProgress() - 0.75, 0, 0.25) * 4)))
|
||||
surface.DrawRect(-1024 + rtow, -1024 + rtoh, 2048, 2048)
|
||||
surface.SetMaterial(self.mydirt)
|
||||
surface.SetDrawColor(ColorAlpha(color_white, 128))
|
||||
surface.DrawTexturedRect(0, 0, rtw, rth)
|
||||
surface.SetDrawColor(ColorAlpha(color_white, 64))
|
||||
surface.DrawTexturedRectUV(rtow, rtoh, rtw, rth, 2, 0, 0, 2)
|
||||
cam.End2D()
|
||||
end
|
||||
|
||||
return SWEP
|
||||
56
addons/tfa_base/lua/tfa/att/am_gib.lua
Normal file
56
addons/tfa_base/lua/tfa/att/am_gib.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "G.I.B Ammunition"
|
||||
ATTACHMENT.ShortName = "GIB" --Abbreviation, 5 chars or less please
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "Always gibs enemies", TFA.Attachments.Colors["+"], "10% more damage", TFA.Attachments.Colors["-"], "20% more recoil", TFA.Attachments.Colors["-"], "10% more spread" }
|
||||
ATTACHMENT.Icon = "entities/tfa_ammo_gib.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.TFADataVersion = TFA.LatestDataVersion
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["DamageType"] = function(wep,stat) return bit.bor( stat or DMG_BULLET, DMG_ALWAYSGIB ) end,
|
||||
["Damage"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["Spread"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.2 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 1.2 end
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
55
addons/tfa_base/lua/tfa/att/am_magnum.lua
Normal file
55
addons/tfa_base/lua/tfa/att/am_magnum.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Magnum Ammunition"
|
||||
ATTACHMENT.ShortName = "MAG" --Abbreviation, 5 chars or less please
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "10% more damage", TFA.Attachments.Colors["-"], "15% more recoil", TFA.Attachments.Colors["-"], "10% more spread" }
|
||||
ATTACHMENT.Icon = "entities/tfa_ammo_magnum.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.TFADataVersion = TFA.LatestDataVersion
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["Damage"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["Spread"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 1.15 end
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
54
addons/tfa_base/lua/tfa/att/am_match.lua
Normal file
54
addons/tfa_base/lua/tfa/att/am_match.lua
Normal file
@@ -0,0 +1,54 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Match Ammunition"
|
||||
ATTACHMENT.ShortName = "Match" --Abbreviation, 5 chars or less please
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "20% lower spread kick", "10% lower recoil", TFA.Attachments.Colors["-"], "20% lower spread recovery" }
|
||||
ATTACHMENT.Icon = "entities/tfa_ammo_match.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.TFADataVersion = TFA.LatestDataVersion
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["SpreadIncrement"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["SpreadRecovery"] = function( wep, stat ) return stat * 0.8 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 0.9 end
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
37
addons/tfa_base/lua/tfa/att/ammo_dragonbreath_shells.lua
Normal file
37
addons/tfa_base/lua/tfa/att/ammo_dragonbreath_shells.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Dragon's Breath Shells"
|
||||
ATTACHMENT.ShortName = "Fire" -- Abbreviation, 5 chars or less please
|
||||
ATTACHMENT.Icon = "entities/dragon_breach_shell.png" -- Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
|
||||
ATTACHMENT.Description = {
|
||||
TFA.Attachments.Colors["+"], "Ignites enemies or objects",
|
||||
TFA.Attachments.Colors["+"], "Stun enemies with fire",
|
||||
TFA.Attachments.Colors["+"], "+8 Pellets",
|
||||
TFA.Attachments.Colors["-"], "+100% Spread", "-50% Damage" }
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["DamageType"] = function(wep,stat) return bit.bor( stat or 0, DMG_BURN ) end,
|
||||
["NumShots"] = function( wep, stat ) return stat + 8 end,
|
||||
["Spread"] = function(wep,stat) return stat * 2 end,
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.5 end,
|
||||
["Damage"] = function(wep,stat) return stat * 0.5 end,
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
38
addons/tfa_base/lua/tfa/att/ammo_flechette_shells.lua
Normal file
38
addons/tfa_base/lua/tfa/att/ammo_flechette_shells.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Flechette Shells" -- Fully attachment name
|
||||
ATTACHMENT.ShortName = "Flechette" -- Abbreviation, 5 chars or less please
|
||||
ATTACHMENT.Icon = "entities/flechetterounds.png" -- Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["="], "Flechette Darts",
|
||||
TFA.AttachmentColors["+"], "Improves the accuracy",
|
||||
TFA.AttachmentColors["+"], "Improves the penetration",
|
||||
TFA.AttachmentColors["+"], "+8 Pellets",
|
||||
TFA.AttachmentColors["-"], "-50% Damage"}
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["IronAccuracy"] = function( wep, stat ) return math.max( stat * 0.75 ) end,
|
||||
["Spread"] = function( wep, stat ) return math.max( stat * 0.75 ) end,
|
||||
["PenetrationMultiplier"] = function( wep, stat ) return stat * 2 end,
|
||||
["NumShots"] = function( wep, stat ) return stat + 8 end,
|
||||
["Damage"] = function(wep,stat) return stat * 0.50 end,
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
57
addons/tfa_base/lua/tfa/att/ar15_ext_mag_60.lua
Normal file
57
addons/tfa_base/lua/tfa/att/ar15_ext_mag_60.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Extended Magazine"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "Increases magazine capacity to 60 rounds."
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/ins2_att_mag_ext_carbine_30rd.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "MAG+"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["mag"] = {
|
||||
["active"] = false,
|
||||
},
|
||||
["mag_ext"] = {
|
||||
["active"] = true,
|
||||
}
|
||||
},
|
||||
["WElements"] = {
|
||||
["mag"] = {
|
||||
["active"] = false,
|
||||
},
|
||||
["mag_ext"] = {
|
||||
["active"] = true,
|
||||
}
|
||||
},
|
||||
|
||||
["Primary"] = {
|
||||
["ClipSize"] = function(wep, val)
|
||||
return wep.Primary.ClipSize_Drum or 60
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
69
addons/tfa_base/lua/tfa/att/ar15_ext_ris_barrel.lua
Normal file
69
addons/tfa_base/lua/tfa/att/ar15_ext_ris_barrel.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "RIS Extended Handguard"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "Activates Laser Sight and GL", "5% lower recoil", TFA.AttachmentColors["-"], "25% lower base accuracy", "Somewhat slower movespeed" }
|
||||
ATTACHMENT.Icon = "entities/ar15_att_ris_e.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "RISE"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["basebarrel"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["risextbarrel"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Bodygroups_W"] = {
|
||||
[2] = 4
|
||||
},
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(1.1, 1.1, 1.1), pos = Vector(0, -13, -0.1), angle = Angle(0, 180, 0) },
|
||||
},
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(0.7, 0.7, 0.7), pos = Vector(14, -1.4, 0.75), angle = Angle(0, 180, 0) },
|
||||
},
|
||||
["Primary"] = {
|
||||
["KickUp"] = function(wep,stat) return stat * 0.9 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.9 end,
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.9 end,
|
||||
["Spread"] = function(wep,stat) return stat * 1.5 end,
|
||||
},
|
||||
["MoveSpeed"] = function(wep,stat) return stat * 0.95 end,
|
||||
["IronSightsMoveSpeed"] = function(wep,stat) return stat * 0.95 end,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
if wep.ViewModelKitOld then
|
||||
wep.ViewModel = wep.ViewModelKitOld
|
||||
if IsValid(wep.OwnerViewModel) then
|
||||
wep.OwnerViewModel:SetModel(wep.ViewModel)
|
||||
timer.Simple(0, function()
|
||||
wep:SendViewModelAnim(ACT_VM_IDLE)
|
||||
end)
|
||||
end
|
||||
wep.ViewModelKitOld = nil
|
||||
end
|
||||
if wep.WorldModelKitOld then
|
||||
wep.WorldModel = wep.WorldModelKitOld
|
||||
wep:SetModel(wep.WorldModel)
|
||||
wep.ViewModelKitOld = nil
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
67
addons/tfa_base/lua/tfa/att/ar15_m16_barrel.lua
Normal file
67
addons/tfa_base/lua/tfa/att/ar15_m16_barrel.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "M16 Handguard"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "60% less vertical recoil", "20% less horizontal recoil", TFA.AttachmentColors["-"], "10% lower base accuracy", "Somewhat slower movespeed" }
|
||||
ATTACHMENT.Icon = "entities/ar15_att_m16_b.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "M16B"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["basebarrel"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["m16barrel"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Bodygroups_W"] = {
|
||||
[2] = 3
|
||||
},
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(1.1, 1.1, 1.1), pos = Vector(0, -13, -0.1), angle = Angle(0, 180, 0) },
|
||||
},
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(0.7, 0.7, 0.7), pos = Vector(14, -1.4, 0.75), angle = Angle(0, 180, 0) },
|
||||
},
|
||||
["Primary"] = {
|
||||
["Spread"] = function(wep,stat) return stat * 1.2 end,
|
||||
["IronAccuracy"] = function(wep,stat) return stat * 0.9 end,
|
||||
},
|
||||
["MoveSpeed"] = function(wep,stat) return stat * 0.95 end,
|
||||
["IronSightsMoveSpeed"] = function(wep,stat) return stat * 0.95 end,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
if wep.ViewModelKitOld then
|
||||
wep.ViewModel = wep.ViewModelKitOld
|
||||
if IsValid(wep.OwnerViewModel) then
|
||||
wep.OwnerViewModel:SetModel(wep.ViewModel)
|
||||
timer.Simple(0, function()
|
||||
wep:SendViewModelAnim(ACT_VM_IDLE)
|
||||
end)
|
||||
end
|
||||
wep.ViewModelKitOld = nil
|
||||
end
|
||||
if wep.WorldModelKitOld then
|
||||
wep.WorldModel = wep.WorldModelKitOld
|
||||
wep:SetModel(wep.WorldModel)
|
||||
wep.ViewModelKitOld = nil
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
62
addons/tfa_base/lua/tfa/att/ar15_m16_stock.lua
Normal file
62
addons/tfa_base/lua/tfa/att/ar15_m16_stock.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "M16 Stock"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "70% less vertical recoil", "30% less horizontal recoil", TFA.AttachmentColors["-"], "Somewhat slower movespeed" }
|
||||
ATTACHMENT.Icon = "entities/ar15_att_m16_s.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "M16S"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["basestock"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["m16stock"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Bodygroups_W"] = {
|
||||
[1] = 1
|
||||
},
|
||||
["Primary"] = {
|
||||
["KickUp"] = function(wep,stat) return stat * 0.3 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.3 end,
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.7 end
|
||||
},
|
||||
["MoveSpeed"] = function(wep,stat) return stat * 0.95 end,
|
||||
["IronSightsMoveSpeed"] = function(wep,stat) return stat * 0.95 end,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
62
addons/tfa_base/lua/tfa/att/ar15_magpul_barrel.lua
Normal file
62
addons/tfa_base/lua/tfa/att/ar15_magpul_barrel.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Magpul Handguard"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "60% less vertical recoil", "20% less horizontal recoil", "10% more ironsight accuracy", TFA.AttachmentColors["-"], "20% lower base accuracy" }
|
||||
ATTACHMENT.Icon = "entities/ar15_att_moe_b.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "MOEB"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["basebarrel"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["magpulbarrel"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Bodygroups_W"] = {
|
||||
[2] = 2
|
||||
},
|
||||
["Primary"] = {
|
||||
["KickUp"] = function(wep,stat) return stat * 0.3 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.3 end,
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.7 end,
|
||||
["Spread"] = function(wep,stat) return stat * 1.1 end,
|
||||
["IronAccuracy"] = function(wep,stat) return stat * 1.1 end
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
60
addons/tfa_base/lua/tfa/att/ar15_magpul_stock.lua
Normal file
60
addons/tfa_base/lua/tfa/att/ar15_magpul_stock.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Magpul Stock"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "30% less vertical recoil", "10% less horizontal recoil" }
|
||||
ATTACHMENT.Icon = "entities/ar15_att_moe_s.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "MOE"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["basestock"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["magpulstock"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Bodygroups_W"] = {
|
||||
[1] = 2
|
||||
},
|
||||
["Primary"] = {
|
||||
["KickUp"] = function(wep,stat) return stat * 0.7 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.7 end,
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.9 end
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
58
addons/tfa_base/lua/tfa/att/ar15_ris_barrel.lua
Normal file
58
addons/tfa_base/lua/tfa/att/ar15_ris_barrel.lua
Normal file
@@ -0,0 +1,58 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "RIS Handguard"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "Activates Laser Sight and GL", TFA.AttachmentColors["-"], "5% lower base accuracy" }
|
||||
ATTACHMENT.Icon = "entities/ar15_att_ris.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "RIS"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["basebarrel"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["risbarrel"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Bodygroups_W"] = {
|
||||
[2] = 1
|
||||
},
|
||||
["Primary"] = {
|
||||
["Spread"] = function(wep,stat) return stat * 0.8 end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
45
addons/tfa_base/lua/tfa/att/ar15_si_folded.lua
Normal file
45
addons/tfa_base/lua/tfa/att/ar15_si_folded.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Folded Sights"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "Easier to aim", TFA.AttachmentColors["-"], "5% higher zoom time" }
|
||||
ATTACHMENT.Icon = "entities/ins2_att_fsi.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "FSI"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["sights_folded"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["sight_fsi"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["WElements"] = {
|
||||
["sights_folded"] = {
|
||||
["active"] = false
|
||||
},
|
||||
["sight_fsi"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["IronSightsPos"] = function( wep, val ) return wep.IronSightsPos end,
|
||||
["IronSightsAng"] = function( wep, val ) return wep.IronSightsAng end,
|
||||
["IronSightTime"] = function( wep, val ) return val * 1.05 end
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
101
addons/tfa_base/lua/tfa/att/at_grip.lua
Normal file
101
addons/tfa_base/lua/tfa/att/at_grip.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Foregrip"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "30% lower H-recoil", TFA.Attachments.Colors["+"], "10% lower V-recoil", TFA.Attachments.Colors["-"], "10% higher spread recovery" }
|
||||
ATTACHMENT.Icon = "entities/tfa_si_eotech.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "FGRIP"
|
||||
ATTACHMENT.TFADataVersion = TFA.LatestDataVersion
|
||||
|
||||
local defaultbl = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) }
|
||||
|
||||
local function LerpBoneMods( t, b1, b2 )
|
||||
local tbl = table.Copy(b1)
|
||||
for k,v in pairs(b2) do
|
||||
if not tbl[k] then
|
||||
tbl[k] = table.Copy(defaultbl)
|
||||
end
|
||||
tbl[k].scale = LerpVector( t, tbl[k].scale, v.scale )
|
||||
tbl[k].pos = LerpVector( t, tbl[k].pos, v.pos )
|
||||
tbl[k].angle = LerpAngle( t, tbl[k].angle, v.angle )
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelElements"] = {
|
||||
["foregrip"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["WorldModelElements"] = {
|
||||
["foregrip"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Primary"] = {
|
||||
["SpreadRecovery"] = function(wep,stat) return stat * 1.1 end,
|
||||
["KickUp"] = function(wep,stat) return stat * 0.9 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.9 end,
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.7 end,
|
||||
},
|
||||
["ViewModelBoneMods"] = function(wep,tbl)
|
||||
if wep.GripBoneMods then
|
||||
wep.GripFactor = wep.GripFactor or 0
|
||||
local CanGrip = true
|
||||
if wep.GripBadActivities and wep.GripBadActivities[ wep:GetLastActivity() ] and wep:VMIV() then
|
||||
local cyc = wep.OwnerViewModel:GetCycle()
|
||||
if cyc > wep.GripBadActivities[ wep:GetLastActivity() ][1] and cyc < wep.GripBadActivities[ wep:GetLastActivity() ][2] then
|
||||
CanGrip = false
|
||||
end
|
||||
end
|
||||
wep.GripFactor = math.Approach( wep.GripFactor, CanGrip and 1 or 0, ( ( CanGrip and 1 or 0 ) - wep.GripFactor ) * TFA.FrameTime() * ( wep.GripLerpSpeed or 20 ) )
|
||||
return LerpBoneMods( wep.GripFactor, tbl, wep.GripBoneMods )
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.GripFactor = 0
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.GripFactor = 0
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
66
addons/tfa_base/lua/tfa/att/base.lua
Normal file
66
addons/tfa_base/lua/tfa/att/base.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
-- ATTACHMENT.TFADataVersion = 1 -- Uncomment this in your attachment file
|
||||
-- If it is undefined, if fallback to 0 and WeaponTable gets migrated like SWEPs do
|
||||
|
||||
ATTACHMENT.Name = "Base Attachment"
|
||||
ATTACHMENT.ShortName = nil --Abbreviation, 5 chars or less please
|
||||
ATTACHMENT.Description = {} --TFA.Attachments.Colors["+"], "Does something good", TFA.Attachments.Colors["-"], "Does something bad" }
|
||||
ATTACHMENT.Icon = nil --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.WeaponTable = {} --put replacements for your SWEP talbe in here e.g. ["Primary"] = {}
|
||||
|
||||
ATTACHMENT.DInv2_GridSizeX = nil -- DInventory/2 Specific. Determines attachment's width in grid.
|
||||
ATTACHMENT.DInv2_GridSizeY = nil -- DInventory/2 Specific. Determines attachment's height in grid.
|
||||
ATTACHMENT.DInv2_Volume = nil -- DInventory/2 Specific. Determines attachment's volume in liters.
|
||||
ATTACHMENT.DInv2_Mass = nil -- DInventory/2 Specific. Determines attachment's mass in kilograms.
|
||||
ATTACHMENT.DInv2_StackSize = nil -- DInventory/2 Specific. Determines attachment's maximal stack size.
|
||||
|
||||
ATTACHMENT.TFADataVersion = nil -- TFA.LatestDataVersion, specifies version of TFA Weapon Data this attachment utilize in `WeaponTable`
|
||||
-- 0 is original, M9K-like data, and is the fallback if `TFADataVersion` is undefined
|
||||
|
||||
function ATTACHMENT:CanAttach(wep)
|
||||
return true --can be overridden per-attachment
|
||||
end
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
68
addons/tfa_base/lua/tfa/att/br_supp.lua
Normal file
68
addons/tfa_base/lua/tfa/att/br_supp.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
-- Copyright (c) 2018-2020 TFA Base Devs
|
||||
|
||||
-- Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
-- of this software and associated documentation files (the "Software"), to deal
|
||||
-- in the Software without restriction, including without limitation the rights
|
||||
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
-- copies of the Software, and to permit persons to whom the Software is
|
||||
-- furnished to do so, subject to the following conditions:
|
||||
|
||||
-- The above copyright notice and this permission notice shall be included in all
|
||||
-- copies or substantial portions of the Software.
|
||||
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
-- SOFTWARE.
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Suppressor"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "Less firing noise", TFA.Attachments.Colors["-"], "10% less spread", TFA.Attachments.Colors["-"], "5% less damage", TFA.Attachments.Colors["-"], "10% less vertical recoil" }
|
||||
ATTACHMENT.Icon = "entities/tfa_br_supp.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SUPP"
|
||||
ATTACHMENT.TFADataVersion = TFA.LatestDataVersion
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelElements"] = {
|
||||
["suppressor"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["WorldModelElements"] = {
|
||||
["suppressor"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Primary"] = {
|
||||
["Damage"] = function(wep,stat) return stat * 0.95 end,
|
||||
["KickUp"] = function(wep,stat) return stat * 0.9 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.9 end,
|
||||
["Spread"] = function(wep,stat) return stat * 0.9 end,
|
||||
["IronAccuracy"] = function(wep,stat) return stat * 0.9 end,
|
||||
["Sound"] = function(wep,stat) return wep.Primary.SilencedSound or stat end
|
||||
},
|
||||
["MuzzleFlashEffect"] = "tfa_muzzleflash_silenced",
|
||||
["MuzzleAttachmentMod"] = function(wep,stat) return wep.MuzzleAttachmentSilenced or stat end
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
35
addons/tfa_base/lua/tfa/att/fas2tfa_acc_bayonet.lua
Normal file
35
addons/tfa_base/lua/tfa/att/fas2tfa_acc_bayonet.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Unfolded Bayonet"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["="], "Use with suitzoom bind (+zoom)",
|
||||
TFA.AttachmentColors["+"], "+75% melee damage",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2sksunfld.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "UNFLD"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[1] = 2},
|
||||
["Bodygroups_W"] = {[2] = 3},
|
||||
["Secondary"] = {
|
||||
["BashDamage"] = function( wep, stat ) return stat * 1.75 end,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
28
addons/tfa_base/lua/tfa/att/fas2tfa_acc_bayonetfolded.lua
Normal file
28
addons/tfa_base/lua/tfa/att/fas2tfa_acc_bayonetfolded.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Folded Bayonet"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = {}
|
||||
ATTACHMENT.Icon = "entities/tfafas2sksfld.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "FOLD"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[1] = 1},
|
||||
["Bodygroups_W"] = {[2] = 1},
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
32
addons/tfa_base/lua/tfa/att/fas2tfa_ammo_frag.lua
Normal file
32
addons/tfa_base/lua/tfa/att/fas2tfa_ammo_frag.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Magnum Shells"
|
||||
ATTACHMENT.ShortName = "MGNM" --Abbreviation, 5 chars or less please
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "Increases critical damage", "+60% damage", TFA.Attachments.Colors["-"], "Decreases hit chance at range", "-5 pellets" }
|
||||
ATTACHMENT.Icon = "entities/tfa_ammo_fragshell.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["StaticRecoilFactor"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["PenetrationMultiplier"] = function( wep, stat ) return wep.Primary.NumShots * stat * 1 end,
|
||||
["Damage"] = function(wep,stat) return stat * 1.60 end,
|
||||
["NumShots"] = function(wep,stat) return stat / 2 end
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
37
addons/tfa_base/lua/tfa/att/fas2tfa_ammo_incn.lua
Normal file
37
addons/tfa_base/lua/tfa/att/fas2tfa_ammo_incn.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Pyro Shells"
|
||||
ATTACHMENT.ShortName = "PYRO" --Abbreviation, 5 chars or less please
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "Ignites flammable objects", "Fun with VFire", "+7 pellets", "-35% overall recoil", TFA.Attachments.Colors["-"], "+200% spread", "-55% total damage" }
|
||||
ATTACHMENT.Icon = "entities/tfa_ammo_incenshell.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["KickUp"] = function( wep, stat ) return stat * .65 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * .65 end,
|
||||
["KickHorizontal"] = function( wep, stat ) return stat * .65 end,
|
||||
["StaticRecoilFactor"] = function( wep, stat ) return stat * .8 end,
|
||||
["DamageType"] = function(wep,stat) return bit.bor( stat or 0, DMG_BURN ) end,
|
||||
["Spread"] = function(wep,stat) return stat * 2 end,
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 3 end,
|
||||
["Damage"] = function(wep,stat) return stat / 2.55 end,
|
||||
["NumShots"] = function(wep,stat) return stat * 1.7 end
|
||||
}
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
43
addons/tfa_base/lua/tfa/att/fas2tfa_ammo_slug.lua
Normal file
43
addons/tfa_base/lua/tfa/att/fas2tfa_ammo_slug.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Slug Shells"
|
||||
ATTACHMENT.ShortName = "SLUG" --Abbreviation, 5 chars or less please
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.Attachments.Colors["+"], "Increases accuracy", "Standard with the KS23's rifled barrel", TFA.Attachments.Colors["-"], "-20% total damage", "-9 pellets" }
|
||||
ATTACHMENT.Icon = "entities/tfa_ammo_slug.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Primary"] = {
|
||||
["Damage"] = function( wep, stat ) return wep.Primary.NumShots * stat * 0.8 end,
|
||||
["PenetrationMultiplier"] = function( wep, stat ) return wep.Primary.NumShots * stat * 3 end,
|
||||
["NumShots"] = function( wep, stat ) return 1, true end,
|
||||
["Spread"] = function( wep, stat ) return stat - 0.025 end,
|
||||
["IronAccuracy"] = function( wep, stat ) return stat - 0.04 end,
|
||||
["Range"] = function( wep, stat ) return stat + 100 * 39.370 end
|
||||
},
|
||||
["MuzzleFlashEffect"] = "tfa_muzzleflash_generic",
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.Type = "Pump-action carbine, 23×75mmR"
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.Type = "Pump-action shotgun, 23×75mmR"
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
41
addons/tfa_base/lua/tfa/att/fas2tfa_g3_adjstock.lua
Normal file
41
addons/tfa_base/lua/tfa/att/fas2tfa_g3_adjstock.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Adjustable Stock"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "-10% overall recoil", "-30% aim recoil",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2adjstk.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "ADJ."
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[2] = 1},
|
||||
["Bodygroups_W"] = {[2] = 2},
|
||||
["Primary"] = {
|
||||
["KickUp"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["KickHorizontal"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["IronRecoilMultiplier"] = function( wep, stat ) return stat * 0.7 end,
|
||||
["StaticRecoilFactor"] = function( wep, stat ) return stat * 0.9 end,
|
||||
},
|
||||
["BlowbackVector"] = Vector(0,-3,-.02),
|
||||
--["IronSightsSensitivity"] = function( wep, stat ) return stat * 0.975 end,
|
||||
--["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 0.85 end,
|
||||
|
||||
}
|
||||
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
50
addons/tfa_base/lua/tfa/att/fas2tfa_g3_cqb.lua
Normal file
50
addons/tfa_base/lua/tfa/att/fas2tfa_g3_cqb.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "CQB Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+10% movement speed",
|
||||
TFA.AttachmentColors["-"], "+20% recoil", "-20% accuracy"
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2g3barcqb.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "CQB"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.8, .8, .8), pos = Vector(-14.75, .85, .41), angle = Angle(-90, 90, 0) },
|
||||
["A_Underbarrel"] = { scale = Vector(.6, .6, .6), pos = Vector(-12.5, .85, 3.41), angle = Angle(-90, 90, 0) },
|
||||
["A_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(9, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(6.5, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["Left Polex Phalange1"] = { scale = Vector(1, 1, 1), pos = Vector(0, 0, 0), angle = Angle(-12, 1, 25) },
|
||||
},
|
||||
["Bodygroups_V"] = {[1] = 1},
|
||||
["Bodygroups_W"] = {[1] = 1},
|
||||
["IronSightsPos"] = Vector(-2.658, -5, -.022),
|
||||
["IronSightsAng"] = Vector(0.515, 0.002, 0),
|
||||
["Primary"] = {
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["Spread"] = function( wep, stat ) return stat * 1.2 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.2 end,
|
||||
["Sound"] = function(wep,stat) return "FAS2TFA_G3.2" or stat end,
|
||||
["SilencedSound"] = function(wep,stat) return "FAS2TFA_G3.4" or stat end,
|
||||
},
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsSensitivity"] = function( wep, stat ) return stat * 0.9 end,
|
||||
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
44
addons/tfa_base/lua/tfa/att/fas2tfa_g3_fullstock.lua
Normal file
44
addons/tfa_base/lua/tfa/att/fas2tfa_g3_fullstock.lua
Normal file
@@ -0,0 +1,44 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Full Stock"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+20% accuracy", "-20% overall recoil", "-70% aim recoil",
|
||||
TFA.AttachmentColors["-"], "-10% aim speed",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2g3fulstk.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "FULL"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[2] = 2},
|
||||
["Bodygroups_W"] = {[2] = 1},
|
||||
["Primary"] = {
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 0.5 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 0.8 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 0.8 end,
|
||||
["KickHorizontal"] = function( wep, stat ) return stat * 0.8 end,
|
||||
["IronRecoilMultiplier"] = function( wep, stat ) return stat * 0.3 end,
|
||||
["StaticRecoilFactor"] = function( wep, stat ) return stat * 0.9 end,
|
||||
},
|
||||
["BlowbackVector"] = Vector(0,-2.25,.005),
|
||||
["IronSightTime"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 0.975 end,
|
||||
["IronSightsSensitivity"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 0.9 end,
|
||||
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
42
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_7rnd.lua
Normal file
42
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_7rnd.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Extended Tube, 6rnd"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "Increases internal magazine capacity", TFA.Attachments.Colors["-"],"Attaching & detaching empties magazine",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/ks23tube.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "+MAG"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[2] = 1},
|
||||
["Bodygroups_W"] = {[2] = 1},
|
||||
["Primary"] = {
|
||||
["ClipSize"] = function(wep, val)
|
||||
return wep.Primary.ClipSize_ExtRifle or 6
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
37
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_plrclr.lua
Normal file
37
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_plrclr.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Colorable Stock"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "Corresponds with your gmod physgun color",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/ks23plrstock.png"
|
||||
ATTACHMENT.ShortName = "RGB"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Skin"] = 1,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep:SetSkin(1)
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep:SetSkin(0)
|
||||
end
|
||||
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
52
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_short.lua
Normal file
52
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_short.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "KS23M Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+10% movement speed",
|
||||
TFA.AttachmentColors["-"], "+35% recoil", "+170% spread",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/ks23short.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SBS"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.85, .85, .85), pos = Vector(13.75, 13.55, 4.27), angle = Angle(180, -90, 90) },
|
||||
["A_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(-9, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(-5, 0, 0), angle = Angle(0, 0, 0) }, },
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(.9, .9, .9), pos = Vector(0, 8.25, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
["VElements"] = {
|
||||
["short"] = {
|
||||
["active"] = true
|
||||
},
|
||||
},
|
||||
["IronSightsPos"] = Vector(-2.7285, -7.035, 1.847),
|
||||
["IronSightsAng"] = Vector(1.05, 0.015, 0),
|
||||
["Bodygroups_V"] = {[1] = 1},
|
||||
["Bodygroups_W"] = {[1] = 1},
|
||||
["Primary"] = {
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["Spread"] = function(wep,stat) return stat * 1.7 end,
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.7 end,
|
||||
},
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsSensitivity"] = function( wep, stat ) return stat * 0.9 end,
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
65
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_supp.lua
Normal file
65
addons/tfa_base/lua/tfa/att/fas2tfa_ks23_supp.lua
Normal file
@@ -0,0 +1,65 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Suppressor"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "Less firing noise", TFA.AttachmentColors["+"], "+10% vertical recoil", "-10% spread", TFA.AttachmentColors["-"], "-30% damage" }
|
||||
ATTACHMENT.Icon = "entities/ins2_att_br_supp.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SUPP"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["suppressor"] = {
|
||||
["active"] = true
|
||||
},
|
||||
["standard_barrel"] = {
|
||||
["active"] = false
|
||||
}
|
||||
},
|
||||
["WElements"] = {
|
||||
["suppressor"] = {
|
||||
["active"] = true
|
||||
},
|
||||
["standard_barrel"] = {
|
||||
["active"] = false
|
||||
}
|
||||
},
|
||||
["IronSightsPos"] = Vector(-2.7285, -7.035, 1.8975),
|
||||
["IronSightsAng"] = Vector(-.2, 0.015, 0),
|
||||
["Primary"] = {
|
||||
["Damage"] = function(wep,stat) return stat * 0.7 end,
|
||||
["KickUp"] = function(wep,stat) return stat * 0.9 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.9 end,
|
||||
["Spread"] = function(wep,stat) return stat * 0.9 end,
|
||||
["IronAccuracy"] = function(wep,stat) return stat * 0.9 end,
|
||||
["Sound"] = function(wep,stat) return wep.Primary.SilencedSound or stat end,
|
||||
},
|
||||
["MuzzleFlashEffect"] = "tfa_muzzleflash_silenced",
|
||||
["MuzzleAttachmentMod"] = function(wep,stat) return wep.MuzzleAttachmentSilenced or stat end,
|
||||
["Silenced"] = true,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.Silenced = true
|
||||
wep:SetSilenced(wep.Silenced)
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.Silenced = false
|
||||
wep:SetSilenced(wep.Silenced)
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
35
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_adjstock.lua
Normal file
35
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_adjstock.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Retractable Stock"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+5% aiming speed", "-15% spread"
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2adjstk.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "RETR"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[5] = 1},
|
||||
["Bodygroups_W"] = {[2] = 1},
|
||||
["Primary"] = {
|
||||
["Spread"] = function(wep,stat) return stat * .85 end,
|
||||
},
|
||||
["BlowbackVector"] = Vector(0,-1.5,-.075),
|
||||
["IronSightTime"] = function( wep, stat ) return stat * 1.05 end,
|
||||
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
140
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_pdw.lua
Normal file
140
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_pdw.lua
Normal file
@@ -0,0 +1,140 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "MP5K Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "Increases RPM to 975", "+5% movement speed",
|
||||
TFA.AttachmentColors["-"], "+20% recoil",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2mp5k.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "PDW"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.75, 1, .75), pos = Vector(10.25, .82, 0), angle = Angle(180, -90, 0) },
|
||||
["A_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(-3.75, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(-2, 0, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(-4, 0, -.29), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
|
||||
["Bodygroups_V"] = {[1] = 1, [3] = 1, [4] = 2},
|
||||
["Bodygroups_W"] = {[1] = 1},
|
||||
|
||||
["Animations"] = {
|
||||
["draw"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_deploy"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["holster"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_holster"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["idle"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_idle"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["idle_empty"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_idle"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["shoot1"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_shoot"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["reload"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_reload"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["reload_empty"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "mp5k_"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "mp5k_reload_empty"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
},
|
||||
|
||||
["Primary"] = {
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.20 end,
|
||||
["Sound"] = function(wep,stat) return "FAS2TFA_MP5.2" or stat end,
|
||||
["SilencedSound"] = function(wep,stat) return "FAS2TFA_MP5.4" or stat end,
|
||||
["RPM"] = function( wep, stat ) return stat + 125 end,
|
||||
},
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 1.05 end,
|
||||
["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 1.05 end,
|
||||
["IronSightsSensitivity"] = function( wep, stat ) return stat * 0.95 end,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach( wep )
|
||||
if TFA.Enum.ReadyStatus[wep:GetStatus()] then
|
||||
wep:ChooseIdleAnim()
|
||||
if game.SinglePlayer() then
|
||||
wep:CallOnClient("ChooseIdleAnim","")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
37
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_pdwstock.lua
Normal file
37
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_pdwstock.lua
Normal file
@@ -0,0 +1,37 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "PDW Stock"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+10% aiming speed", "-5% spread",
|
||||
TFA.AttachmentColors["-"], "+10% horizontal recoil",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2pdwstk.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "PDW"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[5] = 2},
|
||||
["Bodygroups_W"] = {[2] = 2},
|
||||
["Primary"] = {
|
||||
["KickHorizontal"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["Spread"] = function( wep, stat ) return stat * .95 end,
|
||||
},
|
||||
["BlowbackVector"] = Vector(0,-1.5,-.075),
|
||||
["IronSightTime"] = function( wep, stat ) return stat * 1.10 end,
|
||||
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
50
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_sd.lua
Normal file
50
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_sd.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "MP5SD Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["-"], "Decreases RPM to 800",
|
||||
TFA.AttachmentColors["+"], "-15% recoil",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2mp5sd.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SD"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.75, 1, .75), pos = Vector(10.25, .82, 0), angle = Angle(180, -90, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(-1.5, 0, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(.75, .75, .75), pos = Vector(-3, 0, -.29), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
|
||||
["Bodygroups_V"] = {[1] = 2, [3] = 1, [4] = 3},
|
||||
["Bodygroups_W"] = {[1] = 2},
|
||||
|
||||
["Primary"] = {
|
||||
["KickUp"] = function( wep, stat ) return stat * .85 end,
|
||||
["SilencedSound"] = function(wep,stat) return "FAS2TFA_MP5.3" or stat end,
|
||||
["RPM"] = function( wep, stat ) return stat - 50 end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
64
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_supp.lua
Normal file
64
addons/tfa_base/lua/tfa/att/fas2tfa_mp5_supp.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Suppressor"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["+"], "Less firing noise", TFA.AttachmentColors["+"], "-5% overall recoil", "-10% spread", TFA.AttachmentColors["-"], "-7% damage" }
|
||||
ATTACHMENT.Icon = "entities/ins2_att_br_supp.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SUPP"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["VElements"] = {
|
||||
["suppressor"] = {
|
||||
["active"] = true
|
||||
},
|
||||
["standard_barrel"] = {
|
||||
["active"] = false
|
||||
}
|
||||
},
|
||||
["WElements"] = {
|
||||
["suppressor"] = {
|
||||
["active"] = true
|
||||
},
|
||||
["standard_barrel"] = {
|
||||
["active"] = false
|
||||
}
|
||||
},
|
||||
["Primary"] = {
|
||||
["Damage"] = function(wep,stat) return stat * 0.93 end,
|
||||
["KickUp"] = function(wep,stat) return stat * 0.95 end,
|
||||
["KickDown"] = function(wep,stat) return stat * 0.95 end,
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.95 end,
|
||||
["Spread"] = function(wep,stat) return stat * 0.9 end,
|
||||
["IronAccuracy"] = function(wep,stat) return stat * 0.9 end,
|
||||
["Sound"] = function(wep,stat) return wep.Primary.SilencedSound or stat end,
|
||||
},
|
||||
["MuzzleFlashEffect"] = "tfa_muzzleflash_silenced",
|
||||
["MuzzleAttachmentMod"] = function(wep,stat) return wep.MuzzleAttachmentSilenced or stat end,
|
||||
["Silenced"] = true,
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.Silenced = true
|
||||
wep:SetSilenced(wep.Silenced)
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.Silenced = false
|
||||
wep:SetSilenced(wep.Silenced)
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
57
addons/tfa_base/lua/tfa/att/fas2tfa_sg550_cqb.lua
Normal file
57
addons/tfa_base/lua/tfa/att/fas2tfa_sg550_cqb.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "553 Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+5% movement speed",
|
||||
TFA.AttachmentColors["-"], "+15% overall recoil",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/sgshort.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "CQB"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.86, 1, .86), pos = Vector(1.672, -7.25, 2.825), angle = Angle(180, 0, 180) },
|
||||
["A_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(-11, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(-9, 0, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(.9, .9, .9), pos = Vector(-13, .05, -.1), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
|
||||
["VElements"] = { ["cqb"] = { ["active"] = true},
|
||||
|
||||
},
|
||||
["IronSightsPos"] = Vector(-2.3012, -2.5, .956),
|
||||
["IronSightsAng"] = Vector(-.15, 0.008, 0),
|
||||
["Bodygroups_V"] = {[3] = 1, [4] = 2, [8] = 1, [7] = 1},
|
||||
["Bodygroups_W"] = {[1] = 1, [3] = 2, [4] = 1},
|
||||
|
||||
["Primary"] = {
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["KickHorizontal"] = function( wep, stat ) return stat * 1.15 end,
|
||||
["StaticRecoilFactor"] = function( wep, stat ) return stat * 1.05 end,
|
||||
["Sound"] = function(wep,stat) return "FAS2TFA_SG550.3" or stat end,
|
||||
["SilencedSound"] = function(wep,stat) return "FAS2TFA_SG550.4" or stat end,
|
||||
},
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 1.4 end,
|
||||
["IronSightsSensitivity"] = function( wep, stat ) return stat * 0.6 end,
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
55
addons/tfa_base/lua/tfa/att/fas2tfa_sg550_hbar.lua
Normal file
55
addons/tfa_base/lua/tfa/att/fas2tfa_sg550_hbar.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "550-1 Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "-15% vertical recoil", "+35% aiming accuracy",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/ins2_att_br_heavy.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "HBAR"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.88, 1, .88), pos = Vector(1.672, -24.5, 2.825), angle = Angle(180, 0, 180) },
|
||||
["A_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(5, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(10, 0, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(.9, .9, .9), pos = Vector(5, .05, -.1), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
|
||||
["Bodygroups_V"] = {[4] = 1},
|
||||
["Bodygroups_W"] = {[3] = 1},
|
||||
["Primary"] = {
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.35 end,
|
||||
["IronRecoilMultiplier"] = function( wep, stat ) return stat * 1.35 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["KickDown"] = function( wep, stat ) return stat * 0.9 end,
|
||||
},
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 0.95 end,
|
||||
["MuzzleFlashEffect"] = "tfa_muzzleflash_generic",
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.Type = "Select-fire sniper rifle, 5.56×45mm"
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.Type = "Assault rifle, 5.56×45mm"
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
35
addons/tfa_base/lua/tfa/att/fas2tfa_sg550_prstock.lua
Normal file
35
addons/tfa_base/lua/tfa/att/fas2tfa_sg550_prstock.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Precision Stock"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "-10% horizontal recoil",
|
||||
TFA.AttachmentColors["-"], "+25% aiming speed",
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/sgstk2.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "+STK"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[1] = 1},
|
||||
["Bodygroups_W"] = {[2] = 1},
|
||||
["Primary"] = {
|
||||
["KickHorizontal"] = function(wep,stat) return stat * 0.88 end,
|
||||
},
|
||||
["IronSightTime"] = function( wep, stat ) return stat * 1.25 end,
|
||||
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
45
addons/tfa_base/lua/tfa/att/fas2tfa_sg55x_scope.lua
Normal file
45
addons/tfa_base/lua/tfa/att/fas2tfa_sg55x_scope.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "SG550/1 Scope"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["="], "10x zoom", TFA.AttachmentColors["-"], "40% higher zoom time", TFA.AttachmentColors["-"], "10% slower aimed walking" }
|
||||
ATTACHMENT.Icon = "entities/ins2_si_mx4.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SG"
|
||||
ATTACHMENT.Base = "ins2_scope_base"
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[5] = 1, [7] = 1},
|
||||
["BlowbackVector"] = Vector(0,-1,0),
|
||||
["VElements"] = {
|
||||
["rail_sights"] = {
|
||||
["active"] = false,},
|
||||
["pso1_lens"] = {
|
||||
["active"] = true,
|
||||
},
|
||||
},
|
||||
["WElements"] = {
|
||||
["scope_mx4"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Secondary"] = {
|
||||
|
||||
["ScopeZoom"] = function(wep, val) return 10 end
|
||||
},
|
||||
["INS2_SightSuffix"] = "SG"
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
64
addons/tfa_base/lua/tfa/att/fas2tfa_sks_20rnd.lua
Normal file
64
addons/tfa_base/lua/tfa/att/fas2tfa_sks_20rnd.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Detachable 20rnd"
|
||||
ATTACHMENT.Description = {}
|
||||
ATTACHMENT.Icon = "entities/tfafas2sks20rnd.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "20DM"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[2] = 2},
|
||||
["Bodygroups_W"] = {[1] = 1},
|
||||
["Animations"] = {
|
||||
["reload"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "_stanag"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "Reload_30_nmc"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["reload_empty"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "_stanag"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "Reload_30_empty_nmc"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
},
|
||||
["Primary"] = {
|
||||
["ClipSize"] = function(wep, val)
|
||||
return wep.Primary.ClipSize_ExtRifle or 20
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
|
||||
|
||||
62
addons/tfa_base/lua/tfa/att/fas2tfa_sks_30rnd.lua
Normal file
62
addons/tfa_base/lua/tfa/att/fas2tfa_sks_30rnd.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Detachable 30rnd"
|
||||
ATTACHMENT.Description = {}
|
||||
ATTACHMENT.Icon = "entities/tfafas2sks30rnd.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "30DM"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[2] = 3},
|
||||
["Bodygroups_W"] = {[1] = 2},
|
||||
["Animations"] = {
|
||||
["reload"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "_stanag"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "Reload_30_nmc"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["reload_empty"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "_stanag"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "Reload_30_empty_nmc"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
},
|
||||
["Primary"] = {
|
||||
["ClipSize"] = function(wep, val)
|
||||
return wep.Primary.ClipSize_ExtRifle or 30
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
63
addons/tfa_base/lua/tfa/att/fas2tfa_sks_40rnd.lua
Normal file
63
addons/tfa_base/lua/tfa/att/fas2tfa_sks_40rnd.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Detachable 40rnd"
|
||||
ATTACHMENT.Description = {}
|
||||
ATTACHMENT.Icon = "entities/tfafas2sks40rnd.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "40RPK"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["CanJam"] = true,
|
||||
["Bodygroups_V"] = {[2] = 4},
|
||||
["Bodygroups_W"] = {[1] = 3},
|
||||
["Animations"] = {
|
||||
["reload"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "_stanag"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "Reload_30_nmc"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
["reload_empty"] = function(wep, _val)
|
||||
local val = table.Copy(_val)
|
||||
if val.type == TFA.Enum.ANIMATION_SEQ then
|
||||
val.value = val.value .. "_stanag"
|
||||
else
|
||||
val.type = TFA.Enum.ANIMATION_SEQ --Sequence or act
|
||||
val.value = "Reload_30_empty_nmc"
|
||||
end
|
||||
return (wep:CheckVMSequence(val.value) and val or _val), true, true
|
||||
end,
|
||||
},
|
||||
["Primary"] = {
|
||||
["ClipSize"] = function(wep, val)
|
||||
return wep.Primary.ClipSize_ExtRifle or 40
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep:Unload()
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
35
addons/tfa_base/lua/tfa/att/fas2tfa_sks_bf.lua
Normal file
35
addons/tfa_base/lua/tfa/att/fas2tfa_sks_bf.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Full-auto conversion"
|
||||
ATTACHMENT.Description = {}
|
||||
ATTACHMENT.Icon = nil --"entities/ins2_att_mag_ext_rifle_30rd.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "AUTO"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
}
|
||||
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.Primary.Automatic = true
|
||||
wep.Type = "Automatic rifle, 7.62×39mm"
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.Primary.Automatic = false
|
||||
wep.Type = "Semi-automatic rifle, 7.62×39mm"
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
50
addons/tfa_base/lua/tfa/att/fas2tfa_svd_sbr.lua
Normal file
50
addons/tfa_base/lua/tfa/att/fas2tfa_svd_sbr.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "SBR Barrel"
|
||||
ATTACHMENT.Description = {
|
||||
TFA.AttachmentColors["+"], "+10% movement speed",
|
||||
TFA.AttachmentColors["-"], "+20% recoil", "-30% accuracy", "-5% damage"
|
||||
}
|
||||
ATTACHMENT.Icon = "entities/tfafas2svdsbr.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "SBR"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["ViewModelBoneMods"] = {
|
||||
["A_Suppressor"] = { scale = Vector(.8, .8, .8), pos = Vector(9, .5, 0), angle = Angle(0, -90, 0) },
|
||||
["A_Muzzle"] = { scale = Vector(1, 1, 1), pos = Vector(-13.8, 0, 0), angle = Angle(0, 0, 0) },
|
||||
["A_MuzzleSupp"] = { scale = Vector(1, 1, 1), pos = Vector(-10.5, 0, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
["WorldModelBoneMods"] = {
|
||||
["ATTACH_Muzzle"] = { scale = Vector(.9, .9, .9), pos = Vector(-14, .2, 0), angle = Angle(0, 0, 0) },
|
||||
},
|
||||
["Bodygroups_V"] = {[2] = 1},
|
||||
["Bodygroups_W"] = {[1] = 1},
|
||||
["Primary"] = {
|
||||
["IronAccuracy"] = function( wep, stat ) return stat * 1.3 end,
|
||||
["Damage"] = function( wep, stat ) return stat * .95 end,
|
||||
["Spread"] = function( wep, stat ) return stat * 1.3 end,
|
||||
["KickUp"] = function( wep, stat ) return stat * 1.2 end,
|
||||
["Sound"] = function(wep,stat) return "FAS2TFA_SVD.3" or stat end,
|
||||
["SilencedSound"] = function(wep,stat) return "FAS2TFA_SVD.4" or stat end,
|
||||
},
|
||||
["MoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsMoveSpeed"] = function( wep, stat ) return stat * 1.1 end,
|
||||
["IronSightsSensitivity"] = function( wep, stat ) return stat * 0.9 end,
|
||||
["MuzzleFlashEffect"] = "tfa_muzzleflash_generic",
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
45
addons/tfa_base/lua/tfa/att/fas2tfa_svd_scope.lua
Normal file
45
addons/tfa_base/lua/tfa/att/fas2tfa_svd_scope.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "PSO-1 Scope"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["="], "4x zoom", TFA.AttachmentColors["-"], "30% higher zoom time", TFA.AttachmentColors["-"], "15% slower aimed walking" }
|
||||
ATTACHMENT.Icon = "entities/ins2_si_mx4.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "PSO-1"
|
||||
ATTACHMENT.Base = "ins2_scope_base"
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["Bodygroups_V"] = {[1] = 1},
|
||||
["BlowbackVector"] = Vector(0,-1,0),
|
||||
["VElements"] = {
|
||||
["rail_sights"] = {
|
||||
["active"] = false,},
|
||||
["pso1_lens"] = {
|
||||
["active"] = true,
|
||||
},
|
||||
},
|
||||
["WElements"] = {
|
||||
["scope_mx4"] = {
|
||||
["active"] = true
|
||||
}
|
||||
},
|
||||
["Secondary"] = {
|
||||
|
||||
["ScopeZoom"] = function(wep, val) return 4 end
|
||||
},
|
||||
["INS2_SightSuffix"] = "PSO"
|
||||
}
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
68
addons/tfa_base/lua/tfa/att/hl2r_ar2_legacy_is.lua
Normal file
68
addons/tfa_base/lua/tfa/att/hl2r_ar2_legacy_is.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "Ironsight-less"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["-"], "Removes the ironsight on the AR2.", TFA.AttachmentColors["+"], "Appreciate all the intricate mechanisms of the AR2." }
|
||||
ATTACHMENT.Icon = "entities/hl2r_ar2_legacy_is.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "LEGACY"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["IronSightsPos"] = function( wep, val ) return wep.IronSightsPos_LEG or val end,
|
||||
["IronSightsAng"] = function( wep, val ) return wep.IronSightsAng_LEG or val end,
|
||||
["IronSightTime"] = function( wep, val ) return val * 1 end,
|
||||
}
|
||||
function ATTACHMENT:Attach(wep)
|
||||
local mag = wep:Clip1()
|
||||
wep.DrawCrosshairIS = true
|
||||
wep.ViewModelKitOld = wep.ViewModelKitOld or wep.ViewModel
|
||||
wep.ViewModel = wep:GetStat("ViewModel_LEG") or wep.ViewModel
|
||||
if IsValid(wep.OwnerViewModel) then
|
||||
wep.OwnerViewModel:SetModel(wep.ViewModel)
|
||||
timer.Simple(0, function()
|
||||
if mag == 0 then
|
||||
wep:SendViewModelAnim(ACT_VM_IDLE_EMPTY)
|
||||
elseif mag == 1 then
|
||||
wep:SendViewModelSeq("idle_midempty")
|
||||
else
|
||||
wep:SendViewModelAnim(ACT_VM_IDLE)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
local mag = wep:Clip1()
|
||||
wep.DrawCrosshairIS = false
|
||||
if wep.ViewModelKitOld then
|
||||
wep.ViewModel = wep.ViewModelKitOld
|
||||
if IsValid(wep.OwnerViewModel) then
|
||||
wep.OwnerViewModel:SetModel(wep.ViewModel)
|
||||
timer.Simple(0, function()
|
||||
if mag == 0 then
|
||||
wep:SendViewModelAnim(ACT_VM_IDLE_EMPTY)
|
||||
elseif mag == 1 then
|
||||
wep:SendViewModelSeq("idle_midempty")
|
||||
else
|
||||
wep:SendViewModelAnim(ACT_VM_IDLE)
|
||||
end
|
||||
end)
|
||||
end
|
||||
wep.ViewModelKitOld = nil
|
||||
end
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
43
addons/tfa_base/lua/tfa/att/hl2r_crossbow_legacy_is.lua
Normal file
43
addons/tfa_base/lua/tfa/att/hl2r_crossbow_legacy_is.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
if not ATTACHMENT then
|
||||
ATTACHMENT = {}
|
||||
end
|
||||
|
||||
ATTACHMENT.Name = "No-scope"
|
||||
--ATTACHMENT.ID = "base" -- normally this is just your filename
|
||||
ATTACHMENT.Description = { TFA.AttachmentColors["-"], "Don't aim with the scope." }
|
||||
ATTACHMENT.Icon = "entities/hl2r_ar2_legacy_is.png" --Revers to label, please give it an icon though! This should be the path to a png, like "entities/tfa_ammo_match.png"
|
||||
ATTACHMENT.ShortName = "LEGACY"
|
||||
|
||||
ATTACHMENT.WeaponTable = {
|
||||
["IronSightsPos"] = function( wep, val ) return wep.IronSightsPos_LEG or val end,
|
||||
["IronSightsAng"] = function( wep, val ) return wep.IronSightsAng_LEG or val end,
|
||||
["IronSightTime"] = function( wep, val ) return val * 1 end,
|
||||
--["RTMaterialOverride"] = 0;
|
||||
}
|
||||
function ATTACHMENT:Attach(wep)
|
||||
wep.DrawCrosshairIS = true
|
||||
wep:ClearStatCache()
|
||||
--wep.RTMaterialOverride = 0;
|
||||
wep:ClearStatCache()
|
||||
end
|
||||
|
||||
function ATTACHMENT:Detach(wep)
|
||||
wep.DrawCrosshairIS = false
|
||||
wep:ClearStatCache()
|
||||
--wep.RTMaterialOverride = 2;
|
||||
wep:ClearStatCache()
|
||||
end
|
||||
|
||||
if not TFA_ATTACHMENT_ISUPDATING then
|
||||
TFAUpdateAttachments()
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user