This commit is contained in:
lifestorm
2024-08-04 23:12:27 +03:00
parent 0e770b2b49
commit ba1fc01b16
7084 changed files with 2173495 additions and 14 deletions

View File

@@ -0,0 +1,91 @@
--[[
| 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/
--]]
local PLUGIN = PLUGIN
local math = math
local CurTime = CurTime
local charDelay = 0.05
function PLUGIN:RenderScreenspaceEffects()
if IsValid(LocalPlayer()) then
local client = LocalPlayer()
local movieBars = client:GetNetVar("MovieBars");
local frameTime = FrameTime();
local interval = frameTime / 5;
if not colorModify then
colorModify = {
brightness = 0,
contrast = 1,
color = 1,
addr = 0,
addg = 0,
addb = 0
};
end;
if colorModify["$pp_colour_brightness"] == nil then
colorModify["$pp_colour_brightness"] = 0;
end
if colorModify["$pp_colour_contrast"] == nil then
colorModify["$pp_colour_contrast"] = 1;
end
if colorModify["$pp_colour_colour"] == nil then
colorModify["$pp_colour_colour"] = 1;
end
if (movieBars) then
colorModify.brightness = math.Approach(colorModify.brightness, -0.1, interval);
colorModify.contrast = math.Approach(colorModify.contrast, 1, interval);
colorModify.color = math.Approach(colorModify.color, 0.7, interval);
else
colorModify.brightness = math.Approach(colorModify.brightness, 0, interval);
colorModify.contrast = math.Approach(colorModify.contrast, 1, interval);
colorModify.color = math.Approach(colorModify.color, 1, interval);
end;
colorModify["$pp_colour_brightness"] = colorModify.brightness;
colorModify["$pp_colour_contrast"] = colorModify.contrast;
colorModify["$pp_colour_colour"] = colorModify.color;
DrawColorModify(colorModify)
end;
end;
local colorWhite = Color(255, 255, 255);
local colorBlack = Color(0, 0, 0);
function PLUGIN:HUDPaint()
if not IsValid(LocalPlayer()) then return end
local client = LocalPlayer()
local movieBars = client:GetNetVar("MovieBars");
local frameTime = FrameTime();
local scrW, scrH = ScrW(), ScrH();
if not self.movieLength then
self.movieLength = 0;
end
if movieBars then
self.movieLength = math.Approach(self.movieLength, scrH * 0.34, 64 * frameTime);
else
self.movieLength = math.Approach(self.movieLength, 0, 64 * frameTime);
end;
draw.RoundedBox(2, -10, scrH - (self.movieLength / 2), scrW + 20, scrH - self.movieLength, colorBlack);
draw.RoundedBox(2, -10, -10 - (self.movieLength / 2), scrW + 20, 0 + self.movieLength, colorBlack);
end;

View 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/
--]]
AddCSLuaFile()
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.Author = "gb"
ENT.PrintName = "Cutscene Camera"
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.Category = "Cutscene"
local PLUGIN = PLUGIN
function ENT:SetupDataTables()
self:NetworkVar("Int", 0, "CameraID")
end
function ENT:Initialize()
self:SetModel("models/dav0r/camera.mdl")
self:SetMoveType(MOVETYPE_NONE)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
self:DrawShadow(false)
local physicsObject = self:GetPhysicsObject()
if IsValid(physicsObject) then
physicsObject:Wake()
physicsObject:EnableMotion(false)
end
end
if CLIENT then
function ENT:Draw()
if LocalPlayer():GetMoveType() == MOVETYPE_NOCLIP then
self:DrawModel()
end
end
end
if SERVER then
function ENT:Use(act, caller)
if IsValid(caller) and caller:IsPlayer() and caller:IsSuperAdmin() then
caller:SendLua("SetCameraID(" .. self:EntIndex() .. ")")
end
end
end
properties.Add("ixSetCameraID", {
MenuLabel = "Set ID",
Order = 500,
MenuIcon = "icon16/lightning_add.png",
Filter = function(self, entity, client)
if (entity:GetClass() == "ix_cutscenecamera" and client:IsAdmin()) then
return true
end
end,
Action = function(self, entity)
Derma_StringRequest(
"Defin the Cam ID",
"Type the new ID for the cam:",
"",
function(text)
if IsValid(entity) then
self:MsgStart()
net.WriteEntity(entity)
net.WriteString(text)
self:MsgEnd()
end
end,
function() end,
"Set",
"Cancel"
)
end,
Receive = function(self, length, client)
local entity = net.ReadEntity()
local text = net.ReadString()
if (!IsValid(entity)) then
return
end
if (!self:Filter(entity, client)) then
return
end
entity:SetNWInt("CameraID", text)
end
})

