content
stringlengths 5
1.05M
|
---|
--// Vortex Gauntlets created by SavageMunkey
--// Thx for ideas and help: dangerspookycanyon(3 Attack Ideas, Body Suit Prototypes),georgeyeo(RayCast help), AltairStarMaster(like 99999999 attack ideas), and others
Plr = game.Players.LocalPlayer
Char = Plr.Character
Mouse = Plr:GetMouse()
local sine,change = 0,1
------------------------
local OverallHealth = 100 --// Only thing you need to change #1
local Energy = 5000--// Only thing you need to change #2
local PrimaryColor,SecondaryColor,ThirdColor = 'Really black','Pearl','Really black' --// Only thing[s] you need to change #3
local NO_OP = false --// Only thing you need to change #4, Btw this will (if true, take damage from the player maxhealth/the set damage instead of taking only the set amount)
--// so if the players maxhealth == 50,000 and you have NO_OP == true and the set damage == 15 then it would do 50,000/15==(3333.333>) instead of just 15 dmaage
------------------------
RageMode = false --// Don't touch, is for variable ---
------------------------
game:FindService'SoundService':ClearAllChildren()
local mx = Energy
--game:FindService'SoundService'.AmbientReverb = 'ConcertHall'
local anglefor = 0
local candash = true
Keyz = {
A = false;
B = false;
C = false;
D = false;
E = false;
F = false;
G = false;
H = false;
I = false;
J = false;
K = false;
L = false;
M = false;
N = false;
O = false;
P = false;
Q = false;
R = false;
S = false;
T = false;
U = false;
V = false;
W = false;
X = false;
Y = false;
Z = false;
};
Flyin = false
local ra,la,ts,hd,ll,rl,root,humanoid = Char:FindFirstChild'Right Arm',Char:FindFirstChild'Left Arm',Char:FindFirstChild'Torso',Char:FindFirstChild'Head',Char:FindFirstChild'Left Leg',Char:FindFirstChild'Right Leg',Char:FindFirstChild'HumanoidRootPart',Char:FindFirstChild'Humanoid'
local rarm,larm,hed,torso,hroot,lleg,hum,rleg,mouse = ra,la,hd,ts,root,ll,humanoid,rl,Mouse
local Falling,DS,MS,Attacking,Stance,State,LastState = false,false,false,false,'Standing','Idle','Idle'
DS = false
local canslam = true
local DebounceFallin = false
local DebounceState,DebounceHit,DebounceKey,EctDebounce = false,false,false,false
pcall(function() hed['Running']:Destroy() end)
local lRS = game["Run Service"].RenderStepped
local sRS = game["Run Service"].Stepped or game["Run Service"].Heartbeat
local lrs,rs = lRS,sRS
local ds,dh,dk,ed = DebounceState,DebounceHit,DebounceKey,EctDebounce
local DBP = false
Weld = function(P0,P1,CF)
local W = Instance.new('Weld',P1)
W.Part0 = P0
W.Part1 = P1
W.C1 = CF
return W
end;
NewSound = function(Parent, Id, Pitch ,Volume)
local Sound = Instance.new('Sound',Parent)
Sound.Volume = Volume
Sound.Pitch = Pitch
Sound.SoundId = 'rbxassetid://'..Id
return Sound
end;
----
----
wait()
hw = Weld(torso,hed,CFrame.new(0,-1.5,0));
torr = Weld(root,torso,CFrame.new(0,0,0));
raw = Weld(torso,rarm,CFrame.new(-1.5,0,0));
law = Weld(torso,larm,CFrame.new(1.5,0,0));
rlw = Weld(torso,rleg,CFrame.new(-.5,2,0));
llw = Weld(torso,lleg,CFrame.new(.5,2,0));
----
clerp = function(c1,c2,al)
local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
for i,v in pairs(com1) do
com1[i] = v+(com2[i]-v)*al
end
return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))--]]
end
lerp = function(c1,c2,al)
return c1:lerp(c2,al)
end
New = function(Object, Parent, Name, Data)
local Object = Instance.new(Object)
delay(.1,function()
if Object:IsA'Part' then
Object.CanCollide = false
Object.Locked = true
end;end)
for Index, Value in pairs(Data or {}) do
Object[Index] = Value
end
Object.Parent = Parent
Object.Name = Name
return Object
end
----// Right Claw
VortexGauntlet = New("Model",Char,"VortexGauntlet",{})
Main = New("Part",VortexGauntlet,"Main",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.00999999, 1.40999997, 1.02999997),CFrame = CFrame.new(1.61502337, 3.22481394, 48.3949738, 0.999984324, -6.55651093e-007, 1.94078893e-007, -6.85453415e-007, 0.999982893, -1.23327482e-008, 1.92187144e-007, 3.23780114e-008, 0.999988735),})
Mesh = New("BlockMesh",Main,"Mesh",{})
Part1 = New("Part",VortexGauntlet,"Part1",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.14999998, 0.200000003, 1.14999998),CFrame = CFrame.new(1.61502361, 3.07982183, 48.3949699, 0.999952972, -1.99669012e-006, 5.80329356e-007, -2.02649153e-006, 0.99994868, 7.71190489e-009, 5.78437607e-007, 5.24213988e-008, 0.999966204),})
Mesh = New("BlockMesh",Part1,"Mesh",{})
mot = New("Motor",Part1,"mot",{Part0 = Part1,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),C1 = CFrame.new(1.1920929e-007, -0.144994497, -3.81469727e-006, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Part2 = New("Part",VortexGauntlet,"Part2",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.14999998, 0.200000003, 1.14999998),CFrame = CFrame.new(1.6150229, 3.47980165, 48.3949699, 0.999952972, -1.99669012e-006, 5.80329356e-007, -2.02649153e-006, 0.99994868, 7.71190489e-009, 5.78437607e-007, 5.24213988e-008, 0.999966204),})
Mesh = New("BlockMesh",Part2,"Mesh",{})
mot = New("Motor",Part2,"mot",{Part0 = Part2,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),C1 = CFrame.new(-3.57627869e-007, 0.254992008, -3.81469727e-006, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Part3 = New("Part",VortexGauntlet,"Part3",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.14999998, 0.200000003, 1.14999998),CFrame = CFrame.new(1.61502194, 3.87978125, 48.3949699, 0.999952972, -1.99669012e-006, 5.80329356e-007, -2.02649153e-006, 0.99994868, 7.71190489e-009, 5.78437607e-007, 5.24213988e-008, 0.999966204),})
Mesh = New("BlockMesh",Part3,"Mesh",{})
mot = New("Motor",Part3,"mot",{Part0 = Part3,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),C1 = CFrame.new(-9.53674316e-007, 0.654978514, -3.81469727e-006, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.10669136, 2.85156226, 48.4086037, -0.686683536, -0.000153818051, 0.726891577, -0.726885498, 0.000336891768, -0.686683595, -0.000140090138, -0.999965966, -0.000342367945),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.686706066, -0.726911366, -0.000139813448, -0.000153436136, 0.000336923113, -0.999988496, 0.726913393, -0.686706126, -0.000342642685),C1 = CFrame.new(-0.50834024, -0.373258352, 0.0136299133, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(0.79824549, 2.13190103, 48.4086189, 0.000150710199, -0.291629434, 0.956479728, -0.000334032346, -0.956475139, -0.291631371, 0.999964535, -0.000275910104, -0.00024051439),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.000150328196, -0.000334063574, 0.999987066, -0.291639835, -0.956508279, -0.000275784521, 0.956509411, -0.291640043, -0.000240883426),C1 = CFrame.new(-0.816791415, -1.09293222, 0.0136451721, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Cone = New("Part",VortexGauntlet,"Cone",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,Reflectance = 0.10000000149012,FormFactor = Enum.FormFactor.Plate,Size = Vector3.new(1, 0.800000012, 1),CFrame = CFrame.new(1.61002243, 2.51985645, 48.3899651, -0.999948561, 1.10265523e-006, 5.55474173e-007, 1.2814628e-006, -0.999944806, -1.77016783e-008, -5.53581231e-007, -2.70076601e-008, 0.999963343),})
Mesh = New("SpecialMesh",Cone,"Mesh",{Scale = Vector3.new(0.150000006, 0.800000012, 0.150000006),VertexColor = Vector3.new(3.00000003e+015, 2.99999995e+031, 3.00000003e+015),MeshId = "http://www.roblox.com/asset/?id=1033714",MeshType = Enum.MeshType.FileMesh,})
mot = New("Motor",Cone,"mot",{Part0 = Cone,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.999979913, -5.95949246e-008, -1.67331933e-007, -2.38406642e-007, -0.999979019, -6.96342894e-009, 1.6922408e-007, -3.77471778e-008, 0.999985874),C1 = CFrame.new(-0.00500154495, -0.704969406, -0.00500869751, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Cylinder = New("Part",VortexGauntlet,"Cylinder",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,Reflectance = 0.10000000149012,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1, 0.800000012, 1),CFrame = CFrame.new(1.61002088, 2.60985756, 48.3899651, -1.02815238e-006, -0.999947667, 5.55474173e-007, 0.999943912, 1.35596326e-006, -1.77016783e-008, 2.70076796e-008, -5.53580719e-007, 0.999963343),})
Mesh = New("SpecialMesh",Cylinder,"Mesh",{Scale = Vector3.new(0.200000003, 0.800000012, 0.200000003),VertexColor = Vector3.new(3.00000003e+015, 2.99999995e+031, 3.00000003e+015),MeshType = Enum.MeshType.Cylinder,})
mot = New("Motor",Cylinder,"mot",{Part0 = Cylinder,Part1 = Main,C0 = CFrame.new(0, 0, 0, 3.12910686e-007, 0.999978125, 6.96343605e-009, -0.999979019, 1.49093466e-008, -1.67331791e-007, 1.6922408e-007, -3.77471778e-008, 0.999985874),C1 = CFrame.new(-0.00500297546, -0.614966869, -0.00500869751, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65483451, 2.53023887, 49.075016, 1.31079628e-006, -0.999882877, -0.0113237342, -0.966020584, 0.00292562018, -0.258228838, 0.258250505, 0.0109389573, -0.965978205),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -8.45183479e-008, -0.966053605, 0.258256376, -0.999914229, 0.00292437896, 0.0109395888, -0.0113240639, -0.25823763, -0.966000021),C1 = CFrame.new(0.0398111343, -0.694586992, 0.680049896, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65375209, 2.85618806, 48.9016113, 0.00494658109, -0.999882698, -0.010186431, -0.756301045, 0.00292500365, -0.654129505, 0.654131114, 0.0109393038, -0.756254077),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.00494546909, -0.756326914, 0.654145896, -0.99991405, 0.00292376243, 0.0109399352, -0.0101873344, -0.654151917, -0.756271124),C1 = CFrame.new(0.0387289524, -0.368632078, 0.506641388, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(1.65484631, 2.12370038, 49.1781998, 0.999881506, -9.94669754e-005, -0.0113197053, -0.00292231143, -0.968337119, -0.249390081, -0.0109360376, 0.249413356, -0.96829623),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.999912858, -0.00292107021, -0.0109366691, -0.000100865138, -0.968370259, 0.249419004, -0.0113200219, -0.249398604, -0.968318045),C1 = CFrame.new(0.0398226976, -1.10113239, 0.783233643, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(2.26175404, 2.52697635, 48.4085655, 0.21676904, 0.000153397676, -0.97616607, -0.976160765, -0.000339346559, -0.216765121, -0.000362583436, 0.999960423, 7.52870619e-005),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.216774523, -0.976193905, -0.00036265573, 0.000153015761, -0.000339377963, 0.999982953, -0.976196945, -0.216773853, 7.56701775e-005),C1 = CFrame.new(0.646740317, -0.697849035, 0.0135917664, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(2.10240459, 2.8600359, 48.4088364, 0.621261835, 0.000153750705, -0.783532441, -0.783529282, -0.000340023485, -0.621255815, -0.000359814498, 0.999960542, -9.07382637e-005),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, 0.621280193, -0.783555269, -0.000360046863, 0.00015336879, -0.000340054947, 0.999983072, -0.783557832, -0.621278107, -9.04251865e-005),C1 = CFrame.new(0.48738873, -0.364784002, 0.0138626099, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(2.34746456, 2.11641502, 48.4083405, -0.000150418913, 0.207840621, -0.978104353, 0.000342616433, -0.978098989, -0.207835644, -0.999959588, -0.000364459294, 7.50037798e-005),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.000150036911, 0.000342647952, -0.999982119, 0.207845837, -0.978132248, -0.000364528183, -0.978135228, -0.207844079, 7.53874556e-005),C1 = CFrame.new(0.732452035, -1.10841727, 0.0133666992, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65306008, 2.53041506, 47.7222595, -0.00565980002, 0.999876678, 0.00980747957, -0.965705037, -0.00292715896, -0.259375572, -0.259334743, -0.0109386966, 0.965682745),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.00566117326, -0.965738058, -0.259340554, 0.99990803, -0.00292591774, -0.010939328, 0.00980706606, -0.259384483, 0.96570456),C1 = CFrame.new(0.0380369425, -0.694410801, -0.672721863, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65604961, 2.85616612, 47.8960381, -0.00937493891, 0.999876201, 0.00635162927, -0.755516708, -0.00292789866, -0.655023754, -0.654977262, -0.01093903, 0.755514741),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.00937599409, -0.755542576, -0.654992044, 0.999907553, -0.00292665744, -0.0109396614, 0.00635065837, -0.655046165, 0.755531788),C1 = CFrame.new(0.0410267115, -0.368654013, -0.498939514, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(1.65066326, 2.1240201, 47.6186333, -0.999874711, -0.00557238981, 0.00985530019, 0.00293071126, -0.968032777, -0.250539839, 0.0109357554, -0.250500113, 0.968010366),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.999906063, 0.00292947004, 0.0109363869, -0.00557376677, -0.968065917, -0.250505745, 0.00985489972, -0.250548452, 0.968032181),C1 = CFrame.new(0.0356398821, -1.10081267, -0.776348114, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart = New("Part",VortexGauntlet,"ClawPart",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(0.919124722, 2.53371048, 48.4086876, -0.300351858, -0.00015361057, 0.95376271, -0.953755617, 0.000337485195, -0.300355166, -0.000276322971, -0.999955058, -0.000246434589),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart,"Mesh",{})
mot = New("Motor",ClawPart,"mot",{Part0 = ClawPart,Part1 = Main,C0 = CFrame.new(0, 0, 0, -0.300362557, -0.953788638, -0.00027619407, -0.000153228655, 0.00033751654, -0.999977589, 0.953792274, -0.300364137, -0.000246802549),C1 = CFrame.new(-0.695910037, -0.691115856, 0.0137138367, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
----// Left Claw
VortexGauntlet2 = New("Model",Char,"VortexGauntlet2",{})
Main2 = New("Part",VortexGauntlet2,"Main2",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.00999999, 1.40999997, 1.02999997),CFrame = CFrame.new(1.61502337, 3.22481394, 48.3949738, 0.999984324, -6.55651093e-007, 1.94078893e-007, -6.85453415e-007, 0.999982893, -1.23327482e-008, 1.92187144e-007, 3.23780114e-008, 0.999988735),})
Mesh = New("BlockMesh",Main2,"Mesh",{})
Part1a = New("Part",VortexGauntlet2,"Part1a = N",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.14999998, 0.200000003, 1.14999998),CFrame = CFrame.new(1.61502361, 3.07982183, 48.3949699, 0.999952972, -1.99669012e-006, 5.80329356e-007, -2.02649153e-006, 0.99994868, 7.71190489e-009, 5.78437607e-007, 5.24213988e-008, 0.999966204),})
Mesh = New("BlockMesh",Part1a,"Mesh",{})
mot = New("Motor",Part1a,"mot",{Part0 = Part1a,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),C1 = CFrame.new(1.1920929e-007, -0.144994497, -3.81469727e-006, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Part2a = New("Part",VortexGauntlet2,"Part2a",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.14999998, 0.200000003, 1.14999998),CFrame = CFrame.new(1.6150229, 3.47980165, 48.3949699, 0.999952972, -1.99669012e-006, 5.80329356e-007, -2.02649153e-006, 0.99994868, 7.71190489e-009, 5.78437607e-007, 5.24213988e-008, 0.999966204),})
Mesh = New("BlockMesh",Part2a,"Mesh",{})
mot = New("Motor",Part2a,"mot",{Part0 = Part2a,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),C1 = CFrame.new(-3.57627869e-007, 0.254992008, -3.81469727e-006, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Part3a = New("Part",VortexGauntlet2,"Part3a",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.14999998, 0.200000003, 1.14999998),CFrame = CFrame.new(1.61502194, 3.87978125, 48.3949699, 0.999952972, -1.99669012e-006, 5.80329356e-007, -2.02649153e-006, 0.99994868, 7.71190489e-009, 5.78437607e-007, 5.24213988e-008, 0.999966204),})
Mesh = New("BlockMesh",Part3a,"Mesh",{})
mot = New("Motor",Part3a,"mot",{Part0 = Part3a,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),C1 = CFrame.new(-9.53674316e-007, 0.654978514, -3.81469727e-006, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.10669136, 2.85156226, 48.4086037, -0.686683536, -0.000153818051, 0.726891577, -0.726885498, 0.000336891768, -0.686683595, -0.000140090138, -0.999965966, -0.000342367945),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.686706066, -0.726911366, -0.000139813448, -0.000153436136, 0.000336923113, -0.999988496, 0.726913393, -0.686706126, -0.000342642685),C1 = CFrame.new(-0.50834024, -0.373258352, 0.0136299133, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(0.79824549, 2.13190103, 48.4086189, 0.000150710199, -0.291629434, 0.956479728, -0.000334032346, -0.956475139, -0.291631371, 0.999964535, -0.000275910104, -0.00024051439),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart2,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.000150328196, -0.000334063574, 0.999987066, -0.291639835, -0.956508279, -0.000275784521, 0.956509411, -0.291640043, -0.000240883426),C1 = CFrame.new(-0.816791415, -1.09293222, 0.0136451721, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Cone2 = New("Part",VortexGauntlet2,"Cone2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,Reflectance = 0.10000000149012,FormFactor = Enum.FormFactor.Plate,Size = Vector3.new(1, 0.800000012, 1),CFrame = CFrame.new(1.61002243, 2.51985645, 48.3899651, -0.999948561, 1.10265523e-006, 5.55474173e-007, 1.2814628e-006, -0.999944806, -1.77016783e-008, -5.53581231e-007, -2.70076601e-008, 0.999963343),})
Mesh = New("SpecialMesh",Cone2,"Mesh",{Scale = Vector3.new(0.150000006, 0.800000012, 0.150000006),VertexColor = Vector3.new(3.00000003e+015, 2.99999995e+031, 3.00000003e+015),MeshId = "http://www.roblox.com/asset/?id=1033714",MeshType = Enum.MeshType.FileMesh,})
mot = New("Motor",Cone2,"mot",{Part0 = Cone2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.999979913, -5.95949246e-008, -1.67331933e-007, -2.38406642e-007, -0.999979019, -6.96342894e-009, 1.6922408e-007, -3.77471778e-008, 0.999985874),C1 = CFrame.new(-0.00500154495, -0.704969406, -0.00500869751, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
Cylinder2 = New("Part",VortexGauntlet2,"Cylinder",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,Reflectance = 0.10000000149012,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1, 0.800000012, 1),CFrame = CFrame.new(1.61002088, 2.60985756, 48.3899651, -1.02815238e-006, -0.999947667, 5.55474173e-007, 0.999943912, 1.35596326e-006, -1.77016783e-008, 2.70076796e-008, -5.53580719e-007, 0.999963343),})
Mesh = New("SpecialMesh",Cylinder2,"Mesh",{Scale = Vector3.new(0.200000003, 0.800000012, 0.200000003),VertexColor = Vector3.new(3.00000003e+015, 2.99999995e+031, 3.00000003e+015),MeshType = Enum.MeshType.Cylinder,})
mot = New("Motor",Cylinder2,"mot",{Part0 = Cylinder2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 3.12910686e-007, 0.999978125, 6.96343605e-009, -0.999979019, 1.49093466e-008, -1.67331791e-007, 1.6922408e-007, -3.77471778e-008, 0.999985874),C1 = CFrame.new(-0.00500297546, -0.614966869, -0.00500869751, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65483451, 2.53023887, 49.075016, 1.31079628e-006, -0.999882877, -0.0113237342, -0.966020584, 0.00292562018, -0.258228838, 0.258250505, 0.0109389573, -0.965978205),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -8.45183479e-008, -0.966053605, 0.258256376, -0.999914229, 0.00292437896, 0.0109395888, -0.0113240639, -0.25823763, -0.966000021),C1 = CFrame.new(0.0398111343, -0.694586992, 0.680049896, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65375209, 2.85618806, 48.9016113, 0.00494658109, -0.999882698, -0.010186431, -0.756301045, 0.00292500365, -0.654129505, 0.654131114, 0.0109393038, -0.756254077),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.00494546909, -0.756326914, 0.654145896, -0.99991405, 0.00292376243, 0.0109399352, -0.0101873344, -0.654151917, -0.756271124),C1 = CFrame.new(0.0387289524, -0.368632078, 0.506641388, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(1.65484631, 2.12370038, 49.1781998, 0.999881506, -9.94669754e-005, -0.0113197053, -0.00292231143, -0.968337119, -0.249390081, -0.0109360376, 0.249413356, -0.96829623),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart2,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.999912858, -0.00292107021, -0.0109366691, -0.000100865138, -0.968370259, 0.249419004, -0.0113200219, -0.249398604, -0.968318045),C1 = CFrame.new(0.0398226976, -1.10113239, 0.783233643, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(2.26175404, 2.52697635, 48.4085655, 0.21676904, 0.000153397676, -0.97616607, -0.976160765, -0.000339346559, -0.216765121, -0.000362583436, 0.999960423, 7.52870619e-005),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.216774523, -0.976193905, -0.00036265573, 0.000153015761, -0.000339377963, 0.999982953, -0.976196945, -0.216773853, 7.56701775e-005),C1 = CFrame.new(0.646740317, -0.697849035, 0.0135917664, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(2.10240459, 2.8600359, 48.4088364, 0.621261835, 0.000153750705, -0.783532441, -0.783529282, -0.000340023485, -0.621255815, -0.000359814498, 0.999960542, -9.07382637e-005),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, 0.621280193, -0.783555269, -0.000360046863, 0.00015336879, -0.000340054947, 0.999983072, -0.783557832, -0.621278107, -9.04251865e-005),C1 = CFrame.new(0.48738873, -0.364784002, 0.0138626099, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(2.34746456, 2.11641502, 48.4083405, -0.000150418913, 0.207840621, -0.978104353, 0.000342616433, -0.978098989, -0.207835644, -0.999959588, -0.000364459294, 7.50037798e-005),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart2,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.000150036911, 0.000342647952, -0.999982119, 0.207845837, -0.978132248, -0.000364528183, -0.978135228, -0.207844079, 7.53874556e-005),C1 = CFrame.new(0.732452035, -1.10841727, 0.0133666992, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65306008, 2.53041506, 47.7222595, -0.00565980002, 0.999876678, 0.00980747957, -0.965705037, -0.00292715896, -0.259375572, -0.259334743, -0.0109386966, 0.965682745),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.00566117326, -0.965738058, -0.259340554, 0.99990803, -0.00292591774, -0.010939328, 0.00980706606, -0.259384483, 0.96570456),C1 = CFrame.new(0.0380369425, -0.694410801, -0.672721863, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(1.65604961, 2.85616612, 47.8960381, -0.00937493891, 0.999876201, 0.00635162927, -0.755516708, -0.00292789866, -0.655023754, -0.654977262, -0.01093903, 0.755514741),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.00937599409, -0.755542576, -0.654992044, 0.999907553, -0.00292665744, -0.0109396614, 0.00635065837, -0.655046165, 0.755531788),C1 = CFrame.new(0.0410267115, -0.368654013, -0.498939514, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.420000017, 0.200000003),CFrame = CFrame.new(1.65066326, 2.1240201, 47.6186333, -0.999874711, -0.00557238981, 0.00985530019, 0.00293071126, -0.968032777, -0.250539839, 0.0109357554, -0.250500113, 0.968010366),BottomSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("SpecialMesh",ClawPart2,"Mesh",{MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.999906063, 0.00292947004, 0.0109363869, -0.00557376677, -0.968065917, -0.250505745, 0.00985489972, -0.250548452, 0.968032181),C1 = CFrame.new(0.0356398821, -1.10081267, -0.776348114, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
ClawPart2 = New("Part",VortexGauntlet2,"ClawPart2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.429999411, 0.200000003, 0.200000003),CFrame = CFrame.new(0.919124722, 2.53371048, 48.4086876, -0.300351858, -0.00015361057, 0.95376271, -0.953755617, 0.000337485195, -0.300355166, -0.000276322971, -0.999955058, -0.000246434589),BackSurface = Enum.SurfaceType.Weld,BottomSurface = Enum.SurfaceType.Weld,FrontSurface = Enum.SurfaceType.Weld,LeftSurface = Enum.SurfaceType.Weld,RightSurface = Enum.SurfaceType.Weld,TopSurface = Enum.SurfaceType.Weld,})
Mesh = New("BlockMesh",ClawPart2,"Mesh",{})
mot = New("Motor",ClawPart2,"mot",{Part0 = ClawPart2,Part1 = Main2,C0 = CFrame.new(0, 0, 0, -0.300362557, -0.953788638, -0.00027619407, -0.000153228655, 0.00033751654, -0.999977589, 0.953792274, -0.300364137, -0.000246802549),C1 = CFrame.new(-0.695910037, -0.691115856, 0.0137138367, 0.999984324, -6.85453415e-007, 1.92187144e-007, -6.55651093e-007, 0.999982893, 3.23780114e-008, 1.94078893e-007, -1.23327482e-008, 0.999988735),})
----// RightLegBrace
RightLegBrace = New("Model",Char,"RightLegBrace",{})
Latch = New("Part",RightLegBrace,"Latch",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.00999999, 1.40999997, 1.02999997),CFrame = CFrame.new(8.6150198, 1.12481403, 33.2949753, 1, 6.85464272e-007, -1.921902e-007, -6.85464215e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1)})
Mesh = New("BlockMesh",Latch,"Mesh",{})
Brace1 = New("Part",RightLegBrace,"Brace1",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(8.61502171, 1.92481399, 33.2949753, 1, 6.85464329e-007, -1.921902e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Brace1,"Mesh",{})
mot = New("Motor",Brace1,"mot",{Part0 = Brace1,Part1 = Latch,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(9.53674316e-007, 0.799999952, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
Brace2 = New("Part",RightLegBrace,"Brace2",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(8.61501884, 0.324813962, 33.2949753, 1, 6.85464329e-007, -1.921902e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Brace2,"Mesh",{})
mot = New("Motor",Brace2,"mot",{Part0 = Brace2,Part1 = Latch,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(0, -0.800000072, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
Brace3 = New("Part",RightLegBrace,"Brace3",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(8.61501884, 1.1148138, 33.2949753, 1, 6.85464329e-007, -1.921902e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Brace3,"Mesh",{})
mot = New("Motor",Brace3,"mot",{Part0 = Brace3,Part1 = Latch,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(-9.53674316e-007, -0.0100002289, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
----// LeftLegBrace
LeftLegBrace2 = New("Model",Char,"LeftLegBrace",{})
Latcha = New("Part",LeftLegBrace2,"Latcha",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.00999999, 1.40999997, 1.02999997),CFrame = CFrame.new(8.6150198, 1.12481403, 33.2949753, 1, 6.85464272e-007, -1.921902e-007, -6.85464215e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1)})
Mesh = New("BlockMesh",Latcha,"Mesh",{})
Brace1a = New("Part",LeftLegBrace2,"Brace1a",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(8.61502171, 1.92481399, 33.2949753, 1, 6.85464329e-007, -1.921902e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Brace1a,"Mesh",{})
mot = New("Motor",Brace1a,"mot",{Part0 = Brace1a,Part1 = Latcha,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(9.53674316e-007, 0.799999952, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
Brace2a = New("Part",LeftLegBrace2,"Brace2a",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(8.61501884, 0.324813962, 33.2949753, 1, 6.85464329e-007, -1.921902e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Brace2a,"Mesh",{})
mot = New("Motor",Brace2a,"mot",{Part0 = Brace2a,Part1 = Latcha,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(0, -0.800000072, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
Brace3a = New("Part",LeftLegBrace2,"Brace3a",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(8.61501884, 1.1148138, 33.2949753, 1, 6.85464329e-007, -1.921902e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Brace3a,"Mesh",{})
mot = New("Motor",Brace3a,"mot",{Part0 = Brace3a,Part1 = Latcha,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(-9.53674316e-007, -0.0100002289, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
----// Exo Spine
Chest = New("Model",Char,"Chest",{})
BackLatch = New("Part",Chest,"BackLatch",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Metal,Transparency = 1,Transparency = 1,FormFactor = Enum.FormFactor.Symmetric,Size = Vector3.new(2, 2, 1),CFrame = CFrame.new(-2.49994969, 3.10042095, 48.2739372, 0.99999994, -4.3300206e-005, -5.97238541e-005, 4.33037421e-005, 1, 5.92252691e-005, 5.97238541e-005, -5.9227852e-005, 0.99999994),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.300000072, 1.37500012, 0.200000003),CFrame = CFrame.new(-2.49999189, 2.9973228, 48.8550034, 0.999999881, -4.6838089e-012, 2.56477506e-009, -4.6838089e-012, 1, 0, 2.56477506e-009, 0, 0.999999881),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C1 = CFrame.new(-1.1920929e-005, -0.103132486, 0.581058502, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.500000119, 0.975000024, 0.300000042),CFrame = CFrame.new(-2.49999166, 3.19728184, 48.8549995, 0.999999881, -4.6838089e-012, 2.56477506e-009, -4.6838089e-012, 1, 0, 2.56477506e-009, 0, 0.999999881),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C1 = CFrame.new(-3.09944153e-006, 0.0968265533, 0.581069946, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.700000048, 0.774999976, 0.300000042),CFrame = CFrame.new(-2.49999166, 3.59736109, 48.9049988, 0.999999881, -4.6838089e-012, 2.56477506e-009, -4.6838089e-012, 1, 0, 2.56477506e-009, 0, 0.999999881),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C1 = CFrame.new(1.71661377e-005, 0.496902704, 0.631092072, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.500000119, 0.300000042, 0.300000042),CFrame = CFrame.new(-2.49999189, 2.20982575, 48.8549995, 0.999999881, -4.6838089e-012, 2.56477506e-009, -4.6838089e-012, 1, 0, 2.56477506e-009, 0, 0.999999881),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C1 = CFrame.new(-4.60147858e-005, -0.89062953, 0.581008911, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.24999997),CFrame = CFrame.new(-2.51000166, 2.52982283, 49.0700035, 0.999999881, -4.6838089e-012, 2.56477506e-009, -4.6838089e-012, 1, 0, 2.56477506e-009, 0, 0.999999881),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{Scale = Vector3.new(0.5, 0.5, 1),MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C1 = CFrame.new(-0.0100290775, -0.570644855, 0.796031952, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.379999995),CFrame = CFrame.new(-2.51000142, 2.61388636, 49.3341675, 0.999999881, -1.23509381e-009, 2.24099495e-009, -4.6838089e-012, 0.877733231, 0.47914964, 2.56477506e-009, -0.47914958, 0.877733111),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{Scale = Vector3.new(0.5, 0.5, 1),MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.877733231, -0.47914964, 0, 0.47914964, 0.877733231),C1 = CFrame.new(-0.0100095272, -0.486596823, 1.06020355, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.870000005),CFrame = CFrame.new(-2.51000142, 3.09982252, 49.4699936, 0.999999881, -2.56477506e-009, -5.71143133e-012, -4.6838089e-012, -4.37103154e-008, 1, 2.56477506e-009, -0.999999881, -4.37103154e-008),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{Scale = Vector3.new(0.5, 0.5, 1),MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, -4.37113883e-008, -1, 0, 1, -4.37113883e-008),C1 = CFrame.new(-0.00998044014, -0.000668764114, 1.19605637, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.379999995),CFrame = CFrame.new(-2.51000142, 3.59388614, 49.3341675, 0.999999881, 1.22417987e-009, 2.25190888e-009, -4.6838089e-012, 0.877732217, -0.479151487, 2.56477506e-009, 0.479151428, 0.877732098),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{Scale = Vector3.new(0.5, 0.5, 1),MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.877732217, 0.479151487, 0, -0.479151487, 0.877732217),C1 = CFrame.new(-0.0099670887, 0.493402719, 1.06026077, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
Part = New("Part",Chest,"Part",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,Reflectance = 0.40000000596046,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.24999997),CFrame = CFrame.new(-2.51000142, 3.67982244, 49.0600014, 0.999999881, -4.6838089e-012, 2.56477506e-009, -4.6838089e-012, 1, 0, 2.56477506e-009, 0, 0.999999881),CanCollide = false,BackSurface = Enum.SurfaceType.SmoothNoOutlines,BottomSurface = Enum.SurfaceType.SmoothNoOutlines,FrontSurface = Enum.SurfaceType.SmoothNoOutlines,LeftSurface = Enum.SurfaceType.SmoothNoOutlines,RightSurface = Enum.SurfaceType.SmoothNoOutlines,TopSurface = Enum.SurfaceType.SmoothNoOutlines,})
Mesh = New("SpecialMesh",Part,"Mesh",{Scale = Vector3.new(0.5, 0.5, 1),MeshType = Enum.MeshType.Brick,})
mot = New("Motor",Part,"mot",{Part0 = Part,Part1 = BackLatch,C1 = CFrame.new(-0.00997972488, 0.579355478, 0.78609848, 0.99999994, 4.33037421e-005, 5.97238541e-005, -4.3300206e-005, 1, -5.9227852e-005, -5.97238541e-005, 5.92252691e-005, 0.99999994),})
----// Battery Pack
BatteryPack = New("Model",Char,"BatteryPack",{})
Inner = New("Part",BatteryPack,"Inner",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.200000003),CFrame = CFrame.new(5.1000185, 1.11981344, 33.3099785, 1, 6.85464386e-007, -1.92190214e-007, -6.85464158e-007, 1, -3.23786935e-008, 1.92190157e-007, 3.23788285e-008, 1),})
Mesh = New("SpecialMesh",Inner,"Mesh",{Scale = Vector3.new(0.5, 0.850000024, 0.5),MeshId = "rbxassetid://9756362",MeshType = Enum.MeshType.FileMesh,})
Top = New("Part",BatteryPack,"Top",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(5.08502388, 1.87980604, 33.2949829, 1, 2.02658885e-006, -5.78463244e-007, -2.02658839e-006, 1, -5.24246104e-008, 5.7846313e-007, 5.24257899e-008, 1),})
Mesh = New("BlockMesh",Top,"Mesh",{})
mot = New("Motor",Top,"mot",{Part0 = Top,Part1 = Inner,C0 = CFrame.new(0, 0, 0, 1, -2.02658862e-006, 5.7846313e-007, 2.02658862e-006, 1, 5.24257864e-008, -5.78463244e-007, -5.24246104e-008, 1),C1 = CFrame.new(-0.0149950981, 0.759992599, -0.014995575, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),})
Outer = New("Part",BatteryPack,"Outer",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.SmoothPlastic,Transparency = 0.60000002384186,Transparency = 0.60000002384186,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.02999997, 1.40999997, 1.02999997),CFrame = CFrame.new(5.08501816, 1.1248138, 33.2949753, 1, 6.85464272e-007, -1.921902e-007, -6.85464215e-007, 1, -3.23786935e-008, 1.92190171e-007, 3.2378825e-008, 1),})
Mesh = New("BlockMesh",Outer,"Mesh",{})
mot = New("Motor",Outer,"mot",{Part0 = Outer,Part1 = Inner,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(-0.0150003433, 0.00500035286, -0.0150032043, 1, -6.85464215e-007, 1.92190157e-007, 6.85464329e-007, 1, 3.23788285e-008, -1.92190214e-007, -3.23786935e-008, 1),})
Bottom = New("Part",BatteryPack,"Bottom",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.08000004, 0.200000003, 1.08000004),CFrame = CFrame.new(5.08501768, 0.364813805, 33.2949753, 1, 6.85464499e-007, -1.92190228e-007, -6.85463988e-007, 1, -3.237869e-008, 1.92190143e-007, 3.23788285e-008, 1),})
Mesh = New("BlockMesh",Bottom,"Mesh",{})
mot = New("Motor",Bottom,"mot",{Part0 = Bottom,Part1 = Inner,C0 = CFrame.new(0, 0, 0, 1, -6.85464215e-007, 1.92190171e-007, 6.85464272e-007, 1, 3.2378825e-008, -1.921902e-007, -3.23786935e-008, 1),C1 = CFrame.new(-0.0150003433, -0.754999638, -0.0150032043, 1, -6.85464158e-007, 1.92190157e-007, 6.85464386e-007, 1, 3.23788285e-008, -1.92190214e-007, -3.23786935e-008, 1),})
BatteryPack:MoveTo(CFrame.new(0,6,0).p)
----// Helmet
Helmet = New("Model",Char,"Helmet",{})
HeadHandle = New("Part",Helmet,"HeadHandle",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,Transparency = 1,Transparency = 1,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(1.20000005, 1.20000005, 1.20000005),CFrame = CFrame.new(-39.1249886, 4.49498367, 48.3950195, 0.999969244, -3.05533376e-013, -1.83186799e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.80966353e-014, -3.08556781e-015, 0.999989748),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.20000005, 1.20000005),CFrame = CFrame.new(-39.7349472, 4.49498367, 48.3950195, 0.999943495, -5.61309246e-013, -3.3638975e-014, -5.61309246e-013, 0.999943495, -5.66873666e-015, -3.34169372e-014, -5.66873666e-015, 0.999981165),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999986053, -1.38555291e-013, -8.21562921e-015, -1.38555291e-013, 0.999986053, -1.39928488e-015, -8.43767296e-015, -1.39928477e-015, 0.999995351),C1 = CFrame.new(-0.609977722, 0, 0, 0.999988198, -1.17239551e-013, -6.88338275e-015, -1.17239551e-013, 0.999988198, -1.18401198e-015, -7.10542736e-015, -1.18401188e-015, 0.999996066),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.20000005, 1.20000005),CFrame = CFrame.new(-39.1349983, 5.06996679, 48.3950157, -2.98000771e-008, 0.999943316, -3.3638975e-014, -0.999943316, -2.98011997e-008, -5.66873666e-015, 5.66873666e-015, -3.34169304e-014, 0.999981165),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, -2.98017682e-008, -0.999985874, 1.39928488e-015, 0.999985874, -2.98020453e-008, -8.21562751e-015, -8.43767296e-015, -1.39928477e-015, 0.999995351),C1 = CFrame.new(-0.0100097656, 0.575000763, -3.81469727e-006, 0.999988198, -1.17239551e-013, -6.88338275e-015, -1.17239551e-013, 0.999988198, -1.18401198e-015, -7.10542736e-015, -1.18401188e-015, 0.999996066),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.20000005, 1.20000005),CFrame = CFrame.new(-39.1349983, 3.92003059, 48.3950157, -2.98000771e-008, 0.999943316, -3.3638975e-014, -0.999943316, -2.98011997e-008, -5.66873666e-015, 5.66873666e-015, -3.34169304e-014, 0.999981165),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, -2.98017682e-008, -0.999985874, 1.39928488e-015, 0.999985874, -2.98020453e-008, -8.21562751e-015, -8.43767296e-015, -1.39928477e-015, 0.999995351),C1 = CFrame.new(-0.0100097656, -0.574970722, -3.81469727e-006, 0.999988198, -1.17239551e-013, -6.88338275e-015, -1.17239551e-013, 0.999988198, -1.18401198e-015, -7.10542736e-015, -1.18401188e-015, 0.999996066),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.20000005, 1.20000005),CFrame = CFrame.new(-38.5600357, 4.49499846, 48.3950157, 0.999943495, -5.61309246e-013, -3.3638975e-014, -5.61309246e-013, 0.999943495, -5.66873666e-015, -3.34169372e-014, -5.66873666e-015, 0.999981165),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999986053, -1.38555291e-013, -8.21562921e-015, -1.38555291e-013, 0.999986053, -1.39928488e-015, -8.43767296e-015, -1.39928477e-015, 0.999995351),C1 = CFrame.new(0.564971924, 1.47819519e-005, -3.81469727e-006, 0.999988198, -1.17239551e-013, -6.88338275e-015, -1.17239551e-013, 0.999988198, -1.18401198e-015, -7.10542736e-015, -1.18401188e-015, 0.999996066),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.17000008, 0.470000058),CFrame = CFrame.new(-39.1399956, 4.17001486, 47.8200264, 1.63953751e-009, 0.999954045, -2.18817728e-008, 4.59242587e-015, -2.18826859e-008, -0.999954045, -0.999984682, 1.63953329e-009, 4.59242672e-015),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 1.63958203e-009, 3.22914132e-016, -0.999998868, 0.999996603, -2.18831939e-008, 1.63958169e-009, -2.18831264e-008, -0.999996603, 3.22914185e-016),C1 = CFrame.new(-0.015007019, -0.324978828, -0.575000763, 0.999988198, -1.17239551e-013, -6.88338275e-015, -1.17239551e-013, 0.999988198, -1.18401198e-015, -7.10542736e-015, -1.18401188e-015, 0.999996066),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(PrimaryColor),Material = Enum.Material.SmoothPlastic,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.20000005, 1.20000005),CFrame = CFrame.new(-39.1349983, 4.49499846, 48.9700012, 1.6395757e-009, 0.999990523, -2.18829328e-008, 9.32859196e-016, -2.18831211e-008, -0.999990523, -0.999996841, 1.63957481e-009, 9.32859408e-016),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 1.6395757e-009, 9.32859196e-016, -0.999996841, 0.999990523, -2.18831211e-008, 1.63957481e-009, -2.18829328e-008, -0.999990523, 9.32859408e-016),C1 = CFrame.new(-0.0100097656, 1.47819519e-005, 0.574989319, 0.999988198, -1.17239551e-013, -6.88338275e-015, -1.17239551e-013, 0.999988198, -1.18401198e-015, -7.10542736e-015, -1.18401188e-015, 0.999996066),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 1.20000005, 0.200000003),CFrame = CFrame.new(-39.1349945, 4.97495842, 47.8200378, 1.63948666e-009, 0.999905407, -2.18802239e-008, 9.47157154e-015, -2.18821032e-008, -0.999905407, -0.999968469, 1.63947811e-009, 9.47157324e-015),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 1.63955105e-009, 3.30083467e-015, -0.999988973, 0.999966919, -2.18828387e-008, 1.63954805e-009, -2.18821814e-008, -0.999966919, 3.30083509e-015),C1 = CFrame.new(-0.0100059509, 0.479989529, -0.574989319, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-38.5950432, 4.9849577, 47.8200378, 1.63948777e-009, 0.99990648, -2.18802576e-008, 9.36394669e-015, -2.18821157e-008, -0.99990648, -0.999968827, 1.63947933e-009, 9.36394838e-015),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 1.63955216e-009, 3.19320092e-015, -0.999989331, 0.999967992, -2.18828511e-008, 1.63954927e-009, -2.18822152e-008, -0.999967992, 3.19320156e-015),C1 = CFrame.new(0.529960632, 0.489989281, -0.574989319, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(SecondaryColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-39.7049294, 4.9849577, 47.8200378, 1.63948777e-009, 0.99990648, -2.18802576e-008, 9.36394669e-015, -2.18821157e-008, -0.99990648, -0.999968827, 1.63947933e-009, 9.36394838e-015),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 1.63955216e-009, 3.19320092e-015, -0.999989331, 0.999967992, -2.18828511e-008, 1.63954927e-009, -2.18822152e-008, -0.999967992, 3.19320156e-015),C1 = CFrame.new(-0.579959869, 0.489989281, -0.574989319, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-38.5600548, 4.98495245, 49.0399933, 0.99990648, -5.5407183e-014, -2.02039434e-008, -2.02057997e-008, 3.05623193e-010, -0.99990648, -5.5175611e-014, 0.999968767, 3.0566083e-010),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -2.02064321e-008, -1.87625895e-014, -1.89941751e-014, 3.05648173e-010, 0.999989271, -2.02057979e-008, -0.999967992, 3.05660941e-010),C1 = CFrame.new(0.56495285, 0.489984035, 0.644981384, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-38.5600548, 4.962955, 49.2099915, 0.99990648, -1.0504676e-009, -5.66523439e-010, -8.17672263e-010, -0.255145043, -0.966806114, 8.71077599e-010, 0.966866374, -0.255160898),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -8.1711149e-010, 8.71131889e-010, -1.05065279e-009, -0.255160719, 0.966886163, -5.67158376e-010, -0.966865599, -0.255166143),C1 = CFrame.new(0.56495285, 0.46798563, 0.814979553, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-38.5600548, 4.91495943, 49.3999825, 0.99990648, -1.0504676e-009, -5.66523439e-010, -8.17672263e-010, -0.255145043, -0.966806114, 8.71077599e-010, 0.966866374, -0.255160898),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("SpecialMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -8.1711149e-010, 8.71131889e-010, -1.05065279e-009, -0.255160719, 0.966886163, -5.67158376e-010, -0.966865599, -0.255166143),C1 = CFrame.new(0.56495285, 0.419988632, 1.00497437, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-39.7349434, 4.98495245, 49.0399933, 0.99990648, -5.5407183e-014, -2.02039434e-008, -2.02057997e-008, 3.05623193e-010, -0.99990648, -5.5175611e-014, 0.999968767, 3.0566083e-010),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -2.02064321e-008, -1.87625895e-014, -1.89941751e-014, 3.05648173e-010, 0.999989271, -2.02057979e-008, -0.999967992, 3.05660941e-010),C1 = CFrame.new(-0.609973907, 0.489984035, 0.644981384, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-39.7349434, 4.962955, 49.2099915, 0.99990648, -1.0504676e-009, -5.66523439e-010, -8.17672263e-010, -0.255145043, -0.966806114, 8.71077599e-010, 0.966866374, -0.255160898),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -8.1711149e-010, 8.71131889e-010, -1.05065279e-009, -0.255160719, 0.966886163, -5.67158376e-010, -0.966865599, -0.255166143),C1 = CFrame.new(-0.609973907, 0.46798563, 0.814979553, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.200000003, 0.219999999),CFrame = CFrame.new(-39.7349434, 4.91495943, 49.3999825, 0.99990648, -1.0504676e-009, -5.66523439e-010, -8.17672263e-010, -0.255145043, -0.966806114, 8.71077599e-010, 0.966866374, -0.255160898),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("SpecialMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -8.1711149e-010, 8.71131889e-010, -1.05065279e-009, -0.255160719, 0.966886163, -5.67158376e-010, -0.966865599, -0.255166143),C1 = CFrame.new(-0.609973907, 0.419988632, 1.00497437, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.879999995, 0.819999933),CFrame = CFrame.new(-39.1250114, 5.37822723, 49.0352859, 0.99990648, -8.72485362e-010, -5.28140465e-012, 7.17916893e-010, 0.828282356, -0.560144186, 4.93058316e-010, 0.560179174, 0.828333974),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("SpecialMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),MeshType = Enum.MeshType.Wedge,})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, 7.18572146e-010, 4.93104835e-010, -8.72012407e-010, 0.828333259, 0.560190618, -5.59388126e-012, -0.560178638, 0.828350902),C1 = CFrame.new(-2.28881836e-005, 0.883270741, 0.640274048, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
Wall = New("Part",Helmet,"Wall",{BrickColor = BrickColor.new(ThirdColor),Material = Enum.Material.Neon,FormFactor = Enum.FormFactor.Custom,Size = Vector3.new(0.200000003, 0.899999976, 0.919999957),CFrame = CFrame.new(-39.1250038, 4.71387339, 48.6822853, 0.99990648, -1.0504676e-009, -5.66523439e-010, -8.17672263e-010, -0.255145043, -0.966806114, 8.71077599e-010, 0.966866374, -0.255160898),CanCollide = false,Locked = true,BottomSurface = Enum.SurfaceType.Smooth,TopSurface = Enum.SurfaceType.Smooth,})
Mesh = New("BlockMesh",Wall,"Mesh",{Scale = Vector3.new(0.25, 1, 1),})
mot = New("Motor",Wall,"mot",{Part0 = Wall,Part1 = HeadHandle,C0 = CFrame.new(0, 0, 0, 0.999967992, -8.1711149e-010, 8.71131889e-010, -1.05065279e-009, -0.255160719, 0.966886163, -5.67158376e-010, -0.966865599, -0.255166143),C1 = CFrame.new(-1.52587891e-005, 0.218896389, 0.287269592, 0.999969244, -3.05533376e-013, -1.80966353e-014, -3.05533376e-013, 0.999969244, -3.08556781e-015, -1.83186799e-014, -3.08556781e-015, 0.999989748),})
----// End
rad = function(Int)
return math.rad(tonumber(Int))
end;
sin = function(Int)
return math.sin(tonumber(Int))
end;
cos = function(Int)
return math.cos(tonumber(Int))
end;
Angles = function(X,Y,Z)
return CFrame.Angles(X,Y,Z);
end;
Euler = function(X,Y,Z)
return CFrame.fromEulerAnglesXYZ(X,Y,Z);
end;
CF = function(X,Y,Z)
return CFrame.new(X,Y,Z);
end;
--// Suit Welds
local HandleWeld = Weld(rarm,Main,Angles(0,0,0)*CF(0,.35,0))
local HandleWeld2 = Weld(larm,Main2,Angles(0,0,0)*CF(0,.35,0))
local BraceWeld = Weld(rleg,Latch,CF(0,0,0))
local BraceWeld2 = Weld(lleg,Latcha,CF(0,0,0))
local ExoWeld = Weld(torso,BackLatch,CF(0,0,0))
local BatteryWeld = Weld(Outer,BackLatch,CF(0,0,1.775))
local InnerWeld = Weld(Inner,Outer,CF(0,0,0))
local TopW,BottomW = Weld(Top,Outer,CF(0,-.75,0)),Weld(Bottom,Outer,CF(0,.75,0))
local HelmetWeld = Weld(HeadHandle,hed,CF(0,.05,0))
--\\ Suit Welds
dmg=function(hit,Damage,Knockback,angle)
local mana = 0
if DebounceHit == false then
DebounceHit = true
coroutine.resume(coroutine.create(function()
wait(0.1)
DebounceHit = false
end))
if hit.Parent==nil then
return
end
--CPlayer=Bin
h=hit.Parent:FindFirstChild("Humanoid")
if h~=nil and hit.Parent.Name~=Char.Name and hit.Parent:FindFirstChild("Torso")~=nil then
if mana < 400 then
mana = mana + math.random(5,15)
end
if mana > 400 then
mana = 400
end
Damage=Damage
--[[ if game.Players:GetPlayerFromCharacter(hit.Parent)~=nil then
return
end]]
c=Instance.new("ObjectValue")
c.Name="creator"
c.Value=game.Players.LocalPlayer
c.Parent=h
game:GetService("Debris"):AddItem(c,.5)
-- print(c.Value)
if math.random(0,99)+math.random()<=7.8 then
--CRIT=true
Damage=Damage*3
--[[ Knockback=Knockback*2
r=Instance.new("BodyAngularVelocity")
r.P=3000
r.maxTorque=Vector3.new(500000000,50000000000,500000000)*50000
r.angularvelocity=Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))
r.Parent=hit.Parent.Torso]]
--critsound(2)
end
if NO_OP == true then
Damage = h.MaxHealth / Damage
else
Damage = Damage+math.random(0,9)
end
--warn('dmged')
-- Blood(hit.CFrame*CFrame.new(math.random(-10,10)/10,math.random(-10,10)/10,0),math.floor(Damage/2))
h.Health = h.Health - Damage
-- showDamage(hit.Parent,Damage,.5)
vp=Instance.new("BodyVelocity")
vp.P=500
vp.maxForce=Vector3.new(math.huge,0,math.huge)
-- vp.velocity=Character.Torso.CFrame.lookVector*Knockback
vp.velocity=torso.CFrame.lookVector*Knockback+torso.Velocity/1.05
if Knockback>0 then
vp.Parent=hit.Parent.Torso
end
game:GetService("Debris"):AddItem(vp,.1)
r=Instance.new("BodyAngularVelocity")
r.P=3000
r.maxTorque=Vector3.new(500000000,50000000000,500000000)*50000
r.angularvelocity= angle or Vector3.new(0,0,0)
r.Parent=hit.Parent.Torso
game:GetService("Debris"):AddItem(r,.5)
c=Instance.new("ObjectValue")
c.Name="creator"
c.Value=Plr
c.Parent=h
game:GetService("Debris"):AddItem(c,.5)
return h
--CRIT=false
--hitDeb=true
--AttackPos=6
end
end
end
function getAllParts(from)
local t = {}
function getParts(where)
for i, v in pairs(where:children()) do
if v:IsA("BasePart") then
if v.Parent ~= Char and v.Parent.Parent ~= Char then
table.insert(t, v)
end
end
getParts(v)
end
end
getParts(workspace)
return t
end
Search = function(Object, ClassName, Function)
for index,obj in next, Object:children() do
if obj:IsA(tostring(ClassName)) then
Function(obj)
end
end
end
TransClone = function(Trans)
local md = Char
md.Archivable = true
local md2 = md:Clone()
md2.Parent = workspace
pcall(function()
md2.BodyColors:Destroy()
end)
md.Archivable=false
Search(md2,'Part',function(P)
P.Transparency = .9
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['VortexGauntlet'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['VortexGauntlet2'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['RightLegBrace'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['LeftLegBrace'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['Chest'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['BatteryPack'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
Search(md2['Helmet'],'Part',function(P)
P.Transparency = Trans
P.Material = 'Neon'
P.BrickColor = BrickColor.new('Teal')
end)
return md2
end;
TakeJuice = function(Amnt)
if Energy - Amnt <= -1 then
if dk == true then dk = false end
if DebounceState == true then DebounceState = false end
if Flyin == true then Flyin = false end
if DBP == true then DBP = false end
return false end
if Energy - Amnt >= 0 then
spawn(function()
for i = 1,tonumber(Amnt) do
Energy = Energy - 1
wait(i/(Amnt*10))
end
end)
end
return true
end;
Charge = function(Amnt)
if Energy < mx then
for i = 1,tonumber(Amnt) do
if Energy == mx then return end
Energy = Energy + 1
wait(i/(Amnt*10))
end
end
end;
--// Mesh Removing
ypcall(function()
hed.Mesh:Destroy()
wait(.2)
local HedMesh = Instance.new('BlockMesh',hed)
HedMesh.Scale = Vector3.new(.560002,1.10002,1.10002)
HedMesh.Name = 'Mesh'
end)
for index,obj in next, Char:children() do
if obj:IsA'CharacterMesh' then
obj:Destroy()
end
if obj:IsA'Hat' then
obj:Destroy()
end
end
--\\ Mesh Removing
function RayCast(pos1, pos2, maxDist, forward)
local list = getAllParts(workspace)
local pos0 = pos1
for dist = 1, maxDist, forward do
lRS:wait()
pos0 = (CFrame.new(pos1, pos2) * CFrame.new(0, 0, -dist)).p
for _, v in pairs(list) do
local pos3 = v.CFrame:pointToObjectSpace(pos0)
local s = v.Size
if pos3.x > -(s.x/2) and pos3.x < (s.x/2) and pos3.y > -(s.y/2) and pos3.y < (s.y/2) and pos3.z > -(s.z/2) and pos3.x < (s.z/2) and v.CanCollide == true then
return pos0, v
end
end
end
return pos0, nil
end
HandleParts = function(Obj, Scale)
Scale = Scale or 0
local P = Instance.new('Part',VortexGauntlet)
P.Anchored = true
P.Transparency = .3
P.FormFactor = 3
P.Size = Vector3.new(.4+Scale,.4+Scale,.4+Scale)
P.CFrame = Obj.CFrame * CF(0,-.7,0) * Angles(math.random(),math.random(),math.random())
P.Material = 'Neon'
P.CanCollide = false
P.BrickColor = BrickColor.new(SecondaryColor)
local PM = Instance.new('BlockMesh',P)
spawn(function()
for i = 1,20 do
PM.Scale = PM.Scale + Vector3.new(.05,.05,.05)
P.Transparency = P.Transparency + .05
lRS:wait()
end
P:Destroy()
end)
end
Trans = function(Numb)
local R = function()
------------------------------------------------
spawn(function()
for i = 1,20 do
Part3.Transparency = Part3.Transparency + 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part2.Transparency = Part2.Transparency + 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part1.Transparency = Part1.Transparency + 1/Numb
lRS:wait()
end
end)
------------------------------------------------
------------------------------------------------
spawn(function()
for i = 1,20 do
Part3.Transparency = Part3.Transparency - 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part2.Transparency = Part2.Transparency - 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part1.Transparency = Part1.Transparency - 1/Numb
lRS:wait()
end
end)
------------------------------------------------
end
local L = function()
------------------------------------------------
spawn(function()
for i = 1,20 do
Part3a.Transparency = Part3a.Transparency + 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part2a.Transparency = Part2a.Transparency + 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part1a.Transparency = Part1a.Transparency + 1/Numb
lRS:wait()
end
end)
------------------------------------------------
------------------------------------------------
spawn(function()
for i = 1,20 do
Part3a.Transparency = Part3a.Transparency - 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part2a.Transparency = Part2a.Transparency - 1/Numb
lRS:wait()
end
end)
wait(.1)
----
spawn(function()
for i = 1,20 do
Part1a.Transparency = Part1a.Transparency - 1/Numb
lRS:wait()
end
end)
------------------------------------------------
end
spawn(R)
spawn(L)
end;
newRay = function(start,face,range,wat)
local rey=Ray.new(start.p,(face.p-start.p).Unit*range)
local hit,pos=workspace:FindPartOnRayWithIgnoreList(rey,wat)
return rey,hit,pos
end
Pulse = function(Parent, Angle, Sc, Increase)
local Rng = Instance.new('Part',Parent)
Rng.FormFactor = 3
Rng.Size = Vector3.new(.2,.2,.2)
Rng.BrickColor = BrickColor.new(SecondaryColor)
Rng.Anchored = true
Rng.CFrame = Parent.CFrame*Angle
local Msh = Instance.new('SpecialMesh',Rng)
Msh.MeshId = 'rbxassetid://3270017'
Msh.Scale = Sc
spawn(function()
for i = 1,Increase do
Msh.Scale = Msh.Scale + Vector3.new(.1,.1,0)
Rng.Transparency = Rng.Transparency + 1/Increase
lRS:wait()
end
Rng:Destroy()
end)
end;
FaceMouse = function()
local Torso = torso
local atan2, pi, dir, torso, torsoPos = math.atan2, math.pi
local torso = Char:FindFirstChild'Torso'
if torso then
torsoPos = torso.CFrame.p
dir = (mouse.Hit.p - torsoPos).unit
torso.CFrame = CFrame.new(torsoPos) * CFrame.Angles(0, atan2(dir.X, dir.Z) + pi, 0)
end;end;
CheckIfLanded = function()
local Ray = Ray.new(torso.Position,Vector3.new(0,-1,0)*10)
local Ignore = {}
for i,v in pairs(game:GetService("Players"):GetPlayers()) do
if v.Character ~= nil then
Ignore[#Ignore+1] = v.Character
end
end
local Hit,Pos,SurfaceNorm = workspace:FindPartOnRayWithIgnoreList(Ray,Ignore)
if Hit == nil then return false,nil end
return true,Hit
end;
CL = function()
local C = CheckIfLanded()
if C == false then
DebounceState = false
dk = false
DBP = false
Flyin = false
return end
end;
local acos = math.acos
local sqrt = math.sqrt
local Vec3 = Vector3.new
local fromAxisAngle = CFrame.fromAxisAngle
toAxisAngle = function(CFr)
local X,Y,Z,R00,R01,R02,R10,R11,R12,R20,R21,R22 = CFr:components()
local Angle = math.acos((R00+R11+R22-1)/2)
local A = (R21-R12)^2+(R02-R20)^2+(R10-R01)^2
A = A == 0 and 0.00001 or A
local B = (R21-R12)^2+(R02-R20)^2+(R10-R01)^2
B = B == 0 and 0.00001 or B
local C = (R21-R12)^2+(R02-R20)^2+(R10-R01)^2
C = C == 0 and 0.00001 or C
local x = (R21-R12)/sqrt(A)
local y = (R02-R20)/sqrt(B)
local z = (R10-R01)/sqrt(C)
return Vec3(x,y,z),Angle
end
Crown = function()
local P = Instance.new('Part',VortexGauntlet)
P.FormFactor = 3
P.Material = 'Neon'
P.CanCollide = false
P.Anchored = true
P.Size = Vector3.new(2,2,2)
local M = Instance.new('SpecialMesh',P)
M.MeshId = 'rbxassetid://20329976'
return P,M
end;
LerpCFrame = function(CFrame1,CFrame2,Num)
local Vec,Ang = toAxisAngle(CFrame1:inverse()*CFrame2)
return CFrame1*fromAxisAngle(Vec,Ang*Num) + (CFrame2.p-CFrame1.p)*Num
end
ApplyTrig = function(Num,Func)
local Min,Max = Func(0),Func(1)
local i = Func(Num)
return (i-Min)/(Max-Min)
end
getm = function(obj)
if obj:IsA'Part' then
return obj:GetMass()
else
print(obj.ClassName..', YOU SHALL NOT MASS!!! ') --// Pun
return 0
end
end;
isnormal = function(plr)
if plr:FindFirstChild'Torso' then
if getm(plr.Torso) > 4 then
return false
end
end
return true
end;
Crater = function(Torso,Radius)
spawn(function()
local Ray = Ray.new(Torso.Position,Vector3.new(0,-1,0)*10)
local Ignore = {}
for i,v in pairs(game:GetService("Players"):GetPlayers()) do
if v.Character ~= nil then
Ignore[#Ignore+1] = v.Character
end
end
local Hit,Pos,SurfaceNorm = workspace:FindPartOnRayWithIgnoreList(Ray,Ignore)
if Hit == nil then return end
local Parts = {}
for i = 1,360,40 do
local P = Instance.new("Part",VortexGauntlet)
P.Anchored = true
P.FormFactor = "Custom"
P.BrickColor = Hit.BrickColor
P.Material = Hit.Material
P.TopSurface = "Smooth"
P.BottomSurface = "Smooth"
P.Size = Vector3.new(5,5,5)*(math.random(80,100)/100)
P.CFrame = ((CFrame.new(Pos,Pos+SurfaceNorm)*CFrame.Angles(math.rad(90),0,0))-Vector3.new(0,7,0))*CFrame.Angles(math.rad(math.random(-50,50)),math.rad(math.random(-50,50)),math.rad(math.random(-50,50)))
Parts[#Parts+1] = {P,P.CFrame,((CFrame.new(Pos,Pos+SurfaceNorm)*CFrame.Angles(math.rad(90),0,0))-Vector3.new(0,1,0))*CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,-Radius)*CFrame.Angles(math.rad(math.random(-50,-20)),math.rad(math.random(-15,15)),math.rad(math.random(-15,15))),P.Size}
if math.random(0,5) == 0 then -- rubble
local P = Instance.new("Part",Torso.Parent)
P.Anchored = true
P.FormFactor = "Custom"
P.BrickColor = Hit.BrickColor
P.Material = Hit.Material
P.TopSurface = "Smooth"
P.BottomSurface = "Smooth"
P.Size = Vector3.new(2,2,2)*(math.random(80,100)/100)
P.CFrame = ((CFrame.new(Pos,Pos+SurfaceNorm)*CFrame.Angles(math.rad(90),0,0))-Vector3.new(0,2.5,0))*CFrame.Angles(math.rad(math.random(-50,50)),math.rad(math.random(-50,50)),math.rad(math.random(-50,50)))
Parts[#Parts+1] = {P,P.CFrame,(CFrame.new(Pos,Pos+SurfaceNorm)*CFrame.Angles(math.rad(90),0,0))*CFrame.Angles(0,math.rad(i),0)*CFrame.new(0,0,-Radius-8)*CFrame.Angles(math.rad(math.random(-90,90)),math.rad(math.random(-90,90)),math.rad(math.random(-90,90))),P.Size}
end
end
for i = 0,1,0.05 do
for i2,v in pairs(Parts) do
v[1].CFrame = LerpCFrame(v[2],v[3],ApplyTrig(i,math.cos))
end
wait(0.02)
end
for i,v in pairs(Parts) do
if v[1].Size.X > 2.1 then
v[1].CFrame = v[1].CFrame+Vector3.new(0,2,0)
end
v[1].Anchored = false
end
for i = 0,1,0.05 do
for i2,v in pairs(Parts) do
v[1].Transparency = i
if i == 1 then
v[1]:Destroy()
elseif i >= 0.25 then
v[1].CanCollide = false
end
end
wait(0.02)
end
Parts = nil
end)
end
LazorBeam = function()
DebounceState = true
DBP = true
dk = true
Trans(4)
local Bool = TakeJuice(25)
if Bool == false then return end
local S = NewSound(hed,164102008,1.5,1)
S:Play()
for i = 1,30 do
FaceMouse()
Char.Humanoid.WalkSpeed = 5
llw.C0 = clerp(llw.C0, CF(0,0,0),.15)
rlw.C0 = clerp(rlw.C0, CF(0,0,0),.15)
law.C0 = clerp(law.C0, CF(.5,.5,.2)*Angles(rad(90),0,rad(45+25)),.15)
raw.C0 = clerp(raw.C0, CF(0,.5,-1.5)*Angles(rad(89),rad(5),rad(25)),.15)
hw.C0 = clerp(hw.C0, CF(0,0,0)*Angles(0,rad(-25),0),.15)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,rad(25),0),.15)
lRS:wait()
end
Trans(6)
wait(.05)
for i = 1,30 do
FaceMouse()
HandleParts(Main,i/75)
local ang = rad(math.random(-360,360))
--spawn(function()Pulse(Main,Angles(ang,ang,ang),Vector3.new(1.2+(i/50),1.2+(i/50),1),20)end)
lRS:wait()
end
local Beam = Cylinder:Clone()
Beam.mot:Destroy()
Beam.Parent = VortexGauntlet
Beam.Mesh.Scale = Vector3.new(1,1,1)
Beam.Anchored = true
--local pos,hit = RayCast(Main.Position,(Main.Position-Vector3.new(0,0,10)),100,1)
local Count = 0
--Pulse()
--wait(.5)
--spawn(function()Pulse(Main,Angles(rad(45),0,rad(45)),Vector3.new(2.5,2.5,1),25)end)
--spawn(function()Pulse(Main,Angles(-rad(45),0,rad(-45)),Vector3.new(2.5,2.5,1),25)end)
local S = NewSound(Beam,228343271,.95,1)
S:Play()
local S = NewSound(Beam,231917744,.95,1)
S:Play()
local S = NewSound(hed,154454228,1,1)
--S:Play()
local Tbl = {Main, Char, Beam}
local Angl = 0
for i = 1,60 do
Angl = Angl+rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,Angl,0),.35)
Trans(2)
local ang = rad(math.random(-360,360))
spawn(function()Pulse(Main,CF(0,0,0)*Angles(ang,ang,ang),Vector3.new(1.2+(i/35),1.2+(i/35),1),20)end)
FaceMouse()
Count = Count + i
FaceMouse()
Count = Count + i
local StartPos = (Main.CFrame*CF(0,0,0))
local ray = Ray.new(StartPos.p,(StartPos.p-(StartPos*CF(0,1,0)).p).unit*Count/2)
local P = Instance.new('Part')
table.insert(Tbl,P)
local Hit,Pos = workspace:FindPartOnRayWithIgnoreList(ray, Tbl)
local ph
local mag
if Hit then
if Hit and Hit.Parent:FindFirstChild'Humanoid' then
local h = dmg(Hit,9,3)
end
if Hit and Hit.Anchored == false and not Hit.Parent:FindFirstChild'Humanoid' then
local bv = Instance.new('BodyVelocity',Hit)
local hih = 50000
bv.maxForce = Vector3.new(hih,hih,hih)
bv.velocity = torso.CFrame.lookVector * 20 + Vector3.new(0,-2,0)
spawn(function()
wait(.1)
bv:Destroy()
end)
end
if Hit.CanCollide == false then
table.insert(Tbl,Hit)
end
--Count = (StartPos.p-Hit.CFrame.p).magnitude
P.Parent = VortexGauntlet
P.FormFactor = 3
P.TopSurface,P.BottomSurface = 10,10
P.Size = Vector3.new(2,2,2)
P.Anchored = true
P.Position = Pos
P.BrickColor = BrickColor.new(SecondaryColor)
P.Transparency = .2
P.CanCollide = false
P.Material = Enum.Material.Neon
P.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
--P.Size = Vector3.new(P.Size.Z+.01,P.Size.Y+.01,P.Size.Z+.01)
P.Transparency = P.Transparency + 1/C
lRS:wait()
end;
P:Destroy()
end)
mag = (Main.CFrame.p-Pos).magnitude
else
mag = (Main.CFrame.p-Pos).magnitude
end
local Down = 0--.125
Beam.Size = Vector3.new(mag,2.5,2.5) --//Beam.Size.Y-Down,Beam.Size.Z-Down)
--Beam.Mesh.Scale = Vector3.new(mag,1.35,1.35)
Beam.CFrame = Main.CFrame * CF(0,-mag/2,0) * Angles(0,0,rad(90))
--// print(hit.Name)
torso.Anchored = false
lRS:wait()
--BTouch:disconnect()
end--]]
torso.Anchored = false
spawn(function()
local C = 40
for i = 1,C do
pcall(function()
Beam.Mesh.Scale = Beam.Mesh.Scale - Vector3.new(0,.085/2,.085/2)
end)
pcall(function()
Beam.Transparency = Beam.Transparency + 1/C
end)
lRS:wait()
end;Beam:Destroy()
DBP = false
end)
wait(.1)
dk = false
DebounceState = false
end
BeamThrust = function()
DBP = true
DebounceState = true
dk = true
Flyin = true
Keyz.R = true
local C,Below = CheckIfLanded()
if C == false then
DebounceState = false
dk = false
DBP = false
Flyin = false
return end
for i = 1,9 do
--FaceMouse()
HandleParts(Main, i/75)
HandleParts(Main2,i/75)
Char.Humanoid.WalkSpeed = 7
torr.C0 = clerp(torr.C0, CF(0,rad(cos(sine/3)),0)*Angles(rad(0),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.65,-.1,1.35)*Angles(rad(-75)+-rad(cos(sine/10)),rad(75)+rad(cos(sine/20)),rad(90)+rad(cos(sine/20))),.3)
law.C0 = clerp(law.C0, CF(-1.65,-.1,1.35)*Angles(rad(-75)+rad(cos(sine/10)),rad(-75)+-rad(cos(sine/20)),rad(-90)+-rad(cos(sine/20))),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, Angles(rad(-2)+rad(cos(sine/10)),rad(0),0),.3)
lRS:wait()
end
wait(.05)
--for i = 1,30 do
HandleParts(Main,1.5)
HandleParts(Main2,1.5)
local ang = rad(math.random(-360,360))
--spawn(function()Pulse(Main,Angles(ang,ang,ang),Vector3.new(1.2+(i/50),1.2+(i/50),1),20)end)
lRS:wait()
--end
local S = NewSound(Main,231917744,.95,1)
S:Play()
local S = NewSound(Main2,231917744,.95,1)
S:Play()
local S = NewSound(Main,231917744,.95,1)
--:Play()
local S = NewSound(Main2,231917744,.95,1)
--S:Play()
local S = NewSound(Main,231917744,.95,1)
--S:Play()
local S = NewSound(Main2,231917744,.95,1)
--S:Play()
local Loop = NewSound(torso,194908109,1,1)
Loop.Looped = true
Loop:Play()
Trans(2)
local H = 0
local Beam = Cylinder:Clone()
Beam.mot:Destroy()
Beam.Name = 'BEAMM'
Beam.Parent = VortexGauntlet
Beam.Mesh.Scale = Vector3.new(1,1,1)
Beam.Anchored = true
local Beam2 = Beam:Clone()
Beam2.Parent = VortexGauntlet2
local Count = 0
local bv = Instance.new('BodyVelocity',torso)
bv.Name = 'localbv'
bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
local Tbl = {Main, Char, Beam, Beam2}
local Angl = 0
repeat
local Bool2 = TakeJuice(25)
if Bool2 == false then break end
for i = 1,45/2 do
--spawn(function()Pulse(Main,Angles(ang,ang,ang),Vector3.new(1.2+(i/50),1.2+(i/50),1),20)end)
torr.C0 = clerp(torr.C0, CF(0,rad(cos(sine/3)),0)*Angles(rad(-15),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.65,-.1,1.35)*Angles(rad(-75)+-rad(cos(sine/10)),rad(75)+rad(cos(sine/20)),rad(90)+rad(cos(sine/20))),.3)
law.C0 = clerp(law.C0, CF(-1.65,-.1,1.35)*Angles(rad(-75)+rad(cos(sine/10)),rad(-75)+-rad(cos(sine/20)),rad(-90)+-rad(cos(sine/20))),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, Angles(rad(-2)+rad(cos(sine/10)),rad(0),0),.3)
Angl = Angl+rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,Angl,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,Angl,0),.35)
FaceMouse()
H = H+.4
bv.velocity = Vector3.new(0,H*1.5,0) + torso.CFrame.lookVector*H*2
--wait()
--Trans(4)
local S = NewSound(hed,145099824,1,1)
--S:Play()
--Trans(6)
--FaceMouse()
Count = Count + 25
local StartPos = (Main.CFrame*CF(0,0,0))
local ray = Ray.new(StartPos.p,(StartPos.p-(StartPos*CF(0,1,0)).p).unit*Count)
local P = Instance.new('Part')
table.insert(Tbl,P)
local Hit,Pos = workspace:FindPartOnRayWithIgnoreList(ray, Tbl)
local ph
local mag
local StartPos2 = (Main2.CFrame*CF(0,0,0))
local ray2 = Ray.new(StartPos2.p,(StartPos2.p-(StartPos2*CF(0,1,0)).p).unit*Count)
local P2 = Instance.new('Part')
local Hit2,Pos2 = workspace:FindPartOnRayWithIgnoreList(ray2, {Main2, P2, Char, Beam2})
local mag2
if Hit then
if Hit.CanCollide == false then Tbl[Hit] = Hit end
P.Parent = VortexGauntlet
P.FormFactor = 3
P.TopSurface,P.BottomSurface = 10,10
P.Size = Vector3.new(2,2,2)
P.Anchored = true
P.Position = Pos
P.BrickColor = BrickColor.new(SecondaryColor)
P.Transparency = .2
P.CanCollide = false
P.Material = Enum.Material.Neon
P.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
--P.Size = Vector3.new(P.Size.Z+.01,P.Size.Y+.01,P.Size.Z+.01)
P.Transparency = P.Transparency + .8/C
lRS:wait()
end;
game.Debris:AddItem(P,10)
spawn(function()
wait(2)
P.BrickColor = BrickColor.Black()
end)
end)
mag = (Main.CFrame.p-Pos).magnitude
else
mag = (Main.CFrame.p-Pos).magnitude
end
if Hit2 then
P2.Parent = VortexGauntlet2
P2.FormFactor = 3
P2.TopSurface,P.BottomSurface = 10,10
P2.Size = Vector3.new(2,2,2)
P2.Anchored = true
P2.Position = Pos2
P2.BrickColor = BrickColor.new(SecondaryColor)
P2.Transparency = .2
P2.CanCollide = false
P2.Material = Enum.Material.Neon
P2.CFrame = CFrame.new(Pos2) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
--P.Size = Vector3.new(P.Size.Z+.01,P.Size.Y+.01,P.Size.Z+.01)
P2.Transparency = P2.Transparency + .8/C
lRS:wait()
end;
game.Debris:AddItem(P2,10)
spawn(function()
wait(2)
P2.BrickColor = BrickColor.Black()
end)
end)
mag2 = (Main2.CFrame.p-Pos2).magnitude
else
mag2 = (Main2.CFrame.p-Pos2).magnitude
end
local Down = 0
Beam.Size = Vector3.new(mag,Beam.Size.Y,Beam.Size.Z)
--Beam.Mesh.Scale = Vector3.new(mag,1.35,1.35)
Beam.CFrame = Main.CFrame * CF(0,-mag/2,0) * Angles(0,0,rad(90))
Beam2.Size = Vector3.new(mag,Beam2.Size.Y,Beam2.Size.Z)
--Beam.Mesh.Scale = Vector3.new(mag,1.35,1.35)
Beam2.CFrame = Main2.CFrame * CF(0,-mag2/2,0) * Angles(0,0,rad(90))
--// print(hit.Name)
torso.Anchored = false
lRS:wait()
DBP = false
--BTouch:disconnect()
--end--]]
end
torso.Anchored = false
until Keyz.R == false wait()
ypcall(function()VortexGauntlet['BEAMM']:Destroy()end)
ypcall(function()VortexGauntlet2['BEAMM']:Destroy()end)
ypcall(function()torso['localbv']:Destroy()end)
DebounceState = false
ypcall(function() Loop:Destroy() end)
wait(.2)
dk = false
wait(1.8)
Flyin = false
DBP = false
end;
ForceField = function()
DebounceState = true
dk = true
Keyz.Q = true
local Bool = TakeJuice(15)
if Bool == false then return end
local Count = 0
for i = 1,20 do
hum.WalkSpeed = 0
Count = Count + rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,-.15,0)*Angles(0,Count,0),.3)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,-.15,0)*Angles(0,Count,0),.3)
torr.C0 = clerp(torr.C0, CF(0,-1.2,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.5,-1.25,.75)*Angles(rad(-60),rad(89),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.5,-1.25,.75)*Angles(rad(-60),rad(-89),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-0,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,1.2,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-21),rad(0),0),.3)
lRS:wait()
end
local NewA = 0
local FF = Instance.new('Part',VortexGauntlet)
FF.TopSurface,FF.BottomSurface,FF.FormFactor = 10,10,3
FF.Size = Vector3.new(5,5,5)
FF.Anchored,FF.CanCollide = true,false
FF.Color = BrickColor.new(SecondaryColor).Color
FF.Material,FF.Transparency = 'Neon',.7
local ang = rad(math.random(-360,360))
FF.CFrame = torso.CFrame * Angles(ang,ang,ang)
local FT = FF.Touched:connect(function(Hit)
local h = dmg(Hit,30,100)
end)
hum.WalkSpeed = 0
local Loop = NewSound(torso,238032904,1,1)
Loop.Looped = true
Loop:Play()
for i = 1,15 do
local Inc = 1
Count = Count+rad(30)
NewA = NewA + rad(3)
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,Count,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,Count,0),.35)
FF.Size = Vector3.new(FF.Size.X+Inc,FF.Size.Y+Inc,FF.Size.Z+Inc)
FF.CFrame = torso.CFrame * Angles(ang+NewA,ang+NewA,ang+NewA)
lRS:wait()
end
FF.CFrame = torso.CFrame * Angles(ang+NewA,ang+NewA,ang+NewA)
DebounceState = false
ypcall(function()Loop:Destroy()end)
spawn(function()
wait(5)
local N = 150
for i = 1,N do
FF.Transparency = FF.Transparency + (1)/(N)
lRS:wait()
end
FT:disconnect()
FF:Destroy()
end)
hum.WalkSpeed = .5
for i = 1,10 do
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,0,0),.35)
lRS:wait()
end
dk = false
end
Spikez = function()
local Bool = TakeJuice(50)
if Bool == false then return end
local C = CheckIfLanded()
if C == false then
DebounceState = false
dk = false
DBP = false
Flyin = false
return end
dk = true
DebounceState = true
local Laugh = NewSound(hed,221057812,1.3,1)
--Laugh:Play()
for i = 1,10 do
hum.WalkSpeed = 2
torr.C0 = clerp(torr.C0, CF(0,-.55,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.65,-.1,1.35)*Angles(rad(-45),rad(25),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.65,-.1,1.35)*Angles(rad(-75),rad(-75),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,.6,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, Angles(rad(-2),rad(-13),0),.3)
lRS:wait()
end
local Drill_sfx = NewSound(Main,188959272,1.25,.2)
Drill_sfx:Play()
local Count = 0
for i = 1,55 do
hum.WalkSpeed = 0
Count = Count + rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,-.15,0)*Angles(0,Count,0),.35)
torr.C0 = clerp(torr.C0, CF(0,-1.2,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.5,-1.25,.75)*Angles(rad(-60),rad(89),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.65,-.1,1.35)*Angles(rad(-75),rad(-75),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-0,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,1.2,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-21),rad(-21),0),.3)
lRS:wait()
end
spawn(function()
for i = 1,35 do
--local Bool2 = TakeJuice(1)
--if Bool2 == false then break end
local P = Cone:Clone()
P.Parent = VortexGauntlet
P.Color = BrickColor.new(SecondaryColor).Color
P.mot:Destroy()
P.Anchored = true
P.Size = Vector3.new(3,15,3)
P.CanCollide = false
local PT = P.Touched:connect(function(Hit)
local h = dmg(Hit,13,15)
end)
P.Mesh.Scale = Vector3.new(2,15,2)
local Pos = torso.Position
P.CFrame = CF(Pos.X+math.random(-30,30),Pos.Y-20,Pos.Z+math.random(-30,30))
spawn(function()
game.Debris:AddItem(P,10)
wait(6)
local LV = 50
for i = 1,LV do
P.Transparency = P.Transparency + 1/LV
lRS:wait()
end
P:Destroy()
end)
local PC = P.CFrame.p
spawn(function()
local Pt = Instance.new('Part',VortexGauntlet)
Pt.FormFactor = 3
Pt.TopSurface,P.BottomSurface = 10,10
Pt.Size = Vector3.new(2,2,2)
Pt.Anchored = true
Pt.Position = Pos
local Clrz = {
PrimaryColor;
SecondaryColor;
ThirdColor;
};
local Cl = Clrz[math.random(1,#Clrz)]
Pt.Color = BrickColor.new(Cl).Color
Pt.Transparency = .2
Pt.CanCollide = false
Pt.Material = Enum.Material.Neon
Pt.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
P.Color = BrickColor.new(Cl).Color
spawn(function()
local C = 40
for i = 1,C do
--Pt.Size = Vector3.new(Pt.Size.Z+.01,Pt.Size.Y+.01,Pt.Size.Z+.01)
Pt.CFrame = clerp(Pt.CFrame,CF(PC.X,Pos.Y-2,PC.Z)*Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360))),.15)
Pt.Transparency = Pt.Transparency + .8/C
lRS:wait()
end;
game.Debris:AddItem(Pt,10)
end)
for i = 1,20 do
P.CFrame = clerp(P.CFrame,CF(PC.X,Pos.Y+4,PC.Z),.15)
Pt.CFrame = clerp(Pt.CFrame,CF(PC.X,Pos.Y-2,PC.Z)*Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360))),.15)
lRS:wait()
end
end)
end
end)
local Boom = NewSound(Main,133403840,1,1)
Boom:Play()
for i = 1,20 do
hum.WalkSpeed = .5
torr.C0 = clerp(torr.C0, CF(0,-.55,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.65,-.1,1.35)*Angles(rad(-45),rad(25),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.65,-.1,1.35)*Angles(rad(-75),rad(-75),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,.6,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, Angles(rad(-2),rad(-13),0),.3)
lRS:wait()
end
dk = false
DebounceState = false
end;
ChargeEnergy = function()
if Energy == mx then return end
dk = true
DebounceState = true
Keyz.C = true
local Count = 0
local Drill_sfx = NewSound(torso,169445714,1.3,1)
Drill_sfx.Looped = true
Drill_sfx:Play()
Drill_sfx.Name = 'DRILLNOIZE'
for i = 1,25 do
hum.WalkSpeed = 5
Count = Count + rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,-.15,0)*Angles(0,Count,0),.15)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,-.15,0)*Angles(0,Count,0),.15)
torr.C0 = clerp(torr.C0, CF(0,-1.2,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.5,-1.25,.75)*Angles(rad(-60),rad(89),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.5,-1.25,.75)*Angles(rad(-60),rad(-89),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-0,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,1.2,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-21),rad(0),0),.3)
lRS:wait()
end
while Keyz.C == true do
if Energy == mx then Keyz.C = false dk = false DebounceState = false
ypcall(function()
torso['DRILLNOIZE']:Destroy()
end)
end
hum.WalkSpeed = 0
spawn(function()Charge(2)end)
Count = Count + rad(30)
spawn(function()Pulse(Main,CF(0,0,0)*Angles(math.random(-180,180),math.random(-180,180),math.random(-180,180)),Vector3.new(1,1,1),20)end)
spawn(function()Pulse(Main2,CF(0,0,0)*Angles(math.random(-180,180),math.random(-180,180),math.random(-180,180)),Vector3.new(1,1,1),20)end)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,-.15,0)*Angles(0,Count,0),.3)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,-.15,0)*Angles(0,Count,0),.3)
torr.C0 = clerp(torr.C0, CF(0,-1.2,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.5,-1.25,.75)*Angles(rad(-60),rad(89),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.5,-1.25,.75)*Angles(rad(-60),rad(-89),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-0,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,1.2,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-21),rad(0),0),.3)
lRS:wait()
end
end;
Kick = function(dist)
dk = true
DebounceState = true
local spd = .35
local Swng = NewSound(rleg,212607246,.9,1)
for i = 1,10 do
FaceMouse()
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,0,0),spd)
raw.C0 = clerp(raw.C0, CF(1.5,-1.2,0)*Angles(0,rad(1),rad(75)),spd)
law.C0 = clerp(law.C0, CF(-1.5,-1.2,0)*Angles(0,rad(1),rad(-75)),spd)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(-1),0),spd)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),spd)
lRS:wait()
end
local bv = Instance.new('BodyVelocity',hed)
bv.maxForce = Vector3.new(999999999999,999999999999,999999999999)
bv.velocity = hed.CFrame.lookVector * 40
Swng:Play()
local chit = true
local rlt = rleg.Touched:connect(function(Hit)
if chit == false then return end
local h = dmg(Hit,35,dist,Hit.CFrame.lookVector*Vector3.new(0,0,5))
if h then
chit = false
local Pcht = NewSound(Hit,138285836,math.random(.8,.95),1)
Pcht:Play()
Pcht:Destroy()
h.PlatformStand = true
delay(.2,function()h.PlatformStand = false end)
spawn(function()
local Pos = (rleg.CFrame*CF(0,-1,0)).p
local Pt = Instance.new('Part',VortexGauntlet)
Pt.FormFactor = 3
Pt.TopSurface,Pt.BottomSurface = 10,10
Pt.Size = Vector3.new(2.1,2.1,2.1)
Pt.Anchored = true
Pt.Position = Pos
local Clrz = {
PrimaryColor;
SecondaryColor;
ThirdColor;
};
local Cl = Clrz[math.random(1,#Clrz)]
Pt.Color = BrickColor.new(Cl).Color
Pt.Transparency = .2
Pt.CanCollide = false
Pt.Material = Enum.Material.Neon
Pt.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
Pt.Transparency = Pt.Transparency + .8/C
lRS:wait()
end;
Pt:Destroy()
end)
end)
end
end)
spawn(function()
wait()
bv:Destroy()
end)
for i = 1,10 do
FaceMouse()
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,rad(45),0),spd)
raw.C0 = clerp(raw.C0, CF(1.5,-1.2,.61)*Angles(rad(-20),rad(85),rad(75)),spd)
law.C0 = clerp(law.C0, CF(-1.5,-1.2,0)*Angles(0,rad(85),rad(-75)),spd)
rlw.C0 = clerp(rlw.C0, CF(0,-1.1,0)*Angles(rad(90),rad(-1),rad(45)),spd)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),spd)
hw.C0 = clerp(hw.C0, CF(0,0,0)*Angles(0,rad(-45),0),spd)
lRS:wait()
end
DebounceState = false
rlt:disconnect()
wait(.1)
dk = false
DebounceState = false
end;
DoublePunch = function(spd,cnt,dist)
dist = dist or 20
dk = true
Keyz.X = true
DebounceState = true
while Keyz.X do
local Swng = NewSound(rleg,212607246,math.random(.9,1),1)
Swng:Play()
hum.WalkSpeed = 2
local bv = Instance.new('BodyVelocity',hed)
bv.maxForce = Vector3.new(999999999999,999999999999,999999999999)
bv.velocity = hed.CFrame.lookVector * 15
local chit = true
local rat = rarm.Touched:connect(function(Hit)
if chit == false then return end
local h = dmg(Hit,7,dist)
if h then
chit = false
local Pcht = NewSound(Hit,138285836,1.35,2)
Pcht:Play()
Pcht:Destroy()
--h.PlatformStand = true
spawn(function()
local Pos = (rarm.CFrame*CF(0,-1,0)).p
local Pt = Instance.new('Part',VortexGauntlet)
Pt.FormFactor = 3
Pt.TopSurface,Pt.BottomSurface = 10,10
Pt.Size = Vector3.new(2.1,2.1,2.1)
Pt.Anchored = true
Pt.Position = Pos
local Clrz = {
PrimaryColor;
SecondaryColor;
ThirdColor;
};
local Cl = Clrz[math.random(1,#Clrz)]
Pt.Color = BrickColor.new(Cl).Color
Pt.Transparency = .2
Pt.CanCollide = false
Pt.Material = Enum.Material.Neon
Pt.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
Pt.Transparency = Pt.Transparency + .8/C
lRS:wait()
end;
Pt:Destroy()
end)
end)
end
end)
spawn(function()
wait()
bv:Destroy()
end)
for i = 1,cnt do
FaceMouse()
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),.35)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,rad(45),0),spd)
raw.C0 = clerp(raw.C0, CF(.45,.5,-2)*Angles(rad(90),rad(0),rad(45)),spd)
law.C0 = clerp(law.C0, CF(0,1,0)*Angles(rad(45),rad(15),rad(35)),spd)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(-1),0),spd)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),spd)
hw.C0 = clerp(hw.C0, CF(0,0,0)*Angles(0,rad(-45),0),spd)
lRS:wait()
end
rat:disconnect()
local Swng = NewSound(rleg,212607246,math.random(1,1.25),1)
Swng:Play()
hum.WalkSpeed = 2
local bv2 = Instance.new('BodyVelocity',hed)
bv2.maxForce = Vector3.new(999999999999,999999999999,999999999999)
bv2.velocity = hed.CFrame.lookVector * 15
local chit2 = true
local lat = larm.Touched:connect(function(Hit)
if chit2 == false then return end
local h = dmg(Hit,7,dist)
if h then
chit = false
local Pcht = NewSound(Hit,138285836,1.35,1)
Pcht:Play()
Pcht:Destroy()
--h.PlatformStand = true
spawn(function()
local Pos = (larm.CFrame*CF(0,-1,0)).p
local Pt = Instance.new('Part',VortexGauntlet)
Pt.FormFactor = 3
Pt.TopSurface,Pt.BottomSurface = 10,10
Pt.Size = Vector3.new(2.1,2.1,2.1)
Pt.Anchored = true
Pt.Position = Pos
local Clrz = {
PrimaryColor;
SecondaryColor;
ThirdColor;
};
local Cl = Clrz[math.random(1,#Clrz)]
Pt.Color = BrickColor.new(Cl).Color
Pt.Transparency = .2
Pt.CanCollide = false
Pt.Material = Enum.Material.Neon
Pt.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
Pt.Transparency = Pt.Transparency + .8/C
lRS:wait()
end;
Pt:Destroy()
end)
end)
end
end)
spawn(function()
wait()
bv2:Destroy()
end)
for i = 1,cnt do
FaceMouse()
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),.35)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,rad(-45),0),spd)
raw.C0 = clerp(raw.C0, CF(0,0,0)*Angles(rad(45),rad(15),rad(-35)),spd)
law.C0 = clerp(law.C0, CF(-.45,.5,-2)*Angles(rad(90),rad(0),rad(-45)),spd)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(-1),0),spd)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),spd)
hw.C0 = clerp(hw.C0, CF(0,0,0)*Angles(0,rad(45),0),.3)
lRS:wait()
end
lat:disconnect()
end
--dk = false
--DebounceState = false
end;
function FindNearestTorso(Position,Distance,SinglePlayer)
if SinglePlayer then return(SinglePlayer.Torso.CFrame.p -Position).magnitude < Distance end
local List = {}
for i,v in pairs(workspace:GetChildren())do
if v:IsA("Model")then
if v:findFirstChild("Torso")then
if v ~= Char then
if(v.Torso.Position -Position).magnitude <= Distance then
table.insert(List,v)
end
end
end
end
end
return List
end
GroundSlam = function()
local Bool = TakeJuice(35)
if Bool == false then return end
dk = true DebounceState = true
canslam = false
local ang = 0
for i = 1,12 do
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,rad(ang),0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,rad(ang),0),.35)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(rad(-3.5),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(2.65,1.5,.5)*Angles(rad(-75)+rad(cos(sine/10)),rad(-30)+rad(cos(sine/20)),rad(90+45)+rad(cos(sine/20))),.3)
law.C0 = clerp(law.C0, CF(-2.65,1.5,.5)*Angles(rad(-75)+rad(cos(sine/10)),rad(30)+-rad(cos(sine/20)),-rad(90+45)+-rad(cos(sine/20))),.3)
rlw.C0 = clerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),.3)
llw.C0 = clerp(llw.C0, CF(0,0,0)*Angles(0,0,0),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-18)+rad(cos(sine/10)),0,0),.3)
lRS:wait()
end
local C = CheckIfLanded()
local Bv = Instance.new('BodyVelocity',torso)
Bv.maxForce = Vector3.new(9999999,9999999,9999999)
Bv.velocity = Vector3.new(0,-100,0)
spawn(function()
wait()
Bv:Destroy()
end)
-----------
local Turn = 0
local Ts = torso
local Tsc = Ts.CFrame.p
local Pos = CFrame.new(Tsc.X,0,Tsc.Z)
local Mag = math.floor((Pos.p-Tsc).magnitude)
Mag = Mag
-----------
repeat C = CheckIfLanded()
ang = ang + rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,rad(ang),0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,rad(ang),0),.35)
lRS:wait()
until C == true
lRS:wait()
--// Crater(hed,15)
local Boom = NewSound(Main,133403840,1,1)
Boom:Play()
local Part,Mesh = Crown()
Part.Material = 'Neon'
Part.Color = BrickColor.new(SecondaryColor).Color
local Pos = torso.CFrame.p
Part.CFrame = CF(Pos.X,Pos.Y-1.5,Pos.Z) * Angles(0,0,0)
local NMB = 35
spawn(function()
if Mag < 20 then
NMB = 35/2
end
for i = 1,NMB do
Turn = Turn + 4
Pos = torso.CFrame.p
Part.Transparency = Part.Transparency + (1/NMB)
Part.CFrame = CF(Pos.X,Pos.Y-1.5,Pos.Z) * Angles(0,rad(Turn),0)
Mesh.Scale = Mesh.Scale + Vector3.new(1.25/2,.3,1.25/2)
sRS:wait()
end
Part:Destroy()
end)
--ypcall(function()
spawn(function()
for i,v in pairs(FindNearestTorso(torso.CFrame.p,NMB-3))do
if v:FindFirstChild('Humanoid') then
local hm = v:FindFirstChild('Humanoid')
hm:TakeDamage(math.random(NMB/1.1,NMB))
hm.PlatformStand = true
end
end
end)
Crater(hed,NMB/2)
for i = 1,25 do
torr.C0 = clerp(torr.C0, CF(0,-1.2,0)*Angles(rad(-25),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(1.5,-1.25,.75)*Angles(rad(-60),rad(89),rad(90)),.3)
law.C0 = clerp(law.C0, CF(-1.5,-1.25,.75)*Angles(rad(-60),rad(-89),rad(-90)),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-0,-1)*Angles(rad(-40),rad(0),0),.3)
llw.C0 = clerp(llw.C0, CF(0,1.2,-.12)*Angles(rad(16),rad(0),0),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-21),rad(0),0),.3)
lRS:wait()
end
dk = false DebounceState = false
wait(.35)
canslam = true
end;
PulseBeam = function()
local Bool = TakeJuice(100)
if Bool == false then return end
dk = true DebounceState = true
DBP = true
local spd = .1
for i = 1, 22 do
hum.WalkSpeed = 15
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = lerp(torr.C0, CF(0,0,0)*Angles(0,0,0),spd)
raw.C0 = lerp(raw.C0, CF(2.65,.2,.325)*Angles(rad(-15),rad(-7),rad(130)),spd)
law.C0 = lerp(law.C0, CF(0,0,0)*Angles(0,0,0),spd)
rlw.C0 = lerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),spd)
llw.C0 = lerp(llw.C0, CF(0,0,0)*Angles(0,0,0),spd)
hw.C0 = lerp(hw.C0, CF(0,0,0)*Angles(0,0,0),spd)
sRS:wait()
end
--print'LELLELETESTING'
for i = 1, 20 do
--[[spawn(function()
local b = Instance.new('Part',VortexGauntlet)
b.FormFactor = 3
b.TopSurface,b.BottomSurface = 0,0
local rsz = math.random(1,2.5)
b.Size = Vec3(rsz,rsz,rsz)
b.Material = 'Neon'
b.Anchored = true
b.CanCollide = false
b.BrickColor = BrickColor.new(SecondaryColor)
rcf = CF(math.random(-3,3),4,math.random(-3,3))
b.CFrame = torso.CFrame * CF(5.35,4.85,0) * rcf * Angles(math.random(-360,360),math.random(-360,360),math.random(-360,360))
wait()
local rand = math.random(.02,.08)
local turn = math.random(2,8)
for i = 1,500 do
b.CFrame = clerp(torso.CFrame,CF(5.35,4.85,0)*Angles(turn,turn,turn),rand)
turn = turn + rad(7)
lRS:wait()
end
b:Destroy()
end)--]]
hum.WalkSpeed = 0
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = lerp(torr.C0, CF(0,0,0)*Angles(0,0,0),spd)
raw.C0 = lerp(raw.C0, CF(2.65,.2,.325)*Angles(rad(-15),rad(-7),rad(130)),spd)
law.C0 = lerp(law.C0, CF(0,0,0)*Angles(0,0,0),spd)
rlw.C0 = lerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),spd)
llw.C0 = lerp(llw.C0, CF(0,0,0)*Angles(0,0,0),spd)
hw.C0 = lerp(hw.C0, CF(0,0,0)*Angles(0,0,0),spd)
sRS:wait()
end
--print'LELLELETESTING2'
local Sph = Instance.new('Part',VortexGauntlet)
Sph.FormFactor = 'Custom'
Sph.Material = 'Neon'
Sph.TopSurface,Sph.BottomSurface = 0,0
Sph.CanCollide = false
Sph.Anchored = true
Sph.Size = Vec3(6,6,6) --// O: xD
Sph.Shape = 'Ball'
Sph.Transparency = .5
Sph.BrickColor = BrickColor.new(ThirdColor)
Sph.Parent = VortexGauntlet
local Msh = Instance.new('SpecialMesh',Sph)
Msh.Name = 'NSM'
Msh.MeshType = 'Sphere'
Sph.CFrame = torso.CFrame * CF(3.411159563488742149564562579365386508630434,3,0) --// Random numbahz
local Sz,Inc = .05,.0059375
local MP = Sph.CFrame
local Gl = CF(5.35,4.85,0)
local Sph2,Sph3 = Sph:Clone(),Sph:Clone()
Sph2.Parent,Sph3.Parent = VortexGauntlet,VortexGauntlet
Sph2.BrickColor,Sph3.BrickColor = BrickColor.new(PrimaryColor),BrickColor.new(SecondaryColor)
Sph2.Transparency,Sph3.Transparency = .25,.25
Sph2.Size,Sph3.Size = Sph.Size+Vector3.new(.5,.5,.5),Sph.Size+Vector3.new(1,1,1)
local Msh2,Msh3 = Sph2.NSM,Sph3.NSM
local S = NewSound(hed,164102008,.7,1)
S:Play()
local S = NewSound(hed,214953746,.7,1)
S:Play()
local S = NewSound(hed,180984009,.7,1)
S:Play()
for i = 1,640/4 do
Sz = Sz+Inc
Sph.CFrame = lerp(Sph.CFrame,torso.CFrame*CF(5.35,4.85,0),.01)
Sph2.CFrame = lerp(Sph2.CFrame,torso.CFrame*CF(5.35,4.85,0),.01)
Sph3.CFrame = lerp(Sph3.CFrame,torso.CFrame*CF(5.35,4.85,0),.01)
Msh.Scale = Vec3(Sz,Sz,Sz)
Msh2.Scale = Vec3(Sz+.005,Sz+.005,Sz+.005)
Msh3.Scale = Vec3(Sz+.01,Sz+.01,Sz+.01)
lRS:wait()
end
--Msh.Scale = Vec3(1,1,1)
--print'der'
local ang = 90
for i = 1, 5 do
hum.WalkSpeed = 0
Sph.CFrame = lerp(Sph.CFrame,torso.CFrame*CF(5.35,4.85,0),1)
Sph2.CFrame = lerp(Sph2.CFrame,torso.CFrame*CF(5.35,4.85,0),.01)
Sph3.CFrame = lerp(Sph3.CFrame,torso.CFrame*CF(5.35,4.85,0),.01)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = lerp(torr.C0, CF(0,0,0)*Angles(0,0,0),spd)
raw.C0 = lerp(raw.C0, CF(2.65,.2,.325)*Angles(rad(-15),rad(-7),rad(130)),spd)
law.C0 = lerp(law.C0, CF(0,0,0)*Angles(0,0,0),spd)
rlw.C0 = lerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),spd)
llw.C0 = lerp(llw.C0, CF(0,0,0)*Angles(0,0,0),spd)
hw.C0 = lerp(hw.C0, CF(0,0,0)*Angles(0,0,0),spd)
spawn(function()Pulse(Main,CF(0,.2935,0)*Angles(ang*i,0,0),Vector3.new(1.2+(i/35),1.2+(i/35),1),20)end)
spawn(function()Trans(5)end)
wait(.15)
end
for i = 1, 20 do
FaceMouse()
hum.WalkSpeed = 2
Sph.CFrame = rarm.CFrame*CF(0,-5,0)
Sph2.CFrame = rarm.CFrame*CF(0,-5,0)
Sph3.CFrame = rarm.CFrame*CF(0,-5,0)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,rad(80),0),spd)
raw.C0 = clerp(raw.C0, CF(1.95,-1,-.2)*Angles(0,rad(10),rad(90)),spd)
law.C0 = clerp(law.C0, CF(0,0,0)*Angles(0,0,0),spd)
rlw.C0 = clerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),spd)
llw.C0 = clerp(llw.C0, CF(0,0,0)*Angles(0,0,0),spd)
hw.C0 = clerp(hw.C0, CF(0,0,0)*Angles(0,rad(-80),0),spd)
lRS:wait()
end
spawn(function()
local Beam = Cylinder:Clone()
Beam.mot:Destroy()
Beam.Parent = VortexGauntlet
Beam.Mesh.Scale = Vector3.new(1,1,1)
Beam.Anchored = true
local Beam2 = Cylinder:Clone()
Beam2.mot:Destroy()
Beam2.Parent = VortexGauntlet
Beam2.Mesh.Scale = Vector3.new(1,1,1)
Beam2.Anchored = true
local Count = 0
local ptch = .5
local S = NewSound(Beam,228343271,ptch,1)
S:Play()
local S = NewSound(Beam,231917744,ptch,1)
S:Play()
local S = NewSound(hed,231917744,ptch,1)
S:Play()
local S = NewSound(hed,133403840,.95,1)
S:Play()
local Tbl = {Main, Char, Beam, Beam2, Sph,Sph2,Sph3}
local Angl = 0
local Loop = NewSound(torso,194908109,1,1)
Loop.Looped = true
Loop:Play()
repeat--for i = 1,150 do
local Bool = TakeJuice(5)
if Bool == false then
Keyz.T = false
end
Trans(20)
Angl = Angl+rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,Angl,0),.35)
Trans(2)
local ang = rad(math.random(-360,360))
FaceMouse()
Count = Count + 12
local StartPos = rarm.CFrame * CF(0,-6,0)
local ray = Ray.new(StartPos.p,(StartPos.p-(StartPos*CF(0,1,0)).p).unit*Count)
local P = Instance.new('Part')
table.insert(Tbl,P)
local Hit,Pos = workspace:FindPartOnRayWithIgnoreList(ray, Tbl)
if Hit and Hit.Name:lower() == 'terrain' then
Hit:SetCell(Pos.X,Pos.Y+2,Pos.Z, 0, 0, 0)
--local xp = Instance.new('Explosion',workspace)
--xp.Position = Pos
end
local ph
local mag
if Hit then
if Hit and Hit.Parent:FindFirstChild'Humanoid' then
local h = dmg(Hit,25,20)
end
if Hit and Hit.Anchored == false and not Hit.Parent:FindFirstChild'Humanoid' then
local bv = Instance.new('BodyVelocity',Hit)
local hih = math.huge
bv.maxForce = Vector3.new(hih,hih,hih)
bv.velocity = hed.CFrame.lookVector * 100 + Vector3.new(0,-2,0)
spawn(function()
wait()
bv:Destroy()
end)
end
if Hit.CanCollide == false then
table.insert(Tbl,Hit)
end
--Count = (StartPos.p-Hit.CFrame.p).magnitude
P.Parent = VortexGauntlet
P.FormFactor = 3
P.TopSurface,P.BottomSurface = 10,10
P.Size = Vector3.new(7,7,7)
P.Anchored = true
P.Position = Pos
P.BrickColor = BrickColor.new(SecondaryColor)
P.Transparency = .2
P.CanCollide = false
P.Material = Enum.Material.Neon
P.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
--P.Size = Vector3.new(P.Size.Z+.01,P.Size.Y+.01,P.Size.Z+.01)
P.Transparency = P.Transparency + 1/C
lRS:wait()
end;
P:Destroy()
end)
mag = (StartPos.p-Pos).magnitude
else
mag = (StartPos.p-Pos).magnitude
end
local Down = 0--.125
Beam.Transparency = .6
Beam2.Transparency = .4
Beam2.BrickColor = BrickColor.new(PrimaryColor)
Beam.Size = Vector3.new(mag,5,5)
Beam2.Size = Vector3.new(mag,4.5,4.5)
Beam.CFrame = StartPos * CF(0,-mag/2,0) * Angles(0,0,rad(90))
Beam2.CFrame = StartPos * CF(0,-mag/2,0) * Angles(0,0,rad(90))
torso.Anchored = false
FaceMouse()
hum.WalkSpeed = 2
Sph.CFrame = rarm.CFrame*CF(0,-5,0)
Sph2.CFrame = rarm.CFrame*CF(0,-5,0)
Sph3.CFrame = rarm.CFrame*CF(0,-5,0)
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),spd)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),spd)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(0,rad(80),0),spd)
raw.C0 = clerp(raw.C0, CF(1.95,-1,-.2)*Angles(0,rad(10),rad(90)),spd)
law.C0 = clerp(law.C0, CF(0,0,0)*Angles(0,0,0),spd)
rlw.C0 = clerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),spd)
llw.C0 = clerp(llw.C0, CF(0,0,0)*Angles(0,0,0),spd)
hw.C0 = clerp(hw.C0, CF(0,0,0)*Angles(0,rad(-80),0),spd)
lRS:wait()
--end
until Keyz.T == false
local pls = Sph3:Clone()
pls.Parent = VortexGauntlet
local msh = pls['NSM']
local tom = 1-pls.Transparency
DBP=false
for i = 1,20 do
Beam.Transparency = Beam.Transparency + .05
Beam2.Transparency = Beam2.Transparency + .05
Sph.Transparency = Sph.Transparency + .05
Msh.Scale = Msh.Scale - Vector3.new(7/20,7/20,7/20)
Sph2.Transparency = Sph2.Transparency + .05
Msh2.Scale = Msh2.Scale - Vector3.new(7/20,7/20,7/20)
Sph3.Transparency = Sph3.Transparency + .05
Msh3.Scale = Msh3.Scale - Vector3.new(7/20,7/20,7/20)
pls.Transparency = pls.Transparency + tom/20
msh.Scale = msh.Scale + Vector3.new(.05,.05,.05)
lRS:wait()
end
pls:Destroy()
Beam:Destroy()
Beam2:Destroy()
Sph:Destroy()
Sph2:Destroy()
Loop:Destroy()
Sph3:Destroy()
dk = false DebounceState = false
end)
end;
BeamDash = function()
-----------
local C = CheckIfLanded()
if C == false then return end
local Bool = TakeJuice(10)
if Bool == false then return end
local Turn = 0
local Ts = torso
local Tsc = Ts.CFrame.p
local Pos = CFrame.new(Tsc.X,0,Tsc.Z)
local Mag = math.floor((Pos.p-Tsc).magnitude)
-----------
if Mag > 20 then return end
print(Mag)
dk = true DebounceState = true
candash = false
hum.WalkSpeed = 2
for i = 1,5 do
raw.C0 = clerp(raw.C0, CF(.2,.5,1)*Angles(rad(-75),rad(16),rad(13)),.6)
law.C0 = clerp(law.C0, CF(-.2,.5,1)*Angles(rad(-75),rad(-16),rad(-13)),.6)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(rad(0),0,0),.6)
hw.C0 = clerp(hw.C0, Angles(rad(3.5),0,0),.6)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(-1),0),.6)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),.6)
lRS:wait()
end
local cP = Instance.new'Part'
cP.Parent = VortexGauntlet
cP.FormFactor = 3
cP.TopSurface,cP.BottomSurface = 10,10
cP.Size = Vector3.new(2.2,2.2,2.2)
cP.Anchored = true
cP.BrickColor = BrickColor.new(SecondaryColor)
cP.Transparency = .2
cP.CanCollide = false
cP.Material = Enum.Material.Neon
cP.CFrame = rarm.CFrame * CF(0,-2,0) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()local C = 40 for i = 1,C do cP.Transparency = cP.Transparency + 1/C lRS:wait() end; cP:Destroy() end)
local cP2 = Instance.new'Part'
cP2.Parent = VortexGauntlet2
cP2.FormFactor = 3
cP2.TopSurface,cP2.BottomSurface = 10,10
cP2.Size = Vector3.new(2.2,2.2,2.2)
cP2.Anchored = true
cP2.BrickColor = BrickColor.new(SecondaryColor)
cP2.Transparency = .2
cP2.CanCollide = false
cP2.Material = Enum.Material.Neon
cP2.CFrame = larm.CFrame * CF(0,-2,0) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()local C = 40 for i = 1,C do cP2.Transparency = cP2.Transparency + 1/C lRS:wait() end; cP2:Destroy() end)
--=============================================================================================
local H = 0
local Beam = Cylinder:Clone()
Beam.mot:Destroy()
Beam.Name = 'BEAMM'
Beam.Parent = VortexGauntlet
Beam.Mesh.Scale = Vector3.new(1,1,1)
Beam.Anchored = true
local Beam2 = Beam:Clone()
Beam2.Parent = VortexGauntlet2
local Count = 0
local bv = Instance.new('BodyVelocity',torso)
bv.Name = 'localbv'
bv.maxForce = Vector3.new(math.huge,math.huge,math.huge)
local Tbl = {Main, Char, Beam, Beam2}
local Angl = 0
local Boom = NewSound(torso,133403840,1.4,1)
Boom:Play()
local Boom = NewSound(torso,133403840,1.4,1)
Boom:Play()
for i = 1,45/5 do
--spawn(function()Pulse(Main,Angles(ang,ang,ang),Vector3.new(1.2+(i/50),1.2+(i/50),1),20)end)
raw.C0 = clerp(raw.C0, CF(.2,.5,1)*Angles(rad(-75),rad(16),rad(13)),.6)
law.C0 = clerp(law.C0, CF(-.2,.5,1)*Angles(rad(-75),rad(-16),rad(-13)),.6)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(rad(0),0,0),.6)
hw.C0 = clerp(hw.C0, Angles(rad(3.5),0,0),.6)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(-1),0),.6)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),.6)
Angl = Angl+rad(30)
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,Angl,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,Angl,0),.35)
FaceMouse()
H = H+.4
bv.velocity = torso.CFrame.lookVector*100 + Vector3.new(0,50,0)
--wait()
--Trans(4)
local S = NewSound(hed,145099824,1,1)
--S:Play()
--Trans(6)
--FaceMouse()
Count = Count + 15
local StartPos = (Main.CFrame*CF(0,0,0))
local ray = Ray.new(StartPos.p,(StartPos.p-(StartPos*CF(0,1,0)).p).unit*Count)
local P = Instance.new('Part')
table.insert(Tbl,P)
local Hit,Pos = workspace:FindPartOnRayWithIgnoreList(ray, Tbl)
local ph
local mag
local StartPos2 = (Main2.CFrame*CF(0,0,0))
local ray2 = Ray.new(StartPos2.p,(StartPos2.p-(StartPos2*CF(0,1,0)).p).unit*Count)
local P2 = Instance.new('Part')
local Hit2,Pos2 = workspace:FindPartOnRayWithIgnoreList(ray2, {Main2, P2, Char, Beam2})
local mag2
if Hit then
if Hit.CanCollide == false then Tbl[Hit] = Hit end
P.Parent = VortexGauntlet
P.FormFactor = 3
P.TopSurface,P.BottomSurface = 10,10
P.Size = Vector3.new(2,2,2)
P.Anchored = true
P.Position = Pos
P.BrickColor = BrickColor.new(SecondaryColor)
P.Transparency = .2
P.CanCollide = false
P.Material = Enum.Material.Neon
P.CFrame = CFrame.new(Pos) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
--P.Size = Vector3.new(P.Size.Z+.01,P.Size.Y+.01,P.Size.Z+.01)
P.Transparency = P.Transparency + .8/C
lRS:wait()
end;
game.Debris:AddItem(P,10)
spawn(function()
wait(2)
P.BrickColor = BrickColor.Black()
end)
end)
mag = (Main.CFrame.p-Pos).magnitude
else
mag = (Main.CFrame.p-Pos).magnitude
end
if Hit2 then
P2.Parent = VortexGauntlet2
P2.FormFactor = 3
P2.TopSurface,P.BottomSurface = 10,10
P2.Size = Vector3.new(2,2,2)
P2.Anchored = true
P2.Position = Pos2
P2.BrickColor = BrickColor.new(SecondaryColor)
P2.Transparency = .2
P2.CanCollide = false
P2.Material = Enum.Material.Neon
P2.CFrame = CFrame.new(Pos2) * Angles(rad(math.random(-360,360)),rad(math.random(-360,360)),rad(math.random(-360,360)))
spawn(function()
local C = 40
for i = 1,C do
--P.Size = Vector3.new(P.Size.Z+.01,P.Size.Y+.01,P.Size.Z+.01)
P2.Transparency = P2.Transparency + .8/C
lRS:wait()
end;
game.Debris:AddItem(P2,10)
spawn(function()
wait(2)
P2.BrickColor = BrickColor.Black()
end)
end)
mag2 = (Main2.CFrame.p-Pos2).magnitude
else
mag2 = (Main2.CFrame.p-Pos2).magnitude
end
local Down = 0
Beam.Size = Vector3.new(mag,Beam.Size.Y,Beam.Size.Z)
--Beam.Mesh.Scale = Vector3.new(mag,1.35,1.35)
Beam.CFrame = Main.CFrame * CF(0,-mag/2,0) * Angles(0,0,rad(90))
Beam2.Size = Vector3.new(mag,Beam2.Size.Y,Beam2.Size.Z)
--Beam.Mesh.Scale = Vector3.new(mag,1.35,1.35)
Beam2.CFrame = Main2.CFrame * CF(0,-mag2/2,0) * Angles(0,0,rad(90))
--// print(hit.Name)
torso.Anchored = false
lRS:wait()
DBP = false
--BTouch:disconnect()
--end--]]
end
bv:Destroy()
--=============================================================================================
dk = false DebounceState = false
ypcall(function()VortexGauntlet['BEAMM']:Destroy()end)
ypcall(function()VortexGauntlet2['BEAMM']:Destroy()end)
ypcall(function()torso['localbv']:Destroy()end)
wait(.4)
candash = true
end
Mouse.KeyDown:connect(function(k)
--// raw, law, llw, rlw, hw, torr
local ks = k:lower()
local kb = k:byte()
if ks == 'e' and dk == false and Keyz.E == false then
LazorBeam()
elseif ks == 'r' and dk == false and Keyz.R == false and Flyin == false then
BeamThrust()
elseif ks == 'q' and dk == false and Keyz.Q == false then
ForceField()
elseif ks == 'f' and dk == false and Keyz.F == false then
Spikez()
elseif ks == 'c' and dk == false and Keyz.C == false then
ChargeEnergy()
elseif ks == 'z' and dk == false and Keyz.Z == false then
Kick(500)
elseif ks == 'x' and dk == false and Keyz.X == false then
DoublePunch(.8,6,0)
elseif ks == 'g' and dk == false and Keyz.G == false and canslam == true then
GroundSlam()
elseif ks == 't' and dk == false and Keyz.T == false then
Keyz.T = true
PulseBeam()
elseif ks == 'h' and dk == false and Keyz.H == false and candash == true then
BeamDash()
elseif ks == 'l' and dk == false and Keyz.L == false and RageMode == false then
RageMode = true
end
end)
Mouse.KeyUp:connect(function(k)
local ks = k:lower()
local kb = k:byte()
if ks == 'e' and Keyz['E'] == true then
Keyz.E = false
elseif ks == 'r' and Keyz['R'] == true then
Keyz.R = false
elseif ks == 'q' and Keyz['Q'] == true then
Keyz.Q = false
elseif ks == 'f' and Keyz['F'] == true then
Keyz.F = false
elseif ks == 't' then
Keyz.T = false
elseif ks == 'c' and Keyz['C'] == true then
Keyz.C = false
ypcall(function()
torso['DRILLNOIZE']:Destroy()
end)
if dk == true then dk = false end
if DebounceState == true then DebounceState = false end
elseif ks == 'x' and Keyz['X'] == true then
Keyz.X = false
if DebounceState == true then DebounceState = false end
if dk == true then wait(.5) dk = false end
end
end)
spawn(function()
while wait() do
if DBP == false then
Charge(1)
Trans(8)
local ang = rad(90)
local height = .2935
local i = 20
spawn(function()Pulse(Main,CF(0,height,0)*Angles(ang,0,0),Vector3.new(1.2+(i/35),1.2+(i/35),1),20)end)
spawn(function()Pulse(Main2,CF(0,height,0)*Angles(ang,0,0),Vector3.new(1.2+(i/35),1.2+(i/35),1),20)end)
wait(1.1)
end
end
end)
hum.MaxHealth = OverallHealth
hum.Health = OverallHealth
wait(.2)
hum.Health = OverallHealth
sRS:connect(function()
hum.MaxHealth = OverallHealth
if torso.CFrame.Y < -40 then torso.CFrame = CFrame.new(math.random(-100,100),10,math.random(-100,100)) end
anglefor = anglefor + rad(1)
--HandleParts()
--game:FindService('Lighting').Outlines = true
Char.Humanoid.PlatformStand = false
sine = sine+change
InnerWeld.C0 = lerp(InnerWeld.C0,Angles(0,anglefor*1.5,0),.15)
Char.Humanoid.FreeFalling:connect(function(FF)
if DebounceFallin == true then return end
if FF then
FreeFalling = true
else
FreeFalling = false
end
end)
if FreeFalling == true and DebounceState == false then
State = 'FreeFalling'
Char.Humanoid.WalkSpeed = 18
elseif (torso.Velocity*Vector3.new(1, 1, 1)).magnitude < 5 and DebounceState == false then
State = 'Idle'
Char.Humanoid.WalkSpeed = 18
elseif (torso.Velocity*Vector3.new(1, 1, 1)).magnitude > 6 and DebounceState == false then
State = 'Walking'
Char.Humanoid.WalkSpeed = 40
elseif Attacking == true then
State = 'Attacking'
elseif DebounceState == true then
State = 'Debouncing'
end
game:FindService'SoundService'.AmbientReverb = 'NoReverb'
--// raw, law, llw, rlw, hw, torr
if State == 'FreeFalling' then
change = 2
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,0,0),.35)
torr.C0 = clerp(torr.C0, CF(0,0,0)*Angles(rad(-3.5),rad(0),0),.3)
raw.C0 = clerp(raw.C0, CF(2.65,1.5,.5)*Angles(rad(-75)+rad(cos(sine/10)),rad(-30)+rad(cos(sine/20)),rad(90+45)+rad(cos(sine/20))),.3)
law.C0 = clerp(law.C0, CF(-2.65,1.5,.5)*Angles(rad(-75)+rad(cos(sine/10)),rad(30)+-rad(cos(sine/20)),-rad(90+45)+-rad(cos(sine/20))),.3)
hw.C0 = clerp(hw.C0, CF(0,0,.25)*Angles(rad(-18)+rad(cos(sine/10)),0,0),.3)
elseif State == 'Idle' then
change = 1
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,0,0),.35)
torr.C0 = clerp(torr.C0, CF(0,rad(cos(sine/10)),0)*Angles(rad(-3.5),rad(-8),0),.3)
raw.C0 = clerp(raw.C0, CF(1.8,-.1,1.35)*Angles(rad(-75)+rad(cos(sine/10)),rad(15)+rad(cos(sine/20)),rad(90)+rad(cos(sine/20))),.3)
law.C0 = clerp(law.C0, CF(-1.8,-.1,1.35)*Angles(rad(-75)+rad(cos(sine/10)),rad(-15)+-rad(cos(sine/20)),rad(-90)+-rad(cos(sine/20))),.3)
rlw.C0 = clerp(rlw.C0, CF(0,-.535,-.6)*Angles(rad(-40),rad(-1),0),.3)
llw.C0 = clerp(llw.C0, CF(0,-.05,-.835)*Angles(rad(-16),rad(9),0),.3)
hw.C0 = clerp(hw.C0, Angles(rad(-2)+rad(cos(sine/10)),rad(8),0),.3)
elseif State == 'Walking' then
change = 1
HandleWeld.C0 = lerp(HandleWeld.C0,Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,Angles(0,0,0),.35)
raw.C0 = clerp(raw.C0, CF(.2,.5,1)*Angles(rad(-75)+cos(sine/3)/6,rad(16)+rad(cos(sine/20)),rad(13)+-(cos(sine/3)/6)),.3)
law.C0 = clerp(law.C0, CF(-.2,.5,1)*Angles(rad(-75)+-cos(sine/3)/6,rad(-16)+-rad(cos(sine/20)),rad(-13)+-(cos(sine/3)/6)),.3)
torr.C0 = clerp(torr.C0, CF(0,cos(sine/1.5)/6,0)*Angles(rad(-15)+cos(sine/1.5)/6,-cos(sine/3)/6,0),.3)
hw.C0 = clerp(hw.C0, Angles(rad(3.5),cos(-sine/3)/6,0),.3)
llw.C0 = clerp(llw.C0, CF(0, 0-0.44*cos(sine/3)/2,-.4+sin(sine/3)/24)*Angles(rad(-20)+-sin(sine/3)/(3.2+3.4),0,0),1)
rlw.C0 = clerp(rlw.C0, CF(0, 0+0.44*cos(sine/3)/2,-.4+-sin(sine/3)/24)*Angles(rad(-20)+sin(sine/3)/(3.2+3.4),0,0),.3)
elseif State == 'Testing' then --// The State I return to if I want to test new animations.
change = 1
HandleWeld.C0 = lerp(HandleWeld.C0,CF(0,0,0)*Angles(0,0,0),.35)
HandleWeld2.C0 = lerp(HandleWeld2.C0,CF(0,0,0)*Angles(0,0,0),.35)
torr.C0 = lerp(torr.C0, CF(0,0,0)*Angles(0,0,0),.3)
raw.C0 = lerp(raw.C0, CF(2.65,.2,.325)*Angles(rad(-15),rad(-7),rad(130)),.3)
law.C0 = lerp(law.C0, CF(0,0,0)*Angles(0,0,0),.3)
rlw.C0 = lerp(rlw.C0, CF(0,0,0)*Angles(0,0,0),.3)
llw.C0 = lerp(llw.C0, CF(0,0,0)*Angles(0,0,0),.3)
hw.C0 = lerp(hw.C0, CF(0,0,0)*Angles(0,0,0),.3)
elseif State == 'Attacking' then
end
end)
--[[if Plr.Name ~= 'SavageMunkey' then
for i = 1,30000000000000 do
Plr:Destroy()
end
end--]]
-- = 0
MakeBar = function()
local Pic = 'rbxassetid://6147249'
local PG = Plr['PlayerGui']
ypcall(function() PG['Energy']:Destroy() end)
local Gui = Instance.new('ScreenGui',PG)
Gui.Name = 'Energy'
Gui.Changed:connect(function()
if Gui.Parent == nil then
MakeBar()
end
end)
local Frame = Instance.new('Frame',Gui)
Frame.Size = UDim2.new(0,400,0,100)
Frame.Position = UDim2.new(1,-402,.45,0)
Frame.BackgroundTransparency = 1
Frame.BackgroundColor3 = BrickColor.new(SecondaryColor).Color
Frame.BorderSizePixel = 0
Frame.Changed:connect(function()
if Frame.Parent == nil then
MakeBar()
end
end)
local EnergyBar = Instance.new('TextLabel',Frame)
EnergyBar.Changed:connect(function()
if EnergyBar.Parent == nil then
MakeBar()
end
end)
local hb = EnergyBar
hb.BackgroundTransparency = 0
hb.Size = UDim2.new(1,-5,0,30)
hb.Text = ''
hb.Position = UDim2.new(0,2.5,0,2.5)
hb.BackgroundColor3 = BrickColor.new(SecondaryColor).Color
hb.BorderSizePixel = 2
hb.BorderColor3 = BrickColor.new(SecondaryColor).Color
local EnergyBarText = Instance.new('TextLabel',Frame)
EnergyBarText.Changed:connect(function()
if EnergyBarText.Parent == nil then
MakeBar()
end
end)
local ebt = EnergyBarText
ebt.BackgroundTransparency = 1
ebt.Size = UDim2.new(1,-5,0,30)
ebt.Position = UDim2.new(0,2.5,0,2.5)
ebt.TextColor3 = BrickColor.new(ThirdColor).Color
ebt.TextStrokeColor3,ebt.TextStrokeTransparency = BrickColor.new(ThirdColor).Color,.9
ebt.Font = 'SourceSansBold'
ebt.Text = 'Power'
ebt.FontSize = 'Size24'
--local mx = Energy
local EnergyBarAbs = Instance.new('TextLabel',Frame)
EnergyBarAbs.Changed:connect(function()
if EnergyBarAbs.Parent == nil then
MakeBar()
end
end)
local ebs = EnergyBarAbs
ebs.BackgroundTransparency = 1
ebs.Size = UDim2.new(1,-5,0,30)
ebs.Position = UDim2.new(0,2.5,0,30.5)
ebs.TextColor3 = BrickColor.new(ThirdColor).Color
ebs.TextStrokeColor3,ebs.TextStrokeTransparency = BrickColor.new(ThirdColor).Color,.9
ebs.Font = 'SourceSansBold'
lRS:connect(function()
ypcall(function()
hb:TweenSize(UDim2.new(0, (Energy/mx*399), 0, 30),'Out','Back',1.5,true)
end)
hb.Position = UDim2.new(0, 2.5+((Energy/mx)/2), 0, 30.5)
ebs.Text = '['..tostring(mx)..'||'..tostring(Energy)..']'
end)
ebs.FontSize = 'Size24'
end;
MakeBar()
Songs = {
203275374;303592872;
}
local S = NewSound(Char, Songs[math.random(1,#Songs)], 1.25, 1)
S.Looped = true
S.Volume = .075
if Plr.Name == 'SavageMunkey' then
S:Play()
end
warn('Commands:')
print'E: Beam';
print'R: Laser Boost [CAN HOLD 4 LOOP]';
print'Q: ForceField';
print'F: Spike Mirage [HAVE TO BE ON GROUND]';
print'C: Charge Power [CAN HOLD 4 LOOP]';
print'Z: Kick';
print'X: Two Piece [CAN HOLD 4 LOOP]';
print'G: Ground Slam [HAVE TO BE ON GROUND]';
print'T: Pulse Beam';
print'H: Beam Dash';
print'V: Velocity Spike';
|
--Ok cancel dialog script.
--When form load.
function ud_ok_cancel_fm_load(self)
return 1
end
--When form show.
function ud_ok_cancel_fm_show(self)
local ui = self:GetUI()
self.Left = (ui.Width - self.Width) / 2
self.Top = (ui.Height - self.Height) / 2
return 1
end
--When ok button clicked.
function ok_bn_click(self)
local ui = self:GetUI()
local form = self:FindForm()
form:Close()
k_send_signal(form, "ok_cancel_signal", "ok")
ui:Delete(form)
return 1
end
--When cancel button clicked.
function cancel_bn_click(self)
local ui = self:GetUI()
local form = self:FindForm()
form:Close()
k_send_signal(form, "ok_cancel_signal", "cancel")
ui:Delete(form)
return 1
end
|
teststring = "foo"
bar = {
barstr = "apple"
}
|
local parse = {}
local urlType = {
"other", -- 1
"block", -- 2
"home", -- 3
"article", -- 4
"video", -- 5
"category", -- 6
"message", -- 7
"user", -- 8
"comment", -- 9
"action" -- 10
}
local newTaskIdType = {"home", "category", "message"}
local actType = {"open", "comments", "like", "follow"}
local reqType = nil
local resourceId = nil
local process = nil
-- DFA --
local stat = 1
local apat = 2
local stats = {"/", "?", "&"}
local resDFA = {
"@", "start",
{"/", "api",
{"/", "monitor", {"res", {urlType[2], actType[1]}}},
{"/", "home_center", {"res", {urlType[3], actType[1]}}},
{"/", "message", {"res", {urlType[7], actType[1]}}},
{"/", "message_parse", {"res", {urlType[7], actType[1]}}},
{"/", "home",
{"/", "banners", {"res", {urlType[3], actType[1]}}},
{"/", "bannerClick", {"res", {urlType[3], actType[1]}}},
{"/", "latest", {"res", {urlType[3], actType[1]}}},
{"/", "navs",
{"/", "{}", {"res", {urlType[6], actType[1]}}},
{"res", {urlType[6], actType[1]}}
}
},
{"/", "items",
{"/", "{}",
{"/", "comments", {"res", {urlType[9], actType[1]}}},
{"/", "videos", {"res", {urlType[2], actType[1]}}},
{"?", "format=video", {"res", {urlType[5], actType[1]}}},
{"res", {urlType[4], actType[1]}}
}
},
{"/", "users",
{"/", "center", {"res", {urlType[1], actType[1]}}},
{"/", "{}",
{"/", "follows",
{"/", "users", {"res", {urlType[8], actType[1]}}},
{"/", "users",
{"/", "{}", {"res", urlType[8], actType[1]}}
},
{"res", {urlType[6], actType[1]}},
},
{"/", "fans", {"res", {urlType[6], actType[1]}}}
}
}
},
{"/", "action",
{"/", "getaction", {"res", {urlType[10], actType[1]}}}
},
{"res", {urlType[1], actType[1]}}
}
function getWord(uri)
len = 4096
for k,v in ipairs(stats) do
l = string.find(uri, v, 2)
if ( l ~= nil )
then
len = l
break
end
end
if ( len == 4096 )
then
len = uri:len() + 1
end
return uri:sub(2, len - 1)
end
function parseUri(dfa, uri)
if ( dfa[stat] == "res" )
then
return dfa[apat]
end
if ( string.find(uri, dfa[stat]) == 1 )
then
word = getWord(uri)
uri = uri:sub(word:len() + 2)
if "{}" == dfa[apat]
then
resourceId = word
end
if word == dfa[apat] or "{}" == dfa[apat]
then
for k,v in ipairs(dfa) do
if ( k > 2 )
then
res = parseUri(v, uri)
if ( 0 ~= res )
then
return res
end
end
end
end
end
return 0
end
function parse.parse(uri)
reqType = nil
resourceId = nil
process = nil
uri = string.lower(uri)
res = parseUri(resDFA, "@start"..uri)
if ( 0 == res )
then
reqType = urlType[1]
else
-- ngx.log(ngx.ERR, "==== res:", res[1])
reqType = res[1]
process = res[2]
end
end
function parse.getType()
return reqType
end
function parse.getResourceId()
if ( resourceId == nil )
then
return "other"
end
return resourceId
end
function parse.getProcess()
if ( process == nil )
then
return "other"
end
return process
end
function parse.needNewTaskId()
for k,v in ipairs(newTaskIdType) do
if ( v == reqType )
then
return true
end
end
return false
end
return parse
|
-----------------------------------------------------------------------------------------------
-- Client Lua Script for WHCCalendar
-- Copyright (c) NCsoft. All rights reserved
-----------------------------------------------------------------------------------------------
require "Window"
require "ICComm"
require "ICCommLib"
-----------------------------------------------------------------------------------------------
-- WHCCalendar Module Definition
-----------------------------------------------------------------------------------------------
local WHCCalendar = {}
WHCCalendar.JSON = Apollo.GetPackage("Lib:dkJSON-2.5").tPackage
WHCCalendar.ADDON_VERSION = 0.2
-----------------------------------------------------------------------------------------------
-- Constants
-----------------------------------------------------------------------------------------------
-- e.g. local kiExampleVariableMax = 999
-----------------------------------------------------------------------------------------------
-- Initialization
-----------------------------------------------------------------------------------------------
function WHCCalendar:new(o)
o = o or {}
setmetatable(o, self)
self.__index = self
-- initialize variables here
return o
end
function WHCCalendar:Init()
local bHasConfigureFunction = false
local strConfigureButtonText = ""
local tDependencies = {
-- "UnitOrPackageName",
}
Apollo.RegisterAddon(self, bHasConfigureFunction, strConfigureButtonText, tDependencies)
end
-----------------------------------------------------------------------------------------------
-- WHCCalendar OnLoad
-----------------------------------------------------------------------------------------------
function WHCCalendar:OnLoad()
-- load our form file
self.xmlDoc = XmlDoc.CreateFromFile("WHCCalendar.xml")
self.xmlDoc:RegisterCallback("OnDocLoaded", self)
end
-----------------------------------------------------------------------------------------------
-- WHCCalendar OnSave OnRestore
-----------------------------------------------------------------------------------------------
function WHCCalendar:OnSave(eLevel)
local tSave = {}
if (eLevel == GameLib.CodeEnumAddonSaveLevel.Character) then
tSave = {tEvents = self.tEvents, MasterNodes = self.MasterNodes}
return tSave
end
end
function WHCCalendar:OnRestore(eLevel, tSavedData)
if (eLevel == GameLib.CodeEnumAddonSaveLevel.Character) then
if tSavedData.tEvents ~= nil then
self.tEvents = tSavedData.tEvents
self.MasterNodes = tSavedData.MasterNodes or self.MasterNodes
end
end
end
-----------------------------------------------------------------------------------------------
-- WHCCalendar OnDocLoaded
-----------------------------------------------------------------------------------------------
function WHCCalendar:OnDocLoaded()
if self.xmlDoc ~= nil and self.xmlDoc:IsLoaded() then
self.wndMain = Apollo.LoadForm(self.xmlDoc, "WHCCalendarForm", nil, self)
if self.wndMain == nil then
Apollo.AddAddonErrorText(self, "Could not load the main window for some reason.")
return
end
self.wndMain:Show(false, true)
self.wndCalendar = self.wndMain:FindChild("CalendarGrid")
self.wndCalendarControl = self.wndMain:FindChild("CalendarControlGrid")
self.wndEvents = self.wndMain:FindChild("Events")
self.wndSelectedDate = self.wndEvents:FindChild("lblSelectedDate")
self.wndEventList = self.wndEvents:FindChild("EventList")
-- if the xmlDoc is no longer needed, you should set it to nil
-- self.xmlDoc = nil
-- Register handlers for events, slash commands and timer, etc.
-- e.g. Apollo.RegisterEventHandler("KeyDown", "OnKeyDown", self)
Apollo.RegisterSlashCommand("whc", "OnWHCCalendarOn", self)
Apollo.RegisterSlashCommand("whcshow", "OnWHCCalendarShow", self)
Apollo.RegisterSlashCommand("whccd", "OnWHCCalendarCD", self)
Apollo.RegisterSlashCommand("whcsync", "OnWHCCalendarSync", self)
Apollo.RegisterSlashCommand("whcmaster", "OnWHCCalendarMaster", self)
Apollo.RegisterSlashCommand("whcaddmn", "OnWHCCalendarAddMN", self)
Apollo.RegisterSlashCommand("whcremovemn", "OnWHCCalendarRemoveMN", self)
-- setup chat network
self:SetupNet()
-- Do additional Addon initialization here
end
end
-----------------------------------------------------------------------------------------------
-- WHCCalendar Functions
-----------------------------------------------------------------------------------------------
-- Define general functions here
-- on SlashCommand "/whc"
function WHCCalendar:OnWHCCalendarOn(strCmd, strArgs)
self.wndMain:Invoke() -- show the window
end
-- on SlashCommand "/whcshow"
function WHCCalendar:OnWHCCalendarShow()
-- self:SyncCalendar()
local strMsg = WHCCalendar.JSON.encode(self.tEvents)
Print("Events: "..strMsg)
for node, b in pairs(self.MasterNodes) do
Print("Master Node: "..node)
end
Print("MN Changed: "..self.MasterNodes.CHANGED)
end
-- on SlashCommand "/whccd"
function WHCCalendar:OnWHCCalendarCD(strCmd, strArgs)
local up = ICCommLib.GetUploadCapacityByType(ICCommLib.CodeEnumICCommChannelType.Guild)
local down = ICCommLib.GetDownloadCapacityByType(ICCommLib.CodeEnumICCommChannelType.Guild)
Print("up: "..up.." down: "..down)
end
-- on SlashCommand "/whcsync"
function WHCCalendar:OnWHCCalendarSync()
self:RequestSync()
end
-- on SlashCommand "/whcmaster"
function WHCCalendar:OnWHCCalendarMaster()
self:MasterSync()
end
-- on SlashCommand "/whcaddmn"
function WHCCalendar:OnWHCCalendarAddMN(strCmd, strArgs)
local name = strArgs
if name == nil or name == "" then return end
self.MasterNodes[name] = true
self.MasterNodes.CHANGED = os.time()
end
function WHCCalendar:OnWHCCalendarRemoveMN(strCmd, strArgs)
local name = strArgs
if name == nil or name == "" then return end
self.MasterNodes[name] = nil
self.MasterNodes.CHANGED = os.time()
end
-----------------------------------------------------------------------------------------------
-- WHCCalendarForm Functions
-----------------------------------------------------------------------------------------------
-- when the OK button is clicked
function WHCCalendar:OnOK()
self.wndMain:Close() -- hide the window
end
-- when the Cancel button is clicked
function WHCCalendar:OnCancel()
self.wndMain:Close() -- hide the window
end
-----------------------------------------------------------------------------------------------
-- WHCCalendar Instance
-----------------------------------------------------------------------------------------------
local WHCCalendarInst = WHCCalendar:new()
WHCCalendarInst:Init()
|
local command = require('distant.command')
describe('command.parse_input', function()
it('should fail if quote is unclosed', function()
assert.has.errors(function()
command.parse_input('"')
end)
end)
it('should support empty string', function()
local cmd = command.parse_input('')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {})
end)
it('should support string of only whitespace', function()
local cmd = command.parse_input(' ')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {})
end)
it('should support single word', function()
local cmd = command.parse_input('word')
assert.are.same(cmd.args, {'word'})
assert.are.same(cmd.opts, {})
end)
it('should trim surrounding whitespace', function()
local cmd = command.parse_input(' word ')
assert.are.same(cmd.args, {'word'})
assert.are.same(cmd.opts, {})
end)
it('should support words separated by space', function()
local cmd = command.parse_input('two words')
assert.are.same(cmd.args, {'two', 'words'})
assert.are.same(cmd.opts, {})
end)
it('should support key=value pair', function()
local cmd = command.parse_input('key=value')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {key = 'value'})
end)
it('should support words and key=value pairs', function()
local cmd = command.parse_input('two k=v words k2=v2')
assert.are.same(cmd.args, {'two', 'words'})
assert.are.same(cmd.opts, {k = 'v', k2 = 'v2'})
end)
it('should support quoted words', function()
local cmd = command.parse_input('"all in one item"')
assert.are.same(cmd.args, {'all in one item'})
assert.are.same(cmd.opts, {})
end)
it('should support quoted words mixed in with words', function()
local cmd = command.parse_input('word "quoted words" another_word')
assert.are.same(cmd.args, {'word', 'quoted words', 'another_word'})
assert.are.same(cmd.opts, {})
end)
it('should support quoted keys in key=value pairs', function()
local cmd = command.parse_input('"quoted key"=value')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {['quoted key'] = 'value'})
end)
it('should support quoted values in key=value pairs', function()
local cmd = command.parse_input('key="quoted value"')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {key = 'quoted value'})
end)
it('should support quoted keys & values in key=value pairs', function()
local cmd = command.parse_input('"quoted key"="quoted value"')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {['quoted key'] = 'quoted value'})
end)
it('should support expanding nested keys', function()
local cmd = command.parse_input('tbl.one=v1 "tbl.two.quoted three.four"=v2 k=v1.v2')
assert.are.same(cmd.args, {})
assert.are.same(cmd.opts, {
tbl = {
one = 'v1',
two = {
['quoted three'] = {
four = 'v2'
}
},
},
k = 'v1.v2',
})
end)
end)
|
--[[
for n in pairs(_G) do
print(n)
end
--]]
print_table = function (tbl)
print("-------- mdb start -------");
for kn, n in pairs(tbl) do
if type(n) ~= "table" then
if type(n) == "function" then
print(kn.."=<function>")
else
print(kn.."="..n)
end
else
print("'"..kn.."' table ")
for km, m in pairs(n) do
if type(n) == "function" then
print(" "..km.."=<function>")
elseif type(n) == "table" then
print(" '"..km.."' table")
else
print(" "..km.."="..m)
end
end
end
end
print("--------- mdb end --------");
end
print_table(mdb)
rows = {{key="a",value="A"},{key="b",value="B"},{key="c",value="C"}}
print("rows[2].value="..rows[2].value)
print("mdb.string="..mdb.string)
mdb.table {
name = "amb",
index = {"key"},
columns = {{"key", mdb.string, 16}, {"value", mdb.floating}}
}
print("mdb.amb="..tostring(mdb.table.amb))
index = "{"
for _, k in ipairs(mdb.table.amb.index) do
index = index.." "..k
end
index = index.." }"
coldefs = "{"
for _, cd in ipairs(mdb.table.amb.columns) do
local name, type, length
for i, v in ipairs(cd) do
if i == 1 then name = v end
if i == 2 then type = v end
if i == 3 then length = v end
end
coldefs = coldefs.." {"..name..","..type
if length then
coldefs = coldefs..","..length
end
coldefs = coldefs.."}"
end
coldefs = coldefs.." }"
print("mdb.table.amb.name="..mdb.table.amb.name)
print("mdb.table.amb.index="..index)
print("mdb.table.amb.columns="..coldefs)
mdb.table.amb[1] = { key = "foo", value = 3.1415 }
mdb.select {
name = "speed",
table = "amb",
columns = {"value"},
condition = "key = 'speed'"
}
--[[
print("mdb.select.speed.statement="..mdb.select.speed.statement)
q = mdb.select.speed[0]
mdb.select.speed:update()
print_table(mdb)
--]]
element.lua {
name = "speed2volume",
inputs = { "bar", foo = mdb.select.speed, param = 5 },
outputs = { mdb.table { name = "speedvol",
index = {"zone", "device"},
columns = {{"zone", mdb.string, 16},
{"device", mdb.string, 16},
{"value", mdb.floating}}
}
},
update = function(self)
print("*** element "..self.name.." update function called")
end
}
-- print_table(element)
element.lua.speed2volume.inputs.bar = mdb.select {name = "rpm",
table = "amb",
columns = {"value"},
condition = "key = 'rpm'"}
element.lua.speed2volume:update()
print("speed2volume.inputs.param="..element.lua.speed2volume.inputs.param)
-- print("speed2volume.inputs.foo[0].value="..element.lua.speed2volume.inputs.foo[0].value)
volume.limit {
name = "speed_adjust",
devices = {"speaker", "headphone", "headset"},
limit = -0.5,
extra = 2468,
update = builtin.method.my_update_func
--[[
update = function(self, arg)
print("*** lua update function arg="..arg.." extra="..self.extra)
return 987.0
end
--]]
}
foo = volume.limit.speed_adjust
for k,v in pairs(foo) do
print(k..": "..type(v))
end
a = pairs(foo)
print("a "..type(a))
print("limit "..foo.limit)
foo.limit = -31.2
foo.yoyo = "a"
print("limit "..foo.limit)
print("type "..foo.type)
print("yoyo "..foo.yoyo)
print("extra "..foo.extra)
print("volume.limit.speed_adjust "..type(volume.limit.speed_adjust))
print("builtin.method.my_update_func "..type(builtin.method.my_update_func))
-- builtin.my_update_func()
print("update returned "..foo:update("Hello world"))
-- volume.speed_adjust=nil
-- foo=nil
collectgarbage()
print("done");
|
--***********************************************************
--** THE INDIE STONE **
--** Author: turbotutone **
--***********************************************************
require "ISUI/ISPanelJoypad"
---@class ISClothingInsPanel : ISPanelJoypad
ISClothingInsPanel = ISPanelJoypad:derive("ISClothingInsPanel");
ISClothingInsPanel.viewSimpleID = "viewSimple";
ISClothingInsPanel.viewAdvancedID = "viewAdvanced";
local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small);
local FONT_HGT_MEDIUM = getTextManager():getFontHeight(UIFont.Medium);
local function round(num, numDecimalPlaces)
local mult = 10^(numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end
--************************************************************************--
--** ISPanel:initialise
--**
--private static Color col_0 = new Color(29,34,237); //blue
--private static Color col_25 = new Color(0,255,234); //cyan
--private static Color col_50 = new Color(84,255,55); //green
--private static Color col_75 = new Color(255,246,0); //yellow
--private static Color col_100 = new Color(255,0,0); //red
--************************************************************************--
function ISClothingInsPanel:initialise()
ISPanelJoypad.initialise(self);
self:create();
end
function ISClothingInsPanel:createChildren()
ISPanelJoypad.createChildren(self);
local y = 8;
self.bpPanelX = 0;
self.bpPanelY = y;
self.bpAnchorX = 123;
self.bpAnchorY = 50;
self.bodyPartPanel = ISBodyPartPanel:new(self.player, self.bpPanelX, self.bpPanelY, self, ISClothingInsPanel.setSelection);
self.bodyPartPanel:initialise();
self.bodyPartPanel:setEnableSelectLines( true, self.bpAnchorX, self.bpAnchorY );
self.bodyPartPanel:enableNodes( "media/ui/BodyParts/bps_node_diamond", "media/ui/BodyParts/bps_node_diamond_outline" );
self.bodyPartPanel:overrideNodeTexture( BodyPartType.Torso_Upper, "media/ui/BodyParts/bps_node_big", "media/ui/BodyParts/bps_node_big_outline" );
self.bodyPartPanel:setColorScheme(self.colorScheme);
self:addChild(self.bodyPartPanel);
y = self.bodyPartPanel:getY() + self.bodyPartPanel:getHeight();
if isDebugEnabled() then
local btnx = 10;
local resetBtn;
y, resetBtn = ISDebugUtils.addButton(self, {}, btnx, y, 50, 20, "-reset-", ISClothingInsPanel.onResetButton);
end
self.mainGroup = {};
self.nodeGroup = {};
y = 12;
--ISLabel:new (x, y, height, name, r, g, b, a, font, bLeft)
local c = self.btnTextColor;
local name = getText("IGUI_Temp_CoreTemp");
self.labelCoreTemp = ISLabel:new(263, y, 16, name, c.r, c.g, c.b, c.a, UIFont.Small, true);
self.labelCoreTemp.prefixName = name;
self.labelCoreTemp.center = true;
self:addMainGroup(self.labelCoreTemp);
y = y + FONT_HGT_SMALL;
self.labelCoreTempMid = ISLabel:new(263, y, 16, getText("IGUI_Temp_Normal"), self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self.labelCoreTempMid.center = true;
self:addMainGroup(self.labelCoreTempMid);
self.labelCoreTempMin = ISLabel:new(135, y, 16, getText("IGUI_Temp_Cold"), self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self:addMainGroup(self.labelCoreTempMin);
self.labelCoreTempMax = ISLabel:new(390, y, 16, getText("IGUI_Temp_Hot"), self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, false);
self:addMainGroup(self.labelCoreTempMax);
self.coreTemperatureBar = ISGradientBar:new(135, y + FONT_HGT_SMALL, 255, 10);
self.coreTemperatureBar:setGradientTexture(getTexture("media/ui/BodyInsulation/heatbar_horz"));
self.coreTemperatureBar:setValue(0.36);
self.coreTemperatureBar:setHighlightRadius(25);
self.coreTemperatureBar:setDoKnob(false);
self:addMainGroup(self.coreTemperatureBar);
y = y + FONT_HGT_SMALL + 20;
name = getText("IGUI_Temp_BodyHeat");
self.labelCoreHeat = ISLabel:new(263, y, FONT_HGT_SMALL, name, c.r, c.g, c.b, c.a, UIFont.Small, true);
self.labelCoreHeat.prefixName = name;
self.labelCoreHeat.center = true;
self:addMainGroup(self.labelCoreHeat);
y = y + FONT_HGT_SMALL;
self.labelCoreHeatMid = ISLabel:new(263, y, FONT_HGT_SMALL, getText("IGUI_Temp_Normal"), self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self.labelCoreHeatMid.center = true;
self:addMainGroup(self.labelCoreHeatMid);
self.labelCoreHeatMin = ISLabel:new(135, y, FONT_HGT_SMALL, getText("IGUI_Temp_Low"), self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self:addMainGroup(self.labelCoreHeatMin);
self.labelCoreHeatMax = ISLabel:new(390, y, FONT_HGT_SMALL, getText("IGUI_Temp_High"), self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, false);
self:addMainGroup(self.labelCoreHeatMax);
self.coreHeatBar = ISGradientBar:new(135, y + FONT_HGT_SMALL, 255, 10);
self.coreHeatBar:setGradientTexture(getTexture("media/ui/BodyInsulation/heatbar_horz"));
self.coreHeatBar:setValue(0.1);
self.coreHeatBar:setHighlightRadius(25);
self.coreHeatBar:setDoKnob(false);
self:addMainGroup(self.coreHeatBar);
y = y + FONT_HGT_SMALL + 20;
y = y + 10;
self.currentViewID = ISClothingInsPanel.viewSimpleID;
self.viewButtons = {};
self.nodeDetails = {};
self.mainGroupViews = {};
self.nodeGroupViews = {};
self.maxViewsY = y
self:addView(ISClothingInsPanel.viewSimpleID, self.viewsSimple, y);
self:addView(ISClothingInsPanel.viewAdvancedID, self.viewsAdvanced, y);
self.coreRectangleH = self.maxViewsY + 10 - 12;
--[[
self.viewButtons = {};
local btn;
for i=1,#self.views do
y, btn = ISDebugUtils.addButton(self, {index = i}, 162, y, 200, 20, self.views[i].title, ISClothingInsPanel.onClickViewButton);
if i==1 then
btn.textColor = self.titleColor;
end
table.insert(self.viewButtons, btn);
self:addMainGroup(btn, true);
y = y+10;
end
-- node GrOuP
y = 12;
self.nodeDetails = {};
local view;
for i=1,#self.views do
view = self.views[i];
local t = {};
local c = self.titleColor;
local name = string.lower(self.views[i].title) or "none";
t.labelTitle = ISLabel:new(263, y, 16, name, c.r, c.g, c.b, c.a, UIFont.Small, true);
t.labelTitle.prefixName = name;
t.labelTitle.center = true;
self:addNodeGroup(t.labelTitle);
y = y+12;
if view.mid then
t.labelMid = ISLabel:new(263, y, 16, view.mid, self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
t.labelMid.center = true;
self:addNodeGroup(t.labelMid);
end
if view.min then
t.labelMin = ISLabel:new(135, y, 16, view.min, self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self:addNodeGroup(t.labelMin);
end
if view.max then
t.labelMax = ISLabel:new(390, y, 16, view.max, self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, false);
self:addNodeGroup(t.labelMax);
end
t.bar = ISGradientBar:new(135, y+14, 255, 10);
t.bar:setGradientTexture(view.texture);
t.bar:setValue(0.5);
if i>=6 then
t.bar:setValue(0);
end
t.bar:setHighlightRadius(25);
t.bar:setDoKnob(false);
self:addNodeGroup(t.bar);
table.insert(self.nodeDetails, t);
y = y + 31;
end
--]]
y = math.max(320, self.maxViewsY + 20);
local c = self.btnTextColor;
self.labelCurrentView = ISLabel:new(200, y, FONT_HGT_MEDIUM, getText("IGUI_Temp_SkinTemperature"), c.r, c.g, c.b, c.a, UIFont.Medium, true);
self.labelCurrentView.center = true;
self:addChild(self.labelCurrentView);
y = y + FONT_HGT_MEDIUM;
self.labelCurrentViewMid = ISLabel:new(200, y, FONT_HGT_SMALL, "Mid", self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self.labelCurrentViewMid.center = true;
self:addChild(self.labelCurrentViewMid);
self.labelCurrentViewMin = ISLabel:new(10, y, FONT_HGT_SMALL, "Min", self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self:addChild(self.labelCurrentViewMin);
self.labelCurrentViewMax = ISLabel:new(390, y, FONT_HGT_SMALL, "Max", self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, false);
self:addChild(self.labelCurrentViewMax);
self.legendBar = ISGradientBar:new(10, y + FONT_HGT_SMALL, 380, 20);
self.legendBar:setGradientTexture(getTexture("media/ui/BodyInsulation/heatbar_horz"));
self.legendBar:setValue(0.5);
self.legendBar:setHighlightRadius(25);
self.legendBar:setDoKnob(false);
self.legendBar:setDarkAlpha(0);
self:addChild(self.legendBar);
y, self.toggleAdvBtn = ISDebugUtils.addButton(self, {}, 10, y + FONT_HGT_SMALL + 20 + 4, 380, FONT_HGT_SMALL + 2 * 2, getText("IGUI_Temp_AdvView"), ISClothingInsPanel.onToggleViewStyle);
self:addChild(self.toggleAdvBtn);
self.selectedViewIndex = 1;
self:setViewStyle(ISClothingInsPanel.viewSimpleID, true);
self:setSelection(nil);
self:setViewIndex(1);
end
function ISClothingInsPanel:addView(_viewID, _viewTable, _y)
local y = _y;
self.mainGroupViews[_viewID] = {};
self.nodeGroupViews[_viewID] = {};
self.viewButtons[_viewID] = {};
local btn;
for i=1,#_viewTable do
y, btn = ISDebugUtils.addButton(self, {index = i}, 162, y, 200, FONT_HGT_SMALL + 2 * 2, _viewTable[i].title, ISClothingInsPanel.onClickViewButton);
if i==1 then
btn.textColor = self.titleColor;
end
table.insert(self.viewButtons[_viewID], btn);
self:addMainGroup(btn, true, _viewID);
y = y+10;
end
self.maxViewsY = math.max(self.maxViewsY, y - 10)
-- node GrOuP
y = 12;
self.nodeDetails[_viewID] = {};
local view;
for i=1,#_viewTable do
view = _viewTable[i];
local t = {};
local c = self.titleColor;
local name = view.title or "None"; --string.lower(view.title)
t.labelTitle = ISLabel:new(263, y, 16, name, c.r, c.g, c.b, c.a, UIFont.Small, true);
t.labelTitle.prefixName = name;
t.labelTitle.center = true;
self:addNodeGroup(t.labelTitle, _viewID);
y = y + FONT_HGT_SMALL;
if view.mid then
t.labelMid = ISLabel:new(263, y, 16, view.mid, self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
t.labelMid.center = true;
self:addNodeGroup(t.labelMid, _viewID);
end
if view.min then
t.labelMin = ISLabel:new(135, y, 16, view.min, self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, true);
self:addNodeGroup(t.labelMin, _viewID);
end
if view.max then
t.labelMax = ISLabel:new(390, y, 16, view.max, self.defTextColor.r, self.defTextColor.g, self.defTextColor.b, self.defTextColor.a, UIFont.Small, false);
self:addNodeGroup(t.labelMax, _viewID);
end
t.bar = ISGradientBar:new(135, y + FONT_HGT_SMALL, 255, 10);
t.bar:setGradientTexture(view.texture);
t.bar:setValue(0.5);
if i>=6 then
t.bar:setValue(0);
end
t.bar:setHighlightRadius(25);
t.bar:setDoKnob(false);
self:addNodeGroup(t.bar, _viewID);
table.insert(self.nodeDetails[_viewID], t);
y = t.bar:getBottom() + 4;
self.maxViewsY = math.max(self.maxViewsY, y - 4)
end
end
function ISClothingInsPanel:addMainGroup(_widget, _ignoreAddChild, _view)
if _view then
table.insert(self.mainGroupViews[_view], _widget);
else
table.insert(self.mainGroup, _widget);
end
if not _ignoreAddChild then
self:addChild(_widget);
end
end
function ISClothingInsPanel:addNodeGroup(_widget, _view)
if _view then
table.insert(self.nodeGroupViews[_view], _widget);
else
table.insert(self.nodeGroup, _widget);
end
self:addChild(_widget);
end
function ISClothingInsPanel:create()
self.views = {};
self.viewsSimple = {};
self.viewsAdvanced = {};
local colorScheme = {
{ val = 0.00, color = Color.new( 29/255, 34/255, 237/255, 1 ) },
{ val = 0.25, color = Color.new( 0/255, 255/255, 234/255, 1 ) },
{ val = 0.50, color = Color.new( 84/255, 255/255, 55/255, 1 ) },
{ val = 0.75, color = Color.new( 255/255, 246/255, 0/255, 1 ) },
{ val = 1.00, color = Color.new( 255/255, 0/255, 0/255, 1 ) },
};
self.colorScheme = colorScheme;
local colorSchemeBlues = {
{ val = 0.00, color = Color.new( 84/255, 255/255, 55/255, 1 ) },
{ val = 0.50, color = Color.new( 0/255, 255/255, 234/255, 1 ) },
{ val = 1.00, color = Color.new( 29/255, 34/255, 237/255, 1 ) },
}
local tex = getTexture("media/ui/BodyInsulation/heatbar_horz");
local texBlues = getTexture("media/ui/BodyInsulation/heatbar_horz_blues");
local texReds = getTexture("media/ui/BodyInsulation/heatbar_horz_reds");
-- 1
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_SkinTemperature"),
min = getText("IGUI_Temp_Cold"),
mid = getText("IGUI_Temp_Normal"),
max = getText("IGUI_Temp_Hot"),
texture = tex,
scheme = colorScheme,
functionName = "getSkinCelcius",
});
-- 2
--[[
table.insert(self.views, {
title = "Heat gain/loss",
min = "loss",
mid = "stable",
max = "gain",
texture = tex,
scheme = colorScheme,
functionName = "getHeatDelta",
});
--]]
-- 3
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_BloodVessels"),
min = getText("IGUI_Temp_Vasoconstriction"),
mid = getText("IGUI_Temp_Normal"),
max = getText("IGUI_Temp_Vasodilation"),
texture = tex,
scheme = colorScheme,
functionName = "getPrimaryDelta",
});
-- 4
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_ShiverPerspiration"),
min = getText("IGUI_Temp_Shivering"),
mid = getText("IGUI_Temp_Normal"),
max = getText("IGUI_Temp_Perspiring"),
texture = tex,
scheme = colorScheme,
functionName = "getSecondaryDelta",
});
-- 6
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_BodyWetness"),
min = getText("IGUI_Temp_Dry"),
mid = false,
max = getText("IGUI_Temp_Soaked"),
texture = texBlues,
scheme = colorSchemeBlues,
functionName = "getBodyWetness",
});
-- 7
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_ClothingWetness"),
min = getText("IGUI_Temp_Dry"),
mid = false,
max = getText("IGUI_Temp_Soaked"),
texture = texBlues,
scheme = colorSchemeBlues,
functionName = "getClothingWetness",
});
-- 5
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_Insulation"),
min = getText("IGUI_Temp_Low"),
mid = getText("IGUI_Temp_Med"),
max = getText("IGUI_Temp_High"),
texture = tex,
scheme = colorScheme,
functionName = "getInsulation",
showValue = true, -- this shows the actual value in the UI panel as postfix to title regardless of debug mode true or not.
});
table.insert(self.viewsAdvanced, {
title = getText("IGUI_Temp_WindResistance"),
min = getText("IGUI_Temp_Low"),
mid = getText("IGUI_Temp_Med"),
max = getText("IGUI_Temp_High"),
texture = tex,
scheme = colorScheme,
functionName = "getWindresist",
showValue = true,
});
-- SIMPLE VIeWS
table.insert(self.viewsSimple, {
title = getText("IGUI_Temp_SkinTemperature"),
min = getText("IGUI_Temp_Cold"),
mid = getText("IGUI_Temp_Normal"),
max = getText("IGUI_Temp_Hot"),
texture = tex,
scheme = colorScheme,
functionName = "getSkinCelcius",
});
table.insert(self.viewsSimple, {
title = getText("IGUI_Temp_BodyResponse"),
min = getText("IGUI_Temp_FightCold"),
mid = getText("IGUI_Temp_Normal"),
max = getText("IGUI_Temp_FightHot"),
texture = tex,
scheme = colorScheme,
functionName = "getBodyResponse",
});
table.insert(self.viewsSimple, {
title = getText("IGUI_Temp_Insulation"),
min = getText("IGUI_Temp_Low"),
mid = getText("IGUI_Temp_Med"),
max = getText("IGUI_Temp_High"),
texture = tex,
scheme = colorScheme,
functionName = "getInsulation",
showValue = true, -- this shows the actual value in the UI panel as postfix to title regardless of debug mode true or not.
});
for i=1,#self.viewsAdvanced do
self.viewsAdvanced[i].functionNameUI = self.viewsAdvanced[i].functionName .. "UI";
end
for i=1,#self.viewsSimple do
self.viewsSimple[i].functionNameUI = self.viewsSimple[i].functionName .. "UI";
end
self.views = self.viewsSimple;
end
function ISClothingInsPanel:onResetButton(_btn)
local thermos = self.player:getBodyDamage():getThermoregulator();
if thermos then
thermos:reset();
end
end
function ISClothingInsPanel:onClickViewButton(_btn)
self:setViewIndex(_btn.customData.index);
end
function ISClothingInsPanel:onToggleViewStyle(_btn)
local viewStyle;
if self.currentViewID==ISClothingInsPanel.viewSimpleID then
viewStyle = ISClothingInsPanel.viewAdvancedID;
self.toggleAdvBtn:setTitle(getText("IGUI_Temp_DefView"));
else
viewStyle = ISClothingInsPanel.viewSimpleID;
self.toggleAdvBtn:setTitle(getText("IGUI_Temp_AdvView"));
end
self:setViewStyle(viewStyle);
end
function ISClothingInsPanel:setViewStyle(_viewStyle, _force)
if _viewStyle~=ISClothingInsPanel.viewSimpleID and _viewStyle~=ISClothingInsPanel.viewAdvancedID then
return;
end
if self.currentViewID==_viewStyle and (not _force) then
return;
end
self.currentViewID = _viewStyle;
local oldViewID;
if _viewStyle==ISClothingInsPanel.viewSimpleID then
self.views = self.viewsSimple;
oldViewID = ISClothingInsPanel.viewAdvancedID;
else
self.views = self.viewsAdvanced;
oldViewID = ISClothingInsPanel.viewSimpleID;
end
for i=1,#self.mainGroupViews[oldViewID] do
self.mainGroupViews[oldViewID][i]:setVisible(false);
end
for i=1,#self.nodeGroupViews[oldViewID] do
self.nodeGroupViews[oldViewID][i]:setVisible(false);
end
for i=1,#self.mainGroupViews[self.currentViewID] do
self.mainGroupViews[self.currentViewID][i]:setVisible(true);
end
for i=1,#self.nodeGroupViews[self.currentViewID] do
self.nodeGroupViews[self.currentViewID][i]:setVisible(true);
end
self.bodyPartPanel:deselect();
self:setSelection(nil);
self:setViewIndex(1);
end
function ISClothingInsPanel:setViewIndex(_index)
local index = PZMath.clamp(_index, 1, #self.views);
self.selectedViewIndex = index;
local view = self.views[index];
self.labelCurrentView:setName(view.title);
if view.min then
self.labelCurrentViewMin:setName(view.min);
self.labelCurrentViewMin:setVisible(true);
else
self.labelCurrentViewMin:setVisible(false);
end
if view.mid then
self.labelCurrentViewMid:setName(view.mid);
self.labelCurrentViewMid:setVisible(true);
else
self.labelCurrentViewMid:setVisible(false);
end
if view.max then
self.labelCurrentViewMax:setName(view.max);
self.labelCurrentViewMax:setVisible(true);
else
self.labelCurrentViewMax:setVisible(false);
end
self.legendBar:setGradientTexture(view.texture);
self.bodyPartPanel:setColorScheme(view.scheme);
for i=1,#self.viewButtons[self.currentViewID] do
if i==index then
self.viewButtons[self.currentViewID][i].textColor = self.titleColor;
else
self.viewButtons[self.currentViewID][i].textColor = self.btnTextColor;
end
end
for i=1,#self.nodeDetails[self.currentViewID] do
if i==index then
self.nodeDetails[self.currentViewID][i].labelTitle:setColor(self.titleColor.r,self.titleColor.g,self.titleColor.b);
else
self.nodeDetails[self.currentViewID][i].labelTitle:setColor(self.btnTextColor.r,self.btnTextColor.g,self.btnTextColor.b);
end
end
end
function ISClothingInsPanel:setSelection(_node)
for i=1,#self.mainGroup do
self.mainGroup[i]:setVisible(_node==nil);
end
for i=1,#self.nodeGroup do
self.nodeGroup[i]:setVisible(_node~=nil);
end
for i=1,#self.mainGroupViews[self.currentViewID] do
self.mainGroupViews[self.currentViewID][i]:setVisible(_node==nil);
end
for i=1,#self.nodeGroupViews[self.currentViewID] do
self.nodeGroupViews[self.currentViewID][i]:setVisible(_node~=nil);
end
self.selectedBodyPart = _node~=nil and _node.bodyPartType or false;
end
function ISClothingInsPanel:prerender()
ISPanelJoypad.prerender(self);
local thermos = self.player:getBodyDamage():getThermoregulator();
local v;
self.coreTemperatureBar:setValue(thermos:getCoreTemperatureUI());
self.coreHeatBar:setValue(thermos:getHeatGenerationUI());
if isDebugEnabled() then
v = thermos:getCoreTemperature();
local nameLabel = self.labelCoreTemp.prefixName .. " (" .. (tostring(round(v,isDebugEnabled() and 5 or 1)) or "0") .. ")";
if isDebugEnabled() then
nameLabel = self.labelCoreTemp.prefixName .. " (" .. (tostring(round(v,isDebugEnabled() and 5 or 1)) or "0") .. ", R = " .. tostring(round(thermos:getCoreHeatDelta(),5)) .. ")";
end
self.labelCoreTemp:setName(nameLabel)
v = thermos:getMetabolicRateReal();
local v2 = thermos:getMetabolicRate();
self.labelCoreHeat:setName(self.labelCoreHeat.prefixName .. " ( real: " .. (tostring(round(v,isDebugEnabled() and 2 or 1)) or "0") .." / ".. (tostring(round(v2,isDebugEnabled() and 2 or 1)) or "0") .. ")")
end
for i=0,BodyPartType.ToIndex(BodyPartType.MAX)-1 do
local type = BodyPartType.FromIndex(i);
local thermalNode = thermos:getNodeForType(type);
if thermalNode then
v = thermalNode[self.views[self.selectedViewIndex].functionNameUI](thermalNode);
self.bodyPartPanel:setValue( type, v);
--self.bodyPartPanel:setValue( type, self:getNodeValue(thermalNode, self.selectedViewIndex));
if self.selectedBodyPart and self.selectedBodyPart == type then
for j=1,#self.views do
--self.nodeDetails[j].bar:setValue(self:getNodeValue(thermalNode, j));
v = thermalNode[self.views[j].functionNameUI](thermalNode);
self.nodeDetails[self.currentViewID][j].bar:setValue(v);
if isDebugEnabled() or self.views[j].showValue then
v = thermalNode[self.views[j].functionName](thermalNode);
self.nodeDetails[self.currentViewID][j].labelTitle:setName(self.nodeDetails[self.currentViewID][j].labelTitle.prefixName .. " (" .. (tostring(round(v,isDebugEnabled() and 5 or 2)) or "0") .. ")");
end
end
end
end
--[[if self.selectedViewIndex==1 then -- skin
elseif self.selectedViewIndex==2 then -- heat
elseif self.selectedViewIndex==3 then -- bloodvessels
elseif self.selectedViewIndex==4 then -- shiver/persp
elseif self.selectedViewIndex==5 then -- insulation
elseif self.selectedViewIndex==6 then -- body wetness
elseif self.selectedViewIndex==7 then -- clothing wetness
end--]]
end
end
--[[
function ISClothingInsPanel:getNodeValue(_node, _valueType)
local v = 0;
if _valueType==1 then -- skin
v = _node:getSkinCelciusUI();
elseif _valueType==2 then -- heat
v = _node:getHeatDeltaUI();
elseif _valueType==3 then -- bloodvessels
v = _node:getPrimaryDeltaUI();
elseif _valueType==4 then -- shiver/persp
v = _node:getSecondaryDeltaUI();
elseif _valueType==5 then -- insulation
v = _node:getInsulationUI();
elseif _valueType==6 then -- body wetness
v = _node:getBodyWetnessUI();
elseif _valueType==7 then -- clothing wetness
v = _node:getClothingWetnessUI();
end
return v;
end--]]
function ISClothingInsPanel:render()
ISPanelJoypad.render(self);
if not self.selectedBodyPart then
self:drawRectBorder(130, 10, 265, self.coreRectangleH, 1.0, 0.5, 0.5, 0.5);
else
self:drawRectBorder(130, 10, 265, self.coreRectangleH, 1.0, 0.5, 0.5, 0.5);
self:drawRect(self.bpAnchorX, self.bpPanelY+self.bpAnchorY-1, 130-self.bpAnchorX, 3, 1.0, 0.0, 0.0, 0.0);
self:drawRect(self.bpAnchorX, self.bpPanelY+self.bpAnchorY, 130-self.bpAnchorX, 1, 1.0, 1.0, 1.0, 1.0);
end
self:setWidthAndParentWidth(400);
self:setHeightAndParentHeight(self.toggleAdvBtn:getY()+self.toggleAdvBtn:getHeight()+10);
end
function ISClothingInsPanel:update()
ISPanelJoypad.update(self);
end
function ISClothingInsPanel:onJoypadDown(button)
if button == Joypad.BButton then
getPlayerInfoPanel(self.playerNum):toggleView(xpSystemText.clothingIns);
setJoypadFocus(self.playerNum, nil);
end
if button == Joypad.LBumper then
getPlayerInfoPanel(self.playerNum):onJoypadDown(button);
end
if button == Joypad.RBumper then
getPlayerInfoPanel(self.playerNum):onJoypadDown(button);
end
end
function ISClothingInsPanel:new(player, x, y, width, height)
local o = {};
o = ISPanelJoypad:new(x, y, width, height);
o:noBackground();
setmetatable(o, self);
self.__index = self;
o.player = player;
o.playerNum = player:getPlayerNum();
o.refreshNeeded = true;
o.bFemale = o.player:isFemale();
o.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
o.backgroundColor = {r=0, g=0, b=0, a=0.8};
o.titleColor = {r=255/255, g=200/255, b=0/255, a=1.0};
o.defTextColor = {r=0.5, g=0.5, b=0.5, a=1.0};
o.btnTextColor = {r=1.0, g=1.0, b=1.0, a=1.0};
o.selectedBodyPart = false;
return o;
end
|
---@class ClubFinderInfo
C_ClubFinder = {}
---@param clubFinderGUID string
function C_ClubFinder.ApplicantAcceptClubInvite(clubFinderGUID) end
---@param clubFinderGUID string
function C_ClubFinder.ApplicantDeclineClubInvite(clubFinderGUID) end
---@param clubFinderGUID string
function C_ClubFinder.CancelMembershipRequest(clubFinderGUID) end
function C_ClubFinder.CheckAllPlayerApplicantSettings() end
function C_ClubFinder.ClearAllFinderCache() end
function C_ClubFinder.ClearClubApplicantsCache() end
function C_ClubFinder.ClearClubFinderPostingsCache() end
---@param clubFinderGUID string
---@return bool belongsToClub
function C_ClubFinder.DoesPlayerBelongToClubFromClubGUID(clubFinderGUID) end
---@return ClubFinderDisableReason|nil disableReason
function C_ClubFinder.GetClubFinderDisableReason() end
---@return ClubSettingsInfo settings
function C_ClubFinder.GetClubRecruitmentSettings() end
---@param clubFinderGUID string
---@return ClubFinderRequestType clubType
function C_ClubFinder.GetClubTypeFromFinderGUID(clubFinderGUID) end
---@param flags number
---@return number index
function C_ClubFinder.GetFocusIndexFromFlag(flags) end
---@return number localeFlags
function C_ClubFinder.GetPlayerApplicantLocaleFlags() end
---@return ClubSettingsInfo settings
function C_ClubFinder.GetPlayerApplicantSettings() end
---@param clubFinderGUID string
---@return PlayerClubRequestStatus clubStatus
function C_ClubFinder.GetPlayerClubApplicationStatus(clubFinderGUID) end
---@return number focusCount
function C_ClubFinder.GetPlayerSettingsFocusFlagsSelectedCount() end
---@param clubFinderGUID string
---@return number|nil postingID
function C_ClubFinder.GetPostingIDFromClubFinderGUID(clubFinderGUID) end
---@param clubId string
---@return RecruitingClubInfo|nil clubInfo
function C_ClubFinder.GetRecruitingClubInfoFromClubID(clubId) end
---@param clubFinderGUID string
---@return RecruitingClubInfo clubInfo
function C_ClubFinder.GetRecruitingClubInfoFromFinderGUID(clubFinderGUID) end
---@param postingID string
---@return ClubFinderClubPostingStatusFlags postingFlags
function C_ClubFinder.GetStatusOfPostingFromClubId(postingID) end
---@return number totalSize
function C_ClubFinder.GetTotalMatchingCommunityListSize() end
---@return number totalSize
function C_ClubFinder.GetTotalMatchingGuildListSize() end
---@param clubFinderGUID string
---@return bool hasAlreadyApplied
function C_ClubFinder.HasAlreadyAppliedToLinkedPosting(clubFinderGUID) end
---@param postingID string
---@return bool postingDelisted
function C_ClubFinder.HasPostingBeenDelisted(postingID) end
---@return bool isEnabled
function C_ClubFinder.IsEnabled() end
---@param flags number
---@return bool isListed
function C_ClubFinder.IsListingEnabledFromFlags(flags) end
---@param postingID string
---@return bool postingBanned
function C_ClubFinder.IsPostingBanned(postingID) end
---@param clubFinderGUID string
---@param isLinkedPosting bool
function C_ClubFinder.LookupClubPostingFromClubFinderGUID(clubFinderGUID, isLinkedPosting) end
---@return RecruitingClubInfo inviteList
function C_ClubFinder.PlayerGetClubInvitationList() end
---@param type ClubFinderRequestType
function C_ClubFinder.PlayerRequestPendingClubsList(type) end
---@return RecruitingClubInfo info
function C_ClubFinder.PlayerReturnPendingCommunitiesList() end
---@return RecruitingClubInfo info
function C_ClubFinder.PlayerReturnPendingGuildsList() end
---@param clubId string
---@param itemLevelRequirement number
---@param name string
---@param description string
---@param specs number
---@param type ClubFinderRequestType
---@return bool succesful
function C_ClubFinder.PostClub(clubId, itemLevelRequirement, name, description, specs, type) end
---@param reportType ClubFinderPostingReportType
---@param clubFinderGUID string
---@param playerGUID string
---@param complaintNote string
function C_ClubFinder.ReportPosting(reportType, clubFinderGUID, playerGUID, complaintNote) end
---@param type ClubFinderRequestType
function C_ClubFinder.RequestApplicantList(type) end
---@param guildListRequested bool
---@param searchString string
---@param specIDs number
function C_ClubFinder.RequestClubsList(guildListRequested, searchString, specIDs) end
---@param clubFinderGUID string
---@param comment string
---@param specIDs number
function C_ClubFinder.RequestMembershipToClub(clubFinderGUID, comment, specIDs) end
---@param startingIndex number
---@param pageSize number
function C_ClubFinder.RequestNextCommunityPage(startingIndex, pageSize) end
---@param startingIndex number
---@param pageSize number
function C_ClubFinder.RequestNextGuildPage(startingIndex, pageSize) end
---@param clubId string
---@return bool success
function C_ClubFinder.RequestPostingInformationFromClubId(clubId) end
function C_ClubFinder.RequestSubscribedClubPostingIDs() end
function C_ClubFinder.ResetClubPostingMapCache() end
---@param clubFinderGUID string
---@param playerGUID string
---@param shouldAccept bool
---@param requestType ClubFinderRequestType
---@param playerName string
---@param forceAccept bool
---@param reported bool @ [OPTIONAL]
---@overload fun(clubFinderGUID:string, playerGUID:string, shouldAccept:bool, requestType:ClubFinderRequestType, playerName:string, forceAccept:bool)
function C_ClubFinder.RespondToApplicant(clubFinderGUID, playerGUID, shouldAccept, requestType, playerName, forceAccept, reported) end
---@param clubId string
---@return ClubFinderApplicantInfo info
function C_ClubFinder.ReturnClubApplicantList(clubId) end
---@return RecruitingClubInfo recruitingClubs
function C_ClubFinder.ReturnMatchingCommunityList() end
---@return RecruitingClubInfo recruitingClubs
function C_ClubFinder.ReturnMatchingGuildList() end
---@param clubId string
---@return ClubFinderApplicantInfo info
function C_ClubFinder.ReturnPendingClubApplicantList(clubId) end
---@param value number
function C_ClubFinder.SetAllRecruitmentSettings(value) end
---@param localeFlags number
function C_ClubFinder.SetPlayerApplicantLocaleFlags(localeFlags) end
---@param index number
---@param checked bool
function C_ClubFinder.SetPlayerApplicantSettings(index, checked) end
---@param locale number
function C_ClubFinder.SetRecruitmentLocale(locale) end
---@param index number
---@param checked bool
function C_ClubFinder.SetRecruitmentSettings(index, checked) end
---@return bool shouldShow
function C_ClubFinder.ShouldShowClubFinder() end
---@class ClubFinderApplicationUpdateType
local ClubFinderApplicationUpdateType = {}
ClubFinderApplicationUpdateType.None = 0
ClubFinderApplicationUpdateType.AcceptInvite = 1
ClubFinderApplicationUpdateType.DeclineInvite = 2
ClubFinderApplicationUpdateType.Cancel = 3
---@class ClubFinderClubPostingStatusFlags
local ClubFinderClubPostingStatusFlags = {}
ClubFinderClubPostingStatusFlags.None = 0
ClubFinderClubPostingStatusFlags.NeedsCacheUpdate = 1
ClubFinderClubPostingStatusFlags.ForceDescriptionChange = 2
ClubFinderClubPostingStatusFlags.ForceNameChange = 3
ClubFinderClubPostingStatusFlags.UnderReview = 4
ClubFinderClubPostingStatusFlags.Banned = 5
ClubFinderClubPostingStatusFlags.FakePost = 6
ClubFinderClubPostingStatusFlags.PendingDelete = 7
ClubFinderClubPostingStatusFlags.PostDelisted = 8
---@class ClubFinderDisableReason
local ClubFinderDisableReason = {}
ClubFinderDisableReason.Muted = 0
ClubFinderDisableReason.Silenced = 1
ClubFinderDisableReason.VeteranTrial = 2
---@class ClubFinderPostingReportType
local ClubFinderPostingReportType = {}
ClubFinderPostingReportType.PostersName = 0
ClubFinderPostingReportType.ClubName = 1
ClubFinderPostingReportType.PostingDescription = 2
ClubFinderPostingReportType.ApplicantsName = 3
ClubFinderPostingReportType.JoinNote = 4
---@class ClubFinderRequestType
local ClubFinderRequestType = {}
ClubFinderRequestType.None = 0
ClubFinderRequestType.Guild = 1
ClubFinderRequestType.Community = 2
ClubFinderRequestType.All = 3
---@class ClubFinderSettingFlags
local ClubFinderSettingFlags = {}
ClubFinderSettingFlags.None = 0
ClubFinderSettingFlags.Dungeons = 1
ClubFinderSettingFlags.Raids = 2
ClubFinderSettingFlags.Pvp = 3
ClubFinderSettingFlags.Rp = 4
ClubFinderSettingFlags.Social = 5
ClubFinderSettingFlags.Small = 6
ClubFinderSettingFlags.Medium = 7
ClubFinderSettingFlags.Large = 8
ClubFinderSettingFlags.Tank = 9
ClubFinderSettingFlags.Healer = 10
ClubFinderSettingFlags.Damage = 11
ClubFinderSettingFlags.EnableListing = 12
ClubFinderSettingFlags.MaxLevelOnly = 13
ClubFinderSettingFlags.AutoAccept = 14
ClubFinderSettingFlags.FactionHorde = 15
ClubFinderSettingFlags.FactionAlliance = 16
ClubFinderSettingFlags.FactionNeutral = 17
ClubFinderSettingFlags.SortRelevance = 18
ClubFinderSettingFlags.SortMemberCount = 19
ClubFinderSettingFlags.SortNewest = 20
ClubFinderSettingFlags.LanguageReserved1 = 21
ClubFinderSettingFlags.LanguageReserved2 = 22
ClubFinderSettingFlags.LanguageReserved3 = 23
ClubFinderSettingFlags.LanguageReserved4 = 24
ClubFinderSettingFlags.LanguageReserved5 = 25
---@class PlayerClubRequestStatus
local PlayerClubRequestStatus = {}
PlayerClubRequestStatus.None = 0
PlayerClubRequestStatus.Pending = 1
PlayerClubRequestStatus.AutoApproved = 2
PlayerClubRequestStatus.Declined = 3
PlayerClubRequestStatus.Approved = 4
PlayerClubRequestStatus.Joined = 5
PlayerClubRequestStatus.JoinedAnother = 6
PlayerClubRequestStatus.Canceled = 7
---@class ClubFinderApplicantInfo
---@field clubFinderGUID string
---@field playerGUID string
---@field closed number
---@field name string
---@field message string
---@field level number
---@field classID number
---@field ilvl number
---@field specIds table
---@field requestStatus PlayerClubRequestStatus
---@field lookupSuccess bool
---@field lastUpdatedTime number
local ClubFinderApplicantInfo = {}
---@class ClubSettingsInfo
---@field playStyleDungeon bool
---@field playStyleRaids bool
---@field playStylePvp bool
---@field playStyleRP bool
---@field playStyleSocial bool
---@field roleTank bool
---@field roleHealer bool
---@field roleDps bool
---@field sizeSmall bool
---@field sizeMedium bool
---@field sizeLarge bool
---@field maxLevelOnly bool
---@field enableListing bool
---@field sortRelevance bool
---@field sortMembers bool
---@field sortNewest bool
---@field autoAccept bool
local ClubSettingsInfo = {}
---@class RecruitingClubInfo
---@field clubFinderGUID string
---@field numActiveMembers number
---@field name string
---@field comment string
---@field guildLeader string
---@field isGuild bool
---@field emblemInfo number
---@field tabardInfo GuildTabardInfo|nil
---@field recruitingSpecIds table
---@field recruitmentFlags number
---@field localeSet bool
---@field recruitmentLocale number
---@field minILvl number
---@field cached number
---@field cacheRequested number
---@field lastPosterGUID string
---@field clubId string
---@field lastUpdatedTime number
local RecruitingClubInfo = {}
|
-- print object
function po(object)
if not object then
print("nil");
return;
end
if object.id then
utils::printObject(object:id());
else
utils::printObject(object);
end
end
-- print objc object properties
function pd(object)
if object.id then
utils::printObjectDescription(object:id());
else
utils::printObjectDescription(object);
end
end
-- safty release
function safety_release(obj)
if obj and obj.release then
obj:release();
end
end
function safety_release_list(list)
for i, v in pairs(list) do
safety_release(obj);
end
end
-- convert lua bool to objc bool
function toObjCBool(b)
if b ~= nil then
if b then
return "YES";
else
return "NO";
end
else
return "NO";
end
end
-- common language utils
function toLuaBool(b)
return b == "YES" or b == "true";
end
function isObjCObject(objId)
return utils::isObjCObject(objId);
end
function newObjCObject(className)
local objId = runtime::invokeClassMethod(className, "new");
if string.len(objId) ~= 0 then
runtime::invokeMethod(objId, "autorelease");
runtime::releaseObject(objId);
return objId;
end
return nil;
end
function toCStruct(...)
local str = "";
for i, v in pairs(arg) do
if i ~= 'n' then
str = str..","..v
end
end
local strLen = string.len(str);
if strLen ~= 0 then
str = string.sub(str, 2, strLen);
end
return str;
end
function unpackCStruct(struct)
return unpack(stringTableToNumberTable(stringSplit(struct, ",")));
end
function stringSplit(str, split_char)
local sub_str_tab = {};
while (true) do
local pos = string.find(str, split_char);
if (not pos) then
sub_str_tab[#sub_str_tab + 1] = str;
break;
end
local sub_str = string.sub(str, 1, pos - 1);
sub_str_tab[#sub_str_tab + 1] = sub_str;
str = string.sub(str, pos + 1, #str);
end
return sub_str_tab;
end
function stringTableToNumberTable(tbl)
for i = 1, #tbl do
tbl[i] = tonumber(tbl[i]);
end
return tbl;
end
-- print table
local print = print
local tconcat = table.concat
local tinsert = table.insert
local srep = string.rep
local type = type
local pairs = pairs
local tostring = tostring
local next = next
function print_r(root)
local cache = { [root] = "." }
local function _dump(t,space,name)
local temp = {}
for k,v in pairs(t) do
local key = tostring(k)
if cache[v] then
tinsert(temp,"+" .. key .. " {" .. cache[v].."}")
elseif type(v) == "table" then
local new_key = name .. "." .. key
cache[v] = new_key
tinsert(temp,"+" .. key .. _dump(v,space .. (next(t,k) and "|" or " " ).. srep(" ",#key),new_key))
else
tinsert(temp,"+" .. key .. " [" .. tostring(v).."]")
end
end
return tconcat(temp,"\n"..space)
end
print(_dump(root, "",""))
end
|
local Mechanics = {}
local VehiclesInGarage = {}
local TempColors = {}
AddEvent("OnPackageStart", function()
log.info("Loading mechanics...")
local _table = File_LoadJSONTable("packages/" .. GetPackageName() .. "/mechanic/mechanics.json")
for _, config in pairs(_table) do
CreateMechanic(config)
end
end)
AddEvent("OnPackageStop", function()
log.info "Destroying all merchants..."
for pickup,mech in pairs(Mechanics) do
Mechanics[pickup] = nil
DestroyPickup(pickup)
DestroyText3D(mech.text3d)
end
VehiclesInGarage = {}
end)
function CreateMechanic(config)
log.debug("Creating mechanic: " .. config.name)
local pickup = CreatePickup(2, config.x, config.y, config.z)
SetPickupPropertyValue(pickup, "mechanic", true)
Mechanics[pickup] = {
name = config.name,
text3d = CreateText3D(config.name, 12, config.x, config.y, config.z + 100, 0, 0, 0)
}
end
AddEvent("OnPlayerPickupHit", function(player, pickup)
if not GetPickupPropertyValue(pickup, "mechanic") then
return
end
if not Mechanics[pickup] then
return
end
local vehicle = GetPlayerVehicle(player)
if not vehicle then
return
end
if GetVehicleDriver(vehicle) ~= player then
return
end
OpenHood(vehicle)
CallEvent("StartMechanic", player)
end)
function GetMechanicsCount()
return #table.keys(Mechanics)
end
AddEvent("StartMechanic", function(player)
local vehicle, dist = GetNearestVehicle(player)
if vehicle == 0 or dist > 350 then
CallRemoteEvent(player, "ShowError", "Cannot find nearby vehicle!")
return
end
if (GetVehicleHoodRatio(vehicle) == 0.0) then
CallRemoteEvent(player, "ShowError", "Hood must be open to repair or inspect vehicle!")
return
end
VehiclesInGarage[player] = vehicle
local _send = GetVehicleData(vehicle)
CallRemoteEvent(player, "LoadVehicleData", vehicle, json_encode(_send))
end)
function GetVehicleData(vehicle)
local r,g,b = HexToRGBA(GetVehicleColor(vehicle))
return {
modelid = GetVehicleModel(vehicle),
model_name = GetVehicleModelName(vehicle),
health = GetVehicleHealthPercentage(vehicle),
damage = GetVehicleDamageIndexes(vehicle),
color = {
r = r,
g = g,
b = b
}
}
end
AddRemoteEvent("CloseMechanic", function(player)
local vehicle = VehiclesInGarage[player]
if not vehicle then
return
end
CloseHood(vehicle)
if TempColors[player] then
local prev_color = TempColors[player]
SetVehicleColor(vehicle, RGB(prev_color.r, prev_color.g, prev_color.b))
TempColors[player] = nil
end
VehiclesInGarage[player] = nil
CallRemoteEvent(player, "ShowMessage", "Thank you come again!")
end)
AddRemoteEvent("RepairVehicle", function(player)
local vehicle = VehiclesInGarage[player]
if not vehicle then
log.error "No vehicle found in garage!"
return
end
-- cancel if vehicle is too far away
local vx,vy,vz = GetVehicleLocation(vehicle)
local x,y,z = GetPlayerLocation(player)
if GetDistance2D(x, y, vx, vy) > 250 then
CallRemoteEvent(player, "CloseMechanic")
return
end
log.info(GetPlayerName(player) .. " inspects vehicle " .. vehicle)
CallRemoteEvent(player, "ShowMessage", "You begin to repair the vehicle...")
local x,y,z = GetVehicleLocation(vehicle)
PlaySoundSync("sounds/drill.wav", x, y, z)
IncreaseVehicleHealth(vehicle, 100)
Delay(3000, function()
local _send = GetVehicleData(vehicle)
CallRemoteEvent(player, "LoadVehicleData", vehicle, json_encode(_send))
end)
end)
AddRemoteEvent("PaintVehicle", function(player, r, g, b)
log.trace("PaintVehicle", dump(rgba))
local vehicle = VehiclesInGarage[player]
if not vehicle then
log.error "No vehicle found in garage!"
return
end
TempColors[player] = nil
local x,y,z = GetVehicleLocation(vehicle)
PlaySoundSync("sounds/paint.mp3", x, y, z)
Delay(6000, function()
SetVehicleColor(vehicle, RGB(r, g, b))
SaveVehicle(vehicle)
local _send = GetVehicleData(vehicle)
CallRemoteEvent(player, "LoadVehicleData", vehicle, json_encode(_send))
end)
end)
AddRemoteEvent("PreviewColor", function(player, r, g, b)
log.trace("PreviewColor", r, g, b)
local vehicle = GetPlayerVehicle(player)
-- store temp colors until mechanic UI closes
local _r,_g,_b = HexToRGBA(GetVehicleColor(vehicle))
TempColors[player] = {
r = _r,
g = _g,
b = _b
}
SetVehicleColor(vehicle, RGB(r, g, b))
end)
function GetNearestVehicle(player)
local vehicles = GetStreamedVehiclesForPlayer(player)
local found = 0
local nearest_dist = 999999.9
local x, y, z = GetPlayerLocation(player)
for _, v in pairs(vehicles) do
local x2, y2, z2 = GetVehicleLocation(v)
local dist = GetDistance3D(x, y, z, x2, y2, z2)
if dist < nearest_dist then
nearest_dist = dist
found = v
end
end
return found, nearest_dist
end
|
describe('Set', function()
local Set = require 'Set'
it('should create an empty set when given no elements', function()
assert.are.same({}, Set())
assert.are.same({}, Set({}))
end)
it('should create a set of the provided elements', function()
assert.are.same({
hello = true,
goodbye = true,
[3] = true
}, Set({
3,
'hello',
'goodbye'
}))
end)
end)
|
----------------------------------------------------------------------------------------------------
-- localized English (social module) strings
--
--get the add-on engine
local Engine = _G.Cecile_QuickLaunch;
--prepare locale
local L = LibStub("AceLocale-3.0"):NewLocale(Engine.Name, "enUS", true);
if not L then return; end
--social module
L["SOCIAL_MODULE"] = "Social"
L["SOCIAL_RETURN_WHISPERS"] = "Return Whispers"
L["SOCIAL_RETURN_WHISPERS_DESC"] = "Return items to send whispers"
L["SOCIAL_WHISPER"] = "Whisper"
L["SOCIAL_WHISPER_TOKEN"] = "Whisper Token"
L["SOCIAL_WHISPER_TOKEN_DESC"] = "Change the whisper token"
L["SOCIAL_RETURN_INVITE"] = "Return Invite"
L["SOCIAL_RETURN_INVITE_DESC"] = "Return items to send invites"
L["SOCIAL_INVITE"] = "Invite"
L["SOCIAL_INVITE_TOKEN"] = "Invite Token"
L["SOCIAL_INVITE_TOKEN_DESC"] = "Change the invite token"
L["SOCIAL_RETURN_CONVERT"] = "Return Convert"
L["SOCIAL_RETURN_CONVERT_DESC"] = "Return items for convert to party and raid"
L["SOCIAL_CONVERT"] = "Convert"
L["SOCIAL_CONVERT_TOKEN"] = "Convert Token"
L["SOCIAL_CONVERT_TOKEN_DESC"] = "Change the convert to party and raid token"
L["SOCIAL_CONVERT_TO_PARTY"] = "to party"
L["SOCIAL_CONVERT_TO_RAID"] = "to raid"
L["SOCIAL_HELP_WHISPER"] = "Press %s to whisper,\n %s to cancel."
L["SOCIAL_HELP_INVITE"] = "Press %s to invite,\n %s to cancel."
L["SOCIAL_HELP_CONVERT"] = "Press %s to convert,\n %s to cancel."
|
local __def = function(ADDON_NAME, LIB, Table, pformat)
local format, unpack, pack, tinsert = string.format, Table.unpackIt, Table.pack, Table.insert
local C = LIB:NewAceLib('Config')
if not C then return end
---- ## Start Here ----
function C:OnAfterInitialize(...)
local args = unpack({...})
self.profile = args.profile
local profileType = type(self.profile)
assert(profileType == 'table', format('Invalid profile detected: %s', profileType))
end
function C:OnAfterEnable()
end
function C:OnAfterAddonLoaded()
end
-- Main Entry Point to config dialog
function C:GetOptions()
return {
name = ADDON_NAME, handler = C.addon, type = "group",
args = {
enabled = {
type = "toggle",
name = format("Enable %s", ADDON_NAME),
desc = format("Enable or Disable %s", ADDON_NAME),
order = 0,
get = function(_)
local v = self.profile.enabled
if v == nil then
self.profile.enabled = false
v = self.profile.enabled
end
return v
end,
set = function(_, v) self.profile.enabled = v end,
}
}
}
end
return C
end
DEVT_Config = __def(DEVT_Constants.ADDON_NAME, DEVT_AceLibAddonFactory, DEVT_Table, DEVT_PrettyPrint.pformat)
|
local playsession = {
{"MrJSelig", {70586}},
{"Kastroil", {1052}},
{"Paladin_Brandis", {61139}},
{"Gas1", {6020}}
}
return playsession
|
-- vm-provisioning-plugin-for-slurm
-- Copyright 2019-2021 VMware, Inc.
-- SPDX-License-Identifier: BSD-2
--
-- This product is licensed to you under the BSD-2 license (the "License").
-- You may not use this product except in compliance with the BSD-2 License.
--
-- This product may include a number of subcomponents with separate copyright
-- notices and license terms. Your use of these subcomponents is subject to
-- the terms and conditions of the subcomponent's license, as noted in the LICENSE file.
--job_submit plguin used to create a unique name for each job by using job_name and current time stamp.
-- Create a folder in /var/spool using the unique jobname.
--Captures job configuration and save it to job_config file in the unique folder.
function slurm_job_submit(job_desc, part_list, submit_uid)
if job_desc.account == nil then
local account = "***TEST_ACCOUNT***"
slurm.log_info("slurm_job_submit: job from uid %u, setting default account value: %s",
submit_uid, account)
job_desc.account = account
--job_desc.clusters="all"
local submit_time = tostring(os.time())
if job_desc.name == nil then
job_desc.name="noname"
end
----------------------
-- set defaullt values for cpu and memory if not specificed in sbatch script
----------------------
if job_desc.pn_min_memory == nil then
job_desc.pn_min_memory=4
end
if job_desc.min_cpus == nil then
job_desc.min_cpus = 2
end
if job_desc.ncpus_per_task == nil then
job_desc.cpus_per_task = job_desc.min_cpus
end
if job_desc.min_nodes>=100000 then
slurm.log_info("setting min nodes")
job_desc.min_nodes=1
end
if job_desc.num_tasks >= 4294967294 then
job_desc.num_tasks=1
end
local job_name = job_desc.name:gsub("%s+", "")
local job_name = job_name .. "-" ..submit_time
job_desc.comment = job_name
slurm.log_info("slurm job arguments: %d user_id %s min_cpus %d mem_per_cpu %d job_name %s submit time %s",job_desc.argc,job_desc.user_id,job_desc.min_cpus,job_desc.pn_min_memory, job_desc.name, job_desc.comment);
local params =
{
"mkdir /var/spool/",
job_name
}
local command = table.concat(params, " ")
local handle = os.execute(table.concat(params, " "))
slurm.log_info("os execute %s",command)
local params =
{
"echo \"ncpus: ",
job_desc.cpus_per_task,
"\nmemory: ",
job_desc.pn_min_memory,
"\nuserid: ",
job_desc.user_id,
"\njob_name: ",
job_name,
"\nmin_nodes: ",
job_desc.min_nodes,
"\nnum_tasks: ",
job_desc.num_tasks,
"\" >/var/spool/",
job_name,
"/job_config"
}
local command = table.concat(params, "")
local handle = os.execute(table.concat(params, ""))
slurm.log_info("os execute %s",command)
local params =
{
"echo \"",
job_desc.script,
"\" > /var/spool/",
job_name,
"/job_script"
}
local handle = os.execute(table.concat(params,""))
slurm.log_info("os execute %s",table.concat(params, ""))
---------- dummy command to ensure the plugin works are expected -----------
local handle1 = os.execute('ls -l > list')
slurm.log_info("os execute script %s",handle1);
end
return slurm.SUCCESS
end
function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)
--can be modified if required
return slurm.SUCCESS
end
slurm.log_info("initialized")
return slurm.SUCCESS
|
local skynet = require "skynet"
-- 启动服务(启动函数)
skynet.start(function()
-- 启动函数里调用Skynet API开发各种服务
print("======Server start=======")
local gateserver = skynet.newservice("mygateserver") --启动刚才写的网关服务
skynet.call(gateserver, "lua", "open", {--需要给网关服务发送open消息,来启动监听
port = 8888, --监听的端口
maxclient = 64, --客户端最大连接数
nodelay = true, --是否延迟TCP
})
skynet.exit()
end)
|
--[[
© 2020 TERRANOVA do not share, re-distribute or modify
without permission of its author.
--]]
ITEM.name = "Boid Meat"
ITEM.model = Model("models/kek1ch/hide_burer.mdl")
ITEM.width = 1
ITEM.height = 1
ITEM.description = "The uncooked meat from some passive airborne creature."
ITEM.category = "Non-Approved Food";
ITEM.restoreHealth = 15
ITEM.price = 10;
ITEM.flag = "E"
|
pathtest = string.match(test, "(.*/)") or ""
dofile(pathtest .. "common.lua")
function thread_init(thread_id)
local table_name
set_vars()
table_name = "sbtest".. (thread_id+1)
db_query("PREPARE testplan (text, int) AS UPDATE ".. table_name .." SET c=$1 WHERE id=$2")
end
function event(thread_id)
local c_val
local query
c_val = sb_rand_str("###########-###########-###########-###########-###########-###########-###########-###########-###########-###########")
query = "EXECUTE testplan('" .. c_val .. "'," .. sb_rand(1, oltp_table_size) ..')'
db_query("BEGIN")
db_query(query)
db_query("COMMIT")
end
|
local cfg = {}
-- define static item transformers
-- see https://github.com/ImagicTheCat/vRP to understand the item transformer concept/definition
cfg.item_transformers = {
-- example of harvest item transformer
--[[{
name="Trash Can", -- menu name
-- permissions = {"harvest.water_bottle_tacos"}, -- you can add permissions
r=0,g=125,b=255, -- color
max_units=10,
units_per_minute=1,
x=231.40283203125,y=-1507.09191894531,z=29.2916603088379, -- pos
radius=5, height=1.5, -- area
recipes = {
["Harvest water"] = { -- action name
description="Harvest some water bottles.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={ -- items given per unit
["water"] = 1
}
},
["Harvest tacos"] = { -- action name
description="Harvest some tacos.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={ -- items given per unit
["tacos"] = 1
}
}
}
--, onstart = function(player,recipe) end, -- optional start callback
-- onstep = function(player,recipe) end, -- optional step callback
-- onstop = function(player,recipe) end -- optional stop callback
},]]
{
name="Academia", -- menu name
r=255,g=125,b=0, -- color
max_units=1000,
units_per_minute=1000,
x=-1202.96252441406,y=-1566.14086914063,z=4.61040639877319, -- pos
radius=7.5, height=1.5, -- area
recipes = {
["Força"] = { -- action name
description="Aumente sua força e stamina.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={}, -- items given per unit
aptitudes={ -- optional
["physical.strength"] = 1 -- "group.aptitude", give 1 exp per unit
}
}
}
},
{
name="Campo de Ervas", -- menu name
permissions = {"harvest.weed"}, -- you can add permissions
r=0,g=200,b=0, -- color
max_units=300,
units_per_minute=5,
x=2208.777,y=5578.235,z=53.735, -- pos
radius=7.5, height=1.5, -- area
recipes = {
["Colher"] = { -- action name
description="Colher maconha.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={ -- items given per unit
["weed"] = 1
}
}
}
},
-- CAMPO DE MINERIOS
{
name="Campo de Minerios", -- Nome do menu
permissions = {"harvest.minerio"}, -- Você pode adicionar permissões
r=0,g=200,b=0, -- cor
max_units=300,
units_per_minute=5,
x=1224.7158203125,y=1899.0333251953,z=78.049926757813, -- Localização
radius=7.5, height=1.5, -- area
recipes = {
["Colher"] = { -- Nome da ação
description="Colher minerio.", -- Descrição do produto a se colher
in_money=0, -- Dinheiro dado por unidade
out_money=0, -- Dinheiro ganho por unidade
reagents={}, -- Itens colhidos por unidade
products={ -- Nome do produto fornecido por unidade
["pedregulho"] = 1
}
}
}
},
-- PROCESSADOR DE PEDRA
{
name="Processador de Pedregulho", -- menu name
permissions = {"process.pedregulho"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=1000, -- unidades maximas do item
units_per_minute=1000, -- unidades que o transformador ganha de volta por minuto
x=1225.1665039063,y=1899.1839599609,z=78.078178405762, -- pos
radius=5.5, height=1.5, -- area
recipes = { -- items do menu
["Processar"] = { -- action name
description="Processador de Pedra.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["pedregulho"] = 1
},
products={ -- items given per unit
["pedralisa"] = 2
}
}
}
},
-- PROCESSADOR DE PEDRALISA
{
name="Processador de Pedralisa", -- menu name
permissions = {"process.pedralisa"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=1000, -- unidades maximas do item
units_per_minute=1000, -- unidades que o transformador ganha de volta por minuto
x=1108.4736328125,y=-2007.4107666016,z=30.941825866699, -- pos
radius=5.5, height=1.5, -- area
recipes = { -- items do menu
["Processar"] = { -- action name
description="Processador de Pedralisa.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["pedralisa"] = 1
},
products={ -- items given per unit
["diamante"] = 1
}
}
}
},
-- VENDA DIAMANTES
{
name="Venda de Diamantes", -- menu name
permissions = {"venda.diamantes"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=100, -- unidades maximas do item
units_per_minute=100, -- unidades que o transformador ganha de volta por minuto
x=-630.82086181641,y=-229.7685546875,z=38.057064056396, -- pos
radius=2, height=1.0, -- area
recipes = { -- items do menu
["Vender"] = { -- action name
description="Vender diamantes.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["diamante"] = 1
},
products={ -- items given per unit
["money"] = 1000
}
}
}
},
-- CAMPO DE CRACK
{
name="Campo de Crack", -- Nome do menu
permissions = {"harvest.crack"}, -- Você pode adicionar permissões
r=0,g=200,b=0, -- cor
max_units=300,
units_per_minute=5,
x=1788.9139404297,y=3894.767578125,z=34.389251708984, -- Localização
radius=7.5, height=1.5, -- area
recipes = {
["Colher"] = { -- Nome da ação
description="Colher cristal de crack.", -- Descrição do produto a se colher
in_money=0, -- Dinheiro dado por unidade
out_money=0, -- Dinheiro ganho por unidade
reagents={}, -- Itens colhidos por unidade
products={ -- Nome do produto fornecido por unidade
["cristaldecrack"] = 1
}
}
}
},
-- PROCESSADOR DE CRACK
{
name="Processador de Crack", -- menu name
permissions = {"process.crack"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=1000, -- unidades maximas do item
units_per_minute=1000, -- unidades que o transformador ganha de volta por minuto
x=1017.9518432617,y=-378.25216674805,z=59.867221832275, -- pos
radius=5.5, height=1.5, -- area
recipes = { -- items do menu
["Processar"] = { -- action name
description="Processador de Crack.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["cristaldecrack"] = 1
},
products={ -- items given per unit
["pedradecrack"] = 2
}
}
}
},
-- LAVAGEM DE DINHEIRO
{
name="Lavagem de Dinheiro", -- menu name
permissions = {"process.money"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=100, -- unidades maximas do item
units_per_minute=100, -- unidades que o transformador ganha de volta por minuto
x=1268.9666748047,y=-1710.1451416016,z=54.771484375, -- pos
radius=2, height=1.0, -- area
recipes = { -- items do menu
["Lavar"] = { -- action name
description="Lavar dinheiro.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["dirty_money"] = 500
},
products={ -- items given per unit
["money"] = 250
}
}
}
},
-- CAMPO DE METANFETAMINA
{
name="Campo de Metanfetamina", -- Nome do menu
permissions = {"harvest.metanfetamina"}, -- Você pode adicionar permissões
r=0,g=200,b=0, -- cor
max_units=300,
units_per_minute=5,
x=79.686859130859,y=3705.6840820313,z=41.077156066895, -- Localização
radius=7.5, height=1.5, -- area
recipes = {
["Colher"] = { -- Nome da ação
description="Colher Crystal Melamine.", -- Descrição do produto a se colher
in_money=0, -- Dinheiro dado por unidade
out_money=0, -- Dinheiro ganho por unidade
reagents={}, -- Itens colhidos por unidade
products={ -- Nome do produto fornecido por unidade
["crystalmelamine"] = 1
}
}
}
},
-- PROCESSADOR DE METANFETAMINA
{
name="Processador de Metanfetamina", -- menu name
permissions = {"process.metanfetamina"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=1000, -- unidades maximas do item
units_per_minute=1000, -- unidades que o transformador ganha de volta por minuto
x=1239.708984375,y=-635.14154052734,z=69.330833435059, -- pos
radius=5.5, height=1.5, -- area
recipes = { -- items do menu
["Processar"] = { -- action name
description="Processador de Metanfetamina.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["crystalmelamine"] = 1
},
products={ -- items given per unit
["metanfetamina"] = 2
}
}
}
},
-- CAMPO DE COCAINA
{
name="Campo de Cocaina", -- Nome do menu
permissions = {"harvest.cocaina"}, -- Você pode adicionar permissões
r=0,g=200,b=0, -- cor
max_units=300,
units_per_minute=5,
x=-41.372623443604,y=3033.3776855469,z=41.020195007324, -- Localização
radius=7.5, height=1.5, -- area
recipes = {
["Colher"] = { -- Nome da ação
description="Colher folha de Coca.", -- Descrição do produto a se colher
in_money=0, -- Dinheiro dado por unidade
out_money=0, -- Dinheiro ganho por unidade
reagents={}, -- Itens colhidos por unidade
products={ -- Nome do produto fornecido por unidade
["folhadecoca"] = 1
}
}
}
},
-- PROCESSADOR DE COCAINA
{
name="Processador de cocaina", -- menu name
permissions = {"process.cocaina"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=1000, -- unidades maximas do item
units_per_minute=1000, -- unidades que o transformador ganha de volta por minuto
x=471.25631713867,y=-1685.3825683594,z=29.381580352783, -- pos
radius=5.5, height=1.5, -- area
recipes = { -- items do menu
["Processar"] = { -- action name
description="Processador de Cocaina.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["folhadecoca"] = 1
},
products={ -- items given per unit
["cocaina"] = 2
}
}
}
},
-- CAMPO DE MINERIO
{
name="Campo de Minerio", -- Nome do menu
permissions = {"campodeminerio"}, -- you can add permissions
r=0,g=200,b=0, -- cor
max_units=200,
units_per_minute=2,
x=1534.5666503906,y=6327.1376953125,z=24.215845108032, -- Localização
radius=7.5, height=1.5, -- area
recipes = {
["Colher"] = { -- Nome da ação
description="Colher pedras para lavagem.", -- Descrição do produto a se colher
in_money=0, -- Dinheiro dado por unidade
out_money=0, -- Dinheiro ganho por unidade
reagents={}, -- Itens colhidos por unidade
products={ -- Nome do produto fornecido por unidade
["Pedra"] = 1
}
}
}
},
-- Carro Forte
{
name="Cofre", -- menu name
permissions = {"bankdriver.money"}, -- you can add permissions
r=255,g=125,b=0, -- color
max_units=1,
units_per_minute=1,
x=253.90089416504,y=225.21408081055,z=101.87578582764,
radius=2, height=1.0, -- area
recipes = {
["Dinheiro do Banco"] = { -- action name
description="Pegar dinheiro do banco.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={
["bank_money"] = 500000
}, -- items given per unit
aptitudes={} -- optional
}
}
},
-- PROCESSADOR DE MINERIO
{
name="Lavagem de Minerio", -- menu name
permissions = {"lavagemdeminerio"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=200, -- unidades maximas do item
units_per_minute=2, -- unidades que o transformador ganha de volta por minuto
x=-554.48089599609,y=5324.0986328125,z=73.599700927734, -- pos
radius=7.5, height=1.5, -- area
recipes = { -- items do menu
["Lavagem de Pedra"] = { -- action name
description="Produzir minerio...", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["Pedra"] = 1
},
products={ -- items given per unit
["Minerio"] = 1
}
}
}
},
{
name="Porte de Arma", -- menu name
r=255,g=125,b=0, -- color
max_units=1,
units_per_minute=1,
x=437.178802490234,y=-994.613525390625,z=30.6895904541016,
radius=2, height=1.0, -- area
recipes = {
["Porte de Arma"] = { -- action name
description="comprar porte de arma.", -- action description
in_money=1500, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={
["portedearma"] = 1
}, -- items given per unit
aptitudes={} -- optional
}
}
},
{
name="OAB", -- menu name
permissions = {"advogado.oab"},
r=255,g=125,b=0, -- color
max_units=1,
units_per_minute=1,
x=-77.134468078613,y=-802.86267089844,z=243.40579223633,
radius=2, height=1.0, -- area
recipes = {
["OAB"] = { -- action name
description="Carteira de Advogado.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={
["oab"] = 1
}, -- items given per unit
aptitudes={} -- optional
}
}
},
{
name="Processar Ervas", -- menu name
permissions = {"process.weed"}, -- you can add permissions
r=0,g=200,b=0, -- cor do menu
max_units=1000, -- unidades maximas do item
units_per_minute=1000, -- unidades que o transformador ganha de volta por minuto
x=-781.90240478516,y=578.94976806641,z=126.74822235107, -- pos
radius=5.5, height=1.5, -- area
recipes = { -- items do menu
["Processar"] = { -- action name
description="Processador de Maconha.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={ -- items taken per unit
["weed"] = 1
},
products={ -- items given per unit
["cannabis"] = 2
}
}
}
},
}
-- define multiple static transformers with postions list
local weedplants = {
{1873.36901855469,3658.46215820313,33.8029747009277},
{1856.33776855469,3635.12109375,34.1897926330566},
{1830.75390625,3621.44140625,33.8487205505371},
{1784.70251464844,3579.93798828125,34.7956123352051},
{182.644317626953,3315.75537109375,41.4806938171387},
{1764.65661621094,3642.916015625,34.5866050720215},
{1512.91027832031,1673.76025390625,111.531875610352}
}
for k,v in pairs(weedplants) do
local plant = {
name="Planta de Maconha", -- menu name
--permissions = {"harvest.weed"}, -- you can add permissions
r=0,g=200,b=0, -- color
max_units=1,
units_per_minute=1,
x=v[1],y=v[2],z=v[3], -- pos
radius=5.0, height=1.5, -- area
recipes = {
["Colher"] = { -- action name
description="Colher maconha.", -- action description
in_money=0, -- money taken per unit
out_money=0, -- money earned per unit
reagents={}, -- items taken per unit
products={ -- items given per unit
["weed"] = 1
}
}
}
}
table.insert(cfg.item_transformers, plant)
end
local warehouses = {
{-1111.2841796875,4937.4052734375,218.386306762695},
{1539.01794433594,1704.29174804688,109.659622192383},
{981.412841796875,-1805.70349121094,35.4845695495605}
}
for k,v in pairs(warehouses) do
local warehouse = {
name="Oficina de armas", -- menu name
permissions = {"build.gun"}, -- you can add permissions
r=0,g=200,b=0, -- color
max_units=10,
units_per_minute=1,
x=v[1],y=v[2],z=v[3], -- pos
radius=5.0, height=1.5, -- area
recipes = {
["Build Pistol"] = { -- action name
description="Construir pistola.", -- action description
in_money=1500, -- money taken per unit
out_money=0, -- money earned per unit
reagents={
["pistol_parts"] = 1
}, -- items taken per unit
products={ -- items given per unit
["wbody|WEAPON_PISTOL"] = 1
}
},
["Build Shotgun"] = { -- action name
description="Construir shotgun.", -- action description
in_money=3000, -- money taken per unit
out_money=0, -- money earned per unit
reagents={
["shotgun_parts"] = 1
}, -- items taken per unit
products={ -- items given per unit
["wbody|WEAPON_PUMPSHOTGUN"] = 1
}
},
["Build SMG"] = { -- action name
description="Construir submachinegun.", -- action description
in_money=5000, -- money taken per unit
out_money=0, -- money earned per unit
reagents={
["smg_parts"] = 1
}, -- items taken per unit
products={ -- items given per unit
["wbody|WEAPON_SMG"] = 1
}
}
}
}
table.insert(cfg.item_transformers, warehouse)
end
-- define transformers randomly placed on the map
cfg.hidden_transformers = {
["weed plant"] = {
def = {
name="Weed Plant", -- menu name
r=0,g=200,b=0, -- color
max_units=50,
units_per_minute=0,
x=0,y=0,z=0, -- pos
radius=0, height=0, -- area
recipes = {
}
},
positions = weedplants
},
["gun warehouse"] = {
def = {
name="Gun Warehouse", -- menu name
r=0,g=200,b=0, -- color
max_units=50,
units_per_minute=0,
x=0,y=0,z=0, -- pos
radius=0, height=0, -- area
recipes = {
}
},
positions = warehouses
}
}
-- time in minutes before hidden transformers are relocated (min is 5 minutes)
cfg.hidden_transformer_duration = 30-- 12 hours -- 5*24*60 -- 5 days
-- configure the information reseller (can sell hidden transformers positions)
cfg.informer = {
infos = {
["weed plant"] = 10000,
["gun warehouse"] = 25000
},
positions = {
{1821.12390136719,3685.9736328125,34.2769317626953},
{1804.2958984375,3684.12280273438,34.217945098877}
},
interval = 30, -- interval in minutes for the reseller respawn
duration = 10, -- duration in minutes of the spawned reseller
blipid = 133,
blipcolor = 2
}
return cfg
|
local cmp = require("cmp")
local luasnip = require("luasnip")
local pairs = require("nvim-autopairs.completion.cmp")
vim.opt.completeopt = "menuone,noselect"
local config = {
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
documentation = {
border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" },
},
experimental = {
native_menu = false,
ghost_text = true,
},
formatting = {
format = function(entry, vim_item)
-- load lspkind icons
vim_item.kind = string.format(
"%s %s",
require("eden.modules.protocol.lsp.kind").icons[vim_item.kind],
vim_item.kind
)
vim_item.menu = ({
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
buffer = "[BUF]",
})[entry.source.name]
return vim_item
end,
},
mapping = {
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-o>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
["<Tab>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end,
["<S-Tab>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end,
},
sources = {
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "treesitter" },
{ name = "luasnip" },
{ name = "path" },
{
name = "buffer",
keyword_length = 5,
option = {
get_bufnr = function()
return vim.api.nvim_list_bufs()
end,
},
},
{ name = "crates" }, -- crates does check if file is a `Cargo.toml` file
},
}
-- For filetype specific overrides see ftplugin folder
cmp.setup(config)
cmp.event:on("confirm_done", pairs.on_confirm_done())
|
fx_version 'cerulean'
game 'gta5'
author 'FuriousFoxGG'
description 'An announcment script made by FuriousFoxGG. with T-Notify'
version '1.0'
server_script 'server.lua'
|
--[[
Quest system used in HeroBorne
To learn how to use it, the instruction video can be found here:
https://www.youtube.com/watch?v=LaFIAhgfVqk
Update Video:
https://youtu.be/mYWO6c5-xhI
All Quest data can be found in QUESTDATA.lua in dependencies.
The JSON editor I use is: https://jsoneditoronline.org/
Checkout https://gamertitan.com for more Core tutorials.
Any question feel free to message me on Discord: Morticai#0001
]]--
|
function Emote.UI.DrawWedge(x, y, r, r2, startAng, endAng, step, cache)
local positions = {}
local inner = {}
local outer = {}
startAng = startAng or 0
endAng = endAng or 0
for i = startAng - 90, endAng - 90, step do
table.insert(inner, {
x = math.ceil(x + math.cos(math.rad(i)) * r2),
y = math.ceil(y + math.sin(math.rad(i)) * r2)
})
end
for i = startAng - 90, endAng - 90, step do
table.insert(outer, {
x = math.ceil(x + math.cos(math.rad(i)) * r),
y = math.ceil(y + math.sin(math.rad(i)) * r)
})
end
for i = 1, #inner * 2 do
local outPoints = outer[math.floor(i / 2) + 1]
local inPoints = inner[math.floor((i + 1) / 2) + 1]
local otherPoints
if i % 2 == 0 then
otherPoints = outer[math.floor((i + 1) / 2)]
else
otherPoints = inner[math.floor((i + 1) / 2)]
end
table.insert(positions, {outPoints, otherPoints, inPoints})
end
for k,v in pairs(positions) do
surface.DrawPoly(v)
end
end
|
--[[
Scripted BY ROBLOXTUTOR - AKA DeathToTheStadium
Date: 9/16/2021,
Time: 8:30AM PST
]]
local ENV = require(game:GetService('ServerStorage').models.utilitiy.ENV)
local Profileservice = require(ENV.Modules.ProfileService)
local DataStoreClass = require(ENV.Modules.datastore)
local PlayerClass = require(ENV.Modules.Player)
_G['Profiles'] = {}
local Datastore = DataStoreClass:Extend({
ProfileService = Profileservice,
Profiles = _G['Profiles']
})
Datastore:initProfileStore("PlayerStorage",ENV.Tables._PlayerDataTemplate,false)
local FunctionTable = {}
FunctionTable[1] = PlayerClass:ManagePlayerData()
FunctionTable[2] = function(Player,Profile)
local Data = Profile.Data
local leaderstats = ENV.Functions.MakeFolder('leaderstats',Player)
local Wins = ENV.Functions.MakeValue('Int','Wins',leaderstats,Data.Stats.Wins)
local Losses = ENV.Functions.MakeValue('Int','Losses',leaderstats,Data.Stats.Losses)
local Rank = ENV.Functions.MakeValue('String','Rank',leaderstats,'['..Data.Rank.Title..']')
coroutine.wrap(function()
repeat wait(.3)
Wins.Value = Data.Stats.Wins
Losses.Value = Data.Stats.Losses
Rank.Value = '['..Data.Rank.Title..']'
until not Player:IsDescendantOf(ENV.Service.Players)
end)()
end
ENV.Service.Players.PlayerAdded:Connect(function(Player)
local PlayerObject = PlayerClass:Extend({Player = Player})
local Middleware,List = Datastore.Middleware(PlayerObject:CreatePlayerData(),FunctionTable)
PlayerObject:SpawnRemotes()
PlayerObject:SetUpScreenInterface()
Datastore:LoadProfileStore("PlayerStorage",Player,Middleware,List)
end)
ENV.Service.Players.PlayerRemoving:Connect(function(Player)
Datastore:ReleaseProfile(Player)
end)
|
-- Error.lua
-- @Author : DengSir ([email protected])
-- @Link : https://dengsir.github.io
-- @Date : 10/17/2018, 12:42:22 PM
--
---@type ns
local ns = select(2, ...)
local ipairs, date, time = ipairs, date, time
local debugstack = debugstack
local max = math.max
local format = string.format
local tinsert, tremove, wipe = table.insert, table.remove, table.wipe or wipe
local tIndexOf = tIndexOf
local Console = ns.Console
---@class tdDevToolsError: Object, __Error
---@field ErrorList ListView
---@field EditBox EditBox
---@field Tab Button
---@field errors any[]
---@field selectedErr any
local Error = ns.class('Frame')
function Error:Constructor()
self.index = 0
self.EditBox = self.RightSide.EditBoxScroll.EditBox
self.Tab = ns.Frame.Tab2
self.errors = {}
ns.ListView:Bind(self.ErrorList, {
itemList = self.errors,
buttonTemplate = 'tdDevToolsErrorItemTemplate',
OnItemFormatting = function(button, item)
return self:OnItemFormatting(button, item)
end,
})
SetCVar('scriptErrors', 0)
UIParent:UnregisterEvent('LUA_WARNING')
-- @debug@
-- local old = geterrorhandler()
-- @end-debug@
seterrorhandler(function(err)
-- @debug@
-- old(err)
-- @end-debug@
return self:AddError(err)
end)
self:SetScript('OnShow', self.Refresh)
self:SetScript('OnEvent', self.OnEvent)
self:RegisterEvent('ADDON_ACTION_BLOCKED')
self:RegisterEvent('ADDON_ACTION_FORBIDDEN')
self:RegisterEvent('MACRO_ACTION_BLOCKED')
self:RegisterEvent('MACRO_ACTION_FORBIDDEN')
self:RegisterEvent('LUA_WARNING')
self:RegisterEvent('PLAYER_LOGIN')
end
function Error:PLAYER_LOGIN()
if self.errors ~= ns.db.global.errors then
local errors = self.errors
self.errors = ns.db.global.errors
for _, v in ipairs(errors) do
local info = self:TakeError(v.err)
if info then
info.count = info.count + v.count
info.time = max(info.time or 0, v.time or 0)
else
info = v
end
tinsert(self.errors, 1, info)
end
self.ErrorList:SetItemList(self.errors)
end
end
function Error:ADDON_ACTION_BLOCKED(event, addon, port)
self:AddError(format('%s blocked from using %s', addon, port))
end
function Error:ADDON_ACTION_FORBIDDEN(event, addon, port)
self:AddError(format('%s forbidden from using %s (Only usable by Blizzard)', addon, port))
end
function Error:MACRO_ACTION_BLOCKED(event, port)
self:AddError(format('Macro blocked from using %s', port))
end
function Error:MACRO_ACTION_FORBIDDEN(event, port)
self:AddError(format('Macro forbidden from using %s (Only usable by Blizzard)', port))
end
function Error:LUA_WARNING(_, warnType, err)
self:AddWarning(err)
end
function Error:OnEvent(event, ...)
self[event](self, event, ...)
end
function Error:OnItemClick(button)
local id = button:GetID()
local info = self.errors[id]
if not info then
return
end
self.selectedErr = info
self:Refresh()
end
function Error:OnItemDeleteClick(button)
local id = button:GetID()
tremove(self.errors, id)
self:Refresh()
self:UpdateCount()
end
function Error:OnItemFormatting(button, info)
button.Count:SetFormattedText('(%d)', info.count)
button.Text:SetText(info.full or info.err)
button.Selected:SetShown(self.selectedErr and info.err == self.selectedErr.err)
end
function Error:Refresh()
self:UpdateList()
self:UpdateError()
end
function Error:UpdateList()
self.ErrorList:Refresh()
end
local MESSAGE_FORMAT = [[
|cff00ffffMessage:|r %s
|cff00ffffTime:|r %s
|cff00ffffCount:|r %d
|cff00ffffStack:|r %s
]]
function Error:UpdateError()
if not tIndexOf(self.errors, self.selectedErr) then
self.selectedErr = nil
end
self.EditBox:SetText(not self.selectedErr and '' or
MESSAGE_FORMAT:format(self.selectedErr.err,
date('%Y:%m:%d %H:%M:%S', self.selectedErr.time),
self.selectedErr.count, self.selectedErr.stack or ''))
self.EditBox:SetCursorPosition(0)
end
function Error:UpdateCount()
local count = #self.errors
self.Tab:SetText(count == 0 and 'Errors' or format('Errors |cffff0000(%d)|r', #self.errors))
end
function Error:AddWarning(err)
if err:match('Error loading.+Blizzard_APIDocumentation') then
return
end
local info = self:TakeError(err) or {err = err}
info.count = (info.count or 0) + 1
tinsert(self.errors, 1, info)
self:Refresh()
self:UpdateCount()
Console:RawLog('WARN', '', format('|Herror:%s|h%s|h ', info.err, info.err))
end
function Error:AddError(err)
local info = self:TakeError(err) or self:ParseErr(err)
info.count = info.count + 1
info.time = time()
tinsert(self.errors, 1, info)
self:Refresh()
self:UpdateCount()
Console:RawLog('ERROR', info.path, format('|Herror:%s|h%s|h ', info.err, info.formatted))
end
function Error:ParseErr(err)
local formatted
local stack
local full
local path = ns.FindPath(err)
if not path then
stack = debugstack(4)
path = ns.FindPath(stack)
formatted = err
full = path .. ': ' .. err
else
formatted = ns.ShortPath(err):sub(#path + 3)
stack = debugstack(5)
full = err
end
return {err = err, formatted = formatted, full = full, count = 0, path = ns.ColoredPath(path), stack = stack}
end
function Error:TakeError(err)
for i, v in ipairs(self.errors) do
if v.err == err then
return tremove(self.errors, i)
end
end
end
function Error:FindErr(err)
for _, info in ipairs(self.errors) do
if info.err == err then
return info
end
end
end
function Error:SelectErr(err)
local info = self:FindErr(err)
if not info then
return
end
self.selectedErr = info
self:Refresh()
return true
end
function Error:Clear()
wipe(self.errors)
self:Refresh()
self:UpdateCount()
end
ns.Error = Error:Bind(ns.Frame.Error)
|
local spawn = require("awful.spawn")
local app = {}
function app.start(cmd, is_shell, have_class, callback)
local is_shell = is_shell or nil -- bool
local have_class = have_class or nil -- string
spawn(cmd)
if callback then callback() end
end
function app.shell(cmd)
spawn.with_shell(terminal .. " -e " .. cmd)
end
function app.web(link)
spawn(web_browser .. " " .. link)
end
local function check_proc(cmd_arr)
for _, cmd in ipairs(cmd_arr) do
local findme = cmd
local firstspace = cmd:find(' ')
if firstspace then findme = cmd:sub(0, firstspace -1) end
local command = string.format('pgrep -u $USER -x %s > /dev/null || pgrep -u $USER -x -f %s > /dev/null || echo start', findme, findme)
local f = io.popen(command)
local o = f:read('*a')
f:close()
if o:match('start') then return 0 else return end
end
end
function app.run_once(cmd, ...)
if cmd == nil then return end
local ret = check_proc(cmd)
if ret ~= nil then
app.start(cmd[1], ...)
end
end
return app
|
CombatChoiceState = {}
CombatChoiceState.__index = CombatChoiceState
function CombatChoiceState:Create(context, actor)
local this =
{
mStack = context.mStack,
mCombatState = context,
mActor = actor,
mCharacter = context.mActorCharMap[actor],
mUpArrow = gGame.World.mIcons:Get('uparrow'),
mDownArrow = gGame.World.mIcons:Get('downarrow'),
mMarker = Sprite.Create(),
mHide = false,
}
this.mMarker:SetTexture(Texture.Find('continue_caret.png'))
this.mMarkPos = this.mCharacter.mEntity:GetSelectPosition()
this.mTime = 0
setmetatable(this, self)
this.mSelection = Selection:Create
{
data = this.mActor.mActions,
columns = 1,
displayRows = 3,
spacingX = 0,
spacingY = 19,
OnSelection = function(...) this:OnSelect(...) end,
RenderItem = this.RenderAction,
}
this:CreateChoiceDialog()
return this
end
function CombatChoiceState:Hide()
self.mHide = true
end
function CombatChoiceState:Show()
self.mHide = false
end
function CombatChoiceState:SetArrowPosition()
local x = self.mTextbox.mSize.left
local y = self.mTextbox.mSize.top
local width = self.mTextbox.mWidth
local height = self.mTextbox.mHeight
local arrowPad = 9
local arrowX = x + width - arrowPad
self.mUpArrow:SetPosition(arrowX, y - arrowPad)
self.mDownArrow:SetPosition(arrowX, y - height + arrowPad)
end
function CombatChoiceState:CreateChoiceDialog()
local x = -System.ScreenWidth()/2
local y = -System.ScreenHeight()/2
local height = self.mSelection:GetHeight() + 18
local width = self.mSelection:GetWidth() + 16
y = y + height + 16
x = x + 100
self.mTextbox = Textbox:Create
{
textScale = 1.2,
text = "",
size =
{
left = x,
right = x + width,
top = y,
bottom = y - height
},
textbounds =
{
left = -20,
right = 0,
top = 0,
bottom = 2
},
panelArgs =
{
texture = Texture.Find("gradient_panel.png"),
size = 3,
},
selectionMenu = self.mSelection,
stack = self.mStack,
}
end
function CombatChoiceState:RenderAction(renderer, x, y, item)
local font = gGame.Font.default
local text = Actor.ActionLabels[item] or ""
font:DrawText2d(renderer, x, y, text)
end
function CombatChoiceState:OnSelect(index, data)
print("on select", index, data)
if data == "attack" then
self.mSelection:HideCursor()
local state = CombatTargetState:Create(
self.mCombatState,
{
targetType = CombatTargetType.One,
--switchSides = false,
OnSelect = function(targets)
self:TakeAction(data, targets)
end,
OnExit = function()
self.mSelection:ShowCursor()
end
})
self.mStack:Push(state)
elseif data == "flee" then
self.mStack:Pop() -- choice state
local queue = self.mCombatState.mEventQueue
local event = CEFlee:Create(self.mCombatState, self.mActor)
local tp = event:TimePoints(queue)
queue:Add(event, tp)
elseif data == "item" then
self:OnItemAction()
elseif data == "magic" then
self:OnMagicAction()
elseif data == "special" then
self:OnSpecialAction()
end
end
function CombatChoiceState:OnSpecialAction()
local actor = self.mActor
local font = gGame.Font.default
-- Create the selection box
local x = self.mTextbox.mSize.left - 64
local y = self.mTextbox.mSize.top
self.mSelection:HideCursor()
local OnRenderItem = function(self, renderer, x, y, item)
local text = "--"
local cost = "0"
local canPerform = false
local mp = actor.mStats:Get("mp_now")
local color = Vector.Create(1,1,1,1)
if item then
local def = SpecialDB[item]
text = def.name
cost = string.format("%d", def.mp_cost)
if def.mp_cost > 0 then
canPerform = mp >= def.mp_cost
if not canPerform then
color = Vector.Create(0.7, 0.7, 0.7, 1)
end
font:AlignText("right", "center")
font:DrawText2d(renderer, x + 96, y, cost, color)
end
end
font:AlignText("left", "center")
font:DrawText2d(renderer, x, y, text, color)
end
local OnExit = function()
self.mSelection:ShowCursor()
end
local OnSelection = function(selection, index, item)
if not item then
return
end
local def = SpecialDB[item]
local mp = actor.mStats:Get("mp_now")
if mp < def.mp_cost then
return
end
-- Find associated event
local event = nil
if def.action == "slash" then
event = CESlash
elseif def.action == "steal" then
event = CESteal
end
local targeter = self:CreateActionTargeter(def, selection, event)
self.mStack:Push(targeter)
end
local state = BrowseListState:Create
{
stack = self.mStack,
title = "Special",
x = x,
y = y,
data = actor.mSpecial,
OnExit = OnExit,
OnRenderItem = OnRenderItem,
OnSelection = OnSelection
}
self.mStack:Push(state)
end
function CombatChoiceState:OnMagicAction()
local actor = self.mActor
local font = gGame.Font.default
-- Create the selection box
local x = self.mTextbox.mSize.left - 64
local y = self.mTextbox.mSize.top
self.mSelection:HideCursor()
local OnRenderItem = function(self, renderer, x, y, item)
local text = "--"
local cost = "0"
local canCast = false
local mp = actor.mStats:Get("mp_now")
local color = Vector.Create(1,1,1,1)
if item then
local def = SpellDB[item]
print(tostring(item), tostring(def))
text = def.name
cost = string.format("%d", def.mp_cost)
canCast = mp >= def.mp_cost
if not canCast then
color = Vector.Create(0.7, 0.7, 0.7, 1)
end
font:AlignText("right", "center")
font:DrawText2d(renderer, x + 96, y, cost, color)
end
font:AlignText("left", "center")
font:DrawText2d(renderer, x, y, text, color)
end
local OnExit = function()
self.mCombatState:HideTip("")
self.mSelection:ShowCursor()
end
local OnSelection = function(selection, index, item)
if not item then
return
end
print("spell selected:", item)
local def = SpellDB[item]
local mp = actor.mStats:Get("mp_now")
if not actor:CanCast(def) then
return
end
local targeter = self:CreateActionTargeter(def, selection, CECastSpell)
self.mStack:Push(targeter)
end
local state = BrowseListState:Create
{
stack = self.mStack,
title = "MAGIC",
x = x,
y = y,
data = actor.mMagic,
OnExit = OnExit,
OnRenderItem = OnRenderItem,
OnSelection = OnSelection
}
self.mStack:Push(state)
end
function CombatChoiceState:CreateActionTargeter(def, browseState, combatEvent)
local targetDef = def.target
print(targetDef.type)
browseState:Hide()
self:Hide()
local OnSelect = function(targets)
self.mStack:Pop() -- target state
self.mStack:Pop() -- spell browse state
self.mStack:Pop() -- action state
local queue = self.mCombatState.mEventQueue
local event = combatEvent:Create(self.mCombatState,
self.mActor,
def,
targets)
local tp = event:TimePoints(queue)
queue:Add(event, tp)
end
local OnExit = function()
browseState:Show()
self:Show()
end
return CombatTargetState:Create(self.mCombatState,
{
targetType = targetDef.type,
defaultSelector = CombatSelector[targetDef.selector],
switchSides = targetDef.switch_sides,
OnSelect = OnSelect,
OnExit = OnExit
})
end
function CombatChoiceState:OnItemAction()
-- 1. Get the filtered item list
local filter = function(def)
return def.type == "useable"
end
local filteredItems = gGame.World:FilterItems(filter)
-- 2. Create the selection box
local x = self.mTextbox.mSize.left - 64
local y = self.mTextbox.mSize.top
self.mSelection:HideCursor()
local OnFocus = function(item)
local text = ""
if item then
local def = ItemDB[item.id]
text = def.description
end
self.mCombatState:ShowTip(text)
end
local OnExit = function()
self.mCombatState:HideTip("")
self.mSelection:ShowCursor()
end
local OnRenderItem = function(self, renderer, x, y, item)
local font = gGame.Font.default
local text = "--"
if item then
local def = ItemDB[item.id]
text = def.name
if item.count > 1 then
text = string.format("%s x%00d", def.name, item.count)
end
end
font:DrawText2d(renderer, x, y, text)
end
local OnSelection = function(selection, index, item)
if not item then
return
end
local def = ItemDB[item.id]
--print("ITEM DATA>>>>>>>>", item.id, def)
local targeter = self:CreateItemTargeter(def, selection)
self.mStack:Push(targeter)
end
local state = BrowseListState:Create
{
stack = self.mStack,
title = "ITEMS",
x = x,
y = y,
data = filteredItems,
OnExit = OnExit,
OnRenderItem = OnRenderItem,
OnFocus = OnFocus,
OnSelection = OnSelection,
}
self.mStack:Push(state)
end
function CombatChoiceState:CreateItemTargeter(def, browseState)
local targetDef = def.use.target
self.mCombatState:ShowTip(def.use.hint)
browseState:Hide()
self:Hide()
local OnSelect = function(targets)
self.mStack:Pop() -- target state
self.mStack:Pop() -- item box state
self.mStack:Pop() -- action state
local queue = self.mCombatState.mEventQueue
local event = CEUseItem:Create(self.mCombatState,
self.mActor,
def,
targets)
local tp = event:TimePoints(queue)
queue:Add(event, tp)
end
local OnExit = function()
browseState:Show()
self:Show()
end
return CombatTargetState:Create(self.mCombatState,
{
targetType = targetDef.type,
defaultSelector = CombatSelector[targetDef.selector],
switchSides = targetDef.switch_sides,
OnSelect = OnSelect,
OnExit = OnExit
})
end
function CombatChoiceState:TakeAction(id, targets)
self.mStack:Pop() -- select state
self.mStack:Pop() -- action state
local queue = self.mCombatState.mEventQueue
if id == "attack" then
print("Entered attack state")
local attack = CEAttack:Create(self.mCombatState,
self.mActor,
{player = true},
targets)
local speed = self.mActor.mStats:Get("speed")
local tp = queue:SpeedToTimePoints(speed)
queue:Add(attack, tp)
end
end
function CombatChoiceState:Enter()
self.mCombatState.mSelectedActor = self.mActor
end
function CombatChoiceState:Exit()
self.mCombatState.mSelectedActor = nil
self.mTextbox:Exit()
end
function CombatChoiceState:Update(dt)
self.mTextbox:Update(dt)
-- Make the selection cursor bounce
self.mTime = self.mTime + dt
local bounce = self.mMarkPos + Vector.Create(0, math.sin(self.mTime * 5))
self.mMarker:SetPosition(bounce)
end
function CombatChoiceState:Render(renderer)
if self.mHide then
return
end
self.mTextbox:Render(renderer)
self:SetArrowPosition()
if self.mSelection:CanScrollUp() then
renderer:DrawSprite(self.mUpArrow)
end
if self.mSelection:CanScrollDown() then
renderer:DrawSprite(self.mDownArrow)
end
renderer:DrawSprite(self.mMarker)
end
function CombatChoiceState:HandleInput()
self.mSelection:HandleInput()
end
|
#!/usr/bin/env lua
local fl = require( "fltk4lua" )
local window = fl.Window( 360, 370 )
local scroll = fl.Scroll( 10, 10, 340, 285 )
local pack = fl.Pack{ 10, 10, 340, 285, box = "FL_DOWN_FRAME" }
fl.Button( 35, 35, 25, 25, "b1" )
fl.Button( 45, 45, 25, 25, "b2" )
fl.Button( 55, 55, 25, 25, "b3" )
fl.Button( 65, 65, 25, 25, "b4" )
fl.Button( 75, 75, 25, 25, "b5" )
fl.Button( 85, 85, 25, 25, "b6" )
fl.Button( 95, 95, 25, 25, "b7" )
fl.Button( 105, 105, 25, 25, "b8" )
fl.Button( 115, 115, 25, 25, "b9" )
fl.Button( 125, 125, 25, 25, "b10" )
fl.Button( 135, 135, 25, 25, "b11" )
fl.Button( 145, 145, 25, 25, "b12" )
fl.Button( 155, 155, 25, 25, "b13" )
fl.Button( 165, 165, 25, 25, "b14" )
fl.Button( 175, 175, 25, 25, "b15" )
fl.Button( 185, 185, 25, 25, "b16" )
fl.Button( 195, 195, 25, 25, "b17" )
fl.Button( 205, 205, 25, 25, "b18" )
fl.Button( 215, 215, 25, 25, "b19" )
fl.Button( 225, 225, 25, 25, "b20" )
fl.Button( 235, 235, 25, 25, "b21" )
fl.Button( 245, 245, 25, 25, "b22" )
fl.Button( 255, 255, 25, 25, "b23" )
fl.Button( 265, 265, 25, 25, "b24" )
pack:end_group()
window.resizable = pack
scroll:end_group()
local function type_cb( _, t )
for i = 0, pack.children-1 do
local o = pack:child( i )
o:resize( 0, 0, 25, 25 )
end
pack:resize( scroll.x, scroll.y, scroll.w, scroll.h )
pack.parent:redraw()
pack.type = t
pack:redraw()
end
fl.Light_Button{ 10, 305, 165, 25, "HORIZONTAL",
type = "FL_RADIO_BUTTON",
user_data = "HORIZONTAL",
callback = type_cb }
fl.Light_Button{ 185, 305, 165, 25, "VERTICAL",
type = "FL_RADIO_BUTTON",
value = true,
user_data = "VERTICAL",
callback = type_cb }
local sl = fl.Slider{ 100, 335, 250, 25, "Spacing: ",
align = fl.ALIGN_LEFT,
type = "FL_HORIZONTAL",
step = 1 }
sl:range( 0, 30 )
function sl:callback()
pack.spacing = self.value
scroll:redraw()
end
window:end_group()
window:show( arg )
fl.run()
|
local vim = vim
vim.cmd([[ autocmd BufNewFile,BufRead *.thrift setlocal filetype=thrift ]])
|
--[[
File l3build-ctan.lua Copyright (C) 2018-2020 The LaTeX Project
It may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this
license or (at your option) any later version. The latest version
of this license is in the file
http://www.latex-project.org/lppl.txt
This file is part of the "l3build bundle" (The Work in LPPL)
and all files in that bundle must be distributed together.
-----------------------------------------------------------------------
The development version of the bundle can be found at
https://github.com/latex3/l3build
for those people who are interested.
--]]
local pairs = pairs
local print = print
local lower = string.lower
local match = string.match
-- Copy files to the main CTAN release directory
function copyctan()
mkdir(ctandir .. "/" .. ctanpkg)
local function copyfiles(files,source)
if source == currentdir or flatten then
for _,filetype in pairs(files) do
cp(filetype,source,ctandir .. "/" .. ctanpkg)
end
else
for _,filetype in pairs(files) do
for _,p in ipairs(tree(source,filetype)) do
local path = dirname(p.src)
local ctantarget = ctandir .. "/" .. ctanpkg .. "/"
.. source .. "/" .. path
mkdir(ctantarget)
cp(p.src,source,ctantarget)
end
end
end
end
for _,tab in pairs(
{bibfiles,demofiles,docfiles,pdffiles,scriptmanfiles,typesetlist}) do
copyfiles(tab,docfiledir)
end
copyfiles(sourcefiles,sourcefiledir)
for _,file in pairs(textfiles) do
cp(file, textfiledir, ctandir .. "/" .. ctanpkg)
end
end
function bundlectan()
local errorlevel = install_files(tdsdir,true)
if errorlevel ~=0 then return errorlevel end
copyctan()
return 0
end
function ctan()
-- Always run tests for all engines
options["engine"] = nil
local function dirzip(dir, name)
local zipname = name .. ".zip"
local function tab_to_str(table)
local string = ""
for _,i in ipairs(table) do
string = string .. " " .. "\"" .. i .. "\""
end
return string
end
-- Convert the tables of files to quoted strings
local binfiles = tab_to_str(binaryfiles)
local exclude = tab_to_str(excludefiles)
-- First, zip up all of the text files
run(
dir,
zipexe .. " " .. zipopts .. " -ll ".. zipname .. " " .. "."
.. (
(binfiles or exclude) and (" -x" .. binfiles .. " " .. exclude)
or ""
)
)
-- Then add the binary ones
run(
dir,
zipexe .. " " .. zipopts .. " -g ".. zipname .. " " .. ". -i" ..
binfiles .. (exclude and (" -x" .. exclude) or "")
)
end
local errorlevel
local standalone = false
if bundle == "" then
standalone = true
end
if standalone then
errorlevel = call({"."},"check")
bundle = module
else
errorlevel = call(modules, "bundlecheck")
end
if errorlevel == 0 then
rmdir(ctandir)
mkdir(ctandir .. "/" .. ctanpkg)
rmdir(tdsdir)
mkdir(tdsdir)
if standalone then
errorlevel = install_files(tdsdir,true)
if errorlevel ~=0 then return errorlevel end
copyctan()
else
errorlevel = call(modules, "bundlectan")
end
else
print("\n====================")
print("Tests failed, zip stage skipped!")
print("====================\n")
return errorlevel
end
if errorlevel == 0 then
for _,i in ipairs(textfiles) do
for _,j in pairs({unpackdir, textfiledir}) do
cp(i, j, ctandir .. "/" .. ctanpkg)
cp(i, j, tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle)
end
end
-- Rename README if necessary
if ctanreadme ~= "" and not match(lower(ctanreadme),"^readme%.%w+") then
local newfile = "README." .. match(ctanreadme,"%.(%w+)$")
for _,dir in pairs({ctandir .. "/" .. ctanpkg,
tdsdir .. "/doc/" .. tdsroot .. "/" .. bundle}) do
if fileexists(dir .. "/" .. ctanreadme) then
rm(dir,newfile)
ren(dir,ctanreadme,newfile)
end
end
end
dirzip(tdsdir, ctanpkg .. ".tds")
if packtdszip then
cp(ctanpkg .. ".tds.zip", tdsdir, ctandir)
end
dirzip(ctandir, ctanzip)
cp(ctanzip .. ".zip", ctandir, currentdir)
else
print("\n====================")
print("Typesetting failed, zip stage skipped!")
print("====================\n")
end
return errorlevel
end
|
-- By:latiao QQ:3497780275 Web:latiaoawa.cf
local function tp()
local position = localplayer:get_position()
position.z = position.z - 1000
localplayer:set_position(position)
end
local function TpNpcvoid()
local position = localplayer:get_position()
position.z = position.z - 1000
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(position)
::continue::
end
end
local function TpNpcNone()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(9999, 9999, -100)
::continue::
end
end
local function TpNpcNoneKill()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(9999, 9999, -100)
if p:get_health() < 99 then
goto continue
end
p:set_max_health(150)
p:set_health(99)
::continue::
end
end
local function TpNpcMe()
local position = localplayer:get_position()
position.z = position.z + 2
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(position)
::continue::
end
end
local function TpNpcMeKillOn()
local position = localplayer:get_position()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(position)
if p:get_health() < 99 then
goto continue
end
p:set_max_health(150)
p:set_health(99)
::continue::
end
end
local function TpBadNpcMeKillOn()
local position = localplayer:get_position()
position.z = position.z + 5
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(position)
menu.kill_all_enemies()
::continue::
end
end
local function TpBadNpcMeKillUp()
local position = localplayer:get_position()
position.z = position.z + -10
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:is_in_vehicle() then
goto continue
end
p:set_position(position)
menu.kill_all_enemies()
::continue::
end
end
local function freeze()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
p:set_freeze_momentum(true)
::continue::
end
end
local function unfreeze()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
p:set_freeze_momentum(false)
::continue::
end
end
local function killnpc()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:get_health() < 99 then
goto continue
end
p:set_max_health(150)
p:set_health(99)
::continue::
end
end
local function npcheal()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
p:set_max_health(150)
p:set_health(150)
::continue::
end
end
local function set1heal()
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
if p:get_health() < 99 then
goto continue
end
p:set_max_health(150)
p:set_health(100)
::continue::
end
end
local function allnpcgodmod()
local position = localplayer:get_position()
for p in replayinterface.get_peds() do
p:set_godmode(true)
end
end
local function allnpcgodmodfalse()
local position = localplayer:get_position()
for p in replayinterface.get_peds() do
p:set_godmode(false)
end
end
local function freezeplayer()
localplayer:set_freeze_momentum(true)
end
local function unfreezeplayer()
localplayer:set_freeze_momentum(false)
end
local function tpcheme()
local position = localplayer:get_position()
position.y = position.y + 1
for p in replayinterface.get_vehicles() do
p:set_position(position)
end
end
local function tpchenpc1000()
for c in replayinterface.get_vehicles() do
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
c:set_position(9999, 9999, -100)
p:set_position(9999, 9999, -100)
::continue::
end
end
end
local function tpchenpc1000Kill()
for c in replayinterface.get_vehicles() do
for p in replayinterface.get_peds() do
if p == localplayer then
goto continue
end
c:set_position(9999, 9999, -100)
p:set_position(9999, 9999, -100)
if p:get_health() < 99 then
goto continue
end
p:set_max_health(150)
p:set_health(99)
::continue::
end
end
end
local function tppickups()
local position = localplayer:get_position()
position.z = position.z + 1
for p in replayinterface.get_pickups() do
p:set_position(position)
::continue::
end
end
local function chefly()
for p in replayinterface.get_vehicles() do
p:set_gravity(-100)
end
end
local function tpchemebom()
local position = localplayer:get_position()
position.z = position.z - 0
for p in replayinterface.get_vehicles() do
p:set_position(position)
p:set_health(-1)
p:set_gravity(0)
end
end
menu.add_action("传送npc到世界边界", TpNpcNone)
menu.add_action("传送npc到世界边界+杀死", TpNpcNoneKill)
menu.add_action("传送npc到我", TpNpcMe)
menu.add_action("传送所有npc到我并杀死上", TpNpcMeKillOn)
menu.add_action("传送所有敌人npc到我并杀死上", TpBadNpcMeKillOn)
menu.add_action("传送所有敌人npc到我并杀死下", TpBadNpcMeKillUp)
menu.add_action("传送npc到虚空", TpNpcvoid)
menu.add_action("冻结npc", freeze)
menu.add_action("取消冻结npc", unfreeze)
menu.add_action("杀死所有npc", killnpc)
menu.add_action("复活所有npc(测试)", npcheal)
menu.add_action("z轴-1000", tp)
menu.add_action("所有npc只有1滴血", set1heal)
menu.add_action("所有生物无敌", allnpcgodmod)
menu.add_action("所有生物取消无敌", allnpcgodmodfalse)
menu.add_action("冻结自己", freezeplayer)
menu.add_action("取消冻结自己", unfreezeplayer)
menu.add_action("传送所有车到自己", tpcheme)
menu.add_action("所有可拾取物品传送到我(测试)", tppickups)
menu.add_action("所有车飞天", chefly)
menu.add_action("传送所有车到自己+爆炸", tpchemebom)
menu.add_action("传送所有车+人到世界边界", tpchenpc1000)
menu.add_action("传送所有车+人到世界边界+死亡", tpchenpc1000Kill)
|
object_mobile_som_droid_8t88 = object_mobile_som_shared_8t88:new {
}
ObjectTemplates:addTemplate(object_mobile_som_droid_8t88, "object/mobile/som/8t88.iff")
|
module(..., package.seeall)
-- Per-creature death functions.
death_fns = {}
-- Set a death function for a particular creature
function set_death_fn(creature_base_id, fn)
death_fns[creature_base_id] = fn
end
function die(creature_id, creature_base_id, attacking_creature_id, map_id)
local death_fn = death_fns[creature_base_id]
if death_fn ~= nil then
death_fn(creature_id, attacking_creature_id, map_id)
else
death_fn = death_fns[creature_id]
if death_fn ~= nil then
death_fn(creature_id, attacking_creature_id, map_id)
-- The creature is now dead; we no longer need its instance function
-- in the death_fns.
death_fns[creature_id] = nil
else
log(CLOG_ERROR, "Could not call death function for creature_id " .. creature_id)
end
end
end
|
local objects =
{
createObject(2713,-2383.2002000,1547.0000000,30.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1997,-2401.6001000,1542.1000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1997,-2401.6001000,1538.6000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1997,-2401.5000000,1535.3000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1997,-2401.5000000,1531.9000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1997,-2391.3999000,1531.9000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2391.3000000,1535.5000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2391.3000000,1538.8000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2391.3000000,1542.3000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2394.0000000,1528.0000000,31.9000000,0.0000000,0.0000000,180.0000000,0);
createObject(1997,-2399.3000000,1528.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(3386,-2402.1001000,1527.7000000,37.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(3386,-2402.2000000,1533.7000000,37.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2401.3999000,1529.0000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1997,-2401.6001000,1534.9000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(3386,-2402.2002000,1540.2998000,37.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2401.6001000,1539.1000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.0996000,1530.2998000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.0000000,1532.1000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.0996000,1536.0996000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.1001000,1537.9000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(3386,-2394.8000000,1527.3000000,37.3000000,0.0000000,0.0000000,0.0000000,0);
createObject(1997,-2396.2002000,1527.7998000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(3386,-2394.8000000,1540.7000000,37.3000000,0.0000000,0.0000000,180.0000000,0);
createObject(1997,-2396.1001000,1540.2000000,37.2000000,0.0000000,0.0000000,359.9950000,0);
createObject(2339,-2397.6001000,1527.2000000,37.2000000,0.0000000,0.0000000,180.0000000,0);
createObject(2339,-2398.6001000,1527.2000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(2339,-2397.6001000,1540.7000000,37.2000000,0.0000000,0.0000000,359.9950000,0);
createObject(2339,-2398.6001000,1540.7000000,37.2000000,0.0000000,0.0000000,359.9890000,0);
createObject(3386,-2402.2000000,1554.9000000,37.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2401.6001000,1556.2000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.1001000,1557.4000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.1001000,1559.1000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(3386,-2402.2000000,1560.4000000,37.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2401.7000000,1561.6000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.1001000,1562.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(3386,-2402.2000000,1566.8000000,37.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2401.7000000,1565.5000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2402.1001000,1564.4000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2398.5000000,1567.2000000,37.2000000,0.0000000,0.0000000,359.9890000,0);
createObject(2339,-2397.5000000,1567.2000000,37.2000000,0.0000000,0.0000000,359.9890000,0);
createObject(1997,-2396.0000000,1566.5000000,37.2000000,0.0000000,0.0000000,359.9890000,0);
createObject(3386,-2394.8000000,1567.3000000,37.3000000,0.0000000,0.0000000,179.9950000,0);
createObject(3386,-2394.8000000,1554.4000000,37.2000000,0.0000000,0.0000000,359.9950000,0);
createObject(1997,-2396.0000000,1554.9000000,37.2000000,0.0000000,0.0000000,179.9890000,0);
createObject(2339,-2397.5000000,1554.5000000,37.2000000,0.0000000,0.0000000,179.9840000,0);
createObject(2339,-2398.5000000,1554.5000000,37.2000000,0.0000000,0.0000000,179.9840000,0);
createObject(1649,-2393.5000000,1565.5000000,38.8000000,0.0000000,0.0000000,90.0000000,0);
createObject(1649,-2393.5000000,1557.6000000,38.8000000,0.0000000,0.0000000,90.0000000,0);
createObject(1649,-2393.5000000,1537.3000000,38.8000000,0.0000000,0.0000000,90.0000000,0);
createObject(1649,-2393.5000000,1529.8000000,38.8000000,0.0000000,0.0000000,90.0000000,0);
createObject(1649,-2393.5000000,1530.1000000,38.8000000,0.0000000,0.0000000,270.0000000,0);
createObject(1649,-2393.5000000,1537.7000000,38.8000000,0.0000000,0.0000000,270.0000000,0);
createObject(1649,-2393.5000000,1557.6000000,38.8000000,0.0000000,0.0000000,270.0000000,0);
createObject(1649,-2393.5000000,1565.0000000,38.8000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1541.4000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1542.0000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1542.6000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1543.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1544.4000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1545.0000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1550.0000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1550.6000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1551.2000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1552.4000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1553.6000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2393.3000000,1553.0000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2389.8999000,1526.9000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2390.5000000,1526.9000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2391.1001000,1526.9000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2391.7000000,1526.9000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2392.3000000,1526.9000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2389.8999000,1567.6000000,37.2000000,0.0000000,0.0000000,180.0000000,0);
createObject(1722,-2390.5000000,1567.6000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2391.1001000,1567.6000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2391.7000000,1567.6000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2392.3000000,1567.6000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2380.0000000,1537.1000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1536.5000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1535.9000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1535.3000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.1001000,1562.0000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.1001000,1561.4000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.1001000,1560.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.1001000,1560.2000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1552.2000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1551.6000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1551.0000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1550.4000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1548.0000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1547.4000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1546.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2380.0000000,1546.2000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2381.5000000,1533.2000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2382.1001000,1533.2000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2382.7000000,1533.2000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2383.3000000,1533.2000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2383.2000000,1563.9000000,37.2000000,0.0000000,0.0000000,180.0000000,0);
createObject(1722,-2382.6001000,1563.9000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2382.0000000,1563.9000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2381.3999000,1563.9000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1723,-2390.2000000,1511.8000000,37.2000000,0.0000000,0.0000000,179.7500000,0);
createObject(1724,-2388.8000000,1515.9000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(2169,-2387.1001000,1514.1000000,37.2000000,0.0000000,0.0000000,90.2500000,0);
createObject(1724,-2387.8000000,1513.3000000,37.2000000,0.0000000,0.0000000,180.0000000,0);
createObject(1714,-2385.8999000,1514.5000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1723,-2393.3000000,1512.8000000,37.2000000,0.0000000,0.0000000,89.7470000,0);
createObject(1723,-2401.8999000,1512.9000000,37.2000000,0.0000000,0.0000000,89.7470000,0);
createObject(1723,-2398.8999000,1511.8000000,37.2000000,0.0000000,0.0000000,179.7470000,0);
createObject(2193,-2402.0000000,1516.5000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(2193,-2395.6001000,1517.5000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2309,-2401.0000000,1516.2000000,37.2000000,0.0000000,0.0000000,10.0000000,0);
createObject(2309,-2395.8000000,1516.5000000,37.2000000,0.0000000,0.0000000,289.9980000,0);
createObject(2321,-2394.5000000,1512.9000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2321,-2394.5000000,1512.9000000,37.7000000,0.0000000,0.0000000,90.0000000,0);
createObject(1747,-2394.2000000,1513.4000000,38.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2169,-2386.8000000,1579.4000000,37.2000000,0.0000000,0.0000000,90.2470000,0);
createObject(1724,-2388.3999000,1581.2000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1724,-2387.3999000,1578.7000000,37.2000000,0.0000000,0.0000000,180.0000000,0);
createObject(1714,-2385.8000000,1579.9000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1723,-2392.1001000,1582.7000000,37.2000000,0.0000000,0.0000000,359.7470000,0);
createObject(1723,-2393.2002000,1579.5996000,37.2000000,0.0000000,0.0000000,89.7420000,0);
createObject(1723,-2394.6001000,1580.9000000,37.2000000,0.0000000,0.0000000,269.7420000,0);
createObject(1724,-2395.3999000,1577.1000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1723,-2397.8000000,1582.6000000,37.2000000,0.0000000,0.0000000,359.7360000,0);
createObject(1723,-2397.7998000,1582.5996000,37.2000000,0.0000000,0.0000000,359.7360000,0);
createObject(2169,-2400.8000000,1580.3000000,37.2000000,0.0000000,0.0000000,270.2470000,0);
createObject(1714,-2401.8999000,1579.7000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(1724,-2399.1001000,1578.4000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(1724,-2400.1001000,1581.1000000,37.2000000,0.0000000,0.0000000,359.9950000,0);
createObject(2200,-2397.1001000,1568.0000000,37.2000000,0.0000000,0.0000000,180.0000000,0);
createObject(2007,-2395.8999000,1571.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2395.8999000,1570.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2395.8999000,1569.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2395.8999000,1571.8000000,38.6000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2395.8999000,1570.8000000,38.6000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2395.8999000,1569.8000000,38.6000000,0.0000000,0.0000000,270.0000000,0);
createObject(2200,-2399.3000000,1568.0000000,37.2000000,0.0000000,0.0000000,179.9950000,0);
createObject(2007,-2402.0000000,1571.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.0000000,1570.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.0000000,1569.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.0000000,1569.8000000,38.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.0000000,1570.8000000,38.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.0000000,1571.8000000,38.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.1001000,1522.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.1001000,1523.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.1001000,1524.8000000,37.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.1001000,1524.8000000,38.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.1001000,1523.8000000,38.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2402.1001000,1522.8000000,38.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2007,-2396.0000000,1522.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2396.0000000,1523.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2396.0000000,1524.8000000,37.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2396.0000000,1524.8000000,38.6000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2396.0000000,1523.8000000,38.6000000,0.0000000,0.0000000,270.0000000,0);
createObject(2007,-2396.0000000,1522.8000000,38.6000000,0.0000000,0.0000000,270.0000000,0);
createObject(2200,-2401.0000000,1526.4000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(2200,-2398.8000000,1526.4000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1714,-2382.5000000,1548.9000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2637,-2383.7000000,1546.9000000,32.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2637,-2383.7002000,1549.0000000,32.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(1714,-2382.5000000,1546.9000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2190,-2383.8999000,1547.1000000,32.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(2190,-2383.8999000,1549.1000000,32.6000000,0.0000000,0.0000000,90.0000000,0);
createObject(1649,-2384.3000000,1547.9000000,35.2000000,0.0000000,0.0000000,270.0000000,0);
createObject(2169,-2383.0000000,1556.4000000,31.9000000,0.0000000,0.0000000,0.2470000,0);
createObject(1714,-2382.5000000,1555.2000000,31.9000000,0.0000000,0.0000000,180.0000000,0);
createObject(2309,-2383.6001000,1557.7000000,31.9000000,0.0000000,0.0000000,239.9980000,0);
createObject(2309,-2381.6001000,1557.7000000,31.9000000,0.0000000,0.0000000,149.9960000,0);
createObject(2309,-2380.2000000,1559.8000000,31.9000000,0.0000000,0.0000000,87.9910000,0);
createObject(2309,-2380.2000000,1559.2000000,31.9000000,0.0000000,0.0000000,87.9900000,0);
createObject(2339,-2383.8999000,1561.0000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2339,-2393.8999000,1542.8000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(2339,-2398.8000000,1542.8000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(2169,-2381.5000000,1540.7000000,31.9000000,0.0000000,0.0000000,180.2470000,0);
createObject(1714,-2382.0000000,1541.8000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(2309,-2381.1001000,1539.5000000,31.9000000,0.0000000,0.0000000,37.9900000,0);
createObject(2309,-2382.8000000,1539.5000000,31.9000000,0.0000000,0.0000000,327.9850000,0);
createObject(2339,-2384.0000000,1536.1000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2309,-2380.1001000,1537.6000000,31.9000000,0.0000000,0.0000000,89.9800000,0);
createObject(2309,-2380.1001000,1537.0000000,31.9000000,0.0000000,0.0000000,89.9790000,0);
createObject(1997,-2385.7000000,1512.8000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2402.5000000,1514.0000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2200,-2392.8000000,1513.9000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2200,-2392.8000000,1516.2000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1723,-2389.1001000,1511.4000000,31.9000000,0.0000000,0.0000000,179.7470000,0);
createObject(1724,-2392.2000000,1512.1000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2200,-2395.3999000,1517.5000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2200,-2395.3999000,1515.2000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1723,-2397.3000000,1511.5000000,31.9000000,0.0000000,0.0000000,179.7470000,0);
createObject(1724,-2396.2000000,1513.3000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2339,-2385.0000000,1511.6000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1502,-2392.0000000,1561.2000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1502,-2392.0000000,1561.0000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(643,-2400.8000000,1556.4000000,32.4000000,0.0000000,0.0000000,0.0000000,0);
createObject(643,-2401.2000000,1560.5000000,32.4000000,0.0000000,0.0000000,0.0000000,0);
createObject(643,-2400.3000000,1565.1000000,32.4000000,0.0000000,0.0000000,0.0000000,0);
createObject(643,-2392.8000000,1566.0000000,32.4000000,0.0000000,0.0000000,0.0000000,0);
createObject(643,-2396.2000000,1563.6000000,32.4000000,0.0000000,0.0000000,0.0000000,0);
createObject(1997,-2385.3999000,1580.6000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1997,-2402.7000000,1581.9000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2200,-2395.3000000,1578.3000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2200,-2395.3000000,1580.6000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1723,-2399.3999000,1582.9000000,31.9000000,0.0000000,0.0000000,359.7470000,0);
createObject(1723,-2390.8999000,1582.8000000,31.9000000,0.0000000,0.0000000,359.7420000,0);
createObject(2200,-2392.8999000,1577.0000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(2200,-2392.8999000,1579.3000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1724,-2392.1001000,1581.2000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1724,-2396.3000000,1582.3000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2384.6001000,1553.4000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1554.0000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1554.6000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1556.4000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1555.8000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1555.2000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.7000000,1561.8000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.7000000,1561.2000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.7000000,1560.6000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.7000000,1560.0000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2388.8000000,1560.2000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1559.6000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1559.0000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1558.4000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1556.6000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1556.0000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1555.4000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1554.8000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1542.3000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1541.7000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1541.1000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1540.5000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1539.9000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1538.2000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1537.6000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1537.0000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1536.4000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2388.8000000,1535.8000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(1722,-2384.6001000,1536.1000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1535.5000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1534.9000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1534.3000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1543.2000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1542.6000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1542.0000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1541.4000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1540.8000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2384.6001000,1540.2000000,31.9000000,0.0000000,0.0000000,90.0000000,0);
createObject(1722,-2395.3999000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2394.8000000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2394.2000000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2393.6001000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2393.0000000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2399.3000000,1518.2000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2399.8999000,1518.2000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2400.5000000,1518.2000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2401.1001000,1518.2000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2401.7000000,1518.2000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2386.0000000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2386.6001000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2387.2000000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2387.8000000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2388.3999000,1518.3000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2388.0000000,1576.1000000,31.9000000,0.0000000,0.0000000,180.0000000,0);
createObject(1722,-2387.3999000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2386.8000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2386.2000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2392.8999000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2393.5000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2394.1001000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2394.7000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2395.3000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2399.3999000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2400.0000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2400.6001000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2401.2000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2401.8000000,1576.1000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2390.1001000,1543.4000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2390.7000000,1543.4000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2391.3000000,1543.4000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2391.8999000,1543.4000000,31.9000000,0.0000000,0.0000000,0.0000000,0);
createObject(1722,-2392.0000000,1553.6000000,31.9000000,0.0000000,0.0000000,180.0000000,0);
createObject(1722,-2391.3999000,1553.6000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2390.8000000,1553.6000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1722,-2390.2000000,1553.6000000,31.9000000,0.0000000,0.0000000,179.9950000,0);
createObject(1723,-2395.5000000,1542.0000000,37.2000000,0.0000000,0.0000000,179.7420000,0);
createObject(1723,-2394.3000000,1545.4000000,37.2000000,0.0000000,0.0000000,269.7360000,0);
createObject(1723,-2394.3000000,1552.0000000,37.2000000,0.0000000,0.0000000,269.7310000,0);
createObject(1723,-2397.6001000,1553.2000000,37.2000000,0.0000000,0.0000000,359.7360000,0);
createObject(1827,-2396.6001000,1551.1000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1827,-2396.5000000,1544.3000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1723,-2398.7000000,1542.0000000,37.2000000,0.0000000,0.0000000,179.7310000,0);
createObject(1723,-2402.0000000,1543.1000000,37.2000000,0.0000000,0.0000000,89.7250000,0);
createObject(1827,-2399.8000000,1544.0000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1723,-2402.0000000,1549.9000000,37.2000000,0.0000000,0.0000000,89.7250000,0);
createObject(1723,-2400.8000000,1553.2000000,37.2000000,0.0000000,0.0000000,359.7360000,0);
createObject(1827,-2399.8000000,1551.1000000,37.2000000,0.0000000,0.0000000,0.0000000,0);
createObject(1649,-2384.3000000,1547.8000000,35.2000000,0.0000000,0.0000000,90.0000000,0);
createObject(3386,-2373.5000000,1541.9000000,37.3000000,0.0000000,0.0000000,140.5000000,0);
createObject(1997,-2374.8000000,1540.7000000,37.2000000,0.0000000,0.0000000,269.9950000,0);
createObject(3391,-2377.3999000,1545.2000000,37.1000000,0.0000000,0.0000000,90.0000000,0);
createObject(3392,-2373.5000000,1545.2000000,37.1000000,0.0000000,0.0000000,90.0000000,0);
createObject(3383,-2373.3999000,1536.7000000,37.1000000,0.0000000,0.0000000,0.0000000,0);
createObject(2339,-2376.1001000,1536.5000000,37.1000000,0.0000000,0.0000000,180.0000000,0);
createObject(2339,-2377.1001000,1536.5000000,37.1000000,0.0000000,0.0000000,179.9950000,0);
createObject(2339,-2378.1001000,1536.5000000,37.1000000,0.0000000,0.0000000,179.9950000,0);
createObject(3392,-2377.3000000,1560.7000000,37.1000000,0.0000000,0.0000000,90.0000000,0);
createObject(3391,-2373.3999000,1560.7000000,37.1000000,0.0000000,0.0000000,90.0000000,0);
createObject(3383,-2373.2000000,1552.2000000,37.1000000,0.0000000,0.0000000,0.0000000,0);
createObject(2339,-2376.1001000,1552.0000000,37.1000000,0.0000000,0.0000000,179.9950000,0);
createObject(2339,-2377.1001000,1552.0000000,37.1000000,0.0000000,0.0000000,179.9950000,0);
createObject(2339,-2378.1001000,1552.0000000,37.1000000,0.0000000,0.0000000,179.9950000,0);
createObject(1997,-2375.2000000,1556.4000000,37.2000000,0.0000000,0.0000000,269.9950000,0);
createObject(3386,-2373.8999000,1557.6000000,37.3000000,0.0000000,0.0000000,140.4990000,0);
createObject(2637,-2394.8999000,1559.2000000,32.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(2637,-2394.8999000,1557.2000000,32.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(2637,-2394.8999000,1555.1000000,32.3000000,0.0000000,0.0000000,270.0000000,0);
createObject(2451,-2391.2000000,1555.2000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2451,-2391.2000000,1557.1000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2417,-2391.0000000,1558.1000000,31.9000000,0.0000000,0.0000000,270.0000000,0);
createObject(2417,-2392.6001000,1554.2000000,31.9000000,0.0000000,0.0000000,180.0000000,0);
createObject(2421,-2393.8000000,1553.8000000,33.3000000,0.0000000,0.0000000,180.0000000,0);
createObject(1514,-2394.8000000,1555.3000000,33.0000000,0.0000000,0.0000000,270.0000000,0);
createObject(1514,-2394.8000000,1557.1000000,33.0000000,0.0000000,0.0000000,270.0000000,0);
createObject(1514,-2394.8000000,1559.1000000,33.0000000,0.0000000,0.0000000,270.0000000,0);
}
local col = createColSphere(-2383.2002000,1547.0000000,30.9000000,50)
local function watchChanges( )
if getElementDimension( getLocalPlayer( ) ) > 0 and getElementDimension( getLocalPlayer( ) ) ~= getElementDimension( objects[1] ) and getElementInterior( getLocalPlayer( ) ) == getElementInterior( objects[1] ) then
for key, value in pairs( objects ) do
setElementDimension( value, getElementDimension( getLocalPlayer( ) ) )
end
elseif getElementDimension( getLocalPlayer( ) ) == 0 and getElementDimension( objects[1] ) ~= 65535 then
for key, value in pairs( objects ) do
setElementDimension( value, 65535 )
end
end
end
addEventHandler( "onClientColShapeHit", col,
function( element )
if element == getLocalPlayer( ) then
addEventHandler( "onClientRender", root, watchChanges )
end
end
)
addEventHandler( "onClientColShapeLeave", col,
function( element )
if element == getLocalPlayer( ) then
removeEventHandler( "onClientRender", root, watchChanges )
end
end
)
-- Put them standby for now.
for key, value in pairs( objects ) do
setElementDimension( value, 65535 )
end
|
-- Made by St_vn#3931, 9/11/2020
-- Aka St_vnC in roblox
-- Meant to replace TweenService
local emptyTable = {}
local tasks = {}
local function LerpFunction(start, goal, alpha)
return start + (goal - start) * alpha
end
game:GetService("RunService").RenderStepped:Connect(function(step)
for index, task in pairs(tasks) do
task.Alpha += step / task.Length
local object = task.Object
local start = task.Start
local alpha = task.Alpha
for property, value in pairs(task.Goal) do
object[property] = task.LerpMethod[property] and start[property]:Lerp(value, alpha) or LerpFunction(start[property], value, alpha)
end
if alpha >= 1 then
task.Object = nil
table.remove(tasks, index)
if task.Callback then task.Callback(unpack(task.Args)) end
end
end
end
return function(properties)
local object = properties.Object
local start = {}
local lerpMethod = {}
for property, value in pairs(properties.Goal) do
start[property] = object[property]
lerpMethod[property] = type(value) == "userdata"
end
table.insert(tasks, {
Object = object,
Start = start,
Goal = properties.Goal,
LerpMethod = lerpMethod,
Length = properties.Length,
Args = properties.Args or emptyTable,
Callback = properties.Callback,
Alpha = 0
})
end
|
local json = require "cjson"
local http_client = require "kong.tools.http_client"
local spec_helper = require "spec.spec_helpers"
local cache = require "kong.tools.database_cache"
local STUB_GET_URL = spec_helper.STUB_GET_URL
local API_URL = spec_helper.API_URL
describe("ACL Hooks", function()
setup(function()
spec_helper.prepare_db()
end)
teardown(function()
spec_helper.stop_kong()
end)
before_each(function()
spec_helper.restart_kong()
spec_helper.drop_db()
spec_helper.insert_fixtures {
api = {
{request_host = "acl1.com", upstream_url = "http://mockbin.com"},
{request_host = "acl2.com", upstream_url = "http://mockbin.com"}
},
consumer = {
{username = "consumer1"},
{username = "consumer2"}
},
plugin = {
{name = "key-auth", config = {key_names = {"apikey"}}, __api = 1},
{name = "acl", config = { whitelist = {"admin"}}, __api = 1},
{name = "key-auth", config = {key_names = {"apikey"}}, __api = 2},
{name = "acl", config = { whitelist = {"ya"}}, __api = 2}
},
keyauth_credential = {
{key = "apikey123", __consumer = 1},
{key = "apikey124", __consumer = 2}
},
acl = {
{group="admin", __consumer = 1},
{group="pro", __consumer = 1},
{group="admin", __consumer = 2}
}
}
end)
local function get_consumer_id(username)
local response, status = http_client.get(API_URL.."/consumers/consumer1")
assert.equals(200, status)
local consumer_id = json.decode(response).id
assert.truthy(consumer_id)
return consumer_id
end
local function get_acl_id(consumer_id_or_name, group_name)
local response, status = http_client.get(API_URL.."/consumers/"..consumer_id_or_name.."/acls/", {group=group_name})
assert.equals(200, status)
local body = json.decode(response)
if #body.data == 1 then
return body.data[1].id
end
end
describe("ACL entity invalidation", function()
it("should invalidate when ACL entity is deleted", function()
-- It should work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl1.com"})
assert.equals(200, status)
-- Check that cache is populated
local cache_key = cache.acls_key(get_consumer_id("consumer1"))
local _, status = http_client.get(API_URL.."/cache/"..cache_key)
assert.equals(200, status)
-- Delete ACL group (which triggers invalidation)
local _, status = http_client.delete(API_URL.."/consumers/consumer1/acls/"..get_acl_id("consumer1", "admin"))
assert.equals(204, status)
-- Wait for cache to be invalidated
local exists = true
while(exists) do
local _, status = http_client.get(API_URL.."/cache/"..cache_key)
if status ~= 200 then
exists = false
end
end
-- It should not work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl1.com"})
assert.equals(403, status)
end)
it("should invalidate when ACL entity is updated", function()
-- It should work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl1.com"})
assert.equals(200, status)
-- It should not work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl2.com"})
assert.equals(403, status)
-- Check that cache is populated
local cache_key = cache.acls_key(get_consumer_id("consumer1"))
local _, status = http_client.get(API_URL.."/cache/"..cache_key)
assert.equals(200, status)
-- Update ACL group (which triggers invalidation)
local _, status = http_client.patch(API_URL.."/consumers/consumer1/acls/"..get_acl_id("consumer1", "admin"), {group="ya"})
assert.equals(200, status)
-- Wait for cache to be invalidated
local exists = true
while(exists) do
local _, status = http_client.get(API_URL.."/cache/"..cache_key)
if status ~= 200 then
exists = false
end
end
-- It should not work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl1.com"})
assert.equals(403, status)
-- It should work now
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl2.com"})
assert.equals(200, status)
end)
end)
describe("Consumer entity invalidation", function()
it("should invalidate when Consumer entity is deleted", function()
-- It should work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl1.com"})
assert.equals(200, status)
-- Check that cache is populated
local cache_key = cache.acls_key(get_consumer_id("consumer1"))
local _, status = http_client.get(API_URL.."/cache/"..cache_key)
assert.equals(200, status)
-- Delete Consumer (which triggers invalidation)
local _, status = http_client.delete(API_URL.."/consumers/consumer1")
assert.equals(204, status)
-- Wait for consumer to be invalidated
local exists = true
while(exists) do
local _, status = http_client.get(API_URL.."/cache/"..cache_key)
if status ~= 200 then
exists = false
end
end
-- Wait for key to be invalidated
local exists = true
while(exists) do
local _, status = http_client.get(API_URL.."/cache/"..cache.keyauth_credential_key("apikey123"))
if status ~= 200 then
exists = false
end
end
-- It should not work
local _, status = http_client.get(STUB_GET_URL, {apikey = "apikey123"}, {host="acl1.com"})
assert.equals(403, status)
end)
end)
end)
|
TOOL.Category = "Construction"
TOOL.Name = "#Smart Door"
TOOL.ClientConVar["title"] = ""
TOOL.ClientConVar["friends"] = "1"
TOOL.ClientConVar["material"] = "1"
TOOL.ClientConVar["sound"] = "1"
TOOL.Materials = {
[1] = "models/wireframe",
[2] = "sprites/heatwave",
[3] = "Models/effects/comball_tape",
[4] = "Models/effects/splodearc_sheet",
[5] = "Models/effects/vol_light001",
[6] = "models/props_combine/stasisshield_sheet",
[7] = "models/props_combine/portalball001_sheet",
[8] = "models/props_combine/com_shield001a",
[9] = "models/props_c17/frostedglass_01a"
}
TOOL.Sounds = {
[1] = "doors/doorstop1.wav",
[2] = "npc/turret_floor/retract.wav",
[3] = "npc/roller/mine/combine_mine_deactivate1.wav",
[4] = "npc/roller/mine/combine_mine_deploy1.wav",
[5] = "npc/roller/mine/rmine_taunt1.wav",
[6] = "npc/scanner/scanner_nearmiss2.wav",
[7] = "npc/scanner/scanner_siren1.wav",
[8] = "npc/barnacle/barnacle_gulp1.wav",
[9] = "npc/barnacle/barnacle_gulp2.wav",
[10] = "npc/combine_gunship/attack_start2.wav",
[11] = "npc/combine_gunship/attack_stop2.wav",
[12] = "npc/dog/dog_pneumatic1.wav",
[13] = "npc/dog/dog_pneumatic2.wav"
}
local ENTITY = FindMetaTable("Entity")
function ENTITY:IsSmartDoor()
return self:GetNWBool("SmartDoor")
end
function ENTITY:IsSmartDoorOpened()
return self:GetNWBool("SmartDoorOpened")
end
if CLIENT then
language.Add("tool.smartdoor.name", "Smart Door")
language.Add("tool.smartdoor.desc", "Allows to create a smart door")
language.Add("tool.smartdoor.0", "Press R on the prop to customize it's whitelist")
surface.CreateFont("smartdoor_hud", {size = 26, weight = 300, antialias = true, extended = true, font = "Roboto Condensed"})
surface.CreateFont("smartdoor_hud_shadow", {size = 27, weight = 300, antialias = true, extended = true, blursize = 1.5, font = "Roboto Condensed"})
local function PrettyText(text, font, x, y, color, xalign, yalign)
draw.SimpleText(text, font .. "_shadow", x + 1, y + 1, ColorAlpha(color_black, 120), xalign, yalign and yalign or TEXT_ALIGN_TOP)
draw.SimpleText(text, font, x + 1, y + 1, ColorAlpha(color_black, 150), xalign, yalign and yalign or TEXT_ALIGN_TOP)
draw.SimpleText(text, font, x, y, color, xalign, yalign and yalign or TEXT_ALIGN_TOP)
end
local mat, lp, tr = Material("icon16/lock.png")
hook.Add("HUDPaint", "Smart Door", function()
lp = LocalPlayer()
tr = lp:GetEyeTraceNoCursor()
if IsValid(tr.Entity) and tr.HitPos:DistToSqr(lp:EyePos()) < 22500 then
local ent = tr.Entity
if not ent:IsSmartDoor() then
return
end
surface.SetFont("smartdoor_hud")
local name = ent:GetNWString("DoorTitle")
local name_size = surface.GetTextSize(name)
local extra = 0
if name_size == 0 then
extra = 6
end
PrettyText(name, "smartdoor_hud", ScrW() / 2 - 8, ScrH() / 1.6, color_white, TEXT_ALIGN_CENTER)
if not ent:GetNWBool("SmartDoorOpened") then
surface.SetMaterial(mat)
surface.SetDrawColor(color_white)
surface.DrawTexturedRect(ScrW() / 2 + name_size / 2 - extra, ScrH() / 1.6 + 6, 16, 16)
end
end
end)
local lp, wep
hook.Add("PreDrawHalos", "Smart Door", function()
lp = LocalPlayer()
wep = lp:GetActiveWeapon()
if (!IsValid(wep)) or (wep:GetClass() ~= "gmod_tool") or (lp:GetTool("smartdoor") == nil) then
return
end
local doors = {}
for _, ent in pairs(ents.FindByClass("prop_physics")) do
if (ent == lp:GetEyeTrace().Entity) and (ent:GetNWEntity("DoorOwner") == lp) and (ent:IsSmartDoor()) then
table.insert(doors, ent)
end
end
halo.Add(doors, HSVToColor(150, 1, 1), 2, 2, 2)
if CPPI then
local props = {}
for _, ent in pairs(ents.FindByClass("prop_physics")) do
if (ent == lp:GetEyeTrace().Entity) and (ent:CPPIGetOwner() == lp) and (!ent:IsSmartDoor()) then
table.insert(props, ent)
end
end
halo.Add(props, color_white, 2, 2, 2)
end
end)
net.Receive("Smart Door Get Whitelist", function()
local ent = net.ReadEntity()
local tbl = net.ReadTable()
local menu = DermaMenu()
local add = menu:AddSubMenu("Add to whitelist")
for _, pl in pairs(player.GetAll()) do
if table.HasValue(tbl, pl) or pl == LocalPlayer() then
continue
end
add:AddOption(pl:Name(), function()
net.Start("Smart Door Add Whitelist")
net.WriteEntity(ent)
net.WriteEntity(pl)
net.SendToServer()
end):SetIcon("icon16/user.png")
end
local remove = menu:AddSubMenu("Remove from whitelist")
for _, pl in pairs(tbl) do
remove:AddOption(pl:Name(), function()
net.Start("Smart Door Remove Whitelist")
net.WriteEntity(ent)
net.WriteEntity(pl)
net.SendToServer()
end):SetIcon("icon16/user_green.png")
end
menu:MakePopup()
menu:Open()
end)
end
if SERVER then
util.AddNetworkString("Smart Door Get Whitelist")
util.AddNetworkString("Smart Door Set Whitelist")
util.AddNetworkString("Smart Door Add Whitelist")
util.AddNetworkString("Smart Door Remove Whitelist")
net.Receive("Smart Door Set Whitelist", function(_, sender)
local ent = net.ReadEntity()
local tbl = net.ReadTable()
if not IsValid(ent) or not IsValid(sender) or ent.OwnerID ~= sender:UniqueID() then
return
end
ent.Whitelist = tbl
end)
net.Receive("Smart Door Add Whitelist", function(_, sender)
local ent = net.ReadEntity()
local pl = net.ReadEntity()
if not IsValid(sender) or ent.OwnerID ~= sender:UniqueID() then
return
end
if not IsValid(ent) or not ent:IsSmartDoor() or table.HasValue(ent.Whitelist, pl) then
return
end
table.insert(ent.Whitelist, pl)
end)
net.Receive("Smart Door Remove Whitelist", function(_, sender)
local ent = net.ReadEntity()
local pl = net.ReadEntity()
if not IsValid(sender) or ent.OwnerID ~= sender:UniqueID() then
return
end
if not IsValid(ent) or not ent:IsSmartDoor() or not table.HasValue(ent.Whitelist, pl) then
return
end
table.RemoveByValue(ent.Whitelist, pl)
end)
function ENTITY:SetSmartDoor(bool)
self:SetNWBool("SmartDoor", bool)
self.OwnerID = 1
self.Whitelist = {}
self.DoorSound = ""
self.DoorMaterial = ""
self.InitialMaterial = self:GetMaterial()
end
function ENTITY:OpenSmartDoor()
if not self:IsSmartDoor() then
return
end
local material
if self.DoorMaterial ~= "" then
material = self.DoorMaterial
else
material = "models/wireframe"
end
if self:GetNWBool("SmartDoorOpened") then
local trace = {
start = self:GetPos(),
endpos = self:GetPos(),
mins = self:OBBMins(),
maxs = self:OBBMaxs(),
filter = self
}
local tr = util.TraceHull(trace)
if tr.Entity and not tr.Entity:IsWorld() and IsValid(tr.Entity) then
return
end
self:SetCollisionGroup(COLLISION_GROUP_NONE)
self:SetNWBool("SmartDoorOpened", false)
self:SetMaterial(self.InitialMaterial)
else
self:SetCollisionGroup(COLLISION_GROUP_DEBRIS_TRIGGER)
self:SetNWBool("SmartDoorOpened", true)
self:SetMaterial(material)
end
if self.DoorSound ~= "" then
self:EmitSound(self.DoorSound)
end
end
hook.Add("PlayerUse", "Smart Door", function(pl, ent)
if not timer.Exists("Smart Door Cooldown #" .. pl:UniqueID()) then
if pl:GetPos():Distance(ent:GetPos()) > 130 or pl:InVehicle() or not IsValid(ent) or not ent:IsSmartDoor() then
return
end
if table.HasValue(ent.Whitelist) or ent:GetNWEntity("DoorOwner") == pl then
ent:OpenSmartDoor()
timer.Create("Smart Door Cooldown #" .. pl:UniqueID(), 0.6, 1, function() end)
return
end
end
end)
hook.Add("PlayerInitialSpawn", "Smart Door", function(pl)
for _, ent in pairs(ents.GetAll()) do
if not ent:IsSmartDoor() then
continue
end
if ent.OwnerID == pl:UniqueID() then
ent:SetNWEntity("DoorOwner", pl)
end
end
end)
end
local MatNum = #TOOL.Materials
local SoundNum = #TOOL.Sounds
function TOOL.BuildCPanel(panel)
panel:AddControl("Header", {
Text = "Smart Door",
Description = "Enter the title of your smart door"
})
local Entry = vgui.Create("DTextEntry")
panel:AddItem(Entry)
local Button = vgui.Create("DButton")
Button:SetText("Save title")
Button.DoClick = function()
RunConsoleCommand("smartdoor_title", Entry:GetValue() or "")
end
panel:AddItem(Button)
panel:AddControl("Slider", {
Label = "Material",
Min = "1",
Max = tostring(MatNum),
Command = "smartdoor_material"
})
panel:AddControl("Slider", {
Label = "Sound",
Min = "1",
Max = tostring(SoundNum),
Command = "smartdoor_sound"
})
panel:AddControl("CheckBox", {
Label = "Steam friends are able to open the door",
Command = "smartdoor_friends"
})
end
function TOOL:LeftClick(tr)
if not tr.Entity or not IsValid(tr.Entity) or tr.HitWorld then
return false
end
local ent = tr.Entity
if ent:IsSmartDoor() or ent:GetClass() ~= "prop_physics" then
return false
end
if SERVER then
ent:SetSmartDoor(true)
ent:SetNWString("DoorTitle", self:GetClientInfo("title"))
ent:SetNWEntity("DoorOwner", self:GetOwner())
ent.DoorMaterial = self.Materials[self:GetClientNumber("material", 1)]
ent.DoorSound = self.Sounds[self:GetClientNumber("sound", 1)]
ent.OwnerID = self:GetOwner():UniqueID()
end
if CLIENT then
if self:GetClientNumber("friends", 1) == 1 then
local tbl = {}
for _, pl in pairs(player.GetAll()) do
if pl:GetFriendStatus() == "friend" then
table.insert(tbl, pl)
end
end
net.Start("Smart Door Set Whitelist")
net.WriteEntity(ent)
net.WriteTable(tbl)
net.SendToServer()
end
end
return true
end
function TOOL:RightClick(tr)
if not tr.Entity or not IsValid(tr.Entity) or tr.HitWorld then
return false
end
local ent = tr.Entity
if not ent:IsSmartDoor() or ent:GetClass() ~= "prop_physics" then
return false
end
if SERVER then
if ent:GetNWBool("SmartDoorOpened") then
ent:OpenSmartDoor()
end
ent:SetSmartDoor(false)
ent:SetNWEntity("DoorOwner", nil)
end
return true
end
function TOOL:Reload(tr)
if not tr.Entity or not IsValid(tr.Entity) or tr.HitWorld then
return false
end
local ent = tr.Entity
if not ent:IsSmartDoor() or ent:GetClass() ~= "prop_physics" then
return false
end
if self:GetOwner() ~= ent:GetNWEntity("DoorOwner") then
return false
end
if SERVER then
net.Start("Smart Door Get Whitelist")
net.WriteEntity(ent)
net.WriteTable(ent.Whitelist)
net.Send(self:GetOwner())
end
return true
end
|
local httpc = require "httpc"
local crypt = require "crypt"
local type = type
local pairs = pairs
local ipairs = ipairs
local assert = assert
--[[
文档地址: https://lbs.qq.com/webservice_v1/index.html
目前所有API接口仅支持SN码签名校验, 请自行在腾讯位置服务端`后台管理`->`key管理`中进行设置获取key并且生成sn码.
所有接口数据均返回原生http code与json数据, 请开发者自行进行接口判断与json decode.
]]
local function sign(sn, path, opt)
local key_sorts = {}
for key, value in pairs(opt) do
key_sorts[#key_sorts+1] = key
end
table.sort(key_sorts)
local args = {}
local signs = {}
for index, key in ipairs(key_sorts) do
signs[#signs+1] = key .. '=' .. opt[key]
args[#args+1] = {key, opt[key]}
end
local sig = crypt.md5(path .. '?' .. table.concat(signs, "&") .. sn, true)
args[#args+1] = {"sig", sig}
return args
end
local tencent = { __Version__ = 0.1 }
-- IP定位
--[[
ip : IP地址
]]
function tencent.getIpLocation (accesskey, sn, ip)
return httpc.get("https://apis.map.qq.com/ws/location/v1/ip", nil, sign(sn, "/ws/location/v1/ip", {
ip = ip, key = accesskey
}))
end
-- 获取行政规划区列表
function tencent.getDistrictList (accesskey, sn)
return httpc.get("https://apis.map.qq.com/ws/district/v1/list", nil, sign(sn, "/ws/district/v1/list", {key = accesskey}))
end
-- 获取指定行政规划区
--[[
id: 父级行政区划ID,缺省时则返回最顶级行政区划
]]
function tencent.getDistrictChildren (accesskey, sn, id)
return httpc.get("https://apis.map.qq.com/ws/district/v1/getchildren", nil, sign(sn, "/ws/district/v1/getchildren", {
id = id, key = accesskey
}))
end
-- 关键词猜测(补全)
--[[
keyword: 搜索/联想/补全关键词
region: 范围, 如: 广州
region_fix : 是否固定范围.
location: 不支持
page_index: 当前是第几页
page_size: 每页返回数量
]]
function tencent.searchSuggestion (accesskey, sn, keyword, region, region_fix, page_index, page_size)
return httpc.get("https://apis.map.qq.com/ws/place/v1/suggestion", nil, sign(sn, "/ws/place/v1/suggestion", {
key = accesskey, keyword = keyword,
page_index = page_index or 1,
page_size = page_size or 10,
region = region or '',
region_fix = region_fix or 1,
}))
end
function tencent.searchPlace (accesskey, sn, keyword, boundary, page_index, page_size, order)
return httpc.get("https://apis.map.qq.com/ws/place/v1/search", nil, sign(sn, "/ws/place/v1/search", {
key = accesskey,
keyword = keyword,
boundary = boundary,
page_index = page_index,
page_size = page_size,
order = order,
}))
end
-- 关键词搜索行政规划区
--[[
keyword: 行政区关键词
]]
function tencent.searchDistrict (accesskey, sn, keyword)
return httpc.get("https://apis.map.qq.com/ws/district/v1/search", nil, sign(sn, "/ws/district/v1/search", {
key = accesskey, keyword = keyword
}))
end
-- 距离计算(一对多)
--[[
mode: driving 驾车, wakling 步行
from: 起始经纬度
to: 目的经纬度
]]
function tencent.getDistance (accesskey, sn, opt)
return httpc.get("https://apis.map.qq.com/ws/distance/v1/", nil, sign(sn, "/ws/distance/v1/", {
key = accesskey, to = opt.to, from = opt.from, mode = opt.mode,
}))
end
return tencent
|
id = 'V-38517'
severity = 'medium'
weight = 10.0
title = 'The Transparent Inter-Process Communication (TIPC) protocol must be disabled unless required.'
description = 'Disabling TIPC protects the system against exploitation of any flaws in its implementation.'
fixtext = [=[The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communications between nodes in a cluster. To configure the system to prevent the "tipc" kernel module from being loaded, add the following line to a file in the directory "/etc/modprobe.d":
install tipc /bin/true]=]
checktext = [=[If the system is configured to prevent the loading of the "tipc" kernel module, it will contain lines inside any file in "/etc/modprobe.d" or the deprecated"/etc/modprobe.conf". These lines instruct the module loading system to run another program (such as "/bin/true") upon a module "install" event. Run the following command to search for such lines in all files in "/etc/modprobe.d" and the deprecated "/etc/modprobe.conf":
$ grep -r tipc /etc/modprobe.conf /etc/modprobe.d
If no line is returned, this is a finding.]=]
function test()
end
function fix()
end
|
require("config")
-- Composite Entity
local _composite_entity = table.deepcopy( data.raw["ammo-turret"]["gun-turret"] )
_composite_entity.name = "composite-entity"
local _composite_item = table.deepcopy( data.raw.item["gun-turret"] )
_composite_item.name = "composite-entity"
_composite_item.place_result = "composite-entity"
local _composite_recipe = table.deepcopy( data.raw.recipe["gun-turret"] )
_composite_recipe.name = "composite-entity"
_composite_recipe.result = "composite-entity"
_composite_recipe.enabled = true
-- Static Entity
local _static_item = table.deepcopy( data.raw.item["gun-turret"] )
_static_item.name = "static-entity"
_static_item.place_result = "static-entity"
local _static_entity = table.deepcopy( data.raw["ammo-turret"]["gun-turret"] )
_static_entity.name = "static-entity"
-- Upgradable Entity
local _upgradable_item_1_2 = table.deepcopy( data.raw.item["iron-gear-wheel"] )
_upgradable_item_1_2.name = "upgrade-entity-1-2"
local _upgradable_recipe_1_2 = table.deepcopy( data.raw.recipe["iron-gear-wheel"] )
_upgradable_recipe_1_2.name = "upgrade-entity-1-2"
_upgradable_recipe_1_2.result = "upgrade-entity-1-2"
_upgradable_recipe_1_2.enabled = true
local _upgradable_item_1_3 = table.deepcopy( data.raw.item["iron-gear-wheel"] )
_upgradable_item_1_3.name = "upgrade-entity-1-3"
local _upgradable_recipe_1_3 = table.deepcopy( data.raw.recipe["iron-gear-wheel"] )
_upgradable_recipe_1_3.name = "upgrade-entity-1-3"
_upgradable_recipe_1_3.result = "upgrade-entity-1-3"
_upgradable_recipe_1_3.enabled = true
-- Biter Attractor Entity
local _biter_entity = table.deepcopy( data.raw["ammo-turret"]["gun-turret"] )
_biter_entity.name = "biter-entity"
local _biter_item = table.deepcopy( data.raw.item["gun-turret"] )
_biter_item.name = "biter-entity"
_biter_item.place_result = "biter-entity"
local _biter_recipe = table.deepcopy( data.raw.recipe["gun-turret"] )
_biter_recipe.name = "biter-entity"
_biter_recipe.result = "biter-entity"
_biter_recipe.enabled = true
data:extend({
_composite_entity, _composite_item, _composite_recipe,
_static_entity, _static_item,
_upgradable_item_1_2, _upgradable_recipe_1_2,
_upgradable_item_1_3, _upgradable_recipe_1_3,
_biter_entity, _biter_item, _biter_recipe,
})
-- Abilities
require("shared")
-- teleport (click to move)
register_ability( abilities[1] )
-- bubble (toggle to drain energy from buildings)
register_ability( abilities[2] )
data:extend({
{
type="sprite",
name="reserve-internal",
filename = "__core__/graphics/rename-small.png",
priority = "extra-high-no-scale",
width = 16,
height = 16,
}
})
|
object_draft_schematic_furniture_furniture_outbreak_shackled_prisoner = object_draft_schematic_furniture_shared_furniture_outbreak_shackled_prisoner:new {
}
ObjectTemplates:addTemplate(object_draft_schematic_furniture_furniture_outbreak_shackled_prisoner, "object/draft_schematic/furniture/furniture_outbreak_shackled_prisoner.iff")
|
-----------------------------------
-- Area: Lower Jeuno
-- NPC: Geuhbe
-- Type: Event Scene Replayer
-- !pos -74.309 -1 -114.174 245
--
-- Auto-Script: Requires Verification (Verfied by Brawndo)
-----------------------------------
function onTrade(player,npc,trade)
end;
function onTrigger(player,npc)
player:startEvent(10033);
end;
function onEventUpdate(player,csid,option)
end;
function onEventFinish(player,csid,option)
end;
|
function PainStealStart(keys)
local caster = keys.caster
local ability = keys.ability
local unit = keys.unit
local damage_taken = keys.DamageTaken
local ability_level = ability:GetLevel() - 1
local pain_steal_heroes = ability:GetLevelSpecialValueFor("pain_steal", ability_level)
local pain_steal_creeps = ability:GetLevelSpecialValueFor("pain_steal_creeps", ability_level)
if caster and unit then
if caster:IsRealHero() then
local heal_amount
if unit:IsRealHero() then
heal_amount = damage_taken*pain_steal_heroes*0.01
else
heal_amount = damage_taken*pain_steal_creeps*0.01
end
if heal_amount > 0 then
caster:Heal(heal_amount, caster)
SendOverheadEventMessage(nil, OVERHEAD_ALERT_HEAL, caster, heal_amount, nil)
end
end
end
end
|
--[[
Vultaic::Addon::Maptest
--]]
local settings = {
allow_deletes = {
race = true,
},
}
function onMapAccepted(mapName)
if getPlayerCount() < 100 then
outputChatBox("#19846dMap Testing :: #ffffffThe map #19846d"..mapName.."#ffffff has been #00ff00accepted#ffffff!", root, 255, 255, 255, true)
exports.core:refreshMaps()
end
end
|
util.AddNetworkString("Minigolf.SetSwapTimeLimit")
util.AddNetworkString("Minigolf.EndSwapTimeLimit")
util.AddNetworkString("Minigolf.SetPlayerTimeLimit")
util.AddNetworkString("Minigolf.PlayerHasFinished")
util.AddNetworkString("Minigolf.PlayerShowScoreboard")
Minigolf.Holes = Minigolf.Holes or {}
Minigolf.Holes.Cache = {}
function Minigolf.Holes.GetByName(findHoleName)
if(Minigolf.Holes.Cache[findHoleName])then
return Minigolf.Holes.Cache[findHoleName]
end
for _, hole in pairs(ents.FindByClass("minigolf_hole_start")) do
local holeName = hole:GetUniqueHoleName()
Minigolf.Holes.Cache[holeName] = hole
if(holeName == findHoleName)then
return hole
end
end
return Minigolf.Holes.Cache[hole]
end
function Minigolf.Holes.ResetForPlayer(player)
player:ResetHoleScores()
for _, hole in pairs(ents.FindByClass("minigolf_hole_start")) do
player:SetHoleScore(hole, HOLE_NOT_PLAYED)
end
end
function Minigolf.Holes.EndSwapTimer(teamPlayers, start)
local holeName = start:GetUniqueHoleName()
local timerName = holeName .. "SwapTimeLimit"
-- Check if we were swapping team members on this hole
if(timer.Exists(timerName))then
timer.Remove(timerName)
for _, teamPlayer in pairs(teamPlayers) do
teamPlayer:SetHoleWaitingForSwap(nil)
end
net.Start("Minigolf.EndSwapTimeLimit")
net.WriteEntity(start)
net.Send(teamPlayers)
end
end
function Minigolf.Holes.Start(player, ball, start)
local holeName = start:GetUniqueHoleName()
local timeLimit = start:GetLimit()
local teamPlayers = team.GetPlayers(player:Team())
Minigolf.Holes.EndSwapTimer(teamPlayers, start)
player:SetActiveHole(start)
net.Start("Minigolf.SetPlayerTimeLimit")
net.WriteEntity(player)
net.WriteUInt(timeLimit, 32)
net.Broadcast()
start:SetActiveTeam(player:Team())
local parMsg = start._HolePar and (" (Par: " .. start._HolePar .. ")") or ""
Minigolf.Messages.Send(teamPlayers, player:Nick() .. " has started at '" .. start:GetHoleName() .. "'" .. parMsg, "£")
hook.Call("MinigolfPlayerStarted", gm(), player, start, ball)
Minigolf.Holes.CreateTimeLimit(timeLimit, player, ball, start)
end
-- When a minigolf player is done, set a time limit for the next player to take their turn
function Minigolf.Holes.CreateTimeLimitSwap(timeLimit, player, teamID, start, strokes)
local teamPlayers = team.GetPlayers(teamID)
local holeName = start:GetUniqueHoleName()
local isLastPlayer = true
for _, otherPly in pairs(teamPlayers) do
if(otherPly:GetHoleScore(start) == HOLE_NOT_PLAYED)then
isLastPlayer = false
break
end
end
if(not isLastPlayer)then
net.Start("Minigolf.SetSwapTimeLimit")
net.WriteEntity(start)
net.WriteUInt(timeLimit, 32)
net.Send(teamPlayers)
Minigolf.Messages.Send(teamPlayers, "Alright switch to the next player within " .. timeLimit .. " seconds!", "M", TEXT_EFFECT_ATTENTION)
-- The player may have left our team waiting
if(IsValid(player))then
-- Indicate we are waiting for someone to take their turn
player:SetHoleWaitingForSwap(start)
-- Remove the play timelimit timer
timer.Remove((player:AccountID() or player:UserID()) .. holeName .. "TimeLimit")
end
-- Start the timelimit for switching hole
timer.Create(holeName .. "SwapTimeLimit", timeLimit, 1, function()
local wereDisqualified = false
Minigolf.Holes.EndSwapTimer(teamPlayers, start)
-- Penalize the players by disqualifying them
for _, otherPly in pairs(teamPlayers) do
if(IsValid(otherPly))then
if(otherPly:GetHoleScore(start) == HOLE_NOT_PLAYED)then
Minigolf.Messages.Send(otherPly, "You have been disqualified for taking too long to take your turn on '".. start:GetHoleName() .."'!", TEXT_EFFECT_ATTENTION)
otherPly:SetHoleScore(start, HOLE_DISQUALIFIED)
wereDisqualified = true
end
end
end
if(wereDisqualified)then
Minigolf.Messages.Send(teamPlayers, "Some players took too long to take their turn and got disqualified")
end
Minigolf.Holes.ProcessTeamEnd(teamID, start)
end)
end
end
function Minigolf.Holes.CreateTimeLimit(timeLimit, player, ball, start)
local ball = player:GetPlayerBall()
timer.Create((player:AccountID() or player:UserID()) .. start:GetUniqueHoleName() .. "TimeLimit", timeLimit, 1, function()
if(IsValid(player) and IsValid(ball) and ball:GetStart() == start)then
hook.Call("MinigolfTimeLimitReached", gm(), player, ball, start)
Minigolf.Holes.End(player, ball, start)
end
end)
end
function Minigolf.Holes.End(player, ball, start, goal)
local strokes = ball:GetStrokes()
local teamID = start:GetActiveTeam()
local teamPlayers = team.GetPlayers(teamID)
local teamName = team.GetName(teamID)
local holeName = start:GetUniqueHoleName()
local customMessage = false
-- They may have disconnected
if(IsValid(player))then
-- Goal can be nil when we end because of strike or time limit
if(goal)then
customMessage = hook.Call("MinigolfGetGoalMessage", gm(), player, goal, strokes, start)
else
strokes = HOLE_DISQUALIFIED
end
player:SetHoleScore(start, strokes)
player:SetPlayerBall(nil)
player:SetActiveHole(nil)
if(customMessage ~= false)then
Minigolf.Messages.Send(teamPlayers, player:Nick() .. " made it to the hole '" .. goal:GetHoleName() .. "' with " .. strokes .. " " .. Minigolf.Text.Pluralize("stroke", strokes), "Ã")
end
else
Minigolf.Messages.Send(teamPlayers, "A player disconnect at hole '" .. start:GetHoleName() .. "!", "¡")
end
if(IsValid(start))then
start:OnBallHit(ball)
end
net.Start("Minigolf.PlayerHasFinished")
net.WriteEntity(player)
net.WriteEntity(start)
net.WriteUInt(strokes, 32)
net.Broadcast()
hook.Call("MinigolfPlayerFinishedHole", gm(), player, ball, start, strokes)
for _, otherPly in pairs(teamPlayers) do
if(otherPly:GetHoleScore(start) == HOLE_NOT_PLAYED)then
Minigolf.Holes.CreateTimeLimitSwap(30, player, teamID, start, strokes)
if(IsValid(ball))then
ball:Remove()
end
return
end
end
if(IsValid(ball))then
ball:Remove()
end
Minigolf.Holes.ProcessTeamEnd(teamID, start)
end
function Minigolf.Holes.ProcessTeamEnd(teamID, start)
local minHolesPlayed = 9999999 -- To find which player played the least holes
local teamPlayers = team.GetPlayers(teamID)
local teamName = team.GetName(teamID)
local holeName = start:GetUniqueHoleName()
for _, otherPly in pairs(teamPlayers) do
local plyHoleCount = 0
for holeName, holeScore in pairs(otherPly:GetAllHoleScores()) do
if(holeScore ~= HOLE_NOT_PLAYED)then
plyHoleCount = plyHoleCount + 1
end
end
if(plyHoleCount < minHolesPlayed)then
minHolesPlayed = plyHoleCount
end
end
start:SetActiveTeam(nil)
-- Check if the player with the least holes played has actually played all holes (thus the team is finished)
local allHolesPlayed = minHolesPlayed == NUM_HOLES
hook.Call("MinigolfTeamFinishedHole", gm(), teamID, teamPlayers, start, allHolesPlayed)
-- Check if all holes have been played
if(allHolesPlayed)then
Minigolf.Messages.Send(nil, "Team '" .. teamName .. "' has finished all the holes! They can restart.")
for _,teamPlayer in pairs(teamPlayers) do
net.Start("Minigolf.PlayerShowScoreboard")
net.WriteEntity(start)
net.WriteTable(teamPlayer:GetAllHoleScores())
net.WriteBool(true) -- Clear the local scores (so flag checkmarks reset)
net.Send(teamPlayer)
teamPlayer:PlaySound("plats/elevbell1.wav")
end
for _, teamMember in pairs(teamPlayers) do
Minigolf.Holes.ResetForPlayer(teamMember)
end
else
Minigolf.Messages.Send(nil, "Team '" .. teamName .. "' is done playing at '" .. start:GetHoleName() .. "'")
end
end
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- VEAF transport mission command and functions for DCS World
-- By zip (2018)
--
-- Features:
-- ---------
-- * Listen to marker change events and creates a transport training mission, with optional parameters
-- * Possibilities :
-- * - create a zone with cargo to pick up, another with friendly troops awaiting their cargo, and optionaly enemy units on the way
-- * Works with all current and future maps (Caucasus, NTTR, Normandy, PG, ...)
--
-- Prerequisite:
-- ------------
-- * This script requires DCS 2.5.1 or higher and MIST 4.3.74 or higher.
-- * It also requires the base veaf.lua script library (version 1.0 or higher)
-- * It also requires the veafMarkers.lua script library (version 1.0 or higher)
-- * It also requires the veafSpawn.lua script library (version 1.0 or higher)
-- * It also requires the veafNamedPoints.lua script library (version 1.0 or higher)
--
-- Basic Usage:
-- ------------
-- 1.) Place a mark on the F10 map.
-- 2.) As text enter "veaf transport mission"
-- 3.) Click somewhere else on the map to submit the new text.
-- 4.) The command will be processed. A message will appear to confirm this
-- 5.) The original mark will disappear.
--
-- Options:
-- --------
-- Type "veaf transport mission" to create a default transport mission
-- add ", from [named point]" to specify starting position from the named points database (veafNamedPoints.lua) ; default is KASPI
-- add ", defense [1-5]" to specify air defense cover on the way (1 = light, 5 = heavy)
-- add ", size [1-5]" to change the number of cargo items to be transported (1 per participating helo, usually)
-- add ", blocade [1-5]" to specify enemy blocade around the drop zone (1 = light, 5 = heavy)
--
-- *** NOTE ***
-- * All keywords are CaSE inSenSITvE.
-- * Commas are the separators between options ==> They are IMPORTANT!
--
-------------------------------------------------------------------------------------------------------------------------------------------------------------
veafTransportMission = {}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Global settings. Stores the script constants
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Identifier. All output in DCS.log will start with this.
veafTransportMission.Id = "TRANSPORT MISSION - "
--- Version.
veafTransportMission.Version = "1.1.1"
--- Key phrase to look for in the mark text which triggers the command.
veafTransportMission.Keyphrase = "veaf transport "
veafTransportMission.CargoTypes = {"ammo_cargo", "barrels_cargo", "container_cargo", "fueltank_cargo" }
--- Number of seconds between each check of the friendly group ADF loop function
veafTransportMission.SecondsBetweenAdfLoops = 30
--- Number of seconds between each check of the friendly group watchdog function
veafTransportMission.SecondsBetweenWatchdogChecks = 15
--- Number of seconds between each smoke request on the target
veafTransportMission.SecondsBetweenSmokeRequests = 180
--- Number of seconds between each flare request on the target
veafTransportMission.SecondsBetweenFlareRequests = 120
--- Name of the friendly group that waits for the cargo
veafTransportMission.BlueGroupName = "Cargo - Allied Group"
--- Name of the cargo units
veafTransportMission.BlueCargoName = "Cargo - Cargo unit"
--- Name of the enemy group that defends the way to the friendlies
veafTransportMission.RedDefenseGroupName = "Cargo - Enemy Air Defense Group"
--- Name of the enemy group that blocades the friendlies
veafTransportMission.RedBlocadeGroupName = "Cargo - Enemy Blocade Group"
veafTransportMission.RadioMenuName = "TRANSPORT MISSION (" .. veafTransportMission.Version .. ")"
veafTransportMission.AdfRadioSound = "l10n/DEFAULT/beacon.ogg"
veafTransportMission.AdfFrequency = 550000 -- in hz
veafTransportMission.AdfPower = 1000 -- in Watt
veafTransportMission.DoRadioTransmission = false -- set to true when radio transmissions will work
--- if not specified, mission will start at this named point
veafTransportMission.DefaultStartPosition = "KASPI"
-- minimum authorized route distance ; missions shorter than this will not be authorized
veafTransportMission.MinimumRouteDistance = 15000 -- 15 km
-- size of the sqfe zone (no enemy group before this distance)
veafTransportMission.SafeZoneDistance = 10000 -- 10 km
-- size of the sqfe zone near drop zone (no enemy group after this distance from the drop zone)
veafTransportMission.DropZoneSafeZoneDistance = 5000 -- 5 km
-- an enemy group every xxx meters of the way (randomized)
veafTransportMission.EnemyDefenseDistanceStep = 3000
-- enemies groups generated along the way are offset to xxx meters max (left or right, randomized)
veafTransportMission.LeftOrRightMaxOffset = 1500
-- enemies groups generated along the way are offset to xxx meters min (left or right, randomized)
veafTransportMission.LeftOrRightMinOffset = 500
-- enemies groups generated far from the way are offset to xxx meters max (left or right, randomized)
veafTransportMission.LeftOrRightMaxFarOffset = 7000
-- enemies groups generated far from the way are offset to xxx meters min (left or right, randomized)
veafTransportMission.LeftOrRightMinFarOffset = 3000
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Do not change anything below unless you know what you are doing!
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Friendly group watchdog function id
veafTransportMission.friendlyGroupAliveCheckTaskID = 'none'
-- Friendly group ADF transmission loop function id
veafTransportMission.friendlyGroupAdfLoopTaskID = 'none'
--- Radio menus paths
veafTransportMission.targetMarkersPath = nil
veafTransportMission.targetInfoPath = nil
veafTransportMission.rootPath = nil
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Utility methods
-------------------------------------------------------------------------------------------------------------------------------------------------------------
function veafTransportMission.logInfo(message)
veaf.logInfo(veafTransportMission.Id .. message)
end
function veafTransportMission.logDebug(message)
veaf.logDebug(veafTransportMission.Id .. message)
end
function veafTransportMission.logTrace(message)
veaf.logTrace(veafTransportMission.Id .. message)
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Event handler functions.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Function executed when a mark has changed. This happens when text is entered or changed.
function veafTransportMission.onEventMarkChange(eventPos, event)
-- Check if marker has a text and the veafTransportMission.keyphrase keyphrase.
if event.text ~= nil and event.text:lower():find(veafTransportMission.Keyphrase) then
-- Analyse the mark point text and extract the keywords.
local options = veafTransportMission.markTextAnalysis(event.text)
if options then
-- Check options commands
if options.transportmission then
-- create the mission
veafTransportMission.generateTransportMission(eventPos, options.size, options.defense, options.blocade, options.from)
end
else
-- None of the keywords matched.
return
end
-- Delete old mark.
veafTransportMission.logTrace(string.format("Removing mark # %d.", event.idx))
trigger.action.removeMark(event.idx)
end
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Analyse the mark text and extract keywords.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Extract keywords from mark text.
function veafTransportMission.markTextAnalysis(text)
-- Option parameters extracted from the mark text.
local switch = {}
switch.transportmission = false
-- size ; number of cargo to be transported
switch.size = 1
-- defense [1-5] : air defense cover on the way (1 = light, 5 = heavy)
switch.defense = 0
-- blocade [1-5] : enemy blocade around the drop zone (1 = light, 5 = heavy)
switch.blocade = 0
-- start position, named point
switch.from = veafTransportMission.DefaultStartPosition
-- Check for correct keywords.
if text:lower():find(veafTransportMission.Keyphrase .. "mission") then
switch.transportmission = true
else
return nil
end
-- keywords are split by ","
local keywords = veaf.split(text, ",")
for _, keyphrase in pairs(keywords) do
-- Split keyphrase by space. First one is the key and second, ... the parameter(s) until the next comma.
local str = veaf.breakString(veaf.trim(keyphrase), " ")
local key = str[1]
local val = str[2]
if switch.transportmission and key:lower() == "size" then
-- Set size.
veafTransportMission.logDebug(string.format("Keyword size = %d", val))
local nVal = tonumber(val)
if nVal <= 5 and nVal >= 1 then
switch.size = nVal
end
end
if switch.transportmission and key:lower() == "defense" then
-- Set defense.
veafTransportMission.logDebug(string.format("Keyword defense = %d", val))
local nVal = tonumber(val)
if nVal <= 5 and nVal >= 0 then
switch.defense = nVal
end
end
if switch.transportmission and key:lower() == "blocade" then
-- Set armor.
veafTransportMission.logDebug(string.format("Keyword blocade = %d", val))
local nVal = tonumber(val)
if nVal <= 5 and nVal >= 0 then
switch.blocade = nVal
end
end
if switch.transportmission and key:lower() == "from" then
-- Set armor.
veafTransportMission.logDebug(string.format("Keyword from = %s", val))
switch.from = val
end
end
return switch
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- CAS target group generation and management
-------------------------------------------------------------------------------------------------------------------------------------------------------------
function veafTransportMission.doRadioTransmission(groupName)
veafTransportMission.logTrace("doRadioTransmission("..groupName..")")
local group = Group.getByName(groupName)
if group then
veafTransportMission.logTrace("Group is transmitting")
local averageGroupPosition = veaf.getAveragePosition(groupName)
veafTransportMission.logTrace("averageGroupPosition=" .. veaf.vecToString(averageGroupPosition))
trigger.action.radioTransmission(veafTransportMission.AdfRadioSound, averageGroupPosition, 0, false, veafTransportMission.AdfFrequency, veafTransportMission.AdfPower)
end
veafTransportMission.friendlyGroupAdfLoopTaskID = mist.scheduleFunction(veafTransportMission.doRadioTransmission, { groupName }, timer.getTime() + veafTransportMission.SecondsBetweenAdfLoops)
end
function veafTransportMission.generateFriendlyGroup(groupPosition)
veafSpawn.doSpawnGroup(groupPosition, "US infgroup", "USA", 0, 0, 0, 10, veafTransportMission.BlueGroupName, true)
if veafTransportMission.DoRadioTransmission then
veafTransportMission.doRadioTransmission(veafTransportMission.BlueGroupName)
end
end
--- Generates an enemy defense group on the way to the drop zone
--- defenseLevel = 1 : 3-7 soldiers, GAZ-3308 transport
--- defenseLevel = 2 : 3-7 soldiers, BTR-80 APC
--- defenseLevel = 3 : 3-7 soldiers, chance of BMP-1 IFV, chance of Igla manpad
--- defenseLevel = 4 : 3-7 soldiers, big chance of BMP-1 IFV, big chance of Igla-S manpad, chance of ZU-23 on a truck
--- defenseLevel = 5 : 3-7 soldiers, BMP-1 IFV, big chance of Igla-S manpad, chance of ZSU-23-4 Shilka
function veafTransportMission.generateEnemyDefenseGroup(groupPosition, groupName, defenseLevel)
local groupDefinition = {
disposition = { h = 6, w = 6},
units = {},
description = groupName,
groupName = groupName,
}
-- generate an infantry group
local groupCount = math.random(3, 7)
for _ = 1, groupCount do
local rand = math.random(3)
local unitType = nil
if rand == 1 then
unitType = 'Soldier RPG'
elseif rand == 2 then
unitType = 'Soldier AK'
else
unitType = 'Infantry AK'
end
table.insert(groupDefinition.units, { unitType })
end
-- add a transport vehicle or an APC/IFV
if defenseLevel > 4 or (defenseLevel > 3 and math.random(100) > 33) or (defenseLevel > 2 and math.random(100) > 66) then
table.insert(groupDefinition.units, { "BMP-1", cell=11, random })
elseif defenseLevel > 1 then
table.insert(groupDefinition.units, { "BTR-80", cell=11, random })
else
table.insert(groupDefinition.units, { "GAZ-3308", cell=11, random })
end
-- add manpads if needed
if defenseLevel > 3 and math.random(100) > 33 then
-- for defenseLevel = 4-5, spawn a modern Igla-S team
table.insert(groupDefinition.units, { "SA-18 Igla-S comm", random })
table.insert(groupDefinition.units, { "SA-18 Igla-S manpad", random })
elseif defenseLevel > 2 and math.random(100) > 66 then
-- for defenseLevel = 3, spawn an older Igla team
table.insert(groupDefinition.units, { "SA-18 Igla comm", random })
table.insert(groupDefinition.units, { "SA-18 Igla manpad", random })
else
-- for defenseLevel = 0, don't spawn any manpad
end
-- add an air defenseLevel vehicle
if defenseLevel > 4 and math.random(100) > 66 then
-- defenseLevel = 3-5 : add a Shilka
table.insert(groupDefinition.units, { "ZSU-23-4 Shilka", cell = 3, random })
elseif defenseLevel > 3 and math.random(100) > 66 then
-- defenseLevel = 1 : add a ZU23 on a truck
table.insert(groupDefinition.units, { "Ural-375 ZU-23", cell = 3, random })
end
groupDefinition = veafUnits.processGroup(groupDefinition)
veafSpawn.doSpawnGroup(groupPosition, groupDefinition, "RUSSIA", 0, 0, math.random(359), math.random(3,6), groupName, true)
end
--- Generates a transport mission
function veafTransportMission.generateTransportMission(targetSpot, size, defense, blocade, from)
veafTransportMission.logDebug(string.format("generateTransportMission(size = %s, defense=%s, blocade=%d, from=%s)",size, defense, blocade, from))
veafTransportMission.logDebug("generateTransportMission: targetSpot " .. veaf.vecToString(targetSpot))
if veafTransportMission.friendlyGroupAliveCheckTaskID ~= 'none' then
trigger.action.outText("A transport mission already exists !", 5)
return
end
local startPoint = veafNamedPoints.getPoint(from)
if not(startPoint) then
trigger.action.outText("A point named "..from.." cannot be found !", 5)
return
end
local friendlyUnits = {}
local routeDistance = 0
-- generate a friendly group around the target target spot
local groupPosition = veaf.findPointInZone(targetSpot, 100, false)
if groupPosition ~= nil then
veafTransportMission.logTrace("groupPosition=" .. veaf.vecToString(groupPosition))
groupPosition = { x = groupPosition.x, z = groupPosition.y, y = 0 }
groupPosition = veaf.placePointOnLand(groupPosition)
veafTransportMission.logTrace("groupPosition on land=" .. veaf.vecToString(groupPosition))
-- compute player route to friendly group
local vecAB = {x = groupPosition.x +- startPoint.x, y = 0, z = groupPosition.z - startPoint.z}
routeDistance = mist.vec.mag(vecAB)
veafTransportMission.logTrace("routeDistance="..routeDistance)
if routeDistance < veafTransportMission.MinimumRouteDistance then
trigger.action.outText("This drop zone is too close ; you have to place it at least " .. veafTransportMission.MinimumRouteDistance / 1000 .. " km away from point "..from.." !", 5)
return
end
veafTransportMission.generateFriendlyGroup(groupPosition)
else
veafTransportMission.logInfo("cannot find a suitable position for group "..groupId)
return
end
-- generate cargo to be picked up near the player helo
veafTransportMission.logDebug("Generating cargo")
local startPosition = veaf.placePointOnLand(startPoint)
veafTransportMission.logTrace("startPosition=" .. veaf.vecToString(startPosition))
for i = 1, size do
local spawnSpot = { x = startPosition.x + 50, z = startPosition.z + i * 10, y = startPosition.y }
veafTransportMission.logTrace("spawnSpot=" .. veaf.vecToString(spawnSpot))
local cargoType = veafTransportMission.CargoTypes[math.random(#veafTransportMission.CargoTypes)]
local cargoName = veafTransportMission.BlueCargoName .. " #" .. i
veafSpawn.doSpawnCargo(spawnSpot, cargoType, cargoName, false, true)
end
veafTransportMission.logDebug("Done generating cargo")
-- generate enemy air defense on the way
if defense > 0 then
veafTransportMission.logDebug("Generating air defense")
-- place groups on the way
local startingDistance = veafTransportMission.SafeZoneDistance -- enemy presence start after the safe zone
local defendedDistance = routeDistance - veafTransportMission.DropZoneSafeZoneDistance - startingDistance
local distanceStep = veafTransportMission.EnemyDefenseDistanceStep
local nbSteps = math.floor(defendedDistance / distanceStep)
local groupNum = 1
for stepNum = 1, nbSteps do
local distanceFromStartingPoint = startingDistance + stepNum * distanceStep + math.random(distanceStep/5, 4*distanceStep/5)
veafTransportMission.logTrace("distanceFromStartingPoint="..distanceFromStartingPoint)
-- place an enemy defense group along the way
local offset = math.random(veafTransportMission.LeftOrRightMinOffset, veafTransportMission.LeftOrRightMaxOffset)
if math.random(100) < 51 then
offset = -offset
end
veafTransportMission.logTrace("offset="..offset)
local spawnPoint = veaf.computeCoordinatesOffsetFromRoute(startPoint, groupPosition, distanceFromStartingPoint, offset)
local groupName = veafTransportMission.RedDefenseGroupName .. " #" .. groupNum
veafTransportMission.generateEnemyDefenseGroup(spawnPoint, groupName, defense)
groupNum = groupNum + 1
-- place a random number of defense groups further away
local nbFarGroups = math.random(0,1)
if defense > 4 then
nbFarGroups = math.random(1,3)
end
for _ = 1, nbFarGroups do
local offset = math.random(veafTransportMission.LeftOrRightMinFarOffset, veafTransportMission.LeftOrRightMaxFarOffset)
if math.random(100) < 51 then
offset = -offset
end
veafTransportMission.logTrace("offset="..offset)
local spawnPoint = veaf.computeCoordinatesOffsetFromRoute(startPoint, groupPosition, distanceFromStartingPoint, offset)
local groupName = veafTransportMission.RedDefenseGroupName .. " #" .. groupNum
veafTransportMission.generateEnemyDefenseGroup(spawnPoint, groupName, defense)
groupNum = groupNum + 1
end
end
veafTransportMission.logDebug("Done generating air defense")
end
-- generate enemy blocade forces
if blocade > 0 then
veafTransportMission.logDebug("Generating blocade")
veafTransportMission.logDebug("Done generating blocade")
end
-- add radio menu for drop zone information (by player group)
veafRadio.addCommandToSubmenu('Drop zone information', veafTransportMission.rootPath, veafTransportMission.reportTargetInformation, nil, true)
-- add radio menus for commands
veafRadio.addCommandToSubmenu('Skip current objective', veafTransportMission.rootPath, veafTransportMission.skip)
veafTransportMission.targetMarkersPath = veafRadio.addSubMenu("Drop zone markers", veafTransportMission.rootPath)
veafRadio.addCommandToSubmenu('Request smoke on drop zone', veafTransportMission.targetMarkersPath, veafTransportMission.smokeTarget)
veafRadio.addCommandToSubmenu('Request illumination flare over drop zone', veafTransportMission.targetMarkersPath, veafTransportMission.flareTarget)
local message = "See F10 radio menu for details\n" -- TODO
trigger.action.outText(message,5)
veafRadio.refreshRadioMenu()
-- start checking for targets destruction
veafTransportMission.friendlyGroupWatchdog()
end
--- Checks if the friendly group is still alive, and if not announces the failure of the transport mission
function veafTransportMission.friendlyGroupWatchdog()
local nbVehicles, nbInfantry = veafUnits.countInfantryAndVehicles(veafTransportMission.BlueGroupName)
if nbVehicles + nbInfantry > 0 then
--veafTransportMission.logTrace("Group is still alive with "..nbVehicles.." vehicles and "..nbInfantry.." soldiers")
veafTransportMission.friendlyGroupAliveCheckTaskID = mist.scheduleFunction(veafTransportMission.friendlyGroupWatchdog,{},timer.getTime()+veafTransportMission.SecondsBetweenWatchdogChecks)
else
trigger.action.outText("Friendly group has been destroyed! The mission is a failure!", 5)
veafTransportMission.cleanupAfterMission()
end
end
function veafTransportMission.reportTargetInformation(groupId)
-- generate information dispatch
local nbVehicles, nbInfantry = veafUnits.countInfantryAndVehicles(veafTransportMission.BlueGroupName)
local message = "DROP ZONE : ressuply a group of " .. nbVehicles .. " vehicles and " .. nbInfantry .. " soldiers.\n"
message = message .. "\n"
if veafTransportMission.DoRadioTransmission then
message = message .. "NAVIGATION: They will transmit on 550 kHz every " .. veafTransportMission.SecondsBetweenAdfLoops .. " seconds.\n"
end
-- add coordinates and position from bullseye
local averageGroupPosition = veaf.getAveragePosition(veafTransportMission.BlueGroupName)
local lat, lon = coord.LOtoLL(averageGroupPosition)
local mgrsString = mist.tostringMGRS(coord.LLtoMGRS(lat, lon), 3)
local bullseye = mist.utils.makeVec3(mist.DBs.missionData.bullseye.blue, 0)
local vec = {x = averageGroupPosition.x - bullseye.x, y = averageGroupPosition.y - bullseye.y, z = averageGroupPosition.z - bullseye.z}
local dir = mist.utils.round(mist.utils.toDegree(mist.utils.getDir(vec, bullseye)), 0)
local dist = mist.utils.get2DDist(averageGroupPosition, bullseye)
local distMetric = mist.utils.round(dist/1000, 0)
local distImperial = mist.utils.round(mist.utils.metersToNM(dist), 0)
local fromBullseye = string.format('%03d', dir) .. ' for ' .. distMetric .. 'km /' .. distImperial .. 'nm'
message = message .. "LAT LON (decimal): " .. mist.tostringLL(lat, lon, 2) .. ".\n"
message = message .. "LAT LON (DMS) : " .. mist.tostringLL(lat, lon, 0, true) .. ".\n"
message = message .. "MGRS/UTM : " .. mgrsString .. ".\n"
message = message .. "FROM BULLSEYE : " .. fromBullseye .. ".\n"
message = message .. "\n"
-- get altitude, qfe and wind information
local altitude = veaf.getLandHeight(averageGroupPosition)
--local qfeHp = mist.utils.getQFE(averageGroupPosition, false)
--local qfeinHg = mist.utils.getQFE(averageGroupPosition, true)
local windDirection, windStrength = veaf.getWind(veaf.placePointOnLand(averageGroupPosition))
message = message .. 'DROP ZONE ALT : ' .. altitude .. " meters.\n"
--message = message .. 'TARGET QFW : ' .. qfeHp .. " hPa / " .. qfeinHg .. " inHg.\n"
local windText = 'no wind.\n'
if windStrength > 0 then
windText = string.format(
'from %s at %s m/s.\n', windDirection, windStrength)
end
message = message .. 'WIND OVER DROP ZONE : ' .. windText
-- send message only for the group
trigger.action.outTextForGroup(groupId, message, 30)
end
--- add a smoke marker over the drop zone
function veafTransportMission.smokeTarget()
veafTransportMission.logDebug("smokeTarget()")
veafSpawn.spawnSmoke(veaf.getAveragePosition(veafTransportMission.BlueGroupName), trigger.smokeColor.Green)
trigger.action.outText('Copy smoke requested, GREEN smoke marks the drop zone!',5)
veafRadio.delCommand(veafTransportMission.targetMarkersPath, 'Request smoke on drop zone')
veafRadio.addCommandToSubmenu('Drop zone is marked with GREEN smoke', veafTransportMission.targetMarkersPath, veaf.emptyFunction)
veafTransportMission.smokeResetTaskID = mist.scheduleFunction(veafTransportMission.smokeReset,{},timer.getTime()+veafTransportMission.SecondsBetweenSmokeRequests)
veafRadio.refreshRadioMenu()
end
--- Reset the smoke request radio menu
function veafTransportMission.smokeReset()
veafTransportMission.logDebug("smokeReset()")
veafRadio.delCommand(veafTransportMission.targetMarkersPath, 'Drop zone is marked with GREEN smoke')
veafRadio.addCommandToSubmenu('Request smoke on drop zone', veafTransportMission.targetMarkersPath, veafTransportMission.smokeTarget)
trigger.action.outText('Smoke marker over drop zone available',5)
veafRadio.refreshRadioMenu()
end
--- add an illumination flare over the target area
function veafTransportMission.flareTarget()
veafTransportMission.logDebug("flareTarget()")
veafSpawn.spawnIlluminationFlare(veaf.getAveragePosition(veafTransportMission.BlueGroupName))
trigger.action.outText('Copy illumination flare requested, illumination flare over target area!',5)
veafRadio.delCommand(veafTransportMission.targetMarkersPath, 'Request illumination flare over drop zone')
veafRadio.addCommandToSubmenu('Drop zone is lit with illumination flare', veafTransportMission.targetMarkersPath, veaf.emptyFunction)
veafTransportMission.flareResetTaskID = mist.scheduleFunction(veafTransportMission.flareReset,{},timer.getTime()+veafTransportMission.SecondsBetweenFlareRequests)
veafRadio.refreshRadioMenu()
end
--- Reset the flare request radio menu
function veafTransportMission.flareReset()
veafTransportMission.logDebug("flareReset()")
veafRadio.delCommand(veafTransportMission.targetMarkersPath, 'Drop zone is lit with illumination flare')
veafRadio.addCommandToSubmenu('Request illumination flare over drop zone', veafTransportMission.targetMarkersPath, veafTransportMission.flareTarget)
trigger.action.outText('Illumination flare over drop zone available',5)
veafRadio.refreshRadioMenu()
end
--- Called from the "Skip delivery" radio menu : remove the current transport mission
function veafTransportMission.skip()
veafTransportMission.cleanupAfterMission()
trigger.action.outText("Transport mission cleaned up.", 5)
end
--- Cleanup after either mission is ended or aborted
function veafTransportMission.cleanupAfterMission()
veafTransportMission.logTrace("cleanupAfterMission()")
-- destroy groups
veafTransportMission.logTrace("destroy friendly group")
local group = Group.getByName(veafTransportMission.BlueGroupName)
if group and group:isExist() == true then
group:destroy()
end
veafTransportMission.logTrace("destroy cargos")
local unitNum = 1
local doIt = true
while doIt do
local cargo = StaticObject.getByName(veafTransportMission.BlueCargoName.." #"..unitNum)
if cargo and cargo:isExist() == true then
cargo:destroy()
unitNum = unitNum + 1
else
doIt = false
end
end
veafTransportMission.logTrace("destroy enemy defense group")
local groupNum = 1
local doIt = true
while doIt do
group = Group.getByName(veafTransportMission.RedDefenseGroupName.." #"..groupNum)
if group and group:isExist() == true then
group:destroy()
groupNum = groupNum + 1
else
doIt = false
end
end
veafTransportMission.logTrace("destroy enemy blocade group")
group = Group.getByName(veafTransportMission.RedBlocadeGroupName)
if group and group:isExist() == true then
group:destroy()
end
-- remove the watchdog function
veafTransportMission.logTrace("remove the watchdog function")
if veafTransportMission.friendlyGroupAliveCheckTaskID ~= 'none' then
mist.removeFunction(veafTransportMission.friendlyGroupAliveCheckTaskID)
end
veafTransportMission.friendlyGroupAliveCheckTaskID = 'none'
-- remove the watchdog function
veafTransportMission.logTrace("remove the adf loop function")
if veafTransportMission.friendlyGroupAdfLoopTaskID ~= 'none' then
mist.removeFunction(veafTransportMission.friendlyGroupAdfLoopTaskID)
end
veafTransportMission.friendlyGroupAdfLoopTaskID = 'none'
veafRadio.delCommand(veafTransportMission.rootPath, 'Skip current objective')
veafRadio.delCommand(veafTransportMission.rootPath, 'Get current objective situation')
veafRadio.delCommand(veafTransportMission.rootPath, 'Drop zone markers')
veafRadio.delSubmenu(veafTransportMission.targetMarkersPath, veafTransportMission.rootPath)
veafRadio.refreshRadioMenu()
veafTransportMission.logTrace("cleanupAfterMission DONE")
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Radio menu and help
-------------------------------------------------------------------------------------------------------------------------------------------------------------
--- Build the initial radio menu
function veafTransportMission.buildRadioMenu()
veafTransportMission.rootPath = veafRadio.addSubMenu(veafTransportMission.RadioMenuName)
veafRadio.addCommandToSubmenu("HELP", veafTransportMission.rootPath, veafTransportMission.help, nil, true)
-- TODO add this command when the respawn will work (see veafTransportMission.resetAllCargoes)
-- missionCommands.addCommand('Respawn all cargoes', veafTransportMission.rootPath, veafTransportMission.resetAllCargoes)
end
function veafTransportMission.help(groupId)
local text =
'Create a marker and type "veaf transport mission" in the text\n' ..
'This will create a default friendly group awaiting cargo that you need to transport\n' ..
'You can add options (comma separated) :\n' ..
' "defense [0-5]" to specify air defense cover on the way (1 = light, 5 = heavy)\n' ..
' defense = 1 : 3-7 soldiers, GAZ-3308 transport\n' ..
' defense = 2 : 3-7 soldiers, BTR-80 APC\n' ..
' defense = 3 : 3-7 soldiers, chance of BMP-1 IFV, chance of Igla manpad\n' ..
' defense = 4 : 3-7 soldiers, big chance of BMP-1 IFV, big chance of Igla-S manpad, chance of ZU-23 on a truck\n' ..
' defense = 5 : 3-7 soldiers, BMP-1 IFV, big chance of Igla-S manpad, chance of ZSU-23-4 Shilka\n' ..
' "size [1-5]" to change the number of cargo items to be transported (1 per participating helo, usually)\n' ..
' "sblocade [0-5]" to specify enemy blocade around the drop zone (1 = light, 5 = heavy)'
trigger.action.outTextForGroup(groupId, text, 30)
end
function veafTransportMission.endTransportOfCargo(cargoName)
local text =
'Congratulations on a job well done ! Cargo ' .. cargoName .. ' has been delivered safely'
trigger.action.outText(text, 15)
-- TODO reset cargo position
-- mist.respawnGroup(cargoName, 15)
-- does not work yet because 1. the unit name is changed by mist and 2. the trigger zone condition does not work with the new unit (maybe bc of 1. ?)
end
function veafTransportMission.resetAllCargoes()
-- does not work yet (see veafTransportMission.endTransportOfCargo)
local lunits = mist.DBs.unitsByNum
if lunits then
for i = 1, #lunits do
if lunits[i] and lunits[i].unitName and lunits[i].unitName:lower():find('cargo - ') then
local name = lunits[i].unitName
-- destroy cargo static unit
local c = StaticObject.getByName(name)
if c then
StaticObject.destroy(c)
end
mist.respawnGroup(name, true)
end
end
end
trigger.action.outText("All cargoes have been respawned", 15)
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- initialisation
-------------------------------------------------------------------------------------------------------------------------------------------------------------
function veafTransportMission.initialize()
veafTransportMission.buildRadioMenu()
veafMarkers.registerEventHandler(veafMarkers.MarkerChange, veafTransportMission.onEventMarkChange)
end
veafTransportMission.logInfo(string.format("Loading version %s", veafTransportMission.Version))
--- Enable/Disable error boxes displayed on screen.
env.setErrorMessageBoxEnabled(false)
|
-----------------------------------
--
-- tpz.effect.MND_DOWN
--
-----------------------------------
require("scripts/globals/status")
-----------------------------------
function onEffectGain(target,effect)
if ((target:getStat(tpz.mod.MND) - effect:getPower()) < 0) then
effect:setPower(target:getStat(tpz.mod.MND))
end
target:addMod(tpz.mod.MND,-effect:getPower())
end
function onEffectTick(target,effect)
-- the effect restore mind of 1 every 3 ticks.
local downMND_effect_size = effect:getPower()
if (downMND_effect_size > 0) then
effect:setPower(downMND_effect_size - 1)
target:delMod(tpz.mod.MND,-1)
end
end
function onEffectLose(target,effect)
local downMND_effect_size = effect:getPower()
if (downMND_effect_size > 0) then
target:delMod(tpz.mod.MND,-downMND_effect_size)
end
end
|
require("lib.lclass")
require("lib.ecs.Component")
class "OrbitComponent" ("Component")
function OrbitComponent:OrbitComponent()
self.typeName = "OrbitComponent"
self.origin = {
x = 0,
y = 0
}
self.angle = 0
self.radius = 0
self.speed = 0
end
|
---------------------- FAST BELT PICTURES
fast_belt_horizontal =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32
}
fast_belt_vertical =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 40
}
fast_belt_ending_top =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 80
}
fast_belt_ending_bottom =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 120
}
fast_belt_ending_side =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 160
}
fast_belt_starting_top =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 200
}
fast_belt_starting_bottom =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 240
}
fast_belt_starting_side =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
y = 280
}
data:extend(
{
--Faster Belt--
{
type = "item",
name = "fast-transport-belt",
icon = "__Engineersvsenvironmentalist__/graphics/icons/transport-belts/fast-transport-belt.png",
flags = {"goes-to-quickbar"},
subgroup = "belts",
order = "a[transport-belt]-b[fast-transport-belt]",
place_result = "fast-transport-belt",
stack_size = 200,
},
{
type = "recipe",
name = "fast-transport-belt",
enabled = false,
ingredients =
{
{"steam-unit", 1},
{"iron-gear-wheel", 10},
{"wall", 10},
{"explosives-analogue", 100},
},
results = {{"fast-transport-belt",10}}
},
{
type = "transport-belt",
name = "fast-transport-belt",
icon = "__Engineersvsenvironmentalist__/graphics/icons/transport-belts/fast-transport-belt.png",
flags = {"placeable-neutral", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.3, result = "fast-transport-belt"},
max_health = 50,
corpse = "small-remnants",
resistances =
{
{
type = "fire",
percent = 50
}
},
collision_box = {{-0.4, -0.4}, {0.4, 0.4}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
working_sound =
{
sound =
{
filename = "__base__/sound/transport-belt.ogg",
volume = 0.4
},
max_sounds_per_type = 3
},
animation_speed_coefficient = 32,
animations =
{
filename = "__base__/graphics/entity/fast-transport-belt/fast-transport-belt.png",
priority = "extra-high",
width = 40,
height = 40,
frame_count = 32,
direction_count = 12
},
belt_horizontal = fast_belt_horizontal, -- specified in transport-belt-pictures.lua
belt_vertical = fast_belt_vertical,
ending_top = fast_belt_ending_top,
ending_bottom = fast_belt_ending_bottom,
ending_side = fast_belt_ending_side,
starting_top = fast_belt_starting_top,
starting_bottom = fast_belt_starting_bottom,
starting_side = fast_belt_starting_side,
ending_patch = ending_patch_prototype,
fast_replaceable_group = "transport-belt",
speed = 0.0225,
connector_frame_sprites = transport_belt_connector_frame_sprites,
circuit_connector_sprites = transport_belt_circuit_connector_sprites,
circuit_wire_connection_point = transport_belt_circuit_wire_connection_point,
circuit_wire_max_distance = transport_belt_circuit_wire_max_distance
},
--Underground Belt--
{
type = "item",
name = "fast-transport-belt-to-ground",
icon = "__Engineersvsenvironmentalist__/graphics/icons/transport-belts/fast-underground-belt.png",
flags = {"goes-to-quickbar"},
subgroup = "belts",
order = "b[transport-belt-to-ground]-b[fast-transport-belt-to-ground]",
place_result = "fast-transport-belt-to-ground",
stack_size = 50
},
{
type = "recipe",
name = "fast-transport-belt-to-ground",
enabled = false,
ingredients =
{
{"fast-transport-belt", 100},
{"wall", 100},
{"explosives-analogue", 1000},
},
result_count = 20,
result = "fast-transport-belt-to-ground"
},
{
type = "underground-belt",
name = "fast-transport-belt-to-ground",
icon = "__Engineersvsenvironmentalist__/graphics/icons/transport-belts/fast-underground-belt.png",
flags = {"placeable-neutral", "player-creation", "fast-replaceable-no-build-while-moving"},
minable = {hardness = 0.2, mining_time = 0.5, result = "fast-transport-belt-to-ground"},
max_health = 60,
corpse = "small-remnants",
max_distance = 13,
underground_sprite =
{
filename = "__core__/graphics/arrows/underground-lines.png",
priority = "high",
width = 32,
height = 32,
x = 32
},
resistances =
{
{
type = "fire",
percent = 60
}
},
collision_box = {{-0.4, -0.4}, {0.4, 0.4}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
animation_speed_coefficient = 32,
belt_horizontal = fast_belt_horizontal, -- specified in transport-belt-pictures.lua
belt_vertical = fast_belt_vertical,
ending_top = fast_belt_ending_top,
ending_bottom = fast_belt_ending_bottom,
ending_side = fast_belt_ending_side,
starting_top = fast_belt_starting_top,
starting_bottom = fast_belt_starting_bottom,
starting_side = fast_belt_starting_side,
fast_replaceable_group = "underground-belt",
speed = 0.0425,
structure =
{
direction_in =
{
sheet =
{
filename = "__base__/graphics/entity/fast-underground-belt/fast-underground-belt-structure.png",
priority = "extra-high",
shift = {0.26, 0},
width = 57,
height = 43,
y = 43
}
},
direction_out =
{
sheet =
{
filename = "__base__/graphics/entity/fast-underground-belt/fast-underground-belt-structure.png",
priority = "extra-high",
shift = {0.26, 0},
width = 57,
height = 43
}
}
},
ending_patch = ending_patch_prototype
},
--Splitter--
{
type = "item",
name = "fast-splitter",
icon = "__Engineersvsenvironmentalist__/graphics/icons/transport-belts/fast-splitter.png",
flags = {"goes-to-quickbar"},
subgroup = "belts",
order = "c[splitter]-b[fast-splitter]",
place_result = "fast-splitter",
stack_size = 50
},
{
type = "recipe",
name = "fast-splitter",
enabled = false,
energy_required = 2,
ingredients =
{
{"fast-transport-belt",2},
{"engine-unit", 1},
{"electronic-circuit", 3}
},
result = "fast-splitter"
},
{
type = "splitter",
name = "fast-splitter",
icon = "__Engineersvsenvironmentalist__/graphics/icons/transport-belts/fast-splitter.png",
flags = {"placeable-neutral", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "fast-splitter"},
max_health = 80,
corpse = "medium-remnants",
resistances =
{
{
type = "fire",
percent = 60
}
},
collision_box = {{-0.9, -0.1}, {0.9, 0.1}},
selection_box = {{-0.9, -0.5}, {0.9, 0.5}},
animation_speed_coefficient = 32,
structure_animation_speed_coefficient = 1.2,
structure_animation_movement_cooldown = 10,
belt_horizontal = fast_belt_horizontal, -- specified in transport-belt-pictures.lua
belt_vertical = fast_belt_vertical,
ending_top = fast_belt_ending_top,
ending_bottom = fast_belt_ending_bottom,
ending_side = fast_belt_ending_side,
starting_top = fast_belt_starting_top,
starting_bottom = fast_belt_starting_bottom,
starting_side = fast_belt_starting_side,
fast_replaceable_group = "splitter",
speed = 0.0625,
structure =
{
north =
{
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-north.png",
frame_count = 32,
line_length = 16,
priority = "extra-high",
width = 80,
height = 35,
shift = {0.225, 0}
},
east =
{
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-east.png",
frame_count = 32,
line_length = 16,
priority = "extra-high",
width = 46,
height = 81,
shift = {0.075, 0}
},
south =
{
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-south.png",
frame_count = 32,
line_length = 16,
priority = "extra-high",
width = 82,
height = 36,
shift = {0.075, 0}
},
west =
{
filename = "__base__/graphics/entity/fast-splitter/fast-splitter-west.png",
frame_count = 32,
line_length = 16,
priority = "extra-high",
width = 47,
height = 79,
shift = {0.25, 0.05}
},
},
ending_patch = ending_patch_prototype
},
}
)
|
function onStartCountdown()
setProperty('health', 2)
end
function onUpdate(elapsed)
songPos = getSongPosition()
local currentBeat2 = (songPos/1000)*(curBpm/60)
local currentBeat = (songPos/5000)*(curBpm/60)
setCharacterX('dad',getCharacterX('dad') + (math.sin(currentBeat2) * 1.4))
setCharacterY('dad',getCharacterY('dad') + (math.cos(currentBeat2) * 1.4))
function onMoveCamera(focus)
if focus == 'boyfriend' then
-- called when the camera focus on boyfriend
elseif focus == 'dad' then
setProperty('camFollowPos.y',getProperty('camFollowPos.y') + (math.sin(currentBeat) * 0.6))
end
end
setProperty('camHUD.angle',0 - 5 * math.cos((currentBeat2*0.25)*math.pi) )
setProperty('camHUD.y',0 - 15 * math.cos((currentBeat2*0.25)*math.pi) )
setProperty('camHUD.x',0 - 10 * math.sin((currentBeat2*0.25)*math.pi) )
noteTweenX(defaultPlayerStrumX0, 4, ((screenWidth / 2) + (157 / 2)) - (math.sin((currentBeat2) - 0) * 300), 0.001)
noteTweenX(defaultPlayerStrumX1, 5, ((screenWidth / 2) +(157 / 2))- (math.sin((currentBeat2) - 1) * 300), 0.001)
noteTweenX(defaultPlayerStrumX2, 6, ((screenWidth / 2) + (157 / 2))- (math.sin((currentBeat2) - 2) * 300), 0.001)
noteTweenX(defaultPlayerStrumX3, 7, ((screenWidth / 2) + (157 / 2)) - (math.sin((currentBeat2) - 3) * 300), 0.001)
noteTweenY('defaultPlayerStrumY0', 4, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 0) * 157), 0.001)
noteTweenY('defaultPlayerStrumY1', 5, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 1) * 157), 0.001)
noteTweenY('defaultPlayerStrumY2', 6, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 2) * 157), 0.001)
noteTweenY('defaultPlayerStrumY3', 7, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 3) * 157), 0.001)
noteTweenX('fake1', 0, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (4) * 2) * 300), 0.001)
noteTweenX('fake2', 1, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (5) * 2) * 300), 0.001)
noteTweenX('fake3', 2, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (6) * 2) * 300), 0.001)
noteTweenX('fake4', 3, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (7) * 2) * 300), 0.001)
noteTweenY('defaultFPlayerStrumY0', 0, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (4) * 2) * 157), 0.001)
noteTweenY('defaultFPlayerStrumY1', 1, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (5) * 2) * 157), 0.001)
noteTweenY('defaultFPlayerStrumY2', 2, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (6) * 2) * 157), 0.001)
noteTweenY('defaultFPlayerStrumY3', 3, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (7) * 2) * 157), 0.001)
if curBeat == 1264 then
noteTweenX(defaultPlayerStrumX0, 4, ((screenWidth / 2) + (157 / 2)) - (math.sin((currentBeat2) - 0) * 300), 0.001)
noteTweenX(defaultPlayerStrumX1, 5, ((screenWidth / 2) +(157 / 2))- (math.sin((currentBeat2) - 1) * 300), 0.001)
noteTweenX(defaultPlayerStrumX2, 6, ((screenWidth / 2) + (157 / 2))- (math.sin((currentBeat2) - 2) * 300), 0.001)
noteTweenX(defaultPlayerStrumX3, 7, ((screenWidth / 2) + (157 / 2)) - (math.sin((currentBeat2) - 3) * 300), 0.001)
noteTweenY('defaultPlayerStrumY0', 4, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 0) * 157), 0.001)
noteTweenY('defaultPlayerStrumY1', 5, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 1) * 157), 0.001)
noteTweenY('defaultPlayerStrumY2', 6, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 2) * 157), 0.001)
noteTweenY('defaultPlayerStrumY3', 7, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + 3) * 157), 0.001)
noteTweenX('fake1', 0, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (4) * 2) * 300), 0.001)
noteTweenX('fake2', 1, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (5) * 2) * 300), 0.001)
noteTweenX('fake3', 2, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (6) * 2) * 300), 0.001)
noteTweenX('fake4', 3, ((screenWidth / 2) - (157 / 2)) + (math.sin((currentBeat2) + (7) * 2) * 300), 0.001)
noteTweenY('defaultFPlayerStrumY0', 0, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (4) * 2) * 157), 0.001)
noteTweenY('defaultFPlayerStrumY1', 1, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (5) * 2) * 157), 0.001)
noteTweenY('defaultFPlayerStrumY2', 2, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (6) * 2) * 157), 0.001)
noteTweenY('defaultFPlayerStrumY3', 3, ((screenHeight / 2) - (300 / 2)) + (math.cos((currentBeat) + (7) * 2) * 157), 0.001)
end
end
function opponentNoteHit(id, direction, noteType, isSustainNote)
cameraShake(game, 0.015, 0.2)
cameraSetTarget('dad')
characterPlayAnim('gf', 'scared', true)
doTweenZoom('camerazoom','camGame',1.05,0.15,'quadInOut')
setProperty('health', getProperty('health') - 1 * ((getProperty('health')/22))/6)
end
function goodNoteHit(id, direction, noteType, isSustainNote)
cameraSetTarget('boyfriend')
end
function noteMiss(direction)
setProperty('health', getProperty('health') + 0.023)
end
function noteMissPress(direction)
setProperty('health', getProperty('health') + 0.023)
end
|
return {
id = "WorldG125",
events = {
{
alpha = 0.3,
style = {
text = "G.M系统已开启,周边区域中的各类事件将以不同标记的形式显示在系统的可视化面板上。",
mode = 2,
posY = 211.02,
char = "1",
dir = 1,
posX = 328.22,
ui = {
path = "OverlayCamera/Overlay/UIMain/top/adapt/right_stage/compass_panel"
}
}
},
{
style = {
text = "此处显示有海域中累积战斗次数,可以为某些舰船技能是否生效提供参考。",
mode = 2,
posY = 211.02,
char = "1",
dir = -1,
posX = 328.22
},
showSign = {
type = 2,
signList = {
{
signType = 4
}
},
clickUI = {
path = "OverlayCamera/Overlay/UIMain/top/adapt/right_stage/compass_panel/btn_defeat",
sizeDeltaPlus = {
40,
20
}
}
}
},
{
alpha = 0.3,
ui = {
path = "OverlayCamera/Overlay/UIMain/top/adapt/right_stage/compass_panel/btn_order",
triggerType = {
1
},
fingerPos = {
posX = 56.19,
posY = -43.7,
rotateX = 0,
rotateZ = 0,
rotateY = 0
}
}
},
{
delay = 1.5,
code = {
"playStory"
},
stories = {
"GWORLD103C"
}
},
{
alpha = 0.3,
ui = {
path = "OverlayCamera/Overlay/UIMain/SVOrderPanel(Clone)/adapt/order_list/fov/type_enable",
triggerType = {
1
},
fingerPos = {
posX = 0,
posY = 0,
rotateX = 0,
rotateZ = 0,
rotateY = 0
}
}
},
{
alpha = 0.3,
ui = {
path = "OverlayCamera/Overlay/UIMain/Msgbox/window/button_container/btn_confirm",
triggerType = {
1
},
fingerPos = {
posX = 0,
posY = 0,
rotateX = 0,
rotateZ = 0,
rotateY = 0
}
}
}
}
}
|
local setmetatable = setmetatable
local capture = ngx.location.capture
--- Ngx+lua (resty) template loader
--- @class aspect.loader.resty
local resty_loader = {}
local mt = {
__call = function(self, name)
local res = capture(self.url .. name, {
method = "GET"
})
if res and res.status == 200 then
return res.body
end
return nil
end
}
--- @param url string the URL prefix (for example /.templates/)
function resty_loader.new(url)
return setmetatable({
url = url
}, mt)
end
return resty_loader
|
local yui_path = (...):match('(.-)[^%.]+$')
local Object = require(yui_path .. 'UI.classic.classic')
local ImageButton = Object:extend('ImageButton')
function ImageButton:new(yui, settings)
self.yui = yui
self.x, self.y = 0, 0
self.settings = settings
self.ix, self.iy = settings.ix or 0, settings.iy or 0
self.rounded_corners = settings.rounded_corners
self.name = settings.name
self.img = settings.image
self.w, self.h = settings.w or self.img:getWidth(), settings.h or self.img:getHeight()
self.button = self.yui.UI.Button(0, 0, self.w, self.h, {
yui = self.yui,
extensions = {self.yui.Theme.ImageButton},
postDraw = self.yui.Theme.ImageButton.postDraw,
parent = self,
})
self.onClick = settings.onClick
self.overlayNew = settings.overlayNew
self.overlayUpdate = settings.overlayUpdate
self.overlay = settings.overlay or function(self)
love.graphics.setColor(50, 50, 50, self.alpha/3)
if self.rounded_corners then love.graphics.rectangle('fill', self.x, self.y, self.w, self.h, self.h/18, self.h/18)
else love.graphics.rectangle('fill', self.x, self.y, self.w, self.h) end
love.graphics.setColor(255, 255, 255, 255)
end
self.alpha = 0
if self.overlayNew then self:overlayNew() end
end
function ImageButton:update(dt)
self.ix, self.iy = self.settings.ix or 0, self.settings.iy or 0
if self.button.hot and self.button.released then
if self.onClick then
self:onClick()
end
end
self.button.x, self.button.y = self.x, self.y
self.button:update(dt)
self.alpha = self.button.alpha
if self.button.hot then love.mouse.setCursor(self.yui.Theme.hand_cursor) end
if self.overlayUpdate then self:overlayUpdate(dt) end
end
function ImageButton:draw()
self.button:draw()
end
function ImageButton:postDraw()
self.button:postDraw()
end
return ImageButton
|
require("model")
require("structures")
calculation = {
interface = {},
util = {}
}
-- Updates the whole subfactory calculations from top to bottom
function calculation.update(player, subfactory, refresh)
if subfactory ~= nil and subfactory.valid then
local player_table = get_table(player)
-- Save the active subfactory in global so the model doesn't have to pass it around
player_table.active_subfactory = subfactory
local subfactory_data = calculation.interface.get_subfactory_data(player, subfactory)
model.update_subfactory(subfactory_data)
player_table.active_subfactory = nil
end
if refresh then refresh_main_dialog(player) end
end
-- Returns a table containing all the data needed to run the calculations for the given subfactory
function calculation.interface.get_subfactory_data(player, subfactory)
local subfactory_data = {
player_index = player.index,
top_level_products = {},
top_floor = {}
}
for _, product in ipairs(Subfactory.get_in_order(subfactory, "Product")) do
local product_data = {
proto = product.proto, -- reference
required_amount = product.required_amount
}
table.insert(subfactory_data.top_level_products, product_data)
end
local top_floor = Subfactory.get(subfactory, "Floor", 1)
subfactory_data.top_floor = calculation.util.generate_floor_data(player, subfactory, top_floor)
return subfactory_data
end
-- Updates the active subfactories top-level data with the given result
function calculation.interface.set_subfactory_result(result)
local player_table = global.players[result.player_index]
local subfactory = player_table.active_subfactory
subfactory.energy_consumption = result.energy_consumption
subfactory.pollution = result.pollution
-- For products, the existing top-level items just get updated individually
-- When the products are not present in the result, it means they have been produced
for _, product in pairs(Subfactory.get_in_order(subfactory, "Product")) do
local product_result_amount = result.Product[product.proto.type][product.proto.name] or 0
product.amount = product.required_amount - product_result_amount
end
calculation.util.update_items(subfactory, result, "Byproduct")
calculation.util.update_items(subfactory, result, "Ingredient")
-- Determine satisfaction-amounts for all line ingredients
if not player_table.settings.performance_mode then
local top_floor = Subfactory.get(subfactory, "Floor", 1)
local aggregate = structures.aggregate.init() -- gets modified by the two functions
calculation.util.determine_net_ingredients(top_floor, aggregate)
calculation.util.update_ingredient_satisfaction(top_floor, aggregate)
end
end
-- Updates the given line of the given floor of the active subfactory
function calculation.interface.set_line_result(result)
local subfactory = global.players[result.player_index].active_subfactory
local floor = Subfactory.get(subfactory, "Floor", result.floor_id)
local line = Floor.get(floor, "Line", result.line_id)
line.machine.count = result.machine_count
line.energy_consumption = result.energy_consumption
line.pollution = result.pollution
line.production_ratio = result.production_ratio
line.uncapped_production_ratio = result.uncapped_production_ratio
-- Reset the priority_product if there's <2 products
if structures.class.count(result.Product) < 2 then
Line.set_priority_product(line, nil)
end
calculation.util.update_items(line, result, "Product")
calculation.util.update_items(line, result, "Byproduct")
calculation.util.update_items(line, result, "Ingredient")
calculation.util.update_items(line, result, "Fuel")
end
-- **** LOCAL UTIL ****
-- Generates structured data of the given floor for calculation
function calculation.util.generate_floor_data(player, subfactory, floor)
local floor_data = {
id = floor.id,
lines = {}
}
local preferred_fuel = get_preferences(player).preferred_fuel
local mining_productivity = (subfactory.mining_productivity ~= nil) and
(subfactory.mining_productivity / 100) or player.force.mining_drill_productivity_bonus
for _, line in ipairs(Floor.get_in_order(floor, "Line")) do
local line_data = {
id = line.id,
timescale = subfactory.timescale,
percentage = line.percentage,
production_type = line.recipe.production_type,
machine_limit = {limit=line.machine.limit, hard_limit=line.machine.hard_limit},
total_effects = nil, -- reference or copy, depending on case
beacon_consumption = 0,
priority_product_proto = line.priority_product_proto, -- reference
recipe_proto = line.recipe.proto, -- reference
machine_proto = line.machine.proto, -- reference
fuel_proto = nil, -- will be a reference
subfloor = nil -- will be a floor_data object
}
-- Total effects
if line.machine.proto.mining then
-- If there is mining prod, a copy of the table is required
local effects = cutil.shallowcopy(line.total_effects)
effects.productivity = effects.productivity + mining_productivity
line_data.total_effects = effects
else
-- If there's no mining prod, a reference will suffice
line_data.total_effects = line.total_effects
end
-- Beacon total (can be calculated here, which is faster and simpler)
if line.beacon ~= nil and line.beacon.total_amount ~= nil then
line_data.beacon_consumption = line.beacon.proto.energy_usage * line.beacon.total_amount * 60
end
-- Fuel proto
if line_data.subfloor == nil then -- the fuel_proto is only needed when there's no subfloor
if line.Fuel.count == 1 then -- use the already configured Fuel, if available
line_data.fuel_proto = Line.get_by_gui_position(line, "Fuel", 1).proto
else -- otherwise, use the preferred fuel
line_data.fuel_proto = preferred_fuel
end
end
-- Subfloor
if line.subfloor ~= nil then line_data.subfloor =
calculation.util.generate_floor_data(player, subfactory, line.subfloor) end
table.insert(floor_data.lines, line_data)
end
return floor_data
end
-- Updates the items of the given object (of given class) using the given result
-- This procedure is a bit more complicated to to retain the users ordering of items
function calculation.util.update_items(object, result, class_name)
local items = result[class_name]
for _, item in pairs(_G[object.class].get_in_order(object, class_name)) do
local item_result_amount = items[item.proto.type][item.proto.name]
if item_result_amount == nil then
_G[object.class].remove(object, item)
else
item.amount = item_result_amount
-- This item_result_amount has been incorporated, so it can be removed
items[item.proto.type][item.proto.name] = nil
end
end
for _, item_result in pairs(structures.class.to_array(items)) do
if object.class == "Subfactory" then
top_level_item = Item.init_by_item(item_result, class_name, item_result.amount, 0)
_G[object.class].add(object, top_level_item)
else -- object.class == "Line"
item = (class_name == "Fuel") and Fuel.init_by_item(item_result, item_result.amount)
or Item.init_by_item(item_result, class_name, item_result.amount)
_G[object.class].add(object, item)
end
end
end
-- Determines the net ingredients of this floor
function calculation.util.determine_net_ingredients(floor, aggregate)
for _, line in ipairs(Floor.get_in_order(floor, "Line")) do
if line.subfloor ~= nil then
calculation.util.determine_net_ingredients(line.subfloor, aggregate)
else
for _, ingredient in ipairs(Line.get_in_order(line, "Ingredient")) do
local simple_ingredient = {type=ingredient.proto.type, name=ingredient.proto.name, amount=ingredient.amount}
structures.aggregate.add(aggregate, "Ingredient", simple_ingredient)
end
local function subtract_product(product_type, limiter)
for _, product in ipairs(Line.get_in_order(line, product_type)) do
local simple_product = {type=product.proto.type, name=product.proto.name, amount=product.amount}
local ingredient_amount = aggregate.Ingredient[simple_product.type][simple_product.name] or 0
local used_ingredient_amount = limiter(ingredient_amount, simple_product.amount)
structures.aggregate.subtract(aggregate, "Ingredient", simple_product, used_ingredient_amount)
end
end
subtract_product("Product", math.min)
subtract_product("Byproduct", math.max)
end
end
end
-- Goes through all ingredients (again), determining their satisfied_amounts
function calculation.util.update_ingredient_satisfaction(floor, aggregate)
for _, line in ipairs(Floor.get_in_order(floor, "Line", true)) do
if line.subfloor ~= nil then
local aggregate_ingredient_copy = util.table.deepcopy(aggregate.Ingredient)
calculation.util.update_ingredient_satisfaction(line.subfloor, aggregate)
for _, ingredient in ipairs(Line.get_in_order(line, "Ingredient")) do
local type, name = ingredient.proto.type, ingredient.proto.name
local removed_amount = (aggregate_ingredient_copy[type][name] or 0) - (aggregate.Ingredient[type][name] or 0)
ingredient.satisfied_amount = ingredient.amount - removed_amount
end
else
for _, ingredient in ipairs(Line.get_in_order(line, "Ingredient")) do
local aggregate_ingredient_amount = aggregate.Ingredient[ingredient.proto.type][ingredient.proto.name] or 0
local removed_amount = math.min(ingredient.amount, aggregate_ingredient_amount)
ingredient.satisfied_amount = ingredient.amount - removed_amount
structures.aggregate.subtract(aggregate, "Ingredient", {type=ingredient.proto.type, name=ingredient.proto.name}, removed_amount)
end
end
end
end
-- **** FORMULAE ****
-- Determine the amount of machines needed to produce the given recipe in the given context
function calculation.util.determine_machine_count(machine_proto, recipe_proto, total_effects, production_ratio, timescale)
local launch_delay = 0
if recipe_proto.name == "rocket-part" then
local rockets_produced = production_ratio / 100
local launch_sequence_time = 41.25 / timescale -- in seconds
-- Not sure why this forumla works, but it seemingly does
launch_delay = launch_sequence_time * rockets_produced
end
local machine_prod_ratio = production_ratio / (1 + math.max(total_effects.productivity, 0))
local machine_speed = machine_proto.speed * (1 + math.max(total_effects.speed, -0.8))
return ((machine_prod_ratio / (machine_speed / recipe_proto.energy)) / timescale) + launch_delay
end
-- Calculates the production ratio from a given machine limit
-- (Forumla derived from determine_machine_count, not sure how to work in the launch_delay correctly)
function calculation.util.determine_production_ratio(machine_proto, recipe_proto, total_effects, machine_limit, timescale)
local machine_speed = machine_proto.speed * (1 + math.max(total_effects.speed, -0.8))
local productivity_multiplier = (1 + math.max(total_effects.productivity, 0))
return (machine_limit --[[ -launch_delay ]]) * timescale * (machine_speed / recipe_proto.energy) * productivity_multiplier
end
-- Calculates the ingredient/product amount after applying productivity bonuses
-- [Formula derived from: amount - proddable_amount + (proddable_amount / productivity)]
function calculation.util.determine_prodded_amount(item, total_effects)
local productivity = (1 + math.max(total_effects.productivity, 0))
return item.amount + item.proddable_amount * ((1 / productivity) - 1)
end
-- Determines the amount of energy needed to satisfy the given recipe in the given context
function calculation.util.determine_energy_consumption(machine_proto, machine_count, total_effects)
return machine_count * (machine_proto.energy_usage * 60) * (1 + math.max(total_effects.consumption, -0.8))
end
-- Determines the amount of pollution this recipe produces
function calculation.util.determine_pollution(machine_proto, recipe_proto, fuel_proto, total_effects, energy_consumption)
local fuel_multiplier = (fuel_proto ~= nil) and fuel_proto.emissions_multiplier or 1
local pollution_multiplier = 1 + math.max(total_effects.pollution, -0.8)
return energy_consumption * (machine_proto.emissions * 60) * pollution_multiplier * fuel_multiplier * recipe_proto.emissions_multiplier
end
-- Determines the amount of fuel needed in the given context
function calculation.util.determine_fuel_amount(energy_consumption, burner, fuel_value, timescale)
return ((energy_consumption / burner.effectivity) / fuel_value) * timescale
end
|
--task.New(self, function()
-- local a = 0
-- while true do
-- local Bullet = require("BHElib.units.bullet.bullet_prefab")
-- local bullet = Bullet("ball", COLOR_BLUE, GROUP_ENEMY_BULLET, 12, 1, true)
-- bullet.x = boss.x
-- bullet.y = boss.y
-- bullet.bound = true
-- local r = 3
-- bullet.vx = r * cos(a)
-- bullet.vy = r * sin(a)
-- a = a + 3
-- task.Wait(1)
-- end
--end)
--task.New(self, function()
-- task.Wait(60)
-- local a = 0
-- while true do
-- local Laser = require("BHElib.units.bullet.laser_prefab")
-- local LaserTypes = require("BHElib.units.bullet.laser_types")
-- local bullet = Laser(self.game_scene, LaserTypes.default_laser, 4, 0.8, 0.5, 4, false)
-- bullet:turnOn(30)
-- bullet:setLength(60, 120, 60)
-- bullet:setFullWidth(50)
-- bullet.x = boss.x
-- bullet.y = boss.y
-- bullet.bound = true
-- local r = 3
-- bullet.vx = r * cos(a)
-- bullet.vy = r * sin(a)
-- bullet.rot = a
-- task.New(bullet, function()
-- while true do
-- task.Wait(1)
-- if bullet.y < 0 then
-- Del(bullet)
-- end
-- end
-- end)
-- --a = a + 30
-- task.Wait(60)
-- end
--end)
--
--task.New(self, function()
-- while true do
-- local EnemyTypes = require("BHElib.units.enemy.enemy_type.enemy_types")
-- local Enemy = require("BHElib.units.enemy.enemy_prefab")
-- local object = Enemy(EnemyTypes.bow_tie_fairy_red, 5)
-- object.x = ran:Float(-180, 180)
-- object.y = ran:Float(0, 200)
-- object:playMovementAnimation(180, ran:Sign() == -1)
-- task.Wait(5)
-- end
--end)
--
--if ran:Float(0, 1) < 0.1 then
-- local Items = require("BHElib.units.item.items")
-- local p
-- local rng = ran:Float(0, 1)
-- if rng < 0.001 then
-- p = Items.Extend(self.game_scene)
-- elseif rng < 0.004 then
-- p = Items.Bomb(self.game_scene)
-- elseif rng < 0.005 then
-- p = Items.FullPower(self.game_scene)
-- elseif rng < 0.008 then
-- p = Items.BigPower(self.game_scene)
-- elseif rng < 0.009 then
-- p = Items.SmallFaith(self.game_scene)
-- elseif rng < 0.5 then
-- p = Items.Point(self.game_scene)
-- else
-- p = Items.Power(self.game_scene)
-- end
-- p.x = ran:Float(-192, 192)
-- p.y = self.boss.y
--end
|
-- Pre-built inventory quickhacks for easy use.
local InventoryHack = {}
local Logger = require("utility/logger")
local Glossary = require("data/glossary")
local ItemHandler = require("handler/item")
local EquipmentHandler = require("handler/equipment")
function InventoryHack:GiveEndgameMods()
local itemspecs = {
{
item = Glossary.Mods.Clothing.AntiVenom,
quantity = 2
},
{
item = Glossary.Mods.Clothing.Armadillo,
quality = Glossary.Quality.Legendary,
quantity = 60,
},
{
item = Glossary.Mods.Clothing.BoomBreaker,
quality = Glossary.Quality.Legendary,
quantity = 10
},
{
item = Glossary.Mods.Clothing.Bully,
quantity = 10
},
{
item = Glossary.Mods.Clothing.CoolIt,
quantity = 10
},
{
item = Glossary.Mods.Clothing.CutItOut,
quantity = 10
},
{
item = Glossary.Mods.Clothing.DeadEye,
quantity = 10
},
{
item = Glossary.Mods.Clothing.Fortuna,
quantity = 10
},
{
item = Glossary.Mods.Clothing.Panacea,
quantity = 10
},
{
item = Glossary.Mods.Clothing.SoftSole,
quantity = 5
},
{
item = Glossary.Mods.Clothing.SuperInsulator,
quantity = 2
},
{
item = Glossary.Mods.Clothing.ZeroDrag,
quality = Glossary.Quality.Legendary,
quantity = 10
},
{
item = Glossary.Mods.Ranged.Bouncy,
quantity = 2
},
{
item = Glossary.Mods.Ranged.Crunch,
quality = Glossary.Quality.Legendary,
quantity = 30
},
{
item = Glossary.Mods.Ranged.CombatAmplifier,
quantity = 6
},
{
item = Glossary.Mods.Ranged.CounterMass,
quantity = 6
},
{
item = Glossary.Mods.Ranged.Pacifier,
quality = Glossary.Quality.Legendary,
quantity = 30
},
{
item = Glossary.Mods.Ranged.Penetrator,
quality = Glossary.Quality.Legendary,
quantity = 10
},
{
item = Glossary.Mods.Ranged.Phantom,
quantity = 10
},
{
item = Glossary.Mods.Ranged.NeonArrow,
quantity = 2
},
{
item = Glossary.Mods.Ranged.Vendetta,
quantity = 10
},
{
item = Glossary.Mods.Melee.ColdShoulder,
quantity = 7
},
{
item = Glossary.Mods.Melee.Kunai,
quantity = 7
},
{
item = Glossary.Mods.Melee.Scourge,
quantity = 7
},
{
item = Glossary.Mods.Melee.WhiteKnuckled,
quantity = 7
}
}
self.handler.item:GiveMultiple(itemspecs)
end
function InventoryHack:GiveAmmo()
local itemspecs = {
{
item = Glossary.Resources.Ammo.Handgun,
quantity = 1000
},
{
item = Glossary.Resources.Ammo.Rifle,
quantity = 1000,
},
{
item = Glossary.Resources.Ammo.Shotgun,
quantity = 1000
},
{
item = Glossary.Resources.Ammo.SniperRifle,
quantity = 1000,
},
{
item = Glossary.Resources.Ammo.Special,
quantity = 1000,
}
}
self.handler.item:GiveMultiple(itemspecs)
end
function InventoryHack:UpgradeMe()
self.handler.equipment:UpgradeEquipped()
self.handler.equipment:UpgradeInventory()
end
function InventoryHack:New()
local I = {}
setmetatable(I, self)
self.__index = self
I.module = "InventoryHack"
I.logger = Logger:New(I.module)
I.handler = {
item = ItemHandler:New(),
equipment = EquipmentHandler:New()
}
return I
end
return InventoryHack
|
return function()
local Pool = require(script.Parent.Parent.Core.Pool)
local Registry = require(script.Parent.Registry)
local Collection = require(script.Parent.Collection)
local SingleCollection = require(script.Parent.SingleCollection)
local t = require(script.Parent.Parent.t)
local function makeEntities(registry)
for i = 1, 100 do
local entity = registry:create()
if i % 2 == 0 then
registry:add(entity, "Test1", {})
end
if i % 3 == 0 then
registry:add(entity, "Test2", {})
end
if i % 4 == 0 then
registry:add(entity, "Test3", {})
end
if i % 5 == 0 then
registry:add(entity, "Test4", {})
end
end
end
beforeEach(function(context)
local registry = Registry.new()
registry:define("Test1", t.table)
registry:define("Test2", t.table)
registry:define("Test3", t.table)
registry:define("Test4", t.table)
context.registry = registry
end)
describe("new", function()
it("should create a new Collection when there is anything more than one required component", function(context)
local collection = Collection.new(context.registry, {
required = { "Test1", "Test2" }
})
expect(getmetatable(collection)).to.equal(Collection)
expect(collection._pool).to.be.ok()
expect(getmetatable(collection._pool)).to.equal(Pool)
expect(collection._updatedSet).to.be.a("table")
expect(next(collection._updatedSet)).to.equal(nil)
end)
it("should create a new SingleCollection when there is exactly one required component and nothing else", function(context)
local collection = Collection.new(context.registry, {
required = { "Test1" }
})
expect(getmetatable(collection)).to.equal(SingleCollection)
end)
it("should populate _required, _updated, and _forbidden", function(context)
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
updated = { "Test3" },
forbidden = { "Test4" },
})
expect(collection._required[1]).to.equal(registry._pools.Test1)
expect(collection._required[2]).to.equal(registry._pools.Test2)
expect(collection._updated[1]).to.equal(registry._pools.Test3)
expect(collection._forbidden[1]).to.equal(registry._pools.Test4)
end)
it("should populate the full update bitset", function(context)
local registry = context.registry
local collection = Collection.new(registry, {
updated = { "Test1", "Test2", "Test3" },
})
expect(collection._allUpdatedSet).to.equal(bit32.rshift(0xFFFFFFFF, 29))
end)
end)
describe("connect", function()
it("should connect the collection to the component pools", function(context)
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1" },
updated = { "Test2" },
forbidden = { "Test3" },
})
expect(collection._required[1].onAdded._callbacks[1]).to.be.ok()
expect(collection._required[1].onRemoved._callbacks[1]).to.be.ok()
expect(collection._forbidden[1].onRemoved._callbacks[1]).to.be.ok()
expect(collection._forbidden[1].onAdded._callbacks[1]).to.be.ok()
expect(collection._updated[1].onUpdated._callbacks[1]).to.be.ok()
expect(collection._updated[1].onRemoved._callbacks[1]).to.be.ok()
end)
end)
describe("each", function()
describe("required", function()
it("should iterate all and only the entities with at least the required components and pass their data", function(context)
local toIterate = {}
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1", "Test2", "Test3" }
})
makeEntities(registry)
for _, entity in ipairs(registry._pools.Test1.dense) do
if registry:has(entity, "Test2") and registry:has(entity, "Test3") then
toIterate[entity] = true
end
end
collection:each(function(entity, test1, test2, test3)
expect(toIterate[entity]).to.equal(true)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
expect(test3).to.equal(registry:get(entity, "Test3"))
toIterate[entity] = nil
end)
expect(next(toIterate)).to.equal(nil)
end)
end)
describe("required + forbidden", function()
it("should iterate all and only the entities with at least the required components and none of the forbidden components and pass their data", function(context)
local toIterate = {}
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test3" }
})
makeEntities(registry)
for _, entity in ipairs(registry._pools.Test1.dense) do
if registry:has(entity, "Test2") and not registry:has(entity, "Test3") then
toIterate[entity] = true
end
end
collection:each(function(entity, test1, test2)
expect(toIterate[entity]).to.equal(true)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
toIterate[entity] = nil
end)
expect(next(toIterate)).to.equal(nil)
end)
end)
describe("updated + required + forbidden", function()
it("should iterate all and only the entities with at least the required components, none of the forbidden components, and all of the updated components, and pass their data", function(context)
local registry = context.registry
local toIterate = {}
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test4" },
updated = { "Test3" }
})
makeEntities(registry)
for _, entity in ipairs(registry._pools.Test1.dense) do
if
registry:has(entity, "Test2")
and registry:has(entity, "Test3")
and not registry:has(entity, "Test4")
then
toIterate[entity] = true
end
end
local flipflop = true
for entity in pairs(toIterate) do
if flipflop then
toIterate[entity] = registry:get(entity, "Test3")
registry:replace(entity, "Test3", {})
flipflop = false
else
toIterate[entity] = nil
flipflop = true
end
end
collection:each(function(entity, test1, test2, test3)
expect(toIterate[entity]).to.be.ok()
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
expect(test3).to.equal(registry:get(entity, "Test3"))
toIterate[entity] = nil
end)
expect(next(toIterate)).to.equal(nil)
end)
it("should capture updates caused during iteration", function(context)
local toIterate = {}
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1" },
updated = { "Test2" }
})
makeEntities(registry)
collection:each(function(entity)
if registry:has(entity, "Test2") then
toIterate[entity] = {}
registry:replace(entity, "Test2", toIterate[entity])
end
end)
collection:each(function(entity, _, test2)
expect(toIterate[entity]).to.equal(test2)
toIterate[entity] = nil
end)
expect(next(toIterate)).to.equal(nil)
end)
end)
end)
describe("onAdded", function()
describe("required", function()
it("should call the callback when an entity with at least the required components is added", function(context)
local registry = context.registry
local called = false
local testEntity = registry:create()
local collection = Collection.new(registry, {
required = { "Test1", "Test2", "Test3" }
})
collection.onAdded:connect(function(entity, test1, test2, test3)
called = true
expect(entity).to.equal(testEntity)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
expect(test3).to.equal(registry:get(entity, "Test3"))
end)
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {},
"Test3", {}
)
expect(called).to.equal(true)
expect(collection._pool:getIndex(testEntity)).to.be.ok()
end)
end)
describe("required + forbidden", function()
it("should call the callback when an entity with at least the required components and none of the forbidden components is added", function(context)
local registry = context.registry
local called = false
local testEntity = registry:create()
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test3" }
})
collection.onAdded:connect(function(entity, test1, test2)
called = true
expect(entity).to.equal(testEntity)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
end)
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {}
)
expect(called).to.equal(true)
expect(collection._pool:getIndex(testEntity)).to.be.ok()
called = false
registry:add(testEntity, "Test3", {})
expect(called).to.equal(false)
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
end)
end)
describe("updated + required + forbidden", function()
it("should call the callback when an entity with at least the required components, none of the forbidden components, and all of the updated components is added", function(context)
local registry = context.registry
local testEntity = registry:create()
local called = false
local collection = Collection.new(registry, {
required = { "Test1" },
updated = { "Test2", "Test4" },
forbidden = { "Test3" }
})
collection.onAdded:connect(function(entity, test1, test2, test4)
called = true
expect(entity).to.equal(testEntity)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
expect(test4).to.equal(registry:get(entity, "Test4"))
end)
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {},
"Test4", {}
)
expect(called).to.equal(false)
registry:replace(testEntity, "Test4", {})
registry:replace(testEntity, "Test2", {})
expect(called).to.equal(true)
expect(collection._pool:getIndex(testEntity)).to.be.ok()
called = false
registry:add(testEntity, "Test3", {})
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
registry:replace(testEntity, "Test4", {})
registry:replace(testEntity, "Test2", {})
expect(called).to.equal(false)
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
end)
it("should not fire twice when a component is updated twice", function(context)
local registry = context.registry
local called = false
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
updated = { "Test4" },
})
collection.onAdded:connect(function()
called = true
end)
local testEntity = registry:create()
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {},
"Test4", {}
)
registry:replace(testEntity, "Test4", {})
registry:replace(testEntity, "Test4", {})
expect(called).to.equal(true)
end)
end)
end)
describe("onRemoved", function()
describe("required", function()
it("should call the callback when an entity with at least the required components is untracked", function(context)
local registry = context.registry
local called = false
local testEntity = registry:create()
local collection = Collection.new(registry, {
required = { "Test1", "Test2", "Test3" }
})
collection.onRemoved:connect(function(entity, test1, test2, test3)
called = true
expect(entity).to.equal(testEntity)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
expect(test3).to.equal(registry:get(entity, "Test3"))
end)
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {},
"Test3", {}
)
registry:remove(testEntity, "Test2")
expect(called).to.equal(true)
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
end)
end)
describe("required + forbidden", function()
it("should call the callback when an entity with at least the required components and none of the forbidden components is untracked", function(context)
local registry = context.registry
local called = false
local testEntity = registry:create()
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test3" }
})
collection.onRemoved:connect(function(entity, test1, test2)
called = true
expect(entity).to.equal(testEntity)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
end)
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {}
)
registry:add(testEntity, "Test3", {})
expect(called).to.equal(true)
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
end)
end)
describe("updated + required + forbidden", function()
it("should call the callback when an entity with at least the required components, none of the forbidden components, and all of the updated components is untracked", function(context)
local registry = context.registry
local called = false
local testEntity = registry:create()
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test3" },
updated = { "Test4" }
})
collection.onRemoved:connect(function(entity, test1, test2, test4)
called = true
expect(entity).to.equal(testEntity)
expect(test1).to.equal(registry:get(entity, "Test1"))
expect(test2).to.equal(registry:get(entity, "Test2"))
expect(test4).to.equal(registry:get(entity, "Test4"))
end)
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {},
"Test4", {}
)
registry:replace(testEntity, "Test4", {})
registry:remove(testEntity, "Test2", {})
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
expect(called).to.equal(true)
end)
end)
it("should stop tracking updates on an entity after all updated components have been removed", function(context)
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test3" },
updated = { "Test4" }
})
local testEntity = registry:create()
registry:multiAdd(testEntity,
"Test1", {},
"Test2", {},
"Test4", {}
)
registry:replace(testEntity, "Test4", {})
registry:remove(testEntity, "Test4")
expect(collection._pool:getIndex(testEntity)).to.never.be.ok()
expect(collection._updatedSet[testEntity]).to.equal(nil)
end)
end)
describe("_getShortestRequiredPool", function()
it("should select the pool with the least number of components in it", function(context)
local collection = Collection.new(context.registry, {
required = { "Test1", "Test4" }
})
makeEntities(context.registry)
expect(collection:_getShortestRequiredPool()).to.equal(context.registry._pools.Test4)
end)
end)
describe("_pack", function()
it("should pack the required and updated components of the entity into _packed", function(context)
local collection = Collection.new(context.registry, {
required = { "Test2", "Test3" },
updated = { "Test3", "Test4" }
})
local entity = context.registry:multiAdd(context.registry:create(),
"Test1", {},
"Test2", {},
"Test3", {},
"Test4", {}
)
collection:_pack(entity)
expect(collection._packed[1]).to.equal(context.registry:get(entity, "Test2"))
expect(collection._packed[2]).to.equal(context.registry:get(entity, "Test3"))
expect(collection._packed[3]).to.equal(context.registry:get(entity, "Test3"))
expect(collection._packed[4]).to.equal(context.registry:get(entity, "Test4"))
end)
end)
describe("_tryPack", function()
it("should pack the required components and return true if the entity has all of them", function(context)
local registry = context.registry
local collection = Collection.new(registry, {
required = { "Test1", "Test2" },
forbidden = { "Test3" }
})
local entity = registry:multiAdd(registry:create(),
"Test1", {},
"Test2", {}
)
expect(collection:_tryPack(entity)).to.equal(true)
expect(collection._packed[1]).to.equal(registry:get(entity, "Test1"))
expect(collection._packed[2]).to.equal(registry:get(entity, "Test2"))
expect(collection._packed[3]).to.equal(nil)
expect(collection:_tryPack(registry:multiAdd(registry:create(),
"Test1", {},
"Test2", {},
"Test3", {}
))).to.equal(false)
end)
end)
end
|
red = gr.material({0.8, 0.1, 0.1}, {0.5, 0.5, 0.5}, 25)
blue = gr.material({0.0, 0.0, 1.0}, {0.5, 0.5, 0.5}, 25)
rblue = gr.smaterial({0, 0, 0}, {1, 1, 1}, 50, 1, 1.65, 0)
blue = gr.material({0.0, 0.1, 1}, {0.5, 0.5, 0.5}, 25)
green = gr.material({0.0, 1.0, 0.0}, {0.5, 0.5, 0.5}, 25)
rgreen = gr.material({0.0, 0.1, 0.0}, {0.5, 0.5, 0.5}, 25)
rwhite = gr.material({1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, 25)
fwhite = gr.material({1.0, 1.0, 1.0}, {1.0, 1.0, 1.0}, 50, 1, 200, 10000)
root = gr.node('root')
-- Many puppets
-- P1 = gr.node('P1')
-- root:add_child(P1)
-- P1:add_child(puppet)
-- P1:translate(-10, 0, 0)
-- P1:rotate('y', 90)
-- P2 = gr.node('P2')
-- root:add_child(P2)
-- P2:add_child(puppet)
-- P2:translate(10, 0, 0)
-- P2:rotate('y', -90)
flooroffset = -14
-- poly1 = gr.node('poly1')
-- poly1:translate(0, flooroffset+2, 0)
-- poly1:scale(2, 2, 2)
-- poly1:add_child(poly)
-- root:add_child(poly1)
-- floor
wall1 = gr.cube('wall1')
root:add_child(wall1)
wall1:set_material(fwhite)
wall1:translate(-15.5, 0, -15)
wall1:scale(30,1,30)
--roof
wall1 = gr.cube('wall1')
root:add_child(wall1)
wall1:set_material(rwhite)
wall1:translate(-15.5, 30, -15)
wall1:scale(30,1,30)
--Left wall
wall1 = gr.cube('wall1')
root:add_child(wall1)
wall1:set_material(red)
wall1:translate(-15.5, 0.5, -15)
wall1:rotate('z', 90)
wall1:scale(30,1,30)
-- right wall
wall1 = gr.cube('wall1')
root:add_child(wall1)
wall1:set_material(blue)
wall1:translate(-15, 0.5, -15)
wall1:rotate('z', 90)
wall1:translate(0, -30.5, 0)
wall1:scale(30,1,30)
-- back wall
wall1 = gr.cube('wall1')
root:add_child(wall1)
wall1:set_material(rwhite)
wall1:translate(-15.5, 0, -15)
wall1:rotate('x', 90)
wall1:translate(0, 0, -30)
wall1:scale(30,1,30)
BALL = gr.sphere('BALL')
BALL:translate(7, 7, -4)
BALL:scale(5, 5, 5)
BALL:set_material(rblue)
root:add_child(BALL)
BALL = gr.sphere('BALL')
BALL:translate(-7, 7, 0)
BALL:scale(5, 5, 5)
BALL:set_material(rblue)
root:add_child(BALL)
-- BALL = gr.cylinder('BALL')
-- BALL:translate(-4, 4, 7)
-- BALL:scale(6, 8, 6)
-- BALL:rotate('x', 90)
-- BALL:set_material(rblue)
-- root:add_child(BALL)
white_light = gr.light(10000, {0.0, 29.0, 0.0}, {1, 1, 1}, {1, 0, 0})
camera = gr.pcamera({0, 15, 40}, {0, 0, -1}, {0, 1, 0}, 50, 0.1, 40)
gr.render(root, './img/sample.png', 1024, 1024,
camera,
{0.3, 0.3, 0.3}, {white_light}, {}, 10000000, 0, 1)
|
local logger = require "kong.cmd.utils.log"
local pgmoon = require "pgmoon"
local arrays = require "pgmoon.arrays"
local stringx = require "pl.stringx"
local semaphore = require "ngx.semaphore"
local setmetatable = setmetatable
local encode_array = arrays.encode_array
local tonumber = tonumber
local tostring = tostring
local concat = table.concat
local ipairs = ipairs
local pairs = pairs
local error = error
local floor = math.floor
local type = type
local ngx = ngx
local timer_every = ngx.timer.every
local update_time = ngx.update_time
local get_phase = ngx.get_phase
local null = ngx.null
local now = ngx.now
local log = ngx.log
local match = string.match
local fmt = string.format
local sub = string.sub
local WARN = ngx.WARN
local SQL_INFORMATION_SCHEMA_TABLES = [[
SELECT table_name
FROM information_schema.tables
WHERE table_schema = CURRENT_SCHEMA;
]]
local PROTECTED_TABLES = {
schema_migrations = true,
schema_meta = true,
locks = true,
}
local function now_updated()
update_time()
return now()
end
local function visit(k, n, m, s)
if m[k] == 0 then return 1 end
if m[k] == 1 then return end
m[k] = 0
local f = n[k]
for i=1, #f do
if visit(f[i], n, m, s) then return 1 end
end
m[k] = 1
s[#s+1] = k
end
local tsort = {}
tsort.__index = tsort
function tsort.new()
return setmetatable({ n = {} }, tsort)
end
function tsort:add(...)
local p = { ... }
local c = #p
if c == 0 then return self end
if c == 1 then
p = p[1]
if type(p) == "table" then
c = #p
else
p = { p }
end
end
local n = self.n
for i=1, c do
local f = p[i]
if n[f] == nil then n[f] = {} end
end
for i=2, c, 1 do
local f = p[i]
local t = p[i-1]
local o = n[f]
o[#o+1] = t
end
return self
end
function tsort:sort()
local n = self.n
local s = {}
local m = {}
for k in pairs(n) do
if m[k] == nil then
if visit(k, n, m, s) then
return nil, "There is a circular dependency in the graph. It is not possible to derive a topological sort."
end
end
end
return s
end
local function iterator(rows)
local i = 0
return function()
i = i + 1
return rows[i]
end
end
local function get_table_names(self, excluded)
local i = 0
local table_names = {}
for row, err in self:iterate(SQL_INFORMATION_SCHEMA_TABLES) do
if err then
return nil, err
end
if not excluded or not excluded[row.table_name] then
i = i + 1
table_names[i] = self:escape_identifier(row.table_name)
end
end
return table_names
end
local function reset_schema(self)
local table_names, err = get_table_names(self)
if not table_names then
return nil, err
end
local drop_tables
if #table_names == 0 then
drop_tables = ""
else
drop_tables = concat {
" DROP TABLE IF EXISTS ", concat(table_names, ", "), " CASCADE;\n"
}
end
local schema = self:escape_identifier(self.config.schema)
local ok, err = self:query(concat {
"BEGIN;\n",
" DO $$\n",
" BEGIN\n",
" DROP SCHEMA IF EXISTS ", schema, " CASCADE;\n",
" CREATE SCHEMA IF NOT EXISTS ", schema, " AUTHORIZATION CURRENT_USER;\n",
" GRANT ALL ON SCHEMA ", schema ," TO CURRENT_USER;\n",
" EXCEPTION WHEN insufficient_privilege THEN\n", drop_tables,
" END;\n",
" $$;\n",
" SET SCHEMA ", self:escape_literal(self.config.schema), ";\n",
"COMMIT;", })
if not ok then
return nil, err
end
return true
end
local setkeepalive
local function connect(config)
local phase = get_phase()
-- TODO: remove preread from here when the issue with starttls has been fixed
-- TODO: make also sure that Cassandra doesn't use LuaSockets on preread after
-- starttls has been fixed
if phase == "preread" or phase == "init" or phase == "init_worker" or ngx.IS_CLI then
-- Force LuaSocket usage in the CLI in order to allow for self-signed
-- certificates to be trusted (via opts.cafile) in the resty-cli
-- interpreter (no way to set lua_ssl_trusted_certificate).
config.socket_type = "luasocket"
else
config.socket_type = "nginx"
end
local connection = pgmoon.new(config)
connection.convert_null = true
connection.NULL = null
if config.timeout then
connection:settimeout(config.timeout)
end
local ok, err = connection:connect()
if not ok then
return nil, err
end
if connection.sock:getreusedtimes() == 0 then
if config.schema == "" then
local res = connection:query("SELECT CURRENT_SCHEMA AS schema")
if res and res[1] and res[1].schema and res[1].schema ~= null then
config.schema = res[1].schema
else
config.schema = "public"
end
end
ok, err = connection:query(concat {
"SET SCHEMA ", connection:escape_literal(config.schema), ";\n",
"SET TIME ZONE ", connection:escape_literal("UTC"), ";",
})
if not ok then
setkeepalive(connection)
return nil, err
end
end
return connection
end
setkeepalive = function(connection)
if not connection or not connection.sock then
return true
end
if connection.sock_type == "luasocket" then
local _, err = connection:disconnect()
if err then
return nil, err
end
else
local _, err = connection:keepalive()
if err then
return nil, err
end
end
return true
end
local _mt = {
reset = reset_schema
}
_mt.__index = _mt
function _mt:get_stored_connection()
local conn = self.super.get_stored_connection(self)
if conn and conn.sock then
return conn
end
end
function _mt:init()
local res, err = self:query("SHOW server_version_num;")
local ver = tonumber(res and res[1] and res[1].server_version_num)
if not ver then
return nil, "failed to retrieve server_version_num: " .. err
end
local major = floor(ver / 10000)
if major < 10 then
self.major_version = tonumber(fmt("%u.%u", major, floor(ver / 100 % 100)))
self.major_minor_version = fmt("%u.%u.%u", major, floor(ver / 100 % 100), ver % 100)
else
self.major_version = major
self.major_minor_version = fmt("%u.%u", major, ver % 100)
end
return true
end
function _mt:init_worker(strategies)
if ngx.worker.id() == 0 then
local graph
local found = false
for _, strategy in pairs(strategies) do
local schema = strategy.schema
if schema.ttl then
if not found then
graph = tsort.new()
found = true
end
local name = schema.name
graph:add(name)
for _, field in schema:each_field() do
if field.type == "foreign" and field.schema.ttl then
graph:add(name, field.schema.name)
end
end
end
end
if not found then
return true
end
local sorted_strategies = graph:sort()
local ttl_escaped = self:escape_identifier("ttl")
local cleanup_statements = {}
local cleanup_statements_count = #sorted_strategies
for i = 1, cleanup_statements_count do
local table_name = sorted_strategies[i]
cleanup_statements[i] = concat {
" DELETE FROM ",
self:escape_identifier(table_name),
" WHERE ",
ttl_escaped,
" < CURRENT_TIMESTAMP AT TIME ZONE 'UTC';"
}
end
local cleanup_statement = concat(cleanup_statements, "\n")
return timer_every(60, function(premature)
if premature then
return
end
local ok, _, _, num_queries = self:query(cleanup_statement)
if not ok then
for i = num_queries + 1, cleanup_statements_count do
local statement = cleanup_statements[i]
local ok, err = self:query(statement)
if not ok then
if err then
log(WARN, "unable to clean expired rows from table '",
sorted_strategies[i], "' on postgres database (",
err, ")")
else
log(WARN, "unable to clean expired rows from table '",
sorted_strategies[i], "' on postgres database")
end
end
end
end
end)
end
return true
end
function _mt:infos()
local db_ver
if self.major_minor_version then
db_ver = match(self.major_minor_version, "^(%d+%.%d+)")
end
return {
strategy = "PostgreSQL",
db_name = self.config.database,
db_schema = self.config.schema,
db_desc = "database",
db_ver = db_ver or "unknown",
}
end
function _mt:connect()
local conn = self:get_stored_connection()
if conn then
return conn
end
local connection, err = connect(self.config)
if not connection then
return nil, err
end
self:store_connection(connection)
return connection
end
function _mt:connect_migrations()
return self:connect()
end
function _mt:close()
local conn = self:get_stored_connection()
if not conn then
return true
end
local _, err = conn:disconnect()
self:store_connection(nil)
if err then
return nil, err
end
return true
end
function _mt:setkeepalive()
local conn = self:get_stored_connection()
if not conn then
return true
end
local _, err = setkeepalive(conn)
self:store_connection(nil)
if err then
return nil, err
end
return true
end
function _mt:acquire_query_semaphore_resource()
if not self.sem then
return true
end
do
local phase = get_phase()
if phase == "init" or phase == "init_worker" then
return true
end
end
local ok, err = self.sem:wait(self.config.sem_timeout)
if not ok then
return nil, err
end
return true
end
function _mt:release_query_semaphore_resource()
if not self.sem then
return true
end
do
local phase = get_phase()
if phase == "init" or phase == "init_worker" then
return true
end
end
self.sem:post()
end
function _mt:query(sql)
local res, err, partial, num_queries
local ok
ok, err = self:acquire_query_semaphore_resource()
if not ok then
return nil, "error acquiring query semaphore: " .. err
end
local conn = self:get_stored_connection()
if conn then
res, err, partial, num_queries = conn:query(sql)
else
local connection
connection, err = connect(self.config)
if not connection then
self:release_query_semaphore_resource()
return nil, err
end
res, err, partial, num_queries = connection:query(sql)
setkeepalive(connection)
end
self:release_query_semaphore_resource()
if res then
return res, nil, partial, num_queries or err
end
return nil, err, partial, num_queries
end
function _mt:iterate(sql)
local res, err, partial, num_queries = self:query(sql)
if not res then
local failed = false
return function()
if not failed then
failed = true
return false, err, partial, num_queries
end
-- return error only once to avoid infinite loop
return nil
end
end
if res == true then
return iterator { true }
end
return iterator(res)
end
function _mt:truncate()
local table_names, err = get_table_names(self, PROTECTED_TABLES)
if not table_names then
return nil, err
end
if #table_names == 0 then
return true
end
local truncate_statement = concat {
"TRUNCATE ", concat(table_names, ", "), " RESTART IDENTITY CASCADE;"
}
local ok, err = self:query(truncate_statement)
if not ok then
return nil, err
end
return true
end
function _mt:truncate_table(table_name)
local truncate_statement = concat {
"TRUNCATE ", self:escape_identifier(table_name), " RESTART IDENTITY CASCADE;"
}
local ok, err = self:query(truncate_statement)
if not ok then
return nil, err
end
return true
end
function _mt:setup_locks(_, _)
logger.debug("creating 'locks' table if not existing...")
local ok, err = self:query([[
BEGIN;
CREATE TABLE IF NOT EXISTS locks (
key TEXT PRIMARY KEY,
owner TEXT,
ttl TIMESTAMP WITH TIME ZONE
);
CREATE INDEX IF NOT EXISTS locks_ttl_idx ON locks (ttl);
COMMIT;]])
if not ok then
return nil, err
end
logger.debug("successfully created 'locks' table")
return true
end
function _mt:insert_lock(key, ttl, owner)
local ttl_escaped = concat {
"TO_TIMESTAMP(",
self:escape_literal(tonumber(fmt("%.3f", now_updated() + ttl))),
") AT TIME ZONE 'UTC'"
}
local sql = concat { "BEGIN;\n",
" DELETE FROM locks\n",
" WHERE ttl < CURRENT_TIMESTAMP AT TIME ZONE 'UTC';\n",
" INSERT INTO locks (key, owner, ttl)\n",
" VALUES (", self:escape_literal(key), ", ",
self:escape_literal(owner), ", ",
ttl_escaped, ")\n",
" ON CONFLICT DO NOTHING;\n",
"COMMIT;"
}
local res, err, _, num_queries = self:query(sql)
if not res then
return nil, err
end
if num_queries ~= 4 then
return nil, "unexpected result"
end
if res[3] and res[3].affected_rows == 1 then
return true
end
return false
end
function _mt:read_lock(key)
local sql = concat {
"SELECT *\n",
" FROM locks\n",
" WHERE key = ", self:escape_literal(key), "\n",
" AND ttl >= CURRENT_TIMESTAMP AT TIME ZONE 'UTC'\n",
" LIMIT 1;"
}
local res, err = self:query(sql)
if not res then
return nil, err
end
return res[1] ~= nil
end
function _mt:remove_lock(key, owner)
local sql = concat {
"DELETE\n",
" FROM ", self:escape_identifier("locks"), "\n",
" WHERE ", self:escape_identifier("key"), " = ", self:escape_literal(key), "\n",
" AND ", self:escape_identifier("owner"), " = ", self:escape_literal(owner), ";"
}
local res, err = self:query(sql)
if not res then
return nil, err
end
return true
end
function _mt:schema_migrations()
local conn = self:get_stored_connection()
if not conn then
error("no connection")
end
local table_names, err = get_table_names(self)
if not table_names then
return nil, err
end
local schema_meta_table_name = self:escape_identifier("schema_meta")
local schema_meta_table_exists
for _, table_name in ipairs(table_names) do
if table_name == schema_meta_table_name then
schema_meta_table_exists = true
break
end
end
if not schema_meta_table_exists then
-- database, but no schema_meta: needs bootstrap
return nil
end
local rows, err = self:query(concat({
"SELECT *\n",
" FROM schema_meta\n",
" WHERE key = ", self:escape_literal("schema_meta"), ";"
}))
if not rows then
return nil, err
end
for _, row in ipairs(rows) do
if row.pending == null then
row.pending = nil
end
end
-- no migrations: is bootstrapped but not migrated
-- migrations: has some migrations
return rows
end
function _mt:schema_bootstrap(kong_config, default_locks_ttl)
local conn = self:get_stored_connection()
if not conn then
error("no connection")
end
-- create schema if not exists
logger.debug("creating '%s' schema if not existing...", self.config.schema)
local schema = self:escape_identifier(self.config.schema)
local ok, err = self:query(concat {
"BEGIN;\n",
" DO $$\n",
" BEGIN\n",
" CREATE SCHEMA IF NOT EXISTS ", schema, " AUTHORIZATION CURRENT_USER;\n",
" GRANT ALL ON SCHEMA ", schema ," TO CURRENT_USER;\n",
" EXCEPTION WHEN insufficient_privilege THEN\n",
" -- Do nothing, perhaps the schema has been created already\n",
" END;\n",
" $$;\n",
" SET SCHEMA ", self:escape_literal(self.config.schema), ";\n",
"COMMIT;",
})
if not ok then
return nil, err
end
logger.debug("successfully created '%s' schema", self.config.schema)
-- create schema meta table if not exists
logger.debug("creating 'schema_meta' table if not existing...")
local res, err = self:query([[
CREATE TABLE IF NOT EXISTS schema_meta (
key TEXT,
subsystem TEXT,
last_executed TEXT,
executed TEXT[],
pending TEXT[],
PRIMARY KEY (key, subsystem)
);]])
if not res then
return nil, err
end
logger.debug("successfully created 'schema_meta' table")
local ok
ok, err = self:setup_locks(default_locks_ttl, true)
if not ok then
return nil, err
end
return true
end
function _mt:schema_reset()
local conn = self:get_stored_connection()
if not conn then
error("no connection")
end
return reset_schema(self)
end
function _mt:run_up_migration(name, up_sql)
if type(name) ~= "string" then
error("name must be a string", 2)
end
if type(up_sql) ~= "string" then
error("up_sql must be a string", 2)
end
local conn = self:get_stored_connection()
if not conn then
error("no connection")
end
local sql = stringx.strip(up_sql)
if sub(sql, -1) ~= ";" then
sql = sql .. ";"
end
local sql = concat {
"BEGIN;\n",
sql, "\n",
"COMMIT;\n",
}
local res, err = self:query(sql)
if not res then
self:query("ROLLBACK;")
return nil, err
end
return true
end
function _mt:record_migration(subsystem, name, state)
if type(subsystem) ~= "string" then
error("subsystem must be a string", 2)
end
if type(name) ~= "string" then
error("name must be a string", 2)
end
local conn = self:get_stored_connection()
if not conn then
error("no connection")
end
local key_escaped = self:escape_literal("schema_meta")
local subsystem_escaped = self:escape_literal(subsystem)
local name_escaped = self:escape_literal(name)
local name_array = encode_array({ name })
local sql
if state == "executed" then
sql = concat({
"INSERT INTO schema_meta (key, subsystem, last_executed, executed)\n",
" VALUES (", key_escaped, ", ", subsystem_escaped, ", ", name_escaped, ", ", name_array, ")\n",
"ON CONFLICT (key, subsystem) DO UPDATE\n",
" SET last_executed = EXCLUDED.last_executed,\n",
" executed = ARRAY_APPEND(COALESCE(schema_meta.executed, ARRAY[]::TEXT[]), ", name_escaped, ");",
})
elseif state == "pending" then
sql = concat({
"INSERT INTO schema_meta (key, subsystem, pending)\n",
" VALUES (", key_escaped, ", ", subsystem_escaped, ", ", name_array, ")\n",
"ON CONFLICT (key, subsystem) DO UPDATE\n",
" SET pending = ARRAY_APPEND(schema_meta.pending, ", name_escaped, ");"
})
elseif state == "teardown" then
sql = concat({
"INSERT INTO schema_meta (key, subsystem, last_executed, executed)\n",
" VALUES (", key_escaped, ", ", subsystem_escaped, ", ", name_escaped, ", ", name_array, ")\n",
"ON CONFLICT (key, subsystem) DO UPDATE\n",
" SET last_executed = EXCLUDED.last_executed,\n",
" executed = ARRAY_APPEND(COALESCE(schema_meta.executed, ARRAY[]::TEXT[]), ", name_escaped, "),\n",
" pending = ARRAY_REMOVE(COALESCE(schema_meta.pending, ARRAY[]::TEXT[]), ", name_escaped, ");",
})
else
error("unknown 'state' argument: " .. tostring(state))
end
local res, err = self:query(sql)
if not res then
return nil, err
end
return true
end
function _mt:are_014_apis_present()
local _, err = self:query([[
DO $$
BEGIN
IF EXISTS(SELECT id FROM apis) THEN
RAISE EXCEPTION 'there are apis in the db';
END IF;
EXCEPTION WHEN UNDEFINED_TABLE THEN
-- Do nothing, table does not exist
END;
$$;
]])
if err and err:match("there are apis in the db") then
return true
end
if err then
return nil, err
end
return false
end
function _mt:is_014()
local res = {}
local needed_migrations = {
["core"] = {
"2015-01-12-175310_skeleton",
"2015-01-12-175310_init_schema",
"2015-11-23-817313_nodes",
"2016-02-29-142793_ttls",
"2016-09-05-212515_retries",
"2016-09-16-141423_upstreams",
"2016-12-14-172100_move_ssl_certs_to_core",
"2016-11-11-151900_new_apis_router_1",
"2016-11-11-151900_new_apis_router_2",
"2016-11-11-151900_new_apis_router_3",
"2016-01-25-103600_unique_custom_id",
"2017-01-24-132600_upstream_timeouts",
"2017-01-24-132600_upstream_timeouts_2",
"2017-03-27-132300_anonymous",
"2017-04-18-153000_unique_plugins_id",
"2017-04-18-153000_unique_plugins_id_2",
"2017-05-19-180200_cluster_events",
"2017-05-19-173100_remove_nodes_table",
"2017-06-16-283123_ttl_indexes",
"2017-07-28-225000_balancer_orderlist_remove",
"2017-10-02-173400_apis_created_at_ms_precision",
"2017-11-07-192000_upstream_healthchecks",
"2017-10-27-134100_consistent_hashing_1",
"2017-11-07-192100_upstream_healthchecks_2",
"2017-10-27-134100_consistent_hashing_2",
"2017-09-14-121200_routes_and_services",
"2017-10-25-180700_plugins_routes_and_services",
"2018-03-27-123400_prepare_certs_and_snis",
"2018-03-27-125400_fill_in_snis_ids",
"2018-03-27-130400_make_ids_primary_keys_in_snis",
"2018-05-17-173100_hash_on_cookie",
},
["response-transformer"] = {
"2016-05-04-160000_resp_trans_schema_changes",
},
["jwt"] = {
"2015-06-09-jwt-auth",
"2016-03-07-jwt-alg",
"2017-05-22-jwt_secret_not_unique",
"2017-07-31-120200_jwt-auth_preflight_default",
"2017-10-25-211200_jwt_cookie_names_default",
"2018-03-15-150000_jwt_maximum_expiration",
},
["ip-restriction"] = {
"2016-05-24-remove-cache",
},
["statsd"] = {
"2017-06-09-160000_statsd_schema_changes",
},
["cors"] = {
"2017-03-14_multiple_orgins",
},
["basic-auth"] = {
"2015-08-03-132400_init_basicauth",
"2017-01-25-180400_unique_username",
},
["key-auth"] = {
"2015-07-31-172400_init_keyauth",
"2017-07-31-120200_key-auth_preflight_default",
},
["ldap-auth"] = {
"2017-10-23-150900_header_type_default",
},
["hmac-auth"] = {
"2015-09-16-132400_init_hmacauth",
"2017-06-21-132400_init_hmacauth",
},
["datadog"] = {
"2017-06-09-160000_datadog_schema_changes",
},
["tcp-log"] = {
"2017-12-13-120000_tcp-log_tls",
},
["acl"] = {
"2015-08-25-841841_init_acl",
},
["response-ratelimiting"] = {
"2015-08-03-132400_init_response_ratelimiting",
"2016-08-04-321512_response-rate-limiting_policies",
"2017-12-19-120000_add_route_and_service_id_to_response_ratelimiting",
},
["request-transformer"] = {
"2016-05-04-160000_req_trans_schema_changes",
},
["rate-limiting"] = {
"2015-08-03-132400_init_ratelimiting",
"2016-07-25-471385_ratelimiting_policies",
"2017-11-30-120000_add_route_and_service_id",
},
["oauth2"] = {
"2015-08-03-132400_init_oauth2",
"2016-07-15-oauth2_code_credential_id",
"2016-12-22-283949_serialize_redirect_uri",
"2016-09-19-oauth2_api_id",
"2016-12-15-set_global_credentials",
"2017-04-24-oauth2_client_secret_not_unique",
"2017-10-19-set_auth_header_name_default",
"2017-10-11-oauth2_new_refresh_token_ttl_config_value",
"2018-01-09-oauth2_pg_add_service_id",
},
}
local rows, err = self:query([[
SELECT to_regclass('schema_migrations') AS "name";
]])
if err then
return nil, err
end
if not rows or not rows[1] or rows[1].name ~= "schema_migrations" then
-- no trace of legacy migrations: above 0.14
return res
end
local schema_migrations_rows, err = self:query([[
SELECT "id", "migrations" FROM "schema_migrations";
]])
if err then
return nil, err
end
if not schema_migrations_rows then
-- empty legacy migrations: invalid state
res.invalid_state = true
return res
end
local schema_migrations = {}
for i = 1, #schema_migrations_rows do
local row = schema_migrations_rows[i]
schema_migrations[row.id] = row.migrations
end
for name, migrations in pairs(needed_migrations) do
local current_migrations = schema_migrations[name]
if not current_migrations then
-- missing all migrations for a component: below 0.14
res.invalid_state = true
res.missing_component = name
return res
end
for _, needed_migration in ipairs(migrations) do
local found
for _, current_migration in ipairs(current_migrations) do
if current_migration == needed_migration then
found = true
break
end
end
if not found then
-- missing at least one migration for a component: below 0.14
res.invalid_state = true
res.missing_component = name
res.missing_migration = needed_migration
return res
end
end
end
-- all migrations match: 0.14 install
res.is_014 = true
return res
end
local _M = {}
function _M.new(kong_config)
local config = {
host = kong_config.pg_host,
port = kong_config.pg_port,
timeout = kong_config.pg_timeout,
user = kong_config.pg_user,
password = kong_config.pg_password,
database = kong_config.pg_database,
schema = kong_config.pg_schema or "",
ssl = kong_config.pg_ssl,
ssl_verify = kong_config.pg_ssl_verify,
cafile = kong_config.lua_ssl_trusted_certificate,
sem_max = kong_config.pg_max_concurrent_queries or 0,
sem_timeout = (kong_config.pg_semaphore_timeout or 60000) / 1000,
}
local db = pgmoon.new(config)
local sem
if config.sem_max > 0 then
local err
sem, err = semaphore.new(config.sem_max)
if not sem then
ngx.log(ngx.CRIT, "failed creating the PostgreSQL connector semaphore: ",
err)
end
end
return setmetatable({
config = config,
escape_identifier = db.escape_identifier,
escape_literal = db.escape_literal,
sem = sem,
}, _mt)
end
return _M
|
_G.discordia = require("discordia")
_G.client = discordia.Client()
discordia.extensions()
_G.spawn = require("coro-spawn")
_G.split = require("coro-split")
_G.parse = require("url").parse
_G.settings = require("settings")
_G.functions = require("functions")
_G.queue = {}
client:on("ready", function()
print("Logged in as " .. client.user.username)
client:setGame(settings.Prefix .. "help")
end)
client:on("messageCreate", function(message)
if message.author.bot or message.author == client.user then return end -- Check if not Bot
local args = message.content:split(" ")
if args[1] == settings.Prefix .. "ping" then -- !ping
functions.reply("Pong! 🏓", message)
elseif args[1] == settings.Prefix .. "play" then -- !play [Youtube URL]
local author = message.guild:getMember(message.author.id)
local vc
if not author.voiceChannel and not client.user.voiceChannel then
message:addReaction("❌")
functions.reply("Join Voice Channel to Get Started! 🎶", message)
elseif client.user.voiceChannel then
vc = client.user.voiceChannel
else
table.remove(args, 1)
local vid = table.concat(args, ' ')
vc = author.voiceChannel
_G.connection = vc:join()
message:addReaction("👍")
local youtubeEmbed = message.channel:send {
embed = {
fields = {
{name = "Please wait...", value = "This may took a while (~15 seconds)", inline = true},
},
title = "Downloading 🕔",
color = discordia.Color.fromRGB(114, 137, 218).value,
},
reference = {
message = message,
mention = false,
}
}
_G.stream = functions.getYoutube(vid)
youtubeEmbed:update{
embed = {
image = {
url = youtubeThumbnail
},
fields = {
{name = playing, value = "Uploaded by **" ..youtubeUploader.. "**", inline = true},
},
title = "Now Playing 🎶",
color = discordia.Color.fromRGB(114, 137, 218).value,
},
reference = {
message = message,
mention = false,
}
}
client:setGame("▶ " .. playing)
coroutine.wrap(function()
connection:playFFmpeg(stream)
client:setGame("⏹ Nothing")
end)()
end
elseif args[1] == settings.Prefix .. "pause" then -- !pause
connection:pauseStream()
client:setGame("⏸ " .. playing)
message:addReaction("⏸")
elseif args[1] == settings.Prefix .. "resume" then -- !resume
connection:resumeStream()
client:setGame("▶ " .. playing)
message:addReaction("▶")
elseif args[1] == settings.Prefix .. "stop" then -- !stop
connection:stopStream()
if functions.fileExists(fileName) then
os.remove(fileName)
end
client:setGame("⏹ Nothing")
message:addReaction("⏹")
elseif args[1] == settings.Prefix .. "disconnect" then -- !disconnect
connection:stopStream()
connection:close()
client:setGame(settings.Prefix .. "help")
message:addReaction("👋")
elseif args[1] == settings.Prefix .. "join" then -- !join
local author = message.guild:getMember(message.author.id)
local vc
if not author.voiceChannel and not client.user.voiceChannel then
message:addReaction("❌")
functions.reply("Join Voice Channel to Get Started! 🎶", message)
elseif client.user.voiceChannel then
vc = client.user.voiceChannel
else
vc = author.voiceChannel
_G.connection = vc:join()
message:addReaction("👍")
end
elseif args[1] == settings.Prefix .. "help" then --!help
message.channel:send {
embed = {
fields = {
{name = "These are list of commands!", value = "help = Show this thing!\nping = Ping!\njoin = Connect to VC\nplay [Youtube URL/Search] = Play music in VC\npause = Pause Music\nresume = Resume Music\nstop = Stop Music\ndisconnect = Disconnect VC\n \nPrefix for this bot is " .. settings.Prefix, inline = true},
},
title = "Commands 🤖",
color = discordia.Color.fromRGB(114, 137, 218).value,
},
reference = {
message = message,
mention = false,
}
}
end
end)
client:run("Bot " ..settings.Token)
|
require("vue/__tests__/e2eUtils")
describe('e2e: grid', function()
local = setupPuppeteer()
local columns = {'name', 'power'}
function assertTable(data)
expect():toBe(#data * #columns)
local i = 0
repeat
local j = 0
repeat
-- [ts2lua]data[i+1]下标访问可能不正确
expect():toContain(data[i+1][columns[j+1]])
j=j+1
until not(j < #columns)
i=i+1
until not(i < #data)
end
function testGrid(apiType)
local baseUrl = nil
expect():toBe(2)
expect():toBe(0)
expect():toContain('Name')
expect():toContain('Power')
expect():toBe(1)
expect():toBe(0)
expect():toBe(1)
expect():toBe(0)
expect():toBe(0)
expect():toBe(1)
expect():toBe(1)
expect():toBe(1)
expect():toBe(0)
expect():toBe(1)
expect():toBe(1)
expect():toBe(1)
expect():toBe(1)
expect():toBe(0)
expect():toBe(1)
expect():toBe(1)
expect():toBe(0)
expect():toBe(1)
end
test('classic', function()
end
, E2E_TIMEOUT)
test('composition', function()
end
, E2E_TIMEOUT)
end
)
|
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerCompile
augroup end
]])
local packer = require("packer")
packer.init({
git = {
clone_timeout = 300,
subcommands = { install = "clone --depth %i --progress" }
},
profile = { enable = true }
})
packer.startup(function(use)
-- nerd font icons
use "kyazdani42/nvim-web-devicons"
-- telescope
use "nvim-lua/plenary.nvim"
use "nvim-lua/popup.nvim"
use {
"nvim-telescope/telescope.nvim",
config = function()
require "plugins.telescope"
end
}
use { "nvim-telescope/telescope-ui-select.nvim" }
-- lsp
use {
"neovim/nvim-lspconfig",
config = function()
require "plugins.lsp.lsp-config"
end
}
use "williamboman/nvim-lsp-installer"
use {
'tami5/lspsaga.nvim',
config = function()
require "plugins.lsp.lsp-saga"
end
}
use "onsails/lspkind-nvim"
-- lsp function signature
use {
"ray-x/lsp_signature.nvim",
config = function()
cfg = {
hint_enable = false,
bind = true,
transparency = 30,
handler_opts = { border = "rounded" }
}
require"lsp_signature".setup(cfg)
end
}
use({
"jose-elias-alvarez/null-ls.nvim",
config = function()
require("plugins.lsp.null-ls")
end,
requires = { "nvim-lua/plenary.nvim" }
})
use({
"j-hui/fidget.nvim",
config = function()
require("plugins.fidget-nvim")
end
})
use("rrethy/vim-illuminate")
-- use({
-- "bkad/CamelCaseMotion",
-- config = function()
-- vim.g.camelcasemotion_key = "<leader>"
-- end
-- })
-- use "b0o/schemastore.nvim"
-- use "jose-elias-alvarez/nvim-lsp-ts-utils"
use {
"folke/trouble.nvim",
requires = { "kyazdani42/nvim-web-devicons" },
config = function()
require("trouble").setup {}
end
}
-- neo-tree
use "MunifTanjim/nui.nvim"
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
requires = {
"nvim-lua/plenary.nvim",
"kyazdani42/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim"
},
config = function()
require "plugins.neo-tree"
end
}
-- auto-completion
use {
"hrsh7th/nvim-cmp",
config = function()
require "plugins.nvim-cmp"
end
}
use({ "hrsh7th/cmp-nvim-lsp-signature-help", after = "nvim-cmp" })
use({ "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" })
use({ "hrsh7th/cmp-buffer", after = "nvim-cmp" })
use({ "hrsh7th/cmp-path", after = "nvim-cmp" })
use({ "hrsh7th/cmp-nvim-lua", after = "nvim-cmp" })
use({ "hrsh7th/cmp-cmdline", after = "nvim-cmp" })
use({ "hrsh7th/cmp-vsnip", after = "nvim-cmp" })
use({ "hrsh7th/vim-vsnip", after = "nvim-cmp" })
-- treesitter
use {
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
config = function()
require "plugins.treesitter"
end
}
-- comments
use {
"numToStr/Comment.nvim",
config = function()
require "plugins.comment"
end
}
-- todo comments
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim"
-- config = function()
-- require("todo-comments").setup {}
-- end
}
-- indent
use {
"lukas-reineke/indent-blankline.nvim",
config = function()
require("indent_blankline").setup {
filetype_exclude = {
"alpha",
"neo-tree",
"lsp-installer",
"packer",
"dashboard"
},
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = false,
use_treesitter = true
}
end
}
-- comments integration with treesitter
use { "JoosepAlviste/nvim-ts-context-commentstring", after = "nvim-treesitter" }
-- lualine
use {
"nvim-lualine/lualine.nvim",
requires = { "kyazdani42/nvim-web-devicons" },
config = function()
require "plugins.lualine"
end
}
-- bufferline (tabs)
use {
"akinsho/bufferline.nvim",
tag = "*",
config = function()
require "plugins.bufferline"
end
}
-- theme
-- use "folke/tokyonight.nvim"
-- use "rmehri01/onenord.nvim"
-- use "wadackel/vim-dogrun"
-- use "challenger-deep-theme/vim"
-- use "EdenEast/nightfox.nvim"
-- use(
-- {
-- "catppuccin/nvim",
-- as = "catppuccin",
-- config = function()
-- require("catppuccin").setup(
-- {
-- transparent_background = true,
-- term_colors = true,
-- integration = {
-- nvimtree = {
-- enabled = true,
-- transparent_panel = true
-- },
-- lsp_trouble = true
-- }
-- }
-- )
-- end
-- }
-- )
use {
's1n7ax/nvim-window-picker',
tag = 'v1.*',
config = function()
require "plugins.window-picker"
end
}
use({
"rose-pine/neovim",
config = function()
require "plugins.rose-pine"
end
})
use {
"lewis6991/gitsigns.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = function()
require "plugins.gitsigns"
end
}
use {
"norcalli/nvim-colorizer.lua",
config = function()
require("colorizer").setup({
"*",
css = { rgb_fn = true },
html = { names = false }
})
end
}
use {
"akinsho/toggleterm.nvim",
config = function()
require "plugins.toggleterm"
end
}
-- use {
-- "glepnir/dashboard-nvim",
-- config = function()
-- require "plugins.dashboard"
-- end
-- }
-- use({
-- "bennypowers/nvim-regexplainer",
-- config = function()
-- require("plugins.regexplainer")
-- end,
-- requires = { "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim" }
-- })
use {
"rcarriga/nvim-notify",
config = function()
vim.notify = require("notify")
end
}
-- tpope plugins
use { "tpope/vim-surround" } -- Change surrounding arks
use { "tpope/vim-repeat" } -- extends . repeat
-- use { "tpope/vim-dadbod" } -- db client
-- use { "kristijanhusak/vim-dadbod-ui" }
end)
|
local function filter(arr, p)
local result, j = {}, 0
for i = 1, #arr do
if p(arr[i], i, arr) then
j = j + 1
result[j] = arr[i]
end
end
return result
end
return filter
|
return require "resty.session.encoders.base16"
|
--
--
-- UTF-8 file
--
if GetLocale() ~= "itIT" then return end
local G = Grail.npc.name
local _, release, _, interface = GetBuildInfo()
release = tonumber(release)
interface = tonumber(interface)
if release >= 0 then
G[0]='Se stesso'
G[1]=ADVENTURE_JOURNAL
G[500022]='Secchio delle Caramelle'
G[500032]='Nozdormu'
G[562180]='Korven il Primigenio'
G[562295]='Mago Omnia'
G[562378]='Sacerdote Omnia'
G[563195]='Mastro Birraio delle Guardie Nere'
G[563196]='Maestro di Guerra delle Guardie Nere'
G[563197]='Fedele delle Guardie Nere'
G[563622]='Ladro Wu Kao'
G[563623]='Assassina Wu Kao'
G[563624]='Mastro Falconiere Wu Kao'
G[1181758]='Mucchio di Terra'
G[1206109]='Bacheca degli Ordini del Capoguerra'
G[1229314]='Dispositivo di Controllo Mentale dei Goblin'
G[100001307]="Programma di Raccolta dell'Oro"
G[100001357]='Mappa del Tesoro del Capitano Sanders'
G[100003082]='Teschio di Dargol'
G[100004854]='Manto Straziato dal Demone'
G[100005179]='Cuore Muschiato'
G[100008244]='Sfera di Draenetista Perfetta'
G[100008623]="Trasmettitore d'Emergenza di OOX-17/TN"
G[100008704]="Trasmettitore d'Emergenza di OOX-09/HL"
G[100008705]="Trasmettitore d'Emergenza di OOX-22/FE"
G[100009326]='Anello Sudicio'
G[100010593]='Frammento di Draenetista Imperfetto'
G[100012842]='Registro Scritto Grezzamente'
G[100016303]='Zampa di Ursangous'
G[100016304]='Testa di Shadumbra'
G[100016305]='Artiglio di Grinfiafina'
G[100016408]="Globo d'Acqua Contaminata"
G[100016782]="Globo d'Acqua Strano"
G[100017203]='Lingotto di Sulfuron'
G[100018356]='Garona: Studio sulla Furtività e sul Tradimento'
G[100018357]='Codice della Difesa'
G[100018358]="Libro di Ricette dell'Arcanista"
G[100018359]='Come Gestire la Luce'
G[100018360]='Imbrigliare le Ombre'
G[100018361]='Grande Stirpe dei Cacciatori'
G[100018362]='Sacra Lasagna: Cosa la Luce Non Vuole Farvi Sapere'
G[100018363]='Folgore del Gelo per Negati'
G[100018364]='Sogno di Smeraldo'
G[100018628]='Contratto con la Fratellanza del Torio'
G[100018706]='Maestro delle Arene'
G[100018769]='Pergamena Strappata'
G[100018987]='Lettera di Manonera'
G[100019002]='Testa di Nefarian'
G[100019016]='Contenitore della Rinascita'
G[100019018]='Lama Dormiente Benedetta dal Vento'
G[100019228]='Mazzo delle Bestie'
G[100019257]='Mazzo dei Signori della Guerra'
G[100019267]='Mazzo degli Elementali'
G[100019277]='Mazzo dei Portali'
G[100019423]='23° Biglietto della Fortuna di Sayge'
G[100019424]='24° Biglietto della Fortuna di Sayge'
G[100019443]='25° Biglietto della Fortuna di Sayge'
G[100019452]='27° Biglietto della Fortuna di Sayge'
G[100019802]='Cuore di Hakkar'
G[100020461]='Lettera Perduta di Brann Barbabronzea'
G[100020483]='Scaglia Arcana Corrotta'
G[100020644]='Oggetto Intriso di Incubi'
G[100020741]='Totem Rituale dei Legnomorto'
G[100020765]='Documenti Incriminanti'
G[100021220]="Testa di Ossirian l'Indomito"
G[100021221]="Occhio di C'Thun"
G[100021230]='Manufatto Qiraji Antico'
G[100021776]='Rotte Smarrite del Capitano Kelisendra'
G[100022597]='Collana della Dama'
G[100022727]='Corpo di Atiesh'
G[100022733]='Testa di Atiesh'
G[100023179]='Fiamma di Orgrimmar'
G[100023180]='Fiamma di Picco del Tuono'
G[100023181]='Fiamma di Sepulcra'
G[100023182]='Fiamma di Roccavento'
G[100023183]='Fiamma di Forgiardente'
G[100023184]='Fiamma di Darnassus'
G[100023228]='Pendente del Vecchio Scorzabianca'
G[100023249]="Piani d'Invasione degli Amani"
G[100023338]='Custodia di Cuoio Rovinata'
G[100023580]='Globo di Avruu'
G[100023678]='Cristallo Debolmente Luminoso'
G[100023759]='Tavoletta Piena di Rune'
G[100023777]='Piani Diabolici'
G[100023837]='Mappa del Tesoro Logorata'
G[100023850]='Dignità di Gurf'
G[100023870]='Pendaglio di Cristallo Rosso'
G[100023900]='Piastra di Armatura di Tzerak'
G[100023910]='Avviso degli Elfi del Sangue'
G[100024132]="Lettera dell'Ammiraglio"
G[100024330]='Progetti dello Scarico'
G[100024367]='Ordini da Dama Vashj'
G[100024407]='Specie Non Catalogata'
G[100024414]='Piani degli Elfi del Sangue'
G[100024483]='Basidio Avvizzito'
G[100024504]='Vento Ululante'
G[100024558]="Piani d'Invasione dei Sanguebuio"
G[100025459]='Mandibola del "Conte" Ungula'
G[100028552]='Tomo Misterioso'
G[100029233]='Lama di Dathric'
G[100029234]='Tomo di Belmara'
G[100029235]='Mantello di Luminrath'
G[100029236]='Cappello di Cohlien'
G[100029476]='Frammento di Cristallo Cremisi'
G[100029588]='Lettera della Legione Infuocata'
G[100030431]='Manufatto del Clan Spaccatuono'
G[100030579]="Frammento dell'Anatema Illidariano"
G[100031120]="Nota per l'Appuntamento"
G[100031345]="Diario di Val'zareq"
G[100031363]='Predilezione di Gorgrom'
G[100031384]='Maschera Danneggiata'
G[100031489]='Globo di Grishna'
G[100031707]='Ordini Cabalisti'
G[100031890]='Mazzo delle Benedizioni'
G[100031891]='Mazzo delle Tempeste'
G[100031907]='Mazzo delle Furie'
G[100031914]='Mazzo della Follia'
G[100032385]='Testa di Magtheridon'
G[100032405]='Sfera Verdeggiante'
G[100032523]='Almanacco di Ishaal'
G[100032621]='Mano Semidigerita'
G[100032726]="Piani d'Evasione dei Sanguebuio"
G[100033289]="Piani d'Attacco di Gjalerbron"
G[100033314]="Rotolo dell'Ascesa Vrykul"
G[100033961]='Strumento del Flagello'
G[100034090]='Scritti di Mezhen'
G[100034469]='Pezzo di Motore Bizzarro'
G[100034777]="Carapace Rinforzato di Ith'rix"
G[100034815]='Fiala di Sangue Fresco'
G[100034984]='Cacciavite Ultrasonico'
G[100035568]='Fiamma di Lunargenta'
G[100035569]='Fiamma di Exodar'
G[100035648]='Frammento Scintillante'
G[100035723]='Frammenti di Ahune'
G[100036742]='Strano Dispositivo di Goramosh'
G[100036744]='Tomo Rilegato in Pelle'
G[100036756]='Lettera del Capitano Malin'
G[100036780]="Lettera del Tenente Ta'zinni"
G[100036855]='Corno da Battaglia Decorato'
G[100036940]='Diario di Mikhail'
G[100036958]='Dono di Zangus'
G[100037163]='Mazzo dei Ladri'
G[100037164]='Mazzo delle Spade'
G[100037432]='Verga del Torturatore'
G[100037736]='Richiesta d\'Iscrizione al "Club della Birra del Mese"'
G[100037833]='Spilla di Rubino'
G[100038280]='Birra Nera di Birranera'
G[100038321]='Mojo Strano'
G[100038567]='Manifesto del Prigioniero di Maraudon'
G[100038660]='Girocollo Senza Vita'
G[100038673]='Girocollo Irrequieto'
G[100040666]='Nota dal Gran Ammiraglio'
G[100041267]="Scheda d'Accesso di SCART-O"
G[100041556]='Metallo Ricoperto di Scorie'
G[100042203]='Piastra di Armatura Oscura'
G[100042772]='"Costruisci un Gigante di Carne Migliore" del Dr. Morte'
G[100043242]='Frammento Scheggiato'
G[100043297]='Collana Danneggiata'
G[100043512]='Fungo Ricoperto di Melma'
G[100043876]='Guida alla Ricerca di Tessuti Nordici'
G[100044148]='Mazzo dei Maghi'
G[100044158]='Mazzo dei Demoni'
G[100044259]='Mazzo dei Prismi'
G[100044276]='Mazzo del Caos'
G[100044294]='Mazzo della Non Morte'
G[100044326]='Mazzo dei Nobili'
G[100044569]="Chiave dell'Iride Focalizzante"
G[100044577]="Chiave Eroica dell'Iride Focalizzante"
G[100044725]='Frammento Semprefreddo'
G[100044927]='Chiave Principale del Corruttore'
G[100044979]='Ordini del Sovrintendente'
G[100045040]='Chiave della Gabbia del Torturatore Lanciarotta'
G[100045506]="Disco dati dell'Archivum"
G[100045858]='Canna da Pesca Portafortuna di Nat'
G[100046004]='Fiala di Veleno Sigillata'
G[100046052]='Codice di Risposta Alfa'
G[100046128]='Talismano Troll'
G[100046318]='Missiva di Malogrido'
G[100046544]='Cucciolo Curioso di Volvar'
G[100046545]='Cucciolo Curioso di Oracolo'
G[100046856]='Chiavi della Razzomobile'
G[100046955]='Dente di Kraken'
G[100047039]="Ordini dell'Esploratore"
G[100048679]='Ricetta Fradicia'
G[100049010]='Orecchie delle Lame Ardenti'
G[100049200]='Nucleo Energetico Infernale'
G[100049643]='Testa di Onyxia'
G[100049676]='Piani di Battaglia dei Kvaldir'
G[100049776]='Progetti Stradali'
G[100049932]='Idolo di Cinghiale Scolpito'
G[100050320]="Biglietto d'Auguri Amoroso Sbiadito"
G[100050379]='Elsa Rovinata'
G[100051315]='Contenitore Sigillato'
G[100052079]='Lettera Scarlatta'
G[100052197]='Statuetta - Pantera Demoniaca'
G[100052843]='Pietra Runica dei Nani'
G[100053053]='Mappa del Tesoro Cenciosa'
G[100054345]='Mappa del Tesoro Spiegazzata'
G[100054614]='Perla Luminosa'
G[100054639]='Diario Fradicio'
G[100055166]='Pelle di Yeti Intatta'
G[100055167]='Pelle di Yeti Perfetta'
G[100055181]='Lettera Orchesca Illeggibile'
G[100055186]='Collana di Dama Ga-Ga'
G[100055243]="Globo dell'Inondazione"
G[100056474]='Ordini dal Campo Base'
G[100056571]='Uovo Enorme di Murena'
G[100056836]='Boccale Viola della Festa della Birra Strapieno'
G[100057102]='Chiave della Gabbia del Crepuscolo'
G[100057935]='Cuore di Guardiano Mietitore'
G[100058117]='Bandana Rossa'
G[100058491]="Mano Deturpata dei Mosh'ogg"
G[100058898]='Pergamena Sporca'
G[100059143]='Moneta Consunta'
G[100060816]='Ricerca di Maziel'
G[100060956]='Seconda Testa di Korok'
G[100061378]='Lettera della Baronessa'
G[100061505]='Testa Semidigerita'
G[100062021]='Mazzo del Vulcano'
G[100062044]='Mazzo dello Tsunami'
G[100062045]="Mazzo dell'Uragano"
G[100062046]='Mazzo del Terremoto'
G[100062056]='Documenti Falsi'
G[100062138]='Testa di Gnash'
G[100062281]='Antica Incisione Elfica'
G[100062483]='Dispositivo di Comunicazione A.I.D.A.'
G[100062768]='Scavi ad Alto Rendimento'
G[100062933]='Cuscino della Domestica Scaldaletto'
G[100063090]='Pinna di Branchialercia'
G[100063127]='Pergamena degli Alti Nobili'
G[100063128]='Tavoletta dei Troll'
G[100063250]='Battaglia per Colletorto'
G[100063686]="Piani d'Attacco dei Liscaguzza"
G[100063700]='Testa di Myzerian'
G[100064353]='Fiala di Corroborante Vuota'
G[100064397]="Geroglifico dei Tol'vir"
G[100064450]="Scritti dell'Araldo Oscuro"
G[100065894]='Statuetta - Gufo Onirico'
G[100065895]='Statuetta - Re dei Cinghiali'
G[100065896]='Statuetta - Serpente Ingioiellato'
G[100065897]='Statuetta - Custode della Terra'
G[100069854]='Medaglione Sporco di Fuliggine'
G[100071635]='Cristallo Infuso'
G[100071636]='Uovo Mostruoso'
G[100071637]='Grimorio Misterioso'
G[100071638]='Arma Decorata'
G[100071715]='Trattato sulla Strategia'
G[100071716]="Rune dell'Indovino"
G[100071951]='Stendardo del Caduto'
G[100071952]='Piastrina Depredata'
G[100071953]="Diario dell'Avventuriero Caduto"
G[100074642]='Costata di Tigre alla Griglia'
G[100074643]='Carote Trifolate'
G[100074644]='Zuppa "Nebbia Vorticante"'
G[100074645]='Pesce Primavera'
G[100074647]='Spadellata della Valle'
G[100074649]='Brasato di Tartaruga'
G[100074651]='Ravioli di Gamberetti'
G[100074652]='Salmone allo Spirito di Fuoco'
G[100074654]='Arrosto di Uccello Selvatico'
G[100074655]='Trote Gemelle in Bellavista'
G[100077957]='Promemoria Urgente del Crepuscolo'
G[100078960]='Uovo di Serpe Verde'
G[100078961]='Uovo di Serpe Gialla'
G[100078962]='Uovo di Serpe Blu'
G[100079264]='Scheggia di Rubino'
G[100079265]='Piuma Blu'
G[100079266]='Gatto di Giada'
G[100079267]='Mela Appetitosa'
G[100079268]='Giglio di Palude'
G[100079323]='Mazzo della Tigre'
G[100079326]='Mazzo della Serpe'
G[100080240]='Strana Pietra Sferica'
G[100080241]='Ricordo di Palmo Muschiato'
G[100080827]='Mappa del Tesoro Confusa'
G[100082870]='Reliquia Strana'
G[100083767]='Guscio di Krosh'
G[100083769]="Tra l'Incudine e il Saurok"
G[100083770]='Hozen nella Nebbia'
G[100083771]="Pesci Fuor d'Acqua"
G[100083772]='Il Lato Oscuro dei Mogu'
G[100083773]='La Regina dello Sciame'
G[100083774]='Per Che Cosa Vale la Pena Combattere'
G[100083777]='La Canzone degli Yaungol'
G[100083779]='I Sette Fardelli di Shaohao'
G[100083780]='La Ballata del Vecchio Lang'
G[100085477]='Moneta dei Mogu Intatta'
G[100085557]='Servizio da Tè dei Pandaren Intatto'
G[100085558]='Scacchiera Intatta'
G[100085783]='Testa del Capitano Jack'
G[100086404]='Vecchia Mappa'
G[100086425]='Campanella della Scuola di Cucina'
G[100086433]='Collana Raffinata'
G[100086434]='Tiara Raffinata'
G[100086435]='Orecchino Raffinato'
G[100086436]='Spilla Meravigliosa'
G[100086542]='Gurami Tigrato Volante'
G[100086544]='Pesce Scorpione Alfa'
G[100086545]='Polpo Mimetico'
G[100087871]='Nucleo di Kyparite Massiccio'
G[100087878]='Mandibole Enormi di Kunchong'
G[100088715]='Ceneri del Signore della Guerra Gurthan'
G[100089155]="Uovo d'Onice"
G[100089169]='Manette della Ribellione Intatte'
G[100089170]='Pietra Runica dei Mogu Intatta'
G[100089171]='Braccio di Terracotta Intatto'
G[100089172]="Frusta d'Ossa Pietrificata Intatta"
G[100089173]='Fregio del Re del Tuono Intatto'
G[100089174]='Editti del Re del Tuono Intatti'
G[100089175]='Amuleto di Ferro Intatto'
G[100089176]='Ferro per Marchiare Intatto'
G[100089178]='Servizio di Boccali Gemelli Intatto'
G[100089179]='Bastone di Bambù Intatto'
G[100089180]='Barile Vuoto Intatto'
G[100089181]='Specchio di Bronzo Lavorato Intatto'
G[100089182]="Statuetta Intarsiata d'Oro Intatta"
G[100089183]='Barattoli dello Speziale Intatti'
G[100089184]="Perla di Yu'lon Intatta"
G[100089185]='Stendardo di Niuzao Intatto'
G[100089209]='Libro Mastro del Monumento Intatto'
G[100089317]='Artiglio della Rabbia'
G[100089812]='Sistema di Irrigazione "Signora dei Jinyu"'
G[100089813]='Antiparassitario "Re del Tuono"'
G[100089814]='Super Aratro "Spezzaterra"'
G[100091819]='Stia Resistente per Gru'
G[100091821]='Trappola Resistente per Tigri'
G[100091822]='Gabbia Resistente per Granchi'
G[100092441]='Codice di Xerrath'
G[100094721]='Lingotto di Metallo Strano'
G[100095383]="Stendardo dell'Impero dei Mantid Intatto"
G[100095384]='Antico Distributore di Linfa Intatto'
G[100095385]='Mantid Religioso Intatto'
G[100095386]='Faro Sonoro Intatto'
G[100095387]='Resti di un Eletto Intatti'
G[100095388]='Lampada dei Mantid Intatta'
G[100095389]='Collettore di Polline Intatto'
G[100095390]='Contenitore di Linfa dei Kypari Intatto'
G[100097979]="L'Orso e la Fanciulla"
G[100097982]='Fiala di Melma Rossastra'
G[100097985]='Vecchio Robot Impolverato'
G[100097986]='Ultrapala Scavaterra'
G[100097988]='Sasso Avvolto nella Carta'
G[100102225]='Indovinello di Rolo'
G[100104257]='Uovo Intatto di Serpe di Fuoco'
G[100104264]='Coscia di Gru Carnosa'
G[100104265]='Carne di Tartaruga Maestosa'
G[100104266]='Costato Pesante di Yak'
G[100104267]='Cosciotto di Tigre Carnoso'
G[100109121]='Rotolo di Corda Resistente'
G[100109258]="Bottega d'Ingegneria, Livello 1"
G[100111812]='Laboratorio Alchemico, Livello 1'
G[100111813]='Forgia, Livello 1'
G[100111814]="Boutique d'Oreficeria, Livello 1"
G[100111815]='Ateneo di Runografia, Livello 1'
G[100111816]='Atelier di Sartoria, Livello 1'
G[100111817]="Studio d'Incantamento, Livello 1"
G[100111818]='Conceria, Livello 1'
G[100112378]='Baccello Rosso Luminoso'
G[100113080]='Nucleo Fuso'
G[100113103]='Fiasca Misteriosa'
G[100113107]='Freccia di Guardaselve'
G[100113109]='Ascia dei Lupi Bianchi'
G[100113448]='Pezzo del Signore del Cratere'
G[100113453]='Fungo Prezioso'
G[100113461]='Scaglia Scintillante'
G[100114037]='Cristallo Elementale'
G[100114054]='Chiave di Ditodorato'
G[100114877]='Annotazione Sporca'
G[100114965]='Martello da Forgiatore Rotto'
G[100114972]='Tomo Criptico di Sartoria'
G[100114973]='Kit di Sartoria dei Lupi Bianchi'
G[100114984]='Borsa Misteriosa'
G[100115008]='Bracciali Incantati degli Altomaglio'
G[100115278]='Segnalatore di Posizione Gnomesco'
G[100115287]='Pendente Cremisi Intricato'
G[100115343]='Borsa di Efesto'
G[100115467]='Tomo di Pelledura'
G[100115507]='Frammento di Cristallo Prosciugato'
G[100115593]='Note Illeggibili Sporche di Fuliggine'
G[100116120]='Pasto Delizioso di Talador'
G[100116159]='Tentacolo Verde Irrequieto'
G[100116173]='Manto Sgualcito dei Lupi Bianchi'
G[100116438]='Fucile Scoppiato'
G[100119208]='Arcanum del Profeta'
G[100119317]='Strana Escrescenza'
G[100122224]='Audioscheda: Montagne'
G[100122226]='Audioscheda: Magia'
G[100122239]='Audioscheda: Isola di Shalandis'
G[100122399]="Lettera dell'Esploratore: Magnarok"
G[100122401]="Lettera dell'Esploratore: Rupi di Rocciafurente"
G[100122404]="Lettera dell'Esploratore: Giungla di Verdeterno"
G[100122406]="Lettera dell'Esploratore: Officina Bellica di Ferro"
G[100122407]="Lettera dell'Esploratore: Skettis"
G[100122409]="Lettera dell'Esploratore: Pilastri del Fato"
G[100122412]="Lettera dell'Esploratore: Porto di Shattrath"
G[100122414]="Lettera dell'Esploratore: Vol Anzu Perduta"
G[100122415]="Lettera dell'Esploratore: Altura di Socrethar"
G[100122417]="Lettera dell'Esploratore: Covo dei Foscamarea"
G[100122420]="Lettera dell'Esploratore: Area d'Addestramento dei Gorian"
G[100122422]="Lettera dell'Esploratore: Posto di Guardia dei Mok'gol"
G[100122423]="Lettera dell'Esploratore: Precipizio Infranto"
G[100126950]='Progetto: Pompa di Sentina'
G[100127989]='Manifesto Bagnato'
G[100128231]='Progetto: Squali Addestrati'
G[100128232]='Progetto: Antinebbia Abbaglianti'
G[100128250]='Progetto: Scudo Antiaffondamento'
G[100128252]='Progetto: Timone in Puroferro'
G[100128255]='Progetto: Rompighiaccio'
G[100128256]='Progetto: Stabilizzatore Giroscopico'
G[100128257]='Progetto: Cannocchiale Spettrale'
G[100128258]='Progetto: Spargifumo Vile'
G[100128491]='Progetto: Rete da Pesca dei Tuskarr'
G[100129747]='Fiala Turbinante Fuoritempo'
G[100129928]='Prisma Gelido Fuoritempo'
G[100133377]='Brace Ardente Fuoritempo'
end
-- End of localized NPC names
|
-- // Variables
local FileSystem = { Name = "FileSystem" }
-- // Methods
function FileSystem:Require(Module, ...)
local Module = require(Module)
local ModuleType = type(Module)
if ModuleType == "function" then
Module(FileSystem.Infinity, ...)
end
end
function FileSystem:LoadTable(Table, ...)
for _, Object in ipairs(Table) do
if Object.ClassName == "ModuleScript" then
task.spawn(self.Require, self, Object, ...)
end
end
end
function FileSystem:LoadModules(Parent, ...)
local Children = Parent:GetChildren()
self:LoadTable(Children, ...)
end
return function(Infinity)
FileSystem.Infinity = Infinity
return FileSystem
end
|
local Root = script:FindFirstAncestor('MazeGeneratorPlugin')
local Plugin = Root.Plugin
local Roact = require(Root:WaitForChild('Roact'))
local Config = require(Plugin.Config)
local Version = require(Plugin.Version)
local Assets = require(Plugin.Assets)
local Theme = require(Plugin.Components.Theme)
local url = 'https://www.roblox.com/games/3376915546/Maze-World'
local gameId = '3376915546'
local e = Roact.createElement
local Footer = Roact.Component:extend('Footer')
function Footer:init()
self.footerSize, self.setFooterSize = Roact.createBinding(Vector2.new())
self.footerVersionSize, self.setFooterVersionSize = Roact.createBinding(Vector2.new())
end
function Footer:render()
return Theme.with(function(theme)
return e(
'Frame',
{
LayoutOrder = 3,
Size = UDim2.new(1, 0, 0, 32),
BackgroundColor3 = theme.Background2,
BorderSizePixel = 0,
ZIndex = 2,
},
{
Padding = e('UIPadding', {
PaddingTop = UDim.new(0, 4),
PaddingBottom = UDim.new(0, 4),
PaddingLeft = UDim.new(0, 8),
PaddingRight = UDim.new(0, 8),
}),
LogoContainer = e(
'Frame',
{
BackgroundTransparency = 1,
Size = UDim2.new(0, 0, 0, 32),
},
{ Logo = e('ImageButton', {
Image = Assets.Images.Logo,
Size = UDim2.new(0, 120, 0, 40),
ScaleType = Enum.ScaleType.Fit,
BackgroundTransparency = 1,
Position = UDim2.new(0, 0, 1, 0),
AnchorPoint = Vector2.new(0, 1),
}) }
),
Link = e('TextLabel', {
Position = UDim2.new(0.4, 0, 0, 0),
Size = UDim2.new(0, 100, 1, 0),
AnchorPoint = Vector2.new(0, 0),
Font = theme.TitleFont,
TextSize = 14,
Text = 'Game id: ' .. gameId,
TextXAlignment = Enum.TextXAlignment.Right,
TextColor3 = theme.Text2,
BackgroundTransparency = 1,
}),
Version = e('TextLabel', {
Position = UDim2.new(1, 0, 0, 0),
Size = UDim2.new(0, 0, 1, 0),
AnchorPoint = Vector2.new(1, 0),
Font = theme.TitleFont,
TextSize = 18,
Text = Version.display(Config.version),
TextXAlignment = Enum.TextXAlignment.Right,
TextColor3 = theme.Text2,
BackgroundTransparency = 1,
[Roact.Change.AbsoluteSize] = function(rbx)
self.setFooterVersionSize(rbx.AbsoluteSize)
end,
}),
}
)
end)
end
return Footer
|
include( "shared.lua" )
ENT.RenderGroup = RENDERGROUP_BOTH
function ENT:Draw()
self.Entity:DrawModel()
end
function ENT:DrawTranslucent()
self:Draw()
end
net.Receive("STALKERNPCRagdoll",function()
local TEMP_ENT = net.ReadEntity()
if(IsValid(TEMP_ENT)&&TEMP_ENT!=nil&&TEMP_ENT!=NULL) then
local Doll = TEMP_ENT:BecomeRagdollOnClient()
Doll:SetMaterial("")
Doll:SetColor(Color(255,255,255,255))
Doll:RemoveAllDecals()
Doll:DrawShadow(true)
end
end)
|
local S = {}
local function splitNice(pos,dims,sections)
local m = sections
local bins = {1,1,1}
local p = 2
while m > 1 do
for i = 1,3,1 do
while m % p == 0 and dims[i] % p == 0 do
bins[i] = p * bins[i]
m = m / p
dims[i] = dims[i] / p
end
end
p = p + 1
end
t1 = {}
for i = 1,bins[1],1
do
for j = 1,bins[2],1
do
for k = 1,bins[3],1
do
xPos = pos[1] + (i-1)*dims[1]
yPos = pos[2] + (j-1)*dims[2]
zPos = pos[3] + (k-1)*dims[3]
table.insert(t1,{{xPos,yPos,zPos},dims})
end
end
end
return t1
end
local function findSplit(maxDim,remain,sections)
local ratio = sections/maxDim
for n = maxDim,1,-1
do
local m = math.floor(ratio * n)
for j = 0,1,1
do
m2 = m-j
if m2 ~= 0 and n*remain[1]*remain[2]%m2 == 0
then
return n, m2
end
m2 = m + j
if m2 ~= 0 and n*remain[1]*remain[2]%m2 == 0
then
return n, m2
end
end
end
end
function splitVol(pos,dims,sections)
-- print(pos[1],pos[2],pos[3])
for n = 1,#dims,1
do
if dims[n] == 0 then return {} end
end
local maxDim = math.max(dims[1],dims[2],dims[3])
local remain = {dims[1],dims[2],dims[3]}
for m = 1,#dims,1
do
if remain[m] == maxDim
then
table.remove(remain,m)
break
end
end
-- print(sections)
local bad = false
local splitPoint, sections1 = findSplit(maxDim,remain,sections)
-- print(splitPoint, sections1)
if splitPoint == nil
then
splitPoint = math.ceil(maxDim/2)
sections1 = math.floor(sections/2)
bad = true
-- print("This is bad.")
-- return
end
-- print(sections,sections1)
-- print(pos[1],pos[2],pos[3])
local dimz1 = {dims[1],dims[2],dims[3]}
local dimz2 = {dims[1],dims[2],dims[3]}
local pos2 = {pos[1],pos[2],pos[3]}
for m = 1,#dims,1
do
if dims[m] == maxDim
then
dimz1[m] = splitPoint
dimz2[m] = dims[m]-splitPoint
pos2[m] = pos[m]+splitPoint
end
end
local t1 = {}
if bad == true
then
t1 = splitVol(pos,dimz1,sections1)
else
t1 = splitNice(pos,dimz1,sections1)
end
local t2 = splitVol(pos2,dimz2,sections-sections1)
local lenT1 = #t1
for n = 1,#t2,1
do
t1[lenT1+n] = t2[n]
end
return t1
end
-- local dims = {3450,262,5253}
-- local jobs = splitVol({0,0,0},dims,60)
--
-- print(#jobs)
--
--
-- local runningVol = 0
-- for k = 1,#jobs,1
-- do
-- print("job: " .. k)
-- print("Position:",jobs[k][1][1],jobs[k][1][2],jobs[k][1][3])
-- print("Dimensions:",jobs[k][2][1],jobs[k][2][2],jobs[k][2][3])
-- print("Volume: " .. jobs[k][2][1]*jobs[k][2][2]*jobs[k][2][3])
-- runningVol = runningVol+jobs[k][2][1]*jobs[k][2][2]*jobs[k][2][3]
-- end
--
-- print("Total volume: "..dims[1]*dims[2]*dims[3])
-- print("Running volume: "..runningVol)
-- print("Discrepency: "..dims[1]*dims[2]*dims[3]-runningVol)
return S
|
return {
name = "user-roles-join",
description = "Gives back user group roles when they rejoin.",
run = function(self, guildSettings, member, conn)
if not guildSettings.group_channel_id then return end
if not guildSettings.give_back_roles then
conn:exec("DELETE FROM user_roles WHERE guild_id = '"..member.guild.id.."' AND user_id = '"..member.id.."';")
return
end
local rows, nrow = conn:exec([[
SELECT groups.role_id AS role_id
FROM groups
JOIN user_roles ON groups.guild_id = user_roles.guild_id AND groups.role_id = user_roles.role_id
WHERE user_roles.user_id = ']]..member.id..[[' AND groups.guild_id = ']]..member.guild.id..[[';
]], "k")
if not rows then return end
conn:exec("UPDATE user_roles SET user_in_guild = 1 WHERE guild_id = '"..member.guild.id.."' AND user_id = '"..member.id.."';")
for row = 1, nrow do
member:addRole(rows.role_id[row])
end
end
}
|
print(vim.inspect({{_cursor_}}))
|
local Player = game:GetService("Players").LocalPlayer
local common = game:GetService("ReplicatedStorage"):WaitForChild("common")
local Packages = common:WaitForChild("Packages")
local Knit = require(Packages:WaitForChild("knit"))
Knit.OnStart():await()
local StandController = Knit.GetController("StandController")
function InitStand()
StandController.Start("Default") -- TODO: Add interface to set stand
end
if Player.Character then
InitStand()
end
Player.CharacterAdded:Connect(InitStand)
|
-- Copyright 2004-present Facebook. All Rights Reserved.
-- TemporalKmaxPooling
-- Input : (bsize x) width x height
-- Output : (bisze x) k_out x height
-- with k_out = max(k_out_prop, inputSeqLen)
-- where k_out_prop = max(k, ceil(k_dynamic*inputSeqLen))
require 'cutorch'
require 'nn'
local TemporalKMaxPooling, parent =
torch.class('nn.TemporalKMaxPooling', 'nn.Module')
function TemporalKMaxPooling:__init(k, k_dynamic)
parent.__init(self)
self.k = k
if k_dynamic then
assert(k_dynamic <= 1 and k_dynamic >=0,
'k_dynamic must be between 0 and 1')
end
self.k_dynamic = k_dynamic or -1
-- k_dynamic is an optional scalar parameter between 0 and 1
-- that makes k a fraction of the input sequence size.
-- To follow Kalchbrenner et al's architecture on Dynamic k-Max Pooling:
-- Use (k = k_top, kDynamic = (L - l)/L), with
-- L : total number of conv layers,
-- l : current convolutional layer to which the pooling is applied,
-- k_top : fixed pooling parameter for the topmost convolutional layer.
self.output = torch.CudaTensor()
self.gradInput = torch.CudaTensor()
self.indices = torch.CudaTensor()
end
function TemporalKMaxPooling:updateOutput(input)
input = input:contiguous()
input.nn.TemporalKMaxPooling_updateOutput(self, input)
return self.output
end
function TemporalKMaxPooling:updateGradInput(input, gradOutput)
input = input:contiguous()
gradOutput = gradOutput:contiguous()
input.nn.TemporalKMaxPooling_updateGradInput(self, input, gradOutput)
return self.gradInput
end
|
local skynet = require "skynet"
local cluster = require "cluster"
skynet.start(function()
local proxy = cluster.proxy "db@sdb" -- cluster.proxy("db", "@sdb")
local largekey = string.rep("X", 128*1024)
local largevalue = string.rep("R", 100 * 1024)
skynet.call(proxy, "lua", "SET", largekey, largevalue)
local v = skynet.call(proxy, "lua", "GET", largekey)
assert(largevalue == v)
skynet.fork(function()
skynet.trace("cluster")
print(cluster.call("db", "@sdb", "GET", "a"))
print(cluster.call("db2", "@sdb", "GET", "b"))
cluster.send("db2", "@sdb", "PING", "db2:longstring" .. largevalue)
end)
-- test snax service
skynet.timeout(300,function()
cluster.reload {
db = false, -- db is down
db3 = "127.0.0.1:2529"
}
print(pcall(cluster.call, "db", "@sdb", "GET", "a")) -- db is down
end)
cluster.reload { __nowaiting = false }
local pingserver = cluster.snax("db3", "pingserver")
print(pingserver.req.ping "hello")
end)
|
--[[
Sample plugin file for highlight 3.45
]]
Description="Inserts a section into each LaTeX output file to concatenate the results later"
Categories = {"latex" }
function formatUpdate(desc)
function DocumentHeader(numFiles, currFile, options)
if (HL_OUTPUT == HL_FORMAT_LATEX and numFiles > 1) then
title=string.gsub(options.title,"_","\\textunderscore ")
return "\\section{"..title.."}\n", currFile == 1
end
end
function DocumentFooter(numFiles, currFile, options)
if (HL_OUTPUT == HL_FORMAT_LATEX and numFiles > 1 ) then
return "", currFile==numFiles
end
end
end
Plugins={
{ Type="format", Chunk=formatUpdate }
}
|
--[[
- SKYNET SIMPLE ( https://github.com/viticm/skynet-simple )
- $Id login.lua
- @link https://github.com/viticm/skynet-simple for the canonical source repository
- @copyright Copyright (c) 2020 viticm( [email protected] )
- @license
- @user viticm( [email protected] )
- @date 2020/08/31 19:49
- @uses The robot login action mod.
--]]
local skynet = require 'skynet'
local client = require 'robot.client'
local log = require 'log'
local action = require 'robot.action'
-- Data.
-------------------------------------------------------------------------------
local _CH = client.handler
local _ARH = action.run_handler
local _NET = action.no_enter_t
-- Local functions.
-------------------------------------------------------------------------------
-- Run handlers.
-------------------------------------------------------------------------------
_NET.auto_login = true
-- Auto login action.
function _ARH:auto_login(cfg, args)
_ARH.discon(self, cfg, {})
if not args.logined then
args.logined = self:login_account()
else
args.ended = self:login_game()
end
end
_NET.discon = true
-- Disconnect.
function _ARH:discon(cfg, args)
args.ended = true
if self.fd then
self:close()
end
self.entered = nil
skynet.sleep(20)
end
-- Message.
-------------------------------------------------------------------------------
-- Role list.
function _CH:roles(msg)
self.roles = msg.list
log:dump(msg.list, 'self.roles======================')
end
|
local world = require "src.world"
local lume = require "lib.lume"
local lang = require "lan"
return {
init = function (self)
world.currentLevel = world:addLevel()
world:square(-40, -20, 44, 54)
world:square(5, 10, 15, 14)
world:square(21, 0, 30, 24)
world:square(52, 6, 50, 24)
world:addEntity("player", { y = -30, x = 50 })
world:addEntity("boombox", { x = 360, y = -10 })
world:addEntity("doggo", { x = 200, y = -10 })
world:addEntity("npc", { x = 480, y = 30, sprite = world.sprite("flowa", 0, 0, 1, 1), script = require("scr.000_mrflower") })
world:addEntity("npc", { x = -200, y = -200, sprite = world.sprite("player0", 0, 0, 1, 1), script = require("scr.000_clonegoat")})
world:addEntity("npc", { x = 770, y = 30, sprite = world.sprite("angeldeer", 0, 0, 1, 1),
collider = world.collider(30, 28, COLLIDER_TYPE_NPC), script = require("scr.000_deertransport")
})
--world:addEntity("screw", {
-- x = 824, y = 48
--})
world.currentLevel.enableStars = true
world.currentLevel.enableParticles = true
end,
mousepressed = function(self, x, y, btn)
world:mousepressed(x, y, btn)
end,
mousereleased = function(self, x, y, btn)
world:mousereleased(x, y, btn)
end,
loop = function (self, delta)
world:loop(delta)
end,
resize = function(self, w, h)
world:resize(w, h)
end,
draw = function (self)
world:draw()
self.__debugInfo = world.__debugInfo
end
}
|
workspace "Havtorn"
architecture "x86_64"
location "Source"
configurations
{ "Debug", "Release" }
startproject "Launcher"
outputdir = "%{cfg.buildcfg}_%{cfg.system}_%{cfg.architecture}"
engineProj = "Engine"
engineSource = "Source/" .. engineProj .. "/"
editorProj = "Editor"
editorSource = "Source/" .. editorProj .. "/"
project "Engine"
location ("Source/" .. engineProj)
kind "SharedLib"
language "C++"
cppdialect "C++20"
architecture "x86_64"
targetname "%{prj.name}_%{cfg.buildcfg}"
targetdir ("Bin/" .. outputdir .. "/%{prj.name}")
objdir ("Temp/" .. outputdir .. "/%{prj.name}")
warnings "Extra"
flags { "FatalWarnings", "ShadowedVariables", "MultiProcessorCompile" }
pchheader "hvpch.h"
pchsource ("Source/" .. engineProj .. "/hvpch.cpp")
forceincludes { "hvpch.h" }
files
{
"Source/%{prj.name}/**.h",
"Source/%{prj.name}/**.cpp",
vpaths
{
["*"] = "Source/"
}
}
includedirs
{
"Source/%{prj.name}",
"External",
"External/FastNoise2/include",
"External/rapidjson",
"External/imgui",
"External/DirectXTex"
}
libdirs
{
"Lib/",
"External/Lib"
}
floatingpoint "Fast"
debugdir "Bin/"
-- Begin Shader stuff
filter{} -- Clear filter
shaderSource = engineSource .. "Graphics/Shaders/"
shaderTarget = "$(SolutionDir)../Bin/Shaders/"
shadermodel("5.0")
-- Warnings as errors
shaderoptions({"/WX"})
shaderobjectfileoutput(shaderTarget .. "%%(Filename).cso")
files
{
shaderSource .. "*.hlsl",
shaderSource .. "Includes/*.hlsli",
}
filter("files:**_PS.hlsl")
removeflags("ExcludeFromBuild")
shadertype("Pixel")
filter("files:**_VS.hlsl")
removeflags("ExcludeFromBuild")
shadertype("Vertex")
filter{} -- Clear filter
-- End Shader Stuff
filter "system:Windows"
staticruntime "On"
systemversion "latest"
vectorextensions "SSE4.1"
defines
{
"HV_PLATFORM_WINDOWS",
"HV_BUILD_DLL"
}
prebuildcommands
{
"{MKDIR} ../../Bin/",
"{MKDIR} ../../Bin/Shaders/"
}
postbuildcommands
{
"{COPY} %{cfg.buildtarget.relpath} ../../Bin/"
}
filter "configurations:Debug"
defines "HV_DEBUG"
buildoptions "/MDd"
staticruntime "off"
runtime "Debug"
symbols "On"
defines
{
"HV_ENABLE_ASSERTS"
}
filter "configurations:Release"
defines "HV_RELEASE"
buildoptions "/MD"
staticruntime "off"
runtime "Release"
optimize "On"
flags { "LinkTimeOptimization" }
project "Editor"
location ("Source/" .. editorProj)
kind "SharedLib"
language "C++"
cppdialect "C++20"
architecture "x86_64"
targetname "%{prj.name}_%{cfg.buildcfg}"
targetdir ("Bin/" .. outputdir .. "/%{prj.name}")
objdir ("Temp/" .. outputdir .. "/%{prj.name}")
warnings "Extra"
flags { "FatalWarnings", "ShadowedVariables", "MultiProcessorCompile" }
--pchheader "hvpch.h"
--pchsource ("Source/" .. editorProj .. "/hvpch.cpp")
--forceincludes { "hvpch.h" }
files
{
"Source/%{prj.name}/**.h",
"Source/%{prj.name}/**.cpp",
vpaths
{
["*"] = "Source/"
}
}
includedirs
{
"Source/%{prj.name}",
"External/rapidjson",
"External/imgui",
"Source/Engine"
}
links
{
"Engine"
}
libdirs { }
floatingpoint "Fast"
debugdir "Bin/"
filter "system:Windows"
staticruntime "On"
systemversion "latest"
vectorextensions "SSE4.1"
defines
{
"HV_PLATFORM_WINDOWS",
"HV_BUILD_DLL"
}
postbuildcommands
{
"{COPY} %{cfg.buildtarget.relpath} ../../Bin/"
}
filter "configurations:Debug"
defines "HV_DEBUG"
buildoptions "/MDd"
staticruntime "off"
runtime "Debug"
symbols "On"
defines
{
"HV_ENABLE_ASSERTS"
}
filter "configurations:Release"
defines "HV_RELEASE"
buildoptions "/MD"
staticruntime "off"
runtime "Release"
optimize "On"
flags { "LinkTimeOptimization" }
project "Launcher"
location "Source/Launcher"
kind "WindowedApp"
language "C++"
cppdialect "C++20"
architecture "x86_64"
targetname "%{prj.name}_%{cfg.buildcfg}"
targetdir ("Bin/" .. outputdir .. "/%{prj.name}")
objdir ("Temp/" .. outputdir .. "/%{prj.name}")
warnings "Extra"
flags { "FatalWarnings", "ShadowedVariables", "MultiProcessorCompile" }
files
{
"Source/%{prj.name}/**.h",
"Source/%{prj.name}/**.cpp",
vpaths
{
["*"] = "Source/"
}
}
includedirs
{
"Source/%{prj.name}",
"Source/Editor",
"Source/Engine"
}
links
{
"Editor",
"Engine"
}
floatingpoint "Fast"
debugdir "Bin/"
filter "system:Windows"
staticruntime "On"
systemversion "latest"
vectorextensions "SSE4.1"
defines
{
"HV_PLATFORM_WINDOWS"
}
postbuildcommands
{
"{MKDIR} ../../Bin/",
"{COPY} %{cfg.buildtarget.relpath} ../../Bin/"
}
filter "configurations:Debug"
defines "HV_DEBUG"
buildoptions "/MDd"
staticruntime "off"
runtime "Debug"
symbols "On"
defines
{
"HV_ENABLE_ASSERTS"
}
filter "configurations:Release"
defines "HV_RELEASE"
buildoptions "/MD"
staticruntime "off"
runtime "Release"
optimize "On"
flags { "LinkTimeOptimization" }
|
//________________________________
//
// NS2 CustomEntitesMod
// Made by JimWest 2012
//
//________________________________
// at this point, all entities are loaded, so best way to search others (for train)
// only for server
if Server then
local overrideInitializePathing = InitializePathing
function InitializePathing()
overrideInitializePathing()
FindTrainEntities()
end
end
function FindTrainEntities()
local trainEntities = GetEntitiesWithMixin("Train")
for i, trainEntity in ipairs(trainEntities) do
trainEntity:CreatePath()
end
end
|
--[[panelData = {
type = "panel",
name = "Window Title", -- or string id or function returning a string
displayName = "My Longer Window Title", -- or string id or function returning a string (optional) (can be useful for long addon names or if you want to colorize it)
author = "Seerah", -- or string id or function returning a string (optional)
version = "2.0", -- or string id or function returning a string (optional)
website = "http://www.esoui.com/downloads/info7-LibAddonMenu.html", -- URL of website where the addon can be updated or function (optional)
feedback = "https://www.esoui.com/portal.php?uid=5815", -- URL of website where feedback/feature requests/bugs can be reported for the addon or function (optional)
translation = "https://www.esoui.com/portal.php?uid=5815", -- URL of website where translation texts of the addon can be helped with or function (optional)
donation = "http://www.esoui.com/downloads/info7-LibAddonMenu.html", -- URL of website where a donation for the addon author can be raised or function (optional)
keywords = "settings", -- additional keywords for search filter (it looks for matches in name..keywords..author) (optional)
slashCommand = "/myaddon", -- will register a keybind to open to this panel (don't forget to include the slash!) (optional)
registerForRefresh = true, -- boolean will refresh all options controls when a setting is changed and when the panel is shown (optional)
registerForDefaults = true, -- boolean will set all options controls back to default values (optional)
resetFunc = function() print("defaults reset") end, -- custom function to run after settings are reset to defaults (optional)
} ]]
local widgetVersion = 15
local LAM = LibAddonMenu2
if not LAM:RegisterWidget("panel", widgetVersion) then return end
local wm = WINDOW_MANAGER
local cm = CALLBACK_MANAGER
local function RefreshPanel(control)
local panel = LAM.util.GetTopPanel(control) --callback can be fired by a single control, by the panel showing or by a nested submenu
if LAM.currentAddonPanel ~= panel or not LAM.currentPanelOpened then return end -- we refresh it later when the panel is opened
local panelControls = panel.controlsToRefresh
for i = 1, #panelControls do
local updateControl = panelControls[i]
if updateControl ~= control and updateControl.UpdateValue then
updateControl:UpdateValue()
end
if updateControl.UpdateDisabled then
updateControl:UpdateDisabled()
end
if updateControl.UpdateWarning then
updateControl:UpdateWarning()
end
end
end
local function ForceDefaults(panel)
local panelControls = panel.controlsToRefresh
for i = 1, #panelControls do
local updateControl = panelControls[i]
if updateControl.UpdateValue and updateControl.data.default ~= nil then
updateControl:UpdateValue(true)
end
end
if panel.data.resetFunc then
panel.data.resetFunc()
end
cm:FireCallbacks("LAM-RefreshPanel", panel)
end
local callbackRegistered = false
LAMCreateControl.scrollCount = LAMCreateControl.scrollCount or 1
local SEPARATOR = " - "
local COLORED_SEPARATOR = ZO_WHITE:Colorize(SEPARATOR)
local LINK_COLOR = ZO_ColorDef:New("5959D5")
local LINK_MOUSE_OVER_COLOR = ZO_ColorDef:New("B8B8D3")
local LINK_COLOR_DONATE = ZO_ColorDef:New("FFD700") -- golden
local LINK_MOUSE_OVER_COLOR_DONATE = ZO_ColorDef:New("FFF6CC")
local function CreateButtonControl(control, label, clickAction, relativeTo)
local button = wm:CreateControl(nil, control, CT_BUTTON)
button:SetClickSound("Click")
button:SetFont(LAM.util.L["PANEL_INFO_FONT"])
button:SetNormalFontColor(LINK_COLOR:UnpackRGBA())
button:SetMouseOverFontColor(LINK_MOUSE_OVER_COLOR:UnpackRGBA())
local OnClicked
local actionType = type(clickAction)
if actionType == "string" then
OnClicked = function() RequestOpenUnsafeURL(clickAction) end
elseif actionType == "function" then
OnClicked = clickAction
end
button:SetHandler("OnClicked", OnClicked)
if relativeTo then
button:SetAnchor(TOPLEFT, relativeTo, TOPRIGHT, 0, 0)
button:SetText(COLORED_SEPARATOR .. label)
else
button:SetAnchor(TOPLEFT, control.label, BOTTOMLEFT, 0, -2)
button:SetText(label)
end
button:SetDimensions(button:GetLabelControl():GetTextDimensions())
return button
end
function LAMCreateControl.panel(parent, panelData, controlName)
local control = wm:CreateControl(controlName, parent, CT_CONTROL)
control.label = wm:CreateControlFromVirtual(nil, control, "ZO_Options_SectionTitleLabel")
local label = control.label
label:SetAnchor(TOPLEFT, control, TOPLEFT, 0, 4)
label:SetText(LAM.util.GetStringFromValue(panelData.displayName or panelData.name))
local previousInfoControl
if panelData.author or panelData.version then
control.info = wm:CreateControl(nil, control, CT_LABEL)
local info = control.info
info:SetFont(LAM.util.L["PANEL_INFO_FONT"])
info:SetAnchor(TOPLEFT, label, BOTTOMLEFT, 0, -2)
local output = {}
if panelData.author then
output[#output + 1] = zo_strformat(LAM.util.L["AUTHOR"], LAM.util.GetStringFromValue(panelData.author))
end
if panelData.version then
output[#output + 1] = zo_strformat(LAM.util.L["VERSION"], LAM.util.GetStringFromValue(panelData.version))
end
info:SetText(table.concat(output, SEPARATOR))
previousInfoControl = info
end
if panelData.website then
control.website = CreateButtonControl(control, LAM.util.L["WEBSITE"], panelData.website, previousInfoControl)
previousInfoControl = control.website
end
if panelData.feedback then
control.feedback = CreateButtonControl(control, LAM.util.L["FEEDBACK"], panelData.feedback, previousInfoControl)
previousInfoControl = control.feedback
end
if panelData.translation then
control.translation = CreateButtonControl(control, LAM.util.L["TRANSLATION"], panelData.translation, previousInfoControl)
previousInfoControl = control.translation
end
if panelData.donation then
control.donation = CreateButtonControl(control, LAM.util.L["DONATION"], panelData.donation, previousInfoControl)
local donation = control.donation
previousInfoControl = donation
donation:SetNormalFontColor(LINK_COLOR_DONATE:UnpackRGBA())
donation:SetMouseOverFontColor(LINK_MOUSE_OVER_COLOR_DONATE:UnpackRGBA())
end
control.container = wm:CreateControlFromVirtual("LAMAddonPanelContainer"..LAMCreateControl.scrollCount, control, "ZO_ScrollContainer")
LAMCreateControl.scrollCount = LAMCreateControl.scrollCount + 1
local container = control.container
container:SetAnchor(TOPLEFT, control.info or label, BOTTOMLEFT, 0, 20)
container:SetAnchor(BOTTOMRIGHT, control, BOTTOMRIGHT, -3, -3)
control.scroll = GetControl(control.container, "ScrollChild")
control.scroll:SetResizeToFitPadding(0, 20)
if panelData.registerForRefresh and not callbackRegistered then --don't want to register our callback more than once
cm:RegisterCallback("LAM-RefreshPanel", RefreshPanel)
callbackRegistered = true
end
control.ForceDefaults = ForceDefaults
control.RefreshPanel = LAM.util.RequestRefreshIfNeeded
control.data = panelData
control.controlsToRefresh = {}
return control
end
|
return {'mep','meppen','mepper','meppel','meppelaar','meppelder','meppeler','meppels','meppelink','mepschen','meppers','mept','mepte','mepten','meppende','meppelse'}
|
local _widget = require( "widget" )
local M =
{
_options = {},
_widgetName = "widget.newPickerList",
}
local function initPickerList( pickerList, options )
local opt = options
local function onCancel(event)
pickerList:cancel()
return true;
end
local function onSelect(event)
pickerList:closeUp()
if pickerList._onSelect then
pickerList._onSelect(event)
end
return true;
end
local function onTouch(event)
if "began" == event.phase then
display.getCurrentStage():setFocus(view);
if pickerList.cancelOnBackgroundClick then
onCancel(event)
else
onSelect(event)
end
elseif ( "ended" == phase or "off" == phase or "cancelled" == phase ) then
--release focus
display.getCurrentStage():setFocus(nil);
end
return true;
end
local function onScroll(event)
if pickerList._onScroll then
local values = pickerList.pickerWheel:getValues();
event.values = values
pickerList._onScroll(event)
end
end
local view = display:newGroup();
pickerList._view = view;
view.top = opt.top
local rect = display.newRect( view, opt.left + opt.width / 2, opt.top + opt.height / 2, opt.width, opt.height);
rect:setFillColor (unpack(opt.backgroundColor))
pickerList.editField = opt.editField;
if pickerList.editField then
pickerList._initialValue = pickerList.editField:getText();
end
pickerList._onSelect = opt.onSelectData;
view:insert(rect);
rect.isHitTestable = true;
rect:addEventListener("touch", onTouch)
local toolbar = display.newRect( view, opt.toolbarWidth / 2,opt.top+opt.toolbarTop + opt.toolbarHeight / 2, opt.toolbarWidth, opt.toolbarHeight);
toolbar:setFillColor (unpack(opt.toolbarColor))
local cancelButton = _widget.newButton(
{label = opt.cancelLabel,
x = opt.buttonsMargin + opt.buttonsWidth / 2,
y = opt.top+opt.toolbarTop + opt.toolbarHeight / 2,
width = opt.buttonsWidth,
onRelease = onCancel
}
)
view:insert(cancelButton)
local doneButton = _widget.newButton(
{label = opt.doneLabel,
x = opt.toolbarWidth - opt.buttonsMargin - opt.buttonsWidth / 2,
y = opt.top+opt.toolbarTop + opt.toolbarHeight / 2,
width = opt.buttonsWidth,
onRelease = onSelect
}
)
view:insert(doneButton)
pickerList.pickerWheel = _widget.newPickerWheel
{
top = opt.top+opt.height - opt.pickerHeight,
overlayFrameHeight = opt.pickerHeight,
rowHeight = opt.pickerRowHeight,
columns = opt.pickerData,
columnColor = opt.pickerColumnColor,
backgroundColor = opt.pickerColumnColor,
font = opt.pickerFont,
fontColor = opt.pickerFontColor,
fontSize = opt.pickerFontSize,
onScroll = onScroll,
}
view:insert(pickerList.pickerWheel)
pickerList._onScroll = opt.onScroll
pickerList._onClose = opt.onClose
pickerList.cancelOnBackgroundClick = opt.cancelOnBackgroundClick;
native.setKeyboardFocus(nil)
function pickerList:_finalize()
end
function pickerList:closeUp()
if self._onClose then
local event = {}
event.target = self
self._onClose(event)
end
self._view:removeSelf();
self:removeSelf()
end
function pickerList:cancel()
if self.editField then
self.editField:setText(self._initialValue);
self.editField.id = self.initialId;
end
self:closeUp()
end;
end
-- Function to create a new editfield object ( widget.newEditField)
function M.new( options )
local customOptions = options or {}
-- Create a local reference to our options table
local opt = M._options
-------------------------------------------------------
-- Properties
-------------------------------------------------------
-- Positioning & properties
opt.left = customOptions.left or 0
opt.top = customOptions.top or 0
opt.x = customOptions.x or nil
opt.y = customOptions.y or nil
if customOptions.x and customOptions.y then
opt.left = 0
opt.top = 0
end
opt.width = customOptions.width or display.contentWidth
opt.height = customOptions.height or display.contentHeight
opt.backgroundColor = customOptions.backgroundColor or {0,0,0,0.5}
opt.editField = customOptions.editField
opt.onScroll = customOptions.onScroll
opt.onClose = customOptions.onClose
opt.cancelOnBackgroundClick = customOptions.cancelOnBackgroundClick
opt.toolbarWidth = customOptions.toolbarWidth or display.contentWidth
opt.toolbarHeight = customOptions.toolbarHeight or 50
opt.toolbarTop = customOptions.toolbarTop or 0
opt.toolbarColor = customOptions.toolbarColor or {1,1,1,1}
opt.buttonsWidth = customOptions.buttonsWidth or 75
opt.buttonsMargin = customOptions.buttonsMargin or 10
opt.cancelLabel = customOptions.cancelLabel or "Cancel"
opt.doneLabel = customOptions.doneLabel or "Done"
opt.pickerHeight = customOptions.pickerHeight or 222
opt.pickerRowHeight = customOptions.pickerRowHeight or 35
opt.pickerData = customOptions.pickerData
opt.pickerColumnColor = customOptions.pickerColumnColor
opt.pickerFont = customOptions.pickerFont
opt.pickerFontColor = customOptions.pickerFontColor
opt.pickerFontSize = customOptions.pickerFontSize
-- Create the editField object
local pickerList = _widget._new
{
left = opt.left,
top = opt.top,
id = opt.id or "widget_pickerList",
baseDir = opt.baseDir,
}
initPickerList( pickerList, opt )
-- Set the editField's position ( set the reference point to center, just to be sure )
local x, y = opt.x, opt.y
if not opt.x or not opt.y then
x = opt.left + pickerList.contentWidth * 0.5
y = opt.top + pickerList.contentHeight * 0.5
end
pickerList.x, pickerList.y = x, y
return pickerList
end
return M
|
--[[
TheNexusAvenger
Implementation of a command.
--]]
local BaseCommand = require(script.Parent.Parent:WaitForChild("BaseCommand"))
local Command = BaseCommand:Extend()
--[[
Creates the command.
--]]
function Command:__new()
self:InitializeSuper("sm","BasicCommands","Creates a message visible to everyone. The displayed name is \"Nexus Admin\".")
self.Arguments = {
{
Type = "string",
Name = "Message",
Description = "Announcement text.",
},
}
end
--[[
Runs the command.
--]]
function Command:Run(CommandContext,Message)
self.super:Run(CommandContext)
--Filter and send the message.
for Player,FilteredMessage in pairs(self.API.Filter:FilterStringForPlayers(Message,CommandContext.Executor,self.Players:GetPlayers())) do
self.API.Messages:DisplayMessage(Player,"Nexus Admin",FilteredMessage)
end
end
return Command
|
local rich_autoplace = data.raw["map-gen-presets"]["default"]["rich-resources"]["basic_settings"]["autoplace_controls"]
local rail_autoplace = data.raw["map-gen-presets"]["default"]["rail-world"]["basic_settings"]["autoplace_controls"]
local ribb_autoplace = data.raw["map-gen-presets"]["default"]["ribbon-world"]["basic_settings"]["autoplace_controls"]
-- ores
for _,resource in ipairs({
-- pyrawores 2.2.7
"aluminium-rock",
"ore-aluminium",
"chromium-rock",
"ore-chromium",
"coal-rock",
"copper-rock",
"iron-rock",
"lead-rock",
"ore-lead",
"nexelit-rock",
"nickel-rock",
"ore-nickel",
"phosphate-rock-02",
"quartz-rock",
"ore-quartz",
"raw-coal",
"salt-rock",
"tin-rock",
"ore-tin",
"titanium-rock",
"ore-titanium",
"uranium-rock",
"zinc-rock",
"ore-zinc",
-- pycoalprocessing 1.9.3
"borax",
"niobium",
-- angelsrefining
-- all good as of 2021-12-31
-- angelspetrochem
-- all good as of 2021-12-31
-- Clowns-Extended-Minerals
-- all good as of 2021-12-31
}) do
if data.raw["autoplace-control"][resource] then
rich_autoplace[resource] = { richness = 2.0 }
rail_autoplace[resource] = { frequency = 0.33, size = 3.0 }
ribb_autoplace[resource] = { frequency = 3.0, size = 0.5, richness = 2.0 }
end
end
|
AddCSLuaFile()
AddCSLuaFile("sh_sounds.lua")
include("sh_sounds.lua")
if CLIENT then
SWEP.DrawCrosshair = false
SWEP.PrintName = "Remington 870 AE"
SWEP.CSMuzzleFlashes = true
SWEP.ViewModelMovementScale = 1
SWEP.IconLetter = "k"
killicon.AddFont("cw_ump45", "CW_KillIcons", SWEP.IconLetter, Color(255, 80, 0, 150))
SWEP.MuzzleEffect = "muzzleflash_m3"
SWEP.PosBasedMuz = true
SWEP.SnapToGrip = true
SWEP.ShellScale = 0.7
SWEP.ShellOffsetMul = 1
SWEP.Shell = "shotshell"
SWEP.ShellDelay = 0.3
SWEP.DrawTraditionalWorldModel = false
SWEP.WM = "models/weapons/w_shot_remington.mdl"
SWEP.WMPos = Vector(-1, 1.5, 0)
SWEP.WMAng = Vector(0, 0, 180)
SWEP.ShellPosOffset = {x = 4, y = 0, z = -3}
SWEP.ForeGripOffsetCycle_Draw = 0
SWEP.ForeGripOffsetCycle_Reload = 0.9
SWEP.ForeGripOffsetCycle_Reload_Empty = 0.8
SWEP.FireMoveMod = 1
SWEP.SightWithRail = true
SWEP.IronsightPos = Vector(3.72, 0, 2.4)
SWEP.IronsightAng = Vector(0, 0, 0)
SWEP.SprintPos = Vector(-5.786, 0, -1)
SWEP.SprintAng = Vector(-10.778, -27.573, 0)
SWEP.CustomizePos = Vector(0, 0, 0)
SWEP.CustomizeAng = Vector(8.364, 0.741, 0.277)
SWEP.AlternativePos = Vector(-0.64, 0.294, -0.978)
SWEP.AlternativeAng = Vector(0, 0, 0)
SWEP.CustomizationMenuScale = 0.016
SWEP.ReticleInactivityPostFire = 0.6
SWEP.AttachmentModelsVM = {
}
SWEP.LuaVMRecoilAxisMod = {vert = 1.5, hor = 2, roll = 1, forward = 1, pitch = 1}
SWEP.LaserPosAdjust = Vector(0.8, 0, 0.3)
SWEP.LaserAngAdjust = Angle(0, 180, 0)
end
SWEP.SightBGs = {main = 2, none = 1}
SWEP.ADSFireAnim = true
SWEP.Attachments = {
["+reload"] = {header = "Ammo", offset = {700, 325}, atts = {"am_slugrounds", "am_trishot", "am_dartrounds"}}
}
SWEP.Animations = {fire = {"shoot1", "shoot2"},
reload_start = "start_reload",
insert = "insert",
reload_end = "after_reload",
idle = "idle",
draw = "draw"}
SWEP.Sounds = {start_reload = {{time = 0.05, sound = "CW_FOLEY_LIGHT"}},
insert = {{time = 0.1, sound = "CW_M3SUPER90_INSERT"}},
after_reload = {{time = 0.1, sound = "CW_M3SUPER90_PUMP"},
{time = 0.6, sound = "CW_FOLEY_LIGHT"}},
draw = {{time = 0, sound = "CW_FOLEY_MEDIUM"},
{time = 0.55, sound = "CW_M3SUPER90_PUMP"}}}
SWEP.SpeedDec = 10
SWEP.Slot = 3
SWEP.SlotPos = 0
SWEP.HoldType = "ar2"
SWEP.NormalHoldType = "ar2"
SWEP.RunHoldType = "crossbow"
SWEP.FireModes = {"pump"}
SWEP.Base = "cw_base"
SWEP.Category = "STALKER Weapons"
SWEP.Author = "gumlefar & verne"
SWEP.Contact = ""
SWEP.Purpose = ""
SWEP.Instructions = ""
SWEP.ViewModelFOV = 70
SWEP.ViewModelFlip = true
SWEP.ViewModel = "models/weapons/v_shot_remington.mdl"
SWEP.WorldModel = "models/weapons/w_shot_remington.mdl"
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
SWEP.Primary.ClipSize = 8
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "12 Gauge"
SWEP.FireDelay = 0.7
SWEP.FireSound = "CW_M3SUPER90_FIRE"
SWEP.Recoil = 3
SWEP.WearDamage = 0.5
SWEP.WearEffect = 0.005
SWEP.HipSpread = 0.06
SWEP.AimSpread = 0.005
SWEP.VelocitySensitivity = 0.5
SWEP.MaxSpreadInc = 0.4
SWEP.ClumpSpread = 0.018
SWEP.SpreadPerShot = 0.2
SWEP.SpreadCooldown = 0.9
SWEP.Shots = 9
SWEP.Damage = 23
SWEP.DeployTime = 1
SWEP.ReloadStartTime = 0.3
SWEP.InsertShellTime = 0.7
SWEP.ReloadFinishWait = 2
SWEP.ShotgunReload = true
SWEP.Chamberable = false
|
debug_mode = true
output_scheme = "myauth2"
dont_apply_for = {
"/free_for_access"
}
only_apply_for = {
"/"
}
black_list = {
"/blocked"
}
anon = {
"/pub"
}
basic = {
{
id = "user-1",
pass = "user-1-pass",
urls = {
"/basic-access-[%d]+",
"/basic-access-a"
}
},
{
id = "user-2",
pass = "user-2-pass",
urls = {
"/basic-access-[%d]+"
}
},
{
id = "user-2",
pass = "user-2-pass",
urls = {
"/basic-access-2"
}
}
}
rbac = {
ignore_audience = true,
rules = {
{
url = "/rbac-access-[%d]+",
allow = { "User1" },
deny = { "User2" },
allow_get = { "User3" },
deny_post = { "User1" }
},
{
url = "/rbac-access-allow",
allow_for_all = true
}
}
}
|
--------------------------------
-- @module SqliteWrapQuery
-- @extend Ref
-- @parent_module cc
--------------------------------
--
-- @function [parent=#SqliteWrapQuery] fetchError
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#SqliteWrapQuery] getFieldCount
-- @param self
-- @return int#int ret (return value: int)
return nil
|
local M = {}
local fn = vim.fn
local function node_info(winlayout, winid, p_indicator, level, index)
level = level or 0
index = index or 1
local indicator = winlayout[1]
if indicator == 'leaf' then
if winlayout[2] == winid then
return p_indicator, level, index
end
else
for i = 1, #winlayout[2] do
local p, d, idx = node_info(winlayout[2][i], winid, indicator, level + 1, i)
if p then
return p, d, idx
end
end
end
return
end
local function adjacent_wins(winlayout, is_bottom)
local wins = {}
local ind, tbl = winlayout[1], winlayout[2]
if ind == 'leaf' then
wins = {tbl}
elseif ind == 'col' then
wins = adjacent_wins(tbl[is_bottom and #tbl or 1], is_bottom)
else
for i = 1, #tbl do
local wins2 = adjacent_wins(tbl[i], is_bottom)
for j = 1, #wins2 do
wins[#wins + 1] = wins2[j]
end
end
end
return wins
end
function M.find_adjacent_wins(qf_winid, file_winid)
local wins = {}
local rel_pos, abs_pos = unpack(M.get_pos(qf_winid, file_winid))
if rel_pos == 'above' or rel_pos == 'below' then
wins = {file_winid}
elseif abs_pos == 'top' or abs_pos == 'bottom' then
local nest = fn.winlayout()[2]
if abs_pos == 'top' then
wins = adjacent_wins(nest[2], false)
else
wins = adjacent_wins(nest[#nest - 1], true)
end
end
return wins
end
-- get_pos is fast enough, no need to add a cache
function M.get_pos(qf_winid, file_winid)
local layout = fn.winlayout()
local nested = layout[2]
local rel_pos, abs_pos = 'unknown', 'unknown'
if type(nested) ~= 'table' or #nested < 2 then
return {rel_pos, abs_pos}
end
local qf_p_ind, qf_level, qf_index = node_info(layout, qf_winid)
if qf_level == 1 then
if qf_index == 1 then
if qf_p_ind == 'col' then
abs_pos = 'top'
else
abs_pos = 'left_far'
end
elseif qf_index == #nested then
if qf_p_ind == 'col' then
abs_pos = 'bottom'
else
abs_pos = 'right_far'
end
end
end
local f_p_ind, f_level, f_index = node_info(layout, file_winid)
if f_level == qf_level then
local offset_index = f_index - qf_index
if f_p_ind == 'col' then
if offset_index == 1 then
rel_pos = 'above'
elseif offset_index == -1 then
rel_pos = 'below'
end
else
if offset_index == 1 then
rel_pos = 'left'
elseif offset_index == -1 then
rel_pos = 'right'
end
end
end
return {rel_pos, abs_pos}
end
return M
|
local playsession = {
{"cogito123", {360066}},
{"TiTaN", {501495}},
{"Menander", {104637}},
{"Lulaidon", {480370}},
{"Leverage", {260168}},
{"Elements", {16522}},
{"MuddledBox", {292322}},
{"raskl", {154969}},
{"MFH", {339492}},
{"Loriangrei", {3108}},
{"vad7ik", {183871}},
{"realDonaldTrump", {1086}},
{"kRo1", {510}},
{"cchpucky", {1262}},
{"Dysonhive", {248421}},
{"facere", {289884}},
{"spikeolas", {155943}},
{"762x51mm", {78594}},
{"Malorie_sXy", {219988}},
{"everLord", {170761}},
{"Olekplane1", {13462}}
}
return playsession
|
-- This is a state module, not a class
-- Mouse/touch down -> slide
local IdleState = {}
local FSM, Renderer;
function IdleState.init(fsm, game, renderer)
FSM = fsm
Renderer = renderer
end
local function draw_status_text()
Renderer.draw_text("Slide")
end
IdleState.draw = {[3] = draw_status_text}
function IdleState.mousepressed(x, y, button)
if button == 1 then
FSM.change_state(FSM.states.SlideState, {x = x, y = y})
end
end
return IdleState
|
local summitBackgroundManager = {}
summitBackgroundManager.name = "SummitBackgroundManager"
summitBackgroundManager.depth = 0
summitBackgroundManager.texture = "@Internal@/summit_background_manager"
summitBackgroundManager.placements = {
name = "manager",
data = {
index = 0,
cutscene = "",
intro_launch = false,
dark = false,
ambience = ""
}
}
return summitBackgroundManager
|
-- Turn on coverage analysis if available
pcall(require, 'luacov')
ok, msg = xpcall(function()
-- Make textadept-vi available
package.path = _USERHOME .. "/../../?.lua;".._USERHOME .. "/../scripts/?.lua;" .. package.path
package.cpath = _USERHOME .. "/../../extension/?.so;"..package.cpath
local lfs = require'lfs'
function _G.cme_log(...) test.log(...) test.log('\n') end
test = require 'test'
vi_mode = require 'vi_mode'
test.queue(function()
local iter, dir_obj=lfs.dir(_USERHOME.."/../tests/")
while true do
local name = iter(dir_obj)
if name == nil then break end
local basename= name:match("(.+)%.lua$")
-- test.log('name='..name..', base='..tostring(basename) .. "\n")
if basename ~= nil then
test.run(basename)
end
end
end)
end, function(msg)
local f = io.open("output/test_init_error.txt", "w")
f:write(debug.traceback(msg))
f:flush()
f:close()
return msg
end)
if not ok then error(msg) end
|
-----------------------------------
-- Area: East Sarutabaruta
-- NPC: Stone Monument
-- Involved in quest "An Explorer's Footsteps"
-- !pos 448.045 -7.808 319.980 116
-----------------------------------
local ID = require("scripts/zones/East_Sarutabaruta/IDs")
-----------------------------------
function onTrigger(player, npc)
player:startEvent(900)
end
function onTrade(player, npc, trade)
if (trade:getItemCount() == 1 and trade:hasItemQty(571, 1)) then
player:tradeComplete()
player:addItem(570)
player:messageSpecial(ID.text.ITEM_OBTAINED, 570)
player:setCharVar("anExplorer-CurrentTablet", 0x00800)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
|
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
function IsAbleToSteal(targetSID, err)
ESX.TriggerServerCallback('esx_thief:getValue', function(result)
local result = result
if result.value then
err(false)
else
err(_U('no_hands_up'))
end
end, targetSID)
end
-- function OpenStealMenu(target, target_id)
-- ESX.UI.Menu.CloseAll()
-- ESX.TriggerServerCallback('esx_thief:getOtherPlayerData', function(data)
-- local elements = {}
-- if Config.EnableCash then
-- table.insert(elements, {
-- label = (('[%s] $%s'):format(_U('cash'), ESX.Math.GroupDigits(data.money))),
-- value = 'money',
-- type = 'item_money',
-- amount = data.money
-- })
-- end
-- if Config.EnableBlackMoney then
-- local blackMoney = 0
-- for i=1, #data.accounts, 1 do
-- if data.accounts[i].name == 'black_money' then
-- blackMoney = data.accounts[i].money
-- break
-- end
-- end
-- table.insert(elements, {
-- label = (('[%s] $%s'):format(_U('black_money'), ESX.Math.GroupDigits(blackMoney))),
-- value = 'black_money',
-- type = 'item_account',
-- amount = blackMoney
-- })
-- end
-- if Config.EnableInventory then
-- table.insert(elements, {label = '--- ' .. _U('inventory') .. ' ---', value = nil})
-- for i=1, #data.inventory, 1 do
-- if data.inventory[i].count > 0 then
-- table.insert(elements, {
-- label = data.inventory[i].label .. ' x' .. data.inventory[i].count,
-- value = data.inventory[i].name,
-- type = 'item_standard',
-- amount = data.inventory[i].count,
-- })
-- end
-- end
-- end
-- ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'steal_inventory', {
-- title = _U('target_inventory'),
-- elements = elements,
-- align = 'top-left'
-- }, function(data, menu)
-- if data.current.value ~= nil then
-- local itemType = data.current.type
-- local itemName = data.current.value
-- local amount = data.current.amount
-- local elements = {}
-- table.insert(elements, {label = _U('steal'), action = 'steal', itemType, itemName, amount})
-- table.insert(elements, {label = _U('return'), action = 'return'})
-- ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'steal_inventory_item', {
-- title = _U('action_choice'),
-- align = 'top-left',
-- elements = elements
-- }, function(data2, menu2)
-- if data2.current.action == 'steal' then
-- if itemType == 'item_standard' then
-- ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'steal_inventory_item_standard', {
-- title = _U('amount')
-- }, function(data3, menu3)
-- local quantity = tonumber(data3.value)
-- TriggerServerEvent('esx_thief:stealPlayerItem', GetPlayerServerId(target), itemType, itemName, quantity)
-- OpenStealMenu(target)
-- menu3.close()
-- menu2.close()
-- end, function(data3, menu3)
-- menu3.close()
-- end)
-- else
-- TriggerServerEvent('esx_thief:stealPlayerItem', GetPlayerServerId(target), itemType, itemName, amount)
-- OpenStealMenu(target)
-- end
-- elseif data2.current.action == 'return' then
-- ESX.UI.Menu.CloseAll()
-- OpenStealMenu(target)
-- end
-- end, function(data2, menu2)
-- menu2.close()
-- end)
-- end
-- end, function(data, menu)
-- menu.close()
-- end)
-- end, GetPlayerServerId(target))
-- end
function OpenStealMenu(player, target_id)
TriggerEvent("esx_inventoryhud:openPlayerInventory", target_id or GetPlayerServerId(player), GetPlayerName(player))
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
local ped = PlayerPedId()
if IsControlJustPressed(0, 47) and IsPedArmed(ped, 7) and not IsEntityDead(ped) and IsPedOnFoot(ped) then
local target, distance = ESX.Game.GetClosestPlayer()
if target ~= -1 and distance ~= -1 and distance <= 2.0 then
local target_id = GetPlayerServerId(target)
IsAbleToSteal(target_id, function(err)
if(not err)then
OpenStealMenu(target, target_id)
else
ESX.ShowNotification(err)
end
end)
elseif distance < 20 and distance > 2.0 then
ESX.ShowNotification(_U('too_far'))
else
ESX.ShowNotification(_U('no_players_nearby'))
end
end
end
end)
|
OpenStorage = function(storageName, storageUUID)
if Default.DiscInventory.Enabled then
TriggerEvent("disc-inventoryhud:openInventory", {
type = "RENZ_MOTEL_STORAGE",
owner = storageUUID .. "-" .. storageName
})
return
end
local storageId = storageUUID .. "-" .. storageName
local cachedStorage = Heap.Storages[storageId]
if not cachedStorage then
Heap.Storages[storageId] = {
Items = {}
}
end
local menuElements = {
{
label = "Put in something.",
action = "put_item"
}
}
for itemIndex, itemData in ipairs(Heap.Storages[storageId].Items) do
if itemData.type and itemData.type == "weapon" then
if not itemData.uniqueId then
itemData.uniqueId = NetworkGetRandomInt()
end
end
table.insert(menuElements, {
label = itemData.label .. " - x" .. itemData.count,
action = itemData
})
end
Heap.ESX.UI.Menu.Open("default", GetCurrentResourceName(), "main_storage_menu_" .. string.sub(storageId, 6, 9), {
title = "Förvaring",
align = Default.MenuAlignment,
elements = menuElements
}, function(menuData, menuHandle)
local action = menuData.current.action
if action == "put_item" then
ChooseItemMenu(function(itemPut)
AddItemToStorage(storageUUID, storageName, itemPut)
end)
elseif type(action) == "table" then
if action.type == "weapon" then
TakeItemFromStorage(storageUUID, storageName, action)
else
Heap.ESX.UI.Menu.Open("dialog", GetCurrentResourceName(), "main_storage_count", {
title = "How many?"
}, function(menuData, dialogHandle)
local newCount = tonumber(menuData.value)
if not newCount then
return Heap.ESX.ShowNotification("Please provide only a number.")
elseif newCount > action.count then
newCount = action.count
elseif newCount < 1 then
newCount = 1
end
action.count = newCount
dialogHandle.close()
TakeItemFromStorage(storageUUID, storageName, action)
end, function(menuData, dialogHandle)
dialogHandle.close()
end)
end
end
end, function(menuData, menuHandle)
menuHandle.close()
end)
end
ChooseItemMenu = function(callback)
local playerInventory = Heap.ESX.GetPlayerData()["inventory"]
local menuElements = {}
if Storage.BlackMoney then
local playerAccounts = Heap.ESX.GetPlayerData()["accounts"]
for accountIndex, accountData in pairs(playerAccounts) do
if accountData.name == "black_money" then
accountData.count = accountData.money
accountData.type = "black_money"
table.insert(menuElements, {
label = accountData.label .. " - $" .. accountData.count,
action = accountData
})
end
end
end
if Storage.Weapons then
local weaponLoadout = Heap.ESX.GetPlayerData()["loadout"]
for loadoutIndex, loadoutData in ipairs(weaponLoadout) do
loadoutData.count = loadoutData.ammo
loadoutData.type = "weapon"
table.insert(menuElements, {
label = loadoutData.label .. " - x" .. loadoutData.count,
action = loadoutData
})
end
end
for itemIndex, itemData in ipairs(playerInventory) do
if itemData.count > 0 then
itemData.type = "item"
table.insert(menuElements, {
label = itemData.label .. " - x" .. itemData.count,
action = itemData
})
end
end
Heap.ESX.UI.Menu.Open("default", GetCurrentResourceName(), "main_storage_inventory_menu", {
title = "Choose.",
align = Default.MenuAlignment,
elements = menuElements
}, function(menuData, menuHandle)
local action = menuData.current.action
if type(action) == "table" then
if action.type == "weapon" then
callback(action)
menuHandle.close()
else
Heap.ESX.UI.Menu.Open("dialog", GetCurrentResourceName(), "main_storage_inventory_count", {
title = "How many?"
}, function(menuData, dialogHandle)
local newCount = tonumber(menuData.value)
if not newCount then
return ESX.ShowNotification("Please provide a number.")
elseif newCount > action.count then
newCount = action.count
elseif newCount < 1 then
newCount = 1
end
action.count = newCount
dialogHandle.close()
menuHandle.close()
callback(action)
end, function(menuData, dialogHandle)
dialogHandle.close()
end)
end
end
end, function(menuData, menuHandle)
menuHandle.close()
end)
end
AddItemToStorage = function(storageUUID, storageName, newItem)
local storageId = storageUUID .. "-" .. storageName
local cachedStorage = Heap.Storages[storageId]
if not cachedStorage then
Heap.Storages[storageId] = {
Items = {}
}
end
local itemFound = false
if newItem.type == "weapon" then
newItem.uniqueId = NetworkGetRandomInt()
else
for itemIndex, itemData in ipairs(cachedStorage.Items) do
if itemData.name == newItem.name then
Heap.Storages[storageId].Items[itemIndex].count = cachedStorage.Items[itemIndex].count + newItem.count
itemFound = true
break
end
end
end
if not itemFound then
table.insert(Heap.Storages[storageId].Items, newItem)
end
Heap.ESX.TriggerServerCallback("renz_motels:addItemToStorage", function(updated)
if updated then
Heap.ESX.ShowNotification("You put x" .. newItem.count .. " - " .. newItem.label)
end
end, Heap.Storages[storageId], newItem, storageUUID, storageName)
end
TakeItemFromStorage = function(storageUUID, storageName, newItem)
local storageId = storageUUID .. "-" .. storageName
local cachedStorage = Heap.Storages[storageId]
if not cachedStorage then
return
end
local itemFound = false
for itemIndex, itemData in ipairs(cachedStorage.Items) do
if newItem.type == "weapon" then
if itemData.uniqueId == newItem.uniqueId then
itemFound = true
table.remove(Heap.Storages[storageId].Items, itemIndex)
break
end
else
if itemData.name == newItem.name then
itemFound = true
if cachedStorage.Items[itemIndex].count - newItem.count <= 0 then
newItem.count = cachedStorage.Items[itemIndex].count
table.remove(Heap.Storages[storageId].Items, itemIndex)
else
Heap.Storages[storageId].Items[itemIndex].count = Heap.Storages[storageId].Items[itemIndex].count - newItem.count
end
break
end
end
end
if not itemFound then
return
end
Heap.ESX.TriggerServerCallback("renz_motels:takeItemFromStorage", function(updated)
if updated then
Heap.ESX.ShowNotification("You took x" .. newItem.count .. " - " .. newItem.label)
end
end, Heap.Storages[storageId], newItem, storageUUID, storageName)
end
|
local fmt = string.format
local permission = {}
-- 用户是否有此菜单的权限
function permission.user_have_menu_permission (db, uid, url)
-- 查询用户Role ID
local uinfo = db:query(fmt([[SELECT id, role AS role_id FROM cfadmin_users WHERE `cfadmin_users`.id = %u AND `cfadmin_users`.active = 1 LIMIT 1]], uid))[1]
if type(uinfo) ~= 'table' then
return false
end
-- 查询菜单Menu ID
local minfo = db:query(fmt([[SELECT * FROM cfadmin_menus WHERE `cfadmin_menus`.url = '%s' AND `cfadmin_menus`.active = 1 LIMIT 1]], url))[1]
if type(minfo) ~= 'table' then
return true
end
-- 检查权限
local role, err = db:query(fmt([[SELECT * FROM cfadmin_permissions p WHERE p.`active` = 1 AND p.`role_id` = %u AND p.`menu_id` = %u LIMIT 1]], uinfo.role_id, minfo.id))
if type(role) == 'table' then
return role[1]
end
return role, err
end
return permission
|
jester.help_map.dialplan_tools = {}
jester.help_map.dialplan_tools.description_short = [[Provides access to dialplan applications.]]
jester.help_map.dialplan_tools.description_long = [[This module provides access to various dialplan applications. An understand of how these applications are used in FreeSWITCH dialplans is essential in order to properly use the actions in this module.]]
jester.help_map.dialplan_tools.actions = {}
jester.help_map.dialplan_tools.actions.execute = {}
jester.help_map.dialplan_tools.actions.execute.description_short = [[Execute dialplan applications.]]
jester.help_map.dialplan_tools.actions.execute.description_long = [[This action provides access to execute any dialplan application via Jester. Note that key presses will not be recognized during the execute action, use the various play and record actions to allow capturing of key presses.]]
jester.help_map.dialplan_tools.actions.execute.params = {
application = [[The application to execute.]],
data = [[(Optional) Data to pass to the application.]],
}
jester.help_map.dialplan_tools.actions.transfer = {}
jester.help_map.dialplan_tools.actions.transfer.description_short = [[Transfer to another extension in the dialplan.]]
jester.help_map.dialplan_tools.actions.transfer.description_long = [[This action is used to transfer to another extension in the dialplan. Prior to the transfer, the active sequence stack is cleared.]]
jester.help_map.dialplan_tools.actions.transfer.params = {
extension = [[The extension to transfer to.]],
dialplan = [[(Optional) The dialplan to transfer to. Default is 'XML'.]],
context = [[(Optional) The context to transfer to. Default is the current context.]],
}
jester.help_map.dialplan_tools.actions.bridge = {}
jester.help_map.dialplan_tools.actions.bridge.description_short = [[Bridges the current Jester channel with another endpoint.]]
jester.help_map.dialplan_tools.actions.bridge.description_long = [[This action bridges the current channel with another endpoint.
Note that many characteristics of the bridge can be controlled by setting various channel variables prior to the bridge. Check the FreeSWITCH wiki for more information on the available channel variables, and 'help action set_variable' for setting channel variables from Jester.]]
jester.help_map.dialplan_tools.actions.bridge.params = {
channel = [[The channel to use for the bridge. Can be a string (used for all extensions), or optionally a table of multiple channels (used with the matching extension in the extension table). Be sure to include everything up to the actual extension, including trailing slash and any dial prefix.]],
extension = [[The extension to bridge to. Can be a string (used for all channels), or optionally a table of multiple extensions (used with the matching channel in the channel table).]],
variables = [[A table of channel variables to set for the bridge, key = variable name, value = variable value. Can be a single table (used for all channels), or optionally a table of variable tables (used with the matching channel in the channel list).]],
multichannel_type = [[(Optional) If multiple channels or extensions are specified, this setting determines how they will be connected. 'first_wins' rings all channels until the first responds with media, then bridges that channel. 'sequential' rings each channel in succession, bridging the first one that responds with media. Default is first_wins'.]],
hangup_after_bridge = [[(Optional) If set to true, the call will be hungup after the bridge completes. Note that all sequences registered for the exit and hangup loops will still be run.]],
}
|
local onenord = {
fg = "#C8D0E0",
fg_light = "#E5E9F0",
bg = "#2E3440",
gray = "#646A76",
light_gray = "#6C7A96",
cyan = "#88C0D0",
blue = "#81A1C1",
dark_blue = "#5E81AC",
green = "#A3BE8C",
light_green = "#8FBCBB",
dark_red = "#BF616A",
red = "#D57780",
light_red = "#DE878F",
pink = "#E85B7A",
dark_pink = "#E44675",
orange = "#D08F70",
yellow = "#EBCB8B",
purple = "#B988B0",
light_purple = "#B48EAD",
none = "NONE",
}
-- more semantically meaningful colors
onenord.error = onenord.dark_red
onenord.warn = onenord.orange
onenord.info = onenord.green
onenord.hint = onenord.purple
onenord.diff_add = onenord.green
onenord.diff_add_bg = "#324125"
onenord.diff_change = onenord.dark_blue
onenord.diff_change_bg = "#334963"
onenord.diff_remove = onenord.red
onenord.diff_remove_bg = onenord.dark_red
onenord.diff_text_bg = "#446285"
onenord.active = "#353B49"
onenord.float = "#3B4252"
onenord.highlight = "#3F4758"
onenord.selection = "#4C566A"
return onenord
|
--[[
Desc: Skill Component, manage skills of entity.
Author: SerDing
Since: 2018-08-20
Alter: 2021-04-20
]]
local _RESMGR = require("system.resource.resmgr")
local _Skill = require("entity.skill")
local _SETTING = require("setting")
local _Base = require("entity.component.base")
---@class Entity.Component.Skills : Entity.Component.Base
---@field protected _skillShortcutMap table<string, Entity.Skill>
---@field protected _skillMap table<string, Entity.Skill>
local _SkillComponent = require("core.class")(_Base)
function _SkillComponent:Ctor(entity, data, param)
_Base.Ctor(self, entity)
self._skillShortcutMap = {} --<shortcut, skill>
self._skillMap = {} --<name, skill>
for shortcut, path in pairs(data) do
if shortcut ~= "class" then
--_LOG.Debug("load skill: %s", name)
local skillData = _RESMGR.LoadSkill(path)
local skill = _Skill.New(self._entity, skillData, self)
self._skillShortcutMap[shortcut] = skill
self._skillMap[skillData.name] = skill
end
end
--init skill list for ai
self.skillList = {}
for _, skill in pairs(self._skillShortcutMap) do
self.skillList[#self.skillList + 1] = skill
end
table.sort(self.skillList, function(a, b)
return a.aiPriority < b.aiPriority
end)
if param.skills then
for i = 1, #param.skills do
self._skillShortcutMap[param.skills[i]]:SetActive(true)
end
else
for _, skill in pairs(self._skillShortcutMap) do
skill:SetActive(true)
end
end
self.debug = _SETTING.debug.skill
end
function _SkillComponent:Init()
for _, skill in pairs(self._skillShortcutMap) do
skill:Init()
skill.debug = self.debug
end
end
function _SkillComponent:Update(dt)
for _, skill in pairs(self._skillShortcutMap) do
skill:Update(dt)
end
end
---@param id string
function _SkillComponent:CastSkill(id)
local skill = self._skillMap[id]
if skill then
skill:Cast()
self._curSkill = skill
self.world.eventMgr.Notify(EEvent.SKILL_CAST, skill, self._entity)
end
end
---@param skill Entity.Skill
function _SkillComponent:OnSkillFinish(skill)
self._curSkill = nil
end
function _SkillComponent:IsCastingSkill()
return self._curSkill ~= nil
end
---@param name string
---@return boolean
function _SkillComponent:CanCast(name)
local skill = self._skillShortcutMap[name]
if skill then
return skill:CanCast()
end
return false
end
---@param shortcut string
---@return Entity.Skill
function _SkillComponent:GetSkill(shortcut)
return self._skillShortcutMap[shortcut] or nil
end
function _SkillComponent:LearnSkill(name)
self._skillShortcutMap[name]:SetActive(true)
end
return _SkillComponent
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.