content
stringlengths
5
1.05M
-- *************************************************************************** -- BH1750 Example Program for ESP8266 with nodeMCU -- BH1750 compatible tested 2015-1-30 -- -- Written by xiaohu -- -- MIT license, http://opensource.org/licenses/MIT -- *************************************************************************** local bh1750 = require("bh1750") local sda = 6 -- sda pin, GPIO12 local scl = 5 -- scl pin, GPIO14 do bh1750.init(sda, scl) tmr.create():alarm(10000, tmr.ALARM_AUTO, function() bh1750.read() local l = bh1750.getlux() print("lux: "..(l / 100).."."..(l % 100).." lx") end) end
local ok, cmp = pcall(require, "cmp") if not ok then return end local compare = cmp.config.compare --   פּ ﯟ   some other good icons local kind_icons = { Text = "", Method = "m", Function = "", Constructor = "", Field = "", Variable = "", Class = "", Interface = "", Module = "", Property = "", Unit = "", Value = "", Enum = "", Keyword = "", Snippet = "", Color = "", File = "", Reference = "", Folder = "", EnumMember = "", Constant = "", Struct = "", Event = "", Operator = "", TypeParameter = "", } -- find more here: https://www.nerdfonts.com/cheat-sheet cmp.setup({ experimental = { native_menu = false, ghost_text = false, }, confirmation = { get_commit_characters = function() return {} end, }, completion = { completeopt = "menu,menuone,noinsert", keyword_pattern = [[\%(-\?\d\+\%(\.\d\+\)\?\|\h\w*\%(-\w*\)*\)]], keyword_length = 1, }, mapping = { ["<C-d>"] = cmp.mapping.scroll_docs(-4), ["<C-f>"] = cmp.mapping.scroll_docs(4), ["<C-Space>"] = cmp.mapping.complete(), ["<C-q>"] = cmp.mapping.close(), ["<Tab>"] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif vim.fn["vsnip#available"](1) == 1 then vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes("<Plug>(vsnip-expand-or-jump)", true, true, true), "", true ) else fallback() end end, { "i", "s" }), ["<S-Tab>"] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif vim.fn["vsnip#jumpable"](-1) == 1 then vim.api.nvim_feedkeys( vim.api.nvim_replace_termcodes("<Plug>(vsnip-jump-prev)", true, true, true), "", true ) else fallback() end end, { "i", "s" }), ["<CR>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false, }), }, formatting = { fields = { "kind", "abbr", "menu" }, format = function(entry, vim_item) -- Kind icons vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) vim_item.menu = ({ npm = "[npm]", nvim_lsp = "[LSP]", nvim_lua = "[Lua]", vsnip = "[VSnippet]", luasnip = "[Snippet]", buffer = "[Buffer]", path = "[Path]", nvim_lsp_signature_help = "[LSP Sig]", })[entry.source.name] return vim_item end, }, snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) end, }, sources = { { name = "npm" }, { name = "nvim_lsp" }, { name = "nvim_lua" }, { name = "vsnip" }, { name = "path" }, { name = "buffer" }, { name = "nvim_lsp_signature_help" }, }, sorting = { priority_weight = 1.0, comparators = { -- compare.score_offset, --not good at all compare.locality, compare.recently_used, compare.score, -- based on : score = score + ((#sources - (source_index - 1)) * sorting.priority_weight) compare.offset, compare.order, -- compare.scopes, -- what? -- compare.sort_text, -- compare.exact, -- compare.kind, -- compare.length, -- useless }, }, preselect = cmp.PreselectMode.None, }) cmp.setup.cmdline("/", { mapping = cmp.mapping.preset.cmdline(), sources = { { name = "buffer" }, }, }) cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = "path" }, }, { { name = "cmdline" }, }), })
local strtab = {} local function AddFollowUp( str ) -- adds a followup thing to the word table, e.g. I ate > ate is a followup word of I str = string.lower( str ) str = str:gsub( '[.,?!“"]', "" ) -- remove full stops and question marks and all that local strs = {} for word in str:gmatch( "%S+" ) do strs[ #strs + 1 ] = word end for k, v in ipairs( strs ) do local nextkey = strs[ k + 1 ] if nextkey then if not strtab[ v ] then strtab[ v ] = {} end strtab[ v ][ #strtab[ v ] + 1 ] = nextkey end end end local function RandomKey( tab ) -- Gets a random key of a table local t = {} for k,v in pairs( tab ) do t[ #t + 1 ] = k end return t[ math.random( #t ) ] end local function CapitalizeFirst( str ) -- Capitalizes the first letter of a string return ( str:gsub( "^%l", string.upper ) ) end local function GenerateFollowupString( length ) -- Makes a string out of words added from AddFollowUp local s = "" local prevword for i = 1, length do local randomword = RandomKey( strtab ) if prevword then local followupword = strtab[ prevword ] if followupword and next( followupword ) ~= nil then local randomwordfromtab = followupword[ math.random( #followupword ) ] s = s .. " " .. randomwordfromtab prevword = randomwordfromtab else s = s .. ". " .. CapitalizeFirst( randomword ) prevword = randomword end else s = s .. CapitalizeFirst( randomword ) prevword = randomword end end return s .. "." end --[[ EXAMPLE OF HOW THIS COULD BE USED: AddFollowUp( "This is an example string and it is short" ) print( GenerateFollowupString( 20 ) ) POSSIBLE OUTPUT: This is short. It is short. And it is short. This is an example string and it is an example. ]]
return function() local modes = { 'rainbow','random','blink','blink','blink', 'wblink','wblink','wblink','run_rainbow','traffic', 'run_random','slow_random','smooth_random', } clr_timers() local mode = ldfile(modes[math.random(1,#modes)] .. '.lua') if mode then mode() end end
---@meta ---@class cc.JumpTiles3D :cc.TiledGrid3DAction local JumpTiles3D={ } cc.JumpTiles3D=JumpTiles3D ---* brief Set the amplitude rate of the effect.<br> ---* param amplitudeRate The value of amplitude rate will be set. ---@param amplitudeRate float ---@return self function JumpTiles3D:setAmplitudeRate (amplitudeRate) end ---* brief Initializes the action with the number of jumps, the sin amplitude, the grid size and the duration.<br> ---* param duration Specify the duration of the JumpTiles3D action. It's a value in seconds.<br> ---* param gridSize Specify the size of the grid.<br> ---* param numberOfJumps Specify the jump tiles count.<br> ---* param amplitude Specify the amplitude of the JumpTiles3D action.<br> ---* return If the initialization success, return true; otherwise, return false. ---@param duration float ---@param gridSize size_table ---@param numberOfJumps unsigned_int ---@param amplitude float ---@return boolean function JumpTiles3D:initWithDuration (duration,gridSize,numberOfJumps,amplitude) end ---* brief Get the amplitude of the effect.<br> ---* return Return the amplitude of the effect. ---@return float function JumpTiles3D:getAmplitude () end ---* brief Get the amplitude rate of the effect.<br> ---* return Return the amplitude rate of the effect. ---@return float function JumpTiles3D:getAmplitudeRate () end ---* brief Set the amplitude to the effect.<br> ---* param amplitude The value of amplitude will be set. ---@param amplitude float ---@return self function JumpTiles3D:setAmplitude (amplitude) end ---* brief Create the action with the number of jumps, the sin amplitude, the grid size and the duration.<br> ---* param duration Specify the duration of the JumpTiles3D action. It's a value in seconds.<br> ---* param gridSize Specify the size of the grid.<br> ---* param numberOfJumps Specify the jump tiles count.<br> ---* param amplitude Specify the amplitude of the JumpTiles3D action.<br> ---* return If the creation success, return a pointer of JumpTiles3D action; otherwise, return nil. ---@param duration float ---@param gridSize size_table ---@param numberOfJumps unsigned_int ---@param amplitude float ---@return self function JumpTiles3D:create (duration,gridSize,numberOfJumps,amplitude) end ---* ---@return self function JumpTiles3D:clone () end ---* ---@param time float ---@return self function JumpTiles3D:update (time) end ---* ---@return self function JumpTiles3D:JumpTiles3D () end
include('lib/track') include('lib/engine') QuantumPhysics = include('lib/engines/quantumphysics') GraphTheory = include('lib/engines/graphtheory') TimeWaver = include('lib/engines/timewaver') Info = include('lib/misc/info') include('lib/docu') engines = {GraphTheory.name,QuantumPhysics.name,TimeWaver.name} engine_icons = {GraphTheory.icon,QuantumPhysics.icon,TimeWaver.icon} new_engine = {GraphTheory.new,QuantumPhysics.new,TimeWaver.new} midi_slots = {} setup_device_slots = function (d_list) for i,d in pairs(d_list) do midi_slots[i] = {device=midi.connect(d), name=midi.vports[d].name} end end start_midi_devices = function () for _,s in pairs(midi_slots) do s.device:start() end end continue_midi_devices = function () end stop_midi_devices = function () for _,s in pairs(midi_slots) do s.device:stop() end end Brain = function (g) return { grid = g, grid_handler = include('lib/grid/grid_handler').new(), keys = include('lib/isomorphic_keyboard'), tracks = {}, ui_mode = "apps", -- "apps","settings","presets" preset = 1, focus = 1, transport_state = "stop", overlay = {text="superbrain",time=util.time()+3}, help = false, init = function (self) self.tracks = {} for i=1,5 do self.tracks[i] = new_track(i,self.keys) end self:load_preset(1) self.grid:all(0) self.grid:refresh() self.grid.key = function (x,y,z) self:key(x,y,z) end self.grid_handler.grid_event = function (e) self:grid_event(e) end -- DRAW clock.run(function (self) while true do self:redraw() clock.sleep(1/30) end end ,self) end, set_overlay = function (self,t,st,duration) self.overlay = {text="",subtext="",time=0} self.overlay.text = t self.overlay.subtext = st self.overlay.time = util.time()+(duration and duration or 2) end, draw_help = function (info) local x_off = 1 local y_off = 20 local w = 4 -- NAME if info.name then screen.level(15) screen.font_size(8) screen.move(x_off,8) screen.text(info.name) end screen.level(2) screen.move(106,8) screen.text("focus") info:draw_lpx(x_off,y_off,w) i = info[highlight] info:draw(MENU_ENC,x_off,y_off,w) end, redraw_screen = function (self) screen.move(8,60) screen.font_size(8) screen.level(self.help and 15 or 2) screen.text("help") local info = Docu[self.tracks[self.focus].engine.name] if self.help and info then self.draw_help(info) return end -- OUT screen.line_width(1) for _,n in pairs(self.tracks[self.focus].output.active_notes) do local x = util.linlin(1,127,9,121,n.note) screen.pixel(x,2) screen.stroke() end -- TOP LINE screen.level(15) screen.move(9,5) screen.line(121,5) screen.stroke() -- PLAY / STOP local level = self.transport_state=="pre_play" and 2 or 15 -- if self.transport_state=="play" then level = math.floor(util.linlin(0,1,15,2,math.fmod(clock.get_beats(),1))) end screen.level(level) if self.transport_state=="stop" then screen.rect(10,9,6,6) else screen.move(10,9) screen.line(16,12) screen.line(10,15) end screen.fill() -- STEP screen.level(self.transport_state=="pre_play" and 15 or 2) screen.move(13,25) screen.font_size(8) screen.text_center(1+math.fmod(math.floor(clock.get_beats()),4)) -- SELECTED TRACK screen.level(15) screen.rect(113,9,8,8) screen.stroke() screen.move(117,15) screen.font_size(8) screen.text_center(self.focus) -- OVERLAY if self.overlay then -- TEXT screen.level(15) screen.font_size(16) screen.move(64,40) screen.text_center(self.overlay.text) -- SUBTEXT if self.overlay.subtext then screen.level(2) screen.font_size(8) screen.move(64,56) screen.text_center(self.overlay.subtext) end -- REMOVE OVERLAY if util.time() > self.overlay.time then self.overlay = nil end else -- DRAW TRACK self.tracks[self.focus]:redraw() end end, redraw = function (self) local sel_tr = self.tracks[self.focus] self.grid:all(0) -- ADAPTED TO NEW LPX INDICES -- -- ========================== -- -- TRANSPORT self.grid:led(10,1,self.transport_state=="play" and 15 or 2) self.grid:led(10,2,2) -- TRACK SELECTION for i=1,#self.tracks do self.grid:led(10,8-#self.tracks+i,i==self.focus and 15 or 2) end if self.ui_mode=="apps" then -- FOCUSSED TRACK if sel_tr.visible and sel_tr.engine then sel_tr.engine:redraw(self.grid) end -- KEYBOARD if self.keys.visible then self.keys:redraw(self.grid) end elseif self.ui_mode=="settings" then sel_tr:show_settings(self.grid) elseif self.ui_mode=="presets" then local folder = _path.data.."SUPER_BRAIN/" listing = util.scandir(folder) --tab.print(listing) for i=1,64 do local file_path = _path.data.."SUPER_BRAIN/preset_"..i..".txt" if util.file_exists (file_path) then local pos = index_to_pos[i] self.grid:led(pos.x,pos.y,3) end end local pos = index_to_pos[self.preset] self.grid:led(pos.x,pos.y,5,"fade") end self.grid:refresh() end, grid_event = function (self,e) local sel_tr = self.tracks[self.focus] -- ADAPTED TO NEW LPX INDICES -- -- ========================== -- -- TOP BAR if e.x==10 then -- TRANSPORT if e.y<3 then if e.type=="press" or e.type=="double" then self.transport_state = e.y==1 and "pre_play" or "stop" for _,t in pairs(self.tracks) do if self.transport_state=="pre_play" then clock.run(function (tr) clock.sync(4) tr:play() end, t) elseif self.transport_state=="stop" then t:stop() end end if self.transport_state=="pre_play" then clock.run(function (b) clock.sync(4) b.transport_state="play" start_midi_devices() end, self) elseif self.transport_state=="stop" then stop_midi_devices() end end -- PRESTS elseif e.y==3 then if e.type=="hold" then self.ui_mode = "presets" elseif e.type=="release" and self.ui_mode=="presets" then self.ui_mode = "apps" end -- TRACKS elseif e.y>8-#self.tracks then local t = e.y-(8-#self.tracks) self:set_visible(t) if (e.type=="double_click") then self.tracks[t]:reset_engine() elseif e.type=="hold" then self.ui_mode = "settings" elseif e.type=="release" then self.ui_mode = "apps" end end -- ADAPTED TO NEW LPX INDICES -- -- ========================== -- -- SIDE elseif e.x==9 then -- ENGINE SIDE BUTTONS if (e.y<5) and self.ui_mode=="apps" then sel_tr.engine:grid_event(e) -- TRANSPOSE elseif (e.y==5 or e.y==6) and self.ui_mode=="apps" then if (e.type=="press" or e.type=="double") then self.keys:transpose(e.y==5 and 1 or -1) end end -- MATRIX elseif e.x<9 and e.y<9 then -- APPS if self.ui_mode=="apps" then if self.ui_mode=="apps" then sel_tr.engine:grid_event(e) end -- SETTINGS elseif self.ui_mode=="settings" and (e.type=="press" or e.type=="double") and e.y<9 then sel_tr:handle_settings(e) -- PRESETS elseif self.ui_mode=="presets" and e.y<9 then local pre_nr = (e.y-1)*8+e.x if e.type=="click" then print("select",pre_nr) self.preset = pre_nr self:load_preset(pre_nr) elseif e.type=="hold" then print("save to",pre_nr) self:save_preset(pre_nr) end end end end, key = function (self,x,y,z) if self.ui_mode=="apps" then -- KEYBOARD if self.keys.area:in_area(x,y) then self.keys:key(x,y,z) return end end self.grid_handler:key(x,y,z) end, set_visible = function (self, index) self.tracks[self.focus]:set_unvisible() self.focus = util.clamp(index,1,#self.tracks) self.tracks[self.focus]:set_visible() end, save_preset = function (self,pre_nr) local preset_table = {} for i,t in pairs(self.tracks) do -- local s = {id=t.id, engine=t.engine, output=t.output:get()} preset_table[i] = t:get_state_for_preset() end tabutil.save(preset_table, _path.data.."SUPER_BRAIN/preset_"..pre_nr..".txt") end, load_preset = function (self, pre_nr) local file_path = _path.data.."SUPER_BRAIN/preset_"..pre_nr..".txt" if util.file_exists (file_path) then -- load from file local saved_data = tabutil.load(file_path) for i,t in pairs(self.tracks) do t:load_preset(saved_data[i]) end print("loaded "..pre_nr) else for i,t in pairs(self.tracks) do --t:default() print("set to default") end end end, cleanup = function (self) for _,t in pairs(self.tracks) do if t.output then t.output:kill_all_notes() end end if self.grid.enter_mode then self.grid:enter_mode("live") end end } end -- return BRAIN
local targetPath = (...) or "HotSwap.rbxm" print("Building", targetPath) local plugin = DataModel.new() local function addDirectory(dir, target) for _, f in ipairs(fs.dir(dir)) do if not f.IsDir then local script = fs.read(os.join(dir, f.Name), "modulescript.lua") script.Parent = target end end end fs.read("src/Main.lua", "script.lua").Parent = plugin fs.read("src/HotSwap.lua").Parent = plugin fs.read("src/Const.lua").Parent = plugin local assets = fs.read("src/Assets.lua") assets.Parent = plugin fs.read("assets/data.lua").Parent = assets local lion = fs.read("src/Lion.lua") lion.Parent = plugin fs.read("src/Path.lua").Parent = plugin fs.read("src/Tooltip.lua").Parent = plugin fs.read("src/Widget.lua").Parent = plugin addDirectory("l10n", lion) fs.write(targetPath, plugin, "rbxm")
local function overcrowded(pos) local pos_min = vector.add(pos,vector.new(-1,-1,-1)) local pos_max = vector.add(pos,vector.new(1,1,1)) return #minetest.find_nodes_in_area(pos_min, pos_max, "ws_core:gorse") > 1 end minetest.register_abm({ label = "Spread Gorse", nodenames = {"ws_core:gorse"}, neighbors = {"ws_core:clay_dirt"}, interval = 10, chance = 12, catch_up = false, action = function(pos) local pos1 = vector.add(pos,vector.new(-1,-1,-1)) local pos2 = vector.add(pos,vector.new(1,1,1)) local nodes = minetest.find_nodes_in_area_under_air(pos1, pos2, {"ws_core:clay_dirt"}) for _,p in pairs(nodes) do if p then if math.random() < 0.125 and not overcrowded(p) then minetest.set_node(vector.add(p,vector.new(0,1,0)), {name = "ws_core:gorse"}) end end end end, }) minetest.register_abm({ label = "Grow papyrus", nodenames = {"ws_core:dry_papyrus"}, neighbors = {"ws_core:dirt_dry", "ws_core:sandy_dirt", "ws_core:clay_dirt"}, interval = 14, chance = 71, action = function(...) ws_core.grow_papyrus(...) end })
---@meta local resty_core_time={} resty_core_time.version = require("resty.core.base").version return resty_core_time
--Runs with no error. Still no actual script running-- script.Parent = nil Player = game:GetService("Players").LocalPlayer Character = Player.Character Mouse = Player:GetMouse() m = Instance.new("Model", Character) it = Instance.new TagService = require(game:GetService("ReplicatedStorage"):WaitForChild("TagService")) nooutline = function(part) part.TopSurface = 10 end part = function(formfactor, parent, material, reflectance, transparency, brickcolor, name, size) local fp = it("Part") fp.formFactor = formfactor fp.Parent = parent fp.Reflectance = reflectance fp.Transparency = transparency fp.CanCollide = false fp.Locked = true fp.BrickColor = BrickColor.new(tostring(brickcolor)) fp.Name = name fp.Size = size fp.Position = Character.Torso.Position nooutline(fp) fp.Material = material fp:BreakJoints() return fp end mesh = function(Mesh, part, meshtype, meshid, offset, scale) local mesh = it(Mesh) mesh.Parent = part if Mesh == "SpecialMesh" then mesh.MeshType = meshtype mesh.MeshId = meshid end mesh.Offset = offset mesh.Scale = scale return mesh end weld = function(parent, part0, part1, c0, c1) local weld = it("Weld") weld.Parent = parent weld.Part0 = part0 weld.Part1 = part1 weld.C0 = c0 weld.C1 = c1 return weld end wep = game:service("ReplicatedStorage").Weapons[script.Name][Player.Stats.SkinValue.Value]:Clone() wep.Parent = Character for i,v in pairs(wep:children()) do if not v:isA("StringValue") and v.BrickColor == BrickColor.new("Bright blue") then v.BrickColor = Character.Torso.BrickColor end end handle = wep.Handle handleweld = weld(m, Character["Right Arm"], handle, CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1), CFrame.new(-0.0200357437, 0.0800266266, -1.09997594, -1, 0, 0, 0, 0, -1, 0, -0.999999881, 0)) hitbox = wep.hitbox weldScript = function(weldTo) local weldModel = Instance.new("Model", weldTo) weldModel.Name = "Welds" local makeWeld = function(part1, part0) local w = Instance.new("Weld", weldModel) w.Part0 = part0 w.Part1 = part1 local CFrameOrigin = CFrame.new(part0.Position) local CFrame0 = part0.CFrame:inverse() * CFrameOrigin local CFrame1 = part1.CFrame:inverse() * CFrameOrigin w.C0 = CFrame0 w.C1 = CFrame1 end for i,v in pairs(weldTo.Parent:children()) do if (v.ClassName == "Part" or v.Name == "Part" or v:isA("WedgePart")) and v ~= weldTo then makeWeld(v, weldTo) v.Anchored = false v.CanCollide = false v.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0) end end weldTo.Anchored = false weldTo.CanCollide = false weldTo.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0) end weldScript(handle) Meshes = {Blast = "20329976", Crown = "1323306", Ring = "3270017", Claw = "10681506", Crystal = "9756362", Coil = "9753878", Cloud = "1095708"} clangsounds = {"199149119", "199149109", "199149072", "199149025", "199148971"} hitsounds = {"199149137", "199149186", "199149221", "199149235", "199149269", "199149297"} blocksounds = {"199148933", "199148947"} armorsounds = {"199149321", "199149338", "199149367", "199149409", "199149452"} woosh = {Heavy1 = "320557353", Heavy2 = "320557382", Heavy3 = "320557453", Heavy4 = "199144226", Heavy5 = "203691447", Heavy6 = "203691467", Heavy7 = "203691492", Light1 = "320557413", Light2 = "320557487", Light3 = "199145095", Light4 = "199145146", Light5 = "199145887", Light6 = "199145913", Light7 = "199145841", Medium1 = "320557518", Medium2 = "320557537", Medium3 = "320557563", Medium4 = "199145204"} music = {Breaking = "179281636", FinalReckoning = "357375770", NotDeadYet = "346175829", Intense = "151514610", JumpP1 = "160536628", JumpP2 = "60536666", SonsOfWar = "158929777", WrathOfSea = "165520893", ProtectorsOfEarth = "160542922", SkyTitans = "179282324", ArchAngel = "144043274", Anticipation = "168614529", TheMartyred = "186849544", AwakeP1 = "335631255", AwakeP2 = "335631297", ReadyAimFireP1 = "342455387", ReadyAimFireP2 = "342455399", DarkLordP1 = "209567483", DarkLordP2 = "209567529", BloodDrainP1 = "162914123", BloodDrainP2 = "162914203", DanceOfSwords = "320473062", Opal = "286415112", Calamity = "190454307", Hypnotica = "155968128", Nemisis = "160453802", Breathe = "276963903", GateToTheRift = "270655227", InfernalBeserking = "244143404", Trust = "246184492", AwakeningTheProject = "245121821", BloodPain = "242545577", Chaos = "247241693", NightmareFictionHighStake = "248062278", TheWhiteWeapon = "247236446", Gale = "256851659", ImperialCode = "256848383", Blitzkrieg = "306431437", RhapsodyRage = "348690251", TheGodFist = "348541501", BattleForSoul = "321185592", TheDarkColossus = "305976780", EmpireOfAngels = "302580452", Kronos = "302205297", Exorcist = "299796054", CrimsonFlames = "297799220", UltimatePower = "295753229", DrivingInTheDark = "295753229", AscendToPower = "293860654", GodOfTheSun = "293612495", DarkRider = "293861765", Vengeance = "293375555", SoundOfWar = "293376196", HellsCrusaders = "293012202", Legend = "293011823", RisingSouls = "290524959"} misc = {GroundSlam = "199145477", LaserSlash = "199145497", RailGunFire = "199145534", Charge1 = "199145659", Charge2 = "169380469", Charge3 = "169380479", EmptyGun = "203691822", GunShoot = "203691837", Stomp1 = "200632875", Stomp2 = "200632561", TelsaCannonCharge = "169445572", TelsaCannonShoot = "169445602", AncientHymm = "245313442"} wait(0.016666666666667) local player = game.Players.localPlayer local char = player.Character local mouse = player:GetMouse() local m = Instance.new("Model", char) local larm = char["Left Arm"] local rarm = char["Right Arm"] local lleg = char["Left Leg"] local rleg = char["Right Leg"] local hed = char.Head local torso = char.Torso local cam = game.Workspace.CurrentCamera local RootPart = char.HumanoidRootPart local equipped = false local attack = false local Anim = "Idle" local idle = 0 local sprint = false local battlestance = false local attacktype = 1 local state = "none" local torsovelocity = RootPart.Velocity * Vector3.new(1, 0, 1).magnitude local velocity = RootPart.Velocity.y local sine = 0 local change = 1 local on = false local grabbed = false local skill1 = false local skill2 = false local skill3 = false local skill4 = false local cooldown1 = 0 local cooldown2 = 0 local cooldown3 = 0 local cooldown4 = 0 local co1 = 10 local co2 = 20 local co3 = 30 local co4 = 50 local inputserv = game:GetService("UserInputService") local typing = false local crit = false local critchance = 2 local critdamageaddmin = 4 local critdamageaddmax = 8 local maxstamina = 100 local stamina = 0 local skill1stam = 10 local skill2stam = 20 local skill3stam = 40 local skill4stam = 50 local recovermana = 7 local defensevalue = 1.2 local speedvalue = 0.9 local mindamage = 8 local maxdamage = 9 local damagevalue = 1 local cn = CFrame.new local mr = math.rad local angles = CFrame.Angles local ud = UDim2.new local c3 = Color3.new local skillcolorscheme = c3(1, 1, 1) Character:FindFirstChild("Animate"):Destroy() weld = function(part0, part1, c0) local wld = Instance.new("Motor", part1) wld.Name = "Weld" wld.Part0 = part0 wld.Part1 = part1 wld.C0 = c0 return wld end Character = game.Players.localPlayer.Character Humanoid = Character.Humanoid if Humanoid:findFirstChild("Animate") then Humanoid:findFirstChild("Animate"):Destroy() end weld(torso, larm, cn(-1.5, 0.5, 0)) larm.Weld.C1 = cn(0, 0.65, 0) weld(torso, rarm, cn(1.5, 0.5, 0)) rarm.Weld.C1 = cn(0, 0.65, 0) weld(torso, hed, cn(0, 1.5, 0)) weld(torso, lleg, cn(-0.5, -1, 0)) lleg.Weld.C1 = cn(0, 1, 0) weld(torso, rleg, cn(0.5, -1, 0)) rleg.Weld.C1 = cn(0, 1, 0) weld(RootPart, torso, cn(0, -1, 0)) torso.Weld.C1 = cn(0, -1, 0) Humanoid = char.Humanoid if Humanoid:FindFirstChild("Animator") then Humanoid:FindFirstChild("Animator"):Destroy() end local scrn = Instance.new("ScreenGui", player.PlayerGui) makeframe = function(par, trans, pos, size, color) local frame = Instance.new("Frame", par) frame.BackgroundTransparency = trans frame.BorderSizePixel = 0 frame.Position = pos frame.Size = size frame.BackgroundColor3 = color return frame end makelabel = function(par, text) local label = Instance.new("TextLabel", par) label.BackgroundTransparency = 1 label.Size = ud(1, 0, 1, 0) label.Position = ud(0, 0, 0, 0) label.TextColor3 = c3(255, 255, 255) label.TextStrokeTransparency = 0 label.FontSize = Enum.FontSize.Size32 label.Font = Enum.Font.SourceSansBold label.BorderSizePixel = 0 label.TextScaled = true label.Text = text end framesk1 = makeframe(scrn, 0.5, ud(0.23, 0, 0.93, 0), ud(0.26, 0, 0.06, 0), skillcolorscheme) framesk2 = makeframe(scrn, 0.5, ud(0.5, 0, 0.93, 0), ud(0.26, 0, 0.06, 0), skillcolorscheme) framesk3 = makeframe(scrn, 0.5, ud(0.5, 0, 0.86, 0), ud(0.26, 0, 0.06, 0), skillcolorscheme) framesk4 = makeframe(scrn, 0.5, ud(0.23, 0, 0.86, 0), ud(0.26, 0, 0.06, 0), skillcolorscheme) bar1 = makeframe(framesk1, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme) bar2 = makeframe(framesk2, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme) bar3 = makeframe(framesk3, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme) bar4 = makeframe(framesk4, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), skillcolorscheme) text1 = makelabel(framesk1, "[C] Apocalypse Rush") text2 = makelabel(framesk2, "[V] Titan Bomb") text3 = makelabel(framesk3, "[X] Hades Stomp") text4 = makelabel(framesk4, "[Z] Great Divide") staminabar = makeframe(scrn, 0.5, ud(0.23, 0, 0.82, 0), ud(0.26, 0, 0.03, 0), c3(0.23921568627451, 0.67058823529412, 1)) staminacover = makeframe(staminabar, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), c3(0.23921568627451, 0.67058823529412, 1)) staminatext = makelabel(staminabar, "Power") healthbar = makeframe(scrn, 0.5, ud(0.5, 0, 0.82, 0), ud(0.26, 0, 0.03, 0), c3(1, 1, 0)) healthcover = makeframe(healthbar, 0, ud(0, 0, 0, 0), ud(1, 0, 1, 0), c3(1, 0.18039215686275, 0.1921568627451)) healthtext = makelabel(healthbar, "Health") local stats = Instance.new("Folder", char) stats.Name = "Stats" local block = Instance.new("BoolValue", stats) block.Name = "Block" block.Value = false local stun = Instance.new("BoolValue", stats) stun.Name = "Stun" stun.Value = false local defense = Instance.new("NumberValue", stats) defense.Name = "Defence" defense.Value = defensevalue local speed = Instance.new("NumberValue", stats) speed.Name = "Speed" speed.Value = speedvalue local damagea = Instance.new("NumberValue", stats) damagea.Name = "Damage" damagea.Value = damagevalue atktype = function(s, e) coroutine.resume(coroutine.create(function() attacktype = e wait(1.5) attacktype = s end )) end turncrit = function() coroutine.resume(coroutine.create(function() print("CRITICAL!") crit = true wait(0.25) crit = false end )) end subtractstamina = function(k) if k <= stamina then stamina = stamina - k end end fat = Instance.new("BindableEvent", script) fat.Name = "Heartbeat" script:WaitForChild("Heartbeat") frame = 0.033333333333333 tf = 0 allowframeloss = false tossremainder = false lastframe = tick() script.Heartbeat:Fire() game:GetService("RunService").Heartbeat:connect(function(s, p) tf = tf + s if frame <= tf then if allowframeloss then script.Heartbeat:Fire() lastframe = tick() else for i = 1, math.floor(tf / frame) do script.Heartbeat:Fire() end lastframe = tick() end if tossremainder then tf = 0 else tf = tf - frame * math.floor(tf / frame) end end end ) Lerp = function(a, b, i) local com1 = {a.X, a.Y, a.Z, a:toEulerAnglesXYZ()} local com2 = {b.X, b.Y, b.Z, b:toEulerAnglesXYZ()} local calx = com1[1] + (com2[1] - com1[1]) * i local caly = com1[2] + (com2[2] - com1[2]) * i local calz = com1[3] + (com2[3] - com1[3]) * i local cala = com1[4] + (com2[4] - com1[4]) * i local calb = com1[5] + (com2[5] - com1[5]) * i local calc = com1[6] + (com2[6] - com1[6]) * i return CFrame.new(calx, caly, calz) * CFrame.Angles(cala, calb, calc) end local Lerp = CFrame.new().lerp randomizer = function(percent) local randomized = math.random(0, 100) if randomized <= percent then return true else if percent <= randomized then return false end end end begoneoutlines = function(part) part.BottomSurface = 10 end rayCast = function(pos, dir, maxl, ignore) return game:service("Workspace"):FindPartOnRay(Ray.new(pos, dir.unit * (maxl or 999.999)), ignore) end makeeffect = function(par, size, pos1, trans, trans1, howmuch, delay1, id, type) local p = Instance.new("Part", par or workspace) p.CFrame = pos1 p.Anchored = true p.Material = "Plastic" p.CanCollide = false p.TopSurface = 0 p.Size = Vector3.new(1, 1, 1) p.BottomSurface = 0 p.Transparency = trans p.FormFactor = "Custom" begoneoutlines(p) local mesh = Instance.new("SpecialMesh", p) mesh.Scale = size if id ~= nil and type == nil then mesh.MeshId = "rbxassetid://" .. id else if id == nil and type ~= nil then mesh.MeshType = type else if id == nil and type == nil then mesh.MeshType = "Brick" end end end game:GetService("Debris"):AddItem(p, delay1) coroutine.wrap(function() for i = 0, delay1, 0.1 do wait(0.016666666666667) p.CFrame = p.CFrame mesh.Scale = mesh.Scale + howmuch p.Transparency = p.Transparency + trans1 end p:Destroy() end )() return p end clangy = function(cframe) wait(0.016666666666667) local clang = {} local dis = 0 local part = Instance.new("Part", nil) part.CFrame = cframe part.Anchored = true part.CanCollide = false part.BrickColor = BrickColor.new("New Yeller") part.FormFactor = "Custom" part.Name = "clanger" part.Size = Vector3.new(0.2, 0.2, 0.2) part.TopSurface = 10 part.BottomSurface = 10 part.RightSurface = 10 part.LeftSurface = 10 part.BackSurface = 10 part.FrontSurface = 10 part:BreakJoints() local mesh = Instance.new("BlockMesh", part) coroutine.wrap(function() for i = 1, 7 do do wait(0.016666666666667) dis = dis + 0.2 local partc = part:clone() partc.Parent = workspace partc.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(dis, 0, 0) partc.CFrame = partc.CFrame * CFrame.new(0, dis, 0) table.insert(clang, partc) end end for i,v in pairs(clang) do coroutine.wrap(function() for i = 1, 10 do wait(0.01) v.Transparency = v.Transparency + 0.1 end v:destroy() end )() end end )() end circle = function(color, pos1) local p = Instance.new("Part", m) p.BrickColor = BrickColor.new(color) p.CFrame = pos1 p.Anchored = true p.Material = "Plastic" p.CanCollide = false p.TopSurface = 0 p.Size = Vector3.new(1, 1, 1) p.BottomSurface = 0 p.Transparency = 0.35 p.FormFactor = "Custom" local mesh = Instance.new("CylinderMesh", p) mesh.Scale = Vector3.new(0, 0, 0) coroutine.wrap(function() for i = 0, 5, 0.1 do wait(0.016666666666667) p.CFrame = p.CFrame mesh.Scale = mesh.Scale + Vector3.new(0.5, 0, 0.5) p.Transparency = p.Transparency + 0.025 end p:Destroy() end )() end firespaz1 = function(color, pos1) local p = Instance.new("Part", m) p.BrickColor = BrickColor.new(color) p.CFrame = pos1 p.Anchored = true p.Material = "Plastic" p.CanCollide = false p.TopSurface = 0 p.Size = Vector3.new(1, 1, 1) p.BottomSurface = 0 p.Transparency = 0.5 p.FormFactor = "Custom" local mesh = Instance.new("BlockMesh", p) mesh.Scale = Vector3.new(1, 1, 1) coroutine.wrap(function() for i = 0, 15, 0.1 do wait(0.033333333333333) p.CFrame = p.CFrame * CFrame.new(0, 0.1, 0) mesh.Scale = mesh.Scale - Vector3.new(0.1, 0.1, 0.1) p.Transparency = p.Transparency + 0.025 end p:Destroy() end )() end pickrandom = function(tablesa) local randomized = tablesa[math.random(1, #tablesa)] return randomized end sound = function(id, pitch, volume, par, last) local s = Instance.new("Sound", par or torso) s.SoundId = "rbxassetid://" .. id s.Pitch = pitch or 1 s.Volume = volume or 1 wait() s:play() game.Debris:AddItem(s, last or 120) end clangy = function(cframe) wait(0.016666666666667) local clang = {} local dis = 0 local part = Instance.new("Part", nil) part.CFrame = cframe part.Anchored = true part.CanCollide = false part.BrickColor = BrickColor.new("New Yeller") part.FormFactor = "Custom" part.Name = "clanger" part.Size = Vector3.new(0.2, 0.2, 0.2) part.TopSurface = 10 part.BottomSurface = 10 part.RightSurface = 10 part.LeftSurface = 10 part.BackSurface = 10 part.FrontSurface = 10 part:BreakJoints() local mesh = Instance.new("BlockMesh", part) coroutine.wrap(function() for i = 1, 7 do do wait(0.016666666666667) dis = dis + 0.2 local partc = part:clone() partc.Parent = workspace partc.CFrame = part.CFrame * CFrame.fromEulerAnglesXYZ(dis, 0, 0) partc.CFrame = partc.CFrame * CFrame.new(0, dis, 0) table.insert(clang, partc) end end for i,v in pairs(clang) do coroutine.wrap(function() for i = 1, 10 do wait(0.01) v.Transparency = v.Transparency + 0.1 end v:destroy() end )() end end )() end so = function(id, par, vol, pit) coroutine.resume(coroutine.create(function() local sou = Instance.new("Sound", par or workspace) sou.Volume = vol sou.Pitch = pit or 1 sou.SoundId = id wait() sou:play() game:GetService("Debris"):AddItem(sou, 6) end )) end getclosest = function(obj, dis, player) if player.Torso.CFrame.p - obj.magnitude >= dis then do return not player end do local list = {} for i,v in pairs(workspace:GetChildren()) do if v:IsA("Model") and v:findFirstChild("Torso") and v ~= char and v.Torso.Position - obj.magnitude <= dis then table.insert(list, v) end if v:IsA("Part") and v.Name:lower() == "hitbox" and v.Parent.Parent ~= char and v.Position - obj.magnitude <= dis then local pos = CFrame.new(0, 1, -1) do sound(pickrandom(clangsounds), math.random(100, 150) / 100, 1, torso, 6) coroutine.wrap(function() for i = 1, 4 do clangy(torso.CFrame * pos * CFrame.Angles(0, math.rad(math.random(0, 360)), 0)) end end )() end end end do return list end -- DECOMPILER ERROR: 4 unprocessed JMP targets end end end makegui = function(cframe, text) local a = math.random(-10, 10) / 100 local c = Instance.new("Part") c.Transparency = 1 Instance.new("BodyGyro").Parent = c c.Parent = m c.CFrame = CFrame.new(cframe.p + Vector3.new(0, 1.5, 0)) local f = Instance.new("BodyPosition") f.P = 2000 f.D = 100 f.maxForce = Vector3.new(math.huge, math.huge, math.huge) f.position = c.Position + Vector3.new(0, 3, 0) f.Parent = c game:GetService("Debris"):AddItem(c, 6.5) c.CanCollide = false m.Parent = workspace c.CanCollide = false local bg = Instance.new("BillboardGui", m) bg.Adornee = c bg.Size = UDim2.new(1, 0, 1, 0) bg.StudsOffset = Vector3.new(0, 0, 0) bg.AlwaysOnTop = false local tl = Instance.new("TextLabel", bg) tl.BackgroundTransparency = 1 tl.Size = UDim2.new(1, 0, 1, 0) tl.Text = text tl.Font = "SourceSansBold" tl.FontSize = "Size42" if crit == true then tl.TextColor3 = Color3.new(0.70588235294118, 0, 0) else tl.TextColor3 = Color3.new(255, 0.70588235294118, 0.2) end tl.TextStrokeTransparency = 0 tl.TextScaled = true tl.TextWrapped = true coroutine.wrap(function() wait(2) for i = 1, 10 do fat.Event:wait() tl.TextTransparency = tl.TextTransparency + 0.1 end end )() end tag = function(hum, player) local creator = Instance.new("ObjectValue", hum) creator.Value = player creator.Name = "creator" end untag = function(hum) if hum ~= nil then local tag = hum:findFirstChild("creator") if tag ~= nil then tag.Parent = nil end end end tagplayer = function(h) coroutine.wrap(function() tag(h, player) wait(1) untag(h) end )() end damage = function(hit, mind, maxd, knock, type, prop) do if hit.Name:lower() == "hitbox" then local pos = CFrame.new(0, 1, -1) do sound(pickrandom(clangsounds), math.random(100, 150) / 100, 1, torso, 6) coroutine.wrap(function() for i = 1, 4 do clangy(torso.CFrame * pos * CFrame.Angles(0, math.rad(math.random(0, 360)), 0)) end end )() end end if hit.Parent == nil then return end local h = hit.Parent:FindFirstChild("Humanoid") for i,v in pairs(hit.Parent:children()) do if v:IsA("Humanoid") then h = v end end if hit.Parent.Parent:FindFirstChild("Torso") ~= nil then h = hit.Parent.Parent:FindFirstChild("Humanoid") end if hit.Parent:IsA("Hat") then hit = hit.Parent.Parent:findFirstChild("Head") end local D = math.random(mind, maxd) * damagea.Value if h then if h.Parent:FindFirstChild("Stats") then D = D / h.Parent:FindFirstChild("Stats").Defence.Value else end end if h.Parent:FindFirstChild("Stats") or h and h.Parent.Head then makegui(h.Parent.Head.CFrame, tostring(math.floor(D + 0.5))) end TagService:NewTag(h.Parent, Player, "Astaroth", D) if h ~= nil and hit.Parent.Name ~= char.Name and hit.Parent:FindFirstChild("Torso") ~= nil then if type == 1 then tagplayer(h) local asd = randomizer(critchance) if asd == true then turncrit() end if crit == false then game.ReplicatedStorage.Remotes.HealthEvent:FireServer(h, D, 1) else game.ReplicatedStorage.Remotes.HealthEvent:FireServer(h, D + math.random(critdamageaddmin, critdamageaddmax), 1) end so("http://www.roblox.com/asset/?id=169462037", hit, 1, math.random(150, 200) / 100) local vp = Instance.new("BodyVelocity") vp.P = 500 vp.maxForce = Vector3.new(math.huge, 0, math.huge) vp.velocity = prop.CFrame.lookVector * knock + prop.Velocity / 1.05 if knock > 0 then vp.Parent = hit.Parent.Torso end game:GetService("Debris"):AddItem(vp, 0.5) else do if type == 2 then so("http://www.roblox.com/asset/?id=169462037", hit, 1, math.random(150, 200) / 100) local asd = randomizer(critchance) if asd == true then turncrit() end if crit == false then game.ReplicatedStorage.Remotes.HealthEvent:FireServer(h, D, 1) else game.ReplicatedStorage.Remotes.HealthEvent:FireServer(h, D + math.random(critdamageaddmin, critdamageaddmax), 1) end tagplayer(h) else do if type == 3 then tagplayer(h) local asd = randomizer(critchance) if asd == true then turncrit() end if crit == false then game.ReplicatedStorage.Remotes.HealthEvent:FireServer(h, D, 1) else game.ReplicatedStorage.Remotes.HealthEvent:FireServer(h, D + math.random(critdamageaddmin, critdamageaddmax), 1) end char.Humanoid.Health = char.Humanoid.Health + D / 2 so("http://www.roblox.com/asset/?id=206083232", hit, 1, 1.5) for i = 1, 10 do firespaz1("Bright red", hit.CFrame * CFrame.Angles(math.random(0, 3), math.random(0, 3), math.random(0, 3))) end else do if type == 4 then h.Health = h.Health + D so("http://www.roblox.com/asset/?id=186883084", hit, 1, 1) circle("Dark green", h.Parent.Torso.CFrame * CFrame.new(0, -2.5, 0)) end end end end end end end end end end subtrackstamina = function(k) if k <= stamina then stamina = stamina - k end end getclosest_angled = function(obj, dis, max_deg, player) if not max_deg then max_deg = 49.333 end if player.Torso.CFrame.p - obj.magnitude >= dis then do return not player end do local list = {} for i,v in pairs(workspace:GetChildren()) do if v:IsA("Model") and v:findFirstChild("Torso") and v ~= char then if v.Torso.Position - obj.magnitude <= dis then local lv = -torso.CFrame.lookVector * Vector3.new(1, 0, 1).unit do local to = (torso.Position - v.Torso.Position) * Vector3.new(1, 0, 1).unit if math.deg(math.acos(lv:Dot(to))) <= max_deg then print("it worked") table.insert(list, v) else do print("nope", math.deg(math.acos(lv:Dot(to)))) -- DECOMPILER ERROR at PC98: LeaveBlock: unexpected jumping out IF_ELSE_STMT -- DECOMPILER ERROR at PC98: LeaveBlock: unexpected jumping out IF_STMT end end end else print("no distance") end end if v:IsA("Part") and v.Name:lower() == "hitbox" and v.Parent.Parent ~= char and v.Position - obj.magnitude <= dis * 1.55 then local pos = CFrame.new(0, 1, -1) sound(pickrandom(clangsounds), math.random(100, 150) / 100, 1, torso, 6) coroutine.wrap(function() for i = 1, 4 do clangy(torso.CFrame * pos * CFrame.Angles(0, math.rad(math.random(0, 360)), 0)) end end )() end end do return list end -- DECOMPILER ERROR: 6 unprocessed JMP targets end end end attackone = function() attack = true for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, -0.8, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0.8, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(2.4, -0.5, -0.3), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-0.7, 0.65, -0.5) * angles(2, 0, 0.9), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 1.5) * angles(0, 0, 0), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), 0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) end end end so("http://roblox.com/asset/?id=" .. woosh.Heavy4, hitbox, 1, 1.1) for i,v in pairs(getclosest_angled(torso.CFrame.p, 8, 90)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, mindamage, maxdamage, 1, 1, RootPart) end end for i = 0, 1.5, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, 0.5, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, -0.5, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(0.4, -0.5, -0.3), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, -0.5) * angles(0, 0, 0.9), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 1.5) * angles(-0.1, 0.2, 0), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), -0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), -0.5, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, -0.5, 0), 0.4) end end end attack = false atktype(1, 2) end attacktwo = function() attack = true for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, 0.8, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, -0.8, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1.5, 1.5, -0.3), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(1.2, 0, -0.3), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), -0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), -0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, -0.8, 0), 0.4) end end end so("http://roblox.com/asset/?id=" .. woosh.Heavy4, hitbox, 1, 1) for i,v in pairs(getclosest_angled(torso.CFrame.p, 8, 90)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, mindamage, maxdamage, 1, 1, RootPart) end end for i = 0, 1.5, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, -0.8, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0.8, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1, 1.5, 0.3) * angles(-0.6, 0, 0), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-0.7, 0.65, -0.5) * angles(1.4, 0, 1), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(-0.2, 0, 0), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), 0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) end end end attack = false atktype(1, 3) end attackthree = function() attack = true for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, -0.8, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0.8, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1.5, -1.5, -0.3), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-0.7, 0.65, 0) * angles(1.34, 0, 0.3), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), 0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) end end end so("http://roblox.com/asset/?id=" .. woosh.Heavy4, hitbox, 1, 0.7) for i,v in pairs(getclosest_angled(torso.CFrame.p, 8, 90)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, mindamage, maxdamage, 1, 1, RootPart) end end for i = 0, 1.5, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, 0.8, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, -0.8, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1, -1.5, -0.3) * angles(-0.6, 0, 0), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-0.7, 0.65, -0.5) * angles(1.4, 0, 1), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(-0.2, 0, 0), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), -0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), -0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, -0.8, 0), 0.4) end end end attack = false atktype(1, 1) end greatdivide = function() attack = true for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0.5, 0, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1, 0.65, -0.5) * angles(2.5, 0, -0.785), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1, 0.65, -0.5) * angles(2.2, 0, 0.785), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(-0.6, -0.3, 0.7) * angles(0, 0, 0.785), 0.3) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(-0.5 + math.rad(-40 * math.cos(sine / 10)), 0, 0), 0.3) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(-0.5 + math.rad(40 * math.cos(sine / 10)), 0, 0), 0.3) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(-0.5, 0, 0), 0.3) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(-0.5, 0, 0), 0.3) end end end so("http://roblox.com/asset/?id=" .. woosh.Heavy4, hitbox, 1, 1) for i,v in pairs(getclosest_angled(torso.CFrame.p, 8, 90)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, 10, 12, 1, 1, RootPart) end end for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(-0.2, 0, 0), 0.4) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0, 0), 0.4) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1, 0.5, -0.5) * angles(0.7, 0, -0.785), 0.4) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1, 0.5, -0.5) * angles(0.5, 0, 0.785), 0.4) handleweld.C0 = Lerp(handleweld.C0, cn(-0.6, -0.2, 0.7) * angles(0, 0, 0.785) * angles(-0.3, 0, 0), 0.4) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0.2 + math.rad(-40 * math.cos(sine / 10)), 0, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0.2 + math.rad(40 * math.cos(sine / 10)), 0, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0.2, 0, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0.2, 0, 0), 0.4) end end end attack = false end hadesstomp = function() attack = true speed.Value = 0 for i = 0, 2, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0.3, 0, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0.3, 0, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(2, 1.2, 0), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.7, -0.5) * angles(2.7, 0, 0.3), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 1) * angles(0, 0, 0), 0.3) lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(-0.3, 0, -0.1), 0.3) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, 0, -1) * CFrame.Angles(-0.3, 0, 0), 0.3) end so("rbxassetid://" .. misc.GroundSlam, torso, 1, 0.9) local a = makeeffect(workspace, Vector3.new(1, 1, 1), RootPart.CFrame * cn(0, 0, 0), 0.35, 0.025, Vector3.new(1, 0.1, 1), 10, Meshes.Blast, nil) a.BrickColor = BrickColor.new("Bright green") local a = makeeffect(workspace, Vector3.new(1, 1, 1), RootPart.CFrame * cn(0, -3, 0) * angles(math.rad(90), 0, 0), 0.35, 0.025, Vector3.new(1, 1, 1), 10, Meshes.Ring, nil) a.BrickColor = BrickColor.new("Bright green") for i,v in pairs(getclosest(torso.CFrame.p, 10)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, 11, 13, 1, 1, RootPart) end end for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(-0.3, 0, 0), 0.3) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(-0.3, 0, 0), 0.3) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(-0.5, 0, 0.3), 0.3) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(-0.5, 0, -0.3), 0.3) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 1) * angles(0, 0, 0), 0.3) lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0.3, 0, -0.1), 0.3) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, -0.5) * CFrame.Angles(0.3, 0, 0), 0.3) end speed.Value = speedvalue attack = false end weld5 = function(part0, part1, c0, c1) local weeld = Instance.new("Weld", part0) weeld.Part0 = part0 weeld.Part1 = part1 weeld.C0 = c0 weeld.C1 = c1 return weeld end checkclose = function(Obj, Dist) for _,v in pairs(workspace:GetChildren()) do if v:FindFirstChild("Humanoid") and v:FindFirstChild("Torso") and v ~= char then local DistFromTorso = v.Torso.Position - Obj.Position.magnitude if DistFromTorso < Dist then return v end end end end apocpound = function() attack = true so("http://roblox.com/asset/?id=200632211", larm, 1, 0.9) local target = checkclose(larm, 7) if grabbed == false then if target then target.Humanoid.PlatformStand = true if target ~= nil then grabbed = true subtractstamina(skill3stam) cooldown3 = 0 local asd = weld5(larm, target:FindFirstChild("Torso"), CFrame.new(0, -1.7, 0), CFrame.new(0, 0, 0)) asd.Parent = larm asd.Name = "asd" asd.C0 = asd.C0 * CFrame.Angles(math.rad(-90), 0, -1.57) so("http://roblox.com/asset/?id=200632821", torso, 1, 0.9) coroutine.wrap(function() wait(2) target.Humanoid.PlatformStand = false end )() end else do if target == nil then subtractstamina(skill3stam / 2) cooldown3 = cooldown3 / 2 end for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, -0.8, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0.8, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1, 0, 0.2), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(1.2, 0, -0.3), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, -1, 0.8) * angles(1.5, 0.3, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), 0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0.8, 0), 0.4) end end end if grabbed == true then for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, 0.8, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, -0.8, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1, 0, 0.5), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(2.3, 0, -0.3), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, -1, 0.8) * angles(1.5, 0.3, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), -0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), -0.8, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -0.8, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, -0.8, 0), 0.4) end end end target.Torso.Velocity = RootPart.CFrame.lookVector * 50 for i = 0, 0.4, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, -0.5, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0.5, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(2, 0.5, 0.3), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(1, 0, 0.5), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), 0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), 0.5, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0.5, 0), 0.4) end end end for i,v in pairs(larm:GetChildren()) do if v.Name == "asd" and v:IsA("Weld") then v:destroy() end end so("http://roblox.com/asset/?id=200632211", larm, 1, 0.4) for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, -0.5, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, 0.5, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(2, 0.5, 0.3), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(1, 0, 0.5), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), 0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), 0.5, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, 0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, 0.5, 0), 0.4) end end end RootPart.Velocity = RootPart.CFrame.lookVector * 30 so("http://roblox.com/asset/?id=" .. woosh.Heavy4, hitbox, 1, 1) for i,v in pairs(getclosest(torso.CFrame.p, 10)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, 16, 18, 1, 1, RootPart) end end so("rbxassetid://" .. misc.GroundSlam, torso, 1, 0.9) local a = makeeffect(workspace, Vector3.new(1, 1, 1), RootPart.CFrame * cn(0, 0, -7), 0.35, 0.025, Vector3.new(1, 0.1, 1), 10, Meshes.Blast, nil) a.BrickColor = BrickColor.new("Bright green") local a = makeeffect(workspace, Vector3.new(1, 1, 1), RootPart.CFrame * cn(0, -3, -5) * angles(math.rad(90), 0, 0), 0.35, 0.025, Vector3.new(1, 1, 1), 10, Meshes.Ring, nil) a.BrickColor = BrickColor.new("Bright green") for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, 0.5, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(-0.3, -0.5, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(0.5, 0, 0.3), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(1, 0, 0.5), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(-0.3, 0, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), -0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), -0.5, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, -0.5, 0), 0.4) end end end end do grabbed = false attack = false end end end end end titanbomb = function() attack = true for i = 0, 1, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0, 0.3, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0.3, -0.5, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(2.5, 0, 0.2), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(-0.2, 0, -0.3), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 2) * angles(0, 0, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(math.rad(-40 * math.cos(sine / 10)), -0.3, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(math.rad(40 * math.cos(sine / 10)), -0.3, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0, -0.3, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0, -0.3, 0), 0.4) end end end so("rbxassetid://180204501", torso, 1, 1) so("rbxassetid://180199726", torso, 1, 1) local a = makeeffect(workspace, Vector3.new(1, 1, 1), RootPart.CFrame * cn(0, 0, -3), 0.35, 0.025, Vector3.new(1, 0.1, 1), 10, Meshes.Blast, nil) a.BrickColor = BrickColor.new("Bright green") local a = makeeffect(workspace, Vector3.new(3, 3, 3), RootPart.CFrame * cn(0, 0, 0), 0.35, 0.025, Vector3.new(1, 1, 1), 10, nil, "Sphere") a.BrickColor = BrickColor.new("Bright green") local a = makeeffect(workspace, Vector3.new(1, 1, 1), RootPart.CFrame * cn(0, -3, -1) * angles(math.rad(90), 0, 0), 0.35, 0.025, Vector3.new(1, 1, 1), 10, Meshes.Ring, nil) a.BrickColor = BrickColor.new("Bright green") for i,v in pairs(getclosest(torso.CFrame.p, 15)) do if v:FindFirstChild("Humanoid") then damage(v.Torso, 18, 21, 1, 1, RootPart) end end speed.Value = 0 for i = 0, 2, 0.1 do fat.Event:wait() torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1.3, 0) * angles(-0.1, 0.5, 0), 0.5) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(-0.1, -0.5, 0), 0.5) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1.5, 0, 0.1), 0.5) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(-0.5, 0, -0.3), 0.5) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 2) * angles(0, 0, 0), 0.5) if torsovelocity > 2 and torsovelocity < 18 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(0.1 + math.rad(-40 * math.cos(sine / 10)), -0.5, 0), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(0.1 + math.rad(40 * math.cos(sine / 10)), -0.5, 0), 0.4) else if torsovelocity < 1 then lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.6, -0.8, 0) * CFrame.Angles(0.1, -0.5, -0.1), 0.4) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.65, -0.8, -0.1) * CFrame.Angles(0.1, -0.5, 0.1), 0.4) end end end speed.Value = speedvalue attack = false end mouse.Button1Down:connect(function() if attack == false then if attacktype == 1 then attackone() else if attacktype == 2 then attacktwo() else if attacktype == 3 then attackthree() end end end end end ) inputserv.InputBegan:connect(function(k) if k.KeyCode == Enum.KeyCode.Z and attack == false and typing == false and co1 <= cooldown1 and skill1stam <= stamina then subtractstamina(skill1stam) cooldown1 = 0 greatdivide() else if k.KeyCode == Enum.KeyCode.X and attack == false and typing == false and co2 <= cooldown2 and skill2stam <= stamina then subtractstamina(skill2stam) cooldown2 = 0 hadesstomp() else if k.KeyCode == Enum.KeyCode.C and attack == false and typing == false and co3 <= cooldown3 and skill3stam <= stamina then apocpound() else if k.KeyCode == Enum.KeyCode.V and attack == false and typing == false and co4 <= cooldown4 and skill4stam <= stamina then subtractstamina(skill4stam) cooldown4 = 0 titanbomb() end end end end end ) inputserv.InputBegan:connect(function(k) if k.KeyCode == Enum.KeyCode.Slash then local fin = nil do typing = true fin = inputserv.InputBegan:connect(function(k) if k.KeyCode == Enum.KeyCode.Return or k.UserInputType == Enum.UserInputType.MouseButton1 then typing = false fin:disconnect() end end ) end end end ) updateskills = function() if cooldown1 <= co1 then cooldown1 = cooldown1 + 0.033333333333333 end if cooldown2 <= co2 then cooldown2 = cooldown2 + 0.033333333333333 end if cooldown3 <= co3 then cooldown3 = cooldown3 + 0.033333333333333 end if cooldown4 <= co4 then cooldown4 = cooldown4 + 0.033333333333333 end if stamina <= skill1stam then bar4.BackgroundColor3 = c3(0.4078431372549, 0.4078431372549, 0.4078431372549) else bar4.BackgroundColor3 = skillcolorscheme end if stamina <= skill2stam then bar3.BackgroundColor3 = c3(0.4078431372549, 0.4078431372549, 0.4078431372549) else bar3.BackgroundColor3 = skillcolorscheme end if stamina <= skill3stam then bar1.BackgroundColor3 = c3(0.4078431372549, 0.4078431372549, 0.4078431372549) else bar1.BackgroundColor3 = skillcolorscheme end if stamina <= skill4stam then bar2.BackgroundColor3 = c3(0.4078431372549, 0.4078431372549, 0.4078431372549) else bar2.BackgroundColor3 = skillcolorscheme end if stamina <= maxstamina then stamina = stamina + recovermana / 30 end end Character.Humanoid.Died:connect(function() for i,v in pairs(Character:GetChildren()) do if v:IsA("Model") then v:destroy() end end end ) fat.Event:connect(function() updateskills() healthcover:TweenSize(ud(1 * (char.Humanoid.Health / char.Humanoid.MaxHealth), 0, 1, 0), "Out", "Quad", 0.5) staminacover:TweenSize(ud(1 * (stamina / maxstamina), 0, 1, 0), "Out", "Quad", 0.5) bar4:TweenSize(ud(1 * (cooldown1 / co1), 0, 1, 0), "Out", "Quad", 0.5) bar3:TweenSize(ud(1 * (cooldown2 / co2), 0, 1, 0), "Out", "Quad", 0.5) bar1:TweenSize(ud(1 * (cooldown3 / co3), 0, 1, 0), "Out", "Quad", 0.5) bar2:TweenSize(ud(1 * (cooldown4 / co4), 0, 1, 0), "Out", "Quad", 0.5) torsovelocity = RootPart.Velocity * Vector3.new(1, 0, 1).magnitude velocity = RootPart.Velocity.y sine = sine + change local hit, pos = rayCast(RootPart.Position, CFrame.new(RootPart.Position, RootPart.Position - Vector3.new(0, 1, 0)).lookVector, 4, char) char.Humanoid.WalkSpeed = 16 * speed.Value if equipped == true or equipped == false then if RootPart.Velocity.y > 1 and hit == nil and stun.Value ~= true then Anim = "Jump" if attack == false then torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(0.3, 0, 0), 0.2) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0.3, 0, 0), 0.2) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(0.7, 1.57, 0), 0.2) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(0.7, -1.57, 0), 0.2) lleg.Weld.C0 = Lerp(lleg.Weld.C0, cn(-0.5, -1, 0) * angles(-0.4, 0, -0.3), 0.2) rleg.Weld.C0 = Lerp(rleg.Weld.C0, cn(0.5, -1, 0) * angles(-0.4, 0, 0.3), 0.2) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.2) end else if RootPart.Velocity.y < -1 and hit == nil and stun.Value ~= true then Anim = "Fall" if attack == false then torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1, 0) * angles(-0.1, 0, 0), 0.2) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(-0.3, 0, 0), 0.2) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(3, 1.57, 0) * angles(-0.3, 0, 0), 0.2) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(3, -1.57, 0) * angles(-0.3, 0, 0), 0.2) lleg.Weld.C0 = Lerp(lleg.Weld.C0, cn(-0.5, -1, 0) * angles(0, 0, -0.1), 0.2) rleg.Weld.C0 = Lerp(rleg.Weld.C0, cn(0.5, -1, 0) * angles(0, 0, 0.1), 0.2) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.2) end else if torsovelocity < 1 and hit ~= nil and stun.Value ~= true then Anim = "Idle" if attack == false then change = 1 torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1.1 + 0.1 * math.cos(sine / 50), 0) * angles(0, 0, 0), 0.2) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0.1 * math.cos(sine / 50), 0, 0), 0.2) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(0.7 - 0.1 * math.cos(sine / 50), 1.57, 0), 0.2) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.65, 0) * angles(0.7 - 0.1 * math.cos(sine / 50), -1.57, 0), 0.2) lleg.Weld.C0 = Lerp(lleg.Weld.C0, cn(-0.5, -0.9 - 0.1 * math.cos(sine / 50), 0) * angles(0, 0, -0.05), 0.2) rleg.Weld.C0 = Lerp(rleg.Weld.C0, cn(0.5, -0.9 - 0.1 * math.cos(sine / 50), 0) * angles(0, 0, 0.05), 0.2) handleweld.C0 = Lerp(handleweld.C0, cn(0, 0, 0) * angles(0, 0, 0), 0.2) end else if torsovelocity > 2 and torsovelocity < 18 and hit ~= nil and stun.Value ~= true then Anim = "Walk" if attack == false then local asd = 5 torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1 + 0.05 * math.cos(sine / 4), 0) * angles(-0.1, 0, 0), 0.2) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, -0.2, 0), 0.2) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1, 0, -0.3), 0.2) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-0.8, 0.5, -0.5) * angles(1.3, 0, 1.2), 0.2) lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5, -1, 0) * CFrame.Angles(1.5 * math.cos(sine / 3), 0, 0), 0.2) rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5, -1, 0) * CFrame.Angles(-1.5 * math.cos(sine / 3), 0, 0), 0.2) handleweld.C0 = Lerp(handleweld.C0, cn(0, -1, 0.8) * angles(1.1, 0.3, 0), 0.2) end else do if torsovelocity >= 18 and hit ~= nil and stun.Value ~= true then Anim = "Run" if attack == false then local asd = 5 torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -1 + 0.05 * math.cos(sine / 4), 0) * angles(-0.1, 0, 0), 0.2) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(0, -0.2, 0), 0.2) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.65, 0) * angles(1, 0, -0.3), 0.2) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-0.8, 0.5, -0.5) * angles(1.3, 0, 1.2), 0.2) rleg.Weld.C0 = Lerp(rleg.Weld.C0, cn(0.5, -1 - 0.5 * math.cos(sine / asd) / 2, 0.5 * math.cos(sine / asd) / 2) * angles(math.rad(-25 * math.cos(sine / asd)) + -math.sin(sine / asd) / 2.3, 0, 0) * angles(math.rad(-2.5), 0, 0), 0.15) lleg.Weld.C0 = Lerp(lleg.Weld.C0, cn(-0.5, -1 + 0.5 * math.cos(sine / asd) / 2, -0.5 * math.cos(sine / asd) / 2) * angles(math.rad(25 * math.cos(sine / asd)) + math.sin(sine / asd) / 2.3, 0, 0) * angles(math.rad(-2.5), 0, 0), 0.15) handleweld.C0 = Lerp(handleweld.C0, cn(0, -1, 0.8) * angles(1.1, 0.3, 0), 0.2) end else do if stun.Value == true and attack == false then char.Humanoid.WalkSpeed = 0 torso.Weld.C0 = Lerp(torso.Weld.C0, cn(0, -3, 0) * angles(mr(40), 0, 0), 0.2) hed.Weld.C0 = Lerp(hed.Weld.C0, cn(0, 1.5, 0) * angles(mr(-20), 0, 0), 0.2) rarm.Weld.C0 = Lerp(rarm.Weld.C0, cn(1.5, 0.5, 0) * angles(mr(-50), 0, 0), 0.2) larm.Weld.C0 = Lerp(larm.Weld.C0, cn(-1.5, 0.5, 0) * angles(mr(-50), 0, 0), 0.2) lleg.Weld.C0 = Lerp(lleg.Weld.C0, cn(-0.5, -0.3, -0.7) * angles(mr(-10), 0, 0), 0.2) rleg.Weld.C0 = Lerp(rleg.Weld.C0, cn(0.5, -1, 0) * angles(mr(50), 0, 0), 0.2) handleweld.C0 = Lerp(handleweld.C0, cn() * angles(), 0.2) end end end end end end end end end end )
ISDoubleDoor = {}
local plateTable = {} RegisterCommand("addplate", function(source, args, rawCommand) if IsPlayerAceAllowed(source, Config.addPlatePerms) or IsPlayerAceAllowed(source, Config.AdminPerm) or Config.NoPerms == true then local newPlate = table.concat(args, ""):upper():gsub("%s+","") local loadFile = LoadResourceFile(GetCurrentResourceName(), "plates.json") local loadedFile = json.decode(loadFile) if args[1] then if has_value(loadedFile.Plates, newPlate) then TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1This plate is already being tracked!"} }) else table.insert(loadedFile.Plates, newPlate) TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "Plate: ^1^*"..newPlate.."^r^0 added to the tracker."} }) end else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1You need to specify a plate to track!"} }) end SaveResourceFile(GetCurrentResourceName(), "plates.json", json.encode(loadedFile), -1) else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1Insuficient Premissions"} }) end end) RegisterCommand("delplate", function(source, args, rawCommand) if IsPlayerAceAllowed(source, Config.delPlatePerms) or IsPlayerAceAllowed(source, Config.AdminPerm) or Config.NoPerms == true then local newPlate = table.concat(args, ""):upper():gsub("%s+","") local loadFile = LoadResourceFile(GetCurrentResourceName(), "plates.json") local loadedFile = json.decode(loadFile) if args[1] then if has_value(loadedFile.Plates, newPlate) then removebyKey(loadedFile.Plates, newPlate) TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "Plate: ^1^*"..newPlate.."^r^0 removed from the tracker."} }) else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1This plate is not being tracked!"} }) end else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1You need to specify a plate to remove from the tracker!"} }) end SaveResourceFile(GetCurrentResourceName(), "plates.json", json.encode(loadedFile), -1) else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1Insuficient Premissions"} }) end end) RegisterCommand("clearplates", function(source, args, rawCommand) if IsPlayerAceAllowed(source, Config.clearPlatePerms) or IsPlayerAceAllowed(source, Config.AdminPerm) or Config.NoPerms == true then local loadFile = LoadResourceFile(GetCurrentResourceName(), "plates.json") local loadedFile = {Plates = {}} SaveResourceFile(GetCurrentResourceName(), "plates.json", json.encode(loadedFile), -1) TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "Removed all plates from the tracker!"} }) else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1Insuficient Premissions"} }) end end) RegisterCommand("plates", function(source, args, rawCommand) if IsPlayerAceAllowed(source, Config.SeePlatesPerm) or IsPlayerAceAllowed(source, Config.AdminPerm) or Config.NoPerms == true then local loadFile = LoadResourceFile(GetCurrentResourceName(), "plates.json") local loadedFile = json.decode(loadFile) local s = "" for i, v in pairs(loadedFile.Plates) do s = s ..v.. ", " end TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "Currently tracked License Plates are: ^*^1"..s..""} }) else TriggerClientEvent('chat:addMessage', source, { args = {"^5["..Config.ChatPrefix.."]", "^1Insuficient Premissions"} }) end end) function getPlayerLocation(x, y) local raw = LoadResourceFile(GetCurrentResourceName(), 'postals.json') local postals = json.decode(raw) local nearest = nil local ndm = -1 local ni = -1 for i, p in ipairs(postals) do local dm = (x - p.x) ^ 2 + (y - p.y) ^ 2 if ndm == -1 or dm < ndm then ni = i ndm = dm end end if ni ~= -1 then local nd = math.sqrt(ndm) nearest = {i = ni, d = nd} end _nearest = postals[nearest.i].code return _nearest end Citizen.CreateThread(function() while true do local loadFile = LoadResourceFile(GetCurrentResourceName(), "plates.json") local loadedFile = json.decode(loadFile) plateTable = loadedFile.Plates TriggerClientEvent('Prefech:sendPlates',-1 , plateTable) Citizen.Wait(Config.SyncDelay) end end) RegisterServerEvent('Prefech:sendblip') AddEventHandler('Prefech:sendblip', function(x, y, z) TriggerClientEvent('Prefech:trackerset',-1 , x, y, z) end) RegisterServerEvent('Prefech:sendalert') AddEventHandler('Prefech:sendalert', function(x, y, z, plate, model, heading) TriggerClientEvent('Prefech:alertsend',-1 , x, y, z, plate, model, heading, getPlayerLocation(x, y)) end) RegisterServerEvent("Prefech:checkPerms") AddEventHandler("Prefech:checkPerms", function(source) if IsPlayerAceAllowed(source, Config.NotificationPerm) or IsPlayerAceAllowed(source, Config.AdminPerm) or Config.NoPerms == true then TriggerClientEvent("Prefech:getPerms", source, true) else TriggerClientEvent("Prefech:getPerms", source, false) end end) function has_value (tab, val) for i, v in ipairs (tab) do if (v == val) then return true end end return false end function removebyKey(tab, val) for i, v in ipairs (tab) do if (v == val) then tab[i] = nil end end end -- version check Citizen.CreateThread( function() local vRaw = LoadResourceFile(GetCurrentResourceName(), 'version.json') if vRaw and Config.versionCheck then local v = json.decode(vRaw) PerformHttpRequest( 'https://raw.githubusercontent.com/Prefech/Prefech_ALPR/master/version.json', function(code, res, headers) if code == 200 then local rv = json.decode(res) if rv.version ~= v.version then print( ([[^1------------------------------------------------------- ^1Prefech_ALPR ^1UPDATE: %s AVAILABLE ^1CHANGELOG: %s ^1-------------------------------------------------------^0]]):format( rv.version, rv.changelog ) ) end else print('^1Prefech_ALPR unable to check version^0') end end, 'GET' ) end end )
ESX = nil Citizen.CreateThread(function() while ESX == nil do TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end) Citizen.Wait(0) end while ESX.GetPlayerData().job == nil do Citizen.Wait(10) end PlayerData = ESX.GetPlayerData() while PlayerData == nil do PlayerData = ESX.GetPlayerData() Citizen.Wait(10) end end) RegisterNetEvent('esx:setJob') AddEventHandler('esx:setJob', function (job) PlayerData.job = job while ESX.GetPlayerData().job == nil do Citizen.Wait(10) end PlayerData = ESX.GetPlayerData() Citizen.Wait(3000) SendNUIMessage({ action = 'jobset', jobname = job.label, jobrank = job.grade_label }) end) RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(playerData) PlayerData = playerData SendNUIMessage({ action = 'jobset', jobname = playerData.job.label, jobrank = playerData.job.grade_label }) end) --General Updates Citizen.CreateThread(function() Citizen.Wait(0) SendNUIMessage({ action = 'showui' }) while true do local player = PlayerPedId() local time = CalculateTimeToDisplay() SendNUIMessage({ action = 'tick', source = GetPlayerServerId(NetworkGetEntityOwner(GetPlayerPed(-1))), time = time.hour .. ":" .. time.minute, show = IsPauseMenuActive(), health = (GetEntityHealth(player) - 100), armor = GetPedArmour(player), stamina = 100 - GetPlayerSprintStaminaRemaining(PlayerId()), air = GetPlayerUnderwaterTimeRemaining(PlayerId()), }) Citizen.Wait(200) end end)
Boulder = Engine:EntityClass('Boulder') function Boulder:setup(data) self.image = Engine:getAsset('art/Boulder.png') BasicEntSetup(self, data) end function Boulder:blocksTraversal() return true end function Boulder:blocksVision() return true end function Boulder:blocksLight() return true end function Boulder:isMovable() return true end function Boulder:activatesFloorSensors() return true end function Boulder:onShoved() EmitSound({ 'sfx/Boulder_Move_00.ogg', 'sfx/Boulder_Move_01.ogg', 'sfx/Boulder_Move_02.ogg', }, self) end function Boulder:render() love.graphics.setColor(1, 1, 1, 1) DrawSimpleEntImage(self, self.image) end
--[[--ldoc desc @module ZuPaiDaiPai @author SeryZeng Date 2018-03-20 18:40:46 Last Modified by LucasZhen Last Modified time 2018-07-20 12:29:28 ]] local LineBase = import("..base.LineBase") local CardBase = import(".CardBase") local M = class(CardBase) --[[ A张牌点相同的牌算一组牌,B组牌起连 连牌顺序【3-4-5-6-7-8-9-10-J-Q-K-A】不区分花色 每组牌可带C张其它牌 带牌牌点与组牌可以相同 ]] function M:ctor(data, ruleDao) self.mainType = new(LineBase, data, ruleDao) end --[[ 需先调用 sameCount 相同牌张数 minLength 牌组数 lineArgs 连牌 carryCount 每组牌带牌数量 ]] function M:init(data) self._args = {} self._args["sameCount"] = data.sameCount self._args["minLength"] = data.minLength self._args["lineArgs"] = data.lineArgs self._args["carryCount"]= data.carryCount self.mainType:init(self._args) self.minNum = (self._args.sameCount + self._args.carryCount) * self._args.minLength self.offset = self._args.sameCount + self._args.carryCount end function M:check(data) self:sort({cardInfo = data.outCardInfo, ruleDao = data.ruleDao}) -- 长度判断 local size = #data.outCardInfo.cardList if not (size > 0 and (size / self.offset) >= self._args.minLength and (size % self.offset) == 0) then return false end -- 找主牌型 local findData = {} findData.ruleDao = data.ruleDao findData.srcCardStack = new(CardStack,{cards = data.outCardInfo.cardList}) local mainCards = self:_findRightMainType(self.mainType, findData) if mainCards then findData.srcCardStack:removeCards(mainCards.cardList) local subCardsNum = findData.srcCardStack:getNumber() if not ((#mainCards.cardList / self._args.sameCount) >= self._args.minLength and subCardsNum == (#mainCards.cardList / self._args.sameCount) * self._args.carryCount) then return false end data.outCardInfo.size = self.sortRule.args data.outCardInfo.byteToSize = self.byteToSize data.outCardInfo.cardByte = mainCards.cardList[1].byte data.outCardInfo.groupLenght = #mainCards.cardList / self._args.sameCount return true end end function M:compare(data) -- 排序 self:sort({cardInfo = data.outCardInfo, ruleDao = data.ruleDao}) self:sort({cardInfo = data.targetCardInfo, ruleDao = data.ruleDao}) -- 牌张数检测 local outCardList = data.outCardInfo.cardList local targetCardList = data.targetCardInfo.cardList if #outCardList ~= #targetCardList then return false end return self.byteToSize[data.outCardInfo.cardByte] > self.byteToSize[data.targetCardInfo.cardByte] end --[[ 寻找某个合适的最大主牌型 data数据格式 { ruleDao srcCardStack } ]] function M:_findRightMainType(mainType, data) -- 333 444 555 6 找出 444 555 local tmpData = clone(data) local leftSubCards = {} while true do local ret = mainType:find(tmpData) if ret then tmpData.srcCardStack:removeCards(ret.cardList) local left = tmpData.srcCardStack:getCardList() if left and #left >= (#ret.cardList / self._args.sameCount) * self._args.carryCount then -- 符合组牌规则 return ret else -- 存副牌 if left and #left > 0 then for k,v in pairs(left) do table.insert(leftSubCards, v) end end -- 符合组牌规则 if #leftSubCards >= (#ret.cardList / self._args.sameCount) * self._args.carryCount then return ret end -- 减少主牌型组数 if (#ret.cardList / self._args.sameCount) <= self._args.minLength then break end for i = 1, self._args.sameCount do table.insert(leftSubCards, table.remove(ret.cardList)) end tmpData.srcCardStack = new(CardStack,{cards = ret.cardList}) end else Log.i("can not find mainType") break end end end function M:find(data) local tmpData = clone(data) self:sort({cardInfo = {cardList = tmpData.srcCardStack:getCardList(true)}, ruleDao = tmpData.ruleDao}) -- 从压牌里面找主牌型 local targetCardInfo = tmpData.targetCardInfo if targetCardInfo then local targetCardData = { ruleDao = tmpData.ruleDao, srcCardStack = new(CardStack,{cards = targetCardInfo.cardList}) } local targetmainInfo = self:_findRightMainType(self.mainType, targetCardData) if targetmainInfo then tmpData.targetCardInfo = targetmainInfo end end local mainCards = self:_findRightMainType(self.mainType, tmpData) if mainCards then tmpData.srcCardStack:removeCards(mainCards.cardList) local subCards = tmpData.srcCardStack:getCardList() -- 排序 self:sort({cardInfo = {cardList = subCards}, ruleDao = tmpData.ruleDao}) local subCardList = {} local mainCardsNum = #mainCards.cardList -- 副牌从小到大 for i = #subCards, 1, -1 do -- 副牌可以和主牌牌点相同 table.insert(subCardList,table.remove(subCards,i)) if #subCardList == self._args.carryCount * (mainCardsNum / self._args.sameCount) then break end end if #subCardList ~= self._args.carryCount * (mainCardsNum / self._args.sameCount) then return end -- 保持从大到小排序 for i = #subCardList, 1, -1 do table.insert(mainCards.cardList,subCardList[i]) end return { cardList = mainCards.cardList, cardByte = mainCards.cardList[1].byte, cardType = self.uniqueId } end end --[[ 组牌 (调用一次,组一次牌型) reserveCards 保牌数据 mainTypeid 主牌型id subTypeid = {} 所有可拆的牌型id cardValue 副牌型牌点限定(可不传,如果有则限定所有副牌牌点小于或等于该牌点) 返回: 组牌结果,拆牌后重新保牌结果,与保牌数据结构一致, return {[组牌id] = {单个组牌},[拆后重新保牌id] = {}} ]] function M:combination(data) local reserveCards = clone(data.reserveCards) local mainTypeid = data.mainTypeid local subTypeid = data.subTypeid local cardValue = data.cardValue local limits = data.limits if cardValue then cardValue = Card.ValueMap:getKeyByValue(tostring(cardValue)) end -- 判断主牌型是否存在 if not reserveCards[mainTypeid] or #reserveCards[mainTypeid] == 0 then return false end -- 当主牌型有多个时,从小到大的顺序获取 if #reserveCards[mainTypeid] == 0 then return false end local mainCard = table.remove(reserveCards[mainTypeid]) -- 需要进行保牌的牌组 local needProtectedCard = {} -- 找到的副牌 local subCards = {} local subCardsNum = (#mainCard.cardList / self._args.sameCount) * self._args.carryCount -- 遍历副牌型所持有的牌型id for _, cardType in pairs(subTypeid) do --单牌>对子>三条>连对>顺子>飞机 self:_findOneType(reserveCards[cardType], mainCard, cardValue, subCards, needProtectedCard, subCardsNum,limits) if #subCards == subCardsNum then break end end if #subCards ~= subCardsNum then return false end for k,v in pairs(reserveCards) do data.reserveCards[k] = v end -- 返回的保数据 local protectedData = {} -- 对拆分结果进行重新的保牌,按照需要保牌的规则id顺序进行保牌 if #needProtectedCard > 0 then local findData = {ruleDao = self.ruleDao, srcCardStack = new(CardStack,{cards = needProtectedCard})} -- 对牌型进行逆序 for i = #subTypeid, 1, -1 do --{6,5,4,3,2,1} protectedData[subTypeid[i]] = {} while true do if findData.srcCardStack:getNumber() == 0 then break end local cardTypeObj = self.ruleDao:getCardRuleById(subTypeid[i]) local resultData = cardTypeObj:find(findData) if resultData then findData.srcCardStack:removeCards(resultData.cardList) findData.srcCardStack = new(CardStack,{cards = findData.srcCardStack:getCardList()}) table.insert(protectedData[subTypeid[i]], resultData) else break end end end end -- 副牌排序 self:sort({cardInfo = {cardList = subCards}, ruleDao = data.ruleDao}) -- 构造组合牌 for _, card in pairs(subCards) do table.insert(mainCard.cardList, card) end protectedData[self.uniqueId] = {} local combinationData = { cardList = mainCard.cardList, cardByte = mainCard.cardList[1].byte, cardType = self.uniqueId } table.insert(protectedData[self.uniqueId], combinationData) --返回对应的保牌结果 return protectedData end -- 某个牌型数据中找副牌 function M:_findOneType(cardInfoList, mainCard, limitValue, subCards, needProtectedCard, subCardNum,limits) if cardInfoList then for i = #cardInfoList, 1, -1 do local hasRemove = false for j = #cardInfoList[i].cardList, 1, -1 do local card = cardInfoList[i].cardList[j] -- 校验是否符合规则 local isCheck = not limitValue or card.value <= limitValue if limits then if table.keyof(limits,card.byte) then isCheck = false end end if isCheck then -- 将符合规则的牌添加到副牌型牌组当中 table.insert(subCards, card) table.remove(cardInfoList[i].cardList,j) hasRemove = true if subCardNum == #subCards then break end end end -- 判断当前的cardInfo是否有剩余 if hasRemove then if #cardInfoList[i].cardList > 0 then --有剩余,代表该CardInfo剩余的Card要被重新保牌 for _, card in pairs(cardInfoList[i].cardList) do table.insert(needProtectedCard, card) end end -- 从原有的保牌结果中删除 table.remove(cardInfoList, i) end if subCardNum == #subCards then break end end end end return M
return { -- Widget configurations widget = { weather = { -- API Key key = '485689562fd669455c5ae4c8dddeb749', -- City ID city_id = '4906125', -- Units units = 'imperial', -- Update in N seconds update_interval = 60, -- Use 12hr time time_format_12h = true, -- Show Hourly Forecast show_hourly_forecast = true, -- Show daily forecast show_daily_forecast = true }, -- Yes I use military time by default, deal with it ;) (or just disable it) clock = { -- Clock widget format military_mode = false }, -- I do not use the widgets for the below configurations, but I left them here in-case you re-enable them! screen_recorder = { -- Default record dimension resolution = '1366x768', -- X,Y coordinate offset = '0,0', -- Enable audio by default audio = false, -- Recordings directory save_directory = '$(xdg-user-dir VIDEOS)/Recordings/', -- Mic level mic_level = '20', -- FPS fps = '30' }, network = { -- Wired interface wired_interface = 'enp5s0', -- Wireless interface wireless_interface = 'wlan0' }, email = { -- Email address address = '', -- App password app_password = '', -- Imap server imap_server = 'imap.gmail.com', -- Port port = '993' } }, -- Module configurations module = { auto_start = { -- Will create notification if true debug_mode = false }, dynamic_wallpaper = { -- Will look for wallpapers here wall_dir = 'theme/wallpapers/', -- Image formats valid_picture_formats = {'jpg', 'png', 'jpeg'}, -- Leave this table empty for full auto scheduling wallpaper_schedule = { ['00:00:00'] = 'midnight-wallpaper.png', ['06:22:00'] = 'morning-wallpaper.png', ['12:00:00'] = 'noon-wallpaper.png', ['17:58:00'] = 'night-wallpaper.png' -- Example of just using auto-scheduling with keywords --[[ 'midnight', 'morning', 'noon', 'afternoon', 'evening', 'night' --]] }, -- Stretch background image across all screens(monitor) stretch = true }, -- This module is not in use, configuration is left here for potential future use! -- because this idea is actually really cool! lockscreen = { -- Clock format military_clock = false, -- Default password if there's no PAM integration fallback_password = 'toor', -- Capture intruder using webcam capture_intruder = true, -- Intruder image save location (Will create directory if it doesn't exist) face_capture_dir = '$(xdg-user-dir PICTURES)/Intruders/', -- Background directory - Defaults to 'awesome/config/theme/wallpapers/' if null bg_dir = nil, -- Will look for this image file under 'bg_dir' bg_image = 'locksreen-bg.jpg', -- Blur lockscreen background blur_background = false, -- Blurred/filtered background image path (No reason to change this) tmp_wall_dir = '/tmp/awesomewm/' .. os.getenv('USER') .. '/' } } }
--[[ __ __ _ _ _ __ _____ | \/ | | | | | | |/ / | __ \ | \ / | __ _ __| | ___ | |__ _ _ | ' / __ _ ___ _ __ ___ _ __| |__) | | |\/| |/ _` |/ _` |/ _ \ | '_ \| | | | | < / _` / __| '_ \ / _ \ '__| _ / | | | | (_| | (_| | __/ | |_) | |_| | | . \ (_| \__ \ |_) | __/ | | | \ \ |_| |_|\__,_|\__,_|\___| |_.__/ \__, | |_|\_\__,_|___/ .__/ \___|_| |_| \_\ __/ | | | |___/ |_| Author: Kasper Rasmussen Steam: https://steamcommunity.com/id/kasperrasmussen ]] local Tunnel = module("vrp", "lib/Tunnel") local Proxy = module("vrp", "lib/Proxy") vRP = Proxy.getInterface("vRP") vRPclient = Tunnel.getInterface("vRP", "kasperr_police_equipment") RegisterServerEvent("kasperr_police_equipment:hasPermissions") AddEventHandler("kasperr_police_equipment:hasPermissions", function(hasWeapon) local _source = source local user_id = vRP.getUserId({source}) if vRP.hasPermission({user_id, Config.RequiredPermission}) then if hasWeapon == true then TriggerClientEvent("kasperr_progress_handler:open", _source, Config.Language.RemovingEquipment, 3000, "client", "kasperr_police_equipment:removeEquipment", {}) else TriggerClientEvent("kasperr_progress_handler:open", _source, Config.Language.ReceivingEquipment, 3000, "client", "kasperr_police_equipment:giveEquipment", {}) end else TriggerClientEvent("pNotify:SendNotification", source, { text = Config.Language.Error, type = "info", timeout = (3000), layout = "bottomCenter", queue = "global" }) end end)
local vs = [[ VK_UNIFORM_BINDING(0) uniform PerView { mat4 u_view_matrix; mat4 u_projection_matrix; vec4 u_camera_pos; vec4 u_time; }; VK_UNIFORM_BINDING(1) uniform PerRenderer { mat4 u_model_matrix; }; layout(location = 0) in vec4 i_vertex; layout(location = 2) in vec2 i_uv; VK_LAYOUT_LOCATION(0) out vec4 v_pos_proj; VK_LAYOUT_LOCATION(1) out vec4 v_pos_world; VK_LAYOUT_LOCATION(2) out vec4 v_time; VK_LAYOUT_LOCATION(3) out mat4 v_view_projection_matrix; void main() { mat4 model_matrix = u_model_matrix; vec4 pos_world = i_vertex * model_matrix; gl_Position = pos_world * u_view_matrix * u_projection_matrix; v_pos_proj = gl_Position; v_pos_world = pos_world; v_time = u_time; v_view_projection_matrix = u_view_matrix * u_projection_matrix; vk_convert(); } ]] local fs = [[ #ifndef VR_GLES #define VR_GLES 0 #endif precision highp float; VK_SAMPLER_BINDING(0) uniform sampler2D u_reflection_texture; VK_SAMPLER_BINDING(1) uniform highp sampler2D u_reflection_depth_texture; VK_UNIFORM_BINDING(4) uniform PerMaterialFragment { vec4 _Spectra; vec4 _Center; vec4 _RingParams; vec4 _RingSpeed; vec4 _GridColor; vec4 _ReflectionStrength; }; VK_LAYOUT_LOCATION(0) in vec4 v_pos_proj; VK_LAYOUT_LOCATION(1) in vec4 v_pos_world; VK_LAYOUT_LOCATION(2) in vec4 v_time; VK_LAYOUT_LOCATION(3) in mat4 v_view_projection_matrix; layout(location = 0) out vec4 o_color; float _gl_mod(float a, float b) { return a - b * floor(a/b); } vec2 _gl_mod(vec2 a, vec2 b) { return a - b * floor(a/b); } vec3 _gl_mod(vec3 a, vec3 b) { return a - b * floor(a/b); } vec4 _gl_mod(vec4 a, vec4 b) { return a - b * floor(a/b); } float iq_rand(float p) { return fract(sin(p) * 43758.5453); } float rings(vec3 pos) { float pi = 3.14159; vec2 wpos = pos.xz; float stride = _RingParams.x; float strine_half = stride * 0.5; float thickness = 1.0 - (_RingParams.y + length(_Spectra) * (_RingParams.z - _RingParams.y)); float distance = abs(length(wpos) - v_time.y * 0.1); float fra = _gl_mod(distance, stride); float cycle = floor(distance / stride); float c = strine_half - abs(fra - strine_half) - strine_half * thickness; c = max(c * (1.0 / (strine_half * thickness)), 0.0); float rs = iq_rand(cycle * cycle); float r = iq_rand(cycle) + v_time.y * (_RingSpeed.x + (_RingSpeed.y - _RingSpeed.x) * rs); float angle = atan(wpos.y, wpos.x) / pi * 0.5 + 0.5; float a = 1.0 - _gl_mod(angle + r, 1.0); a = max(a - 0.7, 0.0) * c; return a; } float hex(vec2 p, vec2 h) { vec2 q = abs(p); return max(q.x - h.y, max(q.x + q.y * 0.57735, q.y * 1.1547) - h.x); } float hex_grid(vec3 p) { float scale = 1.2; vec2 grid = vec2(0.692, 0.4) * scale; float radius = 0.22 * scale; vec2 p1 = _gl_mod(p.xz, grid) - grid * 0.5; float c1 = hex(p1, vec2(radius, radius)); vec2 p2 = _gl_mod(p.xz + grid * 0.5, grid) - grid * 0.5; float c2 = hex(p2, vec2(radius, radius)); return min(c1, c2); } vec3 guess_normal(vec3 p) { const float d = 0.01; return normalize(vec3( hex_grid(p + vec3(d, 0.0, 0.0)) - hex_grid(p + vec3(-d, 0.0, 0.0)), hex_grid(p + vec3(0.0, d, 0.0)) - hex_grid(p + vec3(0.0, -d, 0.0)), hex_grid(p + vec3(0.0, 0.0, d)) - hex_grid(p + vec3(0.0, 0.0, -d)) )); } float circle(vec3 pos) { float o_radius = 5.0; float i_radius = 4.0; float d = length(pos.xz); float c = max(o_radius - (o_radius - _gl_mod(d - v_time.y * 1.5, o_radius)) - i_radius, 0.0); return c; } vec2 flip_uv_y(vec2 uv) { #if (VR_GLES == 1) return vec2(uv.x, 1.0 - uv.y); #else return uv; #endif } const float blur_radius = 0.005; const vec2 blur_coords[9] = vec2[]( vec2(0.000, 0.000), vec2(0.1080925165271518, -0.9546740999616308) * blur_radius, vec2(-0.4753686437884934, -0.8417212473681748) * blur_radius, vec2(0.7242715177221273, -0.6574584801064549) * blur_radius, vec2(-0.023355087558461607, 0.7964400038854089) * blur_radius, vec2(-0.8308210026544296, -0.7015103725420933) * blur_radius, vec2(0.3243705688309195, 0.2577797517167695) * blur_radius, vec2(0.31851240326305463, -0.2220789454739755) * blur_radius, vec2(-0.36307729185097637, -0.7307245945773899) * blur_radius ); void main() { vec3 center = v_pos_world.xyz - _Center.xyz; float trails = rings(center); float grid_d = hex_grid(center); float grid = grid_d > 0.0 ? 1.0 : 0.0; vec3 n = guess_normal(center); n = (vec4(n, 0.0) * v_view_projection_matrix).xyz; vec4 c = vec4(0.0); c += trails * (0.5 + _Spectra * _RingParams.w); c += _GridColor * (grid * circle(center)) * _GridColor.w; // reflection float depth = 1.0; vec2 coord = v_pos_proj.xy / v_pos_proj.w * 0.5 + 0.5; depth = texture(u_reflection_depth_texture, flip_uv_y(coord)).r; for (int i = 1; i < 9; ++i) { depth = min(depth, texture(u_reflection_depth_texture, flip_uv_y(coord + blur_coords[i])).r); } float refpos = coord.y * 2.0 - 1.0; float fade_by_depth = 1.0; fade_by_depth = max(1.0 - abs(refpos) * 0.3, 0.0); vec3 refcolor = vec3(0.0); float g = clamp((grid_d + 0.02) * 50.0, 0.0, 1.0); coord += n.xz * (g > 0.0 && g < 1.0 ? 1.0 : 0.0) * 0.02; for (int i = 0; i < 9; ++i) { refcolor += texture(u_reflection_texture, flip_uv_y(coord + blur_coords[i] * ((1.0 - fade_by_depth) * 0.75 + 0.25))).rgb * 0.1111; } c.rgb += refcolor * _ReflectionStrength.x * fade_by_depth * (1.0 - grid * 0.9); o_color = c; } ]] --[[ Cull Back | Front | Off ZTest Less | Greater | LEqual | GEqual | Equal | NotEqual | Always ZWrite On | Off SrcBlendMode DstBlendMode One | Zero | SrcColor | SrcAlpha | DstColor | DstAlpha | OneMinusSrcColor | OneMinusSrcAlpha | OneMinusDstColor | OneMinusDstAlpha CWrite On | Off Queue Background | Geometry | AlphaTest | Transparent | Overlay ]] local rs = { Cull = Back, ZTest = LEqual, ZWrite = On, SrcBlendMode = One, DstBlendMode = Zero, CWrite = On, Queue = Geometry, } local pass = { vs = vs, fs = fs, rs = rs, uniforms = { { name = "PerView", binding = 0, members = { { name = "u_view_matrix", size = 64, }, { name = "u_projection_matrix", size = 64, }, { name = "u_camera_pos", size = 16, }, { name = "u_time", size = 16, }, }, }, { name = "PerRenderer", binding = 1, members = { { name = "u_model_matrix", size = 64, }, }, }, { name = "PerMaterialFragment", binding = 4, members = { { name = "_Spectra", size = 16, }, { name = "_Center", size = 16, }, { name = "_RingParams", size = 16, }, { name = "_RingSpeed", size = 16, }, { name = "_GridColor", size = 16, }, { name = "_ReflectionStrength", size = 16, }, }, }, }, samplers = { { name = "PerMaterialFragment", binding = 4, samplers = { { name = "u_reflection_texture", binding = 0, }, { name = "u_reflection_depth_texture", binding = 1, }, }, }, }, } -- return pass array return { pass }
return { unpack = unpack or table.unpack -- luacheck: ignore }
-- Stuff that shows effects upon fullcombo ,etc. local flag = false local song = GAMESTATE:GetCurrentSong() local curBeat = 0 local lastBeat = song:GetLastBeat() local style = GAMESTATE:GetCurrentStyle() local cols = style:ColumnsPerPlayer() local randMagnitude = 0.3 local barCount = cols*5 local barHeight = 150 local barWidth = 5 local text = {'F','u','l','l',' ','C','o','m','b','o'} -- RIP local leamtokem = {28,20,14,14,16,32,36,36,30,30} -- THIS IS DUMB BUT WHATEVER local totalSpacing = 226 -- sun of above minus the last element. local enabled = { PlayerNumber_P1 = GAMESTATE:IsPlayerEnabled(PLAYER_1), PlayerNumber_P2 = GAMESTATE:IsPlayerEnabled(PLAYER_2) } local function FCEffect(pn) local t = Def.ActorFrame{ InitCommand=function(self) self:x(getNoteFieldPos(pn)) self:visible(false) end; FullComboMessageCommand=function(self,params) if params.pn == pn then self:visible(true) end end; } -- Main fade-in gradient t[#t+1] = Def.Quad{ InitCommand=function(self) self:visible(false) self:y(SCREEN_BOTTOM) self:valign(1) self:zoomto(getNoteFieldWidth(pn)+8,0) self:fadetop(1) self:diffusealpha(0):diffuse(getMainColor('highlight')) end; FullComboMessageCommand=function(self,params) if params.pn == pn then self:sleep(0.2) self:visible(true) self:diffusealpha(1) self:linear(1) self:diffusealpha(0) self:zoomy(SCREEN_HEIGHT*4) end end; } -- Random flying bar thing for i=1,barCount do t[#t+1] = Def.Quad{ InitCommand=function(self) self:visible(false) self:x(-(getNoteFieldWidth(pn)/2)+math.random(getNoteFieldWidth(pn))):y(SCREEN_BOTTOM+barHeight+400*math.random()) self:valign(1) self:zoomto(barWidth,barHeight-math.random()*100) self:fadetop(0.5) self:fadebottom(0.5) self:fadeleft(0.2) self:faderight(0.2) self:diffusealpha(0) end; FullComboMessageCommand=function(self,params) if params.pn == pn then self:sleep(0.1) self:visible(true) self:diffusealpha(0.4) self:accelerate(2) self:diffusealpha(0) self:y((-SCREEN_HEIGHT)-(SCREEN_HEIGHT*math.random()*10)) end end; } end -- HAND KERNED TEXT for i=1,#text do t[#t+1] = LoadFont("Common Large") .. { InitCommand=function(self) local spacing = 0 local zoom = 0.6*getNoteFieldScale(pn) if i>1 then for j=1,i-1 do spacing = leamtokem[j]+spacing end end self:visible(false) self:settext(text[i]) self:zoom(1) if i>1 then self:x((-totalSpacing/2)*zoom + spacing*zoom) else self:x((-totalSpacing/2)*zoom) end self:diffusealpha(0) self:zoom(zoom) end; FullComboMessageCommand=function(self,params) if params.pn == pn then --SCREENMAN:SystemMessage("FC") local random = math.random()*randMagnitude self:sleep(0.20+random) self:visible(true) self:y(SCREEN_BOTTOM-(400*math.random())) self:diffusealpha(0.0) self:decelerate(0.5-random) random = math.random()*randMagnitude self:y(SCREEN_CENTER_Y) self:diffusealpha(1) self:sleep(0.3) self:accelerate(0.6-random) self:diffusealpha(0.0) end end; } end return t end local t = Def.ActorFrame{} for _,pn in pairs({PLAYER_1,PLAYER_2}) do if enabled[pn] then t[#t+1] = FCEffect(pn) end end local function Update(self) t.InitCommand=cmd(SetUpdateFunction,Update); curBeat = GAMESTATE:GetSongBeat() if curBeat > lastBeat and flag == false then flag = true for _,v in pairs({PLAYER_1,PLAYER_2}) do if isFullCombo(v) then MESSAGEMAN:Broadcast("FullCombo",{pn = v}) end end end end; t.InitCommand=cmd(SetUpdateFunction,Update); return t
-- Save the Dimensional Accumulator in a table -- function placedDimensionalAccumulator(event) if global.accTable == nil then global.accTable = {} end global.accTable[event.created_entity.unit_number] = event.created_entity end -- Save the Drain Power Pole -- function placedPowerDrainPole(event) if global.pdpTable == nil then global.pdpTable = {} end global.pdpTable[event.created_entity.unit_number] = PDP:new(event.created_entity) end -- Save the Logistic Fluid Pole in a table -- function placedLogisticPowerPole(event) if global.lfpTable == nil then global.lfpTable = {} end global.lfpTable[event.created_entity.unit_number] = event.created_entity end -- Save the Matter Serializer in a table -- function placedMatterSerializer(event) if global.matterSerializerTable == nil then global.matterSerializerTable = {} end global.matterSerializerTable[event.created_entity.unit_number] = MS:new(event.created_entity) end -- Save the Matter Printer in a table -- function placedMatterPrinter(event) if global.matterPrinterTable == nil then global.matterPrinterTable = {} end global.matterPrinterTable[event.created_entity.unit_number] = MP:new(event.created_entity) end -- Save the Data Center in a table -- function placedDataCenter(event) if global.dataCenterTable == nil then global.dataCenterTable = {} end global.dataCenterTable[event.created_entity.unit_number] = DC:new(event.created_entity) end -- Save the Data Center MF -- function placedDataCenterMF(event) if global.MF.dataCenter == nil then global.MF.dataCenter = DCMF:new(event.created_entity) end end -- Save the Data Storage in a table -- function placedDataStorage(event) if global.dataStorageTable == nil then global.dataStorageTable = {} end global.dataStorageTable[event.created_entity.unit_number] = DS:new(event.created_entity) end -- Save the Wireless Data Transmitter in a table -- function placedWirelessDataTransmitter(event) if global.wirelessDataTransmitterTable == nil then global.wirelessDataTransmitterTable = {} end global.wirelessDataTransmitterTable[event.created_entity.unit_number] = WDT:new(event.created_entity) end -- Save the Wireless Data Receiver in a table -- function placedWirelessDataReceiver(event) if global.wirelessDataReceiverTable == nil then global.wirelessDataReceiverTable = {} end global.wirelessDataReceiverTable[event.created_entity.unit_number] = WDR:new(event.created_entity) end -- Save the Energy Cube in a table -- function placedEnergyCube(event) if global.energyCubesTable == nil then global.energyCubesTable = {} end global.energyCubesTable[event.created_entity.unit_number] = EC:new(event.created_entity) end -- Save the Ore Cleaner -- function placedOreCleaner(event) if global.oreCleanerTable == nil then global.oreCleanerTable = {} end global.oreCleanerTable[event.created_entity.unit_number] = OC:new(event.created_entity) end -- Save the Fluid Extractor -- function placedFluidExtractor(event) if global.fluidExtractorTable == nil then global.fluidExtractorTable = {} end global.fluidExtractorTable[event.created_entity.unit_number] = FE:new(event.created_entity) end -- Save the Jet Flag -- function placedJetFlag(event) if global.jetFlagTable == nil then global.jetFlagTable = {} end global.jetFlagTable[event.created_entity.unit_number] = MJF:new(event.created_entity) end -- Save the Deep Storage -- function placedDeepStorage(event) if global.deepStorageTable == nil then global.deepStorageTable = {} end global.deepStorageTable[event.created_entity.unit_number] = DSR:new(event.created_entity) end -- Remove the Dimensional Accumulator from the table -- function removedDimensionalAccumulator(event) if global.accTable == nil then global.accTable = {} return end global.accTable[event.entity.unit_number] = nil end -- Remove the Power Drain Pole from the table -- function removedPowerDrainPole(event) if global.pdpTable == nil then global.pdpTable = {} return end global.pdpTable[event.entity.unit_number] = nil end -- Remove the Logistic Fluid Pole from the table -- function removedLogisticPowerPole(event) if global.lfpTable == nil then global.lfpTable = {} return end global.lfpTable[event.entity.unit_number] = nil end -- Remove the Matter Serializer from the table -- function removedMatterSerializer(event) if global.matterSerializerTable == nil then global.matterSerializerTable = {} return end if global.matterSerializerTable[event.entity.unit_number] ~= nil then global.matterSerializerTable[event.entity.unit_number]:remove() end global.matterSerializerTable[event.entity.unit_number] = nil end -- Remove the Matter Printer from the table -- function removedMatterPrinter(event) if global.matterPrinterTable == nil then global.matterPrinterTable = {} return end if global.matterPrinterTable[event.entity.unit_number] ~= nil then global.matterPrinterTable[event.entity.unit_number]:remove() end global.matterPrinterTable[event.entity.unit_number] = nil end -- Remove the Data Center from the table -- function removedDataCenter(event) if global.dataCenterTable == nil then global.dataCenterTable = {} return end if global.dataCenterTable[event.entity.unit_number] ~= nil then global.dataCenterTable[event.entity.unit_number]:remove() end global.dataCenterTable[event.entity.unit_number] = nil end -- Remove the Data Center MF from the table -- function removedDataCenterMF(event) if global.MF.dataCenter ~= nil and global.MF.dataCenter.ent == event.entity then global.MF.dataCenter:remove() global.MF.dataCenter = nil end end -- Remove the Data Storage from the table -- function removedDataStorage(event) if global.dataStorageTable == nil then global.dataStorageTable = {} return end if global.dataStorageTable[event.entity.unit_number] ~= nil then global.dataStorageTable[event.entity.unit_number]:remove() end global.dataStorageTable[event.entity.unit_number] = nil end -- Remove the Wireless Data Transmitter from the table -- function removedWirelessDataTransmitter(event) if global.wirelessDataTransmitterTable == nil then global.wirelessDataTransmitterTable = {} return end if global.wirelessDataTransmitterTable[event.entity.unit_number] ~= nil then global.wirelessDataTransmitterTable[event.entity.unit_number]:remove() end global.wirelessDataTransmitterTable[event.entity.unit_number] = nil end -- Remove the Wireless Data Receiver from the table -- function removedWirelessDataReceiver(event) if global.wirelessDataReceiverTable == nil then global.wirelessDataReceiverTable = {} return end if global.wirelessDataReceiverTable[event.entity.unit_number] ~= nil then global.wirelessDataReceiverTable[event.entity.unit_number]:remove() end global.wirelessDataReceiverTable[event.entity.unit_number] = nil end -- Remove the Energy Cube from the table -- function removedEnergyCube(event) if global.MF.energyCubesTable ~= nil and global.MF.energyCubesTable.ent == event.entity then if global.energyCubesTable[event.entity.unit_number] ~= nil then global.energyCubesTable[event.entity.unit_number]:remove() end global.MF.energyCubesTable = nil end end -- Remove the Ore Cleaner from the table -- function removedOreCleaner(event) if global.oreCleanerTable == nil then global.oreCleanerTable = {} return end if global.oreCleanerTable[event.entity.unit_number] ~= nil then global.oreCleanerTable[event.entity.unit_number]:remove() end global.oreCleanerTable[event.entity.unit_number] = nil end -- Remove the Fluid Extractor from the table -- function removedFluidExtractor(event) if global.fluidExtractorTable == nil then global.fluidExtractorTable = {} return end if global.fluidExtractorTable[event.entity.unit_number] ~= nil then global.fluidExtractorTable[event.entity.unit_number]:remove() end global.fluidExtractorTable[event.entity.unit_number] = nil end -- Remove the Jet Flag from the table -- function removedJetFlag(event) if global.jetFlagTable == nil then global.jetFlagTable = {} return end if global.jetFlagTable[event.entity.unit_number] ~= nil then global.jetFlagTable[event.entity.unit_number]:remove() end global.jetFlagTable[event.entity.unit_number] = nil end -- Remove the Deep Storage from the table -- function removedDeepStorage(event) if global.deepStorageTable == nil then global.deepStorageTable = {} return end if global.deepStorageTable[event.entity.unit_number] ~= nil then global.deepStorageTable[event.entity.unit_number]:remove() end global.deepStorageTable[event.entity.unit_number] = nil end
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' ui_page('client/html/index.html') server_scripts { 'config.lua', '@mysql-async/lib/MySQL.lua', 'server/server.lua' } client_scripts { 'config.lua', 'client/client.lua' } files { 'client/html/index.html', 'client/html/css/chunk-*.css', 'client/html/js/chunk-*.js', 'client/html/css/app.css', 'client/html/js/app.js', 'client/html/img/citizen-image-placeholder.png', 'client/html/img/example-image.jpg', 'client/html/img/*.png', 'client/html/config/config.json' }
NabooPirateBunkerScreenPlay = ScreenPlay:new { numberOfActs = 1, --location -1482 -1729 screenplayName = "NabooPirateBunkerScreenPlay", lootContainers = { 5535582, 5535589, 5535590, 5535591, 5535606, 5535607, 5535608, 5535609, 5535610, 5535611 }, lootLevel = 16, lootGroups = { { groups = { {group = "color_crystals", chance = 160000}, {group = "junk", chance = 7240000}, {group = "heavy_weapons_consumable", chance = 500000}, {group = "rifles", chance = 500000}, {group = "carbines", chance = 500000}, {group = "pistols", chance = 500000}, {group = "clothing_attachments", chance = 300000}, {group = "armor_attachments", chance = 300000} }, lootChance = 8000000 } }, lootContainerRespawn = 1800 } registerScreenPlay("NabooPirateBunkerScreenPlay", true) function NabooPirateBunkerScreenPlay:start() if (isZoneEnabled("naboo")) then self:spawnMobiles() self:initializeLootContainers() end end function NabooPirateBunkerScreenPlay:spawnMobiles() --add mobiles here spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(25) + -1540.0, 278, getRandomNumber(30) + -1759.7, getRandomNumber(360) + 0, 0) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, -1540.0, 278, -1759.7, 90, 0) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, -1512.0, 278, -1726.8, -90, 0) spawnMobile("naboo", "naboo_pirate_crewman", 300, -1501.0, 278, -1713.2, 180, 0) spawnMobile("naboo", "naboo_pirate_crewman", 300, -1484.1, 278, -1712.3, 140, 0) spawnMobile("naboo", "naboo_pirate_crewman", 300, -1485.0, 278, -1740.4, 0, 0) spawnMobile("naboo", "naboo_pirate_crewman", 300, -1501.8, 278, -1743.8, 10, 0) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, 0.0, 0.3, 3.5, 0, 5535565) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, -3.7, 0.3, -0.8, 0, 5535565) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, 3.5, 0.0, 1.0, 180, 5535573) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(8) + -1.3, -12.0, getRandomNumber(8) + 26.1, getRandomNumber(360) + 0, 5535567) spawnMobile("naboo", "naboo_pirate_crewman", 300, getRandomNumber(8) + -1.3, -12.0, getRandomNumber(8) + 26.1, getRandomNumber(360) + 0, 5535567) spawnMobile("naboo", "naboo_pirate_crewman", 300, getRandomNumber(8) + -1.3, -12.0, getRandomNumber(8) + 26.1, getRandomNumber(360) + 0, 5535567) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, getRandomNumber(8) + -1.3, -12.0, getRandomNumber(8) + 26.1, getRandomNumber(360) + 0, 5535567) spawnMobile("naboo", "naboo_pirate_lieutenant", 300, 32.1, -12.0, 30.3, -90, 5535568) spawnMobile("naboo", "naboo_pirate_lieutenant", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_armsman", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_armsman", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_armsman", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_crewman", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_crewman", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_crewman", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate_cutthroat", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(44) + 39.5, -16.0, getRandomNumber(24) + 58.4, getRandomNumber(360) + 0, 5535571) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(37) + -15.5, -16.0, getRandomNumber(10) + 72.5, getRandomNumber(360) + 0, 5535570) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(37) + -15.5, -16.0, getRandomNumber(10) + 72.5, getRandomNumber(360) + 0, 5535570) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(37) + -15.5, -16.0, getRandomNumber(10) + 72.5, getRandomNumber(360) + 0, 5535570) spawnMobile("naboo", "naboo_gunrunner", 300, getRandomNumber(37) + -15.5, -16.0, getRandomNumber(10) + 72.5, getRandomNumber(360) + 0, 5535570) spawnMobile("naboo", "naboo_pirate", 300, getRandomNumber(37) + -15.5, -16.0, getRandomNumber(10) + 72.5, getRandomNumber(360) + 0, 5535570) spawnMobile("naboo", "naboo_dread_pirate", 300, -37.2, -14, 78.8, 88, 5535572) end
vim.cmd [[ let delimitMate_expand_cr = 2 ]] vim.cmd [[ let delimitMate_expand_space = 1 ]] vim.cmd [[ au FileType markdown let b:delimitMate_nesting_quotes = ['`'] ]] vim.cmd [[ au FileType python let b:delimitMate_nesting_quotes = ['"', "'"] ]] vim.cmd [[ au FileType html let b:delimitMate_matchpairs = "(:),[:],{:}" " vim-closetag ]]
project_root = "../../../.." include(project_root.."/tools/build") group("src") project("xenia-gpu-null") uuid("42FCA0B3-4C20-4532-95E9-07D297013BE4") kind("StaticLib") language("C++") links({ "xenia-base", "xenia-gpu", "xenia-ui", "xenia-ui-vulkan", "xxhash", }) defines({ }) local_platform_files()
--[[ © CloudSixteen.com do not share, re-distribute or modify without permission of its author (kurozael@gmail.com). Clockwork was created by Conna Wiles (also known as kurozael.) http://cloudsixteen.com/license/clockwork.html --]] Clockwork.config:AddToSystem("WeaponSelectMulti", "weapon_selection_multi", "WeaponSelectMultiDesc"); -- A function to draw a weapon's information. function cwWeaponSelect:DrawWeaponInformation(itemTable, weapon, x, y, alpha) local informationColor = Clockwork.option:GetColor("information"); local clipTwoAmount = Clockwork.Client:GetAmmoCount(weapon:GetSecondaryAmmoType()); local clipOneAmount = Clockwork.Client:GetAmmoCount(weapon:GetPrimaryAmmoType()); local mainTextFont = Clockwork.option:GetFont("main_text"); local secondaryAmmo = nil; local primaryAmmo = nil; local clipTwo = weapon:Clip2(); local clipOne = weapon:Clip1(); if (!weapon.Primary or !weapon.Primary.ClipSize or weapon.Primary.ClipSize > 0) then if (clipOne >= 0) then primaryAmmo = L("PrimaryAmmoCount", clipOne, clipOneAmount); end; end; if (!weapon.Secondary or !weapon.Secondary.ClipSize or weapon.Secondary.ClipSize > 0) then if (clipTwo >= 0) then secondaryAmmo = L("SecondaryAmmoCount", clipTwo, clipTwoAmount); end; end; if (!weapon.Instructions) then weapon.Instructions = ""; end; if (!weapon.Purpose) then weapon.Purpose = ""; end; if (!weapon.Contact) then weapon.Contact = ""; end; if (!weapon.Author) then weapon.Author = ""; end; if (itemTable or primaryAmmo or secondaryAmmo or (weapon.DrawWeaponInfoBox and (weapon.Author != "" or weapon.Contact != "" or weapon.Purpose != "" or weapon.Instructions != ""))) then local text = "<font="..mainTextFont..">"; local textColor = "<color=255,255,255,255>"; local titleColor = "<color=230,230,230,255>"; if (informationColor) then titleColor = "<color="..informationColor.r..","..informationColor.g..","..informationColor.b..",255>"; end; if (itemTable and itemTable("description") != "") then text = text..titleColor..L("WeaponSelectDescription").."</color>\n"..textColor..Clockwork.config:Parse(L(itemTable("description"))).."</color>\n"; end; if (primaryAmmo or secondaryAmmo) then text = text..titleColor..L("WeaponSelectAmmunition").."</color>\n"; if (secondaryAmmo) then text = text..textColor..secondaryAmmo.."</color>\n"; end; if (primaryAmmo) then text = text..textColor..primaryAmmo.."</color>\n"; end; end; if (weapon.Instructions != "") then text = text..titleColor..L("WeaponSelectInstructions").."</color>\n"..textColor..weapon.Instructions.."</color>\n"; end; if (weapon.Purpose != "") then text = text..titleColor..L("WeaponSelectPurpose").."</color>\n"..textColor..weapon.Purpose.."</color>\n"; end; if (weapon.Contact != "") then text = text..titleColor..L("WeaponSelectContact").."</color>\n"..textColor..weapon.Contact.."</color>\n"; end; if (weapon.Author != "") then text = text..titleColor..L("WeaponSelectAuthor").."</color>\n"..textColor..weapon.Author.."</color>\n"; end; weapon.InfoMarkup = markup.Parse(text.."</font>", 248); Clockwork.kernel:OverrideMarkupDraw(weapon.InfoMarkup); local weaponMarkupHeight = weapon.InfoMarkup:GetHeight(); local realY = y - (weaponMarkupHeight / 2); local info = { drawBackground = true, weapon = weapon, height = weaponMarkupHeight + 8, width = 260, alpha = alpha, x = x - 4, y = realY }; Clockwork.plugin:Call("PreDrawWeaponSelectionInfo", info); if (info.drawBackground) then SLICED_LARGE_DEFAULT:Draw(x - 8, realY, info.width + 16, info.height + 16, 8, Color(255, 255, 255, alpha)); end; if (weapon.InfoMarkup) then weapon.InfoMarkup:Draw(x + 4, realY + 4, nil, nil, alpha); end; end; end; -- A function to get a weapon's print name. function cwWeaponSelect:GetWeaponPrintName(weapon) local printName = weapon:GetPrintName(); local class = string.lower(weapon:GetClass()); if (printName and printName != "") then self.weaponPrintNames[class] = printName; end; return self.weaponPrintNames[class] or printName; end;
require "sys.tick" require "utils.tableutils" core = require "sys.core" local crypt = require "sys.crypt" local masterconn = require "masterconn" require "reciever" function getmasterfd() return masterconn:getserverfd() end core.start(function() local loglevel = tonumber(core.envget("log_level")) local logdefault= tonumber(core.envget("log_default")) core.debug(1, "set debug level to ".. loglevel ..", log default flag:"..logdefault) core.debuglevel(loglevel, logdefault) if not masterconn:connect() then core.exit() return end local authsalt = core.envget("auth_salt") local authcode = core.envget("auth_code") local cryptstr = crypt.aesencode(authsalt, authcode) slave2master:auth(getmasterfd(), cryptstr, authcode) end)
--- Entity class. Inherited from @{l2df.class|l2df.Class}. -- @classmod l2df.class.entity -- @author Abelidze -- @author Kasai -- @copyright Atom-TM 2019 local core = l2df or require(((...):match('(.-)class.+$') or '') .. 'core') assert(type(core) == 'table' and core.version >= 1.0, 'Entities works only with l2df v1.0 and higher') local helper = core.import 'helper' local Class = core.import 'class' local Component = core.import 'class.component' local Storage = core.import 'class.storage' local assert = _G.assert local require = _G.require local setmetatable = _G.setmetatable local default = helper.notNil local copyTable = helper.copyTable local isArray = helper.isArray local dummy = function () return nil end local Entity = Class:extend() --- Meta-table for performing search in sub-nodes of the entity object. -- @field function __index Doing search. Ex.: `local btn_ref = Entity.R.MENU.BUTTON` -- @field function __newindex Set object key after search. Ex.: `Entity.R.MENU.BUTTON.text = 'Click'` -- @field function __call Returns "clear" @{l2df.class.entity|entity} object. -- Important cuz @{l2df.class.entity.R|Entity.R} variable is not an actual entity. Ex.: `local btn = Entity.R.MENU.BUTTON()` -- @table Entity.R --- Table containing components for easy access. -- Components must manually add / remove them from this list if it is required. -- @table Entity.C --- Entity's public storage for all variables and user data. -- It is important to use this and do not garbage actual entity's table since:<br> -- 1. It's more secure;<br> -- 2. It's used by all the components to store and transfer data;<br> -- 3. It's a part of rollback system;<br> -- 4. Networking doesn't work without this! -- @table Entity.data --- Key string. Used for searching via @{l2df.class.entity.R|Entity.R}. -- @string Entity.key --- Parent entity. Can be `nil` meaning no parent attached. -- @field l2df.class.entity Entity.parent --- Entity's state. -- If false entity would not receive any update and draw events. -- @field boolean Entity.active --- Constructor for eating an entity instance. -- @param[opt] table kwargs Keyword arguments. Also passed to all adding components. -- @param[opt=true] boolean kwargs.active See @{l2df.class.entity.active|Entity.active}. -- @param[opt] table kwargs.components Array of @{l2df.class.component|components} to add on entity creation. -- @param[opt] string key String key used for performing entity-search via @{l2df.class.entity.R|Entity.R} meta-variable. -- @param ... ... Arguments redirected to @{l2df.class.init|Entity:init()} function. function Entity:new(kwargs, key, ...) kwargs = kwargs or { } local obj = self:___getInstance() obj.key = key obj.nodes = Storage:new() obj.components = Storage:new() obj.components.class = { } obj.parent = nil obj.active = default(kwargs.active, true) obj.data = { ___nomerge = true } obj.___meta = { } obj.C = { } obj.R = setmetatable({ }, { __index = function (t, k) if obj[k] then return obj[k] end local x = obj.nodes:getByKey(k) return x and x.R or nil -- t.R end, __newindex = function (t, k, v) obj[k] = v end, __call = function () return obj end }) obj:init(kwargs, key, ...) local components = kwargs.components if isArray(components) then for i = 1, #components do if components[i][2] then obj:createComponent(require(components[i][1] or components[i]), kwargs) else obj:addComponent(require(components[i][1] or components[i]), kwargs) end end end return obj end --- Create copy of current object (with all attached nodes). -- @return l2df.class.entity function Entity:clone() local entity = self:___getInstance() entity.nodes = Storage:new() entity.components = Storage:new() entity.key = self.key entity.data = copyTable(self.data) for id, node in self.nodes:enum(true) do node = node:clone() node.id = id entity:attach(node) end for id, component in self.components:enum(true) do local c = component:new() c.entity = entity entity.data[c] = self.data[component] entity.components:add(c) end return entity end --- Adding an inheritor to an entity. -- @param l2df.class.entity entity Entity to attach. -- @return number|boolean -- @return l2df.class.entity|nil function Entity:attach(entity) assert(entity:isInstanceOf(Entity), 'not a subclass of Entity') if entity.parent == self or self:isDescendant(entity) then return false end if entity.parent then entity.parent:detach(entity) end entity.parent = self if entity.key then return self.nodes:addByKey(entity, entity.key, true) elseif entity.id then return self.nodes:addById(entity, entity.id, true) end return self.nodes:add(entity) end --- Adding some inheritors to an entity. -- @param table array Array of @{l2df.class.entity|entities} to attach. function Entity:attachMultiple(array) array = array or { } for i = 1, #array do if array[i]:isInstanceOf(Entity) then self:attach(array[i]) end end end --- Removing an inheritor from entity. -- @param l2df.class.entity entity Inheritor to remove. function Entity:detach(entity) assert(entity:isInstanceOf(Entity), 'not a subclass of Entity') self.nodes:remove(entity) entity.parent = nil end --- Remove all nodes attached to the entity. function Entity:detachAll() for id, node in self.nodes:enum(true) do self:detach(node) end end --- Removing entity from inheritors list of his parent. -- @return l2df.class.entity function Entity:detachParent() local parent = self.parent if parent then parent:detach(self) end return parent end --- Destroy entity. function Entity:destroy() self:clearComponents() self:detachParent() end --- Getting a list of entity's inheritors. -- @param[opt] function filter Filter predicate function. -- @return table function Entity:getNodes(filter) local list = { } for id, node in self.nodes:enum(true) do if not filter or filter(node) then list[#list + 1] = node end end return list end --- Option to obtain a parent using the function. -- @return l2df.class.entity function Entity:getParent() return self.parent end --- Backup / restore entity. -- @param[opt] table state Table containing snapshot of the entity's state: -- <pre>{ active = [boolean], parent = [@{l2df.class.entity}], data = [table] }</pre>. -- @return table|nil function Entity:sync(state) if not state then return { active = self.active, parent = self.parent, data = copyTable(self.data) } end if state.parent then state.parent:attach(self) end copyTable(state, self) end --- Check for inheritance from an object. -- @param l2df.class.entity entity Source entity. -- @return boolean function Entity:isDescendant(entity) local object = self while object do if object == entity then return true end object = object.parent end return false end --- Set / toggle active state of this entity. -- @param[opt] boolean active Active state to set. Toggles current if not setted. -- @param[opt=false] boolean propagate Propagates state to subnodes if setted to true. -- @return boolean function Entity:setActive(active, propagate) if active == nil then active = not self.active end if not propagate then self.active = active return true end if self.parent and not (self.parent.active) and active then return false end for object in self:enum() do object.active = active end return true end --- Create new component and add to this entity. -- @param l2df.class.component class Component's class. -- @param ... ... Arguments for @{l2df.class.component.added}. -- @return number -- @return l2df.class.component -- @return boolean function Entity:createComponent(class, ...) return self:addComponent(class:new(...), ...) end --- Add component to entity. -- @param l2df.class.component component Component's instance. -- @param ... ... Arguments for @{l2df.class.component.added}. -- @return number -- @return l2df.class.component -- @return boolean function Entity:addComponent(component, ...) assert(component:isInstanceOf(Component), 'not a subclass of Component') if self:hasComponent(component) then return false end -- if component.unique and self:hasComponentClass(component.___class) then return false end self.components.class[component.___class] = self.components.class[component.___class] and self.components.class[component.___class] + 1 or 1 return self.components:add(component), component, component.added and component:added(self, ...) end --- Remove component from entity. -- @param l2df.class.component component Component's instance. -- @param ... ... Arguments for @{l2df.class.component.removed}. -- @return boolean function Entity:removeComponent(component, ...) assert(component:isInstanceOf(Component), 'not a subclass of Component') if self.components:remove(component) then self.components.class[component.___class] = self.components.class[component.___class] - 1 return component.removed and component:removed(self, ...) end return false end --- Remove all components added to entity. -- @return boolean function Entity:clearComponents() for _, component in self.components:enum() do self:removeComponent(component) end self.components:reset() self.components.class = { } return true end --- Floats up existing component of the object like a bubble. Can be used to reorder components execution. -- @param l2df.class.component component Component's instance. -- @return number|boolean -- @return l2df.class.component|nil function Entity:upComponent(component) assert(component:isInstanceOf(Component), 'not a subclass of Component') if not self:hasComponent(component) then return false end self.components:remove(component) return self.components:add(component), component end --- Check if component exists on entity. -- @param l2df.class.component component Component to check. -- @return boolean function Entity:hasComponent(component) return self.components:has(component) end --- Check if component exists on entity, -- @param l2df.class.component componentClass Component's class to check. -- @return boolean function Entity:hasComponentClass(componentClass) return self.components.class[componentClass] and self.components.class[componentClass] > 0 or false end --- Get attached component by ID, -- @param number id Component's ID. -- @return l2df.class.component function Entity:getComponentById(id) return self.components:getById(id) end --- Get a single attached component of given class. -- @param l2df.class.component componentClass Component's class -- @return l2df.class.component|nil function Entity:getComponent(componentClass) assert(componentClass, 'no component specified') for id, value in self.components:enum() do if value:isInstanceOf(componentClass) then return value:wrap(self) end end return nil end --- Get a list of attached components of given class. -- @param l2df.class.component componentClass Component's class. -- @return table function Entity:getComponents(componentClass) local list = { } for id, value in self.components:enum() do if not componentClass or value:isInstanceOf(componentClass) then list[#list + 1] = value:wrap(self) end end return list end --- Enumerate entities' tree. -- @param[opt=false] boolean active Enumerate only active nodes. -- @param[opt=false] boolean skipped Skip self in enumeration. -- @return function function Entity:enum(active, skipped) local beginner = self if not (beginner and (beginner.nodes or beginner.getNodes)) then return dummy end beginner = skipped and beginner:getNodes() or { beginner } local tasks = { { beginner, 0, #beginner } } local depth = 1 local i = 0 local current = tasks[depth] return function () while i < current[3] or depth > 1 do i = i + 1 local returned = current[1][i] local nodes = returned and returned:getNodes() if returned and nodes and next(nodes) then if not active or returned.active then current[2] = i current = { nodes, 0, #nodes } tasks[#tasks + 1] = current depth = depth + 1 i = 0 end elseif i >= current[3] and depth > 1 then depth = depth - 1 current = tasks[depth] i = current[2] end if not active or returned and returned.active then return returned end end return nil end end return Entity
--[[ © CloudSixteen.com do not share, re-distribute or modify without permission of its author (kurozael@gmail.com). Clockwork was created by Conna Wiles (also known as kurozael.) http://cloudsixteen.com/license/clockwork.html --]] -- Called when an entity's target ID HUD should be painted. function cwStorage:HUDPaintEntityTargetID(entity, info) local colorTargetID = Clockwork.option:GetColor("target_id"); local colorWhite = Clockwork.option:GetColor("white"); if (Clockwork.entity:IsPhysicsEntity(entity)) then local model = string.lower(entity:GetModel()); if (self.containerList[model]) then if (entity:GetNetworkedString("Name") != "") then info.y = Clockwork.kernel:DrawInfo(entity:GetNetworkedString("Name"), info.x, info.y, colorTargetID, info.alpha); else info.y = Clockwork.kernel:DrawInfo(self.containerList[model][2], info.x, info.y, colorTargetID, info.alpha); end; info.y = Clockwork.kernel:DrawInfo("You can put stuff inside it.", info.x, info.y, colorWhite, info.alpha); end; end; end; -- Called when an entity's menu options are needed. function cwStorage:GetEntityMenuOptions(entity, options) if (Clockwork.entity:IsPhysicsEntity(entity)) then local model = string.lower(entity:GetModel()); if (self.containerList[model]) then options["Open"] = "cwContainerOpen"; end; end; end; -- Called when the local player's storage is rebuilt. function cwStorage:PlayerStorageRebuilt(panel, categories) if (panel.storageType == "Container") then local entity = Clockwork.storage:GetEntity(); if (IsValid(entity) and entity.cwMessage) then local messageForm = vgui.Create("DForm", panel); local helpText = messageForm:Help(entity.cwMessage); messageForm:SetPadding(5); messageForm:SetName("Message"); helpText:SetFont("Default"); panel:AddItem(messageForm); end; end; end;
set('version', 'v0.7') cflags{ '-std=c99', '-D CONFIG_HELP=1', '-D CONFIG_CURSES=1', '-D CONFIG_LUA=1', '-D CONFIG_LPEG=1', '-D CONFIG_TRE=0', '-D CONFIG_SELINUX=0', '-D CONFIG_ACL=0', '-D HAVE_MEMRCHR=1', '-D _XOPEN_SOURCE=700', [[-D 'VERSION="$version"']], string.format([[-D 'VIS_PATH="%s/share/vis"']], config.prefix), '-D NDEBUG', '-I $outdir', '-isystem $builddir/pkg/libtermkey/include', '-isystem $builddir/pkg/lua/include', '-isystem $builddir/pkg/netbsd-curses/include', } build('copy', '$outdir/config.h', '$srcdir/config.def.h') pkg.deps = { '$outdir/config.h', 'pkg/libtermkey/headers', 'pkg/lua/headers', 'pkg/netbsd-curses/headers', } exe('vis', [[ array.c buffer.c libutf.c main.c map.c sam.c text.c text-common.c text-io.c text-iterator.c text-motions.c text-objects.c text-util.c ui-terminal.c view.c vis.c vis-lua.c vis-marks.c vis-modes.c vis-motions.c vis-operators.c vis-prompt.c vis-registers.c vis-text-objects.c text-regex.c $builddir/pkg/libtermkey/libtermkey.a.d $builddir/pkg/lpeg/liblpeg.a $builddir/pkg/lua/liblua.a $builddir/pkg/netbsd-curses/libcurses.a.d ]]) file('bin/vis', '755', '$outdir/vis') exe('vis-digraph', {'vis-digraph.c'}) file('bin/vis-digraph', '755', '$outdir/vis-digraph') exe('vis-menu', {'vis-menu.c'}) file('bin/vis-menu', '755', '$outdir/vis-menu') file('bin/vis-open', '755', '$srcdir/vis-open') for _, f in ipairs{'vis.1', 'vis-digraph.1', 'vis-menu.1', 'vis-open.1'} do build('sed', '$outdir/'..f, '$srcdir/man/'..f, {expr='s,VERSION,$version,'}) man{'$outdir/'..f} end for f in iterlines('lua.txt') do file('share/vis/'..f, '644', '$srcdir/lua/'..f) end sym('share/vis/lexer.lua', 'lexers/lexer.lua') sym('share/vis/themes/default-16.lua', 'dark-16.lua') sym('share/vis/themes/default-256.lua', 'dark-16.lua') fetch 'git'
--package.path = package.path..';../*.lua' local ffi_gc = require 'ffi_gc' local a = ffi_gc.new() print(collectgarbage("collect")) print(collectgarbage("count")) a = nil print(collectgarbage("count")) print(collectgarbage("collect")) print(collectgarbage("count"))
return { GameObject = { type = "lib", description = "GameObject class", childs = { Instantiate = { type = "function", description = "Creates an instance of a Prefab", args = "(Prefab: prefab)", returns = "(GameObject*)" }, Destroy = { type = "function", description = "Destroys a GameObject and its children", args = "(GameObject*: gameobject)" }, active = {type = "value"}, name = {type = "value"}, transform = { type = "class", description = "transform class", childs = { gameobject = {type = "value"}, parent = {type = "value"}, position = {type = "value"}, gposition = {type = "value"}, rotation = {type = "value"}, grotation = {type = "value"}, scale = {type = "value"}, forward = {type = "value"}, up = {type = "value"}, right = {type = "value"}, SetPositionv = { type = "method", description = "Set the position given a Vector3", args = "(Vector3: position)" }, SetPosition3f = { type = "method", description = "Set the position given a Vector3", args = "(x, y, z)" }, SetRotation = { type = "method", description = "Set the rotation given a Quaternion", args = "(Quaternion: rotation)" }, SetScale3f = { type = "method", description = "Set the scale given a Vector3", args = "(x, y, z)" }, LookAt = { type = "method", description = "Rotates GameObject to look to given position", args = "(Vector3: position)" }, Find = { type = "method", description = "Search a GameObject with name (only in children, not iterative)", args = "(string: name)", returns = "(GameObject*)" }, GetChild = { type = "method", description = "Search a GameObject with index n (only in children, not iterative)", args = "(number: n)", returns = "(GameObject*)" }, ChildCount = { type = "method", description = "Returns the number of children", args = "()", returns = "(number)" }, IsChilldOf = { type = "method", description = "Returns true if gameobject is child of given GameObject", args = "(GameObject*: parent)", returns = "(boolean)" }, SetParent = { type = "method", description = "Change self gameobject to given parent", args = "(GameObject*: parent)" } } } } }, gameObject = { type = "lib", description = "GameObject class", childs = { active = {type = "value"}, name = {type = "value"}, transform = { type = "class", description = "transform class", childs = { gameobject = {type = "value"}, parent = {type = "value"}, position = {type = "value"}, gposition = {type = "value"}, rotation = {type = "value"}, grotation = {type = "value"}, scale = {type = "value"}, forward = {type = "value"}, up = {type = "value"}, right = {type = "value"}, SetPositionv = { type = "method", description = "Set the position given a Vector3", args = "(Vector3: position)" }, SetPosition3f = { type = "method", description = "Set the position given a Vector3", args = "(x, y, z)" }, SetRotation = { type = "method", description = "Set the rotation given a Quaternion", args = "(Quaternion: rotation)" }, SetScale3f = { type = "method", description = "Set the scale given a Vector3", args = "(x, y, z)" }, LookAt = { type = "method", description = "Rotates GameObject to look to given position", args = "(Vector3: position)" }, Find = { type = "method", description = "Search a GameObject with name (only in children, not iterative)", args = "(string: name)", returns = "(GameObject*)" }, GetChild = { type = "method", description = "Search a GameObject with index n (only in children, not iterative)", args = "(number: n)", returns = "(GameObject*)" }, ChildCount = { type = "method", description = "Returns the number of children", args = "()", returns = "(number)" }, IsChilldOf = { type = "method", description = "Returns true if gameobject is child of given GameObject", args = "(GameObject*: parent)", returns = "(boolean)" }, SetParent = { type = "method", description = "Change self gameobject to given parent", args = "(GameObject*: parent)" } } } } }, transform = { type = "lib", description = "transform class", childs = { gameobject = {type = "value"}, parent = {type = "value"}, position = {type = "value"}, gposition = {type = "value"}, rotation = {type = "value"}, grotation = {type = "value"}, scale = {type = "value"}, forward = {type = "value"}, up = {type = "value"}, right = {type = "value"}, SetPositionv = { type = "method", description = "Set the position given a Vector3", args = "(Vector3: position)" }, SetPosition3f = { type = "method", description = "Set the position given a Vector3", args = "(x, y, z)" }, SetRotation = { type = "method", description = "Set the rotation given a Quaternion", args = "(Quaternion: rotation)" }, SetScale3f = { type = "method", description = "Set the scale given a Vector3", args = "(x, y, z)" }, LookAt = { type = "method", description = "Rotates GameObject to look to given position", args = "(Vector3: position)" }, Find = { type = "method", description = "Search a GameObject with name (only in children, not iterative)", args = "(string: name)", returns = "(GameObject*)" }, GetChild = { type = "method", description = "Search a GameObject with index n (only in children, not iterative)", args = "(number: n)", returns = "(GameObject*)" }, ChildCount = { type = "method", description = "Returns the number of children", args = "()", returns = "(number)" }, IsChilldOf = { type = "method", description = "Returns true if gameobject is child of given GameObject", args = "(GameObject*: parent)", returns = "(boolean)" }, SetParent = { type = "method", description = "Change self gameobject to given parent", args = "(GameObject*: parent)" } } }, Vector3 = { type = "class", description = "Vector3 class. Constructors (x, y, z) and (Vector3)", childs = { x = {type = "value"}, y = {type = "value"}, z = {type = "value"}, Normalize = { type = "method", description = "Normalize the vector", args = "()", returns = "(number)" }, Normalized = { type = "method", description = "Return the normalized vector", args = "()", returns = "(Vector3)" }, Magnitude = { type = "method", description = "Return the magnitude", args = "()", returns = "(number)" }, sqrMagnitude = { type = "method", description = "Return the magnitude sqrt", args = "()", returns = "(number)" }, toString = { type = "method", description = "Return a string with the values", args = "()", returns = "(string)" }, FromEuler = { type = "function", description = "(Static, call it from namespace)Return a quaternion with the rotation of the vector", args = "(x, y, z)", returns = "Static (Quat)" } } }, Quaternion = { type = "class", description = "Quaterion class. Constructor (x, y, z, w)", childs = { x = {type = "value"}, y = {type = "value"}, z = {type = "value"}, w = {type = "value"}, Normalize = { type = "method", description = "Normalize the Quaternion", args = "()", returns = "(number)" }, Normalized = { type = "method", description = "Return the normalized Quaternion", args = "()", returns = "(Vector3)" }, ToEuler = { type = "method", description = "Transform to Euler Angles XYZ", args = "()", returns = "(Vector3)" }, toString = { type = "method", description = "Return a string with the values", args = "()", returns = "(string)" }, SetFromAxisAngle = { type = "method", description = "Set the quaternion with the rotation of the given axis and angle", args = "(Vector3 axis, angle (radians))", returns = "()" }, FromEuler = { type = "function", description = "(Static, call it from namespace)Return a quaternion with the rotation of the vector", args = "(x, y, z)", returns = "Static (Quat)" }, RotateAxisAngle = { type = "function", description = "(Static, call it from namespace)Return the quaternion with the rotation of the given axis and angle", args = "(Vector3 axis, angle(radians))", returns = "Static (Quat)" }, RotateX = { type = "function", description = "(Static, call it from namespace)Return the quaternion with the rotation of the X axis and angle", args = "(angle(radians))", returns = "Static (Quat)" }, RotateY = { type = "function", description = "(Static, call it from namespace)Return the quaternion with the rotation of the Y axis and angle", args = "(angle(radians))", returns = "Static (Quat)" }, RotateZ = { type = "function", description = "(Static, call it from namespace)Return the quaternion with the rotation of the Z axis and angle", args = "(angle(radians))", returns = "Static (Quat)" } } } }
module 'mock' EnumOrientation = _ENUM_V { 'portrait' , 'landscape', } -------------------------------------------------------------------- CLASS: ScreenProfile () :MODEL{ Field 'name' :string(); '----'; Field 'width' :int(); Field 'height' :int(); Field 'dpi' :int(); Field 'orientation' :enum( EnumOrientation ); } function ScreenProfile:__init() self.name = 'screen-profile' self.width = 960 self.height = 640 self.orientation = 'portrait' self.dpi = 96 end function ScreenProfile:toString() return string.format( '<%s> %d*%d@%s dpi:%d', self.name, self.width, self.height, self.orientation, self.dpi ) end function ScreenProfile:getDimString() return string.format( '%d*%d', self.width, self.height ) end -------------------------------------------------------------------- --registery -------------------------------------------------------------------- local _screenProfileRegistry = {} function getScreenProfileRegistry() return _screenProfileRegistry end function registerScreenProfile( p ) table.insert( _screenProfileRegistry, p ) end function unregisterScreenProfile( p ) local idx = table.index( _screenProfileRegistry, p ) if idx then table.remove( _screenProfileRegistry, idx ) end end -------------------------------------------------------------------- --Builtin profiles -------------------------------------------------------------------- registerScreenProfile( ScreenProfile:rawInstance{ name = 'iPhone', width = 640; height = 960; dpi = 120; orientation = 'portrait' } )
return { version = "1.1", luaversion = "5.1", tiledversion = "0.12.1", orientation = "orthogonal", width = 64, height = 64, tilewidth = 32, tileheight = 32, nextobjectid = 36, properties = {}, tilesets = { { name = "128x128", firstgid = 1, tilewidth = 128, tileheight = 128, spacing = 0, margin = 0, image = "128cloud00.png", imagewidth = 128, imageheight = 128, tileoffset = { x = 0, y = 0 }, properties = {}, terrains = {}, tiles = {} }, { name = "256x256", firstgid = 2, tilewidth = 256, tileheight = 256, spacing = 0, margin = 0, tileoffset = { x = 0, y = 0 }, properties = {}, terrains = {}, tiles = { { id = 0, image = "256house00.png", width = 256, height = 256 }, { id = 1, image = "256tree00.png", width = 256, height = 256 }, { id = 2, image = "256cloud00.png", width = 256, height = 256 } } }, { name = "512x512", firstgid = 5, tilewidth = 512, tileheight = 512, spacing = 0, margin = 0, tileoffset = { x = 0, y = 0 }, properties = {}, terrains = {}, tiles = { { id = 0, image = "512tree00.png", width = 512, height = 512 } } }, { name = "1024x1024", firstgid = 6, tilewidth = 1024, tileheight = 1024, spacing = 0, margin = 0, image = "1024tree00.png", imagewidth = 1024, imageheight = 1024, tileoffset = { x = 0, y = 0 }, properties = {}, terrains = {}, tiles = {} } }, layers = { { type = "imagelayer", name = "bg00", x = 0, y = 0, visible = true, opacity = 1, image = "2048background00.png", properties = {} }, { type = "objectgroup", name = "e00", visible = true, opacity = 1, properties = {}, objects = { { id = 18, name = "e00a", type = "", shape = "ellipse", x = 2006.06, y = 42.4242, width = 0, height = 0, rotation = 0, visible = true, properties = {} }, { id = 20, name = "e00b", type = "", shape = "ellipse", x = 42.4242, y = 39.3939, width = 0, height = 0, rotation = 0, visible = true, properties = {} }, { id = 21, name = "e00c", type = "", shape = "ellipse", x = 2000, y = 754.545, width = 0, height = 0, rotation = 0, visible = true, properties = {} }, { id = 23, name = "e00d", type = "", shape = "ellipse", x = 27.2727, y = 672.727, width = 0, height = 0, rotation = 0, visible = true, properties = {} }, { id = 26, name = "e00e", type = "", shape = "ellipse", x = 1030.3, y = 36.3636, width = 0, height = 0, rotation = 0, visible = true, properties = {} }, { id = 30, name = "e00f", type = "", shape = "ellipse", x = 1080.48, y = 1200, width = 0, height = 0, rotation = 0, visible = true, properties = {} } } }, { type = "tilelayer", name = "t00", x = 0, y = 0, width = 64, height = 64, visible = true, opacity = 1, properties = {}, encoding = "lua", data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { type = "imagelayer", name = "bg01", x = 0, y = -128, visible = true, opacity = 1, image = "2048hills00.png", properties = {} }, { type = "tilelayer", name = "Tile Layer 3", x = 0, y = 0, width = 64, height = 64, visible = true, opacity = 1, properties = {}, encoding = "lua", data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }, { type = "imagelayer", name = "bg02", x = 0, y = -128, visible = true, opacity = 1, image = "2048hills01.png", properties = {} }, { type = "imagelayer", name = "bg03", x = 0, y = 0, visible = true, opacity = 1, image = "2048hills02.png", properties = {} }, { type = "tilelayer", name = "t00", x = 0, y = 0, width = 64, height = 64, visible = true, opacity = 1, properties = {}, encoding = "lua", data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } } }
nssm:register_mob("nssm:scrausics", "Scrausics", { type = "monster", hp_max = 33, hp_min = 22, collisionbox = {-0.4, -0.3, -0.4, 0.4, 0.3, 0.4}, visual = "mesh", mesh = "scrausics.x", textures = {{"scrausics.png"}}, visual_size = {x=10, y=10}, view_range = 35, rotate = 270, walk_velocity = 2, run_velocity = 3, fall_speed = 0, stepheight = 3, floats=1, sounds = { random = "scrausics", distance = 40, }, damage = 4, jump = true, drops = { {name = "nssm:life_energy", chance = 1, min = 3, max = 4,}, {name = "nssm:raw_scrausics_wing", chance = 1, min = 1, max = 2,}, }, armor = 80, drawtype = "front", lava_damage = 5, light_damage = 0, group_attack=true, attack_animals=true, knock_back=2, blood_texture="nssm_blood.png", on_rightclick = nil, fly = true, attack_type = "dogfight", animation = { speed_normal = 25, speed_run = 25, stand_start = 220, stand_end = 280, walk_start = 140, walk_end = 180, run_start = 190, run_end = 210, punch_start = 20, punch_end = 50, }, })
local seconds = 0 local function flashQuickly() local function checkFactoryResetOff() if(gpio.read(3) == 1) then node.restart() end end tmr.stop(4) tmr.stop(5) tmr.stop(6) gpio.mode(gpio1, gpio.OUTPUT) gpio.write(gpio1, gpio.LOW) tmr.alarm(4, 200, 1, toggleGPIO1LED) tmr.alarm(3, 1000, 1, checkFactoryResetOff) end local function checkFactoryReset() if(gpio.read(3) == 0) then if(file.open("config", "r") ~= nil) then if(seconds == 0) then gpio.mode(gpio1, gpio.OUTPUT) gpio.write(gpio1, gpio.LOW) tmr.alarm(4, 2500, 1, toggleGPIO1LED) print("Starting Factory Reset Check") end seconds = seconds + 1 if(seconds == 10) then print("Factory Reset!") file.remove("config") node.restart() end else flashQuickly() end else seconds = 0 end end tmr.alarm(6, 1000, 1, checkFactoryReset) -- If at the time of loading, gpio0 is low, it means a factory reset is in order if(gpio.read(3) == 0) then if(file.open("config", "r") ~= nil) then print("Factory Reset!") file.remove("config") else flashQuickly() end file.close("config") end
data:extend({ { type = "int-setting", default_value = 2, minimum_value = 0, maximum_value = 10, name = "calcui-decimal-places", setting_type = "runtime-per-user" }, { type = "bool-setting", default_value = false, name = "calcui-clear-on-calc", setting_type = "runtime-per-user" }, { type = "bool-setting", default_value = false, name = "calcui-shortcut-close", setting_type = "runtime-per-user" }, { type = "bool-setting", default_value = false, name = "calcui-nilaus-mode", setting_type = "runtime-per-user" }, { type = "bool-setting", default_value = false, name = "calcui-sfx", setting_type = "runtime-per-user" } })
local KUI, E, L, V, P, G = unpack(select(2, ...)) local M = KUI:GetModule("KuiMedia") local function mediaTable() E.Options.args.KlixUI.args.media = { type = "group", name = L["Media"], order = 50, childGroups = "tab", get = function(info) return E.db.KlixUI.media[ info[#info] ] end, disabled = function() return IsAddOnLoaded("ElvUI_SLE") end, hidden = function() return IsAddOnLoaded("ElvUI_SLE") end, args = { name = { order = 1, type = "header", name = KUI:cOption(L["Media"]), }, credits = { order = 2, type = "group", name = KUI:cOption(L["Credits"]), guiInline = true, args = { tukui = { order = 1, type = "description", fontSize = "medium", name = format("|cffff7d0a MerathilisUI - Merathilis|r & |cff9482c9Shadow&Light - Darth Predator|r"), }, }, }, zonefonts = { type = "group", name = L["Zone Text"], order = 3, args = { intro = { order = 1, type = "description", name = "", }, test = { order = 2, type = 'execute', name = L["Test"], disabled = function() return not E.private.general.replaceBlizzFonts end, func = function() M:TextShow() end, }, zone = { type = "group", name = ZONE, order = 3, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.zone[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.zone[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 48, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, width = { order = 4, name = L["Width"], type = "range", min = 512, max = E.eyefinity or E.screenwidth, step = 1, set = function(info, value) E.db.KlixUI.media.fonts.zone.width = value; M:TextWidth() end, }, }, }, subzone = { type = "group", name = L["Subzone Text"], order = 4, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.subzone[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.subzone[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 48, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, width = { order = 4, name = L["Width"], type = "range", min = 512, max = E.eyefinity or E.screenwidth, step = 1, set = function(info, value) E.db.KlixUI.media.fonts.subzone.width = value; M:TextWidth() end, }, offset = { order = 5, name = L["Offset"], type = "range", min = 0, max = 30, step = 1, }, }, }, pvpstatus = { type = "group", name = L["PvP Status Text"], order = 5, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.pvp[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.pvp[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 48, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, width = { order = 4, name = L["Width"], type = "range", min = 512, max = E.eyefinity or E.screenwidth, step = 1, set = function(info, value) E.db.KlixUI.media.fonts.pvp.width = value; M:TextWidth() end, }, }, }, }, }, miscfonts = { type = "group", name = L["Misc Texts"], order = 4, args = { mail = { type = "group", name = L["Mail Text"], order = 1, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.mail[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.mail[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], desc = "The font used for letters' body", values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 22, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, }, }, editbox = { type = "group", name = L["Chat Editbox Text"], order = 2, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.editbox[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.editbox[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], desc = "The font used for chat editbox", values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 20, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, }, }, gossip = { type = "group", name = L["Gossip and Quest Frames Text"], order = 2, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.gossip[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.gossip[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], desc = "The font used for chat editbox", values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 20, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, }, }, questHeader = { type = "group", name = L["Objective Tracker Header Text"], order = 3, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.objectiveHeader[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.objectiveHeader[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], desc = "The font used for chat editbox", values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 20, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, }, }, questTracker = { type = "group", name = L["Objective Tracker Text"], order = 4, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.objective[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.objective[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = "LSM30_Font", order = 1, name = L["Font"], desc = "The font used for chat editbox", values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 20, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, }, }, questFontSuperHuge = { type = "group", name = L["Banner Big Text"], order = 5, guiInline = true, disabled = function() return not E.private.general.replaceBlizzFonts end, get = function(info) return E.db.KlixUI.media.fonts.questFontSuperHuge[ info[#info] ] end, set = function(info, value) E.db.KlixUI.media.fonts.questFontSuperHuge[ info[#info] ] = value; E:UpdateMedia() end, args = { font = { type = "select", dialogControl = 'LSM30_Font', order = 1, name = L["Font"], desc = "The font used for chat editbox", values = AceGUIWidgetLSMlists.font, }, size = { order = 2, name = L["Font Size"], type = "range", min = 6, max = 48, step = 1, }, outline = { order = 3, name = L["Font Outline"], desc = L["Set the font outline."], type = "select", values = { ["NONE"] = L["None"], ["OUTLINE"] = "OUTLINE", ["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE", ["THICKOUTLINE"] = "THICKOUTLINE", }, }, }, }, }, }, }, } end tinsert(KUI.Config, mediaTable)
---@class EquipGrow_Intensify 强化 非满级 ---@field curEquipData EquipMgr_EquipData 当前质点信息 ---@field curCostGold number 当前消耗金币数量 ---@field isMaxLv boolean 已经达到最高级 local EquipGrow_Intensify = DClass("EquipGrow_Intensify", BaseComponent) _G.EquipGrow_Intensify = EquipGrow_Intensify function EquipGrow_Intensify:ctor() self.messager = Messager.new(self) self.listItem = {} --self.listSelectingItem = {} end function EquipGrow_Intensify:addListener() self.messager:addListener(Msg.EQUIP_GROW_EQUIPDATA, self.onUpdateData) self.messager:addListener(Msg.EQUIP_UPDATE_EQUIPDATAS, self.updateShowListUI) end function EquipGrow_Intensify:onDispose() self.messager:dispose() end function EquipGrow_Intensify:onStart() self:addListener() self:onInit() end function EquipGrow_Intensify:onInit() --self.listSelectingItem = {} self:addEventHandler(self.nodes.btnOnceAll.onClick, self.onOnceAll) self:addEventHandler(self.nodes.btnIntensify.onClick, self.onClickIntensify) self:addEventHandler(self.nodes.btnEquipTab.onClick, self.onClickEquipTab) self:addEventHandler(self.nodes.btnItemTab.onClick, self.onClickItemTab) self:addEventHandler(self.nodes.btnSort.onClick, self.onClickSort) --self:onInitUI() end function EquipGrow_Intensify:onInitUI() self.nodes.sortNode:SetActive(false) self.isShowEquip = false self:onTabChanged(true) end ---@param data EquipMgr_EquipData function EquipGrow_Intensify:onUpdateData(data, updateUI) self.curEquipData = data if updateUI then local configEquipGroup = Config.EquipStage[self.curEquipData.quality] local isMaxLv = self.curEquipData.lv >= configEquipGroup.maxlevel if isMaxLv then MsgCenter.sendMessage(Msg.EQUIPGROW_CHANGE_NODESTATE, EquipGrowWindow.NODE_STATE.BREAK) else self:onUpdateUI() end end end function EquipGrow_Intensify:onUpdateUI() self:updateConfigs() self:setQuilityUI() self:setLvExpUI() self:setEquipBaseUI(0) end function EquipGrow_Intensify:updateConfigs() self.configEquip = Config.Equip[self.curEquipData.cId] self.configEquipGroup = Config.EquipStage[self.curEquipData.quality] self.configSuit = Config.EquipSuit[self.configEquip.type3] local keyAttr = self.configEquip.star * 10 + self.configEquip.item_position self.configAttr = Config.EquipAttr[keyAttr] local keyLv = self.curEquipData.quality * 100 + self.curEquipData.lv self.configLv = Config.EquipLevel[keyLv] end function EquipGrow_Intensify:setLvExpUI() self.isMaxLv = self.configLv.exp == -1 if self.isMaxLv then MsgCenter.sendMessage(Msg.EQUIPGROW_CHANGE_NodesState, EquipGrowWindow.NODE_STATE.BREAK) return end self.preLv = self.curEquipData.lv self.preExp = self.curEquipData.exp self.nodes.txtCurLv.text = self.curEquipData.lv self.nodes.txtMaxLv.text = string.format("/%d", self.configEquipGroup.maxlevel) self.nodes.txtExp.text = self.isMaxLv and "Max" or string.format("%d/%d", self.curEquipData.exp, self.configLv.exp) self.nodes.imgCurExp.gameObject:SetActive(true) self.nodes.imgCurExp.fillAmount = self.curEquipData.exp / self.configLv.exp self.nodes.imgAddExp.fillAmount = 0 self:setIntensifyCost(0) end function EquipGrow_Intensify:setQuilityUI() EquipManager:setQuility(self, self.nodes.imgStage, self.curEquipData.quality, EquipManager.STAGE_TYPE.ICON) end function EquipGrow_Intensify:setEquipBaseUI(addLv, isPre) local listAttr = self.configAttr.show_attr local funcAttr = function(index, obj) local data = EquipManager:getEquipAttr(self.configAttr, listAttr[index], self.curEquipData.quality, self.curEquipData.lv) local txtName = obj.transform:Find("Text_Name"):GetComponent(typeof(Text)) local txtAdd = obj.transform:Find("Text_AddNum"):GetComponent(typeof(Text)) local txtNum = txtAdd.transform:Find("Text_CurNum"):GetComponent(typeof(Text)) txtName.text = data.name txtNum.text = data.num local ndata = EquipManager:getEquipAttr( self.configAttr, listAttr[index], self.curEquipData.quality, self.curEquipData.lv + addLv ) txtAdd.text = string.format(isPre and "<color=yellow>(+%d)</color>" or "(+%d)", ndata.addNumLv - data.addNumLv) end funcAttr(1, self.nodes.attrShow1) funcAttr(2, self.nodes.attrShow2) end ---一键填充 function EquipGrow_Intensify:onOnceAll() if self.isShowEquip then self:addOnceAllEquips() else self:addOnceAllItems() end end function EquipGrow_Intensify:addOnceAllItems() --local list = table.deepclone(self.listItem) for key, value in pairs(self.listShowItems) do value.num = 0 local item = table.findOne( self.listItem, function(o) return o.cId == value.itemData.cId end ) if item then item.txtNum.text = value.num end self:updataItemAddExp() end table.sort( self.listShowItems, function(a, b) return a.itemData.cId < b.itemData.cId end ) for key, value in pairs(self.listShowItems) do if self.isMaxLv then break end local ownCount = BagMgr:getItemDataByCId(value.itemData.cId).num local count = self:getAddItemMaxCount(value.itemData.addExp, ownCount) value.num = count local item = table.findOne( self.listItem, function(o) return o.cId == value.itemData.cId end ) if item then item.txtNum.text = value.num end self:updataItemAddExp() end end function EquipGrow_Intensify:addOnceAllEquips() -- local listShow = EquipMgr:getEquipsExceptEquiped(EquipMgr:getAllEquipDatas()) -- table.removeAll( -- listShow, -- function(e) -- local cfg = Config.Equip[e.cId] -- return e.locked or cfg.star >= EquipManager:getIntensifyOnceStar() -- end -- ) -- table.sort( -- listShow, -- function(a, b) -- local configA = Config.Equip[a.cId] -- local configB = Config.Equip[b.cId] -- return configA.star < configB.star -- end -- ) -- local preLv = self.curEquipData.lv -- local exp = self.curEquipData.exp -- local lvMax = Config.EquipStage[self.curEquipData.quality].maxlevel -- for index, value in ipairs(listShow) do -- if preLv >= lvMax then -- break -- else -- local selectData = EquipMgr:getEquipDataByGid(value.gId) -- local config = Config.Equip[selectData.cId] -- local configLv = Config.EquipLevel[selectData.quality * 100 + selectData.lv] -- local addExp = config.exp + configLv.exp_upgrade -- exp = exp + addExp -- local _exp, _lv, _isUp = self:onCheckPreExp(exp, preLv) -- if _isUp then -- preLv = _lv -- exp = _exp -- end -- end -- self:onSelectEquipExp(value.gId) -- end local listGid = self:getOnceAllEquips() -- for key, value in pairs(listGid) do -- self:onSelectEquipExp(value) -- end self:onSelectEquipExp() end ---强化 function EquipGrow_Intensify:onClickIntensify() ---@type HERO_REQ_STRENGTHEN_EQUIP local data = {} data.equipId = self.curEquipData.gId data.consumeEquipIds = {} local listGid = self:getCurSelectedEquips()--使用装备强化 for key, value in pairs(listGid) do table.insert(data.consumeEquipIds, value) end data.itemData = {} ---@type EquipMgr_ItemData local _iData = {} if self.listShowItems then---使用道具强化 for key, value in pairs(self.listShowItems) do if value.num > 0 then _iData = {} _iData.itemId = value.itemData.cId _iData.itemNum = value.num table.insert(data.itemData, _iData) end end end -- _iData = {} -- _iData.itemId = 104005 --ItemType.GOLD -- _iData.itemNum = 1 -- table.insert(data.itemData, _iData) if self.curCostGold > BagMgr:getGoldCount() then MsgCenter.sendMessage(Msg.HINT_COMMON, Lang(GL_EquipGrow_Intensify_JinBiBuZu)) --"金币不足" return end EquipMgr:sendStrengthenEquip(data) --强化装备 end ---用质点强化 function EquipGrow_Intensify:onClickEquipTab() self:resetSelectItems() self:updataItemAddExp() self:onTabChanged(true) end ---用道具强化 function EquipGrow_Intensify:onClickItemTab() self:resetSelectedEquips() self:updateEquipAddExp() self:onTabChanged(false) end ---排序 function EquipGrow_Intensify:onClickSort() self:setSortView() end function EquipGrow_Intensify:onTabChanged(showEquip) if self.isShowEquip == showEquip then return end self.isShowEquip = showEquip local equipActive = self.nodes.btnEquipTab.transform:Find("Image").gameObject local itemActive = self.nodes.btnItemTab.transform:Find("Image").gameObject equipActive:SetActive(showEquip) itemActive:SetActive(not showEquip) self.nodes.equipsView.transform.parent.parent.gameObject:SetActive(showEquip) self.nodes.itemView.transform.parent.parent.gameObject:SetActive(not showEquip) if self.isShowEquip then self:onShowEquipsView() else self:onShowItemsView() end end function EquipGrow_Intensify:onShowEquipsView() self.listEquipItem = {} --self.listSelectingItem = {} local listShow = EquipMgr:getEquipsExceptEquiped(EquipMgr:getAllEquipDatas()) self.listShowEquipDatas = {} ---@class EquipGrow_Intensify_DataSelectEquip ---@field isSelect boolean ---@field equipData EquipMgr_EquipData for k, v in pairs(listShow) do ---@type EquipGrow_Intensify_DataSelectEquip local d = {} d.equipData = v d.isSelect = false table.insert(self.listShowEquipDatas, d) end table.removeOne( self.listShowEquipDatas, function(data) if self.curEquipData then return self.curEquipData.gId == data.equipData.gId end end ) table.sort( self.listShowEquipDatas, function(a, b) if self.curSortState == 2 then --等级 return a.equipData.lv < b.equipData.lv else --星级级 local configA = Config.Equip[a.equipData.cId] local configB = Config.Equip[b.equipData.cId] return configA.star < configB.star end end ) self.nodes.equipsView:InitPool( #self.listShowEquipDatas, function(index, obj) ---@type EquipGrow_Intensify_DataSelectEquip local data = self.listShowEquipDatas[index] local imgSelect = obj.transform:Find("Image_Select").gameObject local btnSelf = obj:GetComponent(typeof(Button)) imgSelect:SetActive(data.isSelect) -- for key, value in pairs(self.listSelectingItem) do -- if value.gId == data.equipData.gId then -- imgSelect:SetActive(true) -- break -- end -- end local cpt_Equip = self:createComponent(obj.gameObject, Equip_ItemCell) cpt_Equip:onUpdateUI(data.equipData) local item = {} item.gId = data.equipData.gId item.data = data.equipData item.select = imgSelect item.cpt = cpt_Equip self:addEventHandler( btnSelf.onClick, function() local isLockStar, des = EquipManager:checkEquipLockOrStar(data.equipData) if not item.isSelect and isLockStar ~= 0 then local tData = {} tData.title = "" tData.content = string.format(Lang(GL_EquipGrow_Intensify_QueRenXiao), des) --"确认消耗%s的装备吗?" tData.buttonNames = {Lang(GL_BUTTON_SURE), Lang(GL_BUTTON_CANNEL)} tData.buttonTypes = {1, 2} tData.callback = function(sort) if sort == 1 then self:updateShowEquipDatas(item, not data.isSelect) end end MsgCenter.sendMessage(Msg.NOTIFY, tData) else self:updateShowEquipDatas(item, not data.isSelect) end end ) if data.equipData.gId then local contains = 0 for key, value in pairs(self.listEquipItem) do if value.gId == data.equipData.gId then contains = contains + 1 end end if contains <= 0 then table.insert(self.listEquipItem, item) end end end ) end function EquipGrow_Intensify:updateShowEquipDatas(item, select) if select then if self.isMaxLv then Log("已经达到最大等级") return end else end item.select.gameObject:SetActive(select) for key, value in pairs(self.listShowEquipDatas) do if value.equipData.gId == item.gId then value.isSelect = select end end self:onSelectEquipExp(item.gId) end ---选择消耗的装备 function EquipGrow_Intensify:onSelectEquipExp(gId) -- for key, value in pairs(self.listEquipItem) do -- if gId == value.gId then -- local indexRm = 0 -- for index, v in ipairs(self.listSelectingItem) do -- if v.gId == value.gId then -- indexRm = index -- end -- end -- if indexRm ~= 0 then -- table.remove(self.listSelectingItem, indexRm) -- else -- if self.isMaxLv then -- Log("已经达到最大等级") -- return -- end -- table.insert(self.listSelectingItem, value) -- end -- value.select.gameObject:SetActive(indexRm == 0) -- ---添加刷新 经验条--- -- self:updateEquipAddExp() -- end -- end ---添加刷新 经验条--- self:updateEquipAddExp() end ---消耗装备添加的经验 function EquipGrow_Intensify:updateEquipAddExp() local _listSelectedEquip = self:getSelectedEquips() if not _listSelectedEquip or #_listSelectedEquip <= 0 then self:setLvExpUI() self:setEquipBaseUI(0, false) return end local addExp = 0 local addCost = 0 for key, value in pairs(_listSelectedEquip) do local selectData = EquipMgr:getEquipDataByGid(value.equipData.gId) local config = Config.Equip[selectData.cId] local configLv = Config.EquipLevel[value.equipData.quality * 100 + selectData.lv] addExp = addExp + config.exp + configLv.exp_upgrade addCost = addCost + config.gold end self:onShowPreData(addExp, addCost) end ---查看预显示升级属性 function EquipGrow_Intensify:onShowPreData(addExp, addCost) local maxLv = self.configEquipGroup.maxlevel local totleExp = self.curEquipData.exp + addExp local curLv = self.curEquipData.lv local isUpable = false local leftExp, preLv, isUpgrade = self:onCheckPreExp(totleExp, curLv) isUpable = isUpgrade while preLv < maxLv and leftExp > 0 and isUpgrade do local _exp, _lv, _isUped = self:onCheckPreExp(leftExp, preLv) if _isUped then leftExp, preLv, isUpgrade = self:onCheckPreExp(leftExp, preLv) else isUpgrade = false end end local addLv = preLv - self.curEquipData.lv self:updateAddExpUI(leftExp, preLv, addLv > 0) self:setEquipBaseUI(addLv + 1, true) self:setIntensifyCost(addCost) end ---刷新添加的经验 function EquipGrow_Intensify:updateAddExpUI(exp, lv, isUped) local configLv = Config.EquipLevel[self.curEquipData.quality * 100 + lv] local configStage = Config.EquipStage[self.curEquipData.quality] self.preLv = lv self.preExp = exp self.isMaxLv = configLv.exp == -1 self.nodes.txtCurLv.text = string.format("<color=yellow>%d</color>", lv) self.nodes.txtMaxLv.text = string.format("/%d", configStage.maxlevel) self.nodes.txtExp.text = self.isMaxLv and "<color=yellow>Max</color>" or string.format("<color=yellow>%d</color>/%d", exp, configLv.exp) self.nodes.imgCurExp.gameObject:SetActive(not isUped) self.nodes.imgCurExp.fillAmount = self.curEquipData.exp / configLv.exp self.nodes.imgAddExp.fillAmount = exp / configLv.exp end ---设置强化需要消耗的数量 function EquipGrow_Intensify:setIntensifyCost(cost) local txtCost = self.nodes.btnIntensify.transform:Find("Image/Text_Num"):GetComponent(typeof(Text)) local imgIcon = self.nodes.btnIntensify.transform:Find("Image/Image_Icon"):GetComponent(typeof(Image)) local ownGold = BagMgr:getGoldCount() txtCost.text = cost >= ownGold and string.format("<color=red>%d</color>", cost) or string.format("<color=white>%d</color>", cost) self.curCostGold = cost BagManager.setItemIcon(self, imgIcon, ItemType.GOLD) end ---检测 预显示 使用exp升级后 lv为当前等级 function EquipGrow_Intensify:onCheckPreExp(exp, lv) local leftExp = exp local preLv = lv local isUpgrade = false ---当前经验满条 local curTotleMaxExp = Config.EquipLevel[self.curEquipData.quality * 100 + preLv].exp local _leftExp = leftExp - curTotleMaxExp if leftExp > 0 and _leftExp >= 0 then leftExp = _leftExp preLv = preLv + 1 isUpgrade = true else isUpgrade = false end return leftExp, preLv, isUpgrade end function EquipGrow_Intensify:updateShowListUI() self:onShowEquipsView() self:onShowItemsView() end function EquipGrow_Intensify:onShowItemsView() self.listItem = {} local _listShowItems = EquipManager:getIntensifyItems() ---@class EquipGrow_Intensify_ItemData ---@field itemData EquipMgr_IntersifyItemData ---@field num number self.listShowItems = {} for key, value in pairs(_listShowItems) do ---@type EquipGrow_Intensify_ItemData local data = {} data.itemData = value data.num = 0 table.insert(self.listShowItems, data) end self.nodes.itemView:InitPool( #self.listShowItems, function(index, obj) ---@type EquipGrow_Intensify_ItemData local data = self.listShowItems[index] local configItem = Config.Item[data.itemData.cId] ---@type BagMgr_BagItemInfo local itemBagData = BagMgr:getItemDataByCId(data.itemData.cId) local imgBg = obj.transform:Find("IconNode/Image_Bg"):GetComponent(typeof(Image)) local imgIcon = obj.transform:Find("IconNode/Image_Icon"):GetComponent(typeof(Image)) local txtPlace = obj.transform:Find("IconNode/Image/Text_Place"):GetComponent(typeof(Text)) local txtName = obj.transform:Find("Text_Name"):GetComponent(typeof(Text)) local txtNum = obj.transform:Find("Text_Num"):GetComponent(typeof(Text)) local btnMin = obj.transform:Find("Image_Control/Button_Min"):GetComponent(typeof(Button)) local btnMax = obj.transform:Find("Image_Control/Button_Max"):GetComponent(typeof(Button)) local btnLost = obj.transform:Find("Image_Control/Button_Lost"):GetComponent(typeof(Button)) local btnAdd = obj.transform:Find("Image_Control/Button_Add"):GetComponent(typeof(Button)) local txtCurCount = obj.transform:Find("Image_Control/Image/Text_CurCount"):GetComponent(typeof(Text)) local ctrlNum = data.num txtPlace.transform.parent.gameObject:SetActive(false) txtName.text = configItem.name txtNum.text = string.format("×%d", itemBagData.num) EquipManager:setQuility(self, imgBg, configItem.star, EquipManager.STAGE_TYPE.BG_CUBE) BagManager.setItemIcon(self, imgIcon, data.itemData.cId) for i = 1, 6 do local starObj = obj.transform:Find("IconNode/Stars/Star" .. i).gameObject starObj:SetActive(i <= configItem.star) end txtCurCount.text = ctrlNum local item = {} item.cId = data.itemData.cId item.data = data.itemData item.ownNum = itemBagData.num item.txtNum = txtCurCount table.insert(self.listItem, item) self:addEventHandler( btnMin.onClick, function() for key, value in pairs(self.listItem) do if value.cId == item.cId then data.num = 0 value.txtNum.text = data.num self:updataItemAddExp() end end end ) self:addEventHandler( btnMax.onClick, function() if self.isMaxLv then Log("已经达到最大等级") return end local count = self:getAddItemMaxCount(item.data.addExp, item.ownNum) for key, value in pairs(self.listItem) do if value.cId == item.cId then data.num = count value.txtNum.text = count self:updataItemAddExp() end end end ) self:addEventHandler( btnLost.onClick, function() for key, value in pairs(self.listItem) do if value.cId == item.cId then if data.num > 0 then data.num = data.num - 1 value.txtNum.text = data.num self:updataItemAddExp() end end end end ) self:addEventHandler( btnAdd.onClick, function() for key, value in pairs(self.listItem) do if value.cId == item.cId then if data.num < value.ownNum then if self.isMaxLv then Log("已经达到最大等级") return end data.num = data.num + 1 value.txtNum.text = data.num self:updataItemAddExp() end end end end ) -- table.removeOne( -- self.listItem, -- function(itemObj) -- return itemObj.gId == item.gId -- end -- ) end ) end function EquipGrow_Intensify:getAddItemMaxCount(addExp, maxNum) local exp = addExp local lackExp = EquipMgr:getEquipMaxExpNeed(self.preExp, self.preLv, self.curEquipData) local countNeed = math.ceil(lackExp / exp) return countNeed >= maxNum and maxNum or countNeed end ---刷新道具添加的经验 function EquipGrow_Intensify:updataItemAddExp() local addExp = 0 local addCost = 0 for key, value in pairs(self.listShowItems) do if value.num > 0 then addExp = addExp + value.num * value.itemData.addExp addCost = addCost + value.num * value.itemData.addCost end end if addExp == 0 then self:setLvExpUI() self:setEquipBaseUI(0, false) return end self:onShowPreData(addExp, addCost) end function EquipGrow_Intensify:setSortView() local sortState = not self.nodes.sortNode.activeSelf self.nodes.sortNode:SetActive(sortState) if sortState then local listSort = {Lang(51030004), Lang(51030042)} --{"星级", "等级"} self.listSortItem = {} if not self.curSortState then self.curSortState = 1 end self.nodes.sortView:InitPool( #listSort, function(index, obj) local data = listSort[index] local txtName = obj.transform:Find("Text"):GetComponent(typeof(Text)) local imgSelect = obj.transform:Find("Image_Select").gameObject local btnSort = obj.transform:GetComponent(typeof(Button)) imgSelect:SetActive(self.curSortState == data) txtName.text = data local item = {} item.data = index item.select = imgSelect table.insert(self.listSortItem, item) self:addEventHandler( btnSort.onClick, function() for key, value in pairs(self.listSortItem) do value.select:SetActive(value.data == index) end local txtSortBtn = self.nodes.btnSort.transform:Find("Text"):GetComponent(typeof(Text)) txtSortBtn.text = data self.curSortState = index self:setSortView() self:onShowEquipsView() end ) end ) end end ---获取可以一键填充的装备gid list function EquipGrow_Intensify:getOnceAllEquips() ---@type table<number> local listOnceAll = {} self:resetSelectedEquips() local lackExp = EquipMgr:getEquipMaxExpNeed(self.curEquipData.exp, self.curEquipData.lv, self.curEquipData) if lackExp <= 0 then return listOnceAll end local expMax = false for index, value in ipairs(self.listShowEquipDatas) do local config = Config.Equip[value.equipData.cId] local cfgLv = Config.EquipLevel[value.equipData.quality * 100 + value.equipData.lv] local addExp = config.exp + cfgLv.exp_upgrade value.isSelect = true table.insert(listOnceAll, value.equipData.gId) lackExp = lackExp - addExp if lackExp > 0 then else break end end Log(dumpTable(listOnceAll, "EquipGrow_Intensify:getOnceAllEquips()---")) for key, value in pairs(self.listShowEquipDatas) do local item = table.findOne( self.listEquipItem, function(a) return a.gId == value.equipData.gId end ) if item then item.select.gameObject:SetActive(value.isSelect) end end return listOnceAll end ---获取选中的装备 function EquipGrow_Intensify:getSelectedEquips() local select = table.findAll( self.listShowEquipDatas, function(d) return d.isSelect end ) return select end function EquipGrow_Intensify:resetSelectedEquips() for key, value in pairs(self.listShowEquipDatas) do value.isSelect = false end end function EquipGrow_Intensify:getCurSelectedEquips() local list = {} for key, value in pairs(self.listShowEquipDatas) do if value.isSelect then table.insert(list, value.equipData.gId) end end return list end function EquipGrow_Intensify:resetSelectItems() for key, value in pairs(self.listShowItems) do value.num = 0 end end
local syntax_makefile = { bgcolor = "darkblue"; bracketmatch = true; { name = "Comment"; fgcolor = "gray7"; pattern = [[ ^\s*\#.* ]]; }, { name = "Include"; fgcolor = "red"; pattern = [[ ^\s* [!\-]? include (?! \S) .* ]]; }, { name = "Conditional"; fgcolor = "green"; pattern = [[ ^\s* (?: ifeq|ifneq|ifdef|ifndef|else|endif| !(?: if|else|endif|elseif|ifdef|ifndef|undef) ) (?! \S) .* ]]; }, { name = "Assign"; fgcolor = "yellow"; pattern = [[ ^\s*[a-zA-Z_][a-zA-Z_0-9]* (?= \s* [:+?]?= ) ]]; }, { name = "Target"; fgcolor = "white"; pattern = [[ ^ (?: \S+\s+)* \S+\s* ::? (?= \s|$) ]]; }, } Class { name = "Make file"; filemask = "Makefile*;*.mak"; syntax = syntax_makefile; }
local classic = require 'classic' local optim = require 'optim' local AsyncAgent = require 'async/AsyncAgent' require 'modules/sharedRmsProp' local A3CAgent,super = classic.class('A3CAgent', 'AsyncAgent') local TINY_EPSILON = 1e-20 function A3CAgent:_init(opt, policyNet, targetNet, theta, targetTheta, atomic, sharedG) super._init(self, opt, policyNet, targetNet, theta, targetTheta, atomic, sharedG) log.info('creating A3CAgent') self.policyNet_ = policyNet:clone() self.theta_, self.dTheta_ = self.policyNet_:getParameters() self.dTheta_:zero() self.policyTarget = self.Tensor(self.m) self.vTarget = self.Tensor(1) self.targets = { self.vTarget, self.policyTarget } self.rewards = torch.Tensor(self.batchSize) self.actions = torch.ByteTensor(self.batchSize) self.states = torch.Tensor(0) self.beta = opt.entropyBeta self.env:training() classic.strict(self) end function A3CAgent:learn(steps, from) self.step = from or 0 self.stateBuffer:clear() log.info('A3CAgent starting | steps=%d', steps) local reward, terminal, state = self:start() self.states:resize(self.batchSize, table.unpack(state:size():totable())) self.tic = torch.tic() repeat self.theta_:copy(self.theta) self.batchIdx = 0 repeat self.batchIdx = self.batchIdx + 1 self.states[self.batchIdx]:copy(state) local V, probability = table.unpack(self.policyNet_:forward(state)) local action = torch.multinomial(probability, 1):squeeze() self.actions[self.batchIdx] = action reward, terminal, state = self:takeAction(action) self.rewards[self.batchIdx] = reward self:progress(steps) until terminal or self.batchIdx == self.batchSize self:accumulateGradients(terminal, state) if terminal then reward, terminal, state = self:start() end self:applyGradients(self.policyNet_, self.dTheta_, self.theta) until self.step >= steps log.info('A3CAgent ended learning steps=%d', steps) end function A3CAgent:accumulateGradients(terminal, state) local R = 0 if not terminal then R = self.policyNet_:forward(state)[1] end for i=self.batchIdx,1,-1 do R = self.rewards[i] + self.gamma * R local action = self.actions[i] local V, probability = table.unpack(self.policyNet_:forward(self.states[i])) probability:add(TINY_EPSILON) -- could contain 0 -> log(0)= -inf -> theta = nans self.vTarget[1] = -0.5 * (R - V) -- ∇θ logp(s) = 1/p(a) for chosen a, 0 otherwise self.policyTarget:zero() -- f(s) ∇θ logp(s) self.policyTarget[action] = -(R - V) / probability[action] -- Negative target for gradient descent -- Calculate (negative of) gradient of entropy of policy (for gradient descent): -(-logp(s) - 1) local gradEntropy = torch.log(probability) + 1 -- Add to target to improve exploration (prevent convergence to suboptimal deterministic policy) self.policyTarget:add(self.beta, gradEntropy) self.policyNet_:backward(self.states[i], self.targets) end end function A3CAgent:progress(steps) self.atomic:inc() self.step = self.step + 1 if self.step % self.progFreq == 0 then local progressPercent = 100 * self.step / steps local speed = self.progFreq / torch.toc(self.tic) self.tic = torch.tic() log.info('A3CAgent | step=%d | %.02f%% | speed=%d/sec | η=%.8f', self.step, progressPercent, speed, self.optimParams.learningRate) end end return A3CAgent
actionmove = {} function actionmove.move(e, currentaction, dt) local destx = currentaction.x local desty = currentaction.y if e.position.x == destx and e.position.y == desty then -- capture the current position as the previous position e.position.previousx = e.position.x e.position.previousy = e.position.y -- arrived at destination table.remove(e.isPerson.queue, 1) fun.addLog(e, currentaction.log) else -- move towards destination if e.isPerson.stamina > 0 then fun.applyMovement(e, destx, desty, WALKING_SPEED, dt) -- entity, x, y, speed, dt else fun.applyMovement(e, destx, desty, WALKING_SPEED / 2, dt) -- entity, x, y, speed, dt end end end return actionmove
local struct = string; local cjson = require("cjson") local InLuaPacket = {}; function InLuaPacket:ctor(buf) self.buf = "" self.position = 1 if buf then self:copy(buf); end end function InLuaPacket:readInt() local ret = 0 if self.position + 3 <= #self.buf then ret,self.position = struct.unpack('>I4',self.buf,self.position) end return ret end function InLuaPacket:readUnsignInt() local ret ret,self.position = struct.unpack('>I4',self.buf,self.position) return ret end function InLuaPacket:readInt64() local ret ret,self.position = struct.unpack('>i8',self.buf,self.position) return ret end function InLuaPacket:readUnsignInt64() local ret ret,self.position = struct.unpack('>I8',self.buf,self.position) return ret end function InLuaPacket:readShort() local ret ret,self.position = struct.unpack('>h',self.buf,self.position) return ret end function InLuaPacket:readUnsignShort() local ret ret,self.position = struct.unpack('>H',self.buf,self.position) return ret end function InLuaPacket:readByte() local ret ret,self.position = struct.unpack('>B',self.buf,self.position) return ret end function InLuaPacket:readString() -- do return self:readBinary() end --兼容线上环境的读包方式 local len = self:readInt() local ret ret,self.position = struct.unpack('c' .. tostring(len-1),self.buf,self.position) self.position = self.position + 1 return ret end function InLuaPacket:readString() local len = self:readInt() if len == 1 then do local ret ret,self.position = struct.unpack('c' .. tostring(len),self.buf,self.position) self.position = self.position return ret end end local ret ret,self.position = struct.unpack('c' .. tostring(len-1),self.buf,self.position) self.position = self.position + 1 return ret end function InLuaPacket:readBinary() local len = self:readInt() local ret ret,self.position = struct.unpack('c' .. tostring(len),self.buf,self.position) self.position = self.position return ret end function InLuaPacket:reset() self.buf = "" self.position = 1 self.m_cmd = 0 self.len = 0 end function InLuaPacket:copy(buf) if type(buf) == "string" then self.buf = buf self.position = 1 -- error(#self.buf) return; end -- 兼容线上环境的读包方式 if type(buf) == "table" then self.buf = buf.buf; self.position = buf.position; self.m_cmd = buf.m_cmd; self.len = buf.len; return; end end function InLuaPacket:dtor() -- body end function InLuaPacket:unpackToSkyNet() local cmd = self:readInt(); local jsonStr = self:readString(); local data = cjson.decode(jsonStr); data.cmd_ = cmd; return cmd,data end return InLuaPacket
-------------------------------------------------------------------- -- -- Commande !help <Commande> -- -------------------------------------------------------------------- -- Est une commande ScriptType = "command" -- La commande CommandString = "help" -- Nombre minimum d'arguments MinArguments = 0 -- Nombre maximum d'arguments MaxArguments = 1 -------------------------------------------------------------------- -- -- Commande !help request -- -------------------------------------------------------------------- local function helpRequest(senderNickname) server:sendTwitch("Le format des requêtes est: <Url> (+ <Commentaire>). Le commentaire est optionnel") end -------------------------------------------------------------------- -- -- Commande !help doc -- -------------------------------------------------------------------- local function helpDoc(senderNickname) server:sendTwitch("Le doc est disponible à l'adresse http://tinyurl.com/osufrliverules. Il n'est accessible que par les streamers cependant") end -------------------------------------------------------------------- -- -- Commande !help nightbot -- -------------------------------------------------------------------- local function helpNightbot(senderNickname) server:sendTwitch("Nightbot c'est mon grand frère. Mais il est moins bavard. Et il aime pas venir ici, il s'en va tout le temps.") end -------------------------------------------------------------------- -- -- Commande !help skin -- -------------------------------------------------------------------- local function helpSkin(senderNickname) server:sendTwitch("Pour accéder au skin d'un joueur faites !brioche skin <Pseudo>, ou encore !skin <Pseudo>. Le pseudo est optionnel, et l'omettre donnera le skin du streamer actuel.") end -------------------------------------------------------------------- -- -- Commande !help -- -------------------------------------------------------------------- local function help(senderNickname) server:sendTwitch("Les pages d'aide disponibles sont: request, doc, nightbot, skin. Faites !help <Page> pour y accéder.") end -------------------------------------------------------------------- -- -- Callback -- -------------------------------------------------------------------- local pages = { request = helpRequest, doc = helpDoc, nightbot = helpNightbot, skin = helpSkin } -- Callback function onCommand(sender, page) -- Si aucune page n'est donnée if page == nil then -- On appelle la fonction sans argument help(sender) -- Sinon else -- Si la page demandée n'existe pas if pages[page] == nil then -- Erreur server:sendTwitch("La page " .. page .. " n'existe pas") -- Sinon else -- On appelle la fonction correspondante pages[page](sender) end end end
Particles = class('Particles') function Particles:initialize() self.particleLimit = 256 self.particleImage = love.graphics.newImage("img/particle.png") self.particleSmallImage = love.graphics.newImage("img/particleSmall.png") self.particleSystem = love.graphics.newParticleSystem(self.particleImage, self.particleLimit) self.particleSystem:setRadialAcceleration(500, 600) self.particleSystem:setParticleLifetime(1) self.particleSystem:setSpread(2*math.pi) self.particleSystem:setSizeVariation(0.5) self.particleSystem:setRelativeRotation(true) self.particleSystem:setColors(255/255, 0, 0, 255/255, 0, 0, 0, 0) self.particleSmallSystem = self.particleSystem:clone() self.particleSmallSystem:setTexture(self.particleSmallImage) self.healingParticleSystem = self.particleSmallSystem:clone() self.bulletParticleSystem = self.particleSystem:clone() signal.register('enemyDeath', function(enemy) self:onEnemyDeath(enemy) end) signal.register('enemyHit', function(enemy) self:onEnemyHit(enemy) end) signal.register('healing', function(enemy, healer) self:onHealing(enemy, healer) end) signal.register('playerShot', function(player, bullet) self:onPlayerShoot(player, bullet) end) signal.register('newGame', function() self.particleSystem:reset() self.particleSmallSystem:reset() end) end function Particles:update(dt) self.particleSystem:update(dt) self.particleSmallSystem:update(dt) self.healingParticleSystem:update(dt) self.bulletParticleSystem:update(dt) self.particleSystem:setSpeed(250) self.particleSmallSystem:setSpeed(250) end function Particles:onEnemyDeath(enemy) for i, system in pairs({self.particleSystem, self.particleSmallSystem}) do system:setColors(enemy.color[1], enemy.color[2], enemy.color[3], 128/255, 0, 0, 0, 0) system:setSpeed(300, 550) system:setPosition(enemy.position.x, enemy.position.y) system:setSizes(2, 1) system:emit(15) end end function Particles:onEnemyHit(enemy) for i, system in pairs({self.particleSystem, self.particleSmallSystem}) do system:setColors(enemy.color[1], enemy.color[2], enemy.color[3], 128/255, 0, 0, 0, 0) system:setSpeed(50, 250) system:setPosition(enemy.position.x, enemy.position.y) system:emit(5) end end function Particles:onHealing(enemy, healer) for i, system in pairs({self.healingParticleSystem}) do system:setColors(healer.color[1], healer.color[2], healer.color[3], 150/255, 0, 0, 0, 0) system:setSpeed(10, 50) system:setPosition(enemy.position.x, enemy.position.y) system:emit(1) end end function Particles:onPlayerShoot(player, bullet) for i, system in pairs({self.bulletParticleSystem}) do system:setColors(1, 1, 1, 150/255, 0, 0, 0, 0) system:setSpeed(bullet.speed/4) system:setPosition(player.position.x, player.position.y) system:setLinearAcceleration(bullet.velocity.x, bullet.velocity.y, bullet.velocity.x, bullet.velocity.y) system:setDirection(math.atan2(bullet.target.y - bullet.position.y, bullet.target.x - bullet.position.x)) system:setSpread(math.pi/2) system:setParticleLifetime(.2) system:emit(30) end end function Particles:draw() love.graphics.setColor(1, 1, 1) love.graphics.draw(self.particleSystem) love.graphics.draw(self.particleSmallSystem) love.graphics.draw(self.healingParticleSystem) love.graphics.draw(self.bulletParticleSystem) end
Mixin = Mixin or function(object, ...) for i = 1, select("#", ...) do local mixin = select(i, ...); for k, v in pairs(mixin) do object[k] = v; end end return object; end; wipe = wipe or function(table) for key, _ in pairs(table) do table[key] = nil; end end
-- RNN/LSTM training for the bAbI dataset. -- -- Yujia Li, 10/2015 -- require 'lfs' require 'nn' require 'optim' require 'gnuplot' color = require 'trepl.colorize' require '../rnn' babi_data = require 'babi_data' cmd = torch.CmdLine() cmd:option('-learnrate', 1e-3, 'learning rate') cmd:option('-momentum', 0, 'momentum') cmd:option('-mb', 10, 'minibatch size') cmd:option('-nepochs', 0, 'number of epochs to train, if this is set, maxiters will not be used') cmd:option('-maxiters', 1000, 'maximum number of weight updates') cmd:option('-printafter', 10, 'print training information after this amount of weight updates') cmd:option('-saveafter', 100, 'save checkpoint after this amount of weight updates') cmd:option('-plotafter', 10, 'upldate training curves after this amount of weight updates') cmd:option('-optim', 'adam', 'type of optimization algorithm to use') cmd:option('-embedsize', 50, 'dimensionality of the embeddings') cmd:option('-hidsize', 50, 'dimensionality of the hidden layers') cmd:option('-ntargets', 1, 'number of targets for each example, if > 1 the targets will be treated as a sequence') cmd:option('-nthreads', 1, 'set the number of threads to use with this process') cmd:option('-ntrain', 0, 'number of training instances, 0 to use all available') cmd:option('-nval', 50, 'number of validation instances, this will not be used if datafile.val exists') cmd:option('-outputdir', '.', 'output directory') cmd:option('-datafile', '', 'should contain lists of edges and questions in standard format') cmd:option('-model', 'rnn', 'rnn or lstm') cmd:option('-seed', 8, 'random seed') -- cmd:option('-gpuid', -1, 'ID of the GPU to use, not using any GPUs if <= 0') opt = cmd:parse(arg) print('') print(opt) print('') torch.setnumthreads(opt.nthreads) optfunc = optim[opt.optim] if optfunc == nil then error('Unknown optimization method: ' .. opt.optim) end optim_config = { learningRate=opt.learnrate, weightDecay=0, momentum=opt.momentum, alpha=0.95, maxIter=1, maxEval=2, dampening=0 } optim_state = {} os.execute('mkdir -p ' .. opt.outputdir) print('') print('checkpoints will be saved to [ ' .. opt.outputdir .. ' ]') print('') print(optim_config) print('') torch.save(opt.outputdir .. '/params', opt) ----------------------- prepare data --------------------------- math.randomseed(opt.seed) torch.manualSeed(opt.seed) x_train, t_train = babi_data.load_rnn_data_from_file(opt.datafile, opt.ntargets) -- uniform length if x_train is a tensor, otherwise x_train is a list uniform_length = (type(x_train) == 'userdata') if uniform_length then vocab_size = x_train:max() embed_size = opt.embedsize hid_size = opt.hidsize output_size = t_train:max() else -- sequences of different lengths vocab_size = babi_data.find_max_in_list_of_tensors(x_train) embed_size = opt.embedsize hid_size = opt.hidsize output_size = babi_data.find_max_in_list_of_tensors(t_train) end -- split training data into train & val if lfs.attributes(opt.datafile .. '.val') == nil then print('Splitting part of training data for validation.') if uniform_length then x_train, t_train, x_val, t_val = babi_data.split_set_tensor(x_train, t_train, opt.ntrain, opt.nval, true) else x_train, t_train, x_val, t_val = babi_data.split_set_input_output(x_train, t_train, opt.ntrain, opt.nval, true) end else if opt.ntrain ~= 0 then -- if ntrain is 0, automatically use all the training data available if uniform_length then x_train, t_train = babi_data.split_set_tensor(x_train, t_train, opt.ntrain, 0, true) else x_train, t_train = babi_data.split_set_input_output(x_train, t_train, opt.ntrain, 0, true) end end print('Loading validation data from ' .. opt.datafile .. '.val') x_val, t_val = babi_data.load_rnn_data_from_file(opt.datafile .. '.val', opt.ntargets) end if opt.ntargets > 1 then opt.ntargets = opt.ntargets + 1 -- add 1 to include the end symbol end print('') if uniform_length then train_data_loader = babi_data.MiniBatchLoader(x_train, t_train, opt.mb, true) print('Training set : ' .. x_train:size(1) .. 'x' .. x_train:size(2) .. ' sequences') print('Validation set: ' .. x_val:size(1) .. 'x' .. x_val:size(2) .. ' sequences') n_train = x_train:size(1) else train_data_loader = babi_data.PairedDataLoader(x_train, t_train, true) print('Training set : ' .. #x_train .. ' sequences') print('Validation set: ' .. #x_val .. ' sequences') n_train = #x_train end print('Number of output classes: ' .. output_size) print('') if opt.nepochs > 0 then opt.maxiters = opt.nepochs * math.ceil(n_train / opt.mb) end print('Total number of weight updates: ' .. opt.maxiters) print('') if opt.model == 'rnn' then net = rnn.RNN(vocab_size, embed_size, hid_size, output_size) elseif opt.model == 'lstm' then net = rnn.LSTM(vocab_size, embed_size, hid_size, output_size) else error('Unknown model type: ' .. opt.model) end c = nn.CrossEntropyCriterion() net:print_model() print(c) print('') params, grad_params = net:getParameters() print('Total number of parameters: ' .. params:nElement()) print('') function feval(x) if x ~= params then params:copy(x) end grad_params:zero() local x_batch, t_batch, y, loss if uniform_length then x_batch, t_batch = train_data_loader:next() if opt.ntargets > 1 then t_batch = torch.reshape(t_batch, t_batch:size(1) * opt.ntargets, t_batch:size(2) / opt.ntargets) end y = net:forward(x_batch, opt.ntargets) loss = c:forward(y, t_batch) net:backward(c:backward(y, t_batch)) else loss = 0 for i=1,opt.mb do x_batch, t_batch = train_data_loader:next() if opt.ntargets > 1 then t_batch = torch.reshape(t_batch, t_batch:size(1) * opt.ntargets, t_batch:size(2) / opt.ntargets) end y = net:forward(x_batch, opt.ntargets) loss = loss + c:forward(y, t_batch) net:backward(c:backward(y, t_batch)) end loss = loss / opt.mb grad_params:mul(1 / opt.mb) end grad_params:clamp(-5, 5) return loss, grad_params end function eval_loss(model, x, t) if uniform_length then if opt.ntargets > 1 then t = torch.reshape(t, t:size(1) * opt.ntargets, t:size(2) / opt.ntargets) end return c:forward(model:forward(x, opt.ntargets), t) else local loss = 0 for i=1,#x do local tt = t[i] if opt.ntargets > 1 then tt = torch.reshape(tt, tt:size(1) * opt.ntargets, tt:size(2) / opt.ntargets) end loss = loss + c:forward(model:forward(x[i], tt), tt) end return loss / #x end end function eval_err(model, x, t) if uniform_length then local pred = model:predict(x, opt.ntargets) pred = pred:typeAs(t) if opt.ntargets > 1 then return pred:ne(t):type('torch.DoubleTensor'):sum(2):gt(0):type('torch.DoubleTensor'):mean() else return pred:ne(t):type('torch.DoubleTensor'):mean() end else local err = 0 for i=1,#x do local pred = model:predict(x[i], opt.ntargets) if opt.ntargets > 1 then err = err + pred:typeAs(t[i]):ne(t[i]):type('torch.DoubleTensor'):sum():gt(0):sum() else err = err + pred:typeAs(t[i]):ne(t[i]):sum() end end return err / #x end end train_records = {} train_error_records = {} val_records = {} function train() local loss = 0 local batch_loss = 0 local iter = 0 local best_loss = math.huge local best_params = params:clone() local plot_iter = 0 while iter < opt.maxiters do local timer = torch.Timer() batch_loss = 0 for iter_before_print=1,opt.printafter do _, loss = optfunc(feval, params, optim_config, optim_state) loss = loss[1] batch_loss = batch_loss + loss end iter = iter + opt.printafter batch_loss = batch_loss / opt.printafter plot_iter = plot_iter + 1 val_err = eval_err(net, x_val, t_val) io.write(string.format('iter %d, grad_scale=%.8f, train_loss=%.6f, val_error_rate=%.6f, time=%.2f', iter, torch.abs(grad_params):max(), batch_loss, val_err, timer:time().real)) table.insert(train_records, {iter, batch_loss}) table.insert(val_records, {iter, val_err}) if val_err < best_loss then best_loss = val_err best_params:copy(params) rnn.save_rnn_model(opt.outputdir .. '/model_best', best_params, opt.model, vocab_size, embed_size, hid_size, output_size) print(color.green(' *')) else print('') end if iter % opt.saveafter == 0 then rnn.save_rnn_model(opt.outputdir .. '/model_' .. iter, params, opt.model, vocab_size, embed_size, hid_size, output_size) end if plot_iter % opt.plotafter == 0 then generate_plots() collectgarbage() end end generate_plots() rnn.save_rnn_model(opt.outputdir .. '/model_end', params, opt.model, vocab_size, embed_size, hid_size, output_size) end function plot_learning_curve(records, fname, ylabel, xlabel) xlabel = xlabel or '#iterations' local rec = torch.Tensor(records) gnuplot.pngfigure(opt.outputdir .. '/' .. fname .. '.png') gnuplot.plot(rec:select(2,1), rec:select(2,2)) gnuplot.xlabel(xlabel) gnuplot.ylabel(ylabel) gnuplot.plotflush() collectgarbage() end function generate_plots() if not pcall(function () plot_learning_curve(train_records, 'train', 'training loss') end) then print('[Warning] Failed to update training curve plot. Error ignored.') end if not pcall(function () plot_learning_curve(val_records, 'val', 'validation error rate') end) then print('[Warning] Failed to update validation curve plot. Error ignored.') end -- plot_learning_curve(train_records, 'train', 'training loss') -- plot_learning_curve(val_records, 'val', 'validation error rate') if eval_train_err then if not pcall(function () plot_learning_curve(train_error_records, 'train-err', 'training error rate') end) then print('[Warning] Failed to update training error curve plot. Error ignored.') end -- plot_learning_curve(train_error_records, 'train-err', 'training error rate') end collectgarbage() end train()
function Laj_Allergic(Unit, event, miscunit, misc) print "Laj Allergic" Unit:FullCastSpellOnTarget(34697,Unit:GetClosestPlayer()) Unit:SendChatMessage(11, 0, "Let's go Sniff...") end function Laj_Flayer(Unit) print "Laj Flayer" Unit:FullCastSpell(34682) Unit:SendChatMessage(11, 0, "Come to help me...") end function Laj_Lasher(Unit) print "Laj Lasher" Unit:FullCastSpell(34681) Unit:SendChatMessage(11, 0, "Come to help me...") end function Laj(unit, event, miscunit, misc) print "Laj" unit:RegisterEvent("Laj_Allergic",10000,0) unit:RegisterEvent("Laj_Flayer",21000,0) unit:RegisterEvent("Laj_Lasher",22000,0) end RegisterUnitEvent(17980,1,"Laj")
-------------------------------------------------------------------------------- -- Damage reflect gates -- -------------------------------------------------------------------------------- data:extend{ { type = "technology", name = "damage-reflect-gates", --icon = "__Reinforced-Walls__/graphics/icons/tech-tree2.png", --icon_size = 128, icons = LSlib.technology.getIcons("gates", nil, nil, require("prototypes/prototype-settings")["damage-reflect-gate"]["wall-tint"]), prerequisites = {"acid-resist-gates", "damage-reflect-walls"}, effects = { { type = "unlock-recipe", recipe = "damage-reflect-gate" } }, unit = data.raw["technology"]["damage-reflect-walls"].unit, order = data.raw["technology"]["damage-reflect-walls"].order, }, }
EditorRelativeTeleport = EditorRelativeTeleport or class(MissionScriptEditor) function EditorRelativeTeleport:create_element() self.super.create_element(self) self._element.class = "ElementRelativeTeleport" self._element.values.target = {} end function EditorRelativeTeleport:_build_panel() self:_create_panel() self:BuildElementsManage("target", nil, {"ElementRelativeTeleportTarget"}, nil, { single_select = true }) end
config = { -- username username = os.getenv("USER"), -- "anonymous" .. math.random(1, 256), -- server server = "127.0.0.1:61507", -- logging & debugging logfile = "client.log", debug = "true", --cpuprofile = "client.profile", } return config
--============================================================================-- -- X-Space radio transmission related networking -------------------------------------------------------------------------------- Net.RadioTransmissions = {} -- Last time at which data was sent Net.RadioTransmissions.LastTime = 0 -- Buffer of all data to be sent Net.RadioTransmissions.SendBuffer = {} -- Packet size Net.RadioTransmissions.PacketSize = 256 -------------------------------------------------------------------------------- -- Send data from client to server -------------------------------------------------------------------------------- function Net.RadioTransmissions.SendClient() for vesselIdx,vesselBuffers in pairs(Net.RadioTransmissions.SendBuffer) do local networkID = VesselAPI.GetParameter(vesselIdx,2) for channel,data in pairs(vesselBuffers) do local message = NetAPI.NewMessage() Net.Write8(message,Net.Message.Transmission) -- Write channel Net.Write8(message,channel) -- Write vessel network ID Net.Write32(message,networkID) -- Write total count Net.Write8(message,#data-1) -- Write up to 256 bytes of data for i=1,#data do Net.Write8(message,data[i] or 0) end -- Send message NetAPI.SendMessage(Net.Client.Host,Net.Client.Peer,message) end -- Nullify the buffer Net.RadioTransmissions.SendBuffer[vesselIdx] = {} end end -------------------------------------------------------------------------------- -- Send data from server to clients -- FIXME: send data only to clients who ARE RUNNING THIS VESSEL -------------------------------------------------------------------------------- function Net.RadioTransmissions.SendServer() for vesselIdx,vesselBuffers in pairs(Net.RadioTransmissions.SendBuffer) do local networkID = VesselAPI.GetParameter(vesselIdx,2) for channel,data in pairs(vesselBuffers) do for clientID,client in pairs(Net.Server.Clients) do local message = NetAPI.NewMessage() Net.Write8(message,Net.Message.Transmission) -- Write channel Net.Write8(message,channel) -- Write vessel network ID Net.Write32(message,networkID) -- Write total count Net.Write8(message,#data-1) -- Write up to 256 bytes of data for i=1,#data do Net.Write8(message,data[i] or 0) end -- Send message NetAPI.SendMessage(Net.Server.Host,client.Peer,message) end end -- Nullify the buffer Net.RadioTransmissions.SendBuffer[vesselIdx] = {} end end -------------------------------------------------------------------------------- -- Called when some vessel sends a single byte -------------------------------------------------------------------------------- function InternalCallbacks.OnRadioTransmit(idx,channel,data) if Net.Client.Host and Net.Client.Peer and (Net.Client.Connected == true) then -- Create buffers if needed Net.RadioTransmissions.SendBuffer[idx] = Net.RadioTransmissions.SendBuffer[idx] or {} Net.RadioTransmissions.SendBuffer[idx][channel] = Net.RadioTransmissions.SendBuffer[idx][channel] or {} -- Send data in packets if (#Net.RadioTransmissions.SendBuffer[idx][channel] >= Net.RadioTransmissions.PacketSize) or (curtime() - Net.RadioTransmissions.LastTime > 0.05) then Net.RadioTransmissions.LastTime = curtime() Net.RadioTransmissions.SendClient() Net.RadioTransmissions.SendBuffer[idx][channel] = { data } else table.insert(Net.RadioTransmissions.SendBuffer[idx][channel],data) end -- Always avoid further processing of radio data in networked game return true end end -------------------------------------------------------------------------------- -- Called when some vessel receives a single byte -------------------------------------------------------------------------------- function InternalCallbacks.OnRadioReceive(idx,channel,data) if Net.Server.Host then -- Check if vessel is networked and has an assigned clientID if false then -- Create buffer if required Net.RadioTransmissions.SendBuffer[idx] = Net.RadioTransmissions.SendBuffer[idx] or {} Net.RadioTransmissions.SendBuffer[idx][channel] = Net.RadioTransmissions.SendBuffer[idx][channel] or {} -- Send data in packets if (#Net.RadioTransmissions.SendBuffer[idx][channel] >= Net.RadioTransmissions.PacketSize) or (curtime() - Net.RadioTransmissions.LastTime > 0.05) then Net.RadioTransmissions.LastTime = curtime() Net.RadioTransmissions.SendServer() Net.RadioTransmissions.SendBuffer[idx][channel] = { data } else table.insert(Net.RadioTransmissions.SendBuffer[idx][channel],data) end -- Server only avoids processing for owned vessels return true end end end
return { id = 5015, bgm = "battle-boss-4", stages = { { stageIndex = 1, failCondition = 1, timeCount = 180, passCondition = 1, backGroundStageID = 1, totalArea = { -75, 20, 90, 70 }, playerArea = { -75, 20, 42, 68 }, enemyArea = {}, fleetCorrdinate = { -80, 0, 75 }, waves = { { triggerType = 1, waveIndex = 100, preWaves = {}, triggerParams = { timeout = 0.5 } }, { triggerType = 0, waveIndex = 201, conditionType = 1, preWaves = { 100 }, triggerParams = { round = { equal = { 1 } } }, spawn = { { monsterTemplateID = 900007, moveCast = true, delay = 1, score = 0, corrdinate = { -15, 0, 55 }, bossData = { hpBarNum = 50, icon = "tierbici" }, phase = { { switchParam = 1, switchTo = 1, index = 0, switchType = 1, setAI = 90004 }, { index = 1, switchType = 1, switchTo = 2, switchParam = 2.5, addWeapon = { 950131, 950130 } }, { index = 2, switchParam = 2.5, switchTo = 3, switchType = 1, removeWeapon = { 950131 }, addWeapon = { 950131, 950132, 950133 } }, { index = 3, switchParam = 3, switchTo = 4, switchType = 1, removeWeapon = { 950131, 950132, 950133 }, addWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { switchType = 1, switchTo = 5, index = 4, switchParam = 1, setAI = 10001, removeWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { index = 5, switchType = 1, switchTo = 6, switchParam = 3, addWeapon = { 950143, 950146 } }, { index = 6, switchType = 1, switchTo = 7, switchParam = 1, removeWeapon = { 950143 } }, { index = 7, switchType = 1, switchTo = 8, switchParam = 3, addWeapon = { 950144 } }, { switchType = 1, switchTo = 9, index = 8, switchParam = 2, setAI = 90004, removeWeapon = { 950144, 950146 } }, { index = 9, switchType = 1, switchTo = 10, switchParam = 2, addWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { index = 10, switchType = 1, switchTo = 11, switchParam = 1, removeWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { index = 11, switchType = 1, switchTo = 12, switchParam = 2, addWeapon = { 950136, 950137, 950138, 950139, 950140 } }, { index = 12, switchType = 1, switchTo = 13, switchParam = 2, removeWeapon = { 950136, 950137, 950138, 950139, 950140 } }, { switchType = 1, switchTo = 14, index = 13, switchParam = 10, setAI = 10001, addWeapon = { 950145 } }, { index = 14, switchType = 1, switchTo = 100, switchParam = 2, removeWeapon = { 950145 } }, { switchType = 1, switchTo = 101, index = 100, switchParam = 1, setAI = 90004, removeWeapon = { 950145, 950142 }, addWeapon = { 950131, 950138 } }, { index = 101, switchType = 1, switchTo = 102, switchParam = 1, addWeapon = { 950132, 950139 } }, { index = 102, switchType = 1, switchTo = 103, switchParam = 1, addWeapon = { 950135, 950136, 950142 } }, { index = 103, switchType = 1, switchTo = 104, switchParam = 1, addWeapon = { 950134, 950137 } }, { index = 104, switchType = 1, switchTo = 105, switchParam = 9, addWeapon = { 950133, 950140 } }, { index = 105, switchType = 1, switchTo = 200, switchParam = 2, removeWeapon = { 950131, 950132, 950133, 950134, 950135, 950136, 950137, 950138, 950139, 950140, 950142 } }, { switchType = 1, switchTo = 201, index = 200, switchParam = 2, setAI = 10001, addWeapon = { 950145, 950146 } }, { index = 201, switchType = 1, switchTo = 202, switchParam = 15, addWeapon = { 950141 } }, { switchType = 1, switchTo = 100, index = 202, switchParam = 2, setAI = 90004, removeWeapon = { 950145, 950141, 950146 } } } } } }, { triggerType = 0, waveIndex = 202, conditionType = 1, preWaves = { 201 }, triggerParams = { round = { more = 1 } }, spawn = { { monsterTemplateID = 900007, reinforceDelay = 6, delay = 1, moveCast = true, corrdinate = { -15, 0, 55 }, bossData = { hpBarNum = 50, icon = "tierbici" }, phase = { { switchParam = 1, switchTo = 1, index = 0, switchType = 1, setAI = 90004 }, { index = 1, switchType = 1, switchTo = 2, switchParam = 2.5, addWeapon = { 950131, 950130 } }, { index = 2, switchParam = 2.5, switchTo = 3, switchType = 1, removeWeapon = { 950131 }, addWeapon = { 950131, 950132, 950133 } }, { index = 3, switchParam = 3, switchTo = 4, switchType = 1, removeWeapon = { 950131, 950132, 950133 }, addWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { switchType = 1, switchTo = 5, index = 4, switchParam = 1, setAI = 10001, removeWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { index = 5, switchType = 1, switchTo = 6, switchParam = 3, addWeapon = { 950143, 950146 } }, { index = 6, switchType = 1, switchTo = 7, switchParam = 1, removeWeapon = { 950143 } }, { index = 7, switchType = 1, switchTo = 8, switchParam = 3, addWeapon = { 950144 } }, { switchType = 1, switchTo = 9, index = 8, switchParam = 2, setAI = 90004, removeWeapon = { 950144, 950146 } }, { index = 9, switchType = 1, switchTo = 10, switchParam = 2, addWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { index = 10, switchType = 1, switchTo = 11, switchParam = 1, removeWeapon = { 950131, 950132, 950133, 950134, 950135 } }, { index = 11, switchType = 1, switchTo = 12, switchParam = 2, addWeapon = { 950136, 950137, 950138, 950139, 950140 } }, { index = 12, switchType = 1, switchTo = 13, switchParam = 2, removeWeapon = { 950136, 950137, 950138, 950139, 950140 } }, { switchType = 1, switchTo = 14, index = 13, switchParam = 10, setAI = 10001, addWeapon = { 950145 } }, { index = 14, switchType = 1, switchTo = 100, switchParam = 2, removeWeapon = { 950145 } }, { switchType = 1, switchTo = 101, index = 100, switchParam = 1, setAI = 90004, removeWeapon = { 950145, 950142 }, addWeapon = { 950131, 950138 } }, { index = 101, switchType = 1, switchTo = 102, switchParam = 1, addWeapon = { 950132, 950139 } }, { index = 102, switchType = 1, switchTo = 103, switchParam = 1, addWeapon = { 950135, 950136, 950142 } }, { index = 103, switchType = 1, switchTo = 104, switchParam = 1, addWeapon = { 950134, 950137 } }, { index = 104, switchType = 1, switchTo = 105, switchParam = 9, addWeapon = { 950133, 950140 } }, { index = 105, switchType = 1, switchTo = 200, switchParam = 2, removeWeapon = { 950131, 950132, 950133, 950134, 950135, 950136, 950137, 950138, 950139, 950140, 950142 } }, { switchType = 1, switchTo = 201, index = 200, switchParam = 2, setAI = 10001, addWeapon = { 950145, 950146 } }, { index = 201, switchType = 1, switchTo = 202, switchParam = 15, addWeapon = { 950141 } }, { switchType = 1, switchTo = 100, index = 202, switchParam = 2, setAI = 90004, removeWeapon = { 950145, 950141, 950146 } } } } }, reinforcement = { { monsterTemplateID = 909012, moveCast = true, delay = 4, corrdinate = { 10, 0, 35 } }, { monsterTemplateID = 909012, moveCast = true, delay = 4, corrdinate = { 10, 0, 75 } } } }, { triggerType = 8, key = true, waveIndex = 900, preWaves = { 202 }, triggerParams = {} } } } }, fleet_prefab = {} }
test_run = require('test_run').new() REPLICASET_1 = { 'storage_1_a', 'storage_1_b' } REPLICASET_2 = { 'storage_2_a', 'storage_2_b' } test_run:create_cluster(REPLICASET_1, 'storage') test_run:create_cluster(REPLICASET_2, 'storage') util = require('util') util.wait_master(test_run, REPLICASET_1, 'storage_1_a') util.wait_master(test_run, REPLICASET_2, 'storage_2_a') util.map_evals(test_run, {REPLICASET_1, REPLICASET_2}, 'bootstrap_storage(\'memtx\')') _ = test_run:cmd("create server router_1 with script='router/router_1.lua'") _ = test_run:cmd("start server router_1") _ = test_run:switch('router_1') fiber = require('fiber') vshard.router.bootstrap() while test_run:grep_log('router_1', 'All replicas are ok') == nil do fiber.sleep(0.1) end while test_run:grep_log('router_1', 'buckets: was 0, became 1000') == nil do fiber.sleep(0.1) vshard.router.discovery_wakeup() end while test_run:grep_log('router_1', 'buckets: was 1000, became 1500') == nil do fiber.sleep(0.1) vshard.router.discovery_wakeup() end -- -- Gh-72: allow reload. Test simple reload, error during -- reloading, ensure the fibers are restarted on reload. -- assert(rawget(_G, '__module_vshard_router') ~= nil) vshard.router.module_version() _ = test_run:cmd("setopt delimiter ';'") function check_reloaded() for k, v in pairs(old_internal) do if v == vshard.router.internal[k] then return k end end end; function check_not_reloaded() for k, v in pairs(old_internal) do if v ~= vshard.router.internal[k] then return k end end end; function copy_functions(t) local ret = {} for k, v in pairs(t) do if type(v) == 'function' then ret[k] = v end end return ret end; _ = test_run:cmd("setopt delimiter ''"); -- -- Simple reload. All functions are reloaded and they have -- another pointers in vshard.router.internal. -- old_internal = copy_functions(vshard.router.internal) package.loaded["vshard.router"] = nil _ = require('vshard.router') vshard.router.module_version() check_reloaded() while test_run:grep_log('router_1', 'failover_f has been started') == nil do fiber.sleep(0.1) end while test_run:grep_log('router_1', 'discovery_f has been started') == nil do fiber.sleep(0.1) vshard.router.discovery_wakeup() end check_reloaded() -- -- Error during reload - in such a case no function can be -- updated. Reload is atomic. -- vshard.router.internal.errinj.ERRINJ_RELOAD = true old_internal = copy_functions(vshard.router.internal) package.loaded["vshard.router"] = nil util = require('util') util.check_error(require, 'vshard.router') check_not_reloaded() vshard.router.module_version() -- -- A next reload is ok, and all functions are updated. -- vshard.router.internal.errinj.ERRINJ_RELOAD = false old_internal = copy_functions(vshard.router.internal) package.loaded["vshard.router"] = nil _ = require('vshard.router') vshard.router.module_version() check_reloaded() -- -- Outdate old replicaset and replica objects. -- rs = vshard.router.route(1) rs:callro('echo', {'some_data'}) package.loaded["vshard.router"] = nil _ = require('vshard.router') -- Make sure outdate async task has had cpu time. while not rs.is_outdated do fiber.sleep(0.001) end rs.callro(rs, 'echo', {'some_data'}) vshard.router = require('vshard.router') rs = vshard.router.route(1) rs:callro('echo', {'some_data'}) -- Test `connection_outdate_delay`. old_connection_delay = cfg.connection_outdate_delay cfg.connection_outdate_delay = 0.3 vshard.router.cfg(cfg) cfg.connection_outdate_delay = old_connection_delay vshard.router.static.connection_outdate_delay = nil rs_new = vshard.router.route(1) rs_old = rs _, replica_old = next(rs_old.replicas) rs_new:callro('echo', {'some_data'}) -- Check old objets are still valid. rs_old:callro('echo', {'some_data'}) replica_old.conn ~= nil fiber.sleep(0.2) rs_old:callro('echo', {'some_data'}) replica_old.conn ~= nil replica_old.is_outdated == nil fiber.sleep(0.2) rs_old:callro('echo', {'some_data'}) replica_old.conn == nil replica_old.is_outdated == true rs_new:callro('echo', {'some_data'}) -- -- gh-193: code should not rely on global function addresses -- stability. They change at reload. Because of that, for example, -- removal of an old trigger becomes impossible by a global -- function name. -- -- The call below should not throw an exception. rs_new.master:detach_conn() _ = test_run:switch('default') _ = test_run:cmd('stop server router_1') _ = test_run:cmd('cleanup server router_1') test_run:drop_cluster(REPLICASET_2) test_run:drop_cluster(REPLICASET_1)
----------------------------------- -- -- Zone: Aydeewa_Subterrane (68) -- ----------------------------------- local ID = require("scripts/zones/Aydeewa_Subterrane/IDs") require("scripts/globals/keyitems") require("scripts/globals/missions") require("scripts/globals/npc_util") require("scripts/globals/quests") require("scripts/globals/status") require("scripts/globals/titles") ----------------------------------- function onInitialize(zone) zone:registerRegion(1,378,-3,338,382,3,342) end function onZoneIn(player,prevZone) local cs = -1 if player:getXPos() == 0 and player:getYPos() == 0 and player:getZPos() == 0 then player:setPos(356.503,-0.364,-179.607,122) end if player:getCurrentMission(TOAU) == tpz.mission.id.toau.TEAHOUSE_TUMULT and player:getCharVar("AhtUrganStatus") == 0 then cs = 10 end return cs end function onRegionEnter(player,region) if region:GetRegionID() == 1 then local StoneID = player:getCharVar("EmptyVesselStone") if player:getQuestStatus(AHT_URHGAN,tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL) == QUEST_ACCEPTED and player:getCharVar("AnEmptyVesselProgress") == 4 and player:hasItem(StoneID) then player:startEvent(3,StoneID) end end end function onRegionLeave(player,region) end function onEventUpdate(player,csid,option) end function onEventFinish(player,csid,option) if csid == 3 and option == 13 and npcUtil.completeQuest(player, AHT_URHGAN, tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL, {title=tpz.title.BEARER_OF_THE_MARK_OF_ZAHAK, ki=tpz.ki.MARK_OF_ZAHAK, var={"AnEmptyVesselProgress", "EmptyVesselStone"}}) then -- Accept and unlock player:unlockJob(tpz.job.BLU) player:setPos(148,-2,0,130,50) elseif csid == 3 and option ~= 13 then -- Make a mistake and get reset player:setCharVar("AnEmptyVesselProgress", 0) player:setCharVar("EmptyVesselStone", 0) player:delQuest(AHT_URHGAN,tpz.quest.id.ahtUrhgan.AN_EMPTY_VESSEL) player:setPos(148,-2,0,130,50) elseif csid == 10 then player:setCharVar("AhtUrganStatus", 1) end end
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ========== PlaceObj('XTemplate', { group = "InGame", id = "OverviewMapCurtains", PlaceObj('XTemplateWindow', { '__class', "OverviewMapCurtains", 'LayoutMethod', "None", 'HandleKeyboard', false, 'ChildrenHandleMouse', false, 'Translate', false, 'FocusOnOpen', "", }, { PlaceObj('XTemplateWindow', { '__class', "XFrame", 'Id', "idLeft", 'Dock', "ignore", 'Visible', false, 'HandleKeyboard', false, 'ChildrenHandleMouse', false, 'EnableFX', false, 'Image', "UI/Common/menu_pad_2_A.tga", 'FrameBox', box(86, 0, 86, 0), 'TileFrame', true, }), PlaceObj('XTemplateWindow', { '__class', "XFrame", 'Id', "idRight", 'Dock', "ignore", 'Visible', false, 'HandleKeyboard', false, 'ChildrenHandleMouse', false, 'EnableFX', false, 'Image', "UI/Common/menu_pad_2_A.tga", 'FrameBox', box(86, 0, 86, 0), 'TileFrame', true, }), PlaceObj('XTemplateWindow', { '__class', "XFrame", 'Id', "idTop", 'Dock', "ignore", 'Visible', false, 'HandleKeyboard', false, 'ChildrenHandleMouse', false, 'EnableFX', false, 'Image', "UI/Common/menu_pad_2_A.tga", 'FrameBox', box(86, 0, 86, 0), 'TileFrame', true, }), PlaceObj('XTemplateWindow', { '__class', "XFrame", 'Id', "idBottom", 'Dock', "ignore", 'Visible', false, 'HandleKeyboard', false, 'ChildrenHandleMouse', false, 'EnableFX', false, 'Image', "UI/Common/menu_pad_2_A.tga", 'FrameBox', box(86, 0, 86, 0), 'TileFrame', true, }), }), })
local ffi = require("ffi") require("lj2zydis.ffi.CommonTypes") require("lj2zydis.ffi.EnumInstructionCategory") require("lj2zydis.ffi.EnumISASet") require("lj2zydis.ffi.EnumISAExt") ffi.cdef[[ const char* ZydisCategoryGetString(ZydisInstructionCategory category); const char* ZydisISASetGetString(ZydisISASet isaSet); const char* ZydisISAExtGetString(ZydisISAExt isaExt); ]]
function CreateHomeModelWindow() callbacks.homeModelWindow = Position(nil, callbacks.homeWindow, 1, callbacks.homeWindow:GetWidth() * 0.2, callbacks.homeWindow:GetHeight(), nil, 0, 0); callbacks.homeModelWindow:Hide(); -- Create the underlying elements CreateHomeHeaderWindow(); CreateHomeModel(); CreateHomeBottomWindow(); end
local mod = DBM:NewMod(1291, "DBM-Draenor", nil, 557) local L = mod:GetLocalizedStrings() mod:SetRevision(("$Revision: 14030 $"):sub(12, -3)) mod:SetCreatureID(81252) mod:SetReCombatTime(20) mod:SetZone() mod:SetMinSyncRevision(11969) mod:RegisterCombat("combat") mod:RegisterEventsInCombat( "SPELL_CAST_START 175791", "SPELL_AURA_APPLIED 175827" ) local specWarnColossalSlam = mod:NewSpecialWarningDodge(175791, nil, nil, nil, 2, 2) local specWarnCallofEarth = mod:NewSpecialWarningSpell(175827) local timerColossalSlamCD = mod:NewCDTimer(16, 175791, nil, nil, nil, 3)--16-35 second variation? Then again was a bad pull with no tank, boss running loose so may have affected timer local timerCallofEarthCD = mod:NewCDTimer(90, 175827, nil, nil, nil, 1) local voiceColossalSlam = mod:NewVoice(175791) --mod:AddReadyCheckOption(37460, false) function mod:OnCombatStart(delay, yellTriggered) --[[ if yellTriggered then end--]] end function mod:OnCombatEnd() end function mod:SPELL_CAST_START(args) local spellId = args.spellId if spellId == 175791 then specWarnColossalSlam:Show() timerColossalSlamCD:Start() voiceColossalSlam:Play("shockwave") end end function mod:SPELL_AURA_APPLIED(args) local spellId = args.spellId if spellId == 175827 then specWarnCallofEarth:Show() timerCallofEarthCD:Start() end end
--* This Document is AutoGenerate by OrangeFilter, Don't Change it! * ---@meta --- ---[4.2]particle system[parent:Renderer#renderer] --- ---@class ParticleSystem ParticleSystem = {} --- ---[4.2]set camera --- --- @param arg0 RenderCamera#rendercamera --- @nodiscard function ParticleSystem:setCamera(arg0) end --- ---[4.2]play --- --- @nodiscard function ParticleSystem:play() end --- ---[4.2]pause --- --- @nodiscard function ParticleSystem:pause() end --- ---[4.2]stop --- --- @nodiscard function ParticleSystem:stop() end --- ---[4.2]restart --- --- @nodiscard function ParticleSystem:restart() end --- ---[4.5]set every particle size scale --- --- @param arg0 Vec3f#vec3f --- @nodiscard function ParticleSystem:setParticleSizeScale(arg0) end return ParticleSystem
--------------------------------- --! @file NVUtil.lua --! @brief NameValeヘルパ関数 --------------------------------- --[[ Copyright (c) 2017 Nobuhiko Miyamoto ]] local NVUtil= {} --_G["openrtm.NVUtil"] = NVUtil local oil = require "oil" local CORBA_SeqUtil = require "openrtm.CORBA_SeqUtil" local StringUtil = require "openrtm.StringUtil" -- NameValue生成 -- @param name キー -- @param value 値 -- @return NameValue NVUtil.newNV = function(name, value) return {name=name, value=value} end -- プロパティからNameValueをコピーする -- @param nv NameValue -- @param prop プロパティ NVUtil.copyFromProperties = function(nv, prop) local keys = prop:propertyNames() local keys_len = #keys local nv_len = #nv if nv_len > 0 then for i = 1,nv_len do nv[i] = nil end end for i = 1, keys_len do table.insert(nv, NVUtil.newNV(keys[i], prop:getProperty(keys[i]))) end end -- 文字列をRTC::ReturnCode_tに変換 -- @param ret_code リターンコード(文字列) -- @return リターンコード NVUtil.getReturnCode = function(ret_code) --print(ret_code) if type(ret_code) == "string" then local Manager = require "openrtm.Manager" local _ReturnCode_t = Manager:instance():getORB().types:lookup("::RTC::ReturnCode_t").labelvalue if ret_code == "RTC_OK" then return _ReturnCode_t.RTC_OK elseif ret_code == "RTC_ERROR" then return _ReturnCode_t.RTC_ERROR elseif ret_code == "BAD_PARAMETER" then return _ReturnCode_t.BAD_PARAMETER elseif ret_code == "UNSUPPORTED" then return _ReturnCode_t.UNSUPPORTED elseif ret_code == "OUT_OF_RESOURCES" then return _ReturnCode_t.OUT_OF_RESOURCES elseif ret_code == "PRECONDITION_NOT_MET" then return _ReturnCode_t.PRECONDITION_NOT_MET end end return ret_code end -- 文字列をOpenRTM::PortStatusに変換 -- @param ret_code ポートステータス(文字列) -- @return ポートステータス NVUtil.getPortStatus = function(ret_code) --print(ret_code) if type(ret_code) == "string" then local Manager = require "openrtm.Manager" local _PortStatus = Manager:instance():getORB().types:lookup("::OpenRTM::PortStatus").labelvalue if ret_code == "PORT_OK" then return _PortStatus.PORT_OK elseif ret_code == "PORT_ERROR" then return _PortStatus.PORT_ERROR elseif ret_code == "BUFFER_FULL" then return _PortStatus.BUFFER_FULL elseif ret_code == "BUFFER_EMPTY" then return _PortStatus.BUFFER_EMPTY elseif ret_code == "BUFFER_TIMEOUT" then return _PortStatus.BUFFER_TIMEOUT elseif ret_code == "UNKNOWN_ERROR" then return _PortStatus.UNKNOWN_ERROR end end return ret_code end -- 文字列をRTC::PortStatusに変換 -- @param ret_code ポートステータス(文字列) -- @return ポートステータス NVUtil.getPortStatus_RTC = function(ret_code) --print(ret_code) if type(ret_code) == "string" then local Manager = require "openrtm.Manager" local _PortStatus = Manager:instance():getORB().types:lookup("::RTC::PortStatus").labelvalue if ret_code == "PORT_OK" then return _PortStatus.PORT_OK elseif ret_code == "PORT_ERROR" then return _PortStatus.PORT_ERROR elseif ret_code == "BUFFER_FULL" then return _PortStatus.BUFFER_FULL elseif ret_code == "BUFFER_EMPTY" then return _PortStatus.BUFFER_EMPTY elseif ret_code == "BUFFER_TIMEOUT" then return _PortStatus.BUFFER_TIMEOUT elseif ret_code == "UNKNOWN_ERROR" then return _PortStatus.UNKNOWN_ERROR end end return ret_code end -- NameValueからプロパティにコピーする -- @param prop プロパティ -- @param nvlist NameValue NVUtil.copyToProperties = function(prop, nvlist) for i, nv in ipairs(nvlist) do --print(i,nv.value) local val = NVUtil.any_from_any(nv.value) --print(val) prop:setProperty(nv.name,val) end end local nv_find = {} -- NaveValueを検索するための関数オブジェクト初期化 -- return NaveValueを検索するための関数オブジェクト nv_find.new = function(name) local obj = {} obj._name = name -- NameValueが指定名と一致するかを判定 -- @param self 自身のオブジェクト -- @param nv NameValue -- @return true:一致、false:不一致 local call_func = function(self, nv) --print(self._name, nv.name) return (self._name == nv.name) end setmetatable(obj, {__call=call_func}) return obj end -- 名前からNameValueを取得 -- @param nv NameValueのリスト -- @param name 要素名 -- @return 一致したNamValueの配列番号 NVUtil.find_index = function(nv, name) return CORBA_SeqUtil.find(nv, nv_find.new(name)) end -- NameValueのリストに指定名、値を追加 -- 既に指定名のNameValueが存在する場合は上書き -- ","で区切る値の場合は後ろに追加 -- @param nv NameValueのリスト -- @param _name 要素名 -- @param _value 値 NVUtil.appendStringValue = function(nv, _name, _value) local index = NVUtil.find_index(nv, _name) local tmp_nv = nv[index] if tmp_nv ~= nil then local tmp_str = NVUtil.any_from_any(tmp_nv.value) local values = StringUtil.split(tmp_str,",") local find_flag = false for i, val in ipairs(values) do if val == _value then find_flag = true end end if not find_flag then tmp_str = tmp_str..", " tmp_str = tmp_str.._value tmp_nv.value = tmp_str end else table.insert(nv,{name=_name,value=_value}) end end -- NameValueのリストを連結する -- @param dest 連結先のNameValueのリスト -- @param src 連結元のNameValueのリスト NVUtil.append = function(dest, src) for i, val in ipairs(src) do table.insert(dest, val) end end -- NameValueリストの指定名の値が指定文字列と一致するかを判定 -- @param nv NameValueリスト -- @param name 要素名 -- @param value 値(文字列) -- @return true:一致、false:不一致、指定要素がない NVUtil.isStringValue = function(nv, name, value) --print(NVUtil.toString(nv, name)) if NVUtil.isString(nv, name) then if NVUtil.toString(nv, name) == value then return true end end return false end -- NameValueリストから指定要素の値を取得 -- @param nv NameValueリスト -- @param name 要素名 -- @return 指定要素 NVUtil.find = function(nv, name) local index = CORBA_SeqUtil.find(nv, nv_find.new(name)) if nv[index] ~= nil then return nv[index].value else return nil end end -- オブジェクトリファレンスの一致を判定 -- @param obj1 オブジェクト1 -- @param obj2 オブジェクト2 -- @param obj1_ref オブジェクト1のリファレンス -- @param obj2_ref オブジェクト2のリファレンス -- @return true:一致、false:不一致 NVUtil._is_equivalent = function(obj1, obj2, obj1_ref, obj2_ref) if oil.VERSION == "OiL 0.4 beta" then if obj1._is_equivalent == nil then if obj2._is_equivalent == nil then return obj1_ref(obj1):_is_equivalent(obj2_ref(obj2)) else return obj1_ref(obj1):_is_equivalent(obj2) end else if obj2._is_equivalent == nil then return obj1:_is_equivalent(obj2_ref(obj2)) else return obj1:_is_equivalent(obj2) end end elseif oil.VERSION == "OiL 0.5" then if obj1._is_equivalent == nil then obj1 = obj1_ref(obj1) end if obj2._is_equivalent == nil then obj2 = obj2_ref(obj2) end --print(obj1,obj2,(obj1 == obj2)) if obj1._is_equivalent == nil or obj2._is_equivalent == nil then return (obj1 == obj2) else return obj1:_is_equivalent(obj2) end elseif oil.VERSION == "OiL 0.6" then if obj1._is_equivalent == nil then obj1 = obj1_ref(obj1) end if obj2._is_equivalent == nil then obj2 = obj2_ref(obj2) end if obj1._is_equivalent == nil and obj2._is_equivalent == nil then return (obj1 == obj2) else if obj1._is_equivalent ~= nil then return obj1:_is_equivalent(obj2) else return obj2:_is_equivalent(obj1) end end end end -- 指定変数がanyの場合に値を取り出す -- @param value 変数 -- @return 取り出した値 NVUtil.any_from_any = function(value) if type(value) == "table" then if value._anyval ~= nil then return value._anyval end end return value end -- NameValueリストを表示用文字列に変換 -- @param nv NameValueリスト -- @return 文字列 NVUtil.dump_to_stream = function(nv) local out = "" for i, n in ipairs(nv) do local val = NVUtil.any_from_any(nv[i].value) if type(val) == "string" then out = out..n.name..": "..val.."\n" else out = out..n.name..": not a string value \n" end end return out end -- NameValueリストの指定要素を文字列に変換 -- @param nv NameValueリスト -- @param name 要素名 -- @return 文字列 NVUtil.toString = function(nv, name) if name == nil then return NVUtil.dump_to_stream(nv) end local str_value = "" local ret_value = NVUtil.find(nv, name) if ret_value ~= nil then local val = NVUtil.any_from_any(ret_value) if type(val) == "string" then str_value = val end end return str_value end -- NameValueの指定要素が文字列かを判定 -- @param nv NameValueリスト -- @param name 要素名 -- @return true:文字列、false:文字列以外 NVUtil.isString = function(nv, name) local value = NVUtil.find(nv, name) if value ~= nil then local val = NVUtil.any_from_any(value) return (type(val) == "string") else return false end end -- 文字列をCosNamingのBindingTypeに変換 -- @param binding_type バインディング型(文字列) -- @return バインディング型 NVUtil.getBindingType = function(binding_type) if type(binding_type) == "string" then local Manager = require "openrtm.Manager" local _BindingType = Manager:instance():getORB().types:lookup("::CosNaming::BindingType").labelvalue if binding_type == "ncontext" then return _BindingType.ncontext elseif binding_type == "nobject" then return _BindingType.nobject end end return binding_type end -- 文字列をRTCの状態に変換 -- @param state RTCの状態(文字列) -- @return RTCの状態 NVUtil.getLifeCycleState = function(state) --print(state) if type(state) == "string" then local Manager = require "openrtm.Manager" local _LifeCycleState = Manager:instance():getORB().types:lookup("::RTC::LifeCycleState").labelvalue if state == "CREATED_STATE" then return _LifeCycleState.CREATED_STATE elseif state == "INACTIVE_STATE" then return _LifeCycleState.INACTIVE_STATE elseif state == "ACTIVE_STATE" then return _LifeCycleState.ACTIVE_STATE elseif state == "ERROR_STATE" then return _LifeCycleState.ERROR_STATE end end return state end -- CORBAオブジェクトの生存確認 -- @param _obj CORBAオブジェクト -- @return false:生存 NVUtil._non_existent = function(_obj) --print(_obj._non_existent) if _obj._non_existent == nil then return false else local ret = true local success, exception = oil.pcall( function() ret = _obj:_non_existent() end) return ret end end return NVUtil
local nvim = require("nvim") local M = {} ---Returns true if a LSP server is attached to the current buffer. ---@return boolean function M.is_lsp_attached() --{{{ return next(vim.lsp.buf_get_clients(0)) ~= nil end --}}} ---Returns true if at least one of the LSP servers has the given capability. ---@param capability string ---@return boolean function M.has_lsp_capability(capability) --{{{ local clients = vim.lsp.buf_get_clients(0) for _, client in pairs(clients) do local capabilities if vim.fn.has("nvim-0.8") == 1 then capabilities = client.server_capabilities else capabilities = client.resolved_capabilities end if capabilities and capabilities[capability] then return true end end return false end --}}} ---Turns the severity to a form vim.diagnostic.get accepts. ---@param severity string ---@return string local function severity_lsp_to_vim(severity) --{{{ if type(severity) == "string" then severity = vim.lsp.protocol.DiagnosticSeverity[severity] end return severity end --}}} ---Returns the diagnostic count for the current buffer. ---@param severity string ---@return number function M.get_diagnostics_count(severity) --{{{ local active_clients = vim.lsp.buf_get_clients(0) if not active_clients then return 0 end severity = severity_lsp_to_vim(severity) local opts = { severity = severity } return #vim.diagnostic.get(vim.api.nvim_get_current_buf(), opts) end --}}} ---Returns true if there is a diagnostic with the given severity. ---@param severity string ---@return boolean function M.diagnostics_exist(severity) --{{{ return M.get_diagnostics_count(severity) > 0 end --}}} ---Common function used by the diagnostics providers local function diagnostics(severity) --{{{ local count = M.get_diagnostics_count(severity) return count ~= 0 and tostring(count) or "" end --}}} ---Returns the count of errors and a icon. ---@return string ---@return string #suggested icon function M.diagnostic_errors() --{{{ return diagnostics(vim.diagnostic.severity.ERROR), "  " end --}}} ---Returns the count of warnings and a icon. ---@return string ---@return string #suggeste icon function M.diagnostic_warnings() --{{{ return diagnostics(vim.diagnostic.severity.WARN), "  " end --}}} ---Returns the count of hints and a icon. ---@return string ---@return string #suggeste icon function M.diagnostic_hints() --{{{ return diagnostics(vim.diagnostic.severity.HINT), "  " end --}}} ---Returns the count of informations and a icon. ---@return string ---@return string #suggeste icon function M.diagnostic_info() --{{{ return diagnostics(vim.diagnostic.severity.INFO), "  " end --}}} ---Executes go.mod tidy. ---@param filename string should be the full path of the go.mod file. function M.go_mod_tidy(bufnr, filename) --{{{ local clients = vim.lsp.get_active_clients() local command = { command = "gopls.tidy", arguments = { { URIs = { "file:/" .. filename }, } }, } for _, client in pairs(clients) do if client.name == "gopls" then client.request("workspace/executeCommand", command, function(...) local result = vim.lsp.handlers["workspace/executeCommand"](...) if client.supports_method("textDocument/codeLens") then vim.lsp.codelens.refresh() end return result end, bufnr) end end end --}}} ---Checks for dependency updates. It adds the found upgrades to the quickfix -- list. ---@param filename string should be the full path of the go.mod file. function M.go_mod_check_upgrades(filename) --{{{ local f = io.open(filename, "r") local contents = f:read("*a") f:close() local modules = {} for line in contents:gmatch("[^\r\n]+") do local module = line:match("^%s+([%a\\/\\.-]+)%s+[^%s\\/]+") if module then table.insert(modules, module) end end vim.lsp.handlers["textDocument/publishDiagnostics"] = function(_, result, ctx, config) for _, diag in pairs(result.diagnostics) do local cur_list = vim.fn.getqflist() local item = { filename = filename, lnum = diag.range.start.line + 1, col = diag.range.start.character + 1, text = diag.message, } table.insert(cur_list, item) vim.fn.setqflist(cur_list) nvim.ex.copen() end vim.lsp.diagnostic.on_publish_diagnostics(_, result, ctx, config) vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.diagnostic.on_publish_diagnostics end local command = { command = "gopls.check_upgrades", arguments = { { URI = "file:/" .. filename, Modules = modules, } }, } -- FIXME: check if at least one of the clients supports this. vim.lsp.buf.execute_command(command) end --}}} return M -- vim: fdm=marker fdl=0
require 'nn' require 'nngraph' function lstm(x, prev_c, prev_h) local function new_input_sum() local xt = nn.Linear(params.rnn_size, params.rnn_size) local ht_1 = nn.Linear(params.rnn_size, params.rnn_size) local c_t_1 = nn.Linear(params.rnn_size, params.rnn_size) return nn.CAddTable()({xt(i), ht_1(prev_h) , c_t_1(prev_c) }) end local in_gate = nn.Sigmoid()(new_input_sum()) local forget_gate = nn.Sigmoid()(new_input_sum()) local in_gate2 = nn.Tanh()(new_input_sum()) local next_c = nn.CAddTable()({ nn.CMulTable()({forget_gate, prev_c}), nn.CMulTable()({in_gate, in_gate2}) }) local out_gate = nn.Sigmoid()(new_input_sum()) local next_h = nn.CMulTable()({out_gate, nn.Tanh()(next_c)}) return next_c, next_h end
-- This does not handle escaped commas with quotes! local M = {} function split(s,delimiter) delimiter = delimiter or '%s' local t={} local i=1 for str in string.gmatch(s .. delimiter, '([^' .. delimiter .. ']*)' .. delimiter) do t[i] = str i = i + 1 end return t end local function read_file(file) local f = assert(io.open(file, "rb")) local content = f:read("*all") f:close() return content end local function normalize_line_endings(file) return string.gsub(file, '\r\n?', '\n') end function M.parse_csv(csv_file) local csv_table = {} csv_file = normalize_line_endings(csv_file) for line in csv_file:gmatch("(.-)\n") do table.insert(csv_table, split(line, ",")) end return csv_table end function M.load_file(file_path) local data = read_file(file_path) if data then local data_table = M.parse_csv(data) return data_table else print(error) return nil end end function M.load_resource(resource_path) local data, error = sys.load_resource(resource_path) if data then local data_table = M.parse_csv(data) return data_table else print(error) return nil end end return M
local super = Class("MouseInfo", LuaObject).getSuperclass() MouseInfo.x = 0 MouseInfo.y = 0 MouseInfo.component = nil function MouseInfo:init() super.init(self) end function MouseInfo.setPointLocation(x, y) MouseInfo.x = x MouseInfo.y = y end function MouseInfo.getPoint() return MouseInfo.x, MouseInfo.y end function MouseInfo.getOverComponent() return MouseInfo.component end function MouseInfo.setOverComponent(component) MouseInfo.component = component end
 addChar([[ Accelerator Arrange_Accelerator kamijo kamijo_old Agito Akito(COH) Rin okita AKATSUKI-EN1 !MYCALE-EN1 SAI-EN1 Kanae_MKT Fritz-PW Marilyn_MKT WEI-EN1 Anonym-guard E-SOLDAT-EN1 ADLER-EN1 BLITZTANK_HM MURAKUMO-EN1 No-Name(re) Roa_AACC Shiki_AACC Nanaya_AACC NanayaShiki_SE Miyako_AACC Kenshiro Shin2 Shin_I KFG-MeiLing-Armosh-LastNumber Sarashina tenma_sama J_cirno_ver.Armosh Armosh_mai mashiro zekamasi Crescent moriya washizuka sol_b ods ky_slash Ren_Idagawa Sanzou Burai Kirito-B2 Yuuki(re) Kazuya2 Etomo_Shuko_2 Seulbi tatsumaki kiyohime akfg Astraea Fl_Night miko R_Saber y_kurumi kfmj the-kung fu man Yashiro_Nanakase March EINS cvsryu cvsken cvschunli cvsguile Cvs_sagat cvsrugal Sagat(re) ]]) addStage([[ SpaceRainbowLowRes.def AURORA_CITY.def BlueScarlet.def Diavolo in Me Blood.def The Last Effort.def valley.def Outer Space.def Seif Al Din.def Ruins in space.def FGO_Kara_no_Kyoukai_Rooftop.def ]])
local L = BigWigs:NewBossLocale("Atal'Dazar Trash", "frFR") if not L then return end if L then L.skyscreamer = "Hurleciel becqueteur" L.tlonja = "T'lonja" L.shieldbearer = "Porte-bouclier de Zul" L.witchdoctor = "Féticheuse zanchuli" L.kisho = "Dinomancienne Kish'o" L.priestess = "Prêtresse dorée" L.stalker = "Lame-de-l'ombre traqueur" L.confessor = "Confesseur dazar'ai" L.augur = "Augure dazar'ai" end
local vars = { prefix = '<C-b>', local_prefix = { n = nil, v = nil, i = nil, t = nil }, vertical_split = ':NvimuxVerticalSplit', horizontal_split = ':NvimuxHorizontalSplit', quickterm_scope = 'g', quickterm_direction = 'botright', quickterm_orientation = 'vertical', quickterm_size = '', quickterm_command = 'term', close_term = ':x', new_window = 'enew', new_tab = nil } vars.split_type = function(t) return t.quickterm_direction .. ' ' .. t.quickterm_orientation .. ' ' .. t.quickterm_size .. 'split' end return vars
local make make = function(dimensions) local agent = { pos = (function() local _accum_0 = { } local _len_0 = 1 for i = 1, dimensions do _accum_0[_len_0] = math.random(-200, 200) _len_0 = _len_0 + 1 end return _accum_0 end)(), scale = 1 } agent.color = { .01 * math.random(0, 255), .01 * math.random(0, 255), .01 * math.random(0, 255) } agent.radius = 10 agent.update = function(self, dt) local point, scale = projectn(2, 500, self.pos) for i = 1, #self.pos do self.pos[i] = self.pos[i] + (dt * math.random(-20, 20)) end self.x = scale * point[1] self.y = scale * point[2] self.scale = scale end agent.draw = function(self) do local _with_0 = love.graphics _with_0.setColor(self.color) _with_0.circle("fill", self.x, self.y, self.radius * self.scale) return _with_0 end end return agent end return { make = make }
local PLUGIN = PLUGIN; local COMMAND = Clockwork.command:New("PlySilence"); COMMAND.tip = "Prevent a player from running any administrative commands."; COMMAND.text = "<string Name>"; COMMAND.access = "s"; COMMAND.arguments = 1; -- Called when the command has been run. function COMMAND:OnRun(player, arguments) local target = Clockwork.player:FindByID(table.concat(arguments, " ")) local echo = Clockwork.config:Get("admin_echoes"):Get() if (target) then if (target.silenced) then target.silenced = false target:Notify("You have been unsilenced.") player:Notify(target:Name().." has been unsilenced.") if (echo) then Clockwork.player:NotifyAll(player:Name().." has unsilenced "..target:Name()..".") end else target.silenced = true target:Notify("You have been silenced.") player:Notify(target:Name().." has been silenced.") if (echo) then Clockwork.player:NotifyAll(player:Name().." has silenced "..target:Name()..".") end end end end; COMMAND:Register();
-- require('actions.factory') local factory = require "src.actions.factory" function love.keypressed(key) print('pressed', key) if key == "space" then factory.spawnRect() end if key == "up" then factory.toggle("up", true) end if key == "down" then factory.toggle("down", true) end if key == "left" then factory.toggle("left", true) end if key == "right" then factory.toggle("right", true) end end function love.keyreleased(key) print('released', key) if key == "up" then factory.toggle("up", false) end if key == "down" then factory.toggle("down", false) end if key == "left" then factory.toggle("left", false) end if key == "right" then factory.toggle("right", false) end end
function item_homemade_cheese_on_spell_start(keys) local ability = keys.ability local target = keys.target target:Heal(keys.HealthRestore, keys.caster) target:GiveMana(keys.ManaRestore) if target == keys.caster then ability:EndCooldown() ability:StartCooldown(ability:GetSpecialValueFor("alternative_cooldown")) end end
function onCreate() -- This stage took me the longest to code lol makeLuaSprite('sky', 'Majin/sonicFUNsky', -600, -200); setScrollFactor('sky', 0.3, 0.3); scaleObject('sky', 0.9, 0.9); makeLuaSprite('bush2', 'Majin/Bush2', -42, 171); setScrollFactor('bush2', 0.3, 0.3); makeAnimatedLuaSprite('BackBoppers', 'Majin/Majin Boppers Back', 182, -100); --For all the others I just copy and pasted this stage element and edited it lol.. setScrollFactor('BackBoppers', 0.6, 0.6); --scaleObject('BackBoppers', 0.7, 0.7); addAnimationByPrefix('BackBoppers', 'bumpypillar', 'MajinBop2', 24, true); makeLuaSprite('bush', 'Bush 1', 132, 354); setScrollFactor('bush', 0.3, 0.3); makeAnimatedLuaSprite('FrontBop', 'Majin/Majin Boppers Front', -169, -167); setScrollFactor('FrontBop', 0.6, 0.6); --scaleObject('BackBoppers', 0.7, 0.7); addAnimationByPrefix('FrontBop', 'bumpypillar', 'MajinBop1', 24, true); makeLuaSprite('floor', 'Majin/floor BG', -340, 660); setScrollFactor('floor', 0.5, 0.5); makeAnimatedLuaSprite('FrontBoppers', 'Majin/majin FG1', 1126, 903); setScrollFactor('FrontBoppers', 0.8, 0.8); --scaleObject('BackBoppers', 0.7, 0.7); addAnimationByPrefix('FrontBoppers', 'bumpypillar', 'majin front bopper1', 24, true); makeAnimatedLuaSprite('FrontBoppers2', 'Majin/majin FG2', -293, 871); setScrollFactor('FrontBoppers2', 0.8, 0.8); --scaleObject('BackBoppers', 0.7, 0.7); addAnimationByPrefix('FrontBoppers2', 'bumpypillar', 'majin front bopper2', 24, true); makeLuaSprite('readthefiletitlelol', 'makeGraphicsucks', 0, 0); scaleObject('readthefiletitlelol', 6.0, 6.0); setObjectCamera('readthefiletitlelol', 'other'); addLuaSprite('readthefiletitlelol', true); makeLuaSprite('introcircle', 'StartScreens/CircleMajin', 100, 0); setObjectCamera('introcircle', 'other'); addLuaSprite('introcircle', true); makeLuaSprite('introtext', 'StartScreens/TextMajin', -100, 0); setObjectCamera('introtext', 'other'); addLuaSprite('introtext', true); addLuaSprite('sky', false); addLuaSprite('bush2', false); addLuaSprite('BackBoppers', false); addLuaSprite('bush', false); addLuaSprite('FrontBop', false); addLuaSprite('floor', false); addLuaSprite('FrontBoppers', false); addLuaSprite('FrontBoppers2', false); end function onStartCountdown() doTweenX('circleTween', 'introcircle', -100, 2, 'quintOut') doTweenX('textTween', 'introtext', 100, 2, 'quintOut') return Function_Continue end function onSongStart() doTweenAlpha('graphicAlpha', 'readthefiletitlelol', 0, 0.2, 'quintOut'); doTweenAlpha('circleAlpha', 'introcircle', 0, 0.2, 'quintOut'); doTweenAlpha('textAlpha', 'introtext', 0, 0.2, 'quintOut'); end function onUpdate() for i = 0, getProperty('unspawnNotes.length')-1 do setPropertyFromGroup('unspawnNotes', i, 'noteSplashTexture', 'BloodSplash'); end end
local K = require("game.constants") local LG = love.graphics local loveUtils = require('utils.love') local screenLoader = require('utils.screenLoader') local menus = require('game.menus') local chunky = require('game.render.chunky') local bt = require('game.render.bursts') local rboard = require('game.render.gems.board') local function soundMenu(returnTo) local self = menus(K.MENUS_X0, K.MENUS_Y0, 1.1) self.onEnter = function() chunky.setMode('interference') self.selectItem(selection or 1); self.setMousePosition() end local modes = {} do for i, mode in ipairs(love.graphics.getModes()) do modes[#modes + 1] = {label = ( mode.width .. "x" .. mode.height ), data=mode, selected=(SCREEN_WIDTH==mode.width and SCREEN_HEIGHT==mode.height)} end end local resolution = self.add(modes) local window = self.add{{label="Fullscreen", data="fullscreen", selected=SCREEN_FULLSCREEN}, {label="Windowed", data="windowed", selected=(not SCREEN_FULLSCREEN)}} local vsync = self.add{{label="Enable Vertical Sync", selected=SCREEN_VSYNC, data=true}, {label="Disable Vertical Sync", selected=SCREEN_VSYNC, data=false}} local fsaa = {} do for i = 0, 3 do local val = i * 2 fsaa[#fsaa + 1] = {label=val.." FSAA Buffers", data=val, selected=(SCREEN_FSAA == val)} end end local fsaa = self.add(fsaa) self.add("Apply!", function(mode) if love.graphics.setMode(resolution.data.width, resolution.data.height, window.data == "fullscreen", vsync.data, fsaa.data) then SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_FULLSCREEN, SCREEN_VSYNC, SCREEN_FSAA = resolution.data.width, resolution.data.height, window.data == "fullscreen", vsync.data, fsaa.data K.update() K.restore() -- overwrite the defaults of update with the stored settings. chunky.initialize() bt.initialize() rboard.createSheet() screenLoader.store() end end) self.add("Back", function() return returnTo end) function self.draw() LG.setFont(K.MENUS_FONT) LG.setColor(0, 255, 0, 255) loveUtils.printCenter("Options > Screen", K.MENUS_X0) self.render(K.MENUS_X0, K.MENUS_Y0) end return self end return soundMenu
local class = require 'middleclass' local DStream = class('DStream') function DStream:initialize(ssc) self.ssc = ssc self.inputs = {} self.outputs = {} end function DStream:_notify(validTime, rdd) for _, dstream in ipairs(self.inputs) do rdd = dstream:_notify(validTime, rdd) end for _, dstream in ipairs(self.outputs) do dstream:_notify(validTime, rdd) end end function DStream:count() local transformFunc = function(rdd) return self.ssc.sc:makeRDD({rdd:count()}) end return self:transform(transformFunc) end function DStream:foreachRDD(foreachFunc) local TransformedDStream = require 'stuart.streaming.TransformedDStream' local dstream = TransformedDStream:new(self.ssc, foreachFunc) self.outputs[#self.outputs+1] = dstream return self end function DStream:groupByKey() local transformFunc = function(rdd) return rdd:groupByKey() end return self:transform(transformFunc) end function DStream:mapValues(f) local transformFunc = function(rdd) return rdd:mapValues(f) end return self:transform(transformFunc) end function DStream:start() end function DStream:stop() end function DStream:transform(transformFunc) local TransformedDStream = require 'stuart.streaming.TransformedDStream' local dstream = TransformedDStream:new(self.ssc, transformFunc) self.inputs[#self.inputs+1] = dstream return dstream end return DStream
function getNA1Actions(no) if(no < 0)then return {}; elseif(no == 0)then return {'2565','355','871','12975','190456','34428','1160','163558','1719','228920','23922','6572','20243','100','57755','198304','6343','46968'}; elseif(no == 1)then return {'184364','97462','5308','205545','1719','118000','184367','85288','23881','100130','190411','100','57755'}; elseif(no == 2)then return {}; end return {}; end NA1ProfileNames = {[0]='防战',[1]='狂暴战',[2]='武器战',}; NA1ProfileDescriptions = {[0]='天赋:1112323--属性:耐力>力量>精通≥暴击≈急速≈全能',[1]='天赋:2312331--属性:急速>精通>暴击>全能',[2]='天赋:--属性:',}; function NA1Dps() W_Log(1,"战士 dps"); if(W_IsInCombat())then if(NA_ProfileNo < 0)then return false; --保命施法 elseif(NA_ProfileNo == 0)then --防战 if(false )then return true; end elseif(NA_ProfileNo == 1)then --狂暴战 if(false )then return true; end elseif(NA_ProfileNo == 2)then --武器战 if(false )then return true; end end if(W_TargetCanAttack()) then --攻击施法 if(NA_ProfileNo < 0)then return false; elseif(NA_ProfileNo == 0)then --防战 local dpgd = W_RetainBuff(NA_Player, 132404, true); --盾牌格挡 local notTanking = not NA_IsSolo and not W_isTanking(); if(not NA_IsAOE and (false or NA_Fire(not dpgd, '2565', NA_Player) --盾牌格挡 or NA_Fire(notTanking, '355', NA_Target) --嘲讽 or NA_Fire(W_HPlevel(NA_Player)<0.2, '871', NA_Player) --盾墙 or NA_Fire(W_HPlevel(NA_Player)<0.1, '12975', NA_Player) --破釜沉舟 or NA_Fire(W_HPlevel(NA_Player)<0.8, '190456', NA_Player) --无视苦痛 or NA_Fire(not NA_IsMaxDps and W_HPlevel(NA_Player)<0.8, '34428', NA_Player) --乘胜追击 or NA_Fire(W_HPlevel(NA_Player)<1, '1160', NA_Player) --挫志怒吼 or NA_Fire(true, '163558', NA_Target) --副手斩杀 or NA_Fire(true, '1719', NA_Player) --战吼 or NA_Fire(true, '228920', NA_Target) --破坏者 or NA_Fire(true, '23922', NA_Target) --盾牌猛击 or NA_Fire(true, '6572', NA_Target) --复仇 or NA_Fire(true, '20243', NA_Target) --毁灭打击 or NA_Fire(true, '100', NA_Target) --冲锋 or NA_Fire(true, '57755', NA_Target) --英勇投掷 or NA_Fire(true, '198304', NA_Target) --拦截 ))then return true; end if(NA_IsAOE and (false or NA_Fire(not dpgd, '2565', NA_Player) --盾牌格挡 or NA_Fire(notTanking, '355', NA_Target) --嘲讽 or NA_Fire(W_HPlevel(NA_Player)<0.2, '871', NA_Player) --盾墙 or NA_Fire(W_HPlevel(NA_Player)<0.1, '12975', NA_Player) --破釜沉舟 or NA_Fire(W_HPlevel(NA_Player)<0.8, '190456', NA_Player) --无视苦痛 or NA_Fire(not NA_IsMaxDps and W_HPlevel(NA_Player)<0.8, '34428', NA_Player) --乘胜追击 or NA_Fire(W_HPlevel(NA_Player)<1, '1160', NA_Player) --挫志怒吼 or NA_Fire(true, '163558', NA_Target) --副手斩杀 or NA_Fire(true, '1719', NA_Player) --战吼 or NA_Fire(true, '228920', NA_Target) --破坏者 or NA_Fire(true, '6343', NA_Target) --雷霆一击 or NA_Fire(true, '46968', NA_Target) --震荡波 or NA_Fire(true, '6572', NA_Target) --复仇 or NA_Fire(true, '23922', NA_Target) --盾牌猛击 or NA_Fire(true, '20243', NA_Target) --毁灭打击 or NA_Fire(true, '100', NA_Target) --冲锋 or NA_Fire(true, '57755', NA_Target) --英勇投掷 or NA_Fire(true, '198304', NA_Target) --拦截 ))then return true; end elseif(NA_ProfileNo == 1)then --狂暴战 local has215570 = W_HasBuff(NA_Player, 215570, true); --摧枯拉朽 local in5308 = W_HPlevel(NA_Target)<0.2; --斩杀阶段 if(not NA_IsAOE and (false or NA_Fire(NA_IsSolo and NA_checkHP(2), '184364', NA_Player) --狂怒回复 or NA_Fire(NA_IsSolo and NA_checkHP(0), '97462', NA_Player) --命令怒吼 or NA_Fire(true, '5308', NA_Target) --斩杀 or NA_Fire(true, '205545', NA_Player) --奥丁之怒 or NA_Fire(true, '1719', NA_Player) --战吼 or NA_Fire(true, '118000', NA_Player) --巨龙怒吼 or NA_Fire(in5308 and W_PowerLevel(NA_Player) > 0.85, '184367', NA_Target) --暴怒 or NA_Fire(in5308, '85288', NA_Target) --怒击 or NA_Fire(in5308 or W_BuffCount(NA_Player, 206333, true)>5 or W_HasBuff(NA_Player, 184364, true), '23881', NA_Target) --嗜血 or NA_Fire(true, '184367', NA_Target) --暴怒 or NA_Fire(true, '85288', NA_Target) --怒击 or NA_Fire(true, '100130', NA_Target) --狂暴挥砍 or NA_Fire(has215570, '190411', NA_Target) --旋风斩 or NA_Fire(NA_IsSolo and not NA_checkHP(1), '23881', NA_Target) --嗜血 or NA_Fire(true, '190411', NA_Target) --旋风斩 or NA_Fire(true, '100', NA_Target) --冲锋 or NA_Fire(true, '57755', NA_Target) --英勇投掷 ))then return true; end if(NA_IsAOE and (false ))then return true; end elseif(NA_ProfileNo == 2)then --武器战 if(not NA_IsAOE and (false ))then return true; end if(NA_IsAOE and (false ))then return true; end end elseif(UnitCanAssist(NA_Player, NA_Target))then --辅助施法 if(NA_ProfileNo < 0)then return false; elseif(NA_ProfileNo == 0)then --防战 if(false )then return true; end elseif(NA_ProfileNo == 1)then --狂暴战 if(false )then return true; end elseif(NA_ProfileNo == 2)then --武器战 if(false )then return true; end end end else --不在战斗中 if(NA_ProfileNo < 0)then return false; --脱战后补buff,开怪等 elseif(NA_ProfileNo == 0)then --防战 if(false or NA_Fire(NA_IsSolo and W_TargetCanAttack(), '100', NA_Target) --冲锋 or NA_Fire(NA_IsSolo and W_TargetCanAttack(), '57755', NA_Target) --英勇投掷 or NA_Fire(NA_IsSolo and W_TargetCanAttack(), '198304', NA_Target) --拦截 )then return true; end elseif(NA_ProfileNo == 1)then --狂暴战 if(false or NA_Fire(NA_IsSolo and W_TargetCanAttack(), '100', NA_Target) --冲锋 or NA_Fire(NA_IsSolo and W_TargetCanAttack(), '57755', NA_Target) --英勇投掷 )then return true; end elseif(NA_ProfileNo == 2)then --武器战 if(false )then return true; end end end return false; end
create_actor([[lane_jumper;0;pos,confined| x:4; y:4; lane: 1; -- [0, 1, or 2] i:@1; switch_lane:@2; ]], function(a) a:switch_lane(0) end, function(a, lane_dir) -- lane_dir: -1, 0, 1 a.lane = mid(0, a.lane + lane_dir, 2) a.y = TOP_LANE_Y+a.lane*2 end, function(a) scr_circ(a.x, a.y, .5, 8) end) create_actor([[vehicle;0;drawable,spr,mov,x_bounded,col,anim,hurtable,confined| x:4; y:4; ix:.96; iy:.92; vehicle_logic:nf; i:@1; u:@2; move_x:@3; move_y:@4; ]], function(a) a.lane_jumper = _g.lane_jumper() end, function(a) a:vehicle_logic() amov_y(a, .02, a.lane_jumper.y) end, function(a, x) -- x: -1, 0, 1 a.ax = x * .005 end, function(a, y) -- y: -1, 0, 1 a.lane_jumper:switch_lane(y) end) create_actor([[pl;3;vehicle,timed| x:@1; y:@2; vehicle_logic:@4; anim_update:@5; destroyed:@6; x:4; y:4; sind:@3; sh:2; iyy:-4; ]], function(a) a:move_x(xbtn()) a:move_y(ybtnp()) a:anim_update() if a.t > 30 and (btn(4) or btn(5)) then a.t = 0 _g.throwing_star(a.x, a.y) sfx'17' g_stars_thrown += 1 end end, function(a) local toggle = a.tl_tim % .5 < .25 if a.dx > .01 and a.ax > 0 then a.sind = toggle and 36 or 37 elseif a.dx < -.01 and a.ax < 0 then a.sind = toggle and 32 or 33 else a.sind = toggle and 34 or 35 end if g_codename == "popguin" then a.sind -= 32 end end, function(a) _g.dead_pl(a.x, a.y, g_codename == "popguin" and 24 or 56) _g.dead_unicycle(a.x, a.y, g_codename == "popguin" and 8 or 40) _g.fader_out(.5,nf,reset_level) sfx'12' g_death_count += 1 end) create_actor([[truck;2;vehicle,timed| x:@1; y:@2; rx:1; vehicle_logic:@3; destroyed:@4; health:119; max_health:119; sind:26; sw:2; sh:3; iyy:-8; horizontal_input:0; ]], function(a) if flr_rnd(15) == 0 then a.horizontal_input = flr_rnd(3)-1 end a:move_x(a.horizontal_input) if flr_rnd(30) == 0 then a:move_y(flr_rnd(3)-1) end if a.t % 240 == 10 and flr_rnd(4) == 0 then sfx'13' end if a.t % 60 == 0 and flr_rnd(4) == 0 then sfx'16' _g.bomb(a.x-1, a.y) end end, function(a) _g.fader_out(.5,nf,function() g_tl:next() end) _g.dead_truck(a.x, a.y) end) create_actor([[intro_truck;0;truck,| x:-5; y:10; check_bounds:nf; vehicle_logic:@1; destroyed:@2; ]], function(a) a:move_x(a.x < 10 and 1 or 0) end, function(a) g_truck = _g.truck(a.x, a.y) end) create_actor([[intro_pl;0;pl,| x:-18; y:10; check_bounds:nf; vehicle_logic:@1; destroyed:@2; ]], function(a) a:move_x(a.x < 1 and 1 or 0) a:anim_update() end, function(a) g_pl = _g.pl(a.x, a.y, g_codename == "popguin" and 2 or 34) end) create_actor([[mission_text;3;post_drawable,vec,timed, confined| text:@1; y:@2; callback:@3; u:@4; d:@5; ,; u=nf, tl_max_time=.5; i=@6,u=nf; ]], function(a) a.cur_text = sub(a.text, 1, min(#a.text, a.tl_tim*10)) if #a.cur_text >= #a.text then a:next() end end, function(a) fillp(0b1000010000100001) rectfill(0, 0, 127, a.y + 17, 0x10) fillp() rect(0, 0, 127, a.y + 17, 1) zprint(a.cur_text, 4, a.y, -1, 11, 1) end, function(a) a.callback() end) create_actor([[dead_pl;3;drawable,spr,mov,x_bounded,timed,confined| x:@1; y:@2; sind:@3; ix:.95; dx:-.25; u:@4; ]], function(a) if a.t > 5 then a.sind = 55 if a.t > 10 then a.sind = 54 end if g_codename == "popguin" then a.sind -= 32 end end end) create_actor([[dead_unicycle;3;drawable,spr,mov,x_bounded,timed,confined| x:@1; y:@2; sind:@3; ix:.95; dx:.125; u:@4; ]], function(a) if a.t > 5 then a.sind = 39 if a.t > 10 then a.sind = 38 end if g_codename == "popguin" then a.sind -= 32 end end end) create_actor[[dead_truck;2;drawable,spr,pos,x_bounded,timed,confined| x:@1; y:@2; sind:89; sw:2; sh:3; iyy:-8; ]] create_actor([[throwing_star;2;drawable,vec,spr,col,confined| x:@1; y:@2; touchable:no; sind:28; u:@3; hit:@4; iyy:-4; dx:.25; tl_max_time=10,; ]], function(a) local val = t() % 1 if val < .25 then a.sind = 28 elseif val < .5 then a.sind = 29 elseif val < .75 then a.sind = 30 else a.sind = 31 end end, function(a, o) if o.truck then o:hurt(5, 0) a:kill() sfx'11' end end) create_actor([[bomb;2;drawable,vec,spr,col,confined| x:@1; y:@2; u:@3; hit:@4; touchable:no; sind:13; iyy:-4; dx:.25; tl_max_time=10,; ]], function(a) a.dx = ROAD_SPEED end, function(a, o) if o.pl then sfx'10' o:hurt(1, 0) a:kill() end end)
require("firecast.lua"); local __o_rrpgObjs = require("rrpgObjs.lua"); require("rrpgGUI.lua"); require("rrpgDialogs.lua"); require("rrpgLFM.lua"); require("ndb.lua"); require("locale.lua"); local __o_Utils = require("utils.lua"); local function constructNew_frmAMZ3() local obj = GUI.fromHandle(_obj_newObject("form")); local self = obj; local sheet = nil; rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject")); function obj:setNodeObject(nodeObject) sheet = nodeObject; self.sheet = nodeObject; self:_oldSetNodeObjectFunction(nodeObject); end; function obj:setNodeDatabase(nodeObject) self:setNodeObject(nodeObject); end; _gui_assignInitialParentForForm(obj.handle); obj:beginUpdate(); obj:setName("frmAMZ3"); obj:setAlign("client"); obj:setTheme("dark"); obj.scrollBox1 = GUI.fromHandle(_obj_newObject("scrollBox")); obj.scrollBox1:setParent(obj); obj.scrollBox1:setAlign("client"); obj.scrollBox1:setName("scrollBox1"); obj.layout1 = GUI.fromHandle(_obj_newObject("layout")); obj.layout1:setParent(obj.scrollBox1); obj.layout1:setLeft(270); obj.layout1:setTop(0); obj.layout1:setWidth(220); obj.layout1:setHeight(180); obj.layout1:setName("layout1"); obj.rectangle1 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle1:setParent(obj.layout1); obj.rectangle1:setAlign("client"); obj.rectangle1:setColor("black"); obj.rectangle1:setName("rectangle1"); obj.label1 = GUI.fromHandle(_obj_newObject("label")); obj.label1:setParent(obj.layout1); obj.label1:setLeft(0); obj.label1:setTop(5); obj.label1:setWidth(220); obj.label1:setHeight(20); obj.label1:setText("Atributos - Allei"); obj.label1:setHorzTextAlign("center"); obj.label1:setName("label1"); obj.layout2 = GUI.fromHandle(_obj_newObject("layout")); obj.layout2:setParent(obj.layout1); obj.layout2:setLeft(5); obj.layout2:setTop(25); obj.layout2:setWidth(310); obj.layout2:setHeight(25); obj.layout2:setName("layout2"); obj.label2 = GUI.fromHandle(_obj_newObject("label")); obj.label2:setParent(obj.layout2); obj.label2:setLeft(110); obj.label2:setTop(5); obj.label2:setWidth(50); obj.label2:setHeight(20); obj.label2:setText("Bônus"); obj.label2:setHorzTextAlign("center"); obj.label2:setName("label2"); obj.label3 = GUI.fromHandle(_obj_newObject("label")); obj.label3:setParent(obj.layout2); obj.label3:setLeft(160); obj.label3:setTop(5); obj.label3:setWidth(50); obj.label3:setHeight(20); obj.label3:setText("Total"); obj.label3:setHorzTextAlign("center"); obj.label3:setName("label3"); obj.layout3 = GUI.fromHandle(_obj_newObject("layout")); obj.layout3:setParent(obj.layout1); obj.layout3:setLeft(5); obj.layout3:setTop(50); obj.layout3:setWidth(210); obj.layout3:setHeight(25); obj.layout3:setName("layout3"); local function rolagemCallbackdes(rolagem) local chance = (tonumber(sheet.chance_des) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button1 = GUI.fromHandle(_obj_newObject("button")); obj.button1:setParent(obj.layout3); obj.button1:setLeft(0); obj.button1:setTop(0); obj.button1:setWidth(110); obj.button1:setHeight(20); obj.button1:setText("Destreza (DES)"); obj.button1:setHorzTextAlign("center"); obj.button1:setFontSize(13); obj.button1:setName("button1"); obj.edit1 = GUI.fromHandle(_obj_newObject("edit")); obj.edit1:setParent(obj.layout3); obj.edit1:setLeft(110); obj.edit1:setTop(0); obj.edit1:setWidth(50); obj.edit1:setHeight(25); obj.edit1:setField("atr_bonus_des"); obj.edit1:setType("number"); obj.edit1:setName("edit1"); obj.rectangle2 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle2:setParent(obj.layout3); obj.rectangle2:setLeft(160); obj.rectangle2:setTop(0); obj.rectangle2:setWidth(50); obj.rectangle2:setHeight(25); obj.rectangle2:setColor("black"); obj.rectangle2:setStrokeColor("white"); obj.rectangle2:setStrokeSize(1); obj.rectangle2:setName("rectangle2"); obj.label4 = GUI.fromHandle(_obj_newObject("label")); obj.label4:setParent(obj.layout3); obj.label4:setLeft(160); obj.label4:setTop(0); obj.label4:setWidth(50); obj.label4:setHeight(25); obj.label4:setHorzTextAlign("center"); obj.label4:setField("atr_efetivo_des"); obj.label4:setName("label4"); obj.dataLink1 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink1:setParent(obj.layout3); obj.dataLink1:setFields({'atr_total_des', 'atr_bonus_des'}); obj.dataLink1:setName("dataLink1"); obj.layout4 = GUI.fromHandle(_obj_newObject("layout")); obj.layout4:setParent(obj.layout1); obj.layout4:setLeft(5); obj.layout4:setTop(75); obj.layout4:setWidth(210); obj.layout4:setHeight(25); obj.layout4:setName("layout4"); local function rolagemCallbackper(rolagem) local chance = (tonumber(sheet.chance_per) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button2 = GUI.fromHandle(_obj_newObject("button")); obj.button2:setParent(obj.layout4); obj.button2:setLeft(0); obj.button2:setTop(0); obj.button2:setWidth(110); obj.button2:setHeight(20); obj.button2:setText("Percepção (PER)"); obj.button2:setHorzTextAlign("center"); obj.button2:setFontSize(13); obj.button2:setName("button2"); obj.edit2 = GUI.fromHandle(_obj_newObject("edit")); obj.edit2:setParent(obj.layout4); obj.edit2:setLeft(110); obj.edit2:setTop(0); obj.edit2:setWidth(50); obj.edit2:setHeight(25); obj.edit2:setField("atr_bonus_per"); obj.edit2:setType("number"); obj.edit2:setName("edit2"); obj.rectangle3 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle3:setParent(obj.layout4); obj.rectangle3:setLeft(160); obj.rectangle3:setTop(0); obj.rectangle3:setWidth(50); obj.rectangle3:setHeight(25); obj.rectangle3:setColor("black"); obj.rectangle3:setStrokeColor("white"); obj.rectangle3:setStrokeSize(1); obj.rectangle3:setName("rectangle3"); obj.label5 = GUI.fromHandle(_obj_newObject("label")); obj.label5:setParent(obj.layout4); obj.label5:setLeft(160); obj.label5:setTop(0); obj.label5:setWidth(50); obj.label5:setHeight(25); obj.label5:setHorzTextAlign("center"); obj.label5:setField("atr_efetivo_per"); obj.label5:setName("label5"); obj.dataLink2 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink2:setParent(obj.layout4); obj.dataLink2:setFields({'atr_total_per', 'atr_bonus_per'}); obj.dataLink2:setName("dataLink2"); obj.layout5 = GUI.fromHandle(_obj_newObject("layout")); obj.layout5:setParent(obj.layout1); obj.layout5:setLeft(5); obj.layout5:setTop(100); obj.layout5:setWidth(210); obj.layout5:setHeight(25); obj.layout5:setName("layout5"); local function rolagemCallbackint(rolagem) local chance = (tonumber(sheet.chance_int) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button3 = GUI.fromHandle(_obj_newObject("button")); obj.button3:setParent(obj.layout5); obj.button3:setLeft(0); obj.button3:setTop(0); obj.button3:setWidth(110); obj.button3:setHeight(20); obj.button3:setText("Inteligência (INT)"); obj.button3:setHorzTextAlign("center"); obj.button3:setFontSize(13); obj.button3:setName("button3"); obj.edit3 = GUI.fromHandle(_obj_newObject("edit")); obj.edit3:setParent(obj.layout5); obj.edit3:setLeft(110); obj.edit3:setTop(0); obj.edit3:setWidth(50); obj.edit3:setHeight(25); obj.edit3:setField("atr_bonus_int"); obj.edit3:setType("number"); obj.edit3:setName("edit3"); obj.rectangle4 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle4:setParent(obj.layout5); obj.rectangle4:setLeft(160); obj.rectangle4:setTop(0); obj.rectangle4:setWidth(50); obj.rectangle4:setHeight(25); obj.rectangle4:setColor("black"); obj.rectangle4:setStrokeColor("white"); obj.rectangle4:setStrokeSize(1); obj.rectangle4:setName("rectangle4"); obj.label6 = GUI.fromHandle(_obj_newObject("label")); obj.label6:setParent(obj.layout5); obj.label6:setLeft(160); obj.label6:setTop(0); obj.label6:setWidth(50); obj.label6:setHeight(25); obj.label6:setHorzTextAlign("center"); obj.label6:setField("atr_efetivo_int"); obj.label6:setName("label6"); obj.dataLink3 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink3:setParent(obj.layout5); obj.dataLink3:setFields({'atr_total_int', 'atr_bonus_int'}); obj.dataLink3:setName("dataLink3"); obj.layout6 = GUI.fromHandle(_obj_newObject("layout")); obj.layout6:setParent(obj.layout1); obj.layout6:setLeft(5); obj.layout6:setTop(125); obj.layout6:setWidth(210); obj.layout6:setHeight(25); obj.layout6:setName("layout6"); local function rolagemCallbackcon(rolagem) local chance = (tonumber(sheet.chance_con) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button4 = GUI.fromHandle(_obj_newObject("button")); obj.button4:setParent(obj.layout6); obj.button4:setLeft(0); obj.button4:setTop(0); obj.button4:setWidth(110); obj.button4:setHeight(20); obj.button4:setText("Concentração (CON)"); obj.button4:setHorzTextAlign("center"); obj.button4:setFontSize(11); obj.button4:setName("button4"); obj.edit4 = GUI.fromHandle(_obj_newObject("edit")); obj.edit4:setParent(obj.layout6); obj.edit4:setLeft(110); obj.edit4:setTop(0); obj.edit4:setWidth(50); obj.edit4:setHeight(25); obj.edit4:setField("atr_bonus_con"); obj.edit4:setType("number"); obj.edit4:setName("edit4"); obj.rectangle5 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle5:setParent(obj.layout6); obj.rectangle5:setLeft(160); obj.rectangle5:setTop(0); obj.rectangle5:setWidth(50); obj.rectangle5:setHeight(25); obj.rectangle5:setColor("black"); obj.rectangle5:setStrokeColor("white"); obj.rectangle5:setStrokeSize(1); obj.rectangle5:setName("rectangle5"); obj.label7 = GUI.fromHandle(_obj_newObject("label")); obj.label7:setParent(obj.layout6); obj.label7:setLeft(160); obj.label7:setTop(0); obj.label7:setWidth(50); obj.label7:setHeight(25); obj.label7:setHorzTextAlign("center"); obj.label7:setField("atr_efetivo_con"); obj.label7:setName("label7"); obj.dataLink4 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink4:setParent(obj.layout6); obj.dataLink4:setFields({'atr_total_con', 'atr_bonus_con'}); obj.dataLink4:setName("dataLink4"); obj.layout7 = GUI.fromHandle(_obj_newObject("layout")); obj.layout7:setParent(obj.layout1); obj.layout7:setLeft(5); obj.layout7:setTop(150); obj.layout7:setWidth(210); obj.layout7:setHeight(25); obj.layout7:setName("layout7"); local function rolagemCallbackfv(rolagem) local chance = (tonumber(sheet.chance_fv) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button5 = GUI.fromHandle(_obj_newObject("button")); obj.button5:setParent(obj.layout7); obj.button5:setLeft(0); obj.button5:setTop(0); obj.button5:setWidth(110); obj.button5:setHeight(20); obj.button5:setText("Força de Vontade (FV)"); obj.button5:setHorzTextAlign("center"); obj.button5:setFontSize(10); obj.button5:setName("button5"); obj.edit5 = GUI.fromHandle(_obj_newObject("edit")); obj.edit5:setParent(obj.layout7); obj.edit5:setLeft(110); obj.edit5:setTop(0); obj.edit5:setWidth(50); obj.edit5:setHeight(25); obj.edit5:setField("atr_bonus_fv"); obj.edit5:setType("number"); obj.edit5:setName("edit5"); obj.rectangle6 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle6:setParent(obj.layout7); obj.rectangle6:setLeft(160); obj.rectangle6:setTop(0); obj.rectangle6:setWidth(50); obj.rectangle6:setHeight(25); obj.rectangle6:setColor("black"); obj.rectangle6:setStrokeColor("white"); obj.rectangle6:setStrokeSize(1); obj.rectangle6:setName("rectangle6"); obj.label8 = GUI.fromHandle(_obj_newObject("label")); obj.label8:setParent(obj.layout7); obj.label8:setLeft(160); obj.label8:setTop(0); obj.label8:setWidth(50); obj.label8:setHeight(25); obj.label8:setHorzTextAlign("center"); obj.label8:setField("atr_efetivo_fv"); obj.label8:setName("label8"); obj.dataLink5 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink5:setParent(obj.layout7); obj.dataLink5:setFields({'atr_total_fv', 'atr_bonus_fv'}); obj.dataLink5:setName("dataLink5"); obj.layout8 = GUI.fromHandle(_obj_newObject("layout")); obj.layout8:setParent(obj.scrollBox1); obj.layout8:setLeft(500); obj.layout8:setTop(0); obj.layout8:setWidth(220); obj.layout8:setHeight(180); obj.layout8:setName("layout8"); obj.rectangle7 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle7:setParent(obj.layout8); obj.rectangle7:setAlign("client"); obj.rectangle7:setColor("black"); obj.rectangle7:setXradius(5); obj.rectangle7:setYradius(5); obj.rectangle7:setCornerType("round"); obj.rectangle7:setName("rectangle7"); obj.label9 = GUI.fromHandle(_obj_newObject("label")); obj.label9:setParent(obj.layout8); obj.label9:setLeft(0); obj.label9:setTop(0); obj.label9:setWidth(220); obj.label9:setHeight(20); obj.label9:setText("Talentos - Allei"); obj.label9:setHorzTextAlign("center"); obj.label9:setName("label9"); obj.layout9 = GUI.fromHandle(_obj_newObject("layout")); obj.layout9:setParent(obj.layout8); obj.layout9:setLeft(5); obj.layout9:setTop(25); obj.layout9:setWidth(210); obj.layout9:setHeight(25); obj.layout9:setName("layout9"); obj.label10 = GUI.fromHandle(_obj_newObject("label")); obj.label10:setParent(obj.layout9); obj.label10:setLeft(110); obj.label10:setTop(5); obj.label10:setWidth(50); obj.label10:setHeight(20); obj.label10:setText("Bônus"); obj.label10:setHorzTextAlign("center"); obj.label10:setName("label10"); obj.label11 = GUI.fromHandle(_obj_newObject("label")); obj.label11:setParent(obj.layout9); obj.label11:setLeft(160); obj.label11:setTop(5); obj.label11:setWidth(50); obj.label11:setHeight(20); obj.label11:setText("Total"); obj.label11:setHorzTextAlign("center"); obj.label11:setName("label11"); obj.layout10 = GUI.fromHandle(_obj_newObject("layout")); obj.layout10:setParent(obj.layout8); obj.layout10:setLeft(5); obj.layout10:setTop(50); obj.layout10:setWidth(210); obj.layout10:setHeight(25); obj.layout10:setName("layout10"); local function rolagemCallbackmir(rolagem) local chance = (tonumber(sheet.chance_mir) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button6 = GUI.fromHandle(_obj_newObject("button")); obj.button6:setParent(obj.layout10); obj.button6:setLeft(0); obj.button6:setTop(0); obj.button6:setWidth(110); obj.button6:setHeight(20); obj.button6:setText("Mira (MIR)"); obj.button6:setHorzTextAlign("center"); obj.button6:setFontSize(13); obj.button6:setName("button6"); obj.edit6 = GUI.fromHandle(_obj_newObject("edit")); obj.edit6:setParent(obj.layout10); obj.edit6:setLeft(110); obj.edit6:setTop(0); obj.edit6:setWidth(50); obj.edit6:setHeight(25); obj.edit6:setField("atr_bonus_mir"); obj.edit6:setType("number"); obj.edit6:setName("edit6"); obj.rectangle8 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle8:setParent(obj.layout10); obj.rectangle8:setLeft(160); obj.rectangle8:setTop(0); obj.rectangle8:setWidth(50); obj.rectangle8:setHeight(25); obj.rectangle8:setColor("black"); obj.rectangle8:setStrokeColor("white"); obj.rectangle8:setStrokeSize(1); obj.rectangle8:setName("rectangle8"); obj.label12 = GUI.fromHandle(_obj_newObject("label")); obj.label12:setParent(obj.layout10); obj.label12:setLeft(160); obj.label12:setTop(0); obj.label12:setWidth(50); obj.label12:setHeight(25); obj.label12:setHorzTextAlign("center"); obj.label12:setField("atr_efetivo_mir"); obj.label12:setName("label12"); obj.dataLink6 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink6:setParent(obj.layout10); obj.dataLink6:setFields({'atr_total_mir', 'atr_bonus_mir'}); obj.dataLink6:setName("dataLink6"); obj.layout11 = GUI.fromHandle(_obj_newObject("layout")); obj.layout11:setParent(obj.layout8); obj.layout11:setLeft(5); obj.layout11:setTop(75); obj.layout11:setWidth(210); obj.layout11:setHeight(25); obj.layout11:setName("layout11"); local function rolagemCallbackrac(rolagem) local chance = (tonumber(sheet.chance_rac) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button7 = GUI.fromHandle(_obj_newObject("button")); obj.button7:setParent(obj.layout11); obj.button7:setLeft(0); obj.button7:setTop(0); obj.button7:setWidth(110); obj.button7:setHeight(20); obj.button7:setText("Raciocínio (RAC)"); obj.button7:setHorzTextAlign("center"); obj.button7:setFontSize(13); obj.button7:setName("button7"); obj.edit7 = GUI.fromHandle(_obj_newObject("edit")); obj.edit7:setParent(obj.layout11); obj.edit7:setLeft(110); obj.edit7:setTop(0); obj.edit7:setWidth(50); obj.edit7:setHeight(25); obj.edit7:setField("atr_bonus_rac"); obj.edit7:setType("number"); obj.edit7:setName("edit7"); obj.rectangle9 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle9:setParent(obj.layout11); obj.rectangle9:setLeft(160); obj.rectangle9:setTop(0); obj.rectangle9:setWidth(50); obj.rectangle9:setHeight(25); obj.rectangle9:setColor("black"); obj.rectangle9:setStrokeColor("white"); obj.rectangle9:setStrokeSize(1); obj.rectangle9:setName("rectangle9"); obj.label13 = GUI.fromHandle(_obj_newObject("label")); obj.label13:setParent(obj.layout11); obj.label13:setLeft(160); obj.label13:setTop(0); obj.label13:setWidth(50); obj.label13:setHeight(25); obj.label13:setHorzTextAlign("center"); obj.label13:setField("atr_efetivo_rac"); obj.label13:setName("label13"); obj.dataLink7 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink7:setParent(obj.layout11); obj.dataLink7:setFields({'atr_total_rac', 'atr_bonus_rac'}); obj.dataLink7:setName("dataLink7"); obj.layout12 = GUI.fromHandle(_obj_newObject("layout")); obj.layout12:setParent(obj.layout8); obj.layout12:setLeft(5); obj.layout12:setTop(100); obj.layout12:setWidth(210); obj.layout12:setHeight(25); obj.layout12:setName("layout12"); local function rolagemCallbackref(rolagem) local chance = (tonumber(sheet.chance_ref) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button8 = GUI.fromHandle(_obj_newObject("button")); obj.button8:setParent(obj.layout12); obj.button8:setLeft(0); obj.button8:setTop(0); obj.button8:setWidth(110); obj.button8:setHeight(20); obj.button8:setText("Reflexo (REF)"); obj.button8:setHorzTextAlign("center"); obj.button8:setFontSize(13); obj.button8:setName("button8"); obj.edit8 = GUI.fromHandle(_obj_newObject("edit")); obj.edit8:setParent(obj.layout12); obj.edit8:setLeft(110); obj.edit8:setTop(0); obj.edit8:setWidth(50); obj.edit8:setHeight(25); obj.edit8:setField("atr_bonus_ref"); obj.edit8:setType("number"); obj.edit8:setName("edit8"); obj.rectangle10 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle10:setParent(obj.layout12); obj.rectangle10:setLeft(160); obj.rectangle10:setTop(0); obj.rectangle10:setWidth(50); obj.rectangle10:setHeight(25); obj.rectangle10:setColor("black"); obj.rectangle10:setStrokeColor("white"); obj.rectangle10:setStrokeSize(1); obj.rectangle10:setName("rectangle10"); obj.label14 = GUI.fromHandle(_obj_newObject("label")); obj.label14:setParent(obj.layout12); obj.label14:setLeft(160); obj.label14:setTop(0); obj.label14:setWidth(50); obj.label14:setHeight(25); obj.label14:setHorzTextAlign("center"); obj.label14:setField("atr_efetivo_ref"); obj.label14:setName("label14"); obj.dataLink8 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink8:setParent(obj.layout12); obj.dataLink8:setFields({'atr_total_ref', 'atr_bonus_ref'}); obj.dataLink8:setName("dataLink8"); obj.layout13 = GUI.fromHandle(_obj_newObject("layout")); obj.layout13:setParent(obj.layout8); obj.layout13:setLeft(5); obj.layout13:setTop(125); obj.layout13:setWidth(210); obj.layout13:setHeight(25); obj.layout13:setName("layout13"); local function rolagemCallbackhab(rolagem) local chance = (tonumber(sheet.chance_hab) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button9 = GUI.fromHandle(_obj_newObject("button")); obj.button9:setParent(obj.layout13); obj.button9:setLeft(0); obj.button9:setTop(0); obj.button9:setWidth(110); obj.button9:setHeight(20); obj.button9:setText("Habilidade (HAB)"); obj.button9:setHorzTextAlign("center"); obj.button9:setFontSize(13); obj.button9:setName("button9"); obj.edit9 = GUI.fromHandle(_obj_newObject("edit")); obj.edit9:setParent(obj.layout13); obj.edit9:setLeft(110); obj.edit9:setTop(0); obj.edit9:setWidth(50); obj.edit9:setHeight(25); obj.edit9:setField("atr_bonus_hab"); obj.edit9:setType("number"); obj.edit9:setName("edit9"); obj.rectangle11 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle11:setParent(obj.layout13); obj.rectangle11:setLeft(160); obj.rectangle11:setTop(0); obj.rectangle11:setWidth(50); obj.rectangle11:setHeight(25); obj.rectangle11:setColor("black"); obj.rectangle11:setStrokeColor("white"); obj.rectangle11:setStrokeSize(1); obj.rectangle11:setName("rectangle11"); obj.label15 = GUI.fromHandle(_obj_newObject("label")); obj.label15:setParent(obj.layout13); obj.label15:setLeft(160); obj.label15:setTop(0); obj.label15:setWidth(50); obj.label15:setHeight(25); obj.label15:setHorzTextAlign("center"); obj.label15:setField("atr_efetivo_hab"); obj.label15:setName("label15"); obj.dataLink9 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink9:setParent(obj.layout13); obj.dataLink9:setFields({'atr_total_hab', 'atr_bonus_hab'}); obj.dataLink9:setName("dataLink9"); obj.layout14 = GUI.fromHandle(_obj_newObject("layout")); obj.layout14:setParent(obj.scrollBox1); obj.layout14:setLeft(730); obj.layout14:setTop(0); obj.layout14:setWidth(220); obj.layout14:setHeight(180); obj.layout14:setName("layout14"); obj.rectangle12 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle12:setParent(obj.layout14); obj.rectangle12:setAlign("client"); obj.rectangle12:setColor("black"); obj.rectangle12:setXradius(5); obj.rectangle12:setYradius(5); obj.rectangle12:setCornerType("round"); obj.rectangle12:setName("rectangle12"); obj.label16 = GUI.fromHandle(_obj_newObject("label")); obj.label16:setParent(obj.layout14); obj.label16:setLeft(0); obj.label16:setTop(0); obj.label16:setWidth(220); obj.label16:setHeight(20); obj.label16:setText("Atributos - Zhul"); obj.label16:setHorzTextAlign("center"); obj.label16:setName("label16"); obj.layout15 = GUI.fromHandle(_obj_newObject("layout")); obj.layout15:setParent(obj.layout14); obj.layout15:setLeft(5); obj.layout15:setTop(25); obj.layout15:setWidth(210); obj.layout15:setHeight(25); obj.layout15:setName("layout15"); obj.label17 = GUI.fromHandle(_obj_newObject("label")); obj.label17:setParent(obj.layout15); obj.label17:setLeft(110); obj.label17:setTop(5); obj.label17:setWidth(50); obj.label17:setHeight(20); obj.label17:setText("Bônus"); obj.label17:setHorzTextAlign("center"); obj.label17:setName("label17"); obj.label18 = GUI.fromHandle(_obj_newObject("label")); obj.label18:setParent(obj.layout15); obj.label18:setLeft(160); obj.label18:setTop(5); obj.label18:setWidth(50); obj.label18:setHeight(20); obj.label18:setText("Total"); obj.label18:setHorzTextAlign("center"); obj.label18:setName("label18"); obj.layout16 = GUI.fromHandle(_obj_newObject("layout")); obj.layout16:setParent(obj.layout14); obj.layout16:setLeft(5); obj.layout16:setTop(50); obj.layout16:setWidth(210); obj.layout16:setHeight(25); obj.layout16:setName("layout16"); local function rolagemCallbackfor(rolagem) local chance = (tonumber(sheet.chance_for) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button10 = GUI.fromHandle(_obj_newObject("button")); obj.button10:setParent(obj.layout16); obj.button10:setLeft(0); obj.button10:setTop(0); obj.button10:setWidth(110); obj.button10:setHeight(20); obj.button10:setText("Força (FOR)"); obj.button10:setHorzTextAlign("center"); obj.button10:setFontSize(13); obj.button10:setName("button10"); obj.edit10 = GUI.fromHandle(_obj_newObject("edit")); obj.edit10:setParent(obj.layout16); obj.edit10:setLeft(110); obj.edit10:setTop(0); obj.edit10:setWidth(50); obj.edit10:setHeight(25); obj.edit10:setField("atr_bonus_for"); obj.edit10:setType("number"); obj.edit10:setName("edit10"); obj.rectangle13 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle13:setParent(obj.layout16); obj.rectangle13:setLeft(160); obj.rectangle13:setTop(0); obj.rectangle13:setWidth(50); obj.rectangle13:setHeight(25); obj.rectangle13:setColor("black"); obj.rectangle13:setStrokeColor("white"); obj.rectangle13:setStrokeSize(1); obj.rectangle13:setName("rectangle13"); obj.label19 = GUI.fromHandle(_obj_newObject("label")); obj.label19:setParent(obj.layout16); obj.label19:setLeft(160); obj.label19:setTop(0); obj.label19:setWidth(50); obj.label19:setHeight(25); obj.label19:setHorzTextAlign("center"); obj.label19:setField("atr_efetivo_for"); obj.label19:setName("label19"); obj.dataLink10 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink10:setParent(obj.layout16); obj.dataLink10:setFields({'atr_total_for', 'atr_bonus_for'}); obj.dataLink10:setName("dataLink10"); obj.layout17 = GUI.fromHandle(_obj_newObject("layout")); obj.layout17:setParent(obj.layout14); obj.layout17:setLeft(5); obj.layout17:setTop(75); obj.layout17:setWidth(210); obj.layout17:setHeight(25); obj.layout17:setName("layout17"); local function rolagemCallbackvel(rolagem) local chance = (tonumber(sheet.chance_vel) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button11 = GUI.fromHandle(_obj_newObject("button")); obj.button11:setParent(obj.layout17); obj.button11:setLeft(0); obj.button11:setTop(0); obj.button11:setWidth(110); obj.button11:setHeight(20); obj.button11:setText("Velocidade (VEL)"); obj.button11:setHorzTextAlign("center"); obj.button11:setFontSize(13); obj.button11:setName("button11"); obj.edit11 = GUI.fromHandle(_obj_newObject("edit")); obj.edit11:setParent(obj.layout17); obj.edit11:setLeft(110); obj.edit11:setTop(0); obj.edit11:setWidth(50); obj.edit11:setHeight(25); obj.edit11:setField("atr_bonus_vel"); obj.edit11:setType("number"); obj.edit11:setName("edit11"); obj.rectangle14 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle14:setParent(obj.layout17); obj.rectangle14:setLeft(160); obj.rectangle14:setTop(0); obj.rectangle14:setWidth(50); obj.rectangle14:setHeight(25); obj.rectangle14:setColor("black"); obj.rectangle14:setStrokeColor("white"); obj.rectangle14:setStrokeSize(1); obj.rectangle14:setName("rectangle14"); obj.label20 = GUI.fromHandle(_obj_newObject("label")); obj.label20:setParent(obj.layout17); obj.label20:setLeft(160); obj.label20:setTop(0); obj.label20:setWidth(50); obj.label20:setHeight(25); obj.label20:setHorzTextAlign("center"); obj.label20:setField("atr_efetivo_vel"); obj.label20:setName("label20"); obj.dataLink11 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink11:setParent(obj.layout17); obj.dataLink11:setFields({'atr_total_vel', 'atr_bonus_vel'}); obj.dataLink11:setName("dataLink11"); obj.layout18 = GUI.fromHandle(_obj_newObject("layout")); obj.layout18:setParent(obj.layout14); obj.layout18:setLeft(5); obj.layout18:setTop(100); obj.layout18:setWidth(210); obj.layout18:setHeight(25); obj.layout18:setName("layout18"); local function rolagemCallbackmaq(rolagem) local chance = (tonumber(sheet.chance_maq) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button12 = GUI.fromHandle(_obj_newObject("button")); obj.button12:setParent(obj.layout18); obj.button12:setLeft(0); obj.button12:setTop(0); obj.button12:setWidth(110); obj.button12:setHeight(20); obj.button12:setText("Maquinário (MAQ)"); obj.button12:setHorzTextAlign("center"); obj.button12:setFontSize(13); obj.button12:setName("button12"); obj.edit12 = GUI.fromHandle(_obj_newObject("edit")); obj.edit12:setParent(obj.layout18); obj.edit12:setLeft(110); obj.edit12:setTop(0); obj.edit12:setWidth(50); obj.edit12:setHeight(25); obj.edit12:setField("atr_bonus_maq"); obj.edit12:setType("number"); obj.edit12:setName("edit12"); obj.rectangle15 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle15:setParent(obj.layout18); obj.rectangle15:setLeft(160); obj.rectangle15:setTop(0); obj.rectangle15:setWidth(50); obj.rectangle15:setHeight(25); obj.rectangle15:setColor("black"); obj.rectangle15:setStrokeColor("white"); obj.rectangle15:setStrokeSize(1); obj.rectangle15:setName("rectangle15"); obj.label21 = GUI.fromHandle(_obj_newObject("label")); obj.label21:setParent(obj.layout18); obj.label21:setLeft(160); obj.label21:setTop(0); obj.label21:setWidth(50); obj.label21:setHeight(25); obj.label21:setHorzTextAlign("center"); obj.label21:setField("atr_efetivo_maq"); obj.label21:setName("label21"); obj.dataLink12 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink12:setParent(obj.layout18); obj.dataLink12:setFields({'atr_total_maq', 'atr_bonus_maq'}); obj.dataLink12:setName("dataLink12"); obj.layout19 = GUI.fromHandle(_obj_newObject("layout")); obj.layout19:setParent(obj.layout14); obj.layout19:setLeft(5); obj.layout19:setTop(125); obj.layout19:setWidth(210); obj.layout19:setHeight(25); obj.layout19:setName("layout19"); local function rolagemCallbackce(rolagem) local chance = (tonumber(sheet.chance_ce) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button13 = GUI.fromHandle(_obj_newObject("button")); obj.button13:setParent(obj.layout19); obj.button13:setLeft(0); obj.button13:setTop(0); obj.button13:setWidth(110); obj.button13:setHeight(20); obj.button13:setText("Construção Elemental (CE)"); obj.button13:setHorzTextAlign("center"); obj.button13:setFontSize(8); obj.button13:setName("button13"); obj.edit13 = GUI.fromHandle(_obj_newObject("edit")); obj.edit13:setParent(obj.layout19); obj.edit13:setLeft(110); obj.edit13:setTop(0); obj.edit13:setWidth(50); obj.edit13:setHeight(25); obj.edit13:setField("atr_bonus_ce"); obj.edit13:setType("number"); obj.edit13:setName("edit13"); obj.rectangle16 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle16:setParent(obj.layout19); obj.rectangle16:setLeft(160); obj.rectangle16:setTop(0); obj.rectangle16:setWidth(50); obj.rectangle16:setHeight(25); obj.rectangle16:setColor("black"); obj.rectangle16:setStrokeColor("white"); obj.rectangle16:setStrokeSize(1); obj.rectangle16:setName("rectangle16"); obj.label22 = GUI.fromHandle(_obj_newObject("label")); obj.label22:setParent(obj.layout19); obj.label22:setLeft(160); obj.label22:setTop(0); obj.label22:setWidth(50); obj.label22:setHeight(25); obj.label22:setHorzTextAlign("center"); obj.label22:setField("atr_efetivo_ce"); obj.label22:setName("label22"); obj.dataLink13 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink13:setParent(obj.layout19); obj.dataLink13:setFields({'atr_total_ce', 'atr_bonus_ce'}); obj.dataLink13:setName("dataLink13"); obj.layout20 = GUI.fromHandle(_obj_newObject("layout")); obj.layout20:setParent(obj.scrollBox1); obj.layout20:setLeft(960); obj.layout20:setTop(0); obj.layout20:setWidth(220); obj.layout20:setHeight(180); obj.layout20:setName("layout20"); obj.rectangle17 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle17:setParent(obj.layout20); obj.rectangle17:setAlign("client"); obj.rectangle17:setColor("black"); obj.rectangle17:setXradius(5); obj.rectangle17:setYradius(5); obj.rectangle17:setCornerType("round"); obj.rectangle17:setName("rectangle17"); obj.label23 = GUI.fromHandle(_obj_newObject("label")); obj.label23:setParent(obj.layout20); obj.label23:setLeft(0); obj.label23:setTop(0); obj.label23:setWidth(220); obj.label23:setHeight(20); obj.label23:setText("Perícias - Zhul"); obj.label23:setHorzTextAlign("center"); obj.label23:setName("label23"); obj.layout21 = GUI.fromHandle(_obj_newObject("layout")); obj.layout21:setParent(obj.layout20); obj.layout21:setLeft(5); obj.layout21:setTop(25); obj.layout21:setWidth(210); obj.layout21:setHeight(25); obj.layout21:setName("layout21"); obj.label24 = GUI.fromHandle(_obj_newObject("label")); obj.label24:setParent(obj.layout21); obj.label24:setLeft(110); obj.label24:setTop(5); obj.label24:setWidth(50); obj.label24:setHeight(20); obj.label24:setText("Bônus"); obj.label24:setHorzTextAlign("center"); obj.label24:setName("label24"); obj.label25 = GUI.fromHandle(_obj_newObject("label")); obj.label25:setParent(obj.layout21); obj.label25:setLeft(160); obj.label25:setTop(5); obj.label25:setWidth(50); obj.label25:setHeight(20); obj.label25:setText("Total"); obj.label25:setHorzTextAlign("center"); obj.label25:setName("label25"); obj.layout22 = GUI.fromHandle(_obj_newObject("layout")); obj.layout22:setParent(obj.layout20); obj.layout22:setLeft(5); obj.layout22:setTop(50); obj.layout22:setWidth(210); obj.layout22:setHeight(25); obj.layout22:setName("layout22"); local function rolagemCallbackpf(rolagem) local chance = (tonumber(sheet.chance_pf) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button14 = GUI.fromHandle(_obj_newObject("button")); obj.button14:setParent(obj.layout22); obj.button14:setLeft(0); obj.button14:setTop(0); obj.button14:setWidth(110); obj.button14:setHeight(20); obj.button14:setText("Poder de Fogo (PF)"); obj.button14:setHorzTextAlign("center"); obj.button14:setFontSize(11); obj.button14:setName("button14"); obj.edit14 = GUI.fromHandle(_obj_newObject("edit")); obj.edit14:setParent(obj.layout22); obj.edit14:setLeft(110); obj.edit14:setTop(0); obj.edit14:setWidth(50); obj.edit14:setHeight(25); obj.edit14:setField("atr_bonus_pf"); obj.edit14:setType("number"); obj.edit14:setName("edit14"); obj.rectangle18 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle18:setParent(obj.layout22); obj.rectangle18:setLeft(160); obj.rectangle18:setTop(0); obj.rectangle18:setWidth(50); obj.rectangle18:setHeight(25); obj.rectangle18:setColor("black"); obj.rectangle18:setStrokeColor("white"); obj.rectangle18:setStrokeSize(1); obj.rectangle18:setName("rectangle18"); obj.label26 = GUI.fromHandle(_obj_newObject("label")); obj.label26:setParent(obj.layout22); obj.label26:setLeft(160); obj.label26:setTop(0); obj.label26:setWidth(50); obj.label26:setHeight(25); obj.label26:setHorzTextAlign("center"); obj.label26:setField("atr_efetivo_pf"); obj.label26:setName("label26"); obj.dataLink14 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink14:setParent(obj.layout22); obj.dataLink14:setFields({'atr_total_pf', 'atr_bonus_pf'}); obj.dataLink14:setName("dataLink14"); obj.layout23 = GUI.fromHandle(_obj_newObject("layout")); obj.layout23:setParent(obj.layout20); obj.layout23:setLeft(5); obj.layout23:setTop(75); obj.layout23:setWidth(210); obj.layout23:setHeight(25); obj.layout23:setName("layout23"); local function rolagemCallbackagi(rolagem) local chance = (tonumber(sheet.chance_agi) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button15 = GUI.fromHandle(_obj_newObject("button")); obj.button15:setParent(obj.layout23); obj.button15:setLeft(0); obj.button15:setTop(0); obj.button15:setWidth(110); obj.button15:setHeight(20); obj.button15:setText("Agilidade (AGI)"); obj.button15:setHorzTextAlign("center"); obj.button15:setFontSize(13); obj.button15:setName("button15"); obj.edit15 = GUI.fromHandle(_obj_newObject("edit")); obj.edit15:setParent(obj.layout23); obj.edit15:setLeft(110); obj.edit15:setTop(0); obj.edit15:setWidth(50); obj.edit15:setHeight(25); obj.edit15:setField("atr_bonus_agi"); obj.edit15:setType("number"); obj.edit15:setName("edit15"); obj.rectangle19 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle19:setParent(obj.layout23); obj.rectangle19:setLeft(160); obj.rectangle19:setTop(0); obj.rectangle19:setWidth(50); obj.rectangle19:setHeight(25); obj.rectangle19:setColor("black"); obj.rectangle19:setStrokeColor("white"); obj.rectangle19:setStrokeSize(1); obj.rectangle19:setName("rectangle19"); obj.label27 = GUI.fromHandle(_obj_newObject("label")); obj.label27:setParent(obj.layout23); obj.label27:setLeft(160); obj.label27:setTop(0); obj.label27:setWidth(50); obj.label27:setHeight(25); obj.label27:setHorzTextAlign("center"); obj.label27:setField("atr_efetivo_agi"); obj.label27:setName("label27"); obj.dataLink15 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink15:setParent(obj.layout23); obj.dataLink15:setFields({'atr_total_agi', 'atr_bonus_agi'}); obj.dataLink15:setName("dataLink15"); obj.layout24 = GUI.fromHandle(_obj_newObject("layout")); obj.layout24:setParent(obj.layout20); obj.layout24:setLeft(5); obj.layout24:setTop(100); obj.layout24:setWidth(210); obj.layout24:setHeight(25); obj.layout24:setName("layout24"); local function rolagemCallbackres(rolagem) local chance = (tonumber(sheet.chance_res) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button16 = GUI.fromHandle(_obj_newObject("button")); obj.button16:setParent(obj.layout24); obj.button16:setLeft(0); obj.button16:setTop(0); obj.button16:setWidth(110); obj.button16:setHeight(20); obj.button16:setText("Resistência (RES)"); obj.button16:setHorzTextAlign("center"); obj.button16:setFontSize(13); obj.button16:setName("button16"); obj.edit16 = GUI.fromHandle(_obj_newObject("edit")); obj.edit16:setParent(obj.layout24); obj.edit16:setLeft(110); obj.edit16:setTop(0); obj.edit16:setWidth(50); obj.edit16:setHeight(25); obj.edit16:setField("atr_bonus_res"); obj.edit16:setType("number"); obj.edit16:setName("edit16"); obj.rectangle20 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle20:setParent(obj.layout24); obj.rectangle20:setLeft(160); obj.rectangle20:setTop(0); obj.rectangle20:setWidth(50); obj.rectangle20:setHeight(25); obj.rectangle20:setColor("black"); obj.rectangle20:setStrokeColor("white"); obj.rectangle20:setStrokeSize(1); obj.rectangle20:setName("rectangle20"); obj.label28 = GUI.fromHandle(_obj_newObject("label")); obj.label28:setParent(obj.layout24); obj.label28:setLeft(160); obj.label28:setTop(0); obj.label28:setWidth(50); obj.label28:setHeight(25); obj.label28:setHorzTextAlign("center"); obj.label28:setField("atr_efetivo_res"); obj.label28:setName("label28"); obj.dataLink16 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink16:setParent(obj.layout24); obj.dataLink16:setFields({'atr_total_res', 'atr_bonus_res'}); obj.dataLink16:setName("dataLink16"); obj.layout25 = GUI.fromHandle(_obj_newObject("layout")); obj.layout25:setParent(obj.layout20); obj.layout25:setLeft(5); obj.layout25:setTop(125); obj.layout25:setWidth(210); obj.layout25:setHeight(25); obj.layout25:setName("layout25"); local function rolagemCallbackvoo(rolagem) local chance = (tonumber(sheet.chance_voo) or 0); local resultado = rolagem.resultado; local mesa = rrpg.getMesaDe(sheet); if resultado <= chance then mesa.activeChat:enviarMensagem("Sucesso!"); else mesa.activeChat:enviarMensagem("Falha!"); end; end; obj.button17 = GUI.fromHandle(_obj_newObject("button")); obj.button17:setParent(obj.layout25); obj.button17:setLeft(0); obj.button17:setTop(0); obj.button17:setWidth(110); obj.button17:setHeight(20); obj.button17:setText("Voo"); obj.button17:setHorzTextAlign("center"); obj.button17:setFontSize(13); obj.button17:setName("button17"); obj.edit17 = GUI.fromHandle(_obj_newObject("edit")); obj.edit17:setParent(obj.layout25); obj.edit17:setLeft(110); obj.edit17:setTop(0); obj.edit17:setWidth(50); obj.edit17:setHeight(25); obj.edit17:setField("atr_bonus_voo"); obj.edit17:setType("number"); obj.edit17:setName("edit17"); obj.rectangle21 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle21:setParent(obj.layout25); obj.rectangle21:setLeft(160); obj.rectangle21:setTop(0); obj.rectangle21:setWidth(50); obj.rectangle21:setHeight(25); obj.rectangle21:setColor("black"); obj.rectangle21:setStrokeColor("white"); obj.rectangle21:setStrokeSize(1); obj.rectangle21:setName("rectangle21"); obj.label29 = GUI.fromHandle(_obj_newObject("label")); obj.label29:setParent(obj.layout25); obj.label29:setLeft(160); obj.label29:setTop(0); obj.label29:setWidth(50); obj.label29:setHeight(25); obj.label29:setHorzTextAlign("center"); obj.label29:setField("atr_efetivo_voo"); obj.label29:setName("label29"); obj.dataLink17 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink17:setParent(obj.layout25); obj.dataLink17:setFields({'atr_total_voo', 'atr_bonus_voo'}); obj.dataLink17:setName("dataLink17"); obj.layout26 = GUI.fromHandle(_obj_newObject("layout")); obj.layout26:setParent(obj.scrollBox1); obj.layout26:setLeft(0); obj.layout26:setTop(0); obj.layout26:setWidth(260); obj.layout26:setHeight(305); obj.layout26:setName("layout26"); obj.rectangle22 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle22:setParent(obj.layout26); obj.rectangle22:setAlign("client"); obj.rectangle22:setColor("black"); obj.rectangle22:setName("rectangle22"); obj.label30 = GUI.fromHandle(_obj_newObject("label")); obj.label30:setParent(obj.layout26); obj.label30:setLeft(0); obj.label30:setTop(5); obj.label30:setWidth(220); obj.label30:setHeight(20); obj.label30:setText("Êxitos"); obj.label30:setHorzTextAlign("center"); obj.label30:setName("label30"); obj.layout27 = GUI.fromHandle(_obj_newObject("layout")); obj.layout27:setParent(obj.layout26); obj.layout27:setLeft(5); obj.layout27:setTop(25); obj.layout27:setWidth(250); obj.layout27:setHeight(25); obj.layout27:setName("layout27"); obj.button18 = GUI.fromHandle(_obj_newObject("button")); obj.button18:setParent(obj.layout27); obj.button18:setLeft(0); obj.button18:setTop(0); obj.button18:setWidth(110); obj.button18:setHeight(20); obj.button18:setText("Iniciativa"); obj.button18:setHorzTextAlign("center"); obj.button18:setFontSize(13); obj.button18:setName("button18"); obj.rectangle23 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle23:setParent(obj.layout27); obj.rectangle23:setLeft(110); obj.rectangle23:setTop(0); obj.rectangle23:setWidth(100); obj.rectangle23:setHeight(25); obj.rectangle23:setColor("black"); obj.rectangle23:setStrokeColor("white"); obj.rectangle23:setStrokeSize(1); obj.rectangle23:setName("rectangle23"); obj.label31 = GUI.fromHandle(_obj_newObject("label")); obj.label31:setParent(obj.layout27); obj.label31:setLeft(110); obj.label31:setTop(0); obj.label31:setWidth(100); obj.label31:setHeight(25); obj.label31:setHorzTextAlign("center"); obj.label31:setField("roll_iniciativa"); obj.label31:setName("label31"); obj.edit18 = GUI.fromHandle(_obj_newObject("edit")); obj.edit18:setParent(obj.layout27); obj.edit18:setLeft(210); obj.edit18:setTop(0); obj.edit18:setWidth(40); obj.edit18:setHeight(25); obj.edit18:setHorzTextAlign("center"); obj.edit18:setField("extra_iniciativa"); obj.edit18:setName("edit18"); obj.dataLink18 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink18:setParent(obj.layout27); obj.dataLink18:setFields({'atr_efetivo_ref', 'atr_efetivo_agi', 'extra_iniciativa'}); obj.dataLink18:setName("dataLink18"); obj.label32 = GUI.fromHandle(_obj_newObject("label")); obj.label32:setParent(obj.layout26); obj.label32:setLeft(0); obj.label32:setTop(55); obj.label32:setWidth(220); obj.label32:setHeight(20); obj.label32:setText("Acertos"); obj.label32:setHorzTextAlign("center"); obj.label32:setName("label32"); obj.layout28 = GUI.fromHandle(_obj_newObject("layout")); obj.layout28:setParent(obj.layout26); obj.layout28:setLeft(5); obj.layout28:setTop(75); obj.layout28:setWidth(250); obj.layout28:setHeight(25); obj.layout28:setName("layout28"); obj.button19 = GUI.fromHandle(_obj_newObject("button")); obj.button19:setParent(obj.layout28); obj.button19:setLeft(0); obj.button19:setTop(0); obj.button19:setWidth(110); obj.button19:setHeight(20); obj.button19:setText("Ataque Corp."); obj.button19:setHorzTextAlign("center"); obj.button19:setFontSize(13); obj.button19:setName("button19"); obj.rectangle24 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle24:setParent(obj.layout28); obj.rectangle24:setLeft(110); obj.rectangle24:setTop(0); obj.rectangle24:setWidth(100); obj.rectangle24:setHeight(25); obj.rectangle24:setColor("black"); obj.rectangle24:setStrokeColor("white"); obj.rectangle24:setStrokeSize(1); obj.rectangle24:setName("rectangle24"); obj.label33 = GUI.fromHandle(_obj_newObject("label")); obj.label33:setParent(obj.layout28); obj.label33:setLeft(110); obj.label33:setTop(0); obj.label33:setWidth(100); obj.label33:setHeight(25); obj.label33:setHorzTextAlign("center"); obj.label33:setField("roll_acertos_cac"); obj.label33:setName("label33"); obj.edit19 = GUI.fromHandle(_obj_newObject("edit")); obj.edit19:setParent(obj.layout28); obj.edit19:setLeft(210); obj.edit19:setTop(0); obj.edit19:setWidth(40); obj.edit19:setHeight(25); obj.edit19:setHorzTextAlign("center"); obj.edit19:setField("extra_acertos_cac"); obj.edit19:setName("edit19"); obj.dataLink19 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink19:setParent(obj.layout28); obj.dataLink19:setFields({'atr_efetivo_des', 'atr_efetivo_vel', 'extra_acertos_cac'}); obj.dataLink19:setName("dataLink19"); obj.layout29 = GUI.fromHandle(_obj_newObject("layout")); obj.layout29:setParent(obj.layout26); obj.layout29:setLeft(5); obj.layout29:setTop(100); obj.layout29:setWidth(250); obj.layout29:setHeight(25); obj.layout29:setName("layout29"); obj.button20 = GUI.fromHandle(_obj_newObject("button")); obj.button20:setParent(obj.layout29); obj.button20:setLeft(0); obj.button20:setTop(0); obj.button20:setWidth(110); obj.button20:setHeight(20); obj.button20:setText("Ataque a Dist."); obj.button20:setHorzTextAlign("center"); obj.button20:setFontSize(13); obj.button20:setName("button20"); obj.rectangle25 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle25:setParent(obj.layout29); obj.rectangle25:setLeft(110); obj.rectangle25:setTop(0); obj.rectangle25:setWidth(100); obj.rectangle25:setHeight(25); obj.rectangle25:setColor("black"); obj.rectangle25:setStrokeColor("white"); obj.rectangle25:setStrokeSize(1); obj.rectangle25:setName("rectangle25"); obj.label34 = GUI.fromHandle(_obj_newObject("label")); obj.label34:setParent(obj.layout29); obj.label34:setLeft(110); obj.label34:setTop(0); obj.label34:setWidth(100); obj.label34:setHeight(25); obj.label34:setHorzTextAlign("center"); obj.label34:setField("roll_acertos_dist"); obj.label34:setName("label34"); obj.edit20 = GUI.fromHandle(_obj_newObject("edit")); obj.edit20:setParent(obj.layout29); obj.edit20:setLeft(210); obj.edit20:setTop(0); obj.edit20:setWidth(40); obj.edit20:setHeight(25); obj.edit20:setHorzTextAlign("center"); obj.edit20:setField("extra_acertos_dist"); obj.edit20:setName("edit20"); obj.dataLink20 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink20:setParent(obj.layout29); obj.dataLink20:setFields({'atr_efetivo_mir', 'atr_efetivo_agi', 'extra_acertos_dist'}); obj.dataLink20:setName("dataLink20"); obj.layout30 = GUI.fromHandle(_obj_newObject("layout")); obj.layout30:setParent(obj.layout26); obj.layout30:setLeft(5); obj.layout30:setTop(125); obj.layout30:setWidth(250); obj.layout30:setHeight(25); obj.layout30:setName("layout30"); obj.button21 = GUI.fromHandle(_obj_newObject("button")); obj.button21:setParent(obj.layout30); obj.button21:setLeft(0); obj.button21:setTop(0); obj.button21:setWidth(110); obj.button21:setHeight(20); obj.button21:setText("Bloqueio"); obj.button21:setHorzTextAlign("center"); obj.button21:setFontSize(13); obj.button21:setName("button21"); obj.rectangle26 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle26:setParent(obj.layout30); obj.rectangle26:setLeft(110); obj.rectangle26:setTop(0); obj.rectangle26:setWidth(100); obj.rectangle26:setHeight(25); obj.rectangle26:setColor("black"); obj.rectangle26:setStrokeColor("white"); obj.rectangle26:setStrokeSize(1); obj.rectangle26:setName("rectangle26"); obj.label35 = GUI.fromHandle(_obj_newObject("label")); obj.label35:setParent(obj.layout30); obj.label35:setLeft(110); obj.label35:setTop(0); obj.label35:setWidth(100); obj.label35:setHeight(25); obj.label35:setHorzTextAlign("center"); obj.label35:setField("roll_acertos_bloqueio"); obj.label35:setName("label35"); obj.edit21 = GUI.fromHandle(_obj_newObject("edit")); obj.edit21:setParent(obj.layout30); obj.edit21:setLeft(210); obj.edit21:setTop(0); obj.edit21:setWidth(40); obj.edit21:setHeight(25); obj.edit21:setHorzTextAlign("center"); obj.edit21:setField("extra_acertos_bloqueio"); obj.edit21:setName("edit21"); obj.dataLink21 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink21:setParent(obj.layout30); obj.dataLink21:setFields({'atr_efetivo_ref', 'atr_efetivo_vel', 'extra_acertos_bloqueio'}); obj.dataLink21:setName("dataLink21"); obj.layout31 = GUI.fromHandle(_obj_newObject("layout")); obj.layout31:setParent(obj.layout26); obj.layout31:setLeft(5); obj.layout31:setTop(150); obj.layout31:setWidth(250); obj.layout31:setHeight(25); obj.layout31:setName("layout31"); obj.button22 = GUI.fromHandle(_obj_newObject("button")); obj.button22:setParent(obj.layout31); obj.button22:setLeft(0); obj.button22:setTop(0); obj.button22:setWidth(110); obj.button22:setHeight(20); obj.button22:setText("Escape"); obj.button22:setHorzTextAlign("center"); obj.button22:setFontSize(13); obj.button22:setName("button22"); obj.rectangle27 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle27:setParent(obj.layout31); obj.rectangle27:setLeft(110); obj.rectangle27:setTop(0); obj.rectangle27:setWidth(100); obj.rectangle27:setHeight(25); obj.rectangle27:setColor("black"); obj.rectangle27:setStrokeColor("white"); obj.rectangle27:setStrokeSize(1); obj.rectangle27:setName("rectangle27"); obj.label36 = GUI.fromHandle(_obj_newObject("label")); obj.label36:setParent(obj.layout31); obj.label36:setLeft(110); obj.label36:setTop(0); obj.label36:setWidth(100); obj.label36:setHeight(25); obj.label36:setHorzTextAlign("center"); obj.label36:setField("roll_acertos_escape"); obj.label36:setName("label36"); obj.edit22 = GUI.fromHandle(_obj_newObject("edit")); obj.edit22:setParent(obj.layout31); obj.edit22:setLeft(210); obj.edit22:setTop(0); obj.edit22:setWidth(40); obj.edit22:setHeight(25); obj.edit22:setHorzTextAlign("center"); obj.edit22:setField("extra_acertos_escape"); obj.edit22:setName("edit22"); obj.dataLink22 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink22:setParent(obj.layout31); obj.dataLink22:setFields({'atr_efetivo_per', 'atr_efetivo_agi', 'extra_acertos_escape'}); obj.dataLink22:setName("dataLink22"); obj.layout32 = GUI.fromHandle(_obj_newObject("layout")); obj.layout32:setParent(obj.layout26); obj.layout32:setLeft(5); obj.layout32:setTop(175); obj.layout32:setWidth(250); obj.layout32:setHeight(25); obj.layout32:setName("layout32"); obj.button23 = GUI.fromHandle(_obj_newObject("button")); obj.button23:setParent(obj.layout32); obj.button23:setLeft(0); obj.button23:setTop(0); obj.button23:setWidth(110); obj.button23:setHeight(20); obj.button23:setText("Agarrão"); obj.button23:setHorzTextAlign("center"); obj.button23:setFontSize(13); obj.button23:setName("button23"); obj.rectangle28 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle28:setParent(obj.layout32); obj.rectangle28:setLeft(110); obj.rectangle28:setTop(0); obj.rectangle28:setWidth(100); obj.rectangle28:setHeight(25); obj.rectangle28:setColor("black"); obj.rectangle28:setStrokeColor("white"); obj.rectangle28:setStrokeSize(1); obj.rectangle28:setName("rectangle28"); obj.label37 = GUI.fromHandle(_obj_newObject("label")); obj.label37:setParent(obj.layout32); obj.label37:setLeft(110); obj.label37:setTop(0); obj.label37:setWidth(100); obj.label37:setHeight(25); obj.label37:setHorzTextAlign("center"); obj.label37:setField("roll_acertos_agarrao"); obj.label37:setName("label37"); obj.edit23 = GUI.fromHandle(_obj_newObject("edit")); obj.edit23:setParent(obj.layout32); obj.edit23:setLeft(210); obj.edit23:setTop(0); obj.edit23:setWidth(40); obj.edit23:setHeight(25); obj.edit23:setHorzTextAlign("center"); obj.edit23:setField("extra_acertos_agarrao"); obj.edit23:setName("edit23"); obj.dataLink23 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink23:setParent(obj.layout32); obj.dataLink23:setFields({'atr_efetivo_for', 'atr_efetivo_des', 'extra_acertos_agarrao'}); obj.dataLink23:setName("dataLink23"); obj.layout33 = GUI.fromHandle(_obj_newObject("layout")); obj.layout33:setParent(obj.layout26); obj.layout33:setLeft(5); obj.layout33:setTop(200); obj.layout33:setWidth(250); obj.layout33:setHeight(25); obj.layout33:setName("layout33"); obj.button24 = GUI.fromHandle(_obj_newObject("button")); obj.button24:setParent(obj.layout33); obj.button24:setLeft(0); obj.button24:setTop(0); obj.button24:setWidth(110); obj.button24:setHeight(20); obj.button24:setText("Counter"); obj.button24:setHorzTextAlign("center"); obj.button24:setFontSize(13); obj.button24:setName("button24"); obj.rectangle29 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle29:setParent(obj.layout33); obj.rectangle29:setLeft(110); obj.rectangle29:setTop(0); obj.rectangle29:setWidth(100); obj.rectangle29:setHeight(25); obj.rectangle29:setColor("black"); obj.rectangle29:setStrokeColor("white"); obj.rectangle29:setStrokeSize(1); obj.rectangle29:setName("rectangle29"); obj.label38 = GUI.fromHandle(_obj_newObject("label")); obj.label38:setParent(obj.layout33); obj.label38:setLeft(110); obj.label38:setTop(0); obj.label38:setWidth(100); obj.label38:setHeight(25); obj.label38:setHorzTextAlign("center"); obj.label38:setField("roll_acertos_counter"); obj.label38:setName("label38"); obj.edit24 = GUI.fromHandle(_obj_newObject("edit")); obj.edit24:setParent(obj.layout33); obj.edit24:setLeft(210); obj.edit24:setTop(0); obj.edit24:setWidth(40); obj.edit24:setHeight(25); obj.edit24:setHorzTextAlign("center"); obj.edit24:setField("extra_acertos_counter"); obj.edit24:setName("edit24"); obj.dataLink24 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink24:setParent(obj.layout33); obj.dataLink24:setFields({'atr_efetivo_hab', 'atr_efetivo_vel', 'extra_acertos_counter'}); obj.dataLink24:setName("dataLink24"); obj.label39 = GUI.fromHandle(_obj_newObject("label")); obj.label39:setParent(obj.layout26); obj.label39:setLeft(0); obj.label39:setTop(230); obj.label39:setWidth(220); obj.label39:setHeight(20); obj.label39:setText("Ataques"); obj.label39:setHorzTextAlign("center"); obj.label39:setName("label39"); obj.layout34 = GUI.fromHandle(_obj_newObject("layout")); obj.layout34:setParent(obj.layout26); obj.layout34:setLeft(5); obj.layout34:setTop(250); obj.layout34:setWidth(250); obj.layout34:setHeight(25); obj.layout34:setName("layout34"); obj.button25 = GUI.fromHandle(_obj_newObject("button")); obj.button25:setParent(obj.layout34); obj.button25:setLeft(0); obj.button25:setTop(0); obj.button25:setWidth(110); obj.button25:setHeight(20); obj.button25:setText("Corpo-a-Corpo"); obj.button25:setHorzTextAlign("center"); obj.button25:setFontSize(13); obj.button25:setName("button25"); obj.rectangle30 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle30:setParent(obj.layout34); obj.rectangle30:setLeft(110); obj.rectangle30:setTop(0); obj.rectangle30:setWidth(100); obj.rectangle30:setHeight(25); obj.rectangle30:setColor("black"); obj.rectangle30:setStrokeColor("white"); obj.rectangle30:setStrokeSize(1); obj.rectangle30:setName("rectangle30"); obj.label40 = GUI.fromHandle(_obj_newObject("label")); obj.label40:setParent(obj.layout34); obj.label40:setLeft(110); obj.label40:setTop(0); obj.label40:setWidth(100); obj.label40:setHeight(25); obj.label40:setHorzTextAlign("center"); obj.label40:setField("roll_ataques_cac"); obj.label40:setName("label40"); obj.edit25 = GUI.fromHandle(_obj_newObject("edit")); obj.edit25:setParent(obj.layout34); obj.edit25:setLeft(210); obj.edit25:setTop(0); obj.edit25:setWidth(40); obj.edit25:setHeight(25); obj.edit25:setHorzTextAlign("center"); obj.edit25:setField("extra_ataques_cac"); obj.edit25:setName("edit25"); obj.dataLink25 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink25:setParent(obj.layout34); obj.dataLink25:setFields({'atr_efetivo_for', 'empty', 'extra_ataques_cac'}); obj.dataLink25:setName("dataLink25"); obj.layout35 = GUI.fromHandle(_obj_newObject("layout")); obj.layout35:setParent(obj.layout26); obj.layout35:setLeft(5); obj.layout35:setTop(275); obj.layout35:setWidth(250); obj.layout35:setHeight(25); obj.layout35:setName("layout35"); obj.button26 = GUI.fromHandle(_obj_newObject("button")); obj.button26:setParent(obj.layout35); obj.button26:setLeft(0); obj.button26:setTop(0); obj.button26:setWidth(110); obj.button26:setHeight(20); obj.button26:setText("À Distancia"); obj.button26:setHorzTextAlign("center"); obj.button26:setFontSize(13); obj.button26:setName("button26"); obj.rectangle31 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle31:setParent(obj.layout35); obj.rectangle31:setLeft(110); obj.rectangle31:setTop(0); obj.rectangle31:setWidth(100); obj.rectangle31:setHeight(25); obj.rectangle31:setColor("black"); obj.rectangle31:setStrokeColor("white"); obj.rectangle31:setStrokeSize(1); obj.rectangle31:setName("rectangle31"); obj.label41 = GUI.fromHandle(_obj_newObject("label")); obj.label41:setParent(obj.layout35); obj.label41:setLeft(110); obj.label41:setTop(0); obj.label41:setWidth(100); obj.label41:setHeight(25); obj.label41:setHorzTextAlign("center"); obj.label41:setField("roll_ataques_dist"); obj.label41:setName("label41"); obj.edit26 = GUI.fromHandle(_obj_newObject("edit")); obj.edit26:setParent(obj.layout35); obj.edit26:setLeft(210); obj.edit26:setTop(0); obj.edit26:setWidth(40); obj.edit26:setHeight(25); obj.edit26:setHorzTextAlign("center"); obj.edit26:setField("extra_ataques_dist"); obj.edit26:setName("edit26"); obj.dataLink26 = GUI.fromHandle(_obj_newObject("dataLink")); obj.dataLink26:setParent(obj.layout35); obj.dataLink26:setFields({'atr_efetivo_pf', 'empty', 'extra_ataques_dist'}); obj.dataLink26:setName("dataLink26"); obj.layout36 = GUI.fromHandle(_obj_newObject("layout")); obj.layout36:setParent(obj.scrollBox1); obj.layout36:setLeft(270); obj.layout36:setTop(190); obj.layout36:setWidth(485); obj.layout36:setHeight(425); obj.layout36:setName("layout36"); obj.rectangle32 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle32:setParent(obj.layout36); obj.rectangle32:setAlign("client"); obj.rectangle32:setColor("black"); obj.rectangle32:setXradius(5); obj.rectangle32:setYradius(5); obj.rectangle32:setCornerType("round"); obj.rectangle32:setName("rectangle32"); obj.label42 = GUI.fromHandle(_obj_newObject("label")); obj.label42:setParent(obj.layout36); obj.label42:setLeft(0); obj.label42:setTop(0); obj.label42:setWidth(485); obj.label42:setHeight(20); obj.label42:setText("Habilidades"); obj.label42:setHorzTextAlign("center"); obj.label42:setName("label42"); obj.rclHabilidadesIniciaisPequeno = GUI.fromHandle(_obj_newObject("recordList")); obj.rclHabilidadesIniciaisPequeno:setParent(obj.layout36); obj.rclHabilidadesIniciaisPequeno:setName("rclHabilidadesIniciaisPequeno"); obj.rclHabilidadesIniciaisPequeno:setField("campoDosHabilidadesIniciais"); obj.rclHabilidadesIniciaisPequeno:setTemplateForm("frmAMZ3_1"); obj.rclHabilidadesIniciaisPequeno:setLeft(5); obj.rclHabilidadesIniciaisPequeno:setTop(25); obj.rclHabilidadesIniciaisPequeno:setWidth(475); obj.rclHabilidadesIniciaisPequeno:setHeight(395); obj.rclHabilidadesIniciaisPequeno:setLayout("vertical"); obj._e_event0 = obj.button1:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_des) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_des = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Destreza (DES) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackdes); end, obj); obj._e_event1 = obj.dataLink1:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_des) or 0) + (tonumber(sheet.atr_bonus_des) or 0); sheet.atr_efetivo_des = total; end; end, obj); obj._e_event2 = obj.button2:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_per) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_per = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Percepção (PER) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackper); end, obj); obj._e_event3 = obj.dataLink2:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_per) or 0) + (tonumber(sheet.atr_bonus_per) or 0); sheet.atr_efetivo_per = total; end; end, obj); obj._e_event4 = obj.button3:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_int) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_int = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Inteligência (INT) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackint); end, obj); obj._e_event5 = obj.dataLink3:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_int) or 0) + (tonumber(sheet.atr_bonus_int) or 0); sheet.atr_efetivo_int = total; end; end, obj); obj._e_event6 = obj.button4:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_con) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_con = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Concentração (CON) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackcon); end, obj); obj._e_event7 = obj.dataLink4:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_con) or 0) + (tonumber(sheet.atr_bonus_con) or 0); sheet.atr_efetivo_con = total; end; end, obj); obj._e_event8 = obj.button5:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_fv) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_fv = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Força de Vontade (FV) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackfv); end, obj); obj._e_event9 = obj.dataLink5:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_fv) or 0) + (tonumber(sheet.atr_bonus_fv) or 0); sheet.atr_efetivo_fv = total; end; end, obj); obj._e_event10 = obj.button6:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_mir) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_mir = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Mira (MIR) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackmir); end, obj); obj._e_event11 = obj.dataLink6:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_mir) or 0) + (tonumber(sheet.atr_bonus_mir) or 0); sheet.atr_efetivo_mir = total; end; end, obj); obj._e_event12 = obj.button7:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_rac) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_rac = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Raciocínio (RAC) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackrac); end, obj); obj._e_event13 = obj.dataLink7:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_rac) or 0) + (tonumber(sheet.atr_bonus_rac) or 0); sheet.atr_efetivo_rac = total; end; end, obj); obj._e_event14 = obj.button8:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_ref) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_ref = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Reflexo (REF) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackref); end, obj); obj._e_event15 = obj.dataLink8:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_ref) or 0) + (tonumber(sheet.atr_bonus_ref) or 0); sheet.atr_efetivo_ref = total; end; end, obj); obj._e_event16 = obj.button9:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_hab) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_hab = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Habilidade (HAB) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackhab); end, obj); obj._e_event17 = obj.dataLink9:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_hab) or 0) + (tonumber(sheet.atr_bonus_hab) or 0); sheet.atr_efetivo_hab = total; end; end, obj); obj._e_event18 = obj.button10:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_for) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_for = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Força (FOR) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackfor); end, obj); obj._e_event19 = obj.dataLink10:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_for) or 0) + (tonumber(sheet.atr_bonus_for) or 0); sheet.atr_efetivo_for = total; end; end, obj); obj._e_event20 = obj.button11:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_vel) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_vel = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Velocidade (VEL) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackvel); end, obj); obj._e_event21 = obj.dataLink11:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_vel) or 0) + (tonumber(sheet.atr_bonus_vel) or 0); sheet.atr_efetivo_vel = total; end; end, obj); obj._e_event22 = obj.button12:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_maq) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_maq = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Maquinário (MAQ) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackmaq); end, obj); obj._e_event23 = obj.dataLink12:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_maq) or 0) + (tonumber(sheet.atr_bonus_maq) or 0); sheet.atr_efetivo_maq = total; end; end, obj); obj._e_event24 = obj.button13:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_ce) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_ce = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Construção Elemental (CE) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackce); end, obj); obj._e_event25 = obj.dataLink13:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_ce) or 0) + (tonumber(sheet.atr_bonus_ce) or 0); sheet.atr_efetivo_ce = total; end; end, obj); obj._e_event26 = obj.button14:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_pf) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_pf = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Poder de Fogo (PF) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackpf); end, obj); obj._e_event27 = obj.dataLink14:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_pf) or 0) + (tonumber(sheet.atr_bonus_pf) or 0); sheet.atr_efetivo_pf = total; end; end, obj); obj._e_event28 = obj.button15:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_agi) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_agi = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Agilidade (AGI) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackagi); end, obj); obj._e_event29 = obj.dataLink15:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_agi) or 0) + (tonumber(sheet.atr_bonus_agi) or 0); sheet.atr_efetivo_agi = total; end; end, obj); obj._e_event30 = obj.button16:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_res) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_res = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Resistência (RES) " .. atributo .. " (" .. chance .. "%)", rolagemCallbackres); end, obj); obj._e_event31 = obj.dataLink16:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_res) or 0) + (tonumber(sheet.atr_bonus_res) or 0); sheet.atr_efetivo_res = total; end; end, obj); obj._e_event32 = obj.button17:addEventListener("onClick", function (_) local atributo = (tonumber(sheet.atr_efetivo_voo) or 0); local chance = 30; if atributo > 95 then chance = 100; else local p1 = math.min(atributo, 25); local p2 = math.max(math.min(atributo-25, 20), 0); local p3 = math.max(math.min(atributo-45, 50), 0); chance = 30 + p1 + (p2 * 0.75) + (p3 * 0.5); end; sheet.chance_voo = chance; local rolagem = rrpg.interpretarRolagem("1d100"); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Voo " .. atributo .. " (" .. chance .. "%)", rolagemCallbackvoo); end, obj); obj._e_event33 = obj.dataLink17:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet~=nil then local total = (tonumber(sheet.atr_total_voo) or 0) + (tonumber(sheet.atr_bonus_voo) or 0); sheet.atr_efetivo_voo = total; end; end, obj); obj._e_event34 = obj.button18:addEventListener("onClick", function (_) local roll = sheet.roll_iniciativa or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Iniciativa", rolagemCallback); end, obj); obj._e_event35 = obj.dataLink18:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_ref) or 0; local f2 = tonumber(sheet.atr_efetivo_agi) or 0; local f3 = tonumber(sheet.extra_iniciativa) or 0; local mod = f1 + f2 + f3; sheet.roll_iniciativa = "1d20 + " .. mod; end, obj); obj._e_event36 = obj.button19:addEventListener("onClick", function (_) local roll = sheet.roll_acertos_cac or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Ataque Corp.", rolagemCallback); end, obj); obj._e_event37 = obj.dataLink19:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_des) or 0; local f2 = tonumber(sheet.atr_efetivo_vel) or 0; local f3 = tonumber(sheet.extra_acertos_cac) or 0; local mod = f1 + f2 + f3; sheet.roll_acertos_cac = "1d20 + " .. mod; end, obj); obj._e_event38 = obj.button20:addEventListener("onClick", function (_) local roll = sheet.roll_acertos_dist or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Ataque a Dist.", rolagemCallback); end, obj); obj._e_event39 = obj.dataLink20:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_mir) or 0; local f2 = tonumber(sheet.atr_efetivo_agi) or 0; local f3 = tonumber(sheet.extra_acertos_dist) or 0; local mod = f1 + f2 + f3; sheet.roll_acertos_dist = "1d20 + " .. mod; end, obj); obj._e_event40 = obj.button21:addEventListener("onClick", function (_) local roll = sheet.roll_acertos_bloqueio or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Bloqueio", rolagemCallback); end, obj); obj._e_event41 = obj.dataLink21:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_ref) or 0; local f2 = tonumber(sheet.atr_efetivo_vel) or 0; local f3 = tonumber(sheet.extra_acertos_bloqueio) or 0; local mod = f1 + f2 + f3; sheet.roll_acertos_bloqueio = "1d20 + " .. mod; end, obj); obj._e_event42 = obj.button22:addEventListener("onClick", function (_) local roll = sheet.roll_acertos_escape or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Escape", rolagemCallback); end, obj); obj._e_event43 = obj.dataLink22:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_per) or 0; local f2 = tonumber(sheet.atr_efetivo_agi) or 0; local f3 = tonumber(sheet.extra_acertos_escape) or 0; local mod = f1 + f2 + f3; sheet.roll_acertos_escape = "1d20 + " .. mod; end, obj); obj._e_event44 = obj.button23:addEventListener("onClick", function (_) local roll = sheet.roll_acertos_agarrao or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Agarrão", rolagemCallback); end, obj); obj._e_event45 = obj.dataLink23:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_for) or 0; local f2 = tonumber(sheet.atr_efetivo_des) or 0; local f3 = tonumber(sheet.extra_acertos_agarrao) or 0; local mod = f1 + f2 + f3; sheet.roll_acertos_agarrao = "1d10 + " .. mod; end, obj); obj._e_event46 = obj.button24:addEventListener("onClick", function (_) local roll = sheet.roll_acertos_counter or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Counter", rolagemCallback); end, obj); obj._e_event47 = obj.dataLink24:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_hab) or 0; local f2 = tonumber(sheet.atr_efetivo_vel) or 0; local f3 = tonumber(sheet.extra_acertos_counter) or 0; local mod = f1 + f2 + f3; sheet.roll_acertos_counter = "1d20 + " .. mod; end, obj); obj._e_event48 = obj.button25:addEventListener("onClick", function (_) local roll = sheet.roll_ataques_cac or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de Corpo-a-Corpo", rolagemCallback); end, obj); obj._e_event49 = obj.dataLink25:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_for) or 0; local f2 = tonumber(sheet.empty) or 0; local f3 = tonumber(sheet.extra_ataques_cac) or 0; local mod = f1 + f2 + f3; sheet.roll_ataques_cac = "1d10 + " .. mod; end, obj); obj._e_event50 = obj.button26:addEventListener("onClick", function (_) local roll = sheet.roll_ataques_dist or "1d1-1"; local rolagem = rrpg.interpretarRolagem(roll); local mesa = rrpg.getMesaDe(sheet); mesa.activeChat:rolarDados(rolagem, "Teste de À Distancia", rolagemCallback); end, obj); obj._e_event51 = obj.dataLink26:addEventListener("onChange", function (_, field, oldValue, newValue) if sheet == nil then return end; local f1 = tonumber(sheet.atr_efetivo_pf) or 0; local f2 = tonumber(sheet.empty) or 0; local f3 = tonumber(sheet.extra_ataques_dist) or 0; local mod = f1 + f2 + f3; sheet.roll_ataques_dist = "1d10 + " .. mod; end, obj); function obj:_releaseEvents() __o_rrpgObjs.removeEventListenerById(self._e_event51); __o_rrpgObjs.removeEventListenerById(self._e_event50); __o_rrpgObjs.removeEventListenerById(self._e_event49); __o_rrpgObjs.removeEventListenerById(self._e_event48); __o_rrpgObjs.removeEventListenerById(self._e_event47); __o_rrpgObjs.removeEventListenerById(self._e_event46); __o_rrpgObjs.removeEventListenerById(self._e_event45); __o_rrpgObjs.removeEventListenerById(self._e_event44); __o_rrpgObjs.removeEventListenerById(self._e_event43); __o_rrpgObjs.removeEventListenerById(self._e_event42); __o_rrpgObjs.removeEventListenerById(self._e_event41); __o_rrpgObjs.removeEventListenerById(self._e_event40); __o_rrpgObjs.removeEventListenerById(self._e_event39); __o_rrpgObjs.removeEventListenerById(self._e_event38); __o_rrpgObjs.removeEventListenerById(self._e_event37); __o_rrpgObjs.removeEventListenerById(self._e_event36); __o_rrpgObjs.removeEventListenerById(self._e_event35); __o_rrpgObjs.removeEventListenerById(self._e_event34); __o_rrpgObjs.removeEventListenerById(self._e_event33); __o_rrpgObjs.removeEventListenerById(self._e_event32); __o_rrpgObjs.removeEventListenerById(self._e_event31); __o_rrpgObjs.removeEventListenerById(self._e_event30); __o_rrpgObjs.removeEventListenerById(self._e_event29); __o_rrpgObjs.removeEventListenerById(self._e_event28); __o_rrpgObjs.removeEventListenerById(self._e_event27); __o_rrpgObjs.removeEventListenerById(self._e_event26); __o_rrpgObjs.removeEventListenerById(self._e_event25); __o_rrpgObjs.removeEventListenerById(self._e_event24); __o_rrpgObjs.removeEventListenerById(self._e_event23); __o_rrpgObjs.removeEventListenerById(self._e_event22); __o_rrpgObjs.removeEventListenerById(self._e_event21); __o_rrpgObjs.removeEventListenerById(self._e_event20); __o_rrpgObjs.removeEventListenerById(self._e_event19); __o_rrpgObjs.removeEventListenerById(self._e_event18); __o_rrpgObjs.removeEventListenerById(self._e_event17); __o_rrpgObjs.removeEventListenerById(self._e_event16); __o_rrpgObjs.removeEventListenerById(self._e_event15); __o_rrpgObjs.removeEventListenerById(self._e_event14); __o_rrpgObjs.removeEventListenerById(self._e_event13); __o_rrpgObjs.removeEventListenerById(self._e_event12); __o_rrpgObjs.removeEventListenerById(self._e_event11); __o_rrpgObjs.removeEventListenerById(self._e_event10); __o_rrpgObjs.removeEventListenerById(self._e_event9); __o_rrpgObjs.removeEventListenerById(self._e_event8); __o_rrpgObjs.removeEventListenerById(self._e_event7); __o_rrpgObjs.removeEventListenerById(self._e_event6); __o_rrpgObjs.removeEventListenerById(self._e_event5); __o_rrpgObjs.removeEventListenerById(self._e_event4); __o_rrpgObjs.removeEventListenerById(self._e_event3); __o_rrpgObjs.removeEventListenerById(self._e_event2); __o_rrpgObjs.removeEventListenerById(self._e_event1); __o_rrpgObjs.removeEventListenerById(self._e_event0); end; obj._oldLFMDestroy = obj.destroy; function obj:destroy() self:_releaseEvents(); if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then self:setNodeDatabase(nil); end; if self.edit20 ~= nil then self.edit20:destroy(); self.edit20 = nil; end; if self.label33 ~= nil then self.label33:destroy(); self.label33 = nil; end; if self.rectangle11 ~= nil then self.rectangle11:destroy(); self.rectangle11 = nil; end; if self.label14 ~= nil then self.label14:destroy(); self.label14 = nil; end; if self.button15 ~= nil then self.button15:destroy(); self.button15 = nil; end; if self.layout15 ~= nil then self.layout15:destroy(); self.layout15 = nil; end; if self.layout10 ~= nil then self.layout10:destroy(); self.layout10 = nil; end; if self.rectangle9 ~= nil then self.rectangle9:destroy(); self.rectangle9 = nil; end; if self.edit9 ~= nil then self.edit9:destroy(); self.edit9 = nil; end; if self.label40 ~= nil then self.label40:destroy(); self.label40 = nil; end; if self.dataLink4 ~= nil then self.dataLink4:destroy(); self.dataLink4 = nil; end; if self.layout30 ~= nil then self.layout30:destroy(); self.layout30 = nil; end; if self.layout17 ~= nil then self.layout17:destroy(); self.layout17 = nil; end; if self.edit7 ~= nil then self.edit7:destroy(); self.edit7 = nil; end; if self.edit12 ~= nil then self.edit12:destroy(); self.edit12 = nil; end; if self.rectangle21 ~= nil then self.rectangle21:destroy(); self.rectangle21 = nil; end; if self.label26 ~= nil then self.label26:destroy(); self.label26 = nil; end; if self.rectangle16 ~= nil then self.rectangle16:destroy(); self.rectangle16 = nil; end; if self.dataLink13 ~= nil then self.dataLink13:destroy(); self.dataLink13 = nil; end; if self.button16 ~= nil then self.button16:destroy(); self.button16 = nil; end; if self.dataLink10 ~= nil then self.dataLink10:destroy(); self.dataLink10 = nil; end; if self.button2 ~= nil then self.button2:destroy(); self.button2 = nil; end; if self.label22 ~= nil then self.label22:destroy(); self.label22 = nil; end; if self.label23 ~= nil then self.label23:destroy(); self.label23 = nil; end; if self.rectangle19 ~= nil then self.rectangle19:destroy(); self.rectangle19 = nil; end; if self.layout13 ~= nil then self.layout13:destroy(); self.layout13 = nil; end; if self.layout3 ~= nil then self.layout3:destroy(); self.layout3 = nil; end; if self.dataLink5 ~= nil then self.dataLink5:destroy(); self.dataLink5 = nil; end; if self.label13 ~= nil then self.label13:destroy(); self.label13 = nil; end; if self.layout8 ~= nil then self.layout8:destroy(); self.layout8 = nil; end; if self.rectangle10 ~= nil then self.rectangle10:destroy(); self.rectangle10 = nil; end; if self.layout1 ~= nil then self.layout1:destroy(); self.layout1 = nil; end; if self.label24 ~= nil then self.label24:destroy(); self.label24 = nil; end; if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end; if self.layout23 ~= nil then self.layout23:destroy(); self.layout23 = nil; end; if self.label27 ~= nil then self.label27:destroy(); self.label27 = nil; end; if self.layout24 ~= nil then self.layout24:destroy(); self.layout24 = nil; end; if self.rectangle22 ~= nil then self.rectangle22:destroy(); self.rectangle22 = nil; end; if self.dataLink18 ~= nil then self.dataLink18:destroy(); self.dataLink18 = nil; end; if self.rectangle5 ~= nil then self.rectangle5:destroy(); self.rectangle5 = nil; end; if self.label32 ~= nil then self.label32:destroy(); self.label32 = nil; end; if self.layout12 ~= nil then self.layout12:destroy(); self.layout12 = nil; end; if self.edit14 ~= nil then self.edit14:destroy(); self.edit14 = nil; end; if self.button20 ~= nil then self.button20:destroy(); self.button20 = nil; end; if self.button1 ~= nil then self.button1:destroy(); self.button1 = nil; end; if self.dataLink8 ~= nil then self.dataLink8:destroy(); self.dataLink8 = nil; end; if self.edit4 ~= nil then self.edit4:destroy(); self.edit4 = nil; end; if self.layout25 ~= nil then self.layout25:destroy(); self.layout25 = nil; end; if self.label8 ~= nil then self.label8:destroy(); self.label8 = nil; end; if self.label35 ~= nil then self.label35:destroy(); self.label35 = nil; end; if self.dataLink21 ~= nil then self.dataLink21:destroy(); self.dataLink21 = nil; end; if self.dataLink14 ~= nil then self.dataLink14:destroy(); self.dataLink14 = nil; end; if self.label4 ~= nil then self.label4:destroy(); self.label4 = nil; end; if self.label6 ~= nil then self.label6:destroy(); self.label6 = nil; end; if self.layout9 ~= nil then self.layout9:destroy(); self.layout9 = nil; end; if self.edit11 ~= nil then self.edit11:destroy(); self.edit11 = nil; end; if self.label31 ~= nil then self.label31:destroy(); self.label31 = nil; end; if self.rectangle17 ~= nil then self.rectangle17:destroy(); self.rectangle17 = nil; end; if self.edit19 ~= nil then self.edit19:destroy(); self.edit19 = nil; end; if self.edit5 ~= nil then self.edit5:destroy(); self.edit5 = nil; end; if self.button13 ~= nil then self.button13:destroy(); self.button13 = nil; end; if self.label34 ~= nil then self.label34:destroy(); self.label34 = nil; end; if self.rectangle25 ~= nil then self.rectangle25:destroy(); self.rectangle25 = nil; end; if self.label15 ~= nil then self.label15:destroy(); self.label15 = nil; end; if self.dataLink9 ~= nil then self.dataLink9:destroy(); self.dataLink9 = nil; end; if self.dataLink23 ~= nil then self.dataLink23:destroy(); self.dataLink23 = nil; end; if self.rectangle29 ~= nil then self.rectangle29:destroy(); self.rectangle29 = nil; end; if self.edit24 ~= nil then self.edit24:destroy(); self.edit24 = nil; end; if self.layout32 ~= nil then self.layout32:destroy(); self.layout32 = nil; end; if self.dataLink19 ~= nil then self.dataLink19:destroy(); self.dataLink19 = nil; end; if self.label37 ~= nil then self.label37:destroy(); self.label37 = nil; end; if self.label41 ~= nil then self.label41:destroy(); self.label41 = nil; end; if self.edit26 ~= nil then self.edit26:destroy(); self.edit26 = nil; end; if self.rectangle15 ~= nil then self.rectangle15:destroy(); self.rectangle15 = nil; end; if self.layout26 ~= nil then self.layout26:destroy(); self.layout26 = nil; end; if self.label12 ~= nil then self.label12:destroy(); self.label12 = nil; end; if self.button22 ~= nil then self.button22:destroy(); self.button22 = nil; end; if self.edit8 ~= nil then self.edit8:destroy(); self.edit8 = nil; end; if self.layout27 ~= nil then self.layout27:destroy(); self.layout27 = nil; end; if self.layout36 ~= nil then self.layout36:destroy(); self.layout36 = nil; end; if self.rclHabilidadesIniciaisPequeno ~= nil then self.rclHabilidadesIniciaisPequeno:destroy(); self.rclHabilidadesIniciaisPequeno = nil; end; if self.rectangle28 ~= nil then self.rectangle28:destroy(); self.rectangle28 = nil; end; if self.layout28 ~= nil then self.layout28:destroy(); self.layout28 = nil; end; if self.label16 ~= nil then self.label16:destroy(); self.label16 = nil; end; if self.button21 ~= nil then self.button21:destroy(); self.button21 = nil; end; if self.layout19 ~= nil then self.layout19:destroy(); self.layout19 = nil; end; if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end; if self.rectangle8 ~= nil then self.rectangle8:destroy(); self.rectangle8 = nil; end; if self.label9 ~= nil then self.label9:destroy(); self.label9 = nil; end; if self.edit10 ~= nil then self.edit10:destroy(); self.edit10 = nil; end; if self.edit16 ~= nil then self.edit16:destroy(); self.edit16 = nil; end; if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end; if self.label28 ~= nil then self.label28:destroy(); self.label28 = nil; end; if self.dataLink17 ~= nil then self.dataLink17:destroy(); self.dataLink17 = nil; end; if self.button26 ~= nil then self.button26:destroy(); self.button26 = nil; end; if self.rectangle26 ~= nil then self.rectangle26:destroy(); self.rectangle26 = nil; end; if self.button4 ~= nil then self.button4:destroy(); self.button4 = nil; end; if self.dataLink16 ~= nil then self.dataLink16:destroy(); self.dataLink16 = nil; end; if self.edit21 ~= nil then self.edit21:destroy(); self.edit21 = nil; end; if self.button24 ~= nil then self.button24:destroy(); self.button24 = nil; end; if self.layout34 ~= nil then self.layout34:destroy(); self.layout34 = nil; end; if self.button3 ~= nil then self.button3:destroy(); self.button3 = nil; end; if self.label1 ~= nil then self.label1:destroy(); self.label1 = nil; end; if self.layout4 ~= nil then self.layout4:destroy(); self.layout4 = nil; end; if self.rectangle7 ~= nil then self.rectangle7:destroy(); self.rectangle7 = nil; end; if self.label42 ~= nil then self.label42:destroy(); self.label42 = nil; end; if self.button7 ~= nil then self.button7:destroy(); self.button7 = nil; end; if self.rectangle20 ~= nil then self.rectangle20:destroy(); self.rectangle20 = nil; end; if self.label17 ~= nil then self.label17:destroy(); self.label17 = nil; end; if self.button23 ~= nil then self.button23:destroy(); self.button23 = nil; end; if self.dataLink20 ~= nil then self.dataLink20:destroy(); self.dataLink20 = nil; end; if self.edit13 ~= nil then self.edit13:destroy(); self.edit13 = nil; end; if self.dataLink24 ~= nil then self.dataLink24:destroy(); self.dataLink24 = nil; end; if self.layout5 ~= nil then self.layout5:destroy(); self.layout5 = nil; end; if self.layout20 ~= nil then self.layout20:destroy(); self.layout20 = nil; end; if self.edit23 ~= nil then self.edit23:destroy(); self.edit23 = nil; end; if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end; if self.button11 ~= nil then self.button11:destroy(); self.button11 = nil; end; if self.layout18 ~= nil then self.layout18:destroy(); self.layout18 = nil; end; if self.dataLink3 ~= nil then self.dataLink3:destroy(); self.dataLink3 = nil; end; if self.rectangle27 ~= nil then self.rectangle27:destroy(); self.rectangle27 = nil; end; if self.button12 ~= nil then self.button12:destroy(); self.button12 = nil; end; if self.label29 ~= nil then self.label29:destroy(); self.label29 = nil; end; if self.button6 ~= nil then self.button6:destroy(); self.button6 = nil; end; if self.dataLink7 ~= nil then self.dataLink7:destroy(); self.dataLink7 = nil; end; if self.rectangle2 ~= nil then self.rectangle2:destroy(); self.rectangle2 = nil; end; if self.rectangle3 ~= nil then self.rectangle3:destroy(); self.rectangle3 = nil; end; if self.button5 ~= nil then self.button5:destroy(); self.button5 = nil; end; if self.rectangle6 ~= nil then self.rectangle6:destroy(); self.rectangle6 = nil; end; if self.label21 ~= nil then self.label21:destroy(); self.label21 = nil; end; if self.rectangle23 ~= nil then self.rectangle23:destroy(); self.rectangle23 = nil; end; if self.label36 ~= nil then self.label36:destroy(); self.label36 = nil; end; if self.dataLink22 ~= nil then self.dataLink22:destroy(); self.dataLink22 = nil; end; if self.dataLink6 ~= nil then self.dataLink6:destroy(); self.dataLink6 = nil; end; if self.label30 ~= nil then self.label30:destroy(); self.label30 = nil; end; if self.dataLink26 ~= nil then self.dataLink26:destroy(); self.dataLink26 = nil; end; if self.dataLink2 ~= nil then self.dataLink2:destroy(); self.dataLink2 = nil; end; if self.layout31 ~= nil then self.layout31:destroy(); self.layout31 = nil; end; if self.label10 ~= nil then self.label10:destroy(); self.label10 = nil; end; if self.label19 ~= nil then self.label19:destroy(); self.label19 = nil; end; if self.button10 ~= nil then self.button10:destroy(); self.button10 = nil; end; if self.layout2 ~= nil then self.layout2:destroy(); self.layout2 = nil; end; if self.button17 ~= nil then self.button17:destroy(); self.button17 = nil; end; if self.dataLink15 ~= nil then self.dataLink15:destroy(); self.dataLink15 = nil; end; if self.edit17 ~= nil then self.edit17:destroy(); self.edit17 = nil; end; if self.rectangle12 ~= nil then self.rectangle12:destroy(); self.rectangle12 = nil; end; if self.button25 ~= nil then self.button25:destroy(); self.button25 = nil; end; if self.rectangle30 ~= nil then self.rectangle30:destroy(); self.rectangle30 = nil; end; if self.layout29 ~= nil then self.layout29:destroy(); self.layout29 = nil; end; if self.label39 ~= nil then self.label39:destroy(); self.label39 = nil; end; if self.layout35 ~= nil then self.layout35:destroy(); self.layout35 = nil; end; if self.rectangle31 ~= nil then self.rectangle31:destroy(); self.rectangle31 = nil; end; if self.label11 ~= nil then self.label11:destroy(); self.label11 = nil; end; if self.layout11 ~= nil then self.layout11:destroy(); self.layout11 = nil; end; if self.label3 ~= nil then self.label3:destroy(); self.label3 = nil; end; if self.label20 ~= nil then self.label20:destroy(); self.label20 = nil; end; if self.edit15 ~= nil then self.edit15:destroy(); self.edit15 = nil; end; if self.button9 ~= nil then self.button9:destroy(); self.button9 = nil; end; if self.rectangle18 ~= nil then self.rectangle18:destroy(); self.rectangle18 = nil; end; if self.rectangle14 ~= nil then self.rectangle14:destroy(); self.rectangle14 = nil; end; if self.edit6 ~= nil then self.edit6:destroy(); self.edit6 = nil; end; if self.label25 ~= nil then self.label25:destroy(); self.label25 = nil; end; if self.label7 ~= nil then self.label7:destroy(); self.label7 = nil; end; if self.button8 ~= nil then self.button8:destroy(); self.button8 = nil; end; if self.button18 ~= nil then self.button18:destroy(); self.button18 = nil; end; if self.label18 ~= nil then self.label18:destroy(); self.label18 = nil; end; if self.label2 ~= nil then self.label2:destroy(); self.label2 = nil; end; if self.edit22 ~= nil then self.edit22:destroy(); self.edit22 = nil; end; if self.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end; if self.layout33 ~= nil then self.layout33:destroy(); self.layout33 = nil; end; if self.label5 ~= nil then self.label5:destroy(); self.label5 = nil; end; if self.layout6 ~= nil then self.layout6:destroy(); self.layout6 = nil; end; if self.label38 ~= nil then self.label38:destroy(); self.label38 = nil; end; if self.rectangle4 ~= nil then self.rectangle4:destroy(); self.rectangle4 = nil; end; if self.rectangle13 ~= nil then self.rectangle13:destroy(); self.rectangle13 = nil; end; if self.dataLink11 ~= nil then self.dataLink11:destroy(); self.dataLink11 = nil; end; if self.layout22 ~= nil then self.layout22:destroy(); self.layout22 = nil; end; if self.layout14 ~= nil then self.layout14:destroy(); self.layout14 = nil; end; if self.rectangle32 ~= nil then self.rectangle32:destroy(); self.rectangle32 = nil; end; if self.layout16 ~= nil then self.layout16:destroy(); self.layout16 = nil; end; if self.layout21 ~= nil then self.layout21:destroy(); self.layout21 = nil; end; if self.button19 ~= nil then self.button19:destroy(); self.button19 = nil; end; if self.button14 ~= nil then self.button14:destroy(); self.button14 = nil; end; if self.edit18 ~= nil then self.edit18:destroy(); self.edit18 = nil; end; if self.edit25 ~= nil then self.edit25:destroy(); self.edit25 = nil; end; if self.scrollBox1 ~= nil then self.scrollBox1:destroy(); self.scrollBox1 = nil; end; if self.dataLink25 ~= nil then self.dataLink25:destroy(); self.dataLink25 = nil; end; if self.layout7 ~= nil then self.layout7:destroy(); self.layout7 = nil; end; if self.rectangle24 ~= nil then self.rectangle24:destroy(); self.rectangle24 = nil; end; if self.dataLink12 ~= nil then self.dataLink12:destroy(); self.dataLink12 = nil; end; self:_oldLFMDestroy(); end; obj:endUpdate(); return obj; end; function newfrmAMZ3() local retObj = nil; __o_rrpgObjs.beginObjectsLoading(); __o_Utils.tryFinally( function() retObj = constructNew_frmAMZ3(); end, function() __o_rrpgObjs.endObjectsLoading(); end); assert(retObj ~= nil); return retObj; end; local _frmAMZ3 = { newEditor = newfrmAMZ3, new = newfrmAMZ3, name = "frmAMZ3", dataType = "", formType = "undefined", formComponentName = "form", title = "", description=""}; frmAMZ3 = _frmAMZ3; Firecast.registrarForm(_frmAMZ3); return _frmAMZ3;
------------------------------------------------ ----[ GOTO PLAYER ]--------------------- ------------------------------------------------ local Goto = SS.Commands:New("Goto") // Branch flag SS.Flags.Branch("Fun", "Goto") // Goto command function Goto.Command(Player, Args) local Person, Error = SS.Lib.Find(Args[1]) if Person then Player:SetPos(Person:GetPos()) SS.PlayerMessage(Player, "You have teleported to "..Person:Name().."!", 1) else SS.PlayerMessage(Player, Error, 1) end end Goto:Create(Goto.Command, {"administrator", "fun", "goto"}, "Goto somebody", "<Player>", 1, " ")
platform "POSIX" addoption("cxxflags", "-Wno-unused-function") files { "../external/freebsd/realpath.cpp", "src/platform/posix/platform_posix.cpp", } if checkplatform("OSX") then --Nothing extra for now else libs { "-lrt", } end platform_end()
-- Google Search over the AJAX API. -- -- Expects a valid google API key in the config table. -- -- Example: -- config = { -- ... -- googleAPIKey = 'valid key here', -- ... -- } local x0 = require'x0' local simplehttp = require'simplehttp' local json = require'json' local html2unicode = require'html' local utify8 = function(str) str = str:gsub("\\u(....)", function(n) n = tonumber(n, 16) if(n < 128) then return string.char(n) elseif(n < 2048) then return string.char(192 + ((n - (n % 64)) / 64), 128 + (n % 64)) else return string.char(224 + ((n - (n % 4096)) / 4096), 128 + (((n % 4096) - (n % 64)) / 64), 128 + (n % 64)) end end) return str end local urlEncode = function(str) return str:gsub( '([^%w ])', function (c) return string.format ("%%%02X", string.byte(c)) end ):gsub(' ', '+') end local outFormat = '\002%s\002 <%s>' local parseData = function(say, source, destination, data) data = utify8(data) data = json.decode(data) if(data and data.responseStatus == 200) then local arr = {} local n = 0 for i=1,3 do local match = data.responseData.results[i] if(not match) then break end local title = html2unicode(match.titleNoFormatting) local url = match.unescapedUrl if(#url >= 75) then n = n + 1 x0.lookup(url, function(short) n = n - 1 arr[i] = outFormat:format(title, short or url) if(n == 0) then say(table.concat(arr, ' || ')) end end) else arr[i] = outFormat:format(title, url) end end if(n == 0) then if(#arr > 0) then say(table.concat(arr, ' || ')) else say('jack shit found :-(.') end end end end local url = 'http://www.google.com/uds/GwebSearch?context=0&hl=en&key=%s&v=1.0&q=%s&rsz=small' local handler = function(self, source, destination, input) local search = urlEncode(input) simplehttp( url:format(self.config.googleAPIKey, search), function(data) parseData(say, source, destination, data) end ) end return { PRIVMSG = { ['^%pg (.+)$'] = handler, ['^%pgoogle (.+)$'] = handler, }, }
vim.api.nvim_set_keymap('n', '<space>f', '<Cmd>Telescope find_files<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<space>r', '<Cmd>Telescope live_grep<CR>', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '<space>h', '<Cmd>Telescope buffers<CR>', { noremap = true, silent = true })
n,m = 5,5 startState = { {0,0,0,0,0}, {0,1,0,0,0}, {0,1,0,0,0}, {0,1,0,0,0}, {0,0,0,0,0} } function bool_to_num(v) return v and 1 or 0 end function num_to_bool(v) if v == 0 then return false else return true end end function sleep(n) os.execute("sleep " .. tonumber(n)) end function setMatrixState(state, matrix) for i=1,n do for j=1,m do matrix[i][j].isAlive = num_to_bool(state[i][j]) end end end function createMatrix(n,m) newMatrix = {} -- should it be local & returned value? for i=1, n do newMatrix[i] = {} for j=1, m do newMatrix[i][j] = {isAlive=false}--Cell object end end -- populate cells with 8 neighbours; neighbours population refs is here to avoid calculating neighbours at runtime for i = 2,n - 1 do for j = 2, m - 1 do newMatrix[i][j].neighbours = { newMatrix[i + 1][j], newMatrix[i - 1][j], -- lower and upper cells newMatrix[i][j + 1], newMatrix[i][j - 1], -- right and left cells newMatrix[i - 1][j - 1], newMatrix[i + 1][j + 1], -- diagonal 1 newMatrix[i + 1][j - 1], newMatrix[i - 1][j + 1] -- diagonal 2 } end end --populate corners, not expecting small matrix size newMatrix[n][m].neighbours = { -- lower right cell newMatrix[n - 1][m], newMatrix[n][m - 1], newMatrix[n - 1][m - 1]} newMatrix[n][1].neighbours = { -- lower left cell newMatrix[n - 1][1], newMatrix[n][2], newMatrix[n-1][2]} newMatrix[1][m].neighbours = { -- top right newMatrix[1][m - 1], newMatrix[2][m], newMatrix[2][m - 1]} newMatrix[1][1].neighbours = { -- top left cell newMatrix[1][2], newMatrix[2][1], newMatrix[2][2]} for j = 2,m - 1 do -- populate upper row, 12 .. 14, without corners newMatrix[1][j].neighbours = { newMatrix[1][j + 1], newMatrix[1][j - 1], -- left and right newMatrix[2][j + 1], newMatrix[2][j - 1], -- diagonal bottom left and right newMatrix[2][j] -- below } end for j = 2, m - 1 do -- bottom row w/o corners newMatrix[n][j].neighbours = { newMatrix[n][j - 1], newMatrix[n][j + 1], -- left and right neighbours newMatrix[n - 1][j + 1], newMatrix[n - 1][j - 1], -- diagonal l and r newMatrix[n - 1][j] -- above } end for i = 2, n - 1 do -- rightmost row w/o corners newMatrix[i][m].neighbours = { newMatrix[i + 1][m], newMatrix[i - 1][m], --above and below cells newMatrix[i + 1][m - 1],newMatrix[i - 1][m - 1], -- diagonals newMatrix[i][m - 1] -- cell to the left } end for i = 2, n - 1 do -- leftmost row w/o corners newMatrix[i][1].neighbours = { newMatrix[i + 1][1], newMatrix[i - 1][1], -- above and below newMatrix[i + 1][2], newMatrix[i - 1][2], -- diagonals newMatrix[i][2] -- cell to the right } end return newMatrix end -- end create Matrix function printMatrix(n,m, matrix) for i=1,n do for j=1,m do io.write(tostring(bool_to_num(matrix[i][j].isAlive))..' ') end print() end print('------------') end local currentMatrix = createMatrix(n,m) setMatrixState(startState, currentMatrix) printMatrix(n,m,currentMatrix) local nextMatrix = createMatrix(n,m) print(currentMatrix[1][1].neighbours[3].isAlive) for k, v in ipairs(currentMatrix[1][1].neighbours) do print(k, v.isAlive) end counter = 50 while counter ~= 0 do sleep(1) counter = counter - 1 for i=1,n do for j=1,m do local crowdFactor = 0 for k,v in ipairs(currentMatrix[i][j].neighbours) do if v.isAlive then crowdFactor = crowdFactor + 1 end end -- end for neighbours lookup cycle if crowdFactor < 2 then -- underpopulation, dies nextMatrix[i][j].isAlive = false end if crowdFactor > 3 then -- overcrowded, dies nextMatrix[i][j].isAlive = false end if currentMatrix[i][j].isAlive and crowdFactor == 2 then -- continue to live nextMatrix[i][j].isAlive = true end if crowdFactor == 3 then -- new life born / sustains nextMatrix[i][j].isAlive = true end end -- j for end end -- i for end print('###############') print('Current:') printMatrix(n,m,currentMatrix) print('Next:') printMatrix(n,m,nextMatrix) print('###############') nextMatrix, currentMatrix = currentMatrix, nextMatrix end -- while end --[[ n = 5, m = 5 11 12 13 14 15 21 22 23 24 25 31 32 33 34 35 41 42 43 44 45 51 52 53 54 55 ]]
-- config: (lint (only var:use-discard)) local _, x = print() print(_) x[_] = 0
-------------------------------------------------------------------------------- ----------------------------------- DevDokus ----------------------------------- -------------------------------------------------------------------------------- function DrawCircle(x,y,z,r,g,b,a) Citizen.InvokeNative(0x2A32FAA57B937173, 0x94FDAE17, x, y, z-0.95, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 0.25, r, g, b, a, 0, 0, 2, 0, 0, 0, 0) end function Notify(text, time) TriggerClientEvent("vorp:TipRight", source, text, time) end function Note(text, source, time) TriggerClientEvent("pNotify:SendNotification", source, { text = "<height='40' width='40' style='float:left; margin-bottom:10px; margin-left:20px;' />"..text, type = "success", timeout = time, layout = "centerRight", queue = "right" }) end
function josephus(n, k, m) local positions={} for i=1,n do table.insert(positions, i-1) end local i,j=1,1 local s='Execution order: ' while #positions>m do if j==k then s=s .. positions[i] .. ', ' table.remove(positions, i) i=i-1 end i=i+1 j=j+1 if i>#positions then i=1 end if j>k then j=1 end end print(s:sub(1,#s-2) .. '.') local s='Survivors: ' for _,v in pairs(positions) do s=s .. v .. ', ' end print(s:sub(1,#s-2) .. '.') end josephus(41,3, 1)
--- -- conf.lua function love.conf(t) t.window.title = "Test" t.window.width = 400 t.window.height = 200 end
function Server_StartGame(game, standing) if (not Mod.Settings.startWithCommander) then return end if (game.Settings.LimitDistributionTerritories > 10) then print "allowed only with no more than 4 starts" return end for _, territory in pairs(standing.Territories) do if (not territory.IsNeutral) then local numArmies = territory.NumArmies.NumArmies local newArmies = WL.Armies.Create(numArmies, { WL.Commander.Create(territory.OwnerPlayerID) }); territory.NumArmies = newArmies end end end
include("list.lua") include("frame.lua") include("spawn_menu_frame.lua") include("button.lua") include("spawn_icon.lua") include("list_button.lua") include("playermodel.lua")
{ #include "blocks/0_Lapismarine_Primary.lua" #include "blocks/1_Lapismarine_Secondary.lua" #include "blocks/2_Lapismarine_Tertiary.lua" #include "blocks/3_Ancient.lua" #include "blocks/4_Phage.lua" #include "blocks/5_Nullsetter.lua" #include "blocks/6_Stragegic_Brawler.lua" #include "blocks/7_WE2BoLaX.lua" #include "blocks/8_LGCorp.lua" #include "blocks/9_Outlaw.lua" #include "blocks/10_DSSETRNDD.lua" }
ENT.Type = "anim" ENT.Base = "base_gmodentity" ENT.PrintName = "Laser" ENT.Author = "Pilot2" ENT.Category = "Museum robbery" ENT.Spawnable = true ENT.AdminOnly = true ENT.RenderGroup = RENDERGROUP_BOTH function ENT:SetupDataTables() self:NetworkVar( "Bool", 0, "laserstate" ) end
-- Classic Linked List local Node = require "node" LinkedList = {root = Node:new()} function LinkedList:new(o) o = o or {} self.__index = self setmetatable(o, self) return o end function LinkedList:isempty() return self.root:isempty() end return LinkedList
ffi = require "ffi" require "LDYOM.Scripts.baseNode" class = require "LDYOM.Scripts.middleclass" Node = bitser.registerClass(class("NodeRemoveCounter", BaseNode)); Node.static.name = imgui.imnodes.getNodeIcon("func")..' '..ldyom.langt("CoreNodeRemoveCounter"); function Node:initialize(id) BaseNode.initialize(self,id); self.type = 4; self.Pins = { [self.id+1] = BasePin:new(self.id+1,imgui.imnodes.PinType.void, 0), [self.id+2] = BasePin:new(self.id+2,imgui.imnodes.PinType.number, 0, ffi.new("int[1]")), [self.id+5] = BasePin:new(self.id+5,imgui.imnodes.PinType.void, 1), }; end function Node:draw() imgui.imnodes.BeginNode(self.id,self.type) imgui.imnodes.BeginNodeTitleBar(); imgui.Text(self.class.static.name); if ldyom.getLastNode() == self.id then imgui.SameLine(0,0); imgui.TextColored(imgui.ImVec4.new(1.0,0.0,0.0,1.0)," \xef\x86\x88"); end imgui.imnodes.EndNodeTitleBar(); imgui.imnodes.BeginInputAttribute(self.id+1); imgui.Dummy(imgui.ImVec2:new(0,10)); imgui.imnodes.EndInputAttribute(); imgui.imnodes.BeginInputAttribute(self.id+2); if (self.Pins[self.id+2].link == nil) then imgui.SetNextItemWidth(150); imgui.SliderInt(ldyom.langt("slot"),self.Pins[self.id+2].value, 0, 3, tostring(self.Pins[self.id+2].value[0])); else imgui.Text("slot"); end imgui.imnodes.EndInputAttribute(); imgui.imnodes.BeginOutputAttribute(self.id+5); imgui.Dummy(imgui.ImVec2:new(0,10)); imgui.imnodes.EndOutputAttribute(); imgui.imnodes.EndNode(); end function Node:play(data, mission) local slot = self:getPinValue(self.id+2,data,mission)[0]; ldyom.setLastNode(self.id); ldyom.removeCounterByNode(slot); end ldyom.nodeEditor.addNodeClass("World",Node);
local str = "12ab34,eed,56" local func_itor = string.gmatch(str, "%d+") print("func_itor is", func_itor) print("func_itor ret is ", func_itor()) print("func_itor ret is ", func_itor()) local sourcestr = "hello world from Lua" local index = 1 print("\noutput capture using loop:") for word in string.gmatch(sourcestr, "%a+") do print(index, word) index = index + 1 end local attrstr = "from=world, to=Lua, name=AlbertS" print("\noutput attr pair capture using loop:") for k,v in string.gmatch(attrstr, "(%w+)=(%w+)") do print(k, v) end local nonumstr = "fadfasd,.;p[];'asd" local func_numitor = string.gmatch(nonumstr, "%d+") local numret = func_numitor() print("\nnumret ret is", numret)
local ffi = require("ffi"); local core_interlocked = require("core_interlocked"); SList = {} setmetatable(SList, { __call = function(self, ...) return self:new(...); end, }); SList_mt = { __index = SList; } SList.new = function(self, listHead) local obj = {}; if not listHead then obj.OwnAllocation = true; listHead = ffi.new("SLIST_HEADER"); core_interlocked.InitializeSListHead(listHead); end obj.ListHead = listHead; setmetatable(obj, SList_mt); return obj; end SList.push = function(self, item) core_interlocked.InterlockedPushEntrySList(self.ListHead, ffi.cast("SLIST_ENTRY *",item)); end SList.pop = function(self) return core_interlocked.InterlockedPopEntrySList(self.ListHead); end SList.length = function(self) return core_interlocked.QueryDepthSList(self.ListHead); end return SList;
local M = require('xe.node_def._checker') local CalcParamNum = M.CalcParamNum local CheckName = M.CheckName local CheckVName = M.CheckVName local CheckExpr = M.CheckExpr local CheckPos = M.CheckPos local CheckExprOmit = M.CheckExprOmit local CheckCode = M.CheckCode local CheckParam = M.CheckParam local CheckNonBlank = M.CheckNonBlank local CheckClassName = M.CheckClassName local IsBlank = M.IsBlank local CheckResFileInPack = M.CheckResFileInPack local CheckAnonymous = M.CheckAnonymous local MakeFullPath = M.MakeFullPath local stageGroupName local stagegroup = { { 'Name', 'stagegroup', CheckClassName }, { 'Start life', 'any', CheckExpr }, { 'Start power', 'any', CheckExpr }, { 'Start faith', 'any', CheckExpr }, { 'Start bomb', 'any', CheckExpr, '3' }, { 'Allow practice', 'bool', CheckExpr }, { 'Difficulty value', 'difficulty', CheckExpr, '1' }, disptype = 'stage group', editfirst = true, default = { ["type"] = 'stagegroup', attr = { '', '2', '100', '50000', '3', 'true' } }, allowchild = { 'stage' }, allowparent = { 'root', 'folder' }, depth = 0, totext = function(nodedata) return string.format("stage group %q", nodedata.attr[1]) end, tohead = function(nodedata) stageGroupName = nodedata.attr[1] return string.format( "stage.group.New('menu', {}, %q, {lifeleft = %s, power = %s, faith = %s, bomb = %s}, %s, %s)\n", nodedata.attr[1], nodedata.attr[2], nodedata.attr[3], nodedata.attr[4], nodedata.attr[5], nodedata.attr[6], nodedata.attr[7]) end, check = function(nodedata) M.difficulty = nodedata.attr[1] end, checkafter = function(nodedata) M.difficulty = nil end, } local stage_head_fmt = [[stage.group.AddStage('%s', '%s@%s', {lifeleft=%s,power=%s,faith=%s,bomb=%s}, %s) stage.group.DefStageFunc('%s@%s', 'init', function(self) _init_item(self) difficulty = self.group.difficulty New(mask_fader, 'open') New(_G[lstg.var.player_name]) ]] local stage_foot = [[ task.New(self, function() while coroutine.status(self.task[1]) ~= 'dead' do task.Wait() end stage.group.FinishReplay() New(mask_fader, 'close') task.New(self, function() local _, bgm = EnumRes('bgm') for i = 1, 30 do for _, v in pairs(bgm) do if GetMusicState(v) == 'playing' then SetBGMVolume(v, 1 - i / 30) end end task.Wait() end end) task.Wait(30) stage.group.FinishStage() end) end) ]] local stage = { { 'Name', 'any', CheckName }, { 'Start life (practice)', 'any', CheckExpr }, { 'Start power (practice)', 'any', CheckExpr }, { 'Start faith (practice)', 'any', CheckExpr }, { 'Start spell (practice)', 'any', CheckExpr }, { 'Allow practice', 'bool', CheckExpr }, editfirst = true, allowparent = { 'stagegroup' }, allowchild = {}, depth = 1, default = { expand = true, ["type"] = 'stage', attr = { '', '7', '300', '50000', '3', 'true' }, child = { { ["type"] = 'stagetask', attr = {} } } }, totext = function(nodedata) return string.format("stage %q", nodedata.attr[1]) end, tohead = function(nodedata) local ret = string.format( stage_head_fmt, stageGroupName, nodedata.attr[1], stageGroupName, nodedata.attr[2], nodedata.attr[3], nodedata.attr[4], nodedata.attr[5], nodedata.attr[6], nodedata.attr[1], stageGroupName) return ret end, tofoot = function(nodedata) return stage_foot end, } local stagetask = { disptype = 'task for stage', allowparent = {}, forbiddelete = true, totext = function(nodedata) return "create task" end, tohead = function(nodedata) return "task.New(self, function()\n" end, tofoot = function(nodedata) return "end)\n" end, } local stagefinish = { needancestor = { 'stage' }, disptype = 'finish stage', allowchild = {}, totext = function(nodedata) return "finish current stage" end, tohead = function(nodedata) return "if true then return end\n" end, } local stagegoto = { { 'Stage (by index)', 'any', CheckExpr }, disptype = 'go to stage', needancestor = { 'stage' }, allowchild = {}, totext = function(nodedata) return "go to stage " .. nodedata.attr[1] end, tohead = function(nodedata) return "New(mask_fader, 'close')\ task.New(self, function()\ local _, bgm = EnumRes('bgm')\ for i = 1, 30 do \ for _, v in pairs(bgm) do\ if GetMusicState(v) == 'playing' then\ SetBGMVolume(v, 1 - i / 30) end\ end\ task.Wait()\ end end)\ task.Wait(30)\ stage.group.GoToStage(" .. nodedata.attr[1] .. ")\n" end, } local stagefinishgroup_head = [[New(mask_fader, 'close') _stop_music() task.Wait(30) stage.group.FinishGroup() ]] local stagefinishgroup = { disptype = 'finish stage group', needancestor = { 'stage' }, allowchild = {}, totext = function(nodedata) return "finish current game and return to title" end, tohead = function(nodedata) return stagefinishgroup_head end, } local bgstage = { { 'Background', 'bgstage', CheckVName }, disptype = 'set stage background', needancestor = { 'stage' }, allowchild = {}, totext = function(nodedata) return string.format("set current stage's background to %q", nodedata.attr[1]) end, tohead = function(nodedata) return string.format("New(%s_background)\n", nodedata.attr[1]) end, } local _def = { stagegroup = stagegroup, stage = stage, stagetask = stagetask, stagefinish = stagefinish, stagegoto = stagegoto, stagefinishgroup = stagefinishgroup, bgstage = bgstage, } for k, v in pairs(_def) do require('xe.node_def._def').DefineNode(k, v) end
local pwChange,mouse,x,y local pwChangeRep local skipped = false local w,h = term.getSize() local password local menu = { "Update", "Edit Theme", "Change Username", "Change Password", "Set Label", "Clear Label", "Default Apps", } local function clear() term.setBackgroundColor(sPhone.theme["backgroundColor"]) term.setTextColor(sPhone.theme["text"]) term.clear() term.setCursorPos(1,1) end local function changeUsername() local newUsername = sPhone.user term.setBackgroundColor(sPhone.theme["backgroundColor"]) term.clear() term.setCursorPos(1,1) sPhone.header("New username") term.setCursorPos(w,1) term.setBackgroundColor(sPhone.theme["header"]) term.setTextColor(sPhone.theme["headerText"]) write("X") term.setBackgroundColor(sPhone.theme["backgroundColor"]) term.setTextColor(sPhone.theme["text"]) term.setCursorPos(2,7) print("Change your username.") print(" It affects chat app.") while true do term.setCursorPos(2,4) term.clearLine() newUsername,mouse,x,y = sPhone.read(nil,nil,nil,true,newUsername) if mouse then if y == 1 and x == w then return end else break end end sPhone.user = newUsername config.write("/.sPhone/config/sPhone","username",newUsername) sPhone.winOk("Username","changed") end local function changePassword() skipped = false sPhone.wrongPassword = false while true do local usingPW = config.read("/.sPhone/config/sPhone","lockEnabled") if not usingPW then break end term.setBackgroundColor(sPhone.theme["lock.background"]) term.clear() term.setCursorPos(1,1) sPhone.header(sPhone.user) term.setCursorPos(w,1) term.setBackgroundColor(sPhone.theme["header"]) term.setTextColor(sPhone.theme["headerText"]) write("X") paintutils.drawBox(7,9,20,11,sPhone.theme["lock.inputSide"]) term.setBackgroundColor(sPhone.theme["lock.inputBackground"]) if sPhone.wrongPassword then term.setTextColor(sPhone.theme["lock.error"]) term.setBackgroundColor(sPhone.theme["lock.inputBackground"]) visum.align("center"," Wrong Password",false,13) end term.setTextColor(sPhone.theme["lock.text"]) term.setBackgroundColor(sPhone.theme["lock.background"]) visum.align("center"," Current Password",false,7) local loginTerm = window.create(term.native(), 8,10,12,1, true) term.redirect(loginTerm) term.setBackgroundColor(sPhone.theme["lock.inputBackground"]) term.clear() term.setCursorPos(1,1) term.setTextColor(sPhone.theme["lock.inputText"]) while true do password,mouse,x,y = sPhone.read("*",nil,nil,true,password) if mouse then if y == 1 and x == w then term.redirect(sPhone.mainTerm) return end else break end end term.redirect(sPhone.mainTerm) local fpw = config.read("/.sPhone/config/sPhone","password") if sha256.sha256(password) ~= fpw then sPhone.wrongPassword = true else sPhone.wrongPassword = false break end end while true do term.setBackgroundColor(sPhone.theme["lock.background"]) term.clear() term.setCursorPos(1,1) sPhone.header(sPhone.user) paintutils.drawBox(7,9,20,11,sPhone.theme["lock.inputSide"]) term.setBackgroundColor(sPhone.theme["lock.background"]) if sPhone.wrongPassword then term.setTextColor(sPhone.theme["lock.error"]) term.setBackgroundColor(sPhone.theme["lock.background"]) visum.align("center"," Wrong Password",false,13) end term.setTextColor(sPhone.theme["lock.text"]) term.setBackgroundColor(sPhone.theme["lock.background"]) visum.align("center"," New Password",false,7) local t = "Disable Password" term.setCursorPos(w-#t+1,h) write(t) local loginTerm = window.create(term.native(), 8,10,12,1, true) term.redirect(loginTerm) term.setBackgroundColor(sPhone.theme["lock.inputBackground"]) term.clear() term.setCursorPos(1,1) term.setTextColor(sPhone.theme["lock.inputText"]) while true do pwChange,mouse,x,y = sPhone.read("*",nil,nil,true,pwChange) if mouse then if y == h and (x >= 10 and x <= w) then skipped = true config.write("/.sPhone/config/sPhone","lockEnabled",false) break end else break end end term.redirect(sPhone.mainTerm) if not skipped then term.setBackgroundColor(sPhone.theme["lock.background"]) term.clear() term.setCursorPos(1,1) sPhone.header(sPhone.user) paintutils.drawBox(7,9,20,11,sPhone.theme["lock.inputSide"]) term.setBackgroundColor(sPhone.theme["lock.background"]) term.setTextColor(sPhone.theme["lock.text"]) visum.align("center"," Repeat Password",false,7) local loginTerm = window.create(term.native(), 8,10,12,1, true) term.redirect(loginTerm) term.setBackgroundColor(sPhone.theme["lock.inputBackground"]) term.clear() term.setCursorPos(1,1) term.setTextColor(sPhone.theme["lock.inputText"]) pwChangeRep = read("*") term.redirect(sPhone.mainTerm) if sha256.sha256(pwChange) == sha256.sha256(pwChangeRep) then sPhone.wrongPassword = false config.write("/.sPhone/config/sPhone","password",sha256.sha256(pwChangeRep)) config.write("/.sPhone/config/sPhone","lockEnabled",true) sPhone.winOk("Password","changed") return else sPhone.wrongPassword = true end else config.write("/.sPhone/config/sPhone","lockEnabled",false) sPhone.winOk("Password","disabled") return end end end local function changeLabel() local newLabel = os.getComputerLabel() sPhone.header("New Label") term.setCursorPos(w,1) term.setBackgroundColor(sPhone.theme["header"]) term.setTextColor(sPhone.theme["headerText"]) write("X") term.setBackgroundColor(sPhone.theme["backgroundColor"]) term.setTextColor(sPhone.theme["text"]) term.setCursorPos(2,7) print("Change computer label") print(" to be identified") print(" in your inventory.") while true do term.setCursorPos(2,4) term.clearLine() newLabel,mouse,x,y = sPhone.read(nil,nil,nil,true,newLabel) if mouse then if y == 1 and x == w then return end else break end end newLabel = newLabel:gsub("&", string.char(0xc2)..string.char(0xa7)) --yay colors os.setComputerLabel(newLabel) sPhone.winOk("Computer Label set") end local function clearLabel() local ok, err = pcall(function() os.setComputerLabel(nil) end) if not ok then os.setComputerLabel(err) sPhone.winOk("Error") return end sPhone.winOk("Computer Label cleared") end local function editTheme() local themeOptions = { "Theme List", "", "Header Color", "Header Text Color", "Text Color", "Background Color", "Window Options", "Login Options", "Save", "Load", "Reset", } local themeOptionsWindow = { "Background", "Side", "Button", "Text", } local themeOptionsLock = { "Background", "Text", "Input Background", "Input Text", "Input Sides", "Error", } while true do local _, id = sPhone.menu(themeOptions,"Theme","X") if id == 0 then return elseif id == 1 then shell.run("/.sPhone/apps/themes") elseif id == 2 then --separator? elseif id == 3 then sPhone.applyTheme("header", sPhone.colorPicker("Header",sPhone.getTheme("header"))) elseif id == 4 then sPhone.applyTheme("headerText", sPhone.colorPicker("Header Text",sPhone.getTheme("headerText"))) elseif id == 5 then sPhone.applyTheme("text", sPhone.colorPicker("Text",sPhone.getTheme("text"))) elseif id == 6 then sPhone.applyTheme("backgroundColor", sPhone.colorPicker("Background Color",sPhone.getTheme("backgroundColor"))) elseif id == 7 then while true do local _, id = sPhone.menu(themeOptionsWindow,"Window Theme","X") if id == 0 then return elseif id == 1 then sPhone.applyTheme("window.background", sPhone.colorPicker("Background",sPhone.getTheme("window.background"))) elseif id == 2 then sPhone.applyTheme("window.side", sPhone.colorPicker("Side",sPhone.getTheme("window.side"))) elseif id == 3 then sPhone.applyTheme("window.button", sPhone.colorPicker("Button",sPhone.getTheme("window.button"))) elseif id == 4 then sPhone.applyTheme("window.text", sPhone.colorPicker("Text",sPhone.getTheme("window.text"))) end end elseif id == 8 then while true do local _, id = sPhone.menu(themeOptionsLock,"Login Theme","X") if id == 0 then return elseif id == 1 then sPhone.applyTheme("lock.background", sPhone.colorPicker("Background",sPhone.getTheme("lock.background"))) elseif id == 2 then sPhone.applyTheme("lock.text", sPhone.colorPicker("Text",sPhone.getTheme("lock.text"))) elseif id == 3 then sPhone.applyTheme("lock.inputBackground", sPhone.colorPicker("Input Background",sPhone.getTheme("lock.inputBackground"))) elseif id == 4 then sPhone.applyTheme("lock.inputText", sPhone.colorPicker("Input Text",sPhone.getTheme("lock.inputText"))) elseif id == 5 then sPhone.applyTheme("lock.inputSide", sPhone.colorPicker("Input Sides",sPhone.getTheme("lock.inputSide"))) elseif id == 6 then sPhone.applyTheme("lock.error", sPhone.colorPicker("Error",sPhone.getTheme("lock.error"))) end end elseif id == 9 then local saveTheme sPhone.header(sPhone.user) term.setCursorPos(w,1) term.setBackgroundColor(sPhone.theme["header"]) term.setTextColor(sPhone.theme["headerText"]) write("X") term.setBackgroundColor(sPhone.theme["backgroundColor"]) term.setTextColor(sPhone.theme["text"]) visum.align("center", "Save Theme",false,3) while true do term.setCursorPos(2,5) term.clearLine() saveTheme,mouse,x,y = sPhone.read(nil,nil,nil,true,saveTheme) if mouse then if y == 1 and x == w then return end else break end end if fs.exists(saveTheme) then fs.delete(saveTheme) end fs.copy("/.sPhone/config/theme", saveTheme) sPhone.winOk("Theme saved!") elseif id == 10 then local loadTheme = sPhone.list() if loadTheme then if fs.exists(loadTheme) and not fs.isDir(loadTheme) then for k, v in pairs(sPhone.theme) do -- Load theme sPhone.theme[k] = config.read(loadTheme, k) end for k, v in pairs(sPhone.theme) do -- Overwrite theme config config.write("/.sPhone/config/theme", k, v) end sPhone.winOk("Theme loaded!") else sPhone.winOk("Theme not found!") end end elseif id == 11 then fs.delete("/.sPhone/config/theme") sPhone.theme = sPhone.defaultTheme sPhone.winOk("Removed Theme") end end end local function defaultApps() local defaultMenu = { "Home", } local name, id = sPhone.menu(defaultMenu,"Default Apps","X") if id == 0 then return elseif id == 1 then while true do local hList = { ["sphone.home"] = "sPhone Home", } for k,v in pairs(config.list("/.sPhone/config/spklist")) do local f = fs.open("/.sPhone/apps/spk/"..k.."/.spk","r") local data = f.readAll() f.close() data = textutils.unserialise(data) if data.type == "home" then hList[k] = v end end local defaultHome = sPhone.list(nil,{ list = hList, pairs = true, title = " Default Home", }) if not defaultHome then sPhone.setDefaultApp("home","sphone.home") sPhone.winOk("Done!","Reboot to apply") break else sPhone.setDefaultApp("home",defaultHome) sPhone.winOk("Done!","Reboot to apply") break end end end end while true do clear() sPhone.header("","X") local name, id = sPhone.menu(menu, "Settings","X") if id == 0 then task.kill(temp.get("homePID")) return elseif id == 1 then setfenv(loadstring(http.get("https://raw.githubusercontent.com/BeaconNet/sPhone/master/src/installer.lua").readAll()),getfenv())() elseif id == 2 then editTheme() elseif id == 3 then changeUsername() elseif id == 4 then changePassword() elseif id == 5 then changeLabel() elseif id == 6 then clearLabel() elseif id == 7 then defaultApps() end end
----------------------------------------- -- ID: 4931 -- Scroll of Hyoton: Ichi -- Teaches the ninjutsu Hyoton: Ichi ----------------------------------------- function onItemCheck(target) return target:canLearnSpell(323) end function onItemUse(target) target:addSpell(323) end
local n = 10000000 local sum = 0.0 local i=0 local dx = 1.0/n local x=0.0 while i<n do sum = sum + 1.0/(x*x+1.0) x = x+ dx i = i+ 1 end print(sum * 4.0 / n)
require("prototypes.ores-retexture-final-fixes")