content
stringlengths
5
1.05M
#!/usr/bin/lua require("power") A = torch.FloatTensor():rand(5,3) b = square(A) print(b) print(cube(5))
local PacketType = require "lumina.protocol.packet.packet_type" local test_utils = require "spec.test_utils" describe("PacketType", function() it("round trip encoding", function() for i=1,14 do local value = assert(PacketType.from(i)) local bytes = value:encode() local back = assert(PacketType.decode(test_utils.generate_source(bytes))) assert.are.same(value, back) end end) it("bad ctor", function() for i=1,14 do local value, err = PacketType.from(1, "") assert(not value and err, "expected error for string flags") end end) it("invalid flags", function() for i=1,14 do local value, err = PacketType.from(1, 9) assert(not value and err, "expected error for invalid flags") end end) describe("bad from ctor", function() it("non-integer value", function() local value, err = PacketType.from(nil, 9) assert(not value and err, "expected error from PacketType.from(nil, ...)") end) it("value too big", function() local value, err = PacketType.from(20, 9) assert(not value and err, "expected error from PacketType.from(nil, ...)") end) it("flags too big", function() local value, err = PacketType.from(1, 999) assert(not value and err, "expected error from PacketType.from(nil, ...)") end) it("bad flags for publish", function() local value, err = PacketType.from(3, 15) assert(not value and err, "expected error from PacketType.from(nil, ...)") end) end) end)
-- Generated by CSharp.lua Compiler local System = System System.namespace("Slipe.Client.Vehicles.Events", function (namespace) namespace.class("OnNitroStateChangeEventArgs", function (namespace) local __ctor__ __ctor__ = function (this, b) this.State = System.cast(System.Boolean, b) end return { State = false, __ctor__ = __ctor__, __metadata__ = function (out) return { properties = { { "State", 0x6, System.Boolean } }, methods = { { ".ctor", 0x104, nil, System.Object } }, class = { 0x6 } } end } end) end)
shikamaru_meditation = shikamaru_meditation or class({}) LinkLuaModifier("modifier_meditation_negative", "abilities/heroes/shikamaru/shikamaru_meditation.lua", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_meditation_positive", "abilities/heroes/shikamaru/shikamaru_meditation.lua", LUA_MODIFIER_MOTION_NONE) function shikamaru_meditation:ProcsMagicStick() return true end function shikamaru_meditation:OnSpellStart() local ability = self local caster = self:GetCaster() local radius = ability:GetSpecialValueFor("radius") local duration = ability:GetSpecialValueFor("duration") caster:EmitSound("Hero_Dazzle.Weave") local targets = FindUnitsInRadius( caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, radius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false ) local modifier_name_debuff = "modifier_meditation_negative" local abilityS = self:GetCaster():FindAbilityByName("special_bonus_shikamaru_3") if abilityS ~= nil then if abilityS:GetLevel() > 0 then duration = duration + 2 end end for _, unit in pairs(targets) do unit:AddNewModifier(caster, ability, modifier_name_debuff, {duration = duration}) end local friends = FindUnitsInRadius( caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, radius, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, 0, 0, false ) local modifier_name = "modifier_meditation_positive" for _, unit in pairs(friends) do unit:AddNewModifier(caster, ability, modifier_name, {duration = duration}) end end modifier_meditation_negative = modifier_meditation_negative or class({}) function modifier_meditation_negative:IsHidden() return false end function modifier_meditation_negative:IsPurgable() return false end function modifier_meditation_negative:IsDebuff() return true end function modifier_meditation_negative:OnCreated(keys) -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() local abilityS = self:GetCaster():FindAbilityByName("special_bonus_shikamaru_3") if abilityS ~= nil then if abilityS:GetLevel() > 0 then self.stacks = (self.ability:GetSpecialValueFor("armor") + 2) * -1 else self.stacks = self.ability:GetSpecialValueFor("armor") * -1 end end -- Start interval self:StartIntervalThink( 1.0 ) end function modifier_meditation_negative:OnIntervalThink(keys) self.stacks = self.stacks + 1 end function modifier_meditation_negative:DeclareFunctions() return { MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS } end function modifier_meditation_negative:GetModifierPhysicalArmorBonus() return self.stacks end modifier_meditation_positive = modifier_meditation_positive or class({}) function modifier_meditation_positive:IsHidden() return false end function modifier_meditation_positive:IsPurgable() return false end function modifier_meditation_positive:IsBuff() return true end function modifier_meditation_positive:OnCreated(keys) -- Ability properties self.caster = self:GetCaster() self.ability = self:GetAbility() self.parent = self:GetParent() local abilityS = self:GetCaster():FindAbilityByName("special_bonus_shikamaru_3") if abilityS ~= nil then if abilityS:GetLevel() > 0 then self.stacks = self.ability:GetSpecialValueFor("armor") + 2 else self.stacks = self.ability:GetSpecialValueFor("armor") end end -- Start interval self:StartIntervalThink( 1.0 ) end function modifier_meditation_positive:OnIntervalThink(keys) self.stacks = self.stacks - 1 end function modifier_meditation_positive:DeclareFunctions() return { MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS } end function modifier_meditation_positive:GetModifierPhysicalArmorBonus() return self.stacks end
libHDiffPatch = { source = path.join(dependencies.basePath, "HDiffPatch/libHDiffPatch"), } function libHDiffPatch.import() links { "libHDiffPatch" } libHDiffPatch.includes() end function libHDiffPatch.includes() includedirs { path.join(libHDiffPatch.source, "HDiff"), path.join(libHDiffPatch.source, "HPatch"), } end function libHDiffPatch.project() project "libHDiffPatch" language "C" libHDiffPatch.includes() files { path.join(libHDiffPatch.source, "HDiff/**.h"), path.join(libHDiffPatch.source, "HDiff/**.c"), path.join(libHDiffPatch.source, "HDiff/**.cpp"), path.join(libHDiffPatch.source, "HPatch/**.h"), path.join(libHDiffPatch.source, "HPatch/**.c"), } warnings "Off" kind "StaticLib" end table.insert(dependencies, libHDiffPatch)
module("luci.controller.xderm-gui", package.seeall) function index() entry({"admin","vpn","xderm-gui"}, template("xderm-gui"), _("Xderm Mini"), 1).leaf=true end
require('constants') require('tower_student_common') tower_student_common.chat(BLANK_SCROLL_ID, 3, "unstoning_potion", "RUNIC_STUDENT_TRADE_SID", "TOWER_STUDENT_ACCEPT_SID", "TOWER_STUDENT_SHRUG_SID", "TOWER_STUDENT_DEFAULT_SID")
-- Lsp Mappings local List = require "pl.List" local M = {} local opts = { noremap = true, silent = true, buffer = 0 } local mappings = { { "n", "gD", vim.lsp.buf.declaration }, { "n", "gd", vim.lsp.buf.definition }, { "n", "K", vim.lsp.buf.hover }, { "n", "gi", vim.lsp.buf.implementation }, { "n", "<C-k>", vim.lsp.buf.signature_help }, { "n", "<leader>rn", vim.lsp.buf.rename }, { "n", "gr", vim.lsp.buf.references }, { "n", "<leader>ca", vim.lsp.buf.code_action }, { "n", "[d", function() vim.diagnostic.goto_prev { border = "rounded" } end, }, { "n", "gl", function() vim.diagnostic.open_float { border = "rounded" } end, }, { "n", "]d", function() vim.diagnostic.goto_next { border = "rounded" } end, }, { "n", "<leader>q", vim.diagnostic.setloclist }, } M.map = function() List(mappings):foreach(function(mapping) vim.keymap.set(mapping[1], mapping[2], mapping[3], opts) end) end return M
return {'epo','epoche','eponiem','epopee','epoque','epos','epotest','epoxyhars','epoxyverf','epoxyverven','eponiemenwoordenboek','epoxy','epossen','epoxyharsen','epochen','eponiemen','epopeeen','epoque','epoques'}
return { mod_name = { en = "Execute External Lua File" }, mod_description = { en = "Executes 'mods/exec.lua' file in your 'Warhammer Vermintide 2' Steam folder." }, exec_hotkey = { en = "Execute File Hotkey" }, exec_hotkey_tooltip = { en = "Execute the file when you press this hotkey." }, F1_EXEC = { en = "Bind Execute To F1" }, F1_EXEC_T = { en = "Bind the hotkey in code so it can be used inside game menus." .."\nIf hotkey is F1 as well the file will be executed twice!" }, }
----------------------------------- -- Area: Yuhtunga Jungle -- Mob: Voluptuous Vilma ----------------------------------- local ID = require("scripts/zones/Yuhtunga_Jungle/IDs") ----------------------------------- function onMobDeath(mob, player, isKiller) end function onMobDespawn(mob) DisallowRespawn(ID.mob.VOLUPTUOUS_VILMA, true) DisallowRespawn(ID.mob.ROSE_GARDEN_PH, false) GetMobByID(ID.mob.ROSE_GARDEN_PH):setRespawnTime(GetMobRespawnTime(ID.mob.ROSE_GARDEN_PH)) end
local aspawn = require("awful.spawn") local gtimer = require("gears.timer") local fs_info = {} local hdds = disks or { "home" } local function sformat_in_giga(value) return string.format("%.1f", value/1024^2) end local function disks_info() aspawn.with_line_callback('sh -c "df -kP"', { stdout = function(line) local s, u, a, p, m = line:match("^.-%s+(%d+)%s+(%d+)%s+(%d+)%s+(%d+)%%%s+([%p%w]+)") -- check if it's match with myfs and add to the table for _, fs in pairs(hdds) do if m ~= nil and m:match(fs) then if u and m then -- Handle 1st line and broken regexp fs_info[_] = {} fs_info[_]["size"] = sformat_in_giga(s) fs_info[_]["used"] = sformat_in_giga(u) fs_info[_]["available"] = sformat_in_giga(a) fs_info[_]["used_percent"] = p fs_info[_]["mountpoint"] = m end end end end}) awesome.emit_signal("daemon::disks", fs_info) end -- update every 50 seconds gtimer { timeout = 50, autostart = true, call_now = true, callback = function() disks_info() end }
object_tangible_wearables_armor_armor_imperial_guard_saber_armor_imperial_guard_saber_bicep_l = object_tangible_wearables_armor_armor_imperial_guard_saber_shared_armor_imperial_guard_saber_bicep_l:new { } ObjectTemplates:addTemplate(object_tangible_wearables_armor_armor_imperial_guard_saber_armor_imperial_guard_saber_bicep_l, "object/tangible/wearables/armor/armor_imperial_guard_saber/armor_imperial_guard_saber_bicep_l.iff")
local Root = script.Parent.Parent local AccountInfoReceived = require(Root.Actions.AccountInfoReceived) local PurchaseCompleteRecieved = require(Root.Actions.PurchaseCompleteRecieved) local ErrorOccurred = require(Root.Actions.ErrorOccurred) local PurchaseError = require(Root.Enums.PurchaseError) local PromptState = require(Root.Enums.PromptState) local RequestType = require(Root.Enums.RequestType) local getAccountInfo = require(Root.Network.getAccountInfo) local Network = require(Root.Services.Network) local ExternalSettings = require(Root.Services.ExternalSettings) local completeRequest = require(Root.Thunks.completeRequest) local getPlayerPrice = require(Root.Utils.getPlayerPrice) local Thunk = require(Root.Thunk) local purchaseItem = require(script.Parent.purchaseItem) local MAX_RETRIES = 3 local RETRY_RATE = 1 local requiredServices = { Network, ExternalSettings, } local function retryAfterUpsell(retriesRemaining) retriesRemaining = retriesRemaining or MAX_RETRIES return Thunk.new(script.Name, requiredServices, function(store, services) local network = services[Network] local externalSettings = services[ExternalSettings] local state = store:getState() local requestType = state.promptRequest.requestType local promptState = state.promptState if requestType == RequestType.Premium then if promptState == PromptState.UpsellInProgress then store:dispatch(PurchaseCompleteRecieved()) store:dispatch(completeRequest()) end else return getAccountInfo(network, externalSettings) :andThen(function(accountInfo) local state = store:getState() local isPlayerPremium = state.accountInfo.membershipType == 4 local price = getPlayerPrice(state.productInfo, isPlayerPremium) local balance = accountInfo.RobuxBalance store:dispatch(AccountInfoReceived(accountInfo)) if price ~= nil and price > balance then if retriesRemaining > 0 then -- Upsell result may not yet have propagated, so we need to -- wait a while and try again delay(RETRY_RATE, function() store:dispatch(retryAfterUpsell(retriesRemaining - 1)) end) else store:dispatch(ErrorOccurred(PurchaseError.InvalidFunds)) end else -- Upsell was successful and purchase can now be completed store:dispatch(purchaseItem()) end end) :catch(function(error) store:dispatch(ErrorOccurred(error)) end) end end) end return retryAfterUpsell
------------------------------------------------------------------------------- -- Coordinate normalization ------------------------------------------------------------------------------- function normCoords(bbox, keypoints, size, scale) -- get crop region coordinates local xc = (bbox[1]+bbox[3])/2 local yc = (bbox[2]+bbox[4])/2 local width = (bbox[3]-bbox[1])+1 local height = (bbox[5]-bbox[2])+1 -- get maximum size of the bbox local max_size = math.max(width, height) -- get a square bbox around the center of the bbox and add a small scaling effect local crop_coords if width > height then local diff = (width - height)/2 local w_offset = (width/2) * scale local h_offset = (height/2+diff) * scale crop_coords = {xc-w_offset,yc-h_offset,xc+w_offset,yc+h_offset} else local diff = (height - width)/2 local w_offset = (width/2+diff) * scale local h_offset = (height/2) * scale crop_coords = {xc-w_offset,yc-h_offset,xc+w_offset,yc+h_offset} end -- set new keypoints coordinates local new_keypoints = keypoints:clone():fill(0) local new_max_size = crop_coords[3]-crop_coords[1] for i=1, keypoints:size(1) do keypoints[i][1] = keypoints[i][1] - crop_coords[1] / new_max_size * size keypoints[i][2] = keypoints[i][2] - crop_coords[2] / new_max_size * size end -- output return crop_coords, new_keypoints end ------------------------------------------------------------------------------- -- Coordinate transformation ------------------------------------------------------------------------------- function getTransform(center, scale, rot, res) local h = 200 * scale local t = torch.eye(3) -- Scaling t[1][1] = res / h t[2][2] = res / h -- Translation t[1][3] = res * (-center[1] / h + .5) t[2][3] = res * (-center[2] / h + .5) -- Rotation if rot ~= 0 then rot = -rot local r = torch.eye(3) local ang = rot * math.pi / 180 local s = math.sin(ang) local c = math.cos(ang) r[1][1] = c r[1][2] = -s r[2][1] = s r[2][2] = c -- Need to make sure rotation is around center local t_ = torch.eye(3) t_[1][3] = -res/2 t_[2][3] = -res/2 local t_inv = torch.eye(3) t_inv[1][3] = res/2 t_inv[2][3] = res/2 t = t_inv * r * t_ * t end return t end function transform(pt, center, scale, rot, res, invert) local pt_ = torch.ones(3) pt_[1],pt_[2] = pt[1]-1,pt[2]-1 local t = getTransform(center, scale, rot, res) if invert then t = torch.inverse(t) end local new_point = (t*pt_):sub(1,2) return new_point:int():add(1) end function transformBenchmark(pt, center, scale, rot, res, invert) local pt_ = torch.ones(3) pt_[1] = pt[1] pt_[2] = pt[2] local t = getTransform(center, scale, rot, res) if invert then t = torch.inverse(t) end local new_point = (t*pt_):sub(1,2):int() return new_point end function transformPreds(coords, center, scale, res) local origDims = coords:size() coords = coords:view(-1,2) local newCoords = coords:clone() for i = 1,coords:size(1) do newCoords[i] = transform(coords[i], center, scale, 0, res, 1) end return newCoords:view(origDims) end --[[ function mytransform(pt, center, scale, rot, res, invert) local pt_ = torch.ones(3) pt_[1],pt_[2] = pt[1],pt[2] local h = 200 * scale local t = torch.eye(3) -- Scaling t[1][1] = res / h t[2][2] = res / h -- Translation t[1][3] = res * (-center[1] / h + .5) t[2][3] = res * (-center[2] / h + .5) -- rotation matrix if rot ~= 0 then local rotation = -rot local r = torch.eye(3) local ang = rotation * math.pi / 180 local s = math.sin(ang) local c = math.cos(ang) r[1][1] = c r[1][2] = -s r[2][1] = s r[2][2] = c -- Need to make sure rotation is around center local t_ = torch.eye(3) t_[1][3] = -res/2 t_[2][3] = -res/2 local t_inv = torch.eye(3) t_inv[1][3] = res/2 t_inv[2][3] = res/2 t = t_inv * r * t_ * t end if invert then t = torch.inverse(t) end -- process transformation local new_point = (t*pt_):sub(1,2) return new_point end --]] function mytransform(pt, center, scale, rot, res, invert) local pt_ = torch.ones(3) pt_[1] = pt[1] pt_[2] = pt[2] local t = getTransform(center, scale, rot, res) if invert then t = torch.inverse(t) end local new_point = (t*pt_):sub(1,2) return new_point end ------------------------------------------------------------------------------- -- Cropping ------------------------------------------------------------------------------- function checkDims(dims) return dims[3] < dims[4] and dims[5] < dims[6] end function crop2(img, center, scale, rot, res) local ndim = img:nDimension() if ndim == 2 then img = img:view(1,img:size(1),img:size(2)) end local ht,wd = img:size(2), img:size(3) local tmpImg,newImg = img, torch.zeros(img:size(1), res, res) -- Modify crop approach depending on whether we zoom in/out -- This is for efficiency in extreme scaling cases local scaleFactor = (200 * scale) / res if scaleFactor < 2 then scaleFactor = 1 else local newSize = math.floor(math.max(ht,wd) / scaleFactor) if newSize < 2 then -- Zoomed out so much that the image is now a single pixel or less if ndim == 2 then newImg = newImg:view(newImg:size(2),newImg:size(3)) end return newImg else tmpImg = image.scale(img,newSize) ht,wd = tmpImg:size(2),tmpImg:size(3) end end -- Calculate upper left and bottom right coordinates defining crop region local c,s = center:float()/scaleFactor, scale/scaleFactor local ul = transform({1,1}, c, s, 0, res, true) local br = transform({res+1,res+1}, c, s, 0, res, true) if scaleFactor >= 2 then br:add(-(br - ul - res)) end -- If the image is to be rotated, pad the cropped area local pad = math.ceil(torch.norm((ul - br):float())/2 - (br[1]-ul[1])/2) if rot ~= 0 then ul:add(-pad); br:add(pad) end -- Define the range of pixels to take from the old image local old_ = {1,-1,math.max(1, ul[2]), math.min(br[2], ht+1) - 1, math.max(1, ul[1]), math.min(br[1], wd+1) - 1} -- And where to put them in the new image local new_ = {1,-1,math.max(1, -ul[2] + 2), math.min(br[2], ht+1) - ul[2], math.max(1, -ul[1] + 2), math.min(br[1], wd+1) - ul[1]} -- Initialize new image and copy pixels over local newImg = torch.zeros(img:size(1), br[2] - ul[2], br[1] - ul[1]) if not pcall(function() newImg:sub(unpack(new_)):copy(tmpImg:sub(unpack(old_))) end) then print("Error occurred during crop!") end if rot ~= 0 then -- Rotate the image and remove padded area newImg = image.rotate(newImg, rot * math.pi / 180, 'bilinear') newImg = newImg:sub(1,-1,pad+1,newImg:size(2)-pad,pad+1,newImg:size(3)-pad):clone() end if scaleFactor < 2 then newImg = image.scale(newImg,res,res) end if ndim == 2 then newImg = newImg:view(newImg:size(2),newImg:size(3)) end return newImg end function twoPointCrop(img, s, pt1, pt2, pad, res) local center = (pt1 + pt2) / 2 local scale = math.max(20*s,torch.norm(pt1 - pt2)) * .007 scale = scale * pad local angle = math.atan2(pt2[2]-pt1[2],pt2[1]-pt1[1]) * 180 / math.pi - 90 return crop(img, center, scale, angle, res) end function mycrop(img, center, scale, rot, res) -- setup parameters local rescale_factor = (200*scale)/res local ht,wd = img:size(2), img:size(3) local newSize = math.floor(math.max(ht,wd) / rescale_factor) local c_ = center:float()/rescale_factor c_=c_:int() -- apply scalling local img_scaled = image.scale(img, newSize) local offset = res/2 local out = torch.FloatTensor(3, res+offset, res+offset):fill(0) local offset_left, offset_top = (res+offset)/2, (res+offset)/2 local offset_right, offset_bot = (res+offset)/2-1, (res+offset)/2-1 -- (set copy limits) local x1,y1 = math.max(1,c_[1]-offset_left),math.max(1,c_[2]-offset_top) local x2,y2 = math.min(img_scaled:size(3),c_[1]+offset_right),math.min(img_scaled:size(2),c_[2]+offset_bot) local x1_,y1_ = offset_left-(c_[1]-x1)+1, offset_top-(c_[2]-y1)+1 local x2_,y2_ = x1_+(x2-x1), y1_+(y2-y1) -- (copy data to the output tensor) assert(y1_>0 and y2_>0 and x1_>0 and x2_>0, 'One of this variables is smaller than 1: x1_,y1_,x2_,y2_') out[{{},{y1_,y2_},{x1_,x2_}}]:copy(img_scaled[{{},{y1,y2},{x1,x2}}]) -- apply rotation if rot ~= 0 then out = image.rotate(out, rot * math.pi / 180, 'bilinear') end -- apply cropping (center) out = image.crop(out,'c',res,res) return out end ------------------------------------------------------------------------------- -- Non-maximum Suppression ------------------------------------------------------------------------------- function localMaxes(hm, n, c, s, hmIdx, nmsWindowSize) -- Set up max network for NMS local nmsWindowSize = nmsWindowSize or 3 local nmsPad = (nmsWindowSize - 1)/2 local maxlayer = nn.Sequential() if cudnn then maxlayer:add(cudnn.SpatialMaxPooling(nmsWindowSize, nmsWindowSize,1,1, nmsPad, nmsPad)) maxlayer:cuda() else maxlayer:add(nn.SpatialMaxPooling(nmsWindowSize, nmsWindowSize,1,1, nmsPad,nmsPad)) maxlayer:float() end maxlayer:evaluate() local hmSize = torch.totable(hm:size()) hm = torch.Tensor(1,unpack(hmSize)):copy(hm):float() if hmIdx then hm = hm:sub(1,-1,hmIdx,hmIdx) end local hmDim = hm:size() local max_out -- First do nms if cudnn then max_out = maxlayer:forward(hm:cuda()) cutorch.synchronize() else max_out = maxlayer:forward(hm) end local nms = torch.cmul(hm, torch.eq(hm, max_out:float()):float())[1] -- Loop through each heatmap retrieving top n locations, and their scores local predCoords = torch.Tensor(hmDim[2], n, 2) local predScores = torch.Tensor(hmDim[2], n) for i = 1, hmDim[2] do local nms_flat = nms[i]:view(nms[i]:nElement()) local vals,idxs = torch.sort(nms_flat,1,true) for j = 1,n do local pt = {(idxs[j]-1) % hmSize[3] + 1, math.floor((idxs[j]-1) / hmSize[3]) + 1 } if c then predCoords[i][j] = transform(pt, c, s, 0, hmSize[#hmSize], true) else predCoords[i][j] = torch.Tensor(pt) end predScores[i][j] = vals[j] end end return predCoords, predScores end ------------------------------------------------------------------------------- -- Draw gaussian ------------------------------------------------------------------------------- function drawGaussian(img, pt, sigma) -- Draw a 2D gaussian -- Check that any part of the gaussian is in-bounds local tmpSize = math.ceil(3*sigma) local ul = {math.floor(pt[1] - tmpSize), math.floor(pt[2] - tmpSize)} local br = {math.floor(pt[1] + tmpSize), math.floor(pt[2] + tmpSize)} -- If not, return the image as is if (ul[1] > img:size(2) or ul[2] > img:size(1) or br[1] < 1 or br[2] < 1) then return img end -- Generate gaussian local size = 2*tmpSize + 1 local g = image.gaussian(size) -- Usable gaussian range local g_x = {math.max(1, -ul[1]), math.min(br[1], img:size(2)) - math.max(1, ul[1]) + math.max(1, -ul[1])} local g_y = {math.max(1, -ul[2]), math.min(br[2], img:size(1)) - math.max(1, ul[2]) + math.max(1, -ul[2])} -- Image range local img_x = {math.max(1, ul[1]), math.min(br[1], img:size(2))} local img_y = {math.max(1, ul[2]), math.min(br[2], img:size(1))} assert(g_x[1] > 0 and g_y[1] > 0) img:sub(img_y[1], img_y[2], img_x[1], img_x[2]):cmax(g:sub(g_y[1], g_y[2], g_x[1], g_x[2])) return img end function drawLine(img, pt1, pt2, width, color) if img:nDimension() == 2 then img = img:view(1,img:size(1),img:size(2)) end local nChannels = img:size(1) color = color or torch.ones(nChannels) if type(pt1) == 'table' then pt1 = torch.Tensor(pt1) end if type(pt2) == 'table' then pt2 = torch.Tensor(pt2) end m = pt1:dist(pt2) dy = (pt2[2] - pt1[2])/m dx = (pt2[1] - pt1[1])/m for j = 1,width do start_pt1 = torch.Tensor({pt1[1] + (-width/2 + j-1)*dy, pt1[2] - (-width/2 + j-1)*dx}) start_pt1:ceil() for i = 1,torch.ceil(m) do y_idx = torch.ceil(start_pt1[2]+dy*i) x_idx = torch.ceil(start_pt1[1]+dx*i) if y_idx - 1 > 0 and x_idx -1 > 0 and y_idx < img:size(2) and x_idx < img:size(3) then for j = 1,nChannels do img[j]:sub(y_idx-1,y_idx,x_idx-1,x_idx):fill(color[j]) end end end end end ------------------------------------------------------------------------------- -- Flipping functions ------------------------------------------------------------------------------- function shuffleLR(x) local dim if x:nDimension() == 4 then dim = 2 else assert(x:nDimension() == 3) dim = 1 end local matchedParts if opt.dataset == 'mpii' then matchedParts = { {1,6}, {2,5}, {3,4}, {11,16}, {12,15}, {13,14} } elseif opt.dataset == 'flic' then matchedParts = { {1,4}, {2,5}, {3,6}, {7,8}, {9,10} } elseif opt.dataset == 'lsp' or opt.dataset =='lsp+mpii' then matchedParts = { {1,6}, {2,5}, {3,4}, {7,12}, {8,11}, {9,10} } elseif opt.dataset == 'coco' then matchedParts = { {2,3}, {4,5}, {6,7}, {8,9}, {10,11}, {12,13}, {14,15}, {16,17} } end for i = 1,#matchedParts do local idx1, idx2 = unpack(matchedParts[i]) local tmp = x:narrow(dim, idx1, 1):clone() x:narrow(dim, idx1, 1):copy(x:narrow(dim, idx2, 1)) x:narrow(dim, idx2, 1):copy(tmp) end return x end function flip(x) require 'image' local y = torch.FloatTensor(x:size()) for i = 1, x:size(1) do image.hflip(y[i], x[i]:float()) end return y:typeAs(x) end
local ffi = require "ffi" local ffi_new = ffi.new local ffi_typeof = ffi.typeof local ffi_cdef = ffi.cdef local ffi_str = ffi.string local assert = assert local setmetatable = setmetatable local nettle = require "resty.nettle" ffi_cdef[[ typedef struct salsa20_ctx { uint32_t input[16]; } SALSA20_CTX; void nettle_salsa20_128_set_key(struct salsa20_ctx *ctx, const uint8_t *key); void nettle_salsa20_256_set_key(struct salsa20_ctx *ctx, const uint8_t *key); void nettle_salsa20_set_nonce(struct salsa20_ctx *ctx, const uint8_t *nonce); void nettle_salsa20_crypt(struct salsa20_ctx *ctx, size_t length, uint8_t *dst, const uint8_t *src); void nettle_salsa20r12_crypt(struct salsa20_ctx *ctx, size_t length, uint8_t *dst, const uint8_t *src); ]] local uint8t = ffi_typeof "uint8_t[?]" local ctxs20 = ffi_typeof "SALSA20_CTX[1]" local setkey128 = nettle.nettle_salsa20_128_set_key local setkey256 = nettle.nettle_salsa20_256_set_key local setnonce = nettle.nettle_salsa20_set_nonce local crypt = nettle.nettle_salsa20_crypt local crypt12 = nettle.nettle_salsa20r12_crypt local salsa20r12 = {} salsa20r12.__index = salsa20r12 function salsa20r12:encrypt(src) local len = #src local dst = ffi_new(uint8t, len) crypt12(self.context, len, dst, src) return ffi_str(dst, len) end function salsa20r12:decrypt(src) local len = #src local dst = ffi_new(uint8t, len) crypt12(self.context, len, dst, src) return ffi_str(dst, len) end local salsa20 = {} salsa20.__index = salsa20 function salsa20.new(key, nonce, rounds) local len = #key assert(len == 16 or len == 32, "The Salsa20 supported key sizes are 128, and 256 bits.") local ctx = ffi_new(ctxs20) if len == 16 then setkey128(ctx, key) else setkey256(ctx, key) end if nonce then assert(#nonce == 8, "The Salsa20 supported nonce size is 64 bits.") setnonce(ctx, nonce) end rounds = rounds or 20 assert(rounds == 12 or rounds == 20, "The Salsa20 supported rounds are 12, and 20. The recommended rounds is 20.") if rounds == 20 then return setmetatable({ context = ctx }, salsa20) end return setmetatable({ context = ctx }, salsa20r12) end function salsa20:encrypt(src) local len = #src local dst = ffi_new(uint8t, len) crypt(self.context, len, dst, src) return ffi_str(dst, len) end function salsa20:decrypt(src) local len = #src local dst = ffi_new(uint8t, len) crypt(self.context, len, dst, src) return ffi_str(dst, len) end return salsa20
local _M = { conf = {} } local http = require "resty.http" local pl_stringx = require "pl.stringx" local cjson = require "cjson.safe" function _M.error_response(message, status) local jsonStr = '{"data":[],"error":{"code":' .. status .. ',"message":"' .. message .. '"}}' ngx.header['Content-Type'] = 'application/json' ngx.status = status ngx.say(jsonStr) ngx.exit(status) end function _M.introspect_access_token_req(access_token) local httpc = http.new() local res, err = httpc:request_uri(_M.conf.introspection_endpoint, { method = "POST", body = "token_type_hint=access_token&token=" .. access_token .. "&client_id=" .. _M.conf.client_id .. "&client_secret=" .. _M.conf.client_secret, headers = { ["Content-Type"] = "application/x-www-form-urlencoded" } }) if not res then return { status = 0 } end if res.status ~= 200 then return { status = res.status } end return { status = res.status, body = res.body } end function _M.introspect_access_token(access_token) if _M.conf.token_cache_time > 0 then local cache_id = "at:" .. access_token local res, err = kong.cache:get(cache_id, { ttl = _M.conf.token_cache_time }, _M.introspect_access_token_req, access_token) if err then _M.error_response("Unexpected error: " .. err, ngx.HTTP_INTERNAL_SERVER_ERROR) end -- not 200 response status isn't valid for normal caching -- TODO:optimisation if res.status ~= 200 then kong.cache:invalidate(cache_id) end return res end return _M.introspect_access_token_req(access_token) end function _M.is_scope_authorized(scope) if _M.conf.scope == nil then return true end local needed_scope = pl_stringx.strip(_M.conf.scope) if string.len(needed_scope) == 0 then return true end scope = table.concat(scope, " ") scope = pl_stringx.strip(scope) if string.find(scope, '*', 1, true) or string.find(scope, needed_scope, 1, true) then return true end return false end -- TODO: plugin config that will allow not authorized queries function _M.run(conf) _M.conf = conf local access_token = ngx.req.get_headers()[_M.conf.token_header] if not access_token then _M.error_response("Unauthenticated.", ngx.HTTP_UNAUTHORIZED) end -- replace Bearer prefix access_token = pl_stringx.replace(access_token, "Bearer ", "", 1) local res = _M.introspect_access_token(access_token) if not res then _M.error_response("Authorization server error.", ngx.HTTP_INTERNAL_SERVER_ERROR) end if res.status ~= 200 then _M.error_response("The resource owner or authorization server denied the request.", ngx.HTTP_UNAUTHORIZED) end local data = cjson.decode(res.body) if data["active"] ~= true then _M.error_response("The resource owner or authorization server denied the request.", ngx.HTTP_UNAUTHORIZED) end if not _M.is_scope_authorized(data["scope"]) then _M.error_response("Forbidden", ngx.HTTP_FORBIDDEN) end ngx.req.set_header("X-Credential-Authorities", data["authorities"]) ngx.req.set_header("X-Credential-Scope", data["scope"]) ngx.req.set_header("X-Credential-Serial", data["serial"]) -- clear token header from req ngx.req.clear_header(_M.conf.token_header) end return _M
RegisterServerEvent("kickForBeingAnAFKDouchebag") AddEventHandler("kickForBeingAnAFKDouchebag", function() DropPlayer(source, "Du var AFK i for lang tid.") end)
local ContextMenuWindow = { OnInitialize = function () local scale = OpenCore:GetScale() local mouseX, mouseY = OpenCore:GetMousePosition() WindowSetOffsetFromParent(OpenCore:GetActiveWindow(), mouseX / scale, mouseY / scale) y = 5 for i, item in pairs(OpenCore.ContextMenu:GetMenuItems()) do local windowName = "OpenUI.Windows.ContextMenuItem." .. item:GetAlias() CreateWindowFromTemplate(windowName, "OpenUI.ContextMenuItem", OpenCore:GetActiveWindow()) ButtonSetText(windowName, item:GetLabel()) OpenCore:Chat(item:GetLabel()) WindowAddAnchor(windowName, "top", OpenCore:GetActiveWindow(), "top", 0, y) y = y + 25 + 2 end local w, h = WindowGetDimensions(OpenCore:GetActiveWindow()) WindowSetDimensions(OpenCore:GetActiveWindow(), w, y + 5) end, OnShutdown = function () end, OnItemClick = function () local alias = OpenCore:GetActiveWindow():split(".")[4] local item = OpenCore.ContextMenu:GetMenuItem(alias) if item then item:Execute() end end } OpenUI.ContextMenuWindow = ContextMenuWindow
local genx = require'genx' local ffi = require'ffi' local w = genx.new() local ns1 = w:ns('ns1', 'pns1') local ns2 = w:ns('ns2', 'pns2') local body = w:tag('body', ns1) local a1 = w:attr('a1') local a2 = w:attr('a2') w:start_doc(io.stdout) w:start_tag'root' w:text'hello' w:end_tag() w:end_doc() print() local t = {} w:start_doc(function(s, sz) s = s and (sz and ffi.string(s, sz) or ffi.string(s)) or '\n!EOF\n' t[#t+1] = s end) w:start_tag('html') w:add_ns(ns1) w:add_ns(ns2, 'g') w:text'\n\t' w:start_tag('head') w:add_attr('b', 'vb') w:add_attr('a', 'va') w:text'hello' w:end_tag() w:text'\n\t' w:start_tag(body) w:add_attr(a1, 'v1') w:add_attr(a2, 'v2') w:text'hey' w:end_tag() w:text'\n' w:end_tag() w:end_doc() w:free() local s = table.concat(t) assert(s == [[ <html xmlns:g="ns2" xmlns:pns1="ns1"> <head a="va" b="vb">hello</head> <pns1:body a1="v1" a2="v2">hey</pns1:body> </html> !EOF ]])
pg = pg or {} pg.ship_skin_template_18 = { [900205] = { ship_group = 900205, name = "克利夫兰(μ兵装)", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900205, group_index = 0, shop_id = 0, painting = "kelifulan_idolns", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "kelifulan_idol", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "克利夫兰μ无舰装版", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.13, 1.088, 0 } }, vicegun = { { 1.14, 1.04, 0 } }, antiaircraft = { { 1.114, 1.107, 0 } } }, smoke = { { 50, { { "smoke", { -0.369, 2.43, 0 } } } } } }, [900206] = { ship_group = 900206, name = "希佩尔海军上将(μ兵装)", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900206, group_index = 0, shop_id = 0, painting = "xipeier_idolns", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "xipeier_idol", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "希佩尔海军上将μ无舰装版", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.442, 1.205, 0 } }, vicegun = { { 1.391, 1.273, 0 } }, torpedo = { { -0.004, 0, 0 } }, antiaircraft = { { 1.358, 1.265, 0 } } }, smoke = { { 50, { { "smoke", { -0.377, 2.284, -0.081 } } } } } }, [900207] = { ship_group = 900207, name = "谢菲尔德(μ兵装)", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900207, group_index = 0, shop_id = 0, painting = "xiefeierde_idolns", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "xiefeierde_idol", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "谢菲尔德μ无舰装版", voice_actor = -1, spine_offset = "", illustrator = 20, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.163, 1.256, 0 } }, vicegun = { { 1.176, 1.324, 0 } }, torpedo = { { 0.001, 0.001, 0 } }, antiaircraft = { { 1.173, 1.311, 0 } } }, smoke = { { 50, { { "smoke", { -0.39, 2.2, 0 } } } } } }, [900208] = { ship_group = 900208, name = "大黄蜂", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900208, group_index = 0, shop_id = 0, painting = "dahuangfeng_hx", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "dahuangfeng_hx", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "约克城级航空母舰—大黄蜂,舷号CV-8", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.757, 1.097, 0 } }, plane = { { -0.492, 0.598, 0 } } }, smoke = { { 70, { { "smoke", { -0.76, 0.4, 0 } } } }, { 30, { { "smoke", { 0.53, 0.21, 0 } } } } } }, [900209] = { ship_group = 900209, name = "白上吹雪", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900209, group_index = 0, shop_id = 0, painting = "vtuber_fubuki_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_fubuki", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.346, 1.136, 0 } }, torpedo = { { 0.009, 0.004, 0 } }, antiaircraft = { { 1.374, 1.117, 0 } }, remote = { -50, 0, 0 } }, smoke = { { 50, { { "smoke", { -0.4, 2.386, 0 } } } } } }, [900210] = { ship_group = 900210, name = "时乃空", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900210, group_index = 0, shop_id = 0, painting = "vtuber_sora_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_sora", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.161, 1.097, 0 } }, torpedo = { { 0.003, -0.001, 0 } }, antiaircraft = { { 1.181, 1.153, 0 } } }, smoke = { { 50, { { "smoke", { -0.57, 2.46, 0 } } } } } }, [900211] = { ship_group = 900211, name = "湊阿库娅", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900211, group_index = 0, shop_id = 0, painting = "vtuber_aqua_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_aqua", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.561, 0.849, 0 } }, torpedo = { { 0, -0.062, 0 } }, antiaircraft = { { 1.437, 0.832, 0 } } }, smoke = { { 50, { { "smoke", { -0.57, 2.46, 0 } } } } } }, [900212] = { ship_group = 900212, name = "夏色祭", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900212, group_index = 0, shop_id = 0, painting = "vtuber_matsuri_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_matsuri", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.152, 1.077, 0 } }, torpedo = { { 0.002, 0.01, 0 } }, antiaircraft = { { 1.169, 1.101, 0 } } }, smoke = { { 50, { { "smoke", { -0.493, 2.318, 0 } } } } } }, [900213] = { ship_group = 900213, name = "百鬼绫目", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900213, group_index = 0, shop_id = 0, painting = "vtuber_ayame_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_ayame", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.566, 1.322, 0 } }, torpedo = { { 0.002, -0.001, 0 } }, antiaircraft = { { 1.538, 1.332, 0 } } }, smoke = { { 50, { { "smoke", { -0.57, 2.46, 0 } } } } } }, [900214] = { ship_group = 900214, name = "紫咲诗音", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900214, group_index = 0, shop_id = 0, painting = "vtuber_shion_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_shion", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.485, 1.133, 0 } }, torpedo = { { 0.009, -0.006, 0 } }, antiaircraft = { { 1.477, 1.156, 0 } } }, smoke = { { 50, { { "smoke", { -0.323, 2.372, 0 } } } } } }, [900215] = { ship_group = 900215, name = "大神澪", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900215, group_index = 0, shop_id = 0, painting = "vtuber_mio_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "vtuber_mio", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗨多磨~!我是绊爱!你就是传说中的指挥官吗?接下来请多指教啦!", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.461, 1.144, 0 } }, torpedo = { { -0.003, -0.006, 0 } }, antiaircraft = { { 1.454, 1.151, 0 } } }, smoke = { { 50, { { "smoke", { -0.57, 2.46, 0 } } } } } }, [900216] = { ship_group = 900216, name = "黛朵", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900216, group_index = 0, shop_id = 0, painting = "daiduo", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "daiduo", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "黛朵世界BOSS", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900217] = { ship_group = 900217, name = "基洛夫", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900217, group_index = 0, shop_id = 0, painting = "jiluofu", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "jiluofu", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "基洛夫", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900218] = { ship_group = 900218, name = "苏维埃同盟", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900218, group_index = 0, shop_id = 0, painting = "suweiaitongmeng_wjz", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "suweiaitongmeng", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "苏维埃同盟", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900219] = { ship_group = 900219, name = "清除者", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900219, group_index = 0, shop_id = 0, painting = "qingchuzhe", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "qingchuzhe", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "清除者", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900220] = { ship_group = 900220, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900220, group_index = 0, shop_id = 0, painting = "suweiailuoxiya_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "suweiailuoxiya_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "苏维埃罗西亚黑脸", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900221] = { ship_group = 900221, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900221, group_index = 0, shop_id = 0, painting = "gangute_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "gangute_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "甘古特黑脸", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900222] = { ship_group = 900222, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900222, group_index = 0, shop_id = 0, painting = "tashigan_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "tashigan_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "塔什干黑脸", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900223] = { ship_group = 900223, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900223, group_index = 0, shop_id = 0, painting = "qiabayefu_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "qiabayefu_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "恰巴耶夫黑脸", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900224] = { ship_group = 900224, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900224, group_index = 0, shop_id = 0, painting = "weiyan_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "weiyan_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "威严黑脸", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900225] = { ship_group = 900225, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900225, group_index = 0, shop_id = 0, painting = "shuixingjinian_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "shuixingjinian_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "水星纪念黑脸", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900226] = { ship_group = 900226, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900226, group_index = 0, shop_id = 0, painting = "suweiaitongmeng_dark", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "suweiaitongmeng_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "苏维埃同盟", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900227] = { ship_group = 900227, name = "???", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900227, group_index = 0, shop_id = 0, painting = "qiye_dark_shadow", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "qiye_dark", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "约克城级航空母舰—企业,舷号CV-6", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900228] = { ship_group = 900228, name = "???", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900228, group_index = 0, shop_id = 0, painting = "lansaiyu", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lansaiyu", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "蓝鳃鱼", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900229] = { ship_group = 900229, name = "???", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900229, group_index = 0, shop_id = 0, painting = "unknown5_shadow", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "unknown5_shadow", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "构建者黑色剪影", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.7, 1.23, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.65, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.69, 2.05, 0 } } } } } }, [900230] = { ship_group = 900230, name = "构建者", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900230, group_index = 0, shop_id = 0, painting = "unknown5", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "unknown5", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "构建者", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900231] = { ship_group = 900231, name = "净化者", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900231, group_index = 0, shop_id = 0, painting = "unknown3_shadow", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "unknown3_shadow", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "净化者黑色剪影", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900232] = { ship_group = 900232, name = "观察者", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900232, group_index = 0, shop_id = 0, painting = "unknown2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "unknown2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "观察者", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900233] = { ship_group = 900233, name = "净化者", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900233, group_index = 0, shop_id = 0, painting = "unknown3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "unknown3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "净化者", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900234] = { ship_group = 900234, name = "???", bullet_skin_secondary = "", hand_id = 0, bgm = "", illustrator2 = -1, bg = "", id = 900234, group_index = 0, shop_id = 0, painting = "unknown5", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "unknown5", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "构建者", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.34, 0.39, 0 } }, plane = { { -0.37, 0.39, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900235] = { ship_group = 900235, name = "泛用型布里", bullet_skin_secondary = "", hand_id = 5, bgm = "", illustrator2 = -1, bg = "", id = 900235, group_index = 0, shop_id = 0, painting = "gin", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "gin", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "泛用型布里,可以用于精锐以下所有角色的突破", voice_actor = 72, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.35, 0.67, 0 } }, torpedo = { { 0.13, 0.25, 0 } }, antiaircraft = { { 0.35, 0.67, 0 } } }, smoke = { { 70, { { "smoke", { -0.09, 0.59, -0.15 } } } }, { 30, { { "smoke", { -0.83, 2.24, -0.59 } } } } } }, [900236] = { ship_group = 900236, name = "沃克兰", bullet_skin_secondary = "", hand_id = 5, bgm = "", illustrator2 = -1, bg = "", id = 900236, group_index = 0, shop_id = 0, painting = "wokelan", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "wokelan", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "沃克兰", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.35, 0.67, 0 } }, torpedo = { { 0.13, 0.25, 0 } }, antiaircraft = { { 0.35, 0.67, 0 } } }, smoke = { { 70, { { "smoke", { -0.09, 0.59, -0.15 } } } }, { 30, { { "smoke", { -0.83, 2.24, -0.59 } } } } } }, [900237] = { ship_group = 900237, name = "可怖", bullet_skin_secondary = "", hand_id = 5, bgm = "", illustrator2 = -1, bg = "", id = 900237, group_index = 0, shop_id = 0, painting = "kebu", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "kebu", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "可怖", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.35, 0.67, 0 } }, torpedo = { { 0.13, 0.25, 0 } }, antiaircraft = { { 0.35, 0.67, 0 } } }, smoke = { { 70, { { "smoke", { -0.09, 0.59, -0.15 } } } }, { 30, { { "smoke", { -0.83, 2.24, -0.59 } } } } } }, [900238] = { ship_group = 900238, name = "阿尔及利亚?", bullet_skin_secondary = "", hand_id = 5, bgm = "", illustrator2 = -1, bg = "", id = 900238, group_index = 0, shop_id = 0, painting = "aerjiliya_hei", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "aerjiliya_hei", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "阿尔及利亚?", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.35, 0.67, 0 } }, torpedo = { { 0.13, 0.25, 0 } }, antiaircraft = { { 0.35, 0.67, 0 } } }, smoke = { { 70, { { "smoke", { -0.09, 0.59, -0.15 } } } }, { 30, { { "smoke", { -0.83, 2.24, -0.59 } } } } } }, [900239] = { ship_group = 900239, name = "让·巴尔", bullet_skin_secondary = "", hand_id = 5, bgm = "", illustrator2 = -1, bg = "", id = 900239, group_index = 0, shop_id = 0, painting = "rangbaer_hei", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "rangbaer_hei", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "让·巴尔黑色剪影", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.35, 0.67, 0 } }, torpedo = { { 0.13, 0.25, 0 } }, antiaircraft = { { 0.35, 0.67, 0 } } }, smoke = { { 70, { { "smoke", { -0.09, 0.59, -0.15 } } } }, { 30, { { "smoke", { -0.83, 2.24, -0.59 } } } } } }, [900240] = { ship_group = 900240, name = "拉菲", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900240, group_index = 0, shop_id = 0, painting = "lafei", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lafei", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "本森级驱逐舰—拉菲,舷号DD-459", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { -0.37, 0.97, 0 } }, torpedo = { { 0.53, 0.39, 0 } }, antiaircraft = { { -0.37, 0.97, 0 } } }, smoke = { { 70, { { "smoke", { 0.293, 0.826, 0 } } } }, { 30, { { "smoke", { -0.559, 2.57, -0.13 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_voice_calibrate = { propose = 2.5 } }, [900241] = { ship_group = 900241, name = "标枪", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900241, group_index = 0, shop_id = 0, painting = "biaoqiang", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "biaoqiang", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "J级驱逐舰—标枪,舷号F61", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.855, 0.424, 0 } }, torpedo = { { -0.545, 0.537, 0 } }, antiaircraft = { { 0.855, 0.424, 0 } } }, smoke = { { 70, { { "smoke", { -0.487, 0.32, 0 } } } }, { 30, { { "smoke", { -0.354, 0.977, 0 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_voice_calibrate = { propose = 2.5 } }, [900242] = { ship_group = 900242, name = "Z23", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900242, group_index = 0, shop_id = 0, painting = "z23", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936A “纳尔维克”型驱逐舰—Z23", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { -0.16, 0.59, 0 } }, vicegun = { { -0.16, 0.59, 0 } }, torpedo = { { 0.33, 0.35, 0 } }, antiaircraft = { { -0.16, 0.59, 0 } } }, smoke = { { 70, { { "smoke", { -0.531, 0.89, -0.27 } } } }, { 30, { { "smoke", { -0.53, 2.92, -0.38 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_voice_calibrate = { propose = 2.5 } }, [900243] = { ship_group = 900243, name = "{namecode:6}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 900243, group_index = 0, shop_id = 0, painting = "lingbo", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lingbo", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "特II型{namecode:6}级驱逐舰一番舰—{namecode:6}", voice_actor = -1, spine_offset = "", illustrator = 2, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.98, 1.05, 0 } }, vicegun = { { 0.98, 1.05, 0 } }, torpedo = { { 0.25, 0.08, 0 } }, antiaircraft = { { 0.98, 1.05, 0 } } }, smoke = { { 50, { { "smoke", { -0.45, 2.45, 0 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_voice_calibrate = { propose = 2.5 } }, [900244] = { ship_group = 900244, name = "提尔比茨", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900244, group_index = 0, shop_id = 0, painting = "tierbici", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "tierbici", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "俾斯麦级战列舰—提尔比茨", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.28, 1.3, 0 } }, vicegun = { { 1.28, 1.19, 0 } }, torpedo = { { 0.29, 0.09, 0 } }, antiaircraft = { { 1.28, 1.19, 0 } } }, smoke = { { 70, { { "smoke", { -0.74, 0.86, -0.18 } } } }, { 40, { { "smoke", { 0.03, 2.66, -1.22 } } } } } }, [900245] = { ship_group = 900245, name = "齐柏林伯爵", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900245, group_index = 0, shop_id = 0, painting = "qibolin", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "qibolin", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "齐柏林伯爵号航空母舰", voice_actor = -1, spine_offset = "", illustrator = 21, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.74, 1, 0 } }, plane = { { 0.73, 1.28, 0 } } }, smoke = { { 70, { { "smoke", { -1.01, 0.86, -1.89 } } } }, { 40, { { "smoke", { 0.87, 0.79, -1.85 } } } } } }, [900246] = { ship_group = 900246, name = "格奈森瑙", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900246, group_index = 0, shop_id = 0, painting = "genaisennao", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "genaisennao", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "沙恩霍斯特级战列巡洋舰—格奈森瑙", voice_actor = -1, spine_offset = "", illustrator = 32, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.42, 1.3, 0 } }, vicegun = { { 1.42, 0.88, 0 } }, torpedo = { { 0.2, 0.06, 0 } }, antiaircraft = { { 1.42, 0.88, 0 } } }, smoke = { { 70, { { "smoke", { -0.88, 1.26, -0.73 } } } }, { 40, { { "smoke", { 0.18, 2.65, -1.54 } } } } } }, [900247] = { ship_group = 900247, name = "{namecode:95}", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "", id = 900247, group_index = 0, shop_id = 0, painting = "xianghe", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "xianghe", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:95}级航空母舰一番舰—{namecode:95}", voice_actor = -1, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -1.19, 1.31, 0 } }, plane = { { 0.62, 1.13, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.22, 0 } } } } } }, [900248] = { ship_group = 900248, name = "{namecode:96}", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "", id = 900248, group_index = 0, shop_id = 0, painting = "ruihe", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "ruihe", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:95}级航空母舰二番舰—{namecode:96}", voice_actor = -1, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 0.83, 0.74, 0 } }, plane = { { 0.83, 0.74, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [900249] = { ship_group = 900249, name = "{namecode:79}.改", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 900249, group_index = 9, shop_id = 0, painting = "shancheng_g", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 2, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "shancheng_g", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "殿下!现在的{namecode:79},炮击也好、航空也好,什么都能做!所以、所以,多依赖依赖我嘛,殿下!殿下——!!", voice_actor = -1, spine_offset = "", illustrator = 22, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.31, 1.3, 0 } }, vicegun = { { 0.31, 1.16, 0 } }, torpedo = { { 0.1, 0.1, 0 } }, antiaircraft = { { 0.31, 1.16, 0 } } }, smoke = { { 50, { { "smoke", { -0.41, 2.48, 0 } } } } } }, [900250] = { ship_group = 900250, name = "北卡罗来纳", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900250, group_index = 0, shop_id = 0, painting = "beikaluolaina", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "beikaluolaina", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "北卡罗来纳级战列舰—北卡罗来纳,舷号BB-55", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.52, 1.06, 0 } }, vicegun = { { 1.52, 1.06, 0 } }, antiaircraft = { { 1.52, 1.06, 0 } } }, smoke = { { 50, { { "smoke", { -0.3, 2.33, 0 } } } } } }, [900251] = { ship_group = 900251, name = "华盛顿", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900251, group_index = 0, shop_id = 0, painting = "huashengdun", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "huashengdun", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "北卡罗来纳级战列舰—华盛顿,舷号BB-56", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.42, 1.4, 0 } }, vicegun = { { 1.42, 1.4, 0 } }, antiaircraft = { { 1.42, 1.4, 0 } } }, smoke = { { 50, { { "smoke", { -0.29, 2.42, 0 } } } } } }, [900252] = { ship_group = 900252, name = "企业", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900252, group_index = 0, shop_id = 0, painting = "qiye", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "qiye", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "约克城级航空母舰—企业,舷号CV-6", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 0.802, 0.53, 0 } }, plane = { { -0.863, 0.643, 0 } } }, smoke = { { 70, { { "smoke", { -0.967, 0.38, 0 } } } }, { 30, { { "smoke", { -0.14, 0.832, 0 } } } } } }, [900253] = { ship_group = 900253, name = "约克公爵", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = 19, bg = "", id = 900253, group_index = 0, shop_id = 0, painting = "yuekegongjue", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "yuekegongjue", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "英王乔治五世级战列舰—约克公爵,舷号17", voice_actor = -1, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.9, 1.55, 0 } }, vicegun = { { -0.21, 1.4, 0 } }, torpedo = { { 0.19, 0.13, 0 } }, antiaircraft = { { 1.83, 1.38, 0 } } }, smoke = { { 50, { { "smoke", { -0.45, 2.26, 0.53 } } } } } }, [900254] = { ship_group = 900254, name = "胜利", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900254, group_index = 0, shop_id = 0, painting = "shengli", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "shengli", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "光辉级航空母舰—胜利,舷号38", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 1, 1.39, 0 } }, plane = { { 1.12, 1.44, 0 } } }, smoke = { { 50, { { "smoke", { -0.41, 2.27, -1.47 } } } } } }, [900255] = { ship_group = 900255, name = "{namecode:82}", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "", id = 900255, group_index = 0, shop_id = 0, painting = "sanli", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "sanli", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:136}级战列舰四番舰—{namecode:82}", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.029, 1.278, 0 } }, vicegun = { { 0.029, 1.278, 0 } }, torpedo = { { 0.154, 0.067, 0 } }, antiaircraft = { { 0.029, 1.278, 0 } } }, smoke = { { 50, { { "smoke", { -0.221, 2.345, 0 } } } } } }, [900256] = { ship_group = 900256, name = "马萨诸塞", bullet_skin_secondary = "", hand_id = 3, bgm = "", illustrator2 = -1, bg = "", id = 900256, group_index = 0, shop_id = 0, painting = "masazhusai", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "masazhusai", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "南达科他级战列舰—马萨诸塞,舷号BB-59", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.11, 1.23, 0 } }, vicegun = { { 1.11, 1.24, 0 } }, torpedo = { { 0.17, 0.11, 0 } }, antiaircraft = { { 1.05, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.45, 2.16, 0 } } } } } }, [900257] = { ship_group = 900257, name = "胡德", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900257, group_index = 0, shop_id = 0, painting = "hude", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "hude", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "海军上将级战列巡洋舰—胡德,舷号51", voice_actor = -1, spine_offset = "", illustrator = 11, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { -0.25, 1.291, 0 } }, vicegun = { { 0, 0.585, 0 } }, antiaircraft = { { 1.65, 0.823, 0 } } }, smoke = { { 70, { { "smoke", { -0.5, 0.55, 0 } } } }, { 30, { { "smoke", { 0.3, 0.87, -0.4 } } } } } }, [900258] = { ship_group = 900258, name = "皇家方舟", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900258, group_index = 0, shop_id = 0, painting = "huangjiafangzhou", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "huangjiafangzhou", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "皇家方舟号航空母舰,舷号91", voice_actor = -1, spine_offset = "", illustrator = 18, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 0.333, 1.037, 0 } }, plane = { { -0.81, 0.757, 0 } } }, smoke = { { 70, { { "smoke", { -0.469, 0.402, 0 } } } }, { 30, { { "smoke", { 0.34, 0.854, 0 } } } } } }, [900259] = { ship_group = 900259, name = "{namecode:91}", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "", id = 900259, group_index = 0, shop_id = 0, painting = "chicheng", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "chicheng", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:91}号航空母舰", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -0.931, 1.059, 0 } }, plane = { { 0.492, 0.393, 0 } } }, smoke = { { 70, { { "smoke", { 0.478, 0.432, 0 } } } }, { 30, { { "smoke", { -0.384, 0.853, 0 } } } } } }, [900260] = { ship_group = 900260, name = "{namecode:92}", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "", id = 900260, group_index = 0, shop_id = 0, painting = "jiahe", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "jiahe", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:92}号航空母舰", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { -1.059, 0.492, 0 } }, plane = { { 0.946, 0.204, 0 } } }, smoke = { { 70, { { "smoke", { 0.799, 0.453, 0 } } } }, { 30, { { "smoke", { -0.304, 0.977, 0 } } } } } }, [900261] = { ship_group = 900261, name = "声望", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900261, group_index = 0, shop_id = 0, painting = "shengwang", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "shengwang", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "声望级战列巡洋舰—声望", voice_actor = -1, spine_offset = "", illustrator = 11, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.015, 1.165, 0 } }, vicegun = { { 1.407, 0.613, 0 } }, antiaircraft = { { 1.407, 0.613, 0 } } }, smoke = { { 70, { { "smoke", { -0.832, 0.566, 0 } } } }, { 30, { { "smoke", { 0.608, 0.741, 0 } } } } } }, [900262] = { ship_group = 900262, name = "英王乔治五世", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900262, group_index = 0, shop_id = 0, painting = "qiaozhiwushi", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "qiaozhiwushi", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "英王乔治五世级战列舰—英王乔治五世,舷号41", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand2", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 2.07, 1.4, 0 } }, vicegun = { { 1.99, 1.39, 0 } }, torpedo = { { 0.03, 0, 0 } } }, smoke = { { 50, { { "smoke", { -0.5, 2.3, 0.4 } } } } } }, [900263] = { ship_group = 900263, name = "厌战", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900263, group_index = 0, shop_id = 0, painting = "yanzhan", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "yanzhan", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "伊丽莎白女王级战列舰—厌战,舷号03", voice_actor = -1, spine_offset = "", illustrator = 19, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { -0.061, 1.339, 0 } }, vicegun = { { -0.696, 0.779, 0 }, { 0.893, 0.242, 0 } }, antiaircraft = { { -0.696, 0.779, 0 }, { 0.893, 0.242, 0 } } }, smoke = { { 70, { { "smoke", { -1.082, 0.566, 0 } } } }, { 30, { { "smoke", { 0.919, 0.617, 0 } } } } } }, [900264] = { ship_group = 900264, name = "光辉", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900264, group_index = 0, shop_id = 0, painting = "guanghui", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "guanghui", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "光辉级航空母舰—光辉,舷号87", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 0.804, 0.561, 0 } }, plane = { { -0.205, 1.344, 0 } } }, smoke = { { 70, { { "smoke", { -1.38, 1.09, -0.39 } } } }, { 30, { { "smoke", { -0.6, 3.04, -1.47 } } } } } }, [900265] = { ship_group = 900265, name = "可畏", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900265, group_index = 0, shop_id = 0, painting = "kewei", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "kewei", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "光辉级航空母舰—可畏,舷号67", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 1, 0.88, 0 } }, plane = { { 0.85, 0.77, 0 } } }, smoke = { { 50, { { "smoke", { -0.54, 2.19, -1.47 } } } } } }, [900266] = { ship_group = 900266, name = "苏维埃罗西亚", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900266, group_index = 0, shop_id = 0, painting = "suweiailuoxiya", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "suweiailuoxiya", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "苏联级战列舰—苏维埃罗西亚", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.702, 1.074, 0 } }, vicegun = { { 1.691, 1.094, 0 } }, torpedo = { { -0.013, 0.032, 0 } }, antiaircraft = { { 1.643, 1.075, 0 } } }, smoke = { { 50, { { "smoke", { -0.38, 2.186, 0 } } } } } }, [900267] = { ship_group = 900267, name = "甘古特", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900267, group_index = 0, shop_id = 0, painting = "gangute", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "gangute", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "甘古特级战列舰—甘古特", voice_actor = -1, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.558, 1.084, 0 } }, vicegun = { { 1.623, 1.027, 0 } }, torpedo = { { -0.003, 0.022, 0 } }, antiaircraft = { { 1.595, 1.143, 0 } } }, smoke = { { 50, { { "smoke", { -0.611, 2.1, 0 } } } } } }, [900268] = { ship_group = 900268, name = "萨拉托加", bullet_skin_secondary = "", hand_id = 5, bgm = "", illustrator2 = -1, bg = "", id = 900268, group_index = 0, shop_id = 0, painting = "salatuojia", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "salatuojia", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "列克星敦级航空母舰—萨拉托加,舷号CV-3", voice_actor = -1, spine_offset = "", illustrator = 10, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { -0.772, 0.605, 0 } }, antiaircraft = { { -0.772, 0.605, 0 } }, plane = { { -0.772, 0.605, 0 } } }, smoke = { { 70, { { "smoke", { -0.887, 1.243, 0 } } } }, { 30, { { "smoke", { 0.642, 1.068, 0 } } } } } }, [900269] = { ship_group = 900269, name = "埃塞克斯", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900269, group_index = 0, shop_id = 0, painting = "aisaikesi", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "aisaikesi", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "埃塞克斯级航空母舰—埃塞克斯,舷号CV-9", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 1.12, 1.3, 0 } }, plane = { { 1.09, 1.32, 0 } } }, smoke = { { 50, { { "smoke", { -0.41, 2.37, 0 } } } } } }, [900270] = { ship_group = 900270, name = "无畏", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900270, group_index = 0, shop_id = 0, painting = "wuwei", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "wuwei", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "埃塞克斯级航空母舰—无畏,舷号CV-11", voice_actor = -1, spine_offset = "", illustrator = 8, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 1.483, 1.215, 0 } }, plane = { { 1.438, 1.204, 0 } } }, smoke = { { 50, { { "smoke", { -0.41, 2.37, 0 } } } } } }, [900271] = { ship_group = 900271, name = "邦克山", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900271, group_index = 0, shop_id = 0, painting = "bangkeshan", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "bangkeshan", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "埃塞克斯级航空母舰—邦克山,舷号CV-17", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { antiaircraft = { { 1.29, 1.03, 0 } }, plane = { { 1.41, 1.07, 0 } } }, smoke = { { 50, { { "smoke", { -0.41, 2.37, 0 } } } } } }, [900272] = { ship_group = 900272, name = "黎塞留", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900272, group_index = 0, shop_id = 0, painting = "lisailiu", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lisailiu", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "自由鸢尾黎塞留级战列舰—黎塞留", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.67, 1.335, 0 } }, vicegun = { { 1.66, 1.365, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.66, 1.299, 0 } } }, smoke = { { 50, { { "smoke", { -0.6, 2.26, 0 } } } } } }, [900273] = { ship_group = 900273, name = "贝亚恩", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900273, group_index = 0, shop_id = 0, painting = "beiyaen", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "beiyaen", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "自由鸢尾航空母舰—贝亚恩", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.16, 1.13, 0 } }, plane = { { 1.244, 1.128, 0 } }, torpedo = { { 0, 0, 0 } } }, smoke = { { 50, { { "smoke", { -0.55, 2.07, -1.85 } } } } } }, [900274] = { ship_group = 900274, name = "豪", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 900274, group_index = 0, shop_id = 0, painting = "hao", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "hao", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "英王乔治五世级战列舰—豪,舷号32", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.063, 1.184, 0 } }, vicegun = { { 1.112, 1.175, 0 } }, torpedo = { { 0.003, -0.001, 0 } }, antiaircraft = { { 1.118, 1.193, 0 } } }, smoke = { { 50, { { "smoke", { -0.45, 2.315, 0.53 } } } } } }, [900275] = { ship_group = 900275, name = "英勇", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900275, group_index = 0, shop_id = 0, painting = "yingyong", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "yingyong", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "伊丽莎白女王级战列舰—英勇,舷号02", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 0, 0, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.605, 1.205, 0 } }, vicegun = { { 1.607, 1.255, 0 } }, torpedo = { { -0.014, 0.01, 0 } }, antiaircraft = { { 1.59, 1.288, 0 } } }, smoke = { { 50, { { "smoke", { -0.45, 2.415, 0.53 } } } } } }, [900276] = { ship_group = 900276, name = "英仙座", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 900276, group_index = 0, shop_id = 0, painting = "yingxianzuo", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = -1, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "yingxianzuo", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "巨像级航空母舰—英仙座", voice_actor = -1, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = {}, live2d_offset = { 80, -120, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 2.789, 1.258, 0 } }, vicegun = { { 2.747, 1.311, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 2.785, 1.358, 0 } }, plane = { { 2.785, 1.301, 0 } } }, smoke = { { 50, { { "smoke", { -0.481, 2.325, -0.55 } } } } } } } return
require("prototypes.laser-sounds") data:extend( { { type = "recipe", name = "5d-personal-yellow-laser-defense-equipment", enabled = false, energy_required = 10, ingredients = { {"processing-unit", 1}, {"steel-plate", 5}, {"5d-laser-turret-small", 5} }, result = "5d-personal-yellow-laser-defense-equipment" }, { type = "item", name = "5d-personal-yellow-laser-defense-equipment", icon = "__5dim_equipment__/graphics/icons/personal-laser-defense4-equipment.png", placed_as_equipment_result = "5d-personal-yellow-laser-defense-equipment", icon_size = 32, -- flags = {"goes-to-main-inventory"}, subgroup = "armor-defense", order = "aa", stack_size = 20 }, --Equipment { type = "active-defense-equipment", name = "5d-personal-yellow-laser-defense-equipment", sprite = { filename = "__base__/graphics/equipment/personal-laser-defense-equipment.png", --"__5dim_equipment__/graphics/equipment/personal-laser-defense4-equipment.png", width = 64, height = 64, priority = "medium" }, shape = { width = 2, height = 2, type = "full" }, energy_source = { type = "electric", usage_priority = "secondary-input", buffer_capacity = "110kJ" }, attack_parameters = { type = "beam", cooldown = 30, range = 10, damage_modifier = 2, ammo_type = { category = "laser-turret", energy_consumption = "50kJ", action = { type = "direct", action_delivery = { type = "beam", beam = "laser-beam", max_length = 10, duration = 30, source_offset = {0, -1.31439} } } } }, automatic = true, categories = {"armor"} }, } )
local system = require "system" local logger = require "logger" local socket = require "socket" local args = {...} logger.info("file client.lua", args, system.self()) local cc = socket.tcp.connect({ip=args[1], port=args[2], ipv6=false}) logger.info("tcp connect id", cc:unwrap()) cc:start() while true do local msg = cc:read() logger.info("tcp client msg", msg) cc:write(msg) if #msg == 0 or msg:match("(%a+)") == "exit" then cc:shutdown() break end end
--[[ --=====================================================================================================-- Script Name: Name Ban, for SAPP (PC & CE) Description: The most advanced name-ban script that exists. This script uses a pattern matching algorithm that matches all possible permutations of letters in a name based on the patterns table (see below). Copyright (c) 2022, Jericho Crosby <jericho.crosby227@gmail.com> * Notice: You can use this document subject to the following conditions: https://github.com/Chalwk77/HALO-SCRIPT-PROJECTS/blob/master/LICENSE --=====================================================================================================-- ]]-- -- config starts -- -- This script will kick or ban a player if they use a vulgar name: -- Valid actions: "kick" or "ban" -- local action = "kick" -- Ban time (in minutes), requires action to be set to "ban". -- local time = 10 -- Action reason: -- local reason = "Inappropriate name. Please change it!" -- List of names to kick/ban: -- local banned_names = { "penis", "nigger", -- -- repeat the structure to add more names -- } -- Advanced users only: -- local patterns = { ["a"] = { "[aA@ÀÂÃÄÅ]" }, ["b"] = { "[bBßḄɃḂ]" }, ["c"] = { "[cCkKÇ]" }, ["d"] = { "[dDĐĎɗḏ]" }, ["e"] = { "[eE3Èé]" }, ["f"] = { "[fFḟḞƒƑ]" }, ["g"] = { "[gG6ǵĝĠĞ]" }, ["h"] = { "[hHĤȞĥĦḪ]" }, ["i"] = { "[iIl!1Ì]" }, ["j"] = { "[jJɈɉǰĴĵ]" }, ["k"] = { "[cCkKǨƙķḲ]" }, ["l"] = { "[lL1!i£]" }, ["m"] = { "[mMḿḾṀṃṂ]" }, ["n"] = { "[nNñÑ]" }, ["o"] = { "[oO0Ò]" }, ["p"] = { "[pPþᵽṗṕ]" }, ["q"] = { "[qQ9Ɋɋ]" }, ["r"] = { "[rR®ȐŖ]" }, ["s"] = { "[sS$5ŜṤŞṩ]" }, ["t"] = { "[tT7ƬṬțṰ]" }, ["u"] = { "[vVuUÙ]" }, ["v"] = { "[vVuUÙṼṾṽ]" }, ["w"] = { "[wWŴẄẆⱳ]" }, ["x"] = { "[xXẌẍẊẋ]" }, ["y"] = { "[yYýÿÝ]" }, ["z"] = { "[zZ2ẑẐȥ]" }, } -- config ends -- api_version = "1.12.0.0" local bad_names = { } local function StringToTable(str) local t = {} for i = 1, str:len() do t[#t + 1] = str:sub(i, i) end return t end function OnScriptLoad() action = (action == "kick" and 'k $n' or 'ipban $n ' .. time) .. ' "' .. reason .. '"' for i = 1, #banned_names do local word = "" local name = banned_names[i] local t = StringToTable(name) for j = 1, #t do local char = t[j] if (patterns[char]) then for k, v in pairs(patterns[char]) do if (patterns[char][k]) then word = word .. v end end end end bad_names[#bad_names + 1] = word end register_callback(cb["EVENT_JOIN"], "OnJoin") end local function NameIsBanned(Ply) local name = get_var(Ply, "$name") for i = 1, #bad_names do if name:match(bad_names[i]) then return true end end return false end function OnJoin(Ply) if NameIsBanned(Ply) then execute_command(action:gsub("$n", Ply)) end end function OnScriptUnload() -- N/A end
object_mobile_space_comm_ghrag_merc_02 = object_mobile_shared_space_comm_ghrag_merc_02:new { } ObjectTemplates:addTemplate(object_mobile_space_comm_ghrag_merc_02, "object/mobile/space_comm_ghrag_merc_02.iff")
-- Weed farm: 1051.491, -3196.536, -39.14842 exports('GetBikerWeedFarmObject', function() return BikerWeedFarm end) BikerWeedFarm = { interiorId = 247297, Ipl = { Interior = { ipl = "bkr_biker_interior_placement_interior_3_biker_dlc_int_ware02_milo", Load = function() EnableIpl(BikerWeedFarm.Ipl.Interior.ipl, true) end, Remove = function() EnableIpl(BikerWeedFarm.Ipl.Interior.ipl, false) end }, }, Style = { basic = "weed_standard_equip", upgrade = "weed_upgrade_equip", Set = function(style, refresh) BikerWeedFarm.Style.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, style, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Style.basic, BikerWeedFarm.Style.upgrade}, false, refresh) end }, Security = { basic = "weed_low_security", upgrade = "weed_security_upgrade", Set = function(security, refresh) BikerWeedFarm.Security.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, security, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Security.basic, BikerWeedFarm.Security.upgrade}, false, refresh) end }, Plant1 = { Stage = { small = "weed_growtha_stage1", medium = "weed_growtha_stage2", full = "weed_growtha_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant1.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant1.Stage.small, BikerWeedFarm.Plant1.Stage.medium, BikerWeedFarm.Plant1.Stage.full}, false, refresh) end }, Light = { basic = "light_growtha_stage23_standard", upgrade = "light_growtha_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant1.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant1.Light.basic, BikerWeedFarm.Plant1.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hosea", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant1.Stage.Set(stage, false) BikerWeedFarm.Plant1.Light.Set(upgrade, false) BikerWeedFarm.Plant1.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant1.Stage.Clear() BikerWeedFarm.Plant1.Light.Clear() BikerWeedFarm.Plant1.Hose.Enable(false, true) end }, Plant2 = { Stage = { small = "weed_growthb_stage1", medium = "weed_growthb_stage2", full = "weed_growthb_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant2.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant2.Stage.small, BikerWeedFarm.Plant2.Stage.medium, BikerWeedFarm.Plant2.Stage.full}, false, refresh) end }, Light = { basic = "light_growthb_stage23_standard", upgrade = "light_growthb_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant2.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant2.Light.basic, BikerWeedFarm.Plant2.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hoseb", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant2.Stage.Set(stage, false) BikerWeedFarm.Plant2.Light.Set(upgrade, false) BikerWeedFarm.Plant2.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant2.Stage.Clear() BikerWeedFarm.Plant2.Light.Clear() BikerWeedFarm.Plant2.Hose.Enable(false, true) end }, Plant3 = { Stage = { small = "weed_growthc_stage1", medium = "weed_growthc_stage2", full = "weed_growthc_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant3.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant3.Stage.small, BikerWeedFarm.Plant3.Stage.medium, BikerWeedFarm.Plant3.Stage.full}, false, refresh) end }, Light = { basic = "light_growthc_stage23_standard", upgrade = "light_growthc_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant3.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant3.Light.basic, BikerWeedFarm.Plant3.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hosec", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant3.Stage.Set(stage, false) BikerWeedFarm.Plant3.Light.Set(upgrade, false) BikerWeedFarm.Plant3.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant3.Stage.Clear() BikerWeedFarm.Plant3.Light.Clear() BikerWeedFarm.Plant3.Hose.Enable(false, true) end }, Plant4 = { Stage = { small = "weed_growthd_stage1", medium = "weed_growthd_stage2", full = "weed_growthd_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant4.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant4.Stage.small, BikerWeedFarm.Plant4.Stage.medium, BikerWeedFarm.Plant4.Stage.full}, false, refresh) end }, Light = { basic = "light_growthd_stage23_standard", upgrade = "light_growthd_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant4.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant4.Light.basic, BikerWeedFarm.Plant4.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hosed", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant4.Stage.Set(stage, false) BikerWeedFarm.Plant4.Light.Set(upgrade, false) BikerWeedFarm.Plant4.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant4.Stage.Clear() BikerWeedFarm.Plant4.Light.Clear() BikerWeedFarm.Plant4.Hose.Enable(false, true) end }, Plant5 = { Stage = { small = "weed_growthe_stage1", medium = "weed_growthe_stage2", full = "weed_growthe_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant5.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant5.Stage.small, BikerWeedFarm.Plant5.Stage.medium, BikerWeedFarm.Plant5.Stage.full}, false, refresh) end }, Light = { basic = "light_growthe_stage23_standard", upgrade = "light_growthe_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant5.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant5.Light.basic, BikerWeedFarm.Plant5.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hosee", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant5.Stage.Set(stage, false) BikerWeedFarm.Plant5.Light.Set(upgrade, false) BikerWeedFarm.Plant5.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant5.Stage.Clear() BikerWeedFarm.Plant5.Light.Clear() BikerWeedFarm.Plant5.Hose.Enable(false, true) end }, Plant6 = { Stage = { small = "weed_growthf_stage1", medium = "weed_growthf_stage2", full = "weed_growthf_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant6.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant6.Stage.small, BikerWeedFarm.Plant6.Stage.medium, BikerWeedFarm.Plant6.Stage.full}, false, refresh) end }, Light = { basic = "light_growthf_stage23_standard", upgrade = "light_growthf_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant6.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant6.Light.basic, BikerWeedFarm.Plant6.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hosef", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant6.Stage.Set(stage, false) BikerWeedFarm.Plant6.Light.Set(upgrade, false) BikerWeedFarm.Plant6.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant6.Stage.Clear() BikerWeedFarm.Plant6.Light.Clear() BikerWeedFarm.Plant6.Hose.Enable(false, true) end }, Plant7 = { Stage = { small = "weed_growthg_stage1", medium = "weed_growthg_stage2", full = "weed_growthg_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant7.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant7.Stage.small, BikerWeedFarm.Plant7.Stage.medium, BikerWeedFarm.Plant7.Stage.full}, false, refresh) end }, Light = { basic = "light_growthg_stage23_standard", upgrade = "light_growthg_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant7.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant7.Light.basic, BikerWeedFarm.Plant7.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hoseg", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant7.Stage.Set(stage, false) BikerWeedFarm.Plant7.Light.Set(upgrade, false) BikerWeedFarm.Plant7.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant7.Stage.Clear() BikerWeedFarm.Plant7.Light.Clear() BikerWeedFarm.Plant7.Hose.Enable(false, true) end }, Plant8 = { Stage = { small = "weed_growthh_stage1", medium = "weed_growthh_stage2", full = "weed_growthh_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant8.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant8.Stage.small, BikerWeedFarm.Plant8.Stage.medium, BikerWeedFarm.Plant8.Stage.full}, false, refresh) end }, Light = { basic = "light_growthh_stage23_standard", upgrade = "light_growthh_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant8.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant8.Light.basic, BikerWeedFarm.Plant8.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hoseh", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant8.Stage.Set(stage, false) BikerWeedFarm.Plant8.Light.Set(upgrade, false) BikerWeedFarm.Plant8.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant8.Stage.Clear() BikerWeedFarm.Plant8.Light.Clear() BikerWeedFarm.Plant8.Hose.Enable(false, true) end }, Plant9 = { Stage = { small = "weed_growthi_stage1", medium = "weed_growthi_stage2", full = "weed_growthi_stage3", Set = function(stage, refresh) BikerWeedFarm.Plant9.Stage.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, stage, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant9.Stage.small, BikerWeedFarm.Plant9.Stage.medium, BikerWeedFarm.Plant9.Stage.full}, false, refresh) end }, Light = { basic = "light_growthi_stage23_standard", upgrade = "light_growthi_stage23_upgrade", Set = function(light, refresh) BikerWeedFarm.Plant9.Light.Clear(false) SetIplPropState(BikerWeedFarm.interiorId, light, true, refresh) end, Clear = function(refresh) SetIplPropState(BikerWeedFarm.interiorId, {BikerWeedFarm.Plant9.Light.basic, BikerWeedFarm.Plant9.Light.upgrade}, false, refresh) end }, Hose = { Enable = function (state, refresh) SetIplPropState(BikerWeedFarm.interiorId, "weed_hosei", state, refresh) end }, Set = function(stage, upgrade, refresh) BikerWeedFarm.Plant9.Stage.Set(stage, false) BikerWeedFarm.Plant9.Light.Set(upgrade, false) BikerWeedFarm.Plant9.Hose.Enable(true, true) end, Clear = function(refresh) BikerWeedFarm.Plant9.Stage.Clear() BikerWeedFarm.Plant9.Light.Clear() BikerWeedFarm.Plant9.Hose.Enable(false, true) end }, Details = { production = "weed_production", -- Weed on the tables fans = "weed_set_up", -- Fans + mold buckets drying = "weed_drying", -- Drying weed hooked to the ceiling chairs = "weed_chairs", -- Chairs at the tables Enable = function (details, state, refresh) SetIplPropState(BikerWeedFarm.interiorId, details, state, refresh) end }, LoadDefault = function() BikerWeedFarm.Ipl.Interior.Load() BikerWeedFarm.Style.Set(BikerWeedFarm.Style.upgrade) BikerWeedFarm.Security.Set(BikerWeedFarm.Security.basic) BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.drying, false) BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.chairs, false) BikerWeedFarm.Details.Enable(BikerWeedFarm.Details.production, false) BikerWeedFarm.Details.Enable({BikerWeedFarm.Details.production, BikerWeedFarm.Details.chairs, BikerWeedFarm.Details.drying}, true) BikerWeedFarm.Plant1.Set(BikerWeedFarm.Plant1.Stage.medium, BikerWeedFarm.Plant1.Light.basic) BikerWeedFarm.Plant2.Set(BikerWeedFarm.Plant2.Stage.full, BikerWeedFarm.Plant2.Light.basic) BikerWeedFarm.Plant3.Set(BikerWeedFarm.Plant3.Stage.medium, BikerWeedFarm.Plant3.Light.basic) BikerWeedFarm.Plant4.Set(BikerWeedFarm.Plant4.Stage.full, BikerWeedFarm.Plant4.Light.basic) BikerWeedFarm.Plant5.Set(BikerWeedFarm.Plant5.Stage.medium, BikerWeedFarm.Plant5.Light.basic) BikerWeedFarm.Plant6.Set(BikerWeedFarm.Plant6.Stage.full, BikerWeedFarm.Plant6.Light.basic) BikerWeedFarm.Plant7.Set(BikerWeedFarm.Plant7.Stage.medium, BikerWeedFarm.Plant7.Light.basic) BikerWeedFarm.Plant8.Set(BikerWeedFarm.Plant8.Stage.full, BikerWeedFarm.Plant8.Light.basic) BikerWeedFarm.Plant9.Set(BikerWeedFarm.Plant9.Stage.full, BikerWeedFarm.Plant9.Light.basic) RefreshInterior(BikerWeedFarm.interiorId) end }
local IAspect = require("api.IAspect") local IItemDrinkable = require("mod.elona.api.aspect.IItemDrinkable") local Gui = require("api.Gui") local IItemWell = class.interface("IItemWell", { draw_water_from = "function", pour_water_into = "function", is_dry = "function", on_drink_effects = "function", decrement_water = "function", ai_drinks_from = "function", water_amount = "number" }, { IAspect, IItemDrinkable }) IItemWell.default_impl = "mod.elona.api.aspect.ItemWellAspect" function IItemWell:localize_action() return "base:aspect._.elona.IItemWell.action_name" end function IItemWell:on_drink(item, params) -- >>>>>>>> shade2/proc.hsp:1453 iParam1(ci)-=rnd(3):iParam3(ci)+=rnd(3) ... if self:is_dry(item) then Gui.mes("action.drink.well.is_dry", item:build_name()) return false end Gui.play_sound("base.drink1") self:on_drink_effects(item, params) self:decrement_water(item, params) return true -- <<<<<<<< shade2/proc.hsp:1458 } .. end return IItemWell
sys.exec("/cmd/shell.lua", {}, "user:") sys.exec("user:startup.lua", {}, "user:")
local setmetatable = setmetatable local type = type local tostring = tostring local select = select local pairs = pairs local tinsert = table.insert local tsort = table.sort local strsplit = string.split local CreateFrame = CreateFrame local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME local IsAddOnLoaded = IsAddOnLoaded local IsInInstance = IsInInstance local MAX_BATTLEFIELD_QUEUES = MAX_BATTLEFIELD_QUEUES local GetBattlefieldStatus = GetBattlefieldStatus local GetSpellInfo = GetSpellInfo local UnitGUID = UnitGUID local UnitBuff = UnitBuff local UnitDebuff = UnitDebuff local UnitIsDeadOrGhost = UnitIsDeadOrGhost local UnitHealth = UnitHealth local UnitHealthMax = UnitHealthMax local UnitMana = UnitMana local UnitManaMax = UnitManaMax local UnitPowerType = UnitPowerType local UnitCastingInfo = UnitCastingInfo local GetTime = GetTime local UnitChannelInfo = UnitChannelInfo local UnitIsPartyLeader = UnitIsPartyLeader local UnitName = UnitName local UnitExists = UnitExists local UnitIsPlayer = UnitIsPlayer local UnitCanAttack = UnitCanAttack local UnitIsCharmed = UnitIsCharmed local UnitRace = UnitRace local UnitClass = UnitClass local tonumber = tonumber local CombatLogClearEntries = CombatLogClearEntries local CombatLog_Object_IsA = CombatLog_Object_IsA local COMBATLOG_OBJECT_TARGET = COMBATLOG_OBJECT_TARGET local COMBATLOG_OBJECT_FOCUS = COMBATLOG_OBJECT_FOCUS local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_BUFF, AURA_TYPE_DEBUFF local GetNumPartyMembers, GetNumRaidMembers = GetNumPartyMembers, GetNumRaidMembers local channelSpells = { [GetSpellInfo(15407)] = true, [GetSpellInfo(10)] = true, [GetSpellInfo(5740)] = true, [GetSpellInfo(1949)] = true, [GetSpellInfo(740)] = true, [GetSpellInfo(689)] = true, [GetSpellInfo(5138)] = true, [GetSpellInfo(12051)] = true, [GetSpellInfo(5143)] = true, } local unitsToCheck = { ["mouseover"] = true, ["mouseovertarget"] = true, ["mouseovertargettarget"] = true, ["targettarget"] = true, ["targettargettarget"] = true, ["focustargettarget"] = true, ["focustarget"] = true, ["pettarget"] = true, ["pettargettarget"] = true, ["party1target"] = true, ["party2target"] = true, ["party3target"] = true, ["party4target"] = true, ["partypet1target"] = true, ["partypet2target"] = true, ["partypet3target"] = true, ["partypet4target"] = true, ["party1targettarget"] = true, ["party2targettarget"] = true, ["party3targettarget"] = true, ["party4targettarget"] = true, ["raid1target"] = true, ["raid2target"] = true, ["raid3target"] = true, ["raid4target"] = true, ["raidpet1target"] = true, ["raidpet2target"] = true, ["raidpet3target"] = true, ["raidpet4target"] = true, ["raid1targettarget"] = true, ["raid2targettarget"] = true, ["raid3targettarget"] = true, ["raid4targettarget"] = true, } local MAJOR, MINOR = "Gladdy", 4 local Gladdy = LibStub:NewLibrary(MAJOR, MINOR) local L LibStub("AceTimer-3.0"):Embed(Gladdy) LibStub("AceComm-3.0"):Embed(Gladdy) local DRData = LibStub("DRData-1.0") Gladdy.modules = {} setmetatable(Gladdy, { __tostring = function() return MAJOR end }) function Gladdy:Print(...) local text = "|cff33ff99Gladdy|r:" local val for i = 1, select("#", ...) do val = select(i, ...) if (type(val) == 'boolean') then val = val and "true" or false end text = text .. " " .. tostring(val) end DEFAULT_CHAT_FRAME:AddMessage(text) end function Gladdy:GetIconStyles() return { ["Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp"] = L["Gladdy Tooltip round"], ["Interface\\AddOns\\Gladdy\\Images\\Border_squared_blp"] = L["Gladdy Tooltip squared"], ["Interface\\AddOns\\Gladdy\\Images\\Border_Gloss"] = L["Gloss (black border)"], } end Gladdy.events = CreateFrame("Frame") Gladdy.events.registered = {} Gladdy.events:RegisterEvent("PLAYER_LOGIN") Gladdy.events:SetScript("OnEvent", function(self, event, ...) if (event == "PLAYER_LOGIN") then Gladdy:OnInitialise() Gladdy:OnEnable() else local func = self.registered[event] if (type(Gladdy[func]) == "function") then Gladdy[func](Gladdy, event, ...) end end end) function Gladdy:RegisterEvent(event, func) self.events.registered[event] = func or event self.events:RegisterEvent(event) end function Gladdy:UnregisterEvent(event) self.events.registered[event] = nil self.events:UnregisterEvent(event) end function Gladdy:UnregisterAllEvents() self.events.registered = {} self.events:UnregisterAllEvents() end local function pairsByPrio(t) local a = {} for k, v in pairs(t) do tinsert(a, { k, v.priority }) end tsort(a, function(x, y) return x[2] > y[2] end) local i = 0 return function() i = i + 1 if (a[i] ~= nil) then return a[i][1], t[a[i][1]] else return nil end end end function Gladdy:IterModules() return pairsByPrio(self.modules) end function Gladdy:Call(module, func, ...) if (type(module) == "string") then module = self.modules[module] end if (type(module[func]) == "function") then module[func](module, ...) end end function Gladdy:SendMessage(message, ...) for k, v in self:IterModules() do self:Call(v, v.messages[message], ...) end end function Gladdy:NewModule(name, priority, defaults) local module = CreateFrame("Frame") module.name = name module.priority = priority or 0 module.defaults = defaults or {} module.messages = {} module.RegisterMessage = function(self, message, func) self.messages[message] = func or message end module.GetOptions = function() return nil end for k, v in pairs(module.defaults) do self.defaults.profile[k] = v end self.modules[name] = module return module end function Gladdy:OnInitialise() self.dbi = LibStub("AceDB-3.0"):New("GladdyXZ", self.defaults) self.dbi.RegisterCallback(self, "OnProfileChanged", "OnProfileChanged") self.dbi.RegisterCallback(self, "OnProfileCopied", "OnProfileChanged") self.dbi.RegisterCallback(self, "OnProfileReset", "OnProfileChanged") self.db = self.dbi.profile self.LSM = LibStub("LibSharedMedia-3.0") self.LSM:Register("statusbar", "Gloss", "Interface\\AddOns\\Gladdy\\Images\\Gloss") self.LSM:Register("statusbar", "Smooth", "Interface\\AddOns\\Gladdy\\Images\\Smooth") self.LSM:Register("statusbar", "Minimalist", "Interface\\AddOns\\Gladdy\\Images\\Minimalist") self.LSM:Register("statusbar", "LiteStep", "Interface\\AddOns\\Gladdy\\Images\\LiteStep.tga") self.LSM:Register("border", "Gladdy Tooltip round", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_round_selfmade") self.LSM:Register("border", "Gladdy Tooltip squared", "Interface\\AddOns\\Gladdy\\Images\\UI-Tooltip-Border_square_selfmade") self.LSM:Register("font", "DorisPP", "Interface\\AddOns\\Gladdy\\Images\\DorisPP.TTF") L = self.L self.testData = { ["arena1"] = { name = "Swift", raceLoc = L["Undead"], classLoc = L["Warrior"], class = "WARRIOR", health = 9635, healthMax = 14207, power = 76, powerMax = 100, powerType = 1, testSpec = L["Arms"], race = "Scourge" }, ["arena2"] = { name = "Vilden", raceLoc = L["Undead"], classLoc = L["Mage"], class = "MAGE", health = 10969, healthMax = 11023, power = 7833, powerMax = 10460, powerType = 0, testSpec = L["Frost"], race = "Scourge" }, ["arena3"] = { name = "Krymu", raceLoc = L["Night Elf"], classLoc = L["Rogue"], class = "ROGUE", health = 1592, healthMax = 11740, power = 45, powerMax = 110, powerType = 3, testSpec = L["Subtlety"], race = "Human" }, ["arena4"] = { name = "Talmon", raceLoc = L["Human"], classLoc = L["Warlock"], class = "WARLOCK", health = 10221, healthMax = 14960, power = 9855, powerMax = 9855, powerType = 0, testSpec = L["Demonology"], race = "Human" }, ["arena5"] = { name = "Hydra", raceLoc = L["Undead"], classLoc = L["Priest"], class = "PRIEST", health = 11960, healthMax = 11960, power = 2515, powerMax = 10240, powerType = 0, testSpec = L["Discipline"], race = "Human" }, } self.specBuffs = self:GetSpecBuffs() self.specSpells = self:GetSpecSpells() -- Get Cooldown Spells self.cooldownSpells = self:GetCooldownList() self.cooldownSpellIds = {} self.spellTextures = {} for class, t in pairs(self.cooldownSpells) do for k, v in pairs(t) do local spellName, _, texture = GetSpellInfo(k) if spellName then self.cooldownSpellIds[spellName] = k self.spellTextures[k] = texture else self:Print("spellid does not exist " .. k) end end end self.NS = GetSpellInfo(16188) self.POM = GetSpellInfo(12043) self.NF = GetSpellInfo(18095) self.SHADOWBOLT = GetSpellInfo(27209) self.INSTANT = { [GetSpellInfo(172)] = true, -- Corruption [GetSpellInfo(2645)] = true, -- Ghost Wolf } self.CAST_TIMES = { [GetSpellInfo(26985)] = 1.5, -- Wrath } self.FD = GetSpellInfo(18708) self.SUMMON = { [GetSpellInfo(688)] = true, [GetSpellInfo(697)] = true, [GetSpellInfo(712)] = true, [GetSpellInfo(691)] = true, [GetSpellInfo(30146)] = true, } self.buttons = {} self.guids = {} self.curBracket = nil self.curUnit = 1 self.lastInstance = nil self:SetupOptions() for k, v in self:IterModules() do self:Call(v, "Initialise") -- B.E > A.E :D end end function Gladdy:OnProfileChanged() self.db = self.dbi.profile self:HideFrame() self:ToggleFrame(3) end function Gladdy:OnEnable() self:RegisterEvent("PLAYER_ENTERING_WORLD") if IsAddOnLoaded("BuffLib") then self.bufflibEnabled = true end if (IsAddOnLoaded("Clique")) then for i = 1, 5 do self:CreateButton(i) end ClickCastFrames = ClickCastFrames or {} ClickCastFrames[self.buttons.arena1.secure] = true ClickCastFrames[self.buttons.arena2.secure] = true ClickCastFrames[self.buttons.arena3.secure] = true ClickCastFrames[self.buttons.arena4.secure] = true ClickCastFrames[self.buttons.arena5.secure] = true end if (not self.db.locked and self.db.x == 0 and self.db.y == 0) then self:Print(L["Welcome to Gladdy!"]) self:Print(L["First run has been detected, displaying test frame."]) self:Print(L["Valid slash commands are:"]) self:Print(L["/gladdy ui"]) self:Print(L["/gladdy test2-5"]) self:Print(L["/gladdy hide"]) self:Print(L["/gladdy reset"]) self:Print(L["If this is not your first run please lock or move the frame to prevent this from happening."]) self:HideFrame() self:ToggleFrame(3) end end function Gladdy:Test() for i = 1, self.curBracket do local unit = "arena" .. i if (not self.buttons[unit]) then self:CreateButton(i) end local button = self.buttons[unit] for k, v in pairs(self.testData[unit]) do button[k] = v end for k, v in self:IterModules() do self:Call(v, "Test", unit) end button:SetAlpha(1) end end function Gladdy:PLAYER_ENTERING_WORLD() self:Reset() local instance = select(2, IsInInstance()) if (instance == "arena") then self:JoinedArena() elseif (instance ~= "arena" and self.lastInstance == "arena") then self:HideFrame() end self.lastInstance = instance end function Gladdy:Reset() if type(self.guids) == "table" then for k, v in pairs(self.guids) do self.guids[k] = nil end end self.guids = {} self.curBracket = nil self.curUnit = 1 for k1, v1 in self:IterModules() do self:Call(v1, "Reset") end for k2 in pairs(self.buttons) do self:ResetUnit(k2) end end function Gladdy:ResetUnit(unit) local button = self.buttons[unit] if (not button) then return end button:SetAlpha(0) button._health = nil button._power = nil button.name = nil button.health = nil button.healthMax = nil button.power = nil button.powerMax = nil button.powerType = nil button.guid = nil button.class = nil button.classLoc = nil button.raceLoc = nil button.spec = nil button.testSpec = nil for k1, v1 in pairs(self.BUTTON_DEFAULTS) do button[k1] = v1 end for k2, v2 in self:IterModules() do self:Call(v2, "ResetUnit", unit) end end function Gladdy:JoinedArena() self:RegisterEvent("UNIT_AURA") self:RegisterEvent("UNIT_HEALTH") self:RegisterEvent("UNIT_MANA", "UNIT_POWER") self:RegisterEvent("UNIT_ENERGY", "UNIT_POWER") self:RegisterEvent("UNIT_RAGE", "UNIT_POWER") self:RegisterEvent("UNIT_DISPLAYPOWER", "UNIT_POWER") self:RegisterEvent("UNIT_SPELLCAST_START") self:RegisterEvent("UNIT_SPELLCAST_STOP") self:RegisterEvent("UNIT_SPELLCAST_DELAYED") self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") self:RegisterEvent("UNIT_SPELLCAST_FAILED", "UNIT_SPELLCAST_STOP") self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED", "UNIT_SPELLCAST_STOP") self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START") self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE", "UNIT_SPELLCAST_DELAYED") self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", "UNIT_SPELLCAST_STOP") self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") self:RegisterEvent("PLAYER_TARGET_CHANGED") self:RegisterEvent("PLAYER_FOCUS_CHANGED") self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") self:RegisterEvent("UNIT_TARGET") self:ScheduleRepeatingTimer("UpdateUnits", 0.25, self) self:ScheduleRepeatingTimer("UpdateCastBars", 0.05, self) self:RegisterComm("Gladdy") for i = 1, MAX_BATTLEFIELD_QUEUES do local status, _, _, _, _, teamSize = GetBattlefieldStatus(i) if teamSize > 5 then teamSize = 3 end if (status == "active" and teamSize > 0) then self.curBracket = teamSize break end end if not self.curBracket then self.curBracket = 2 end for i = 1, self.curBracket do if (not self.buttons["arena" .. i]) then self:CreateButton(i) end end self:SendMessage("JOINED_ARENA") self:UpdateFrame() self.frame:Show() CombatLogClearEntries() end function Gladdy:UNIT_AURA(event, uid) local button = self:GetButton(uid) if (not button) then return end local Auras = Gladdy.modules.Auras local auraName, auraIcon, auraExpTime local priority = 0 local index = 1 while (true) do local name, _, icon, _, _, expTime = UnitBuff(uid, index) if (not name) then break end self:AuraGain(button.unit, name) if (Auras.auras[name] and Auras.auras[name].priority >= (Auras.frames[button.unit].priority or 0)) then auraName = name auraIcon = icon auraExpTime = expTime or nil priority = Auras.auras[name].priority end index = index + 1 end index = 1 while (true) do local name, rank, icon, _, _, _, expTime = UnitDebuff(uid, index) if (not name) then break end if name == GetSpellInfo(30405) then name = "Unstable Affliction Silence" end self:AuraGain(button.unit, name) if (Auras.auras[name] and Auras.auras[name].priority >= (Auras.frames[button.unit].priority or 0)) then auraName = name auraIcon = icon auraExpTime = expTime or nil priority = Auras.auras[name].priority end index = index + 1 end if (auraName) then if auraName == "Unstable Affliction Silence" then return -- we trust the CLOG here end if (not auraExpTime) then if (auraName == Auras.frames[button.unit].name) then auraExpTime = Auras.frames[button.unit].timeLeft else auraExpTime = Auras.auras[auraName].duration if button[DRData:GetSpellCategory(Auras.auras[auraName].spellID)] then auraExpTime = Auras.auras[auraName].duration * button[DRData:GetSpellCategory(Auras.auras[auraName].spellID)].diminished end end end self:SendMessage("AURA_GAIN", button.unit, auraName, auraIcon, auraExpTime, priority) else self:SendMessage("AURA_FADE", button.unit) end end function Gladdy:UNIT_HEALTH(event, uid) local button = self:GetButton(uid) if (not button) then return end if (not UnitIsDeadOrGhost(uid)) then button.health = UnitHealth(uid) button.healthMax = UnitHealthMax(uid) self:SendMessage("UNIT_HEALTH", button.unit, button.health, button.healthMax) else self:SendMessage("UNIT_DEATH", button.unit) end end function Gladdy:UNIT_POWER(event, uid) local button = self:GetButton(uid) if (not button) then return end if (not UnitIsDeadOrGhost(uid)) then button.power = UnitMana(uid) button.powerMax = UnitManaMax(uid) button.powerType = UnitPowerType(uid) self:SendMessage("UNIT_POWER", button.unit, button.power, button.powerMax, button.powerType) else self:SendMessage("UNIT_DEATH", button.unit) end end function Gladdy:UNIT_SPELLCAST_START(event, uid) local button = self:GetButton(uid) if (not button) then return end local spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(uid) if not endTime then return end local value = (startTime / 1000) - GetTime() local maxValue = (endTime - startTime) / 1000 self:CastStart(button.unit, spell, icon, value, maxValue, "cast") end function Gladdy:UNIT_SPELLCAST_CHANNEL_START(event, uid) local button = self:GetButton(uid) if (not button) then return end local spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(uid) if not endTime then return end local value = (endTime / 1000) - GetTime() local maxValue = (endTime - startTime) / 1000 self:CastStart(button.unit, spell, icon, value, maxValue, "channel") end function Gladdy:UNIT_SPELLCAST_SUCCEEDED(event, uid, spell) local button = self:GetButton(uid) if (not button) then return end self:CastSuccess(button.unit, spell) end function Gladdy:UNIT_SPELLCAST_DELAYED(event, uid) local button = self:GetButton(uid) if (not button) then return end local spell, rank, displayName, icon, startTime, endTime local value if (event == "UNIT_SPELLCAST_DELAYED") then spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(uid) value = GetTime() - (startTime / 1000) else spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(uid) value = (endTime / 1000) - GetTime() end local castBar = Gladdy.modules.Castbar.frames[button.unit] castBar.value = value castBar.maxValue = (endTime - startTime) / 1000 castBar.bar:SetMinMaxValues(0, castBar.maxValue) end function Gladdy:UNIT_SPELLCAST_STOP(event, uid) local button = self:GetButton(uid) if (not button) then return end self:SendMessage("CAST_STOP", button.unit) end function Gladdy:UNIT_SPELLCAST_FAILED(event, uid) local button = self:GetButton(uid) if (not button) then return end self:SendMessage("CAST_STOP", button.unit) end Gladdy.eventGrps = { ["PARTY_KILL"] = "DEATH", ["UNIT_DIED"] = "DEATH", ["UNIT_DESTROYED"] = "DEATH", ["SWING_DAMAGE"] = "DAMAGE", ["RANGE_DAMAGE"] = "DAMAGE", ["SPELL_DAMAGE"] = "DAMAGE", ["SPELL_PERIODIC_DAMAGE"] = "DAMAGE", ["ENVIRONMENTAL_DAMAGE"] = "DAMAGE", ["DAMAGE_SHIELD"] = "DAMAGE", ["DAMAGE_SPLIT"] = "DAMAGE", ["SPELL_AURA_APPLIED"] = "BUFF", ["SPELL_PERIODIC_AURA_APPLIED"] = "BUFF", ["SPELL_AURA_APPLIED_DOSE"] = "BUFF", ["SPELL_PERIODIC_AURA_APPLIED_DOSE"] = "BUFF", ["SPELL_AURA_REFRESH"] = "REFRESH", ["SPELL_AURA_REMOVED"] = "FADE", ["SPELL_PERIODIC_AURA_REMOVED"] = "FADE", ["SPELL_AURA_REMOVED_DOSE"] = "FADE", ["SPELL_PERIODIC_AURA_REMOVED_DOSE"] = "FADE", ["SPELL_CAST_START"] = "CASTSTART", ["SPELL_SUMMON"] = "CASTSTART", ["SPELL_CREATE"] = "CASTSTART", ["SPELL_CAST_SUCCESS"] = "CASTSUCCESS", ["SPELL_CAST_FAILED"] = "CASTEND", ["SPELL_INTERRUPT"] = "INTERRUPT", } function Gladdy.DEATH(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if destUnit then self:SendMessage("UNIT_DEATH", destUnit) end end function Gladdy.DAMAGE(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if destUnit then local button = self.buttons[destUnit] if (not button) then return end button.damaged = t end end function Gladdy.BUFF(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if destUnit then local button = self.buttons[destUnit] if (not button) then return end spellName = (spellID == 31117 or spellID == 43523) and "Unstable Affliction Silence" or spellName self:AuraGain(destUnit, spellName, spellID, auraType) local Auras = Gladdy.modules.Auras local aura = Auras.auras[spellName] if (aura and aura.priority >= (Auras.frames[destUnit].priority or 0)) then local auraIcon = select(3, GetSpellInfo(spellID)) local auraExpTime = aura.duration if button[DRData:GetSpellCategory(spellID)] then auraExpTime = aura.duration * button[DRData:GetSpellCategory(spellID)].diminished end self:SendMessage("AURA_GAIN", destUnit, spellName, auraIcon, auraExpTime, aura.priority) button.spells[spellName] = t end end end function Gladdy.REFRESH(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if destUnit then local button = self.buttons[destUnit] if (not button) then return end if auraType == AURA_TYPE_DEBUFF then local drCat = DRData:GetSpellCategory(spellID) if drCat then if( not button[drCat] ) then button[drCat] = { reset = 0, diminished = 1.0 } end local time = GetTime() local tracked = button[drCat] tracked.reset = time + DRData:GetResetTime() tracked.diminished = DRData:NextDR(tracked.diminished) end end if (button.spells[spellName] and t > button.spells[spellName]) then self:AuraGain(destUnit, spellName, spellID, auraType) local Auras = Gladdy.modules.Auras local aura = Auras.auras[spellName] if (aura and aura.priority >= (Auras.frames[destUnit].priority or 0)) then local auraIcon = select(3, GetSpellInfo(spellID)) local auraExpTime = aura.duration if button[DRData:GetSpellCategory(spellID)] then auraExpTime = aura.duration * button[DRData:GetSpellCategory(spellID)].diminished end self:SendMessage("AURA_GAIN", destUnit, spellName, auraIcon, auraExpTime, aura.priority) button.spells[spellName] = t end end end end function Gladdy.FADE(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if destUnit then local button = self.buttons[destUnit] if (not button) then return end spellName = (spellID == 31117 or spellID == 43523) and "Unstable Affliction Silence" or spellName self:AuraFade(destUnit, spellName, spellID, auraType) local Auras = Gladdy.modules.Auras if (spellName == Auras.frames[destUnit].name) then self:SendMessage("AURA_FADE", destUnit) button.spells[spellName] = nil end end end function Gladdy.CASTSTART(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if srcUnit then local fromTarget = CombatLog_Object_IsA(sourceFlags, COMBATLOG_OBJECT_TARGET) local fromFocus = CombatLog_Object_IsA(sourceFlags, COMBATLOG_OBJECT_FOCUS) if (not fromTarget and not fromFocus) then local icon = select(3, GetSpellInfo(spellID)) local castTime = self.CAST_TIMES[spellName] or select(7, GetSpellInfo(spellID)) / 1000 self:CastStart(srcUnit, spellName, icon, 0, castTime, "cast") end end end function Gladdy.CASTSUCCESS(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if srcUnit then self:CastSuccess(srcUnit, spellName) self:SendMessage("CAST_STOP", srcUnit) end end function Gladdy.CASTEND(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if srcUnit then local fromTarget = CombatLog_Object_IsA(sourceFlags, COMBATLOG_OBJECT_TARGET) local fromFocus = CombatLog_Object_IsA(sourceFlags, COMBATLOG_OBJECT_FOCUS) if (not fromTarget and not fromFocus) then self:SendMessage("CAST_STOP", srcUnit) end end end function Gladdy.INTERRUPT(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) if srcUnit then self:SendMessage("CAST_STOP", srcUnit) end end Gladdy.EventParse = { ["PARTY_KILL"] = Gladdy.DEATH, ["UNIT_DIED"] = Gladdy.DEATH, ["UNIT_DESTROYED"] = Gladdy.DEATH, ["SWING_DAMAGE"] = Gladdy.DAMAGE, ["RANGE_DAMAGE"] = Gladdy.DAMAGE, ["SPELL_DAMAGE"] = Gladdy.DAMAGE, ["SPELL_PERIODIC_DAMAGE"] = Gladdy.DAMAGE, ["ENVIRONMENTAL_DAMAGE"] = Gladdy.DAMAGE, ["DAMAGE_SHIELD"] = Gladdy.DAMAGE, ["DAMAGE_SPLIT"] = Gladdy.DAMAGE, ["SPELL_AURA_APPLIED"] = Gladdy.BUFF, ["SPELL_PERIODIC_AURA_APPLIED"] = Gladdy.BUFF, ["SPELL_AURA_APPLIED_DOSE"] = Gladdy.BUFF, ["SPELL_PERIODIC_AURA_APPLIED_DOSE"] = Gladdy.BUFF, ["SPELL_AURA_REFRESH"] = Gladdy.REFRESH, ["SPELL_AURA_REMOVED"] = Gladdy.FADE, ["SPELL_PERIODIC_AURA_REMOVED"] = Gladdy.FADE, ["SPELL_AURA_REMOVED_DOSE"] = Gladdy.FADE, ["SPELL_PERIODIC_AURA_REMOVED_DOSE"] = Gladdy.FADE, ["SPELL_CAST_START"] = Gladdy.CASTSTART, ["SPELL_SUMMON"] = Gladdy.CASTSTART, ["SPELL_CREATE"] = Gladdy.CASTSTART, ["SPELL_CAST_SUCCESS"] = Gladdy.CASTSUCCESS, ["SPELL_CAST_FAILED"] = Gladdy.CASTEND, ["SPELL_INTERRUPT"] = Gladdy.INTERRUPT, } function Gladdy:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellID, spellName, spellSchool, auraType, amount, ...) if (not self.eventGrps[eventType]) then return end local srcUnit = self.guids[sourceGUID] local destUnit = self.guids[destGUID] local t = ("%.1f"):format(GetTime()) local parsefunc = Gladdy.EventParse[eventType] if parsefunc then parsefunc(self, sourceFlags, spellID, spellName, spellSchool, auraType, destUnit, srcUnit, t) end -- cooldown tracker if self.cooldownSpellIds[spellName] and srcUnit then local unit = srcUnit if self.buttons[unit] then local unitClass local spellId = self.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank if (self.cooldownSpells[self.buttons[unit].class][spellId]) then unitClass = self.buttons[unit].class else unitClass = self.buttons[unit].race end self:CooldownUsed(unit, unitClass, spellId, spellName) end end end function Gladdy:UpdateUnits() for unit, v in pairs(unitsToCheck) do self:UpdateUnit(unit); end end function Gladdy:UpdateCastBars() --[[ above can randomly start casts, but we also need to stop the casts, if we lose all information information can either be lost by losing the unit (e.g. your pet doesn't target the player anymore) or they stop the actual cast. therefore sometimes the castbar may disappear, even though the player hasn't stopped the cast ]] for i = 1, 5 do local button = self.buttons["arena" .. i] if button and button.guid ~= UnitGUID("target") and button.guid ~= UnitGUID("focus") then local spell, rank, displayName, icon, startTime, endTime, event local value -- check if any relevant unit that isn't target or focus, but still equal to arena1-5 is casting for uid, v in pairs(unitsToCheck) do if button.guid == UnitGUID(uid) then spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(uid) event = "cast" if startTime then value = GetTime() - (startTime / 1000) end -- try to have a backup in case server returns UnitCastingInfo data when it should be UnitChannelInfo if not spell or channelSpells[spell] then spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(uid) if endTime then value = (endTime / 1000) - GetTime() end event = "channel" end end end if spell then self:SendMessage("CAST_START", button.unit, spell, icon, value, (endTime - startTime) / 1000, event) elseif not spell and not self.db.castBarGuesses then self:SendMessage("CAST_STOP", button.unit) end end end end function Gladdy:UpdateUnit(unit) local guid = UnitGUID(unit) if (guid and self:IsValid(unit)) then self:UpdateGUID(guid, unit) end end function Gladdy:PLAYER_TARGET_CHANGED() local guid = UnitGUID("target") if (guid and self:IsValid("target")) then self:UpdateGUID(guid, "target") end for k, v in pairs(self.buttons) do self:Call("Highlight", "Toggle", k, "target", guid and guid == v.guid) end end function Gladdy:PLAYER_FOCUS_CHANGED() local guid = UnitGUID("focus") if (guid and self:IsValid("focus")) then self:UpdateGUID(guid, "focus") end for k, v in pairs(self.buttons) do self:Call("Highlight", "Toggle", k, "focus", guid and guid == v.guid) end end function Gladdy:UPDATE_MOUSEOVER_UNIT() local guid = UnitGUID("mouseover") if (guid and self:IsValid("mouseover")) then self:UpdateGUID(guid, "mouseover") end end function Gladdy:UNIT_TARGET(event, uid) if (UnitIsPartyLeader(uid) and UnitName(uid) ~= UnitName("player")) then local unit = uid .. "target" local guid = UnitGUID(unit) if (guid and self:IsValid(unit)) then self:UpdateGUID(guid, unit) end for k, v in pairs(self.buttons) do self:Call("Highlight", "Toggle", k, "leader", guid and guid == v.guid) end end end function Gladdy:OnCommReceived(prefix, message, dest, sender) -- hack, to avoid faulty messages from ArenaIdentify (not server sent) if dest ~= "WHISPER" then return end ---- if (prefix == "Gladdy" and sender ~= UnitName("player")) then local name, guid, class, classLoc, raceLoc, spec, health, healthMax, power, powerMax, powerType = strsplit(',', message) health, healthMax = tonumber(health), tonumber(healthMax) power, powerMax, powerType = tonumber(power), tonumber(powerMax), tonumber(powerType) if self:IsInParty(guid) then return end local unit = self.guids[guid] if (not unit) then unit = self:EnemySpotted(name, guid, class, classLoc, raceLoc) end local button = self.buttons[unit] if (not button) then return end button.health = health button.healthMax = healthMax self:SendMessage("UNIT_HEALTH", unit, health, healthMax) button.power = power button.powerMax = powerMax button.powerType = powerType self:SendMessage("UNIT_POWER", unit, power, powerMax, powerType) if (spec ~= "") then self:DetectSpec(unit, spec) end end end function Gladdy:GetButton(uid) local guid = UnitGUID(uid) local unit = self.guids[guid] return self.buttons[unit] end function Gladdy:AuraGain(unit, aura, spellID, auraType) local button = self.buttons[unit] if (not button) then return end if auraType == AURA_TYPE_DEBUFF then local drCat = DRData:GetSpellCategory(spellID) if drCat then -- See if we should reset it back to undiminished local tracked = button[drCat] if( tracked and tracked.reset <= GetTime() ) then tracked.diminished = 1.0 end end end if (aura == self.NS) then button.ns = true elseif (aura == self.NF) then button.nf = true elseif (aura == self.POM) then button.pom = true elseif (aura == self.FD) then button.fd = true end self:Call("Announcements", "CheckDrink", unit, aura) self:DetectSpec(unit, self.specBuffs[aura]) end function Gladdy:AuraFade(unit, aura, spellID, auraType) local button = self.buttons[unit] if (not button) then return end if auraType == AURA_TYPE_DEBUFF then local drCat = DRData:GetSpellCategory(spellID) if drCat then if( not button[drCat] ) then button[drCat] = { reset = 0, diminished = 1.0 } end local time = GetTime() local tracked = button[drCat] tracked.reset = time + DRData:GetResetTime() tracked.diminished = DRData:NextDR(tracked.diminished) end end if (aura == self.NS) then button.ns = false elseif (aura == self.NF) then button.nf = false elseif (aura == self.POM) then button.pom = false elseif (aura == self.FD) then button.fd = false end end function Gladdy:CastStart(unit, spell, icon, value, maxValue, event) local button = self.buttons[unit] if (not button) then return end if (button.ns or button.pom or (button.nf and spell == self.SHADOWBOLT) or self.INSTANT[spell]) then self:CastSuccess(unit, spell) return elseif (button.fd and self.SUMMON[spell]) then maxValue = 0.5 end self:SendMessage("CAST_START", unit, spell, icon, value, maxValue, event) self:DetectSpec(unit, self.specSpells[spell]) end function Gladdy:CastSuccess(unit, spell) self:DetectSpec(unit, self.specSpells[spell]) end function Gladdy:DetectSpec(unit, spec) local button = self.buttons[unit] if (not button or not spec or button.spec ~= "") then return end button.spec = spec self:SendMessage("UNIT_SPEC", unit, spec) -- update cooldown tracker --[[ All of this could possibly be handled in a "once they're used, they show up"-manner but I PERSONALLY prefer it this way. It also meant less work and makes spec-specific cooldowns easier ]] if (self.db.cooldown) then local class = self.buttons[unit].class local race = self.buttons[unit].race for k, v in pairs(self.cooldownSpells[class]) do --if (self.db.cooldownList[k] ~= false and self.db.cooldownList[class] ~= false) then if (type(v) == "table" and ((v.spec ~= nil and v.spec == spec) or (v.notSpec ~= nil and v.notSpec ~= spec))) then local button = self.buttons[unit] local sharedCD = false if (type(v) == "table" and v.sharedCD ~= nil and v.sharedCD.cd == nil) then for spellId, _ in pairs(v.sharedCD) do for i = 1, button.lastCooldownSpell do local icon = button.spellCooldownFrame["icon" .. i] if (icon.spellId == spellId) then sharedCD = true end end end end if sharedCD then return end local icon = button.spellCooldownFrame["icon" .. button.lastCooldownSpell] icon:Show() icon.texture:SetTexture(self.spellTextures[k]) icon.spellId = k button.spellCooldownFrame["icon" .. button.lastCooldownSpell] = icon button.lastCooldownSpell = button.lastCooldownSpell + 1 end end --end end ---------------------- --- RACE FUNCTIONALITY ---------------------- local race = self.buttons[unit].race if self.cooldownSpells[race] then for k, v in pairs(self.cooldownSpells[race]) do --if (self.db.cooldownList[k] ~= false and self.db.cooldownList[class] ~= false) then if (type(v) == "table" and ((v.spec ~= nil and v.spec == spec) or (v.notSpec ~= nil and v.notSpec ~= spec))) then local button = self.buttons[unit] local sharedCD = false if (type(v) == "table" and v.sharedCD ~= nil and v.sharedCD.cd == nil) then for spellId, _ in pairs(v.sharedCD) do for i = 1, button.lastCooldownSpell do local icon = button.spellCooldownFrame["icon" .. i] if (icon.spellId == spellId) then sharedCD = true end end end end if sharedCD then return end local icon = button.spellCooldownFrame["icon" .. button.lastCooldownSpell] icon:Show() icon.texture:SetTexture(self.spellTextures[k]) icon.spellId = k button.spellCooldownFrame["icon" .. button.lastCooldownSpell] = icon button.lastCooldownSpell = button.lastCooldownSpell + 1 end end end end function Gladdy:IsValid(uid) if (UnitExists(uid) and UnitName(uid) and UnitIsPlayer(uid) and UnitCanAttack("player", uid) and not UnitIsCharmed(uid) and not UnitIsCharmed("player")) then return true end end function Gladdy:UpdateCooldowns(button) local class = button.class local race = button.race if (self.db.cooldown) then for k, v in pairs(self.cooldownSpells[class]) do if (type(v) ~= "table" or (type(v) == "table" and v.spec == nil and v.notSpec == nil)) then -- see if we have shared cooldowns without a cooldown defined -- e.g. hunter traps have shared cooldowns, so only display one trap instead all of them local sharedCD = false if (type(v) == "table" and v.sharedCD ~= nil and v.sharedCD.cd == nil) then for spellId, _ in pairs(v.sharedCD) do for i = 1, button.lastCooldownSpell do local icon = button.spellCooldownFrame["icon" .. i] if (icon.spellId == spellId) then sharedCD = true end end end end if (not sharedCD) then local icon = button.spellCooldownFrame["icon" .. button.lastCooldownSpell] icon:Show() icon.spellId = k icon.texture:SetTexture(self.spellTextures[k]) button.spellCooldownFrame["icon" .. button.lastCooldownSpell] = icon button.lastCooldownSpell = button.lastCooldownSpell + 1 end end end ---- -- RACE FUNCTIONALITY ---- for k, v in pairs(self.cooldownSpells[race]) do if (type(v) ~= "table" or (type(v) == "table" and v.spec == nil and v.notSpec == nil)) then local icon = button.spellCooldownFrame["icon" .. button.lastCooldownSpell] icon:Show() icon.spellId = k icon.texture:SetTexture(self.spellTextures[k]) button.spellCooldownFrame["icon" .. button.lastCooldownSpell] = icon button.lastCooldownSpell = button.lastCooldownSpell + 1 end end end end function Gladdy:UpdateGUID(guid, uid) local unit = self.guids[guid] if (not unit) then local name = UnitName(uid) local classLoc, class = UnitClass(uid) local raceLoc, race = UnitRace(uid) unit = self:EnemySpotted(name, guid, class, classLoc, raceLoc, race) end if unit then local button = self.buttons[unit] local classLoc, class = UnitClass(uid) local raceLoc, race = UnitRace(uid) -- update cooldown tracker if button then button.race = race button.lastCooldownSpell = 1 self:UpdateCooldowns(button) end end self:UNIT_AURA(nil, uid) self:UNIT_HEALTH(nil, uid) self:UNIT_POWER(nil, uid) end function Gladdy:EnemySpotted(name, guid, class, classLoc, raceLoc, race) if name == "Unknown" or self:IsInParty(guid) then return end local units = {[1] = 0,[2] = 0, [3] = 0} for i=1, self.curBracket do if self.buttons["arena" .. i] and (self.buttons["arena" .. i].name ~= "" and self.buttons["arena" .. i].name) then units[i] = 1 end end for i=1,#units do if units[i] == 0 then self.curUnit = i break end end if (class == "ROGUE" or class == "WARRIOR" or class == "HUNTER") and units[self.curBracket] == 0 then self.curUnit = self.curBracket end local unit = "arena" .. self.curUnit self.guids[guid] = unit local button = self.buttons[unit] if (not button) then return end button.name = name button.guid = guid button.class = class button.classLoc = classLoc button.raceLoc = raceLoc button.race = race or button.race self:SendMessage("ENEMY_SPOTTED", unit) button:SetAlpha(1) return unit end function Gladdy:IsInParty(guid) for i = 1, GetNumPartyMembers() do if guid == UnitGUID("party" .. i) then return true end end for i = 1, GetNumRaidMembers() do if guid == UnitGUID("raid" .. i) then return true end end return false end function Gladdy:CooldownUsed(unit, unitClass, spellId, spellName) local button = self.buttons[unit] if not button then return end -- if (self.db.cooldownList[spellId] == false) then return end local cooldown = self.cooldownSpells[unitClass][spellId] local cd = cooldown if (type(cooldown) == "table") then -- return if the spec doesn't have a cooldown for this spell --if (arenaSpecs[unit] ~= nil and cooldown.notSpec ~= nil and arenaSpecs[unit] == cooldown.notSpec) then return end if (button.spec ~= nil and cooldown.notSpec ~= nil and button.spec == cooldown.notSpec) then return end -- check if we need to reset other cooldowns because of this spell if (cooldown.resetCD ~= nil) then for k, v in pairs(cooldown.resetCD) do self:CooldownReady(button, k, false) end end -- check if there is a special cooldown for the units spec --if (arenaSpecs[unit] ~= nil and cooldown[arenaSpecs[unit]] ~= nil) then if (button.spec ~= nil and cooldown[button.spec] ~= nil) then cd = cooldown[button.spec] else cd = cooldown.cd end -- check if there is a shared cooldown with an other spell if (cooldown.sharedCD ~= nil) then local sharedCD = cooldown.sharedCD.cd and cooldown.sharedCD.cd or cd for k, v in pairs(cooldown.sharedCD) do if (k ~= "cd") then self:CooldownStart(button, k, sharedCD) end end end end if (self.db.cooldown) then -- start cooldown self:CooldownStart(button, spellId, cd) end --[[ announcement if (self.db.cooldownAnnounce or self.db.cooldownAnnounceList[spellId] or self.db.cooldownAnnounceList[unitClass]) then self:SendAnnouncement(string.format(L["COOLDOWN USED: %s (%s) used %s - %s sec. cooldown"], UnitName(unit), UnitClass(unit), spellName, cd), RAID_CLASS_COLORS[UnitClass(unit)], self.db.cooldownAnnounceList[spellId] and self.db.cooldownAnnounceList[spellId] or self.db.announceType) end]] --[[ sound file if (db.cooldownSoundList[spellId] ~= nil and db.cooldownSoundList[spellId] ~= "disabled") then PlaySoundFile(LSM:Fetch(LSM.MediaType.SOUND, db.cooldownSoundList[spellId])) end ]] end function Gladdy:CooldownStart(button, spellId, duration) -- starts timer frame if not duration or duration == nil or type(duration) ~= "number" then return end for i = 1, button.lastCooldownSpell + 1 do if (button.spellCooldownFrame["icon" .. i].spellId == spellId) then local frame = button.spellCooldownFrame["icon" .. i] frame.active = true frame.timeLeft = duration if (not Gladdy.db.cooldownDisableCircle) then frame.cooldown:SetCooldown(GetTime(), duration) end frame:SetScript("OnUpdate", function(self, elapsed) self.timeLeft = self.timeLeft - elapsed local timeLeft = ceil(self.timeLeft) if timeLeft >= 540 then self.cooldownFont:SetText(ceil(timeLeft / 60) .. "m") self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 3.1 * Gladdy.db.cooldownFontScale, "OUTLINE") elseif timeLeft < 540 and timeLeft >= 60 then -- more than 1 minute self.cooldownFont:SetText(ceil(timeLeft / 60) .. "m") self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE") elseif timeLeft < 60 and timeLeft > 0 then -- between 60s and 21s (green) self.cooldownFont:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.cooldownFont), Gladdy.db.cooldownSize / 2.15 * Gladdy.db.cooldownFontScale, "OUTLINE") self.cooldownFont:SetText(timeLeft) else self.cooldownFont:SetText("") end if (self.timeLeft <= 0) then Gladdy:CooldownReady(button, spellId, frame) end if (self.timeLeft <= 0) then Gladdy:CooldownReady(button, spellId, frame) end end) end end end function Gladdy:CooldownReady(button, spellId, frame) if (frame == false) then for i = 1, button.lastCooldownSpell do frame = button.spellCooldownFrame["icon" .. i] if (frame.spellId == spellId) then frame.active = false frame.cooldown:Hide() frame.cooldownFont:SetText("") frame:SetScript("OnUpdate", nil) end end else frame.active = false frame.cooldown:Hide() frame.cooldownFont:SetText("") frame:SetScript("OnUpdate", nil) end end
-- bar.lua -- Handles bar local gears = require('gears') local awful = require('awful') local beautiful = require('beautiful') local wibox = require('wibox') local naughty = require("naughty") --local menubar = require("menubar") local hotkeys_popup = require("awful.hotkeys_popup") local vars = require('modules.vars') local menulaunch = require('modules.menu') local M = {} local testwid = require('widget.battery') local volwid = require('widget.vol') local clock = wibox.widget.textclock() -- {{{Declare tag buttons local tag_buts = gears.table.join( awful.button({ }, 1, function(t) t:view_only() end), awful.button({ modkey }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, function(t) if client.focus then client.focus:toggle_tag(t) end end), awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) ) -- }}} -- {{{Declare task buttons local task_buts = gears.table.join( awful.button({ }, 1, function (c) if c == client.focus then c.minimized = true else c:emit_signal( "request::activate", "tasklist", {raise = true} ) end end), awful.button({ }, 3, function() awful.menu.client_list({ theme = { width = 250 } }) end), awful.button({ }, 4, function () awful.client.focus.byidx(1) end), awful.button({ }, 5, function () awful.client.focus.byidx(-1) end) ) --}}} -- {{{Wallpaper function local function wall_set(s) if beautiful.wallpaper then local wall = beautiful.wallpaper if type(wall) == 'function' then wall = wal(s) end gears.wallpaper.maximized(wall, s, true) end end -- }}} --{{{Signal & Bar screen.connect_signal('property::geometry', wall_set) awful.screen.connect_for_each_screen(function(s) -- Set wallpaper wall_set(s) -- Tag Table awful.tag({'一', '二', '三', '四', '五', '六', '七', '八', '九'}, s, awful.layout.layouts[1]) -- Promptbox for every screen s.promptbox = awful.widget.prompt() --Layout box per screen s.layoutbox = awful.widget.layoutbox(s) s.layoutbox:buttons(gears.table.join( awful.button({ }, 1, function() awful.layout.inc(1) end), awful.button({ }, 3, function() awful.layout.inc(-1) end), awful.button({ }, 4, function() awful.layout.inc(1) end), awful.button({ }, 5, function() awful.layout.inc(-1) end) )) -- Taglist widget s.taglist = awful.widget.taglist { screen = s; filter = awful.widget.taglist.filter.all; buttons = tag_buts; } -- Tasklist widget s.tasklist = awful.widget.tasklist { screen = s; filter = awful.widget.tasklist.filter.currenttags; buttons = task_buts } -- Create the WeebBox s.wibox = awful.wibar({position = 'top', screen = s}) s.wibox:setup{ layout = wibox.layout.align.horizontal, { -- Das Linke layout = wibox.layout.fixed.horizontal; --menulaunch.launcher; s.taglist; s.promptbox; }, -- Midbar s.tasklist; { -- The Right layout = wibox.layout.fixed.horizontal; wibox.widget.systray(); testwid:init(); volwid:init({}); clock; --s.layoutbox; }, } end)
--------------------------------------------------------------- -- Copyright 2020 Deviap (https://deviap.com/) -- --------------------------------------------------------------- -- Made available under the MIT License: -- -- https://github.com/deviap/sample-apps/blob/master/LICENSE -- --------------------------------------------------------------- -- Users can send us messages core.networking:on("message", function(client, msg) -- Do not trust the client, -- We must validate their message -- In this case, we'll just limit it to 100 characters msg = tostring(msg):sub(0, 100) -- Pass on the cropped message to all clients core.networking:broadcast("message", client.name .. ": " .. msg) end) -- When a user connects core.networking:on("_clientConnected", function(client) -- Broadcast a message with their username core.networking:broadcast("message", "server: " .. client.name .. " connected") end) -- And when a user disconnects... core.networking:on("_clientDisconnected", function(client) -- Broadcast a message with their username core.networking:broadcast("message", "server: " .. client.name .. " disconnected") end)
local data = {} local n = 1000 --should be an even number as we use n/2 below... for i=1,n do data[i] = tostring(i) end function testSimpleAdd() local bs, bg bg = parsejoy.makeStringBitGrammar() bs = parsejoy.StringBitSet(bg) luaunit.assertEquals(bs:Contains("test"),false) bs:Add("test") luaunit.assertEquals(bs:Contains("test"),true) luaunit.assertEquals(bg:Get("test"),1) end function testCount() local bs, bg bg = parsejoy.makeStringBitGrammar() bs = parsejoy.StringBitSet(bg) bs:Add("test") luaunit.assertEquals(bs:N(),1) end function testRemove() local bs, bg bg = parsejoy.makeStringBitGrammar() bs = parsejoy.StringBitSet(bg) bs:Add("test") bs:Add("tests") luaunit.assertEquals(bs:Contains("tests"),true) luaunit.assertEquals(bs:Contains("test"),true) bs:Remove("test") luaunit.assertEquals(bs:Contains("tests"),true) luaunit.assertEquals(bs:Contains("test"),false) bs:Remove("tests") luaunit.assertEquals(bs:Contains("tests"),false) luaunit.assertEquals(bs:Contains("test"),false) end function testIds() local bs, bg, testId bg = parsejoy.makeStringBitGrammar() bs = parsejoy.StringBitSet(bg) testId = bg:GetOrAdd("test") bs:Add("test") luaunit.assertEquals(bs:ContainsId(testId),true) end function testSubtract() local bg, bs1, bs2, bs3 bg = parsejoy.makeStringBitGrammar() bs1 = parsejoy.StringBitSet(bg) bs2 = parsejoy.StringBitSet(bg) bs1:Add("a") bs1:Add("b") bs1:Add("c") bs2:Add("c") bs3 = bs1:Subtract(bs2) luaunit.assertEquals(bs3:N(),2) luaunit.assertEquals(bs3:Contains("c"),false) luaunit.assertEquals(bs3:Contains("a"),true) luaunit.assertEquals(bs3:Contains("b"),true) end function testLargeSubtract() local bg, bs1, bs2, bs3 bg = parsejoy.makeStringBitGrammar() bs1 = parsejoy.StringBitSet(bg) bs2 = parsejoy.StringBitSet(bg) for key, value in pairs(data) do if key % 2 == 0 then bs1:Add(value) luaunit.assertEquals(bs1:N(),key/2) end bs2:Add(value) luaunit.assertEquals(bs2:N(),key) end luaunit.assertEquals(bs1:N(),n/2) luaunit.assertEquals(bs2:N(),n) bs3 = bs2:Subtract(bs1) luaunit.assertEquals(bs3:N(),n/2) --we make sure bs3 contains only values that are in bs2 but not in bs1 for key, value in pairs(data) do if key % 2 == 0 then luaunit.assertEquals(bs3:Contains(value),false) else luaunit.assertEquals(bs3:Contains(value),true) end end end function testUnion() local bg, bs1, bs2, bs3 bg = parsejoy.makeStringBitGrammar() bs1 = parsejoy.StringBitSet(bg) bs2 = parsejoy.StringBitSet(bg) bs1:Add("a") bs1:Add("b") bs1:Add("c") bs2:Add("c") bs2:Add("d") bs2:Add("e") bs3 = bs1:Union(bs2) luaunit.assertEquals(bs3:N(),5) luaunit.assertEquals(bs3:Contains("a"),true) luaunit.assertEquals(bs3:Contains("b"),true) luaunit.assertEquals(bs3:Contains("c"),true) luaunit.assertEquals(bs3:Contains("d"),true) luaunit.assertEquals(bs3:Contains("e"),true) end function testLargeUnion() local bg, bs1, bs2, bs3 bg = parsejoy.makeStringBitGrammar() bs1 = parsejoy.StringBitSet(bg) bs2 = parsejoy.StringBitSet(bg) for key, value in pairs(data) do if key % 2 == 0 then bs1:Add(value) luaunit.assertEquals(bs1:N(),key/2) end bs2:Add(value) luaunit.assertEquals(bs2:N(),key) end luaunit.assertEquals(bs1:N(),n/2) luaunit.assertEquals(bs2:N(),n) bs3 = bs2:Union(bs1) luaunit.assertEquals(bs3:N(),n) for key, value in pairs(data) do luaunit.assertEquals(bs3:Contains(value),true) end end function testIntersect() local bg, bs1, bs2, bs3 bg = parsejoy.makeStringBitGrammar() bs1 = parsejoy.StringBitSet(bg) bs2 = parsejoy.StringBitSet(bg) bs1:Add("a") bs1:Add("b") bs1:Add("c") bs2:Add("c") bs2:Add("d") bs2:Add("e") bs3 = bs1:Intersect(bs2) luaunit.assertEquals(bs3:N(),1) luaunit.assertEquals(bs3:Contains("a"),false) luaunit.assertEquals(bs3:Contains("b"),false) luaunit.assertEquals(bs3:Contains("c"),true) luaunit.assertEquals(bs3:Contains("d"),false) luaunit.assertEquals(bs3:Contains("e"),false) end function testLargeIntersect() local bg, bs1, bs2, bs3 bg = parsejoy.makeStringBitGrammar() bs1 = parsejoy.StringBitSet(bg) bs2 = parsejoy.StringBitSet(bg) for key, value in pairs(data) do if key % 2 == 0 then bs1:Add(value) luaunit.assertEquals(bs1:N(),key/2) end bs2:Add(value) luaunit.assertEquals(bs2:N(),key) end luaunit.assertEquals(bs1:N(),n/2) luaunit.assertEquals(bs2:N(),n) bs3 = bs2:Intersect(bs1) luaunit.assertEquals(bs3:N(),n/2) for key, value in pairs(data) do if bs2:Contains(value) and bs1:Contains(value) then luaunit.assertEquals(bs3:Contains(value),true) else luaunit.assertEquals(bs3:Contains(value),false) end end end
local skynet = require "skynet" local netpack = require "netpack" local sprotoloader = require "sprotoloader" local socket = require "socket" local util = require "util" local loginservice = tonumber(...) local CMD = {} local SOCKET = {} local gate local agent = {} local host local send_request local function send_package(fd, pack) local package = string.pack(">s2", pack) socket.write(fd, package) end function SOCKET.open(fd, addr) skynet.error("New client from : " .. addr) -- agent[fd] = skynet.newservice("agent") -- skynet.call(agent[fd], "lua", "start", {gate = gate, client = fd, watchdog = skynet.self()}) skynet.call(gate, "lua", "register", fd) end local function close_agent(fd) local a = agent[fd] agent[fd] = nil if a then skynet.call(gate, "lua", "kick", fd) -- disconnect never return skynet.send(a, "lua", "disconnect") end end function SOCKET.close(fd) print("socket close",fd) close_agent(fd) end function SOCKET.error(fd, msg) print("socket error", fd, msg) close_agent(fd) end function SOCKET.warning(fd, size) -- size K bytes havn't send out in fd print("socket warning", fd, size) end function SOCKET.data(fd, msg, sz) local t, name, args, response = host:dispatch(msg, sz) if not agent[fd] then local subid = args["subid"] if not subid then return end local c = skynet.call(loginservice, "lua", "agent_get", tostring(subid)) if not c then return end agent[fd] = c skynet.call(c, "lua", "start", {gate = gate, client = fd, watchdog = skynet.self()}) end if t == "REQUEST" and args["subid"] then if name == "login" then local subid = args["subid"] local name = args["name"] local ret = skynet.call(gate, "lua", "auth", subid, name) if not ret then if response then local ret = response({result = "ERROR"}) send_package(fd, ret) end return end if response then local ret = response({result = "OK"}) send_package(fd, ret) end elseif name == "register" then skynet.call(c, "lua", "register", {args["name"], args["password"]}) end end end function CMD.start(conf) skynet.call(gate, "lua", "open" , conf) host = sprotoloader.load(1):host "package" send_request = host:attach(sprotoloader.load(2)) end function CMD.close(fd) close_agent(fd) end skynet.start(function() skynet.dispatch("lua", function(session, source, cmd, subcmd, ...) if cmd == "socket" then local f = SOCKET[subcmd] f(...) -- socket api don't need return else local f = assert(CMD[cmd]) skynet.ret(skynet.pack(f(subcmd, ...))) end end) gate = skynet.newservice("gate", loginservice) end)
----------------------------------------- -- ID: 4690 -- Scroll of Baramnesia -- Teaches the white magic Baramnesia ----------------------------------------- function onItemCheck(target) return target:canLearnSpell(84) end function onItemUse(target) target:addSpell(84) end
local awful = require('awful') local apps = { browser = 'brave', editor = os.getenv('EDITOR') or 'nvim', fmanager = 'pcmanfm', geditor = 'geany', launcher = 'dmenu_run -i -p "Run:"', rofi = 'rofi -show drun', lock = 'i3lock', mplayer = 'spotify', screenshot = 'maim -B -u $HOME/.screenshots/"Screenshot-"$(date +%Y-%m-%d-%H-%M).png', terminal = 'kitty', vplayer = 'mpv', vector = 'inkscape', ssh = 'filezilla', wallpaper = 'sxiv -t -o -r /home/hisham/Pictures/*' } local function run_once(cmd) local findme = cmd local firstspace = cmd:find(' ') if firstspace then findme = cmd:sub(0, firstspace - 1) end awful.spawn.with_shell(string.format('pgrep -u $USER -x %s > /dev/null || (%s)', findme, cmd), false) end do local startup_apps= { --'nitrogen --restore', --'picom --experimental-backends', --'lxsession', } for _,apps in pairs(startup_apps) do run_once(apps) end end return apps
local function keycode(code, shift, ctrl, alt) return ((shift and 1 or 0) << 2) | ((ctrl and 1 or 0) << 1) | (alt and 1 or 0) | (code << 3) end local function keych(ch, shift, ctrl, alt) return keycode(string.byte(ch), shift, ctrl, alt) end local function iMode() editor.CaretStyle = 1 OnKey = imapOnKey end local function nMode() editor.CaretStyle = 2 OnKey = nmapOnKey end local function OnKeyFromMap(map) OnKey = function (key, s, c, a) local act = map[keycode(key, s, c, a)] if act then local morekeys = false if type(act) == "string" then morekeys = editor[act](editor) else act() end if not morekeys then nMode() end else print "Keybinding not found" nMode() end return true end end imap = { [keych('h', false, true)] = "DeleteBack", [keych('[', false, true)] = nMode, [keych('m', false, true)] = "NewLine", [keych('w', false, true)] = "DelWordLeft", [keycode(65307)] = nMode } local dmap = { [keych'w'] = function() editor:DelWordRight() end, [keych'd'] = function() editor:LineDelete() end } nmap = { [keych'd'] = function() OnKeyFromMap(dmap) end, [keych'g'] = function () OnKeyFromMap({[keych'g'] = "DocumentStart"}) end, [keych('G', true)] = "DocumentEnd", [keych'0'] = "HomeDisplay", [keych'k'] = "LineUp", [keych'j'] = "LineDown", [keych'b'] = "WordLeft", [keych'w'] = "WordRight", [keych'e'] = "WordRightEnd", [keych'p'] = "Paste", [keych('$', true, false)] = "LineEnd", [keych'h'] = "CharLeft", [keych'l'] = "CharRight", [keych'u'] = "Undo", [keych('r',false, true)] = "Redo", [keych('d',false, true)] = "PageDown", [keych('u',false, true)] = "PageUp", [keych('S', true)] = function() scite.MenuCommand(IDM_SAVE) end, [keych'o'] = function() editor:LineEnd() editor:NewLine() iMode() end, [keych('A', true)] = function() editor:LineEnd() iMode() end, [keych'a'] = function() editor:CharRight() iMode() end, [keych'x'] = function() editor:CharRight() editor:DeleteBack() end, [keych'i'] = function() iMode() end } function nmapOnKey(key, shift, ctrl, alt) local act = nmap[keycode(key, shift, ctrl, alt)] if act then if type(act) == "string" then editor[act](editor) else act() end return true end print(key, shift, ctrl, alt) return true end function imapOnKey(key, shift, ctrl, alt) local act = imap[keycode(key, shift, ctrl, alt)] if act then if type(act) == "string" then editor[act](editor) else act() end return true end return false end OnKey = nmapOnKey
------------------------ -- Entity class. -- Base class of pretty much all your game objects. -- -- Derived from @{Object}. -- @cl Entity --- @type Entity local Entity = class("Entity") Entity:include( Positional ) -- Generate unique entity IDs local entCounter = 0 local function getEntUID() entCounter = entCounter + 1 return entCounter end function Entity:initialize() Positional.initialize( self ) self._entIndex = getEntUID() self._depth = 0 self:setDrawBoundingBox() self._removeflag = false end function Entity.static.isValid( ent ) return ent ~= nil and ent._removeflag == false end function Entity:update( dt ) end function Entity:draw() end function Entity:onRemove() end -- gets the layer name where this entity is drawn on function Entity:getDrawLayer() return DRAW_LAYER.TOP end function Entity:setDrawBoundingBox( x1, y1, x2, y2 ) self._drawbox = { x1 = x1 or -16, y1 = y1 or -16, x2 = x2 or 16, y2 = y2 or 16 } end -- returns the entity's drawing bounds in world coordinates function Entity:getDrawBoundingBox() local px, py = self:getPos() -- always assumed this is axis-aligned return px + self._drawbox.x1, py + self._drawbox.y1, px + self._drawbox.x2, py + self._drawbox.y2 end function Entity:setDrawDepth( d ) self._depth = d return self end function Entity:getDrawDepth() return self._depth end function Entity:getEntIndex() return self._entIndex end function Entity:remove() self._removeflag = true end function Entity:__eq( other ) return self:isInstanceOf(other) and self:getEntIndex() == other:getEntIndex() end function Entity:__tostring() return tostring(self.class).." - Entity["..tostring(self._entIndex).."]" end return Entity
------------------------------------------------------------------------------ -- hyper_city.lua: -- -- City layouts get their own fle now. There are two main variants: -- * Hyper City. Builds an initial space - could be an open level, could -- have some geometry, maybe a street lyout, could even be an existing layout. -- Random buildings are then placed wherever they'll fit in the space or are -- carved into walls or joined onto each other. -- * Grid City. Creates a zones grid (by one of two methods of subdivision) -- and then places buildings specifically within those zones. ------------------------------------------------------------------------------ crawl_require("dlua/v_main.lua") hyper.city = {} hyper.city.default_strategy = hyper.place.strategy_inner_or_carve function hyper.city.room_types(pass,options) return { { weight = 10, paint_callback = floor_vault, room_transform = hyper.rooms.add_walls,size_padding = 3,min_size = 3 }, -- Filler to be used with very tiny rooms and occasionally with bigger areas { weight = 1, paint_callback = wall_vault, room_transform = hyper.rooms.add_walls,size_padding = 1 }, { weight = 10, paint_callback = wall_vault, room_transform = hyper.rooms.add_walls,size_padding = 1 }, { weight = 1, paint_callback = wall_vault, room_transform = hyper.rooms.add_walls,size_padding = 1 }, { weight = 1, paint_callback = wall_vault, room_transform = hyper.rooms.add_walls,size_padding = 1 }, { weight = 1, paint_callback = wall_vault, room_transform = hyper.rooms.add_walls,size_padding = 1 }, } end function hyper.city.grid_rooms(room,options,gen) local grid = gen.grid_callback(room,options,gen) local paint = { { type = "floor", corner1 = { x = 0, y = 0 }, corner2 = { x = room.size.x-1, y = room.size.y-1 } } } local passes = {} for i,zone in ipairs(grid.zones) do table.insert(passes,{ pass = "Zone"..i, strategy = hyper.place.strategy_primary, max_rooms = 1, bounds = zone.bounds, generators = gen.room_generators }) end table.insert(paint,{ type = "build", passes = passes }) end -- Creates a house by subdividing the rooms and then connecting them up function hyper.city.house_vault(room,options,gen) local params = hyper.merge_options(hyper.layout.omnigrid_defaults(),{ jitter = false, minimum_size = 3, subdivide_level_multiplier = 0.90, guaranteed_divides = 3 }) local zonemap = hyper.layout.omnigrid_subdivide(0,0,room.size.x-1,room.size.y-1,params) -- Fill with wall to start with local paint = { { type = "wall", corner1 = { x = 0, y = 0 }, corner2 = { x = room.size.x-1, y = room.size.y-1 } } } -- Paint the zones with floor util.append(paint,hyper.layout.zonemap_paint(zonemap,{ feature = "floor", outer_padding = false, corridor_width = 1 })) -- TODO: Genericise the following process more. We should be able to supply custom decorators -- to draw the connection (and this would allow for e.g. spotty connector for zones that don't -- already overlap). -- In fact, this could entirely replace the existing way that carvable walls are decorated. -- Run two passes of "connect" - the first joins zones together with floor to create bigger room shapes local plots = util.append(hyper.layout.zonemap_connect(zonemap,{ min_zones = 4, connect_borders = function(borders) return function(wall,border) -- TODO: Can make a bit of internal architecture by patterning the connections return "floor" end end }), -- The second connects all the remaining zones together with doors until we only have 1 zone hyper.layout.zonemap_connect(zonemap,{ max_zones = 1, connect_borders = function(borders) -- How many doors to make? (Usually 1) local numconnects = 1 if crawl.coinflip() then numconnects = numconnects + crawl.random2(3) end local bcons = {} for n=1,numconnects,1 do local id = crawl.random2(#borders)+1 if bcons[id] == nil then bcons[id] = {} end local wallnum = crawl.random2(#borders.walls)+1 bcons[id][wallnum] = true end return function(wall,border) if bcons[border.id] ~= nil and bcons[border.id][wall.id] == true then return "closed_door" else return nil end end end })) table.insert(paint, { type = "plot", coords = plots }) room.zonemap = zonemap -- TODO: Probably isn't useful to us in this state return paint end function hyper.layout.zonemap_connect(zonemap,params) -- TODO: zone connection needs to be in a separate function local bail = false local function mergezones(a,b) -- Always take the lower id, it'll simplify table manipulation if b.id<a.id then a,b=b,a end local plots = {} -- Update foreign borders local connected = {} for i,bor in ipairs(b.borders) do if bor.b == a then -- Lose borders with the one we're merging to (but remember them for paint func) table.insert(connected,bor) util.remove(a.borders,bor.inverse) -- TODO: slow else -- Update other borders to point to us bor.a = a bor.inverse.b = a -- TODO: It's possible that the border needs to merge with an existing one if they are congruent lines table.insert(a.borders,bor) end end local fdeco = params.connect_borders(connected) -- TODO: Passing in the callback probably obfuscates things here. Should just return a list of connected -- internals with the result then handle them any way we wanted? Or are there other uses for having it here? for i,bor in ipairs(connected) do for w,wall in ipairs(bor.walls) do local feat = fdeco(wall,bor) table.insert(plots, { feature = feat, x = wall.x, y = wall.y }) end end util.append(a.connects,b.connects) util.append(a.borders,b.borders) a.size = a.size + b.size -- Remove the old zone table.remove(zonemap.zones,b.id) -- Adjust ids of zones to the right for n = b.id, #(zonemap.zones), 1 do zonemap.zones[n].id = n end -- Adjust count zonemap.count = zonemap.count - 1 return plots end -- Weight function for picking the next zone to join up -- TODO: Not really sure how these local function fweightpick(zone) return math.ceil(100 / zone.size) end -- Weight function for picking which zone to connect it to local function fweightconnect(border) return math.ceil(100 / zone.to.size) end local plots = {} while (zonemap.count > 1 and not bail) do -- Pick which zone to link up local picked = util.random_weighted_from(fweightpick,zonemap.zones) local connect = util.random_weighted_from(fweightconnect,picked.borders) util.append(plots,mergezones(picked,connect)) if zonemap.count == params.min_zones then bail = true elseif zonemap.count <= params.max_zones -- TODO: Not sure of a good way to handle this proability. Could always just keep going until min_zones is met and let -- the caller randomise this. Or could get increasingly likely the closer we are to min_zones. and crawl.random2(101) < 10 then end end return plots end
local S = mobs.intllib -- name tag minetest.register_craftitem("mobs:nametag", { description = S("Nametag"), inventory_image = "mobs_nametag.png", }) core.register_craft({ type = "shapeless", output = "mobs:nametag", recipe = {"default:paper", "dye:black", "farming:string"}, }) -- leather minetest.register_craftitem("mobs:leather", { description = S("Leather"), inventory_image = "mobs_leather.png", }) -- raw meat minetest.register_craftitem("mobs:meat_raw", { description = S("Raw Meat"), inventory_image = "mobs_meat_raw.png", on_use = minetest.item_eat(3), }) -- cooked meat minetest.register_craftitem("mobs:meat", { description = S("Meat"), inventory_image = "mobs_meat.png", on_use = minetest.item_eat(8), }) minetest.register_craft({ type = "cooking", output = "mobs:meat", recipe = "mobs:meat_raw", cooktime = 5, }) -- magic lasso minetest.register_tool("mobs:magic_lasso", { description = S("Magic Lasso (right-click animal to put in inventory)"), inventory_image = "mobs_magic_lasso.png", }) minetest.register_craft({ output = "mobs:magic_lasso", recipe = { {"farming:string", "default:gold_lump", "farming:string"}, {"default:gold_lump", "default:diamondblock", "default:gold_lump"}, {"farming:string", "default:gold_lump", "farming:string"}, } }) -- net minetest.register_tool("mobs:net", { description = S("Net (right-click animal to put in inventory)"), inventory_image = "mobs_net.png", }) minetest.register_craft({ output = "mobs:net", recipe = { {"default:stick", "", "default:stick"}, {"default:stick", "", "default:stick"}, {"farming:string", "default:stick", "farming:string"}, } }) -- shears (right click to shear animal) minetest.register_tool("mobs:shears", { description = S("Steel Shears (right-click to shear)"), inventory_image = "mobs_shears.png", }) minetest.register_craft({ output = 'mobs:shears', recipe = { {'', 'default:steel_ingot', ''}, {'', 'group:stick', 'default:steel_ingot'}, } }) -- protection rune minetest.register_craftitem("mobs:protector", { description = S("Mob Protection Rune"), inventory_image = "mobs_protector.png", }) minetest.register_craft({ output = "mobs:protector", recipe = { {"default:stone", "default:stone", "default:stone"}, {"default:stone", "default:goldblock", "default:stone"}, {"default:stone", "default:stone", "default:stone"}, } }) -- saddle minetest.register_craftitem("mobs:saddle", { description = "Saddle", inventory_image = "mobs_saddle.png" }) minetest.register_craft({ output = "mobs:saddle", recipe = { {"mobs:leather", "mobs:leather", "mobs:leather"}, {"mobs:leather", "default:steel_ingot", "mobs:leather"}, {"mobs:leather", "default:steel_ingot", "mobs:leather"}, } })
---@class CS.UnityEngine.Ray : CS.System.ValueType ---@field public origin CS.UnityEngine.Vector3 ---@field public direction CS.UnityEngine.Vector3 ---@type CS.UnityEngine.Ray CS.UnityEngine.Ray = { } ---@return CS.UnityEngine.Ray ---@param origin CS.UnityEngine.Vector3 ---@param direction CS.UnityEngine.Vector3 function CS.UnityEngine.Ray.New(origin, direction) end ---@return CS.UnityEngine.Vector3 ---@param distance number function CS.UnityEngine.Ray:GetPoint(distance) end ---@overload fun(): string ---@return string ---@param optional format string function CS.UnityEngine.Ray:ToString(format) end return CS.UnityEngine.Ray
---@class EncounterJournal C_EncounterJournal = {} ---@param uiMapID number ---@return DungeonEntranceMapInfo dungeonEntrances function C_EncounterJournal:GetDungeonEntrancesForMap(uiMapID) end ---@param uiMapID number ---@return EncounterJournalMapEncounterInfo encounters function C_EncounterJournal:GetEncountersOnMap(uiMapID) end --- Represents the icon indices for this EJ section. An icon index can be used to arrive at texture coordinates for specific encounter types, e.g.: EncounterJournal_SetFlagIcon ---@param sectionID number ---@return number|nil iconFlags function C_EncounterJournal:GetSectionIconFlags(sectionID) end ---@param sectionID number ---@return EncounterJournalSectionInfo info function C_EncounterJournal:GetSectionInfo(sectionID) end ---@class DungeonEntranceMapInfo ---@field areaPoiID number ---@field position table ---@field name string ---@field description string ---@field atlasName string ---@field journalInstanceID number local DungeonEntranceMapInfo = {} ---@class EncounterJournalMapEncounterInfo ---@field encounterID number ---@field mapX number ---@field mapY number local EncounterJournalMapEncounterInfo = {} ---@class EncounterJournalSectionInfo ---@field spellID number ---@field title string ---@field description string|nil ---@field headerType number ---@field abilityIcon number ---@field creatureDisplayID number ---@field uiModelSceneID number ---@field siblingSectionID number|nil ---@field firstChildSectionID number|nil ---@field filteredByDifficulty bool ---@field link string ---@field startsOpen bool local EncounterJournalSectionInfo = {}
-- ---------------------------------------------- -- Copyright(c) 2018, CounterFlow AI, Inc. All Rights Reserved. -- author: Collins Huff <ch@counterflowai.com> -- -- Use of this source code is governed by a BSD-style -- license that can be found in the LICENSE.txt file. -- ---------------------------------------------- -- Country Anomaly computes an anomaly score based on country code require 'analyzer/utils' local redis_key = "country" local analyzer_name = 'Country Anomaly' function setup() conn = hiredis.connect() if conn:command('PING') ~= hiredis.status.PONG then dragonfly.log_event(analyzer_name..': Could not connect to redis') dragonfly.log_event(analyzer_name..': exiting') os.exit() end starttime = 0 --mle.epoch() print('>>>>>>>> '..analyzer_name..' starting') dragonfly.log_event('>>>>>>>> '..analyzer_name..' starting') local start = os.clock() -- https://datahub.io/core/country-list#resource-data<Paste> local filepath = "analyzer/country-codes.txt" local file, err = io.open(filepath,'rb') if file then while true do line = file:read() if line == nil then break elseif line ~='' then local cmd = 'HMSET '..redis_key..' '..line..' '..0 reply = conn:command_line(cmd) if type(reply) == 'table' and reply.name ~= 'OK' then dragonfly.log_event('Country Anomaly: '..cmd..' : '..reply.name) end end end file:close() end local cmd = 'HMSET ' .. redis_key .. ' total ' .. 0 reply = conn:command_line(cmd) if type(reply) == 'table' and reply.name ~= 'OK' then dragonfly.log_event('Country Anomaly: '..cmd..' : '..reply.name) end local now = os.clock() local delta = now - start print ('>>>>>>>> Loaded Country Codes in '..delta..' seconds') dragonfly.log_event('>>>>>>>> Loaded Country Codes in '..delta..' seconds') end function loop(msg) local start = os.clock() local eve = msg local fields = {"analytics.ip_geo.location.country_code",} if not check_fields(eve, fields) then dragonfly.log_event(analyzer_name..': Required fields missing') dragonfly.analyze_event(default_analyzer, msg) return end local country_code = eve.analytics.ip_geo.location.country_code local cmd = 'HMGET '..redis_key..' total '..country_code local reply = conn:command_line(cmd) for _,v in ipairs(reply) do if type(v) == 'table' and v.name ~= 'OK' then dragonfly.log_event(analyzer_name..': '..cmd..': '..v.name) dragonfly.analyze_event(default_analyzer, msg) return end end local total = reply[1] local count = reply[2] if not tonumber(total) or not tonumber(count) then dragonfly.log_event(analyzer_name..': Could not convert total '.. total..' or count to number '..count) dragonfly.analyze_event(default_analyzer, msg) return end prob = tonumber(count) * 1.0 / (tonumber(total) + 1) inv_prob = 1 - prob new_total = tonumber(total) + 1 new_count = tonumber(count) + 1 local cmd = 'HMSET '..redis_key..' total '..new_total..' '..country_code..' '..new_count reply = conn:command_line(cmd) if type(reply) == 'table' and reply.name ~= 'OK' then dragonfly.log_event(analyzer_name..': '..cmd..' '..reply.name) end analytics = eve.analytics if not analytics then analytics = {} end country_info = {} country_info["country_code"] = country_code country_info["score"] = inv_prob country_info["count"] = count country_info["total"] = total country_info["threshold"] = 0.995983936 analytics["country"] = country_info eve['analytics'] = analytics dragonfly.analyze_event(default_analyzer, eve) local now = os.clock() local delta = now - start dragonfly.log_event(analyzer_name..': time: '..delta) end
local print, clock, format = print, os.clock, string.format local concat = table.concat local start, en for _ = 1, 10 do start = clock() local s = '' for i = 1, 100000 do s = s .. 'a' end en = clock() print(format('operator ..: %.03f', en - start)) start = clock() local s = {} for i = 1, 100000 do s[i] = 'a' end s = concat(s) en = clock() print(format('table.concat: %.03f', en - start)) print() end
print("testing callstack generation") local function testfn_with_a_very_long_name_3(value1, value2, value3) return testmodule.foo(value1, value2, value3) end local function testfn_with_a_very_long_name_2(value1, value2) testfn_with_a_very_long_name_3(value1, value2, value1 + value2) end local function testfn_with_a_very_long_name_(value) if value == 0 then testfn_with_a_very_long_name_2(value*2, value*3+1) else testfn_with_a_very_long_name_(value - 1) end end function do_crash() print("OUTPUT:", testfn_with_a_very_long_name_(200)) end
local tNewAbilities = { "flame_lord_flameshot", "flame_lord_fire_storm", "flame_lord_liquid_fire", "generic_hidden", "generic_hidden", "flame_lord_enflame", "special_bonus_gold_income_120", "special_bonus_exp_boost_30", "special_bonus_unique_flame_lord_1", "special_bonus_cast_range_150", "special_bonus_unique_flame_lord_2", "special_bonus_unique_flame_lord_3", "special_bonus_unique_flame_lord_4", "special_bonus_cooldown_reduction_30" } local tHeroBaseStats = { MovementSpeed = 300, AttackRate = 1.6, AttackAnimationPoint = 0.3, AttackDamageMin = 17, AttackDamageMax = 26, AttackRange = 575, AttributeBaseStrength = 16, AttributeBaseAgility = 18, AttributeBaseIntelligence = 22, AttributeStrengthGain = 1.8, AttributeAgilityGain = 1.5, AttributeIntelligenceGain = 3, ArmorPhysical = 0, PrimaryAttribute = DOTA_ATTRIBUTE_INTELLECT, } CustomNetTables:SetTableValue("fun_hero_stats", "flame_lord_abilities", tNewAbilities) CustomNetTables:SetTableValue("fun_hero_stats", "flame_lord", tHeroBaseStats) GameMode:FunHeroScepterUpgradeInfo("flame_lord", tNewAbilities) function FlameLordTalentManager(keys) if PlayerResource:GetPlayer(keys.PlayerID):GetAssignedHero():GetName() ~= "npc_dota_hero_warlock" then return end local hHero = PlayerResource:GetPlayer(keys.PlayerID):GetAssignedHero() if keys.abilityname == "special_bonus_unique_flame_lord_4" then local iLevel = hHero:FindAbilityByName("flame_lord_enflame"):GetLevel() local fCD = hHero:FindAbilityByName("flame_lord_enflame"):GetCooldownTimeRemaining() hHero:RemoveAbility("flame_lord_enflame") local hAbility = hHero:AddAbility("flame_lord_enflame_talented") hAbility:SetLevel(iLevel) hAbility:StartCooldown(fCD) end if keys.abilityname == "special_bonus_unique_flame_lord_2" then local iLevel = hHero:FindAbilityByName("flame_lord_fire_storm"):GetLevel() local fCD = hHero:FindAbilityByName("flame_lord_fire_storm"):GetCooldownTimeRemaining() hHero:RemoveAbility("flame_lord_fire_storm") local hAbility = hHero:AddAbility("flame_lord_fire_storm_talented") hAbility:SetLevel(iLevel) hAbility:StartCooldown(fCD) end end function FlameLordInit(hHero, context) hHero:AddNewModifier(hHero, nil, "modifier_attribute_indicator_flame_lord", {}) GameMode:InitiateHeroStats(hHero, tNewAbilities, tHeroBaseStats) if not GameMode.bFlameLordTalentManagerSet then ListenToGameEvent( "dota_player_learned_ability", FlameLordTalentManager, nil ) GameMode.bFlameLordTalentManagerSet = true end end
local function _toMarkup(val, spacing, colors, parsed) if type(val) == "string" then return {{v = string.format("%q", val), i = spacing, c = colors.string or colors["default"]}} elseif type(val) == "boolean" then return {{v = val and "true" or "false", i = spacing, c = colors.boolean or colors["default"]}} elseif type(val) == "number" then return {{v = tostring(val), i = spacing, c = colors.number or colors["default"]}} elseif type(val) == "function" then local info = debug.getinfo(val, "S") if not info or info.what == "C" then return {{v = "function:([C])", i = spacing, c = colors.c_function or colors["function"] or colors["default"]}} else return {{v = ("function:(%s : %s-%s)"):format(info.short_src, info.linedefined, info.lastlinedefined), i = spacing, c = colors["function"] or colors["default"]}} --"..table.concat(debug.getparams(val), ",").." end elseif type(val) == "table" then if parsed[val] then return {{v = "<"..tostring(val)..">", i = spacing, c = colors.table or colors["default"]}} else parsed[val] = true local s = {{v = "{", n = true, i = spacing, c = colors.table or colors["default"]}} for key,val2 in pairs(val) do table.insert(s, {v = "[", i = spacing+1, c = colors.table or colors["default"]}) local k_s = _toMarkup(key, spacing+1, colors, parsed) k_s.i = spacing+1 for k_i = 1, #k_s do table.insert(s, k_s[k_i]) end table.insert(s, {v = "]", i = spacing+1, c = colors.table or colors["default"]}) table.insert(s, {v = " = ", i = spacing, c = colors.table or colors["default"]}) local v_s = _toMarkup(val2, spacing+1, colors, parsed) v_s.i = spacing+1 for v_i = 1, #v_s do table.insert(s, v_s[v_i]) end table.insert(s, {v = ",", n = true, c = colors.table or colors["default"]}) end table.insert(s, {v = "}", i = spacing, c = colors.table or colors["default"]}) return s end elseif type(val) == "nil" then return {{v = "nil", c = colors["nil"] or colors["default"]}} elseif type(val) == "Panel" then return {{v = "<"..type(val)..">: "..(val:IsValid () and (val.ClassName or "") or "INVALID"), c = colors["default"]}} end return {{v = "<"..type(val)..">: "..tostring(val)..">", c = colors["default"]}} end function toMarkup(val, colors) return _toMarkup(val, 0, colors, {}) end function MarkupToHTML(markup, colors_override) local colors = colors_override or table.markup_colors local s, cc, ic, first = "", colors.default, 0, true local jn = true for oi = 1, #markup do local object = markup[oi] local c = object.c local changes = "" if c and c.r ~= cc.r or c.g ~= cc.g or c.b ~= cc.b then changes = changes.."color:#"..string.format("%X", (c.r*256+c.g)*256+c.b)..";" cc = c end --[[if object.i and object.i ~= ic then changes = changes.."text-ident: "..(5+10*object.i).."pt;" ic = object.i end]] if changes ~= "" then s = s..(first and "" or "</span>")..'<span style="'..changes..'">' first = false end s = s ..(jn and ("&nbsp;"):rep((object.i or 0)*4) or "") ..string.gsub(object.v or "", ".", function(c) local b = string.byte(c) return (b < 32 or b > 155 or b == 60 or b == 62 or b == 38) and "&#"..b..";" end) ..(object.n and "<br/>\n" or "") jn = object.n end if not first then s = s.."</span>" end return s end table.markup_colors = { table = Color(255, 150, 255), string = color_white, number = Color(255, 128, 0), boolean = Color(150, 255, 150), ["function"] = Color(100, 150, 255), c_function = Color(100, 255, 255), -- what colour is this? :S default = Color(255, 100, 100), } function table.tomarkup(t, colors_override) return toMarkup(t, colors_override or table.markup_colors) end function table.print(tbl, colors_override) local markup = table.tomarkup(tbl, colors_override) local jn = true for oi = 1, #markup do local object = markup[oi] MsgC(object.c, ("\t"):rep(jn and object.i or 0)..(object.v or "")..(object.n and "\n" or "")) jn = object.n end MsgC(table.markup_colors.default,"\n") end PrintTable = function(...) -- so we don't pass extra tables.. for k,tbl in pairs{...} do table.print(tbl) end end function table.tohtml(tbl, colors_override) return MarkupToHTML(table.tomarkup(tbl, colors_override)) end
--- --- Generated by EmmyLua(https://github.com/EmmyLua) --- Created by Bing Lau. --- DateTime: 2021/5/23 15:09 --- --local _PlayerPref = CS.UnityEngine.PlayerPrefs --local enable = _PlayerPref.GetInt("enable_emmylua", 0) -- --print("Enable EmmyLua debugger: %s", enable == 1 and "on" or "off") --if enable ~= 1 then -- return --end -- 只判断是不是开启了EmmyLua调试,至于是 IDE connect Debugger 还是 Debugger connect IDE 自己去调整 package.cpath = package.cpath .. ';C:/Users/wangman/AppData/Roaming/JetBrains/Rider2020.1/plugins/intellij-emmylua/classes/debugger/emmy/windows/x64/?.dll' local dbg = require('emmy_core') dbg.tcpListen('localhost', 9966)
local NeP = NeP NeP.Interface.usedGUIs = {} local LibStub = NeP._G.LibStub local unpack = NeP._G.unpack local DiesalGUI = LibStub("DiesalGUI-1.0") local element_space = 2 function NeP.Interface.Noop() end local Elements = { header = 'Header', text = 'Text', rule = 'Rule', ruler = 'Rule', texture = 'Texture', checkbox = 'Checkbox', spinner = 'Spinner', checkspin = 'Checkspin', combo = 'Combo', dropdown = 'Combo', button = 'Button', input = 'Input', spacer = 'Spacer' } local default_profiles = {{key='default',text='Default'}} local new_prof_Name = "New Profile Name" local function new_prof(table, parent) local pFrame = NeP.Interface.pFrame local profileName = pFrame.Input:GetText() if profileName == '' or profileName == new_prof_Name or profileName == "settings" then return pFrame.Button:SetText('Profile cant have that name!') end for _,p in ipairs(table.av_profiles) do if p.key == profileName then return pFrame.Button:SetText('Profile with that name exists!') end end NeP._G.table.insert(table.av_profiles, {key = profileName, text = profileName}) NeP.Config:Write(table.key, 'av_profiles', table.av_profiles, 'settings') NeP.Config:Write(table.key, 'selected_profile', profileName, 'settings') pFrame:Hide() parent:Hide() parent:Release() NeP.Interface.usedGUIs[table.key] = nil NeP.Interface:BuildGUI(table) pFrame:Hide() pFrame.Input:SetText(new_prof_Name) end local function del_prof(table, parent) for i,p in ipairs(table.av_profiles) do if p.key == table.selected_profile then if table.selected_profile ~= 'default' then table.av_profiles[i] = nil end NeP.Config:Write(table.key, 'av_profiles', table.av_profiles, 'settings') NeP.Config:Write(table.key, 'selected_profile', 'default', 'settings') parent:Hide() parent:Release() NeP.Interface.usedGUIs[table.key] = nil NeP.Config:Reset(table.key, nil, table.selected_profile) NeP.Interface:BuildGUI(table) break end end end function NeP.Interface:BuildGUI_New(table, parent) local tmp = DiesalGUI:Create('Button') parent:AddChild(tmp) tmp:SetParent(parent.footer) tmp:SetPoint('TOPLEFT',21,0) tmp:SetSettings({width = 21, height = 21}, true) tmp:SetText('N') tmp:SetStylesheet(self.buttonStyleSheet) tmp:SetEventListener('OnClick', function() local pFrame = NeP.Interface.pFrame pFrame:Show() pFrame.Button:SetEventListener('OnClick', function() new_prof(table, parent) end) end) end function NeP.Interface:BuildGUI_Del(table, parent) local tmp = DiesalGUI:Create('Button') parent:AddChild(tmp) tmp:SetParent(parent.footer) tmp:SetPoint('TOPLEFT') tmp:SetSettings({width = 21, height = 21}, true) tmp:SetText('D') tmp:SetStylesheet(self.buttonStyleSheet) tmp:SetEventListener('OnClick', function() del_prof(table, parent) end) end function NeP.Interface:BuildGUI_Combo(table, parent) local tmp = DiesalGUI:Create('Dropdown') parent:AddChild(tmp) tmp:SetParent(parent.footer) tmp:SetPoint("TOPRIGHT", parent.footer, "TOPRIGHT", 0, 0) tmp:SetPoint("BOTTOMLEFT", parent.footer, "BOTTOMLEFT", 42, 0) --tmp:SetStylesheet(self.comboBoxStyleSheet) local orderdKeys = {} local list = {} -- Only when loaded NeP.Core:WhenInGame(function() for i, value in pairs(table.av_profiles) do orderdKeys[i] = value.key list[value.key] = value.text end tmp:SetList(list, orderdKeys) tmp:SetValue(table.selected_profile) end) tmp:SetEventListener('OnValueChanged', function(_,_, value) if table.selected_profile == value then return end NeP.Config:Write(table.key, 'selected_profile', value, 'settings') parent:Hide() parent:Release() self.usedGUIs[table.key] = nil self:BuildGUI(table) end) end function NeP.Interface:AddText(element, parent, table, element_type, tmp) if element.text and element_type ~= "Text" and element_type ~= "Header" and element_type ~= "Button" then tmp.text2 = self:Text(element, parent, table) if element_type == 'Spinner' then tmp:SetHeight(element.height or tmp.text2:GetStringHeight()) end if element_type == 'Checkspin' then tmp.spin:SetHeight(element.height or tmp.text2:GetStringHeight()) end end end function NeP.Interface:AddDesc(element, parent, table, tmp) if element.desc then element.text = element.desc tmp.desc = self:Text(element, parent, table) table.offset = table.offset - tmp.desc:GetStringHeight() end end function NeP.Interface:BuildElements(table, parent) table.offset = -5 for i=1, #table.config do local element = table.config[i] local element_type = Elements[element.type:lower()] --build element element.key = element.key or "fake" local tmp = self[element_type](self, element, parent, table) self:AddText(element, parent, table, element_type, tmp) self:AddDesc(element, parent, table, tmp) table.offset = table.offset - element_space self.usedGUIs[table.key].elements[element.key] = tmp end end function NeP.Interface:GetElement(key, element) return self.usedGUIs[key].elements[element].parent end -- This opens a existing GUI instead of creating another function NeP.Interface:TestCreated(table) local test = type(table) == 'string' and table or table.key if self.usedGUIs[test] then self.usedGUIs[test].parent:Show() return self.usedGUIs[test] end end local function UI_WhenInGame(table, parent) --Colors if not table.color then table.color = NeP.Color end if type(table.color) == 'function' then table.color = table.color() end -- load Location local left, top = unpack(NeP.Config:Read(table.key, 'Location', {500, 500}, 'settings')) parent.settings.left = left parent.settings.top = top parent:UpdatePosition() --tittle parent:SetTitle("|cff"..table.color..(table.title or table.key).."|r", table.subtitle) --profiles table.selected_profile = NeP.Config:Read(table.key, 'selected_profile', 'default', 'settings') table.av_profiles = NeP.Config:Read(table.key, 'av_profiles', default_profiles, 'settings') parent:ApplySettings() end function NeP.Interface.BuildGUI(_, table) local self = NeP.Interface --Tests local gui_test = self:TestCreated(table) if gui_test then return gui_test end if not table.key then return end -- Create a new parent local parent = DiesalGUI:Create('Window') self.usedGUIs[table.key] = {} self.usedGUIs[table.key].parent = parent self.usedGUIs[table.key].elements = {} parent:SetWidth(table.width or 200) parent:SetHeight(table.height or 300) parent.frame:SetClampedToScreen(true) --parent:SetStylesheet(self.WindowStyleSheet) --Save Location after dragging parent:SetEventListener('OnDragStop', function(_,_, l, t) NeP.Config:Write(table.key, 'Location', {l, t}, 'settings') end) -- Only build the body after we'r done loading configs NeP.Core:WhenInGame(function() UI_WhenInGame(table, parent) end, 9) -- Build Profiles if table.profiles then parent.settings.footer = true self:BuildGUI_Combo(table, parent) self:BuildGUI_Del(table, parent) self:BuildGUI_New(table, parent) end --Header if table.header then parent.settings.header = true end -- Build elements local window = DiesalGUI:Create('ScrollFrame') parent:AddChild(window) window:SetParent(parent.content) window:SetAllPoints(parent.content) if table.config then self:BuildElements(table, window) end self.usedGUIs[table.key].window = window parent:ApplySettings() return self.usedGUIs[table.key] end function NeP.Interface.Fetch(_, a, b, default) local cprofile = NeP.Config:Read(a, 'selected_profile', 'default', 'settings') return NeP.Config:Read(a, b, default, cprofile) end function NeP.Interface.Write(_, a, b, key) local cprofile = NeP.Config:Read(a, 'selected_profile', 'default', 'settings') NeP.Config:Write(a, b, key, cprofile) end
---@module ModuleA module("ModuleA") module_scoped_var = "a"
ITEM.name = "Rusty Crossbow" ITEM.model = "models/weapons/w_crossbow.mdl" ITEM.description = "A rusty crossbow, it doesn't seem to operate but maybe after some restornation..." ITEM.chance = 5 ITEM.category = "Crafting"
meta.name = "Vanilla rendering" meta.version = "WIP" meta.description = "Demonstrates drawing of in-game text and textures" meta.author = "Zappatic" white = Color:white() red = Color:red() green = Color:green() blue = Color:blue() black = Color:black() font_scale = 0.0006 background_rect_top_left_x = 0.0 background_rect_top_left_y = 0.0 background_rect_bottom_right_x = 0.0 background_rect_bottom_right_y = 0.0 set_callback(function(render_ctx) local y = 0.9 local scale = font_scale for i = 1, 7 do render_ctx:draw_text("Text scale "..tostring(scale), 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) y = y - 0.1 scale = scale + 0.0001 end y = y + 0.05 local x = -0.28 for i = 1, 7 do render_ctx:draw_screen_texture(TEXTURE.DATA_TEXTURES_HUD_0, 4, i-1, x, y, x + 0.08, y - (0.08 * (16.0/9.0)), white) x = x + 0.08 end y = y - 0.20 scale = 0.0008 render_ctx:draw_text("Left aligned", 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.LEFT, VANILLA_FONT_STYLE.ITALIC) y = y - 0.07 render_ctx:draw_text("Center aligned", 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) y = y - 0.07 render_ctx:draw_text("Right aligned", 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.RIGHT, VANILLA_FONT_STYLE.ITALIC) y = y - 0.07 red_width, _ = render_ctx:draw_text_size("Red ", scale, scale, VANILLA_FONT_STYLE.ITALIC) green_width, _ = render_ctx:draw_text_size("Green ", scale, scale, VANILLA_FONT_STYLE.ITALIC) blue_width, _ = render_ctx:draw_text_size("Blue ", scale, scale, VANILLA_FONT_STYLE.ITALIC) space_width = 0.01 total_width = red_width + green_width + blue_width + (space_width * 2.0) render_ctx:draw_text("Red", (total_width / 2.0) * -1.0, y, scale, scale, red, VANILLA_TEXT_ALIGNMENT.LEFT, VANILLA_FONT_STYLE.ITALIC) render_ctx:draw_text("Green", ((total_width / 2.0) * -1.0) + red_width + space_width, y, scale, scale, green, VANILLA_TEXT_ALIGNMENT.LEFT, VANILLA_FONT_STYLE.ITALIC) render_ctx:draw_text("Blue", ((total_width / 2.0) * -1.0) + red_width + space_width + green_width + space_width, y, scale, scale, blue, VANILLA_TEXT_ALIGNMENT.LEFT, VANILLA_FONT_STYLE.ITALIC) y = y - 0.07 render_ctx:draw_text("Bold text", 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.BOLD) y = y - 0.07 local text = "Bordered, shadowed text" render_ctx:draw_text(text, 0.0025, y - 0.0025, scale, scale, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) render_ctx:draw_text(text, 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) width, height = render_ctx:draw_text_size(text, scale, scale, VANILLA_FONT_STYLE.ITALIC) -- because this text is rendered centered, we have to calc the top left relative to the centerpoint we provided to render_ctx:draw_text background_rect_top_left_x = 0.0 - (width / 2.0) background_rect_top_left_y = y - (height / 2.0) background_rect_bottom_right_x = background_rect_top_left_x + width background_rect_bottom_right_y = background_rect_top_left_y + height -- these background rect coords are then used below in the GUIFRAME callback to draw the border on the screen y = y - 0.12 -- jump = \u{83} -- attack = \u{84} -- bomb = \u{85} -- rope = \u{86} -- pause = \u{89} -- journal = \u{8A} -- use door/buy = \u{88} -- walk/run = \u{87} -- left = \u{8B} -- right = \u{8C} -- up = \u{8D} -- down = \u{8E} -- enter/confirm = \u{8F} -- if you combine multiple keys in one string, it might mess up, e.g. "\u{83} and \u{89}" local special_characters = "Press \u{83} to jump" scale = 0.0013 render_ctx:draw_text(special_characters, 0.0, y, scale, scale, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) end, ON.RENDER_POST_HUD) set_callback(function(render_ctx) render_ctx:draw_text("Rendered below the HUD", 0.95, 0.86, 0.0006, 0.0006, red, VANILLA_TEXT_ALIGNMENT.RIGHT, VANILLA_FONT_STYLE.ITALIC) end, ON.RENDER_PRE_HUD) set_callback(function(draw_ctx) draw_ctx:draw_rect(background_rect_top_left_x, background_rect_top_left_y, background_rect_bottom_right_x, background_rect_bottom_right_y, 2, 2, rgba(255, 0, 255, 200)) end, ON.GUIFRAME) -- draw a crown on the player's head set_callback(function(render_ctx, draw_depth) if #players < 1 then return end -- the event is PRE draw depth, so if we want to draw it in front of the player, we have to -- draw it 'pre' the next draw_depth, which is one closer towards draw_depth 1 (so subtract 1 instead of add 1) if draw_depth == players[1].type.draw_depth - 1 then x, y, l = get_render_position(players[1].uid) -- reposition the crown on top of the head, starting from the center point of the player: bit to the left, bit upwards x = x - 0.5 y = y + 1.15 rect = AABB:new(x, y, x + 1.0, y - 1.0) render_ctx:draw_world_texture(TEXTURE.DATA_TEXTURES_ITEMS_0, 1, 14, rect, white) end end, ON.RENDER_PRE_DRAW_DEPTH) -- move Ana on the title screen set_pre_render_screen(SCREEN.TITLE, function(screen, render_ctx) s = screen:as_screen_title() s.ana:set_destination(AABB:new(-0.1, 0, 0.15, -0.4)) s.particle_torchflame_flames.x = 0.05 s.particle_torchflame_flames.y = 0.0 s.particle_torchflame_backflames.x = 0.05 s.particle_torchflame_backflames.y = 0.0 s.particle_torchflame_smoke.x = 0.0 s.particle_torchflame_smoke.y = 0.0 s.particle_torchflame_backflames_animated.x = 0.05 s.particle_torchflame_backflames_animated.y = 0.0 s.particle_torchflame_flames_animated.x = 0.05 s.particle_torchflame_flames_animated.y = 0.0 s.particle_torchflame_ash.x = 0.05 s.particle_torchflame_ash.y = 0.0 end) -- drawing text on top of the screen should be done in the post_render_screen callback: set_post_render_screen(SCREEN.TITLE, function(screen, render_ctx) render_ctx:draw_text("Ana", 0.0, 0.0, 0.0006, 0.0006, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) end) -- put the journal in the bottom right corner set_pre_render_screen(SCREEN.LEVEL, function(screen, render_ctx) -- the journal (and pause screen) UI is available through the game manager, it's not a property of a particular screen if game_manager.journal_ui.state > 0 then -- checks if the journal is visible game_manager.journal_ui.entire_book:set_destination(AABB:new(0, 0, 0.95, -0.95)) end end) set_callback(function(render_ctx, page_type, page) if page_type == JOURNAL_PAGE_TYPE.JOURNAL_MENU then render_ctx:draw_text("Text on the journal menu", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.PROGRESS then render_ctx:draw_text("Text on the progress page", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.PLACES then -- If you draw when the page_type equals PLACES, then it will be drawn on every place page -- If you want to draw on a specific page, compare the page_number of the current page to the page you want to render, in this case page 3 -- The page number is a zero-based index, and you have to count the journal progress and journal menu page as well, so Jungle is page 3 -- In this case, we don't have to cast the page with as_journal_page_places() because page_number is available in the base class JournalPage if page.page_number == 3 then render_ctx:draw_text("Text on the Jungle place page", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) end elseif page_type == JOURNAL_PAGE_TYPE.PEOPLE then render_ctx:draw_text("Text on all people pages", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.BESTIARY then render_ctx:draw_text("Text on all bestiary pages", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) -- hide all main images in bestiary (as if they were undiscovered) local p = page:as_journal_page_bestiary(); p.show_main_image = false elseif page_type == JOURNAL_PAGE_TYPE.ITEMS then render_ctx:draw_text("Text on all items pages", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.TRAPS then render_ctx:draw_text("Text on all traps pages", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.STORY then render_ctx:draw_text("Text on all story pages", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.FEATS then render_ctx:draw_text("Text on all feats pages", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.DEATH_CAUSE then render_ctx:draw_text("Text on the deathcause page", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.DEATH_MENU then render_ctx:draw_text("Text on the death menu", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.RECAP then render_ctx:draw_text("Text on the recap page", 0.0, 0.0, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.PLAYER_PROFILE then render_ctx:draw_text("Text on the player profile page", 0.0, 0.0, 0.0018, 0.0018, white, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) elseif page_type == JOURNAL_PAGE_TYPE.LAST_GAME_PLAYED then render_ctx:draw_text("Text on the last game played page", 0.0, 0.2, 0.0018, 0.0018, black, VANILLA_TEXT_ALIGNMENT.CENTER, VANILLA_FONT_STYLE.ITALIC) end end, ON.RENDER_POST_JOURNAL_PAGE)
-- some.field come from c++ some.field.y = 103 function begin(uworld,uactor) world=uworld actor=uactor assert(UEnums.LogLevel.LL_Warning) print("Unreal enum",UEnums.LogLevel.LL_Warning) assert(TestEnum.TE_COUNT==2) assert(TestEnum2.COUNT==2) -- set from c++ print(some,some.field) assert(somefield==102) assert(some.field.x==101) assert(some.field.y==103) assert(some.field.z==104) slua.threadGC("on") testcase() end function testcase() -- require 'TestPerf' require 'TestUI' require 'TestCase' require 'TestStruct' require 'TestCppBinding' TestBp=require 'TestBlueprint' TestBp:test(world,actor) TestMap = require 'TestMap' TestArray = require 'TestArray' TestActor = require 'TestActor' -- slua can detect dead loop code -- if lua exec timeout ,slua will report an error and jump out function -- you can comment out below code to test it -- while true do -- print("dead loop") -- end end local tt=0 function update(dt) tt=tt+dt TestActor.update(tt,actor) TestArray.update(tt) TestMap.update(tt) TestBp:update(tt) end
-- this script is presented by https://forum.cfx.re/u/saltygrandpa/summary all core functions were created by aswell; for the free use of the CFX community. -- edits and polish made by Entarukun for vehicle effects and limited function trigger parameters. -- duely dubbed SaltySyn_Carcrash -- No need to modify any of this, but I tried to document what it's doing local isBlackedOut = false local isLimp = false local isConcussed = false local drivertriggerblackout = false local drivertriggercuncussed = false --[[ local careffects = false ]] local oldBodyDamage = 0 local oldSpeed = 0 local tireBurstMaxNumber = Config.randomTireBurstInterval * 1200; -- the tire burst lottery runs roughly 1200 times per minute if Config.randomTireBurstInterval ~= 0 then tireBurstLuckyNumber = math.random(tireBurstMaxNumber) end local function blackout() -- Only blackout once to prevent an extended blackout if both speed and damage thresholds were met if not isBlackedOut then isBlackedOut = true drivertriggerblackout = true -- This thread will black out the user's screen for the specified time Citizen.CreateThread(function() DoScreenFadeOut(250) while not IsScreenFadedOut() do Citizen.Wait(0) end Citizen.Wait(Config.BlackoutTime) DoScreenFadeIn(250) isBlackedOut = false drivertriggerblackout = false end) else --[[ print("alreadyblacketout") ]] end end local function concussed() -- Only blackout once to prevent an extended blackout if both speed and damage thresholds were met if not isconcussed then isconcussed = true drivertriggercuncussed = true -- This thread will black out the user's screen for the specified time Citizen.CreateThread(function() PlaySoundFrontend(-1, "SCREEN_FLASH", "CELEBRATION_SOUNDSET", 1) -- check natives for alternate sound bites, additionally other effects can be triggered here --[[ SetCamEffect(2) ]] --[[ SetPedMovementClipset(PlayerPedId(),"move_injured_generic",1.0) ]] Citizen.Wait(1) --[[ SetCamEffect(0) ]] isconcussed = false drivertriggercuncussed = false end) end end local function CarEffects() -- Only blackout once to prevent an extended blackout if both speed and damage thresholds were met if isBlackedOut and Config.EnableVehicleCrashEffects then if not careffects then careffects = true -- Borrowed controls from https://github.com/Sighmir/FiveM-Scripts/blob/master/vrp/vrp_hotkeys/client.lua --[[ DisableControlAction(0,71,true) -- veh forward DisableControlAction(0,72,true) -- veh backwards DisableControlAction(0,63,true) -- veh turn left DisableControlAction(0,64,true) -- veh turn right DisableControlAction(0,75,true) -- disable exit vehicle ]] Citizen.CreateThread(function() local vehicle = GetVehiclePedIsIn(PlayerPedId(-1), false) local tyre = math.random(0, 20) -- created ranom chance for tires to pop, it is not 1-20, tires pop on individual triggers ,0,1,2,3,4,5,6 etc depending on model vehicle. local tankdamage = (math.random(100, 200) + (oldSpeed * 1.5))-- applies damage to gas tank on crash, leaking tank will eventually run out of fuel. local enginedamage = (math.random(150, 300) + (oldSpeed * 2)) local vehiclebodydamage = math.random(150, 300) --[[ local tempincrease = math.random(10, 50) local oillevel = math.random(20,40) ]] --[[ local oilmax = GetVehicleOilLevel(vehicle) unbracket to print oil level local temp = GetVehicleEngineTemperature(vehicle) unbracket to engine temp ]] --[[ SetVehiclePetrolTankHealth(vehicle, -300) ]] -- -400 is max SetVehiclePetrolTankHealth(vehicle,GetVehiclePetrolTankHealth(vehicle) - tankdamage ) SetVehicleTyreBurst(vehicle,tyre, 0 , 80.0) SetVehicleEngineHealth(vehicle ,GetVehicleEngineHealth(vehicle) - enginedamage) SetVehicleBodyHealth(vehicle, GetVehicleBodyHealth(vehicle) - vehiclebodydamage) SetVehicleOilLevel(vehicle, GetVehicleOilLevel(vehicle) + 5.0 ) -- max is 15? SetVehicleEngineTemperature(vehicle, GetVehicleEngineTemperature(vehicle) + 25.0 ) -- between 1-100 SetVehicleDirtLevel(vehicle, GetVehicleDirtLevel(vehicle) + 5.0 ) -- no value greater than 15.0 --[[ print(temp) print(oilmax) print("veheffect") ]] Citizen.Wait(3000) careffects = false end) end end end local function tireBurstLottery() local tireBurstNumber = math.random(tireBurstMaxNumber) if tireBurstNumber == tireBurstLuckyNumber then -- We won the lottery, lets burst a tire. if GetVehicleTyresCanBurst(vehicle) == false then return end local numWheels = GetVehicleNumberOfWheels(vehicle) local affectedTire if numWheels == 2 then affectedTire = (math.random(2)-1)*4 -- wheel 0 or 4 elseif numWheels == 4 then affectedTire = (math.random(4)-1) if affectedTire > 1 then affectedTire = affectedTire + 2 end -- 0, 1, 4, 5 elseif numWheels == 6 then affectedTire = (math.random(6)-1) else affectedTire = 0 end SetVehicleTyreBurst(vehicle, affectedTire, false, 1000.0) tireBurstLuckyNumber = math.random(tireBurstMaxNumber) -- Select a new number to hit, just in case some numbers occur more often than others --[[ print("tireloteryworking") ]] end end local function isPedDrivingAVehicle() local ped = GetPlayerPed(-1) vehicle = GetVehiclePedIsIn(ped, false) if IsPedInAnyVehicle(ped, false) then -- Check if ped is in driver seat if GetPedInVehicleSeat(vehicle, -1) == ped then local class = GetVehicleClass(vehicle) -- We don't want planes, helicopters, bicycles and trains if class ~= 15 and class ~= 16 and class ~=21 and class ~=13 then return true end end end return false end local function isPedPassengerInAVehicle() local ped = GetPlayerPed(-1) vehicle = GetVehiclePedIsIn(ped, false) if IsPedInAnyVehicle(ped, false) then -- Check if ped is in driver seat if not (GetPedInVehicleSeat(vehicle, -1) == ped) then --print("pedispassenger") return true end end return false end Citizen.CreateThread(function() while true do Citizen.Wait(0) -- Get the vehicle the player is in, and continue if it exists local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if DoesEntityExist(vehicle) then Citizen.Wait(300) -- changed for performance -- Check if damage blackout is enabled if Config.BlackoutFromDamage then local currentDamage = GetVehicleBodyHealth(vehicle) -- If the damage changed, see if it went over the threshold and blackout if necesary if currentDamage ~= oldBodyDamage then if not isBlackedOut and (currentDamage < oldBodyDamage) and ((oldBodyDamage - currentDamage) >= Config.BlackoutDamageRequired) then if HasEntityBeenDamagedByWeapon(vehicle, 0, 2) then -- prevents blackout from damage triggering on bullet damage or while on fire. --[[ print("bulletdamage") ]] elseif IsEntityOnFire(vehicle) then --[[ print("caronfire") ]] else if isPedDrivingAVehicle() then blackout() concussed() CarEffects() --print("isdriver") if Config.DamagePedOnCrash then local ped = GetPlayerPed(-1) ApplyDamageToPed(ped, Config.PedCrashDamage, true) --[[ print("pedamagesbydamage") ]] end else if isPedPassengerInAVehicle() then --print("notdriverbutintcar") if drivertriggercuncussed and drivertriggerblackout then if not isBlackedOut then blackout() concussed() end end end end end end oldBodyDamage = currentDamage end end -- Check if speed blackout is enabled if Config.BlackoutFromSpeed then local currentSpeed = GetEntitySpeed(vehicle) * 2.23 -- If the speed changed, see if it went over the threshold and blackout if necesary if currentSpeed ~= oldSpeed then if not isBlackedOut and (currentSpeed < oldSpeed) and ((oldSpeed - currentSpeed) >= Config.BlackoutSpeedRequired) then if isPedDrivingAVehicle() then blackout() concussed() CarEffects() if Config.DamagePedOnCrash then local ped = GetPlayerPed(-1) ApplyDamageToPed(ped, Config.PedCrashDamage, true) --[[ print("pedamagesbyispeed") ]] end else if isPedPassengerInAVehicle() then --print("notdriverbutintcar") if --[[ drivertriggercuncussed and ]]drivertriggerblackout then if not isBlackedOut then blackout() concussed() end end end end end oldSpeed = currentSpeed end end else oldBodyDamage = 0 oldSpeed = 0 end end end) Citizen.CreateThread(function() while true do Citizen.Wait(0) -- stop car from exploding 50 percent of the time is onfire local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if DoesEntityExist(vehicle) then -- Check if damage blackout is enabled local cancelfire = math.random(0, 20) if IsEntityOnFire(vehicle) then --[[ Citizen.Wait(1500) ]] if cancelfire < 11 then SetDisableVehiclePetrolTankFires(vehicle, false ) --[[ SetDisableVehicleEngineFires(vehicle, false ) ]] --[[ print("canfire") ]] else Wait(3000) SetDisableVehiclePetrolTankFires(vehicle, true ) StopEntityFire(vehicle) --[[ print("cantfire") ]] end Citizen.Wait(15000) else end else end end end) Citizen.CreateThread(function() while true do Citizen.Wait(500) -- changed for performance -- stop car from exploding 50 percent of the time is onfire local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if isPedDrivingAVehicle() then if Config.randomTireBurstInterval ~= 0 and GetEntitySpeed(vehicle) > 10 then tireBurstLottery() end -- added from realistic failure end end end)
object_tangible_loot_creature_loot_collections_publish_gift_datapad_component_08 = object_tangible_loot_creature_loot_collections_shared_publish_gift_datapad_component_08:new { } ObjectTemplates:addTemplate(object_tangible_loot_creature_loot_collections_publish_gift_datapad_component_08, "object/tangible/loot/creature/loot/collections/publish_gift_datapad_component_08.iff")
require "ratchet" function ctx1(host, port) local rec = ratchet.socket.prepare_tcp(host, port) local socket = ratchet.socket.new(rec.family, rec.socktype, rec.protocol) socket:setsockopt("SO_REUSEADDR", true) socket:bind(rec.addr) socket:listen() local paused = { ratchet.thread.attach(ctx3), ratchet.thread.attach(ctx3), ratchet.thread.attach(ctx3), ratchet.thread.attach(ctx3), ratchet.thread.attach(ctx3), } local self = ratchet.thread.self() ratchet.thread.attach(ctx2, self, paused) local client = socket:accept() end function ctx2(thread, paused) ratchet.thread.kill(thread) ratchet.thread.kill_all(paused) end function ctx3() ratchet.thread.pause() end kernel = ratchet.new(function () ratchet.thread.attach(ctx1, "localhost", 10025) end) kernel:loop() assert(0 == kernel:get_num_threads()) -- vim:foldmethod=marker:sw=4:ts=4:sts=4:et:
return { tag = 'graphicsState', summary = 'Set the stencil test.', description = [[ Sets the stencil test. The stencil test lets you mask out pixels that meet certain criteria, based on the contents of the stencil buffer. The stencil buffer can be modified using `lovr.graphics.stencil`. After rendering to the stencil buffer, the stencil test can be set to control how subsequent drawing functions are masked by the stencil buffer. ]], arguments = { compareMode = { type = 'CompareMode', description = [[ The comparison method used to decide if a pixel should be visible, or nil if the stencil test is disabled. ]] }, compareValue = { type = 'number', description = 'The value to compare stencil values to.' } }, returns = {}, variants = { { arguments = { 'compareMode', 'compareValue' }, returns = {} }, { description = 'Disables the stencil test.', arguments = {}, returns = {} } }, notes = [[ Stencil values are between 0 and 255. By default, the stencil test is disabled. ]], related = { 'lovr.graphics.stencil' } }
local Rand = require("api.Rand") local Chara = require("api.Chara") local I18N = require("api.I18N") local Sidequest = require("mod.elona_sys.sidequest.api.Sidequest") local Item = require("api.Item") local Text = require("mod.elona.api.Text") local IChara = require("api.chara.IChara") local World = require("api.World") local util = require("mod.elona.data.map_archetype.util") local Elona122Map = require("mod.elona_sys.map_loader.Elona122Map") local MapEntrance = require("mod.elona_sys.api.MapEntrance") local Scene = require("mod.elona_sys.scene.api.Scene") local DeferredEvent = require("mod.elona_sys.api.DeferredEvent") local Gui = require("api.Gui") local DeferredEvents = require("mod.elona.api.DeferredEvents") local MapgenUtils = require("mod.elona.api.MapgenUtils") local Enum = require("api.Enum") local Event = require("api.Event") local Charagen = require("mod.elona.api.Charagen") local ICharaSandBag = require("mod.elona.api.aspect.ICharaSandBag") local Area = require("api.Area") local Feat = require("api.Feat") do local vernis = { _type = "base.map_archetype", _id = "vernis", elona_id = 5, starting_pos = MapEntrance.edge, properties = { music = "elona.town1", types = { "town" }, tileset = "elona.town", turn_cost = 10000, is_indoor = false, is_temporary = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", max_crowd_density = 40, trainer_skills = { "elona.alchemy", "elona.healing", "elona.cooking", "elona.mining", "elona.traveling", "elona.fishing", "elona.lock_picking", } }, } vernis.chara_filter = util.chara_filter_town( function() if Rand.one_in(2) then return { id = "elona.miner" } end return nil end ) function vernis.on_generate_map(area, floor) local map = Elona122Map.generate("vernis") map:set_archetype("elona.vernis", { set_properties = true }) local chara = Chara.create("elona.whom_dwell_in_the_vanity", 39, 3, nil, map) chara = Chara.create("elona.loyter", 42, 23, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.miches", 24, 5, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.shena", 40, 24, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.dungeon_cleaner", 40, 25, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.rilian", 30, 5, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 42, 24, nil, map) chara:add_role("elona.special") if Sidequest.progress("elona.puppys_cave") == 1000 then chara = Chara.create("elona.poppy", 31, 4, nil, map) chara:add_role("elona.special") end chara = Chara.create("elona.shopkeeper", 47, 9, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.fisher" }) chara.shop_rank = 5 chara.name = I18N.get("chara.job.fisher", chara.name) chara = Chara.create("elona.shopkeeper", 14, 12, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.blacksmith" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.blacksmith", chara.name) chara = Chara.create("elona.shopkeeper", 39, 27, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.shopkeeper", 10, 15, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.general_vendor" }) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.wizard", 7, 26, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.magic_vendor" }) chara.shop_rank = 11 chara.name = I18N.get("chara.job.magic_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 14, 25, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.shopkeeper", 22, 26, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.bakery" }) chara.shop_rank = 9 chara.image = "elona.chara_baker" chara.name = I18N.get("chara.job.baker", chara.name) chara = Chara.create("elona.wizard", 28, 16, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.bartender", 38, 27, nil, map) chara:add_role("elona.bartender") chara = Chara.create("elona.healer", 6, 25, nil, map) chara:add_role("elona.healer") chara = Chara.create("elona.elder", 10, 7, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_vernis", chara.name) chara = Chara.create("elona.trainer", 27, 16, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.informer", 25, 16, nil, map) chara:add_role("elona.informer") for _=1,4 do chara = Chara.create("elona.citizen", nil, nil, nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,4 do chara = Chara.create("elona.guard", nil, nil, nil, map) chara:add_role("elona.guard") end for _=1,25 do MapgenUtils.generate_chara(map) end util.connect_stair_at(map, 28, 9, area, 3) if Sidequest.progress("elona.thieves_hideout") > 0 then local stairs = assert(Feat.create("elona.stairs_down", 48, 5, {force=true}, map)) stairs.params.area_uid = area.uid stairs.params.area_floor = 4 end return map end function vernis.on_map_renew_geometry(map) util.reload_122_map_geometry(map, "vernis") end function vernis.on_map_loaded(map) -- >>>>>>>> shade2/map.hsp:2035 if gArea=areaVernis{ .. if not save.elona.flag_has_met_ally then save.elona.flag_has_met_ally = true DeferredEvent.add(DeferredEvents.first_ally) end -- <<<<<<<< shade2/map.hsp:2038 } .. end data:add(vernis) data:add { _type = "base.area_archetype", _id = "vernis", elona_id = 5, types = { "town" }, image = "elona.feat_area_city", floors = { [1] = "elona.vernis", [3] = "elona.the_mine", [4] = "elona.robbers_hideout", [5] = "elona.test_site" }, metadata = { town_floors = { 1 }, }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 26, y = 23, starting_floor = 1 } } end do local yowyn = { _id = "yowyn", _type = "base.map_archetype", elona_id = 12, starting_pos = MapEntrance.edge, properties = { music = "elona.village1", types = { "town" }, tileset = "elona.town", level = 1, is_indoor = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", quest_town_id = 2, trainer_skills = { "elona.healing", "elona.sense_quality", "elona.cooking", "elona.carpentry", "elona.tailoring", "elona.gardening", "elona.riding", "elona.two_hand", "elona.weight_lifting", } } } yowyn.chara_filter = util.chara_filter_town( function() if Rand.one_in(2) then return { id = "elona.farmer" } end return nil end ) function yowyn.on_generate_map(area, floor) local map = Elona122Map.generate("yowyn") map:set_archetype("elona.yowyn", { set_properties = true }) if Sidequest.progress("elona.cat_house") > 0 then local stairs = assert(Feat.create("elona.stairs_down", 23, 22, {force=true}, map)) stairs.params.area_uid = area.uid stairs.params.area_floor = 3 end local chara = Chara.create("elona.ainc", 3, 17, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.tam", 26, 11, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.gilbert", 14, 20, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.shopkeeper", 11, 5, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.general_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 25, 8, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.shopkeeper", 7, 8, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.goods_vendor"}) chara.shop_rank = 8 chara.name = I18N.get("chara.job.goods_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 14, 14, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.shopkeeper", 35, 18, nil, map) chara:add_role("elona.horse_master") chara.shop_rank = 12 chara.name = I18N.get("chara.job.horse_master", chara.name) chara = Chara.create("elona.lame_horse", 33, 16, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.lame_horse", 37, 19, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.yowyn_horse", 34, 19, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.yowyn_horse", 38, 16, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.elder", 3, 4, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_yowyn", chara.name) chara = Chara.create("elona.trainer", 20, 14, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.wizard", 24, 16, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.informer", 26, 16, nil, map) chara:add_role("elona.informer") chara = Chara.create("elona.gwen", 14, 12, nil, map) chara:add_role("elona.special") for _=1,2 do chara = Chara.create("elona.citizen", nil, nil, nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,3 do chara = Chara.create("elona.guard", nil, nil, nil, map) chara:add_role("elona.guard") end for _=1,15 do MapgenUtils.generate_chara(map) end return map end function yowyn.on_map_renew_geometry(map) util.reload_122_map_geometry(map, "yowyn") end data:add(yowyn) data:add { _type = "base.area_archetype", _id = "yowyn", elona_id = 12, types = { "town" }, image = "elona.feat_area_village", floors = { [1] = "elona.yowyn", [3] = "elona.cat_mansion", [4] = "elona.battle_field" }, metadata = { town_floors = { 1 }, can_return_to = true }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 43, y = 32, starting_floor = 1 } } end do local palmia = { _id = "palmia", _type = "base.map_archetype", elona_id = 15, properties = { music = "elona.town4", types = { "town" }, tileset = "elona.town", level = 1, is_indoor = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", max_crowd_density = 45, quest_town_id = 3, trainer_skills = { "elona.gene_engineer", "elona.literacy", "elona.anatomy", "elona.jeweler", "elona.riding", "elona.negotiation", "elona.investing", "elona.casting", "elona.alchemy", } }, } function palmia.starting_pos(map, chara) local pos = MapEntrance.edge(map, chara) if save.base.player_pos_on_map_leave then return pos end local last_dir = Chara.player().direction if last_dir == "East" then pos.y = 22 elseif last_dir == "North" then pos.x = 30 end return pos end palmia.chara_filter = util.chara_filter_town( function() if Rand.one_in(3) then return { id = "elona.noble" } end return nil end ) function palmia.on_generate_map() local map = Elona122Map.generate("palmia") map:set_archetype("elona.palmia", { set_properties = true }) local chara = Chara.create("elona.bartender", 42, 27, nil, map) chara:add_role("elona.bartender") chara = Chara.create("elona.healer", 34, 3, nil, map) chara:add_role("elona.healer") chara = Chara.create("elona.arena_master", 22, 31, nil, map) chara:add_role("elona.arena_master") chara = Chara.create("elona.erystia", 5, 15, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.mia", 41, 11, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.conery", 5, 6, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.cleaner", 24, 6, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.cleaner", 15, 22, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 15, 22, nil, map) chara:add_role("elona.special") if Sidequest.progress("elona.mias_dream") == 1000 then local silver_cat = Chara.create("elona.silver_cat", 42, 11, {}, map, nil, map) silver_cat:add_role("elona.special") end chara = Chara.create("elona.shopkeeper", 48, 18, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.general_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 30, 17, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.shopkeeper", 48, 3, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.goods_vendor"}) chara.shop_rank = 8 chara.name = I18N.get("chara.job.goods_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 42, 17, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blacksmith"}) chara.shop_rank = 12 chara.name = I18N.get("chara.job.blacksmith", chara.name) chara = Chara.create("elona.shopkeeper", 11, 14, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.bakery" }) chara.shop_rank = 9 chara.image = "elona.chara_baker" chara.name = I18N.get("chara.job.baker", chara.name) chara = Chara.create("elona.wizard", 41, 3, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.magic_vendor" }) chara.shop_rank = 11 chara.name = I18N.get("chara.job.magic_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 41, 28, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.stersha", 7, 2, nil, map) chara:add_role("elona.royal_family") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.xabi", 6, 2, nil, map) chara:add_role("elona.royal_family") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.elder", 49, 11, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_palmia", chara.name) chara = Chara.create("elona.trainer", 30, 27, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.wizard", 32, 27, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.informer", 29, 28, nil, map) chara:add_role("elona.informer") chara = Chara.create("elona.guard", 16, 5, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 16, 9, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 5, 3, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 8, 3, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 35, 14, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 38, 14, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 29, 2, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 19, 18, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" chara = Chara.create("elona.guard", 22, 18, nil, map) chara:add_role("elona.guard") chara.ai_calm_action = "base.calm_stand" for _=1,5 do chara = Chara.create("elona.citizen", nil, nil, nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,4 do chara = Chara.create("elona.guard", nil, nil, nil, map) chara:add_role("elona.guard") end for _=1,25 do MapgenUtils.generate_chara(map) end return map end function palmia.on_map_renew_geometry(map) util.reload_122_map_geometry(map, "palmia") end data:add(palmia) data:add { _type = "base.area_archetype", _id = "palmia", types = { "town" }, image = "elona.feat_area_palace", floors = { [1] = "elona.palmia" }, metadata = { town_floors = { 1 }, can_return_to = true }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 53, y = 24, starting_floor = 1 } } end do local derphy = { _id = "derphy", _type = "base.map_archetype", elona_id = 14, starting_pos = MapEntrance.edge, properties = { music = "elona.town3", types = { "town" }, player_start_pos = "base.edge", tileset = "elona.town", level = 1, is_indoor = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", quest_town_id = 4, trainer_skills = { "elona.lock_picking", "elona.stealth", "elona.medium_armor", "elona.light_armor", "elona.carpentry", "elona.magic_device", "elona.performer", "elona.mining", } } } derphy.chara_filter = util.chara_filter_town( function() if Rand.one_in(3) then return { id = "elona.rogue" } elseif Rand.one_in(2) then return { id = "elona.prostitute" } end end ) function derphy.on_generate_map(area) local map = Elona122Map.generate("rogueden") map:set_archetype("elona.derphy", { set_properties = true }) local chara = Chara.create("elona.marks", 23, 14, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.noel", 13, 18, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.abyss", 16, 17, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.shopkeeper", 10, 17, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.bartender", 15, 15, nil, map) chara:add_role("elona.bartender") chara = Chara.create("elona.shopkeeper", 13, 3, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.general_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 29, 23, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.shopkeeper", 26, 7, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.goods_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.goods_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 30, 4, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blackmarket"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.blackmarket", chara.name) chara = Chara.create("elona.shopkeeper", 29, 4, nil, map) chara:add_role("elona.slaver") chara.name = I18N.get("chara.job.slave_master", chara.name) chara = Chara.create("elona.shopkeeper", 10, 6, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blacksmith"}) chara.shop_rank = 12 chara.name = I18N.get("chara.job.blacksmith", chara.name) chara = Chara.create("elona.arena_master", 7, 15, nil, map) chara:add_role("elona.arena_master") chara = Chara.create("elona.elder", 9, 18, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_derphy", chara.name) chara = Chara.create("elona.trainer", 13, 18, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.wizard", 5, 26, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.informer", 3, 28, nil, map) chara:add_role("elona.informer") for _=1,4 do chara = Chara.create("elona.citizen", nil, nil, nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,20 do MapgenUtils.generate_chara(map) end util.connect_stair_at(map, 16, 17, area, 3) return map end function derphy.on_map_renew_geometry(map) util.reload_122_map_geometry(map, "rogueden") end data:add(derphy) data:add { _type = "base.area_archetype", _id = "derphy", types = { "town" }, image = "elona.feat_area_village", floors = { [1] = "elona.derphy", [3] = "elona.thieves_guild" }, metadata = { town_floors = { 1 }, can_return_to = true }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 14, y = 35, starting_floor = 1 } } end do local port_kapul = { _id = "port_kapul", _type = "base.map_archetype", elona_id = 11, starting_pos = MapEntrance.edge, properties = { music = "elona.town2", types = { "town" }, tileset = "elona.town", level = 1, is_indoor = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", quest_town_id = 5, trainer_skills = { "elona.negotiation", "elona.investing", "elona.performer", "elona.fishing", "elona.magic_device", "elona.gene_engineer", } } } port_kapul.chara_filter = util.chara_filter_town() function port_kapul.on_generate_map(area) local map = Elona122Map.generate("kapul") map:set_archetype("elona.port_kapul", { set_properties = true }) local chara = Chara.create("elona.raphael", 15, 18, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.arnord", 36, 27, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.icolle", 5, 26, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.doria", 29, 3, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.cleaner", 24, 21, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.cleaner", 12, 26, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.cleaner", 8, 11, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 8, 14, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.shopkeeper", 16, 17, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.shopkeeper", 23, 7, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blacksmith"}) chara.shop_rank = 12 chara.name = I18N.get("chara.job.blacksmith", chara.name) chara = Chara.create("elona.shopkeeper", 32, 14, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.general_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 22, 14, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.goods_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.goods_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 16, 25, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blackmarket"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.blackmarket", chara.name) chara = Chara.create("elona.shopkeeper", 17, 28, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.food_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.food_vendor", chara.name) chara = Chara.create("elona.wizard", 22, 22, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.magic_vendor" }) chara.shop_rank = 11 chara.name = I18N.get("chara.job.magic_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 35, 3, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.bartender", 15, 15, nil, map) chara:add_role("elona.bartender") chara = Chara.create("elona.arena_master", 26, 3, nil, map) chara:add_role("elona.arena_master") chara = Chara.create("elona.pet_arena_master", 25, 4, nil, map) chara:add_role("elona.arena_master") chara = Chara.create("elona.elder", 8, 12, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_port_kapul", chara.name) chara = Chara.create("elona.trainer", 16, 4, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.wizard", 14, 4, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.informer", 17, 5, nil, map) chara:add_role("elona.informer") chara = Chara.create("elona.healer", 27, 11, nil, map) chara:add_role("elona.healer") for _=1,2 do chara = Chara.create("elona.citizen", nil, nil, nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,4 do chara = Chara.create("elona.sailor", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,5 do chara = Chara.create("elona.guard_port_kapul", nil, nil, nil, map) chara:add_role("elona.guard") end chara = Chara.create("elona.captain", 7, 6, nil, map) chara:add_role("elona.citizen") for _=1,20 do MapgenUtils.generate_chara(map) end util.connect_stair_at(map, 29, 3, area, 3) return map end function port_kapul.on_map_renew_geometry(map) util.reload_122_map_geometry(map, "kapul") end data:add(port_kapul) data:add { _type = "base.area_archetype", _id = "port_kapul", types = { "town" }, image = "elona.feat_area_city", floors = { [1] = "elona.port_kapul", [3] = "elona.fighters_guild", [25] = "elona.doom_ground" }, metadata = { town_floors = { 1 }, can_return_to = true }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 3, y = 15, starting_floor = 1 } } end do local noyel = { _id = "noyel", _type = "base.map_archetype", elona_id = 33, properties = { music = "elona.town6", types = { "town" }, tileset = "elona.town", level = 1, deepest_dungeon_level = 1, is_indoor = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", quest_town_id = 6, has_snow = true, max_crowd_density = 35, trainer_skills = { "elona.faith", "elona.literacy", "elona.sense_quality", "elona.cooking", "elona.traveling", "elona.meditation", "elona.weight_lifting", } } } function noyel.starting_pos(map, chara) local pos = MapEntrance.edge(map, chara) if save.base.player_pos_on_map_leave then return pos end local last_dir = Chara.player().direction if last_dir == "East" then pos.y = 3 elseif last_dir == "North" then pos.x = 28 elseif last_dir == "South" then pos.x = 5 end return pos end noyel.chara_filter = util.chara_filter_town( function() if Rand.one_in(3) then return { id = "elona.sister" } end end ) local function reload_noyel_christmas(map) local item = Item.create("elona.pedestal", 29, 16, nil, map) item.own_state = Enum.OwnState.NotOwned item = Item.create("elona.statue_of_jure", 29, 16, nil, map) item.own_state = Enum.OwnState.NotOwned item = Item.create("elona.altar", 29, 17, nil, map) item.own_state = Enum.OwnState.NotOwned item.params = { god_id = "elona.jure" } item = Item.create("elona.mochi", 29, 17, nil, map) item.own_state = Enum.OwnState.Unobtainable local chara = Chara.create("elona.kaneda_bike", 48, 19, nil, map) chara:add_role("elona.special") chara.is_only_in_christmas = true chara = Chara.create("elona.part_time_worker", 30, 17, nil, map) chara:add_role("elona.special") chara.is_only_in_christmas = true chara = Chara.create("elona.punk", 38, 19, nil, map) chara.is_only_in_christmas = true chara:get_aspect_or_default(ICharaSandBag, true):hang_on_sand_bag(chara) chara.name = I18N.get("chara.job.fanatic") chara = Chara.create("elona.fanatic", 35, 19, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.fanatic", 37, 18, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.fanatic", 37, 21, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.fanatic", 39, 20, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.fanatic", 38, 21, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.bartender", 17, 8, nil, map) chara.ai_calm_action = "base.calm_stand" chara.relation = Enum.Relation.Neutral chara.is_only_in_christmas = true chara:add_role("elona.shopkeeper", {inventory_id="elona.food_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.food_vendor", chara.name) chara = Chara.create("elona.hot_spring_maniac", 25, 8, nil, map) chara.ai_calm_action = "base.calm_stand" chara.relation = Enum.Relation.Neutral chara.is_only_in_christmas = true chara:add_role("elona.shopkeeper", {inventory_id="elona.souvenir_vendor"}) chara.shop_rank = 30 chara.name = I18N.get("chara.job.souvenir_vendor", Text.random_name()) chara = Chara.create("elona.rogue", 24, 22, nil, map) chara.ai_calm_action = "base.calm_stand" chara.relation = Enum.Relation.Neutral chara.is_only_in_christmas = true chara:add_role("elona.shopkeeper", {inventory_id="elona.souvenir_vendor"}) chara.shop_rank = 30 chara.name = I18N.get("chara.job.souvenir_vendor", Text.random_name()) chara = Chara.create("elona.shopkeeper", 38, 12, nil, map) chara.ai_calm_action = "base.calm_stand" chara:add_role("elona.shopkeeper", {inventory_id="elona.blackmarket"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.blackmarket", Text.random_name()) chara.is_only_in_christmas = true chara = Chara.create("elona.rogue", 28, 9, nil, map) chara.ai_calm_action = "base.calm_stand" chara.relation = Enum.Relation.Neutral chara.is_only_in_christmas = true chara:add_role("elona.shopkeeper", {inventory_id="elona.street_vendor"}) chara.shop_rank = 30 chara.name = I18N.get("chara.job.street_vendor", Text.random_name()) chara = Chara.create("elona.rogue", 29, 24, nil, map) chara.ai_calm_action = "base.calm_stand" chara.faction = Enum.Relation.Neutral chara.is_only_in_christmas = true chara:add_role("elona.shopkeeper", {inventory_id="elona.street_vendor"}) chara.shop_rank = 30 chara.name = I18N.get("chara.job.street_vendor2", Text.random_name()) for _ = 1, 20 do chara = Chara.create("elona.holy_beast", nil, nil, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.festival_tourist", nil, nil, nil, map) chara.is_only_in_christmas = true end for _ = 1, 15 do chara = Chara.create("elona.bard", nil, nil, nil, map) chara.is_only_in_christmas = true end for _ = 1, 7 do chara = Chara.create("elona.prostitute", nil, nil, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.tourist", nil, nil, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.noble", nil, nil, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.punk", nil, nil, nil, map) chara.is_only_in_christmas = true end for _ = 1, 3 do chara = Chara.create("elona.stray_cat", nil, nil, nil, map) chara.is_only_in_christmas = true chara = Chara.create("elona.tourist", nil, nil, nil, map) chara.is_only_in_christmas = true end end function noyel.on_generate_map() local map = Elona122Map.generate("noyel") map:set_archetype("elona.noyel", { set_properties = true }) local chara = Chara.create("elona.ebon", 46, 18, {}, map) chara:add_role("elona.special") save.elona.fire_giant_uid = chara.uid chara = Chara.create("elona.moyer_the_crooked", 47, 18, {}, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.moyer"}) chara = Chara.create("elona.town_child", 47, 20, {}, map) chara:add_role("elona.special") chara = Chara.create("elona.town_child", 15, 19, {}, map) chara:add_role("elona.special") chara = Chara.create("elona.town_child", 49, 20, {}, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 28, 22, {}, map) chara:add_role("elona.special") chara = Chara.create("elona.pael", 19, 3, {}, map) chara:add_role("elona.special") if Sidequest.progress("elona.pael_and_her_mom") ~= 1001 then chara = Chara.create("elona.lily", 19, 2, {}, map) chara:add_role("elona.special") end chara = Chara.create("elona.bartender", 40, 33, {}, map) chara:add_role("elona.bartender") chara = Chara.create("elona.healer", 44, 6, {}, map) chara:add_role("elona.healer") chara = Chara.create("elona.healer", 44, 3, {}, map) chara:add_role("elona.sister") chara = Chara.create("elona.shopkeeper", 19, 31, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blacksmith"}) chara.shop_rank = 12 chara.name = I18N.get("chara.job.blacksmith", chara.name) chara = Chara.create("elona.shopkeeper", 11, 31, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.general_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 38, 34, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.shopkeeper", 5, 27, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.bakery" }) chara.shop_rank = 9 chara.image = "elona.chara_baker" chara.name = I18N.get("chara.job.baker", chara.name) chara = Chara.create("elona.wizard", 56, 5, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.magic_vendor" }) chara.shop_rank = 11 chara.name = I18N.get("chara.job.magic_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 39, 35, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.elder", 5, 18, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_noyel", chara.name) chara = Chara.create("elona.trainer", 18, 20, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.wizard", 4, 33, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.informer", 6, 33, nil, map) chara:add_role("elona.informer") for _ = 1, 3 do chara = Chara.create("elona.citizen", Rand.rnd(32), Rand.rnd(map:height()), nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", Rand.rnd(32), Rand.rnd(map:height()), nil, map) chara:add_role("elona.citizen") end for _ = 1, 3 do chara = Chara.create("elona.guard", Rand.rnd(32), Rand.rnd(map:height()), nil, map) chara:add_role("elona.guard") end for _ = 1, 8 do chara = MapgenUtils.generate_chara(map, Rand.rnd(11) + 25, Rand.rnd(5) + 15, { id = "elona.town_child" }) chara:add_role("elona.special") end for _ = 1, 20 do MapgenUtils.generate_chara(map, Rand.rnd(55), Rand.rnd(map:height())) end return map end local function reload_noyel(map) Chara.iter_others(map) :filter(function(c) return c.is_only_in_christmas end) :each(IChara.vanquish) end local function proc_noyel_christmas_festival(map, area) if not area then return end -- >>>>>>>> shade2/map.hsp:1904 if gMonth=12{ ... if World.date().month == 12 then if not area.metadata.is_noyel_christmas_festival then area.metadata.is_noyel_christmas_festival = true reload_noyel_christmas(map) end util.reload_122_map_geometry(map, "noyel_fest") else if area.metadata.is_noyel_christmas_festival then area.metadata.is_noyel_christmas_festival = false reload_noyel(map) end util.reload_122_map_geometry(map, "noyel") end end noyel.events = noyel.events or {} noyel.events[#noyel.events+1] = { id = "base.on_map_generated_from_archetype", name = "Proc Noyel Christmas festival", callback = function(map, params) proc_noyel_christmas_festival(map, params.area) end } function noyel.on_map_renew_geometry(map) -- >>>>>>>> shade2/map.hsp:3395 inv_getHeader -1 ... for _, item in Item.iter_ground(map) do if item.id ~= "elona.shelter" and item.id ~= "elona.giants_shackle" then item:remove() end end -- <<<<<<<< shade2/map.hsp:3400 loop .. local area = Area.for_map(map) proc_noyel_christmas_festival(map, area) save.elona.is_fire_giant_released = false -- <<<<<<<< shade2/map.hsp:1911 flagFireGiant=false .. end function noyel.on_map_pass_turn(map) -- >>>>>>>> shade2/map.hsp:3295 if gArea=areaNoyel:if flagFireGiant=true:if cExis ... if save.elona.is_fire_giant_released then local fire_giant = map:get_object_of_type("base.chara", save.elona.fire_giant_uid) if Chara.is_alive(fire_giant) and map:calc("crowd_density") < 30 then if Rand.one_in(4) then Charagen.create(nil, nil, { id = "elona.palmian_elite_soldier", quality = Enum.Quality.Bad }, map) end if Rand.one_in(10) then Charagen.create(nil, nil, { id = "elona.tourist", quality = Enum.Quality.Bad }, map) end end end -- <<<<<<<< shade2/map.hsp:3300 } .. end data:add(noyel) data:add { _type = "base.area_archetype", _id = "noyel", types = { "town" }, image = "elona.feat_area_village_snow", floors = { [1] = "elona.noyel" }, metadata = { town_floors = { 1 }, can_return_to = true }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 89, y = 14, starting_floor = 1 } } local function target_fire_giant(chara, params, result) -- >>>>>>>> shade2/ai.hsp:86 if gArea=areaNoyel{ ... local map = chara:current_map() if map and map._archetype == "elona.noyel" and save.elona.fire_giant_uid ~= nil then local fire_giant = map:get_object_of_type("base.chara", save.elona.fire_giant_uid) if chara.uid ~= save.elona.fire_giant_uid and not chara:is_in_player_party() and save.elona.is_fire_giant_released and Chara.is_alive(fire_giant) then chara:set_target(fire_giant, 500) end end -- <<<<<<<< shade2/ai.hsp:90 } .. end Event.register("elona.on_default_ai_action", "Target fire giant if escaped", target_fire_giant) local function prevent_tourist_loot(chara, _, blocked) -- >>>>>>>> shade2/item.hsp:154 if gArea=areaNoyel{ ... local map = chara:current_map() if map and map._archetype == "elona.noyel" then if chara._id == "elona.tourist" or chara._id == "elona.palmian_elite_soldier" then blocked = true end end return blocked -- <<<<<<<< shade2/item.hsp:157 } .. end Event.register("elona.before_chara_drop_items", "Prevent loot drops from citizens and soldiers in Noyel", prevent_tourist_loot) end do local lumiest = { _id = "lumiest", _type = "base.map_archetype", elona_id = 36, properties = { music = "elona.town2", types = { "town" }, tileset = "elona.town", level = 1, is_indoor = false, has_anchored_npcs = true, default_ai_calm = "base.calm_roam", quest_town_id = 7, trainer_skills = { "elona.casting", "elona.healing", "elona.literacy", "elona.magic_device", "elona.fishing", "elona.light_armor", "elona.investing", "elona.two_hand", } } } function lumiest.starting_pos(map, chara) local pos = MapEntrance.edge(map, chara) if save.base.player_pos_on_map_leave then return pos end local last_dir = Chara.player().direction if last_dir == "West" then pos.x = 58 pos.y = 21 elseif last_dir == "East" then pos.x = 25 pos.y = 1 elseif last_dir == "North" then pos.x = 58 pos.y = 21 elseif last_dir == "South" then pos.x = 25 pos.y = 1 end return pos end lumiest.chara_filter = util.chara_filter_town( function() if Rand.one_in(3) then return { id = "elona.artist" } end end ) function lumiest.on_generate_map(area) local map = Elona122Map.generate("lumiest") map:set_archetype("elona.lumiest", { set_properties = true }) -- TODO only if sidequest --local stair = Feat.at(18, 45, map):nth(1) --assert(stair) --stair.generator_params = { generator = "base.map_template", params = { id = "elona.the_sewer" }} --stair.area_params = { outer_map_id = map._id } local chara = Chara.create("elona.renton", 12, 24, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.balzak", 21, 3, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.lexus", 5, 20, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.cleaner", 28, 29, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 41, 19, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 32, 43, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 29, 28, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 16, 45, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bard", 13, 24, nil, map) chara:add_role("elona.special") chara = Chara.create("elona.bartender", 41, 42, nil, map) chara:add_role("elona.bartender") chara = Chara.create("elona.healer", 10, 16, nil, map) chara:add_role("elona.healer") chara = Chara.create("elona.shopkeeper", 47, 30, nil, map) chara:add_role("elona.shopkeeper", {inventory_id="elona.general_vendor"}) chara.shop_rank = 10 chara.name = I18N.get("chara.job.general_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 24, 47, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.innkeeper" }) chara:add_role("elona.innkeeper") chara.shop_rank = 8 chara.name = I18N.get("chara.job.innkeeper", chara.name) chara = Chara.create("elona.shopkeeper", 37, 30, nil, map) chara:add_role("elona.shopkeeper", {inventory_id = "elona.blacksmith"}) chara.shop_rank = 12 chara.name = I18N.get("chara.job.blacksmith", chara.name) chara = Chara.create("elona.shopkeeper", 37, 12, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.bakery" }) chara.shop_rank = 9 chara.image = "elona.chara_baker" chara.name = I18N.get("chara.job.baker", chara.name) chara = Chara.create("elona.wizard", 6, 15, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.magic_vendor" }) chara.shop_rank = 11 chara.name = I18N.get("chara.job.magic_vendor", chara.name) chara = Chara.create("elona.shopkeeper", 33, 43, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.trader" }) chara.shop_rank = 12 chara.name = I18N.get("chara.job.trader", chara.name) chara = Chara.create("elona.shopkeeper", 47, 12, nil, map) chara:add_role("elona.shopkeeper", { inventory_id = "elona.fisher" }) chara.shop_rank = 5 chara.name = I18N.get("chara.job.fisher", chara.name) chara = Chara.create("elona.elder", 3, 38, nil, map) chara:add_role("elona.elder") chara.name = I18N.get("chara.job.of_lumiest", chara.name) chara = Chara.create("elona.trainer", 21, 28, nil, map) chara:add_role("elona.trainer") chara.name = I18N.get("chara.job.trainer", chara.name) chara = Chara.create("elona.wizard", 21, 30, nil, map) chara:add_role("elona.identifier") chara = Chara.create("elona.informer", 23, 38, nil, map) chara:add_role("elona.informer") for _=1,6 do chara = Chara.create("elona.citizen", nil, nil, nil, map) chara:add_role("elona.citizen") chara = Chara.create("elona.citizen2", nil, nil, nil, map) chara:add_role("elona.citizen") end for _=1,7 do chara = Chara.create("elona.guard", nil, nil, nil, map) chara:add_role("elona.guard") end for _=1,25 do MapgenUtils.generate_chara(map) end util.connect_stair_at(map, 5, 20, area, 3) return map end function lumiest.on_map_renew_geometry(map) util.reload_122_map_geometry(map, "lumiest") end data:add(lumiest) data:add { _type = "base.area_archetype", _id = "lumiest", types = { "town" }, image = "elona.feat_area_city", floors = { [1] = "elona.lumiest", [3] = "elona.mages_guild", [20] = "elona.the_sewer" }, metadata = { town_floors = { 1 }, can_return_to = true }, parent_area = { _id = "elona.north_tyris", on_floor = 1, x = 61, y = 32, starting_floor = 1 } } end
--[[ Based on slap.lua, Copyright 2016 topkecleon <drew@otou.to> This code is licensed under the GNU AGPLv3. ]]-- local slap = {} local mattata = require('mattata') function slap:init(configuration) slap.arguments = 'slap <target>' slap.commands = mattata.commands(self.info.username, configuration.commandPrefix):c('slap').table slap.help = configuration.commandPrefix .. 'slap <target> - Slap somebody (or something).' end local slaps = { 'VICTIM was shot by VICTOR.', 'VICTIM was pricked to death.', 'VICTIM walked into a cactus while trying to escape VICTOR.', 'VICTIM drowned.', 'VICTIM drowned whilst trying to escape VICTOR.', 'VICTIM blew up.', 'VICTIM was blown up by VICTOR.', 'VICTIM hit the ground too hard.', 'VICTIM fell from a high place.', 'VICTIM fell off a ladder.', 'VICTIM fell into a patch of cacti.', 'VICTIM was doomed to fall by VICTOR.', 'VICTIM was blown from a high place by VICTOR.', 'VICTIM was squashed by a falling anvil.', 'VICTIM went up in flames.', 'VICTIM burned to death.', 'VICTIM was burnt to a crisp whilst fighting VICTOR.', 'VICTIM walked into a fire whilst fighting VICTOR.', 'VICTIM tried to swim in lava.', 'VICTIM tried to swim in lava while trying to escape VICTOR.', 'VICTIM was struck by lightning.', 'VICTIM was slain by VICTOR.', 'VICTIM got finished off by VICTOR.', 'VICTIM was killed by magic.', 'VICTIM was killed by VICTOR using magic.', 'VICTIM starved to death.', 'VICTIM suffocated in a wall.', 'VICTIM fell out of the world.', 'VICTIM was knocked into the void by VICTOR.', 'VICTIM withered away.', 'VICTIM was pummeled by VICTOR.', 'VICTIM was fragged by VICTOR.', 'VICTIM was desynchronized.', 'VICTIM was wasted.', 'VICTIM was busted.', 'VICTIM\'s bones are scraped clean by the desolate wind.', 'VICTIM has died of dysentery.', 'VICTIM fainted.', 'VICTIM is out of usable Pokemon! VICTIM whited out!', 'VICTIM is out of usable Pokemon! VICTIM blacked out!', 'VICTIM whited out!', 'VICTIM blacked out!', 'VICTIM says goodbye to this cruel world.', 'VICTIM got rekt.', 'VICTIM was sawn in half by VICTOR.', 'VICTIM died. I blame VICTOR.', 'VICTIM was axe-murdered by VICTOR.', 'VICTIM\'s melon was split by VICTOR.', 'VICTIM was sliced and diced by VICTOR.', 'VICTIM was split from crotch to sternum by VICTOR.', 'VICTIM\'s death put another notch in VICTOR\'s axe.', 'VICTIM died impossibly!', 'VICTIM died from VICTOR\'s mysterious tropical disease.', 'VICTIM escaped infection by dying.', 'VICTIM played hot-potato with a grenade.', 'VICTIM was knifed by VICTOR.', 'VICTIM fell on his sword.', 'VICTIM ate a grenade.', 'VICTIM practiced being VICTOR\'s clay pigeon.', 'VICTIM is what\'s for dinner!', 'VICTIM was terminated by VICTOR.', 'VICTIM was shot before being thrown out of a plane.', 'VICTIM was not invincible.', 'VICTIM has encountered an error.', 'VICTIM died and reincarnated as a goat.', 'VICTOR threw VICTIM off a building.', 'VICTIM is sleeping with the fishes.', 'VICTIM got a premature burial.', 'VICTOR replaced all of VICTIM\'s music with Nickelback.', 'VICTOR spammed VICTIM\'s email.', 'VICTOR made VICTIM a knuckle sandwich.', 'VICTOR slapped VICTIM with pure nothing.', 'VICTOR hit VICTIM with a small, interstellar spaceship.', 'VICTIM was quickscoped by VICTOR.', 'VICTOR put VICTIM in check-mate.', 'VICTOR RSA-encrypted VICTIM and deleted the private key.', 'VICTOR put VICTIM in the friendzone.', 'VICTOR slaps VICTIM with a DMCA takedown request!', 'VICTIM became a corpse blanket for VICTOR.', 'Death is when the monsters get you. Death comes for VICTIM.', 'Cowards die many times before their death. VICTIM never tasted death but once.', 'VICTIM died of hospital gangrene.', 'VICTIM got a house call from Doctor VICTOR.', 'VICTOR beheaded VICTIM.', 'VICTIM got stoned...by an angry mob.', 'VICTOR sued the pants off VICTIM.', 'VICTIM was impeached.', 'VICTIM was one-hit KO\'d by VICTOR.', 'VICTOR sent VICTIM to /dev/null.', 'VICTOR sent VICTIM down the memory hole.', 'VICTIM was a mistake.', '\'VICTIM was a mistake.\' - VICTOR', 'VICTOR checkmated VICTIM in two moves.' } function slap:onMessage(message) local input = mattata.input(message.text) local victor = message.from.first_name local victim if not input then victor = self.info.first_name victim = message.from.first_name else if message.reply_to_message then victim = message.reply_to_message.from.first_name else victim = input end end mattata.sendMessage(message.chat.id, slaps[math.random(#slaps)]:gsub('VICTIM', victim):gsub('VICTOR', victor), nil, true, false, message.message_id) end return slap
return { type = "table", entries = { particles_per_metre = { type = "number", description = "Particles per one metre (= node size)", range = {min = 1, max = 100}, default = 10 }, spawn_chance = { type = "number", description = "Chance of a ghost spawning the first night", range = {min = 0, max = 1}, default = 1 }, chance_reduction_per_night = { type = "number", description = "Decrease in chance of ghost spawning per night", range = {min = 0, max = 1}, default = 0.5 }, forget_duration_nights = { type = "number", description = "How many nights it takes for a ghost to forget their victim", default = 10, }, fallback_resolution = { type = "table", entries = { { type = "number", description = "Fallback resolution width", default = 64 }, { type = "number", description = "Fallback resolution height", default = 64 } } }, force_fallback_resolution = { type = "boolean", description = "Whether to always resize textures to the given fallback dimensions. Guarantees support for arbitrary resolution texture packs. If this is not set, texture packs with a resolution lower than the server texture resolution won't work at all; texture packs with a multiple of said resolution will work well, however. A resolution of 64x64 or lower is usually acceptable performance-wise.", default = false } } }
local FirstChargeUI = class("FirstChargeUI", BaseUI) function FirstChargeUI:ctor() self:load(UriConst.ui_firstCharge, UIType.PopUp,UIAnim.MiddleAppear) end function FirstChargeUI:Refresh() App.RetrieveProxy("MainProxy"):FirstChargeOpenReq() end function FirstChargeUI:Hide() if self.timer then LuaTimer.Delete(self.timer) end end function FirstChargeUI:UpdateData() if Player.first_charge_left_time then self.count_time = Player.first_charge_left_time self.timer = LuaTimer.Add(100,100,Handler(self.ShowTimer,self)) end end function FirstChargeUI:ShowTimer() if self.count_time > 0 then self.count_time = self.count_time - 0.1 local zs,xs = math.modf(self.count_time) local h = math.floor(zs / 3600) local m = math.floor((zs % 3600) / 60) local s = math.floor((zs % 3600) % 60) xs = math.floor(xs*100) self.txt_countdown.text = string.format("%02d:%02d:%02d:%02d",h,m,s,xs) return true else return false end end function FirstChargeUI:onClick(go, name) if name == "btn_exit" or name == "btn_mask" then self:closePage() elseif name == "btn_getCoin" then if table.isEmpty(Cache.pay_type) then App.Notice(AppMsg.DialogShow,"CashIn channel is under maintenance!") else App.Notice(AppMsg.CashChannelShow,Cache.firstChargeItem) end end end return FirstChargeUI
local M = {} --- Create a signal -- @param signal_id The unique id of the signal -- @return The created signal function M.create(signal_id) assert(signal_id, "You must provide a signal_id") signal_id = type(signal_id) == "string" and hash(signal_id) or signal_id local signal = { id = signal_id, } local listeners = {} --- Add a listener to the signal -- @param cb Function callback or message url (defaults to current url) function signal.add(cb) cb = cb or msg.url() if type(cb) == "function" then listeners[cb] = { fn = cb } else local key = hash_to_hex(cb.socket or hash("")) .. hash_to_hex(cb.path or hash("")) .. hash_to_hex(cb.fragment or hash("")) listeners[key] = { fn = function(message) if not message then msg.post(cb, signal_id) else if type(message) ~= "table" then message = { message = message } end msg.post(cb, signal_id, message) end end } end end --- Remove a listener from the signal -- @param cb Function callback or message url (defaults to current url) function signal.remove(cb) cb = cb or msg.url() if type(cb) == "function" then listeners[cb] = nil else local key = hash_to_hex(cb.socket or hash("")) .. hash_to_hex(cb.path or hash("")) .. hash_to_hex(cb.fragment or hash("")) listeners[key] = nil end end --- Trigger the signal -- @param message Optional message to pass to listeners function signal.trigger(message) for _,v in pairs(listeners) do v.fn(message) end end return signal end return M
require 'nn' require 'image' require 'xlua' torch.setdefaulttensortype('torch.FloatTensor') -- parse STL-10 data from table into Tensor function parseDataLabel(d, numSamples, numChannels, height, width) local t = torch.ByteTensor(numSamples, numChannels, height, width) local l = torch.ByteTensor(numSamples) local idx = 1 for i = 1, #d do local this_d = d[i] for j = 1, #this_d do t[idx]:copy(this_d[j]) l[idx] = i idx = idx + 1 end end assert(idx == numSamples+1) return t, l end function parseDataNoLabel(d, numSamples, numChannels, height, width) local t_nl = torch.ByteTensor(numSamples, numChannels, height, width) local idx = 1 for i = 1, #d do local this_d = d[i] for j = 1, #this_d do t_nl[idx]:copy(this_d[j]) idx = idx + 1 end end assert(idx == numSamples + 1) return t_nl end local Provider = torch.class 'Provider' function Provider:__init(full) local trsize = 4000 local valsize = 1000 -- Use the validation here as the valing set local testsize = 8000 local channel = 3 local height = 96 local width = 96 -- download dataset if not paths.dirp('stl-10') then os.execute('mkdir stl-10') local www = { train = 'https://s3.amazonaws.com/dsga1008-spring16/data/a2/train.t7b', val = 'https://s3.amazonaws.com/dsga1008-spring16/data/a2/val.t7b', extra = 'https://s3.amazonaws.com/dsga1008-spring16/data/a2/extra.t7b', test = 'https://s3.amazonaws.com/dsga1008-spring16/data/a2/test.t7b' } os.execute('wget ' .. www.train .. '; '.. 'mv train.t7b stl-10/train.t7b') os.execute('wget ' .. www.val .. '; '.. 'mv val.t7b stl-10/val.t7b') os.execute('wget ' .. www.test .. '; '.. 'mv test.t7b stl-10/test.t7b') os.execute('wget ' .. www.extra .. '; '.. 'mv extra.t7b stl-10/extra.t7b') end local raw_train = torch.load('stl-10/train.t7b') local raw_val = torch.load('stl-10/val.t7b') local raw_test = torch.load('stl-10/test.t7b') -- load and parse dataset self.testData = { data = torch.Tensor(), labels = torch.Tensor(), size = function() return testsize end } self.testData.data, self.testData.labels = parseDataLabel(raw_test.data, testsize, channel, height, width) local testData = self.testData self.trainData = { data = torch.Tensor(), labels = torch.Tensor(), size = function() return trsize end } self.trainData.data, self.trainData.labels = parseDataLabel(raw_train.data, trsize, channel, height, width) local trainData = self.trainData self.valData = { data = torch.Tensor(), labels = torch.Tensor(), size = function() return valsize end } self.valData.data, self.valData.labels = parseDataLabel(raw_val.data, valsize, channel, height, width) local valData = self.valData -- convert from ByteTensor to Float self.testData.data = self.testData.data:float() self.testData.labels = self.testData.labels:float() self.trainData.data = self.trainData.data:float() self.trainData.labels = self.trainData.labels:float() self.valData.data = self.valData.data:float() self.valData.labels = self.valData.labels:float() collectgarbage() end function Provider:getUnlabelled() local exsize = 100000 if not paths.dirp('stl-10') then local www = { extra = 'https://s3.amazonaws.com/dsga1008-spring16/data/a2/extra.t7b', } os.execute('wget ' .. www.extra .. '; '.. 'mv extra.t7b stl-10/extra.t7b') end local raw_extra = torch.load('stl-10/extra.t7b') local extraData = { data = torch.FloatTensor(), size = function() return exsize end } extraData.data = parseDataNoLabel(raw_extra.data, 100000, 3, 96, 96) -- local extraData = self.extraData extraData.data = extraData.data:float() self.extraData = extraData collectgarbage() end function Provider:normalize() ---------------------------------------------------------------------- -- preprocess/normalize train/val sets -- local trainData = self.trainData local valData = self.valData local extraData = self.extraData local testData = self.testData print '<trainer> preprocessing data (color space + normalization)' collectgarbage() -- preprocess trainSet local normalization = nn.SpatialContrastiveNormalization(1, image.gaussian1D(7)) for i = 1,trainData:size() do xlua.progress(i, trainData:size()) -- rgb -> yuv local rgb = trainData.data[i] local yuv = image.rgb2yuv(rgb) -- normalize y locally: yuv[1] = normalization(yuv[{{1}}]) trainData.data[i] = yuv end -- normalize u globally: local mean_u = trainData.data:select(2,2):mean() local std_u = trainData.data:select(2,2):std() trainData.data:select(2,2):add(-mean_u) trainData.data:select(2,2):div(std_u) -- normalize v globally: local mean_v = trainData.data:select(2,3):mean() local std_v = trainData.data:select(2,3):std() trainData.data:select(2,3):add(-mean_v) trainData.data:select(2,3):div(std_v) trainData.mean_u = mean_u trainData.std_u = std_u trainData.mean_v = mean_v trainData.std_v = std_v -- preprocess valSet for i = 1,valData:size() do xlua.progress(i, valData:size()) -- rgb -> yuv local rgb = valData.data[i] local yuv = image.rgb2yuv(rgb) -- normalize y locally: yuv[{1}] = normalization(yuv[{{1}}]) valData.data[i] = yuv end -- normalize u globally: valData.data:select(2,2):add(-mean_u) valData.data:select(2,2):div(std_u) -- normalize v globally: valData.data:select(2,3):add(-mean_v) valData.data:select(2,3):div(std_v) -- preprocess testSet for i = 1,testData:size() do xlua.progress(i, testData:size()) -- rgb -> yuv local rgb = testData.data[i] local yuv = image.rgb2yuv(rgb) -- normalize y locally: yuv[{1}] = normalization(yuv[{{1}}]) testData.data[i] = yuv end -- normalize u globally: testData.data:select(2,2):add(-mean_u) testData.data:select(2,2):div(std_u) -- normalize v globally: testData.data:select(2,3):add(-mean_v) testData.data:select(2,3):div(std_v) -- preprocess extraSet for i=1, extraData:size() do xlua.progress(i, extraData:size()) -- rgb -> yuv local rgb = extraData.data[i] local yuv = image.rgb2yuv(rgb) -- normalize y locally: yuv[{1}] = normalization(yuv[{{1}}]) extraData.data[i] = yuv end extraData.data:select(2,2):add(-mean_u) extraData.data:select(2,2):div(std_u) extraData.data:select(2,3):add(-mean_v) extraData.data:select(2,3):div(std_v) end
SkillTree = Object:extend() function SkillTree:new() self.timer = Timer() self.area = Area(self) self.font = fonts.Anonymous_8 self.main_canvas = love.graphics.newCanvas(gw, gh) self.final_canvas = love.graphics.newCanvas(gw, gh) self.temp_canvas = love.graphics.newCanvas(gw, gh) self.glitch_canvas = love.graphics.newCanvas(gw, gh) self.rgb_canvas = love.graphics.newCanvas(gw, gh) self.rgb_shift_mag = 0 self.nodes = {} self.lines = {} self.tree = table.copy(tree) camera:lookAt(32, 96) -- Create nodes and links for id, node in pairs(self.tree) do self.nodes[id] = Node(id, node.x, node.y, node.size) end for id, node in pairs(self.tree) do for _, linked_node_id in ipairs(node.links or {}) do table.insert(self.lines, Line(self.nodes, id, linked_node_id)) end end -- Keyboard tree movement for id, current_node in pairs(self.tree) do for _, linked_node_id in ipairs(current_node.links or {}) do if not self.nodes[id].link_directions then self.nodes[id].link_directions = {} end local current_node = self.nodes[id] local other_node = self.nodes[linked_node_id] local dx, dy = current_node.x - other_node.x, current_node.y - other_node.y local direction if math.abs(dx) <= 0.01 and dy > 0 then direction = 'up' end if math.abs(dx) <= 0.01 and dy < 0 then direction = 'down' end if math.abs(dy) <= 0.01 and dx > 0 then direction = 'left' end if math.abs(dy) <= 0.01 and dx < 0 then direction = 'right' end if dx > 0 and dy > 0 then direction = 'left-up' end if dx < 0 and dy > 0 then direction = 'right-up' end if dx > 0 and dy < 0 then direction = 'left-down' end if dx < 0 and dy < 0 then direction = 'right-down' end if direction then self.nodes[id].link_directions[direction] = linked_node_id end end end self.moving_with_kb = true self.selected_kb_node_id = 1 self.keys_alpha = 255 self.timer:after(10, function() self.timer:tween(5, self, {keys_alpha = 0}, 'in-out-cubic') end) self:updateCanBeBoughtNodes() self.buying = false self.refunding = false self.skill_points_to_buy = 0 self.temporary_bought_node_indexes = {} input:unbindAll() input:bind('a', 'left') input:bind('d', 'right') input:bind('w', 'up') input:bind('s', 'down') input:bind('left', 'left') input:bind('right', 'right') input:bind('up', 'up') input:bind('down', 'down') input:bind('mouse1', 'left_click') input:bind('wheelup', 'zoom_in') input:bind('wheeldown', 'zoom_out') input:bind('r1', 'zoom_in') input:bind('l1', 'zoom_out') input:bind('q', 'kb_zoom_in') input:bind('e', 'kb_zoom_out') input:bind('return', 'return') input:bind('backspace', 'backspace') input:bind('escape', 'escape') input:bind('dpleft', 'left') input:bind('dpright', 'right') input:bind('dpup', 'up') input:bind('dpdown', 'down') input:bind('start', 'return') input:bind('fright', 'escape') input:bind('fdown', 'return') input:bind('fleft', 'return') input:bind('fup', 'escape') input:bind('select', 'escape') input:bind('tab', 'tab') input:bind('fleft', 'kb_enter') input:bind('return', 'kb_enter') input:bind('fdown', 'kb_cancel') input:bind('c', 'kb_cancel') input:bind('start', 'kb_apply') input:bind('k', 'kb_apply') self.timer:every(0.2, function() self.area:addGameObject('GlitchDisplacement') self.area:addGameObject('RGBShift') end) self.stats_rectangle_sx, self.stats_rectangle_sy = 0, 0 end function SkillTree:update(dt) self.timer:update(dt) self.area:update(dt) camera.smoother = Camera.smooth.damped(10) if self.moving_with_kb then local node = self.nodes[self.selected_kb_node_id] camera:lockPosition(dt, node.x, node.y) local changeSelectedNode = function(linked_node_id) self.selected_kb_node_id = linked_node_id self.nodes[self.selected_kb_node_id]:enterHot() end local delay = 0.040 for direction, linked_node_id in pairs(node.link_directions) do if direction == 'left-up' and ((input:pressed('left') and input:pressed('up')) or (input:sequence('left', delay, 'up') or input:sequence('up', delay, 'left'))) then self.timer:cancel('kb_left') self.timer:cancel('kb_up') changeSelectedNode(linked_node_id) goto continue elseif direction == 'left-down' and ((input:pressed('left') and input:pressed('down')) or (input:sequence('left', delay, 'down') or input:sequence('down', delay, 'left'))) then self.timer:cancel('kb_left') self.timer:cancel('kb_down') changeSelectedNode(linked_node_id) goto continue elseif direction == 'right-up' and ((input:pressed('right') and input:pressed('up')) or (input:sequence('right', delay, 'up') or input:sequence('up', delay, 'right'))) then self.timer:cancel('kb_right') self.timer:cancel('kb_up') changeSelectedNode(linked_node_id) goto continue elseif direction == 'right-down' and ((input:pressed('right') and input:pressed('down')) or (input:sequence('right', delay, 'down') or input:sequence('down', delay, 'right'))) then self.timer:cancel('kb_right') self.timer:cancel('kb_down') changeSelectedNode(linked_node_id) goto continue end end for direction, linked_node_id in pairs(node.link_directions) do if direction == 'left' and input:pressed('left') then self.timer:after('kb_left', delay, function() changeSelectedNode(linked_node_id) end); goto continue elseif direction == 'right' and input:pressed('right') then self.timer:after('kb_right', delay, function() changeSelectedNode(linked_node_id) end); goto continue elseif direction == 'up' and input:pressed('up') then self.timer:after('kb_up', delay, function() changeSelectedNode(linked_node_id) end); goto continue elseif direction == 'down' and input:pressed('down') then self.timer:after('kb_down', delay, function() changeSelectedNode(linked_node_id) end); goto continue end end for direction, linked_node_id in pairs(node.link_directions) do if direction == 'left-up' and input:pressed('left') then self.timer:after('kb_left', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'left-up' and input:pressed('up') then self.timer:after('kb_up', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'left-down' and input:pressed('left') then self.timer:after('kb_left', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'left-down' and input:pressed('down') then self.timer:after('kb_down', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'right-up' and input:pressed('right') then self.timer:after('kb_right', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'right-up' and input:pressed('up') then self.timer:after('kb_up', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'right-down' and input:pressed('right') then self.timer:after('kb_right', delay, function() changeSelectedNode(linked_node_id) end) elseif direction == 'right-down' and input:pressed('down') then self.timer:after('kb_down', delay, function() changeSelectedNode(linked_node_id) end) end end ::continue:: end if input:pressed('left') or input:pressed('right') or input:pressed('up') or input:pressed('down') or input:pressed('kb_zoom_in') or input:pressed('kb_zoom_out') or input:pressed('kb_enter') or input:pressed('kb_apply') or input:pressed('kb_cancel') then self.moving_with_kb = true end if input:down('left_click') then self.moving_with_kb = false local mx, my = camera:getMousePosition(sx, sy, 0, 0, sx*gw, sy*gh) local dx, dy = mx - self.previous_mx, my - self.previous_my camera:move(-dx/camera.scale, -dy/camera.scale) camera.x, camera.y = math.floor(camera.x), math.floor(camera.y) end self.previous_mx, self.previous_my = camera:getMousePosition(sx, sy, 0, 0, sx*gw, sy*gh) if input:pressed('zoom_in') or input:pressed('kb_zoom_in') then self.timer:tween('zoom', 0.2, camera, {scale = camera.scale + 0.1}, 'in-out-cubic') end if input:pressed('zoom_out') or input:pressed('kb_zoom_out') then self.timer:tween('zoom', 0.2, camera, {scale = camera.scale - 0.1}, 'in-out-cubic') end camera.scale = math.max(0.2, camera.scale) -- Console local pmx, pmy = love.mouse.getPosition() local text = 'CONSOLE' local w = self.font:getWidth(text) local x, y = gw - w - 15, 5 if (pmx >= sx*x and pmx <= sx*(x + w + 10) and pmy >= sy*y and pmy <= sy*(y + 16) and input:pressed('left_click')) or input:pressed('escape') then self:cancel() playMenuBack() gotoRoom('Console') end -- Apply, cancel buttons self.bought_nodes_this_frame = false if self.buying then local pmx, pmy = love.mouse.getPosition() -- Apply local text = 'Apply ' .. self.skill_points_to_buy .. ' Skill Points' local w = self.font:getWidth(text) local x, y = 5, gh - 20 if (pmx >= sx*x and pmx <= sx*(x + w + 10) and pmy >= sy*y and pmy <= sy*(y + 16) and input:pressed('left_click')) or input:pressed('kb_apply') then if self.skill_points_to_buy <= skill_points and #bought_node_indexes <= max_tree_nodes then skill_points = skill_points - self.skill_points_to_buy spent_sp = spent_sp + self.skill_points_to_buy self.skill_points_to_buy = 0 self.buying = false self.temporary_bought_node_indexes = {} playMenuSelect() self:rgbShift() self.bought_nodes_this_frame = true else if #bought_node_indexes > max_tree_nodes then self.cant_buy_error = 'CANT HAVE MORE THAN ' .. max_tree_nodes .. ' NODES' self.timer:after(0.5, function() self.cant_buy_error = false end) self:cancel() playMenuError() self:glitchError() else self.cant_buy_error = 'NOT ENOUGH SKILL POINTS' self.timer:after(0.5, function() self.cant_buy_error = false end) self:cancel() playMenuError() self:glitchError() end end end -- Cancel local x = x + w + 10 + 5 local text = 'Cancel' local w = self.font:getWidth(text) if (pmx >= sx*x and pmx <= sx*(x + w + 10) and pmy >= sy*y and pmy <= sy*(y + 16) and input:pressed('left_click')) or input:pressed('kb_cancel') then playMenuBack() self:cancel() end end for _, node in pairs(self.nodes) do node:update(dt) end for _, line in pairs(self.lines) do line:update(dt) end end function SkillTree:draw() love.graphics.setCanvas(self.glitch_canvas) love.graphics.clear() love.graphics.setColor(color255To1(127, 127, 127)) love.graphics.rectangle('fill', 0, 0, gw, gh) love.graphics.setColor(color255To1(255, 255, 255)) self.area:drawOnly({'glitch'}) love.graphics.setCanvas() love.graphics.setCanvas(self.main_canvas) love.graphics.clear() camera:attach(0, 0, gw, gh) -- Draw grid local grid_w, grid_h = 18000, 18000 local grid_node_w, grid_node_h = 12, 12 local grid_cluster_size = 5 love.graphics.setColor(color255To1(255, 255, 255, 4)) love.graphics.line(0, -grid_h/2, 0, grid_h/2) local n_grid_w, n_grid_h = (grid_w/2)/grid_node_w, (grid_h/2)/grid_node_h local n_big_grid_w, n_big_grid_h = (grid_w/2)/(grid_cluster_size*grid_node_w), (grid_h/2)/(grid_cluster_size*grid_node_h) for i = 1, n_big_grid_w do love.graphics.line(0 - grid_cluster_size*grid_node_w*i, -grid_h/2, 0 - grid_cluster_size*grid_node_w*i, grid_h/2) love.graphics.line(0 + grid_cluster_size*grid_node_w*i, -grid_h/2, 0 + grid_cluster_size*grid_node_w*i, grid_h/2) end love.graphics.setColor(color255To1(255, 255, 255, 2)) for i = 1, n_grid_w do love.graphics.line(0 - grid_node_w*i, -grid_h/2, 0 - grid_node_w*i, grid_h/2) love.graphics.line(0 + grid_node_w*i, -grid_h/2, 0 + grid_node_w*i, grid_h/2) end love.graphics.setColor(color255To1(255, 255, 255, 4)) love.graphics.line(-grid_w/2, 0, grid_w/2, 0) for i = 1, n_big_grid_h do love.graphics.line(-grid_w/2, 0 - grid_cluster_size*grid_node_h*i, grid_w/2, 0 - grid_cluster_size*grid_node_h*i) love.graphics.line(-grid_w/2, 0 + grid_cluster_size*grid_node_h*i, grid_w/2, 0 + grid_cluster_size*grid_node_h*i) end love.graphics.setColor(color255To1(255, 255, 255, 2)) for i = 1, n_grid_h do love.graphics.line(-grid_w/2, 0 - grid_node_h*i, grid_w/2, 0 - grid_node_h*i) love.graphics.line(-grid_w/2, 0 + grid_node_h*i, grid_w/2, 0 + grid_node_h*i) end -- Draw nodes and lines love.graphics.setLineWidth(1/camera.scale) for _, line in pairs(self.lines) do line:draw() end for _, node in pairs(self.nodes) do node:draw() end love.graphics.setLineWidth(1) camera:detach() -- Skill points love.graphics.setColor(color255To1(skill_point_color)) love.graphics.print(skill_points .. 'SP', gw - 20, 28, 0, 1, 1, math.floor(self.font:getWidth(skill_points .. 'SP')/2), math.floor(self.font:getHeight()/2)) -- Nodes if #bought_node_indexes > max_tree_nodes then love.graphics.setColor(color255To1(hp_color)) else love.graphics.setColor(color255To1(default_color)) end love.graphics.print(#bought_node_indexes .. '/' .. max_tree_nodes .. ' NODES BOUGHT', 10, 20, 0, 1, 1, 0, math.floor(self.font:getHeight()/2)) -- Keys local r, g, b = unpack(background_color) love.graphics.setColor(color255To1(r, g, b, self.keys_alpha)) love.graphics.rectangle('fill', 10, gh - 15 - 3 - 18, 18, 18) love.graphics.rectangle('fill', 10 + 18 + 3, gh - 15 - 3 - 18, 18, 18) love.graphics.rectangle('fill', 10 + 36 + 6, gh - 15 - 3 - 18, 18, 18) love.graphics.rectangle('fill', 10 + 18 + 3, gh - 15 - 6 - 36, 18, 18) love.graphics.rectangle('fill', 10 + 36 + 6, gh - 15 - 6 - 36, 18, 18) love.graphics.rectangle('fill', 10, gh - 15 - 6 - 36, 18, 18) love.graphics.rectangle('fill', 10 + 36 + 6 + 18 + 3, gh - 15 - 3 - 18, 32, 18) local r, g, b = unpack(default_color) love.graphics.setColor(color255To1(r, g, b, self.keys_alpha)) love.graphics.rectangle('line', 10, gh - 15 - 3 - 18, 18, 18) love.graphics.rectangle('line', 10 + 18 + 3, gh - 15 - 3 - 18, 18, 18) love.graphics.rectangle('line', 10 + 36 + 6, gh - 15 - 3 - 18, 18, 18) love.graphics.rectangle('line', 10 + 18 + 3, gh - 15 - 6 - 36, 18, 18) love.graphics.rectangle('line', 10 + 36 + 6, gh - 15 - 6 - 36, 18, 18) love.graphics.rectangle('line', 10, gh - 15 - 6 - 36, 18, 18) love.graphics.rectangle('line', 10 + 36 + 6 + 18 + 3, gh - 15 - 3 - 18, 32, 18) pushRotate(10 + 9, gh - 15 - 3 - 9, -math.pi/2) draft:triangleEquilateral(10 + 9, gh - 15 - 3 - 9, 9, 'fill') love.graphics.pop() pushRotate(10 + 9 + 3 + 18, gh - 15 - 3 - 9, math.pi) draft:triangleEquilateral(10 + 9 + 3 + 18, gh - 15 - 3 - 9, 9, 'fill') love.graphics.pop() pushRotate(10 + 9 + 3 + 18 + 3 + 18, gh - 15 - 3 - 9, math.pi/2) draft:triangleEquilateral(10 + 9 + 3 + 18 + 3 + 18, gh - 15 - 3 - 9, 9, 'fill') love.graphics.pop() draft:triangleEquilateral(10 + 9 + 3 + 18, gh - 15 - 3 - 9 - 18 - 3, 9, 'fill') local font = love.graphics.getFont() love.graphics.print('Q', 10 + 9, gh - 15 - 6 - 36 + 9, 0, 1, 1, math.floor(font:getWidth('Q')/2), math.floor(font:getHeight()/2)) love.graphics.print('E', 10 + 36 + 6 + 9, gh - 15 - 6 - 36 + 9, 0, 1, 1, math.floor(font:getWidth('E')/2), math.floor(font:getHeight()/2)) love.graphics.print('ENTER', 10 + 36 + 6 + 18 + 3 + 16, gh - 15 - 6 - 18 + 9 + 3, 0, 1, 1, math.floor(font:getWidth('ENTER')/2), math.floor(font:getHeight()/2)) love.graphics.print('ZOOMIN', 10 + 9, gh - 15 - 6 - 36 - 9, 0, 1, 1, math.floor(font:getWidth('ZOOMIN')/2), math.floor(font:getHeight()/2)) love.graphics.print('ZOOMOUT', 10 + 36 + 6 + 9, gh - 15 - 6 - 36 - 9, 0, 1, 1, math.floor(font:getWidth('ZOOMOUT')/2), math.floor(font:getHeight()/2)) love.graphics.setColor(color255To1(255, 255, 255, 255)) -- Can't buy if self.cant_buy_error then local text = self.cant_buy_error local w = self.font:getWidth(text) local x, y = gw/2 - w/2 - 5, gh/2 - 12 love.graphics.setColor(color255To1(hp_color)) love.graphics.rectangle('fill', x, y, w + 10, 24) love.graphics.setColor(color255To1(background_color)) love.graphics.print(text, math.floor(x + 5), math.floor(y + 8)) end -- Console button local pmx, pmy = love.mouse.getPosition() local text = 'CONSOLE' local w = self.font:getWidth(text) local x, y = gw - w - 15, 5 love.graphics.setColor(color255To1(0, 0, 0, 222)) love.graphics.rectangle('fill', x, y, w + 10, 16) love.graphics.setColor(color255To1(255, 255, 255, 255)) love.graphics.print(text, x + 5, y + 3) if pmx >= sx*x and pmx <= sx*(x + w + 10) and pmy >= sy*y and pmy <= sy*(y + 16) then love.graphics.rectangle('line', x, y, w + 10, 16) end -- Confirm/cancel buttons if self.buying then local pmx, pmy = love.mouse.getPosition() local text = 'Apply ' .. self.skill_points_to_buy .. ' Skill Points' local w = self.font:getWidth(text) local x, y = 5, gh - 20 love.graphics.setColor(color255To1(0, 0, 0, 222)) love.graphics.rectangle('fill', x, y, w + 10, 16) love.graphics.setColor(color255To1(255, 255, 255, 255)) love.graphics.print(text, x + 5, y + 3) if pmx >= sx*x and pmx <= sx*(x + w + 10) and pmy >= sy*y and pmy <= sy*(y + 16) then love.graphics.rectangle('line', x, y, w + 10, 16) end local x = x + w + 10 + 5 local text = 'Cancel' local w = self.font:getWidth(text) love.graphics.setColor(color255To1(0, 0, 0, 222)) love.graphics.rectangle('fill', x, y, w + 10, 16) love.graphics.setColor(color255To1(255, 255, 255, 255)) love.graphics.print(text, x + 5, y + 3) if pmx >= sx*x and pmx <= sx*(x + w + 10) and pmy >= sy*y and pmy <= sy*(y + 16) then love.graphics.rectangle('line', x, y, w + 10, 16) end love.graphics.line(x - 65, y + 13, x - 65 + 5, y + 13) -- K love.graphics.line(x + 5, y + 13, x + 5 + 5, y + 13) -- C end -- Stats rectangle local font = self.font love.graphics.setFont(font) for id, node in pairs(self.nodes) do if ((node.hot or node.exiting_hot) and node.visible) or (self.moving_with_kb and id == self.selected_kb_node_id) then local stats = self.tree[node.id].stats or {} -- Figure out max_text_width to be able to set the proper rectangle width local max_text_width = 0 for i = 1, #stats, 3 do if font:getWidth(stats[i]) > max_text_width then max_text_width = font:getWidth(stats[i]) end end max_text_width = max_text_width + 24 -- Draw rectangle local mx, my = love.mouse.getPosition() if self.moving_with_kb then mx, my = camera:getCameraCoords(node.x, node.y) mx = mx - 1.5*max_text_width my = my + 48 end mx, my = mx/sx, my/sy pushRotateScale(mx + (16 + max_text_width)/2, my + (font:getHeight() + (#stats/3)*font:getHeight())/2, 0, node.stats_rectangle_sx, node.stats_rectangle_sy) love.graphics.setColor(color255To1(0, 0, 0, 222)) love.graphics.rectangle('fill', mx, my, 16 + max_text_width, font:getHeight() + (#stats/3)*font:getHeight()) love.graphics.setColor(color255To1(skill_point_color)) love.graphics.print(node.cost[node.size] .. 'SP', math.floor(mx + 16 + max_text_width - 16), math.floor(my + font:getHeight()), 0, 1, 1, math.floor(self.font:getWidth(node.cost[node.size] .. 'SP')/2), math.floor(self.font:getHeight()/2)) -- Draw text love.graphics.setColor(color255To1(default_color)) for i = 1, #stats, 3 do love.graphics.print(stats[i], math.floor(mx + 8), math.floor(my + font:getHeight()/2 + math.floor(i/3)*font:getHeight())) end love.graphics.pop() end end love.graphics.setColor(color255To1(default_color)) love.graphics.setCanvas() love.graphics.setCanvas(self.temp_canvas) love.graphics.clear() love.graphics.setColor(color255To1(255, 255, 255)) love.graphics.setBlendMode("alpha", "premultiplied") love.graphics.setShader(shaders.glitch) shaders.glitch:send('glitch_map', self.glitch_canvas) love.graphics.draw(self.main_canvas, 0, 0, 0, 1, 1) love.graphics.setShader() love.graphics.setBlendMode("alpha") love.graphics.setCanvas() love.graphics.setCanvas(self.final_canvas) love.graphics.clear() love.graphics.setColor(color255To1(255, 255, 255)) love.graphics.setBlendMode("alpha", "premultiplied") love.graphics.setShader(shaders.rgb_shift) shaders.rgb_shift:send('amount', {random(-self.rgb_shift_mag, self.rgb_shift_mag)/gw, random(-self.rgb_shift_mag, self.rgb_shift_mag)/gh}) love.graphics.draw(self.temp_canvas, 0, 0, 0, 1, 1) love.graphics.setShader() love.graphics.setBlendMode("alpha") love.graphics.setCanvas() if not disable_expensive_shaders then love.graphics.setShader(shaders.distort) shaders.distort:send('time', time) shaders.distort:send('horizontal_fuzz', 0.2*(distortion/10)) shaders.distort:send('rgb_offset', 0.2*(distortion/10)) end love.graphics.setColor(color255To1(255, 255, 255, 255)) love.graphics.setBlendMode('alpha', 'premultiplied') love.graphics.draw(self.final_canvas, 0, 0, 0, sx, sy) love.graphics.setBlendMode('alpha') love.graphics.setShader() end function SkillTree:destroy() end function SkillTree:canNodeBeBought(id) for _, linked_node_id in ipairs(self.tree[id].links) do if fn.any(bought_node_indexes, linked_node_id) then return true end end end function SkillTree:updateCanBeBoughtNodes() for _, node in pairs(self.nodes) do node.can_be_bought = false end for _, bought_node_index in ipairs(bought_node_indexes) do for _, linked_node_id in ipairs(self.tree[bought_node_index].links) do self.nodes[linked_node_id].can_be_bought = true end end for _, node in pairs(self.nodes) do if node.bought then node.can_be_bought = false end end end function SkillTree:cancel() self.skill_points_to_buy = 0 self.buying = false bought_node_indexes = fn.difference(bought_node_indexes, self.temporary_bought_node_indexes) self.temporary_bought_node_indexes = {} for _, node in pairs(self.nodes) do node:updateStatus() end self:updateCanBeBoughtNodes() end function SkillTree:getNumberOfBoughtNeighbors(id) local n = 0 for _, linked_node_id in ipairs(self.tree[id].links) do if fn.any(bought_node_indexes, linked_node_id) then n = n + 1 end end return n end function SkillTree:getBoughtNeighbors(id) local bought_neighbors = {} for _, linked_node_id in ipairs(self.tree[id].links) do if fn.any(bought_node_indexes, linked_node_id) then table.insert(bought_neighbors, linked_node_id) end end return bought_neighbors end function SkillTree:isBoughtNeighbor(id, neighbor_id) for _, linked_node_id in ipairs(self.tree[id].links) do if fn.any(bought_node_indexes, linked_node_id) and linked_node_id == neighbor_id then return true end end end function SkillTree:isNodeReachableWithout(id, without_id) local bought_nodes_without_id = fn.select(bought_node_indexes, function(_, value) return value ~= without_id end) local result = self:reachNodeFrom(1, id, {}, table.copy(bought_nodes_without_id)) return result end function SkillTree:reachNodeFrom(start_id, target_id, explored_nodes, node_pool) local stack = {} table.insert(stack, 1, start_id) local current_node = nil repeat current_node = table.remove(stack, 1) if not fn.any(explored_nodes, current_node) then table.insert(explored_nodes, current_node) for _, linked_node_id in ipairs(self.tree[current_node].links) do if fn.any(node_pool, linked_node_id) then table.insert(stack, 1, linked_node_id) end end end until current_node == target_id or #stack == 0 if current_node == target_id then return true end end function SkillTree:rgbShift() self.rgb_shift_mag = random(2, 4) self.timer:tween('rgb_shift', 0.25, self, {rgb_shift_mag = 0}, 'in-out-cubic') end function SkillTree:glitch(x, y) for i = 1, 6 do self.timer:after(0.1*i, function() self.area:addGameObject('GlitchDisplacement', x + random(-32, 32), y + random(-32, 32)) end) end end function SkillTree:glitchError() for i = 1, 10 do self.timer:after(0.1*i, function() self.area:addGameObject('GlitchDisplacement') end) end self.rgb_shift_mag = random(4, 8) self.timer:tween('rgb_shift', 1, self, {rgb_shift_mag = 0}, 'in-out-cubic') end
--[[ Copyright (c) 2014 Juan Carlos González Amestoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]] local dsk=require('rvm.decoders.dsk') local path=require('h.io.path') local id=require('rvm.parsers.id').parser return { name='mountDisk', abbr='md', --g=g, doCmd=function(self,cs,p,selfPtr) local n,pos=id:match(p) if not n then cs.red('Error: Sintax Error.') return 0 end if diskCache[n] then cs.red('Error: Disk already mounted in slot "').white('%s',n).red('"\n') return 0 end return function(filename) --print(path) local pt=ffi.C.rvmCommandAddDisc(selfPtr,filename) diskCache[n]={name=n,ptr=pt,filename=path.filename(filename),path=filename} cs.lime('Disk mounted in slot "').white('%s',n).lime('"\n') end ,{'dsk'} ,1 end }
local book = SILE.require("book", "classes") SILE.require("packages/cropmarks") book:loadPackage("masters") book:defineMaster({ id="right", firstContentFrame="content", frames={ content = { left="0", right="100%pw", top="0", bottom="top(folio)" }, folio = { left="left(content)", right="right(content)", height="10pt", bottom="100%ph"} }}) book:defineMaster({ id="left", firstContentFrame="content", frames={} }) book:loadPackage("twoside", { oddPageMaster="right", evenPageMaster="left" }) book:mirrorMaster("right", "left") SILE.call("switch-master-one-page", { id="right" }) SILE.registerCommand("printPaperInPoints", function() SILE.typesetter:typeset(("%.0fpt × %.0fpt"):format(SILE.toPoints("100%ph"), SILE.toPoints("100%pw"))) end)
local ReplicatedFirst = import("./ReplicatedFirst") describe("instances.ReplicatedFirst", function() it("should instantiate", function() local instance = ReplicatedFirst:new() assert.not_nil(instance) end) end)
local InvalidInputColor = Color3.new(1, 0, 0) local InvalidInputTransparency = 0.5 local ValidInputColor = Color3.new(0, 0, 0) local ValidInputTransparency = 0.8 local EnabledButtonColor = Color3.fromRGB(47, 165, 255) local DisabledButtonColor = Color3.fromRGB(150, 150, 150) local SelectionService = game:GetService("Selection") local InputWrapper = {} function InputWrapper.WrapTextual(inputObject, verifier) local box = inputObject.Input local errorReason = inputObject.ErrorReason local returnState = { Valid = true; Value = box.Text; } local function Update() local valid, reason = verifier(box.Text) local color = valid and ValidInputColor or InvalidInputColor local transparency = valid and ValidInputTransparency or InvalidInputTransparency box.BorderColor3 = color box.Shadow.BackgroundColor3 = color box.BackgroundTransparency = transparency box.Shadow.BackgroundTransparency = transparency errorReason.Visible = not valid if not valid then errorReason.Text = reason end returnState.Valid = valid returnState.Value = box.Text end box.FocusLost:Connect(Update) function returnState.SetValue(value) box.Text = value Update() end return returnState end function InputWrapper.WrapEnumerated(inputObject, values, startingIndex) local downButton = inputObject.Down local upButton = inputObject.Up local valueDisplay = inputObject.Value local index = startingIndex local returnState = { Value = values[startingIndex]; } local function Update() valueDisplay.Text = values[index] returnState.Value = values[index] end -- Simple functor. local function ButtonConnector(increment) return function() index = index + increment -- Wrap around if we've overshot the array. if index < 1 then index = #values elseif index > #values then index = 1 end Update() end end -- Update once to set the GUI into a known state. Update() downButton.MouseButton1Click:Connect(ButtonConnector(-1)) upButton.MouseButton1Click:Connect(ButtonConnector(1)) return returnState end function InputWrapper.WrapCloneLocation(inputObject, defaultObject) local setButton = inputObject.SetButton local valueDisplay = inputObject.Value local returnState = { Value = defaultObject; } local function ChangeSelection(object) valueDisplay.Text = object:GetFullName() returnState.Value = object end -- Not declared as an anonymous function to allow initializing the GUI local function UpdateButton() local valid = #SelectionService:Get() == 1 setButton.Active = valid setButton.AutoButtonColor = valid setButton.BackgroundColor3 = valid and EnabledButtonColor or DisabledButtonColor end SelectionService.SelectionChanged:Connect(UpdateButton) setButton.MouseButton1Click:Connect(function() -- Active doesn't stop input events. if setButton.Active and #SelectionService:Get() == 1 then ChangeSelection(SelectionService:Get()[1]) end end) ChangeSelection(defaultObject) UpdateButton() return returnState end return InputWrapper
--local hostIP = "hostIP" -- Your cloud host IP local appKey = "0000000-0000-0000-0000-0000000000" -- Your cloud app ke local appName = "echo" -- Your app name local data = require("data") local json = require("json") -- Require and initialize your Coronium LS Cloud local coronium = require('coronium.cloud') local cloud = coronium:new( { host = data.hostIP, app_key = appKey, is_local = false, -- true when working on a local server, false when on AWS/DigitalOcean https = true -- false when working on a local server, true when on AWS/DigitalOcean }) local function check(event) if event.phase == "ended" then local response = event.response print( "check" ) print( "------------------" ) print(json.encode(event)) print("-------------------") end end local function check1(event) if event.phase == "ended" then local response = event.response print( "check1" ) print( "------------------" ) print(json.encode(event)) print("-------------------") end end cloud:request("/" .. appName .. "/test", { name = "bob", }, check) local enterPhoneText = display.newText( "Phone Number", display.contentCenterX, display.contentCenterY-140, native.systemFont ) local enterPhone = native.newTextField( display.contentCenterX, display.contentCenterY-100, 200, 50 ) enterPhone.inputType = "number" enterPhone:addEventListener( "userInput", function ( e ) if (e.phase == "submitted") then native.setKeyboardFocus( nil ) end end ) local submitButton = display.newGroup( ) submitButton.box = display.newRect( submitButton, 0,0, 100, 50 ) submitButton.box:addEventListener( "tap", function ( ) print(enterPhone.text) cloud:request("/" .. appName .. "/sendUS", { number = enterPhone.text, message= "hello from coronium ls", }, check1) end ) submitButton.myText = display.newText( submitButton, "Text", 0,0, native.systemFont, 15 ) submitButton.myText:setFillColor( 0 ) submitButton.x, submitButton.y = display.contentCenterX, display.contentCenterY
local path = minetest.get_modpath("player").."/" dofile(path.."hand_removal.lua") dofile(path.."climbing_mechanic.lua") dofile(path.."player_model.lua") dofile(path.."hud_handling.lua") dofile(path.."stats.lua") dofile(path.."modifiers.lua") dofile(path.."physics_modifications.lua") dofile(path.."dig_anti_cheat.lua") dofile(path.."item_drop_override.lua") dofile(path.."inventory_adjustments.lua") dofile(path.."disable_engine_inventory.lua") dofile(path.."inventory_management.lua")
return { PlaceObj("ModItemOptionToggle", { "name", "IgnoreSpec", "DisplayName", T(302535920011473, "Override Existing Spec"), "Help", T(302535920011539, "If colonist is already a specialist it will be replaced."), "DefaultValue", false, }), PlaceObj("ModItemOptionNumber", { "name", "SolsToTrain", "DisplayName", T(302535920011474, "Sols To Train"), "Help", T(302535920011540, "How many Sols of working does it take to get a spec."), "DefaultValue", 25, "MinValue", 1, "MaxValue", 250, }), }
--[[ Made by Megumu#8008 <3 ]] local t=string.byte;local f=string.char;local c=string.sub;local A=table.concat;local s=math.ldexp;local F=getfenv or function()return _ENV end;local l=setmetatable;local i=select;local r=unpack;local h=tonumber;local function u(t)local e,o,d="","",{}local n=256;local a={}for l=0,n-1 do a[l]=f(l)end;local l=1;local function r()local e=h(c(t,l,l),36)l=l+1;local o=h(c(t,l,l+e-1),36)l=l+e;return o end;e=f(r())d[1]=e;while l<#t do local l=r()if a[l]then o=a[l]else o=e..c(e,1,1)end;a[n]=e..c(o,1,1)d[#d+1],e,n=o,o,n+1 end;return table.concat(d)end;local a=u('1V1U2752761U1N2771F27623C23B23023F23H23623B23H23923E23F22Y27G22Y2352301U1G27627H27J23921T27M27O23H27Q2302742771U26M1X1U1Q27623D23J23723F1U1K27622H27N22523F23022W27J28G1P27622623623J22V28N2311U1L27622A23523H23J23628U28W28N28A27622D27X1U1E27622521S21Y21Q21K21Q22623023527Q21Q22922822A21Z1V162761P1M26M2691W1M2751R21Q27521F2A824E1U162A221729Y24E2A02A22A427528I27521I2761O1E29G21N29G27522U2AF22U1U2AI1E2AK2AV1R2AP1U21F2AP2AC21Q2AF2AB1P2B22A32AV2AN1U2B61U1H2AE26921J29Y1U1O162AT2BQ1U2122AF2122B01P2BB2A32A82BR1M2261U21E2A52BL21A2A221A21A2752BS2A821A2BQ1O1M2321U21A2CA2CL2AC2CP2751H22E2CD22E2CG2BT2CO2BQ1S2CA21P2CA2CA2CG27623B23223J27E28Z28B27528D28F28H28J28L28N28P23H28G27927522127R2392312DB2DO27827622G23023J23D28F23422Y28Z29127528K22Y22L23A23B23623E27F2341U2D722L23022V23122Y29628Z1J27622L27I27K22I27N27P27R1U1C2761T2872692892752AJ2692112CA1L2BF21A2BH1E2CF2FF2751D2C221A2C41K162CI2BQ1K1E2C72FJ28H1E23I2CO2FG2752FW1O1U22M2CO2772BN2CJ2B0142762BK1021I2CN21G2B6102122AC21G2BZ1U142AS1U2AU2D82A821027725Y2692692172GY22P2D32752D5275');local n=bit and bit.bxor or function(l,e)local o,n=1,0 while l>0 and e>0 do local c,a=l%2,e%2 if c~=a then n=n+o end l,e,o=(l-c)/2,(e-a)/2,o*2 end if l<e then l=e end while l>0 do local e=l%2 if e>0 then n=n+o end l,o=(l-e)/2,o*2 end return n end local function e(e,l,o)if o then local l=(e/2^(l-1))%2^((o-1)-(l-1)+1);return l-l%1;else local l=2^(l-1);return(e%(l+l)>=l)and 1 or 0;end;end;local l=1;local function o()local a,o,c,e=t(a,l,l+3);a=n(a,30)o=n(o,30)c=n(c,30)e=n(e,30)l=l+4;return(e*16777216)+(c*65536)+(o*256)+a;end;local function d()local e=n(t(a,l,l),30);l=l+1;return e;end;local function u()local l=o();local o=o();local c=1;local n=(e(o,1,20)*(2^32))+l;local l=e(o,21,31);local e=((-1)^e(o,32));if(l==0)then if(n==0)then return e*0;else l=1;c=0;end;elseif(l==2047)then return(n==0)and(e*(1/0))or(e*(0/0));end;return s(e,l-1023)*(c+(n/(2^52)));end;local s=o;local function h(e)local o;if(not e)then e=s();if(e==0)then return'';end;end;o=c(a,l,l+e-1);l=l+e;local e={}for l=1,#o do e[l]=f(n(t(c(o,l,l)),30))end return A(e);end;local l=o;local function f(...)return{...},i('#',...)end local function C()local t={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};local l={0};local c={};local a={t,nil,l,nil,c};for e=1,o()do l[e-1]=C();end;local l=o()local c={0,0,0,0,0,0,0,0,0};for o=1,l do local e=d();local l;if(e==2)then l=(d()~=0);elseif(e==1)then l=u();elseif(e==0)then l=h();end;c[o]=l;end;a[2]=c a[4]=d();for a=1,o()do local c=n(o(),2);local o=n(o(),48);local n=e(c,1,2);local l=e(o,1,11);local l={l,e(c,3,11),nil,nil,o};if(n==0)then l[3]=e(c,12,20);l[5]=e(c,21,29);elseif(n==1)then l[3]=e(o,12,33);elseif(n==2)then l[3]=e(o,12,32)-1048575;elseif(n==3)then l[3]=e(o,12,32)-1048575;l[5]=e(c,21,29);end;t[a]=l;end;return a;end;local function B(l,e,s)local e=l[1];local n=l[2];local o=l[3];local l=l[4];return function(...)local t=e;local d=n;local U=o;local n=l;local u=f local o=1;local f=-1;local h={};local c={...};local a=i('#',...)-1;local l={};local e={};for l=0,a do if(l>=n)then h[l-n]=c[l+1];else e[l]=c[l+1];end;end;local l=a-n+1 local l;local n;while true do l=t[o];n=l[1];if n<=14 then if n<=6 then if n<=2 then if n<=0 then o=o+l[3];elseif n>1 then local n=l[2];local a={};local o=0;local c=f;for l=n+1,c do o=o+1;a[o]=e[l];end;local c={e[n](r(a,1,c-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;f=l;else local n=l[2];local c={};local o=0;local l=n+l[3]-1;for l=n+1,l do o=o+1;c[o]=e[l];end;local c,l=u(e[n](r(c,1,l-n)));l=l+n-1;o=0;for l=n,l do o=o+1;e[l]=c[o];end;f=l;end;elseif n<=4 then if n==3 then local n=l[2];local o=e[l[3]];e[n+1]=o;e[n]=o[d[l[5]]];else do return end;end;elseif n==5 then o=o+l[3];else e[l[2]]=d[l[3]];end;elseif n<=10 then if n<=8 then if n==7 then local n=l[2];local a=l[5];local l=n+2;local c={e[n](e[n+1],e[l])};for o=1,a do e[l+o]=c[o];end;local n=e[n+3];if n then e[l]=n else o=o+1;end;else local n=l[2];local o=e[l[3]];e[n+1]=o;e[n]=o[d[l[5]]];end;elseif n==9 then e[l[2]]=e[l[3]];else local n=l[2];local a=l[5];local l=n+2;local c={e[n](e[n+1],e[l])};for o=1,a do e[l+o]=c[o];end;local n=e[n+3];if n then e[l]=n else o=o+1;end;end;elseif n<=12 then if n==11 then local n,n;local A;local a;local c;local i;local h;local n;e[l[2]]=s[d[l[3]]];o=o+1;l=t[o];e[l[2]]=s[d[l[3]]];o=o+1;l=t[o];n=l[2];h=e[l[3]];e[n+1]=h;e[n]=h[d[l[5]]];o=o+1;l=t[o];e[l[2]]=d[l[3]];o=o+1;l=t[o];n=l[2];i={};c=0;a=n+l[3]-1;for l=n+1,a do c=c+1;i[c]=e[l];end;A={e[n](r(i,1,a-n))};a=n+l[5]-2;c=0;for l=n,a do c=c+1;e[l]=A[c];end;f=a;o=o+1;l=t[o];e[l[2]]=e[l[3]][d[l[5]]];o=o+1;l=t[o];n=l[2];h=e[l[3]];e[n+1]=h;e[n]=h[d[l[5]]];o=o+1;l=t[o];n=l[2];i={};c=0;a=n+l[3]-1;for l=n+1,a do c=c+1;i[c]=e[l];end;A,a=u(e[n](r(i,1,a-n)));a=a+n-1;c=0;for l=n,a do c=c+1;e[l]=A[c];end;f=a;o=o+1;l=t[o];n=l[2];i={};c=0;a=f;for l=n+1,a do c=c+1;i[c]=e[l];end;A={e[n](r(i,1,a-n))};a=n+l[5]-2;c=0;for l=n,a do c=c+1;e[l]=A[c];end;f=a;o=o+1;l=t[o];o=o+l[3];else if e[l[2]]then o=o+1;else o=o+l[3];end;end;elseif n==13 then e[l[2]]=B(U[l[3]],nil,s);else e[l[2]]=s[d[l[3]]];end;elseif n<=21 then if n<=17 then if n<=15 then e[l[2]]=B(U[l[3]],nil,s);elseif n>16 then e[l[2]]=e[l[3]][d[l[5]]];else local n=l[2];local a={};local o=0;local c=n+l[3]-1;for l=n+1,c do o=o+1;a[o]=e[l];end;local c={e[n](r(a,1,c-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;f=l;end;elseif n<=19 then if n>18 then do return end;else local o=l[2];local c={};local n=0;local l=o+l[3]-1;for l=o+1,l do n=n+1;c[n]=e[l];end;e[o](r(c,1,l-o));f=o;end;elseif n==20 then local n=l[2];local c={};local o=0;local l=n+l[3]-1;for l=n+1,l do o=o+1;c[o]=e[l];end;local c,l=u(e[n](r(c,1,l-n)));l=l+n-1;o=0;for l=n,l do o=o+1;e[l]=c[o];end;f=l;else local o=l[2];local c={};local n=0;local l=o+l[3]-1;for l=o+1,l do n=n+1;c[n]=e[l];end;e[o](r(c,1,l-o));f=o;end;elseif n<=25 then if n<=23 then if n>22 then local n=l[2];local c={};local o=0;local a=n+l[3]-1;for l=n+1,a do o=o+1;c[o]=e[l];end;local c={e[n](r(c,1,a-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;f=l;else e[l[2]]=s[d[l[3]]];end;elseif n>24 then e[l[2]]=d[l[3]];else e[l[2]]=e[l[3]];end;elseif n<=27 then if n>26 then local n=l[2];local a={};local o=0;local c=f;for l=n+1,c do o=o+1;a[o]=e[l];end;local c={e[n](r(a,1,c-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;f=l;else e[l[2]]=e[l[3]][d[l[5]]];end;elseif n==28 then local s;local a;local c;local h;local i;local n;n=l[2];i=e[l[3]];e[n+1]=i;e[n]=i[d[l[5]]];o=o+1;l=t[o];e[l[2]]=d[l[3]];o=o+1;l=t[o];n=l[2];h={};c=0;a=n+l[3]-1;for l=n+1,a do c=c+1;h[c]=e[l];end;s={e[n](r(h,1,a-n))};a=n+l[5]-2;c=0;for l=n,a do c=c+1;e[l]=s[c];end;f=a;o=o+1;l=t[o];e[l[2]]=e[l[3]][d[l[5]]];o=o+1;l=t[o];n=l[2];i=e[l[3]];e[n+1]=i;e[n]=i[d[l[5]]];o=o+1;l=t[o];e[l[2]]=d[l[3]];o=o+1;l=t[o];n=l[2];h={};c=0;a=n+l[3]-1;for l=n+1,a do c=c+1;h[c]=e[l];end;e[n](r(h,1,a-n));f=n;else if e[l[2]]then o=o+1;else o=o+l[3];end;end;o=o+1;end;end;end;return B(C(),{},F())();
-- Requiring Libs Object = require 'libs.classic'; push = require 'libs.push'; -- Requiring Classes require 'Classes.bird'; require 'Classes.pipe'; -- Global Variables windowWidth = 630; windowHeight = 720; virtualWidth = 340; virtualHeight = 388; score = 0; highScore = 0; function love.load() -- Removes Bilinear Filter love.graphics.setDefaultFilter('nearest', 'nearest'); -- Randomize math.randomseed(os.time()); listOfPipes = {}; resetGame(); -- Sets font pixelFont = love.graphics.newFont('fonts/kongtext.ttf', 8); -- Screen Setup with virtual resolutions from push lib push:setupScreen(virtualWidth, virtualHeight, windowWidth, windowHeight, { fullscreen = false, resizable = false, vsync = true }); -- "Can Count Score = True" nextPipe = 1; end function love.update(dt) -- Updates Birbs n' Pipes Birb:update(dt); -- For each pipe in the listOfPipes table for i, pipe in ipairs(listOfPipes) do pipe:update(dt); -- Updates the Pipe pipe:checkCollision(Birb); -- Checks Collision and Birb Offscreen if pipe.dead then -- If the pipe is offscreen table.remove(listOfPipes, i); -- Destroy it if nextPipe == 2 then -- If the score has already been added nextPipe = 1; -- Resets the NextPipe "Boolean" end end if Birb.x > listOfPipes[1].x + listOfPipes[1].width -- Checks Next Pipe Position and nextPipe == 1 then -- If the previous pipe has been destroyed score = score + 1; -- Counts only 1+ to the score nextPipe = 2; -- NextPipe "Boolean = false" end end end function love.keypressed(key) -- Handles Single Key Presses if key == 'escape' then love.event.quit() else Birb:keypressed(key); end end --[[ function love.touchpressed() Birb:keypressed(); end ]] function love.draw(dt) push:start(); -- Starts Push Rendering -- Background Color love.graphics.clear(.14, .36, .46, 1) -- Birb Draw Event Birb:draw(dt); -- Draw Pipes for i, pipe in ipairs(listOfPipes) do pipe:draw(dt); end -- Ui Text love.graphics.setFont(pixelFont); love.graphics.setColor(1, 1, 1, 1); love.graphics.printf("Score: " .. score, 0, 10, virtualWidth, 'left'); love.graphics.printf("Highscore: " .. highScore, 0, 20, virtualWidth, 'left'); push:finish(); -- Ends Push rendering end function resetGame() -- Deletes existing pipes for i, pipe in ipairs(listOfPipes) do table.remove(listOfPipes, i); end -- Recreates the Birb and the Pipes Birb = Bird(62, 200, 30, 25); listOfPipes = {}; table.insert(listOfPipes, Pipe(virtualWidth, 0, 54, virtualHeight)); table.insert(listOfPipes, Pipe(virtualWidth + ((virtualWidth + 54) / 2), 0, 54, virtualHeight)); -- Sets Highscore if score > highScore then highScore = score score = 0; end -- Resets canScoreCounter nextPipe = 1; end
local login = require "snax.loginserver" local crypt = require "lovesnow.crypt" local ls = require "lovesnow" local server = { host = "127.0.0.1", port = 8001, multilogin = false, -- disallow multilogin name = "login_master", } local server_list = {} local user_online = {} local user_login = {} function server.auth_handler(token) -- the token is base64(user)@base64(server):base64(password) local user, server, password = token:match("([^@]+)@([^:]+):(.+)") user = crypt.base64decode(user) server = crypt.base64decode(server) password = crypt.base64decode(password) assert(password == "password", "Invalid password") return server, user end function server.login_handler(server, uid, secret) print(string.format("%s@%s is login, secret is %s", uid, server, crypt.hexencode(secret))) local gameserver = assert(server_list[server], "Unknown server") -- only one can login, because disallow multilogin local last = user_online[uid] if last then ls.call(last.address, "lua", "kick", uid, last.subid) end if user_online[uid] then error(string.format("user %s is already online", uid)) end local subid = tostring(ls.call(gameserver, "lua", "login", uid, secret)) user_online[uid] = { address = gameserver, subid = subid , server = server} return subid end local CMD = {} function CMD.register_gate(server, address) server_list[server] = address end function CMD.logout(uid, subid) local u = user_online[uid] if u then print(string.format("%s@%s is logout", uid, u.server)) user_online[uid] = nil end end function server.command_handler(command, ...) local f = assert(CMD[command]) return f(...) end login(server)
--[[========================================= _ _ _ | | | | | | /\ /\ | | | | | | / \ _ __ _ __ / \ _ __ ___ | | | | | |/ /\ \ | '_ \| '_ \ / /\ \ | '__/ __| | |___| |__| / ____ \| |_) | |_) / ____ \| | | (__ |______\____/_/ \_\ .__/| .__/_/ \_\_| \___| Scripting Project | | | | Improved LUA Engine |_| |_| SVN: http://svn.burning-azzinoth.de/LUAppArc LOG: http://luapparc.burning-azzinoth.de/trac/timeline TRAC: http://luapparc.burning-azzinoth.de/trac ---------------------- Original Code by DARKI Version 1 ========================================]]-- function Gahz_Frostbreath(pUnit, event) print "Gahz_Frostbreath initiated..." pUnit:FullCastSpell(16099) pUnit:RegisterEvent("Gahz_Frostbreath", math.random(22000, 26000), 1) end function Gahz_Slam(pUnit, event) print "Gahz_Slam initiated..." pUnit:FullCastSpell(24326) end function Gahz_OnEnterCombat(pUnit, event) print "Gahz_Aggro initiated..." pUnit:RegisterEvent("Gahz_Frostbreath", math.random(16000, 20000), 1) pUnit:RegisterEvent("Gahz_Slam", 25000, 0) end RegisterUnitEvent(15114, 1, "Gahz_OnEnterCombat") function Gahz_OnWipe(pUnit, event) print "Gahz_Wipe initiated..." pUnit:RemoveEvents() end RegisterUnitEvent(15114, 2, "Gahz_OnWipe") function Gahz_OnDie(pUnit, event) print "Gahz_Dies initiated..." pUnit:RemoveEvents() end RegisterUnitEvent(15114, 4, "Gahz_OnDie")
print("begin gui/type0Creator") print("type0Creator") local guiDialog = bin_types.gui.guiDialog -- now define the dialog local type0Dialog = {} function type0Dialog:onCreate() guiDialog.onCreate(self) print("type0Dialog::onCreate", self:getID()) return true end -- define the creator function gui.type0(ui) local newDialog = gui.newDialog() if newDialog == nil or not newDialog:imported() then return nil end local dialogDef = type0Dialog do newDialog.onCreate = dialogDef.onCreate end if gui.loadDialog(newDialog, ui) ~= 1 then newDialog = nil end return newDialog end print("type1Creator") -- Inheriget from type0 local type1Dialog = {} function type1Dialog:onCreate() local super = type0Dialog if not super.onCreate(self) then print("type0Dialog::onCreate false", self:getID()) return false end print("type1Dialog::onCreate", self:getID()) return true end function gui.type1(ui) local newDialog = gui.newDialog() if newDialog == nil or not newDialog:imported() then return nil end local dialogDef = type1Dialog do newDialog.onCreate = dialogDef.onCreate end if gui.loadDialog(newDialog, ui) ~= 1 then newDialog = nil end return newDialog end print("end gui/type0Creator")
require "lunit" module(..., lunit.testcase, package.seeall) local serializer = require "xauxi.serialize" function test_serialize_not_a_table() assert_error("Not a session table", function() serializer.serialize("not a table") end) end function test_serialize_empty_table() assert_equal("{}", serializer.serialize({})) end function test_serialize_one_int_entry() assert_equal("{1}", serializer.serialize({1})) end function test_serialize_int_entris() assert_equal("{1,2,3,4}", serializer.serialize({1,2,3,4})) end function test_serialize_strings() assert_equal("{\"foo\",\"bar\"}", serializer.serialize({"foo","bar"})) end function test_serialize_strings_and_ints() assert_equal("{\"foo\",1,\"bar\",10,122}", serializer.serialize({"foo",1,"bar",10,122})) end function test_serialize_table_in_table() assert_equal("{{}}", serializer.serialize({{}})) end function test_serialize_many_tables() assert_equal("{{},{},{},{}}", serializer.serialize({{},{},{},{}})) end function test_serialize_tables_ints_strings() assert_equal("{{1,2,3},{\"foo\",\"bar\",\"bla\"},{1,\"bar\",20},{}}", serializer.serialize({{1,2,3},{"foo","bar","bla"},{1,"bar",20},{}})) end function test_serialize_named_pair() assert_equal("{foo=\"bar\"}", serializer.serialize({foo="bar"})) end function test_serialize_mixed() --not the same order, as key value paris are hashed unsorted --maybe this test can fail in the future, if hashing changes assert_equal("{1,2,3,t={1,2,bla=\"fasel\"},foo=\"bar\"}", serializer.serialize({foo="bar",1,2,3,t={1,2,bla="fasel"}})) end function test_deserialize() local t = serializer.deserialize("{1,2,3,foo=\"bar\"}") assert_equal("bar", t.foo) assert_equal(1, t[1]) assert_equal(2, t[2]) assert_equal(3, t[3]) end
#!/usr/bin/env luajit require 'ext' local env = setmetatable({}, {__index=_G}) if setfenv then setfenv(1, env) else _ENV = env end require 'symmath'.setup{env=env, MathJax={title='Acoustic Black Hole', usePartialLHSForDerivative=true}} local chart = Tensor.Chart{coords={'0', 'xyz'}} local greekSymbols = require 'symmath.tensor.symbols'.greekSymbolNames -- :sort(function(a,b) return a < b end) :filter(function(s) return s:match'^[a-z]' end) -- lowercase :mapi(function(s) return '\\'..s end) -- append \ to the beginning for LaTeX Tensor.defaultSymbols = table{'i','j','k','l','m','n'} local alpha = var'\\alpha' local beta = var'\\beta' local gamma = var'\\gamma' local delta = var'\\delta' local conn3 = var'\\Gamma' local conn4 = var'\\hat{\\Gamma}' local g = var'g' local n = var'n' local K = var'K' local c = var'c' local v = var'v' local gLL = Tensor('_ab', {-alpha^2 + beta'^k' * beta'_k', beta'_j'}, {beta'_i', gamma'_ij'} ) printbr(g'_ab':eq(gLL), '= ADM metric') local gUU = Tensor('^ab', {-1/alpha^2, beta'^j' / alpha^2}, {beta'^i' / alpha^2, gamma'^ij' - beta'^i' * beta'^j' / alpha^2} ) printbr(g'^ab':eq(gUU), '= ADM metric inverse') local gLU = ( gLL'_ac':reindex{j='k'} * gUU'^cb':reindex{i='k'} )() :replaceIndex( beta'_i', beta'^j' * gamma'_ij' )():tidyIndexes()() :symmetrizeIndexes(gamma, {1,2}) :replace(gamma'^jm' * gamma'_im', delta'_i^j') :replace(beta'^i' * delta'_i^j', beta'^j')() printbr((g'_ac' * g'^cb'):eq(gLU)) printbr() printbr[[wave equation of a scalar field (from my 'wave equation in spacetime' symmath worksheet)]] local f = var'f' local Phi = var'\\Phi' local partial00_Phi_def = Phi'_,00':eq( -alpha^2 * Phi'_,0' * conn4'^0' + alpha^2 * Phi'_,ij' * gamma'^ij' - alpha^2 * Phi'_,i' * conn4'^i' + 2 * beta'^i' * Phi'_,0i' - beta'^i' * beta'^j' * Phi'_,ij' - f * alpha^2 ) printbr(partial00_Phi_def) local conn4_0_U_def = conn4'^0':eq(-frac(1, alpha^3) * (alpha'_,0' - beta'^k' * alpha'_,k' + alpha^2 * K)) printbr(conn4_0_U_def) local conn4_i_U_def = conn4'^i':eq(conn3'^i' + frac(1, alpha^3) * beta'^i' * (alpha'_,0' - beta'^k' * alpha'_,k' + alpha^2 * K) - frac(1, alpha^2) * (beta'^i_,0' - beta'^k' * beta'^i_,k' + alpha * alpha'_,j' * gamma'^ij')) printbr(conn4_i_U_def) partial00_Phi_def = partial00_Phi_def:subst(conn4_0_U_def, conn4_i_U_def ) partial00_Phi_def = partial00_Phi_def:simplifyAddMulDiv() printbr(partial00_Phi_def) printbr() printbr'<hr>' printbr[[2012 Visser acoustic black hole metric]] local gUUab1 = Tensor('^ab', {-1/c^2, -v'^j' / c^2}, {-v'^i' / c^2, delta'^ij' - v'^i' * v'^j' / c^2} ) printbr(g'^ab':eq(gUUab1)) local ab1_alpha_def = gUU[1][1]:eq(gUUab1[1][1]) printbr(ab1_alpha_def) ab1_alpha_def = ab1_alpha_def:solve(alpha) printbr(ab1_alpha_def) printbr() local ab1_betaU_def = gUU[2][1]:eq(gUUab1[2][1]) printbr(ab1_betaU_def) ab1_betaU_def = ab1_betaU_def:subst(ab1_alpha_def):solve(beta'^i') printbr(ab1_betaU_def) printbr() local ab1_gammaUU_def = gUU[2][2]:eq(gUUab1[2][2]) printbr(ab1_gammaUU_def) ab1_gammaUU_def = ab1_gammaUU_def :subst(ab1_alpha_def) :substIndex(ab1_betaU_def) :solve(gamma'^ij') printbr(ab1_gammaUU_def) printbr() -- TODO manually assuming ab1_gammaUU_def is gamma^ij = delta^ij ... local ab1_gammaLL_def = gamma'_ij':eq(delta'_ij') printbr(ab1_gammaLL_def) printbr() -- TODO manually assuming ab1_gammaUU_def is gamma^ij = delta^ij ... printbr(beta'_i':eq(gamma'_ij' * beta'^j'):eq(ab1_betaU_def:rhs():reindex{i='j'} * ab1_gammaLL_def:rhs())) printbr[[Using convention $v_i = \delta_{ij} v^j$]] local ab1_betaL_def = beta'_i':eq(-v'_i') printbr('So',ab1_betaL_def) printbr() local ab1_gLL = gLL :subst(ab1_alpha_def) :substIndex(ab1_betaU_def) :substIndex(ab1_betaL_def) :subst(ab1_gammaLL_def) () printbr(g'_ab':eq(ab1_gLL)) printbr() printbr[[$\gamma_{ij} = \delta_{ij}$, so $\Gamma_{ijk} = 0$ and ${\Gamma^i}_{jk} = 0$ and $\Gamma^i = 0$]] local ab1_conn4ijkLLL_def = conn4'_ijk':eq(0) printbr(ab1_conn4ijkLLL_def) local ab1_conn3iU_def = conn3'^i':eq(0) printbr(ab1_conn3iU_def) printbr() printbr'spacetime metric connection:' local ab1_conn4tijLLL_def = conn4'_0ij':eq( frac(1,2) * (g'_0i,j' + g'_0j,i' - g'_ij,0')) printbr(ab1_conn4tijLLL_def) -- TODO manually replacing here ... local ab1_conn4tijLLL_def = conn4'_0ij':eq( frac(1,2) * (ab1_gLL[2][1]'_,j' + ab1_gLL[1][2]'_,i' - ab1_gLL[2][2]'_,0')) printbr(ab1_conn4tijLLL_def) ab1_conn4tijLLL_def = ab1_conn4tijLLL_def():replaceIndex(delta'_ij,k', 0) ab1_conn4tijLLL_def = ab1_conn4tijLLL_def:simplifyAddMulDiv() printbr(ab1_conn4tijLLL_def) printbr() local ab1_conn40jkULL_def = conn4'^0_jk':eq(g'^00' * conn4'_0jk' + g'^0i' * conn4'_ijk') printbr(ab1_conn40jkULL_def) ab1_conn40jkULL_def = ab1_conn40jkULL_def :replace(g'^00', gUUab1[1][1]) :replace(g'^0i', gUUab1[2][1]) :subst(ab1_conn4tijLLL_def:reindex{ij='jk'}) :subst(ab1_conn4ijkLLL_def) ():replace(v'^i' * delta'_ik', v'_k') ():replace(v'^i' * delta'_ij', v'_j') ab1_conn40jkULL_def = ab1_conn40jkULL_def:simplifyAddMulDiv() printbr(ab1_conn40jkULL_def) printbr() local ab1_KLL_def = K'_ij':eq(-alpha * conn4'^0_ij') printbr(ab1_KLL_def) ab1_KLL_def = ab1_KLL_def:subst(ab1_alpha_def, ab1_conn40jkULL_def:reindex{jki='ijk'}) ab1_KLL_def = ab1_KLL_def:simplifyAddMulDiv() printbr(ab1_KLL_def) printbr() local K_def = K:eq(gamma'^ij' * K'_ij') printbr(K_def) local ab1_K_def = K_def:subst(ab1_gammaUU_def, ab1_KLL_def) ab1_K_def = ab1_K_def:simplifyAddMulDiv() printbr(ab1_K_def) ab1_K_def = ab1_K_def :replace(delta'^ij' * delta'_ij', n) :replace(delta'^ij' * v'_i,j', v'^k_,k') :replace(delta'^ij' * v'_j,i', v'^k_,k') ab1_K_def = ab1_K_def() printbr(ab1_K_def) printbr() printbr'wave equation:' local ab1_partial00_Phi_def = partial00_Phi_def :splitOffDerivIndexes() :subst(ab1_alpha_def) :substIndex(ab1_betaU_def) :subst(ab1_K_def) :substIndex(ab1_conn3iU_def) :subst(ab1_gammaUU_def) :simplify() --:tidyIndexes() -- tidyIndexes() doesnt like specific indexes, like _0 ab1_partial00_Phi_def = ab1_partial00_Phi_def:simplifyAddMulDiv() printbr(ab1_partial00_Phi_def) printbr() printbr'<hr>' local rho = var'\\rho' printbr[[Ussembayev acoustic black hole metric]] local gUUab2 = Tensor('^ab', {-1/(rho * c), -v'^j' / (rho * c)}, {-v'^i' / (rho * c), (c / rho) * delta'^ij' - v'^i' * v'^j' / (rho * c)} ) printbr(g'^ab':eq(gUUab2)) printbr() local ab2_alpha_def = gUU[1][1]:eq(gUUab2[1][1]) printbr(ab2_alpha_def) ab2_alpha_def = ab2_alpha_def:solve(alpha) printbr(ab2_alpha_def) printbr() local ab2_betaU_def = gUU[2][1]:eq(gUUab2[2][1]) printbr(ab2_betaU_def) ab2_betaU_def = ab2_betaU_def:subst(ab2_alpha_def):solve(beta'^i') printbr(ab2_betaU_def) printbr() local ab2_gammaUU_def = gUU[2][2]:eq(gUUab2[2][2]) printbr(ab2_gammaUU_def) ab2_gammaUU_def = ab2_gammaUU_def :subst(ab2_alpha_def) :substIndex(ab2_betaU_def) :solve(gamma'^ij') printbr(ab2_gammaUU_def) printbr() -- TODO manually assuming ab2_gammaUU_def is gamma^ij = (c/rho) delta^ij ... local ab2_gammaLL_def = gamma'_ij':eq((rho / c) * delta'_ij') printbr(ab2_gammaLL_def) printbr() -- TODO manually assuming ab2_gammaUU_def is gamma^ij = delta^ij ... printbr(beta'_i':eq(gamma'_ij' * beta'^j')) local ab2_betaL_def = beta'_i':eq(ab2_betaU_def:rhs():reindex{i='j'} * ab2_gammaLL_def:rhs()) printbr(ab2_betaL_def) printbr[[Using convention $v_i = \delta_{ij} v^j$]] --ab2_betaL_def = ab2_betaL_def:replace(v'^j' * delta'_ij', v'_j') ab2_betaL_def = beta'_i':eq(-(rho / c) * v'_i') printbr('So',ab2_betaL_def) printbr() local ab2_gLL = gLL :subst(ab2_alpha_def) :substIndex(ab2_betaU_def) :substIndex(ab2_betaL_def) :subst(ab2_gammaLL_def) () printbr(g'_ab':eq(ab2_gLL)) printbr() printbr'spatial metric connection:' local conn3_def = conn3'_ijk':eq( frac(1,2) * (gamma'_ij,k' + gamma'_ik,j' - gamma'_jk,i')) printbr(conn3_def) local ab2_conn3_def = conn3_def :splitOffDerivIndexes() :substIndex(ab2_gammaLL_def) printbr(ab2_conn3_def) ab2_conn3_def = ab2_conn3_def():replaceIndex(delta'_ij,k', 0) ab2_conn3_def = ab2_conn3_def:simplifyAddMulDiv() printbr(ab2_conn3_def) printbr() printbr'spatial metric contracted on 2nd and 3rd indexes:' local ab2_conn3_tr23_def = (ab2_conn3_def * gamma'^jk')() ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:substIndex(ab2_gammaUU_def) ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:simplifyAddMulDiv() -- :simplifyAddMulDiv() distributes the deltas so they are next to one another so replace() can work ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replace(delta'^jk' * delta'_jk', n) ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replaceIndex(delta'^jk' * delta'_ik', delta'^j_i') ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replaceIndex(delta'^jk' * delta'_ij', delta'^k_i') ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replaceIndex(c'_,j' * delta'^j_i', c'_,i') ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replaceIndex(c'_,k' * delta'^k_i', c'_,i') ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replaceIndex(rho'_,j' * delta'^j_i', rho'_,i') ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:replaceIndex(rho'_,k' * delta'^k_i', rho'_,i') ab2_conn3_tr23_def[2] = ab2_conn3_tr23_def[2]:simplifyAddMulDiv() printbr(ab2_conn3_tr23_def) --ab2_conn3_tr23_def = ab2_conn3_tr23_def:simplifyAddMulDiv() --printbr(ab2_conn3_tr23_def) printbr() printbr'spacetime metric connection:' local ab2_conn4tijLLL_def = conn4'_0ij':eq( frac(1,2) * (g'_0i,j' + g'_0j,i' - g'_ij,0')) printbr(ab2_conn4tijLLL_def) -- TODO manually replacing here ... local ab2_conn4tijLLL_def = conn4'_0ij':eq( frac(1,2) * (ab2_gLL[2][1]'_,j' + ab2_gLL[1][2]'_,i' - ab2_gLL[2][2]'_,0')) printbr(ab2_conn4tijLLL_def) ab2_conn4tijLLL_def = ab2_conn4tijLLL_def():replaceIndex(delta'_ij,k', 0) ab2_conn4tijLLL_def = ab2_conn4tijLLL_def:simplifyAddMulDiv() printbr(ab2_conn4tijLLL_def) printbr() local ab2_conn4ijkLLL_def = conn4'_ijk':eq( frac(1,2) * (g'_ij,k' + g'_ik,j' - g'_jk,i' )) printbr(ab2_conn4ijkLLL_def) ab2_conn4ijkLLL_def = ab2_conn4ijkLLL_def:splitOffDerivIndexes():replaceIndex(g'_ij', ab2_gLL[2][2]) printbr(ab2_conn4ijkLLL_def) ab2_conn4ijkLLL_def = ab2_conn4ijkLLL_def():replaceIndex(delta'_ij,k', 0) ab2_conn4ijkLLL_def = ab2_conn4ijkLLL_def:simplifyAddMulDiv() printbr(ab2_conn4ijkLLL_def) printbr() local ab2_conn40jkULL_def = conn4'^0_jk':eq(g'^00' * conn4'_0jk' + g'^0i' * conn4'_ijk') printbr(ab2_conn40jkULL_def) ab2_conn40jkULL_def = ab2_conn40jkULL_def :replace(g'^00', gUUab2[1][1]) :replace(g'^0i', gUUab2[2][1]) :subst(ab2_conn4tijLLL_def:reindex{ij='jk'}) :subst(ab2_conn4ijkLLL_def) ():replace(v'^i' * delta'_ik', v'_k') ():replace(v'^i' * delta'_ij', v'_j') ab2_conn40jkULL_def = ab2_conn40jkULL_def:simplifyAddMulDiv() printbr(ab2_conn40jkULL_def) printbr() local K = var'K' local ab2_KLL_def = K'_ij':eq(-alpha * conn4'^0_ij') printbr(ab2_KLL_def) ab2_KLL_def = ab2_KLL_def:subst(ab2_alpha_def, ab2_conn40jkULL_def:reindex{jki='ijk'}) ab2_KLL_def = ab2_KLL_def:simplifyAddMulDiv() printbr(ab2_KLL_def) printbr() local K_def = K:eq(gamma'^ij' * K'_ij') printbr(K_def) local ab2_K_def = K_def:subst(ab2_gammaUU_def, ab2_KLL_def) ab2_K_def = ab2_K_def:simplifyAddMulDiv() printbr(ab2_K_def) ab2_K_def = ab2_K_def :replace(delta'^ij' * delta'_ij', n) :replace(delta'^ij' * v'_i,j', v'^k_,k') :replace(delta'^ij' * v'_j,i', v'^k_,k') ab2_K_def = ab2_K_def() printbr(ab2_K_def) printbr()
-- dyes_api/init.lua dyes = {} function dyes.register_dye(name, def) local txt = name:gsub(":", "_") local color_name = "color_" .. name:match(":.*$") if def.groups then def.groups.dye = 1 def.groups[color_name] = 1 else def.groups = {dye = 1, [color_name] = 1} end minetest.register_craftitem(name, { description = def.description, inventory_image = txt .. ".png", groups = def.groups }) if def.recipe then minetest.register_craft({ output = name .. " 4", recipe = { {"group:flower," .. color_name} }, }) end end
--[[Prophet Velen says: As the Legion's final defeat draws ever-nearer, stand proud in the knowledge that you have saved worlds without number from the flame. Prophet Velen says: Farewell... Prophet Velen says: Gaze now, mortals - upon the HEART OF M'URU! Unblemished. Bathed by the light of Creation - just as it was at the Dawn. Prophet Velen says: In time, the light and hope held within - will rebirth more than this mere fount of power... Mayhap, they will rebirth the soul of a nation. Prophet Velen says: Just as this day marks an ending, so too does it herald a new beginning... Prophet Velen says: Mortal heroes - your victory here today was foretold long ago. My brother's anguished cry of defeat will echo across the universe - bringing renewed hope to all those who still stand against the Burning Crusade. Prophet Velen says: Salvation, young one. It waits for us all. Prophet Velen says: The creature Entropius, whom you were forced to destroy, was once the noble naaru, M'uru. In life, M'uru channeled vast energies of LIGHT and HOPE. For a time, a misguided few sought to steal those energies... Prophet Velen says: Then fortunate it is, that I have reclaimed the noble naaru's spark from where it fell! Where faith dwells, hope is never lost, young blood elf.]] --[[Lady Liadrin says: Blessed ancestors! I feel it... so much love... so much grace... there are... no words... impossible to describe... Lady Liadrin says: Can it be? Lady Liadrin says: Our arrogance was unpardonable. We damned one of the most noble beings of all. We may never atone for this sin.]] function Velen_OnSpawn(pUnit,Event) pUnit:RegisterEvent("Velen_Talk1", 4000, 1) end function Liadrin_OnSpawn(pUnit,Event) pUnit:RegisterEvent("Liadrin_Talk", 81000, 0) end function Velen_Talk1(pUnit,Event) pUnit:SendChatMessage(14, 0, "Mortal heroes, your victory here today was foretold long ago. My brother's anguished cry of defeat will echo across the universe, bringing renewed hope to all those who still stand against the Burning Crusade. ") pUnit:RegisterEvent("Velen_Talk2",25000, 1) pUnit:PlaySoundToSet(12515) end function Velen_Talk2(pUnit,Event) pUnit:SendChatMessage(14, 0, "As the Legion's final defeat draws ever-nearer, stand proud in the knowledge that you have saved worlds without number from the flame.") pUnit:PlaySoundToSet(12516) pUnit:RegisterEvent("Velen_Talk2part2",14000, 1) pUnit:RegisterEvent("Velen_Talk3",24000, 1) end function Velen_Talk2part2(pUnit,Event) pUnit:SendChatMessage(14, 0, "Just as this day marks an ending, so too does it herald a new beginning...") pUnit:PlaySoundToSet(12517) end function Velen_Talk3(pUnit,Event) pUnit:SendChatMessage(14, 0, "The creature Entropius, whom you were forced to destroy, was once the noble naaru, M'uru. In life, M'uru channeled vast energies of Light and Hope. For a time, a misguided few sought to steal those energies... ") pUnit:PlaySoundToSet(12518) pUnit:RegisterEvent("Velen_Talk4",32000, 1) end function Liadrin_Talk(pUnit,Event) pUnit:SendChatMessage(14, 0, "Our arrogance was unpardonable. We damned one of the most noble beings of all. We may never atone for this sin. ") pUnit:PlaySoundToSet(12524) pUnit:RegisterEvent("Liadrin_Talk2",9000, 1) end function Velen_Talk4(pUnit,Event) pUnit:SendChatMessage(14, 0, "Then fortunate it is, that I have reclaimed the noble naaru's spark from where it fell! Where faith dwells, hope is never lost, young blood elf. ") pUnit:PlaySoundToSet(12519) pUnit:RegisterEvent("Velen_Talk5",5000, 1) end function Liadrin_Talk2(pUnit,Event) pUnit:SendChatMessage(14, 0, "Can it be?") pUnit:PlaySoundToSet(12525) pUnit:RegisterEvent("Liadrin_Talk3",2000, 1) end function Velen_Talk5(pUnit,Event) pUnit:SendChatMessage(14, 0, "Gaze now, mortals - upon the Heat Of M'uru! Unblemished. Bathed by the light of Creation - just as it was at the Dawn. ") pUnit:PlaySoundToSet(12519) pUnit:RegisterEvent("Velen_Talk6",16000, 1) end function Velen_Talk6(pUnit,Event) pUnit:SendChatMessage(14, 0, "In time, the light and hope held within - will rebirth more than this mere fount of power... Mayhap, they will rebirth the soul of a nation. ") pUnit:PlaySoundToSet(12521) pUnit:RegisterEvent("Velen_Talk7",15000, 1) end function Liadrin_Talk3(pUnit,Event) pUnit:SendChatMessage(14, 0, "Blessed ancestors! I feel it... so much love... so much grace... there are... no words... impossible to describe...") pUnit:PlaySoundToSet(12525) pUnit:RegisterEvent("Liadrin_Talk3",31000, 1) end function Velen_Talk7(pUnit,Event) pUnit:SendChatMessage(14, 0, "Salvation, young one. It waits for us all. ") pUnit:PlaySoundToSet(12522) pUnit:RegisterEvent("Velen_Talk8",6000, 1) end function Velen_Talk8(pUnit,Event) pUnit:SendChatMessage(14, 0, "Farewell... ") pUnit:PlaySoundToSet(12523) end RegisterUnitEvent(26246, 6, "Velen_OnSpawn") RegisterUnitEvent(26247, 6, "Liadrin_OnSpawn")
------------------------------------------------------------------------------------------------------------------------ -- Meta Ability Progression Adaptor -- Author Morticai - (https://www.coregames.com/user/d1073dbcc404405cbef8ce728e53d380) -- Date: 2021/3/23 -- Version 0.1.4 ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ -- Require ------------------------------------------------------------------------------------------------------------------------ local DATA = require(script:GetCustomProperty("DATA")) local CONST = require(script:GetCustomProperty("MetaAbilityProgressionConstants_API")) ------------------------------------------------------------------------------------------------------------------------ -- Local Variables ------------------------------------------------------------------------------------------------------------------------ local currentClass = {} local listeners = {} ------------------------------------------------------------------------------------------------------------------------ -- GLOBAL TABLE ACCESS ------------------------------------------------------------------------------------------------------------------------ local function META_AP() return _G["Meta.Ability.Progression"] end local function CLASS_P() return _G["Class.Progression"] end ------------------------------------------------------------------------------------------------------------------------ -- GLOBAL FUNCTIONS ------------------------------------------------------------------------------------------------------------------------ --@param object player --@param string skillName --@param int skillLevel function ApplySkillStats(player, class, bind, bindLevel) if currentClass[player] ~= class then Task.Wait() end if not Object.IsValid(player) then return end currentClass[player] = class local data = DATA.GetClassTable() player.serverUserData["bind"] = player.serverUserData["bind"] or {} player.serverUserData["bind"][bind] = player.serverUserData["bind"][bind] or {} for name, value in pairs(data[class][bind][bindLevel]) do player.serverUserData["bind"][bind][name] = value end --TablePrint(player.serverUserData["bind"]) end function OnResourceChanged(player, resName, resAmount) if resName == CONST.CLASS_RES then local classId = player:GetResource(resName) META_AP().ChangeClass(player, classId) CLASS_P().SetClassLevel(player, classId) end end --Connected through a context call --@param object player function OnPlayerJoined(player) listeners[player.id] = player.resourceChangedEvent:Connect(OnResourceChanged) end --Connected through a context call --@param object player function OnPlayerLeft(player) currentClass[player] = nil listeners[player.id]:Disconnect() listeners[player.id] = nil end ------------------------------------------------------------------------------------------------------------------------ -- Listeners ------------------------------------------------------------------------------------------------------------------------ Events.Connect("META_AP.ApplyStats", ApplySkillStats)
local hyper = {"ctrl", "cmd", "alt", "shift"} local terminalPrg = "iTerm" local browserPrg = "Firefox" local editorPrg = "Emacs" -- reload config hs.loadSpoon("ReloadConfiguration") spoon.ReloadConfiguration:bindHotkeys({ reloadConfiguration = {hyper, "r"} }) spoon.ReloadConfiguration:start() -- window manager hs.loadSpoon("MiroWindowsManager") hs.window.animationDuration = 0 spoon.MiroWindowsManager:bindHotkeys({ up = {hyper, "k"}, right = {hyper, "l"}, down = {hyper, "j"}, left = {hyper, "h"}, fullscreen = {hyper, "f"} }) -- send focused window to other desktop hs.hotkey.bind(hyper, "o", function() -- Get the focused window, its window frame dimensions, its screen frame -- dimensions, and the next screen's frame dimensions. local focusedWindow = hs.window.focusedWindow() local focusedScreenFrame = focusedWindow:screen():frame() local nextScreenFrame = focusedWindow:screen():next():frame() local windowFrame = focusedWindow:frame() -- Calculate the coordinates of the window frame in the next screen and retain -- aspect ratio windowFrame.x = ((((windowFrame.x - focusedScreenFrame.x) / focusedScreenFrame.w) * nextScreenFrame.w) + nextScreenFrame.x) windowFrame.y = ((((windowFrame.y - focusedScreenFrame.y) / focusedScreenFrame.h) * nextScreenFrame.h) + nextScreenFrame.y) windowFrame.h = ((windowFrame.h / focusedScreenFrame.h) * nextScreenFrame.h) windowFrame.w = ((windowFrame.w / focusedScreenFrame.w) * nextScreenFrame.w) -- Set the focused window's new frame dimensions focusedWindow:setFrame(windowFrame) end) -- hotkey for terminal hs.hotkey.bind(hyper, "Return", function() if hs.application.frontmostApplication():name() == editorPrg then hs.application.launchOrFocus(terminalPrg) else hs.application.launchOrFocus(editorPrg) end end) -- editor and browser 50-50 layout hs.hotkey.bind(hyper, "1", function() local mainScreen = "Color LCD" local terminal = hs.application.find(terminalPrg) local browser = hs.application.find(browserPrg) local layout = { {terminal, nil, mainScreen, hs.layout.left50, nil, nil}, {browser, nil, mainScreen, hs.layout.right50, nil, nil} } hs.layout.apply(layout) end)
-- Air Voxel Data game.data.addVoxel({ name = "openbuilder_air", description = "Air", type = game.VoxelType.Gas, collidable = false, render = { top = "error", sides = "error", bottom ="error", mesh = game.MeshStyle.None }, }) -- Grass Voxel Data game.data.addVoxel { name = "openbuilder_grass", description = "Grass", render = { top = "grass", sides = "grass_side", bottom = "dirt", }, } -- Dirt Voxel Data game.data.addVoxel { name = "openbuilder_dirt", description = "Dirt", render = { top = "dirt", sides = "dirt", bottom = "dirt", }, } -- Stone Voxel Data game.data.addVoxel { name = "openbuilder_stone", description = "Stone", render = { top = "stone", sides = "stone", bottom = "stone", }, } -- Water Voxel Data game.data.addVoxel { name = "openbuilder_water", description = "Water", type = game.VoxelType.Fluid, collidable = false, render = { top = "water", sides = "water", bottom = "water", }, } -- Sand Voxel Data game.data.addVoxel { name = "openbuilder_sand", description = "Sand", collidable = false, render = { top = "sand", sides = "sand", bottom = "sand", }, } ---- Wood Voxel Data --game.data.addVoxel { -- name = "openbuilder_wood", -- description = "Wood", -- collidable = false, -- render = { -- top = "logtop", -- sides = "log", -- bottom = "logtop", -- }, --} -- ---- Leaf Voxel Data --game.data.addVoxel { -- name = "openbuilder_leaf", -- description = "Leaf", -- type = game.VoxelType.Flora, -- collidable = false, -- render = { -- top = "leaves", -- sides = "leaves", -- bottom = "leaves", -- }, --} -- ---- Coal ore Voxel Data --game.data.addVoxel { -- name = "openbuilder_raw_coal", -- description = "Raw Coal", -- collidable = false, -- render = { -- top = "coal_ore", -- sides = "coal_ore", -- bottom = "coal_ore", -- }, --} -- ---- Iron ore Voxel Data --game.data.addVoxel { -- name = "openbuilder_iron_ore", -- description = "Iron Ore", -- collidable = false, -- render = { -- top = "iron_ore", -- sides = "iron_ore", -- bottom = "iron_ore", -- }, --}
local ffi = require "ffi" local ffi_cast = ffi.cast local ffi_cdef = ffi.cdef local ffi_string = ffi.string local pcre = ffi.load("pcre") local r3 = ffi.load("r3") local string_len = string.len local string_upper = string.upper local table_insert = table.insert local unpack = unpack or table.unpack ffi_cdef[[ typedef struct real_pcre pcre; typedef struct pcre_extra pcre_extra; struct _edge; struct _node; struct _route; typedef struct _edge edge; typedef struct _node node; typedef struct _route route; typedef struct _str_array { char **tokens; int len; int cap; } str_array; struct _node { edge ** edges; // edge ** edge_table; // edges are mostly less than 255 unsigned char compare_type; // compare_type: pcre, opcode, string unsigned char edge_len; unsigned char endpoint; // endpoint, should be zero for non-endpoint nodes unsigned char ov_cnt; // capture vector array size for pcre // almost less than 255 unsigned char edge_cap; unsigned char route_len; unsigned char route_cap; // <-- here comes a char[1] struct padding for alignment since we have 4 char above. /** compile-time variables here.... **/ /* the combined regexp pattern string from pattern_tokens */ pcre * pcre_pattern; pcre_extra * pcre_extra; route ** routes; char * combined_pattern; /** * the pointer of route data */ void * data; }; struct _edge { char * pattern; // 8 bytes node * child; // 8 bytes unsigned char pattern_len; // 1 byte unsigned char opcode:4; // 4 bit unsigned char has_slug:1; // 1 bit }; struct _route { char * path; int path_len; int request_method; // can be (GET || POST) char * host; // required host name int host_len; void * data; char * remote_addr_pattern; int remote_addr_pattern_len; }; typedef struct { str_array * vars; const char * path; // current path to dispatch int path_len; // the length of the current path int request_method; // current request method void * data; // route ptr char * host; // the request host int host_len; char * remote_addr; int remote_addr_len; } match_entry; str_array * str_array_create(int cap); bool str_array_is_full(const str_array * l); bool str_array_resize(str_array *l, int new_cap); bool str_array_append(str_array * list, char * token); void str_array_free(str_array *l); void str_array_dump(const str_array *l); str_array * split_route_pattern(char *pattern, int pattern_len); node * r3_tree_create(int cap); node * r3_node_create(); void r3_tree_free(node * tree); edge * r3_node_connectl(node * n, const char * pat, int len, int strdup, node *child); edge * r3_node_find_edge(const node * n, const char * pat, int pat_len); void r3_node_append_edge(node *n, edge *child); edge * r3_node_find_common_prefix(node *n, const char *path, int path_len, int *prefix_len, char **errstr); node * r3_tree_insert_pathl(node *tree, const char *path, int path_len, void * data); route * r3_tree_insert_routel(node *tree, int method, const char *path, int path_len, void *data); route * r3_tree_insert_routel_ex(node *tree, int method, const char *path, int path_len, void *data, char **errstr); node * r3_tree_insert_pathl_ex(node *tree, const char *path, int path_len, route * route, void * data, char ** errstr); void r3_tree_dump(const node * n, int level); edge * r3_node_find_edge_str(const node * n, const char * str, int str_len); int r3_tree_compile(node *n, char** errstr); int r3_tree_compile_patterns(node * n, char** errstr); node * r3_tree_matchl(const node * n, const char * path, int path_len, match_entry * entry); bool r3_node_has_slug_edges(const node *n); edge * r3_edge_createl(const char * pattern, int pattern_len, node * child); node * r3_edge_branch(edge *e, int dl); void r3_edge_free(edge * edge); route * r3_route_create(const char * path); route * r3_route_createl(const char * path, int path_len); void r3_node_append_route(node * n, route * route); void r3_route_free(route * route); int r3_route_cmp(const route *r1, const match_entry *r2); route * r3_tree_match_route(const node *n, match_entry * entry); int r3_pattern_to_opcode(const char * pattern, int pattern_len); match_entry * match_entry_createl(const char * path, int path_len); void match_entry_free(match_entry * entry); ]] local _M = { _VERSION = '0.01' } local mt = { __index = _M } local bit = require "bit" local _METHOD_GET = 2; local _METHOD_POST = bit.lshift(2,1); local _METHOD_PUT = bit.lshift(2,2); local _METHOD_DELETE = bit.lshift(2,3); local _METHOD_PATCH = bit.lshift(2,4); local _METHOD_HEAD = bit.lshift(2,5); local _METHOD_OPTIONS = bit.lshift(2,6); local _METHODS = { GET = _METHOD_GET, POST = _METHOD_POST, PUT = _METHOD_PUT, DELETE = _METHOD_DELETE, PATCH = _METHOD_PATCH, HEAD = _METHOD_HEAD, OPTIONS = _METHOD_OPTIONS, } ---------------------------------------------------------------- -- new ---------------------------------------------------------------- function _M.new(routes) local self = setmetatable({ tree = r3.r3_tree_create(10), match_data_index = 0, match_data = {}, }, mt) if not routes then return self end -- register routes for i, route in ipairs(routes) do local method = route[1] local bit_methods = nil if type(method) ~= "table" then bit_methods = _METHODS[method] else local methods = {} for i2, m in ipairs(method) do table_insert(methods, _METHODS[m]) end bit_methods = bit.bor(unpack(methods)) end local path = route[2] local handler = route[3] -- register self:insert_route(bit_methods, path, handler) end -- compile if self.match_data_index > 0 then self:compile() end return self end function _M.compile(self) return r3.r3_tree_compile(self.tree, nil) end function _M.dump(self, level) level = level or 0 return r3.r3_tree_dump(self.tree, level) end function _M.tree_free(self) return r3.r3_tree_free(self.tree) end function _M.match_entry_free(self, entry) return r3.match_entry_free(entry) end function _M.insert_route(self, method, path, block) if not method or not path or not block then return end self.match_data_index = self.match_data_index + 1 self.match_data[self.match_data_index] = block local dataptr = ffi_cast('void *', ffi_cast('intptr_t', self.match_data_index)) -- route * r3_tree_insert_routel_ex(node *tree, int method, const char *path, int path_len, void *data, char **errstr); r3.r3_tree_insert_routel_ex(self.tree, method, path, string_len(path), dataptr, nil) end function _M.match_route(self, method, route, ...) local block local stokens={} local entry = r3.match_entry_createl(route, string_len(route)) entry.request_method = method; node = r3.r3_tree_match_route(self.tree, entry) if node == nil then self:match_entry_free(entry); entry = nil return false end -- get match data from index local i = tonumber(ffi_cast('intptr_t', ffi_cast('void *', node.data))) block = self.match_data[i] -- token proc if entry ~= nil and entry.vars and entry.vars.len then for i=0, entry.vars.len-1 do local token = ffi_string(entry.vars.tokens[i]) table_insert(stokens, token) end end -- free self:match_entry_free(entry); entry = nil -- execute block block(stokens, ...) return true end ---------------------------------------------------------------- -- method ---------------------------------------------------------------- function _M.get(self, path, block) self:insert_route(_METHODS["GET"], path, block) end function _M.post(self, path, block) self:insert_route(_METHODS["POST"], path, block) end function _M.put(self, path, block) self:insert_route(_METHODS["PUT"], path, block) end function _M.delete(self, path, block) self:insert_route(_METHODS["DELETE"], path, block) end ---------------------------------------------------------------- -- dispatcher ---------------------------------------------------------------- function _M.dispatch(self, method, path, ...) return self:match_route(_METHODS[method], path, ...) end function _M.dispatch_ngx(self) local method = string_upper(ngx.var.request_method) local path = ngx.var.uri local params = {} local body = "" if method == "GET" then params = ngx.req.get_uri_args() elseif method == "POST" then ngx.req.read_body() params = ngx.req.get_post_args() else ngx.req.read_body() body = ngx.req.get_body_data() end return self:match_route(_METHODS[method], path, params, body) end return _M
return _('A-6E Intruder')
local condition = Condition(CONDITION_ATTRIBUTES) condition:setParameter(CONDITION_PARAM_TICKS, 4000) condition:setParameter(CONDITION_PARAM_SKILL_SHIELDPERCENT, 85) condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, 85) local combat = Combat() combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA) combat:setArea(createCombatArea(AREA_SQUARE1X1)) combat:setCondition(condition) function onCastSpell(creature, variant) return combat:execute(creature, variant) end
local _M = {} _M.AppBase = import("AppBase") _M.ViewBase = import("ViewBase") _M.SceneBase = import("SceneBase") return _M
local assets = { Asset("ANIM", "anim/sch_battle_staff.zip"), Asset("ANIM", "anim/sch_swap_battle_staff.zip"), Asset("ATLAS", "images/inventoryimages/sch_battle_staff.xml"), Asset("IMAGE", "images/inventoryimages/sch_battle_staff.tex"), } local function onequip(inst, owner) owner.AnimState:OverrideSymbol("swap_object", "sch_swap_battle_staff", "icestaff") owner.AnimState:Show("ARM_carry") owner.AnimState:Hide("ARM_normal") end local function onunequip(inst, owner) owner.AnimState:Hide("ARM_carry") owner.AnimState:Show("ARM_normal") end local function OnHit(inst, owner, target) if target ~= nil and target:IsValid() then local x, y, z = target.Transform:GetWorldPosition() if inst.BattleActivate then local fx = SpawnPrefab("sch_shot_projectile_fx") fx.Transform:SetPosition(x, y, z) local fx2 = SpawnPrefab("groundpoundring_fx") local pos = Vector3(target.Transform:GetWorldPosition()) fx2.Transform:SetScale(0.45, 0.45, 0.45) TheWorld:DoTaskInTime(0.2, function() fx2.Transform:SetPosition(pos:Get()) end) target.components.health:DoDelta(-70) if target.components.locomotor and not target:HasTag("ghost") then target.components.locomotor.groundspeedmultiplier = 0.1 end if target.components.burnable then target.components.burnable:Ignite() end if target.components.burnable and target.components.burnable:IsBurning() then target.components.burnable:Extinguish() end end end end local function OnUseItem(inst, data) if not inst.BattleActivate then inst:AddTag("staffz") inst.BattleActivate = true inst.components.useableitem:StopUsingItem() inst.components.weapon:SetProjectile(nil) elseif inst.BattleActivate then inst:RemoveTag("staffz") inst.BattleActivate = false inst.components.weapon:SetProjectile("fire_projectile") inst.components.useableitem:StopUsingItem() end end local function OnChosen(inst,owner) return owner.prefab == "schwarzkirsche" end local function fn(Sim) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() inst.AnimState:SetBank("icestaff") inst.AnimState:SetBuild("sch_battle_staff") inst.AnimState:PlayAnimation("idle_90s") MakeInventoryPhysics(inst) if not TheWorld.ismastersim then return inst end inst.entity:SetPristine() inst:AddComponent("finiteuses") inst.components.finiteuses:SetMaxUses(TUNING.AXE_USES) inst.components.finiteuses:SetUses(TUNING.AXE_USES) inst.components.finiteuses:SetOnFinished(inst.Remove) inst:AddTag("staff") inst:AddTag("meteorstaff") inst:AddTag("schstuff") inst:AddComponent("useableitem") inst.components.useableitem:SetOnUseFn(OnUseItem) inst.entity:AddMiniMapEntity() inst.MiniMapEntity:SetIcon( "sch_battle_staff.tex" ) inst:AddComponent("weapon") inst.components.weapon:SetDamage(25) ----------- Fair Damage Please inst.components.weapon:SetRange(10) inst.components.weapon:SetOnAttack(OnHit) inst.components.weapon:SetProjectile("fire_projectile") inst:AddComponent("equippable") -- inst.components.equippable.keepondeath = true inst.components.equippable:SetOnEquip(onequip) inst.components.equippable:SetOnUnequip(onunequip) inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") -- inst.components.inventoryitem.keepondeath = true inst.components.inventoryitem.imagename = "sch_battle_staff" inst.components.inventoryitem.atlasname = "images/inventoryimages/sch_battle_staff.xml" inst:AddComponent("characterspecific") inst.components.characterspecific:SetOwner("schwarzkirsche") inst.components.characterspecific:SetStorable(true) inst.components.characterspecific:SetComment("I can't hold this!") inst:AddComponent("chosenpeople") inst.components.chosenpeople:SetChosenFn(OnChosen) MakeHauntableLaunch(inst) return inst end return Prefab("common/inventory/sch_battle_staff", fn, assets)
/************************************************************** Laser Hitbox Entity https://github.com/buu342/GMod-DeadSpacePlasmaCutter **************************************************************/ AddCSLuaFile() ENT.Type = "anim" ENT.Base = "base_gmodentity" -- Make sure we can't spawn this entity randomly ENT.Spawnable = false ENT.AdminSpawnable = false -- Needed for animations ENT.AutomaticFrameAdvance = true -- Hitbox radius local COLLISION_RADIUS = 3 /*----------------------------- Initialize Initializes the entity -----------------------------*/ function ENT:Initialize() -- Setup the model (Unused anyway) self.Entity:SetModel("models/Gibs/HGIBS.mdl") self:DrawShadow(false) self:SetNotSolid(true) -- Initiate cheap physics self:PhysicsInitSphere(COLLISION_RADIUS) self:SetCollisionBounds(Vector(-COLLISION_RADIUS, -COLLISION_RADIUS, -COLLISION_RADIUS), Vector(COLLISION_RADIUS, COLLISION_RADIUS, COLLISION_RADIUS)) self.PlacedDecal = false -- Make sure it's unaffected by gravity self:SetMoveType(MOVETYPE_FLY) self:SetMoveCollide(MOVECOLLIDE_FLY_SLIDE) -- Handle damaging if SERVER then local dmginfo = nil local found = ents.FindInSphere(self:GetPos(), 32) -- Cycle through all the entities we found for i=1, #found do -- If we found something that isn't another laser hitbox if (found[i]:GetClass() != "ent_laserhit") then local damage = 15 -- Initialize damageinfo dmginfo = DamageInfo() dmginfo:SetAttacker(self.Owner) dmginfo:SetInflictor(self.Inflictor) dmginfo:SetDamageType(DMG_BULLET) -- Set special settings based on what we hit if (found[i]:GetClass() == "npc_zombie" && self.CanSlice) && found[i]:Health()-damage <= 0 && GetConVar("hl2_episodic"):GetInt() == 1 then dmginfo:SetAmmoType(game.GetAmmoID('CombineHeavyCannon')) elseif (found[i]:GetClass() == "npc_fastzombie" || (found[i]:GetClass() == "npc_zombie" && self.CanSlice)) && found[i]:Health()-damage <= 0 then dmginfo:SetDamageType(DMG_BLAST) damage = 25 end -- Apply damage dmginfo:SetDamage(damage) found[i]:TakeDamageInfo(dmginfo) found[i]:Extinguish() end end -- Create an explosion, so that blood and stuff works if (dmginfo != nil) then util.BlastDamageInfo(dmginfo, self:GetPos(), 32) end end -- Remove ourselves after a bit timer.Simple(0.2, function() if (IsValid(self) && SERVER) then self:Remove() end end) end /*----------------------------- Think Logic that runs every tick -----------------------------*/ function ENT:Think() -- Place a decal clientside if (CLIENT && !self.PlacedDecal) then -- Create a trace to see if we penetrate something local trace = {} trace.start = self:GetPos() - Vector(COLLISION_RADIUS, COLLISION_RADIUS, COLLISION_RADIUS) trace.endpos = self:GetPos() + Vector(COLLISION_RADIUS, COLLISION_RADIUS, COLLISION_RADIUS) local trline = util.TraceLine(trace) self.PlacedDecal = true -- If we hit something valid, then create the decal if (trline.Entity != NULL) then util.DecalEx(Material(util.DecalMaterial("FadingScorch")), trline.Entity, trline.HitPos, trline.HitNormal, Color(255,255,255,255), 0.2, 0.2) end end end /*----------------------------- RenderOverride Overrides rendering on the entity -----------------------------*/ if SERVER then return end function ENT:RenderOverride() -- Useful for debugging hitboxes. Uncomment to see them /* local phys = self:GetPhysicsObject() local col = COLLISION_RADIUS local mins = Vector(-col, -col, -col) local maxs = Vector(col, col, coL) local pos = self:GetPos() local angle = self:GetAngles() render.SetMaterial(Material("models/debug/debugwhite")) render.DrawWireframeBox(pos, angle, mins, maxs, Color(255,255,255,255), true) */ end
#!/usr/bin/env lua -- MoonGL example: hello-fltk.lua fl = require("moonfltk") gl = require("moongl") function init(win) -- Called only the first time the window is drawn. -- Initializes the GL context and sets the draw() callback to the -- actual rendering function, which will be called the next times -- the window will be drawn. assert(win == window) gl.init() -- glewInit() print("OpenGL " .. gl.get("major version") .. "." .. gl.get("minor version")) print("mode", win:mode()) print("can_do_overlay", win:can_do_overlay()) win:override_draw(render) win:flush() end function render(win) -- Rendering function -- print("draw()", win) -- ... rendering code goes here ... --gl.clear_color(0.85, 0.85, 1.0, 1.0) gl.clear_color(0.67, 0.67, 0.87, 1.0) gl.clear("color", "depth") win:redraw() end window = fl.gl_window_sub(0, 0, 600, 400, "Hello, World!") window:override_draw(init) -- Optional overloading of other fl.gl_window_sub methods: window:override_handle(function (win, ev) -- Handles an event assert(win == window) -- print("handle()", win, ev) return win:super_handle(ev) end) window:override_hide(function(win) -- Called when the wintow is hidden. assert(win == window) -- print("hide()", win) win:super_hide() end) window:override_resize(function (win, x, y, w, h) -- Called when the window is resized. assert(win == window) -- print("resize()", win, x, y, w, h) print("window reshaped to "..w.."x"..h) win:super_resize(x, y, w, h) end) -- main FLTK loop window:resizable(window) window:show() return fl.run()
---[[ -- to define resources. Probably don't really need this local function MAKEINTRESOURCE(i) return i --return (LPSTR)((ULONG_PTR)((WORD)(i))) end --]] local enum = require("pereader.enum") local DirectoryID = enum { IMAGE_DIRECTORY_ENTRY_EXPORT = 0; -- Export Directory IMAGE_DIRECTORY_ENTRY_IMPORT = 1; -- Import Directory IMAGE_DIRECTORY_ENTRY_RESOURCE = 2; -- Resource Directory IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3; -- Exception Directory IMAGE_DIRECTORY_ENTRY_SECURITY = 4; -- Security Directory IMAGE_DIRECTORY_ENTRY_BASERELOC = 5; -- Base Relocation Table IMAGE_DIRECTORY_ENTRY_DEBUG = 6; -- Debug Directory -- IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7; -- (X86 usage) IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7; -- Architecture Specific Data IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8; -- RVA of GP IMAGE_DIRECTORY_ENTRY_TLS = 9; -- TLS Directory IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10; -- Load Configuration Directory IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11; -- Bound Import Directory in headers IMAGE_DIRECTORY_ENTRY_IAT = 12; -- Import Address Table IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13; -- Delay Load Import Descriptors IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14; -- COM Runtime descriptor } -- Optional Header, DllCharacteristics local DllCharacteristics = enum { IMAGE_DLL_RESERVED1 = 0x0001, IMAGE_DLL_RESERVED2 = 0x0002, IMAGE_DLL_RESERVED3 = 0x0004, IMAGE_DLL_RESERVED4 = 0x0008, IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE = 0x0040, IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY = 0x0080, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT = 0x0100, IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 0x0200, IMAGE_DLLCHARACTERISTICS_NO_SEH = 0x0400, IMAGE_DLLCHARACTERISTICS_NO_BIND = 0x0800, IMAGE_DLL_RESERVED5 = 0x1000, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 0x2000, IMAGE_DLLCHARACTERISTICS_GUARD_CF = 0x4000, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000, } -- Optional Header, Subsystem field of local Subsystem = enum { IMAGE_SUBSYSTEM_UNKNOWN = 0, IMAGE_SUBSYSTEM_NATIVE = 1, IMAGE_SUBSYSTEM_WINDOWS_GUI = 2, IMAGE_SUBSYSTEM_WINDOWS_CUI = 3, IMAGE_SUBSYSTEM_OS2_CUI = 5, IMAGE_SUBSYSTEM_POSIX_CUI = 7, IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8, IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9, IMAGE_SUBSYSTEM_EFI_APPLICATION = 10, IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, IMAGE_SUBSYSTEM_EFI_ROM = 13, IMAGE_SUBSYSTEM_XBOX = 14, IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16, } local OptHeaderMagic = enum { IMAGE_MAGIC_HEADER_PE32 = 0x10b, IMAGE_MAGIC_HEADER_PE32_PLUS = 0x20b, } -- COFF Header, Characteristics field local Characteristics = enum { IMAGE_FILE_RELOCS_STRIPPED = 0x0001, IMAGE_FILE_EXECUTABLE_IMAGE = 0x0002, IMAGE_FILE_LINE_NUMS_STRIPPED = 0x0004, IMAGE_FILE_LOCAL_SYMS_STRIPPED = 0x0008, IMAGE_FILE_AGGRESSIVE_WS_TRIM = 0x0010, IMAGE_FILE_LARGE_ADDRESS_AWARE = 0x0020, IMAGE_FILE_BYTES_REVERSED_LO = 0x0080, IMAGE_FILE_32BIT_MACHINE = 0x0100, IMAGE_FILE_DEBUG_STRIPPED = 0x0200, IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400, IMAGE_FILE_NET_RUN_FROM_SWAP = 0x0800, IMAGE_FILE_SYSTEM = 0x1000, IMAGE_FILE_DLL = 0x2000, IMAGE_FILE_UP_SYSTEM_ONLY = 0x4000, IMAGE_FILE_BYTES_REVERSED_HI = 0x8000, } -- COFF Header, MachineType field local MachineType = enum { IMAGE_FILE_MACHINE_UNKNOWN = 0x0, IMAGE_FILE_MACHINE_ARM = 0x1c0, IMAGE_FILE_MACHINE_ARMN = 0x1c4, IMAGE_FILE_MACHINE_AM33 = 0x1d3, IMAGE_FILE_MACHINE_I386 = 0x14c, IMAGE_FILE_MACHINE_R4000 = 0x166, IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x169, IMAGE_FILE_MACHINE_SH3 = 0x1a2, IMAGE_FILE_MACHINE_SH3D = 0x1a3, IMAGE_FILE_MACHINE_SH4 = 0x1a6, IMAGE_FILE_MACHINE_SH5 = 0x1a8, IMAGE_FILE_MACHINE_ARM = 0x1c0, IMAGE_FILE_MACHINE_THUMB = 0x1c2, IMAGE_FILE_MACHINE_ARMNT = 0x1c4, IMAGE_FILE_MACHINE_POWERPC = 0x1f0, IMAGE_FILE_MACHINE_POWERPCFP = 0x1f1, IMAGE_FILE_MACHINE_IA64 = 0x200, IMAGE_FILE_MACHINE_MIPS1 = 0x266, IMAGE_FILE_MACHINE_MIPSF = 0x366, IMAGE_FILE_MACHINE_MIPSF = 0x466, IMAGE_FILE_MACHINE_EBC = 0xebc, IMAGE_FILE_MACHINE_RISCV32 = 0x5032, IMAGE_FILE_MACHINE_RISCV64 = 0x5064, IMAGE_FILE_MACHINE_RISCV128 = 0x5128, IMAGE_FILE_MACHINE_AMD64 = 0x8664, IMAGE_FILE_MACHINE_M32R = 0x9041, IMAGE_FILE_MACHINE_ARM64 = 0xaa64, IMAGE_FILE_MACHINE_AMD64 = 0x8664, } -- Section Flags, of Characteristics field, of Section Header local SectionCharacteristics = enum { IMAGE_SCN_RESERVED_1 = 0x00000000; IMAGE_SCN_RESERVED_2 = 0x00000001; IMAGE_SCN_RESERVED_3 = 0x00000002; IMAGE_SCN_RESERVED_4 = 0x00000004; IMAGE_SCN_TYPE_NO_PAD = 0x00000008; IMAGE_SCN_RESERVED_5 = 0x00000010; IMAGE_SCN_CNT_CODE = 0x00000020 ; IMAGE_SCN_CNT_INITIALIZED_DATA = 0x00000040 ; IMAGE_SCN_CNT_UNINITIALIZED_DATA= 0x00000080 ; IMAGE_SCN_LNK_OTHER = 0x00000100 ; IMAGE_SCN_LNK_INFO = 0x00000200 ; IMAGE_SCN_RESERVED_6 = 0x00000400; IMAGE_SCN_LNK_REMOVE = 0x00000800 ; IMAGE_SCN_LNK_COMDAT = 0x00001000 ; IMAGE_SCN_GPREL = 0x00008000 ; IMAGE_SCN_MEM_PURGEABLE = 0x00020000 ; IMAGE_SCN_MEM_16BIT = 0x00020000 ; IMAGE_SCN_MEM_LOCKED = 0x00040000 ; IMAGE_SCN_MEM_PRELOAD = 0x00080000 ; IMAGE_SCN_ALIGN_1BYTES = 0x00100000 ; IMAGE_SCN_ALIGN_2BYTES = 0x00200000 ; IMAGE_SCN_ALIGN_4BYTES = 0x00300000 ; IMAGE_SCN_ALIGN_8BYTES = 0x00400000 ; IMAGE_SCN_ALIGN_16BYTES = 0x00500000 ; IMAGE_SCN_ALIGN_32BYTES = 0x00600000 ; IMAGE_SCN_ALIGN_64BYTES = 0x00700000 ; IMAGE_SCN_ALIGN_128BYTES = 0x00800000 ; IMAGE_SCN_ALIGN_256BYTES = 0x00900000 ; IMAGE_SCN_ALIGN_512BYTES = 0x00A00000 ; IMAGE_SCN_ALIGN_1024BYTES = 0x00B00000 ; IMAGE_SCN_ALIGN_2048BYTES = 0x00C00000 ; IMAGE_SCN_ALIGN_4096BYTES = 0x00D00000 ; IMAGE_SCN_ALIGN_8192BYTES = 0x00E00000 ; IMAGE_SCN_LNK_NRELOC_OVFL = 0x01000000 ; IMAGE_SCN_MEM_DISCARDABLE = 0x02000000 ; IMAGE_SCN_MEM_NOT_CACHED = 0x04000000 ; IMAGE_SCN_MEM_NOT_PAGED = 0x08000000 ; IMAGE_SCN_MEM_SHARED = 0x10000000 ; IMAGE_SCN_MEM_EXECUTE = 0x20000000 ; IMAGE_SCN_MEM_READ = 0x40000000 ; IMAGE_SCN_MEM_WRITE = 0x80000000 ; } -- Resource Types local DIFFERENCE = 11 local ResourceTypes = enum { RT_CURSOR = MAKEINTRESOURCE(1); RT_BITMAP = MAKEINTRESOURCE(2); RT_ICON = MAKEINTRESOURCE(3); RT_MENU = MAKEINTRESOURCE(4); RT_DIALOG = MAKEINTRESOURCE(5); RT_STRING = MAKEINTRESOURCE(6); RT_FONTDIR = MAKEINTRESOURCE(7); RT_FONT = MAKEINTRESOURCE(8); RT_ACCELERATOR = MAKEINTRESOURCE(9); RT_RCDATA = MAKEINTRESOURCE(10); RT_MESSAGETABLE = MAKEINTRESOURCE(11); RT_GROUP_CURSOR = 1 + 11; -- MAKEINTRESOURCE((ULONG_PTR)RT_CURSOR + DIFFERENCE); RT_GROUP_ICON = 3 + 11; -- MAKEINTRESOURCE((ULONG_PTR)RT_ICON + DIFFERENCE); RT_VERSION = MAKEINTRESOURCE(16); RT_DLGINCLUDE = MAKEINTRESOURCE(17); RT_PLUGPLAY = MAKEINTRESOURCE(19); RT_VXD = MAKEINTRESOURCE(20); RT_ANICURSOR = MAKEINTRESOURCE(21); RT_ANIICON = MAKEINTRESOURCE(22); RT_HTML = MAKEINTRESOURCE(23); RT_MANIFEST = 24; } --[[ Manifest related CREATEPROCESS_MANIFEST_RESOURCE_ID = 1; ISOLATIONAWARE_MANIFEST_RESOURCE_ID = 2; ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID = 3; MINIMUM_RESERVED_MANIFEST_RESOURCE_ID = 1; MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID = 16; --]] local exports = { DirectoryID = DirectoryID; DllCharacteristics = DllCharacteristics, Subsystem = Subsystem, OptHeaderMagic = OptHeaderMagic, Characteristics = Characteristics, MachineType = MachineType, ResourceTypes = ResourceTypes, SectionCharacteristics = SectionCharacteristics; } setmetatable(exports, { __call = function(self, ...) for k,v in pairs(exports) do _G[k] = v; end end, }) return exports
--Boot Registry print('load telnet server module') dofile('telnet-server.lua') print('load enduser server module') dofile('enduser.lua') print('load main module') dofile('main.lua') --dofile("mqtt.lua")
fx_version 'bodacious' game 'gta5' server_scripts { '@vrp/lib/utils.lua', 'config.lua', 'server.lua' } client_scripts { '@vrp/lib/utils.lua', 'config.lua', 'client.lua' }
-- Anti-cram script by Devieth -- Script for SAPP crams = {} --Types: 0 = All, 1 = Light, 2 = Heavy, 3 = Air --Example: crams[x] = {x, y, z, r, type, map} crams[1] = {40.2, -75.2, 0, 1, 0, "bloodgulch"} crams[2] = {40.1, -82.75, 0, 1, 0, "bloodgulch"} crams[3] = {95.5, -156.2, 0, 1, 0, "bloodgulch"} crams[4] = {95.5, -162.75, 0, 1, 0, "bloodgulch"} crams[5] = {-12.00, 4.88, -2.35, 5, 0, "dangercanyon"} --red tunnel danger canyon crams[6] = {-12.00, -3.45, -2.24, 12, 2, "dangercanyon"} --anti-tank red danger canyon crams[7] = {12.00, -3.45, -2.24, 12, 2, "dangercanyon"} --anti-tank blue danger canyon crams[8] = {12.00, 4.88, -2.35, 5, 0, "dangercanyon"} --blue tunnel danger canyon --crams[9] = types = {} types[1] = {1, "ghost_mp"} types[2] = {1, "rwarthog"} types[3] = {1, "mp_warthog"} types[4] = {2, "scorpion_mp"} types[5] = {3, "banshee_mp"} api_version = "1.10.0.0" function OnScriptLoad() register_callback(cb['EVENT_TICK'], "OnEventTick") register_callback(cb['EVENT_GAME_START'], "OnGameStart") if tonumber(get_var(0, "$running")) == 1 then OnGameStart() end end function OnScriptUnload() end function OnGameStart() map = read_string(read_dword(sig_scan("B8??????00E8??????0032C983F813") + 0x1)) end function OnEventTick() for i = 1,16 do if player_alive(i) then local m_object = get_dynamic_player(i) if tonumber(m_object) ~= 0 then if tonumber(read_char(m_object + 0x2F0)) ~= -1 then if cramming(m_object) then exit_vehicle(i) end end end end end end function cramming(m_object) local m_vehicle = get_object_memory(read_dword(m_object + 0x11C)) for i = 1,#crams do local type = get_vehicle_type(m_vehicle) if crams[i][5] == type or crams[i][5] == 0 then if vehicle_in_sphere(m_vehicle, crams[i][1], crams[i][2], crams[i][3], crams[i][4]) and map == crams[i][6] then timer(100, "move_to_spawn", m_vehicle) return true end end end return false end function move_to_spawn(m_vehicle) local allow = true local driver = read_char(m_vehicle + 0x324) local gunner = read_char(m_vehicle + 0x328) if driver == -1 and gunner == -1 then local x,y,z = read_vector3d(m_vehicle + 0x5B4) write_vector3d(m_vehicle + 0x5c, x, y, z) write_float(m_vehicle + 0x4D4, 0) allow = false end return allow end function get_vehicle_type(m_vehicle) local ID = read_dword(m_vehicle) local tagarray = read_dword(0x40440000) for i=0,read_word(0x4044000C)-1 do local tag = tagarray + i * 0x20 local tagid = read_dword(tag + 0xC) if ID == tagid then local tag_path = read_string(read_dword(tag + 0x10)) local t = tokenizestring(tag_path, "\\") for x=1,#types do if t[3] == types[x][2] then vehi_type = types[x][1] end end break end end return vehi_type end function vehicle_in_sphere(m_vehicle, X, Y, Z, R) local x,y,z = read_vector3d(m_vehicle + 0x5c) if (X - tonumber(x))^2 + (Y - tonumber(y))^2 + (Z - tonumber(z))^2 <= R then return true end return false end function tokenizestring(inputstr, sep) if sep == nil then sep = "%s" end local t={} ; i=1 for str in string.gmatch(inputstr, "([^"..sep.."]+)") do t[i] = str i = i + 1 end return t end
local nmap = require "nmap" local stdnse = require "stdnse" local string = require "string" local table = require "table" local target = require "target" description = [[ Resolves hostnames and adds every address (IPv4 or IPv6, depending on Nmap mode) to Nmap's target list. This differs from Nmap's normal host resolution process, which only scans the first address (A or AAAA record) returned for each host name. ]] --- -- @usage -- nmap --script=resolveall --script-args=newtargets,resolveall.hosts={<host1>, ...} ... -- @args resolveall.hosts Table of hosts to resolve -- @output -- Pre-scan script results: -- | resolveall: -- | Host 'google.com' resolves to: -- | 74.125.39.106 -- | 74.125.39.147 -- | 74.125.39.99 -- | 74.125.39.103 -- | 74.125.39.105 -- | 74.125.39.104 -- |_ Successfully added 6 new targets author = "Kris Katterjohn" license = "Same as Nmap--See http://nmap.org/book/man-legal.html" categories = {"safe", "discovery"} prerule = function() if not stdnse.get_script_args("resolveall.hosts") then stdnse.print_debug(3, "Skipping '%s' %s, 'resolveall.hosts' argument is missing.", SCRIPT_NAME, SCRIPT_TYPE) return false end return true end local addtargets = function(list) local sum = 0 for _, t in ipairs(list) do local st, err = target.add(t) if st then sum = sum + 1 else stdnse.print_debug("Couldn't add target " .. t .. ": " .. err) end end return sum end action = function() local hosts = stdnse.get_script_args("resolveall.hosts") if type(hosts) ~= "table" then hosts = {hosts} end local sum, output = 0, {} for _, host in ipairs(hosts) do local status, list = nmap.resolve(host, nmap.address_family()) if status and #list > 0 then if target.ALLOW_NEW_TARGETS then sum = sum + addtargets(list) end table.insert(output, string.format("Host '%s' resolves to:", host)) table.insert(output, list) end end if sum > 0 then table.insert(output, string.format("Successfully added %d new targets", tostring(sum))) else table.insert(output, "Use the 'newtargets' script-arg to add the results as targets") end return stdnse.format_output(true, output) end
return process_tick(now, false)['running']
--[[ Based on a plugin by topkecleon. Copyright 2017 wrxck <matthew@matthewhesketh.com> This code is licensed under the MIT. See LICENSE for details. ]] local channel = {} local mattata = require('mattata') local socket = require('socket') local json = require('dkjson') local redis = require('mattata-redis') function channel:init() channel.commands = mattata.commands( self.info.username ):command('channel') :command('ch') :command('msg').table channel.help = [[/channel <channel> <message> - Sends a message to a Telegram channel/group. The channel/group can be specified via ID or username. Messages can be formatted with Markdown. Users can only send messages to channels/groups they own/administrate. Aliases: /ch, /msg.]] end function channel:on_callback_query(callback_query, message) local request = json.decode( redis:hget( 'temp:channel', callback_query.data ) ) if request.from ~= callback_query.from.id then return mattata.answer_callback_query( callback_query.id, 'You are not allowed to use this!' ) elseif not mattata.is_group_admin( request.target, request.from ) then return mattata.answer_callback_query( callback_query.id, 'You don\'t appear to be an administrator in that chat anymore!' ) end local success = mattata.send_message( request.target, request.text, 'markdown' ) if not success then return mattata.edit_message_text( message.chat.id, message.message_id, 'I couldn\'t send your message, are you sure I still have permission to send messages in that chat?' ) end redis:hdel( 'temp:channel', callback_query.data ) return mattata.edit_message_text( message.chat.id, message.message_id, 'Your message has been sent!' ) end function channel:on_message(message, configuration) if message.chat.type == 'channel' then return end local input = mattata.input(message.text) if not input then return mattata.send_reply( message, channel.help ) end local target = mattata.get_word(input) if tonumber(target) == nil and not target:match('^@') then target = '@' .. target end target = mattata.get_chat_id(target) or target local admin_list = mattata.get_chat_administrators(target) if not admin_list and not mattata.is_global_admin(message.from.id) then return mattata.send_reply( message, 'I was unable to retrieve a list of administrators for that chat!' ) elseif not mattata.is_global_admin(message.from.id) then -- Make configured owners an exception. local is_admin = false for _, admin in ipairs(admin_list.result) do if admin.user.id == message.from.id then is_admin = true end end if not is_admin then return mattata.send_reply( message, 'You don\'t appear to be an administrator in that chat!' ) end end local text = input:match(' (.-)$') if not text then return mattata.send_reply( message, 'Please specify the message to send, using the syntax /channel <channel> <message>.' ) end local request_id = tostring(socket.gettime()):gsub('%D', '') local success = mattata.send_message( message.chat.id, '*Are you sure you want to send this message? This is how it will look:*\n\n' .. text, 'markdown', true, false, nil, json.encode( { ['inline_keyboard'] = { { { ['text'] = 'Yes, I\'m sure!', ['callback_data'] = string.format( 'channel:%s', request_id ) } } } } ) ) if not success then return mattata.send_reply( message, 'That message contains invalid Markdown formatting! Please correct your syntax and try again.' ) end redis:hset( 'temp:channel', request_id, json.encode( { ['target'] = target, ['text'] = text, ['from'] = message.from.id } ) ) return end return channel
if (CLIENT) then SWEP.PrintName = "MAC-10 SMG" SWEP.Slot = 2 SWEP.SlotPos = 0 SWEP.IconLetter = "d" SWEP.DrawAmmo = true SWEP.DrawCrosshair = false SWEP.CSMuzzleFlashes = true SWEP.SwayScale = 1.0 SWEP.BobScale = 1.0 killicon.AddFont("weapon_mp5_ocrp","CSKillIcons",SWEP.IconLetter,Color(255,80,0,255)) end if (SERVER) then AddCSLuaFile("shared.lua") end SWEP.Base = "weapon_basegun_ocrp" SWEP.ViewModelFOV = 72 SWEP.ViewModelFlip = true SWEP.ViewModel = "models/weapons/v_smg_mac10.mdl" SWEP.WorldModel = "models/weapons/w_smg_mac10.mdl" SWEP.HoldType = "smg" SWEP.Peircing = 3 SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false SWEP.Primary.Sound = Sound("Weapon_Mac10.Single") SWEP.Primary.Recoil = .6 SWEP.Primary.Delay = 0.06 SWEP.Primary.Damage = 23 SWEP.Primary.NumShots = 1 SWEP.Primary.Cone = 0.08 SWEP.Primary.ClipSize = 30 SWEP.Primary.DefaultClip = 0 SWEP.Primary.Automatic = true SWEP.Primary.Ammo = "SMG1" SWEP.Assualt = true SWEP.SightsPos = Vector (5.5851, 1.2612, -0.4635) SWEP.SightsAng = Vector (-0.382, 7.5612, 7.1634) SWEP.IronSightsPos = Vector (6.4857, -5.1825, 2.8605) SWEP.IronSightsAng = Vector (1.0528, 5.3537, 6.88)
-- This file only exists to indicate that this is the Git Edition of the mod BA2_GIT = true
local L2LossCriterion, parent = torch.class('nn.L2LossCriterion', 'nn.Criterion') -- This function is only for handling the output of softmax layer local epsilon = 1e-35 --to avoid calculating log(0) or dividing 0 function L2LossCriterion:__init(margin) parent.__init(self) self.sizeAverage = false self.margin = margin or 2 -- 2 is the empirical value for mnist end function L2LossCriterion:KLDiv(target, input) -- The function calculates the KL-divergence -- target and input must be dim==1 self.buf_t = self.buf_t or target.new() self.buf_t:resizeAs(target) self.buf_i = self.buf_i or input.new() self.buf_i:resizeAs(input) -- KL(T||I) = \sum T(logT-logI) self.buf_t = target + epsilon self.buf_i = input + epsilon self.buf_t:log() -- logT self.buf_i:log() -- logI self.buf_t = self.buf_t - self.buf_i --logT-logI local dist = self.buf_t:cmul(target):sum() -- a number return dist end function L2LossCriterion:loss(p, q, target) local loss = self:KLDiv(p, q) loss = torch.cmul((torch.ones(target:size(1)) - target), loss) + torch.cmul(target, (torch.max(torch.zeros(target:size(1)), self.margin - loss, 2))) return loss end function L2LossCriterion:updateOutput(pairss, target) local pair_count = target:size(1) self.output = self.output + self:loss(pairss[1], pairss[2], target) self.output = self.output / pair_count return self.output end function L2LossCriterion:updateGradInput(input, target) --assert(input:dim() == 2) --assert(input:size(1) > 1) local pair_count = 0 local pair_idx = 0 local factor = 0 -- Indicator of similar pair (similar: 1; dissimilar: -1) self.gradInput = self.gradInput or input.new() if self.gradInput:type() ~= input:type() then self.gradInput = input.new() end self.gradInput:resizeAs(input):fill(0) self.buf = self.buf or input[1].new() self.buf:resizeAs(input[1]) if target:dim() == 1 then pair_count = target:size(1) * (target:size(1) + 1) / 2 - target:size(1) elseif target:size(1) == target:size(2) then pair_count = target:ne(0):sum() / 2 else pair_count = target:size(1) end -- target is nx1 class label or nxn relationship matrix if target:dim() == 1 or target:size(1) == target:size(2) then for i = 1, input:size(1) do for j = 1, input:size(1) do if i ~= j and self:is_pair_labeled(i, j, target) then pair_idx = pair_idx + 1 if self:is_simi_pair(i, j, target) then factor = 1 else factor = -1 end local loss = self:loss(j, i, input, factor == 1, pair_idx, true) if loss ~= 0 then self.buf:copy(input[j]):cdiv(input[i] + epsilon):mul(-1) self.gradInput[i] = self.gradInput[i] + self.buf:mul(factor) end end end end -- target is nx3: (i,j,relationship); relationship= 1:similar pair, 0: dissimilar pair else for p = 1, pair_count do local i, j, s = target[p][1], target[p][2], target[p][3] s = s == 1 local loss_i = self:loss(j, i, input, s, p, true) --read the loss from cache local loss_j = self:loss(i, j, input, s, pair_count + p, true) if s then factor = 1 else factor = -1 end -- Implementation trick: Ignore the gradient when loss=0 (even it is a similar pair). -- The trick saves some computation and doesn't affect the result. -- Do the clustering multiple times with random initialization is the key to reach lower training error. -- dloss(p,q)/dq_i = -p_i/q_i if loss_i ~= 0 then self.buf:copy(input[j]):cdiv(input[i] + epsilon):mul(-1) self.gradInput[i] = self.gradInput[i] + self.buf:mul(factor) end -- dloss(q,p)/dp_i = -q_i/p_i if loss_j ~= 0 then self.buf:copy(input[i]):cdiv(input[j] + epsilon):mul(-1) self.gradInput[j] = self.gradInput[j] + self.buf:mul(factor) end end end -- average by size if self.sizeAverage then self.gradInput = self.gradInput:div(pair_count) end return self.gradInput end
object_draft_schematic_droid_droid_asn_121 = object_draft_schematic_droid_shared_droid_asn_121:new { } ObjectTemplates:addTemplate(object_draft_schematic_droid_droid_asn_121, "object/draft_schematic/droid/droid_asn_121.iff")