content
stringlengths
5
1.05M
ardour { ["type"] = "EditorAction", name = "Toggle All Plugins and Sends", license = "MIT", author = "Lorenzo Gabriele", description = [[Toggle all Plugins and sends on all tracks]] } function factory () return function () if deactivating_lolgab == nil then deactivating_lolgab = 1 end if already_deactivated_lolgab == nil then already_deactivated_lolgab = {} end local tracks = Session:get_routes () local trackNumber = 1 for track in tracks:iter () do local i = 0; while 1 do -- iterate over all plugins/processors local proc = track:nth_plugin (i) if proc:isnil () then break end if proc:active() and deactivating_lolgab == 1 then proc:deactivate() if already_deactivated_lolgab[trackNumber] ~= nil then already_deactivated_lolgab[trackNumber][i] = nil end elseif deactivating_lolgab == 1 and not proc:active() then if already_deactivated_lolgab[trackNumber] == nil then already_deactivated_lolgab[trackNumber] = {} end already_deactivated_lolgab[trackNumber][i] = true elseif deactivating_lolgab == 0 and (already_deactivated_lolgab[trackNumber] == nil or already_deactivated_lolgab[trackNumber][i] == nil) then proc:activate() end i = i + 1 end i = 0 while 1 do -- iterate over all sends local send = track:nth_send (i) if send:isnil () then break end if send:active() and deactivating_lolgab == 1 then send:deactivate() already_deactivated_lolgab[send] = nil elseif deactivating_lolgab == 1 and not send:active() then already_deactivated_lolgab[send] = true elseif deactivating_lolgab == 0 and already_deactivated_lolgab[send] == nil then send:activate() end i = i + 1 end trackNumber = trackNumber + 1 end deactivating_lolgab = 1 - deactivating_lolgab end end
local table = Elona.require("table") local string = Elona.require("string") local remove = {} local redirect = {} for key, asset in pairs(data.raw["core.asset"]) do if asset.file then if string.match(asset.file, "^__core__") then table.insert(remove, key) elseif string.match(asset.file, "^__BUILTIN__") then table.insert(redirect, key) end end end local function extract_id_parts(key) return string.match(key, "(.+)%.(.+)") end local function chip_mapping(data_type, folder) local mapping = {} local _, kind = extract_id_parts(data_type) for key, chip in pairs(data.raw[data_type]) do local mod, instance = extract_id_parts(key) mapping[key] = kind .. "/" .. mod .. "/" .. instance .. ".png" end return mapping end data:define_type("theme") data:add_multi( "theme.theme", { { name = "beautify", root = "__theme__/theme/beautify", transforms = { { type = "redirect", field = "file", folder = "graphic3", targets = { ["core.asset"] = redirect, } }, { type = "mapping", field = "source", folder = ".", targets = { ["core.chara_chip"] = chip_mapping("core.chara_chip"), ["core.item_chip"] = chip_mapping("core.item_chip"), } }, --{ -- type = "mapping", -- field = "source", -- folder = "graphic2", -- targets = { -- ["core.portrait"] = { -- -- } -- } --} { type = "remove", field = "file", targets = { ["core.asset"] = remove, } }, } } } )
minetest.register_tool("rangedweapons:forcegun", { description = "" ..core.colorize("#35cdff","Force gun\n") ..core.colorize("#FFFFFF", "Completelly harmless... by itself...\n")..core.colorize("#FFFFFF", "It's projectile will push either the entity it hits directly, or everyone near the node it collides with far away.\n") ..core.colorize("#FFFFFF", "Perfect for rocket-jumping or YEETing enemies away.\n")..core.colorize("#FFFFFF", "Power usage: 40\n")..core.colorize("#FFFFFF", "Gun type:Power Special-gun\n") ..core.colorize("#FFFFFF", "Bullet velocity: 60"), range = 0, wield_scale = {x=2.0,y=2.0,z=1.75}, inventory_image = "rangedweapons_forcegun.png", on_use = function(itemstack, user, pointed_thing) local pos = user:get_pos() local dir = user:get_look_dir() local yaw = user:get_look_yaw() local inv = user:get_inventory() if inv:contains_item("main", "rangedweapons:power_particle 40") then if pos and dir then inv:remove_item("main", "rangedweapons:power_particle 25") pos.y = pos.y + 1.5 local obj = minetest.add_entity(pos, "rangedweapons:forceblast") if obj then minetest.sound_play("rangedweapons_rocket", {object=obj}) obj:set_velocity({x=dir.x * 60, y=dir.y * 60, z=dir.z * 60}) obj:setyaw(yaw + math.pi) proj_dir = dir local ent = obj:get_luaentity() if ent then ent.player = ent.player or user end end end end end, }) local rangedweapons_forceblast = { timer = 0, initial_properties = { physical = true, hp_max = 420, glow = 30, visual = "sprite", visual_size = {x=0.4, y=0.4,}, textures = {"rangedweapons_force_bullet.png"}, lastpos = {}, collide_with_objects = false, collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, }, } rangedweapons_forceblast.on_step = function(self, dtime, moveresult) self.timer = self.timer + dtime local pos = self.object:get_pos() proj_dir = proj_dir or ({x=0,y=0,z=0}) if self.timer > 10 then self.object:remove() end if self.timer > 0.05 then self.object:set_properties({collide_with_objects = true}) end if moveresult.collides == true then if moveresult.collisions[1] ~= nil then if moveresult.collisions[1].type == "object" then if moveresult.collisions[1].object:is_player() then moveresult.collisions[1].object:add_player_velocity({x=proj_dir.x * 20, y=5+ (proj_dir.y * 20), z=proj_dir.z * 20}) else moveresult.collisions[1].object:add_velocity({x=proj_dir.x * 20, y=5+ (proj_dir.y * 20), z=proj_dir.z * 20}) end minetest.add_particle({ pos = ({x = pos.x, y = pos.y, z = pos.z}), velocity ={x=0,y=0,z=0}, acceleration ={x=0,y=0,z=0}, expirationtime = 0.20, size = 16, collisiondetection = true, collision_removal = false, vertical = false, texture = "rangedweapons_force_blast.png", glow = 20, animation = {type="vertical_frames", aspect_w=64, aspect_h=64, length = 0.20,}, }) self.object:remove() end if moveresult.collisions[1].type == "node" then local objs = minetest.get_objects_inside_radius({x = pos.x, y = pos.y, z = pos.z}, 7) for k, obj in pairs(objs) do if obj:get_pos() then posd_x = pos.x - obj:get_pos().x posd_y = pos.y - obj:get_pos().y posd_z = pos.z - obj:get_pos().z else posd_x = 1 posd_y = 1 posd_z = 1 end if posd_y < 0 and posd_y > -1 then posd_y = -1 end if posd_y > 0 and posd_y < 1 then posd_y = 1 end if posd_y > 0 then posd_y=posd_y*3 end posd_y = (posd_y + 0.5) * (((math.abs(posd_x)+0.5)+(math.abs(posd_z)+0.5))/2) if posd_y > -1.0 and posd_y < 0 then posd_y = -1.0 end if obj:get_luaentity() ~= nil then if obj:get_luaentity().name ~= "rangedweapons:forceblast" then obj:add_velocity({x=10*(-posd_x), y=30*(-1/posd_y), z=10*(-posd_z)}) self.object:remove() end else obj:add_player_velocity({x=30*((-posd_x)/(1+math.abs(posd_x))), y=25*(-1/posd_y), z=30*((-posd_z)/(1+math.abs(posd_z)))}) self.object:remove() end end minetest.add_particle({ pos = ({x = pos.x, y = pos.y, z = pos.z}), velocity ={x=0,y=0,z=0}, acceleration ={x=0,y=0,z=0}, expirationtime = 0.20, size = 128, collisiondetection = true, collision_removal = false, vertical = false, texture = "rangedweapons_force_blast.png", glow = 20, animation = {type="vertical_frames", aspect_w=64, aspect_h=64, length = 0.20,}, }) self.object:remove() end self.lastpos= {x = pos.x, y = pos.y, z = pos.z} end end end minetest.register_entity("rangedweapons:forceblast", rangedweapons_forceblast)
--[[ Copyright (C) 2015 Real-Time Innovations, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] xtypes = require ('ddsl.xtypes') -- The Generator<T> monad -- It's the prototype ("class") for all generator objects -- Every generator has a method named "generate" that -- produces a new T. I.e., every Generator looks like below -- class Generator<T> { T generate() } local TGenerator = { -- All methods of TGenerator are instance methods new = nil, map = nil, flatMap = nil, zip2 = nil, amb = nil, generate = nil, } -- Generator package object local GenPackage = { -- Numeric limits MAX_BYTE = 0xFF, MAX_INT16 = 0x7FFF, MAX_INT32 = 0x7FFFFFFF, MAX_INT64 = 0x7FFFFFFFFFFFFFFF, MAX_UINT16 = 0xFFFF, MAX_UINT32 = 0xFFFFFFFF, MAX_UINT64 = 0xFFFFFFFFFFFFFFFF, MAX_FLOAT = 3.4028234 * math.pow(10,38), MAX_DOUBLE = 1.7976931348623157 * math.pow(10, 308), -- Built-in generator objects Bool = nil, Octet = nil, Char = nil, WChar = nil, Float = nil, Double = nil, LongDouble = nil, Short = nil, Long = nil, LongLong = nil, UShort = nil, ULong = nil, ULongLong = nil, String = nil, WString = nil, -- Generator factories -- Most methods produce new generators. -- All methods below are non-instance methods. singleGen = nil, oneOf = nil, numGen = nil, boolGen = nil, charGen = nil, wcharGen = nil, octetGen = nil, shortGen = nil, int16Gen = nil, int32Gen = nil, int64Gen = nil, uint16Gen = nil, uint32Gen = nil, uint64Gen = nil, posFloatGen = nil, posDoubleGen = nil, floatGen = nil, doubleGen = nil, getPrimitiveGen = nil, lowercaseGen = nil, uppercaseGen = nil, alphaGen = nil, alphaNumGen = nil, printableGen = nil, stringGen = nil, nonEmptyStringGen = nil, rangeGen = nil, seqGen = nil, aggregateGen = nil, enumGen = nil, newGen = nil, -- Initialize the random number generator. initialize = nil, } -- GenPackage GenPackage.MIN_FLOAT = -GenPackage.MAX_FLOAT GenPackage.MIN_DOUBLE = -GenPackage.MAX_DOUBLE GenPackage.MIN_INT16 = -GenPackage.MAX_INT16-1 GenPackage.MIN_INT32 = -GenPackage.MAX_INT32-1 GenPackage.MIN_INT64 = -GenPackage.MAX_INT64-1 -- Only private methods/data local Private = { createMemberGenTab = nil, getGenerator = nil, seqParseGen = nil } ----------------------------------------------------- -------------------- TGenerator --------------------- ----------------------------------------------------- function TGenerator:new(generatorFunc) o = { generate = generatorFunc } setmetatable(o, self) self.__index = self return o end function TGenerator.kind() return "pull" end function TGenerator:map(func) return TGenerator:new(function () return func(self:generate()) end) end function TGenerator:flatMap(func) return self:map(function (x) return func(x):generate() end) end function TGenerator:zip2(otherGen, zipperFunc) return TGenerator:new(function () return zipperFunc(self:generate(), otherGen:generate()) end) end function TGenerator:amb(otherGen) return GenPackage.boolGen():flatMap(function (b) return b and self or otherGen end) end --------------------------------------------------- ------------------- GenPackage -------------------- --------------------------------------------------- function GenPackage.singleGen(val) return TGenerator:new(function () return val end) end function GenPackage.oneOf(array) return GenPackage.rangeGen(1, #array) :map(function (i) return array[i] end) end function GenPackage.numGen() return TGenerator:new(function () return math.random(GenPackage.MAX_INT32); end) end function GenPackage.int16Gen() return TGenerator:new(function () return math.random(GenPackage.MIN_INT16, GenPackage.MAX_INT16); end) end function GenPackage.int32Gen() return TGenerator:new(function () return math.random(GenPackage.MIN_INT32, GenPackage.MAX_INT32); end) end function GenPackage.int64Gen() return TGenerator:new(function () return math.random(GenPackage.MIN_INT64, GenPackage.MAX_INT64); end) end function GenPackage.uint16Gen() return TGenerator:new(function () return math.random(0, GenPackage.MAX_UINT16); end) end function GenPackage.uint32Gen() return TGenerator:new(function () return math.random(0, GenPackage.MAX_UINT32); end) end function GenPackage.uint64Gen() return TGenerator:new(function () return math.random(0, GenPackage.MAX_UINT64); end) end function GenPackage.rangeGen(loInt, hiInt) return TGenerator:new(function() return math.random(loInt, hiInt) end) end function GenPackage.boolGen() return TGenerator:new(function () return math.random(2) > 1; end) end function GenPackage.charGen() return GenPackage.rangeGen(0, GenPackage.MAX_BYTE) end function GenPackage.wcharGen() return GenPackage.rangeGen(0, GenPackage.MAX_INT16) end function GenPackage.octetGen() return GenPackage.rangeGen(0, GenPackage.MAX_BYTE) end function GenPackage.shortGen() return GenPackage.int16Gen() end function GenPackage.posFloatGen() return TGenerator:new(function() return math.random() * math.random(0, GenPackage.MAX_INT16) end) end function GenPackage.posDoubleGen() return TGenerator:new(function() return math.random() * math.random(0, GenPackage.MAX_INT32) end) end function GenPackage.floatGen() return GenPackage.boolGen():map(function(b) local num = math.random() * math.random(0, GenPackage.MAX_INT16) return b and -num or num end) end function GenPackage.doubleGen() return GenPackage.boolGen():map(function(b) local num = math.random() * math.random(0, GenPackage.MAX_INT32) return b and -num or num end) end function GenPackage.lowercaseGen() local a = 97 local z = 122 return GenPackage.rangeGen(a, z) end function GenPackage.uppercaseGen() local A = 65 local Z = 90 return GenPackage.rangeGen(A, Z) end function GenPackage.alphaGen() return GenPackage.lowercaseGen():amb( GenPackage.uppercaseGen()) end function GenPackage.alphaNumGen() local zero = 48 local nine = 57 return GenPackage.alphaGen():amb( GenPackage.rangeGen(zero, nine)) end function GenPackage.printableGen() local space = 32 local tilde = 126 return GenPackage.rangeGen(space, tilde) end function GenPackage.seqGen(elemGen, maxLength) elemGen = elemGen or GenPackage.singleGen("unknown ") maxLength = maxLength or GenPackage.MAX_BYTE+1 return GenPackage.rangeGen(0, maxLength) :map(function (length) local arr = {} for i=1,length do arr[i] = elemGen:generate() end return arr end) end function GenPackage.nonEmptyStringGen(maxLength, charGen) charGen = charGen or GenPackage.printableGen() maxLength = maxLength or GenPackage.MAX_BYTE+1 return GenPackage.rangeGen(1, maxLength) :map(function (length) local arr = {} for i=1,length do arr[i] = string.char(charGen:generate()) end return table.concat(arr) end) end function GenPackage.stringGen(maxLength, charGen) return GenPackage.boolGen():flatMap( function (empty) return empty and GenPackage.singleGen("") or GenPackage.nonEmptyStringGen(maxLength, charGen) end) end function Private.createMemberGenTab( structtype, genLib, memoizeGen) local memberGenTab = { } genLib = genLib or { } genLib.typeGenLib = genLib.typeGenLib or { } -- if structtype[xtypes.KIND]() == "struct" and if structtype[xtypes.BASE] ~= nil then memberGenTab = Private.createMemberGenTab( structtype[xtypes.BASE], genLib, memoizeGen) end for idx, val in ipairs(structtype) do local member, def = next(val) --io.write(member .. ": ") if genLib[member] then -- if library already has a generator memberGenTab[member] = genLib[member] else memberGenTab[member] = Private.getGenerator( def, genLib, memoizeGen) if memoizeGen then genLib[member] = memberGenTab[member] end end --print() end return memberGenTab; end function Private.getGenerator( roledef, genLib, memoizeGen) local gen = nil local baseTypename = tostring(roledef[1]) if genLib.typeGenLib[baseTypename] == nil then -- if genertor isn't there if roledef[1][xtypes.KIND]() == "atom" then -- It's a function! gen = GenPackage.getPrimitiveGen(baseTypename) elseif roledef[1][xtypes.KIND]() == "enum" then -- It's a function! gen = GenPackage.enumGen(roledef[1]) elseif roledef[1][xtypes.KIND]() == "struct" then -- It's a function! gen = GenPackage.aggregateGen(roledef[1], genLib, memoizeGen) -- elseif roledef[1][xtypes.KIND]() == "union" then -- It's a function! -- gen = GenPackage.aggregateGen(roledef[1], genLib, memoizeGen) else error "Error: Unknown kind" end if memoizeGen then genLib.typeGenLib[baseTypename] = gen end else gen = genLib.typeGenLib[baseTypename] -- cache the generator end for i=2, #roledef do --io.write(tostring(roledef[i]) .. " ") local info = tostring(roledef[i]) if string.find(info, "Sequence") then gen = Private.sequenceParseGen(gen, info) elseif string.find(info, "Optional") then gen = gen:amb(GenPackage.singleGen(nil)) end end return gen end function Private.sequenceParseGen(gen, info) local o = 10 -- open parenthesis "@Sequence(...)" local close = string.find(info, ")") if close == nil then -- unbounded sequence gen = GenPackage.seqGen(gen) else local bound = string.sub(info, o+1, close-1) --print(tonumber(bound)) gen = GenPackage.seqGen(gen, tonumber(bound)) end return gen end function Private.unionGen( structtype, genLib, memoizeGen) local memberGenTab = Private.createMemberGenTab( structtype, genLib, memoizeGen) return TGenerator:new(function () local data = {} for member, gen in pairs(memberGenTab) do data[member] = gen:generate() end return data end) end function GenPackage.aggregateGen( structtype, genLib, memoizeGen) -- if structtype[xtypes.KIND]()=="union" then -- return Private.unionGen(structtype, genLib, memoizeGen) -- end local memberGenTab = Private.createMemberGenTab( structtype, genLib, memoizeGen) return TGenerator:new(function () local data = {} for member, gen in pairs(memberGenTab) do data[member] = gen:generate() end return data end) end function GenPackage.enumGen(enumtype) local ordinals = {} for idx, enumdef in ipairs(enumtype) do local elem, value = next(enumdef) ordinals[idx] = value end return GenPackage.oneOf(ordinals) end function GenPackage.getGenerator( roledef, genLib, memoizeGen) return Private.getGenerator(roledef, genLib, memoizeGen) end function GenPackage.getPrimitiveGen(ptype) if ptype=="boolean" then return GenPackage.Bool elseif ptype=="octet" then return GenPackage.Octet elseif ptype=="char" then return GenPackage.Char elseif ptype=="wchar" then return GenPackage.WChar elseif ptype=="float" then return GenPackage.Float elseif ptype=="double" then return GenPackage.Double elseif ptype=="long_double" then return GenPackage.LongDouble elseif ptype=="short" then return GenPackage.Short elseif ptype=="long" then return GenPackage.Long elseif ptype=="long_long" then return GenPackage.LongLong elseif ptype=="unsigned_short" then return GenPackage.UShort elseif ptype=="unsigned_long" then return GenPackage.ULong elseif ptype=="unsigned_long_long" then return GenPackage.ULongLong elseif ptype=="string" then return GenPackage.String elseif ptype=="wstring" then return GenPackage.WString end local isString = string.find(ptype, "string") or string.find(ptype, "wstring") if isString then local lt = string.find(ptype, "<") local gt = string.find(ptype, ">") local bound = string.sub(ptype, lt+1, gt-1) return GenPackage.nonEmptyStringGen(tonumber(bound)) else return nil end end function GenPackage.initialize(seed) seed = seed or os.time() math.randomseed(seed) end function GenPackage.newGen(func) return TGenerator:new(func) end function GenPackage.fibonacciGen() local a = 0 local b = 1 return TGenerator:new(function () local c = a; a = b b = c+b return c end) end function GenPackage.stepGen(start, max, step, cycle) if start == nil then error "Error in stepGen: start is nil" end max = max or math.huge step = step or 1 cycle = cycle or false local current = start local init = false return TGenerator:new(function () if init==false then init = true else if step >= 0 then if current + step <= max then current = current + step else if cycle then current = start end end else if current + step >= max then current = current + step else if cycle then current = start end end end end return current end) end function GenPackage.inOrderGen(array, cycle) if #array == 0 then error "Error: Empty sequence" end return GenPackage.stepGen(1, #array, 1, cycle) :map(function (i) return array[i] end) end GenPackage.Bool = GenPackage.boolGen() GenPackage.Octet = GenPackage.octetGen() GenPackage.Char = GenPackage.charGen() GenPackage.WChar = GenPackage.wcharGen() GenPackage.Float = GenPackage.floatGen() GenPackage.Double = GenPackage.doubleGen() GenPackage.LongDouble = GenPackage.doubleGen() GenPackage.Short = GenPackage.int16Gen() GenPackage.Long = GenPackage.int32Gen() GenPackage.LongLong = GenPackage.int64Gen() GenPackage.UShort = GenPackage.uint16Gen() GenPackage.ULong = GenPackage.uint32Gen() GenPackage.ULongLong = GenPackage.uint64Gen() GenPackage.String = GenPackage.nonEmptyStringGen() GenPackage.WString = GenPackage.nonEmptyStringGen() return GenPackage
Player = Player or {} --- add a upgrade display for the engineering station --- @deprecated The integration will probably change, because I think having some kind of menu structure might be the better option --- @param self --- @param player PlayerSpaceship --- @param config table --- @field label string the label for the menu item --- @field title string the title to display atop the listing --- @field noUpgrades string the text to display if the ship got no upgrades --- @return PlayerSpaceship Player.withUpgradeDisplay = function(self, player, config) if not isEePlayer(player) then error("Expected player to be a Player, but got " .. typeInspect(player), 2) end if not Player:hasUpgradeTracker(player) then error("Player " .. player:getCallSign() .. " should have a upgrade tracker", 2) end if not Player:hasMenu(player) then error("Expected player " .. player:getCallSign() .. " to have menus enabled, but it does not", 2) end if Player:hasUpgradeDisplay(player) then error("Player " .. player:getCallSign() .. " already has a upgrade display", 2) end config = config or {} if not isTable(config) then error("Expected config to be a table, but got " .. typeInspect(config), 2) end if not isString(config.label) then error("Expected label to be a string, but got " .. typeInspect(config.label), 2) end if not isString(config.title) then error("Expected title to be a string, but got " .. typeInspect(config.title), 2) end if not isString(config.noUpgrades) then error("Expected noUpgrades to be a string, but got " .. typeInspect(config.noUpgrades), 2) end player:addEngineeringMenuItem(Menu:newItem(config.label, function() local text = config.title .. "\n--------------------------\n" local upgrades = {} for _, upgrade in pairs(player:getUpgrades()) do if BrokerUpgrade:isUpgrade(upgrade) then table.insert(upgrades, upgrade) end end if Util.size(upgrades) == 0 then text = text .. config.noUpgrades .. "\n" else for _, upgrade in pairs(upgrades) do text = text .. " * ".. upgrade:getName() .. "\n" end end return text end)) player.upgradeDisplayActive = true return player end --- check if the player has an upgrade display --- @param self --- @param player any --- @return boolean Player.hasUpgradeDisplay = function(self, player) return player.upgradeDisplayActive == true end
return Import("ga.CoreByte.CoreBase.Database")
ENT.Base = "dronesrewrite_base" ENT.DrrBaseType = "walker" ENT.Type = "anim" ENT.PrintName = "PLOT-130" ENT.Spawnable = true ENT.AdminSpawnable = true ENT.Category = "Drones Rewrite" ENT.AdminOnly = true ENT.UNIT = "PLOT" ENT.Model = "models/dronesrewrite/plotdr/plotdr.mdl" ENT.Weight = 4000 ENT.SpawnHeight = 32 ENT.OverlayName = "Black and white" ENT.FirstPersonCam_pos = Vector(80, 0, 195) ENT.ThirdPersonCam_pos = Vector(0, 0, 300) ENT.ThirdPersonCam_distance = 260 ENT.RenderCam = false ENT.AI_AllowDown = false ENT.AI_AllowUp = false ENT.Speed = 100000 ENT.SprintCoefficient = 1 ENT.RotateSpeed = 5 ENT.PitchOffset = 0 ENT.Hover = 110 ENT.AngOffset = 1.6 ENT.HackValue = 4 ENT.Fuel = 700 ENT.MaxFuel = 700 ENT.FuelReduction = 6 ENT.ExplosionForce = 2 ENT.ExplosionAngForce = 0 ENT.DoExplosionEffect = "splode_big_drone_main" ENT.AllowPitchRestrictions = true ENT.PitchMin = -90 ENT.PitchMax = 35 ENT.AllowYawRestrictions = true ENT.YawMin = -80 ENT.YawMax = 50 ENT.NoiseCoefficient = 2 ENT.WaitForSound = 0.54 ENT.Slip = 170 ENT.AngSlip = 0.03 ENT.KeysFuncs = DRONES_REWRITE.DefaultKeys() ENT.KeysFuncs.Physics["Up"] = function(self) if self:IsDroneOnGround() then local up = self:GetUp() local phys = self:GetPhysicsObject() if not self.JumpPower then self.JumpPower = 0 end self.JumpPower = math.Approach(self.JumpPower, 1000, 10) phys:ApplyForceCenter(-up * phys:GetMass() * 18) end end ENT.KeysFuncs.UnPressed["Up"] = function(self) if self:IsDroneOnGround() then local forward = self:GetForward() local up = self:GetUp() local phys = self:GetPhysicsObject() local ang = self:GetAngles() local angp = math.NormalizeAngle(ang.p) local angr = math.NormalizeAngle(ang.r) phys:ApplyForceCenter((forward * 200 + up * self.JumpPower) * phys:GetMass()) phys:AddAngleVelocity(Vector(angr, angp, 0) * self.JumpPower * 0.018) self.JumpPower = 0 end end ENT.KeysFuncs.Physics["Down"] = function(self) local up = self:GetUp() local phys = self:GetPhysicsObject() phys:ApplyForceCenter(-up * phys:GetMass() * 30) end ENT.HealthAmount = 1500 ENT.DefaultHealth = 1500 ENT.Sounds = { ExplosionSound = { Name = "ambient/explosions/explode_1.wav", Level = 82 }, FootSound = { Sounds = { --"physics/metal/metal_barrel_impact_hard1.wav", "physics/metal/metal_barrel_impact_hard2.wav" }, Pitch = 120, Volume = 72 } } ENT.Corners = { Vector(-8, -69, 110), Vector(-8, 64, 110), Vector(68, 64, 110), Vector(68, -69, 110) } ENT.Attachments = { ["Minigun1"] = { Pos = Vector(52, -76, 192), Angle = Angle(0, 0, -95) }, ["Minigun2"] = { Pos = Vector(52, -76, 170), Angle = Angle(0, 0, -90) }, ["MissileL"] = { Pos = Vector(0, 84, 180), Angle = Angle(0, 0, -90) }, ["BackwardUp"] = { Pos = Vector(0, 0, 219), Angle = Angle(0, 0, 180) }, ["HeadUp"] = { Pos = Vector(35, 0, 213), Angle = Angle(0, 0, 180) } } ENT.Weapons = { ["3-barrel Miniguns & Missile Batteries"] = { Name = "3-barrel Minigun", Sync = { ["1"] = { fire1 = "fire1" }, ["2"] = { fire1 = "fire2" } }, Attachment = "Minigun2" }, ["1"] = { Name = "3-barrel Minigun", Select = false, Attachment = "Minigun1" }, ["2"] = { Name = "Missile Battery", Select = false, PrimaryAsSecondary = true, Attachment = "MissileL" } } ENT.Modules = DRONES_REWRITE.GetBaseModules()
return {'fade','fading','fado','fadozangeres','fadime','fados','fadozangeressen','fadimes'}
local Llama = require(script.Parent.Parent.Vendor.Llama) local StudioStyleGuideColors = Enum.StudioStyleGuideColor:GetEnumItems() local StudioStyleGuideModifiers = Enum.StudioStyleGuideModifier:GetEnumItems() local CONSTANTS = { TextBox = { Font = Enum.Font.SourceSansSemibold; }; } local function GetTheme() ---@type StudioTheme local StudioTheme = settings().Studio.Theme local Theme = Llama.Dictionary.join({ ThemeName = StudioTheme.Name; }, CONSTANTS) for _, StudioStyleGuideColor in ipairs(StudioStyleGuideColors) do local Color = {} for _, StudioStyleGuideModifier in ipairs(StudioStyleGuideModifiers) do Color[StudioStyleGuideModifier.Name] = StudioTheme:GetColor(StudioStyleGuideColor, StudioStyleGuideModifier) end Theme[StudioStyleGuideColor.Name] = Color end return Theme end return GetTheme
local BulletTear = Projectile:extend("BulletTear") function BulletTear:new(x, y, dir) BulletTear.super.new(self, x, y) self:setImage("bosses/emotilord/tear") self.dir = dir self.velocity.x = _.random(230, 600) * dir self.rotate = 1 * dir self.angleOffset = PI * -dir self.velocity.y = _.random(-300, -500) self.gravity = Thing.gravity self.floating = false self.damaging = true self.pixelChance = .5 end function BulletTear:update(dt) BulletTear.super.update(self, dt) end function BulletTear:draw() BulletTear.super.draw(self) end function BulletTear:onOverlap(e, mine, his) if e:is(SolidTile) then self:kill() end return BulletTear.super.onOverlap(self, e, mine, his) end return BulletTear
resource_manifest_version "77731fab-63ca-442c-a67b-abc70f28dfa5" this_is_a_map 'yes' files { 'shellpropsv5.ytyp' } data_file 'DLC_ITYP_REQUEST' 'shellpropsv5.ytyp'
local defensiveModule = require "module.DefensiveFortressModule" local View = {}; function View:Start() self.root=CS.SGK.UIReference.Setup(self.gameObject) self.view=self.root.view end function View:InitData(data) self.BossData=data and data.BossData self.LastHP=data and (data.LastHP>=0 and data.LastHP or 0) self:InitUI() end local colorTab={"<color=#095D59FF>","<color=#4B2C09FF>","<color=#092C62FF>","<color=#9D0607FF>","<color=#564804FF>","<color=#480C60FF>","<color=#FDB2B2FF>"} local propertyTab={"风","土","水","火","光","暗"} local activeTab={[0]="等待中","破坏中","发呆","生命回复","移动中"} local activeDesc={[0]="怪物晕乎乎的","破坏据点后,据点将无法产生资源","怪物懵圈中","回复最大生命值10%","魔王向据点发起攻击"} ---[[--boss信息 function View:InitUI() CS.UGUIClickEventListener.Get(self.root.mask.gameObject,true).onClick = function (obj) self.gameObject:SetActive(false) end CS.UGUIClickEventListener.Get(self.view.ExitBtn.gameObject).onClick = function (obj) self.gameObject:SetActive(false) end local bossCfg=defensiveModule.GetBossCfg(self.BossData.Id) self.view.top.bossData.Icon[UI.Image]:LoadSprite("icon/"..bossCfg.Monster_icon) self.view.top.bossData.name[UI.Text].text=bossCfg.Monster_name self.view.top.bossData.line1[UI.Text]:TextFormat("当前血量:") self.view.top.bossData.line1.Slider[UI.Slider].maxValue=bossCfg.Monster_hp self:RefBossData() local _status=self.BossData.Status self.view.top.bossData.line2[UI.Text]:TextFormat("状态:{0}({1})",activeTab[_status],activeDesc[_status]) local propertyCfg=defensiveModule.GetResourceCfgById(bossCfg.Monster_type) self.view.OddsTitle.static_addedOdds[UI.Text]:TextFormat("怪物属性:\t{0}{1}{2}",colorTab[bossCfg.Monster_type],propertyTab[bossCfg.Monster_type],"</color>") local _item=self.view.effects local _elseType=0 for i=1,6 do if i~=bossCfg.restrain_type and i~=bossCfg.Monster_type and i~=bossCfg.Berestrain_type then _elseType=i break end end self:refreshPitFallEffectDesc(_item[1],bossCfg.restrain_type,propertyTab[bossCfg.restrain_type])--相克 self:refreshPitFallEffectDesc(_item[2],bossCfg.Monster_type,propertyTab[bossCfg.Monster_type])--相同 if bossCfg.Berestrain_type~=0 then self:refreshPitFallEffectDesc(_item[3],bossCfg.Berestrain_type,propertyTab[bossCfg.Berestrain_type])--相生 end self:refreshPitFallEffectDesc(_item[4],_elseType,"其余")--其他 end function View:refreshPitFallEffectDesc(item,typeId,typeDes) item.gameObject:SetActive(true) local _value=self:GetPitFallEffectValueByType(typeId) local cfg=defensiveModule.GetResourceCfgById(typeId) item.Icon.gameObject:SetActive(typeDes~="其余") item.Icon[UI.Image]:LoadSprite("propertyIcon/"..cfg.Resource_icon) item.effect[UI.Text]:TextFormat("受 {0} 系陷阱伤害\t{1}%",typeDes,_value/100) end function View:GetPitFallEffectValueByType(type) local pitFallCfg=defensiveModule.GetPitFallLevelCfg(type,1) local bossCfg=defensiveModule.GetBossCfg(self.BossData.Id) local bossType=bossCfg.Monster_type local _value=pitFallCfg.Type1==bossType and pitFallCfg.Value1 or pitFallCfg.Type2==bossType and pitFallCfg.Value2 or pitFallCfg.Type3==bossType and pitFallCfg.Value3 or pitFallCfg.Type4==bossType and pitFallCfg.Value4 or pitFallCfg.Type5==bossType and pitFallCfg.Value5 or pitFallCfg.Value6 return _value end function View:RefBossData() local bossCfg=defensiveModule.GetBossCfg(self.BossData.Id) self.view.top.bossData.line1.Slider[UI.Slider].value=self.LastHP self.view.top.bossData.line1.Slider.Text[UI.Text].text=string.format("%d%%",math.ceil(self.LastHP*100/bossCfg.Monster_hp)) end return View;
-- yleaf(yaroot@gmail.com) if GetLocale() ~= "zhCN" then return end local L = DBM_SpellsUsed_Translations L.TabCategory_SpellsUsed = "冷却助手" L.AreaGeneral = "常规设置" L.Enable = "开启冷却计时" L.Show_LocalMessage = "显示本地提示" L.Enable_inRaid = "只显示团队成员的冷却信息" L.Enable_inBattleground = "战场中同样启用" L.Enable_Portals = "显示时间" L.Reset = "重置设置" L.Local_CastMessage = "检测到施法: %s" L.AreaAuras = "技能设置" L.SpellID = "法术编号" L.BarText = "计时条文字(预设: %spell: %player)" L.Cooldown = "冷却时间" L.Error_FillUp = "请填写完整"
--[[ 和STL map 不同的是,这并不能指定类型 ]] _ENV=namespace "container" using_namespace "luaClass" ---@class map local map=class ("map"){ public{ FUNCTION.map; FUNCTION.del; FUNCTION.has; FUNCTION.get; FUNCTION.insert; FUNCTION.onFun; FUNCTION.size; FUNCTION.iter; FUNCTION.merge; FUNCTION.for_each; }; protected{ MEMBER._data; }; } function map:map(dict) dict=dict or {} self._data=dict end function map:del(key) self._data[key]=nil end function map:has(key) return self._data[key]~=nil end function map:get(key,default) return self._data[key] or default end function map:insert(key,value) self._data[key]=value end ---@param alterFunc fun(value:any,value2:any) function map:onFun(key,alterFunc) self._data[key]=alterFunc() end function map:size() local count=0 for _,_ in pairs(self._data) do count=count+1 end return count end function map:iter() local data=self._data return pairs(data) end function map:merge(map2) for k,v in map2:iter() do self:insert(k,v) end end function map:for_each(callBack) for k,v in self:iter() do callBack(k,v) end end
local api = vim.api local utils = {} -- Function taken from NvimChad utils.map function(mode, lhs, rhs, opts) local options = {noremap = true, silent = true} if opts then options = vim.tbl_extend("force", options, opts) end api.nvim_set_keymap(mode, lhs, rhs, options) end utils.nmap function(key, cmd, opts) return map("n", key, cmd, opts) end utils.vmap function(key, cmd, opts) return map("v", key, cmd, opts) end utils.xmap function(key, cmd, opts) return map("x", key, cmd, opts) end utils.imap function(key, cmd, opts) return map("i", key, cmd, opts) end utils.omap function(key, cmd, opts) return map("o", key, cmd, opts) end utils.smap = function(key, cmd, opts) return map("s", key, cmd, opts) end utils.sugar_folds = function() local start_line = vim.fn.getline(vim.v.foldstart):gsub("\t", ("\t"):rep(vim.opt.tabstop:get())) return string.format("%s ... (%d lines)", start_line, vim.v.foldend - vim.v.foldstart + 1) end --- Executes a git command and gets the output --- @param command string --- @param remove_newlines boolean --- @return string utils.get_git_output = function(command, remove_newlines) local git_command_handler = io.popen(system.git_workspace .. command) -- Read the command output and remove newlines if wanted local command_output = git_command_handler:read("*a") if remove_newlines then command_output = command_output:gsub("[\r\n]", "") end -- Close child process git_command_handler:close() return command_output end return utils
local function FixLazers() for k,v in pairs(ents.FindByClass("env_laser")) do local ts = v:GetSaveTable().LaserTarget if(ts && ts != "") then local t = ents.FindByName(ts)[1] if(t) then local tp = t:GetParent() t:SetParent(nil) --source doesn't enjoy moving things that have parents local p = v:GetParent() v:SetParent(nil) local ep = v:GetPos() local tep = t:GetPos() local c = ep+(tep-ep)*0.5 --we are calculating the centre and using it to trace local tracedata = {} tracedata.start = c tracedata.endpos = ep tracedata.filter = v tracedata.mask = MASK_ALL local trace = util.TraceLine(tracedata) --trace to wall local hp = trace.HitPos local np = hp+((tep-hp)*(1/(hp:Distance(tep)))) --move the position slightly away from the wall v:SetPos(np) if(tp && tp != NULL) then t:SetParent(p) end if(p && p != NULL) then v:SetParent(p) end end end end end hook.Add("InitPostEntity","fixlaz0rs",FixLazers)
local g_ForbWords = {} function CsPreprocessStr(str) local offsets = {} for i = 1, #str do table.insert(offsets, i) end str = str:lower() local tmp = 0 str = str:gsub('()#%x%x%x%x%x%x', function(idx) table.removeMultiple(offsets, idx - tmp, 7) tmp = tmp + 7 return '' end) tmp = 0 local i = 0 str = str:gsub('()(%W*)(%w+)', function(idx, rest, word) if(word:len() ~= 1) then i = 0 elseif(i >= 1) then if(#rest > 0) then table.removeMultiple(offsets, idx - tmp, #rest) tmp = tmp + #rest end return word else i = i + 1 end end) return str, offsets end function CsProcessMsg(msg) if(not Settings.censor) then return msg, false end local prof = DbgPerf(5) local buf, offsets = CsPreprocessStr(msg) local punish = {fine = 0, mute = 0, warn = false, hide = false} local replaceWords = Settings.censor_replace local found = false for i, item in ipairs(g_ForbWords) do for i, j in buf:gmatch('()'..item.pattern..'()') do -- Bad word has been found found = true if(replaceWords) then local repl = item.repl local repl2 = ('*'):rep(j - i) if(not repl) then -- Change word to ***** repl = repl2 end if(#repl ~= #repl2) then for k = j, #offsets do offsets[k] = offsets[k] + #repl - #repl2 end end local before = msg:sub(1, offsets[i] - 1) local after = msg:sub(offsets[j - 1] + 1) msg = before..repl..after buf = buf:sub(1, i - 1)..repl2..buf:sub(j) end -- Update punishment data punish.fine = math.max(punish.fine, item.fine) punish.mute = math.max(punish.mute, item.mute) punish.warn = punish.warn or item.warn punish.hide = punish.hide or item.hide end end if(not found) then return msg, false end -- Censored words have been found punish.fine = math.max(punish.fine, Settings.censor_fine) punish.mute = math.max(punish.mute, Settings.censor_mute) punish.warn = punish.warn or Settings.censor_warn punish.hide = punish.hide or Settings.censor_hide if(punish.hide) then msg = false end prof:cp('CsProcessMsg') return msg, punish end function CsCheckNickname(name) if(not Settings.censor or not Settings.censor_nicknames) then return false end --Debug.info('CsCheckNickname '..name) local plainName = name:lower():gsub('#%x%x%x%x%x%x', '') for i, item in ipairs(g_ForbWords) do if(plainName:find(item.pattern)) then --Debug.info('Detected banned nickname: '..plainName) return true end end return false end function CsPunish(player, punishment) local msg = false if(punishment.fine > 0) then player.accountData:add('cash', -punishment.fine) outputMsg(player, Styles.red, "Do not swear %s! %s has been taken from your cash.", player:getName(true), formatMoney(punishment.fine)) msg = true end if(punishment.mute > 0) then if(player:mute(punishment.mute, 'Censor')) then outputMsg(g_Root, Styles.red, "%s has been muted by Censor (%u seconds)!", player:getName(true), punishment.mute) msg = true end end if(punishment.warn) then if(not warnPlayer(player, Player.getConsole(), 'Censor')) then outputMsg(player, Styles.red, "You have been warned by Censor!") end msg = true end if(punishment.hide and not msg) then outputMsg(player, Styles.red, "Your message contains disallowed content!") end end local function CsLoadWords() -- Open censor configuration file local node = xmlLoadFile('conf/censor.xml') if(not node) then return false end -- Load all words for i, subnode in ipairs(xmlNodeGetChildren(node)) do local attr = xmlNodeGetAttributes(subnode) local word = xmlNodeGetValue(subnode) assert(word:len() > 0) local item = {} item.pattern = word:lower():gsub('%a', '%1+') item.fine = touint(attr.price, 0) item.mute = touint(attr.mute, 0) item.hide = tobool(attr.hide) item.warn = tobool(attr.warn) item.repl = attr.repl table.insert(g_ForbWords, item) end -- Unload file xmlUnloadFile(node) -- Sort patterns from longest to shortest to fix problems with one pattern containing another table.sort(g_ForbWords, function(a, b) return a.pattern:len() > b.pattern:len() end) assert(g_ForbWords[1].pattern:len() >= g_ForbWords[#g_ForbWords-1].pattern:len()) return true end local function CsInit() -- Note: called before players are created CsLoadWords() end addInitFunc(CsInit, -200) #if(TEST) then Test.register('censor', function() Test.checkTblEq({CsPreprocessStr('AbC')}, {'abc', {1, 2, 3}}) Test.checkTblEq({CsPreprocessStr('abc d')}, {'abc d', {1, 2, 3, 4, 5}}) Test.checkTblEq({CsPreprocessStr('a bcd')}, {'a bcd', {1, 2, 3, 4, 5}}) Test.checkTblEq({CsPreprocessStr('a b')}, {'ab', {1, 3}}) Test.checkTblEq({CsPreprocessStr('abc d e')}, {'abc de', {1, 2, 3, 4, 5, 7}}) Test.checkTblEq({CsPreprocessStr('a b cde')}, {'ab cde', {1, 3, 4, 5, 6, 7}}) Test.checkTblEq({CsPreprocessStr('abc d e fg')}, {'abc de fg', {1, 2, 3, 4, 5, 7, 8, 9, 10}}) Test.checkTblEq({CsPreprocessStr('a b c')}, {'abc', {1, 3, 5}}) Test.checkTblEq({CsPreprocessStr('#000000')}, {'', {}}) Test.checkTblEq({CsPreprocessStr('#000000#FFFFFF')}, {'', {}}) Test.checkTblEq({CsPreprocessStr('ab#000000cd')}, {'abcd', {1, 2, 10, 11}}) Test.checkTblEq({CsPreprocessStr('a b#000000 c d')}, {'abcd', {1, 3, 12, 14}}) end) #end
require 'nn' -- Network-in-Network -- achieves 92% with BN and 88% without local model = nn.Sequential() local function Block(...) local arg = {...} model:add(nn.SpatialConvolution(...)) model:add(nn.SpatialBatchNormalization(arg[2],1e-3)) model:add(nn.ReLU(true)) return model end Block(3,192,5,5,1,1,2,2) Block(192,160,1,1) Block(160,96,1,1) model:add(nn.SpatialMaxPooling(3,3,2,2):ceil()) model:add(nn.Dropout()) Block(96,192,5,5,1,1,2,2) Block(192,192,1,1) Block(192,192,1,1) model:add(nn.SpatialAveragePooling(3,3,2,2):ceil()) model:add(nn.Dropout()) Block(192,192,3,3,1,1,1,1) Block(192,192,1,1) Block(192,10,1,1) model:add(nn.SpatialAveragePooling(8,8,1,1):ceil()) model:add(nn.View(10)) for k,v in pairs(model:findModules(('%s.SpatialConvolution'):format(backend_name))) do v.weight:normal(0,0.05) v.bias:zero() end --print(#model:cuda():forward(torch.CudaTensor(1,3,32,32))) return model
------------------------------------------------------------------------------------------- -- -- raylib [shapes] example - Draw raylib custom color palette -- -- This example has been created using raylib 1.6 (www.raylib.com) -- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) -- -- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5) -- ------------------------------------------------------------------------------------------- -- Initialization ------------------------------------------------------------------------------------------- local screenWidth = 800 local screenHeight = 450 InitWindow(screenWidth, screenHeight, "raylib [shapes] example - raylib color palette") SetTargetFPS(60) -- Set target frames-per-second ------------------------------------------------------------------------------------------- -- Main game loop while not WindowShouldClose() do -- Detect window close button or ESC key -- Update --------------------------------------------------------------------------------------- -- TODO: Update your variables here --------------------------------------------------------------------------------------- -- Draw --------------------------------------------------------------------------------------- BeginDrawing() ClearBackground(RAYWHITE) DrawText("raylib color palette", 28, 42, 20, BLACK) DrawRectangle(26, 80, 100, 100, DARKGRAY) DrawRectangle(26, 188, 100, 100, GRAY) DrawRectangle(26, 296, 100, 100, LIGHTGRAY) DrawRectangle(134, 80, 100, 100, MAROON) DrawRectangle(134, 188, 100, 100, RED) DrawRectangle(134, 296, 100, 100, PINK) DrawRectangle(242, 80, 100, 100, ORANGE) DrawRectangle(242, 188, 100, 100, GOLD) DrawRectangle(242, 296, 100, 100, YELLOW) DrawRectangle(350, 80, 100, 100, DARKGREEN) DrawRectangle(350, 188, 100, 100, LIME) DrawRectangle(350, 296, 100, 100, GREEN) DrawRectangle(458, 80, 100, 100, DARKBLUE) DrawRectangle(458, 188, 100, 100, BLUE) DrawRectangle(458, 296, 100, 100, SKYBLUE) DrawRectangle(566, 80, 100, 100, DARKPURPLE) DrawRectangle(566, 188, 100, 100, VIOLET) DrawRectangle(566, 296, 100, 100, PURPLE) DrawRectangle(674, 80, 100, 100, DARKBROWN) DrawRectangle(674, 188, 100, 100, BROWN) DrawRectangle(674, 296, 100, 100, BEIGE) DrawText("DARKGRAY", 65, 166, 10, BLACK) DrawText("GRAY", 93, 274, 10, BLACK) DrawText("LIGHTGRAY", 61, 382, 10, BLACK) DrawText("MAROON", 186, 166, 10, BLACK) DrawText("RED", 208, 274, 10, BLACK) DrawText("PINK", 204, 382, 10, BLACK) DrawText("ORANGE", 295, 166, 10, BLACK) DrawText("GOLD", 310, 274, 10, BLACK) DrawText("YELLOW", 300, 382, 10, BLACK) DrawText("DARKGREEN", 382, 166, 10, BLACK) DrawText("LIME", 420, 274, 10, BLACK) DrawText("GREEN", 410, 382, 10, BLACK) DrawText("DARKBLUE", 498, 166, 10, BLACK) DrawText("BLUE", 526, 274, 10, BLACK) DrawText("SKYBLUE", 505, 382, 10, BLACK) DrawText("DARKPURPLE", 592, 166, 10, BLACK) DrawText("VIOLET", 621, 274, 10, BLACK) DrawText("PURPLE", 620, 382, 10, BLACK) DrawText("DARKBROWN", 705, 166, 10, BLACK) DrawText("BROWN", 733, 274, 10, BLACK) DrawText("BEIGE", 737, 382, 10, BLACK) EndDrawing() --------------------------------------------------------------------------------------- end -- De-Initialization ------------------------------------------------------------------------------------------- CloseWindow() -- Close window and OpenGL context -------------------------------------------------------------------------------------------
LinkLuaModifier( "modifier_animation_translate_permanent_string", "libraries/modifiers/modifier_animation_translate_permanent_string.lua", LUA_MODIFIER_MOTION_NONE ) LinkLuaModifier("modifier_arcana_dbz", "modifiers/modifier_arcana_dbz.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_arcana_rockelec", "modifiers/modifier_arcana_rockelec.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_arcana_pepsi", "modifiers/modifier_arcana_pepsi.lua", LUA_MODIFIER_MOTION_NONE) if HeroCosmetics == nil then DebugPrint ( 'Starting HeroCosmetics' ) HeroCosmetics = class({}) end function HeroCosmetics:Sohei (hero) DebugPrint ( 'Starting Sohei Cosmetics' ) --hero.body = SpawnEntityFromTableSynchronous("prop_dynamic", {model = "models/items/juggernaut/thousand_faces_hakama/thousand_faces_hakama.vmdl"}) --hero.hand = SpawnEntityFromTableSynchronous("prop_dynamic", {model = "models/heroes/sohei/so_weapon.vmdl"}) --hero.head = SpawnEntityFromTableSynchronous("prop_dynamic", {model = "models/heroes/sohei/so_head.vmdl"}) --hero.cape = SpawnEntityFromTableSynchronous("prop_dynamic", {model = "models/items/wraith_king/deadreborn_cape/deadreborn_cape.vmdl"}) -- lock to bone --hero.body:FollowEntity(hero, true) --hero.hand:FollowEntity(hero, true) --hero.head:FollowEntity(hero, true) --hero.cape:FollowEntity(hero, true) --hero:AddNewModifier(hero, nil, 'modifier_animation_translate_permanent_string', {translate = 'walk'}) --hero:AddNewModifier(hero, nil, 'modifier_animation_translate_permanent_string', {translate = 'odachi'}) --hero:AddNewModifier(hero, nil, 'modifier_animation_translate_permanent_string', {translate = 'aggressive'}) end function HeroCosmetics:ApplySelectedArcana (hero, arcana) if hero:GetUnitName( ) == 'npc_dota_hero_sohei' then if arcana == 'DBZSohei' then print('Applying Arcana DBZSohei') hero:AddNewModifier( hero, nil, 'modifier_arcana_dbz', nil ) -- TODO Apply arcana elseif arcana == 'PepsiSohei' then print('Applying Arcana PepsiSohei') hero:AddNewModifier( hero, nil, 'modifier_arcana_pepsi', nil ) -- TODO Apply arcana end elseif hero:GetUnitName( ) == 'npc_dota_hero_electrician' then if arcana == 'RockElectrician' then print('Applying Arcana RockElectrician') hero:AddNewModifier( hero, nil, 'modifier_arcana_rockelec', nil ) -- TODO Apply arcana end end end
-- Item data (c) Grinding Gear Games return { -- Weapon: One Handed Mace [[ 裂颅【仿品】 刚猛巨锤 等级需求: 40, 131 Str 联盟: 夺宝奇兵 固定基底词缀: 1 敌人被晕眩时间延长 30% -5000 命中值 此武器进行的所有攻击皆是暴击 ]], [[ 康戈的战炎【仿品】 惧灵重锤 等级需求: 67, 212 Str replica: true 联盟: 夺宝奇兵 固定基底词缀: 1 有 25% 几率使晕眩时间延长 1 倍 附加 (43-56) - (330-400) 基础物理伤害 暴击后获得 4 秒的【猛攻】状态 +(15-20)% 所有元素抗性 攻击和法术无法被闪避 你的暴击不造成额外暴击伤害 若你近期内用该武器造成暴击,则每秒再生 20% 的能量护盾 ]], [[ 苦梦【仿品】 影语短杖 等级需求: 32, 52 Str, 62 Int replica: true 联盟: 夺宝奇兵 固定基底词缀: 1 元素伤害提高 22% 此物品上的技能石受到 1 级的 元素穿透 辅助 此物品上的技能石受到 10 级的 献祭 辅助 此物品上的技能石受到 1 级的 异常爆发 辅助 此物品上的技能石受到 10 级的 霜咬 辅助 此物品上的技能石受到 1 级的 启迪 辅助 此物品上的技能石受到 10 级的 闪电支配 辅助 ]], [[ 叶兰德尔的拥抱【仿品】 远古之祭 等级需求: 35, 62 Str, 62 Int 联盟: 夺宝奇兵 replica: true 固定基底词缀: 1 元素伤害提高 18% +(20-30) 全属性 召唤生物的伤害提高 (30-40)% 魔卫复苏击中时让敌人受到【灰烬缠身】 魔卫复苏每秒将其最大生命的 (15-30)% 转化为火焰伤害 魔卫复苏获得【火之化身】 ]], [[ 霜息【仿品】 华丽之锤 等级需求: 50, 161 Str 联盟: 夺宝奇兵 replica: true 固定基底词缀: 1 敌人晕眩门槛降低 15% 附加 (53-67) - (71-89) 基础混沌伤害 攻击速度提高 (8-12)% +(23-31)% 混沌抗性 你的混沌伤害可以造成冰缓 此武器的攻击对冰缓的敌人造成双倍伤害 ]], [[ 内布利斯【仿品】 虚影短杖 版本: 3.13.0以前 版本: 当前 联盟: 夺宝奇兵 等级需求: 68, 104 Str, 122 Int replica: true 固定基底词缀: 1 元素伤害提高 40% 施法速度提高 (15-20)% {variant:1}每失去 1% 冰霜抗性,就使冰霜伤害提高 (3-5)% {variant:1}每失去 1% 火焰抗性,就使火焰伤害提高 (3-5)% {variant:2}每失去 1% 冰霜抗性,冰霜伤害就提高 (15-20)%,最多提高 300% {variant:2}每失去 1% 火焰抗性,火焰伤害就提高 (15-20)%,最多提高 300% ]], [[ 烬杵 朽木之棒 联盟: 竞赛专用 插槽: W-W-W 固定基底词缀: 1 敌人晕眩门槛降低 10% 该装备附加 3 - 6 基础火焰伤害 攻击速度提高 20% 燃烧伤害提高 25% 有 30% 几率点燃 敌人被点燃的持续时间延长 500% ]], [[ 漆黑藤杖 皇家短杖 源: 传奇Boss【诸界觉者希鲁斯】 专属掉落 等级需求: 50, 86 Str, 86 Int 固定基底词缀: 1 元素伤害提高 24% +(20-30) 智慧 施法速度提高 (8-15)% 魔力回复速度提高 (40-60)% 召唤生物的伤害提高 (40-60)% 每个召唤的幻灵都给你【幽影之力】 ]], [[ 罪恶吞噬者的叹息 暴君之统 联盟: 战乱之殇 源: 圣堂军团 等级需求: 58 固定基底词缀: 1 元素伤害提高 26% +(10-30) 力量与智慧 获得 30 级的主动技能【惩击】,且可被此道具上的技能石辅助 怪物造成元素异常会作用在附近友方改为在你 ]], [[ 内布利斯(分裂) 虚影短杖 联盟: 虚空忆境 等级需求: 68 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 40% {fractured}施法速度提高 (15-20)% 冰霜抗性高于 75% 时,每高 1%,冰霜伤害便提高 (15-20)% 闪电抗性高于 75% 时,每高 1%,闪电伤害便提高 (15-20)% 分裂之物 ]], [[ 内布利斯(忆境) 虚影短杖 联盟: 虚空忆境 等级需求: 68 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 40% 施法速度提高 (15-20)% 冰霜抗性高于 75% 时,每高 1%,冰霜伤害便提高 (15-20)% 闪电抗性高于 75% 时,每高 1%,闪电伤害便提高 (15-20)% 忆境物品 ]], [[ 光耀之锤 战锤 版本: 2.6.0以前 版本: 3.7.0以前 版本: 当前 等级需求: 20, 71 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2,3}敌人晕眩门槛降低 10% 物理伤害提高 (50-75)% {variant:1,2}攻击速度提高 50% {variant:3}攻击速度提高 45% 该装备的攻击暴击率提高 25% +(20-30)% 火焰抗性 +(20-30)% 闪电抗性 ]],[[ 坚定之刃 圣约之锤 版本: 2.6.0以前 版本: 当前 等级需求: 66, 212 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2}敌人晕眩门槛降低 15% 附加 (5-10) - (15-23) 基础物理伤害 物理伤害提高 (150-200)% 使用该武器时,敌人晕眩门槛降低 (15-25)% 无法击退敌人 晕眩时所有攻击伤害造成冰缓 ]],[[ 卡美利亚之锤 坚锤 升级: 使用 预言【冷酷的贪婪】 升级为 传奇【卡美利亚之贪婪】 版本: 2.6.0以前 版本: 3.0.0以前 版本: 当前 等级需求: 60, 212 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2,3}敌人晕眩门槛降低 15% 物理伤害提高 (140-180)% 附加 (10-20) - (30-50) 基础冰霜伤害 该装备的攻击暴击率提高 (15-40)% {variant:1,2}武器攻击的冰霜伤害提高 (30-40)% {variant:3}攻击技能的冰霜伤害提高 (30-40)% 冰冻的敌人物品稀有度提高 40% ]],[[ 卡美利亚之贪婪 坚锤 版本: 3.12.0以前 版本: 当前 源: 由 传奇【卡美利亚之锤】 使用 预言【冷酷的贪婪】 升级 等级需求: 60 固定基底词缀: 1 敌人晕眩门槛降低 15% 物理伤害提高 (140-180)% 附加 (11-14) - (17-21) 基础物理伤害 该装备的攻击暴击率提高 (15-40)% 冰冻的敌人物品稀有度提高 40% 攻击技能的冰霜伤害提高 (30-40)% {variant:1}你击败被冻结的敌人时触发 20 级的【爆环冰刺】 {variant:2}你击中冻结的敌人时触发 20 级爆环冰刺 ]],[[ 塑泥者 破岩锤 版本: 2.6.0以前 版本: 当前 等级需求: 41, 134 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2}敌人晕眩门槛降低 15% 附加 (24-30) - (34-40) 基础物理伤害 攻击速度提高 (8-10)% 召唤生物的最大生命提高 (20-30)% 召唤生物的攻击额外造成 (5-8) - (12-16) 物理伤害 最多可同时拥有额外 1 个魔像 获得 12 级的【召唤巨石魔像】 ]],[[ 血肉之嗜 梦境之锤 版本: 2.6.0以前 版本: 当前 等级需求: 32, 107 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人晕眩门槛降低 10% 物理伤害提高 (60-80)% 附加 10 - 15 基础物理伤害 攻击速度提高 10% 物理攻击伤害的 1% 会转化为生命偷取 {variant:1}击中时 10% 几率造成流血 {variant:2}击中时 30% 几率造成流血 {variant:1}对流血敌人造成的攻击伤害的 1% 转化为生命偷取 {variant:2}对流血敌人造成的攻击伤害的 3% 转化为生命偷取 ]],[[ 霜息 华丽之锤 版本: 2.6.0以前 版本: 3.0.0以前 版本: 当前 等级需求: 50, 161 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2,3}敌人晕眩门槛降低 15% {variant:1,2}附加 (16-22) - (26-32) 基础物理伤害 {variant:3}附加 (26-32) - (36-42) 基础物理伤害 {variant:1,2}附加 (16-22) - (26-32) 基础冰霜伤害 {variant:3}附加 (26-32) - (36-42) 基础冰霜伤害 攻击速度提高 (8-14)% +(40-50)% 火焰抗性 敌人被冰缓的持续时间延长 (35-50)% 此武器的攻击对冰缓的敌人造成双倍伤害 ]],[[ 血裂 钝钉木棒 版本: 2.6.0以前 版本: 当前 等级需求: 10, 41 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人晕眩门槛降低 10% 物理伤害提高 (300-360)% 攻击速度降低 20% 敌人晕眩门槛降低 (10-20)% 敌人被晕眩时间延长 (30-50)% 对流血敌人的近战伤害提高 30% ]],[[ 拉维安加的智慧 战锤 联盟: 战乱之殇 源: 卡鲁军团 版本: 2.6.0以前 版本: 3.7.0以前 版本: 3.7.0以后 等级需求: 20, 71 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2,3}敌人晕眩门槛降低 10% {variant:1,2}+(10-20) 最大生命 {variant:3}+70 最大生命 {variant:1,2}+(10-20) 最大魔力 {variant:3}+70 最大魔力 {variant:1,2}物理伤害提高 (130-160)% {variant:3}物理伤害提高 (160-200)% 移动速度降低 5% {variant:1,2}范围效果扩大 10% {variant:3}范围效果扩大 (15-25)% {variant:1,2}范围伤害提高 (10-15)% {variant:3}范围伤害提高 (10-20)% ]],[[ 沉默之雷 坚锤 版本: 2.0.0以前 版本: 2.4.0以前 版本: 2.6.0以前 版本: 3.0.0以前 版本: 当前 等级需求: 60, 412 Str, 300 Int 固定基底词缀: 2 {variant:1,2,3}敌人被晕眩时间延长 40% {variant:4,5}敌人晕眩门槛降低 15% 物理伤害提高 (80-120)% 投射物可以连锁弹射 +1 次 {variant:1,2,3,4}武器攻击的闪电伤害提高 (30-40)% {variant:5}攻击技能的闪电伤害提高 (30-40)% +200 力量需求 +300 智慧需求 {variant:1}击中时 50% 几率触发插槽内的闪电法术 {variant:2}击中时 30% 几率触发插槽内的闪电法术 {variant:3,4,5}击中时触发插槽内的闪电法术 触发后,插槽内闪电法术的法术伤害提高 100% ]],[[ 尼布洛克 梦魇之锤 源:源: 传奇Boss【裂界者】 专属掉落 (T6地图或以上) 版本: 3.4.0以前 版本: 当前 等级需求: 68 固定基底词缀: 1 敌人晕眩门槛降低 10% 附加 (45-60) - (100-120) 基础物理伤害 获得等同 (30-40)% 物理攻击伤害的火焰伤害 每个耐力球附加 +4% 混沌抗性 每个耐力球可使被击中时受到的火焰、冰霜、闪电伤害降低 1% 每个耐力球附加 5 - 8 基础物理伤害 每个耐力球增加 +500 点护甲 {variant:1}近期内你若被击中过,则每有 1 个耐力球,就会每秒受到 400 火焰伤害 {variant:2}近期内你若被击中过,则每有 1 个耐力球,就会每秒受到 200 火焰伤害 裂界之器 ]], -- Weapon: Sceptre [[ 占星 虚影短杖 版本: 3.5.0以前 版本: 当前 源: 传奇Boss【裂界守卫:净世】 专属掉落(T11地图或以上) 等级需求: 68 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 40% 物理伤害提高 (180-200)% 攻击速度提高 (10-15)% 该装备的攻击暴击率提高 (80-100)% 物理伤害的 50% 转换为闪电伤害 每 16 秒获得一次【元素超载】,持续 8 秒 当你没有获得【元素超载】时,获得【坚毅之心】 {variant:2}你获得【坚毅之心】时,物理伤害提高 100% 裂界之器 ]],[[ 历史公理 铜锻短杖 版本: 2.3.0以前 版本: 当前 等级需求: 10, 22 Str, 22 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2}火焰、冰霜、闪电伤害提高 12% 施法速度提高 (4-6)% 法术暴击率提高 (100-140)% 法术附加 (2-3) - (5-6) 基础火焰伤害 法术附加 (2-3) - (5-6) 基础冰霜伤害 法术附加 1 - (10-12) 基础闪电伤害 ]],[[ 灾难之光 灵石短杖 等级需求: 60 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 40% 获得 25 级的主动技能【灼热光线】,且可被此道具上的技能石辅助 施法速度提高 (12-20)% 击败敌人时回复 (1-3)% 最大生命 击败敌人时回复 (1-3)% 最大魔力 【灼热光线】的光束长度延长 10% ]],[[ 苦梦 影语短杖 版本: 2.3.0以前 版本: 3.11.0以前 版本: 当前 等级需求: 32, 52 Str, 62 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 15% {variant:2,3}火焰、冰霜、闪电伤害提高 22% 此物品上的技能石受到 1 级的 急冻 辅助 此物品上的技能石受到 1 级的 霜咬 辅助 此物品上的技能石受到 1 级的 冰霜穿透 辅助 {variant:1,2}此物品上的技能石受到 1 级的 魔力偷取 辅助 {variant:3}此物品上的技能石受到 1 级的 彻骨 辅助 此物品上的技能石受到 10 级的 附加冰霜伤害 辅助 此物品上的技能石受到 1 级的 魔力减免 辅助 ]],[[ 议会之息 禁礼短杖 源: 预言【疫病大嘴兽 V】 版本: 3.0.0以前 版本: 当前 等级需求: 66, 113 Str, 113 Int 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 32% 物理伤害提高 (260-310)% {variant:1}混沌伤害提高 (60-80)% {variant:2}混沌伤害提高 (80-100)% 范围效果扩大 10% 混沌技能效果持续时间延长 40% ]],[[ 布鲁特斯的刑具 祭仪短杖 联盟: 苦痛 版本: 2.3.0以前 版本: 2.6.0以前 版本: 3.0.0以前 版本: 当前 等级需求: 28, 51 Str, 51 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2,3,4}火焰、冰霜、闪电伤害提高 16% 物理伤害提高 20% {variant:1,2}对被点燃敌人附加 15 - 25 基础火焰伤害 附加 (8-13) - (26-31) 基础物理伤害 {variant:3}每 10 点力量可以为攻击附加 2 - 4 基础火焰伤害 {variant:4}使用此武器攻击时,每 10 点力量附加 4 - 7 基础火焰伤害 火焰伤害提高 30% 攻击速度提高 (15-20)% 该装备的攻击暴击率提高 (30-40)% ]],[[ 黯黑贤者 影语短杖 联盟: 超越 版本: 2.3.0以前 版本: 3.0.0以前 版本: 3.11.0以前 版本: 当前(生命/魔力) 版本: 当前(生命/能量护盾) 版本: 当前(魔力/能量护盾) 等级需求: 32, 52 Str, 62 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 15% {variant:2,3,4,5,6}火焰、冰霜、闪电伤害提高 22% {variant:1,2,3}全局伤害提高 (30-50)% {variant:4,5,6}全局伤害提高 (40-60)% {variant:1,2,3}击中时有 7% 几率使敌人致盲 {variant:4,5,6}击中时有 10% 几率使敌人致盲 {variant:1,2}每一级在击败敌人时获得 +1 魔力 {variant:1,2}每一级在击败敌人时获得 +1 能量护盾 {variant:4,5}每级 +1 生命 {variant:4,6}每级 +1 魔力 {variant:5,6}每级 +1 能量护盾 {variant:1,2,3}不会被致盲 {variant:4,5,6}目盲不会影响你的命中率 {variant:4,5,6}你在目盲状态下,被你致盲的敌人受到【恶语术】影响 ]],[[ 死神之手 卡鲁短杖 版本: 2.3.0以前 版本: 3.7.0以前 版本: 当前 等级需求: 56, 96 Str, 96 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2,3}火焰、冰霜、闪电伤害提高 26% {variant:1,2}附加 (30-41) - (80-123) 基础物理伤害 {variant:3}附加 (35-46) - (85-128) 基础物理伤害 该装备的攻击暴击率提高 (20-50)% 晕眩时有 30% 几率获得暴击球 {variant:1,2}暴击时获得【不洁之力】 2 秒 {variant:3}暴击时获得【不洁之力】 4 秒 ]],[[ 黑钢 瓦尔短杖 版本: 2.3.0以前 版本: 当前 等级需求: 64, 113 Str, 113 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2}火焰、冰霜、闪电伤害提高 32% +(50-70) 力量 施法速度提高 (15-18)% +(20-30) 最大魔力 此物品上的技能石受到 30 级的钢铁意志辅助 在主手时,每 8 力量提高 1% 伤害 在副手时,每 16 力量提高 1% 护甲 ]],[[ 多里亚尼的幻化之杖 瓦尔短杖 源: 传奇Boss【瓦尔女王阿兹里】 专属掉落(地图【生贽之尖】) 版本: 2.3.0以前 版本: 当前 等级需求: 75, 113 Str, 113 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2}火焰、冰霜、闪电伤害提高 32% 此物品上的技能石受到 20 级的 元素扩散 辅助 附加 (65-85) - (100-160) 基础物理伤害 攻击速度提高 (11-15)% 施法速度提高 (6-10)% 攻击和法术暴击率提高 (30-40)% 火焰、冰霜、闪电伤害的 0.2% 转化为生命偷取 火焰、冰霜、闪电伤害提高 (80-100)% ]],[[ 凋灵魔爪 虚影短杖 版本: 1.2.0以前 版本: 2.3.0以前 版本: 2.6.0以前 版本: 当前 等级需求: 68, 104 Str, 122 Int 固定基底词缀: 2 {variant:1,2}火焰、冰霜、闪电伤害提高 15% {variant:3,4}火焰、冰霜、闪电伤害提高 40% 魔卫数量上限降低 50% {variant:1}+500 魔卫最大生命 {variant:2,3}+2000 魔卫最大生命 {variant:4}+5000 魔卫最大生命 魔卫抗性提高 (25-30)% 魔卫体型增大 25% {variant:1,2,3}魔卫的物理伤害提高 (80-100)% {variant:4}魔卫的物理总伤害额外提高 (80-100)% 魔卫击败敌人时,产生的爆炸会造成火焰伤害 ]],[[ 奈可妲之灯 水晶短杖 版本: 2.0.0以前 版本: 2.3.0以前 版本: 2.6.0以前 版本: 当前 等级需求: 41, 59 Str, 85 Int 固定基底词缀: 2 {variant:1,2}火焰、冰霜、闪电伤害提高 20% {variant:3,4}火焰、冰霜、闪电伤害提高 30% {variant:4}此物品上装备的【火焰技能石】等级 +2 {variant:1,2,3}此物品上的技能石受到 10 级的 附加火焰伤害 辅助 {variant:1,2,3}此物品上的技能石受到 10 级的 寒冰转烈焰 辅助 此物品上的技能石受到 10 级的 火焰穿透 辅助 {variant:4}此物品上的技能石额外造成 63 - 94 火焰伤害 法术伤害提高 (20-30)% {variant:2,3,4}物理伤害提高 (150-200)% 攻击击中每个敌人会回复 +(6-10) 生命 照亮范围扩大 25% ]],[[ 奇异 白金短杖 版本: 2.3.0以前 版本: 3.0.0以前 版本: 当前 等级需求: 62, 113 Str, 113 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2,3}火焰、冰霜、闪电伤害提高 30% 法术附加 (30-40) - (60-70) 闪电伤害 施法速度提高 (14-18)% 技能魔力消耗降低 (6-8)% 周围敌人被干扰,移动速度降低 25% {variant:1,2}对被干扰敌人的伤害提高 (60-80)% {variant:3}击中和异常状态对被干扰敌人的伤害提高 (60-80)% ]],[[ 先驱之脊 冷铁短杖 源: 帝王试炼迷宫专属掉落 版本: 2.3.0以前 版本: 3.0.0以前 版本: 3.5.0以前 版本: 当前 等级需求: 20, 38 Str, 38 Int 固定基底词缀: 2 {variant:1}火焰、冰霜、闪电伤害提高 10% {variant:2,3,4}火焰、冰霜、闪电伤害提高 14% 物理伤害提高 (100-140)% {variant:1,2}对被冰冻敌人的击中伤害提高 40% {variant:3,4}对被冰冻敌人的击中伤害提高 40% 冰霜伤害提高 (30-50)% 攻击速度提高 (5-10)% 施法速度提高 (4-8)% 冰霜伤害击中时有 5% 的几率冰冻敌人 {variant:4}持续冰霜伤害效果提高 (25-35)% ]],[[ 无上箴言 水晶短杖 版本: 2.0.0以前 版本: 2.3.0以前 版本: 当前 等级需求: 41, 59 Str, 136 Int 固定基底词缀: 2 {variant:1,2}火焰、冰霜、闪电伤害提高 20% {variant:3}火焰、冰霜、闪电伤害提高 30% 此物品上装备的技能石等级 +1 物理伤害提高 (80-100)% 攻击速度提高 (10-20)% {variant:1}经验值获取提高 5% {variant:2,3}经验值获取提高 3% 火焰、冰霜、闪电伤害提高 20% 智慧需求提高 60% ]], -- Weapon: Two Handed Mace [[ 脑乱者 戮魂重锤 源: 传奇Boss【牛头人守卫】 专属掉落 版本: 2.6.0以前 版本: 3.11.0以前 版本: 当前 等级需求: 63, 212 Str 固定基底词缀: 3 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人被晕眩时间延长 30% {variant:3}有 5% 几率造成双倍伤害 {variant:1,2}附加 (80-100) - (320-370) 基础物理伤害 {variant:3}附加 (60-80) - (270-320) 基础物理伤害 物理伤害的 50% 转换为闪电伤害 {variant:1,2}闪电伤害击中时有 15% 几率使敌人受到感电效果影响 {variant:3}闪电伤害击中时有 50% 几率使敌人受到感电效果影响 {variant:1,2}10% 几率使敌人逃跑 被你感电的敌人施法速度降低 30% 被你感电的敌人移动速度降低 20% 伤害穿透 20% 闪电抗性 {variant:3}如同额外造成 300% 总伤害来计算感电门槛 ]],[[ 忠诚之锤 刚猛巨锤 升级: 使用 预言【信仰恢复】 升级为 传奇【石冢】 版本: 2.6.0以前 版本: 3.0.0以前 版本: 当前 等级需求: 40, 104 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2,3}敌人被晕眩时间延长 30% 此物品上装备的【近战技能石】等级 +1 此物品上装备的【召唤生物技能石】等级 +1 {variant:1,2}物理伤害提高 (100-120)% {variant:3}物理伤害提高 (200-220)% 最大魔力提高 25% 召唤生物的最大生命提高 (20-40)% 技能效果持续时间延长 15% 力量需求降低 20% ]],[[ 吉尔菲的净罪之锤 铜影巨锤 升级: 使用 预言【黑暗狂热】 升级 传奇【吉尔菲的奉献之锤】 版本: 2.6.0以前 版本: 当前 等级需求: 27, 92 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人被晕眩时间延长 30% 物理伤害提高 200% 附加 11 - 23 基础冰霜伤害 敌人被晕眩时间延长 (10-20)% 无法造成暴击 ]],[[ 吉尔菲的奉献之锤 铜影巨锤 版本: 3.11.0以前 版本: 当前 源: 由 传奇【吉尔菲的净罪之锤】 使用 预言【黑暗狂热】 升级 等级需求: 61 固定基底词缀: 1 敌人被晕眩时间延长 20% {variant:1}被诅咒时你击中一个敌人,触发 20 级的【元素守卫】 {variant:2}被诅咒时你近战攻击击中一个敌人,触发 20 级的【元素守卫】 物理伤害提高 200% {variant:1}附加 (50-56) - (73-78) 基础物理伤害 {variant:2}附加 (42-47) - (66-71) 基础物理伤害 附加 11 - 23 基础冰霜伤害 敌人被晕眩时间延长 (10-20)% 无法造成暴击 ]],[[ 雷姆诺的挽歌 冷铁重锤 升级: 使用 预言【冬季悲歌】 升级为 传奇【雷姆诺的挽歌】 版本: 2.6.0以前 版本: 当前 等级需求: 36, 62 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2}敌人被晕眩时间延长 45% 物理伤害提高 (140-200)% 附加 (10-20) - (30-40) 基础物理伤害 +10 力量 敌人晕眩门槛降低 15% 物理攻击伤害的 1% 会转化为生命偷取 敌人被晕眩时间延长 (40-50)% 获得额外冰霜伤害, 其数值等同于物理伤害的 50% ]],[[ 雷姆诺的夺命凶器 冷铁重锤 源: 由 传奇【雷姆诺的夺命凶器】 使用 预言【冬季悲歌】 升级 版本: 2.6.0以前 版本: 当前 等级需求: 17, 62 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2}敌人被晕眩时间延长 45% 物理伤害提高 (140-200)% +10 力量 敌人晕眩门槛降低 15% 物理攻击伤害的 1% 会转化为生命偷取 敌人被晕眩时间延长 (40-50)% ]],[[ 乔赫黑钢 沉钢重锤 联盟: 风暴 版本: 2.6.0以前 版本: 当前 等级需求: 44, 143 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 40% {variant:2}敌人被晕眩时间延长 45% 物理伤害提高 (150-200)% 施法速度提高 (8-12)% 攻击速度提高 (8-12)% 30% 较少幻化武器时间 你幻化的武器将额外复制 1 把 {variant:2}击败敌人时有 25% 几率触发 20 级的【幻化武器】 ]],[[ 康戈的战炎 惧灵重锤 版本: 2.0.0以前 版本: 2.6.0以前 版本: 3.11.0以前 版本: 当前 等级需求: 67, 212 Str 固定基底词缀: 3 {variant:1,2}敌人被晕眩时间延长 20% {variant:3}敌人被晕眩时间延长 30% {variant:4}有 25% 几率使晕眩时间延长 1 倍 {variant:1}附加 (27-36) - (270-360) 基础物理伤害 {variant:2,3,4}附加 (27-56) - (270-400) 基础物理伤害 {variant:2,3,4}该装备的攻击暴击率提高 (30-40)% 获得 +(15-20)% 火焰、冰霜、闪电抗性 攻击和法术无法被闪避 你的暴击不造成额外暴击伤害 {variant:1,2}暴击后获得 2 秒的【猛攻】状态 {variant:3,4}暴击后获得 4 秒的【猛攻】状态 ]],[[ 尔奇的巨灵之锤 卡鲁重锤 联盟: 战乱之殇 源: 卡鲁军团 版本: 2.6.0以前 版本: 3.7.0以前 版本: 3.11.0以前 版本: 当前 等级需求: 57, 182 Str 固定基底词缀: 3 {variant:1}敌人被晕眩时间延长 20% {variant:2,3,4}敌人被晕眩时间延长 30% {variant:4}敌人被晕眩时间延长 45% 此物品上的技能石受到 15 级的 增大范围 辅助 {variant:3,4}此物品上的技能石受到 15 级的 粉碎 辅助 {variant:1,2}物理伤害提高 (220-250)% {variant:3}物理伤害提高 (230-260)% {variant:4}物理伤害提高 (200-230)% {variant:1,2}附加 10 - 20 基础物理伤害 {variant:3,4}附加 30 - 40 基础物理伤害 攻击速度降低 10% -100 命中值 移动速度降低 10% 敌人被晕眩时间延长 (40-50)% ]],[[ 重击之锤 狼牙重锤 升级: 使用 预言【帝王之陨】 升级为 传奇【巨击之锤】 版本: 2.6.0以前 版本: 当前 等级需求: 22, 77 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人被晕眩时间延长 30% 物理伤害提高 (80-100)% 附加 5 - 25 基础物理伤害 +(25-50) 全属性 击败敌人回复 +10 生命 敌人死后爆炸,造成敌人生命 10% 的火焰伤害 ]],[[ 巨击之锤 狼牙重锤 源: 由传奇【重击之锤】 使用 预言【帝王之陨】 升级 等级需求: 61 固定基底词缀: 1 敌人被晕眩时间延长 30% 物理伤害提高 (80-100)% 附加 (94-98) - (115-121) 基础物理伤害 +(25-50) 全属性 敌人死后爆炸,造成敌人生命 10% 的火焰伤害 击败敌人时回复 5% 最大生命 ]],[[ 局势逆转者 帝国重锤 版本: 3.5.0以前 版本: 3.11.0以前 版本: 当前 等级需求: 65, 212 Str 固定基底词缀: 1 {variant:1,2}敌人被晕眩时间延长 30% {variant:3}力量提高 10% 插槽内的技能石受到 20 级的 近战击晕获得耐力球 辅助 {variant:1}附加 (60-70) - (300-350) 基础物理伤害 {variant:2,3}附加 (70-80) - (340-375) 基础物理伤害 +40 智慧 每个耐力球可使物理伤害提高 10% 使用该武器时,敌人晕眩门槛降低 (20-30)% ]],[[ 裂颅 刚猛巨锤 联盟: 普兰德斯 版本: 2.6.0以前 版本: 当前 等级需求: 40, 131 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人被晕眩时间延长 30% 攻击速度降低 50% 此武器进行的所有攻击皆是暴击 ]],[[ 逝空之锤 威权巨锤 版本: 2.6.0以前 版本: 当前 等级需求: 54, 173 Str 固定基底词缀: 2 {variant:1}敌人被晕眩时间延长 20% {variant:2}敌人被晕眩时间延长 30% 物理伤害提高 150% 攻击速度提高 50% 物品稀有度降低 (30-50)% 经验值获取降低 (30-50)% 物理攻击伤害的 0.4% 转化为魔力偷取 ]], [[ 叶兰德尔的拥抱 远古之祭 等级需求: 35 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 18% +(20-30) 全属性 召唤生物的伤害提高 (30-40)% 异灵魔侍击中时让敌人受到【灰烬缠身】 异灵魔侍每秒将其最大生命的 (15-30)% 转化为火焰伤害 异灵魔侍获得【火之化身】 ]], [[ 冥犬残肢 血色短杖 联盟: 地心 源: 传奇Boss【盲目者亚华托提利】 专属掉落 等级需求: 47 固定基底词缀: 1 火焰、冰霜、闪电伤害提高 24% 法术伤害提高 (70-100)% 施法速度提高 (15-20)% 装备的护盾格挡几率若不低于 30%,则法术伤害的 0.5% 转化为生命偷取 装备的护盾上每有 5 点护甲,便 +1 最大能量护盾 装备的护盾上每有 5 点闪避值,便 +5 护甲 装备的护盾上每有 5 点最大能量护盾,便 +20 闪避值 ]], [[ 石冢 刚猛巨锤 源: 由 传奇【忠诚之锤】 使用 预言【信仰恢复】 升级 等级需求: 60 固定基底词缀: 1 敌人被晕眩时间延长 30% 此物品上装备的【近战技能石】等级 +1 此物品上装备的【召唤生物技能石】等级 +2 该装备的物理伤害提高 (200-220)% 附加 (25-35) - (45-55) 基础物理伤害 最大魔力提高 25% 召唤生物的最大生命提高 (20-40)% 技能效果持续时间延长 30% ]], }
--[[TODO Player needs to be able to do the following to a book (ignoring the gui/input): -Favourite -Like -Dislike -Mark as read -Mark as unread -Add to book pouch To support that functionality, we need client side functions that signal remotes that the server side is listening to. ]] local ReplicatedStorage = game:GetService("ReplicatedStorage") local Profile = require(ReplicatedStorage.Profile) local remotes = ReplicatedStorage.Remotes local AUTOSAVE_FREQ = 60 local ServerScriptService = game:GetService("ServerScriptService") local DataStores = require(ServerScriptService.DataStores) local profileStore = DataStores:GetDataStore("Profiles") local oldPlaylistStore = DataStores:GetDataStore("Playlists") local Music = require(ServerScriptService.MusicServer) local Tutorial = require(ServerScriptService.Tutorial) local NewRemote = require(ServerScriptService.NewRemote) local Players = game:GetService("Players") local profiles = {} -- Player->Profile Players.PlayerAdded:Connect(function(player) local profile local success, profileData = profileStore:Get(player.UserId, function() return not player.Parent end, true) if not player.Parent then return end if success then if profileData then profile = Profile.Deserialize(profileData) else profile = Profile.new() local success, songs = oldPlaylistStore:Get("user_" .. player.UserId, function() return not player.Parent end, true) if success then if songs then profile.Music:CreateNewPlaylist(nil, Music.FilterSongs(songs)) end else warn("Data store failed to load old profile for", player.Name .. ":", songs) end end else warn("Data store failed to load profile for", player.Name .. ":", profileData) profile = Profile.new() end local event = profiles[player] profiles[player] = profile if event then event:Fire() event:Destroy() end while true do wait(AUTOSAVE_FREQ) if not player.Parent then break end profileStore:SetFunc(player.UserId, function() return profile:Serialize() end, function() return not player.Parent end) end end) local function pcallLog(func) local success, msg = pcall(func) if not success then warn(debug.traceback(msg)) end return success, msg end Players.PlayerRemoving:Connect(function(player) local profile = profiles[player] pcallLog(function() if typeof(profile) == "Instance" then -- it's an event; a thread is waiting on the profile loading profile:Fire(nil) else pcall(function() profileStore:Set(player.UserId, profile:Serialize()) end) end profile:Destroy() end) profiles[player] = nil end) game:BindToClose(function() while next(profiles) do wait() end end) local function new(type, name) local r = Instance.new(type) r.Name = name r.Parent = remotes return r end local function getProfile(player) -- note: can return nil if the player leaves before their profile loads local profile = profiles[player] if not profile then local event = Instance.new("BindableEvent") profiles[player] = event event.Event:Wait() profile = profiles[player] end return profile end new("RemoteFunction", "GetProfile").OnServerInvoke = function(player) return getProfile(player):Serialize() end local function get(key) return function(player) local profile = getProfile(player) return profile and profile[key] end end Music.InitRemotes(NewRemote.newFolder(remotes, "Music", get("Music"))) Tutorial.InitRemotes(NewRemote.new(remotes, get("Tutorial")))
function init() setName("Colorizer") setDesc("Colors texture") setSize(108, 24+64+8+4+18+18+18+18+7+4) addOutput(24+32) addInput("Texture", 24+64+8+8) addCRamp(24+64+8+18+4) end function apply() colorize() end
local lpeg = require('lpeg') -- Copyright 2006-2020 Robert Gieseke. See License.txt. -- NSIS LPeg lexer -- Based on NSIS 2.46 docs: http://nsis.sourceforge.net/Docs/. local lexer = require('syntaxhighlight.textadept.lexer') local token, word_match = lexer.token, lexer.word_match local P, R, S = lpeg.P, lpeg.R, lpeg.S local lex = lexer.new('nsis') -- Whitespace. lex:add_rule('whitespace', token(lexer.WHITESPACE, lexer.space^1)) -- Comments (4.1). local line_comment = lexer.to_eol(P(';') + '#') local block_comment = lexer.range('/*', '*/') lex:add_rule('comment', token(lexer.COMMENT, line_comment + block_comment)) -- Strings. local sq_str = lexer.range("'") local dq_str = lexer.range('"') local bq_str = lexer.range('`') lex:add_rule('string', token(lexer.STRING, sq_str + dq_str + bq_str)) -- Constants (4.2.3). lex:add_rule('constant', token(lexer.CONSTANT, word_match[[ $PROGRAMFILES $PROGRAMFILES32 $PROGRAMFILES64 $COMMONFILES $COMMONFILES32 $COMMONFILES64 $DESKTOP $EXEDIR $EXEFILE $EXEPATH ${NSISDIR} $WINDIR $SYSDIR $TEMP $STARTMENU $SMPROGRAMS $SMSTARTUP $QUICKLAUNCH$DOCUMENTS $SENDTO $RECENT $FAVORITES $MUSIC $PICTURES $VIDEOS $NETHOOD $FONTS $TEMPLATES $APPDATA $LOCALAPPDATA $PRINTHOOD $INTERNET_CACHE $COOKIES $HISTORY $PROFILE $ADMINTOOLS $RESOURCES $RESOURCES_LOCALIZED $CDBURN_AREA $HWNDPARENT $PLUGINSDIR ]])) -- TODO? Constants used in strings: $$ $\r $\n $\t -- Variables (4.2). lex:add_rule('variable', token(lexer.VARIABLE, word_match[[ $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $R0 $R1 $R2 $R3 $R4 $R5 $R6 $R7 $R8 $R9 $INSTDIR $OUTDIR $CMDLINE $LANGUAGE Var /GLOBAL ]]) + '$' * lexer.word) -- Keywords. lex:add_rule('keyword', token(lexer.KEYWORD, word_match[[ -- Pages (4.5). Page UninstPage PageEx PageEnd PageExEnd -- Section commands (4.6). AddSize Section SectionEnd SectionIn SectionGroup SectionGroupEnd -- Functions (4.7). Function FunctionEnd -- Callbacks (4.7.2). .onGUIInit .onInit .onInstFailed .onInstSuccess .onGUIEnd .onMouseOverSection .onRebootFailed .onSelChange .onUserAbort .onVerifyInstDir un.onGUIInit un.onInit un.onUninstFailed un.onUninstSuccess un.onGUIEnd un.onRebootFailed un.onSelChange un.onUserAbort -- General Attributes (4.8.1). AddBrandingImage AllowRootDirInstall AutoCloseWindow BGFont BGFont BrandingText /TRIMLEFT /TRIMRIGHT /TRIMCENTER Caption ChangeUI CheckBitmap CompletedText ComponentText CRCCheck DetailsButtonText DirText DirVar DirVerify FileErrorText Icon InstallButtonText InstallColors InstallDir InstallDirRegKey InstProgressFlags InstType LicenseBkColor LicenseData LicenseForceSelection LicenseText MiscButtonText Name OutFile RequestExecutionLevel SetFont ShowInstDetails ShowUninstDetails SilentInstall SilentUnInstall SpaceTexts SubCaption UninstallButtonText UninstallCaption UninstallIcon UninstallSubCaption UninstallText WindowIcon XPStyle admin auto bottom checkbox false force height hide highest leave left nevershow none normal off on radiobuttons right show silent silentlog top true user width -- Compiler Flags (4.8.2). AllowSkipFiles FileBufSize SetCompress SetCompressor /SOLID /FINAL zlib bzip2 lzma SetCompressorDictSize SetDatablockOptimize SetDateSave SetOverwrite ifnewer ifdiff lastused try -- Version Information (4.8.3). VIAddVersionKey VIProductVersion /LANG ProductName Comments CompanyName LegalCopyright FileDescription FileVersion ProductVersion InternalName LegalTrademarks OriginalFilename PrivateBuild SpecialBuild -- Basic Instructions (4.9.1). Delete /REBOOTOK Exec ExecShell ExecShell File /nonfatal Rename ReserveFile RMDir SetOutPath -- Registry INI File Instructions (4.9.2). DeleteINISec DeleteINIStr DeleteRegKey /ifempty DeleteRegValue EnumRegKey EnumRegValue ExpandEnvStrings FlushINI ReadEnvStr ReadINIStr ReadRegDWORD ReadRegStr WriteINIStr WriteRegBin WriteRegDWORD WriteRegStr WriteRegExpandStr HKCR HKEY_CLASSES_ROOT HKLM HKEY_LOCAL_MACHINE HKCU HKEY_CURRENT_USER HKU HKEY_USERS HKCC HKEY_CURRENT_CONFIG HKDD HKEY_DYN_DATA HKPD HKEY_PERFORMANCE_DATA SHCTX SHELL_CONTEXT -- General Purpose Instructions (4.9.3). CallInstDLL CopyFiles /SILENT /FILESONLY CreateDirectory CreateShortCut GetDLLVersion GetDLLVersionLocal GetFileTime GetFileTimeLocal GetFullPathName /SHORT GetTempFileName SearchPath SetFileAttributes RegDLL UnRegDLL -- Flow Control Instructions (4.9.4). Abort Call ClearErrors GetCurrentAddress GetFunctionAddress GetLabelAddress Goto IfAbort IfErrors IfFileExists IfRebootFlag IfSilent IntCmp IntCmpU MessageBox MB_OK MB_OKCANCEL MB_ABORTRETRYIGNORE MB_RETRYCANCEL MB_YESNO MB_YESNOCANCEL MB_ICONEXCLAMATION MB_ICONINFORMATION MB_ICONQUESTION MB_ICONSTOP MB_USERICON MB_TOPMOST MB_SETFOREGROUND MB_RIGHT MB_RTLREADING MB_DEFBUTTON1 MB_DEFBUTTON2 MB_DEFBUTTON3 MB_DEFBUTTON4 IDABORT IDCANCEL IDIGNORE IDNO IDOK IDRETRY IDYES Return Quit SetErrors StrCmp StrCmpS -- File Instructions (4.9.5). FileClose FileOpen FileRead FileReadByte FileSeek FileWrite FileWriteByte FindClose FindFirst FindNext -- Uninstaller Instructions (4.9.6). WriteUninstaller -- Miscellaneous Instructions (4.9.7). GetErrorLevel GetInstDirError InitPluginsDir Nop SetErrorLevel SetRegView SetShellVarContext all current Sleep -- String Manipulation Instructions (4.9.8). StrCpy StrLen -- Stack Support (4.9.9). Exch Pop Push -- Integer Support (4.9.10). IntFmt IntOp -- Reboot Instructions (4.9.11). Reboot SetRebootFlag -- Install Logging Instructions (4.9.12). LogSet LogText -- Section Management (4.9.13). SectionSetFlags SectionGetFlags SectionGetFlags SectionSetText SectionGetText SectionSetInstTypes SectionGetInstTypes SectionSetSize SectionGetSize SetCurInstType GetCurInstType InstTypeSetText InstTypeGetText -- User Interface Instructions (4.9.14). BringToFront CreateFont DetailPrint EnableWindow FindWindow GetDlgItem HideWindow IsWindow LockWindow SendMessage SetAutoClose SetBrandingImage SetDetailsView SetDetailsPrint listonlytextonly both SetCtlColors /BRANDING SetSilent ShowWindow -- Multiple Languages Instructions (4.9.15). LoadLanguageFile LangString LicenseLangString -- Compile time commands (5). !include !addincludedir !addplugindir !appendfile !cd !delfile !echo !error !execute !packhdr !system !tempfile !warning !verbose {__FILE__} {__LINE__} {__DATE__} {__TIME__} {__TIMESTAMP__} {NSIS_VERSION} !define !undef !ifdef !ifndef !if !ifmacrodef !ifmacrondef !else !endif !insertmacro !macro !macroend !searchparse !searchreplace ]])) -- Numbers. lex:add_rule('number', token(lexer.NUMBER, lexer.integer)) -- Operators. lex:add_rule('operator', token(lexer.OPERATOR, S('+-*/%|&^~!<>'))) -- Labels (4.3). lex:add_rule('label', token(lexer.LABEL, lexer.word * ':')) -- Identifiers. lex:add_rule('identifier', token(lexer.IDENTIFIER, lexer.word)) return lex
require "Car" require "Utils" -- Mutation constants local WheelRadiusMutRange = 6 local WheelShapeIndexMutRange = 2 -- wheel's position local BodySideMutRange = 10 -- These parameters are not mutable! local BodyNumSides = 10 local BodyDensity = 4 local BodySideMin = 25 local BodySideMax = 80 local WheelDensity = 1 local WheelRadiusMin = 22 local WheelRadiusMax = 48 function createFirstCarPrototype(world, x, y) local wheel1Radius = math.random(WheelRadiusMin, WheelRadiusMax) local wheel2Radius = math.random(WheelRadiusMin, WheelRadiusMax) local wheel1ShapeIndex = math.random(1, BodyNumSides-1) local wheel2ShapeIndex = math.random(1, BodyNumSides-1) local bodySides = {} for i = 1, BodyNumSides do bodySides[i] = math.random(BodySideMin, BodySideMax) end -- Copy the first element to the last position bodySides[BodyNumSides + 1] = bodySides[1] return Car:new(world, x, y, BodyDensity, WheelDensity, bodySides, wheel1ShapeIndex, wheel1Radius, wheel2ShapeIndex, wheel2Radius) end local function mutateWheelRadius(radius) local range = WheelRadiusMutRange/2 return setWithinRange(radius + math.random(-range, range), WheelRadiusMin, WheelRadiusMax) end local function mutateShapeIndex(shapeIndex) local range = WheelShapeIndexMutRange/2 return setWithinRange(shapeIndex + math.random(-range, range), 1, BodyNumSides) end local function mutateBodySides(bodySides) local range = BodySideMutRange/2 for i = 1, BodyNumSides do bodySides[i] = setWithinRange(bodySides[i] + math.random(-range, range), BodySideMin, BodySideMax) end -- Do not forget to copy the first side to the last position bodySides[BodyNumSides + 1] = bodySides[1] return bodySides end -- Create a new car with mutated parameters of given car function createMutatedCar(car, world, x, y) local wheel1Radius = mutateWheelRadius(car:getWheelRadius("wheel1")) local wheel2Radius = mutateWheelRadius(car:getWheelRadius("wheel2")) local wheel1ShapeIndex = mutateShapeIndex(car:getWheelShapeIndex("wheel1")) local wheel2ShapeIndex = mutateShapeIndex(car:getWheelShapeIndex("wheel2")) local bodySides = mutateBodySides(clone(car.bodySides)) return Car:new(world, x, y, BodyDensity, WheelDensity, bodySides, wheel1ShapeIndex, wheel1Radius, wheel2ShapeIndex, wheel2Radius) end
-- Keeps track of all the actions that were performed so they can be played -- back on new clients. return { new = function() return {} end }
local playsession = { {"ManuelG", {431500}}, {"ISniffPetrol", {395529}}, {"ZeroBeta", {425055}}, {"MovingMike", {421569}}, {"tykak", {420446}}, {"rlidwka", {137626}}, {"Zorin862", {397623}}, {"jackazzm", {404602}}, {"Arnietom", {180087}}, {"OmegaLunch", {382662}}, {"guruthrill", {369655}}, {"Vegadyn", {310818}}, {"22144418", {2909}}, {"flachen", {308380}}, {"Nikkichu", {298035}}, {"yulingqixiao", {246735}}, {"harukine", {290911}}, {"Giatros", {293095}}, {"Kiwicake", {298430}}, {"AndyKaz", {244358}}, {"zutto", {23115}}, {"Lucasuper32", {10857}}, {"ThatGuyStyx", {128615}}, {"Cloudtv", {252756}}, {"GuidoCram", {232345}}, {"DWDMaster", {6789}}, {"Ruuyji", {230456}}, {"mewmew", {29335}}, {"Pyroman69", {5056}}, {"Wellow", {13421}}, {"KIRkomMAX", {875}}, {"Frederika_Bernkastel", {179158}}, {"olexn", {155388}}, {"hlbg007", {3234}}, {"PyroBG", {2098}}, {"cjsarab", {4313}}, {"lilleskutt", {24194}}, {"Sneakypoop", {92430}}, {"Malorie_sXy", {123460}}, {"maximuskylus", {108511}}, {"Delqvs", {89615}}, {"wengPC", {5504}}, {"cogito123", {77086}}, {"Jarocin", {36384}}, {"VovKgr", {28426}}, {"Vojadger", {9331}}, {"jose78930", {2435}}, {"crash893", {11202}}, {"samnrad", {2182}} } return playsession
local _M = {} local sayHi = function() print("Hi,I'm from myluamodule.") end _M.sayHi = function() sayHi() end return _M
local root = script.Parent.Parent local includes = root:FindFirstChild("includes") local BuiltInPalettes = require(includes:FindFirstChild("BuiltInPalettes")) local Roact = require(includes:FindFirstChild("Roact")) local Components = root:FindFirstChild("Components") local ColorBrewerPalettes = require(Components:FindFirstChild("ColorBrewerPalettes")) local ColorVariations = require(Components:FindFirstChild("ColorVariations")) local Palette = require(Components:FindFirstChild("Palette")) local BrickColors = BuiltInPalettes.BrickColors local CopicColors = BuiltInPalettes.CopicColors local WebColors = BuiltInPalettes.WebColors --- return { { name = "BrickColors", getContent = function() return Roact.createElement(Palette, { palette = BrickColors, readOnly = true }) end }, { name = "ColorBrewer", getContent = function() return Roact.createElement(ColorBrewerPalettes) end }, { name = "Copic Colors", getContent = function() return Roact.createElement(Palette, { palette = CopicColors, readOnly = true }) end }, { name = "Variations", getContent = function() return Roact.createElement(ColorVariations) end }, { name = "Web Colors", getContent = function() return Roact.createElement(Palette, { palette = WebColors, readOnly = true }) end } }
local map = vim.api.nvim_buf_set_keymap local noremap = { noremap = true } map(0, "n", "h", "<Plug>(dirbuf_up)", noremap) map(0, "n", "l", "<Plug>(dirbuf_enter)", noremap)
----------------------------------- -- -- -- ----------------------------------- function onEffectGain(target,effect) target:recalculateAbilitiesTable() local bonus = effect:getPower() local regen = effect:getSubPower() target:addMod(tpz.mod.WHITE_MAGIC_COST, -bonus) target:addMod(tpz.mod.WHITE_MAGIC_CAST, -bonus) target:addMod(tpz.mod.WHITE_MAGIC_RECAST, -bonus) if not (target:hasStatusEffect(tpz.effect.TABULA_RASA)) then target:addMod(tpz.mod.WHITE_MAGIC_COST, -10) target:addMod(tpz.mod.WHITE_MAGIC_CAST, -10) target:addMod(tpz.mod.WHITE_MAGIC_RECAST, -10) target:addMod(tpz.mod.BLACK_MAGIC_COST, 20) target:addMod(tpz.mod.BLACK_MAGIC_CAST, 20) target:addMod(tpz.mod.BLACK_MAGIC_RECAST, 20) target:addMod(tpz.mod.LIGHT_ARTS_REGEN, regen) target:addMod(tpz.mod.REGEN_DURATION, regen*2) end target:recalculateSkillsTable() end function onEffectTick(target,effect) end function onEffectLose(target,effect) target:recalculateAbilitiesTable() local bonus = effect:getPower() local regen = effect:getSubPower() target:delMod(tpz.mod.WHITE_MAGIC_COST, -bonus) target:delMod(tpz.mod.WHITE_MAGIC_CAST, -bonus) target:delMod(tpz.mod.WHITE_MAGIC_RECAST, -bonus) if not (target:hasStatusEffect(tpz.effect.TABULA_RASA)) then target:delMod(tpz.mod.WHITE_MAGIC_COST, -10) target:delMod(tpz.mod.WHITE_MAGIC_CAST, -10) target:delMod(tpz.mod.WHITE_MAGIC_RECAST, -10) target:delMod(tpz.mod.BLACK_MAGIC_COST, 20) target:delMod(tpz.mod.BLACK_MAGIC_CAST, 20) target:delMod(tpz.mod.BLACK_MAGIC_RECAST, 20) target:delMod(tpz.mod.LIGHT_ARTS_REGEN, regen) target:delMod(tpz.mod.REGEN_DURATION, regen*2) end target:recalculateSkillsTable() end
local ServerData local NeedRefresh = false net.Receive("FScript.ViewCharacterDatabase.SendServerData", function() ServerData = net.ReadTable() NeedRefresh = true end) net.Receive("FScript.ViewCharacterDatabase.OpenMenu", function() local DermaFrame = vgui.Create("DFrame") DermaFrame:SetSize(FScript.ResponsiveWidthSize(700), FScript.ResponsiveHeightSize(600)) DermaFrame:SetTitle("") DermaFrame:ShowCloseButton(false) DermaFrame:SetDraggable(false) DermaFrame:Center() DermaFrame:MakePopup() DermaFrame.Paint = function(self, w, h) Derma_DrawBackgroundBlur(self) surface.SetDrawColor(FScript.Config.DermaBackgroundColor) surface.DrawRect(0, 0, w, h) surface.SetDrawColor(FScript.Config.BlackColor) surface.DrawLine(10, 60, self:GetWide() - 10, 60) surface.SetDrawColor(FScript.Config.BlackColor) surface.DrawLine(self:GetWide() / 2, 70, self:GetWide() / 2, 245) surface.SetDrawColor(FScript.Config.BlackColor) surface.DrawLine(10, 255, self:GetWide() - 10, 255) surface.SetDrawColor(FScript.Config.BlackColor) surface.DrawOutlinedRect(0, 0, w, h) end local Title = vgui.Create("DLabel", DermaFrame) Title:SetText(FScript.Lang.ViewDatabaseTitle1) Title:SetFont(FScript.Config.TitleFont) Title:SetTextColor(FScript.Config.TitleColor) Title:SizeToContents() Title:SetPos(60, 15) local TitleIcon = vgui.Create("DImage", DermaFrame) TitleIcon:SetPos(20, 16) TitleIcon:SetSize(24, 24) TitleIcon:SetImage("icon16/application_view_detail.png") local CloseButton = vgui.Create("DButton", DermaFrame) CloseButton:SetSize(80, 30) CloseButton:SetPos(DermaFrame:GetWide() - 100, 15) CloseButton:SetFont(FScript.Config.SubTitleFont) CloseButton:SetText(FScript.Lang.Close) CloseButton.Slide = 0 CloseButton.Paint = function(self, w, h) if self:IsHovered() then self.Slide = Lerp(0.05, self.Slide, w) self:SetColor(FScript.Config.BlackColor) draw.RoundedBox(5, 0, 0, w, h, FScript.Config.ButtonColor) draw.RoundedBox(5, 0, 0, self.Slide, h, FScript.Config.WhiteColor) else self.Slide = Lerp(0.05, self.Slide, 0) self:SetColor(FScript.Config.WhiteColor) draw.RoundedBox(5, 0, 0, w, h, FScript.Config.RedColor) draw.RoundedBox(5, 0, 0, self.Slide, h, FScript.Config.WhiteColor) end end CloseButton.OnCursorEntered = function() surface.PlaySound(FScript.Config.HoverSound) end CloseButton.DoClick = function() surface.PlaySound(FScript.Config.ClickSound) DermaFrame:Close() end local TitlePos = Title:GetPos() local TitleWide = Title:GetWide() local CloseButtonPos = CloseButton:GetPos() if TitlePos + TitleWide >= (CloseButtonPos - 10) then local X, Y = Title:GetSize() Title:SetSize(X - ((TitlePos + TitleWide) - CloseButtonPos + 10), Y) end local SubTitle1 = vgui.Create("DLabel", DermaFrame) SubTitle1:SetText(FScript.Lang.ViewDatabaseSubTitle1) SubTitle1:SetFont(FScript.Config.SubTitleFont) SubTitle1:SetTextColor(FScript.Config.TextColor) SubTitle1:SizeToContents() SubTitle1:SetPos(((DermaFrame:GetWide() / 2) - SubTitle1:GetWide()) / 2, 70) do local SubTitle1Pos = SubTitle1:GetPos() local SubTitle1Wide = SubTitle1:GetWide() local SeparatorPos = DermaFrame:GetWide() / 2 if SubTitle1Pos + SubTitle1Wide >= (SeparatorPos - 20) then local _, Y = SubTitle1:GetSize() SubTitle1:SetPos(20, 70) SubTitle1:SetSize(SeparatorPos - 40, Y) end end local SteamIDSearch = vgui.Create("DTextEntry", DermaFrame) SteamIDSearch.DefaultText = FScript.Lang.ViewDatabaseSteamID64Search SteamIDSearch:SetPos(10, 105) SteamIDSearch:SetSize((DermaFrame:GetWide() / 2) - 20, 30) SteamIDSearch:SetText(SteamIDSearch.DefaultText) SteamIDSearch:SetFont(FScript.Config.TextFont) SteamIDSearch:SetDrawLanguageID(false) SteamIDSearch.OnCursorEntered = function() surface.PlaySound(FScript.Config.HoverSound) end SteamIDSearch.OnMousePressed = function(self) self:SetTextColor(FScript.Config.BlackColor) end SteamIDSearch.Think = function(self) if not self:HasFocus() and string.Trim(self:GetText()) == "" then self:SetText(self.DefaultText) elseif self:HasFocus() and self:GetText() == self.DefaultText then self:SetText("") end end SteamIDSearch.OnTextChanged = function(self) local Text = self:GetText() if #Text > 18 then self:SetText(self.PrevText or string.sub(Text, 0, 18)) else self.PrevText = Text end end local NameSearch = vgui.Create("DTextEntry", DermaFrame) NameSearch.DefaultText = FScript.Lang.ViewDatabaseRPNameSearch NameSearch:SetPos(10, 140) NameSearch:SetSize((DermaFrame:GetWide() / 2) - 20, 30) NameSearch:SetText(NameSearch.DefaultText) NameSearch:SetFont(FScript.Config.TextFont) NameSearch:SetDrawLanguageID(false) NameSearch.OnCursorEntered = function() surface.PlaySound(FScript.Config.HoverSound) end NameSearch.OnMousePressed = function(self) self:SetTextColor(FScript.Config.BlackColor) end NameSearch.Think = function(self) if not self:HasFocus() and string.Trim(self:GetText()) == "" then self:SetText(self.DefaultText) elseif self:HasFocus() and self:GetText() == self.DefaultText then self:SetText("") end end NameSearch.OnTextChanged = function(self) local Text = self:GetText() if #Text > (FScript.Config.FirstnameMaxLenght + FScript.Config.SurnameMaxLenght) then self:SetText(self.PrevText or string.sub(Text, 0, FScript.Config.FirstnameMaxLenght + FScript.Config.SurnameMaxLenght)) else self.PrevText = Text end end local IDSearch = vgui.Create("DTextEntry", DermaFrame) IDSearch.DefaultText = FScript.Lang.ViewDatabaseIDSearch IDSearch:SetPos(10, 175) IDSearch:SetSize((DermaFrame:GetWide() / 2) - 20, 30) IDSearch:SetText(IDSearch.DefaultText) IDSearch:SetFont(FScript.Config.TextFont) IDSearch:SetNumeric(true) IDSearch:SetDrawLanguageID(false) IDSearch.OnCursorEntered = function() surface.PlaySound(FScript.Config.HoverSound) end IDSearch.OnMousePressed = function(self) self:SetTextColor(FScript.Config.BlackColor) end IDSearch.Think = function(self) if not self:HasFocus() and string.Trim(self:GetText()) == "" then self:SetText(self.DefaultText) elseif self:HasFocus() and self:GetText() == self.DefaultText then self:SetText("") end end IDSearch.OnTextChanged = function(self) local Text = self:GetText() if #Text > FScript.Config.IDLenght then self:SetText(self.PrevText or string.sub(Text, 0, FScript.Config.IDLenght)) else self.PrevText = Text end end local DescriptionSearch = vgui.Create("DTextEntry", DermaFrame) DescriptionSearch.DefaultText = FScript.Lang.ViewDatabaseDescriptionSearch DescriptionSearch:SetPos(10, 210) DescriptionSearch:SetSize((DermaFrame:GetWide() / 2) - 20, 30) DescriptionSearch:SetText(DescriptionSearch.DefaultText) DescriptionSearch:SetFont(FScript.Config.TextFont) DescriptionSearch:SetDrawLanguageID(false) DescriptionSearch.OnCursorEntered = function() surface.PlaySound(FScript.Config.HoverSound) end DescriptionSearch.OnMousePressed = function(self) self:SetTextColor(FScript.Config.BlackColor) end DescriptionSearch.Think = function(self) if not self:HasFocus() and string.Trim(self:GetText()) == "" then self:SetText(self.DefaultText) elseif self:HasFocus() and self:GetText() == self.DefaultText then self:SetText("") end end DescriptionSearch.OnTextChanged = function(self) local Text = self:GetText() if #Text > FScript.Config.DescriptionMaxLenght then self:SetText(self.PrevText or string.sub(Text, 0, FScript.Config.DescriptionMaxLenght)) else self.PrevText = Text end end local SubTitle2 = vgui.Create("DLabel", DermaFrame) SubTitle2:SetText(FScript.Lang.ViewDatabaseSubTitle2) SubTitle2:SetFont(FScript.Config.SubTitleFont) SubTitle2:SetTextColor(FScript.Config.TextColor) SubTitle2:SizeToContents() SubTitle2:SetPos((DermaFrame:GetWide() / 2) + (((DermaFrame:GetWide() / 2) - SubTitle2:GetWide()) / 2), 70) do local SeparatorPos = DermaFrame:GetWide() / 2 local SubTitle2Pos = SubTitle2:GetPos() - SeparatorPos local SubTitle2Wide = SubTitle2:GetWide() if SubTitle2Pos + SubTitle2Wide >= (SeparatorPos - 20) then local _, Y = SubTitle2:GetSize() SubTitle2:SetPos(SeparatorPos + 20, 70) SubTitle2:SetSize(SeparatorPos - 40, Y) end end local PlayersList = vgui.Create("DListView", DermaFrame) PlayersList:SetMultiSelect(false) PlayersList:Dock(FILL) PlayersList:DockMargin((DermaFrame:GetWide() / 2) + 5, 75, 5, DermaFrame:GetTall() - 245) PlayersList:AddColumn(FScript.Lang.RPName) PlayersList:AddColumn(FScript.Lang.SteamID64) PlayersList.OnRowSelected = function(list, index, panel) surface.PlaySound(FScript.Config.ClickSound) end for _, v in ipairs(player.GetHumans()) do PlayersList:AddLine(v:Nick(), v:SteamID64()) end local SubTitle3 = vgui.Create("DLabel", DermaFrame) SubTitle3:SetText(FScript.Lang.ViewDatabaseSubTitle3) SubTitle3:SetFont(FScript.Config.SubTitleFont) SubTitle3:SetTextColor(FScript.Config.TextColor) SubTitle3:SizeToContents() SubTitle3:SetPos((DermaFrame:GetWide() - SubTitle3:GetWide()) / 2, 265) local SearchIcon = vgui.Create("DImage", DermaFrame) SearchIcon:SetSize(16, 16) SearchIcon:SetImage("icon16/zoom.png") SearchIcon.Think = function(self) self:SetPos(SubTitle3:GetPos() - 25, 270) end local SearchList = vgui.Create("DListView", DermaFrame) SearchList:SetMultiSelect(false) SearchList:Dock(FILL) SearchList:DockMargin(5, 270, 5, 70) SearchList.Think = function(self) if not NeedRefresh then return end NeedRefresh = false SearchList:Clear() for k, v in ipairs(ServerData) do SearchList:AddLine(v[1], v[2], v[3]) SearchList.OnRowSelected = function(list, index, panel) local data = ServerData[index] surface.PlaySound(FScript.Config.ClickSound) Derma_Query(FScript.Lang.CharacterRequest, FScript.Lang.Warning, FScript.Lang.SeeProfile, function() DermaFrame:Close() net.Start("FScript.ViewCharacterDatabase.Validate") net.WriteTable({"ViewCharacterInformations", data[4], data[5]}) net.SendToServer() end, FScript.Lang.EditCharacterInformationsValidation, function() Derma_Query(FScript.Lang.ViewDatabaseCharacterEdition, FScript.Lang.Warning, FScript.Lang.EditCharacterInformations, function() DermaFrame:Close() net.Start("FScript.ViewCharacterDatabase.Validate") net.WriteTable({"EditCharacterInformations", data[4], data[5]}) net.SendToServer() end, FScript.Lang.EditCharacterNotes, function() DermaFrame:Close() net.Start("FScript.ViewCharacterDatabase.Validate") net.WriteTable({"EditCharacterNotes", data[4], data[5]}) net.SendToServer() end, FScript.Lang.Close, function() -- Nothing here end ) end, FScript.Lang.DeleteCharacter, function() Derma_Query(FScript.Lang.ViewDatabaseCharacterDeletion, FScript.Lang.Warning, FScript.Lang.DeleteCharacter, function() DermaFrame:Close() net.Start("FScript.ViewCharacterDatabase.Validate") net.WriteTable({"DeleteCharacter", data[4], data[5]}) net.SendToServer() end, FScript.Lang.DeleteCharacters, function() DermaFrame:Close() net.Start("FScript.ViewCharacterDatabase.Validate") net.WriteTable({"DeleteAllCharacters", data[4], data[5]}) net.SendToServer() end, FScript.Lang.Close, function() -- Nothing here end ) end, FScript.Lang.Close, function() -- Nothing here end ) end end end local Column1 = SearchList:AddColumn(FScript.Lang.RPName) Column1:SetMinWidth(140) Column1:SetMaxWidth(140) local Column2 = SearchList:AddColumn(FScript.Lang.Number) Column2:SetMinWidth(50) Column2:SetMaxWidth(50) local _ = SearchList:AddColumn(FScript.Lang.Description) local ConfirmButton = vgui.Create("DButton", DermaFrame) ConfirmButton:SetText(FScript.Lang.ViewDatabaseValidation) ConfirmButton:SetIcon("icon16/tick.png") ConfirmButton:SetSize(DermaFrame:GetWide() - 20, 25) ConfirmButton:SetPos((DermaFrame:GetWide() - ConfirmButton:GetWide()) / 2, DermaFrame:GetTall() - 65) ConfirmButton.Slide = 0 ConfirmButton.Paint = function(self, w, h) if self:IsHovered() then self.Slide = Lerp(0.05, self.Slide, w) self:SetColor(FScript.Config.BlackColor) draw.RoundedBox(5, 0, 0, w, h, FScript.Config.ButtonColor) draw.RoundedBox(5, 0, 0, self.Slide, h, FScript.Config.WhiteColor) else self.Slide = Lerp(0.05, self.Slide, 0) self:SetColor(FScript.Config.WhiteColor) draw.RoundedBox(5, 0, 0, w, h, FScript.Config.GreenColor) draw.RoundedBox(5, 0, 0, self.Slide, h, FScript.Config.WhiteColor) end end ConfirmButton.OnCursorEntered = function() surface.PlaySound(FScript.Config.HoverSound) end ConfirmButton.DoClick = function(self) local SteamID = SteamIDSearch:GetText() local Name = NameSearch:GetText() local ID = IDSearch:GetText() local Description = DescriptionSearch:GetText() local ListData = PlayersList:GetSelected()[1] SearchList:Clear() if SteamID ~= SteamIDSearch.DefaultText then net.Start("FScript.ViewCharacterDatabase.RequestServerData") net.WriteTable({"SteamID", SteamID}) net.SendToServer() surface.PlaySound(FScript.Config.ClickSound) return elseif Name ~= NameSearch.DefaultText then net.Start("FScript.ViewCharacterDatabase.RequestServerData") net.WriteTable({"Name", Name}) net.SendToServer() surface.PlaySound(FScript.Config.ClickSound) return elseif ID ~= IDSearch.DefaultText then net.Start("FScript.ViewCharacterDatabase.RequestServerData") net.WriteTable({"ID", ID}) net.SendToServer() surface.PlaySound(FScript.Config.ClickSound) return elseif Description ~= DescriptionSearch.DefaultText then net.Start("FScript.ViewCharacterDatabase.RequestServerData") net.WriteTable({"Description", Description}) net.SendToServer() surface.PlaySound(FScript.Config.ClickSound) return elseif ListData then net.Start("FScript.ViewCharacterDatabase.RequestServerData") net.WriteTable({"List", ListData:GetColumnText(2)}) net.SendToServer() surface.PlaySound(FScript.Config.ClickSound) return end surface.PlaySound(FScript.Config.ErrorSound) SteamIDSearch:SetTextColor(FScript.Config.RedColor) NameSearch:SetTextColor(FScript.Config.RedColor) IDSearch:SetTextColor(FScript.Config.RedColor) DescriptionSearch:SetTextColor(FScript.Config.RedColor) end local AddonInfo = vgui.Create("DLabel", DermaFrame) AddonInfo:SetText("FScript - " .. FScript.Lang.Version .. " " .. FScript.Info.Version .. " " .. FScript.Lang.Revision .. " " .. FScript.Info.Revision) AddonInfo:SetFont(FScript.Config.TextFont) AddonInfo:SetTextColor(Color(82, 82, 82)) AddonInfo:SetVisible(false) AddonInfo:SizeToContents() AddonInfo:SetPos((DermaFrame:GetWide() - AddonInfo:GetWide()) / 2, DermaFrame:GetTall() - 30) local AddonIcon = vgui.Create("DImage", DermaFrame) AddonIcon:SetPos(AddonInfo:GetPos() - 25, DermaFrame:GetTall() - 30) AddonIcon:SetSize(16, 16) AddonIcon:SetImage("icon16/lightbulb.png") AddonIcon:SetVisible(false) local CreditText = vgui.Create("RichText", DermaFrame) CreditText:SetSize(300, 20) CreditText:InsertColorChange(82, 82, 82, 255) local Words = {"Made", "By", "Florian", "Dubois", "<3"} local Delay = 0 for k, v in ipairs(Words) do if k == 1 then Delay = 0.2 else Delay = (k - 1) * 0.45 end timer.Simple(Delay, function() if IsValid(DermaFrame) then CreditText:AppendText(v .. " ") CreditText:InsertFade(2, 1) CreditText:SetFontInternal(FScript.Config.TextFont) CreditText:SetPos((DermaFrame:GetWide() - AddonInfo:GetWide()) / 2, DermaFrame:GetTall() - 30) end end) end timer.Simple(4, function() if IsValid(DermaFrame) then AddonInfo:SetVisible(true) AddonIcon:SetVisible(true) end end) end)
-- Our base collectable basecollectable = { sprite = 10, x = 0, y = 0, width = 1, height = 1, dy = 0, box = { xleft = 1, xright = 5, yup = 0, ydown = 7 }, floaty = 0, floatingup = true, maxlifespan = 60 * 4, lifespan = 0, floatheight = 2, cashtype = false, healthtype = false } -- the collectable class constructor function basecollectable:new(o) o = o or {} setmetatable(o, self) self.__index = self return o end function collectableinit() -- the larger the collectable spawn rate the less they spawn drops, collectablespawnrate = {}, 250 collectablespawnrate = (425) - getcurrentlevel() * 2 if bossmode then collectablespawnrate = flr(collectablespawnrate / 1.75) end if collectablespawnrate < 250 then collectablespawnrate = 250 end end function spawncash(cashx, cashy, amount) if gamestate__finalbossstart then return end -- Spawning too much cash is bad -- Delete drops if cash is spawning if count(drops) > 50 then del(drops, drops[0]) end local newcash = basecollectable:new({ x = cashx, y = cashy }) newcash.box = { xleft = 1, xright = 4, yup = 0, ydown = 3 } newcash.lifespan, newcash.sprite, newcash.cashtype, newcash.floaty, newcash.amount = newcash.maxlifespan + flr(rnd(20)), 10, true, cashy, amount add(drops, newcash) end function spawnhealth(collectablex, collectabley, amount) if gamestate__finalbossstart then return end local newcollectable = basecollectable:new({ x = collectablex, y = collectabley }) newcollectable.lifespan, newcollectable.sprite, newcollectable.healthtype, newcollectable.floaty, newcollectable.amount = newcollectable.maxlifespan + flr(rnd(20)), 11, true, collectabley, amount add(drops, newcollectable) end function spawncoffee(collectablex, collectabley, amount) if gamestate__finalbossstart then return end local newcollectable = basecollectable:new({ x = collectablex, y = collectabley }) newcollectable.lifespan, newcollectable.sprite, newcollectable.coffeetype, newcollectable.coffeetime, newcollectable.floaty = newcollectable.maxlifespan + flr(rnd(20)), 12, true, 300, collectabley add(drops, newcollectable) end function spawnslowtime(collectablex, collectabley, amount) if gamestate__finalbossstart then return end local newcollectable = basecollectable:new({ x = collectablex, y = collectabley }) newcollectable.lifespan, newcollectable.sprite, newcollectable.slowtimetype, newcollectable.slowtime, newcollectable.floaty = newcollectable.maxlifespan, 13, true, 300, collectabley add(drops, newcollectable) end function floatcollectable(collectable) -- Slightly increase the collectable dy if collectable.floatingup then collectable.dy += .03 else collectable.dy -= .03 end collectable.floaty += collectable.dy if collectable.floaty - collectable.y > collectable.floatheight then collectable.floatingup = false end if collectable.floaty < collectable.y then collectable.floatingup = true collectable.dy = 0 end end function generatecollectablespawn() -- generate the spawn (Get a random enemy and spawn near it) local spawnlocation = { x = flr(rnd(110)), y = flr(rnd(110)), width = 1, height = 1 } if count(bosses) > 0 then local enemyindex = flr(rnd(count(bosses))) + 1 spawnlocation.x, spawnlocation.y = bosses[enemyindex].x, bosses[enemyindex].y - 8 end if count(enemies) > 0 then local enemyindex = flr(rnd(count(enemies))) + 1 spawnlocation.x, spawnlocation.y = enemies[enemyindex].x, enemies[enemyindex].y - 8 end -- Check if we spawned inside the ground if isgrounded(spawnlocation) then spawnlocation.y += 8 end -- return the spawn locaiton return spawnlocation end function collectableupdate() for collectable in all(drops) do -- Decrease collectable lifespan if collectable.lifespan > 0 then collectable.lifespan -= 1 end floatcollectable(collectable) -- Check for collectable collision with a player for player in all(players) do if iscollision(collectable, player) and player.health > 0 then -- cash collectable logic if collectable.cashtype then -- Add the cash value to the player score sfx(6) gamestate__cash += collectable.amount if gamestate__cash >= PICO__MAX__NUMBER then gamestate__cash = PICO__MAX__NUMBER end del(drops, collectable) end -- health colelctable logic if collectable.healthtype then -- Add the cash value to the player score player.health += collectable.amount sfx(5) if player.health > player.maxhealth then player.health = player.maxhealth end del(drops, collectable) end -- coffee collectable logic if collectable.coffeetype then -- Add the cash value to the player score player.slowtimepowerup, player.coffeepowerup = 0, collectable.coffeetime sfx(5) del(drops, collectable) end -- slow time collectable logic if collectable.slowtimetype then -- Add the cash value to the player score player.coffeepowerup, player.slowtimepowerup = 0, collectable.slowtime sfx(5) del(drops, collectable) end end -- Check if we should remove the collectable if collectable.lifespan <= 0 then del(drops, collectable) end end end -- Randomly spawn some drops -- only if the players is alive, and the next level car has not spawned if not allplayersdead() and gametime % collectablespawnrate == 0 and not levelcarspawned then -- get our spawn location local spawn = generatecollectablespawn() local whichdrop = flr(rnd(9)) if whichdrop >= 5 then spawnhealth(spawn.x, spawn.y, flr(rnd(3)) + 2) elseif whichdrop >= 2 then spawncoffee(spawn.x, spawn.y, 1) elseif whichdrop >= 0 then spawnslowtime(spawn.x, spawn.y, 1) end end end function collectabledraw() for collectable in all(drops) do -- Check if it is cash if collectable.cashtype then if collectable.amount > 5 then pal(3, 1) pal(11, 12) elseif collectable.amount > 10 then pal(3, 9) pal(11, 10) elseif collectable.amount > 25 then pal(3, 8) pal(11, 14) elseif collectable.amount > 50 then pal(3, 5) pal(11, 13) end end -- Flash if about to disappear if collectable.lifespan < 105 then if collectable.lifespan % 6 > 0 and collectable.lifespan % 6 <= 2 then pal(1, 10) pal(2, 10) pal(3, 10) pal(4, 10) pal(5, 10) pal(6, 10) pal(7, 10) pal(8, 10) pal(9, 10) pal(11, 10) pal(12, 10) pal(13, 10) pal(14, 10) pal(15, 10) end end spr(collectable.sprite, collectable.x, collectable.floaty, collectable.width, collectable.height) -- reset pal pal() end -- Show powerupds in HUD for i=1,count(players) do local powertitley = 0 if i == 1 then powertitley = 1 else powertitley = 9 end -- Print the current powerup if players[i].coffeepowerup > 0 then spr(12, 120, powertitley) end if players[i].slowtimepowerup > 0 then spr(13, 120, powertitley) end 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_frmADnD1() 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("frmADnD1"); 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(0); obj.layout1:setTop(0); obj.layout1:setWidth(935); obj.layout1:setHeight(70); 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:setXradius(5); obj.rectangle1:setYradius(5); obj.rectangle1:setCornerType("round"); obj.rectangle1:setName("rectangle1"); obj.layout2 = GUI.fromHandle(_obj_newObject("layout")); obj.layout2:setParent(obj.layout1); obj.layout2:setLeft(5); obj.layout2:setTop(5); obj.layout2:setWidth(310); obj.layout2:setHeight(25); obj.layout2:setName("layout2"); obj.label1 = GUI.fromHandle(_obj_newObject("label")); obj.label1:setParent(obj.layout2); obj.label1:setLeft(5); obj.label1:setTop(5); obj.label1:setWidth(100); obj.label1:setHeight(20); obj.label1:setText("Nome"); obj.label1:setHorzTextAlign("trailing"); obj.label1:setName("label1"); obj.edit1 = GUI.fromHandle(_obj_newObject("edit")); obj.edit1:setParent(obj.layout2); obj.edit1:setLeft(110); obj.edit1:setTop(0); obj.edit1:setWidth(200); obj.edit1:setHeight(25); obj.edit1:setField("nome"); obj.edit1:setName("edit1"); obj.layout3 = GUI.fromHandle(_obj_newObject("layout")); obj.layout3:setParent(obj.layout1); obj.layout3:setLeft(270); obj.layout3:setTop(5); obj.layout3:setWidth(310); obj.layout3:setHeight(25); obj.layout3:setName("layout3"); obj.label2 = GUI.fromHandle(_obj_newObject("label")); obj.label2:setParent(obj.layout3); obj.label2:setLeft(5); obj.label2:setTop(5); obj.label2:setWidth(100); obj.label2:setHeight(20); obj.label2:setText("Raça"); obj.label2:setHorzTextAlign("trailing"); obj.label2:setName("label2"); obj.edit2 = GUI.fromHandle(_obj_newObject("edit")); obj.edit2:setParent(obj.layout3); obj.edit2:setLeft(110); obj.edit2:setTop(0); obj.edit2:setWidth(200); obj.edit2:setHeight(25); obj.edit2:setField("raca"); obj.edit2:setName("edit2"); obj.layout4 = GUI.fromHandle(_obj_newObject("layout")); obj.layout4:setParent(obj.layout1); obj.layout4:setLeft(560); obj.layout4:setTop(5); obj.layout4:setWidth(310); obj.layout4:setHeight(25); obj.layout4:setName("layout4"); obj.label3 = GUI.fromHandle(_obj_newObject("label")); obj.label3:setParent(obj.layout4); obj.label3:setLeft(5); obj.label3:setTop(5); obj.label3:setWidth(100); obj.label3:setHeight(20); obj.label3:setText("Divindade"); obj.label3:setHorzTextAlign("trailing"); obj.label3:setName("label3"); obj.edit3 = GUI.fromHandle(_obj_newObject("edit")); obj.edit3:setParent(obj.layout4); obj.edit3:setLeft(110); obj.edit3:setTop(0); obj.edit3:setWidth(200); obj.edit3:setHeight(25); obj.edit3:setField("divindade"); obj.edit3:setName("edit3"); obj.layout5 = GUI.fromHandle(_obj_newObject("layout")); obj.layout5:setParent(obj.layout1); obj.layout5:setLeft(5); obj.layout5:setTop(35); obj.layout5:setWidth(310); obj.layout5:setHeight(25); obj.layout5:setName("layout5"); obj.label4 = GUI.fromHandle(_obj_newObject("label")); obj.label4:setParent(obj.layout5); obj.label4:setLeft(5); obj.label4:setTop(5); obj.label4:setWidth(100); obj.label4:setHeight(20); obj.label4:setText("Nível"); obj.label4:setHorzTextAlign("trailing"); obj.label4:setName("label4"); obj.edit4 = GUI.fromHandle(_obj_newObject("edit")); obj.edit4:setParent(obj.layout5); obj.edit4:setLeft(110); obj.edit4:setTop(0); obj.edit4:setWidth(40); obj.edit4:setHeight(25); obj.edit4:setField("nivel"); obj.edit4:setName("edit4"); obj.label5 = GUI.fromHandle(_obj_newObject("label")); obj.label5:setParent(obj.layout5); obj.label5:setLeft(155); obj.label5:setTop(5); obj.label5:setWidth(20); obj.label5:setHeight(20); obj.label5:setText("XP"); obj.label5:setHorzTextAlign("trailing"); obj.label5:setName("label5"); obj.edit5 = GUI.fromHandle(_obj_newObject("edit")); obj.edit5:setParent(obj.layout5); obj.edit5:setLeft(180); obj.edit5:setTop(0); obj.edit5:setWidth(65); obj.edit5:setHeight(25); obj.edit5:setField("xp1"); obj.edit5:setName("edit5"); obj.edit6 = GUI.fromHandle(_obj_newObject("edit")); obj.edit6:setParent(obj.layout5); obj.edit6:setLeft(245); obj.edit6:setTop(0); obj.edit6:setWidth(65); obj.edit6:setHeight(25); obj.edit6:setField("xp2"); obj.edit6:setName("edit6"); obj.layout6 = GUI.fromHandle(_obj_newObject("layout")); obj.layout6:setParent(obj.layout1); obj.layout6:setLeft(270); obj.layout6:setTop(35); obj.layout6:setWidth(310); obj.layout6:setHeight(25); obj.layout6:setName("layout6"); obj.label6 = GUI.fromHandle(_obj_newObject("label")); obj.label6:setParent(obj.layout6); obj.label6:setLeft(5); obj.label6:setTop(5); obj.label6:setWidth(100); obj.label6:setHeight(20); obj.label6:setText("Classe"); obj.label6:setHorzTextAlign("trailing"); obj.label6:setName("label6"); obj.edit7 = GUI.fromHandle(_obj_newObject("edit")); obj.edit7:setParent(obj.layout6); obj.edit7:setLeft(110); obj.edit7:setTop(0); obj.edit7:setWidth(200); obj.edit7:setHeight(25); obj.edit7:setField("classe"); obj.edit7:setName("edit7"); obj.layout7 = GUI.fromHandle(_obj_newObject("layout")); obj.layout7:setParent(obj.layout1); obj.layout7:setLeft(560); obj.layout7:setTop(35); obj.layout7:setWidth(310); obj.layout7:setHeight(25); obj.layout7:setName("layout7"); obj.label7 = GUI.fromHandle(_obj_newObject("label")); obj.label7:setParent(obj.layout7); obj.label7:setLeft(5); obj.label7:setTop(5); obj.label7:setWidth(100); obj.label7:setHeight(20); obj.label7:setText("Tendência"); obj.label7:setHorzTextAlign("trailing"); obj.label7:setName("label7"); obj.edit8 = GUI.fromHandle(_obj_newObject("edit")); obj.edit8:setParent(obj.layout7); obj.edit8:setLeft(110); obj.edit8:setTop(0); obj.edit8:setWidth(200); obj.edit8:setHeight(25); obj.edit8:setField("tendencia"); obj.edit8:setName("edit8"); obj.layout8 = GUI.fromHandle(_obj_newObject("layout")); obj.layout8:setParent(obj.scrollBox1); obj.layout8:setLeft(0); obj.layout8:setTop(80); obj.layout8:setWidth(450); obj.layout8:setHeight(360); obj.layout8:setName("layout8"); obj.rectangle2 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle2:setParent(obj.layout8); obj.rectangle2:setAlign("client"); obj.rectangle2:setColor("black"); obj.rectangle2:setXradius(5); obj.rectangle2:setYradius(5); obj.rectangle2:setCornerType("round"); obj.rectangle2:setName("rectangle2"); obj.label8 = GUI.fromHandle(_obj_newObject("label")); obj.label8:setParent(obj.layout8); obj.label8:setLeft(0); obj.label8:setTop(5); obj.label8:setWidth(450); obj.label8:setHeight(20); obj.label8:setText("ATRIBUTOS"); obj.label8:setHorzTextAlign("center"); obj.label8:setName("label8"); obj.layout9 = GUI.fromHandle(_obj_newObject("layout")); obj.layout9:setParent(obj.layout8); obj.layout9:setLeft(0); obj.layout9:setTop(30); obj.layout9:setWidth(450); obj.layout9:setHeight(50); obj.layout9:setName("layout9"); obj.label9 = GUI.fromHandle(_obj_newObject("label")); obj.label9:setParent(obj.layout9); obj.label9:setLeft(5); obj.label9:setTop(5); obj.label9:setWidth(100); obj.label9:setHeight(45); obj.label9:setText("FORÇA"); obj.label9:setName("label9"); obj.edit9 = GUI.fromHandle(_obj_newObject("edit")); obj.edit9:setParent(obj.layout9); obj.edit9:setLeft(100); obj.edit9:setTop(0); obj.edit9:setWidth(50); obj.edit9:setHeight(50); obj.edit9:setField("forca"); obj.edit9:setHorzTextAlign("center"); obj.edit9:setFontSize(20); obj.edit9:setName("edit9"); obj.label10 = GUI.fromHandle(_obj_newObject("label")); obj.label10:setParent(obj.layout9); obj.label10:setLeft(155); obj.label10:setTop(5); obj.label10:setWidth(40); obj.label10:setHeight(20); obj.label10:setText("Acerto"); obj.label10:setName("label10"); obj.edit10 = GUI.fromHandle(_obj_newObject("edit")); obj.edit10:setParent(obj.layout9); obj.edit10:setLeft(155); obj.edit10:setTop(25); obj.edit10:setWidth(40); obj.edit10:setHeight(25); obj.edit10:setField("for_acerto"); obj.edit10:setName("edit10"); obj.label11 = GUI.fromHandle(_obj_newObject("label")); obj.label11:setParent(obj.layout9); obj.label11:setLeft(203); obj.label11:setTop(5); obj.label11:setWidth(40); obj.label11:setHeight(20); obj.label11:setText("Dano"); obj.label11:setName("label11"); obj.edit11 = GUI.fromHandle(_obj_newObject("edit")); obj.edit11:setParent(obj.layout9); obj.edit11:setLeft(200); obj.edit11:setTop(25); obj.edit11:setWidth(40); obj.edit11:setHeight(25); obj.edit11:setField("for_dano"); obj.edit11:setName("edit11"); obj.label12 = GUI.fromHandle(_obj_newObject("label")); obj.label12:setParent(obj.layout9); obj.label12:setLeft(247); obj.label12:setTop(5); obj.label12:setWidth(40); obj.label12:setHeight(20); obj.label12:setText("Carga"); obj.label12:setName("label12"); obj.edit12 = GUI.fromHandle(_obj_newObject("edit")); obj.edit12:setParent(obj.layout9); obj.edit12:setLeft(245); obj.edit12:setTop(25); obj.edit12:setWidth(40); obj.edit12:setHeight(25); obj.edit12:setField("for_carga"); obj.edit12:setName("edit12"); obj.label13 = GUI.fromHandle(_obj_newObject("label")); obj.label13:setParent(obj.layout9); obj.label13:setLeft(290); obj.label13:setTop(5); obj.label13:setWidth(45); obj.label13:setHeight(20); obj.label13:setText("Sustentação"); obj.label13:setFontSize(8); obj.label13:setName("label13"); obj.edit13 = GUI.fromHandle(_obj_newObject("edit")); obj.edit13:setParent(obj.layout9); obj.edit13:setLeft(290); obj.edit13:setTop(25); obj.edit13:setWidth(40); obj.edit13:setHeight(25); obj.edit13:setField("for_sustentacao"); obj.edit13:setName("edit13"); obj.label14 = GUI.fromHandle(_obj_newObject("label")); obj.label14:setParent(obj.layout9); obj.label14:setLeft(338); obj.label14:setTop(5); obj.label14:setWidth(40); obj.label14:setHeight(20); obj.label14:setText("Abrir"); obj.label14:setName("label14"); obj.edit14 = GUI.fromHandle(_obj_newObject("edit")); obj.edit14:setParent(obj.layout9); obj.edit14:setLeft(335); obj.edit14:setTop(25); obj.edit14:setWidth(40); obj.edit14:setHeight(25); obj.edit14:setField("for_abrir"); obj.edit14:setName("edit14"); obj.label15 = GUI.fromHandle(_obj_newObject("label")); obj.label15:setParent(obj.layout9); obj.label15:setLeft(380); obj.label15:setTop(5); obj.label15:setWidth(40); obj.label15:setHeight(20); obj.label15:setText("Barras"); obj.label15:setName("label15"); obj.edit15 = GUI.fromHandle(_obj_newObject("edit")); obj.edit15:setParent(obj.layout9); obj.edit15:setLeft(380); obj.edit15:setTop(25); obj.edit15:setWidth(40); obj.edit15:setHeight(25); obj.edit15:setField("for_barras"); obj.edit15:setName("edit15"); obj.layout10 = GUI.fromHandle(_obj_newObject("layout")); obj.layout10:setParent(obj.layout8); obj.layout10:setLeft(0); obj.layout10:setTop(85); obj.layout10:setWidth(450); obj.layout10:setHeight(50); obj.layout10:setName("layout10"); obj.label16 = GUI.fromHandle(_obj_newObject("label")); obj.label16:setParent(obj.layout10); obj.label16:setLeft(5); obj.label16:setTop(5); obj.label16:setWidth(100); obj.label16:setHeight(45); obj.label16:setText("DESTREZA"); obj.label16:setName("label16"); obj.edit16 = GUI.fromHandle(_obj_newObject("edit")); obj.edit16:setParent(obj.layout10); obj.edit16:setLeft(100); obj.edit16:setTop(0); obj.edit16:setWidth(50); obj.edit16:setHeight(50); obj.edit16:setField("destreza"); obj.edit16:setHorzTextAlign("center"); obj.edit16:setFontSize(20); obj.edit16:setName("edit16"); obj.label17 = GUI.fromHandle(_obj_newObject("label")); obj.label17:setParent(obj.layout10); obj.label17:setLeft(155); obj.label17:setTop(5); obj.label17:setWidth(40); obj.label17:setHeight(20); obj.label17:setText("Reação"); obj.label17:setFontSize(12); obj.label17:setName("label17"); obj.edit17 = GUI.fromHandle(_obj_newObject("edit")); obj.edit17:setParent(obj.layout10); obj.edit17:setLeft(155); obj.edit17:setTop(25); obj.edit17:setWidth(40); obj.edit17:setHeight(25); obj.edit17:setField("des_reacao"); obj.edit17:setName("edit17"); obj.label18 = GUI.fromHandle(_obj_newObject("label")); obj.label18:setParent(obj.layout10); obj.label18:setLeft(203); obj.label18:setTop(5); obj.label18:setWidth(40); obj.label18:setHeight(20); obj.label18:setText("Ataque"); obj.label18:setFontSize(12); obj.label18:setName("label18"); obj.edit18 = GUI.fromHandle(_obj_newObject("edit")); obj.edit18:setParent(obj.layout10); obj.edit18:setLeft(200); obj.edit18:setTop(25); obj.edit18:setWidth(40); obj.edit18:setHeight(25); obj.edit18:setField("des_ataque"); obj.edit18:setName("edit18"); obj.label19 = GUI.fromHandle(_obj_newObject("label")); obj.label19:setParent(obj.layout10); obj.label19:setLeft(247); obj.label19:setTop(5); obj.label19:setWidth(40); obj.label19:setHeight(20); obj.label19:setText("Defesa"); obj.label19:setName("label19"); obj.edit19 = GUI.fromHandle(_obj_newObject("edit")); obj.edit19:setParent(obj.layout10); obj.edit19:setLeft(245); obj.edit19:setTop(25); obj.edit19:setWidth(40); obj.edit19:setHeight(25); obj.edit19:setField("des_defesa"); obj.edit19:setName("edit19"); obj.layout11 = GUI.fromHandle(_obj_newObject("layout")); obj.layout11:setParent(obj.layout8); obj.layout11:setLeft(0); obj.layout11:setTop(140); obj.layout11:setWidth(450); obj.layout11:setHeight(50); obj.layout11:setName("layout11"); obj.label20 = GUI.fromHandle(_obj_newObject("label")); obj.label20:setParent(obj.layout11); obj.label20:setLeft(5); obj.label20:setTop(5); obj.label20:setWidth(100); obj.label20:setHeight(45); obj.label20:setText("CONSTITUIÇÃO"); obj.label20:setName("label20"); obj.edit20 = GUI.fromHandle(_obj_newObject("edit")); obj.edit20:setParent(obj.layout11); obj.edit20:setLeft(100); obj.edit20:setTop(0); obj.edit20:setWidth(50); obj.edit20:setHeight(50); obj.edit20:setField("constituicao"); obj.edit20:setHorzTextAlign("center"); obj.edit20:setFontSize(20); obj.edit20:setName("edit20"); obj.label21 = GUI.fromHandle(_obj_newObject("label")); obj.label21:setParent(obj.layout11); obj.label21:setLeft(160); obj.label21:setTop(5); obj.label21:setWidth(40); obj.label21:setHeight(20); obj.label21:setText("PVs"); obj.label21:setName("label21"); obj.edit21 = GUI.fromHandle(_obj_newObject("edit")); obj.edit21:setParent(obj.layout11); obj.edit21:setLeft(155); obj.edit21:setTop(25); obj.edit21:setWidth(40); obj.edit21:setHeight(25); obj.edit21:setField("con_pvs"); obj.edit21:setName("edit21"); obj.label22 = GUI.fromHandle(_obj_newObject("label")); obj.label22:setParent(obj.layout11); obj.label22:setLeft(200); obj.label22:setTop(5); obj.label22:setWidth(40); obj.label22:setHeight(20); obj.label22:setText("Colapso"); obj.label22:setFontSize(11); obj.label22:setName("label22"); obj.edit22 = GUI.fromHandle(_obj_newObject("edit")); obj.edit22:setParent(obj.layout11); obj.edit22:setLeft(200); obj.edit22:setTop(25); obj.edit22:setWidth(40); obj.edit22:setHeight(25); obj.edit22:setField("con_colapse"); obj.edit22:setName("edit22"); obj.label23 = GUI.fromHandle(_obj_newObject("label")); obj.label23:setParent(obj.layout11); obj.label23:setLeft(243); obj.label23:setTop(5); obj.label23:setWidth(47); obj.label23:setHeight(20); obj.label23:setText("Ressurreição"); obj.label23:setFontSize(8); obj.label23:setName("label23"); obj.edit23 = GUI.fromHandle(_obj_newObject("edit")); obj.edit23:setParent(obj.layout11); obj.edit23:setLeft(245); obj.edit23:setTop(25); obj.edit23:setWidth(40); obj.edit23:setHeight(25); obj.edit23:setField("con_ressurreicao"); obj.edit23:setName("edit23"); obj.label24 = GUI.fromHandle(_obj_newObject("label")); obj.label24:setParent(obj.layout11); obj.label24:setLeft(290); obj.label24:setTop(5); obj.label24:setWidth(45); obj.label24:setHeight(20); obj.label24:setText("Veneno"); obj.label24:setFontSize(12); obj.label24:setName("label24"); obj.edit24 = GUI.fromHandle(_obj_newObject("edit")); obj.edit24:setParent(obj.layout11); obj.edit24:setLeft(290); obj.edit24:setTop(25); obj.edit24:setWidth(40); obj.edit24:setHeight(25); obj.edit24:setField("con_veneno"); obj.edit24:setName("edit24"); obj.label25 = GUI.fromHandle(_obj_newObject("label")); obj.label25:setParent(obj.layout11); obj.label25:setLeft(335); obj.label25:setTop(5); obj.label25:setWidth(50); obj.label25:setHeight(20); obj.label25:setText("Regeneração"); obj.label25:setFontSize(8); obj.label25:setName("label25"); obj.edit25 = GUI.fromHandle(_obj_newObject("edit")); obj.edit25:setParent(obj.layout11); obj.edit25:setLeft(335); obj.edit25:setTop(25); obj.edit25:setWidth(40); obj.edit25:setHeight(25); obj.edit25:setField("con_regeneracao"); obj.edit25:setName("edit25"); obj.layout12 = GUI.fromHandle(_obj_newObject("layout")); obj.layout12:setParent(obj.layout8); obj.layout12:setLeft(0); obj.layout12:setTop(195); obj.layout12:setWidth(450); obj.layout12:setHeight(50); obj.layout12:setName("layout12"); obj.label26 = GUI.fromHandle(_obj_newObject("label")); obj.label26:setParent(obj.layout12); obj.label26:setLeft(5); obj.label26:setTop(5); obj.label26:setWidth(100); obj.label26:setHeight(45); obj.label26:setText("INTELIGÊNCIA"); obj.label26:setName("label26"); obj.edit26 = GUI.fromHandle(_obj_newObject("edit")); obj.edit26:setParent(obj.layout12); obj.edit26:setLeft(100); obj.edit26:setTop(0); obj.edit26:setWidth(50); obj.edit26:setHeight(50); obj.edit26:setField("inteligencia"); obj.edit26:setHorzTextAlign("center"); obj.edit26:setFontSize(20); obj.edit26:setName("edit26"); obj.label27 = GUI.fromHandle(_obj_newObject("label")); obj.label27:setParent(obj.layout12); obj.label27:setLeft(155); obj.label27:setTop(5); obj.label27:setWidth(40); obj.label27:setHeight(20); obj.label27:setText("Idiomas"); obj.label27:setFontSize(11); obj.label27:setName("label27"); obj.edit27 = GUI.fromHandle(_obj_newObject("edit")); obj.edit27:setParent(obj.layout12); obj.edit27:setLeft(155); obj.edit27:setTop(25); obj.edit27:setWidth(40); obj.edit27:setHeight(25); obj.edit27:setField("int_idiomas"); obj.edit27:setName("edit27"); obj.label28 = GUI.fromHandle(_obj_newObject("label")); obj.label28:setParent(obj.layout12); obj.label28:setLeft(200); obj.label28:setTop(5); obj.label28:setWidth(40); obj.label28:setHeight(20); obj.label28:setText("Magia"); obj.label28:setFontSize(13); obj.label28:setName("label28"); obj.edit28 = GUI.fromHandle(_obj_newObject("edit")); obj.edit28:setParent(obj.layout12); obj.edit28:setLeft(200); obj.edit28:setTop(25); obj.edit28:setWidth(40); obj.edit28:setHeight(25); obj.edit28:setField("int_magia"); obj.edit28:setName("edit28"); obj.label29 = GUI.fromHandle(_obj_newObject("label")); obj.label29:setParent(obj.layout12); obj.label29:setLeft(245); obj.label29:setTop(5); obj.label29:setWidth(47); obj.label29:setHeight(20); obj.label29:setText("Aprender"); obj.label29:setFontSize(10); obj.label29:setName("label29"); obj.edit29 = GUI.fromHandle(_obj_newObject("edit")); obj.edit29:setParent(obj.layout12); obj.edit29:setLeft(245); obj.edit29:setTop(25); obj.edit29:setWidth(40); obj.edit29:setHeight(25); obj.edit29:setField("int_aprender"); obj.edit29:setName("edit29"); obj.label30 = GUI.fromHandle(_obj_newObject("label")); obj.label30:setParent(obj.layout12); obj.label30:setLeft(290); obj.label30:setTop(5); obj.label30:setWidth(45); obj.label30:setHeight(20); obj.label30:setText("Maximo"); obj.label30:setFontSize(11); obj.label30:setName("label30"); obj.edit30 = GUI.fromHandle(_obj_newObject("edit")); obj.edit30:setParent(obj.layout12); obj.edit30:setLeft(290); obj.edit30:setTop(25); obj.edit30:setWidth(40); obj.edit30:setHeight(25); obj.edit30:setField("int_magia"); obj.edit30:setName("edit30"); obj.label31 = GUI.fromHandle(_obj_newObject("label")); obj.label31:setParent(obj.layout12); obj.label31:setLeft(335); obj.label31:setTop(5); obj.label31:setWidth(95); obj.label31:setHeight(20); obj.label31:setText("Imunidade à Magia"); obj.label31:setFontSize(11); obj.label31:setName("label31"); obj.edit31 = GUI.fromHandle(_obj_newObject("edit")); obj.edit31:setParent(obj.layout12); obj.edit31:setLeft(335); obj.edit31:setTop(25); obj.edit31:setWidth(95); obj.edit31:setHeight(25); obj.edit31:setField("int_imunidade"); obj.edit31:setName("edit31"); obj.layout13 = GUI.fromHandle(_obj_newObject("layout")); obj.layout13:setParent(obj.layout8); obj.layout13:setLeft(0); obj.layout13:setTop(250); obj.layout13:setWidth(450); obj.layout13:setHeight(50); obj.layout13:setName("layout13"); obj.label32 = GUI.fromHandle(_obj_newObject("label")); obj.label32:setParent(obj.layout13); obj.label32:setLeft(5); obj.label32:setTop(5); obj.label32:setWidth(100); obj.label32:setHeight(45); obj.label32:setText("SABEDORIA"); obj.label32:setName("label32"); obj.edit32 = GUI.fromHandle(_obj_newObject("edit")); obj.edit32:setParent(obj.layout13); obj.edit32:setLeft(100); obj.edit32:setTop(0); obj.edit32:setWidth(50); obj.edit32:setHeight(50); obj.edit32:setField("sabedoria"); obj.edit32:setHorzTextAlign("center"); obj.edit32:setFontSize(20); obj.edit32:setName("edit32"); obj.label33 = GUI.fromHandle(_obj_newObject("label")); obj.label33:setParent(obj.layout13); obj.label33:setLeft(155); obj.label33:setTop(5); obj.label33:setWidth(40); obj.label33:setHeight(20); obj.label33:setText("Defesa"); obj.label33:setFontSize(11); obj.label33:setName("label33"); obj.edit33 = GUI.fromHandle(_obj_newObject("edit")); obj.edit33:setParent(obj.layout13); obj.edit33:setLeft(155); obj.edit33:setTop(25); obj.edit33:setWidth(40); obj.edit33:setHeight(25); obj.edit33:setField("sab_defesa"); obj.edit33:setName("edit33"); obj.label34 = GUI.fromHandle(_obj_newObject("label")); obj.label34:setParent(obj.layout13); obj.label34:setLeft(200); obj.label34:setTop(5); obj.label34:setWidth(85); obj.label34:setHeight(20); obj.label34:setText("Magias Extras"); obj.label34:setFontSize(13); obj.label34:setName("label34"); obj.edit34 = GUI.fromHandle(_obj_newObject("edit")); obj.edit34:setParent(obj.layout13); obj.edit34:setLeft(200); obj.edit34:setTop(25); obj.edit34:setWidth(85); obj.edit34:setHeight(25); obj.edit34:setField("sab_extra"); obj.edit34:setName("edit34"); obj.label35 = GUI.fromHandle(_obj_newObject("label")); obj.label35:setParent(obj.layout13); obj.label35:setLeft(290); obj.label35:setTop(5); obj.label35:setWidth(45); obj.label35:setHeight(20); obj.label35:setText("Falha"); obj.label35:setFontSize(12); obj.label35:setName("label35"); obj.edit35 = GUI.fromHandle(_obj_newObject("edit")); obj.edit35:setParent(obj.layout13); obj.edit35:setLeft(290); obj.edit35:setTop(25); obj.edit35:setWidth(40); obj.edit35:setHeight(25); obj.edit35:setField("sab_falha"); obj.edit35:setName("edit35"); obj.label36 = GUI.fromHandle(_obj_newObject("label")); obj.label36:setParent(obj.layout13); obj.label36:setLeft(335); obj.label36:setTop(5); obj.label36:setWidth(95); obj.label36:setHeight(20); obj.label36:setText("Imunidade à Magia"); obj.label36:setFontSize(11); obj.label36:setName("label36"); obj.edit36 = GUI.fromHandle(_obj_newObject("edit")); obj.edit36:setParent(obj.layout13); obj.edit36:setLeft(335); obj.edit36:setTop(25); obj.edit36:setWidth(95); obj.edit36:setHeight(25); obj.edit36:setField("int_imunidade"); obj.edit36:setName("edit36"); obj.layout14 = GUI.fromHandle(_obj_newObject("layout")); obj.layout14:setParent(obj.layout8); obj.layout14:setLeft(0); obj.layout14:setTop(305); obj.layout14:setWidth(450); obj.layout14:setHeight(50); obj.layout14:setName("layout14"); obj.label37 = GUI.fromHandle(_obj_newObject("label")); obj.label37:setParent(obj.layout14); obj.label37:setLeft(5); obj.label37:setTop(5); obj.label37:setWidth(100); obj.label37:setHeight(45); obj.label37:setText("CARISMA"); obj.label37:setName("label37"); obj.edit37 = GUI.fromHandle(_obj_newObject("edit")); obj.edit37:setParent(obj.layout14); obj.edit37:setLeft(100); obj.edit37:setTop(0); obj.edit37:setWidth(50); obj.edit37:setHeight(50); obj.edit37:setField("carisma"); obj.edit37:setHorzTextAlign("center"); obj.edit37:setFontSize(20); obj.edit37:setName("edit37"); obj.label38 = GUI.fromHandle(_obj_newObject("label")); obj.label38:setParent(obj.layout14); obj.label38:setLeft(155); obj.label38:setTop(5); obj.label38:setWidth(40); obj.label38:setHeight(20); obj.label38:setText("Aliados"); obj.label38:setFontSize(12); obj.label38:setName("label38"); obj.edit38 = GUI.fromHandle(_obj_newObject("edit")); obj.edit38:setParent(obj.layout14); obj.edit38:setLeft(155); obj.edit38:setTop(25); obj.edit38:setWidth(40); obj.edit38:setHeight(25); obj.edit38:setField("car_aliados"); obj.edit38:setName("edit38"); obj.label39 = GUI.fromHandle(_obj_newObject("label")); obj.label39:setParent(obj.layout14); obj.label39:setLeft(203); obj.label39:setTop(5); obj.label39:setWidth(40); obj.label39:setHeight(20); obj.label39:setText("Lealdade"); obj.label39:setFontSize(10); obj.label39:setName("label39"); obj.edit39 = GUI.fromHandle(_obj_newObject("edit")); obj.edit39:setParent(obj.layout14); obj.edit39:setLeft(200); obj.edit39:setTop(25); obj.edit39:setWidth(40); obj.edit39:setHeight(25); obj.edit39:setField("car_lealdade"); obj.edit39:setName("edit39"); obj.label40 = GUI.fromHandle(_obj_newObject("label")); obj.label40:setParent(obj.layout14); obj.label40:setLeft(247); obj.label40:setTop(5); obj.label40:setWidth(40); obj.label40:setHeight(20); obj.label40:setText("Reação"); obj.label40:setFontSize(12); obj.label40:setName("label40"); obj.edit40 = GUI.fromHandle(_obj_newObject("edit")); obj.edit40:setParent(obj.layout14); obj.edit40:setLeft(245); obj.edit40:setTop(25); obj.edit40:setWidth(40); obj.edit40:setHeight(25); obj.edit40:setField("car_reação"); obj.edit40:setName("edit40"); obj.layout15 = GUI.fromHandle(_obj_newObject("layout")); obj.layout15:setParent(obj.scrollBox1); obj.layout15:setLeft(0); obj.layout15:setTop(450); obj.layout15:setWidth(600); obj.layout15:setHeight(160); obj.layout15:setName("layout15"); obj.rectangle3 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle3:setParent(obj.layout15); obj.rectangle3:setAlign("client"); obj.rectangle3:setColor("black"); obj.rectangle3:setXradius(5); obj.rectangle3:setYradius(5); obj.rectangle3:setCornerType("round"); obj.rectangle3:setName("rectangle3"); obj.label41 = GUI.fromHandle(_obj_newObject("label")); obj.label41:setParent(obj.layout15); obj.label41:setLeft(0); obj.label41:setTop(5); obj.label41:setWidth(600); obj.label41:setHeight(20); obj.label41:setText("RESISTÊNCIAS"); obj.label41:setHorzTextAlign("center"); obj.label41:setName("label41"); obj.layout16 = GUI.fromHandle(_obj_newObject("layout")); obj.layout16:setParent(obj.layout15); obj.layout16:setLeft(0); obj.layout16:setTop(25); obj.layout16:setWidth(600); obj.layout16:setHeight(25); obj.layout16:setName("layout16"); obj.label42 = GUI.fromHandle(_obj_newObject("label")); obj.label42:setParent(obj.layout16); obj.label42:setLeft(100); obj.label42:setTop(5); obj.label42:setWidth(35); obj.label42:setHeight(20); obj.label42:setText("1"); obj.label42:setHorzTextAlign("center"); obj.label42:setName("label42"); obj.label43 = GUI.fromHandle(_obj_newObject("label")); obj.label43:setParent(obj.layout16); obj.label43:setLeft(135); obj.label43:setTop(5); obj.label43:setWidth(35); obj.label43:setHeight(20); obj.label43:setText("2"); obj.label43:setHorzTextAlign("center"); obj.label43:setName("label43"); obj.label44 = GUI.fromHandle(_obj_newObject("label")); obj.label44:setParent(obj.layout16); obj.label44:setLeft(170); obj.label44:setTop(5); obj.label44:setWidth(35); obj.label44:setHeight(20); obj.label44:setText("3"); obj.label44:setHorzTextAlign("center"); obj.label44:setName("label44"); obj.label45 = GUI.fromHandle(_obj_newObject("label")); obj.label45:setParent(obj.layout16); obj.label45:setLeft(205); obj.label45:setTop(5); obj.label45:setWidth(35); obj.label45:setHeight(20); obj.label45:setText("4"); obj.label45:setHorzTextAlign("center"); obj.label45:setName("label45"); obj.label46 = GUI.fromHandle(_obj_newObject("label")); obj.label46:setParent(obj.layout16); obj.label46:setLeft(240); obj.label46:setTop(5); obj.label46:setWidth(35); obj.label46:setHeight(20); obj.label46:setText("5"); obj.label46:setHorzTextAlign("center"); obj.label46:setName("label46"); obj.label47 = GUI.fromHandle(_obj_newObject("label")); obj.label47:setParent(obj.layout16); obj.label47:setLeft(275); obj.label47:setTop(5); obj.label47:setWidth(35); obj.label47:setHeight(20); obj.label47:setText("6"); obj.label47:setHorzTextAlign("center"); obj.label47:setName("label47"); obj.label48 = GUI.fromHandle(_obj_newObject("label")); obj.label48:setParent(obj.layout16); obj.label48:setLeft(310); obj.label48:setTop(5); obj.label48:setWidth(35); obj.label48:setHeight(20); obj.label48:setText("7"); obj.label48:setHorzTextAlign("center"); obj.label48:setName("label48"); obj.label49 = GUI.fromHandle(_obj_newObject("label")); obj.label49:setParent(obj.layout16); obj.label49:setLeft(345); obj.label49:setTop(5); obj.label49:setWidth(35); obj.label49:setHeight(20); obj.label49:setText("8"); obj.label49:setHorzTextAlign("center"); obj.label49:setName("label49"); obj.label50 = GUI.fromHandle(_obj_newObject("label")); obj.label50:setParent(obj.layout16); obj.label50:setLeft(380); obj.label50:setTop(5); obj.label50:setWidth(35); obj.label50:setHeight(20); obj.label50:setText("9"); obj.label50:setHorzTextAlign("center"); obj.label50:setName("label50"); obj.label51 = GUI.fromHandle(_obj_newObject("label")); obj.label51:setParent(obj.layout16); obj.label51:setLeft(415); obj.label51:setTop(5); obj.label51:setWidth(35); obj.label51:setHeight(20); obj.label51:setText("10"); obj.label51:setHorzTextAlign("center"); obj.label51:setName("label51"); obj.label52 = GUI.fromHandle(_obj_newObject("label")); obj.label52:setParent(obj.layout16); obj.label52:setLeft(455); obj.label52:setTop(5); obj.label52:setWidth(105); obj.label52:setHeight(20); obj.label52:setText("Paralisia/Veneno/Morte"); obj.label52:setHorzTextAlign("trailing"); obj.label52:setFontSize(10); obj.label52:setName("label52"); obj.edit41 = GUI.fromHandle(_obj_newObject("edit")); obj.edit41:setParent(obj.layout16); obj.edit41:setLeft(560); obj.edit41:setTop(0); obj.edit41:setWidth(35); obj.edit41:setHeight(25); obj.edit41:setField("TRveneno"); obj.edit41:setName("edit41"); obj.layout17 = GUI.fromHandle(_obj_newObject("layout")); obj.layout17:setParent(obj.layout15); obj.layout17:setLeft(0); obj.layout17:setTop(50); obj.layout17:setWidth(600); obj.layout17:setHeight(25); obj.layout17:setName("layout17"); obj.label53 = GUI.fromHandle(_obj_newObject("label")); obj.label53:setParent(obj.layout17); obj.label53:setLeft(2); obj.label53:setTop(5); obj.label53:setWidth(40); obj.label53:setHeight(20); obj.label53:setText("TACO"); obj.label53:setHorzTextAlign("trailing"); obj.label53:setName("label53"); obj.edit42 = GUI.fromHandle(_obj_newObject("edit")); obj.edit42:setParent(obj.layout17); obj.edit42:setLeft(45); obj.edit42:setTop(0); obj.edit42:setWidth(40); obj.edit42:setHeight(25); obj.edit42:setField("taco"); obj.edit42:setName("edit42"); obj.edit43 = GUI.fromHandle(_obj_newObject("edit")); obj.edit43:setParent(obj.layout17); obj.edit43:setLeft(100); obj.edit43:setTop(0); obj.edit43:setWidth(35); obj.edit43:setHeight(25); obj.edit43:setField("taco1"); obj.edit43:setName("edit43"); obj.edit44 = GUI.fromHandle(_obj_newObject("edit")); obj.edit44:setParent(obj.layout17); obj.edit44:setLeft(135); obj.edit44:setTop(0); obj.edit44:setWidth(35); obj.edit44:setHeight(25); obj.edit44:setField("taco2"); obj.edit44:setName("edit44"); obj.edit45 = GUI.fromHandle(_obj_newObject("edit")); obj.edit45:setParent(obj.layout17); obj.edit45:setLeft(170); obj.edit45:setTop(0); obj.edit45:setWidth(35); obj.edit45:setHeight(25); obj.edit45:setField("taco3"); obj.edit45:setName("edit45"); obj.edit46 = GUI.fromHandle(_obj_newObject("edit")); obj.edit46:setParent(obj.layout17); obj.edit46:setLeft(205); obj.edit46:setTop(0); obj.edit46:setWidth(35); obj.edit46:setHeight(25); obj.edit46:setField("taco4"); obj.edit46:setName("edit46"); obj.edit47 = GUI.fromHandle(_obj_newObject("edit")); obj.edit47:setParent(obj.layout17); obj.edit47:setLeft(240); obj.edit47:setTop(0); obj.edit47:setWidth(35); obj.edit47:setHeight(25); obj.edit47:setField("taco5"); obj.edit47:setName("edit47"); obj.edit48 = GUI.fromHandle(_obj_newObject("edit")); obj.edit48:setParent(obj.layout17); obj.edit48:setLeft(275); obj.edit48:setTop(0); obj.edit48:setWidth(35); obj.edit48:setHeight(25); obj.edit48:setField("taco6"); obj.edit48:setName("edit48"); obj.edit49 = GUI.fromHandle(_obj_newObject("edit")); obj.edit49:setParent(obj.layout17); obj.edit49:setLeft(310); obj.edit49:setTop(0); obj.edit49:setWidth(35); obj.edit49:setHeight(25); obj.edit49:setField("taco7"); obj.edit49:setName("edit49"); obj.edit50 = GUI.fromHandle(_obj_newObject("edit")); obj.edit50:setParent(obj.layout17); obj.edit50:setLeft(345); obj.edit50:setTop(0); obj.edit50:setWidth(35); obj.edit50:setHeight(25); obj.edit50:setField("taco8"); obj.edit50:setName("edit50"); obj.edit51 = GUI.fromHandle(_obj_newObject("edit")); obj.edit51:setParent(obj.layout17); obj.edit51:setLeft(380); obj.edit51:setTop(0); obj.edit51:setWidth(35); obj.edit51:setHeight(25); obj.edit51:setField("taco9"); obj.edit51:setName("edit51"); obj.edit52 = GUI.fromHandle(_obj_newObject("edit")); obj.edit52:setParent(obj.layout17); obj.edit52:setLeft(415); obj.edit52:setTop(0); obj.edit52:setWidth(35); obj.edit52:setHeight(25); obj.edit52:setField("taco10"); obj.edit52:setName("edit52"); obj.label54 = GUI.fromHandle(_obj_newObject("label")); obj.label54:setParent(obj.layout17); obj.label54:setLeft(455); obj.label54:setTop(5); obj.label54:setWidth(105); obj.label54:setHeight(20); obj.label54:setText("Bastão/Cajado/Varinha"); obj.label54:setHorzTextAlign("trailing"); obj.label54:setFontSize(10); obj.label54:setName("label54"); obj.edit53 = GUI.fromHandle(_obj_newObject("edit")); obj.edit53:setParent(obj.layout17); obj.edit53:setLeft(560); obj.edit53:setTop(0); obj.edit53:setWidth(35); obj.edit53:setHeight(25); obj.edit53:setField("TRgatilho"); obj.edit53:setName("edit53"); obj.layout18 = GUI.fromHandle(_obj_newObject("layout")); obj.layout18:setParent(obj.layout15); obj.layout18:setLeft(0); obj.layout18:setTop(75); obj.layout18:setWidth(600); obj.layout18:setHeight(25); obj.layout18:setName("layout18"); obj.label55 = GUI.fromHandle(_obj_newObject("label")); obj.label55:setParent(obj.layout18); obj.label55:setLeft(2); obj.label55:setTop(5); obj.label55:setWidth(40); obj.label55:setHeight(20); obj.label55:setText("Acerto"); obj.label55:setHorzTextAlign("trailing"); obj.label55:setName("label55"); obj.edit54 = GUI.fromHandle(_obj_newObject("edit")); obj.edit54:setParent(obj.layout18); obj.edit54:setLeft(45); obj.edit54:setTop(0); obj.edit54:setWidth(40); obj.edit54:setHeight(25); obj.edit54:setField("acerto"); obj.edit54:setName("edit54"); obj.label56 = GUI.fromHandle(_obj_newObject("label")); obj.label56:setParent(obj.layout18); obj.label56:setLeft(100); obj.label56:setTop(5); obj.label56:setWidth(35); obj.label56:setHeight(20); obj.label56:setText("-1"); obj.label56:setHorzTextAlign("center"); obj.label56:setName("label56"); obj.label57 = GUI.fromHandle(_obj_newObject("label")); obj.label57:setParent(obj.layout18); obj.label57:setLeft(135); obj.label57:setTop(5); obj.label57:setWidth(35); obj.label57:setHeight(20); obj.label57:setText("-2"); obj.label57:setHorzTextAlign("center"); obj.label57:setName("label57"); obj.label58 = GUI.fromHandle(_obj_newObject("label")); obj.label58:setParent(obj.layout18); obj.label58:setLeft(170); obj.label58:setTop(5); obj.label58:setWidth(35); obj.label58:setHeight(20); obj.label58:setText("-3"); obj.label58:setHorzTextAlign("center"); obj.label58:setName("label58"); obj.label59 = GUI.fromHandle(_obj_newObject("label")); obj.label59:setParent(obj.layout18); obj.label59:setLeft(205); obj.label59:setTop(5); obj.label59:setWidth(35); obj.label59:setHeight(20); obj.label59:setText("-4"); obj.label59:setHorzTextAlign("center"); obj.label59:setName("label59"); obj.label60 = GUI.fromHandle(_obj_newObject("label")); obj.label60:setParent(obj.layout18); obj.label60:setLeft(240); obj.label60:setTop(5); obj.label60:setWidth(35); obj.label60:setHeight(20); obj.label60:setText("-5"); obj.label60:setHorzTextAlign("center"); obj.label60:setName("label60"); obj.label61 = GUI.fromHandle(_obj_newObject("label")); obj.label61:setParent(obj.layout18); obj.label61:setLeft(275); obj.label61:setTop(5); obj.label61:setWidth(35); obj.label61:setHeight(20); obj.label61:setText("-6"); obj.label61:setHorzTextAlign("center"); obj.label61:setName("label61"); obj.label62 = GUI.fromHandle(_obj_newObject("label")); obj.label62:setParent(obj.layout18); obj.label62:setLeft(310); obj.label62:setTop(5); obj.label62:setWidth(35); obj.label62:setHeight(20); obj.label62:setText("-7"); obj.label62:setHorzTextAlign("center"); obj.label62:setName("label62"); obj.label63 = GUI.fromHandle(_obj_newObject("label")); obj.label63:setParent(obj.layout18); obj.label63:setLeft(345); obj.label63:setTop(5); obj.label63:setWidth(35); obj.label63:setHeight(20); obj.label63:setText("-8"); obj.label63:setHorzTextAlign("center"); obj.label63:setName("label63"); obj.label64 = GUI.fromHandle(_obj_newObject("label")); obj.label64:setParent(obj.layout18); obj.label64:setLeft(380); obj.label64:setTop(5); obj.label64:setWidth(35); obj.label64:setHeight(20); obj.label64:setText("-9"); obj.label64:setHorzTextAlign("center"); obj.label64:setName("label64"); obj.label65 = GUI.fromHandle(_obj_newObject("label")); obj.label65:setParent(obj.layout18); obj.label65:setLeft(415); obj.label65:setTop(5); obj.label65:setWidth(35); obj.label65:setHeight(20); obj.label65:setText("-10"); obj.label65:setHorzTextAlign("center"); obj.label65:setName("label65"); obj.label66 = GUI.fromHandle(_obj_newObject("label")); obj.label66:setParent(obj.layout18); obj.label66:setLeft(455); obj.label66:setTop(5); obj.label66:setWidth(105); obj.label66:setHeight(20); obj.label66:setText("Petrificação/Transformação"); obj.label66:setHorzTextAlign("trailing"); obj.label66:setFontSize(8); obj.label66:setName("label66"); obj.edit55 = GUI.fromHandle(_obj_newObject("edit")); obj.edit55:setParent(obj.layout18); obj.edit55:setLeft(560); obj.edit55:setTop(0); obj.edit55:setWidth(35); obj.edit55:setHeight(25); obj.edit55:setField("TRtransmutacao"); obj.edit55:setName("edit55"); obj.layout19 = GUI.fromHandle(_obj_newObject("layout")); obj.layout19:setParent(obj.layout15); obj.layout19:setLeft(0); obj.layout19:setTop(100); obj.layout19:setWidth(600); obj.layout19:setHeight(25); obj.layout19:setName("layout19"); obj.label67 = GUI.fromHandle(_obj_newObject("label")); obj.label67:setParent(obj.layout19); obj.label67:setLeft(2); obj.label67:setTop(5); obj.label67:setWidth(40); obj.label67:setHeight(20); obj.label67:setText("Distância"); obj.label67:setHorzTextAlign("trailing"); obj.label67:setFontSize(10); obj.label67:setName("label67"); obj.edit56 = GUI.fromHandle(_obj_newObject("edit")); obj.edit56:setParent(obj.layout19); obj.edit56:setLeft(45); obj.edit56:setTop(0); obj.edit56:setWidth(40); obj.edit56:setHeight(25); obj.edit56:setField("distancia"); obj.edit56:setName("edit56"); obj.edit57 = GUI.fromHandle(_obj_newObject("edit")); obj.edit57:setParent(obj.layout19); obj.edit57:setLeft(100); obj.edit57:setTop(0); obj.edit57:setWidth(35); obj.edit57:setHeight(25); obj.edit57:setField("taco-1"); obj.edit57:setName("edit57"); obj.edit58 = GUI.fromHandle(_obj_newObject("edit")); obj.edit58:setParent(obj.layout19); obj.edit58:setLeft(135); obj.edit58:setTop(0); obj.edit58:setWidth(35); obj.edit58:setHeight(25); obj.edit58:setField("taco-2"); obj.edit58:setName("edit58"); obj.edit59 = GUI.fromHandle(_obj_newObject("edit")); obj.edit59:setParent(obj.layout19); obj.edit59:setLeft(170); obj.edit59:setTop(0); obj.edit59:setWidth(35); obj.edit59:setHeight(25); obj.edit59:setField("taco-3"); obj.edit59:setName("edit59"); obj.edit60 = GUI.fromHandle(_obj_newObject("edit")); obj.edit60:setParent(obj.layout19); obj.edit60:setLeft(205); obj.edit60:setTop(0); obj.edit60:setWidth(35); obj.edit60:setHeight(25); obj.edit60:setField("taco-4"); obj.edit60:setName("edit60"); obj.edit61 = GUI.fromHandle(_obj_newObject("edit")); obj.edit61:setParent(obj.layout19); obj.edit61:setLeft(240); obj.edit61:setTop(0); obj.edit61:setWidth(35); obj.edit61:setHeight(25); obj.edit61:setField("taco-5"); obj.edit61:setName("edit61"); obj.edit62 = GUI.fromHandle(_obj_newObject("edit")); obj.edit62:setParent(obj.layout19); obj.edit62:setLeft(275); obj.edit62:setTop(0); obj.edit62:setWidth(35); obj.edit62:setHeight(25); obj.edit62:setField("taco-6"); obj.edit62:setName("edit62"); obj.edit63 = GUI.fromHandle(_obj_newObject("edit")); obj.edit63:setParent(obj.layout19); obj.edit63:setLeft(310); obj.edit63:setTop(0); obj.edit63:setWidth(35); obj.edit63:setHeight(25); obj.edit63:setField("taco-7"); obj.edit63:setName("edit63"); obj.edit64 = GUI.fromHandle(_obj_newObject("edit")); obj.edit64:setParent(obj.layout19); obj.edit64:setLeft(345); obj.edit64:setTop(0); obj.edit64:setWidth(35); obj.edit64:setHeight(25); obj.edit64:setField("taco-8"); obj.edit64:setName("edit64"); obj.edit65 = GUI.fromHandle(_obj_newObject("edit")); obj.edit65:setParent(obj.layout19); obj.edit65:setLeft(380); obj.edit65:setTop(0); obj.edit65:setWidth(35); obj.edit65:setHeight(25); obj.edit65:setField("taco-9"); obj.edit65:setName("edit65"); obj.edit66 = GUI.fromHandle(_obj_newObject("edit")); obj.edit66:setParent(obj.layout19); obj.edit66:setLeft(415); obj.edit66:setTop(0); obj.edit66:setWidth(35); obj.edit66:setHeight(25); obj.edit66:setField("taco-10"); obj.edit66:setName("edit66"); obj.label68 = GUI.fromHandle(_obj_newObject("label")); obj.label68:setParent(obj.layout19); obj.label68:setLeft(455); obj.label68:setTop(5); obj.label68:setWidth(105); obj.label68:setHeight(20); obj.label68:setText("Sopro-de-Dragão"); obj.label68:setHorzTextAlign("trailing"); obj.label68:setFontSize(11); obj.label68:setName("label68"); obj.edit67 = GUI.fromHandle(_obj_newObject("edit")); obj.edit67:setParent(obj.layout19); obj.edit67:setLeft(560); obj.edit67:setTop(0); obj.edit67:setWidth(35); obj.edit67:setHeight(25); obj.edit67:setField("TRsopro"); obj.edit67:setName("edit67"); obj.layout20 = GUI.fromHandle(_obj_newObject("layout")); obj.layout20:setParent(obj.layout15); obj.layout20:setLeft(0); obj.layout20:setTop(125); obj.layout20:setWidth(600); obj.layout20:setHeight(25); obj.layout20:setName("layout20"); obj.label69 = GUI.fromHandle(_obj_newObject("label")); obj.label69:setParent(obj.layout20); obj.label69:setLeft(455); obj.label69:setTop(5); obj.label69:setWidth(105); obj.label69:setHeight(20); obj.label69:setText("Magia"); obj.label69:setHorzTextAlign("trailing"); obj.label69:setFontSize(13); obj.label69:setName("label69"); obj.edit68 = GUI.fromHandle(_obj_newObject("edit")); obj.edit68:setParent(obj.layout20); obj.edit68:setLeft(560); obj.edit68:setTop(0); obj.edit68:setWidth(35); obj.edit68:setHeight(25); obj.edit68:setField("TRmagia"); obj.edit68:setName("edit68"); obj.layout21 = GUI.fromHandle(_obj_newObject("layout")); obj.layout21:setParent(obj.scrollBox1); obj.layout21:setLeft(460); obj.layout21:setTop(80); obj.layout21:setWidth(200); obj.layout21:setHeight(160); obj.layout21:setName("layout21"); obj.rectangle4 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle4:setParent(obj.layout21); obj.rectangle4:setAlign("client"); obj.rectangle4:setColor("black"); obj.rectangle4:setXradius(5); obj.rectangle4:setYradius(5); obj.rectangle4:setCornerType("round"); obj.rectangle4:setName("rectangle4"); obj.label70 = GUI.fromHandle(_obj_newObject("label")); obj.label70:setParent(obj.layout21); obj.label70:setLeft(0); obj.label70:setTop(5); obj.label70:setWidth(200); obj.label70:setHeight(20); obj.label70:setText("CATEGORIA DE ARMADURA (CA)"); obj.label70:setHorzTextAlign("center"); obj.label70:setName("label70"); obj.label71 = GUI.fromHandle(_obj_newObject("label")); obj.label71:setParent(obj.layout21); obj.label71:setLeft(5); obj.label71:setTop(30); obj.label71:setWidth(90); obj.label71:setHeight(20); obj.label71:setText("Destreza"); obj.label71:setHorzTextAlign("trailing"); obj.label71:setName("label71"); obj.edit69 = GUI.fromHandle(_obj_newObject("edit")); obj.edit69:setParent(obj.layout21); obj.edit69:setLeft(100); obj.edit69:setTop(25); obj.edit69:setWidth(40); obj.edit69:setHeight(25); obj.edit69:setField("CAdes"); obj.edit69:setName("edit69"); obj.label72 = GUI.fromHandle(_obj_newObject("label")); obj.label72:setParent(obj.layout21); obj.label72:setLeft(5); obj.label72:setTop(55); obj.label72:setWidth(90); obj.label72:setHeight(20); obj.label72:setText("Armadura"); obj.label72:setHorzTextAlign("trailing"); obj.label72:setName("label72"); obj.edit70 = GUI.fromHandle(_obj_newObject("edit")); obj.edit70:setParent(obj.layout21); obj.edit70:setLeft(100); obj.edit70:setTop(50); obj.edit70:setWidth(40); obj.edit70:setHeight(25); obj.edit70:setField("CAarmadura"); obj.edit70:setName("edit70"); obj.label73 = GUI.fromHandle(_obj_newObject("label")); obj.label73:setParent(obj.layout21); obj.label73:setLeft(5); obj.label73:setTop(80); obj.label73:setWidth(90); obj.label73:setHeight(20); obj.label73:setText("Escudo"); obj.label73:setHorzTextAlign("trailing"); obj.label73:setName("label73"); obj.edit71 = GUI.fromHandle(_obj_newObject("edit")); obj.edit71:setParent(obj.layout21); obj.edit71:setLeft(100); obj.edit71:setTop(75); obj.edit71:setWidth(40); obj.edit71:setHeight(25); obj.edit71:setField("CAescudo"); obj.edit71:setName("edit71"); obj.label74 = GUI.fromHandle(_obj_newObject("label")); obj.label74:setParent(obj.layout21); obj.label74:setLeft(5); obj.label74:setTop(105); obj.label74:setWidth(90); obj.label74:setHeight(20); obj.label74:setText(""); obj.label74:setHorzTextAlign("trailing"); obj.label74:setName("label74"); obj.edit72 = GUI.fromHandle(_obj_newObject("edit")); obj.edit72:setParent(obj.layout21); obj.edit72:setLeft(100); obj.edit72:setTop(100); obj.edit72:setWidth(40); obj.edit72:setHeight(25); obj.edit72:setField("CAoutros"); obj.edit72:setName("edit72"); obj.label75 = GUI.fromHandle(_obj_newObject("label")); obj.label75:setParent(obj.layout21); obj.label75:setLeft(5); obj.label75:setTop(130); obj.label75:setWidth(90); obj.label75:setHeight(20); obj.label75:setText("TOTAL"); obj.label75:setHorzTextAlign("trailing"); obj.label75:setName("label75"); obj.rectangle5 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle5:setParent(obj.layout21); obj.rectangle5:setLeft(100); obj.rectangle5:setTop(125); obj.rectangle5:setWidth(40); obj.rectangle5:setHeight(25); obj.rectangle5:setColor("Black"); obj.rectangle5:setStrokeColor("white"); obj.rectangle5:setStrokeSize(1); obj.rectangle5:setName("rectangle5"); obj.label76 = GUI.fromHandle(_obj_newObject("label")); obj.label76:setParent(obj.layout21); obj.label76:setLeft(100); obj.label76:setTop(125); obj.label76:setWidth(40); obj.label76:setHeight(25); obj.label76:setField("CAtotal"); obj.label76:setHorzTextAlign("center"); obj.label76:setName("label76"); local function sumCA(); if sheet~=nil then local mod = 10 + (tonumber(sheet.CAdes) or 0) + (tonumber(sheet.CAarmadura) or 0) + (tonumber(sheet.CAescudo) or 0) + (tonumber(sheet.CAoutros) or 0); sheet.CAtotal = mod; end; end; obj.layout22 = GUI.fromHandle(_obj_newObject("layout")); obj.layout22:setParent(obj.scrollBox1); obj.layout22:setLeft(460); obj.layout22:setTop(250); obj.layout22:setWidth(200); obj.layout22:setHeight(60); obj.layout22:setName("layout22"); obj.rectangle6 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle6:setParent(obj.layout22); obj.rectangle6:setAlign("client"); obj.rectangle6:setColor("black"); obj.rectangle6:setXradius(5); obj.rectangle6:setYradius(5); obj.rectangle6:setCornerType("round"); obj.rectangle6:setName("rectangle6"); obj.label77 = GUI.fromHandle(_obj_newObject("label")); obj.label77:setParent(obj.layout22); obj.label77:setLeft(0); obj.label77:setTop(5); obj.label77:setWidth(200); obj.label77:setHeight(20); obj.label77:setText("PONTOS DE VIDA"); obj.label77:setHorzTextAlign("center"); obj.label77:setName("label77"); obj.edit73 = GUI.fromHandle(_obj_newObject("edit")); obj.edit73:setParent(obj.layout22); obj.edit73:setLeft(5); obj.edit73:setTop(30); obj.edit73:setWidth(95); obj.edit73:setHeight(25); obj.edit73:setField("PVatual"); obj.edit73:setName("edit73"); obj.edit74 = GUI.fromHandle(_obj_newObject("edit")); obj.edit74:setParent(obj.layout22); obj.edit74:setLeft(100); obj.edit74:setTop(30); obj.edit74:setWidth(95); obj.edit74:setHeight(25); obj.edit74:setField("PVmax"); obj.edit74:setName("edit74"); obj.image1 = GUI.fromHandle(_obj_newObject("image")); obj.image1:setParent(obj.scrollBox1); obj.image1:setLeft(460); obj.image1:setTop(320); obj.image1:setWidth(120); obj.image1:setHeight(120); obj.image1:setStyle("stretch"); obj.image1:setSRC("/Ficha ADnD 2e/images/d20.png"); obj.image1:setName("image1"); obj.rectangle7 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle7:setParent(obj.scrollBox1); obj.rectangle7:setLeft(670); obj.rectangle7:setTop(80); obj.rectangle7:setWidth(230); obj.rectangle7:setHeight(230); obj.rectangle7:setColor("DimGray"); obj.rectangle7:setXradius(5); obj.rectangle7:setYradius(5); obj.rectangle7:setCornerType("innerLine"); obj.rectangle7:setName("rectangle7"); obj.image2 = GUI.fromHandle(_obj_newObject("image")); obj.image2:setParent(obj.scrollBox1); obj.image2:setLeft(670); obj.image2:setTop(80); obj.image2:setWidth(230); obj.image2:setHeight(230); obj.image2:setField("avatar"); obj.image2:setEditable(true); obj.image2:setStyle("autoFit"); obj.image2:setName("image2"); obj.layout23 = GUI.fromHandle(_obj_newObject("layout")); obj.layout23:setParent(obj.scrollBox1); obj.layout23:setLeft(610); obj.layout23:setTop(320); obj.layout23:setWidth(600); obj.layout23:setHeight(290); obj.layout23:setName("layout23"); obj.rectangle8 = GUI.fromHandle(_obj_newObject("rectangle")); obj.rectangle8:setParent(obj.layout23); obj.rectangle8:setAlign("client"); obj.rectangle8:setColor("black"); obj.rectangle8:setXradius(5); obj.rectangle8:setYradius(5); obj.rectangle8:setCornerType("round"); obj.rectangle8:setName("rectangle8"); obj.label78 = GUI.fromHandle(_obj_newObject("label")); obj.label78:setParent(obj.layout23); obj.label78:setLeft(0); obj.label78:setTop(5); obj.label78:setWidth(600); obj.label78:setHeight(20); obj.label78:setText("ARMAS"); obj.label78:setHorzTextAlign("center"); obj.label78:setName("label78"); obj.layout24 = GUI.fromHandle(_obj_newObject("layout")); obj.layout24:setParent(obj.layout23); obj.layout24:setLeft(0); obj.layout24:setTop(30); obj.layout24:setWidth(600); obj.layout24:setHeight(25); obj.layout24:setName("layout24"); obj.label79 = GUI.fromHandle(_obj_newObject("label")); obj.label79:setParent(obj.layout24); obj.label79:setLeft(5); obj.label79:setTop(0); obj.label79:setWidth(190); obj.label79:setHeight(25); obj.label79:setFontSize(13); obj.label79:setHorzTextAlign("center"); obj.label79:setText("Arma"); obj.label79:setName("label79"); obj.label80 = GUI.fromHandle(_obj_newObject("label")); obj.label80:setParent(obj.layout24); obj.label80:setLeft(195); obj.label80:setTop(0); obj.label80:setWidth(50); obj.label80:setHeight(25); obj.label80:setFontSize(11); obj.label80:setHorzTextAlign("center"); obj.label80:setText("Ataques"); obj.label80:setName("label80"); obj.label81 = GUI.fromHandle(_obj_newObject("label")); obj.label81:setParent(obj.layout24); obj.label81:setLeft(245); obj.label81:setTop(0); obj.label81:setWidth(50); obj.label81:setHeight(25); obj.label81:setFontSize(11); obj.label81:setHorzTextAlign("center"); obj.label81:setText("Alcance"); obj.label81:setName("label81"); obj.label82 = GUI.fromHandle(_obj_newObject("label")); obj.label82:setParent(obj.layout24); obj.label82:setLeft(295); obj.label82:setTop(0); obj.label82:setWidth(50); obj.label82:setHeight(25); obj.label82:setFontSize(9); obj.label82:setHorzTextAlign("center"); obj.label82:setText("Dano (P/M)"); obj.label82:setName("label82"); obj.label83 = GUI.fromHandle(_obj_newObject("label")); obj.label83:setParent(obj.layout24); obj.label83:setLeft(345); obj.label83:setTop(0); obj.label83:setWidth(50); obj.label83:setHeight(25); obj.label83:setFontSize(11); obj.label83:setHorzTextAlign("center"); obj.label83:setText("Dano (G)"); obj.label83:setName("label83"); obj.label84 = GUI.fromHandle(_obj_newObject("label")); obj.label84:setParent(obj.layout24); obj.label84:setLeft(395); obj.label84:setTop(0); obj.label84:setWidth(50); obj.label84:setHeight(25); obj.label84:setFontSize(10); obj.label84:setHorzTextAlign("center"); obj.label84:setText("Ajuste"); obj.label84:setName("label84"); obj.label85 = GUI.fromHandle(_obj_newObject("label")); obj.label85:setParent(obj.layout24); obj.label85:setLeft(445); obj.label85:setTop(0); obj.label85:setWidth(50); obj.label85:setHeight(25); obj.label85:setFontSize(13); obj.label85:setHorzTextAlign("center"); obj.label85:setText("Peso"); obj.label85:setName("label85"); obj.label86 = GUI.fromHandle(_obj_newObject("label")); obj.label86:setParent(obj.layout24); obj.label86:setLeft(495); obj.label86:setTop(0); obj.label86:setWidth(50); obj.label86:setHeight(25); obj.label86:setFontSize(13); obj.label86:setHorzTextAlign("center"); obj.label86:setText("Tipo"); obj.label86:setName("label86"); obj.label87 = GUI.fromHandle(_obj_newObject("label")); obj.label87:setParent(obj.layout24); obj.label87:setLeft(545); obj.label87:setTop(0); obj.label87:setWidth(50); obj.label87:setHeight(25); obj.label87:setFontSize(10); obj.label87:setHorzTextAlign("center"); obj.label87:setText("Velocidade"); obj.label87:setName("label87"); obj.layout25 = GUI.fromHandle(_obj_newObject("layout")); obj.layout25:setParent(obj.layout23); obj.layout25:setLeft(0); obj.layout25:setTop(55); obj.layout25:setWidth(600); obj.layout25:setHeight(25); obj.layout25:setName("layout25"); obj.edit75 = GUI.fromHandle(_obj_newObject("edit")); obj.edit75:setParent(obj.layout25); obj.edit75:setLeft(5); obj.edit75:setTop(0); obj.edit75:setWidth(190); obj.edit75:setHeight(25); obj.edit75:setField("Arma_1"); obj.edit75:setName("edit75"); obj.edit76 = GUI.fromHandle(_obj_newObject("edit")); obj.edit76:setParent(obj.layout25); obj.edit76:setLeft(195); obj.edit76:setTop(0); obj.edit76:setWidth(50); obj.edit76:setHeight(25); obj.edit76:setField("Arma_ataques_1"); obj.edit76:setName("edit76"); obj.edit77 = GUI.fromHandle(_obj_newObject("edit")); obj.edit77:setParent(obj.layout25); obj.edit77:setLeft(245); obj.edit77:setTop(0); obj.edit77:setWidth(50); obj.edit77:setHeight(25); obj.edit77:setField("Arma_alcance_1"); obj.edit77:setName("edit77"); obj.edit78 = GUI.fromHandle(_obj_newObject("edit")); obj.edit78:setParent(obj.layout25); obj.edit78:setLeft(295); obj.edit78:setTop(0); obj.edit78:setWidth(50); obj.edit78:setHeight(25); obj.edit78:setField("Arma_dano_pm_1"); obj.edit78:setName("edit78"); obj.edit79 = GUI.fromHandle(_obj_newObject("edit")); obj.edit79:setParent(obj.layout25); obj.edit79:setLeft(345); obj.edit79:setTop(0); obj.edit79:setWidth(50); obj.edit79:setHeight(25); obj.edit79:setField("Arma_dano_g_1"); obj.edit79:setName("edit79"); obj.edit80 = GUI.fromHandle(_obj_newObject("edit")); obj.edit80:setParent(obj.layout25); obj.edit80:setLeft(395); obj.edit80:setTop(0); obj.edit80:setWidth(50); obj.edit80:setHeight(25); obj.edit80:setField("Arma_ajuste_1"); obj.edit80:setName("edit80"); obj.edit81 = GUI.fromHandle(_obj_newObject("edit")); obj.edit81:setParent(obj.layout25); obj.edit81:setLeft(445); obj.edit81:setTop(0); obj.edit81:setWidth(50); obj.edit81:setHeight(25); obj.edit81:setField("Arma_tipo_1"); obj.edit81:setName("edit81"); obj.edit82 = GUI.fromHandle(_obj_newObject("edit")); obj.edit82:setParent(obj.layout25); obj.edit82:setLeft(495); obj.edit82:setTop(0); obj.edit82:setWidth(50); obj.edit82:setHeight(25); obj.edit82:setField("Arma_peso_1"); obj.edit82:setName("edit82"); obj.edit83 = GUI.fromHandle(_obj_newObject("edit")); obj.edit83:setParent(obj.layout25); obj.edit83:setLeft(545); obj.edit83:setTop(0); obj.edit83:setWidth(50); obj.edit83:setHeight(25); obj.edit83:setField("Arma_velocidade_1"); obj.edit83:setName("edit83"); obj.layout26 = GUI.fromHandle(_obj_newObject("layout")); obj.layout26:setParent(obj.layout23); obj.layout26:setLeft(0); obj.layout26:setTop(80); obj.layout26:setWidth(600); obj.layout26:setHeight(25); obj.layout26:setName("layout26"); obj.edit84 = GUI.fromHandle(_obj_newObject("edit")); obj.edit84:setParent(obj.layout26); obj.edit84:setLeft(5); obj.edit84:setTop(0); obj.edit84:setWidth(190); obj.edit84:setHeight(25); obj.edit84:setField("Arma_2"); obj.edit84:setName("edit84"); obj.edit85 = GUI.fromHandle(_obj_newObject("edit")); obj.edit85:setParent(obj.layout26); obj.edit85:setLeft(195); obj.edit85:setTop(0); obj.edit85:setWidth(50); obj.edit85:setHeight(25); obj.edit85:setField("Arma_ataques_2"); obj.edit85:setName("edit85"); obj.edit86 = GUI.fromHandle(_obj_newObject("edit")); obj.edit86:setParent(obj.layout26); obj.edit86:setLeft(245); obj.edit86:setTop(0); obj.edit86:setWidth(50); obj.edit86:setHeight(25); obj.edit86:setField("Arma_alcance_2"); obj.edit86:setName("edit86"); obj.edit87 = GUI.fromHandle(_obj_newObject("edit")); obj.edit87:setParent(obj.layout26); obj.edit87:setLeft(295); obj.edit87:setTop(0); obj.edit87:setWidth(50); obj.edit87:setHeight(25); obj.edit87:setField("Arma_dano_pm_2"); obj.edit87:setName("edit87"); obj.edit88 = GUI.fromHandle(_obj_newObject("edit")); obj.edit88:setParent(obj.layout26); obj.edit88:setLeft(345); obj.edit88:setTop(0); obj.edit88:setWidth(50); obj.edit88:setHeight(25); obj.edit88:setField("Arma_dano_g_2"); obj.edit88:setName("edit88"); obj.edit89 = GUI.fromHandle(_obj_newObject("edit")); obj.edit89:setParent(obj.layout26); obj.edit89:setLeft(395); obj.edit89:setTop(0); obj.edit89:setWidth(50); obj.edit89:setHeight(25); obj.edit89:setField("Arma_ajuste_2"); obj.edit89:setName("edit89"); obj.edit90 = GUI.fromHandle(_obj_newObject("edit")); obj.edit90:setParent(obj.layout26); obj.edit90:setLeft(445); obj.edit90:setTop(0); obj.edit90:setWidth(50); obj.edit90:setHeight(25); obj.edit90:setField("Arma_tipo_2"); obj.edit90:setName("edit90"); obj.edit91 = GUI.fromHandle(_obj_newObject("edit")); obj.edit91:setParent(obj.layout26); obj.edit91:setLeft(495); obj.edit91:setTop(0); obj.edit91:setWidth(50); obj.edit91:setHeight(25); obj.edit91:setField("Arma_peso_2"); obj.edit91:setName("edit91"); obj.edit92 = GUI.fromHandle(_obj_newObject("edit")); obj.edit92:setParent(obj.layout26); obj.edit92:setLeft(545); obj.edit92:setTop(0); obj.edit92:setWidth(50); obj.edit92:setHeight(25); obj.edit92:setField("Arma_velocidade_2"); obj.edit92:setName("edit92"); obj.layout27 = GUI.fromHandle(_obj_newObject("layout")); obj.layout27:setParent(obj.layout23); obj.layout27:setLeft(0); obj.layout27:setTop(105); obj.layout27:setWidth(600); obj.layout27:setHeight(25); obj.layout27:setName("layout27"); obj.edit93 = GUI.fromHandle(_obj_newObject("edit")); obj.edit93:setParent(obj.layout27); obj.edit93:setLeft(5); obj.edit93:setTop(0); obj.edit93:setWidth(190); obj.edit93:setHeight(25); obj.edit93:setField("Arma_3"); obj.edit93:setName("edit93"); obj.edit94 = GUI.fromHandle(_obj_newObject("edit")); obj.edit94:setParent(obj.layout27); obj.edit94:setLeft(195); obj.edit94:setTop(0); obj.edit94:setWidth(50); obj.edit94:setHeight(25); obj.edit94:setField("Arma_ataques_3"); obj.edit94:setName("edit94"); obj.edit95 = GUI.fromHandle(_obj_newObject("edit")); obj.edit95:setParent(obj.layout27); obj.edit95:setLeft(245); obj.edit95:setTop(0); obj.edit95:setWidth(50); obj.edit95:setHeight(25); obj.edit95:setField("Arma_alcance_3"); obj.edit95:setName("edit95"); obj.edit96 = GUI.fromHandle(_obj_newObject("edit")); obj.edit96:setParent(obj.layout27); obj.edit96:setLeft(295); obj.edit96:setTop(0); obj.edit96:setWidth(50); obj.edit96:setHeight(25); obj.edit96:setField("Arma_dano_pm_3"); obj.edit96:setName("edit96"); obj.edit97 = GUI.fromHandle(_obj_newObject("edit")); obj.edit97:setParent(obj.layout27); obj.edit97:setLeft(345); obj.edit97:setTop(0); obj.edit97:setWidth(50); obj.edit97:setHeight(25); obj.edit97:setField("Arma_dano_g_3"); obj.edit97:setName("edit97"); obj.edit98 = GUI.fromHandle(_obj_newObject("edit")); obj.edit98:setParent(obj.layout27); obj.edit98:setLeft(395); obj.edit98:setTop(0); obj.edit98:setWidth(50); obj.edit98:setHeight(25); obj.edit98:setField("Arma_ajuste_3"); obj.edit98:setName("edit98"); obj.edit99 = GUI.fromHandle(_obj_newObject("edit")); obj.edit99:setParent(obj.layout27); obj.edit99:setLeft(445); obj.edit99:setTop(0); obj.edit99:setWidth(50); obj.edit99:setHeight(25); obj.edit99:setField("Arma_tipo_3"); obj.edit99:setName("edit99"); obj.edit100 = GUI.fromHandle(_obj_newObject("edit")); obj.edit100:setParent(obj.layout27); obj.edit100:setLeft(495); obj.edit100:setTop(0); obj.edit100:setWidth(50); obj.edit100:setHeight(25); obj.edit100:setField("Arma_peso_3"); obj.edit100:setName("edit100"); obj.edit101 = GUI.fromHandle(_obj_newObject("edit")); obj.edit101:setParent(obj.layout27); obj.edit101:setLeft(545); obj.edit101:setTop(0); obj.edit101:setWidth(50); obj.edit101:setHeight(25); obj.edit101:setField("Arma_velocidade_3"); obj.edit101:setName("edit101"); obj.layout28 = GUI.fromHandle(_obj_newObject("layout")); obj.layout28:setParent(obj.layout23); obj.layout28:setLeft(0); obj.layout28:setTop(130); obj.layout28:setWidth(600); obj.layout28:setHeight(25); obj.layout28:setName("layout28"); obj.edit102 = GUI.fromHandle(_obj_newObject("edit")); obj.edit102:setParent(obj.layout28); obj.edit102:setLeft(5); obj.edit102:setTop(0); obj.edit102:setWidth(190); obj.edit102:setHeight(25); obj.edit102:setField("Arma_4"); obj.edit102:setName("edit102"); obj.edit103 = GUI.fromHandle(_obj_newObject("edit")); obj.edit103:setParent(obj.layout28); obj.edit103:setLeft(195); obj.edit103:setTop(0); obj.edit103:setWidth(50); obj.edit103:setHeight(25); obj.edit103:setField("Arma_ataques_4"); obj.edit103:setName("edit103"); obj.edit104 = GUI.fromHandle(_obj_newObject("edit")); obj.edit104:setParent(obj.layout28); obj.edit104:setLeft(245); obj.edit104:setTop(0); obj.edit104:setWidth(50); obj.edit104:setHeight(25); obj.edit104:setField("Arma_alcance_4"); obj.edit104:setName("edit104"); obj.edit105 = GUI.fromHandle(_obj_newObject("edit")); obj.edit105:setParent(obj.layout28); obj.edit105:setLeft(295); obj.edit105:setTop(0); obj.edit105:setWidth(50); obj.edit105:setHeight(25); obj.edit105:setField("Arma_dano_pm_4"); obj.edit105:setName("edit105"); obj.edit106 = GUI.fromHandle(_obj_newObject("edit")); obj.edit106:setParent(obj.layout28); obj.edit106:setLeft(345); obj.edit106:setTop(0); obj.edit106:setWidth(50); obj.edit106:setHeight(25); obj.edit106:setField("Arma_dano_g_4"); obj.edit106:setName("edit106"); obj.edit107 = GUI.fromHandle(_obj_newObject("edit")); obj.edit107:setParent(obj.layout28); obj.edit107:setLeft(395); obj.edit107:setTop(0); obj.edit107:setWidth(50); obj.edit107:setHeight(25); obj.edit107:setField("Arma_ajuste_4"); obj.edit107:setName("edit107"); obj.edit108 = GUI.fromHandle(_obj_newObject("edit")); obj.edit108:setParent(obj.layout28); obj.edit108:setLeft(445); obj.edit108:setTop(0); obj.edit108:setWidth(50); obj.edit108:setHeight(25); obj.edit108:setField("Arma_tipo_4"); obj.edit108:setName("edit108"); obj.edit109 = GUI.fromHandle(_obj_newObject("edit")); obj.edit109:setParent(obj.layout28); obj.edit109:setLeft(495); obj.edit109:setTop(0); obj.edit109:setWidth(50); obj.edit109:setHeight(25); obj.edit109:setField("Arma_peso_4"); obj.edit109:setName("edit109"); obj.edit110 = GUI.fromHandle(_obj_newObject("edit")); obj.edit110:setParent(obj.layout28); obj.edit110:setLeft(545); obj.edit110:setTop(0); obj.edit110:setWidth(50); obj.edit110:setHeight(25); obj.edit110:setField("Arma_velocidade_4"); obj.edit110:setName("edit110"); obj.layout29 = GUI.fromHandle(_obj_newObject("layout")); obj.layout29:setParent(obj.layout23); obj.layout29:setLeft(0); obj.layout29:setTop(155); obj.layout29:setWidth(600); obj.layout29:setHeight(25); obj.layout29:setName("layout29"); obj.edit111 = GUI.fromHandle(_obj_newObject("edit")); obj.edit111:setParent(obj.layout29); obj.edit111:setLeft(5); obj.edit111:setTop(0); obj.edit111:setWidth(190); obj.edit111:setHeight(25); obj.edit111:setField("Arma_5"); obj.edit111:setName("edit111"); obj.edit112 = GUI.fromHandle(_obj_newObject("edit")); obj.edit112:setParent(obj.layout29); obj.edit112:setLeft(195); obj.edit112:setTop(0); obj.edit112:setWidth(50); obj.edit112:setHeight(25); obj.edit112:setField("Arma_ataques_5"); obj.edit112:setName("edit112"); obj.edit113 = GUI.fromHandle(_obj_newObject("edit")); obj.edit113:setParent(obj.layout29); obj.edit113:setLeft(245); obj.edit113:setTop(0); obj.edit113:setWidth(50); obj.edit113:setHeight(25); obj.edit113:setField("Arma_alcance_5"); obj.edit113:setName("edit113"); obj.edit114 = GUI.fromHandle(_obj_newObject("edit")); obj.edit114:setParent(obj.layout29); obj.edit114:setLeft(295); obj.edit114:setTop(0); obj.edit114:setWidth(50); obj.edit114:setHeight(25); obj.edit114:setField("Arma_dano_pm_5"); obj.edit114:setName("edit114"); obj.edit115 = GUI.fromHandle(_obj_newObject("edit")); obj.edit115:setParent(obj.layout29); obj.edit115:setLeft(345); obj.edit115:setTop(0); obj.edit115:setWidth(50); obj.edit115:setHeight(25); obj.edit115:setField("Arma_dano_g_5"); obj.edit115:setName("edit115"); obj.edit116 = GUI.fromHandle(_obj_newObject("edit")); obj.edit116:setParent(obj.layout29); obj.edit116:setLeft(395); obj.edit116:setTop(0); obj.edit116:setWidth(50); obj.edit116:setHeight(25); obj.edit116:setField("Arma_ajuste_5"); obj.edit116:setName("edit116"); obj.edit117 = GUI.fromHandle(_obj_newObject("edit")); obj.edit117:setParent(obj.layout29); obj.edit117:setLeft(445); obj.edit117:setTop(0); obj.edit117:setWidth(50); obj.edit117:setHeight(25); obj.edit117:setField("Arma_tipo_5"); obj.edit117:setName("edit117"); obj.edit118 = GUI.fromHandle(_obj_newObject("edit")); obj.edit118:setParent(obj.layout29); obj.edit118:setLeft(495); obj.edit118:setTop(0); obj.edit118:setWidth(50); obj.edit118:setHeight(25); obj.edit118:setField("Arma_peso_5"); obj.edit118:setName("edit118"); obj.edit119 = GUI.fromHandle(_obj_newObject("edit")); obj.edit119:setParent(obj.layout29); obj.edit119:setLeft(545); obj.edit119:setTop(0); obj.edit119:setWidth(50); obj.edit119:setHeight(25); obj.edit119:setField("Arma_velocidade_5"); obj.edit119:setName("edit119"); obj.layout30 = GUI.fromHandle(_obj_newObject("layout")); obj.layout30:setParent(obj.layout23); obj.layout30:setLeft(0); obj.layout30:setTop(180); obj.layout30:setWidth(600); obj.layout30:setHeight(25); obj.layout30:setName("layout30"); obj.edit120 = GUI.fromHandle(_obj_newObject("edit")); obj.edit120:setParent(obj.layout30); obj.edit120:setLeft(5); obj.edit120:setTop(0); obj.edit120:setWidth(190); obj.edit120:setHeight(25); obj.edit120:setField("Arma_6"); obj.edit120:setName("edit120"); obj.edit121 = GUI.fromHandle(_obj_newObject("edit")); obj.edit121:setParent(obj.layout30); obj.edit121:setLeft(195); obj.edit121:setTop(0); obj.edit121:setWidth(50); obj.edit121:setHeight(25); obj.edit121:setField("Arma_ataques_6"); obj.edit121:setName("edit121"); obj.edit122 = GUI.fromHandle(_obj_newObject("edit")); obj.edit122:setParent(obj.layout30); obj.edit122:setLeft(245); obj.edit122:setTop(0); obj.edit122:setWidth(50); obj.edit122:setHeight(25); obj.edit122:setField("Arma_alcance_6"); obj.edit122:setName("edit122"); obj.edit123 = GUI.fromHandle(_obj_newObject("edit")); obj.edit123:setParent(obj.layout30); obj.edit123:setLeft(295); obj.edit123:setTop(0); obj.edit123:setWidth(50); obj.edit123:setHeight(25); obj.edit123:setField("Arma_dano_pm_6"); obj.edit123:setName("edit123"); obj.edit124 = GUI.fromHandle(_obj_newObject("edit")); obj.edit124:setParent(obj.layout30); obj.edit124:setLeft(345); obj.edit124:setTop(0); obj.edit124:setWidth(50); obj.edit124:setHeight(25); obj.edit124:setField("Arma_dano_g_6"); obj.edit124:setName("edit124"); obj.edit125 = GUI.fromHandle(_obj_newObject("edit")); obj.edit125:setParent(obj.layout30); obj.edit125:setLeft(395); obj.edit125:setTop(0); obj.edit125:setWidth(50); obj.edit125:setHeight(25); obj.edit125:setField("Arma_ajuste_6"); obj.edit125:setName("edit125"); obj.edit126 = GUI.fromHandle(_obj_newObject("edit")); obj.edit126:setParent(obj.layout30); obj.edit126:setLeft(445); obj.edit126:setTop(0); obj.edit126:setWidth(50); obj.edit126:setHeight(25); obj.edit126:setField("Arma_tipo_6"); obj.edit126:setName("edit126"); obj.edit127 = GUI.fromHandle(_obj_newObject("edit")); obj.edit127:setParent(obj.layout30); obj.edit127:setLeft(495); obj.edit127:setTop(0); obj.edit127:setWidth(50); obj.edit127:setHeight(25); obj.edit127:setField("Arma_peso_6"); obj.edit127:setName("edit127"); obj.edit128 = GUI.fromHandle(_obj_newObject("edit")); obj.edit128:setParent(obj.layout30); obj.edit128:setLeft(545); obj.edit128:setTop(0); obj.edit128:setWidth(50); obj.edit128:setHeight(25); obj.edit128:setField("Arma_velocidade_6"); obj.edit128:setName("edit128"); obj.layout31 = GUI.fromHandle(_obj_newObject("layout")); obj.layout31:setParent(obj.layout23); obj.layout31:setLeft(0); obj.layout31:setTop(205); obj.layout31:setWidth(600); obj.layout31:setHeight(25); obj.layout31:setName("layout31"); obj.edit129 = GUI.fromHandle(_obj_newObject("edit")); obj.edit129:setParent(obj.layout31); obj.edit129:setLeft(5); obj.edit129:setTop(0); obj.edit129:setWidth(190); obj.edit129:setHeight(25); obj.edit129:setField("Arma_7"); obj.edit129:setName("edit129"); obj.edit130 = GUI.fromHandle(_obj_newObject("edit")); obj.edit130:setParent(obj.layout31); obj.edit130:setLeft(195); obj.edit130:setTop(0); obj.edit130:setWidth(50); obj.edit130:setHeight(25); obj.edit130:setField("Arma_ataques_7"); obj.edit130:setName("edit130"); obj.edit131 = GUI.fromHandle(_obj_newObject("edit")); obj.edit131:setParent(obj.layout31); obj.edit131:setLeft(245); obj.edit131:setTop(0); obj.edit131:setWidth(50); obj.edit131:setHeight(25); obj.edit131:setField("Arma_alcance_7"); obj.edit131:setName("edit131"); obj.edit132 = GUI.fromHandle(_obj_newObject("edit")); obj.edit132:setParent(obj.layout31); obj.edit132:setLeft(295); obj.edit132:setTop(0); obj.edit132:setWidth(50); obj.edit132:setHeight(25); obj.edit132:setField("Arma_dano_pm_7"); obj.edit132:setName("edit132"); obj.edit133 = GUI.fromHandle(_obj_newObject("edit")); obj.edit133:setParent(obj.layout31); obj.edit133:setLeft(345); obj.edit133:setTop(0); obj.edit133:setWidth(50); obj.edit133:setHeight(25); obj.edit133:setField("Arma_dano_g_7"); obj.edit133:setName("edit133"); obj.edit134 = GUI.fromHandle(_obj_newObject("edit")); obj.edit134:setParent(obj.layout31); obj.edit134:setLeft(395); obj.edit134:setTop(0); obj.edit134:setWidth(50); obj.edit134:setHeight(25); obj.edit134:setField("Arma_ajuste_7"); obj.edit134:setName("edit134"); obj.edit135 = GUI.fromHandle(_obj_newObject("edit")); obj.edit135:setParent(obj.layout31); obj.edit135:setLeft(445); obj.edit135:setTop(0); obj.edit135:setWidth(50); obj.edit135:setHeight(25); obj.edit135:setField("Arma_tipo_7"); obj.edit135:setName("edit135"); obj.edit136 = GUI.fromHandle(_obj_newObject("edit")); obj.edit136:setParent(obj.layout31); obj.edit136:setLeft(495); obj.edit136:setTop(0); obj.edit136:setWidth(50); obj.edit136:setHeight(25); obj.edit136:setField("Arma_peso_7"); obj.edit136:setName("edit136"); obj.edit137 = GUI.fromHandle(_obj_newObject("edit")); obj.edit137:setParent(obj.layout31); obj.edit137:setLeft(545); obj.edit137:setTop(0); obj.edit137:setWidth(50); obj.edit137:setHeight(25); obj.edit137:setField("Arma_velocidade_7"); obj.edit137:setName("edit137"); obj.layout32 = GUI.fromHandle(_obj_newObject("layout")); obj.layout32:setParent(obj.layout23); obj.layout32:setLeft(0); obj.layout32:setTop(230); obj.layout32:setWidth(600); obj.layout32:setHeight(25); obj.layout32:setName("layout32"); obj.edit138 = GUI.fromHandle(_obj_newObject("edit")); obj.edit138:setParent(obj.layout32); obj.edit138:setLeft(5); obj.edit138:setTop(0); obj.edit138:setWidth(190); obj.edit138:setHeight(25); obj.edit138:setField("Arma_8"); obj.edit138:setName("edit138"); obj.edit139 = GUI.fromHandle(_obj_newObject("edit")); obj.edit139:setParent(obj.layout32); obj.edit139:setLeft(195); obj.edit139:setTop(0); obj.edit139:setWidth(50); obj.edit139:setHeight(25); obj.edit139:setField("Arma_ataques_8"); obj.edit139:setName("edit139"); obj.edit140 = GUI.fromHandle(_obj_newObject("edit")); obj.edit140:setParent(obj.layout32); obj.edit140:setLeft(245); obj.edit140:setTop(0); obj.edit140:setWidth(50); obj.edit140:setHeight(25); obj.edit140:setField("Arma_alcance_8"); obj.edit140:setName("edit140"); obj.edit141 = GUI.fromHandle(_obj_newObject("edit")); obj.edit141:setParent(obj.layout32); obj.edit141:setLeft(295); obj.edit141:setTop(0); obj.edit141:setWidth(50); obj.edit141:setHeight(25); obj.edit141:setField("Arma_dano_pm_8"); obj.edit141:setName("edit141"); obj.edit142 = GUI.fromHandle(_obj_newObject("edit")); obj.edit142:setParent(obj.layout32); obj.edit142:setLeft(345); obj.edit142:setTop(0); obj.edit142:setWidth(50); obj.edit142:setHeight(25); obj.edit142:setField("Arma_dano_g_8"); obj.edit142:setName("edit142"); obj.edit143 = GUI.fromHandle(_obj_newObject("edit")); obj.edit143:setParent(obj.layout32); obj.edit143:setLeft(395); obj.edit143:setTop(0); obj.edit143:setWidth(50); obj.edit143:setHeight(25); obj.edit143:setField("Arma_ajuste_8"); obj.edit143:setName("edit143"); obj.edit144 = GUI.fromHandle(_obj_newObject("edit")); obj.edit144:setParent(obj.layout32); obj.edit144:setLeft(445); obj.edit144:setTop(0); obj.edit144:setWidth(50); obj.edit144:setHeight(25); obj.edit144:setField("Arma_tipo_8"); obj.edit144:setName("edit144"); obj.edit145 = GUI.fromHandle(_obj_newObject("edit")); obj.edit145:setParent(obj.layout32); obj.edit145:setLeft(495); obj.edit145:setTop(0); obj.edit145:setWidth(50); obj.edit145:setHeight(25); obj.edit145:setField("Arma_peso_8"); obj.edit145:setName("edit145"); obj.edit146 = GUI.fromHandle(_obj_newObject("edit")); obj.edit146:setParent(obj.layout32); obj.edit146:setLeft(545); obj.edit146:setTop(0); obj.edit146:setWidth(50); obj.edit146:setHeight(25); obj.edit146:setField("Arma_velocidade_8"); obj.edit146:setName("edit146"); obj.layout33 = GUI.fromHandle(_obj_newObject("layout")); obj.layout33:setParent(obj.layout23); obj.layout33:setLeft(0); obj.layout33:setTop(255); obj.layout33:setWidth(600); obj.layout33:setHeight(25); obj.layout33:setName("layout33"); obj.edit147 = GUI.fromHandle(_obj_newObject("edit")); obj.edit147:setParent(obj.layout33); obj.edit147:setLeft(5); obj.edit147:setTop(0); obj.edit147:setWidth(190); obj.edit147:setHeight(25); obj.edit147:setField("Arma_9"); obj.edit147:setName("edit147"); obj.edit148 = GUI.fromHandle(_obj_newObject("edit")); obj.edit148:setParent(obj.layout33); obj.edit148:setLeft(195); obj.edit148:setTop(0); obj.edit148:setWidth(50); obj.edit148:setHeight(25); obj.edit148:setField("Arma_ataques_9"); obj.edit148:setName("edit148"); obj.edit149 = GUI.fromHandle(_obj_newObject("edit")); obj.edit149:setParent(obj.layout33); obj.edit149:setLeft(245); obj.edit149:setTop(0); obj.edit149:setWidth(50); obj.edit149:setHeight(25); obj.edit149:setField("Arma_alcance_9"); obj.edit149:setName("edit149"); obj.edit150 = GUI.fromHandle(_obj_newObject("edit")); obj.edit150:setParent(obj.layout33); obj.edit150:setLeft(295); obj.edit150:setTop(0); obj.edit150:setWidth(50); obj.edit150:setHeight(25); obj.edit150:setField("Arma_dano_pm_9"); obj.edit150:setName("edit150"); obj.edit151 = GUI.fromHandle(_obj_newObject("edit")); obj.edit151:setParent(obj.layout33); obj.edit151:setLeft(345); obj.edit151:setTop(0); obj.edit151:setWidth(50); obj.edit151:setHeight(25); obj.edit151:setField("Arma_dano_g_9"); obj.edit151:setName("edit151"); obj.edit152 = GUI.fromHandle(_obj_newObject("edit")); obj.edit152:setParent(obj.layout33); obj.edit152:setLeft(395); obj.edit152:setTop(0); obj.edit152:setWidth(50); obj.edit152:setHeight(25); obj.edit152:setField("Arma_ajuste_9"); obj.edit152:setName("edit152"); obj.edit153 = GUI.fromHandle(_obj_newObject("edit")); obj.edit153:setParent(obj.layout33); obj.edit153:setLeft(445); obj.edit153:setTop(0); obj.edit153:setWidth(50); obj.edit153:setHeight(25); obj.edit153:setField("Arma_tipo_9"); obj.edit153:setName("edit153"); obj.edit154 = GUI.fromHandle(_obj_newObject("edit")); obj.edit154:setParent(obj.layout33); obj.edit154:setLeft(495); obj.edit154:setTop(0); obj.edit154:setWidth(50); obj.edit154:setHeight(25); obj.edit154:setField("Arma_peso_9"); obj.edit154:setName("edit154"); obj.edit155 = GUI.fromHandle(_obj_newObject("edit")); obj.edit155:setParent(obj.layout33); obj.edit155:setLeft(545); obj.edit155:setTop(0); obj.edit155:setWidth(50); obj.edit155:setHeight(25); obj.edit155:setField("Arma_velocidade_9"); obj.edit155:setName("edit155"); obj.image3 = GUI.fromHandle(_obj_newObject("image")); obj.image3:setParent(obj.scrollBox1); obj.image3:setAlign("client"); obj.image3:setSRC("https://dl.dropboxusercontent.com/u/31086811/Plugins/Ficha%20ADnD%20releases/imagens/block.png"); obj.image3:setStyle("autoFit"); obj.image3:setName("image3"); obj._e_event0 = obj.edit69:addEventListener("onChange", function (_) sumCA(); end, obj); obj._e_event1 = obj.edit70:addEventListener("onChange", function (_) sumCA(); end, obj); obj._e_event2 = obj.edit71:addEventListener("onChange", function (_) sumCA(); end, obj); obj._e_event3 = obj.edit72:addEventListener("onChange", function (_) sumCA(); end, obj); function obj:_releaseEvents() __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.edit150 ~= nil then self.edit150:destroy(); self.edit150 = nil; end; if self.label14 ~= nil then self.label14:destroy(); self.label14 = nil; end; if self.edit73 ~= nil then self.edit73:destroy(); self.edit73 = nil; end; if self.edit64 ~= nil then self.edit64:destroy(); self.edit64 = nil; end; if self.edit98 ~= nil then self.edit98:destroy(); self.edit98 = nil; end; if self.layout15 ~= nil then self.layout15:destroy(); self.layout15 = nil; end; if self.edit41 ~= nil then self.edit41:destroy(); self.edit41 = nil; end; if self.layout10 ~= nil then self.layout10:destroy(); self.layout10 = nil; end; if self.edit36 ~= nil then self.edit36:destroy(); self.edit36 = 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.edit33 ~= nil then self.edit33:destroy(); self.edit33 = nil; end; if self.label43 ~= nil then self.label43:destroy(); self.label43 = nil; end; if self.edit29 ~= nil then self.edit29:destroy(); self.edit29 = nil; end; if self.label77 ~= nil then self.label77:destroy(); self.label77 = nil; end; if self.edit111 ~= nil then self.edit111:destroy(); self.edit111 = nil; end; if self.edit28 ~= nil then self.edit28:destroy(); self.edit28 = nil; end; if self.layout17 ~= nil then self.layout17:destroy(); self.layout17 = nil; end; if self.label45 ~= nil then self.label45:destroy(); self.label45 = nil; end; if self.label57 ~= nil then self.label57:destroy(); self.label57 = nil; end; if self.edit71 ~= nil then self.edit71:destroy(); self.edit71 = nil; end; if self.label71 ~= nil then self.label71:destroy(); self.label71 = nil; end; if self.edit85 ~= nil then self.edit85:destroy(); self.edit85 = nil; end; if self.label75 ~= nil then self.label75:destroy(); self.label75 = nil; end; if self.label63 ~= nil then self.label63:destroy(); self.label63 = nil; end; if self.label22 ~= nil then self.label22:destroy(); self.label22 = nil; end; if self.label70 ~= nil then self.label70:destroy(); self.label70 = nil; end; if self.layout24 ~= nil then self.layout24:destroy(); self.layout24 = nil; end; if self.edit76 ~= nil then self.edit76:destroy(); self.edit76 = nil; end; if self.layout13 ~= nil then self.layout13:destroy(); self.layout13 = nil; end; if self.label35 ~= nil then self.label35:destroy(); self.label35 = 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.edit153 ~= nil then self.edit153:destroy(); self.edit153 = nil; end; if self.label27 ~= nil then self.label27:destroy(); self.label27 = nil; end; if self.label59 ~= nil then self.label59:destroy(); self.label59 = nil; end; if self.label68 ~= nil then self.label68:destroy(); self.label68 = nil; end; if self.layout23 ~= nil then self.layout23:destroy(); self.layout23 = nil; end; if self.edit47 ~= nil then self.edit47:destroy(); self.edit47 = nil; end; if self.edit82 ~= nil then self.edit82:destroy(); self.edit82 = nil; end; if self.edit131 ~= nil then self.edit131:destroy(); self.edit131 = nil; end; if self.label67 ~= nil then self.label67:destroy(); self.label67 = nil; end; if self.rectangle5 ~= nil then self.rectangle5:destroy(); self.rectangle5 = nil; end; if self.edit149 ~= nil then self.edit149:destroy(); self.edit149 = nil; end; if self.edit120 ~= nil then self.edit120:destroy(); self.edit120 = nil; end; if self.label8 ~= nil then self.label8:destroy(); self.label8 = nil; end; if self.edit26 ~= nil then self.edit26:destroy(); self.edit26 = nil; end; if self.label69 ~= nil then self.label69:destroy(); self.label69 = nil; end; if self.edit34 ~= nil then self.edit34:destroy(); self.edit34 = 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.edit19 ~= nil then self.edit19:destroy(); self.edit19 = nil; end; if self.label31 ~= nil then self.label31:destroy(); self.label31 = nil; end; if self.image1 ~= nil then self.image1:destroy(); self.image1 = nil; end; if self.edit112 ~= nil then self.edit112:destroy(); self.edit112 = nil; end; if self.label34 ~= nil then self.label34:destroy(); self.label34 = nil; end; if self.edit5 ~= nil then self.edit5:destroy(); self.edit5 = nil; end; if self.edit114 ~= nil then self.edit114:destroy(); self.edit114 = nil; end; if self.label15 ~= nil then self.label15:destroy(); self.label15 = nil; end; if self.label41 ~= nil then self.label41:destroy(); self.label41 = nil; end; if self.label49 ~= nil then self.label49:destroy(); self.label49 = nil; end; if self.layout32 ~= nil then self.layout32:destroy(); self.layout32 = nil; end; if self.label72 ~= nil then self.label72:destroy(); self.label72 = nil; end; if self.label12 ~= nil then self.label12:destroy(); self.label12 = nil; end; if self.label82 ~= nil then self.label82:destroy(); self.label82 = nil; end; if self.edit68 ~= nil then self.edit68:destroy(); self.edit68 = nil; end; if self.edit72 ~= nil then self.edit72:destroy(); self.edit72 = nil; end; if self.edit69 ~= nil then self.edit69:destroy(); self.edit69 = nil; end; if self.label16 ~= nil then self.label16:destroy(); self.label16 = nil; end; if self.label52 ~= nil then self.label52:destroy(); self.label52 = 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.edit31 ~= nil then self.edit31:destroy(); self.edit31 = nil; end; if self.label47 ~= nil then self.label47:destroy(); self.label47 = nil; end; if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end; if self.label48 ~= nil then self.label48:destroy(); self.label48 = nil; end; if self.edit106 ~= nil then self.edit106:destroy(); self.edit106 = nil; end; if self.edit79 ~= nil then self.edit79:destroy(); self.edit79 = nil; end; if self.label76 ~= nil then self.label76:destroy(); self.label76 = nil; end; if self.edit115 ~= nil then self.edit115:destroy(); self.edit115 = nil; end; if self.edit77 ~= nil then self.edit77:destroy(); self.edit77 = nil; end; if self.edit52 ~= nil then self.edit52:destroy(); self.edit52 = nil; end; if self.label78 ~= nil then self.label78:destroy(); self.label78 = nil; end; if self.edit116 ~= nil then self.edit116:destroy(); self.edit116 = nil; end; if self.edit125 ~= nil then self.edit125:destroy(); self.edit125 = 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.edit101 ~= nil then self.edit101:destroy(); self.edit101 = nil; end; if self.edit58 ~= nil then self.edit58:destroy(); self.edit58 = nil; end; if self.image3 ~= nil then self.image3:destroy(); self.image3 = nil; end; if self.label58 ~= nil then self.label58:destroy(); self.label58 = nil; end; if self.edit66 ~= nil then self.edit66:destroy(); self.edit66 = 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.layout18 ~= nil then self.layout18:destroy(); self.layout18 = nil; end; if self.edit129 ~= nil then self.edit129:destroy(); self.edit129 = nil; end; if self.label56 ~= nil then self.label56:destroy(); self.label56 = nil; end; if self.label29 ~= nil then self.label29:destroy(); self.label29 = nil; end; if self.edit142 ~= nil then self.edit142:destroy(); self.edit142 = nil; end; if self.rectangle2 ~= nil then self.rectangle2:destroy(); self.rectangle2 = nil; end; if self.rectangle6 ~= nil then self.rectangle6:destroy(); self.rectangle6 = nil; end; if self.edit139 ~= nil then self.edit139:destroy(); self.edit139 = nil; end; if self.label21 ~= nil then self.label21:destroy(); self.label21 = nil; end; if self.edit122 ~= nil then self.edit122:destroy(); self.edit122 = nil; end; if self.edit40 ~= nil then self.edit40:destroy(); self.edit40 = nil; end; if self.label30 ~= nil then self.label30:destroy(); self.label30 = nil; end; if self.edit110 ~= nil then self.edit110:destroy(); self.edit110 = nil; end; if self.label51 ~= nil then self.label51:destroy(); self.label51 = nil; end; if self.edit99 ~= nil then self.edit99:destroy(); self.edit99 = nil; end; if self.label19 ~= nil then self.label19:destroy(); self.label19 = nil; end; if self.edit86 ~= nil then self.edit86:destroy(); self.edit86 = nil; end; if self.edit38 ~= nil then self.edit38:destroy(); self.edit38 = nil; end; if self.edit123 ~= nil then self.edit123:destroy(); self.edit123 = nil; end; if self.edit67 ~= nil then self.edit67:destroy(); self.edit67 = nil; end; if self.edit143 ~= nil then self.edit143:destroy(); self.edit143 = nil; end; if self.label54 ~= nil then self.label54:destroy(); self.label54 = nil; end; if self.edit105 ~= nil then self.edit105:destroy(); self.edit105 = nil; end; if self.layout11 ~= nil then self.layout11:destroy(); self.layout11 = nil; end; if self.edit137 ~= nil then self.edit137:destroy(); self.edit137 = nil; end; if self.edit146 ~= nil then self.edit146:destroy(); self.edit146 = nil; end; if self.edit6 ~= nil then self.edit6:destroy(); self.edit6 = nil; end; if self.edit124 ~= nil then self.edit124:destroy(); self.edit124 = nil; end; if self.edit90 ~= nil then self.edit90:destroy(); self.edit90 = 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.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end; if self.layout33 ~= nil then self.layout33:destroy(); self.layout33 = nil; end; if self.label38 ~= nil then self.label38:destroy(); self.label38 = nil; end; if self.edit49 ~= nil then self.edit49:destroy(); self.edit49 = nil; end; if self.label62 ~= nil then self.label62:destroy(); self.label62 = nil; end; if self.edit83 ~= nil then self.edit83:destroy(); self.edit83 = nil; end; if self.edit27 ~= nil then self.edit27:destroy(); self.edit27 = nil; end; if self.layout14 ~= nil then self.layout14:destroy(); self.layout14 = 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.edit140 ~= nil then self.edit140:destroy(); self.edit140 = nil; end; if self.edit62 ~= nil then self.edit62:destroy(); self.edit62 = 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.edit74 ~= nil then self.edit74:destroy(); self.edit74 = nil; end; if self.scrollBox1 ~= nil then self.scrollBox1:destroy(); self.scrollBox1 = nil; end; if self.layout7 ~= nil then self.layout7:destroy(); self.layout7 = nil; end; if self.edit60 ~= nil then self.edit60:destroy(); self.edit60 = nil; end; if self.edit94 ~= nil then self.edit94:destroy(); self.edit94 = nil; end; if self.edit134 ~= nil then self.edit134:destroy(); self.edit134 = nil; end; if self.label33 ~= nil then self.label33:destroy(); self.label33 = nil; end; if self.label44 ~= nil then self.label44:destroy(); self.label44 = nil; end; if self.edit46 ~= nil then self.edit46:destroy(); self.edit46 = nil; end; if self.label83 ~= nil then self.label83:destroy(); self.label83 = nil; end; if self.edit121 ~= nil then self.edit121:destroy(); self.edit121 = nil; end; if self.edit104 ~= nil then self.edit104:destroy(); self.edit104 = nil; end; if self.layout30 ~= nil then self.layout30:destroy(); self.layout30 = nil; end; if self.edit7 ~= nil then self.edit7:destroy(); self.edit7 = nil; end; if self.edit108 ~= nil then self.edit108:destroy(); self.edit108 = nil; end; if self.label55 ~= nil then self.label55:destroy(); self.label55 = nil; end; if self.edit12 ~= nil then self.edit12:destroy(); self.edit12 = nil; end; if self.label66 ~= nil then self.label66:destroy(); self.label66 = nil; end; if self.label73 ~= nil then self.label73:destroy(); self.label73 = nil; end; if self.edit80 ~= nil then self.edit80:destroy(); self.edit80 = nil; end; if self.edit35 ~= nil then self.edit35:destroy(); self.edit35 = nil; end; if self.edit95 ~= nil then self.edit95:destroy(); self.edit95 = nil; end; if self.label26 ~= nil then self.label26:destroy(); self.label26 = nil; end; if self.edit92 ~= nil then self.edit92:destroy(); self.edit92 = nil; end; if self.edit97 ~= nil then self.edit97:destroy(); self.edit97 = nil; end; if self.label23 ~= nil then self.label23:destroy(); self.label23 = nil; end; if self.label32 ~= nil then self.label32:destroy(); self.label32 = nil; end; if self.edit57 ~= nil then self.edit57:destroy(); self.edit57 = nil; end; if self.image2 ~= nil then self.image2:destroy(); self.image2 = nil; end; if self.edit147 ~= nil then self.edit147:destroy(); self.edit147 = nil; end; if self.label24 ~= nil then self.label24:destroy(); self.label24 = nil; end; if self.layout3 ~= nil then self.layout3:destroy(); self.layout3 = nil; end; if self.edit54 ~= nil then self.edit54:destroy(); self.edit54 = nil; end; if self.label61 ~= nil then self.label61:destroy(); self.label61 = nil; end; if self.label65 ~= nil then self.label65:destroy(); self.label65 = nil; end; if self.edit63 ~= nil then self.edit63:destroy(); self.edit63 = nil; end; if self.layout1 ~= nil then self.layout1:destroy(); self.layout1 = nil; end; if self.edit61 ~= nil then self.edit61:destroy(); self.edit61 = nil; end; if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end; if self.edit50 ~= nil then self.edit50:destroy(); self.edit50 = nil; end; if self.edit84 ~= nil then self.edit84:destroy(); self.edit84 = nil; end; if self.label60 ~= nil then self.label60:destroy(); self.label60 = nil; end; if self.label64 ~= nil then self.label64:destroy(); self.label64 = nil; end; if self.edit24 ~= nil then self.edit24:destroy(); self.edit24 = nil; end; if self.edit100 ~= nil then self.edit100:destroy(); self.edit100 = nil; end; if self.edit59 ~= nil then self.edit59:destroy(); self.edit59 = 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.edit88 ~= nil then self.edit88:destroy(); self.edit88 = nil; end; if self.edit4 ~= nil then self.edit4:destroy(); self.edit4 = nil; end; if self.edit44 ~= nil then self.edit44:destroy(); self.edit44 = nil; end; if self.layout25 ~= nil then self.layout25:destroy(); self.layout25 = nil; end; if self.edit89 ~= nil then self.edit89:destroy(); self.edit89 = 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.edit128 ~= nil then self.edit128:destroy(); self.edit128 = nil; end; if self.edit103 ~= nil then self.edit103:destroy(); self.edit103 = nil; end; if self.label74 ~= nil then self.label74:destroy(); self.label74 = nil; end; if self.label37 ~= nil then self.label37:destroy(); self.label37 = nil; end; if self.edit127 ~= nil then self.edit127:destroy(); self.edit127 = nil; end; if self.edit148 ~= nil then self.edit148:destroy(); self.edit148 = nil; end; if self.layout26 ~= nil then self.layout26:destroy(); self.layout26 = nil; end; if self.edit45 ~= nil then self.edit45:destroy(); self.edit45 = 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.edit53 ~= nil then self.edit53:destroy(); self.edit53 = nil; end; if self.edit145 ~= nil then self.edit145:destroy(); self.edit145 = nil; end; if self.layout28 ~= nil then self.layout28:destroy(); self.layout28 = nil; end; if self.label86 ~= nil then self.label86:destroy(); self.label86 = 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.label9 ~= nil then self.label9:destroy(); self.label9 = nil; end; if self.label28 ~= nil then self.label28:destroy(); self.label28 = nil; end; if self.label53 ~= nil then self.label53:destroy(); self.label53 = nil; end; if self.rectangle8 ~= nil then self.rectangle8:destroy(); self.rectangle8 = nil; end; if self.edit96 ~= nil then self.edit96:destroy(); self.edit96 = nil; end; if self.edit107 ~= nil then self.edit107:destroy(); self.edit107 = nil; end; if self.edit109 ~= nil then self.edit109:destroy(); self.edit109 = nil; end; if self.edit30 ~= nil then self.edit30:destroy(); self.edit30 = nil; end; if self.edit21 ~= nil then self.edit21:destroy(); self.edit21 = nil; end; if self.edit56 ~= nil then self.edit56:destroy(); self.edit56 = nil; end; if self.label80 ~= nil then self.label80:destroy(); self.label80 = nil; end; if self.label42 ~= nil then self.label42:destroy(); self.label42 = nil; end; if self.edit141 ~= nil then self.edit141:destroy(); self.edit141 = nil; end; if self.edit55 ~= nil then self.edit55:destroy(); self.edit55 = nil; end; if self.edit43 ~= nil then self.edit43:destroy(); self.edit43 = nil; end; if self.edit152 ~= nil then self.edit152:destroy(); self.edit152 = nil; end; if self.edit133 ~= nil then self.edit133:destroy(); self.edit133 = nil; end; if self.label17 ~= nil then self.label17:destroy(); self.label17 = nil; end; if self.edit75 ~= nil then self.edit75:destroy(); self.edit75 = nil; end; if self.edit65 ~= nil then self.edit65:destroy(); self.edit65 = nil; end; if self.edit93 ~= nil then self.edit93:destroy(); self.edit93 = nil; end; if self.edit126 ~= nil then self.edit126:destroy(); self.edit126 = nil; end; if self.edit13 ~= nil then self.edit13:destroy(); self.edit13 = nil; end; if self.edit39 ~= nil then self.edit39:destroy(); self.edit39 = nil; end; if self.edit130 ~= nil then self.edit130:destroy(); self.edit130 = nil; end; if self.edit81 ~= nil then self.edit81:destroy(); self.edit81 = nil; end; if self.edit144 ~= nil then self.edit144:destroy(); self.edit144 = nil; end; if self.label81 ~= nil then self.label81:destroy(); self.label81 = nil; end; if self.label36 ~= nil then self.label36:destroy(); self.label36 = nil; end; if self.rectangle3 ~= nil then self.rectangle3:destroy(); self.rectangle3 = nil; end; if self.edit37 ~= nil then self.edit37:destroy(); self.edit37 = nil; end; if self.edit151 ~= nil then self.edit151:destroy(); self.edit151 = nil; end; if self.edit132 ~= nil then self.edit132:destroy(); self.edit132 = 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.edit17 ~= nil then self.edit17:destroy(); self.edit17 = nil; end; if self.edit51 ~= nil then self.edit51:destroy(); self.edit51 = nil; end; if self.layout2 ~= nil then self.layout2:destroy(); self.layout2 = nil; end; if self.edit119 ~= nil then self.edit119:destroy(); self.edit119 = nil; end; if self.edit48 ~= nil then self.edit48:destroy(); self.edit48 = nil; end; if self.label85 ~= nil then self.label85:destroy(); self.label85 = nil; end; if self.label46 ~= nil then self.label46:destroy(); self.label46 = nil; end; if self.edit155 ~= nil then self.edit155:destroy(); self.edit155 = nil; end; if self.edit87 ~= nil then self.edit87:destroy(); self.edit87 = nil; end; if self.label39 ~= nil then self.label39:destroy(); self.label39 = nil; end; if self.layout29 ~= nil then self.layout29:destroy(); self.layout29 = nil; end; if self.label79 ~= nil then self.label79:destroy(); self.label79 = nil; end; if self.edit113 ~= nil then self.edit113:destroy(); self.edit113 = nil; end; if self.label11 ~= nil then self.label11:destroy(); self.label11 = nil; end; if self.edit15 ~= nil then self.edit15:destroy(); self.edit15 = 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.edit78 ~= nil then self.edit78:destroy(); self.edit78 = nil; end; if self.label87 ~= nil then self.label87:destroy(); self.label87 = nil; end; if self.edit138 ~= nil then self.edit138:destroy(); self.edit138 = nil; end; if self.edit91 ~= nil then self.edit91:destroy(); self.edit91 = 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.label50 ~= nil then self.label50:destroy(); self.label50 = nil; end; if self.edit70 ~= nil then self.edit70:destroy(); self.edit70 = nil; end; if self.edit42 ~= nil then self.edit42:destroy(); self.edit42 = nil; end; if self.edit22 ~= nil then self.edit22:destroy(); self.edit22 = nil; end; if self.edit118 ~= nil then self.edit118:destroy(); self.edit118 = nil; end; if self.edit154 ~= nil then self.edit154:destroy(); self.edit154 = 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.rectangle4 ~= nil then self.rectangle4:destroy(); self.rectangle4 = nil; end; if self.layout22 ~= nil then self.layout22:destroy(); self.layout22 = nil; end; if self.edit135 ~= nil then self.edit135:destroy(); self.edit135 = nil; end; if self.label84 ~= nil then self.label84:destroy(); self.label84 = nil; end; if self.edit32 ~= nil then self.edit32:destroy(); self.edit32 = nil; end; if self.edit136 ~= nil then self.edit136:destroy(); self.edit136 = nil; end; if self.edit102 ~= nil then self.edit102:destroy(); self.edit102 = nil; end; if self.edit117 ~= nil then self.edit117:destroy(); self.edit117 = nil; end; if self.edit20 ~= nil then self.edit20:destroy(); self.edit20 = nil; end; self:_oldLFMDestroy(); end; obj:endUpdate(); return obj; end; function newfrmADnD1() local retObj = nil; __o_rrpgObjs.beginObjectsLoading(); __o_Utils.tryFinally( function() retObj = constructNew_frmADnD1(); end, function() __o_rrpgObjs.endObjectsLoading(); end); assert(retObj ~= nil); return retObj; end; local _frmADnD1 = { newEditor = newfrmADnD1, new = newfrmADnD1, name = "frmADnD1", dataType = "", formType = "undefined", formComponentName = "form", title = "", description=""}; frmADnD1 = _frmADnD1; Firecast.registrarForm(_frmADnD1); return _frmADnD1;
vim.cmd([[set runtimepath=$VIMRUNTIME]]) vim.cmd([[set packpath=/tmp/nvim/site]]) local package_root = '/tmp/nvim/site/pack' local install_path = package_root .. '/packer/start/packer.nvim' -- IMPORTANT: update the sumneko setup if you need lua language server -- I installed it in '/github/sumneko/lua-language-server' local sumneko_root_path = vim.fn.expand('$HOME') .. '/github/sumneko/lua-language-server' local sumneko_binary = vim.fn.expand('$HOME') .. '/github/sumneko/lua-language-server/bin/macOS/lua-language-server' local lua_cfg = { -- cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' }, settings = { Lua = { runtime = { version = 'LuaJIT', path = vim.split(package.path, ';') }, diagnostics = { enable = true }, }, }, } if vim.fn.executable('lua-language-server') == 0 then lua_cfg.cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' } end local function load_plugins() require('packer').startup({ function(use) use({ 'wbthomason/packer.nvim' }) use({ 'nvim-treesitter/nvim-treesitter', config = function() require('nvim-treesitter.configs').setup({ ensure_installed = { 'python', 'go', 'javascript' }, highlight = { enable = true }, }) end, run = ':TSUpdate', }) use({ 'neovim/nvim-lspconfig' }) use({ 'ray-x/lsp_signature.nvim' }) use({ 'ray-x/aurora' }) use({ 'ray-x/navigator.lua', -- '~/github/navigator.lua', requires = { 'ray-x/guihua.lua', run = 'cd lua/fzy && make' }, config = function() require('navigator').setup({ lsp_signature_help = true, }) end, }) use({ 'L3MON4D3/LuaSnip' }) use({ 'hrsh7th/nvim-cmp', requires = { 'hrsh7th/cmp-nvim-lsp', 'saadparwaiz1/cmp_luasnip', }, config = function() local cmp = require('cmp') local luasnip = require('luasnip') cmp.setup({ snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) end, }, mapping = { ['<CR>'] = cmp.mapping.confirm({ select = true }), ['<Tab>'] = cmp.mapping(function(fallback) if cmp.visible() then cmp.confirm({ select = true }) elseif luasnip.expand_or_locally_jumpable() then luasnip.expand_or_jump() else fallback() end end, { 'i', 's' }), }, sources = { { name = 'nvim_lsp' }, { name = 'buffer' }, }, }) require('cmp').setup.cmdline(':', { sources = { { name = 'cmdline' }, }, }) require('cmp').setup.cmdline('/', { sources = { { name = 'buffer' }, }, }) end, }) end, config = { package_root = package_root, compile_path = install_path .. '/plugin/packer_compiled.lua', }, }) end if vim.fn.isdirectory(install_path) == 0 then vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path, }) load_plugins() require('packer').sync() vim.cmd('colorscheme aurora') else load_plugins() vim.cmd('colorscheme aurora') end
--[[ (C) Copyright 2014 William Dyce All rights reserved. This program and the accompanying materials are made available under the terms of the GNU Lesser General Public License (LGPL) version 2.1 which accompanies this distribution, and is available at http://www.gnu.org/licenses/lgpl-2.1.html This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. --]] local camera = Camera(0, 0, 1, 0) local GAME_TIME = 180 local END_TRANSITION_DURATION = 2; local END_TEXT_DURATION = 3; local TEXT_LENGTH = 2*WORLD_W local TIMER_X = WORLD_W/2 - TEXT_LENGTH/2 - 25 local TIMER_Y = 0.05*WORLD_H local ENDTEXT_X = WORLD_W/2 - TEXT_LENGTH/2 local ENDTEXT_Y = 0.25*WORLD_H local GRAB_HIT_POINTS_TEAR = 1/8000 local GRAB_HIT_POINTS_REFILL = 10 local state = gamestate.new() local lightImage = love.graphics.newImage( "assets/foreground/light.PNG" ) local cursorDownImage = love.graphics.newImage( "assets/foreground/cursor_down.png" ) local cursorUpImage = love.graphics.newImage( "assets/foreground/cursor_up.png" ) local END_DEBUG = false if END_DEBUG then GAME_TIME = 5 END_TRANSITION_DURATION = 0.5; END_TEXT_DURATION = 0.5; end --[[------------------------------------------------------------ Workspace, local to this file --]]-- --[[------------------------------------------------------------ Gamestate navigation --]]-- function state:init() self.characterDeck = useful.deck() for _, character in pairs(characters) do self.characterDeck.stack(character) end self.propDeck = useful.deck() for _, prop in pairs(props) do self.propDeck.stack(prop) end end function state:enter() audio.swap_music() self.timer = GAME_TIME self.cursorImage = cursorUpImage love.mouse.setVisible(false) camera:lookAt(WORLD_W/2, WORLD_H/2) camera:zoomTo(1) -- create the world self.world = love.physics.newWorld(0, 500) love.physics.setMeter(100) -- 100 pixels per meter -- floor local floor = {} floor.body = love.physics.newBody( self.world, WORLD_W/2, WORLD_H + 16) floor.shape = love.physics.newRectangleShape(WORLD_W, 64) floor.fixture = love.physics.newFixture(floor.body, floor.shape) floor.fixture:setCategory(COLLIDE_WALLS) floor.body:setUserData("floor") -- roof local roof = {} roof.body = love.physics.newBody( self.world, -WORLD_W/2, -16) roof.shape = love.physics.newRectangleShape(WORLD_W*3, 64) roof.fixture = love.physics.newFixture(roof.body, roof.shape) roof.fixture:setCategory(COLLIDE_WALLS) roof.body:setUserData("roof") -- far left wall local leftWall = {} leftWall.body = love.physics.newBody( self.world, -WORLD_W*2, WORLD_H*2) leftWall.shape = love.physics.newRectangleShape(64, WORLD_H*4) leftWall.fixture = love.physics.newFixture(leftWall.body, leftWall.shape) leftWall.fixture:setCategory(COLLIDE_WALLS) leftWall.body:setUserData("leftWall") -- far left bottom wall local leftBottomWall = {} leftBottomWall.body = love.physics.newBody( self.world, -WORLD_W, WORLD_H*4) leftBottomWall.shape = love.physics.newRectangleShape(WORLD_W*2, 64) leftBottomWall.fixture = love.physics.newFixture(leftBottomWall.body, leftBottomWall.shape) leftBottomWall.fixture:setCategory(COLLIDE_WALLS) leftBottomWall.body:setUserData("leftBottomWall") -- middle wall local middleWallBottom = {} middleWallBottom.body = love.physics.newBody( self.world, 0, WORLD_H - 40) middleWallBottom.shape = love.physics.newRectangleShape(120, 80) middleWallBottom.fixture = love.physics.newFixture(middleWallBottom.body, middleWallBottom.shape) middleWallBottom.fixture:setCategory(COLLIDE_WALLS) middleWallBottom.body:setUserData("middleWallBottom") -- far bottom middle wall local middleWallFarBottom = {} middleWallFarBottom.body = love.physics.newBody( self.world, 0, 5*WORLD_H/2) middleWallFarBottom.shape = love.physics.newRectangleShape(120, 3*WORLD_H) middleWallFarBottom.fixture = love.physics.newFixture(middleWallFarBottom.body, middleWallFarBottom.shape) middleWallFarBottom.fixture:setCategory(COLLIDE_WALLS) middleWallFarBottom.body:setUserData("middleWallFarBottom") local middleWallTop = {} middleWallTop.body = love.physics.newBody( self.world, 0, 60/2) middleWallTop.shape = love.physics.newRectangleShape(120, 60) middleWallTop.fixture = love.physics.newFixture(middleWallTop.body, middleWallTop.shape) middleWallTop.fixture:setCategory(COLLIDE_WALLS) middleWallTop.body:setUserData("middleWallTop") -- right wall local rightWallTop = {} rightWallTop.body = love.physics.newBody( self.world, WORLD_W, 111/2) rightWallTop.shape = love.physics.newRectangleShape(32, 111) rightWallTop.fixture = love.physics.newFixture(rightWallTop.body, rightWallTop.shape) rightWallTop.fixture:setCategory(COLLIDE_WALLS) rightWallTop.body:setUserData("rightWallTop") local rightWallBottom = {} rightWallBottom.body = love.physics.newBody( self.world, WORLD_W, WORLD_H - 320/2) rightWallBottom.shape = love.physics.newRectangleShape(32, 320) rightWallBottom.fixture = love.physics.newFixture(rightWallBottom.body, rightWallBottom.shape) rightWallBottom.fixture:setCategory(COLLIDE_WALLS) rightWallBottom.body:setUserData("rightWallBottom") -- create a door self.door = Door(WORLD_W*0.7) --create lockers self.lockers = {} self.locker_origin_x = 288 self.locker_origin_y = 309 self.locker_width = 162 self.locker_height = 182 table.insert(self.lockers, Locker(self.locker_origin_x, self.locker_origin_y, self.locker_width, self.locker_height, self.propDeck.draw())) table.insert(self.lockers, Locker(self.locker_origin_x, self.locker_origin_y + self.locker_height, self.locker_width, self.locker_height, self.propDeck.draw())) table.insert(self.lockers, Locker(self.locker_origin_x + self.locker_width, self.locker_origin_y + self.locker_height, self.locker_width, self.locker_height, self.propDeck.draw())) -- create animation views self.bgFin = AnimationView(bgFinAnim, 7, 0) -- reset state variables self.epilogue = nil self.windowBroken = false self.catAtWindow = 1 end function state:leave() audio.swap_music() love.mouse.setVisible(true) if self.mouseJoint then self.mouseJoint:destroy() end self.mouseJoint = nil GameObject.purgeAll() self.world:destroy() end --[[------------------------------------------------------------ Love callbacks --]]-- function state:keypressed(key, uni) if key == "escape" then gamestate.switch(title) elseif key == "return" then self.epilogue = 0 -- elseif key == "p" then -- Prop(WORLD_W/2, WORLD_H/2, "pizza") end end function state:mousepressed(x, y) self.grabHitpoints = 1 if x < 0 or x > WORLD_W or y < 0 or y > WORLD_H then return end self.cursorImage = cursorDownImage -- drag around bodies local grabbedBody, best = nil, -math.huge self.world:queryBoundingBox(x, y, x, y, function(fixture) local body = fixture:getBody() local userdata = body:getUserData() if userdata then if userdata.dude then local val = Dude.pickingPriority[userdata.part] if val > best then grabbedBody = body best = val end elseif userdata.prop then grabbedBody = body best = math.huge end end return true end) if grabbedBody then local userdata = grabbedBody:getUserData() local dude = userdata.dude if dude then self.grabDude = userdata.dude self.grabPart = userdata.part self.grabHitpoints = 1 -- un-puppet if dude.puppeteer and dude.canBeGrabbed then dude.puppeteer.joint:destroy() dude.puppeteer.body:destroy() dude.puppeteer = nil end else if userdata.prop and userdata.prop.dude then userdata.prop.dude:dropProp() end self.grabDude = nil self.grabPart = nil end -- remove previous grab if self.mouseJoint then self.mouseJoint:destroy() end self.mouseJoint = love.physics.newMouseJoint(grabbedBody, x, y) self.mouseJoint:setDampingRatio(0.1) else -- open doors GameObject.mapToType("Door", function(obj) obj:onclick() end, function(obj) return obj:isCollidingPoint(x, y) end) GameObject.mapToType("Locker", function(obj) obj:onclick() end, function(obj) return obj:isCollidingPoint(x, y) end) end end function state:mousereleased() self.grabHitpoints = 1 self.cursorImage = cursorUpImage if self.mouseJoint then self.mouseJoint:destroy() end self.mouseJoint = nil end function state:setEnding() ending = nil -- build a table with points count for every ending local endingPoints = {} for i,endi in ipairs(endings) do endingPoints[endi.name] = 0 end local dudeCount = 0 local nb_bites_a_l_air = 0 local nb_pieds_nus = 0 local nb_torses_poil = 0 GameObject.mapToType("Dude", function(dude) dudeCount = dudeCount+1 -- retrieve character points for field_name,field in pairs(dude.character) do for ending_name, ending_points in pairs(endingPoints) do if ending_name == field_name then log:write(ending_name..tostring(field)) endingPoints[ending_name] = ending_points + field end end end -- retrieve clothes points local dude_clothes = dude:getVisibleClothes() for cloth_value,cloth_name in pairs(dude_clothes) do for cloth_field_name, cloth_field in pairs(cloth_value) do for ending_name, ending_points in pairs(endingPoints) do if ending_name == cloth_field_name then log:write(cloth_name..cloth_field_name..tostring(cloth_field)) endingPoints[ending_name] = ending_points + cloth_field end end end end local naked_parts = dude:getNakedParts() if naked_parts["torso"] then nb_torses_poil = nb_torses_poil + 1 end if naked_parts["groin"] then nb_bites_a_l_air = nb_bites_a_l_air + 1 end if naked_parts["rightFoot"] and naked_parts["leftFoot"] then nb_pieds_nus = nb_pieds_nus + 1 end end) --retrieve props points self.world:queryBoundingBox(-WORLD_W*2, WORLD_H*2, 0, WORLD_H*4, function(fixture) local body = fixture:getBody() local userdata = body:getUserData() if userdata then if userdata.prop and userdata.prop.prototype then if userdata.prop.prototype.endings then for end_name,end_point in pairs(userdata.prop.prototype.endings) do if endingPoints[end_name] then endingPoints[end_name] = endingPoints[end_name] + end_point end end end end end return true end) -- if one or less dudes, all alone ending if dudeCount <= 1 then endingPoints["alone"] = endingPoints["alone"] + 10000; end -- check hippie ending (all bare feet) if dudeCount == nb_pieds_nus then endingPoints["hippie"] = 70 end -- check orgy ending if dudeCount >=2 then endingPoints["orgy"] = endingPoints["orgy"] + (nb_bites_a_l_air *2 + nb_torses_poil) * 50 / dudeCount end -- find the correct ending local maxScore = 49 for i, endi in ipairs(endings) do log:write(endi.name.." ".. endingPoints[endi.name]) if (maxScore < endingPoints[endi.name] and endi.trigger <= endingPoints[endi.name]) then ending = endi maxScore = endingPoints[endi.name] end end -- if no ending, last ending (normal ending) if ending == nil then ending = endings[#endings] end end function state:update(dt) local mx, my = love.mouse.getPosition() -- animate self.bgFin:update(dt) -- un-cloth if self.mouseJoint and self.grabDude then local p = self.grabDude.body_parts[self.grabPart] local dx, dy = p.body:getLinearVelocity() local vx, vy = p.body:getPosition() vx, vy = mx - vx, my - vy local d = Vector.det(dx, dy, vx, vy) if d < 0 then self.grabHitpoints = math.max(0, self.grabHitpoints + d*dt*GRAB_HIT_POINTS_TEAR) if self.grabHitpoints == 0 then -- lose what you're carrying self.grabDude:dropProp() local cloth = self.grabDude:tearClothingOffPart(self.grabPart) if cloth then self.mouseJoint:destroy() self.mouseJoint = love.physics.newMouseJoint(cloth.bodies[1], mx, my) self.mouseJoint:setDampingRatio(0.1) self.grabPart = nil self.grabDude = nil self.grabHitpoints = 0 end else self.grabHitpoints = math.min(1, self.grabHitpoints + GRAB_HIT_POINTS_REFILL*dt) end end end -- cat returns self.catAtWindow = math.min(1, self.catAtWindow + 0.05*dt) -- update physics self.world:update(dt) if self.epilogue then if self.epilogue < 1 then -- epilogue local new_ep = math.min(1, self.epilogue + dt) local del_ep = new_ep - self.epilogue self.epilogue = new_ep camera:move(-3*WORLD_W/2*del_ep, 5*WORLD_H/2*del_ep) camera:zoomTo(1-0.5*new_ep) else self.epilogue = self.epilogue + dt end else -- control physics if self.mouseJoint then self.mouseJoint:setTarget(love.mouse.getPosition()) end end -- update logic GameObject.updateAll(dt) -- check if dudes have left the screen local onscreen = {} GameObject.mapToType("Dude", function(dude) onscreen[dude] = false end) self.world:queryBoundingBox(0, 0, WORLD_W, WORLD_H, function(fixture) local userdata = fixture:getBody():getUserData() if userdata then if userdata.dude then onscreen[userdata.dude] = true end end local bx, by = fixture:getBody():getPosition() if bx > WORLD_W then if not self.windowBroken then audio:play_sound("Fenetre", 0.2) self.windowBroken = true end if self.catAtWindow >= 1 then audio:play_sound("Cat", 0.2) self.catAtWindow = 0 end end return true end) local count = 0 for dude, isonscreen in pairs(onscreen) do if isonscreen then count = count + 1 else if dude.x > WORLD_W/2 then dude.purge = true audio:play_sound(dude.character.rejected_sound, 0.2) if self.mouseJoint and (self.grabDude == dude) then self.mouseJoint:destroy() self.mouseJoint = nil end else if not dude.accepted then dude.accepted = true audio:play_sound(dude.character.accepted_sound, 0.2) end end end end if count == 0 and not self.door:anyQueued() and self.door:isClosed() then self.door:enqueue(function(x, y) Dude(x, y, self.characterDeck.draw(), self.propDeck.draw()) end) end -- update timer self.timer = self.timer - dt; if (self.timer < 0) then self.timer = 0 if (not self.epilogue and count == 0) then self.epilogue = 0 end end -- check end if self.epilogue and self.epilogue >= (1 + END_TRANSITION_DURATION + END_TEXT_DURATION) then self:setEnding() gamestate.switch(gameover) end end function state:draw() local mx, my = love.mouse.getPosition() -- background love.graphics.setColor(0, 0, 0) love.graphics.rectangle("fill", 0, 0, WORLD_W, WORLD_H) useful.bindWhite() camera:attach() -- objects foregroundb:addb("bg", 0, 0, 0, 1, 1) if not self.windowBroken then foregroundb:addb("window_Clean", 565, 605) elseif self.catAtWindow >= 1 then foregroundb:addb("window_BrokenCat", 565, 605) else foregroundb:addb("window_Broken", 565, 605) end self.bgFin:draw(self, -2*WORLD_W, 2*WORLD_H) GameObject.drawAll(self.view) love.graphics.draw(foregroundb) love.graphics.draw(lightImage, 0, 0) foregroundb.batch:clear() GameObject.mapToType("Cloth", function(obj) obj:draw_cloth() end) -- debug if DEBUG then debugWorldDraw(self.world, 0, 0, WORLD_W, WORLD_H) useful.bindWhite() end camera:detach() --ui if not self.epilogue then if self.timer > 0 then local timerInt = math.floor(self.timer) local minutes = math.floor(timerInt/60) local seconds = timerInt - minutes * 60 love.graphics.setFont(FONT_MEDIUM) local format = string.format("%02d:%02d", minutes, seconds) love.graphics.printf(format, TIMER_X, TIMER_Y, TEXT_LENGTH, "center") end love.graphics.draw(self.cursorImage, mx, my) elseif self.epilogue > (1 + END_TRANSITION_DURATION) then love.graphics.setFont(FONT_BIG) love.graphics.printf("What do we do now ?", ENDTEXT_X, ENDTEXT_Y, TEXT_LENGTH, "center") end end --[[------------------------------------------------------------ EXPORT --]]------------------------------------------------------------ return state
 --A reference to all of the dialogue triggers in the level --The property should be the parent object of all of the triggers local dialogueTriggers = script:GetCustomProperty("Triggers"):WaitForObject():GetChildren() --Table for storing the event listeners of each trigger local interactionListeners = {} function OnInteracted(trigger) --TODO: Make it an option to turn this back on at the end --Turn off interaction with the trigger so we don't have to stare at the interaction prompt trigger.isInteractable = false --Grab the dialogue key then play the dialogue for all players local dialogueKey = trigger:GetCustomProperty("DialogueKey") Events.BroadcastToAllPlayers("PlayDialogue", dialogueKey) --TODO: Make this optional --We only want to play the dialogue once, so unhook the event at the end if interactionListeners[dialogueKey] ~= nil then interactionListeners[dialogueKey]:Disconnect() end end function SetFlagForPlayer(player, setFlag) --Set the flag on the specified player according to the provided settings if setFlag.addValue then player:AddResource(setFlag.flag, setFlag.value) else print(Game.GetLocalPlayer()) player:SetResource(setFlag.flag, setFlag.value) end end function Init() --Loop through each dialogue trigger and hook up their interaction events for i = 1, #dialogueTriggers do local dialogueKey = dialogueTriggers[i]:GetCustomProperty("DialogueKey") interactionListeners[dialogueKey] = dialogueTriggers[i].interactedEvent:Connect(OnInteracted) end Events.Connect("SetFlag", SetFlagForPlayer) end Init()
-- Globally defined because these will be used literally everywhere class = require 'lib.hump.class' gs = require 'lib.hump.gamestate' vector = require 'lib.hump.vector' inspect = require 'lib.inspect.inspect' bump = require 'lib.bump.bump' function math.sign(x) if x < 0 then return -1 end return 1 end function load_folder(folder) folder_items = {} for i, file_name in ipairs(love.filesystem.getDirectoryItems(folder)) do file_path = folder .. '/' .. file_name local ok, file, room ok, file = pcall(love.filesystem.load, file_path) if not ok then error('Problem occurred loading entity file: ' .. file_path .. '\n' .. file) end ok, file_code = pcall(file) if not ok then error('Entity file failed to compile: ' .. file_path .. '\n' .. entity_class) end folder_items[file_name] = file_code end return folder_items end function load_tileset(tileset) -- load the tileset image local image = love.graphics.newImage('dungeon_rooms/' .. tileset.image) local numtilerows = math.floor(tileset.imagewidth / tileset.tilewidth) local numtilecols = math.floor(tileset.imageheight / tileset.tileheight) local ts = {} for row=0,numtilerows-1 do for col=0,numtilecols-1 do local x = row * tileset.tilewidth local y = col * tileset.tileheight local tile = {} tile.quad = love.graphics.newQuad( x, y, tileset.tilewidth, tileset.tileheight, tileset.imagewidth, tileset.imageheight ) tile.image = image tile.width = tileset.tilewidth tile.height = tileset.tileheight tile.local_id = col * numtilecols + row tile.global_id = tile.local_id + tileset.firstgid tile.tileset_name = tileset.name ts[tile.local_id] = tile end end for i, property in ipairs(tileset.tiles) do ts[property.id].properties = property.properties end local tiles = {} for i, tile in pairs(ts) do tiles[tile.global_id] = tile end return tiles end function load_tilelayer(layer, global_tileset, map) local tilelayer = {} for i, global_tile_id in ipairs(layer.data) do -- tile coords shifted 1 to be similar to Lua's starting index of 1 on -- table arrays local tile_x = (i - 1) % layer.width local tile_y = math.floor((i - 1) / layer.width) local x = (i - 1) % layer.width * map.tilewidth local y = math.floor((i - 1) / layer.width) * map.tileheight local tile if global_tile_id > 0 then tile = global_tileset[global_tile_id] if not tile then local err_str err_str = 'WARNING: Global id "%s" in layer "%s" does not match any global ids in all tilesets loaded.' error(string.format(err_str, global_tile_id, layer.name)) end end table.insert(tilelayer, { x=x, y=y, tile_x = tile_x, tile_y = tile_y, tile_width = map.tilewidth, tile_height = map.tileheight, has_tile = tile ~= nil, tile = tile, global_tile_id = global_tile_id, layer_name = layer.name }) end return tilelayer end function load_map(map_file_path) local ok, file ok, map_file = pcall(love.filesystem.load, map_file_path) if not ok then local err_str err_str ='Problem occurred loading map_file_path: %s\n%s' error(string.format(err_str, map_file_path, map_file)) end ok, map = pcall(map_file) if not ok then local err_str err_str = 'Template failed to compile: %s\n%s' error(string.format(err_str, map_file, map)) end --load tilesets in local tilesets = {} for i, ts in ipairs(map.tilesets) do tilesets[ts.name] = load_tileset(ts) end -- build global tileset array local global_tileset = {} for tileset_name, tileset in pairs(tilesets) do for tile_global_id, tile in pairs(tileset) do if global_tileset[tile_global_id] then local err_str, err_str1, err_str2, err_str3 err_str = "Attempted to overwrite tile with another tile in global tileset\n" err_str = err_str + 'Old tile: %s\n' error(string.format(err_str, inspect(global_tileset[tile_global_id]), inspect(tile))) end global_tileset[tile_global_id] = tile end end -- load tile layers in local tilelayers = {} for i, layer in ipairs(map.layers) do if layer.type == 'tilelayer' then tilelayers[layer.name] = load_tilelayer(layer, global_tileset, map) end end return { tilelayers = tilelayers, tilesets = tilesets, global_tileset = global_tileset, width = map.width, tile_width = map.tilewidth, height = map.height, tile_height = map.tileheight } end function get_tile_by_property(map, property, value) for global_id, tile in pairs(global_tileset) do if tile.properties and tile.properties.property and tile.properties.property == value then return tile end end end DungeonRoomState = require 'states.dungeon_room' DungeonLevelState = require 'states.dungeon_level_map' GameStartState = require 'states.game_start' GameWinState = require 'states.game_win' GameLoseState = require 'states.game_lose' function love.load() gs.registerEvents() gs.switch(GameStartState, 'game_start.lua' ) end --DungeonLevelState, 'dungeon_rooms/level1.lua'
local fn = vim.fn local M = {} local p = { single = "'(.-)'", double = '"(.-)"', } ---Take a users command arguments in the format "cmd='git commit' dir=~/dotfiles" ---and parse this into a table of arguments ---{cmd = "git commit", dir = "~/dotfiles"} ---@see https://stackoverflow.com/a/27007701 ---@param args string ---@return table<string, string|number> function M.parse(args) local result = {} if args then local quotes = args:match(p.single) and p.single or args:match(p.double) and p.double or nil if quotes then -- 1. extract the quoted command local pattern = "(%S+)=" .. quotes for key, value in args:gmatch(pattern) do -- Check if the current OS is Windows so we can determine if +shellslash -- exists and if it exists, then determine if it is enabled. In that way, -- we can determine if we should match the value with single or double quotes. quotes = jit.os ~= "Windows" and p.single or vim.g.shellslash == "yes" and quotes or p.single value = fn.shellescape(value) result[vim.trim(key)] = fn.expandcmd(value:match(quotes)) end -- 2. then remove it from the rest of the argument string args = args:gsub(pattern, "") end for _, part in ipairs(vim.split(args, " ")) do if #part > 1 then local arg = vim.split(part, "=") local key, value = arg[1], arg[2] if key == "size" then value = tonumber(value) elseif key == "go_back" or key == "open" then value = value ~= "0" end result[key] = value end end end return result end return M
--[[ TheNexusAvenger Creates buffer and non-buffer slingshot ammo. --]] local SlingshotBallCreator = {} local Tool = script.Parent local Handle = Tool:WaitForChild("Handle") local SlingshotBallScript = script:WaitForChild("SlingshotBallScript") local PlayerDamagerScript = Tool:WaitForChild("PlayerDamager") local ConfigurationScript = Tool:WaitForChild("Configuration") --[[ Creates a slingshot ball. --]] function SlingshotBallCreator:CreateSlingshotBall(IsBuffer) --Create the base part. local SlingshotBall = Instance.new("Part") SlingshotBall.Name = "SlingshotBall" SlingshotBall.BottomSurface = "Smooth" SlingshotBall.TopSurface = "Smooth" SlingshotBall.Shape = "Ball" SlingshotBall.Size = Vector3.new(1,1,1) local SlingshotBallMesh = Instance.new("SpecialMesh") SlingshotBallMesh.MeshId = "http://www.roblox.com/asset/?id=94689434" SlingshotBallMesh.TextureId = "http://www.roblox.com/asset/?id=94689543" SlingshotBallMesh.Scale = Vector3.new(1.5,1.5,1.5) SlingshotBallMesh.Name = "SlingshotBallMesh" SlingshotBallMesh.Parent = SlingshotBall if IsBuffer then --If it is a buffer version, add the scripts. local NewSlingshotBallScript = SlingshotBallScript:Clone() NewSlingshotBallScript.Disabled = false NewSlingshotBallScript.Parent = SlingshotBall PlayerDamagerScript:Clone().Parent = NewSlingshotBallScript ConfigurationScript:Clone().Parent = NewSlingshotBallScript else --If it isn't a buffer version, make it uncollidable. SlingshotBall.CanCollide = false end return SlingshotBall end return SlingshotBallCreator
data:extend({ { type = "item", name = "train-tracker", icon = "__Vehicle_Radar__/graphics/radar2_icon.png", icon_size = 32, subgroup = "transport", order = "a[train-system]-x[train-tracker]", place_result = "train-tracker", stack_size = 5 }, { type = "item", name = "vehicular-tracker", icon = "__Vehicle_Radar__/graphics/radar1_icon.png", icon_size = 32, subgroup = "transport", order = "b[vehicles]-x[vehicular-tracker]", place_result = "vehicular-tracker", stack_size = 5 }, })
--[[ This file was extracted by 'EsoLuaGenerator' at '2021-09-04 16:42:25' using the latest game version. NOTE: This file should only be used as IDE support; it should NOT be distributed with addons! **************************************************************************** CONTENTS OF THIS FILE IS COPYRIGHT ZENIMAX MEDIA INC. **************************************************************************** ]] ZO_GAMEPAD_PLAYER_INVENTORY_FOOTER_SCREEN_EDGE_OFFSET_X = -100 ZO_GAMEPAD_PLAYER_INVENTORY_FOOTER_SCREEN_EDGE_OFFSET_Y = -61 ZO_Gamepad_PlayerInventoryFooterFragment = ZO_FadeSceneFragment:Subclass() function ZO_Gamepad_PlayerInventoryFooterFragment:New(...) return ZO_FadeSceneFragment.New(self, ...) end function ZO_Gamepad_PlayerInventoryFooterFragment:Initialize(...) ZO_AnimatedSceneFragment.Initialize(self, ...) self.capacityAmountLabel = self.control:GetNamedChild("InventoryCapacityAmount") local function CapacityUpdate() self:CapacityUpdate() end self.control:RegisterForEvent(EVENT_MONEY_UPDATE, CapacityUpdate) self.control:RegisterForEvent(EVENT_ALLIANCE_POINT_UPDATE, CapacityUpdate) self.control:RegisterForEvent(EVENT_CROWN_UPDATE, CapacityUpdate) self.control:RegisterForEvent(EVENT_INVENTORY_FULL_UPDATE, CapacityUpdate) self.control:RegisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, CapacityUpdate) end function ZO_Gamepad_PlayerInventoryFooterFragment:CapacityUpdate(forceUpdate) if not self.control:IsHidden() or forceUpdate then self.capacityAmountLabel:SetText(zo_strformat(SI_GAMEPAD_INVENTORY_CAPACITY_FORMAT, GetNumBagUsedSlots(BAG_BACKPACK), GetBagSize(BAG_BACKPACK))) end end do local FORCE_CAPACITY_UPDATE = true function ZO_Gamepad_PlayerInventoryFooterFragment:Show() self:CapacityUpdate(FORCE_CAPACITY_UPDATE) ZO_AnimatedSceneFragment.Show(self) end end
local M = {} M.config = function() local status_ok, gp = pcall(require, "nvim-gps") if not status_ok then vim.notify "nvim-gps not found" return end gp.setup { disable_icons = false, -- Setting it to true will disable all icons icons = { ["class-name"] = " ", -- Classes and class-like objects ["function-name"] = " ", -- Functions ["method-name"] = " ", -- Methods (functions inside class-like objects) -- ["container-name"] = "⛶ ", -- Containers (example: lua tables) ["tag-name"] = "炙", -- Tags (example: html tags) }, -- Add custom configuration per language or -- Disable the plugin for a language -- Any language not disabled here is enabled by default languages = { -- Some languages have custom icons ["json"] = { icons = { ["array-name"] = " ", ["object-name"] = " ", ["null-name"] = "[] ", ["boolean-name"] = "ﰰ ", ["number-name"] = "# ", ["string-name"] = " ", }, }, ["latex"] = { icons = { ["title-name"] = "#", ["label-name"] = "", }, }, ["norg"] = { icons = { ["title-name"] = "", }, }, ["toml"] = { icons = { ["table-name"] = " ", ["array-name"] = " ", ["boolean-name"] = "ﰰﰴ ", ["date-name"] = " ", ["date-time-name"] = " ", ["float-name"] = " ", ["inline-table-name"] = " ", ["integer-name"] = "# ", ["string-name"] = " ", ["time-name"] = " ", }, }, ["verilog"] = { icons = { ["module-name"] = " ", }, }, ["yaml"] = { icons = { ["mapping-name"] = " ", ["sequence-name"] = " ", ["null-name"] = "[] ", ["boolean-name"] = "ﰰﰴ ", ["integer-name"] = "# ", ["float-name"] = " ", ["string-name"] = " ", }, }, ["yang"] = { icons = { ["module-name"] = "", ["augment-path"] = "", ["container-name"] = "", ["grouping-name"] = "", ["typedef-name"] = "", ["identity-name"] = "", ["list-name"] = "﬘", ["leaf-list-name"] = "", ["leaf-name"] = "", ["action-name"] = "", }, }, }, separator = " > ", depth = 0, -- indicator used when context hits depth limit depth_limit_indicator = "..", } end return M
beremaConvoTemplate = ConvoTemplate:new { initialScreen = "", templateType = "Lua", luaClassHandler = "theme_park_nym_conv_handler", screens = {} } ---------- --Only if player is on nym quest ---------- nym_sent_you = ConvoScreen:new { id = "nym_sent_you", leftDialog = "@celebrity/lok_gambler:nym_sent_you", -- I've been expecting you. Nym was supposed to send someone to meet me days ago. But, before I give you any information, let's play a game. stopConversation = "false", options = { {"@celebrity/lok_gambler:tell_me_something", "games_first"}, -- What can you tell me right now? {"@celebrity/lok_gambler:talk_nym", "nym_rules"}, -- Tell me about Nym. {"@celebrity/lok_gambler:what_game", "explain_game"}, -- Tell me about the game. } } beremaConvoTemplate:addScreen(nym_sent_you); games_first = ConvoScreen:new { id = "games_first", leftDialog = "@celebrity/lok_gambler:games_first", -- I won't say anything until we've played some cards. You ready? stopConversation = "false", options = { {"@celebrity/lok_gambler:what_game", "explain_game"}, -- Tell me about the game. } } beremaConvoTemplate:addScreen(games_first); nym_rules = ConvoScreen:new { id = "nym_rules", leftDialog = "@celebrity/lok_gambler:nym_rules", -- I like Nym. He's helped me out of a few scrapes over the years. He even bought up all my markers in the galaxy. Now, I'm in his pocket, but it's better than being dead. stopConversation = "false", options = { {"@celebrity/lok_gambler:what_game", "explain_game"}, -- Tell me about the game. } } beremaConvoTemplate:addScreen(nym_rules); begin_game_five_wins = ConvoScreen:new { id = "begin_game_five_wins", leftDialog = "@celebrity/lok_gambler:begin_game_five_wins", -- Well, you're pretty good. I'll play another hand if you want, or you can ask me some questions... stopConversation = "false", options = { {"@celebrity/lok_gambler:tell_me_more", "lab_info"}, -- Tell me about the Imperial Lab. {"@celebrity/lok_gambler:play_again", "bet_how_much"} -- Let's play again. } } beremaConvoTemplate:addScreen(begin_game_five_wins); lab_info = ConvoScreen:new { id = "lab_info", leftDialog = "@celebrity/lok_gambler:lab_info", -- The lab, eh? Yeah, I know about it. It's pretty well-guarded. Rather than rely on General Otto and his goons, the Imperials in charge of the lab hired mercenaries to protect it. They're all blood thirsty and will shoot on sight. The scientists shouldn't give you too much trouble, but there might be other dangers... stopConversation = "false", options = { {"@celebrity/lok_gambler:other_dangers", "other_dangers_info"}, -- What other dangers? {"@celebrity/lok_gambler:hard_drive_where", "hard_drive_loc"}, -- Where's the memory module? {"@celebrity/lok_gambler:imggcu_where", "imggcu_loc"}, -- Where are the IMGGCUs? {"@celebrity/lok_gambler:leaving", "good_luck"} -- I'll be going now. } } beremaConvoTemplate:addScreen(lab_info); other_dangers_info = ConvoScreen:new { id = "other_dangers_info", leftDialog = "@celebrity/lok_gambler:other_dangers_info", -- Well, I hear they're doing some other, illegal experiments in that base. Creating monsters that will rip your arms off and beat you to death with them. Or so the rumors go. stopConversation = "false", options = { {"@celebrity/lok_gambler:hard_drive_where", "hard_drive_loc"}, -- Where's the memory module? {"@celebrity/lok_gambler:imggcu_where", "imggcu_loc"}, -- Where are the IMGGCUs? {"@celebrity/lok_gambler:leaving", "good_luck"} -- I'll be going now. } } beremaConvoTemplate:addScreen(other_dangers_info); hard_drive_loc = ConvoScreen:new { id = "hard_drive_loc", leftDialog = "@celebrity/lok_gambler:hard_drive_loc", -- Well, once you get inside, you'll find four corridors leading from the central room. The computer room is to the west, I think. Somewhere in there you'll find your memory module. stopConversation = "false", options = { {"@celebrity/lok_gambler:other_dangers", "other_dangers_info"}, -- What other dangers? {"@celebrity/lok_gambler:imggcu_where", "imggcu_loc"}, -- Where are the IMGGCUs? {"@celebrity/lok_gambler:leaving", "good_luck"} -- I'll be going now. } } beremaConvoTemplate:addScreen(hard_drive_loc); imggcu_loc = ConvoScreen:new { id = "imggcu_loc", leftDialog = "@celebrity/lok_gambler:imggcu_loc", -- Heh, you know about those, eh? Unfortunately, I don't know where they store 'em. But, if the Imperials are getting ready to ship the IMGGCUs off of Lok, the explosives are probably stored in a locker or crate, awaiting transport. You'll have to look around a bit, I'm sure. stopConversation = "false", options = { {"@celebrity/lok_gambler:other_dangers", "other_dangers_info"}, -- What other dangers? {"@celebrity/lok_gambler:hard_drive_where", "hard_drive_loc"}, -- Where's the memory module? {"@celebrity/lok_gambler:leaving", "good_luck"} -- I'll be going now. } } beremaConvoTemplate:addScreen(imggcu_loc); ---------- -- Base gambling game convo ---------- explain_game = ConvoScreen:new { id = "explain_game", leftDialog = "@celebrity/lok_gambler:explain_game", -- We'll play Desert Draw. The game is simple. Just six cards. I pick one of mine and hold it behind my back, then you pick one of yours and then we compare them to see who wins. Simple, eh? stopConversation = "false", options = { {"@celebrity/lok_gambler:game_rules", "explain_rules"}, -- How do we know who wins? {"@celebrity/lok_gambler:sure_lets_play", "bet_how_much"} -- Ok, I'm game. Let's do it. } } beremaConvoTemplate:addScreen(explain_game); explain_rules = ConvoScreen:new { id = "explain_rules", leftDialog = "@celebrity/lok_gambler:explain_rules", -- We each have three cards. A Bounty Hunter, the Sarlacc, and a Thermal Detonator. I pick one, you pick one, then we compare. Bounty Hunter beats a Thermal Detonator. Thermal Detonator beats a Sarlacc, and Sarlacc beats the Bounty Hunter. It's really just that simple. Wanna try a hand? stopConversation = "false", options = { {"@celebrity/lok_gambler:sure_lets_play", "bet_how_much"} -- Ok, I'm game. Let's do it. } } beremaConvoTemplate:addScreen(explain_rules); begin_game = ConvoScreen:new { id = "begin_game", leftDialog = "@celebrity/lok_gambler:begin_game", -- Ok, I've picked my card. Which one are you going to go with? stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(begin_game); begin_game_5 = ConvoScreen:new { id = "begin_game_5", leftDialog = "@celebrity/lok_gambler:begin_game", -- Ok, I've picked my card. Which one are you going to go with? stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(begin_game_5); begin_game_10 = ConvoScreen:new { id = "begin_game_10", leftDialog = "@celebrity/lok_gambler:begin_game", -- Ok, I've picked my card. Which one are you going to go with? stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(begin_game_10); begin_game_50 = ConvoScreen:new { id = "begin_game_50", leftDialog = "@celebrity/lok_gambler:begin_game", -- Ok, I've picked my card. Which one are you going to go with? stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(begin_game_50); game_description = ConvoScreen:new { id = "game_description", leftDialog = "@celebrity/lok_gambler:game_description", -- It's called Desert Draw. It's really simple. We each have three cards, we both pick a card and show them at the same time. The winner gets the credits. stopConversation = "false", options = { {"@celebrity/lok_gambler:sure_lets_play", "bet_how_much"} -- Ok, I'm game. Let's do it. } } beremaConvoTemplate:addScreen(game_description); you_win_td = ConvoScreen:new { id = "you_win_td", leftDialog = "@celebrity/lok_gambler:you_win_td", -- Your Thermal Detonator blows up my Sarlacc. You win. stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(you_win_td); you_lose_td = ConvoScreen:new { id = "you_lose_td", leftDialog = "@celebrity/lok_gambler:you_lose_td", -- My Bounty Hunter disarms the Thermal Detonator. You lose! stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(you_lose_td); you_win_bh = ConvoScreen:new { id = "you_win_bh", leftDialog = "@celebrity/lok_gambler:you_win_bh", -- Your Bounty Hunter disarms my Thermal Detonator. Stang! stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(you_win_bh); you_lose_bh = ConvoScreen:new { id = "you_lose_bh", leftDialog = "@celebrity/lok_gambler:you_lose_bh", -- My Sarlacc eats your Bounty Hunter! You lose. stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(you_lose_bh); you_win_s = ConvoScreen:new { id = "you_win_s", leftDialog = "@celebrity/lok_gambler:you_win_s", -- Stang! Your Sarlacc swallows my Bounty Hunter. You win. stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(you_win_s); you_lose_s = ConvoScreen:new { id = "you_lose_s", leftDialog = "@celebrity/lok_gambler:you_lose_s", -- My Thermal Detonator blows up your Sarlacc! I win! You lose. stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(you_lose_s); tie = ConvoScreen:new { id = "tie", leftDialog = "@celebrity/lok_gambler:tie", -- We both picked the same card. It's a tie. stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(tie); play_game = ConvoScreen:new { id = "play_game", leftDialog = "@celebrity/lok_gambler:play_game", -- Interested in wagering a little cash? Maybe making some money? I have a game that's perfect. Wanna hear about it? stopConversation = "false", options = { {"@celebrity/lok_gambler:what_game", "game_description"} -- Tell me about the game. } } beremaConvoTemplate:addScreen(play_game); bet_how_much = ConvoScreen:new { id = "bet_how_much", leftDialog = "@celebrity/lok_gambler:bet_how_much", -- How much you wanna bet? Can't play without credits you know. stopConversation = "false", options = { -- Handled in screen handler } } beremaConvoTemplate:addScreen(bet_how_much); good_luck = ConvoScreen:new { id = "good_luck", leftDialog = "@celebrity/lok_gambler:good_luck", -- Good luck. stopConversation = "true", options = { } } beremaConvoTemplate:addScreen(good_luck); addConversationTemplate("beremaConvoTemplate", beremaConvoTemplate);
return { "rcarriga/nvim-dap-ui", config = function() local dapui = require("dapui") dapui.setup({ icons = { expanded = "−", collapsed = "+" }, mappings = { -- Use a table to apply multiple mappings expand = { "<CR>", "<2-LeftMouse>" }, open = "o", remove = "d", edit = "e", repl = "r", toggle = "t", }, -- Expand lines larger than the window -- Requires >= 0.7 expand_lines = vim.fn.has("nvim-0.7"), layouts = { { elements = { -- Elements can be strings or table with id and size keys. { id = "scopes", size = 0.25 }, "breakpoints", "stacks", "watches", }, size = 40, position = "left", }, { elements = { "repl", "console", }, size = 10, position = "bottom", }, }, floating = { max_height = nil, -- These can be integers or a float between 0 and 1. max_width = nil, -- Floats will be treated as percentage of your screen. border = "single", -- Border style. Can be "single", "double" or "rounded" mappings = { close = { "q", "<Esc>" }, }, }, windows = { indent = 1 }, render = { max_type_length = nil, -- Can be integer or nil. } }) end, defer = function() -- MARK: Register and add to command_center local has_command_center, command_center = pcall(require, 'command_center') if not has_command_center then return end local noremap = { noremap = true } local dapui = require("dapui") command_center.add({ { description = "Open floating window for dap", cmd = dapui.float_element, keybindings = { "n", "<leader>D", noremap }, category = "dap" } }) end }
--Rock libraries console = require 'loveconsole.console' console:initialize({ name = "main", extend = true, buffer_width = 80, buffer_height = 50, font = "res/fonts/press-start-2p.ttf", font_size = 16, }) colors = require 'loveconsole.colors' class = require 'middleclass' --utility functions util = require 'lib.util' --utility classes Queue = require 'lib.queue' --managers local keys = require 'src.managers.keys' --classes Graph = require 'src.graph.graph' require 'src.graph.algorithms.bfs' require 'src.graph.algorithms.mst-prims' require 'src.graph.algorithms.dijkstra' Vertice = require 'src.graph.vertice' Edge = require 'src.graph.edge' function love.run() if love.math then love.math.setRandomSeed(os.time()) end if love.load then love.load(arg) end -- We don't want the first frame's dt to include time taken by love.load. if love.timer then love.timer.step() end local dt = 0 if love.graphics and love.graphics.isActive() then love.graphics.clear(love.graphics.getBackgroundColor()) love.graphics.origin() if love.draw then love.draw() end love.graphics.present() end -- Main loop time. while true do -- Process events. if love.event then love.event.pump() for name, a,b,c,d,e,f in love.event.poll() do if name == "quit" then if not love.quit or not love.quit() then return a end end love.handlers[name](a,b,c,d,e,f) end end -- Update dt, as we'll be passing it to update if love.timer then love.timer.step() dt = love.timer.getDelta() end -- Call update and draw if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled if love.timer then love.timer.sleep(0.001) end end end function love.load() love.keyboard.setKeyRepeat(true) generate_graph() player = {x = graph.start.x, y = graph.start.y} distance = graph:distance_to(graph.start.x, graph.start.y, graph.exit) dijkstra_distance = graph:pathfinding(player.x, player.y, graph.exit) log = "Acties: Tali(s)man, Hand(g)ranaat, Kompa(s)" end function love.draw() console:print("S = Room: Startpunt", 2, 2, colors.white, colors.black) console:print("E = Room: Eindpunt", 2, 3, colors.white, colors.black) console:print("X = Room: Niet Bezocht", 2, 4, colors.white, colors.black) console:print("* = Room: Bezocht", 2, 5, colors.white, colors.black) console:print("~ = Hallway: Ingestort", 2, 6, colors.white, colors.black) console:print("# = Hallway: Level Tegenstander", 2, 7, colors.white, colors.black) graph:draw(4, 8) console:print(" ", 4+player.x*4, 8+player.y*4, colors.white, {1.0, 0.0, 0.0, 0.4}) console:print(log, 2, 45, colors.white, colors.black) console:print("Distance: " .. tostring(distance), 2, 46) console:print("Weighted distance: " .. tostring(dijkstra_distance), 2, 47) end function love.keypressed(key) if keys.handle(key) then graph:refresh() distance = graph:distance_to(player.x, player.y, graph.exit) dijkstra_distance = graph:pathfinding(player.x, player.y, graph.exit) console:flush() end end function generate_graph() graph = Graph:new(16, 8) end function console:flush() if love.graphics and love.graphics.isActive() then love.graphics.clear(love.graphics.getBackgroundColor()) love.graphics.origin() if love.draw then love.draw() end love.graphics.present() end end
local units = {} units.measures = { ['length'] = dofile('definitions/length.lua'), ['area'] = dofile('definitions/area.lua'), ['mass'] = dofile('definitions/mass.lua'), ['volume'] = dofile('definitions/volume.lua'), ['each'] = dofile('definitions/each.lua'), ['temperature'] = dofile('definitions/temperature.lua'), ['time'] = dofile('definitions/time.lua'), ['digital'] = dofile('definitions/digital.lua'), ['parts-per'] = dofile('definitions/parts_per.lua'), ['speed'] = dofile('definitions/speed.lua'), ['pressure'] = dofile('definitions/pressure.lua'), ['current'] = dofile('definitions/current.lua'), ['voltage'] = dofile('definitions/voltage.lua'), ['power'] = dofile('definitions/power.lua'), ['reactive-power'] = dofile('definitions/reactive_power.lua'), ['apparent-power'] = dofile('definitions/apparent_power.lua'), ['energy'] = dofile('definitions/energy.lua'), ['reactive-energy'] = dofile('definitions/reactive_energy.lua'), ['volume-flow-rate'] = dofile('definitions/volume_flow_rate.lua') } function units.convert(amount, from, to) if from == to then return amount, true elseif tonumber(amount) == nil then return false, '"amount" must be a number!' end amount = tonumber(amount) from = { ['unit'] = from, ['type'] = false, ['measure'] = false, ['_anchors'] = {} } to = { ['unit'] = to, ['type'] = false, ['measure'] = false, ['_anchors'] = {} } for measure_type, measure in pairs(units.measures) do for unit_type, unit in pairs(measure) do local count = 0 for k, v in pairs(unit) do count = count + 1 end if unit_type == 'metric' and count >= 1 then for k, v in pairs(unit) do if from['unit'] == k:lower() or from['unit'] == v['name']['singular']:lower() or from['unit'] == v['name']['plural']:lower() then from['type'] = 'metric' from['measure'] = measure_type from['unit'] = v from['_anchors'] = measure._anchors end if to['unit'] == k:lower() or to['unit'] == v['name']['singular']:lower() or to['unit'] == v['name']['plural']:lower() then to['type'] = 'metric' to['measure'] = measure_type to['unit'] = v to['_anchors'] = measure._anchors end end end if unit_type == 'imperial' and count >= 1 then for k, v in pairs(unit) do if from['unit'] == k:lower() or from['unit'] == v['name']['singular']:lower() or from['unit'] == v['name']['plural']:lower() then from['type'] = 'imperial' from['measure'] = measure_type from['unit'] = v from['_anchors'] = measure._anchors end if to['unit'] == k:lower() or to['unit'] == v['name']['singular']:lower() or to['unit'] == v['name']['plural']:lower() then to['type'] = 'imperial' to['measure'] = measure_type to['unit'] = v to['_anchors'] = measure._anchors end end end end end if not from['type'] then return false, 'Invalid "from" unit!' elseif not to['type'] then return false, 'Invalid "to" unit!' elseif from['measure'] ~= to['measure'] then return false, '"' .. from['measure'] .. '" units cannot be converted into "' .. to['measure'] .. '" units!' end local result = amount * from['unit']['to_anchor'] if from['unit']['anchor_shift'] then result = result - from['unit']['anchor_shift'] end local unit_type = from['type'] if from['type'] ~= to['type'] then if from['_anchors'][tostring(unit_type)] and from['_anchors'][tostring(unit_type)].transform then local transform = from['_anchors'][tostring(unit_type)].transform result = transform(result) else local ratio = from['_anchors'][tostring(unit_type)]['ratio'] result = result * tonumber(ratio) end end if to['unit']['anchor_shift'] then result = result + to['unit']['anchor_shift'] end result = result / to['unit']['to_anchor'] return result, true end return units
local M = {} local map = vim.api.nvim_set_keymap local options = { noremap = true } M.start = function() map('n', '<leader>mb', '<CMD>FloatermNew --autoclose=2 --height=0.9 --width=0.9 btm<CR>', options) -- Bottom app (brew install clementtsang/bottom/bottom) map('n', '<leader>md', '<CMD>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazydocker<CR>', options) map('n', '<leader>mg', '<CMD>FloatermNew --autoclose=2 --height=0.9 --width=0.9 lazygit<CR>', options) map('n', '<leader>mn', '<CMD>FloatermNew --autoclose=2 --height=0.5 --width=0.5 nnn -Hde<CR>', options) --- like ranger for directory brow map('n', '<leader>mz', '<CMD>FloatermNew --autoclose=2 --height=0.9 --width=0.9 zsh<CR>', options) map('n', '<leader>mt', '<CMD>FloatermNew --autoclose=2 --height=0.9 --width=0.9 tannskwarrior-tui<CR>', options) -- vim.api.nvim_set_keymap("n", "<leader>s1", ":HopChar2<cr>", { silent = true }) -- vim.api.nvim_set_keymap("n", "<leader>s2", ":HopWord<cr>", { silent = true }) map('n', '<leader>m1', ':HopChar1<CR>', { silent = true }) map('n', '<leader>m2', ':HopChar2<CR>', { silent = true }) map('n', '<leader>mp', ':HopPattern<CR>', { silent = true }) map('n', '<leader>ml', ':HopLine<CR>', { silent = true }) map('n', '<leader>mw', ':HopWord<CR>', { silent = true }) local teleOptions = { noremap = true, silent = true } -- Builtin map('n', '<leader>fe', ':Telescope file_browser cwd=vim.fn.expand("%:p:h")<CR>', teleOptions) map('n', '<leader>fg', ':Telescope git_files<CR>', teleOptions) map('n', '<C-f>', ':Telescope find_files hidden=true<CR>', teleOptions) -- map('n', '<leader>fl', ':Telescope live_grep<CR>', teleOptions) map('n', '<leader>fb', ':Telescope buffers<CR>', teleOptions) map('n', '<leader>fh', ':Telescope help_tags<CR>', teleOptions) map('n', '<leader>fd', ':Telescope lsp_workspace_diagnostics<CR>', teleOptions) -- no hl vim.api.nvim_set_keymap('n', '<Esc><Esc>', ':set hlsearch!<CR>', {noremap = true, silent = true}) vim.cmd([[ tnoremap <C-h> <C-\><C-N><C-w>h tnoremap <C-j> <C-\><C-N><C-w>j tnoremap <C-k> <C-\><C-N><C-w>k tnoremap <C-l> <C-\><C-N><C-w>l inoremap <C-h> <C-\><C-N><C-w>h inoremap <C-j> <C-\><C-N><C-w>j inoremap <C-k> <C-\><C-N><C-w>k inoremap <C-l> <C-\><C-N><C-w>l tnoremap <Esc> <C-\><C-n> ]]) vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', {silent = true}) vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', {silent = true}) vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', {silent = true}) vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', {silent = true}) vim.api.nvim_set_keymap('n', '<C-Up>', ':resize -2<CR>', {silent = true}) vim.api.nvim_set_keymap('n', '<C-Down>', ':resize +2<CR>', {silent = true}) vim.api.nvim_set_keymap('n', '<C-Left>', ':vertical resize -2<CR>', {silent = true}) vim.api.nvim_set_keymap('n', '<C-Right>', ':vertical resize +2<CR>', {silent = true}) vim.api.nvim_set_keymap('v', '<', '<gv', {noremap = true, silent = true}) vim.api.nvim_set_keymap('v', '>', '>gv', {noremap = true, silent = true}) vim.api.nvim_set_keymap('n', '<TAB>', ':bnext<CR>', {noremap = true, silent = true}) vim.api.nvim_set_keymap('n', '<S-TAB>', ':bprevious<CR>', {noremap = true, silent = true}) vim.api.nvim_set_keymap('x', 'K', ':move \'<-2<CR>gv-gv', {noremap = true, silent = true}) vim.api.nvim_set_keymap('x', 'J', ':move \'>+1<CR>gv-gv', {noremap = true, silent = true}) vim.cmd('vnoremap p "0p') vim.cmd('vnoremap P "0P') vim.api.nvim_set_keymap("n", "<leader>bd", ":bd<CR>", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<leader>bD", ":bd!<CR>", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<leader>bA", ":bufdo! bd<CR>", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<leader>bn", ":bnext<CR>", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "<leader>bv", ":bprevious<CR>", {noremap = true, silent = true}) -- Toggle the QuickFix window vim.api.nvim_set_keymap('', '<C-q>', ':call QuickFixToggle()<CR>', {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "Y", "y$", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "n", "nzzzv", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "N", "Nzzzv", {noremap = true, silent = true}) vim.api.nvim_set_keymap("n", "J", "mzJ`z", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", ",", ",<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", ".", ".<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", "!", "!<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", "?", "?<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", "[", "[<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", "{", "{<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", "(", "(<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("i", "_", "_<c-g>u", {noremap = true, silent = true}) vim.api.nvim_set_keymap("v", "J", ":m \'>+1<CR>gv=gv", {noremap = true}) vim.api.nvim_set_keymap("v", "K", ":m \'<-2<CR>gv=gv", {noremap = true}) vim.api.nvim_set_keymap("i", "<C-j>", "<esc>:m .+1<CR>==", {noremap = true}) vim.api.nvim_set_keymap("i", "<C-k>", "<esc>:m .-2<CR>==", {noremap = true}) vim.api.nvim_set_keymap("n", "<leader>j", ":m .+1<CR>==", {noremap = true}) vim.api.nvim_set_keymap("n", "<leader>k", ":m .-2<CR>==", {noremap = true}) end return M
-------------------------------------------------------------------------------- --[[ Dusk Engine Demo: Spin --]] -------------------------------------------------------------------------------- display.setStatusBar(display.HiddenStatusBar) local textureFilter = "nearest" display.setDefault("minTextureFilter", textureFilter) display.setDefault("magTextureFilter", textureFilter) -------------------------------------------------------------------------------- -- Localize -------------------------------------------------------------------------------- local dusk = require("Dusk.Dusk") local intersection = require("intersection") local math_ceil = math.ceil local math_abs = math.abs local table_insert = table.insert local map local player local move local maxSpeed local accelRate local canJump ---- local gravity -------------------------------------------------------------------------------- -- Functions -------------------------------------------------------------------------------- local distanceBetween = function(x1, y1, x2, y2) return (((x2 - x1) ^ 2) + ((y2 - y1) ^ 2)) ^ 0.5 end local getPointsAlongLine = function(x1, y1, x2, y2, d) local points = {} local diffX = x2 - x1 local diffY = y2 - y1 local distBetween = math_ceil(distanceBetween(x1, y1, x2, y2) / d) local x, y = x1, y1 local addX, addY = diffX / distBetween, diffY / distBetween for i = 1, distBetween do table_insert(points, {x, y}) x, y = x + addX, y + addY end return points end local clamp = function(v, l, h) return (v < l and l) or (v > h and h) or v end -------------------------------------------------------------------------------- -- Load Map -------------------------------------------------------------------------------- map = dusk.buildMap("map.json") maxSpeed = 20 accelRate = 0.002 canJump = true gravity = 0.3 -------------------------------------------------------------------------------- -- Create Player -------------------------------------------------------------------------------- player = display.newImageRect("graphics/ball.png", 40, 40) map.layer[1]:insert(player) player.downSensorLength = 20 -- How far below the player the ground is stopped player.sensorWidth = 3 player.xVel, player.yVel = 0, 0 -- Initial X and Y velocities player.groundOffset = 20 -- Y-offset of the player's collision point player.xRetain = 0.95 player.bounce = 0.5 -- Tweak this if you want player.jumpForce = 15 player.isGrounded = false -- This flag represents if the player is on the ground -------------------------------------------------------------------------------- -- Create Movement System -------------------------------------------------------------------------------- move = display.newGroup() -- Elements of movement system move.background = display.newRoundedRect(0, 0, display.contentWidth - 20, 60, 9) move.background.strokeWidth = 4 move.background:setFillColor(0, 0, 0) move:insert(move.background) move.fillBar = display.newRect(0, 0, 10, move.height - move.background.strokeWidth) move.fillBar:setFillColor(1, 1, 1) move:insert(move.fillBar) move.bar = display.newRoundedRect(0, 0, move.background.height * 0.6, move.height, 9) move:insert(move.bar) move.jump = display.newPolygon(0, 0, {0,-30, 15,15, -15,15}) move.jump.strokeWidth = 3 move.jump:setStrokeColor(1, 1, 1) move.jump:setFillColor(0, 0, 0) move:insert(move.jump) -- Position controls at bottom of screen move.x, move.y = display.contentCenterX, display.contentHeight - 10 - move.height * 0.5 -- Function to draw the fill bar function move.drawFill() move.fillBar.width = math_abs(move.bar.x) move.fillBar.x = move.bar.x * 0.5 end function move:touch(event) if "began" == event.phase then display.getCurrentStage():setFocus(move, event.id) move.isFocus = true move.bar.x = clamp(event.x - move.x, -move.width * 0.5 + move.bar.width * 0.5, move.width * 0.5 - move.bar.width * 0.5) move.jump.x = move.bar.x move.jump.y = clamp((event.y - event.yStart) * 0.8, -move.background.height, 0) move.drawFill() elseif move.isFocus then if "moved" == event.phase then move.bar.x = clamp(event.x - move.x, -move.width * 0.5 + move.bar.width * 0.5, move.width * 0.5 - move.bar.width * 0.5) move.jump.x = move.bar.x move.jump.y = clamp((event.y - event.yStart) * 0.8, -move.background.height, 0) move.drawFill() elseif "ended" == event.phase then display.getCurrentStage():setFocus(nil, event.id) move.isFocus = false move.bar.x = 0 move.jump.x, move.jump.y = 0, 0 move.drawFill() end end if move.jump.y ~= -move.background.height then canJump = true end end -------------------------------------------------------------------------------- --[[ This is our main collision function. All it does is determine the intersection point between two lines, if any, and return it. --]] -------------------------------------------------------------------------------- local checkTile = function(tile) local intersectionPoint = intersection( -- Line segment #1: line drawn between player's current and previous positions player.x, player.y + player.groundOffset, player.x, player.prevY, -- Line segment #2: Top of tile tile.x - (tile.width * 0.5), tile.y - (tile.height * 0.5), tile.x + (tile.width * 0.5), tile.y - (tile.height * 0.5) ) if intersectionPoint then return true, intersectionPoint else return false end end -------------------------------------------------------------------------------- --[[ resolveCollision() Resolves a collision with the player, given the collision point. --]] -------------------------------------------------------------------------------- local resolveCollision = function(point) if player.yVel >= 0 then player.y = point.y - player.groundOffset player.yVel = -(player.yVel * player.bounce) return true else return false end end -------------------------------------------------------------------------------- --[[ updatePlayerCollisions() This function wraps up checkTile() and resolveCollision(). --]] -------------------------------------------------------------------------------- local updatePlayerCollisions = function() --[[ First, we do a collision check on the current position of the player. If the player has collided, we return before checking through all the points. --]] local tile = map.layer[1].tileByPixels(player.x, player.y + player.groundOffset) if tile then local collided, point = checkTile(tile) if collided then return resolveCollision(point) end end --[[ If we're still in the function, we didn't get a collision for the current position. Thus, we calculate the tiles between the player's current position and the player's previous position, then do a collision check for each one. This prevents the player from moving through the floor if it is going fast. --]] local points = getPointsAlongLine(player.x, player.prevY + player.groundOffset, player.x, player.y + player.groundOffset, map.data.tileHeight) for i = 1, #points do local tile = map.layer[1].tileByPixels(points[i][1], points[i][2]) if tile then local collided, point = checkTile(tile) if collided then return resolveCollision(point) end end end return false end -------------------------------------------------------------------------------- --[[ gameLoop() This function is executed each frame. It moves the player, applies gravity, and calls the collision check functions. --]] -------------------------------------------------------------------------------- local gameLoop = function(event) player.prevX, player.prevY = player.x, player.y player.xVel = clamp(player.xVel + (move.bar.x * accelRate), -maxSpeed, maxSpeed) * player.xRetain player.yVel = player.yVel + gravity player:translate(player.xVel, player.yVel) local isGrounded = updatePlayerCollisions() player.isGrounded = isGrounded if player.isGrounded then if move.jump.y <= -move.background.height and canJump then player.yVel = -player.jumpForce canJump = false end end player:rotate(player.xVel * 2) map.updateView() end -------------------------------------------------------------------------------- -- Finish Up -------------------------------------------------------------------------------- player.x, player.y = map.tilesToPixels(map.playerPosition) map.setTrackingLevel(0.1) map.setCameraFocus(player) -- display.getCurrentStage():setFocus(move) Runtime:addEventListener("enterFrame", gameLoop) move:addEventListener("touch") -- Display the initial alert -- native.showAlert("Spin", "Welcome to the Spin demo. This is a demo that demonstrates non-Box2D physics using tile properties.\n\nControl the player by clicking or touching to either side of the screen and moving back and forth. To jump, slide the touch or click point upward. To do multiple jumps, you'll need to move your click or touch point to the position along the Y-axis that it started.\n\nRead the code to see how it works!", {"Got it!"})
-- Cameron K Titus Assignment 4 -- CS331 UAF Spring 2018 -- Based on rdparser4 and assn4_code.txt local parseit = {} lexit = require "lexit" -- For lexer iteration local iter local state local lexer_out_s local lexer_out_c -- For current lexeme local lexyString = "" local lexyCat = 0 -- Symbolic constants for aSearchTree local STMT_LIST = 1 local INPUT_STMT = 2 local PRINT_STMT = 3 local FUNC_STMT = 4 local CALL_FUNC = 5 local IF_STMT = 6 local WHILE_STMT = 7 local ASSN_STMT = 8 local CR_OUT = 9 local STRLIT_OUT = 10 local BIN_OP = 11 local UN_OP = 12 local NUMLIT_VAL = 13 local BOOLLIT_VAL = 14 local SIMPLE_VAR = 15 local ARRAY_VAR = 16 -- Go to next lexeme and load it into lexyString, lexyCat. -- Should be called once before any parsing is done. -- Function init must be called before this function is called. local function advance() -- Advance the iterator lexit_out_s, lexit_out_c = iter(state, lexit_out_s) -- If we're not past the end, copy current lexeme into vars if lexit_out_s ~= nil then lexyString, lexyCat = lexit_out_s, lexit_out_c else lexyString, lexyCat = "", 0 end end -- Return true if pos has reached end of input. -- Function init must be called before this function is called. local function atEnd() return lexyCat == 0 end -- Given string, see if current lexeme string form is equal to it. If -- so, then advance to next lexeme & return true. If not, then do not -- advance, return false. -- Function init must be called before this function is called. local function matchString(s) if lexyString == s then if lexyString == ')' then lexit.preferOp() end advance() return true else return false end end -- Same as matchString, but for categories local function matchCat(c) return lexyCat == c end -- Initial call. Sets input for parsing functions. local function init(prog) iter, state, lexer_out_s = lexit.lex(prog) advance() end function parseit.parse(prog) -- Initialization init(prog) -- Get results from parsing local tresBien, aSearchTree = parsePRGRM() -- Parse start symbol local done = atEnd() -- And return them return tresBien, done, aSearchTree end -- Handles print arguments function parsePRINTARG() local tresBien, aSearchTree if matchString('cr') then aSearchTree = { CR_OUT } tresBien = true elseif matchCat(lexit.STRLIT) then aSearchTree = { STRLIT_OUT, lexyString } advance() tresBien = true else tresBien, aSearchTree = parseEXPR() if not tresBien then return false, nil end -- advance() tresBien = true end return tresBien, aSearchTree end -- parsePRGRM -- Parsing function for nonterminal "program". -- Function init must be called before this function is called. function parsePRGRM() local tresBien, aSearchTree tresBien, aSearchTree = parseSTMTList() return tresBien, aSearchTree end -- Parsing function for nonterminal "stmt_list". -- Function init must be called before this function is called. function parseSTMTList() local tresBien, aSearchTree, secondTree aSearchTree = { STMT_LIST } while true do if lexyString ~= "input" and lexyString ~= "print" and lexyString ~= "func" and lexyString ~= "call" and lexyString ~= "if" and lexyString ~= "while" and lexyCat ~= lexit.ID then return true, aSearchTree end tresBien, secondTree = parseSTMT() if not tresBien then return false, nil end table.insert(aSearchTree, secondTree) end return tresBien, aSearchTree end -- Handles call statements function parseCall() local tresBien, aSearchTree if matchCat(lexit.ID) then aSearchTree = { CALL_FUNC, lexyString } tresBien = true advance() else tresBien = false end return tresBien, aSearchTree end -- Handles arithmetic expressions function parseARITH() local tresBien, aSearchTree, secondTree, oldLexyString tresBien, aSearchTree = parseTERM() if not tresBien then return false, nil end while true do oldLexyString = lexyString if not matchString('+') and not matchString('-') then break end tresBien, secondTree = parseTERM() if not tresBien then return false, nil end aSearchTree = { { BIN_OP, oldLexyString }, aSearchTree, secondTree } end return true, aSearchTree end -- Handles expressions function parseEXPR() local tresBien, aSearchTree, secondTree, oldLexyString tresBien, aSearchTree = parse_COMP() while true do oldLexyString = lexyString if not matchString("&&") and not matchString("||") then break end tresBien, secondTree = parse_COMP() if not tresBien then return false, nil end aSearchTree = { { BIN_OP, oldLexyString }, aSearchTree, secondTree } end return tresBien, aSearchTree end -- Handles comparison expressions function parse_COMP() local tresBien, aSearchTree, secondTree, thirdTree if matchString('!') then tresBien, aSearchTree = parse_COMP() if not tresBien then return false, nil end aSearchTree = { { UN_OP, "!" }, aSearchTree} return true, aSearchTree end tresBien, aSearchTree = parseARITH() if not tresBien then return false, nil end while true do local oldLexyString = lexyString if not matchString("==") and not matchString("!=") and not matchString("<") and not matchString("<=") and not matchString(">") and not matchString(">=") then return tresBien, aSearchTree else tresBien, secondTree = parseARITH() if not tresBien then return false, nil end aSearchTree = { { BIN_OP, oldLexyString }, aSearchTree, secondTree } end end return tresBien, aSearchTree end -- Handles terminals function parseTERM() local tresBien, aSearchTree, secondTree, oldLexyString tresBien, aSearchTree = parseFCTR() if not tresBien then return false, nil end while true do oldLexyString = lexyString if not matchString('*') and not matchString('/') and not matchString('%') then break end tresBien, secondTree = parseFCTR() if not tresBien then return false, nil end aSearchTree = { { BIN_OP, oldLexyString }, aSearchTree, secondTree } end return true, aSearchTree end -- Handles factors function parseFCTR() local tresBien, aSearchTree, secondTree, oldLexyString oldLexyString = lexyString if matchString('call') then return parseCall() elseif matchString('true') or matchString('false') then return true, { BOOLLIT_VAL, oldLexyString } elseif matchCat(lexit.NUMLIT) then lexit.preferOp() tresBien = true aSearchTree = { NUMLIT_VAL, lexyString } advance() elseif matchString('+') or matchString('%') or matchString('-') then tresBien, secondTree = parseFCTR() if not tresBien then return false, nil end aSearchTree = { {UN_OP, oldLexyString}, secondTree } elseif matchString('(') then tresBien, aSearchTree = parseEXPR() if not tresBien or not matchString(')') then return false, nil end else tresBien, aSearchTree = parseLVAL() if not tresBien then return false, nil end end return tresBien, aSearchTree end -- Handles lvalues function parseLVAL() local tresBien, aSearchTree if matchCat(lexit.ID) then lexit.preferOp() aSearchTree = { SIMPLE_VAR, lexyString } tresBien = true advance() if matchString('[') then local tresBien, secondTree = parseEXPR() if not tresBien then return false, nil end aSearchTree = { ARRAY_VAR, aSearchTree[2], secondTree } if not matchString(']') then return false, nil end end else tresBien = false end return tresBien, aSearchTree end -- Parsing function for nonterminal "statement" -- Function init must be called before this function is called. function parseSTMT() local tresBien, aSearchTree, secondTree, oldLexyString -- Input statements if matchString("input") then tresBien, aSearchTree = parseLVAL() return tresBien, { INPUT_STMT, aSearchTree } -- Call statements elseif matchString('call') then tresBien, aSearchTree = parseCall() return tresBien, aSearchTree -- Print statements elseif matchString("print") then tresBien, aSearchTree = parsePRINTARG() if not tresBien then return false, nil end secondTree = { PRINT_STMT, aSearchTree } while true do if not matchString(";") then break end tresBien, aSearchTree = parsePRINTARG() if not tresBien then return false, nil end table.insert(secondTree, aSearchTree) end return true, secondTree -- Func definitions elseif matchString("func") then local func_name if matchCat(lexit.ID) then func_name = lexyString advance() else return false, nil end tresBien, secondTree = parseSTMTList() if not tresBien then return false, nil end tresBien = matchString('end') aSearchTree = { FUNC_STMT, func_name, secondTree } return tresBien, aSearchTree -- While statements elseif matchString('while') then local expr, stmt_list tresBien, expr = parseEXPR() if not tresBien then return false, nil end tresBien, stmt_list = parseSTMTList() if not tresBien or not matchString('end') then return false, nil end aSearchTree = { WHILE_STMT, expr, stmt_list } return true, aSearchTree -- If statements elseif matchString('if') then local expr, stmt_list tresBien, expr = parseEXPR() if not tresBien then return false, nil end tresBien, stmt_list = parseSTMTList() if not tresBien then return false, nil end aSearchTree = { IF_STMT, expr, stmt_list } while true do oldLexyString = lexyString if not matchString('elseif') then break end tresBien, expr = parseEXPR() if not tresBien then return false, nil end tresBien, stmt_list = parseSTMTList() if not tresBien then return false, nil end table.insert(aSearchTree, expr) table.insert(aSearchTree, stmt_list) end if matchString('else') then tresBien, stmt_list = parseSTMTList() if not tresBien then return false, nil end table.insert(aSearchTree, stmt_list) end if not matchString('end') then return false, nil end return true, aSearchTree -- Handle assignments elseif matchCat(lexit.ID) then tresBien, aSearchTree = parseLVAL() if not tresBien then return false, nil end if not matchString('=') then return false, nil end tresBien, secondTree = parseEXPR() if not tresBien then return false, nil end aSearchTree = { ASSN_STMT, aSearchTree, secondTree } return true, aSearchTree -- Handle unknown cases else advance() return false, nil end end return parseit
function Vector2(x, y) return {x = x, y = y} end function Vector3(x, y, z) return {x = x, y = y, z = z} end function DegToRad(d) return math.pi * d / 180 end init_config_file = "rosbuild_ws/simulator/init_config.lua" -- example of loading human crow scenario configs -- init_config_file = "config/human_crowd_scenario_configs/example_scenario/init_config.lua" -- Time-step for simulation. delta_t = 0.025 -- Car dimensions. car_width = 0.281 car_length = 0.535 car_height = 0.15; -- Location of the robot's rear wheel axle relative to the center of the body. rear_axle_offset = -0.162 laser_loc = Vector3(0.2, 0, 0.15) -- Kinematic and dynamic constraints for the car. min_turn_radius = 0.98 max_speed = 1.2 max_accel = 3.0 -- Laser noise simulation. laser_noise_stddev = 0.01 -- Turning error simulation. angular_error_bias = DegToRad(0); angular_error_rate = 0.1; -- Laser rangefinder parameters. laser_noise_stddev = 0.01; laser_angle_min = DegToRad(-135.0); laser_angle_max = DegToRad(135.0); laser_angle_increment = DegToRad(1); laser_min_range = 0.02; laser_max_range = 6.0; robot_types = {"DIFF_DRIVE", "DIFF_DRIVE", "DIFF_DRIVE", "DIFF_DRIVE", "DIFF_DRIVE"} robot_config = "rosbuild_ws/simulator/turtlebot_config.lua" laser_topic = "/Cobot/scan" laser_frame = "/laser"
return { armbats = { acceleration = 0.036, brakerate = 0.093, buildangle = 16384, buildcostenergy = 89150, buildcostmetal = 7004, builder = false, buildpic = "armbats.dds", buildtime = 60000, canattack = true, canguard = true, canmove = true, canpatrol = true, canstop = 1, category = "ALL HUGE MOBILE SURFACE UNDERWATER", collisionvolumeoffsets = "-1 -10 4", collisionvolumescales = "67 67 138", collisionvolumetype = "CylZ", corpse = "dead", defaultmissiontype = "Standby", description = "Battleship", explodeas = "CRAWL_BLASTSML", firestandorders = 1, floater = true, footprintx = 6, footprintz = 6, icontype = "sea", idleautoheal = 5, idletime = 1800, losemitheight = 58, maneuverleashlength = 640, mass = 7004, maxdamage = 18150, maxvelocity = 1.4, minwaterdepth = 15, mobilestandorders = 1, movementclass = "DBOAT6", name = "Millennium", noautofire = false, objectname = "ARMBATS", radaremitheight = 57, seismicsignature = 0, selfdestructas = "CRAWL_BLAST", sightdistance = 600, standingfireorder = 2, standingmoveorder = 1, steeringmode = 1, turninplaceanglelimit = 140, turninplacespeedlimit = 1.30, turnrate = 180, unitname = "armbats", customparams = { buildpic = "armbats.dds", faction = "ARM", --requiretech = "Advanced T2 Unit Research Centre", }, featuredefs = { dead = { blocking = false, collisionvolumeoffsets = -22.182, collisionvolumescales = "74.9459686279 67.6992492676 151.322341919", collisionvolumetype = "Box", damage = 9118, description = "Millennium Wreckage", energy = 0, featuredead = "heap", footprintx = 6, footprintz = 6, metal = 5250, object = "ARMBATS_DEAD", reclaimable = true, customparams = { fromunit = 1, }, }, heap = { blocking = false, damage = 11397, description = "Millennium Debris", energy = 0, footprintx = 2, footprintz = 2, metal = 2800, object = "6X6D", reclaimable = true, customparams = { fromunit = 1, }, }, }, sfxtypes = { explosiongenerators = { [1] = "custom:MEDIUMFLARE", }, pieceexplosiongenerators = { [1] = "piecetrail0", [2] = "piecetrail1", [3] = "piecetrail2", [4] = "piecetrail3", [5] = "piecetrail4", [6] = "piecetrail6", }, }, sounds = { canceldestruct = "cancel2", underattack = "warning1", cant = { [1] = "cantdo4", }, count = { [1] = "count6", [2] = "count5", [3] = "count4", [4] = "count3", [5] = "count2", [6] = "count1", }, ok = { [1] = "sharmmov", }, select = { [1] = "sharmsel", }, }, weapondefs = { arm_bats = { accuracy = 350, areaofeffect = 96, avoidfeature = false, cegtag = "Trail_cannon_med", craterareaofeffect = 0, craterboost = 0, cratermult = 0, explosiongenerator = "custom:FLASH96", gravityaffected = "TRUE", impulseboost = 0.123, impulsefactor = 0.123, name = "BattleshipCannon", nogap = 1, noselfdamage = true, range = 1400, reloadtime = 0.75, rgbcolor = "0.86 0.62 0", separation = 0.45, size = 1.82, sizedecay = -0.15, soundhitdry = "xplomed2", soundhitwet = "splsmed", soundhitwetvolume = 0.6, soundstart = "cannhvy1", stages = 20, turret = true, weapontype = "Cannon", weaponvelocity = 470, damage = { commanders = 112.5, default = 225, subs = 5, }, }, }, weapons = { [1] = { def = "ARM_BATS", maindir = "0 0 1", maxangledif = 330, onlytargetcategory = "SURFACE", }, [2] = { def = "ARM_BATS", maindir = "0 0 1", maxangledif = 270, onlytargetcategory = "SURFACE", }, }, }, }
am.addCMD("ban", "Bans a player", "Administration", function(caller, target, reason, server, duration) local isPlayer = type(target) == "Player" // Notifications if (!duration || duration.seconds == 0) then am.notify(nil, am.green, caller:Nick(), am.def, " has banned ", am.red, isPlayer && target:Nick() || target, " indefinitely", am.def, " on ", am.red, server.info.name, am.def, " because of ", am.red, reason) else am.notify(nil, am.green, caller:Nick(), am.def, " has banned ", am.red, isPlayer && target:Nick() || target, am.def, " for ", am.red, duration.pretty , am.def, " on ", am.red, server.info.name, am.def, " because of ", am.red, reason) end // Insert ban into the database local query = am.db:insert("bans") query:insert("banned_steamid", isPlayer && target:SteamID() || target) query:insert("banned_name", isPlayer && target:Nick() || "n/a") query:insert("banned_timestamp", os.time()) query:insert("banned_reason", reason) query:insert("banned_time", duration.seconds) query:insert("banner_steamid", caller:SteamID()) query:insert("banner_name", caller:Nick()) query:insert("banned_ip", isPlayer && target:IPAddress() || "n/a") query:insert("serverid", server.id) query:execute() if (isPlayer) then target:Kick("You have been banned! Time: " .. duration.pretty .. " Reason: "..reason); end end):addParam({ name = "target", type = "player" }):addParam({ name = "reason", type = "string" }):addParam({ name = "server", type = "server", optional = true, defaultUI = "global" }):addParam({ name = "time", type = "duration", optional = true, defaultUI = "indefinitely", default = { seconds = 0, pretty = "indefinitely" } }):setPerm("ban") am.addCMD("unbanid", "Unbans a player by their steamid. Note: global unbans will deactive ALL bans", "Administration", function(caller, target, server, deleteBan) // Optionally delete and unban if it exists am.db:select("bans"):where("banned_steamid", target):where("ban_active", 1):callback(function(res) if (#res == 0) then return end am.notify(nil, am.green, caller:Nick(), am.def, " has unbanned ", am.red, target, am.def, " on ", am.red, server.info.name) // Delete the ban if (deleteBan) then local query = am.db:delete("bans") query:where("banned_steamid", target) query:where("ban_active", 1) if (server.id != 0) then query:where("serverid", server.id) end query:execute() else // Keep the record, but unban it local query = am.db:update("bans") query:where("banned_steamid", target) query:where("ban_active", 1) query:update("ban_active", 0) // Support for server id or global if (server.id != 0) then query:where("serverid", server.id) end query:execute() end end):execute() end):addParam({ name = "targetid", type = "string" }):addParam({ name = "server", type = "server", optional = true, defaultUI = "global" }):addParam({ name = "delete ban", type = "bool", optional = true, defaultUI = "false" }):setPerm("unban")
local lavaSandwich = {} lavaSandwich.name = "MaxHelpingHand/CustomSandwichLava" lavaSandwich.depth = 0 lavaSandwich.placements = { name = "lava_sandwich", data = { direction = "CoreModeBased", speed = 20.0, sandwichGap = 160.0, hotSurfaceColor = "ff8933", hotEdgeColor = "f25e29", hotCenterColor = "d01c01", coldSurfaceColor = "33ffe7", coldEdgeColor = "4ca2eb", coldCenterColor = "0151d0" } } lavaSandwich.fieldInformation = { hotSurfaceColor = { fieldType = "color" }, hotEdgeColor = { fieldType = "color" }, hotCenterColor = { fieldType = "color" }, coldSurfaceColor = { fieldType = "color" }, coldEdgeColor = { fieldType = "color" }, coldCenterColor = { fieldType = "color" } } function lavaSandwich.texture(room, entity) if entity.direction == "AlwaysUp" then return "ahorn/MaxHelpingHand/lava_sandwich_up" elseif entity.direction == "AlwaysDown" then return "ahorn/MaxHelpingHand/lava_sandwich_down" else return "@Internal@/lava_sandwich" end end return lavaSandwich
-- https://github.com/hrsh7th/vim-gindent/blob/ca389426eb111507e56c792894cf3299b6439ced/lua/gindent/syntax.lua local M = {} function M.get_treesitter_syntax_groups(cursor) local bufnr = vim.api.nvim_get_current_buf() local highlighter = vim.treesitter.highlighter.active[bufnr] if not highlighter then return {} end local contains = function(node, cursor) local row_s, col_s, row_e, col_e = node:range() local contains = true contains = contains and (row_s < cursor[1] or (row_s == cursor[1] and col_s <= cursor[2])) contains = contains and (cursor[1] < row_e or (row_e == cursor[1] and cursor[2] < col_e)) return contains end local names = {} highlighter.tree:for_each_tree(function(tstree, ltree) if not tstree then return end local root = tstree:root() if contains(root, cursor) then local query = highlighter:get_query(ltree:lang()):query() for id, node in query:iter_captures(root, bufnr, cursor[1], cursor[1] + 1) do if contains(node, cursor) then local name = vim.treesitter.highlighter.hl_map[query.captures[id]] if name then table.insert(names, name) end end end end end) return names end return M
ITEM.name = ".454 Casull Ammo" ITEM.model = "models/gmodz/ammo/454.mdl" ITEM.ammo = "454casull" ITEM.ammoAmount = 8 ITEM.maxRounds = 16 ITEM.description = "Ammo box that contains .454 Casull caliber" ITEM.price = 23000 ITEM.rarity = { weight = 20 }
local core = require "core" local command = {} command.map = {} local always_true = function() return true end function command.add(predicate, map) predicate = predicate or always_true if type(predicate) == "string" then predicate = require(predicate) end if type(predicate) == "table" then local class = predicate predicate = function() return core.active_view:is(class) end end for name, fn in pairs(map) do assert(not command.map[name], "command already exists: " .. name) command.map[name] = { predicate = predicate, perform = fn } end end local function capitalize_first(str) return str:sub(1, 1):upper() .. str:sub(2) end function command.prettify_name(name) return name:gsub(":", ": "):gsub("-", " "):gsub("%S+", capitalize_first) end function command.get_all_valid() local res = {} for name, cmd in pairs(command.map) do if cmd.predicate() then table.insert(res, name) end end return res end local function perform(name) local cmd = command.map[name] if cmd and cmd.predicate() then cmd.perform() return true end return false end function command.perform(...) local ok, res = core.try(perform, ...) return not ok or res end function command.add_defaults() local reg = { "core", "root", "command", "doc", "findreplace", "files", "drawwhitespace", "dialog" } for _, name in ipairs(reg) do require("core.commands." .. name) end end return command
while wait(0.1) do local dir = game.CoreGui.RobloxGui.PlayerListContainer.ScrollList for i,v in pairs(dir:GetChildren()) do if game.Workspace:findFirstChild(v.Name) then local role = game.Players[v.Name].Character:findFirstChild("Role") if role then if role.Value == "Sheriff" then v.BGFrame.PlayerName.TextColor3 = Color3.new(1, 170/255, 0) elseif role.Value == "Murderer" then v.BGFrame.PlayerName.TextColor3 = Color3.new(1, 0, 0) else v.BGFrame.PlayerName.TextColor3 = Color3.new(0, 1, 0) end end end end for i,v in pairs(game.Players:GetChildren()) do v.CharacterAdded:connect(function() v.Character.Role.Value = "Innocent" end) end end
local M = Class(DisplayObject) function M:init(w, h) self.super:init() local assets = assets self:addChild(DisplayShape.new(w, h) :setSource(Pattern.texture(assets:loadTexture("widgets/radiobutton/bg.png")):setExtend(Pattern.EXTEND_REPEAT)) :paint()) local radiobutton = Widget.RadioButton.new({x = 100, y = 100}) :addEventListener("Change", function(d, e) print("RadioButton changed:", e.checked) end) self:addChild(radiobutton) end return M
require "Polycode/Resource" class "GLSLProgram" (Resource) TYPE_VERT = 0 TYPE_FRAG = 1 function GLSLProgram:__index__(name) if name == "type" then return Polycore.GLSLProgram_get_type(self.__ptr) end end function GLSLProgram:__set_callback(name,value) if name == "type" then Polycore.GLSLProgram_set_type(self.__ptr, value) return true end return false end function GLSLProgram:GLSLProgram(...) if type(arg[1]) == "table" and count(arg) == 1 then if ""..arg[1]:class() == "Resource" then self.__ptr = arg[1].__ptr return end end for k,v in pairs(arg) do if type(v) == "table" then if v.__ptr ~= nil then arg[k] = v.__ptr end end end if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then self.__ptr = Polycore.GLSLProgram(unpack(arg)) Polycore.__ptr_lookup[self.__ptr] = self end end function GLSLProgram:addParam(name, isAuto, autoID, paramType, defaultData) local retVal = Polycore.GLSLProgram_addParam(self.__ptr, name, isAuto, autoID, paramType, defaultData.__ptr) end function GLSLProgram:__delete() Polycore.__ptr_lookup[self.__ptr] = nil Polycore.delete_GLSLProgram(self.__ptr) end
local game = {} game.Game = require("heart.game.Game") return game
m = Map("snmpd") -- SNMP -- s = m:section(NamedSection, "daemon", "snmp", translate("SNMP")) s.anonymous = true en = s:option(Flag, "enabled", translate("Enable SNMP")) en.rmempty = false return m
-- Copyright 2021 HDBSD -- -- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -- IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -- OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local game = {} local HipFiles = { "b001", "b002", "b003", "b004", "c001", "c002", "c003", "c004", "c005", "c006", "c007", "e001", "e002", "e003", "e004", "e005", "e006", "e007", "e008", "e009", "f001", "f003", "f004", "f005", "f006", "f007", "f008", "f009", "f010", "f011", "g001", "g002", "g003", "g004", "g005", "g006", "g007", "g008", "g009", "h001", "h002", "h003", "i001", "i003", "i004", "i005", "i006", "i020", "i021", "l011", "l013", "l014", "l015", "l017", "l018", "l019", "mnu3", "mnu4", "o001", "o002", "o003", "o004", "o005", "o006", "o008", "p001", "p002", "p003", "p004", "p005", "r001", "r003", "r004", "r005", "r020", "r021", "s001", "s002", "s003", "s004", "s005", "s006", "w020", "w021", "w022", "w023", "w025", "w026", "w027", "w028", "boot", "font" } local function infiniteiFrames() shared.consoleOut = shared.consoleOut .. "Infinite iFrames Enabled\n" WriteValue8(0x80234E29, 255) end local function giveFullHealth() WriteValue8(0x80234DCB, 5) end local function powerupMenu(input, menuVars, disable) -- buttom system was easy, but this, yeah... but it works! if menuVars.setup == nill then menuVars.setup = true menuVars.lastCommandFrame = 0 menuVars.lastCommand = "none" menuVars.selectionIndex = 1 menuVars.powerupstate = toBits(ReadValue8(0x8023509A),8) end if input.UP == 1 and ( menuVars.lastCommand ~= "UP" or (menuVars.lastCommand == "UP" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then menuVars.selectionIndex = menuVars.selectionIndex - 1 if menuVars.selectionIndex == 0 then menuVars.selectionIndex = 8 end menuVars.lastCommand = "UP" menuVars.lastCommandFrame = GetFrameCount() elseif input.DOWN == 1 and ( menuVars.lastCommand ~= "DOWN" or (menuVars.lastCommand == "DOWN" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then menuVars.selectionIndex = menuVars.selectionIndex + 1 if menuVars.selectionIndex == 9 then menuVars.selectionIndex = 1 end menuVars.lastCommand = "DOWN" menuVars.lastCommandFrame = GetFrameCount() elseif (input.LEFT == 1 or input.RIGHT == 1 ) and ( menuVars.lastCommand ~= "LR" or (menuVars.lastCommand == "LR" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then if menuVars.powerupstate[menuVars.selectionIndex] == 1 then menuVars.powerupstate[menuVars.selectionIndex] = 0 else menuVars.powerupstate[menuVars.selectionIndex] = 1 end menuVars.lastCommand = "LR" menuVars.lastCommandFrame = GetFrameCount() elseif input.A == 1 and ( menuVars.lastCommand ~= "A" or (menuVars.lastCommand == "A" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then tmp = "" for i=1,8 do tmp = tmp .. tostring(menuVars.powerupstate[i]) end WriteValue8(0x8023509A,tonumber(tmp,2)) disable() menuVars.lastCommand = "A" menuVars.lastCommandFrame = GetFrameCount() elseif input.B == 1 and ( menuVars.lastCommand ~= "B" or (menuVars.lastCommand == "B" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then disable() menuVars.lastCommand = "B" menuVars.lastCommandFrame = GetFrameCount() end -- i hate the below, i really do if menuVars.selectionIndex == 1 then shared.consoleOut = shared.consoleOut .. string.format(">unknown: %s\nsuper smash: %s\nshovel: %s\numbrella: %s\nhelmet: %s\nsmash: %s\ndouble jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 2 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\n>super smash: %s\nshovel: %s\numbrella: %s\nhelmet: %s\nsmash: %s\ndouble jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 3 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\nsuper smash: %s\n>shovel: %s\numbrella: %s\nhelmet: %s\nsmash: %s\ndouble jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 4 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\nsuper smash: %s\nshovel: %s\n>umbrella: %s\nhelmet: %s\nsmash: %s\ndouble jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 5 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\nsuper smash: %s\nshovel: %s\numbrella: %s\n>helmet: %s\nsmash: %s\ndouble jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 6 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\nsuper smash: %s\nshovel: %s\numbrella: %s\nhelmet: %s\n>smash: %s\ndouble jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 7 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\nsuper smash: %s\nshovel: %s\numbrella: %s\nhelmet: %s\nsmash: %s\n>double jump: %s\nunknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) elseif menuVars.selectionIndex == 8 then shared.consoleOut = shared.consoleOut .. string.format("unknown: %s\nsuper smash: %s\nshovel: %s\numbrella: %s\nhelmet: %s\nsmash: %s\ndouble jump: %s\n>unknown: %s",tostring(menuVars.powerupstate[1]), tostring(menuVars.powerupstate[2]), tostring(menuVars.powerupstate[3]), tostring(menuVars.powerupstate[4]) ,tostring(menuVars.powerupstate[5]) ,tostring(menuVars.powerupstate[6]), tostring(menuVars.powerupstate[7]), tostring(menuVars.powerupstate[8])) end return menuVars end local function hipSelectMenu(input, menuVars, disable) if menuVars.setup == nill then menuVars.setup = true menuVars.lastCommandFrame = 0 menuVars.lastCommand = "none" menuVars.mapIndex = lookupIndex(HipFiles, ReadValueString(0x80235650, 4)) end if input.UP == 1 and ( menuVars.lastCommand ~= "UP" or (menuVars.lastCommand == "UP" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then menuVars.mapIndex = menuVars.mapIndex + 1 if menuVars.mapIndex > 92 then menuVars.mapIndex = menuVars.mapIndex - 91 end menuVars.lastCommand = "UP" menuVars.lastCommandFrame = GetFrameCount() elseif input.DOWN == 1 and ( menuVars.lastCommand ~= "DOWN" or (menuVars.lastCommand == "DOWN" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then menuVars.mapIndex = menuVars.mapIndex - 1 if menuVars.mapIndex < 1 then menuVars.mapIndex = menuVars.mapIndex + 91 end menuVars.lastCommand = "DOWN" menuVars.lastCommandFrame = GetFrameCount() elseif input.LEFT == 1 and ( menuVars.lastCommand ~= "LEFT" or (menuVars.lastCommand == "LEFT" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then menuVars.mapIndex = menuVars.mapIndex - 10 if menuVars.mapIndex < 1 then menuVars.mapIndex = menuVars.mapIndex + 91 end menuVars.lastCommand = "LEFT" menuVars.lastCommandFrame = GetFrameCount() elseif input.RIGHT == 1 and ( menuVars.lastCommand ~= "RIGHT" or (menuVars.lastCommand == "RIGHT" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then menuVars.mapIndex = menuVars.mapIndex + 10 if menuVars.mapIndex > 92 then menuVars.mapIndex = menuVars.mapIndex - 91 end menuVars.lastCommand = "RIGHT" menuVars.lastCommandFrame = GetFrameCount() elseif (input.A == 1 or input.START == 1) and ( menuVars.lastCommand ~= "A" or (menuVars.lastCommand == "A" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then WriteValueString(0x80235650, HipFiles[menuVars.mapIndex]) disable() menuVars.lastCommand = "A" menuVars.lastCommandFrame = GetFrameCount() elseif input.B == 1 and ( menuVars.lastCommand ~= "B" or (menuVars.lastCommand == "B" and (GetFrameCount() - menuVars.lastCommandFrame) >= 7)) then disable() menuVars.lastCommand = "B" menuVars.lastCommandFrame = GetFrameCount() end shared.consoleOut = shared.consoleOut .. string.format("NG Map: %s (index: %s)\n", HipFiles[menuVars.mapIndex], tostring(menuVars.mapIndex)) end game.hipSelectMenu = hipSelectMenu game.powerupMenu = powerupMenu game.infiniteiFrames = infiniteiFrames game.giveFullHealth = giveFullHealth return game
--战场盛放之花 local m=14010035 local cm=_G["c"..m] function cm.initial_effect(c) --activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(cm.tg) e1:SetOperation(cm.op) c:RegisterEffect(e1) end function cm.filter(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.IsPlayerCanDraw(tp,1) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function cm.op(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if g:GetCount()>0 then if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then Duel.BreakEffect() Duel.Draw(tp,1,REASON_EFFECT) end end end
local pkg = "/cm/shared/apps/openblas/0.2.14" setenv( "BLASDIR", pathJoin(pkg,"lib")) prepend_path("LD_LIBRARY_PATH", pathJoin(pkg,"lib"))
local mod = get_mod("Squig-Pig") -- Your mod code goes here. -- https://vmf-docs.verminti.de Managers.package:load("units/weapons/player/wpn_empire_handgun_02_t2/wpn_empire_handgun_02_t2_3p", "global") local unit_path = "units/squig_herd/grn_squig_herd_01" local num_inv = #NetworkLookup.inventory_packages local num_husk = #NetworkLookup.husks NetworkLookup.inventory_packages[num_inv] = unit_path NetworkLookup.inventory_packages[unit_path] = num_inv NetworkLookup.husks[num_husk] = unit_path NetworkLookup.husks[unit_path] = num_husk mod:dofile("scripts/mods/Squig-Pig/breeds/breed_squig") mod:dofile("scripts/settings/breeds") mod:dofile("scripts/mods/Squig-Pig/settings/ai_inventory") -- mod:dofile("scripts/managers/performance/performance_manager") -- mod:dofile("scripts/managers/conflict_director/conflict_director") mod:dofile("scripts/mods/Squig-Pig/AI/bt_selector_squig") mod:dofile("scripts/mods/Squig-Pig/AI/squig_behavior") --mod:dofile("scripts/entity_systems/systems/behaviour/bt_minion") -- AISystem:create_all_trees() -- if true then -- for bt_name, bt_node in pairs(BreedBehaviors) do -- bt_node[1] = "BTSelector_" .. bt_name -- bt_node.name = bt_name .. "_GENERATED" -- end -- else -- for bt_name, bt_node in pairs(BreedBehaviors) do -- bt_node[1] = "BTSelector" -- bt_node.name = bt_name -- end -- end -- mod:hook(Unit, "animation_event", function(func, self, event) -- mod:echo(self) -- mod:echo(event) -- return func(self, event) -- end) local function create_lookups(lookup, hashtable) local i = #lookup for key, _ in pairs(hashtable) do i = i + 1 lookup[i] = key end return lookup end NetworkLookup.breeds = create_lookups({}, Breeds) Breeds.greenskin_squig.name = "critter_rat" Breeds.critter_rat["base_unit"] = unit_path Breeds.critter_rat["hit_zones"] = { neck = { prio = 1, actors = { "c_head" } }, torso = { prio = 2, actors = { "c_head" }, push_actors = { "head_0" } }, full = { prio = 3, actors = {} } } Breeds.critter_pig["base_unit"] = unit_path Breeds.critter_pig["hit_zones"] = { neck = { prio = 1, actors = { "c_head" } }, torso = { prio = 2, actors = { "c_head" }, push_actors = { "head_0" } }, full = { prio = 3, actors = {} } } -- Breeds.skaven_slave['default_inventory_template'] = {'squig'} -- Breeds.skaven_slave['opt_default_inventory_template'] = {'squig'} -- Breeds.skaven_slave["base_unit"] = unit_path -- Breeds.skaven_slave["hit_zones"] = { -- neck = { -- prio = 1, -- actors = { -- "c_head" -- } -- }, -- torso = { -- prio = 2, -- actors = { -- "c_head" -- }, -- push_actors = { -- "head_0" -- } -- }, -- full = { -- prio = 3, -- actors = {} -- } -- } local function replace_textures(unit) if Unit.has_data(unit, "mat_to_use") then local mat = Unit.get_data(unit, "mat_to_use") local mat_slots = {} local colors = {} local normals = {} local glosses = {} for i=1, 20, 1 do if Unit.has_data(unit, "mat_slots", "slot"..tostring(i)) then mat_slots[i] = Unit.get_data(unit, "mat_slots", "slot"..tostring(i)) end if Unit.has_data(unit, "colors", "slot"..tostring(i)) then colors[i] = Unit.get_data(unit, "colors", "slot"..tostring(i)) end if Unit.has_data(unit, "normals", "slot"..tostring(i)) then normals[i] = Unit.get_data(unit, "normals", "slot"..tostring(i)) end if Unit.has_data(unit, "glosses", "slot"..tostring(i)) then glosses[i] = Unit.get_data(unit, "glosses", "slot"..tostring(i)) end end local color_slot = Unit.get_data(unit, "color_slot") local norm_slot = Unit.get_data(unit, "norm_slot") local gloss_slot = Unit.get_data(unit, "gloss_slot") print(mat) print(color) print(color_slot) print(unit) local num_meshes = Unit.num_meshes(unit) for index, mat_slot in pairs(mat_slots) do Unit.set_material(unit, mat_slot, mat) for i = 0, num_meshes - 1, 1 do local mesh = Unit.mesh(unit, i) local num_mats = Mesh.num_materials(mesh) for j = 0, num_mats - 1, 1 do local mat = Mesh.material(mesh, j) Material.set_texture(mat, color_slot, colors[index]) Material.set_texture(mat, norm_slot, normals[index]) Material.set_texture(mat, gloss_slot, glosses[index]) end end end end end local function spawn_package_to_player (package_name) local player = Managers.player:local_player() local world = Managers.world:world("level_world") if world and player and player.player_unit then local player_unit = player.player_unit local position = Unit.local_position(player_unit, 0) + Vector3(0, 0, 1) local rotation = Unit.local_rotation(player_unit, 0) local unit = World.spawn_unit(world, package_name, position, rotation) mod:chat_broadcast(#NetworkLookup.inventory_packages + 1) return unit end return nil end mod:command("spawn_squig", "spawns the squig model without being linked to ai\nthis model can cause crashes", function() local unit = spawn_package_to_player("units/squig_herd/grn_squig_herd_01") replace_textures(unit) end) mod:hook(UnitSpawner, 'create_unit_extensions', function (func, self, world, unit, unit_template_name, extension_init_data) replace_textures(unit) return func(self, world, unit, unit_template_name, extension_init_data) end) -- mod:hook(Unit, "animation_event", function( func, self, event) -- mod:echo(tostring(self)..tostring(event)) -- return func(self, event) -- end) mod:hook(Unit, 'node', function(func, self, node) if Unit.has_node(self, node) then return func(self, node) end local new_node = Unit.get_data(self, 'node_replace') return func(self, new_node) end) --prevents crash from billhook stagger local unit_node = Unit.node local unit_world_position = Unit.world_position ActionSweep.check_precision_target = function (self, owner_unit, owner_player, dedicated_target_range, check_distance, weapon_furthest_point) local current_target = self._precision_target_unit if not AiUtils.unit_alive(current_target) then return nil end local first_person_extension = ScriptUnit.extension(owner_unit, "first_person_system") first_person_extension:disable_rig_movement() local pos = first_person_extension:current_position() local rot = first_person_extension:current_rotation() local direction = Quaternion.forward(rot) local node = "j_spine" --crash is caused by node being hard coded to j_spine if not Unit.has_node(current_target, node) then node = Unit.get_data(current_target, 'node_replace') end local target_position = unit_world_position(current_target, unit_node(current_target, node)) local good_target = false local player_to_target_vector = target_position - pos local player_to_target_distance = Vector3.length(player_to_target_vector) local player_to_target_unit_dir = Vector3.normalize(player_to_target_vector) local dot = Vector3.dot(player_to_target_unit_dir, direction) local target_health_extension = ScriptUnit.extension(current_target, "health_system") if dot < 0.9 or dedicated_target_range < player_to_target_distance then good_target = false elseif target_health_extension:is_alive() then good_target = true end return (good_target and current_target) or nil end --this enables the breed with creature spawner settings local spawn_mod = get_mod("CreatureSpawner") local add_spawn_catagory = { greenskin_squig = { "misc", } } table.merge(spawn_mod.unit_categories, table) breed_name = 'greenskin_squig' table.insert(spawn_mod["all_units"], breed_name)
--[[ Copyright 2021 Bilal2453. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] --[[lit-meta name = "bilal2453/discordia-replies" version = "1.2.2" homepage = "https://github.com/bilal2453/discordia-replies/" description = "An addon for the library Discordia 2 to provide replies support." tags = {"discordia", "replies", "bots", "discord"} license = "Apache License 2.0" ]] local readFileSync = require("fs").readFileSync local splitPath = require("pathjoin").splitPath local configs = {} local discordia -- lazy required/provided by user local function assertType(value, types, arg, name) value = type(value) == "table" and value.__name or type(value) name = name or '?' arg = arg or '?' local match for type in types:gmatch('(%w+)|?') do if type == value then match = true end end if not match then error(("bad argument #%s to '%s' (%s expected, got %s)"):format(arg, name, types, value)) end end -- The following code have been copied from the original Discordia source code, and slightly modified, -- aiming to replucate the same exact behavoir of the original send method, while supporting additional features, -- without having to patch the original source code to do so. -- All rights reserved for SinisterRectus and the contributers of SinisterRectus/discordia under the MIT license. -- This do include changes made by the author of this module! --[[ Start of Discordia copied code ]] -- libs/containers/abstract/TextChannel.lua -- local function parseFile(obj, files) if type(obj) == "string" then local data, err = readFileSync(obj) if not data then return nil, err end files = files or {} table.insert(files, {table.remove(splitPath(obj)), data}) elseif type(obj) == "table" and type(obj[1]) == "string" and type(obj[2]) == "string" then files = files or {} table.insert(files, obj) else return nil, "Invalid file object: " .. tostring(obj) end return files end local function parseMention(obj, mentions) if type(obj) == "table" and obj.mentionString then mentions = mentions or {} table.insert(mentions, obj.mentionString) else return nil, "Unmentionable object: " .. tostring(obj) end return mentions end local function send(self, content) local data, err if type(content) == "table" then local tbl = content content = tbl.content if type(tbl.code) == "string" then content = string.format("```%s\n%s\n```", tbl.code, content) elseif tbl.code == true then content = string.format("```\n%s\n```", content) end local mentions if tbl.mention then mentions, err = parseMention(tbl.mention) if err then return nil, err end end if type(tbl.mentions) == "table" then for _, mention in ipairs(tbl.mentions) do mentions, err = parseMention(mention, mentions) if err then return nil, err end end end if mentions then table.insert(mentions, content) content = table.concat(mentions, ' ') end local files if tbl.file then files, err = parseFile(tbl.file) if err then return nil, err end end if type(tbl.files) == "table" then for _, file in ipairs(tbl.files) do files, err = parseFile(file, files) if err then return nil, err end end end data, err = self.client._api:createMessage(self._id, { content = content, tts = tbl.tts, nonce = tbl.nonce, embed = tbl.embed, allowed_mentions = tbl.allowedMentions, message_reference = tbl.messageReference, }, files) else data, err = self.client._api:createMessage(self._id, {content = content}) end if data then return self._messages:_insert(data) else return nil, err end end -- libs/containers/Message.lua -- local function parseMentions(content, pattern) if not content:find('%b<>') then return end local mentions, seen = {}, {} for id in content:gmatch(pattern) do if not seen[id] then table.insert(mentions, id) seen[id] = true end end return mentions end local function loadMore(self, data) if data.mentions then for _, user in ipairs(data.mentions) do if user.member then user.member.user = user self._parent._parent._members:_insert(user.member) else self.client._users:_insert(user) end end end local content = data.content if content then if self._mentioned_users then self._mentioned_users._array = parseMentions(content, '<@!?(%d+)>') end if self._mentioned_roles then self._mentioned_roles._array = parseMentions(content, '<@&(%d+)>') end if self._mentioned_channels then self._mentioned_channels._array = parseMentions(content, '<#(%d+)>') end if self._mentioned_emojis then self._mentioned_emojis._array = parseMentions(content, '<a?:[%w_]+:(%d+)>') end self._clean_content = nil end if data.embeds then self._embeds = #data.embeds > 0 and data.embeds or nil end if data.attachments then self._attachments = #data.attachments > 0 and data.attachments or nil end if data.message_reference then self._message_reference = data.message_reference end if data.referenced_message and next(data.referenced_message) then self._referenced_message = self._parent._messages:_insert(data.referenced_message) end end --[[ End of copied code ]] local function reply(msg, content) assertType(msg, "Message", 1, "reply") assertType(content, "string|table", 2, "reply") -- Setting content if type(content) ~= "table" then content = {content = tostring(content)} end -- Setting allowed_mentions -- Discord treats mentions by content if no allowed_mention is passed, therefor no need to pass it when true if configs.replyMention == false and not content.allowedMentions then content.allowedMentions = { replied_user = false } end -- Setting message_reference content.messageReference = not content.messageReference and { message_id = msg.id, fail_if_not_exists = configs.failIfNotExists, } return send(msg.channel, content) end local function repliesTo(msg) if msg._repliesTo then return msg._repliesTo end -- is it cached already? if not msg._message_reference then return end -- any chance it's a reply? if not (msg.content or msg.attachment or msg.embeds) then return end -- is it really a reply message? -- Messages of type 21 also do have message_reference, can't check that since we are on API v7 local client = msg.client local struct = {client = client} msg._repliesTo = struct -- Do we already have everything we need provided? local refMsg = msg._referenced_message if refMsg then struct.message = msg._referenced_message struct.channel = refMsg.channel struct.guild = refMsg.guild return struct end local ref = msg._message_reference local messageId, channelId = ref.message_id, ref.channel_id -- Get the Guild and TextChannel objects local guild, channel = client._channel_map[channelId] if guild then channel = guild._text_channels:get(channelId) else channel = client._private_channels:get(channelId) or client._group_channels:get(channelId) end struct.channel = channel struct.guild = guild if not channel then return struct end -- Not sure if possible but just in case -- Get the Message object struct.message = channel._messages:get(messageId) -- Try to fetch it from cache first if not struct.message and configs.fetchMessage then -- Not cached, fetch it from the API local data = client._api:getChannelMessage(channel._id, messageId) if data then struct.message = channel._messages:_insert(data) end end return struct end local function init(_, options) assertType(options, "table|nil", 1) -- is `options` the actual options table or is it the Discordia module? -- This is only here because I was (and probably still) dumb, it'd break backward compatibilty (ish) if removed if options then configs = options if (options.package or {}).name == "SinisterRectus/discordia" then discordia = options configs = {discordia = options} elseif options.discordia and (options.discordia.package or {}).name == "SinisterRectus/discordia" then discordia = options.discordia end end discordia = discordia or assert(require("discordia"), "This module requires Discordia to be installed!") local classes = discordia.class.classes -- Patch reply method in if configs.replaceOriginal then classes.Message.reply = reply else classes.Message[configs.replyIndex or "newReply"] = reply end -- Patch send method in, not recommended therefor disabled by default if configs.patchSend then local patchChannels = {"TextChannel", "GuildTextChannel", "PrivateChannel", "GroupChannel"} for i=1, #patchChannels do classes[patchChannels[i]][configs.sendIndex or "send"] = send end end -- Provide Message.repliesTo getter if configs.patchGetters or configs.patchGetters == nil then classes.Message._loadMore = loadMore -- needed to load _message_reference in classes.Message.__getters.repliesTo = repliesTo end -- Defaulting options configs.failIfNotExists = configs.failIfNotExists == false and false or nil -- Saving on payload size -- Returns the patched Discordia module, for convenience return discordia end return setmetatable({ send = send, reply = reply, module = "Bilal2453/discordia-replies", version = '1.2.2', }, { __call = init })
return { transportFever2Path = '/cygdrive/d/Spiele/steamapps/common/Transport Fever 2/res/scripts' }
project "GoogleTest" kind "StaticLib" language "C++" systemversion "latest" targetdir "../../Bin/%{cfg.buildcfg}" --CB: using the unity build file files { "include/gtest/**.h", "scr/**.h", "src/gtest-all.cc" } includedirs { "include", "." } configuration "macosx" linkoptions { "-std=c++17", "-stdlib=libc++" } buildoptions { "-std=c++17", "-stdlib=libc++" } configuration "windows" defines { "GTEST_HAS_PTHREAD=0" }
local assert = require('luassert') local lfs = require('lfs') local check_logs_useless_lines = { ['Warning: noted but unhandled ioctl']=1, ['could cause spurious value errors to appear']=2, ['See README_MISSING_SYSCALL_OR_IOCTL for guidance']=3, } local eq = function(exp, act) return assert.are.same(exp, act) end local neq = function(exp, act) return assert.are_not.same(exp, act) end local ok = function(res) return assert.is_true(res) end local function check_logs() local log_dir = os.getenv('LOG_DIR') local runtime_errors = 0 if log_dir and lfs.attributes(log_dir, 'mode') == 'directory' then for tail in lfs.dir(log_dir) do if tail:sub(1, 30) == 'valgrind-' or tail:find('san%.') then local file = log_dir .. '/' .. tail local fd = io.open(file) local start_msg = ('='):rep(20) .. ' File ' .. file .. ' ' .. ('='):rep(20) local lines = {} local warning_line = 0 for line in fd:lines() do local cur_warning_line = check_logs_useless_lines[line] if cur_warning_line == warning_line + 1 then warning_line = cur_warning_line else lines[#lines + 1] = line end end fd:close() os.remove(file) if #lines > 0 then -- local out = os.getenv('TRAVIS_CI_BUILD') and io.stdout or io.stderr local out = io.stdout out:write(start_msg .. '\n') out:write('= ' .. table.concat(lines, '\n= ') .. '\n') out:write(select(1, start_msg:gsub('.', '=')) .. '\n') runtime_errors = runtime_errors + 1 end end end end assert(0 == runtime_errors) end -- Tries to get platform name from $SYSTEM_NAME, uname; fallback is "Windows". local uname = (function() local platform = nil return (function() if platform then return platform end platform = os.getenv("SYSTEM_NAME") if platform then return platform end local status, f = pcall(io.popen, "uname -s") if status then platform = f:read("*l") else platform = 'Windows' end return platform end) end)() local function tmpname() local fname = os.tmpname() if uname() == 'Windows' and fname:sub(1, 2) == '\\s' then -- In Windows tmpname() returns a filename starting with -- special sequence \s, prepend $TEMP path local tmpdir = os.getenv('TEMP') return tmpdir..fname elseif fname:match('^/tmp') and uname() == 'Darwin' then -- In OS X /tmp links to /private/tmp return '/private'..fname else return fname end end return { eq = eq, neq = neq, ok = ok, check_logs = check_logs, uname = uname, tmpname = tmpname, }
local t = require( "taptest" ) local trunc = require( "trunc" ) t( trunc( 1.2 ), 1 ) t( trunc( 1.7 ), 1 ) t( trunc( -2.2 ), -2 ) t( trunc( -2.7 ), -2 ) t()
object_tangible_item_som_frn_holo_mustafarian_a_reward = object_tangible_item_som_shared_frn_holo_mustafarian_a_reward:new { } ObjectTemplates:addTemplate(object_tangible_item_som_frn_holo_mustafarian_a_reward, "object/tangible/item/som/frn_holo_mustafarian_a_reward.iff")
local o = vim.opt local a = 4 -- Indent o.smartindent = true -- I prefer tabs over spaces o.expandtab = false o.tabstop = a o.shiftwidth = a -- Clipboard o.clipboard = "unnamedplus" -- Mouse o.mouse = "a" -- Undo o.undofile = true -- Search o.ignorecase = true o.smartcase = true o.incsearch = true -- Filetypes vim.g.did_load_filetypes = 0 vim.g.do_filetype_lua = 1 vim.g.python_host_prog = "/usr/bin/python" vim.g.python3_host_prog = "/usr/bin/python3" -- o.foldmethod = "expr" -- use treesitter for folding -- o.foldexpr = "nvim_treesitter#foldexpr()" -- Others o.formatoptions:remove { "c", "r", "o" } o.compatible = false o.so = 5 o.swapfile = false o.shadafile = "NONE" o.history = 10000 o.timeoutlen = 500 o.updatetime = 200 -- o.runtimepath = "$XDG_CONFIG_HOME/nvim,$VIMRUNTIME,$XDG_CONFIG_HOME/nvim/after,$XDG_CONFIG_HOME/nvim/spell,$XDG_CONFIG_HOME/nvim/lua"
vim.cmd 'let g:ranger_map_keys = 0' vim.cmd 'let g:gitgutter_map_keys = 0' -- vim.g.tokyonight_style = "night" -- vim.cmd 'hi VertSplit guifg=DarkGrey' -- vim.cmd 'hi BufTabLineActive guibg=bg' -- vim.cmd 'hi lspReference ctermfg=red guifg=red ctermbg=green guibg=green' vim.cmd 'let vim_markdown_preview_pandoc=1' vim.cmd 'let vim_markdown_preview_browser="Firefox"' vim.cmd 'hi VimwikiHeader1 guifg=black guibg=yellow' vim.cmd 'hi VimwikiHeader2 guifg=black guibg=lightgrren' vim.cmd 'hi VimwikiHeader3 guifg=black guibg=lightgrey' vim.cmd 'hi VimwikiHeader4 guifg=black guibg=red' vim.cmd 'hi VimwikiHeader5 guifg=black guibg=blue' vim.cmd 'hi VimwikiHeader6 guifg=black guibg=pink' vim.cmd 'hi markdownH1 guifg=black guibg=pink' vim.cmd 'hi markdownH2 guifg=black guibg=pink' vim.cmd 'autocmd FileType markdown highlight htmlH1 cterm=none ctermfg=70' -- nvim-tree lag on save, turn off git vim.g.nvim_tree_git_hl = 0 -- highlights({ -- htmlH1 = { fg=DarkGrey }, -- mkdHeading = { bg=fg } -- }) vim.cmd 'let g:NERDCreateDefaultMappings = 0' vim.cmd 'hi HopNextKey guifg=red' vim.cmd 'hi HopNextKey1 guifg=red' vim.cmd 'hi HopNextKey2 guifg=red' vim.api.nvim_exec( [[ command! CloseHiddenBuffers call CloseHiddenBuffers() function! CloseHiddenBuffers() let open_buffers = [] for i in range(tabpagenr('$')) call extend(open_buffers, tabpagebuflist(i + 1)) endfor for num in range(1, bufnr("$") + 1) if buflisted(num) && index(open_buffers, num) == -1 exec "bdelete ".num endif endfor endfunction ]], true)
--Override any of these values by using `MyDataStore:SetGlobals(globals)` return { -- Datastore identity TITLE = "global"; VERSION = 0; -- Intervals / tries AUTOSAVE_INTERVAL = 10 * 60; -- Minutes TIMEOUT = 60; -- Seconds before kicking for no data RETRIES_BEFORE_KICK = 3; SAVE_ATTEMPTS = 20; -- Messages ERROR_MESSAGE = "Sorry! There was a problem loading your data. Please rejoin!"; BLACKLIST_MESSAGE = "You are blacklisted from this game!"; -- Flags ROLLBACK_CHECKS = false; AUTO_LOAD = true; CAN_KICK = true; KICK_IN_STUDIO = true; SAVE_IN_STUDIO = true; DEBUG = false; }
local BattleCutscene, super = Class(Cutscene) local function _true() return true end function BattleCutscene:init(group, id, ...) local scene, args = self:parseFromGetter(Registry.getBattleCutscene, group, id, ...) self.move_targets = {} self.waiting_for_text = nil self.waiting_for_enemy_text = nil self.last_battle_state = Game.battle.state Game.battle:setState("CUTSCENE") super:init(self, scene, unpack(args)) end function BattleCutscene:update(dt) if self.ended then return end local done_moving = {} for battler,target in pairs(self.move_targets) do if battler.x == target[1] and battler.y == target[2] then table.insert(done_moving, battler) end local tx = Utils.approach(battler.x, target[1], target[3] * DTMULT) local ty = Utils.approach(battler.y, target[2], target[3] * DTMULT) battler:setPosition(tx, ty) end for _,v in ipairs(done_moving) do self.move_targets[v] = nil end super:update(self, dt) end function BattleCutscene:onEnd() Game.battle.battle_ui.encounter_text:setActor(nil) Game.battle.battle_ui.encounter_text:setFace(nil) Game.battle.battle_ui.encounter_text.can_advance = false Game.battle.battle_ui.encounter_text.auto_advance = false for _,battler in ipairs(Game.battle.party) do battler:toggleOverlay(false) end for _,battler in ipairs(Game.battle.enemies) do battler:toggleOverlay(false) end if self.finished_callback then self.finished_callback(self) else Game.battle:setState(self.last_battle_state, "CUTSCENE") end end function BattleCutscene:getCharacter(id) for _,battler in ipairs(Game.battle.party) do if battler.chara.id == id then return battler end end for _,battler in ipairs(Game.battle.enemies) do if battler.id == id then return battler end end end function BattleCutscene:getEnemies(id) local result = {} for _,battler in ipairs(Game.battle.enemies) do if battler.id == id then table.insert(result, battler) end end return result end function BattleCutscene:getUser() return Game.battle.party[Game.battle:getCurrentAction().character_id] end function BattleCutscene:getTarget() return Game.battle:getCurrentAction().target end function BattleCutscene:resetSprites() for _,battler in ipairs(Game.battle.party) do battler:toggleOverlay(false) end for _,battler in ipairs(Game.battle.enemies) do battler:toggleOverlay(false) end end function BattleCutscene:setSprite(chara, sprite, speed) if type(chara) == "string" then chara = self:getCharacter(chara) end chara:toggleOverlay(true) chara.overlay_sprite:setSprite(sprite) if speed then chara.overlay_sprite:play(speed, true) end end function BattleCutscene:setAnimation(chara, anim) if type(chara) == "string" then chara = self:getCharacter(chara) end local done = false chara:toggleOverlay(true) chara.overlay_sprite:setAnimation(anim, function() done = true end) return function() return done end end function BattleCutscene:moveTo(chara, x, y, speed) if type(chara) == "string" then chara = self:getCharacter(chara) end if chara.x ~= x or chara.y ~= y then self.move_targets[chara] = {x, y, speed or 4} return function() return self.move_targets[chara] == nil end end return _true end function BattleCutscene:shakeCharacter(chara, x, y) if type(chara) == "string" then chara = self:getCharacter(chara) end chara.sprite:shake(x, y) chara.overlay_sprite:shake(x, y) return function() return chara.sprite.shake_x == 0 and chara.sprite.shake_y == 0 end end local function cameraShakeCheck() return Game.battle.shake == 0 end function BattleCutscene:shakeCamera(shake) Game.battle.shake = shake return cameraShakeCheck end function BattleCutscene:setSpeaker(actor) if isClass(actor) and (actor:includes(PartyBattler) or actor:includes(EnemyBattler)) then actor = actor.actor end self.textbox_actor = actor end local function waitForEncounterText() return Game.battle.battle_ui.encounter_text:getText() == "" end function BattleCutscene:text(text, portrait, actor, options) if type(actor) == "table" then options = actor actor = nil end if type(portrait) == "table" then options = portrait portrait = nil end options = options or {} actor = actor or self.textbox_actor Game.battle.battle_ui.encounter_text:setActor(actor) Game.battle.battle_ui.encounter_text:setFace(portrait, options["x"], options["y"]) Game.battle.battle_ui.encounter_text:resetSmallFaces() if options["faces"] then for _,face in ipairs(options["faces"]) do Game.battle.battle_ui.encounter_text:addSmallFace(face[1], face[2], face[3], face[4], face[5]) end end Game.battle.battle_ui.encounter_text:setText(text) Game.battle.battle_ui.encounter_text.can_advance = options["advance"] or options["advance"] == nil Game.battle.battle_ui.encounter_text.auto_advance = options["auto"] or false local wait = options["wait"] or options["wait"] == nil if not Game.battle.battle_ui.encounter_text.can_advance then wait = options["wait"] -- By default, don't wait if the textbox can't advance end if wait then self.waiting_for_text = Game.battle.battle_ui.encounter_text return self:pause() else return waitForEncounterText end end function BattleCutscene:enemyText(enemies, text, options) options = options or {} if type(enemies) == "string" then enemies = {} for _,battler in ipairs(Game.party.enemies) do table.insert(enemies, battler) end elseif isClass(enemies) then enemies = {enemies} end local wait = options["wait"] or options["wait"] == nil local textboxes = {} for _,enemy in ipairs(enemies) do local textbox if not options["x"] and not options["y"] then textbox = Game.battle:spawnEnemyTextbox(enemy, text, options["right"]) else textbox = EnemyTextbox(text, options["x"] or 0, options["y"] or 0, enemy, options["right"]) Game.battle:addChild(textbox) end textbox.can_advance = options["advance"] or options["advance"] == nil textbox.auto_advance = options["auto"] or false if not textbox.can_advance then wait = options["wait"] end table.insert(textboxes, textbox) end if wait then self.waiting_for_enemy_text = textboxes return self:pause() else return function() for _,textbox in ipairs(textboxes) do if not textbox.done then return false end end return true end, textboxes end end return BattleCutscene
-- Created by Elfansoer --[[ Ability checklist (erase if done/checked): - Scepter Upgrade - Break behavior - Linken/Reflect behavior - Spell Immune/Invulnerable/Invisible behavior - Illusion behavior - Stolen behavior ]] -------------------------------------------------------------------------------- modifier_naga_siren_rip_tide_lua = class({}) -------------------------------------------------------------------------------- -- Classifications function modifier_naga_siren_rip_tide_lua:IsHidden() return true end function modifier_naga_siren_rip_tide_lua:IsDebuff() return false end function modifier_naga_siren_rip_tide_lua:IsPurgable() return false end -------------------------------------------------------------------------------- -- Initializations function modifier_naga_siren_rip_tide_lua:OnCreated( kv ) self.parent = self:GetParent() self.caster = self:GetCaster() -- references self.chance = self:GetAbility():GetSpecialValueFor( "chance" ) self.radius = self:GetAbility():GetSpecialValueFor( "radius" ) self.duration = self:GetAbility():GetSpecialValueFor( "duration" ) local damage = self:GetAbility():GetSpecialValueFor( "damage" ) if not IsServer() then return end -- ability properties self.abilityDamageType = self:GetAbility():GetAbilityDamageType() self.abilityTargetTeam = self:GetAbility():GetAbilityTargetTeam() self.abilityTargetType = self:GetAbility():GetAbilityTargetType() self.abilityTargetFlags = self:GetAbility():GetAbilityTargetFlags() -- precache damage self.damageTable = { -- victim = target, attacker = self.parent, damage = damage, damage_type = self.abilityDamageType, ability = self:GetAbility(), --Optional. } -- ApplyDamage(damageTable) end function modifier_naga_siren_rip_tide_lua:OnRefresh( kv ) self:OnCreated( kv ) end function modifier_naga_siren_rip_tide_lua:OnRemoved() end function modifier_naga_siren_rip_tide_lua:OnDestroy() end -------------------------------------------------------------------------------- -- Modifier Effects function modifier_naga_siren_rip_tide_lua:DeclareFunctions() local funcs = { MODIFIER_PROPERTY_PROCATTACK_FEEDBACK, } return funcs end function modifier_naga_siren_rip_tide_lua:GetModifierProcAttack_Feedback( params ) if not IsServer() then return end -- cancel if break if self.parent:PassivesDisabled() then return end -- roll chance local rand = RandomInt( 0,100 ) if rand>=self.chance then return end -- find enemies local enemies = FindUnitsInRadius( self.caster:GetTeamNumber(), -- int, your team number self.parent:GetOrigin(), -- point, center point nil, -- handle, cacheUnit. (not known) self.radius, -- float, radius. or use FIND_UNITS_EVERYWHERE DOTA_UNIT_TARGET_TEAM_ENEMY, -- int, team filter DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, -- int, type filter 0, -- int, flag filter 0, -- int, order filter false -- bool, can grow cache ) for _,enemy in pairs(enemies) do -- apply debuff enemy:AddNewModifier( self.caster, -- player source self:GetAbility(), -- ability source "modifier_naga_siren_rip_tide_lua_debuff", -- modifier name { duration = self.duration } -- kv ) -- damage self.damageTable.victim = enemy ApplyDamage( self.damageTable ) end -- play effects self:PlayEffects() end -------------------------------------------------------------------------------- -- Graphics & Animations function modifier_naga_siren_rip_tide_lua:PlayEffects() -- Get Resources local particle_cast = "particles/units/heroes/hero_siren/naga_siren_riptide.vpcf" local sound_cast = "Hero_NagaSiren.Riptide.Cast" -- Create Particle local effect_cast = ParticleManager:CreateParticle( particle_cast, PATTACH_ABSORIGIN_FOLLOW, self.parent ) ParticleManager:SetParticleControl( effect_cast, 1, Vector( self.radius, self.radius, self.radius ) ) ParticleManager:SetParticleControl( effect_cast, 3, Vector( self.radius, self.radius, self.radius ) ) ParticleManager:ReleaseParticleIndex( effect_cast ) -- Create Sound EmitSoundOn( sound_cast, self.parent ) end
local eclipse = require "nvim-lsp-installer.core.clients.eclipse" ---@async ---@param receipt InstallReceipt return function(receipt) return eclipse.fetch_latest_jdtls_version():map_catching(function(latest_version) if receipt.primary_source.version ~= latest_version then return { name = "jdtls", current_version = receipt.primary_source.version, latest_version = latest_version, } end error "Primary package is not outdated." end) end
require("zen-mode").setup { window = { width = 121, height = 0.9, options = { signcolumn = "no", number = false, relativenumber = false }, }, plugins = { options = { enabled = true, showcmd = false }, gitsigns = { enabled = true }, tmux = { enabled = true }, }, on_open = function(win) vim.cmd [[SoftPencil]] end, on_close = function() vim.cmd [[PencilOff]] end, } local nnoremap = vim.keymap.nnoremap nnoremap { "<Leader>zz", function() vim.api.nvim_command [[ZenMode]] end, }
local __exports = LibStub:NewLibrary("ovale/simulationcraft/unparser", 80300) if not __exports then return end local __class = LibStub:GetLibrary("tslib").newClass local __definitions = LibStub:GetLibrary("ovale/simulationcraft/definitions") local UNARY_OPERATOR = __definitions.UNARY_OPERATOR local BINARY_OPERATOR = __definitions.BINARY_OPERATOR local tostring = tostring local pairs = pairs local tonumber = tonumber local kpairs = pairs local __texttools = LibStub:GetLibrary("ovale/simulationcraft/text-tools") local self_outputPool = __texttools.self_outputPool local concat = table.concat local function GetPrecedence(node) if node.type ~= "operator" then return 0 end local precedence = node.precedence if not precedence then local operator = node.operator if operator then if node.expressionType == "unary" and UNARY_OPERATOR[operator] then precedence = UNARY_OPERATOR[operator][2] elseif node.expressionType == "binary" and BINARY_OPERATOR[operator] then precedence = BINARY_OPERATOR[operator][2] end end end return precedence end __exports.Unparser = __class(nil, { constructor = function(self, ovaleDebug) self.UnparseAction = function(node) local output = self_outputPool:Get() output[#output + 1] = node.name for modifier, expressionNode in kpairs(node.modifiers) do output[#output + 1] = modifier .. "=" .. self:Unparse(expressionNode) end local s = concat(output, ",") self_outputPool:Release(output) return s end self.UnparseActionList = function(node) local output = self_outputPool:Get() local listName if node.name == "_default" then listName = "action" else listName = "action." .. node.name end output[#output + 1] = "" for i, actionNode in pairs(node.child) do local operator = (tonumber(i) == 1 and "=") or "+=/" output[#output + 1] = listName .. operator .. self:Unparse(actionNode) end local s = concat(output, "\n") self_outputPool:Release(output) return s end self.UnparseExpression = function(node) local expression local precedence = GetPrecedence(node) if node.expressionType == "unary" then local rhsExpression local rhsNode = node.child[1] local rhsPrecedence = GetPrecedence(rhsNode) if rhsPrecedence and precedence >= rhsPrecedence then rhsExpression = "(" .. self:Unparse(rhsNode) .. ")" else rhsExpression = self:Unparse(rhsNode) end expression = node.operator .. rhsExpression elseif node.expressionType == "binary" then local lhsExpression, rhsExpression local lhsNode = node.child[1] local lhsPrecedence = GetPrecedence(lhsNode) if lhsPrecedence and lhsPrecedence < precedence then lhsExpression = "(" .. self:Unparse(lhsNode) .. ")" else lhsExpression = self:Unparse(lhsNode) end local rhsNode = node.child[2] local rhsPrecedence = GetPrecedence(rhsNode) if rhsPrecedence and precedence > rhsPrecedence then rhsExpression = "(" .. self:Unparse(rhsNode) .. ")" elseif rhsPrecedence and precedence == rhsPrecedence then if rhsNode.type == "operator" and BINARY_OPERATOR[node.operator][3] == "associative" and node.operator == rhsNode.operator then rhsExpression = self:Unparse(rhsNode) else rhsExpression = "(" .. self:Unparse(rhsNode) .. ")" end else rhsExpression = self:Unparse(rhsNode) end expression = lhsExpression .. node.operator .. rhsExpression else return "Unknown node expression type" end return expression end self.UnparseFunction = function(node) return node.name .. "(" .. self:Unparse(node.child[1]) .. ")" end self.UnparseNumber = function(node) return tostring(node.value) end self.UnparseOperand = function(node) return node.name end self.UNPARSE_VISITOR = { ["action"] = self.UnparseAction, ["action_list"] = self.UnparseActionList, ["operator"] = self.UnparseExpression, ["function"] = self.UnparseFunction, ["number"] = self.UnparseNumber, ["operand"] = self.UnparseOperand } self.tracer = ovaleDebug:create("SimulationCraftUnparser") end, Unparse = function(self, node) local visitor = self.UNPARSE_VISITOR[node.type] if not visitor then self.tracer:Error("Unable to unparse node of type '%s'.", node.type) else return visitor(node) end end, })
require "lmk" require "lmkutil" require "lmkbase" local assert = assert local error = error local io = io local ipairs = ipairs local lmk = lmk local lmkbase = lmkbase local lmkutil = lmkutil local os = os local print = print local tostring = tostring local type = type module (...) add_files = lmk.add_files_local append_global = lmk.append_global append_local = lmk.append_local get_var = lmk.get_var resolve = lmk.resolve set_local = lmk.set_local set_global = lmk.set_global system = lmk.system is_dir = lmkbase.is_dir directories = lmkbase.directories files = lmkbase.files function print_success (msg) lmk.console_green () print (msg) lmk.console_default () end function print_fail (msg) lmk.console_red () print (msg) lmk.console_default () end function verbose () return lmk.IsVerbose end local buildPart1 = nil local buildPart2 = nil function get_build_number () if not buildPart1 or not buildPart2 then buildPart1 = os.date ("!%y%m%d") buildPart2 = os.date ("!%H%M%S") end return tostring (buildPart1) .. "-" .. tostring (buildPart2), tostring (buildPart1), tostring (buildPart2) end function append_table (target, add) if type (target) ~= "table" then error ("Expect table but was given: " .. type (target)) end local size = #target if type (add) ~= "table" then target[size + 1] = add else for ix = 1, #add do target[size + ix] = add[ix] end end end function set_persist (name, value) set_global (name, value, true) end function rm (path) path = lmkutil.clean_path (lmk.resolve (path)) local result, msg = true, nil if lmkbase.is_valid (path) then print ("Removing: " .. path) result, msg = lmkutil.raw_rm (path) end return result, msg end function mkdir (path) path = lmkutil.clean_path (lmk.resolve (path)) local result, msg = true, nil assert (path ~= "", "Path not defined for lmkbuild.mkdir") if path then result, msg = lmkutil.raw_mkdir (path) end return result, msg end function split (path) path = lmkutil.clean_path (lmk.resolve (path)) local file, ext = nil, nil if path then path, file, ext = lmkutil.raw_split (path) end return path, file, ext end function split_path_and_file (path) local file, ext = nil, nil path, file, ext = split (path) if ext and file then file = file .. "." .. ext end return path, file end function abs_path (path) return lmkutil.raw_abs_path (lmk.resolve (path)) end local function copy_file (src, target) local result = false local inp = io.open (src, "rb") local out = io.open (target, "wb") if inp and out then local data = inp:read ("*all") out:write (data) io.close (inp) io.close (out) result = true end return result end function cp (fileList, target) local result = true target = lmkutil.clean_path (lmk.resolve (target)) if type (fileList) ~= "table" then fileList = { fileList } end if lmkbase.is_dir (target) then for index, file in ipairs (fileList) do file = lmkutil.clean_path (lmk.resolve (file)) if lmkbase.is_valid (file) then local path = nil path, fileName = split_path_and_file (file) if not copy_file (file, target .. "/" .. fileName) then result = false end end end else if #fileList == 1 then local file = lmk.resolve (fileList[1]) if (lmkbase.is_valid (file)) then result = copy_file (file, target) else result = false; end else result = false msg = "Unable to copy multiple files to single file" end end return result end function is_valid (path) return lmkbase.is_valid (lmk.resolve (path)) end function file_newer (src, target) local result, msg = false, nil target = lmkutil.clean_path (lmk.resolve (target)) if lmkbase.is_valid (target) then if type (src) ~= "table" then src = { src } end for index, file in ipairs (src) do file = lmkutil.clean_path (lmk.resolve (file)) if lmkbase.is_valid (file) then result = lmkbase.file_newer (file, target) if result then break end else result = true print ("Warning: source file: " .. file .. " does not exist for target file: " .. target) break end end else result = true end return result, msg end function exec (list) if type (list) ~= "table" then list = { list } end for index, item in ipairs (list) do local todo = resolve (item) assert (todo and todo ~= "", "Empty exec string from: " .. item) if lmk.IsVerbose then print (todo) local result = os.execute (todo) assert (result == 0, "Build failed in " .. lmkbase.pwd ()) else local result = os.execute (todo) if result ~= 0 then print (todo) error ("Build failed in " .. lmkbase.pwd ()) end end end end function find_file (item, paths) local file = lmk.resolve (item) if is_valid (file) then file = abs_path (file) elseif paths then local p, f, e = split (file) file = nil for ix = 1, #paths do local testPath = resolve (paths[ix] .. "/" .. item) if is_valid (testPath) then file = abs_path (testPath); break else testPath = resolve (paths[ix]) .. f .. (e and ("." .. e) or "") if is_valid (testPath) then file = abs_path (testPath); break end end end end return file end
local flowTable = { "gmod_mcore_test 1", "mat_queue_mode -1", "cl_threaded_bone_setup 1", "cl_threaded_client_leaf_system 1", "r_threaded_particles 1", "r_threaded_renderables 1", "r_queued_ropes 1", "studio_queue_mode 1", "r_decals 2048", "mp_decals 2048", "mat_wateroverlaysize 4", "r_ForceWaterLeaf 0", "r_maxmodeldecal 4", --"cl_playerspraydisable 1", "cl_ejectbrass 0", "muzzleflash_light 0", "r_drawmodeldecals 0", "ai_expression_optimization 1", "cl_autohelp 0" } local function execute_cmds() print("Now making the following changes to improve general game performance:") for k, v in pairs(flowTable) do LocalPlayer():ConCommand(v) print(v) end print("Changes complete") end hook.Add("HUDPaint", "crazy_multicore_stuff", function() hook.Remove("HUDPaint", "crazy_multicore_stuff") if not system.IsWindows() then XYZShit.Msg("Clientside FPS Boost", Color(0, 255, 0), "If you'd like to try to gain extra FPS, type crazy_multicore_stuff into console. This is unreliable on your OS and is therefore disabled by default.") if system.IsLinux() then XYZShit.Msg("Clientside FPS Boost", Color(0, 255, 0), "Seeing as you're running Linux, try enabling mesa glthread if you've not already done this: https://www.gamingonlinux.com/wiki/Performance_impact_of_Mesa_glthread") end return end execute_cmds() end) concommand.Add("crazy_multicore_stuff", execute_cmds)
local Prop = {} Prop.Name = "Twin Apartments 2b" Prop.Cat = "Apartments" Prop.Price = 750 Prop.Doors = { Vector( -5388, -3657, 590 ), Vector( -5247, -3732, 590 ), } GM.Property:Register( Prop )
TUTORIALS['en'][#TUTORIALS['en'] + 1] = { name = "Customizing your Character", contents = { {type = CONTENT_TYPES.IMAGE, value = "/images/tutorial/outfit.png"}, {type = CONTENT_TYPES.TEXT, value = "A fun task within the PSoul is the clothing customization of your character. To open the clothes window, right click on your character and go to the \"Set Outfit\" option.\n\nOn this window you can navigate between the clothes that your character has and color each part of it separately.\n\nThere various types of clothing and initially you will have two types. You can get new types of clothes through missions, trading with NPCs, etc."}, } }
-- Written by bc1 using Notepad++ local GameInfo = GameInfoCache -- warning! booleans are true, not 1, and use iterator ONLY with table field conditions, NOT string SQL query local max = math.max local format = string.format local tostring = tostring local IsMultiplayerGame = PreGame.IsMultiplayerGame local GetActivePlayer = Game.GetActivePlayer local GetActiveTeam = Game.GetActiveTeam local IsDebugMode = Game.IsDebugMode local GetReligionName = Game.GetReligionName local L = Locale.ConvertTextKey local Players = Players local Teams = Teams local DOMAIN_AIR = DomainTypes.DOMAIN_AIR local MOVE_DENOMINATOR = GameDefines.MOVE_DENOMINATOR ------------------------------------------------------ -- Short Unit Tip function ShortUnitTip( unit ) local activePlayerID = GetActivePlayer() local activeTeamID = GetActiveTeam() local activeTeam = Teams[activeTeamID] local unitOwnerID = unit:GetOwner() local unitOwner = Players[unitOwnerID] local unitTeamID = unit:GetTeam() local civAdjective = unitOwner:GetCivilizationAdjective() local nickName = unitOwner:GetNickName() local unitTip if activeTeamID == unitTeamID or ( unitOwner:IsMinorCiv() and unitOwner:IsAllies( activePlayerID ) ) then unitTip = "[COLOR_POSITIVE_TEXT]" elseif activeTeam:IsAtWar( unitTeamID ) then unitTip = "[COLOR_NEGATIVE_TEXT]" else unitTip = "[COLOR_WHITE]" end unitTip = unitTip .. L(unit:GetNameKey()) .. "[ENDCOLOR]" -- Player using nickname if IsMultiplayerGame() and nickName and #nickName > 0 then unitTip = L( "TXT_KEY_MULTIPLAYER_UNIT_TT", nickName, civAdjective, unitTip ) elseif activeTeam:IsHasMet( unitTeamID ) then unitTip = L( "TXT_KEY_PLOTROLL_UNIT_DESCRIPTION_CIV", civAdjective, unitTip ) if unit:HasName() then unitTip = L(unit:GetNameNoDesc()) .. " (" .. unitTip .. ")" end end local originalOwnerID = unit:GetOriginalOwner() local originalOwner = originalOwnerID and Players[originalOwnerID] if originalOwner and originalOwnerID ~= unitOwnerID and activeTeam:IsHasMet( originalOwner:GetTeam() ) then unitTip = unitTip .. " (" .. originalOwner:GetCivilizationAdjective() .. ")" end -- Debug stuff if IsDebugMode() then unitTip = unitTip .. " (".. tostring(unitOwnerID) ..":" .. tostring(unit:GetID()) .. ")" end -- Moves & Combat Strength local unitMoves = 0 local unitStrength = unit.GetBaseCombatStrength and unit:GetBaseCombatStrength() or unit:GetCombatStrength() --BE stupid function name change -- todo unit:GetMaxDefenseStrength() local rangedStrength = unit.GetBaseRangedCombatStrength and unit:GetBaseRangedCombatStrength() or unit:GetRangedCombatStrength() --BE stupid function name change if unit:GetDomainType() == DOMAIN_AIR then unitStrength = rangedStrength rangedStrength = 0 unitMoves = unit:Range() else if unitOwnerID == activePlayerID then unitMoves = unit:MovesLeft() else unitMoves = unit:MaxMoves() end unitMoves = unitMoves / MOVE_DENOMINATOR end -- In Orbit? if unit.IsInOrbit and unit:IsInOrbit() then unitTip = unitTip .. " " .. "[COLOR_CYAN]" .. L"TXT_KEY_PLOTROLL_ORBITING" .. "[ENDCOLOR]" else -- Moves if unitMoves > 0 then unitTip = format("%s %.3g[ICON_MOVES]", unitTip, unitMoves ) end -- Strength if unitStrength > 0 then local adjustedUnitStrength = (max(100 + unit:GetStrategicResourceCombatPenalty(), 10) * unitStrength) / 100 --todo other modifiers eg unhappy... if adjustedUnitStrength < unitStrength then adjustedUnitStrength = format(" [COLOR_NEGATIVE_TEXT]%.3g[ENDCOLOR]", adjustedUnitStrength ) end unitTip = unitTip .. " " .. adjustedUnitStrength .. "[ICON_STRENGTH]" end -- Ranged Strength if rangedStrength > 0 then unitTip = unitTip .. " " .. rangedStrength .. "[ICON_RANGE_STRENGTH]"..unit:Range().." " end -- Religious Fervor if unit.GetReligion then local religionID = unit:GetReligion() if religionID > 0 then local spreadsLeft = unit:GetSpreadsLeft() unitTip = unitTip .. " " if spreadsLeft > 0 then unitTip = unitTip .. spreadsLeft end unitTip = unitTip .. ((GameInfo.Religions[ religionID ] or {}).IconString or "?") .. L( GetReligionName( religionID ) ) end end -- Hit Points if unit:IsHurt() then unitTip = unitTip .. " " .. L( "TXT_KEY_PLOTROLL_UNIT_HP", unit:GetCurrHitPoints() ) end end -- Embarked? if unit:IsEmbarked() then unitTip = unitTip .. " " .. L"TXT_KEY_PLOTROLL_EMBARKED" end return unitTip end
local function lol(gfx) local items = newItemList() items:add(newEItem('spawn',5,6,gfx)) items:add(newEItem('goal',8,7,gfx)) items:add(newEItem('score',26,21,gfx)) local decs = {} decs[1] = {1, 5, 7} decs[2] = {1, 6, 7} decs[3] = {1, 7, 7} local nmys = {} nmys[1] = {5, 11, 4} nmys[2] = {5, 12, 4} nmys[3] = {5, 14, 5} nmys[4] = {5, 15, 5} nmys[5] = {5, 13, 5} nmys[6] = {5, 16, 6} nmys[7] = {5, 17, 7} nmys[8] = {5, 18, 8} nmys[9] = {5, 19, 9} nmys[10] = {5, 20, 10} nmys[11] = {5, 20, 11} nmys[12] = {5, 20, 12} nmys[13] = {5, 20, 13} nmys[14] = {5, 20, 14} nmys[15] = {5, 20, 15} nmys[16] = {5, 19, 16} nmys[17] = {5, 18, 17} nmys[18] = {5, 17, 18} nmys[19] = {5, 17, 19} nmys[20] = {5, 10, 9} nmys[21] = {5, 11, 10} nmys[22] = {5, 12, 11} nmys[23] = {5, 11, 12} nmys[24] = {5, 11, 13} nmys[25] = {5, 10, 14} nmys[26] = {5, 9, 15} nmys[27] = {5, 9, 16} nmys[28] = {5, 8, 17} nmys[29] = {5, 7, 18} nmys[30] = {5, 8, 19} nmys[31] = {5, 8, 20} nmys[32] = {5, 9, 21} nmys[33] = {5, 9, 22} nmys[34] = {5, 10, 23} nmys[35] = {5, 11, 23} nmys[36] = {5, 12, 24} nmys[37] = {5, 13, 24} nmys[38] = {5, 14, 24} nmys[39] = {5, 15, 24} nmys[40] = {5, 16, 24} nmys[41] = {5, 18, 24} nmys[42] = {5, 17, 24} nmys[43] = {5, 19, 25} nmys[44] = {5, 21, 25} nmys[45] = {5, 20, 25} nmys[46] = {5, 18, 19} nmys[47] = {5, 19, 19} nmys[48] = {5, 20, 19} nmys[49] = {5, 22, 19} nmys[50] = {5, 21, 19} nmys[51] = {5, 23, 18} nmys[52] = {5, 24, 17} nmys[53] = {5, 25, 16} nmys[54] = {5, 26, 16} nmys[55] = {5, 27, 16} nmys[56] = {5, 28, 16} nmys[57] = {5, 29, 17} nmys[58] = {5, 30, 18} nmys[59] = {5, 31, 19} nmys[60] = {5, 32, 20} nmys[61] = {5, 32, 21} nmys[62] = {5, 32, 22} nmys[63] = {5, 31, 23} nmys[64] = {5, 30, 24} nmys[65] = {5, 30, 25} nmys[66] = {5, 29, 26} nmys[67] = {5, 28, 26} nmys[68] = {5, 27, 26} nmys[69] = {5, 26, 26} nmys[70] = {5, 25, 25} nmys[71] = {5, 24, 25} nmys[72] = {5, 23, 25} nmys[73] = {5, 22, 25} local lvl = {} lvl[1] = {} lvl[2] = {} lvl[3] = {} lvl[3][7] = 1 lvl[3][8] = 4 lvl[3][9] = 7 lvl[4] = {} lvl[4][7] = 2 lvl[4][8] = 5 lvl[4][9] = 8 lvl[5] = {} lvl[5][7] = 2 lvl[5][8] = 5 lvl[5][9] = 8 lvl[6] = {} lvl[6][7] = 2 lvl[6][8] = 5 lvl[6][9] = 8 lvl[7] = {} lvl[7][7] = 2 lvl[7][8] = 5 lvl[7][9] = 8 lvl[8] = {} lvl[8][7] = 2 lvl[8][8] = 5 lvl[8][9] = 8 lvl[9] = {} lvl[9][7] = 2 lvl[9][8] = 5 lvl[9][9] = 8 lvl[10] = {} lvl[10][7] = 3 lvl[10][8] = 6 lvl[10][9] = 9 lvl[11] = {} lvl[12] = {} lvl[13] = {} lvl[14] = {} lvl[15] = {} lvl[16] = {} lvl[17] = {} lvl[18] = {} lvl[19] = {} lvl[20] = {} lvl[21] = {} lvl[22] = {} lvl[23] = {} lvl[24] = {} lvl[25] = {} lvl[26] = {} lvl[27] = {} lvl[28] = {} lvl[29] = {} lvl[30] = {} lvl[31] = {} lvl[32] = {} lvl[33] = {} lvl[34] = {} lvl[35] = {} lvl[36] = {} lvl[37] = {} lvl[38] = {} lvl[39] = {} lvl[40] = {} lvl[41] = {} lvl[42] = {} lvl[43] = {} lvl[44] = {} lvl[45] = {} lvl[46] = {} lvl[47] = {} lvl[48] = {} lvl[49] = {} lvl[50] = {} lvl[51] = {} lvl[52] = {} lvl[53] = {} lvl[54] = {} lvl[55] = {} lvl[56] = {} lvl[57] = {} lvl[58] = {} lvl[59] = {} lvl[60] = {} lvl[61] = {} lvl[62] = {} lvl[63] = {} lvl[64] = {} lvl[65] = {} lvl[66] = {} lvl[67] = {} lvl[68] = {} lvl[69] = {} lvl[70] = {} lvl[71] = {} lvl[72] = {} lvl[73] = {} lvl[74] = {} lvl[75] = {} lvl[76] = {} lvl[77] = {} lvl[78] = {} lvl[79] = {} lvl[80] = {} lvl[81] = {} lvl[82] = {} lvl[83] = {} lvl[84] = {} lvl[85] = {} lvl[86] = {} lvl[87] = {} lvl[88] = {} lvl[89] = {} lvl[90] = {} lvl[91] = {} lvl[92] = {} lvl[93] = {} lvl[94] = {} lvl[95] = {} lvl[96] = {} lvl[97] = {} lvl[98] = {} lvl[99] = {} lvl[100] = {} return lvl,items,decs,nmys end return lol
Spring.Utilities = Spring.Utilities or {} ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------- -- bool deep: clone subtables. defaults to false. not safe with circular tables! function Spring.Utilities.CopyTable(tableToCopy, deep) local copy = {} for key, value in pairs(tableToCopy) do if (deep and type(value) == "table") then copy[key] = Spring.Utilities.CopyTable(value, true) else copy[key] = value end end return copy end function Spring.Utilities.MergeTable(primary, secondary, deep) local new = Spring.Utilities.CopyTable(primary, deep) for i, v in pairs(secondary) do -- key not used in primary, assign it the value at same key in secondary if not new[i] then if (deep and type(v) == "table") then new[i] = Spring.Utilities.CopyTable(v, true) else new[i] = v end -- values at key in both primary and secondary are tables, merge those elseif type(new[i]) == "table" and type(v) == "table" then new[i] = Spring.Utilities.MergeTable(new[i], v, deep) end end return new end
local brokeAllowanceGuide= { name="brokeAllowanceGuide",type=0,typeName="View",time=0,x=0,y=0,width=1280,height=800,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignTopLeft, { name="shiled",type=0,typeName="Image",time=105625572,x=276,y=197,width=1,height=1,nodeAlign=kAlignTopLeft,visible=1,fillParentWidth=1,fillParentHeight=1,file="isolater/bg_shiled.png" }, { name="content",type=1,typeName="Image",time=91611912,x=0,y=0,width=800,height=550,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,file="isolater/popupWindow/popupWindow_bg_55_55_55_55.png",gridLeft=55,gridRight=55,gridTop=55,gridBottom=55, { name="close_btn",type=2,typeName="Button",time=91612024,x=-25,y=-25,width=60,height=60,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTopRight,file="isolater/popupWindow/popupWindow_close.png" }, { name="title_img",type=1,typeName="Image",time=91611938,x=0,y=-50,width=919,height=155,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTop,file="hall/bankrupt/title.png", { name="Text1",type=0,typeName="Text",time=105535826,x=0,y=0,width=64,height=64,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[您银币不足啦]],fontSize=34,textAlign=kAlignCenter,colorRed=247,colorGreen=229,colorBlue=196 } }, { name="info_bg",type=1,typeName="Image",time=91612083,x=0,y=180,width=2,height=2,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignBottom,file="isolater/bg_blank.png", { name="text",type=4,typeName="Text",time=91612181,x=0,y=0,width=461,height=51,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignCenter,fontSize=34,textAlign=kAlignCenter,colorRed=145,colorGreen=93,colorBlue=32,string=[[运气真好,获得全国1%的购买机会哦]] } }, { name="content_bg",type=2,typeName="Button",time=91612133,x=0,y=-40,width=594,height=150,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,file="hall/common/buy_redbg.png", { name="to_safebox_area",type=0,typeName="View",time=91612809,x=0,y=0,width=200,height=150,visible=0,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignCenter, { name="to_safebox_btn",type=2,typeName="Button",time=91613491,x=30,y=3,width=173,height=88,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignRight,file="hall/bankrupt/bankruptGuide/broke_btn.png", { name="Text3",type=4,typeName="Text",time=91613516,x=0,y=-3,width=150,height=60,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,fontSize=32,textAlign=kAlignCenter,colorRed=253,colorGreen=203,colorBlue=142,string=[[立即领取]] } }, { name="Text4",type=4,typeName="Text",time=91613579,x=31,y=0,width=168,height=138,visible=1,fillParentWidth=0,fillParentHeight=1,nodeAlign=kAlignLeft,fontSize=28,textAlign=kAlignLeft,colorRed=255,colorGreen=226,colorBlue=90,string=[[保险箱余额:]] }, { name="safebox_money_text",type=4,typeName="Text",time=91613635,x=192,y=0,width=200,height=138,visible=1,fillParentWidth=0,fillParentHeight=1,nodeAlign=kAlignLeft,fontSize=34,textAlign=kAlignLeft,colorRed=255,colorGreen=255,colorBlue=255,string=[[123,123,123]] } }, { name="recharge_area",type=0,typeName="View",time=91612823,x=0,y=0,width=594,height=138,visible=1,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignCenter, { name="Image2",type=1,typeName="Image",time=91612868,x=30,y=0,width=128,height=107,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignLeft,file="hall/bankrupt/bankruptGuide/broke_coin.png" }, { name="coin_text",type=4,typeName="Text",time=91613043,x=165,y=29,width=200,height=40,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTopLeft,fontSize=34,textAlign=kAlignLeft,colorRed=255,colorGreen=226,colorBlue=90 }, { name="coin_extra_text",type=4,typeName="Text",time=91613125,x=165,y=66,width=200,height=50,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTopLeft,fontSize=26,textAlign=kAlignLeft,colorRed=255,colorGreen=255,colorBlue=255 }, { name="recharge_btn",type=2,typeName="Button",time=91613302,x=30,y=3,width=173,height=88,visible=0,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignRight,file="hall/bankrupt/bankruptGuide/broke_btn.png", { name="recharge_btn_txt",type=4,typeName="Text",time=91613350,x=0,y=-3,width=150,height=60,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,fontSize=36,textAlign=kAlignCenter,colorRed=253,colorGreen=203,colorBlue=142,string=[[加载中...]] } } }, { name="daytask_area",type=0,typeName="View",time=99221149,x=0,y=0,width=200,height=150,visible=0,fillParentWidth=1,fillParentHeight=1,nodeAlign=kAlignCenter, { name="daytask_btn",type=2,typeName="Button",time=99221150,x=30,y=3,width=173,height=88,visible=0,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignRight,file="hall/bankrupt/bankruptGuide/broke_btn.png", { name="Text3",type=4,typeName="Text",time=99221151,x=0,y=-3,width=150,height=60,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,fontSize=32,textAlign=kAlignCenter,colorRed=253,colorGreen=203,colorBlue=142,string=[[每日任务]] } }, { name="Text4",type=4,typeName="Text",time=99221152,x=170,y=0,width=168,height=138,visible=1,fillParentWidth=0,fillParentHeight=1,nodeAlign=kAlignLeft,fontSize=30,textAlign=kAlignLeft,colorRed=255,colorGreen=226,colorBlue=90,string=[[做任务可以获得银币哦~]] }, { name="Image22",type=1,typeName="Image",time=105625038,x=30,y=0,width=128,height=107,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignLeft,file="hall/bankrupt/bankruptGuide/broke_coin.png" } } }, { name="title_text",type=4,typeName="Text",time=91612247,x=0,y=80,width=600,height=80,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTop,fontSize=34,textAlign=kAlignCenter,colorRed=145,colorGreen=93,colorBlue=32,string=[[很遗憾,您已被请离高级场]] }, { name="Image1",type=1,typeName="Image",time=91612726,x=8,y=88,width=109,height=78,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignTopRight,file="hall/bankrupt/bankruptGuide/broke_again_img.png" }, { name="to_free_btn",type=2,typeName="Button",time=91613779,x=0,y=60,width=234,height=85,visible=1,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignBottom,file="games/common/btns/154x79_green.png",gridLeft=30,gridRight=30,gridTop=30,gridBottom=30, { name="Image3",type=1,typeName="Image",time=94446928,x=0,y=-5,width=109,height=39,visible=0,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignCenter,file="hall/bankrupt/bankruptGuide/broke_btn_text.png" }, { name="Text1",type=0,typeName="Text",time=105536333,x=0,y=0,width=64,height=64,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,string=[[新手场]],fontSize=34,textAlign=kAlignCenter,colorRed=255,colorGreen=235,colorBlue=185 } }, { name="to_game1_free_btn",type=2,typeName="Button",time=102790581,x=-165,y=60,width=320,height=85,visible=0,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignBottom,file="games/common/btns/154x79_green.png",gridLeft=30,gridRight=30,gridTop=30,gridBottom=30, { name="text",type=0,typeName="Text",time=105536480,x=0,y=0,width=64,height=64,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=34,textAlign=kAlignCenter,colorRed=255,colorGreen=235,colorBlue=185 } }, { name="to_game2_free_btn",type=2,typeName="Button",time=102790583,x=165,y=60,width=320,height=85,visible=0,fillParentWidth=0,fillParentHeight=0,nodeAlign=kAlignBottom,file="games/common/btns/154x79_green.png",gridLeft=30,gridRight=30,gridTop=30,gridBottom=30, { name="text",type=0,typeName="Text",time=105536501,x=0,y=0,width=64,height=64,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=34,textAlign=kAlignCenter,colorRed=255,colorGreen=235,colorBlue=185 } }, { name="tipsBg",type=0,typeName="Image",time=102791798,x=-188,y=138,width=253,height=149,nodeAlign=kAlignBottomRight,visible=1,fillParentWidth=0,fillParentHeight=0,file="hall/bankrupt/bankruptGuide/broke_tips_img.png", { name="tipsTxt",type=0,typeName="TextView",time=102792036,x=0,y=-15,width=250,height=100,nodeAlign=kAlignCenter,visible=1,fillParentWidth=0,fillParentHeight=0,fontSize=22,textAlign=kAlignCenter,colorRed=137,colorGreen=57,colorBlue=29 } } } } return brokeAllowanceGuide;
--[[ A debug session is created when a player starts debugging a specific contraption. Although multiple debug session can be active at the same time, a single player can only have one debug session enabled, and any entity can only be inside one debug session. Modifications to a contraption whilst a debug session is in progress are possible, but it is the responsibility of a contraption to avoid a single entity being added to two debug session at the same time, since that'll cause conflict. During a debug session, all entities in it are automatically powered to full, even when not in an electronic network, and pausing is achieved by stripping all energy away from an entity. When a player's force changes, any assocaited debug session is destroyed. ]] local debug_session = {} function debug_session:new(player, contraption) self.player, self.contraption = player, contraption self.paused, self.step_next = true, false for _, entity in ipairs(contraption.entities) do if global.controlled_entities[entity.unit_number] then error('cannot start a debug session because entities overlap') else global.controlled_entities[entity.unit_number] = true end end end function debug_session:destroy() for _, entity in ipairs(self.contraption.entities) do global.controlled_entities[entity.unit_number] = nil end for k, v in pairs(self) do self[k] = nil end end function debug_session:on_entity_added(entity) assert(not global.controlled_entities[entity.unit_number], 'cannot add an entity to a contraption with \ an active debug_session when the entity is already controlled by another debug_session') global.controlled_entities[entity.unit_number] = true end function debug_session:on_entity_removed(entity) assert(global.controlled_entities[entity.unit_number], 'cannot remove an entity that is not controlled') global.controlled_entities[entity.unit_number] = nil end function debug_session:is_paused() return self.paused end function debug_session:pause() assert(not self.paused, 'cannot pause an already paused debug_session') self.paused = true end function debug_session:resume() assert(self.paused, 'cannot resume a debug_session that is not paused') self.paused = false end function debug_session:step() assert(self.paused, 'a debug_session must be paused before stepping') self.step_next = true end function debug_session:on_tick() if not self.paused or self.step_next then for _, entity in ipairs(self.contraption.entities) do entity.energy = entity.electric_buffer_size end else for _, entity in ipairs(self.contraption.entities) do entity.energy = 0 end end self.step_next = false end return debug_session
local cjson = require "cjson" local basic_serializer = require "kong.plugins.log-serializers.basic" local BasePlugin = require "kong.plugins.base_plugin" local StdoutLogHandler = BasePlugin:extend() StdoutLogHandler.PRIORITY = 9 StdoutLogHandler.VERSION = "0.0.1" function StdoutLogHandler:new() StdoutLogHandler.super.new(self, "stdout-log") end function StdoutLogHandler:log(conf) StdoutLogHandler.super.log(self) local message = basic_serializer.serialize(ngx) print(cjson.encode(message)) end return StdoutLogHandler
return { -- A request line can parse to something invalid. INVALID_REQUEST_LINE = 1, -- HTTP method is not implemented. METHOD_NOT_IMPLEMENTED = 2, -- HTTP version is not supported. VERSION_NOT_SUPPORTED = 3, }
return { HOOK_PLAYER_FISHED = { CalledWhen = "A player gets a reward from fishing.", DefaultFnName = "OnPlayerFished", -- also used as pagename Desc = [[ This hook gets called after a player reels in the fishing rod. This is a notification-only hook, the reward has already been decided. If a plugin needs to modify the reward, use the {{OnPlayerFishing|HOOK_PLAYER_FISHING}} hook. ]], Params = { { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who pulled the fish in." }, { Name = "Reward", Type = "{{cItems}}", Notes = "The reward the player gets. It can be a fish, treasure and junk." }, }, Returns = [[ If the function returns false or no value, the next plugin's callback is called. If the function returns true, no other callback is called for this event. ]], }, -- HOOK_PLAYER_FISHED };
cfg.debug = true cfg.wifi_check_count = 5 cfg.wifi_check_interval = 1000 cfg.submit_interval = 15000 cfg.thingspeak_api_key = '0123456789ABCDEF' cfg.graphite_host = 'example.com' cfg.graphite_port = 2003 cfg.elastic_url = 'http://example.com/' cfg.elastic_index = 'sensors' cfg.elastic_auth = '0123456789012345678901234567890123456789'
-- MONKEY: guarda a imagem, posicao inicial e dimensoes local img = canvas:new('monkey.png') local dx, dy = img:attrSize() local monkey = { img=img, x=10, y=10, dx=dx, dy=dy } -- BANANA: guarda a imagem, posicao inicial e dimensoes local img = canvas:new('banana.png') local dx, dy = img:attrSize() local banana = { img=img, x=150, y=150, dx=dx, dy=dy } -- Funcao de redesenho: -- chamada a cada tecla pressionada -- primeiro o fundo, depois a banana e por fim o macaco function redraw () canvas:attrColor('black') canvas:drawRect('fill', 0,0, canvas:attrSize()) canvas:compose(banana.x, banana.y, banana.img) canvas:compose(monkey.x, monkey.y, monkey.img) canvas:flush() end -- Funcao de colisao: -- chamada a cada tecla pressionada -- checa se o macaco esta em cima da banana function collide (A, B) local ax1, ay1 = A.x, A.y local ax2, ay2 = ax1+A.dx, ay1+A.dy local bx1, by1 = B.x, B.y local bx2, by2 = bx1+B.dx, by1+B.dy if ax1 > bx2 then return false elseif bx1 > ax2 then return false elseif ay1 > by2 then return false elseif by1 > ay2 then return false end return true end local IGNORE = false -- Funcao de tratamento de eventos: function handler (evt) if IGNORE then return end -- apenas eventos de tecla me interessam if evt.class == 'key' and evt.type == 'press' then -- apenas as setas movem o macaco if evt.key == 'CURSOR_UP' then monkey.y = monkey.y - 10 elseif evt.key == 'CURSOR_DOWN' then monkey.y = monkey.y + 10 elseif evt.key == 'CURSOR_LEFT' then monkey.x = monkey.x - 10 elseif evt.key == 'CURSOR_RIGHT' then monkey.x = monkey.x + 10 end -- testa se o macaco esta em cima da banana if collide(monkey, banana) then -- caso esteja, sinaliza que a ancora de FIM esta ocorrendo event.post { class = 'ncl', type = 'presentation', label = 'fim', action = 'start', } -- e ignora os eventos posteriores IGNORE = true end end -- redesenha a tela toda redraw() end event.register(handler)
slot2 = "SlwhJettonCcsView" SlwhJettonCcsView = class(slot1) SlwhJettonCcsView.onCreationComplete = function (slot0) slot8 = slot0.view ClassUtil.extends(slot2, slot0, ZoomPopUpChildView, true, slot0, slot0.bg) slot0._layerView = slot0.view slot0._layerJetton = slot0.view.layer_jetton slot0.layerAnimal = slot0.view.layer_animal slot0._baseBetButtonIndex = 100 slot0._upperBetButtonIndex = 106 slot0._baseAreaButtonIndex = 0 slot0._upperAreaButtonIndex = 16 slot0._areaComponent = {} for slot4 = 1, 15, 1 do slot8 = { playerBet = -1, totalBet = -1, rewardTimes = -1 } table.insert(slot6, slot0._areaComponent) end slot0._buttonComponent = {} for slot4 = 1, 5, 1 do slot8 = -1 table.insert(slot6, slot0._buttonComponent) end slot0._currentSelectButton = -1 slot0._layerJettonChild = { slot0._layerJetton.btnJetton_1, slot0._layerJetton.btnJetton_2, slot0._layerJetton.btnJetton_3, slot0._layerJetton.btnJetton_4, slot0._layerJetton.btnJetton_5 } slot1 = pairs slot3 = slot0._layerJettonChild or {} for slot4, slot5 in slot1(slot2) do if slot5 then if not slot5.betBtnSpine then slot10 = Tree.root .. "effect/slwh_xzgd.atlas" slot5.betBtnSpine = sp.SkeletonAnimation.create(slot7, sp.SkeletonAnimation, Tree.root .. "effect/slwh_xzgd.json") slot11 = true slot5.betBtnSpine.setAnimation(slot7, slot5.betBtnSpine, 0, "animation") slot10 = 16 slot5.betBtnSpine.setPosition(slot7, slot5.betBtnSpine, 0) slot9 = slot5.betBtnSpine slot0._layerJetton["betBtnEffect_" .. slot4].addChild("betBtnEffect_" .. slot4, slot0._layerJetton["betBtnEffect_" .. slot4]) slot9 = false slot5.betBtnSpine.setVisible("betBtnEffect_" .. slot4, slot5.betBtnSpine) end if not slot5.betBtnParticle then slot9 = Tree.root .. "particle/slwh_cmlightlizi.plist" slot5.betBtnParticle = cc.ParticleSystemQuad.create(slot7, cc.ParticleSystemQuad) slot10 = 16 slot5.betBtnParticle.setPosition(slot7, slot5.betBtnParticle, 0) slot9 = slot5.betBtnParticle slot0._layerJetton["betBtnEffect_" .. slot4].addChild("betBtnEffect_" .. slot4, slot0._layerJetton["betBtnEffect_" .. slot4]) slot9 = false slot5.betBtnParticle.setVisible("betBtnEffect_" .. slot4, slot5.betBtnParticle) end end end slot4 = slot0._layerJetton.btnJetton_1 slot4 = slot0._layerJetton.btnJetton_2 slot4 = slot0._layerJetton.btnJetton_3 slot4 = slot0._layerJetton.btnJetton_4 slot4 = slot0._layerJetton.btnJetton_5 slot2 = slot0._layerJetton.btnJetton_5.getPositionY(slot3) slot0._layerJettonChildPositionY = { slot0._layerJetton.btnJetton_1.getPositionY(slot3), slot0._layerJetton.btnJetton_2.getPositionY(slot3), slot0._layerJetton.btnJetton_3.getPositionY(slot3), slot0._layerJetton.btnJetton_4.getPositionY(slot3), slot2 } slot6 = slot0 TreeEventDispatcher.addEventListener(slot2, TreeEventDispatcher, Tree.Event.gameOver, slot0.notifyGameOver) slot6 = slot0 TreeEventDispatcher.addEventListener(slot2, TreeEventDispatcher, Tree.Event.gameBet, slot0.notifyJetton) slot6 = slot0 TreeEventDispatcher.addEventListener(slot2, TreeEventDispatcher, Tree.Event.gameBetContinue, slot0.notifyJettonContinue) slot6 = slot0 TreeEventDispatcher.addEventListener(slot2, TreeEventDispatcher, Tree.Event.closeJettonView, slot0.notifyCloseView) slot6 = slot0 TreeEventDispatcher.addEventListener(slot2, TreeEventDispatcher, Tree.Event.cancelAllBets, slot0.onCancelAllBets) slot6 = slot0 TreeEventDispatcher.addEventListener(slot2, TreeEventDispatcher, Tree.Event.closeGame, slot0.exitGame) end SlwhJettonCcsView.replaceJettonPanel = function (slot0) for slot4 = 1, 5, 1 do slot8 = slot4 slot10 = 1 slot0._layerView.layer_jetton["btnJetton_" .. slot4].loadTexture("btnJetton_" .. slot4, slot0._layerView.layer_jetton["btnJetton_" .. slot4], string.format(slot6, "slwh_jetton_%d_n.png")) end slot5 = 1 slot0._layerView.btnCancel.loadTexture(slot2, slot0._layerView.btnCancel, "button_cancel.png") slot5 = 1 slot0._layerView.btnContinue.loadTexture(slot2, slot0._layerView.btnContinue, "button_continue.png") slot5 = 1 slot0._layerView.btnClose.loadTexture(slot2, slot0._layerView.btnClose, "button_close.png") slot1 = slot0._layerView.layer_animal for slot5 = 1, 15, 1 do slot9 = slot5 slot11 = 1 slot1["btnBet_" .. slot5].loadTexture(slot5, slot1["btnBet_" .. slot5], string.format(slot7, "slwh_bet_frame_%d.png")) end end SlwhJettonCcsView.onCancelAllBets = function (slot0) slot3 = slot0 slot0.updateView(slot2) end SlwhJettonCcsView.notifyButtonStatus = function (slot0, slot1, slot2) slot8 = state_f slot4 = string.format(slot1, "slwh_jetton_%d_%s.png", slot1.getTag(slot4) - slot0._baseBetButtonIndex) end SlwhJettonCcsView.updateJettonButton = function (slot0) slot5 = Hero slot1 = parseInt(Hero.getUserScore(slot4)) slot4 = slot0.model slot2 = slot0.model.getCellScoreArray(Hero.getUserScore) for slot6 = 1, 5, 1 do slot8 = slot0._layerJettonChild[slot6] slot9 = "n" if slot1 < slot2[slot6] then slot9 = "d" end slot14 = slot9 slot15 = 1 slot8.loadTexture("slwh_jetton_%d_%s.png", slot8, string.format(slot11, "slwh_jetton_%d_%s.png", slot6)) end if slot0._currentSelectButton > 0 and slot1 < slot2[slot0._currentSelectButton] then slot3 = slot0._currentSelectButton for slot7 = slot0._currentSelectButton - 1, 0, 1 do if slot2[slot7] < slot1 then slot0._currentSelectButton = slot7 break end end if slot3 == slot0._currentSelectButton then slot0._currentSelectButton = -1 end end if slot0._currentSelectButton > 0 then slot9 = 1 slot0._layerJettonChild[slot0._currentSelectButton].loadTexture(slot0._currentSelectButton, slot0._layerJettonChild[slot0._currentSelectButton], string.format(slot4, "slwh_jetton_%d_s.png")) end slot5 = slot0._jettonMap if TreeFunc.checkSumary(slot4) > 0 then slot8 = Hero if slot3 <= parseInt(Hero.getUserScore(slot7)) then slot6 = slot0.model if slot0.model.getCanJettonContinue(slot5) == true then slot7 = true slot0._layerView.btnContinue.setEnabled(slot5, slot0._layerView.btnContinue) slot8 = 1 slot0._layerView.btnContinue.loadTexture(slot5, slot0._layerView.btnContinue, "button_continue.png") end end else slot7 = false slot0._layerView.btnContinue.setEnabled(slot5, slot0._layerView.btnContinue) slot8 = 1 slot0._layerView.btnContinue.loadTexture(slot5, slot0._layerView.btnContinue, "button_continue_d.png") end end SlwhJettonCcsView.updateBetBtnPosition = function (slot0) if slot0._currentSelectButton == -1 then slot1 = pairs slot3 = slot0._layerJettonChild or {} for slot4, slot5 in slot1(slot2) do if slot5 then slot9 = slot0._layerJettonChildPositionY[slot4] slot5.setPositionY(slot7, slot5) slot9 = false slot5.betBtnParticle.setVisible(slot7, slot5.betBtnParticle) slot9 = false slot5.betBtnSpine.setVisible(slot7, slot5.betBtnSpine) end end else for slot4 = 1, 5, 1 do if slot0._currentSelectButton == slot4 then slot7 = slot0._layerJettonChild[slot4] if slot0._layerJettonChild[slot4].getPositionY(slot6) == slot0._layerJettonChildPositionY[slot4] then slot7 = slot0._layerJettonChild[slot4] slot0._layerJettonChild[slot4].stopAllActions(slot6) slot7 = slot0._layerJettonChild[slot4] slot11 = 0.1 slot16 = slot0._layerJettonChild[slot4] slot15 = slot0._layerJettonChildPositionY[slot4] + 10 slot0._layerJettonChild[slot4].runAction(slot6, cc.MoveTo.create(slot9, cc.MoveTo, cc.p(slot13, slot0._layerJettonChild[slot4].getPositionX(slot15)))) slot7 = slot0._layerJettonChild[slot4].betBtnParticle slot0._layerJettonChild[slot4].betBtnParticle.resetSystem(slot6) slot8 = true slot0._layerJettonChild[slot4].betBtnParticle.setVisible(slot6, slot0._layerJettonChild[slot4].betBtnParticle) slot8 = true slot0._layerJettonChild[slot4].betBtnSpine.setVisible(slot6, slot0._layerJettonChild[slot4].betBtnSpine) end else slot7 = slot0._layerJettonChild[slot4] if slot0._layerJettonChild[slot4].getPositionY(slot6) ~= slot0._layerJettonChildPositionY[slot4] then slot7 = slot0._layerJettonChild[slot4] slot0._layerJettonChild[slot4].stopAllActions(slot6) slot7 = slot0._layerJettonChild[slot4] slot11 = 0.1 slot16 = slot0._layerJettonChild[slot4] slot15 = slot0._layerJettonChildPositionY[slot4] slot0._layerJettonChild[slot4].runAction(slot6, cc.MoveTo.create(slot9, cc.MoveTo, cc.p(slot13, slot0._layerJettonChild[slot4].getPositionX(slot15)))) slot8 = false slot0._layerJettonChild[slot4].betBtnParticle.setVisible(slot6, slot0._layerJettonChild[slot4].betBtnParticle) slot8 = false slot0._layerJettonChild[slot4].betBtnSpine.setVisible(slot6, slot0._layerJettonChild[slot4].betBtnSpine) end end end end end SlwhJettonCcsView.updateView = function (slot0) slot3 = slot0.model slot1 = slot0.model.getCellScoreArray(slot2) for slot5 = 1, 5, 1 do slot6 = slot0._layerJettonChild[slot5] if slot0._buttonComponent[slot5] ~= slot1[slot5] then slot0._buttonComponent[slot5] = slot7 slot10 = slot6.node_jetton TreeFunc.extractCacheWithNode(slot9) slot11 = slot5 slot16 = true TreeFunc.createSpriteNumberWithShort("jetton_%d_money_%%s", slot7, string.format(slot9, "jetton_%d_money_%%s"), nil, { x = 0.5, y = 0.5 }, slot6.node_jetton) end end slot7 = slot0.model slot5 = slot0.controller.getOrCreateJettonMap(slot3, slot0.model.getRoomKind(slot6)) if TreeFunc.checkSumary(slot0.controller) > 0 then slot8 = Hero if slot3 <= parseInt(Hero.getUserScore(slot7)) then slot6 = slot0.model if slot0.model.getCanJettonContinue(slot5) == true then slot7 = true slot0._layerView.btnContinue.setEnabled(slot5, slot0._layerView.btnContinue) slot8 = 1 slot0._layerView.btnContinue.loadTexture(slot5, slot0._layerView.btnContinue, "button_continue.png") end end else slot7 = false slot0._layerView.btnContinue.setEnabled(slot5, slot0._layerView.btnContinue) slot8 = 1 slot0._layerView.btnContinue.loadTexture(slot5, slot0._layerView.btnContinue, "button_continue_d.png") end slot0._jettonMap = slot2 slot4 = slot0._layerView.layer_animal slot5 = slot0.model.getAreaUserBetArray(slot6) slot6 = slot0.model.getAreaTotalBetArray(slot0.model) slot9 = slot0.model slot7 = slot0.model.getAreaBetMultiplyArray(slot0.model) for slot11 = 1, 15, 1 do slot13 = slot4["btnBet_" .. slot11] slot14 = Tree.JettonNumbers[slot11] if slot0._areaComponent[slot11].rewardTimes ~= slot7[slot11] then slot12.rewardTimes = slot7[slot11] TreeFunc.extractCacheWithNode(slot16) slot24 = true TreeFunc.createSpriteNumber(slot13.node_multiplier, slot12.rewardTimes, slot14[2], nil, { x = 0.5, y = 0.5 }, 0, slot13.node_multiplier) end if slot12.playerBet ~= slot5[slot11] then slot12.playerBet = slot5[slot11] TreeFunc.extractCacheWithNode(slot16) slot23 = true TreeFunc.createSpriteNumberWithShortW(slot13.node_self, slot12.playerBet, slot14[1], nil, nil, slot13.node_self) end if slot12.totalBet ~= slot6[slot11] then slot12.totalBet = slot6[slot11] TreeFunc.extractCacheWithNode(slot16) slot23 = true TreeFunc.createSpriteNumberWithShortW(slot13.node_total, slot12.totalBet, slot14[3], nil, nil, slot13.node_total) end end end SlwhJettonCcsView.hide = function (slot0, slot1, slot2) slot7 = slot2 ZoomPopUpChildView.hide(slot4, slot0, slot1) end SlwhJettonCcsView.show = function (slot0, slot1, slot2) slot7 = slot2 ZoomPopUpChildView.show(slot4, slot0, slot1) slot0._currentSelectButton = -1 slot5 = slot0 slot0.updateBetBtnPosition(slot4) slot5 = slot0 slot0.updateView(slot4) slot6 = false slot0._layerView.btnCancel.setEnabled(slot4, slot0._layerView.btnCancel) slot7 = 1 slot0._layerView.btnCancel.loadTexture(slot4, slot0._layerView.btnCancel, "button_cancel_d.png") end SlwhJettonCcsView.notifyCloseView = function (slot0) slot4 = false slot0.model.setIsShowingJetton(slot2, slot0.model) end SlwhJettonCcsView.onBtnClick = function (slot0, slot1, slot2) slot5 = slot1 slot3 = slot1.getTag(slot4) if slot1 == slot0._layerView.btnCancel then slot7 = false slot0._layerView.btnCancel.setEnabled(slot5, slot0._layerView.btnCancel) reqSlwhCancelJetton() slot8 = 1 slot0._layerView.btnCancel.loadTexture(slot5, slot0._layerView.btnCancel, "button_cancel_d.png") elseif slot1 == slot0._layerView.btnContinue then slot7 = false slot0._layerView.btnContinue.setEnabled(slot5, slot0._layerView.btnContinue) slot8 = 1 slot0._layerView.btnContinue.loadTexture(slot5, slot0._layerView.btnContinue, "button_continue_d.png") slot6 = slot0 slot0.jettonContinue(slot5) slot7 = false slot0.model.setCanJettonContinue(slot5, slot0.model) elseif slot3 < slot0._upperAreaButtonIndex then slot7 = slot1 slot0.putJettonAnimal(slot5, slot0) elseif slot3 < slot0._upperBetButtonIndex then slot0._currentSelectButton = slot3 - slot0._baseBetButtonIndex slot7 = slot0 slot0.updateBetBtnPosition(slot6) slot7 = slot0 slot0.updateJettonButton(slot6) elseif slot1 == slot0._layerView.btnClose then slot6 = slot0 slot0.notifyCloseView(slot5) end end SlwhJettonCcsView.putJettonAnimal = function (slot0, slot1) slot5 = slot0._baseAreaButtonIndex < slot1.getTag(assert) and slot2 < slot0._upperAreaButtonIndex assert(slot1) slot2 = slot2 - slot0._baseAreaButtonIndex if slot0._currentSelectButton > 0 then slot5 = slot0.model slot9 = slot0.model.getCellScoreArray(slot4)[slot0._currentSelectButton] slot0.requestJetton(slot6, slot0, slot2) end end SlwhJettonCcsView.requestJetton = function (slot0, slot1, slot2) slot7 = slot2 slot0.model.setCurSelectdGold(slot5, slot0.model) slot9 = slot2 print(slot5, "area->", slot1 - 1, "bet->") slot6 = { nJettonArea = slot1 - 1, lBet = slot2 } reqSlwhJetton(slot5) end SlwhJettonCcsView.notifyJetton = function (slot0, slot1) slot4 = Hero slot2 = Hero.getWChairID(slot3) if slot1.cbRet == Tree.JettonRetType.RetType_Success then slot4 = slot0._areaComponent[slot1.nArea + 1] slot5 = slot0._layerView.layer_animal["btnBet_" .. slot3] slot6 = Tree.JettonNumbers[slot1.nArea + 1] if slot2 == slot1.wChairID then if slot4.playerBet ~= slot1.lJetton then slot4.playerBet = slot1.lJetton TreeFunc.extractCacheWithNode(slot8) slot16 = true TreeFunc.createSpriteNumber(slot5.node_self, slot4.playerBet, slot6[1], nil, nil, 0, slot5.node_self) end slot11 = Hero slot11 = parseInt(Hero.getUserScore(slot10)) - slot1.lScore Hero.setUserScore(Hero.getUserScore, Hero) slot13 = slot0.model slot11 = slot0.model.getUserTotalJetton(slot12) + slot1.lScore slot0.model.setUserTotalJetton(Hero.getUserScore, slot0.model) slot10 = slot0 slot0.updateJettonButton(Hero.getUserScore) slot11 = true slot0._layerView.btnCancel.setEnabled(Hero.getUserScore, slot0._layerView.btnCancel) slot12 = 1 slot0._layerView.btnCancel.loadTexture(Hero.getUserScore, slot0._layerView.btnCancel, "button_cancel.png") end if slot4.totalBet ~= slot1.lTotalJetton then slot4.totalBet = slot1.lTotalJetton TreeFunc.extractCacheWithNode(slot8) slot15 = true TreeFunc.createSpriteNumberWithShortW(slot5.node_total, slot4.totalBet, slot6[3], nil, nil, slot5.node_total) end elseif slot1.cbRet == Tree.JettonRetType.RetType_ReachAreaLimit then slot6 = "下注失败,已达区域投注上限" tweenMsgMgr.showRedMsg(slot4, tweenMsgMgr) elseif slot1.cbRet == Tree.JettonRetType.RetType_ReachPersonalLimit then slot6 = "下注失败,已达个人区域投注上限" tweenMsgMgr.showRedMsg(slot4, tweenMsgMgr) elseif slot1.cbRet == Tree.JettonRetType.RetType_ZhuangXianOnlyOne then slot6 = "您不能同时下注庄、闲" tweenMsgMgr.showRedMsg(slot4, tweenMsgMgr) end end SlwhJettonCcsView.notifyJettonContinue = function (slot0, slot1) slot4 = slot1 dump(slot3) slot4 = Hero slot2 = Hero.getWChairID(slot3) if slot1.cbRet == Tree.JettonRetType.RetType_Success then for slot6 = 1, 15, 1 do slot8 = slot0._areaComponent[slot6] slot9 = slot0._layerView.layer_animal["btnBet_" .. slot7] slot10 = Tree.JettonNumbers[slot6] if slot2 == slot1.wChairID then if slot8.playerBet ~= slot1.lBet[slot6] then slot8.playerBet = slot1.lBet[slot6] TreeFunc.extractCacheWithNode(slot12) slot20 = true TreeFunc.createSpriteNumber(slot9.node_self, slot8.playerBet, slot10[1], nil, nil, 0, slot9.node_self) end slot15 = Hero slot15 = parseInt(Hero.getUserScore(slot14)) - slot1.lBet[slot6] Hero.setUserScore(Hero.getUserScore, Hero) slot17 = slot0.model slot15 = slot0.model.getUserTotalJetton(slot16) + slot1.lBet[slot6] slot0.model.setUserTotalJetton(Hero.getUserScore, slot0.model) slot14 = slot0 slot0.updateJettonButton(Hero.getUserScore) slot15 = true slot0._layerView.btnCancel.setEnabled(Hero.getUserScore, slot0._layerView.btnCancel) slot16 = 1 slot0._layerView.btnCancel.loadTexture(Hero.getUserScore, slot0._layerView.btnCancel, "button_cancel.png") end if slot8.totalBet ~= slot1.lTotalJetton[slot6] then slot8.totalBet = slot1.lTotalJetton[slot6] TreeFunc.extractCacheWithNode(slot12) slot19 = true TreeFunc.createSpriteNumberWithShortW(slot9.node_total, slot8.totalBet, slot10[3], nil, nil, slot9.node_total) end end slot6 = slot1.lBet slot0.model.setCurAreaUserBetOrder(slot4, slot0.model) elseif slot1.cbRet == Tree.JettonRetType.RetType_ReachAreaLimit then slot6 = "下注失败,已达区域投注上限" tweenMsgMgr.showRedMsg(slot4, tweenMsgMgr) elseif slot1.cbRet == Tree.JettonRetType.RetType_ReachPersonalLimit then slot6 = "下注失败,已达个人区域投注上限" tweenMsgMgr.showRedMsg(slot4, tweenMsgMgr) elseif slot1.cbRet == Tree.JettonRetType.RetType_ZhuangXianOnlyOne then slot6 = "您不能同时下注庄、闲" tweenMsgMgr.showRedMsg(slot4, tweenMsgMgr) end end SlwhJettonCcsView.jettonContinue = function (slot0) slot3 = slot0.model slot1 = slot0.model.getPreAreaUserBetOrder(slot2) for slot5 = 1, 15, 1 do if slot1[slot5] == nil then slot1[slot5] = 0 end end slot4 = slot1 reqSlwhJettonContinue(slot3) end SlwhJettonCcsView.notifyGameOver = function (slot0, slot1) slot4 = slot0.controller slot0.controller.savePreJettonMap(slot3) end SlwhJettonCcsView.exitGame = function (slot0) for slot4 = 1, 15, 1 do slot0._areaComponent[slot4].rewardTimes = -1 slot0._areaComponent[slot4].playerBet = -1 slot0._areaComponent[slot4].totalBet = -1 end for slot4 = 1, 5, 1 do slot0._buttonComponent[slot4] = -1 end end SlwhJettonCcsView.destroy = function (slot0) slot4 = slot0 TreeEventDispatcher.clearOneObjEvent(slot2, TreeEventDispatcher) end return
----------------------------------------- -- ID: 5831 -- Item: Lucid Elixir II -- Item Effect: Restores 75% of HP and MP ----------------------------------------- require("scripts/globals/settings") require("scripts/globals/msg") function onItemCheck(target) if target:getMaxHP() == target:getHP() and target:getMaxMP() == target:getMP() then return tpz.msg.basic.ITEM_UNABLE_TO_USE_2 end return 0 end function onItemUse(target) target:addHP(target:getMaxHP()*0.75*ITEM_POWER) target:addMP(target:getMaxMP()*0.75*ITEM_POWER) target:messageBasic(tpz.msg.basic.RECOVERS_HP_AND_MP) end
-- Author: Wesley, Duclier and Luis -- Lexical analyser of math language local lexer = {} -- File to be opened local file = nil local reservedWords = {'print'} local currentLine = nil local currentFileLine = 0 local currentFileColumn = 0 local currentState = 'idle' function lexer.parseFile(fileName) --file = io.open(arg[1], "r") file = io.open(fileName, "r") parse() io.close() end function getNextLine() local buffer = file:read() -- Test if exists a net line if buffer then currentFileLine = currentFileLine + 1 currentFileColumn = 0 return buffer .. '' end return nil end function getPreviousChar() if ((currentFileColumn - 1) >= 1) then currentFileColumn = currentFileColumn - 1 return currentLine:sub(currentFileColumn, currentFileColumn) else return nil end end function getNextChar() if ((currentFileColumn + 1) <= string.len(currentLine)) then currentFileColumn = currentFileColumn + 1 return currentLine:sub(currentFileColumn, currentFileColumn) else return nil end end function getLookAHead() local nextFileColumn = currentFileColumn + 1 if (nextFileColumn <= string.len(currentLine)) then return currentLine:sub(nextFileColumn, nextFileColumn) else return nil end end function isReservedWord(token) local index = {} for k,v in pairs(reservedWords) do index[v] = k end return index[token] end function isNumber(token) local numbers = {'0','1','2','3','4','5','6','7','8','9'} local index = {} for k,v in pairs(numbers) do index[v] = k end return index[token] end function isOperator(token) local operators = {'=','+','-','*','/','%','(',')'} local index = {} for k,v in pairs(operators) do index[v] = k end return index[token] end function isDelimiter(token) return token == ';' end function isAlpha(token) local characters = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'} local index = {} for k,v in pairs(characters) do index[v] = k end return index[token] end -- FSM local states = {'id','keyword', 'integer', 'real', 'operator'} local tokens = {} local currentToken = 0 function lexer.putToken(tokenType, token, row, column) table.insert(tokens, { type = tokenType, value = token, row = row, column = column }) end function lexer.hasNextToken() if (currentToken + 1) <= #tokens then return { type = tokens[currentToken + 1].type, value = tokens[currentToken + 1].value, row = tokens[currentToken + 1].row, column = tokens[currentToken + 1].column } end return nil end function lexer.getNextToken() currentToken = currentToken + 1 return tokens[currentToken] end function lexer.printTokens() currentState = 0 for k,v in pairs(tokens) do print(v.value, v.type) end end function parse() --openFile() currentLine = getNextLine() local charBuffer = '' while(currentLine) do currentChar = getNextChar() charBuffer = '' while currentChar do --ignore whitespaces while currentChar == ' ' do currentChar = getNextChar() end local lookahead = getLookAHead() charBuffer = charBuffer .. currentChar if (isReservedWord(charBuffer) and (not isAlpha(lookahead) or lookahead == nil)) then lexer.putToken('keyword', reservedWords[isReservedWord(charBuffer)], currentFileLine, (currentFileColumn - string.len(charBuffer) + 1)) -- Ignores the whitespace at next position --getNextChar() charBuffer = '' elseif(isNumber(charBuffer)) then while (isNumber(getLookAHead())) do currentChar = getNextChar() charBuffer = charBuffer .. currentChar end lexer.putToken('number', charBuffer, currentFileLine, (currentFileColumn - string.len(charBuffer) + 1)) charBuffer = '' elseif(isOperator(charBuffer)) then lexer.putToken('operator', charBuffer, currentFileLine, (currentFileColumn - string.len(charBuffer) + 1)) charBuffer = '' elseif(isDelimiter(charBuffer)) then lexer.putToken('delimiter', charBuffer, currentFileLine, (currentFileColumn - string.len(charBuffer) + 1)) charBuffer = '' --elseif(isAlpha(currentChar) and not isReservedWord(charBuffer) and (lookahead == ' ' or lookahead == nil)) then elseif(isAlpha(currentChar) and not isReservedWord(charBuffer) and (not isAlpha(lookahead) or lookahead == nil)) then lexer.putToken('id', charBuffer, currentFileLine, (currentFileColumn - string.len(charBuffer) + 1)) --getNextChar() charBuffer = '' end currentChar = getNextChar() end currentLine = getNextLine() end end -- function main() -- parse() -- while (hasNextToken()) do -- local token = lexer.getNextToken() -- print(token.value, token.type) -- end -- end -- Runs program and close buffer at program be runned --main() --io.close() return lexer
local function simpleprogram(name) cprogram { name = name, srcs = { "./"..name..".c" }, deps = { "h+emheaders", "modules/src/alloc+lib", "modules/src/data+lib", "modules/src/object+lib", "modules/src/system+lib", } } installable { name = name.."-pkg", map = { ["$(INSDIR)/bin/"..name] = "+"..name, ["$(INSDIR)/share/man/man1/"..name..".1"] = "./"..name..".1", } } end simpleprogram("abmodules") simpleprogram("aelflod") simpleprogram("anm") simpleprogram("ashow") simpleprogram("asize") simpleprogram("aslod") simpleprogram("astrip") installable { name = "pkg", map = { "+abmodules-pkg", "+aelflod-pkg", "+anm-pkg", "+ashow-pkg", "+asize-pkg", "+aslod-pkg", "+astrip-pkg", } }
require "include/protoplug" attack = 0.005 release = 0.005 polyGen.initTracks(8) pedal = false TWOPI = 2*math.pi local freq = 6*TWOPI/44100 function newChannel() new = {} new.pressure = 0 new.phase = 0 new.f = 0 new.pitch = 0 new.pitchbend = 0 new.vel = 0 return new end channels = {} for i = 1,16 do channels[i] = newChannel() end function setPitch(ch) ch.f = getFreq(ch.pitch + ch.pitchbend) end function polyGen.VTrack:init() self.channel = 0 self.f_ = 0 self.pres_ = 0 self.noise = 0 self.noise2 = 0 self.phase = 0 self.fdbck = 0 self.fv = 0 end local function curve(x) local g = 1-x return 1-g*g end function processMidi(msg) --print(msg:debug()) local ch = msg:getChannel() if(msg:isPitchBend()) then local p = msg:getPitchBendValue () if ch ~= 1 then p = (p - 8192)/8192 local pitchbend = p*48 local chn = channels[ch] chn.pitchbend = pitchbend setPitch(chn) end elseif msg:isControl() then --print(msg:getControlNumber()) if msg:getControlNumber() == 64 then pedal = msg:getControlValue() ~= 0 end elseif msg:isPressure() then if ch > 1 then channels[ch].pressure = curve(msg:getPressure()/127) end end end function polyGen.VTrack:addProcessBlock(samples, smax) local ch = channels[self.channel] if ch then for i = 0,smax do local a = attack if self.pres_ > ch.pressure then a = release end self.pres_ = self.pres_ - (self.pres_ - ch.pressure)*a --self.f_ = self.f_ - (self.f_ - ch.f)*0.002 local fa = ch.f - self.f_ self.fv = self.fv + freq*(fa - 0.4*self.fv) self.fv = math.tanh(self.fv*0.7/self.f_)*(self.f_/0.7) self.f_ = self.f_ + freq*self.fv local nse2 = math.random()-0.5 self.noise2 = self.noise2 - (self.noise2 - nse2) * 0.004 local addn = self.pres_*self.pres_*self.f_ local nse = math.random()-0.5 self.noise = self.noise - (self.noise - nse) * 0.2 self.phase = self.phase + (self.f_*TWOPI) + nse*0.5*addn + self.noise2*0.1*self.f_ local out = math.sin(self.phase + self.fdbck*(self.pres_*0.5+0.6) + self.noise*0.1) --self.phase = self.phase + (self.f_*TWOPI) --local out = math.sin(self.phase + self.fdbck*(self.pres_*0.5+0.8)) self.fdbck = out local samp = out*self.pres_ samples[0][i] = samples[0][i] + samp*0.1 -- left samples[1][i] = samples[1][i] + samp*0.1 -- right end end end function polyGen.VTrack:noteOff(note, ev) local i = ev:getChannel() local ch = channels[i] ch.pressure = 0 end function polyGen.VTrack:noteOn(note, vel, ev) local i = ev:getChannel() local vtrack = self local assignNew = true for j=1,polyGen.VTrack.numTracks do local vt = polyGen.VTrack.tracks[j] if vt.channel == i then assignNew = false vtrack = vt end end --if assignNew then vtrack.channel = i --end local ch = channels[i] ch.pitch = note ch.pressure = 0 setPitch(ch) vtrack.f_ = ch.f end function getFreq(note) local n = note - 69 local f = 440 * 2^(n/12) return f/44100 end params = plugin.manageParams { -- automatable VST/AU parameters -- note the new 1.3 way of declaring them { name = "Attack"; min = 4; max = 10; default = 5; changed = function(val) attack = math.exp(-val) end; }; { name = "Release"; min = 4; max = 12; default = 5; changed = function(val) release = math.exp(-val) end; }; }
local skynet = require("skynet") local socketdriver = require("socketdriver") local queue = require "skynet.queue" local socketfd local TAG = 'BYGATESERVER' local BYGateServer = {} local socket_pool = setmetatable( {}, { __gc = function(p) for id, v in pairs(p) do socketdriver.close(id) -- don't need clear v.buffer, because buffer pool will be free at the end p[id] = nil end end } ) local function wakeup(s) local co = s.co if co then s.co = nil skynet.wakeup(co) end end local function suspend(s) assert(not s.co) s.co = coroutine.running() skynet.wait(s.co) -- wakeup closing corouting every time suspend, -- because socket.close() will wait last socket buffer operation before clear the buffer. if s.closing then skynet.wakeup(s.closing) end end local function funcqueen( cs, func ) cs(func) end local function connect(id, func) local s = { id = id, buffer = "", connected = false, connecting = true, co = false, callback = func, protocol = "TCP", cs = queue(), } assert(not socket_pool[id], "socket is not closed") socket_pool[id] = s suspend(s) local err = s.connecting s.connecting = nil if s.connected then return id else socket_pool[id] = nil return nil, err end end function BYGateServer.openclient(fd, func) -- Log.i(TAG, "openclient fd = %s, func = %s", fd, func) socketdriver.start(fd) return connect(fd, func) end function BYGateServer.closelient(fd, func) -- Log.i(TAG, "closelient fd = %s, func = %s", fd, func) local s = socket_pool[fd] if s then if s.connected then func(fd) end end end local function close_fd(fd, func) -- Log.i(TAG, "close_fd fd = %s, func = %s", fd, func) local s = socket_pool[fd] if s then if s.connected then func(fd) end end end function BYGateServer.shutdown(id) close_fd(id, socketdriver.shutdown) end function BYGateServer.close_fd(id) assert(socket_pool[id] == nil,"Use socket.close instead") socketdriver.close(id) end function BYGateServer.close(id) local s = socket_pool[id] if s == nil then return end if s.connected then socketdriver.close(id) -- notice: call socket.close in __gc should be carefully, -- because skynet.wait never return in __gc, so driver.clear may not be called if s.co then -- reading this socket on another coroutine, so don't shutdown (clear the buffer) immediately -- wait reading coroutine read the buffer. assert(not s.closing) s.closing = coroutine.running() skynet.wait(s.closing) else suspend(s) end s.connected = false end close_fd(id) -- clear the buffer (already close fd) assert(s.lock == nil or next(s.lock) == nil) socket_pool[id] = nil end function BYGateServer.start(handler) assert(handler.message) assert(handler.connect) local CMD = {} function CMD.open(source, conf) assert(not socketfd) local ip = conf.ip or '0.0.0.0' local port = assert(conf.port) maxclient = conf.maxclient or 1024 nodelay = conf.nodelay if handler.open then handler.open(source, conf, false) end Log.i(TAG, string.format('listen on %s:%s', ip, port)) socketfd = socketdriver.listen(ip, port) socketdriver.start(socketfd) connect(socketfd, handler.connect) end -- 主动链接一个端口 function CMD.connect(source, conf) -- Log.i(TAG, "connect source = %s, ip = %s, port = %s", source, conf.ip, conf.port) socketfd = socketdriver.connect(conf.ip, conf.port) if handler.open then handler.open(source, conf, true) end assert(socketfd) connect(socketfd) end function CMD.close() -- Log.i(TAG, 'CMD close') assert(socketfd) socketdriver.close(socketfd) end local function unpack_package( fd, info) -- Log.d(TAG, "fd = %s", fd) local s = socket_pool[fd] if s == nil then return end s.buffer = s.buffer .. info while(true) do local size = string.len(s.buffer) -- Log.d(TAG, "buffer size = %s", size) if size < 2 then Log.d(TAG, string.format("fd [%d] data size[%d] less than 2",fd,size)); return end local pack_len = string.unpack(">I2", s.buffer) -- Log.d(TAG, "pack_len = %s", pack_len) if size < pack_len + 2 then Log.d(TAG, string.format("fd[%d] data size[%d] < pack_len[%d] + 2",fd,size, pack_len)); return end local data = s.buffer:sub(1, pack_len + 2) local cmd = string.unpack(">I2", data, 7) s.buffer = s.buffer:sub(3 + pack_len) handler.message(fd, cmd, data) local size = string.len(s.buffer) if size < 2 then break end end end local MSG = {} -- read skynet_socket.h for these macro -- SKYNET_SOCKET_TYPE_DATA = 1 MSG[1] = function(id, size, data) -- Log.d(TAG, "id = %s, size = %s", id, size) local s = socket_pool[id] if not s then Log.e(TAG, "socket drop packet for id %s", id) socketdriver.drop(data, size) end local info = skynet.tostring(data, size) socketdriver.drop(data, size) s.cs(unpack_package, id, info) end -- SKYNET_SOCKET_TYPE_CONNECT = 2 MSG[2] = function(id, xx, address) -- Log.d(TAG, "id = %s, xx = %s, address = %s", id, xx, address) local s = socket_pool[id] if not s then return end s.connected = true wakeup(s) if handler.connected then handler.connected(id, address) end end -- SKYNET_SOCKET_TYPE_CLOSE = 3 MSG[3] = function(id) -- Log.d(TAG, "msgType = %s, id = %s", 3, id) local s = socket_pool[id] if s == nil then return end s.connected = false wakeup(s) if handler.disconnect then handler.disconnect(id) end end -- SKYNET_SOCKET_TYPE_ACCEPT = 4 MSG[4] = function(id, newid, addr) -- Log.d(TAG, "msgType = %s, id = %s, newid = %s, addr = %s", 4, id, newid, addr) local s = socket_pool[id] if s == nil then socketdriver.close(newid) return end s.callback(newid, addr) end -- SKYNET_SOCKET_TYPE_ERROR = 5 MSG[5] = function(id, _, err) -- Log.d(TAG, "msgType = %s, id = %s, _ = %s, err = %s", 5, id, _, err) local s = socket_pool[id] if s == nil then Log.e(TAG, "socket: error on unknown id = %s, err = %s", id, err) return end if s.connected then Log.e(TAG, "socket: error on id = %s, err = %s", id, err) elseif s.connecting then s.connecting = err end s.connected = false socketdriver.shutdown(id) wakeup(s) end -- SKYNET_SOCKET_TYPE_UDP = 6 MSG[6] = function(id, size, data, address) -- udp , now don't need Log.d(TAG, "msgType = %s, id = %s, size = %s, data = %s, address", 6, id, size, data, address) end -- SKYNET_SOCKET_TYPE_WARNING = 7 MSG[7] = function(id, size) Log.d(TAG, "msgType = %s, id = %s, size = %s", 7, id, size); local s = socket_pool[id] if s then -- local warning = s.warning or default_warning -- warning(id, size) end end skynet.register_protocol { name = "socket", id = skynet.PTYPE_SOCKET, -- PTYPE_SOCKET = 6 unpack = socketdriver.unpack, dispatch = function (_, _, t, ...) Log.d(TAG, "msgType = [%s], socketfd = [%s]", t, tostring(...)); MSG[t](...) end } skynet.start(function() skynet.dispatch("lua", function (_, address, cmd, ...) -- Log.d(TAG, 'address = %s, cmd = %s', address, cmd) local f = CMD[cmd] if f then skynet.ret(skynet.pack(f(address, ...))) else skynet.ret(skynet.pack(handler.command(cmd, address, ...))) end end) end) end return BYGateServer