View File

@@ -0,0 +1,338 @@
--[[
| 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/
--]]
local PLUGIN = PLUGIN
ix.command.Add("MovieBars", {
description = "Adds a movie bar effect to the player screen. Run the command again with the zero radius argument to remove the effect.",
adminOnly = true,
arguments = {
ix.type.number
},
OnRun = function(self, client, radius )
PLUGIN:HandleMovieBars(client, radius)
end
})
ix.command.Add("CinematicCamera", {
description = "Sets every player in the range in the camera's perspective.",
adminOnly = true,
arguments = {
ix.type.number,
ix.type.text,
},
argumentNames = { "Range(0 for global)", "Cam ID"},
OnRun = function(self, client, range, camID)
local cameraEnts = ents.FindByClass("ix_cutscenecamera")
if !cameraEnts then
client:Notify("There aren't any cams in the map!")
end
if range == 0 then
for _, ent in ipairs(cameraEnts) do
if IsValid(ent) and ent:GetNWInt("CameraID") == camID then
for _, ply in ipairs(player.GetAll()) do
if IsValid(ply) and ply:IsPlayer() then
ply:SetViewEntity(ent)
end
end
end
end
else
local cameraEnts = ents.FindByClass("ix_cutscenecamera")
for _, ent in ipairs(cameraEnts) do
if IsValid(ent) and ent:GetNWInt("CameraID") == camID then
for _, ply in ipairs(ents.FindInSphere(ent:GetPos(), tonumber(range))) do
if IsValid(ply) and ply:IsPlayer() then
ply:SetViewEntity(ent)
end
end
break
end
end
end
end
})
ix.command.Add("CinematicCameraPlayer", {
description = "Sets a single player to a camera's ID.",
adminOnly = true,
arguments = {
ix.type.character,
ix.type.text,
},
argumentNames = { "Character", "Cam ID"},
OnRun = function(self, client, character, camID)
local cameraEnts = ents.FindByClass("ix_cutscenecamera")
local characterPly = character:GetPlayer()
if !characterPly then
client:Notify("Invalid Target!")
end
if !cameraEnts then
client:Notify("No cams in the map!")
end
local cameraEnts = ents.FindByClass("ix_cutscenecamera")
for _, ent in ipairs(cameraEnts) do
if IsValid(ent) and ent:GetNWInt("CameraID") == camID then
characterPly:SetViewEntity(ent)
break
end
end
end
})
ix.command.Add("ResetCinematicCamera", {
description = "Resets the cinematic camera for everybody",
adminOnly = true,
OnRun = function(self, client)
for _, ply in ipairs(player.GetAll()) do
if IsValid(ply) and ply:IsPlayer() then
ply:SetViewEntity(ply)
end
end
end
})
ix.command.Add("PortalNPC", {
description = "Summon an NPC at your targeted point.",
adminOnly = true,
arguments = { ix.type.string },
argumentNames = { "NPC" },
OnRun = function(self, player, npcName)
local npc = ents.Create(npcName)
if IsValid(npc) then
local trace = player:GetEyeTraceNoCursor()
if trace.Hit then
local destination = trace.HitPos + Vector(0, 0, 32)
local spawnDelay = math.Rand(1, 2)
timer.Simple(spawnDelay, function()
timer.Simple(0.2, function()
local flash = ents.Create("light_dynamic")
flash:SetKeyValue("brightness", "2")
flash:SetKeyValue("distance", "256")
flash:SetPos(destination + Vector(0, 0, 8))
flash:Fire("Color", "33 255 0")
flash:Spawn()
flash:Activate()
flash:Fire("TurnOn", "", 0)
timer.Simple(0.5, function() if IsValid(flash) then flash:Remove() end end)
util.ScreenShake(destination, 10, 100, 0.4, 1000, true)
end)
timer.Simple(0.25, function()
if IsValid(npc) then
if npc.CustomInitialize then
npc:CustomInitialize()
end
npc:SetPos(destination + Vector(0, 0, 16))
local angleToPlayer = (player:GetPos() - destination):Angle()
npc:SetAngles(Angle(0, angleToPlayer.y, 0))
local effectTeleport = VJ_HLR_Effect_PortalSpawn(destination)
effectTeleport:SetKeyValue("ParticleScale", "2")
effectTeleport:Fire("Kill", "", 1)
local dynLight = ents.Create("light_dynamic")
dynLight:SetKeyValue("brightness", "2")
dynLight:SetKeyValue("distance", "200")
dynLight:SetPos(destination)
dynLight:SetLocalAngles(Angle(0, angleToPlayer.y, 0))
dynLight:Fire("Color", "33 255 0")
dynLight:Spawn()
dynLight:Activate()
dynLight:Fire("TurnOn", "", 0)
dynLight:Fire("Kill", "", 0.3)
npc:Spawn()
npc:Activate()
end
end)
end)
else
player:Notify("Look somewhere valid!")
end
else
player:Notify(npcName.." isn't a valid NPC!")
end
end
})
ix.command.Add("PortalItem", {
description = "Summon an item at your targeted point.",
adminOnly = true,
arguments = { ix.type.text },
argumentNames = { "Item ID" },
OnRun = function(self, client, item)
local foundItem = false
for uniqueID, itemData in pairs(ix.item.list) do
if uniqueID == item then
foundItem = true
break
end
end
if foundItem then
local trace = client:GetEyeTraceNoCursor()
if trace.Hit then
local destination = trace.HitPos + Vector(0, 0, 32)
local spawnDelay = math.Rand(1, 2)
timer.Simple(spawnDelay, function()
timer.Simple(0.2, function()
local flash = ents.Create("light_dynamic")
flash:SetKeyValue("brightness", "2")
flash:SetKeyValue("distance", "256")
flash:SetPos(destination + Vector(0, 0, 8))
flash:Fire("Color", "33 255 0")
flash:Spawn()
flash:Activate()
flash:Fire("TurnOn", "", 0)
timer.Simple(0.5, function() if IsValid(flash) then flash:Remove() end end)
util.ScreenShake(destination, 10, 100, 0.4, 1000, true)
end)
timer.Simple(0.25, function()
local angleToPlayer = (client:GetPos() - destination):Angle()
local effectTeleport = VJ_HLR_Effect_PortalSpawn(destination)
effectTeleport:SetKeyValue("ParticleScale", "2")
effectTeleport:Fire("Kill", "", 1)
local dynLight = ents.Create("light_dynamic")
dynLight:SetKeyValue("brightness", "2")
dynLight:SetKeyValue("distance", "200")
dynLight:SetPos(destination)
dynLight:SetLocalAngles(Angle(0, angleToPlayer.y, 0))
dynLight:Fire("Color", "33 255 0")
dynLight:Spawn()
dynLight:Activate()
dynLight:Fire("TurnOn", "", 0)
dynLight:Fire("Kill", "", 0.3)
local itemEntity = ix.item.Spawn(item, destination, function(item, entity)
entity:SetRenderMode(RENDERMODE_TRANSCOLOR)
entity:SetColor(Color(255, 255, 255, 0))
timer.Create("portalItem"..CurTime(), 0.75, 1, function()
if IsValid(entity) then
entity:SetColor(Color(255, 255, 255, 255))
end
end)
end)
end)
end)
else
client:Notify("Look at a valid spot!")
end
else
client:Notify("You didn't put a valid item!")
end
end
})
ix.command.Add("PortalPlayer", {
description = "Summon a player to your targeted point.",
adminOnly = true,
arguments = { ix.type.character },
argumentNames = { "Nome" },
OnRun = function(self, player, character)
local target = character:GetPlayer()
local trace = player:GetEyeTraceNoCursor()
if trace.Hit then
if target then
local origin = target:GetPos()
local destination = trace.HitPos
targetPos = target:GetPos()
local flash = ents.Create("light_dynamic")
flash:SetKeyValue("brightness", "2")
flash:SetKeyValue("distance", "256")
flash:SetPos(targetPos + Vector(0, 0, 8))
flash:Fire("Color", "33 255 0")
flash:Spawn()
flash:Activate()
flash:Fire("TurnOn", "", 0)
timer.Simple(0.5, function() if IsValid(flash) then flash:Remove() end end)
util.ScreenShake(targetPos, 10, 100, 0.4, 1000, true)
local effectTeleport = VJ_HLR_Effect_PortalSpawn(targetPos + Vector(0, 0, 24))
effectTeleport:SetKeyValue("ParticleScale", "10")
effectTeleport:Fire("Kill", "", 1)
local dynLight = ents.Create("light_dynamic")
dynLight:SetKeyValue("brightness", "2")
dynLight:SetKeyValue("distance", "200")
dynLight:SetPos(targetPos + Vector(0, 0, 8))
dynLight:Fire("Color", "33 255 0")
dynLight:Spawn()
dynLight:Activate()
dynLight:Fire("TurnOn", "", 0)
dynLight:Fire("Kill", "", 0.3)
timer.Create("summonplayer_"..tostring(target:EntIndex()), 0.75, 1, function()
if IsValid(target) then
target:SetPos(destination)
local flash = ents.Create("light_dynamic")
flash:SetKeyValue("brightness", "2")
flash:SetKeyValue("distance", "256")
flash:SetPos(destination + Vector(0, 0, 24))
flash:Fire("Color", "33 255 0")
flash:Spawn()
flash:Activate()
flash:Fire("TurnOn", "", 0)
timer.Simple(0.5, function() if IsValid(flash) then flash:Remove() end end)
util.ScreenShake(destination, 10, 100, 0.4, 1000, true)
local effectTeleportExit = VJ_HLR_Effect_PortalSpawn(destination + Vector(0, 0, 100))
effectTeleportExit:SetKeyValue("ParticleScale", "10")
effectTeleportExit:Fire("Kill", "", 1)
local dynLight = ents.Create("light_dynamic")
dynLight:SetKeyValue("brightness", "2")
dynLight:SetKeyValue("distance", "200")
dynLight:SetPos(destination)
dynLight:Fire("Color", "33 255 0")
dynLight:Spawn()
dynLight:Activate()
dynLight:Fire("TurnOn", "", 0)
dynLight:Fire("Kill", "", 0.3)
end
end)
else
player:Notify(arguments[1].." is not a valid player!")
end
else
player:Notify("You're not looking at a valid place!")
end
end
})

View File

@@ -0,0 +1,39 @@
--[[
| 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/
--]]
local PLUGIN = PLUGIN
function PLUGIN:HandleMovieBars(player, radius)
if (!radius) then
radius = 250;
end;
if (player.movieBarPlayers) then
for k, v in pairs (player.movieBarPlayers) do
if (IsValid(v) and v:IsPlayer() and !v.cannotMovieBar) then
v:SetNetVar("MovieBars", false);
end;
end;
else
player.movieBarPlayers = {}
end;
for k, v in pairs (ents.FindInSphere(player:GetEyeTrace().HitPos, radius)) do
if (IsValid(v) and v:IsPlayer()) then
table.insert(player.movieBarPlayers, v);
if (!v:GetNetVar("MovieBars") and !v.cannotMovieBar) then
v:SetNetVar("MovieBars", true);
end;
end;
end;
end;

View File

@@ -0,0 +1,21 @@
--[[
| 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/
--]]
local PLUGIN = PLUGIN
PLUGIN.name = "Cinematic Camera"
PLUGIN.description = "Adds cinematic cameras with movie bars."
PLUGIN.author = "gb"
ix.util.Include("sh_hooks.lua")
ix.util.Include("cl_hooks.lua")
ix.util.Include("sh_commands.lua")