content
stringlengths
5
1.05M
-- -- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the "License"); you may not use this file except in compliance with -- the License. You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- local require = require local pcall = pcall local open = io.open local popen = io.popen local exit = os.exit local stderr = io.stderr local str_format = string.format local tonumber = tonumber local _M = {} -- Note: The `execute_cmd` return value will have a line break at the end, -- it is recommended to use the `trim` function to handle the return value. function _M.execute_cmd(cmd) --使用io.popen函数来执行命令(和直接在命令行界面执行命令的结果上一样的,不过使用函数这种方式的结果保存在文件中),在这里执行的就是下面的pwd命令 local t, err = popen(cmd) --这里返回的t其实是一个文件描述符 if not t then return nil, "failed to execute command: " .. cmd .. ", error info: " .. err end local data, err = t:read("*all") --执行read命令读取文件 t:close() if err ~= nil then return nil, "failed to read execution result of: " .. cmd .. ", error info: " .. err end return data --结尾的\n是换行符 end function _M.trim(s) return (s:gsub("^%s*(.-)%s*$", "%1")) end function _M.split(self, sep) local sep, fields = sep or ":", {} local pattern = str_format("([^%s]+)", sep) -- 符合pattern 则回调函数 self:gsub(pattern, function(c) fields[#fields + 1] = c end) return fields end function _M.read_file(file_path) local file, err = open(file_path, "rb") if not file then return false, "failed to open file: " .. file_path .. ", error info:" .. err end local data, err = file:read("*all") if err ~= nil then file:close() return false, "failed to read file: " .. file_path .. ", error info:" .. err end file:close() return data end function _M.die(...) stderr:write(...) exit(1) end function _M.is_32bit_arch() local ok, ffi = pcall(require, "ffi") if ok then -- LuaJIT return ffi.abi("32bit") end local ret = _M.execute_cmd("getconf LONG_BIT") local bits = tonumber(ret) return bits <= 32 end function _M.write_file(file_path, data) local file, err = open(file_path, "w+") if not file then return false, "failed to open file: " .. file_path .. ", error info:" .. err end file:write(data) file:close() return true end function _M.is_file_exist(file_path) local file, err = open(file_path) if not file then return false, "failed to open file: " .. file_path .. ", error info: " .. err end file:close() return true end return _M
local ops = require("redisOps") --加载redis操作模块 local row = ops.rawRow() --数据库当前变更的一行数据,table类型,key为列名称 local action = ops.rawAction() --当前数据库事件,包括:insert、updare、delete local userName = row["USER_NAME"] --获取USER_NAME列的值 local createTime = row["CREATE_TIME"] --获取CREATE_TIME列的值,13位时间戳 local key = "users" if action == "insert" -- 监听insert事件 then ops.ZADD(key, createTime, userName) elseif action == "update" -- 监听update事件 then local oldRow = ops.rawOldRow() --数据库变更之前的数据(修改之前的数据) local oldUserName = oldRow["USER_NAME"] --获取USER_NAME列的值 ops.ZREM(key,oldUserName) -- 删除旧值 ops.ZADD(key, createTime, userName) --插入新值 else -- 监听删除事件 ops.ZREM(key,userName) -- 删除旧值 end
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ========== PlaceObj('DomeSkins', { construction_entity = "DomeBasicFacetConstruction", cupola_entity = "DomeBasicFacet_Glass", cupola_entity_opt = "DomeBasicFacet_Top", entity = "DomeBasicFacet", entrance_entity = "DomeFacet_Entrance", id = "DomeBasicFacet", preset = "Facet", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomeFacet_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeDiamondConstruction", cupola_entity = "DomeDiamond_Glass", cupola_entity_opt = "DomeDiamond_Top", dome_type = "DomeDiamond", entity = "DomeDiamond", entrance_entity = "DomePack_Entrance", group = "Default", id = "DomeDiamondAngular", palette_color1 = "outside_base", palette_color2 = "mining_base", palette_color3 = "pipes_metal", preset = "Angular", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomePack_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeHexaConstruction", cupola_entity = "DomeHexa_Glass", cupola_entity_opt = "DomeHexa_Top", dome_type = "DomeHexa", entity = "DomeHexa", entrance_entity = "DomePack_Entrance", group = "Default", id = "DomeHexaAngular", palette_color1 = "outside_base", palette_color2 = "mining_base", palette_color3 = "pipes_metal", preset = "Angular", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomePack_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeMediumFacetConstruction", cupola_entity = "DomeMediumFacet_Glass", cupola_entity_opt = "DomeMediumFacet_Top", dome_type = "DomeMedium", entity = "DomeMediumFacet", entrance_entity = "DomeFacet_Entrance", id = "DomeMediumFacet", preset = "Facet", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomeFacet_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeMegaFacetConstruction", cupola_entity = "DomeMegaFacet_Glass", cupola_entity_opt = "DomeMegaFacet_Top", dome_type = "DomeMega", entity = "DomeMegaFacet", entrance_entity = "DomeFacet_Entrance", id = "DomeMegaFacet", preset = "Facet", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomeFacet_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeMegaTrigonConstruction", cupola_entity = "DomeMegaTrigon_Glass", cupola_entity_opt = "DomeMegaTrigon_Top", dome_type = "DomeMegaTrigon", entity = "DomeMegaTrigon", entrance_entity = "DomePack_Entrance", group = "Default", id = "DomeMegaTrigonAngular", palette_color1 = "outside_base", palette_color2 = "mining_base", palette_color3 = "pipes_metal", preset = "Angular", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomePack_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeMicroConstruction", cupola_entity = "DomeMicro_Glass", cupola_entity_opt = "DomeMicro_Top", dome_type = "DomeMicro", entity = "DomeMicro", entrance_entity = "DomePack_Entrance", group = "Default", id = "DomeMicroAngular", palette_color1 = "outside_base", palette_color2 = "mining_base", palette_color3 = "pipes_metal", preset = "Angular", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomePack_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeOvalFacetConstruction", cupola_entity = "DomeOvalFacet_Glass", cupola_entity_opt = "DomeOvalFacet_Top", dome_type = "DomeOval", entity = "DomeOvalFacet", entrance_entity = "DomeFacet_Entrance", id = "DomeOvalFacet", preset = "Facet", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomeFacet_EntranceTube", }) PlaceObj('DomeSkins', { construction_entity = "DomeTrigonConstruction", cupola_entity = "DomeTrigon_Glass", cupola_entity_opt = "DomeTrigon_Top", dome_type = "DomeTrigon", entity = "DomeTrigon", entrance_entity = "DomePack_Entrance", group = "Default", id = "DomeTrigonAngular", palette_color1 = "outside_base", palette_color2 = "mining_base", palette_color3 = "pipes_metal", preset = "Angular", road_connection = "DomeRoadAsphaltConnection", tube_entrance_entity = "DomePack_EntranceTube", })
AddCSLuaFile("shared.lua") include("shared.lua") SWEP.ManaCost = NEO_MANA_COST function SWEP:SecondaryAttack() if self.Owner:GetMana() > self.ManaCost then self.Owner:SetVelocity(self.Owner:GetForward() * 1000) self.Owner:TakeMana(self.ManaCost) end end
local function SendMissingExtenderMessage(uuid) local character = Ext.GetCharacter(uuid) if character and character.UserID ~= character.ReservedUserID and character.IsPlayer and CharacterIsControlled(uuid) == 1 then return Ext.PlayerHasExtender(uuid) end return false end Ext.RegisterOsirisListener("UserConnected", 3, "after", function(id, username, profileId) Vars.Users[profileId] = {ID = id, Name=username} if Ext.GetGameState() == "Running" then if GlobalGetFlag("LeaderLib_AutoUnlockInventoryInMultiplayer") == 1 then IterateUsers("Iterators_LeaderLib_UI_UnlockPartyInventory") end SettingsManager.SyncAllSettings(id) local host = CharacterGetHostCharacter() local uuid = GetCurrentCharacter(id) if not StringHelpers.IsNullOrEmpty(uuid) and host ~= uuid and SendMissingExtenderMessage(uuid) then OpenMessageBox(uuid, "LeaderLib_MessageBox_ExtenderNotInstalled_Client") local text = GameHelpers.GetStringKeyText("LeaderLib_MessageBox_ExtenderNotInstalled_HostMessageText"):gsub("%[1%]", username) OpenMessageBox(host, text) --local hostText = GameHelpers.GetStringKeyText("LeaderLib_MessageBox_ExtenderNotInstalled_HostMessageText"):gsub("%[1%]", username) --GameHelpers.UI.ShowMessageBox(hostText, host, 0, GameHelpers.GetStringKeyText("LeaderLib_MessageBox_ExtenderNotInstalled_HostMessageTitle")) end end end) Ext.RegisterOsirisListener("UserDisconnected", 3, "after", function(id, username, profileId) Vars.Users[profileId] = nil end) Ext.RegisterOsirisListener("UserEvent", 2, "after", function(id, event) if event == "Iterators_LeaderLib_UI_UnlockPartyInventory" and SharedData.RegionData.LevelType == LEVELTYPE.GAME then Ext.PostMessageToUser(id, "LeaderLib_UnlockCharacterInventory", "") end end) -- Ext.RegisterOsirisListener("CharacterAddToCharacterCreation", 3, "after", function(uuid, respec, success) -- if success == 1 then -- Timer.StartOneshot("", 1, function() -- Ext.PostMessageToClient(uuid, "LeaderLib_CCStarted", Ext.GetCharacter(uuid).NetID) -- end) -- end -- end) Ext.RegisterOsirisListener("GameStarted", 2, "after", function(region, isEditorMode) Vars.IsEditorMode = isEditorMode Ext.BroadcastMessage("LeaderLib_SyncFeatures", Ext.JsonStringify(Features), nil) end) local function OnLog(logType, ...) if Osi.LeaderLib_QRY_AnyGoalsAreActive("LeaderLib_00_0_TS_StrictLogCalls", "LeaderLib_00_0_TS_AllLogging") == true then return end if logType == "COMBINE" or Vars.DebugMode or Osi.LeaderLog_QRY_LogTypeEnabled(logType) == true then local params = {...} local msg = StringHelpers.Join("", params) Osi.LeaderLog_Internal_RunString(logType, msg) if Vars.DebugMode then Ext.Print(string.format("[LeaderLib:Log(%s)] %s", logType, msg)) end end end -- if Vars.DebugMode then -- for i=1,16 do -- Ext.RegisterOsirisListener("LeaderLog_Log", i, "before", OnLog) -- end -- end local function GlobalFlagChanged(flag, enabled) local flagListeners = Listeners.GlobalFlagChanged[flag] if flagListeners then InvokeListenerCallbacks(flagListeners, flag, enabled) end end Ext.RegisterOsirisListener("GlobalFlagSet", 1, "after", function(flag) GlobalFlagChanged(flag, true) end) Ext.RegisterOsirisListener("GlobalFlagCleared", 1, "after", function(flag) GlobalFlagChanged(flag, false) end) local function OnObjectDying(obj) obj = StringHelpers.GetUUID(obj) local isSummon = false local owner = nil local summon = ObjectExists(obj) == 1 and Ext.GetGameObject(obj) or nil for ownerId,tbl in pairs(PersistentVars.Summons) do for i,uuid in pairs(tbl) do if uuid == obj then owner = Ext.GetGameObject(ownerId) table.remove(tbl, i) isSummon = true end end if #tbl == 0 then PersistentVars.Summons[ownerId] = nil end end if isSummon then InvokeListenerCallbacks(Listeners.OnSummonChanged, summon or obj, owner, true, ObjectIsItem(obj) == 1) end end Ext.RegisterOsirisListener("CharacterPrecogDying", Data.OsirisEvents.CharacterPrecogDying, "before", OnObjectDying) Ext.RegisterOsirisListener("ItemDestroying", Data.OsirisEvents.ItemDestroying, "before", OnObjectDying) local function OnObjectEvent(event, ...) InvokeListenerCallbacks(Listeners.ObjectEvent[event], ...) InvokeListenerCallbacks(Listeners.ObjectEvent._All, ...) end Ext.RegisterOsirisListener("StoryEvent", Data.OsirisEvents.StoryEvent, "before", function(object, event) OnObjectEvent(event, StringHelpers.GetUUID(object)) end) Ext.RegisterOsirisListener("CharacterCharacterEvent", Data.OsirisEvents.CharacterCharacterEvent, "before", function(obj1, obj2, event) OnObjectEvent(event, StringHelpers.GetUUID(obj1), StringHelpers.GetUUID(obj2)) end) Ext.RegisterOsirisListener("CharacterItemEvent", Data.OsirisEvents.CharacterItemEvent, "before", function(obj1, obj2, event) OnObjectEvent(event, StringHelpers.GetUUID(obj1), StringHelpers.GetUUID(obj2)) end) ---@param item EsvItem RegisterProtectedExtenderListener("TreasureItemGenerated", function(item) InvokeListenerCallbacks(Listeners.TreasureItemGenerated, item, item and item.StatsId or "") end)
require "Wherigo" ZonePoint = Wherigo.ZonePoint Distance = Wherigo.Distance Player = Wherigo.Player -- String decode -- function _dEX(str) local res = "" local dtable = "\055\042\063\077\064\039\067\105\024\019\025\115\032\124\125\040\059\114\101\010\006\023\104\046\119\018\074\034\102\089\099\056\075\122\017\083\110\068\044\076\035\096\015\007\001\065\053\003\054\090\021\072\047\097\084\116\013\082\020\094\033\022\057\070\043\061\079\038\121\118\095\085\016\005\028\066\107\087\009\081\108\093\014\106\071\113\012\031\073\002\109\078\050\062\000\011\008\030\026\058\069\123\060\103\126\100\088\112\041\051\091\117\049\052\029\111\080\045\086\120\004\036\027\037\098\048\092" for i=1, #str do local b = str:byte(i) if b > 0 and b <= 0x7F then res = res .. string.char(dtable:byte(b)) else res = res .. string.char(b) end end return res end -- Internal functions -- require "table" require "math" math.randomseed(os.time()) math.random() math.random() math.random() _Urwigo = {} _Urwigo.InlineRequireLoaded = {} _Urwigo.InlineRequireRes = {} _Urwigo.InlineRequire = function(moduleName) local res if _Urwigo.InlineRequireLoaded[moduleName] == nil then res = _Urwigo.InlineModuleFunc[moduleName]() _Urwigo.InlineRequireLoaded[moduleName] = 1 _Urwigo.InlineRequireRes[moduleName] = res else res = _Urwigo.InlineRequireRes[moduleName] end return res end _Urwigo.Round = function(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end _Urwigo.Ceil = function(num, idp) local mult = 10^(idp or 0) return math.ceil(num * mult) / mult end _Urwigo.Floor = function(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult) / mult end _Urwigo.DialogQueue = {} _Urwigo.RunDialogs = function(callback) local dialogs = _Urwigo.DialogQueue local lastCallback = nil _Urwigo.DialogQueue = {} local msgcb = {} msgcb = function(action) if action ~= nil then if lastCallback ~= nil then lastCallback(action) end local entry = table.remove(dialogs, 1) if entry ~= nil then lastCallback = entry.Callback; if entry.Text ~= nil then Wherigo.MessageBox({Text = entry.Text, Media=entry.Media, Buttons=entry.Buttons, Callback=msgcb}) else msgcb(action) end else if callback ~= nil then callback() end end end end msgcb(true) -- any non-null argument end _Urwigo.MessageBox = function(tbl) _Urwigo.RunDialogs(function() Wherigo.MessageBox(tbl) end) end _Urwigo.OldDialog = function(tbl) _Urwigo.RunDialogs(function() Wherigo.Dialog(tbl) end) end _Urwigo.Dialog = function(buffered, tbl, callback) for k,v in ipairs(tbl) do table.insert(_Urwigo.DialogQueue, v) end if callback ~= nil then table.insert(_Urwigo.DialogQueue, {Callback=callback}) end if not buffered then _Urwigo.RunDialogs(nil) end end _Urwigo.Hash = function(str) local b = 378551; local a = 63689; local hash = 0; for i = 1, #str, 1 do hash = hash*a+string.byte(str,i); hash = math.fmod(hash, 65535) a = a*b; a = math.fmod(a, 65535) end return hash; end _Urwigo.DaysInMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, } _Urwigo_Date_IsLeapYear = function(year) if year % 400 == 0 then return true elseif year% 100 == 0 then return false elseif year % 4 == 0 then return true else return false end end _Urwigo.Date_DaysInMonth = function(year, month) if month ~= 2 then return _Urwigo.DaysInMonth[month]; else if _Urwigo_Date_IsLeapYear(year) then return 29 else return 28 end end end _Urwigo.Date_DayInYear = function(t) local res = t.day for month = 1, t.month - 1 do res = res + _Urwigo.Date_DaysInMonth(t.year, month) end return res end _Urwigo.Date_HourInWeek = function(t) return t.hour + (t.wday-1) * 24 end _Urwigo.Date_HourInMonth = function(t) return t.hour + t.day * 24 end _Urwigo.Date_HourInYear = function(t) return t.hour + (_Urwigo.Date_DayInYear(t) - 1) * 24 end _Urwigo.Date_MinuteInDay = function(t) return t.min + t.hour * 60 end _Urwigo.Date_MinuteInWeek = function(t) return t.min + t.hour * 60 + (t.wday-1) * 1440; end _Urwigo.Date_MinuteInMonth = function(t) return t.min + t.hour * 60 + (t.day-1) * 1440; end _Urwigo.Date_MinuteInYear = function(t) return t.min + t.hour * 60 + (_Urwigo.Date_DayInYear(t) - 1) * 1440; end _Urwigo.Date_SecondInHour = function(t) return t.sec + t.min * 60 end _Urwigo.Date_SecondInDay = function(t) return t.sec + t.min * 60 + t.hour * 3600 end _Urwigo.Date_SecondInWeek = function(t) return t.sec + t.min * 60 + t.hour * 3600 + (t.wday-1) * 86400 end _Urwigo.Date_SecondInMonth = function(t) return t.sec + t.min * 60 + t.hour * 3600 + (t.day-1) * 86400 end _Urwigo.Date_SecondInYear = function(t) return t.sec + t.min * 60 + t.hour * 3600 + (_Urwigo.Date_DayInYear(t)-1) * 86400 end -- Inlined modules -- _Urwigo.InlineModuleFunc = {} varcartridge = Wherigo.ZCartridge() -- Media -- med_fertigteil1 = Wherigo.ZMedia(varcartridge) med_fertigteil1.Id = "ec360989-db94-4a81-a1d0-7b5ee43369d3" med_fertigteil1.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\113") med_fertigteil1.Description = "" med_fertigteil1.AltText = "" med_fertigteil1.Resources = { { Type = "jpg", Filename = "fertigteil1.jpg", Directives = {} } } _14v = Wherigo.ZMedia(varcartridge) _14v.Id = "02f8dd4c-76df-4baa-aede-be94a55f0649" _14v.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\093") _14v.Description = "" _14v.AltText = "" _14v.Resources = { { Type = "jpg", Filename = "fertigteil2.jpg", Directives = {} } } _f68MG = Wherigo.ZMedia(varcartridge) _f68MG.Id = "a2438bd5-8ab9-4a27-b234-d0bb8d7508ad" _f68MG.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\110") _f68MG.Description = "" _f68MG.AltText = "" _f68MG.Resources = { { Type = "jpg", Filename = "fertigteil3.jpg", Directives = {} } } _4KAk = Wherigo.ZMedia(varcartridge) _4KAk.Id = "f80252be-727c-45a7-884b-4af649b13ee8" _4KAk.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114") _4KAk.Description = "" _4KAk.AltText = "" _4KAk.Resources = { { Type = "jpg", Filename = "fertigteil4.jpg", Directives = {} } } _MIoi = Wherigo.ZMedia(varcartridge) _MIoi.Id = "d2e3153d-2236-4466-ac10-9bb5c4294462" _MIoi.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047") _MIoi.Description = "" _MIoi.AltText = "" _MIoi.Resources = { { Type = "jpg", Filename = "fertigteil5.jpg", Directives = {} } } med_lastwagen0 = Wherigo.ZMedia(varcartridge) med_lastwagen0.Id = "e3d60822-0930-419a-8aa4-f62da993c00c" med_lastwagen0.Name = _dEX("\081\054\012\056\025\054\104\019\037\126") med_lastwagen0.Description = "" med_lastwagen0.AltText = "" med_lastwagen0.Resources = { { Type = "jpg", Filename = "lastwagen.jpg", Directives = {} } } _XKy = Wherigo.ZMedia(varcartridge) _XKy.Id = "32b64835-9641-4722-a542-36be3d425200" _XKy.Name = _dEX("\033\018\054\037") _XKy.Description = "" _XKy.AltText = "" _XKy.Resources = { { Type = "jpg", Filename = "kran.jpg", Directives = {} } } _ltt2 = Wherigo.ZMedia(varcartridge) _ltt2.Id = "57153c06-c68f-424f-bae3-f26776990821" _ltt2.Name = _dEX("\036\031\023\054\056\034") _ltt2.Description = "" _ltt2.AltText = "" _ltt2.Resources = { { Type = "jpg", Filename = "schatztruhe.jpg", Directives = {} } } _sEbX = Wherigo.ZMedia(varcartridge) _sEbX.Id = "99939d41-4235-4de8-8740-5badd83beafe" _sEbX.Name = _dEX("\052\054\037\116\008") _sEbX.Description = "" _sEbX.AltText = "" _sEbX.Resources = { { Type = "jpg", Filename = "TurmvonHanoi.jpg", Directives = {} } } _EoCB = Wherigo.ZMedia(varcartridge) _EoCB.Id = "8bd059da-bbae-4455-a1d2-42a5dcdfe142" _EoCB.Name = _dEX("\081\054\012\056\025\054\104\019\037\047") _EoCB.Description = "" _EoCB.AltText = "" _EoCB.Resources = { { Type = "jpg", Filename = "lastwagen5.jpg", Directives = {} } } _u5wG = Wherigo.ZMedia(varcartridge) _u5wG.Id = "e4e21fb3-3311-4961-b638-d8951eb9f2da" _u5wG.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114") _u5wG.Description = "" _u5wG.AltText = "" _u5wG.Resources = { { Type = "jpg", Filename = "fertigteil54.jpg", Directives = {} } } _DVQ = Wherigo.ZMedia(varcartridge) _DVQ.Id = "e18d84fb-a2f6-4660-a353-065735dd9d91" _DVQ.Name = _dEX("\081\054\012\056\025\054\104\019\037\113") _DVQ.Description = "" _DVQ.AltText = "" _DVQ.Resources = { { Type = "jpg", Filename = "lastwagen1.jpg", Directives = {} } } _PGPZv = Wherigo.ZMedia(varcartridge) _PGPZv.Id = "0e19aac3-d115-481a-831e-3c680b73f5f3" _PGPZv.Name = _dEX("\081\054\012\056\025\054\104\019\037\093") _PGPZv.Description = "" _PGPZv.AltText = "" _PGPZv.Resources = { { Type = "jpg", Filename = "lastwagen2.jpg", Directives = {} } } _zqEV = Wherigo.ZMedia(varcartridge) _zqEV.Id = "b054b0a6-2df0-49e2-953d-05c5ebe84646" _zqEV.Name = _dEX("\081\054\012\056\025\054\104\019\037\110") _zqEV.Description = "" _zqEV.AltText = "" _zqEV.Resources = { { Type = "jpg", Filename = "lastwagen3.jpg", Directives = {} } } _WMfr = Wherigo.ZMedia(varcartridge) _WMfr.Id = "e01943b9-3a06-4c91-8323-c6617b7880e9" _WMfr.Name = _dEX("\081\054\012\056\025\054\104\019\037\114") _WMfr.Description = "" _WMfr.AltText = "" _WMfr.Resources = { { Type = "jpg", Filename = "lastwagen4.jpg", Directives = {} } } _03Y = Wherigo.ZMedia(varcartridge) _03Y.Id = "d03c1b49-4227-4ca8-a4a1-9e1af78da44f" _03Y.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\110") _03Y.Description = "" _03Y.AltText = "" _03Y.Resources = { { Type = "jpg", Filename = "fertigteil543.jpg", Directives = {} } } _RkjhS = Wherigo.ZMedia(varcartridge) _RkjhS.Id = "d28ee926-cbab-43c0-a178-9c206e3c2c2c" _RkjhS.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\110\093") _RkjhS.Description = "" _RkjhS.AltText = "" _RkjhS.Resources = { { Type = "jpg", Filename = "fertigteil5432.jpg", Directives = {} } } _yBevh = Wherigo.ZMedia(varcartridge) _yBevh.Id = "db4f0252-39db-40e0-9e51-6be1693415c5" _yBevh.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\110\093\113") _yBevh.Description = "" _yBevh.AltText = "" _yBevh.Resources = { { Type = "jpg", Filename = "fertigteil54321.jpg", Directives = {} } } _NCm1 = Wherigo.ZMedia(varcartridge) _NCm1.Id = "d1111c09-4c3f-47cb-9f9b-6869c9fe37d9" _NCm1.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\110\093\113") _NCm1.Description = "" _NCm1.AltText = "" _NCm1.Resources = { { Type = "jpg", Filename = "fertigteil321.jpg", Directives = {} } } _QRqj = Wherigo.ZMedia(varcartridge) _QRqj.Id = "b7debaee-487a-424c-8a21-7a3624450082" _QRqj.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\110\093\113") _QRqj.Description = "" _QRqj.AltText = "" _QRqj.Resources = { { Type = "jpg", Filename = "fertigteil4321.jpg", Directives = {} } } _VSY = Wherigo.ZMedia(varcartridge) _VSY.Id = "852ba1ef-dc1b-4a83-bcda-e9cc3f08d5d4" _VSY.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\113") _VSY.Description = "" _VSY.AltText = "" _VSY.Resources = { { Type = "jpg", Filename = "fertigteil51.jpg", Directives = {} } } _TZfsf = Wherigo.ZMedia(varcartridge) _TZfsf.Id = "297359df-af8c-435f-b1dd-6de803d04dd2" _TZfsf.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\093\113") _TZfsf.Description = "" _TZfsf.AltText = "" _TZfsf.Resources = { { Type = "jpg", Filename = "fertigteil21.jpg", Directives = {} } } _8YjE = Wherigo.ZMedia(varcartridge) _8YjE.Id = "8135e746-d8c0-41c6-aad0-6ac716638486" _8YjE.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\110\113") _8YjE.Description = "" _8YjE.AltText = "" _8YjE.Resources = { { Type = "jpg", Filename = "fertigteil31.jpg", Directives = {} } } _IhGi = Wherigo.ZMedia(varcartridge) _IhGi.Id = "bd462bca-4c3b-4e22-b39f-b04ab1786491" _IhGi.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\110\093") _IhGi.Description = "" _IhGi.AltText = "" _IhGi.Resources = { { Type = "jpg", Filename = "fertigteil32.jpg", Directives = {} } } _miNmj = Wherigo.ZMedia(varcartridge) _miNmj.Id = "36f1fb4d-bb00-4a98-9efa-c1f208175581" _miNmj.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\113") _miNmj.Description = "" _miNmj.AltText = "" _miNmj.Resources = { { Type = "jpg", Filename = "fertigteil41.jpg", Directives = {} } } _4BK = Wherigo.ZMedia(varcartridge) _4BK.Id = "9d3660f8-51cd-4ff1-a706-6522086ca3a8" _4BK.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\093") _4BK.Description = "" _4BK.AltText = "" _4BK.Resources = { { Type = "jpg", Filename = "fertigteil42.jpg", Directives = {} } } _lHU = Wherigo.ZMedia(varcartridge) _lHU.Id = "a3272c91-b02b-4ba5-ba79-e61a1b3fb0e0" _lHU.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\110") _lHU.Description = "" _lHU.AltText = "" _lHU.Resources = { { Type = "jpg", Filename = "fertigteil43.jpg", Directives = {} } } _ACt9 = Wherigo.ZMedia(varcartridge) _ACt9.Id = "5d17b009-721e-4006-b5ad-30ff80e6fd00" _ACt9.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\093\113") _ACt9.Description = "" _ACt9.AltText = "" _ACt9.Resources = { { Type = "jpg", Filename = "fertigteil421.jpg", Directives = {} } } _KwW = Wherigo.ZMedia(varcartridge) _KwW.Id = "34e32c0f-a2ac-4f08-b3e8-7eebbbc0a19d" _KwW.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\110\113") _KwW.Description = "" _KwW.AltText = "" _KwW.Resources = { { Type = "jpg", Filename = "fertigteil431.jpg", Directives = {} } } _GEZ = Wherigo.ZMedia(varcartridge) _GEZ.Id = "d5b97b58-dddc-4b6d-bf04-f5948330cae7" _GEZ.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\114\110\093") _GEZ.Description = "" _GEZ.AltText = "" _GEZ.Resources = { { Type = "jpg", Filename = "fertigteil432.jpg", Directives = {} } } _SDf = Wherigo.ZMedia(varcartridge) _SDf.Id = "dc56135c-86c7-45c8-a608-cd2b453bbb60" _SDf.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\093") _SDf.Description = "" _SDf.AltText = "" _SDf.Resources = { { Type = "jpg", Filename = "fertigteil52.jpg", Directives = {} } } _kila = Wherigo.ZMedia(varcartridge) _kila.Id = "eb31bd46-a088-48bc-a04e-bb7f058c6ca1" _kila.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\110") _kila.Description = "" _kila.AltText = "" _kila.Resources = { { Type = "jpg", Filename = "fertigteil53.jpg", Directives = {} } } _eMLJ = Wherigo.ZMedia(varcartridge) _eMLJ.Id = "33d04865-5b0e-4b1d-881a-5688fcde264f" _eMLJ.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\113") _eMLJ.Description = "" _eMLJ.AltText = "" _eMLJ.Resources = { { Type = "jpg", Filename = "fertigteil541.jpg", Directives = {} } } _OSXAA = Wherigo.ZMedia(varcartridge) _OSXAA.Id = "8f08305c-d43b-4e0c-a2ee-e8077e48e544" _OSXAA.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\093") _OSXAA.Description = "" _OSXAA.AltText = "" _OSXAA.Resources = { { Type = "jpg", Filename = "fertigteil542.jpg", Directives = {} } } _Pe6 = Wherigo.ZMedia(varcartridge) _Pe6.Id = "f6bee7da-c751-422e-8bf8-1a1b8d242046" _Pe6.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\110\113") _Pe6.Description = "" _Pe6.AltText = "" _Pe6.Resources = { { Type = "jpg", Filename = "fertigteil531.jpg", Directives = {} } } _kBJ = Wherigo.ZMedia(varcartridge) _kBJ.Id = "54218c62-f0e9-41cc-9583-298398a9f4e6" _kBJ.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\110\093") _kBJ.Description = "" _kBJ.AltText = "" _kBJ.Resources = { { Type = "jpg", Filename = "fertigteil532.jpg", Directives = {} } } _B4hS = Wherigo.ZMedia(varcartridge) _B4hS.Id = "59cfa736-281a-49ba-894a-5a383cdfa101" _B4hS.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\093\113") _B4hS.Description = "" _B4hS.AltText = "" _B4hS.Resources = { { Type = "jpg", Filename = "fertigteil521.jpg", Directives = {} } } _1k0F = Wherigo.ZMedia(varcartridge) _1k0F.Id = "4dd140b7-7ced-4b55-b4a4-49bcb9dc4613" _1k0F.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\110\093\113") _1k0F.Description = "" _1k0F.AltText = "" _1k0F.Resources = { { Type = "jpg", Filename = "fertigteil5321.jpg", Directives = {} } } _byIEY = Wherigo.ZMedia(varcartridge) _byIEY.Id = "38047cfa-0417-40c4-976b-91510804d2e4" _byIEY.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\093\113") _byIEY.Description = "" _byIEY.AltText = "" _byIEY.Resources = { { Type = "jpg", Filename = "fertigteil5421.jpg", Directives = {} } } _RwGO = Wherigo.ZMedia(varcartridge) _RwGO.Id = "372e23d2-8db6-4d17-b372-79822765ceca" _RwGO.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\047\114\110\113") _RwGO.Description = "" _RwGO.AltText = "" _RwGO.Resources = { { Type = "jpg", Filename = "fertigteil5431.jpg", Directives = {} } } _dDfeU = Wherigo.ZMedia(varcartridge) _dDfeU.Id = "ae514efa-b8b4-4cbf-9b6d-f85b64b00a5b" _dDfeU.Name = _dEX("\029\019\018\056\008\104\056\019\008\081\126") _dDfeU.Description = "" _dDfeU.AltText = "" _dDfeU.Resources = { { Type = "jpg", Filename = "fertigteil0.jpg", Directives = {} } } _OJ2y = Wherigo.ZMedia(varcartridge) _OJ2y.Id = "b130f02d-a7c0-4fed-9dda-6f2afee57bac" _OJ2y.Name = _dEX("\029\019\018\056\008\104\056\019\008\081") _OJ2y.Description = "" _OJ2y.AltText = "" _OJ2y.Resources = { { Type = "jpg", Filename = "fertigteil0_1.jpg", Directives = {} } } -- Cartridge Info -- varcartridge.Id="44e3660e-7d15-4eca-a326-537292240ac5" varcartridge.Name="Turmbau zu Hanoi" varcartridge.Description=[[Play Anywhere Deine Aufgabe: Baue den Turm wieder ab und an der richtigen Stelle wieder auf ]] varcartridge.Visible=true varcartridge.Activity="Puzzle" varcartridge.StartingLocationDescription=[[]] varcartridge.StartingLocation = Wherigo.INVALID_ZONEPOINT varcartridge.Version="" varcartridge.Company="" varcartridge.Author="" varcartridge.BuilderVersion="URWIGO 1.21.5528.18461" varcartridge.CreateDate="01/12/2012 09:04:17" varcartridge.PublishDate="1/1/0001 12:00:00 AM" varcartridge.UpdateDate="03/16/2015 21:23:41" varcartridge.LastPlayedDate="1/1/0001 12:00:00 AM" varcartridge.TargetDevice="PocketPC" varcartridge.TargetDeviceVersion="0" varcartridge.StateId="1" varcartridge.CountryId="2" varcartridge.Complete=false varcartridge.UseLogging=true varcartridge.Media=_sEbX -- Zones -- objSchatzinfo = Wherigo.Zone(varcartridge) objSchatzinfo.Id = "490c8ae9-77a8-4d6c-bad3-ef363d12065d" objSchatzinfo.Name = _dEX("\036\031\023\054\056\034\008\037\029\116") objSchatzinfo.Description = _dEX("\052\008\019\018\013\012\056\019\023\056\013\106\019\018\013\085\019\116\031\054\031\023\008\037\104\118\055\112\018\091\013\054\112\012\013\064\019\018\056\008\104\125\054\112\056\019\008\081\019\037\013\118\013\081\019\008\106\019\018\013\025\112\018\106\019\013\019\018\013\106\008\018\019\077\056\013\054\112\029\013\103\076\058\094\089\037\029\116\018\091\054\056\008\116\037\019\037\013\104\019\012\056\019\081\081\056\039\013\106\008\019\013\034\112\091\013\064\008\037\106\019\037\013\019\008\037\019\012\013\036\031\023\054\056\034\019\012\013\037\116\056\025\019\037\106\008\104\013\012\008\037\106\024\013\068\037\125\012\108\017\119\019\018\012\019\056\034\019\013\106\019\037\013\055\112\018\091\013\054\112\029\013\106\019\037\013\076\054\112\108\081\054\056\034") objSchatzinfo.Visible = true objSchatzinfo.Commands = {} objSchatzinfo.DistanceRange = Distance(-1, "feet") objSchatzinfo.ShowObjects = "OnEnter" objSchatzinfo.ProximityRange = Distance(60, "meters") objSchatzinfo.AllowSetPositionTo = false objSchatzinfo.Active = false objSchatzinfo.Points = { ZonePoint(47.6095585201282, 9.60492150425898, 0), ZonePoint(47.6097393487639, 9.60490004658686, 0), ZonePoint(47.6096670173846, 9.6051414453982, 0) } objSchatzinfo.OriginalPoint = ZonePoint(47.6096549620922, 9.60498766541468, 0) objSchatzinfo.DistanceRangeUOM = "Feet" objSchatzinfo.ProximityRangeUOM = "Meters" objSchatzinfo.OutOfRangeName = "" objSchatzinfo.InRangeName = "" objBauplatz = Wherigo.Zone(varcartridge) objBauplatz.Id = "62b4d006-24fb-4ecc-a7f9-5d6d570a6020" objBauplatz.Name = _dEX("\076\054\112\108\081\054\056\034") objBauplatz.Description = _dEX("\052\008\019\018\013\012\116\081\081\013\019\008\037\013\025\112\037\106\019\018\012\031\023\116\019\037\019\018\013\085\019\116\031\054\031\023\008\037\104\118\055\112\018\091\013\054\112\012\013\064\019\018\056\008\104\056\019\008\081\019\037\013\054\112\029\104\019\125\054\112\056\013\025\019\018\106\019\037\013\118\013\106\008\019\013\064\019\018\056\008\104\056\019\008\081\019\013\025\112\018\106\019\037\013\104\019\081\008\019\029\019\018\056\013\118\013\054\125\019\018\013\081\019\008\106\019\018\013\054\091\013\029\054\081\012\031\023\019\037\013\117\081\054\056\034\013\054\112\029\104\019\125\054\112\056\024\013") objBauplatz.Visible = true objBauplatz.Media = _dDfeU objBauplatz.Commands = {} objBauplatz.DistanceRange = Distance(-1, "feet") objBauplatz.ShowObjects = "OnEnter" objBauplatz.ProximityRange = Distance(60, "meters") objBauplatz.AllowSetPositionTo = false objBauplatz.Active = false objBauplatz.Points = { ZonePoint(47.6102095002908, 9.60450844407069, 0), ZonePoint(47.6100937710763, 9.60431532502162, 0), ZonePoint(47.6100576056443, 9.60456208825099, 0) } objBauplatz.OriginalPoint = ZonePoint(47.6101202923371, 9.60446195244777, 0) objBauplatz.DistanceRangeUOM = "Feet" objBauplatz.ProximityRangeUOM = "Meters" objBauplatz.OutOfRangeName = "" objBauplatz.InRangeName = "" objMaterialplatz = Wherigo.Zone(varcartridge) objMaterialplatz.Id = "96836ad9-358d-4660-96da-b4c5523efacb" objMaterialplatz.Name = _dEX("\004\054\056\019\018\008\054\081\108\081\054\056\034") objMaterialplatz.Description = _dEX("\052\008\019\018\013\077\054\037\037\012\056\013\038\112\013\004\054\056\019\018\008\054\081\013\034\025\008\012\031\023\019\037\081\054\104\019\018\037\039\013\106\054\012\013\106\112\013\008\091\013\004\116\091\019\037\056\013\037\008\031\023\056\013\070\019\018\125\054\112\019\037\013\077\054\037\037\012\056\024") objMaterialplatz.Visible = true objMaterialplatz.Media = _dDfeU objMaterialplatz.Commands = {} objMaterialplatz.DistanceRange = Distance(-1, "feet") objMaterialplatz.ShowObjects = "OnEnter" objMaterialplatz.ProximityRange = Distance(60, "meters") objMaterialplatz.AllowSetPositionTo = false objMaterialplatz.Active = false objMaterialplatz.Points = { ZonePoint(47.6097176493606, 9.60381643414485, 0), ZonePoint(47.6095295874884, 9.60375206112849, 0), ZonePoint(47.6096597842412, 9.60403101086604, 0) } objMaterialplatz.OriginalPoint = ZonePoint(47.6096356736967, 9.60386650204646, 0) objMaterialplatz.DistanceRangeUOM = "Feet" objMaterialplatz.ProximityRangeUOM = "Meters" objMaterialplatz.OutOfRangeName = "" objMaterialplatz.InRangeName = "" -- Characters -- -- Items -- objKran = Wherigo.ZItem{ Cartridge = varcartridge, Container = objSchatzinfo } objKran.Id = "fe7eeacc-5c5a-4920-af6c-ef1398944147" objKran.Name = _dEX("\033\018\054\037") objKran.Description = _dEX("\004\008\056\013\106\008\019\012\019\091\013\033\018\054\037\013\077\054\037\037\012\056\013\038\112\013\106\008\019\013\064\019\018\056\008\104\056\019\008\081\019\013\054\112\029\013\118\013\116\106\019\018\013\054\125\081\054\106\019\037") objKran.Visible = true objKran.Media = _XKy objKran.Commands = { _KKKT9 = Wherigo.ZCommand{ Text = _dEX("\125\019\037\112\056\034\019\037"), CmdWith = false, Enabled = true, EmptyTargetListText = _dEX("\092\008\031\023\056\013\070\019\018\029\112\104\125\054\018") } } objKran.Commands._KKKT9.Custom = true objKran.Commands._KKKT9.Id = "7d877c08-c565-4ff5-8b01-0b96f81d3b04" objKran.Commands._KKKT9.WorksWithAll = true objKran.ObjectLocation = Wherigo.INVALID_ZONEPOINT objKran.Locked = false objKran.Opened = false _pUVQn = Wherigo.ZItem{ Cartridge = varcartridge, Container = Player } _pUVQn.Id = "05244b8b-171a-4744-b968-f5f84daa6525" _pUVQn.Name = _dEX("\036\108\008\019\081\054\037\081\019\008\056\112\037\104") _pUVQn.Description = _dEX("\038\008\019\012\019\012\013\036\108\008\019\081\013\008\012\056\013\054\081\012\013\117\081\054\069\118\046\037\069\025\023\019\018\019\118\078\023\019\018\008\104\116\013\077\116\037\034\008\108\008\019\018\056\013\118\013\106\024\023\024\013\106\112\013\077\054\037\037\012\056\013\008\023\037\013\112\019\125\019\018\054\081\081\013\012\108\008\019\081\019\037\013\025\116\013\106\112\013\104\019\037\112\019\104\019\037\106\013\117\081\054\056\034\013\023\054\012\056\013\118\013\012\056\019\081\081\013\038\008\031\023\013\084\019\056\034\056\013\008\037\013\106\008\019\013\004\008\056\056\019\013\106\019\012\013\117\081\054\056\034\019\012\024\103\076\058\094\038\019\008\037\019\013\046\112\029\104\054\125\019\013\125\019\012\056\019\023\056\013\106\054\018\008\037\039\013\106\019\037\013\085\019\116\031\054\031\023\008\037\104\118\055\112\018\091\013\054\112\012\013\064\019\018\056\008\104\056\019\008\081\019\037\013\106\019\018\013\050\116\037\019\013\036\031\023\054\056\034\008\037\029\116\013\054\112\029\013\106\019\091\013\076\054\112\108\081\054\056\034\013\025\008\019\106\019\018\013\054\112\029\034\112\125\054\112\019\037\024\013\038\112\013\077\054\037\037\012\056\013\037\112\018\013\019\008\037\013\064\019\018\056\008\104\056\019\008\081\013\054\112\029\013\019\008\037\091\054\081\013\056\018\054\037\012\108\116\018\056\008\019\018\019\037\024\013\078\019\008\056\019\018\023\008\037\013\077\054\037\037\012\056\013\038\112\013\037\112\018\013\077\081\019\008\037\019\018\019\013\076\054\112\056\019\008\081\019\013\054\112\029\013\104\018\116\019\012\012\019\018\019\037\013\076\054\112\056\019\008\081\019\037\013\012\056\054\108\019\081\037\013\118\013\023\008\019\018\034\112\013\025\008\018\012\056\013\106\112\013\106\019\037\013\004\054\056\019\018\008\054\081\108\081\054\056\034\013\125\019\037\116\019\056\008\104\019\037\024\013\103\076\058\094\078\054\019\023\081\019\013\037\112\037\013\106\008\019\013\046\037\034\054\023\081\013\106\019\018\013\055\112\019\018\091\019\039\013\091\008\056\013\106\019\037\019\037\013\106\112\013\012\108\008\019\081\019\037\013\025\008\081\081\012\056\024") _pUVQn.Visible = true _pUVQn.Media = _NCm1 _pUVQn.Commands = { _zbG = Wherigo.ZCommand{ Text = _dEX("\078\019\008\056\019\018"), CmdWith = false, Enabled = true, EmptyTargetListText = _dEX("\092\008\031\023\056\013\070\019\018\029\112\104\125\054\018") } } _pUVQn.Commands._zbG.Custom = true _pUVQn.Commands._zbG.Id = "f4d0d78a-fd95-48f6-b58c-ed7b0184406d" _pUVQn.Commands._zbG.WorksWithAll = true _pUVQn.ObjectLocation = Wherigo.INVALID_ZONEPOINT _pUVQn.Locked = false _pUVQn.Opened = false objLastwagen = Wherigo.ZItem{ Cartridge = varcartridge, Container = Player } objLastwagen.Id = "3e396091-d64e-4d66-b8e8-f06476899516" objLastwagen.Name = _dEX("\040\054\012\056\025\054\104\019\037") objLastwagen.Description = _dEX("\091\008\056\013\106\008\019\012\019\091\013\040\054\012\056\025\054\104\019\037\013\077\054\037\037\012\056\013\106\112\013\106\008\019\013\064\019\018\056\008\104\056\019\008\081\019\013\056\018\054\037\012\108\116\018\056\008\019\018\019\037\013\118\013\106\019\018\013\040\054\012\056\025\054\104\019\037\013\125\019\104\081\019\008\056\019\056\013\038\008\031\023\013\008\091\091\019\018\013\112\037\106\013\125\018\008\037\104\056\013\019\008\037\013\054\112\029\104\019\081\054\106\019\037\019\012\013\064\019\018\056\008\104\056\019\008\081\013\034\112\091\013\076\019\012\056\008\091\091\112\037\104\012\116\018\056\024") objLastwagen.Visible = true objLastwagen.Media = med_lastwagen0 objLastwagen.Commands = {} objLastwagen.ObjectLocation = Wherigo.INVALID_ZONEPOINT objLastwagen.Locked = false objLastwagen.Opened = false _qHI = Wherigo.ZItem(varcartridge) _qHI.Id = "3f1c382a-3377-48cf-b173-c24b193fcc2a" _qHI.Name = _dEX("\007\054\031\023\019\008\037\029\116\013\112\037\106\013\072\037\081\116\031\077\007\116\106\019") _qHI.Description = _dEX("\078\019\037\037\013\106\112\013\037\008\031\023\056\013\008\091\013\101\091\112\081\054\056\116\018\013\104\019\012\108\008\019\081\056\013\023\054\012\056\039\013\019\018\023\054\019\081\056\012\056\013\038\112\013\023\008\019\018\013\106\008\019\013\078\019\018\056\019\013\046\076\007\038\013\016\036\108\008\019\081\013\091\008\056\013\114\013\055\112\019\018\091\019\037\109\013\125\034\025\024\013\101\064\085\052\013\016\047\013\055\112\019\018\091\019\109\013\091\008\056\013\052\008\081\029\019\013\106\019\018\019\018\013\038\112\013\104\019\091\054\019\012\012\013\085\007\118\007\054\031\023\019\081\008\012\056\008\037\104\013\106\008\019\013\064\008\037\054\081\077\116\116\018\106\008\037\054\056\019\037\013\125\019\018\019\031\023\037\019\037\013\077\054\037\037\012\056\024\013\076\019\008\091\013\036\108\008\019\081\019\037\013\091\008\056\013\110\013\055\112\019\018\091\019\037\013\104\008\125\056\012\013\077\019\008\037\019\013\089\037\029\116\024\013\038\019\037\013\072\037\081\116\031\077\118\007\116\106\019\013\019\018\023\054\019\081\056\012\056\013\106\112\013\008\091\091\019\018\024") _qHI.Visible = true _qHI.Media = _ltt2 _qHI.Commands = { _664xA = Wherigo.ZCommand{ Text = _dEX("\072\037\081\116\031\077\118\007\116\106\019\013\054\037\034\019\008\104\019\037"), CmdWith = false, Enabled = true, EmptyTargetListText = _dEX("\092\008\031\023\056\013\070\019\018\029\112\104\125\054\018") }, _OLm = Wherigo.ZCommand{ Text = _dEX("\007\054\031\023\019\008\037\029\116\013\034\019\008\104\019\037"), CmdWith = false, Enabled = true, EmptyTargetListText = _dEX("\092\008\031\023\056\013\070\019\018\029\112\104\125\054\018") } } _qHI.Commands._664xA.Custom = true _qHI.Commands._664xA.Id = "0154c7fa-5482-4fea-ab55-27cb1e007561" _qHI.Commands._664xA.WorksWithAll = true _qHI.Commands._OLm.Custom = true _qHI.Commands._OLm.Id = "ebe2fff0-aa6b-4c20-a5df-765bc904b699" _qHI.Commands._OLm.WorksWithAll = true _qHI.ObjectLocation = Wherigo.INVALID_ZONEPOINT _qHI.Locked = false _qHI.Opened = false -- Tasks -- _zPws = Wherigo.ZTask(varcartridge) _zPws.Id = "c257c21d-45dc-4b15-bc50-2a826cd4c525" _zPws.Name = _dEX("\055\112\018\091\013\070\019\018\012\019\056\034\019\037") _zPws.Description = _dEX("\119\019\018\012\019\056\034\019\013\106\019\037\013\055\112\018\091\013\054\112\029\013\106\019\037\013\076\054\112\108\081\054\056\034\013\118\013\106\054\125\019\008\013\106\054\018\029\013\008\091\091\019\018\013\037\112\018\013\019\008\037\013\077\081\019\008\037\019\018\019\012\013\064\019\018\056\008\104\125\054\112\056\019\008\081\013\054\112\029\013\019\008\037\019\091\013\104\018\116\019\012\012\019\018\019\037\013\081\008\019\104\019\037\061") _zPws.Visible = true _zPws.Media = _EoCB _zPws.Active = true _zPws.Complete = false _zPws.CorrectState = "None" -- Cartridge Variables -- var_fertigteilnr = 0 aktZone = "" var_fertigteile = 0 var_max_fertigteile = 5 _05fAX = 1234 _X4d = 5678 _BQcoD = _dEX("\116\125\084\036\031\023\054\056\034\008\037\029\116") _btKZ = _dEX("\106\112\091\091\069") _Rmt6q = _dEX("\116\125\084\033\018\054\037") _HoqI = _dEX("\071\034\117\025\012") _hnHrl = _dEX("\071\119\036\023") _1H_ = _dEX("\106\112\091\091\069") varcartridge.ZVariables = { var_fertigteilnr = 0, aktZone = "", var_fertigteile = 0, var_max_fertigteile = 5, _05fAX = 1234, _X4d = 5678, _BQcoD = _dEX("\116\125\084\036\031\023\054\056\034\008\037\029\116"), _btKZ = _dEX("\106\112\091\091\069"), _Rmt6q = _dEX("\116\125\084\033\018\054\037"), _HoqI = _dEX("\071\034\117\025\012"), _hnHrl = _dEX("\071\119\036\023"), _1H_ = _dEX("\106\112\091\091\069") } -- Timers -- -- Inputs -- _VSh = Wherigo.ZInput(varcartridge) _VSh.Id = "96bf1da8-ce15-48fb-9e8d-efa9f31b566a" _VSh.Name = _dEX("\101\008\037\104\054\125\019\071\055\112\019\018\091\019") _VSh.Description = "" _VSh.Visible = true _VSh.Media = _NCm1 _VSh.Choices = { "3", "4", "5" } _VSh.InputType = "MultipleChoice" _VSh.Text = _dEX("\110\013\055\112\019\018\091\019\100\013\050\112\091\013\072\019\125\019\037\103\076\058\094\114\013\055\112\019\018\091\019\100\013\078\019\018\056\019\013\046\076\007\038\103\076\058\094\047\013\055\112\019\018\091\019\100\013\078\019\018\056\019\013\101\064\085\052") -- WorksWithList for object commands -- -- functions -- function varcartridge:OnStart() if (_G[_dEX("\101\037\070")][_dEX("\038\019\070\008\031\019\089\038")] == _dEX("\038\019\012\077\056\116\108")) or (_G[_dEX("\101\037\070")][_dEX("\117\081\054\056\029\116\018\091")] == _dEX("\078\008\037\110\093")) then _05fAX = 0 _X4d = 0 end _Urwigo.Dialog(false, { { Text = (_dEX("\052\054\081\081\116\013")..Player.Name).._dEX("\103\076\058\094\103\076\058\094\036\031\023\116\019\037\039\013\106\054\012\012\013\038\112\013\023\019\081\029\019\037\013\091\116\019\031\023\056\019\012\056\039\013\106\008\019\012\019\012\013\025\112\037\106\019\018\012\031\023\116\019\037\019\013\085\019\116\031\054\031\023\008\037\104\118\076\054\112\025\019\018\077\013\054\037\013\106\008\019\013\018\008\031\023\056\008\104\019\013\036\056\019\081\081\019\013\034\112\013\070\019\018\012\019\056\034\019\037\024\103\076\058\094\040\019\008\106\019\018\013\025\112\018\106\019\013\125\019\008\013\040\008\019\029\019\018\112\037\104\013\106\019\018\013\064\019\018\056\008\104\056\019\008\081\019\013\106\019\018\013\029\054\081\012\031\023\019\013\067\018\056\013\034\112\091\013\046\112\029\125\054\112\013\104\019\025\054\019\023\081\056\024\013\072\037\056\019\018\013\106\019\091\013\055\112\091\013\125\019\029\008\037\106\019\037\013\012\008\031\023\013\089\037\029\116\018\091\054\056\008\116\037\019\037\013\029\112\019\018\013\019\008\037\019\037\013\036\031\023\054\056\034\013\118\013\106\008\019\012\019\037\013\019\018\023\054\019\081\056\012\056\013\038\112\013\054\081\012\013\076\019\081\116\023\037\112\037\104\013\025\019\037\037\013\106\112\013\106\019\037\013\055\112\018\091\013\070\019\018\012\019\056\034\056\024"), Media = _sEbX }, { Text = _dEX("\046\125\019\018\013\012\112\031\023\019\013\038\008\018\013\034\112\019\018\012\056\013\091\054\081\013\019\008\037\019\037\013\029\018\019\008\019\037\013\117\081\054\056\034\013\118\013\031\054\024\013\001\047\120\001\047\013\004\019\056\019\018\013\012\116\081\081\056\019\037\013\018\019\008\031\023\019\037\013\112\037\106\013\012\056\019\081\081\019\013\038\008\031\023\013\008\037\013\106\008\019\013\004\008\056\056\019\024\013\046\037\012\031\023\081\008\019\012\012\019\037\106\013\081\008\019\012\013\106\008\019\013\036\108\008\019\081\018\019\104\019\081\037\013\106\112\018\031\023\013\112\037\106\013\106\054\037\037\013\077\054\037\037\013\019\012\013\054\112\031\023\013\012\031\023\116\037\013\081\116\012\104\019\023\019\037"), Media = _sEbX } }, function(action) Wherigo.ShowScreen(Wherigo.DETAILSCREEN, _pUVQn) end) end function varcartridge:OnRestore() end function objSchatzinfo:OnEnter() _BQcoD = _dEX("\116\125\084\036\031\023\054\056\034\008\037\029\116") aktZone = objSchatzinfo _xUjy() end function objSchatzinfo:OnExit() _BQcoD = _dEX("\116\125\084\036\031\023\054\056\034\008\037\029\116") _XDjs() end function objBauplatz:OnEnter() _BQcoD = _dEX("\116\125\084\076\054\112\108\081\054\056\034") aktZone = objBauplatz _xUjy() end function objBauplatz:OnExit() _BQcoD = _dEX("\116\125\084\076\054\112\108\081\054\056\034") _XDjs() end function objMaterialplatz:OnEnter() _BQcoD = _dEX("\116\125\084\004\054\056\019\018\008\054\081\108\081\054\056\034") aktZone = objMaterialplatz _xUjy() end function objMaterialplatz:OnExit() _BQcoD = _dEX("\116\125\084\004\054\056\019\018\008\054\081\108\081\054\056\034") _XDjs() end function _VSh:OnGetInput(input) if input == nil then input = "" end if _Urwigo.Hash(string.lower(input)) == 51 then var_max_fertigteile = 3 elseif _Urwigo.Hash(string.lower(input)) == 52 then var_max_fertigteile = 4 else var_max_fertigteile = 5 end init_fertigteile(objBauplatz,0) init_fertigteile(objMaterialplatz,0) init_fertigteile(objSchatzinfo,var_max_fertigteile) objSchatzinfo.Media = get_media("fertigteil",get_fertigteilestring(objSchatzinfo)) objLastwagen.Fertigteilnr = 0 init_play_anywhere(objSchatzinfo, objBauplatz, objMaterialplatz) _pUVQn:MoveTo(nil) objBauplatz.Active = true objBauplatz.Visible = true objMaterialplatz.Active = true objMaterialplatz.Visible = true objSchatzinfo.Active = true objSchatzinfo.Visible = true outWithMainScreen("Fein, du spielst jetzt mit "..var_max_fertigteile.." Tuermen, Viel Spass!",get_media("fertigteil",get_fertigteilestring(objSchatzinfo))) end function objKran:On_KKKT9(target) if objLastwagen.Locked then var_fertigteilnr = put_fertigteil(aktZone,objLastwagen.Fertigteilnr) med_msgmedia = get_media("lastwagen",var_fertigteilnr) if var_fertigteilnr > 0 then objLastwagen.Locked = false objLastwagen.Fertigteilnr = 0 out("Das Fertigteil Nor: "..var_fertigteilnr.." ist auf dem Lastwagen, du laedtst es jetzt ab",get_media("lastwagen",var_fertigteilnr)) else out("Der Lastwagen ist zwar voll, aber hier kannst du das Fertigteil nicht abladen",get_media("lastwagen",objLastwagen.Fertigteilnr)) end else var_fertigteilnr = get_fertigteil(aktZone) if var_fertigteilnr > 0 then objLastwagen.Locked = true objLastwagen.Fertigteilnr = var_fertigteilnr out("Der Lastwagen war leer, du laedst das Fertigteil No: "..var_fertigteilnr.." auf den Lastwagen",get_media("lastwagen",var_fertigteilnr)) else out("Der Lastwagen ist leer, allerdings gibt es hier auch nichts zum Aufladen",get_media("lastwagen",var_fertigteilnr)) end end objLastwagen.Media = get_media("lastwagen",objLastwagen.Fertigteilnr) aktZone.Media = get_media("fertigteil",get_fertigteilestring(aktZone)) _WFHCp() end function _pUVQn:On_zbG(target) _Urwigo.RunDialogs(function() Wherigo.GetInput(_VSh) end) end function _qHI:On_664xA(target) _Urwigo.MessageBox{ Text = string.sub(Player.CompletionCode, 1, 15) } end function _qHI:On_OLm(target) if var_max_fertigteile == 3 then _Urwigo.MessageBox{ Text = _dEX("\038\054\012\013\025\054\018\013\084\019\056\034\056\013\034\112\091\013\072\019\125\019\037\013\118\013\008\031\023\013\023\116\029\029\019\013\019\012\013\023\054\056\013\036\108\054\012\012\013\104\019\091\054\031\023\056\061"), Media = _sEbX } elseif var_max_fertigteile == 4 then _Urwigo.MessageBox{ Text = _dEX("\050\112\091\013\076\019\018\019\031\023\037\019\037\013\106\019\018\013\064\008\037\054\081\077\116\116\018\106\008\037\054\056\019\013\104\019\091\054\019\012\012\013\085\019\116\031\054\031\023\008\037\104\118\040\008\012\056\008\037\104\013\070\019\018\025\019\037\106\019\013\125\008\056\056\019\013\106\008\019\013\078\019\018\056\019\013\046\076\007\038\066").._05fAX, Media = _ltt2 } else _Urwigo.MessageBox{ Text = _dEX("\050\112\091\013\076\019\018\019\031\023\037\019\037\013\106\019\018\013\064\008\037\054\081\077\116\116\018\106\008\037\054\056\019\013\104\019\091\054\019\012\012\013\085\019\116\031\054\031\023\008\037\104\118\040\008\012\056\008\037\104\013\070\019\018\025\019\037\106\019\013\125\008\056\056\019\013\106\008\019\013\078\019\018\056\019\013\101\064\085\052\066").._X4d, Media = _ltt2 } end end -- Urwigo functions -- function _xUjy() objKran.Name = [[Kran - Zone ]]..aktZone.Name objKran:MoveTo(aktZone) objKran.Visible = true Wherigo.ShowScreen(Wherigo.DETAILSCREEN, objKran) end function _XDjs() objKran.Visible = false end function _WFHCp() objBauplatz.Description = [[Auf dem Bauplatz liegen folgende Fertigteile: ]]..get_fertigteilestring(objBauplatz) objMaterialplatz.Description = [[Auf dem Materialplatz liegen folgende Fertigteile: ]]..get_fertigteilestring(objMaterialplatz) objSchatzinfo.Description = [[Auf der Schatzinfo liegen folgende Fertigteile: ]].. get_fertigteilestring(objSchatzinfo) var_fertigteile = #objBauplatz.Fertigteile if var_fertigteile == var_max_fertigteile then _Urwigo.MessageBox{ Text = _dEX("\085\081\112\019\031\077\025\112\037\012\031\023\039\013\106\112\013\023\054\012\056\013\019\012\013\104\019\012\031\023\054\029\029\056\013\061\013\038\112\013\023\054\012\056\013\037\112\037\013\106\008\019\013\089\037\029\116\018\091\054\056\008\116\037\019\037\013\034\112\091\013\064\008\037\106\019\037\013\106\019\012\013\007\054\031\023\019\012\013\112\037\106\013\034\112\091\013\072\037\081\116\031\077\019\037\013\008\091\013\089\037\070\019\037\056\054\018"), Media = _ltt2, Callback = function(action) if action ~= nil then Wherigo.ShowScreen(Wherigo.MAINSCREEN) _zPws.Complete = true varcartridge.Complete = true _qHI:MoveTo(Player) varcartridge:RequestSync() end end } else var_fertigteile = #objMaterialplatz.Fertigteile if var_fertigteile == var_max_fertigteile then out("Oh no, Du hast den Turm zwar fertig aufgebaut, aber auf dem Materialplatz anstatt auf dem Bauplatz - das geht so leider nicht !Baue den Turm bitte auf dem Bauplatz auf",get_media("fertigteil",get_fertigteilestring(objMaterialplatz))) end end end -- Begin user functions -- aktZone = objSchatzinfo --aktuelle Zone function new_table(anzahl) local tbl = {} for i = 1, anzahl, 1 do table.insert(tbl,i,var_max_fertigteile + 1 - i) end return tbl end function init_fertigteile(objzone,anzahlteile) --legt das Table Fertigteile fuer die jeweilige Zone an das erste element ist das unterste Element und hat die Kardinalzahl 5 - mehr als 5 Teile sind zur Zeit nicht implementiert objzone.Fertigteile = new_table(anzahlteile) end function get_fertigteilestring(aktZone) local msg = "" --print("get fertigteilestring") if aktZone.Fertigteile ~= nil then --print ("Nr Fertigteile: ",#aktZone.Fertigteile) for i = 1, #aktZone.Fertigteile, 1 do --print(i) msg=msg..aktZone.Fertigteile[i] end end --print(msg) return msg end function get_fertigteil(aktZone) local nr = 0 if #aktZone.Fertigteile > 0 then nr = table.remove(aktZone.Fertigteile,#aktZone.Fertigteile) end return nr end function put_fertigteil(aktZone, teilnr) --return 0 bei Fehler, ansonsten Fertigteilnr if teilnr == 0 then return 0 end if #aktZone.Fertigteile == 0 then table.insert(aktZone.Fertigteile,teilnr) return teilnr else if teilnr < aktZone.Fertigteile[#aktZone.Fertigteile] then table.insert(aktZone.Fertigteile,teilnr) return teilnr end end return 0 end function get_media(basename,fertigteilstring) local objects = varcartridge.AllZObjects local media_name = basename..fertigteilstring for i= 1, #objects,1 do if objects[i].Name == media_name then print(media_name) return objects[i] end end return nil end function out(m,med) _Urwigo.MessageBox{ Text= "" .. m, Media = med } end function outWithMainScreen(m,med) _Urwigo.MessageBox{ Text= "" .. m, Media = med, Callback = function(action) if action ~= nil then Wherigo.ShowScreen(Wherigo.MAINSCREEN) end end } end function init_play_anywhere(zone1, zone2, zone3) local dist = Wherigo.Distance(40,'m') zone1.OriginalPoint = Wherigo.TranslatePoint(Player.ObjectLocation,dist,0) zone1.Points = GetZonePoints(zone1.OriginalPoint,10) zone2.OriginalPoint = Wherigo.TranslatePoint(Player.ObjectLocation,dist,120) zone2.Points = GetZonePoints(zone2.OriginalPoint,10) zone3.OriginalPoint = Wherigo.TranslatePoint(Player.ObjectLocation,dist,240) zone3.Points = GetZonePoints(zone3.OriginalPoint,10) end function GetZonePoints(refPt, radi) local dist = Wherigo.Distance(radi, 'm') local pts = { Wherigo.TranslatePoint(refPt, dist, 0), Wherigo.TranslatePoint(refPt, dist, 60), Wherigo.TranslatePoint(refPt, dist, 120), Wherigo.TranslatePoint(refPt, dist, 180), Wherigo.TranslatePoint(refPt, dist, 240), Wherigo.TranslatePoint(refPt, dist, 300), } return pts end -- End user functions -- return varcartridge
--[[ Name: cl_menu_crafting_table.lua ----------------------------------------------------------------- -- @package VrZn - Custom Gamemode (SRP BASE) -- @author Nodge -- @build Beta 1 ----------------------------------------------------------------- ]]-- surface.CreateFont( "Crafting_Trebuchet20", {size = 20, weight = 525, font = "Trebuchet24"} ) surface.CreateFont( "Crafting_Trebuchet20_Bold", {size = 20, weight = 400, font = "Trebuchet24"} ) local Panel = {} function Panel:Init() self.m_colSold = Color( 255, 50, 50, 255 ) self.m_colSell = Color( 50, 255, 50, 255 ) self.m_colPrice = Color( 120, 230, 110, 255 ) self.m_pnlIcon = vgui.Create( "ModelImage", self ) self.m_pnlNameLabel = vgui.Create( "DLabel", self ) self.m_pnlNameLabel:SetExpensiveShadow( 2, Color(0, 0, 0, 255) ) self.m_pnlNameLabel:SetTextColor( Color(255, 255, 255, 255) ) self.m_pnlNameLabel:SetFont( "CarMenuFont" ) self.m_pnlDescLabel = vgui.Create( "DLabel", self ) self.m_pnlDescLabel:SetExpensiveShadow( 2, Color(0, 0, 0, 255) ) self.m_pnlDescLabel:SetTextColor( Color(255, 255, 255, 255) ) self.m_pnlDescLabel:SetFont( "Crafting_Trebuchet20_Bold" ) self.m_pnlLevelLabel = vgui.Create( "DLabel", self ) self.m_pnlLevelLabel:SetExpensiveShadow( 2, Color(0, 0, 0, 255) ) self.m_pnlLevelLabel:SetTextColor( Color(255, 255, 255, 255) ) self.m_pnlLevelLabel:SetFont( "CarMenuFont" ) self.m_pnlCraftBtn = vgui.Create( "SRP_Button", self ) self.m_pnlCraftBtn:SetFont( "CarMenuFont" ) self.m_pnlCraftBtn:SetText( "Craft" ) self.m_pnlCraftBtn:SetAlpha( 150 ) self.m_pnlCraftBtn.DoClick = function() GAMEMODE.Net:RequestCraftItem( self.m_tblItem.Name ) end self.m_tblMatLabels = {} end function Panel:SetItem( tblData ) self.m_tblItem = tblData self.m_pnlNameLabel:SetText( tblData.Name ) self.m_pnlDescLabel:SetText( tblData.Desc ) self.m_pnlIcon:SetModel( tblData.Model, tblData.Skin ) self.m_pnlLevelLabel:SetText( tblData.CraftSkill.. ": ".. tblData.CraftSkillLevel ) if GAMEMODE.Skills:GetPlayerLevel( tblData.CraftSkill ) < tblData.CraftSkillLevel then self.m_pnlLevelLabel:SetTextColor( Color(255, 50, 50, 255) ) end local maxW = 0 for k, v in pairs( tblData.CraftRecipe ) do local label = vgui.Create( "DLabel", self ) label:SetExpensiveShadow( 2, Color(0, 0, 0, 255) ) label:SetFont( "Crafting_Trebuchet20" ) label:SetText( k.. ("(%d/%d)"):format( math.min(LocalPlayer():GetInventory()[k] or 0, v), v ) ) if v > (LocalPlayer():GetInventory()[k] or 0) then label:SetTextColor( Color(255, 50, 50, 255) ) else label:SetTextColor( Color(255, 255, 255, 255) ) end table.insert( self.m_tblMatLabels, label ) end self:InvalidateLayout() end function Panel:Paint( intW, intH ) surface.SetDrawColor( 50, 50, 50, 200 ) surface.DrawRect( 0, 0, intW, intH ) end function Panel:Think() if not self.m_tblItem then return end if GAMEMODE.Skills:GetPlayerLevel( self.m_tblItem.CraftSkill ) < self.m_tblItem.CraftSkillLevel then self.m_pnlCraftBtn:SetDisabled( true ) return end local hasItems = true for k, v in pairs( self.m_tblItem.CraftRecipe ) do if not GAMEMODE.Inv:PlayerHasItem( k, v ) then hasItems = false end end self.m_pnlCraftBtn:SetDisabled( not hasItems ) end function Panel:PerformLayout( intW, intH ) local padding = 5 self.m_pnlIcon:SetPos( 0, 0 ) self.m_pnlIcon:SetSize( intH, intH ) self.m_pnlIcon:SetModel( self.m_tblItem.Model ) self.m_pnlNameLabel:SizeToContents() self.m_pnlNameLabel:SetPos( (padding *2) +intH, 4 ) self.m_pnlDescLabel:SizeToContents() self.m_pnlDescLabel:SetPos( (padding *2) +intH, 32 ) self.m_pnlCraftBtn:SetSize( 65, intH ) self.m_pnlCraftBtn:SetPos( intW -self.m_pnlCraftBtn:GetWide(), 0 ) self.m_pnlLevelLabel:SizeToContents() self.m_pnlLevelLabel:SetPos( intW -self.m_pnlCraftBtn:GetWide() -self.m_pnlLevelLabel:GetWide() -padding, 4 ) local x, y = (padding *2) +intH, 32 +self.m_pnlDescLabel:GetTall() local w, h = intW -((padding *2) +intH) -self.m_pnlCraftBtn:GetWide(), intH -32 -self.m_pnlDescLabel:GetTall() local _x, _y = x, y for k, v in pairs( self.m_tblMatLabels ) do v:SizeToContents() v:SetPos( _x, _y ) _x = _x +v:GetWide() +10 if _x >= w then _x = x _y = _y +v:GetTall() end end end vgui.Register( "SRPCraftingCard", Panel, "EditablePanel" ) -- ---------------------------------------------------------------- local Panel = {} function Panel:Init() self.m_pnlIcon = vgui.Create( "ModelImage", self ) self.m_pnlAbortBtn = vgui.Create( "SRP_Button", self ) self.m_pnlAbortBtn:SetFont( "CarMenuFont" ) self.m_pnlAbortBtn:SetText( "Cancel" ) self.m_pnlAbortBtn:SetAlpha( 150 ) self.m_pnlAbortBtn.DoClick = function() GAMEMODE.Net:RequestAbortCraft() end self.m_pnlTimeBar = vgui.Create( "DProgress", self ) self.m_pnlTimeBar.Think = function() if not self.m_tblItem then return end self.m_pnlTimeBar:SetFraction( (CurTime() -self.m_intCraftStartTime) /self.m_intCraftDuration ) end self.m_pnlNameLabel = vgui.Create( "DLabel", self ) self.m_pnlNameLabel:SetExpensiveShadow( 2, Color(0, 0, 0, 255) ) self.m_pnlNameLabel:SetTextColor( Color(255, 255, 255, 255) ) self.m_pnlNameLabel:SetFont( "CarMenuFont" ) end function Panel:SetCraftingData( strItemID, intStartCraft ) self.m_tblItem = GAMEMODE.Inv:GetItem( strItemID ) self.m_intCraftStartTime = intStartCraft local craftDurationScalar = GAMEMODE.Skills:GetReductionFactor( self.m_tblItem.CraftSkill, self.m_tblItem.CraftSkillLevel ) local craftDuration = self.m_tblItem.CraftDuration or 10 self.m_intCraftDuration = math.max( 1, craftDuration -(craftDuration *craftDurationScalar) ) self.m_pnlNameLabel:SetText( "Crafting 1 ".. self.m_tblItem.Name ) self.m_pnlIcon:SetModel( self.m_tblItem.Model, self.m_tblItem.Skin ) self:InvalidateLayout() end function Panel:Paint( intW, intH ) --surface.SetDrawColor( 50, 50, 50, 200 ) --surface.DrawRect( 0, 0, intW, intH ) end function Panel:PerformLayout( intW, intH ) self.m_pnlIcon:SetSize( 128, 128 ) self.m_pnlIcon:SetPos( (intW /2) -(self.m_pnlIcon:GetWide() /2), (intH /2) -(self.m_pnlIcon:GetTall() /2) ) local x, y = self.m_pnlIcon:GetPos() self.m_pnlTimeBar:SetSize( intW *0.8, 30 ) self.m_pnlTimeBar:SetPos( (intW /2) -(self.m_pnlTimeBar:GetWide() /2), y +self.m_pnlIcon:GetTall() +5 ) self.m_pnlNameLabel:SizeToContents() self.m_pnlNameLabel:SetPos( (intW /2) -(self.m_pnlNameLabel:GetWide() /2), y +self.m_pnlIcon:GetTall() +5 ) self.m_pnlAbortBtn:SetSize( intW, 30 ) self.m_pnlAbortBtn:SetPos( 0, intH -self.m_pnlAbortBtn:GetTall() ) end vgui.Register( "SRPCraftingDisplay", Panel, "EditablePanel" ) -- ---------------------------------------------------------------- local Panel = {} function Panel:Init() self:SetDeleteOnClose( false ) self:SetTitle( "Crafting Table" ) self.m_pnlCanvas = vgui.Create( "SRP_ScrollPanel", self ) self.m_tblCards = {} self.m_pnlSearch = vgui.Create( "EditablePanel", self ) self.m_pnlSearch.SearchBtn = vgui.Create( "SRP_Button", self.m_pnlSearch ) self.m_pnlSearch.SearchBtn:SetFont( "DermaLarge" ) self.m_pnlSearch.SearchBtn:SetText( "Search" ) self.m_pnlSearch.SearchBtn:SetAlpha( 200 ) self.m_pnlSearch.SearchBtn.DoClick = function() for k, v in pairs( self.m_tblCards ) do if v.m_tblItem.Name:lower():find( self.m_pnlSearch.TextEntry:GetValue() ) ~= nil then self.m_pnlCanvas:ScrollToChild( v ) break end end end self.m_pnlSearch.TextEntry = vgui.Create( "DTextEntry", self.m_pnlSearch ) self.m_pnlSearch.TextEntry.OnEnter = self.m_pnlSearch.SearchBtn.DoClick self.m_pnlSearch.PerformLayout = function( p, intW, intH ) p.SearchBtn:SetSize( 110, intH ) p.SearchBtn:SetPos( intW -p.SearchBtn:GetWide(), 0 ) p.TextEntry:SetSize( intW -p.SearchBtn:GetWide(), intH ) p.TextEntry:SetPos( 0, 0 ) end self.m_pnlSearch.Paint = function( _, intW, intH ) surface.SetDrawColor( 50, 50, 50, 200 ) surface.DrawRect( 0, 0, intW, intH ) end self.m_pnlCanvas:AddItem( self.m_pnlSearch ) self.m_pnlCraftDisplay = vgui.Create( "SRPCraftingDisplay", self ) self.m_pnlCraftDisplay:SetVisible( false ) hook.Add( "GamemodeOnStartCrafting", ("OnStartCraft_CraftingTableMenu_%p"):format(self), function( strItemID, intStartTime ) if self.m_strGroup ~= GAMEMODE.Inv:GetItem( strItemID ).CraftingEntClass then return end self.m_pnlCraftDisplay:SetCraftingData( strItemID, intStartTime ) self.m_pnlCanvas:MoveTo( -self:GetWide(), 24, 0.25, 0, 2, function() self.m_pnlCanvas:SetVisible( false ) end ) self.m_pnlCraftDisplay:SetVisible( true ) self.m_pnlCraftDisplay:SetPos( self:GetWide(), 24 ) self.m_pnlCraftDisplay:MoveTo( 0, 24, 0.25, 0, 2, function() self.m_pnlCraftDisplay:SetVisible( true ) end ) end ) hook.Add( "GamemodeOnEndCrafting", ("OnEndCraft_CraftingTableMenu_%p"):format(self), function( strItemID ) if self.m_strGroup ~= GAMEMODE.Inv:GetItem( strItemID ).CraftingEntClass then return end self.m_pnlCraftDisplay:SetVisible( true ) self.m_pnlCraftDisplay:MoveTo( self:GetWide(), 24, 0.25, 0, 2, function() self.m_pnlCraftDisplay:SetVisible( false ) end ) self.m_pnlCanvas:SetVisible( true ) self.m_pnlCanvas:SetPos( -self:GetWide(), 24 ) self.m_pnlCanvas:MoveTo( 0, 24, 0.25, 0, 2, function() self.m_pnlCanvas:SetVisible( true ) end ) end ) end function Panel:SetCraftingGroupData( strMenuTitle, strCraftingGroup ) self:SetTitle( strMenuTitle ) self.m_strGroup = strCraftingGroup end function Panel:Populate() for k, v in pairs( self.m_tblCards ) do if ValidPanel( v ) then v:Remove() end self.m_tblCards[k] = nil end local items = table.Copy( GAMEMODE.Inv:GetItems() ) for k, data in SortedPairsByMemberValue( items, "CraftSkillLevel", false ) do if not data.CraftingEntClass or data.CraftingEntClass ~= self.m_strGroup then continue end self:CreateCraftingCardCard( k, items[k] ) end self:InvalidateLayout() end function Panel:CreateCraftingCardCard( k, tblData ) local pnl = vgui.Create( "SRPCraftingCard" ) pnl:SetItem( tblData ) pnl.m_pnlParentMenu = self self.m_pnlCanvas:AddItem( pnl ) self.m_tblCards[k] = pnl return pnl end function Panel:PerformLayout( intW, intH ) DFrame.PerformLayout( self, intW, intH ) self.m_pnlCanvas:SetPos( 0, 24 ) self.m_pnlCanvas:SetSize( intW, intH -24 ) self.m_pnlSearch:DockMargin( 0, 0, 0, 5 ) self.m_pnlSearch:SetTall( 32 ) self.m_pnlSearch:Dock( TOP ) for _, pnl in pairs( self.m_tblCards ) do pnl:DockMargin( 0, 0, 0, 5 ) pnl:SetTall( 128 ) pnl:Dock( TOP ) end self.m_pnlCraftDisplay:SetPos( 0, 24 ) self.m_pnlCraftDisplay:SetSize( intW, intH -24 ) end function Panel:Open() self:Populate() self:SetVisible( true ) self:MakePopup() end vgui.Register( "SRPCraftingTableMenu", Panel, "SRP_Frame" ) -- ---------------------------------------------------------------- local Panel = {} function Panel:Init() self:SetDeleteOnClose( false ) self:SetTitle( "Crafting Table" ) self.m_pnlTabs = vgui.Create( "SRP_PropertySheet", self ) self.m_pnlTabs:SetPadding( 0 ) self.m_tblTabs = {} self.m_pnlCraftDisplay = vgui.Create( "SRPCraftingDisplay", self ) self.m_pnlCraftDisplay:SetVisible( false ) hook.Add( "GamemodeOnStartCrafting", ("OnStartCraft_CraftingTableMenu_%p"):format(self), function( strItemID, intStartTime ) if self.m_strGroup ~= GAMEMODE.Inv:GetItem( strItemID ).CraftingEntClass then return end self.m_pnlCraftDisplay:SetCraftingData( strItemID, intStartTime ) self.m_pnlTabs:MoveTo( -self:GetWide(), 24, 0.25, 0, 2, function() self.m_pnlTabs:SetVisible( false ) end ) self.m_pnlCraftDisplay:SetVisible( true ) self.m_pnlCraftDisplay:SetPos( self:GetWide(), 24 ) self.m_pnlCraftDisplay:MoveTo( 0, 24, 0.25, 0, 2, function() self.m_pnlCraftDisplay:SetVisible( true ) end ) end ) hook.Add( "GamemodeOnEndCrafting", ("OnEndCraft_CraftingTableMenu_%p"):format(self), function( strItemID ) if self.m_strGroup ~= GAMEMODE.Inv:GetItem( strItemID ).CraftingEntClass then return end self.m_pnlCraftDisplay:SetVisible( true ) self.m_pnlCraftDisplay:MoveTo( self:GetWide(), 24, 0.25, 0, 2, function() self.m_pnlCraftDisplay:SetVisible( false ) end ) self.m_pnlTabs:SetVisible( true ) self.m_pnlTabs:SetPos( -self:GetWide(), 24 ) self.m_pnlTabs:MoveTo( 0, 24, 0.25, 0, 2, function() self.m_pnlTabs:SetVisible( true ) end ) end ) end function Panel:AddTab( strTabName ) local tab = vgui.Create( "EditablePanel", self ) tab.m_pnlCanvas = vgui.Create( "SRP_ScrollPanel", tab ) tab.m_tblCards = {} tab.m_pnlSearch = vgui.Create( "EditablePanel", tab ) tab.m_pnlSearch.SearchBtn = vgui.Create( "SRP_Button", tab.m_pnlSearch ) tab.m_pnlSearch.SearchBtn:SetFont( "DermaLarge" ) tab.m_pnlSearch.SearchBtn:SetText( "Search" ) tab.m_pnlSearch.SearchBtn:SetAlpha( 200 ) tab.m_pnlSearch.SearchBtn.DoClick = function() for k, v in pairs( tab.m_tblCards ) do if v.m_tblItem.Name:lower():find( tab.m_pnlSearch.TextEntry:GetValue() ) ~= nil then tab.m_pnlCanvas:ScrollToChild( v ) break end end end tab.m_pnlSearch.TextEntry = vgui.Create( "DTextEntry", tab.m_pnlSearch ) tab.m_pnlSearch.TextEntry.OnEnter = tab.m_pnlSearch.SearchBtn.DoClick tab.m_pnlSearch.PerformLayout = function( p, intW, intH ) p.SearchBtn:SetSize( 110, intH ) p.SearchBtn:SetPos( intW -p.SearchBtn:GetWide(), 0 ) p.TextEntry:SetSize( intW -p.SearchBtn:GetWide(), intH ) p.TextEntry:SetPos( 0, 0 ) end tab.m_pnlSearch.Paint = function( _, intW, intH ) surface.SetDrawColor( 50, 50, 50, 200 ) surface.DrawRect( 0, 0, intW, intH ) end tab.m_pnlCanvas:AddItem( tab.m_pnlSearch ) tab.PerformLayout = function( _, intW, intH ) tab.m_pnlCanvas:SetPos( 0, 0 ) tab.m_pnlCanvas:SetSize( intW, intH ) tab.m_pnlSearch:DockMargin( 0, 0, 0, 5 ) tab.m_pnlSearch:SetTall( 32 ) tab.m_pnlSearch:Dock( TOP ) for _, pnl in pairs( tab.m_tblCards ) do pnl:DockMargin( 0, 0, 0, 5 ) pnl:SetTall( 128 ) pnl:Dock( TOP ) end end self.m_tblTabs[strTabName] = tab self.m_pnlTabs:AddSheet( strTabName, tab ) end function Panel:GetTab( strTabName ) return self.m_tblTabs[strTabName] and self.m_tblTabs[strTabName].Panel or nil end function Panel:SetCraftingGroupData( strMenuTitle, strCraftingGroup ) self:SetTitle( strMenuTitle ) self.m_strGroup = strCraftingGroup end function Panel:Populate() for _, tab in pairs( self.m_tblTabs ) do for k, v in pairs( tab.m_tblCards ) do if ValidPanel( v ) then v:Remove() end tab.m_tblCards[k] = nil end end local items = table.Copy( GAMEMODE.Inv:GetItems() ) for k, data in SortedPairsByMemberValue( items, "CraftSkillLevel", false ) do if not data.CraftingEntClass or data.CraftingEntClass ~= self.m_strGroup then continue end self:CreateCraftingCardCard( k, items[k] ) end self:InvalidateLayout() end function Panel:CreateCraftingCardCard( k, tblData ) if not tblData.CraftSkill then return end local pnl = vgui.Create( "SRPCraftingCard" ) pnl:SetItem( tblData ) pnl.m_pnlParentMenu = self if not ValidPanel( self:GetTab(tblData.CraftSkill) ) then self:AddTab( tblData.CraftSkill ) end self:GetTab( tblData.CraftSkill ).m_pnlCanvas:AddItem( pnl ) self:GetTab( tblData.CraftSkill ).m_tblCards[k] = pnl return pnl end function Panel:PerformLayout( intW, intH ) DFrame.PerformLayout( self, intW, intH ) self.m_pnlTabs:SetPos( 0, 24 ) self.m_pnlTabs:SetSize( intW, intH -24 ) self.m_pnlCraftDisplay:SetPos( 0, 24 ) self.m_pnlCraftDisplay:SetSize( intW, intH -24 ) end function Panel:Open() self:Populate() self:SetVisible( true ) self:MakePopup() end vgui.Register( "SRPAssemblyTableMenu", Panel, "SRP_Frame" )
function love.conf(t) t.window.width = 1280 t.window.height = 720 end
-- Copyright 2018 the wonderful GUI project authors -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. --- Various table utilities. -- @module wonderful.util.table --- Create a shallow copy of a table. -- @tparam table orig a value -- @treturn table the copy local function shallowcopy(orig) if type(orig) ~= "table" then return orig end local copy = {} for k, v in pairs(orig) do copy[k] = v end return copy end --- Test two values for equality. -- If both values are tables, checks whether the left value is a subset of -- the right value, using `==` to test for equality of table values. -- @param lhs the left value -- @param rhs the right value -- @treturn boolean local function shalloweq(lhs, rhs) if lhs == rhs then return true end if type(lhs) ~= type(rhs) then return false end if type(lhs) ~= "table" then return false end for k, v in pairs(lhs) do if not rhs[k] or rhs[k] ~= v then return false end end end --- Checks if a table contains a value. -- @param value a value -- @tparam table tbl a table -- @return[1] `true` if the table contains the given value -- @return[1] the first key which maps to the given value -- @return[2] `false` if the table doesn't contain the given value local function isin(value, tbl) for k, v in pairs(tbl) do if v == value then return true, k end end return false end --- Create a table that tries to require a submodule when indexed. -- E. g., `autoimport({}, "test").submodule` tries to -- `require("test.submodule")` and returns the value if it succeeds. -- -- If the required value is a table, applies -- @{wonderful.util.table.autoimport|autoimport} to it. -- -- @tparam table root an root table -- @tparam string pkg a root module name -- @treturn table local function autoimport(root, pkg) return setmetatable(root, { __index = function(self, name) local success, mod = pcall(require, pkg .. "." .. name) if success then if type(mod) == "table" and not getmetatable(mod) then return autoimport(mod, pkg .. "." .. name) else return mod end end end }) end --- Swap the keys and values of a table. -- @tparam table tbl a table -- @treturn table a swapped table -- @raise the table has two keys with the same value -- @usage -- local tbl = {13, 19, 20, 45} -- local swapped = swapPairs(tbl) -- print(swapped[13]) --> 1 -- print(swapped[1]) --> nil local function swapPairs(tbl) local result = {} for k, v in pairs(tbl) do if result[v] then error("the table has two keys with the same value") end result[v] = k end return result end --- Calculate the number of entries in a table. -- @tparam table tbl the table -- @treturn int the number of entries local function tableLen(tbl) local i = 0 for _ in pairs(tbl) do i = i + 1 end return i end --- Get keys of a table. -- @tparam table tbl the table -- @treturn table a table of the keys local function getKeys(tbl) local result = {} for k in pairs(tbl) do result[#result + 1] = k end return result end --- Get an element of a table that follows a previous one. -- -- If the given key is `nil`, the first element is returned. -- @tparam table tbl the table -- @param[opt] key the key of the previous element -- @return the next key -- @return the next element local function nextEntry(tbl, key) local keys = {} for k in pairs(tbl) do if not key or k > key then keys[#keys + 1] = k end end table.sort(keys) return keys[1], tbl[keys[1]] end --- Get an element of a table that precedes a following one. -- -- If the given key is `nil`, the last element is returned. -- @tparam table tbl the table -- @param[opt] key the key of the following element -- @return the preceding key -- @return the preceding element local function prevEntry(tbl, key) local keys = {} for k in pairs(tbl) do if not key or k < key then keys[#keys + 1] = k end end table.sort(keys) return keys[#keys], tbl[keys[#keys]] end --- Find the first sequence entry whose value equals to the given one, and -- remove it. -- @tparam table tbl the sequence -- @param value the value -- @return[1] the key of the removed entry -- @return[1] the value of the removed entry -- @treturn[2] nil no entry was found local function removeFirst(tbl, value) for k, v in ipairs(tbl) do if v == value then table.remove(tbl, k) return k, v end end return nil end --- Find the first sequence entry that satisfies a predicate. -- -- The predicate should return any value other than `nil` and `false` to stop -- the iteration and return the current value. -- -- The range of search is `[start; stop]`. -- @tparam table tbl the sequence -- @tparam function(element,key,tbl) predicate the predicate -- @tparam[opt=1] int start the index to start searching from -- @tparam[optchain=#tbl] int stop the index to stop searching at -- @return[1] the entry key -- @return[1] the entry value -- @treturn[2] nil no entries satisfy the predicate local function first(tbl, predicate, start, stop) for k = start or 1, stop or #tbl, 1 do local v = tbl[k] if v ~= nil and predicate(v, k, tbl) then return k, v end end return nil end --- Find the last sequence entry that satisfies a predicate. -- -- The predicate should return any value other than `nil` and `false` to stop -- the iteration and return the current value. -- -- The range of search is `[start; stop]`. -- @tparam table tbl the sequence -- @tparam function(element,key,tbl) predicate the predicate -- @tparam[opt=1] int start the start index -- @tparam[optchain=#tbl] int stop the end index -- @return[1] the entry key -- @return[1] the entry value -- @treturn[2] nil no entries satisfy the predicate local function last(tbl, predicate, start, stop) for k = stop or #tbl, start or 1, -1 do local v = tbl[k] if v ~= nil and predicate(v, k, tbl) then return k, v end end return nil end --- @export return { shalloweq = shalloweq, shallowcopy = shallowcopy, isin = isin, autoimport = autoimport, swapPairs = swapPairs, tableLen = tableLen, getKeys = getKeys, nextEntry = nextEntry, prevEntry = prevEntry, removeFirst = removeFirst, first = first, last = last, }
-- This is a fix for the global resource not starting up function resStart() setTimer(loadGlobal, 1000, 1) end addEventHandler("onResourceStart", getResourceRootElement(), resStart) function loadGlobal() restartResource(getResourceFromName("global")) setTimer(displayCredits, 1000, 1) end function displayCredits() exports.irc:sendMessage("-------------------------------------------------------------") exports.irc:sendMessage("-- VG MTA:RP Script V2 Loaded - By vG.MTA Scripting Team --") exports.irc:sendMessage("-- www.valhallagaming.net --") exports.irc:sendMessage("-------------------------------------------------------------") end
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' files { 'PoliceFunctions-API.dll', 'NativeUI.dll' } client_scripts { 'client.net.dll' }
Quest.Config.Storylines["the_great_heist"] ={ name = "The Great Heist", id = "the_great_heist", desc = "Take on the biggest robbery and hit the bank vault", quests = { [1] = { name = "Purchase a Mask", desc = "Purchase a mask from the F4 menu", func = function(ply, data, partyCount) return true end }, [2] = { name = "Rob the Big Bank Vault", desc = "Break into the bank vault and rob it", func = function(ply, data, partyCount) return true end }, [3] = { name = "Sell the Money Bags", desc = "Find a Corrupt Banker and sell him your Money Bags", func = function(ply, data, partyCount) return true end, reward = function(ply) ply:GiveBadge("quest") end }, } } -- Purchase a mask hook.Add("playerBoughtCustomEntity", "Quest:Progress:the_great_heist", function(ply, entTable, ent) if not (ent:GetClass() == "pvault_mask") then return end Quest.Core.ProgressQuest(ply, "the_great_heist", 1) end) -- The big vault was robbed hook.Add("pVaultVaultCracked", "Quest:Progress:the_great_heist", function(ent, ply) if not (ent:GetClass() == "pvault_door") then return end Quest.Core.ProgressPartyQuest(ply, "the_great_heist", 2) end) -- Sell the money hook.Add("pVaultMoneyCleaned", "Quest:Progress:the_great_heist", function(ply) Quest.Core.ProgressPartyQuest(ply, "the_great_heist", 3) end)
-- fireflies/documentation.lua -----Load documentation via doc_helper------------------------ local MP = minetest.get_modpath(minetest.get_current_modname()) local docpath = MP .. DIR_DELIM .. "doc" doc.add_category("fireflies", { name = "_fireflies_", description = "Fireflies Documentation", build_formspec = doc.entry_builders.text_and_square_gallery, }) doc.build_entries(docpath, "fireflies")
-- --SHEEP -- ccmobs2 = {} minetest.register_node("ccmobs2:sheep_block", { drawtype = "nodebox", node_box = { type = "fixed", fixed = { {-0.3125, -0.375, -0.4375, 0.3125, 0.1875, 0.1875}, {-0.1875, -0.25, 0.125, 0.1875, 0.0625, 0.375}, {-0.25, -0.0625, 0.1875, 0.25, 0.06, 0.3125}, {-0.125, -0.3125, 0.3125, 0.125, 0.08995, 0.5}, {0.0625, -0.5, -0.0625, 0.25, -0.375, 0.125}, {-0.25, -0.5, -0.0625, -0.0625, -0.3125, 0.125}, {0.0625, -0.5, -0.375, 0.25, -0.3125, -0.1875}, {-0.25, -0.5, -0.375, -0.0625, -0.3125, -0.1875}, {-0.0625, -0.1875, -0.5, 0.0625, 0.0625, -0.4375}, }, }, tiles = {"ccmobs2_sheep_top.png", "ccmobs2_sheep_bottom.png", "ccmobs2_sheep_right_side.png", "ccmobs2_sheep_left_side.png", "ccmobs2_sheep_front.png", "ccmobs2_sheep_back.png"}, groups = {not_in_creative_inventory = 1}, }) minetest.register_node("ccmobs2:sheep_shaved", { drawtype = "nodebox", node_box = { type = "fixed", fixed = { {-0.25, -0.35225, -0.375, 0.25, 0.125, 0.1875}, {-0.1875, -0.207206, 0.125, 0.1875, 0.0207206, 0.375}, {-0.25, -0.0625, 0.1875, 0.25, 0.06, 0.3125}, {-0.125, -0.3125, 0.3125, 0.125, 0.08995, 0.5}, {-0.0625, -0.1875, -0.4375, 0.0625, 0.0625, -0.375}, {-0.25, -0.5, -0.375, -0.0625, -0.25, -0.1875}, {0.0625, -0.5, -0.375, 0.25, -0.25, -0.1875}, {-0.25, -0.5, -0.0625, -0.0625, -0.25, 0.125}, {0.0625, -0.5, -0.0625, 0.25, -0.25, 0.125}, }, }, tiles = {"ccmobs2_sheep_shaved_top.png", "ccmobs2_sheep_bottom.png", "ccmobs2_sheep_shaved_right_side.png", "ccmobs2_sheep_shaved_left_side.png", "ccmobs2_sheep_shaved_front.png", "ccmobs2_sheep_shaved_back.png"}, groups = {not_in_creative_inventory = 1}, }) mobs:register_mob("ccmobs2:sheep", { type = "animal", passive = true, hp_min = 4, hp_max = 8, armor = 200, collisionbox = {-0.525, -0.585, -0.525, 0.525, 0.325, 0.525}, visual = "wielditem", visual_size = {x=0.75, y=0.75}, textures = {"ccmobs2:sheep_block"}, --gotten_texture = {"ccmobs2:sheep_shaved"}, makes_footstep_sound = false, walk_velocity = 0.1, run_velocity = 0.75, runaway = true, pushable = true, jump = false, drops = { {name = "mobs:meat_raw", chance = 1, min = 1, max = 1,}, }, drawtype = "front", water_damage = 2, lava_damage = 6, light_damage = 0, sounds = { random = "ccmobs2_sheep", }, animation = { speed_normal = 15, speed_run = 15, stand_start = 0, stand_end = 80, walk_start = 81, walk_end = 100, }, follow = {"farming:wheat", "default:grass_1"}, view_range = 4, replace_rate = 10, replace_what = { {"group:grass", "air", -1}, {"default:dirt_with_grass", "default:dirt", -2} }, fear_height = 3, on_replace = function(self, pos, oldnode, newnode) self.food = (self.food or 0) + 1 -- if sheep replaces 8x grass then it regrows wool if self.food >= 8 then self.food = 0 self.gotten = false self.object:set_properties({ textures = {"ccmobs2:sheep_block"}, }) end end, on_rightclick = function(self, clicker) tool = clicker:get_wielded_item():get_name() --are we feeding? if mobs:feed_tame(self, clicker, 8, true, true) then --if fed 7x grass or wheat then sheep regrows wool if self.food and self.food > 6 then self.gotten = false self.object:set_properties({ textures = {"ccmobs2:sheep_block"}, }) end return end if mobs:protect(self, clicker) then return end if ccmobs2:capture_mob(self, clicker, "ccmobs2:sheep") then return end if tool == "mobs:shears" and clicker:get_inventory() and not self.empty then self.empty = true clicker:get_inventory():add_item("main", "wool:white") minetest.sound_play("ccmobs2_sheep_hurt",{pos=pos, max_hear_distance=3, gain=0.5, loop=false}) self.object:set_properties({ textures = {"ccmobs2:sheep_shaved"}, }) end end })
return { init_effect = "", name = "灭火器T3", time = 0, color = "blue", picture = "", desc = "起火概率降低30%,持续时间缩短6秒,伤害降低20%", stack = 1, id = 6031, icon = 6031, last_effect = "", effect_list = { { type = "BattleBuffAddAttr", trigger = { "onAttach" }, arg_list = { attr = "igniteResist", number = 0.3 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach" }, arg_list = { attr = "igniteShorten", number = 6 } }, { type = "BattleBuffAddAttr", trigger = { "onAttach" }, arg_list = { attr = "igniteReduce", number = 2000 } } } }
repeat wait() until game.Players.LocalPlayer.Character local Players = game:GetService("Players") local Player = Players.LocalPlayer local Character = Player.Character -- services local ECS = require(game.ReplicatedStorage:WaitForChild("ECS")) local ECSUtil = require(game.ReplicatedStorage:WaitForChild("ECSUtil")) -- Components local Components = game.ReplicatedStorage:WaitForChild("tutorial"):WaitForChild("component") local WeaponComponent = require(Components:WaitForChild("WeaponComponent")) -- Systems local Systems = game.ReplicatedStorage:WaitForChild("tutorial"):WaitForChild("system") local FiringSystem = require(Systems:WaitForChild("FiringSystem")) local PlayerShootingSystem = require(Systems:WaitForChild("PlayerShootingSystem")) local CleanupFiringSystem = require(Systems:WaitForChild("CleanupFiringSystem")) -- Our world local world = ECS.CreateWorld(nil, { Frequency = 10 }) world.AddSystem(FiringSystem) world.AddSystem(PlayerShootingSystem) world.AddSystem(CleanupFiringSystem) ECSUtil.AddDefaultSystems(world) -- Our weapon local rightHand = Character:WaitForChild("RightHand") local weapon = Instance.new("Part", Character) weapon.CanCollide = false weapon.CastShadow = false weapon.Size = Vector3.new(0.2, 0.2, 2) weapon.CFrame = rightHand.CFrame + Vector3.new(0, 0, -1) weapon.Color = Color3.fromRGB(255, 0, 255) local weldWeapon = Instance.new("WeldConstraint", weapon) weldWeapon.Part0 = weapon weldWeapon.Part1 = rightHand -- weapon bullet spawn local BulletSpawnPart = Instance.new("Part", weapon) BulletSpawnPart.CanCollide = false BulletSpawnPart.CastShadow = false BulletSpawnPart.Color = Color3.fromRGB(255, 255, 0) BulletSpawnPart.Size = Vector3.new(0.6, 0.6, 0.6) BulletSpawnPart.Shape = Enum.PartType.Ball BulletSpawnPart.CFrame = weapon.CFrame + Vector3.new(0, 0, -1) local weldBulletSpawn = Instance.new("WeldConstraint", BulletSpawnPart) weldBulletSpawn.Part0 = BulletSpawnPart weldBulletSpawn.Part1 = weapon -- Create our entity local bulletSpawnEntity = ECSUtil.NewBasePartEntity(world, BulletSpawnPart, true, false) -- Mark as weapon world.Set(bulletSpawnEntity, WeaponComponent)
return function() local Toast = script.Parent local Dialog = Toast.Parent local App = Dialog.Parent local UIBlox = App.Parent local Packages = UIBlox.Parent local Roact = require(Packages.Roact) local TestStyle = require(UIBlox.App.Style.Validator.TestStyle) local mockStyleComponent = require(UIBlox.Utility.mockStyleComponent) local ToastFrame = require(Toast.ToastFrame) local ICON_SIZE = 36 local testText = "Test Title" local testSubText = "test test test" local createToastFrame = function(props) return mockStyleComponent({ ToastFrame = Roact.createElement(ToastFrame, props) }) end it("should throw on invalid titleTextProps", function() local element = createToastFrame({ titleTextProps = {}, }) expect(function() Roact.mount(element) end).to.throw() end) it("should create and destroy without errors with valid titleTextProps", function() local element = createToastFrame({ titleTextProps = { colorStyle = TestStyle.Theme.TextEmphasis, fontStyle = TestStyle.Font.Header2, Size = UDim2.new(1, 0, 1, 0), Text = testText, }, }) local instance = Roact.mount(element) Roact.unmount(instance) end) it("should create and destroy without errors with valid titleTextProps and subtitleTextProps", function() local element = createToastFrame({ subtitleTextProps = { colorStyle = TestStyle.Theme.TextEmphasis, fontStyle = TestStyle.Font.CaptionBody, Size = UDim2.new(1, 0, 0.5, 0), Text = testSubText, }, titleTextProps = { colorStyle = TestStyle.Theme.TextEmphasis, fontStyle = TestStyle.Font.Header2, Size = UDim2.new(1, 0, 0.5, 0), Text = testText, }, }) local instance = Roact.mount(element) Roact.unmount(instance) end) it("should create and destroy without errors with valid titleTextProps and iconProps", function() local element = createToastFrame({ iconProps = { colorStyle = TestStyle.Theme.IconEmphasis, Image = "rbxassetid://4126499279", Size = UDim2.new(0, ICON_SIZE, 0, ICON_SIZE), }, titleTextProps = { colorStyle = TestStyle.Theme.TextEmphasis, fontStyle = TestStyle.Font.Header2, Size = UDim2.new(1, -ICON_SIZE, 1, 0), Text = testText, }, }) local instance = Roact.mount(element) Roact.unmount(instance) end) it("should create and destroy without errors with composed image", function() local element = createToastFrame({ iconProps = { colorStyle = TestStyle.Theme.IconEmphasis, Image = "rbxassetid://4126499279", Size = UDim2.new(0, ICON_SIZE, 0, ICON_SIZE), }, iconChildren = { Child = Roact.createElement("TextLabel"), }, titleTextProps = { colorStyle = TestStyle.Theme.TextEmphasis, fontStyle = TestStyle.Font.Header2, Size = UDim2.new(1, -ICON_SIZE, 1, 0), Text = testText, }, }) local instance = Roact.mount(element) Roact.unmount(instance) end) end
-- local Class = require "libs.class" local Concord = require "libs.concord" local Position = require "components.position" local Velocity = require "components.velocity" local Sprite = require "components.sprite" local Input = require "components.input" local Player = require "components.player" local Hitbox = require "components.hitbox" local Kinematic = require "components.kinematic" local Gravity = require "components.gravity" local Player = Concord.assemblage(function(e, obj) local pos = {x = obj.position[1], y = obj.position[2]} local sprite = tico.resources.getByKey(obj.sprite) -- print(pos.x, pos.y) e :give(Position, pos.x, pos.y) :give(Velocity) :give(Sprite, sprite) :give(Input) :give(Player) :give(Hitbox, obj.hitbox) :give(Kinematic) :give(Gravity) end) -- local Player = Class:extend("Player") -- function Player:constructor(object) -- -- self.image = tico.resources.getByKey(object.texture) -- self.x = object.position[1] -- self.y = object.position[2] -- self.angle = object.angle -- local sprite = tico.resources.getByKey(object.sprite) -- self.sprite = tico.engine.newSprite(sprite) -- self.sprite:play("idle") -- end -- function Player:update(dt) -- if tico.input.keyDown("right") then -- self.x = self.x + 100 * dt -- self.sprite:play("walk") -- elseif tico.input.keyDown("left") then -- self.x = self.x - 100 * dt -- self.sprite:play("walk") -- else -- self.sprite:play("idle") -- end -- self.sprite:update(dt) -- camera:move(-self.x+80, -self.y+46) -- end -- function Player:draw() -- self.sprite:draw(self.x, self.y, self.angle, 1, 1, 8, 8) -- end return Player
local const = require("scrollbar.const") local utils = require("scrollbar.utils") local M = {} local NAMESPACE = vim.api.nvim_create_namespace(const.NAME_PREFIX) M.render = function() vim.api.nvim_buf_clear_namespace(0, NAMESPACE, 0, -1) local config = require("scrollbar.config").get() if not config.show then return end if vim.tbl_contains(config.excluded_filetypes, vim.bo.filetype) then return end local total_lines = vim.api.nvim_buf_line_count(0) local visible_lines = vim.api.nvim_win_get_height(0) local first_visible_line = vim.fn.line("w0") local last_visible_line = vim.fn.line("w$") local show_handle = true if visible_lines >= total_lines then visible_lines = total_lines if config.handle.hide_if_all_visible then show_handle = false end end local ratio = visible_lines / total_lines local relative_first_line = math.floor(first_visible_line * ratio) - math.floor(1 * ratio) local relative_last_line = math.floor(last_visible_line * ratio) local scrollbar_marks = utils.get_scrollbar_marks(0) local sorted_scrollbar_marks = {} for _, namespace_marks in pairs(scrollbar_marks) do for _, mark in ipairs(namespace_marks) do table.insert(sorted_scrollbar_marks, mark) end end table.sort(sorted_scrollbar_marks, function(a, b) if a.line == b.line then return config.marks[a.type].priority < config.marks[b.type].priority end return a.line < b.line end) local handle_marks = {} local other_marks = {} for _, mark in pairs(sorted_scrollbar_marks) do local relative_mark_line = math.floor(mark.line * ratio) if mark.line <= total_lines then if handle_marks[#handle_marks] and math.floor(handle_marks[#handle_marks].line * ratio) == relative_mark_line then utils.set_next_level_text(handle_marks[#handle_marks]) elseif other_marks[#other_marks] and math.floor(other_marks[#other_marks].line * ratio) == relative_mark_line then utils.set_next_level_text(other_marks[#other_marks]) else if relative_mark_line >= relative_first_line and relative_mark_line <= relative_last_line then table.insert(handle_marks, mark) else table.insert(other_marks, mark) end end end end local scroll_offset = visible_lines - (last_visible_line - first_visible_line) for i = relative_first_line, relative_last_line, 1 do local mark_line = first_visible_line + i - scroll_offset if mark_line >= 0 then local handle_opts = { virt_text_pos = "right_align", } local handle_mark = nil for index, mark in ipairs(handle_marks) do local relative_mark_line = math.floor(mark.line * ratio) if relative_mark_line >= i - 1 and relative_mark_line <= i then handle_mark = mark table.remove(handle_marks, index) break end end if handle_mark then handle_opts.virt_text = { { handle_mark.text, utils.get_highlight_name(handle_mark.type, show_handle) }, } else local handle_mark_text = config.handle.text if not show_handle then handle_mark_text = "" end handle_opts.virt_text = { { handle_mark_text, utils.get_highlight_name("", show_handle) }, } end vim.api.nvim_buf_set_extmark(0, NAMESPACE, mark_line, -1, handle_opts) end end for _, mark in pairs(other_marks) do if mark ~= nil then local mark_line = first_visible_line + math.floor(tonumber(mark.line) * ratio) - scroll_offset if mark_line >= 0 then local mark_opts = { virt_text_pos = "right_align", virt_text = { { mark.text, utils.get_highlight_name(mark.type, false) } }, } vim.api.nvim_buf_set_extmark(0, NAMESPACE, mark_line, -1, mark_opts) end end end end M.setup = function(overrides) local config = require("scrollbar.config").set(overrides) utils.set_highlights() utils.set_commands() vim.cmd([[ augroup scrollbar_setup_highlights autocmd! autocmd ColorScheme * lua require('scrollbar.utils').set_highlights() augroup END ]]) if config.autocmd and config.autocmd.render and #config.autocmd.render > 0 then vim.cmd(string.format( [[ augroup scrollbar autocmd! autocmd %s * lua require('scrollbar').render() augroup END ]], table.concat(config.autocmd.render, ",") )) end if config.handlers.diagnostic then require("scrollbar.handlers.diagnostic").setup() end if config.handlers.search then require("scrollbar.handlers.search").setup() end end return M
--[[ Number.lua --]] local Number, dbg = Object:newClass{ className = 'Number', register = false } --- Constructor for extending class. -- function Number:newClass( t ) return Object.newClass( self, t ) end --- Constructor for new instance. -- function Number:new( t ) return Object.new( self, t ) end --- Check whether a value assumed to be number (or nil) is not zero. -- function Number:isNonZero( s ) if (s ~= nil) and (s ~= 0) then return true else return false end end --- Try to convert a string to a number, without croaking if the string is nil, null, or isn't a number... -- function Number:numberFromString( s ) if s == nil or s == '' then -- I thought this would throw an error if s not a string type, but @15/Dec/2012 (already) numeric type is surviving the test. return nil end local sts, num = pcall( tonumber, s ) if sts and num then return num else return nil end end Number.getNumberFromString = Number.numberFromString -- 'Number:getNumberFromString(' --- takes a number (or string representation of a number) and returns a string with sign prepended. function Number:signedString( v ) if tonumber( v ) > 0 then -- should be ok to apply tonumber if v already number. return "+" .. v else return "" .. v end end --- Get a number from a variable whose type has not been pre-assured. -- -- @usage This function was invented when I thought the above would fail when 's' not string (e.g. number), but that seems OK now, so this function is may be completely redundent. -- @usage If number, then returned verbatim, if string, then attempt to convert to number, otherwise returns nil. -- @usage The intended use is for cases when a number is required, but user or legacy code may have left something else where a number is expected, in which case, the old value is to be ignored... -- @usage never throws an error. -- function Number:getAsNumber( a ) if a ~= nil then if type( a ) == 'number' then return a elseif type( a ) == 'string' then return self:numberFromString( a ) -- will be nil if string is not convertible to number. else return nil end else return nil end end --- Determine if a number, and if so, return it's value, otherwise return nil. -- -- @usage never throws error. -- function Number:getNumber( a, nameToThrow ) if a ~= nil then if type( a ) == 'number' then return a elseif nameToThrow then app:error( "'^1' must be a number, not a '^2'", nameToThrow, type( a ) ) else return nil end else return nil end end --- Check if value is non-zero number. -- -- @usage value can be nil, but if non-nil - must be number. -- function Number:isNonZero( value ) if value ~= nil and value ~= 0 then return true else return false end end --- Determine if number is integer. -- function Number:isInteger( num ) return (num % 1) == 0 end --- Determine if number is within a certain amount of another number +/- -- function Number:isWithin( num1, num2, amt ) if ( num1 + amt ) >= num2 and ( num1 - amt ) <= num2 then return true end end --- Format number to string with specified precision. -- function Number:fmtPrec( val, prec ) if prec == 0 then return string.format( "%d", val ) else return string.format( str:fmtx( "%.^1f", prec ), val ) end end return Number
local noop = function() end local vararg_callback = function(...) end local call_noargs = function(fn) fn() end local call_vararg = function(fn, ...) fn(...) end local call_3 = function(fn, a, b, c) fn(a, b, c) end NUM_ITER = 1000 bench = { } bench.noop = noop bench.vararg_callback = vararg_callback bench.call_noargs_noop_nil = function() call_noargs(noop) end bench.call_noargs_vararg_nil = function() call_noargs(vararg_callback) end bench.call_vararg_noop_nil = function() call_noargs(noop) end bench.call_vararg_vararg_nil = function() call_noargs(vararg_callback) end bench.call_3_noop_nil = function() call_3(noop) end bench.call_3_vararg_nil = function() call_3(vararg_callback) end bench.call_noargs_noop_3 = function() call_noargs(noop, 1, 2, 3) end bench.call_noargs_vararg_3 = function() call_noargs(vararg_callback, 1, 2, 3) end bench.call_vararg_noop_3 = function() call_noargs(noop, 1, 2, 3) end bench.call_vararg_vararg_3 = function() call_noargs(vararg_callback, 1, 2, 3) end bench.call_3_noop_3 = function() call_3(noop, 1, 2, 3) end bench.call_3_vararg_3 = function() call_3(vararg_callback, 1, 2, 3) end return bench
pg = pg or {} pg.ship_skin_template_13 = { [307120] = { ship_group = 30712, name = "{namecode:208}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 307120, group_index = 0, shop_id = 0, painting = "gecheng", 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 = "gecheng", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:209}级航空母舰三番舰—{namecode:208}", voice_actor = 286, 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.481, 1.049, 0 } }, plane = { { 1.48, 1.081, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [307121] = { ship_group = 30712, name = "黎明辉祭", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "145", id = 307121, group_index = 1, shop_id = 70591, painting = "gecheng_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 16, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "1102", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "gecheng_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "祭·典·来·啦!嗯——这个时期的话叫做夏日祭有点点微妙呢,应该叫节日庆典更合适?哎怎么都好啦,指挥官今天只要尽情享受就行!因为我也很开心哦!", voice_actor = 286, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.481, 1.049, 0 } }, plane = { { 1.48, 1.081, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308010] = { ship_group = 30801, name = "{namecode:154}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 308010, group_index = 0, shop_id = 0, painting = "I19", 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 = "I19", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:280}潜艇{namecode:154}", voice_actor = 83, 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.06, 0.11, 0 } }, torpedo = { { 1.1, 0.07, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308011] = { ship_group = 30801, name = "启程的微风", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "103", id = 308011, group_index = 1, shop_id = 70074, painting = "I19_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 4, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I19_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "唔……这种时候还要上课吗……嗯?指挥官,是来专门送人家的吗?", voice_actor = 83, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.06, 0.11, 0 } }, torpedo = { { 1.1, 0.07, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308012] = { ship_group = 30801, name = "枕头天堂", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "109", id = 308012, group_index = 2, shop_id = 70391, painting = "I19_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I19_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "好困……嗯,指挥官?要和“鱼雷先生”一起睡会吗?", voice_actor = 83, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.563, 0.382, 0 } }, torpedo = { { 0.011, -0.417, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308013] = { ship_group = 30801, name = "粉红甜心兔", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "145", id = 308013, group_index = 3, shop_id = 70547, painting = "i19_4", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 16, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "1102", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "i19_4", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "人家换上了新的衣服哦~怎么样,合适吗?指~挥~官~觉得可爱的话就多夸夸人家嘛~", voice_actor = 83, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.268, 0.442, 0 } }, torpedo = { { 0, 0, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308020] = { ship_group = 30802, name = "{namecode:155}", bullet_skin_secondary = "", hand_id = 17, bgm = "", illustrator2 = -1, bg = "", id = 308020, group_index = 0, shop_id = 0, painting = "I26", 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 = "I26", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:280}潜艇{namecode:155}", voice_actor = 121, 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 = { { 0.97, 0.24, 0 } }, torpedo = { { 0.97, 0.3, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308021] = { ship_group = 30802, name = "深海少女", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "103", id = 308021, group_index = 1, shop_id = 70075, painting = "I26_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 4, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I26_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "海洋的深处可是藏着许多秘密的!指挥官,有机会的话要去看看吗?作为课外辅导,嘻嘻~", voice_actor = 121, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.6, 0.19, 0 } }, torpedo = { { 0.65, 0.03, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308022] = { ship_group = 30802, name = "烟火大会前", bullet_skin_secondary = "", hand_id = 17, bgm = "", illustrator2 = -1, bg = "114", id = 308022, group_index = 2, shop_id = 70223, painting = "I26_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 10, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "1102", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I26_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,你也在等烟火大会开始吗?还有一点时间,稍微陪我聊一会天吧!", voice_actor = 121, spine_offset = "", illustrator = 14, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.181, 0.291, 0 } }, torpedo = { { 0.288, 0.03, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.45, 0 } } } } } }, [308030] = { ship_group = 30803, name = "{namecode:156}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 308030, group_index = 0, shop_id = 0, painting = "I58", 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 = "I58", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:283}型潜艇{namecode:156}", voice_actor = 129, 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 = { { 0.7, 0.21, 0 } }, torpedo = { { 0.7, 0.25, 0 } } }, smoke = { { 50, { { "smoke", { -0.55, 2.21, 0 } } } } } }, [308040] = { ship_group = 30804, name = "{namecode:252}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 308040, group_index = 0, shop_id = 0, painting = "I25", 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 = "I25", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:280}潜艇{namecode:252}", voice_actor = 121, 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.9, 0.15, 0 } }, torpedo = { { 1.209, 0.03, 0 } } }, smoke = { { 50, { { "smoke", { -0.42, 2.388, 0 } } } } } }, [308041] = { ship_group = 30804, name = "兔兔与珊瑚礁", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "103", id = 308041, group_index = 1, shop_id = 70205, painting = "I25_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 4, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I25_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官大人您好。这身衣服…?今天要在学园上课才穿的哦?说起来,指挥官大人有没有兴趣参观大家上课呢?", voice_actor = 121, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.02, 0.44, 0 } }, torpedo = { { 1.04, 0.666, 0 } } }, smoke = { { 50, { { "smoke", { -0.55, 2.21, 0 } } } } } }, [308042] = { ship_group = 30804, name = "甘美的新春祝福", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "144", id = 308042, group_index = 2, shop_id = 70498, painting = "I25_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 3, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "1102", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I25_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官大人,春节快乐!要来点庆祝用的甜酒吗?啊,就算是甜酒也请注意不要喝太多哦?", voice_actor = 121, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 4 }, 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.266, 0.999, 0 } }, torpedo = { { 0, -0.154, 0 } } }, smoke = { { 50, { { "smoke", { -0.55, 2.403, 0 } } } } } }, [308050] = { ship_group = 30805, name = "{namecode:254}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 308050, group_index = 0, shop_id = 0, painting = "I56", 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 = "I56", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:283}型潜艇{namecode:254}", voice_actor = 16, 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.87, 0.319, 0 } }, torpedo = { { 1.088, 0.236, 0 } } }, smoke = { { 50, { { "smoke", { -0.329, 2.323, 0 } } } } } }, [308051] = { ship_group = 30805, name = "角落的向日葵", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "103", id = 308051, group_index = 1, shop_id = 0, painting = "I56_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 4, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I56_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "学校,真是一个好地方。我可以安静地躲在角落里,不和别人说话也没有关系…", voice_actor = 16, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.108, 0.082, 0 } }, torpedo = { { 1.236, -0.27, 0 } } }, smoke = { { 50, { { "smoke", { -0.55, 2.21, 0 } } } } } }, [308060] = { ship_group = 30806, name = "{namecode:256}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 308060, group_index = 0, shop_id = 0, painting = "I168", 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 = "I168", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:284}潜艇{namecode:256}", voice_actor = 33, 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.268, 0.246, 0 } }, torpedo = { { 1.002, 0.241, 0 } } }, smoke = { { 50, { { "smoke", { -0.465, 2.445, 0 } } } } } }, [308061] = { ship_group = 30806, name = "祭典之日!", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "114", id = 308061, group_index = 1, shop_id = 70203, painting = "I168_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 10, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "I168_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "和平时好像不太一样?这种不是一看就知道…好啦好啦,我知道了,没关系。难得的祭典,就好好享受一下吧", voice_actor = 33, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.098, 0.383, 0 } }, torpedo = { { 1.052, 0.111, 0 } } }, smoke = { { 50, { { "smoke", { -0.532, 2.13, 0 } } } } } }, [312010] = { ship_group = 31201, name = "{namecode:98}", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 312010, group_index = 0, shop_id = 0, painting = "mingshi", 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 = "mingshi", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:98}号维修舰\n<color=#ffde38>获得后将解锁建造</color>", voice_actor = 28, spine_offset = "", illustrator = 10, 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 = { { 1.66, 1.24, 0 } }, vicegun = { { 1.66, 1.24, 0 } }, torpedo = { { 0.01, 0.12, 0 } }, antiaircraft = { { 1.66, 1.24, 0 } } }, smoke = { { 70, { { "smoke", { -0.531, 0.427, 0 } } } }, { 30, { { "smoke", { 0.711, 0.361, 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 } }, [312011] = { ship_group = 31201, name = "正月,浴衣,赤字", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "101", id = 312011, group_index = 1, shop_id = 70035, painting = "Mingshi_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 2, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Mingshi_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,{namecode:98}的新衣服怎样喵?是不是很可爱喵!觉得可爱的话就买一点装备吧喵,大家都去玩了…卖不掉要破产了喵……", voice_actor = 28, spine_offset = "", illustrator = 10, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.62, 0.93, 0 } }, vicegun = { { 0.62, 0.93, 0 } }, torpedo = { { 0, 0.17, 0 } }, antiaircraft = { { 0.62, 0.93, 0 } } }, smoke = { { 50, { { "smoke", { -0.47, 2.26, 0 } } } } } }, [312012] = { ship_group = 31201, name = "黑猫来袭!", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "107", id = 312012, group_index = 2, shop_id = 70100, painting = "mingshi_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 7, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "mingshi_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "哼哼哼,平日里辛苦积攒就是为了这一刻喵!锵锵锵,融合了重樱和西洋元素的特别礼服!指挥官,今天要来点钻石喵?", voice_actor = 28, spine_offset = "", illustrator = 10, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.84, 1.25, 0 } }, vicegun = { { 0.77, 1.22, 0 } }, torpedo = { { 0.19, 0.11, 0 } }, antiaircraft = { { 0.66, 1.26, 0 } } }, smoke = { { 50, { { "smoke", { -0.47, 2.26, 0 } } } } } }, [312013] = { ship_group = 31201, name = "{namecode:98}_在A1摊位喵!", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 312013, group_index = 3, shop_id = 0, painting = "mingshi_4", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "mingshi_4", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "哦,指挥官你好喵。是来买{namecode:98}的新刊的喵?今天可是祭典的日子喵~好好逛逛喵♪", voice_actor = 28, 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 = { { 1.007, 1.008, 0 } }, vicegun = { { 1.007, 1.008, 0 } }, torpedo = { { 0.037, 0.059, 0 } }, antiaircraft = { { 1.007, 1.008, 0 } } }, smoke = { { 50, { { "smoke", { -0.47, 2.26, 0 } } } } } }, [312014] = { ship_group = 31201, name = "欢迎光临Sofmap!", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 312014, group_index = 4, shop_id = 0, painting = "mingshi_5", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 9999, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "mingshi_5", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "呼呼呼,欢迎光临喵!想要找什么喵?让亲切待人又知识丰富的导购{namecode:98}来给你详细的建议喵!", voice_actor = 28, 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 = { { 1.036, 1.416, 0 } }, vicegun = { { 1.039, 1.394, 0 } }, torpedo = { { 0.001, 0.001, 0 } }, antiaircraft = { { 1.074, 1.26, 0 } } }, smoke = { { 50, { { "smoke", { -0.47, 2.26, 0 } } } } } }, [312018] = { ship_group = 31201, name = "白猫的报恩", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "", id = 312018, group_index = 8, shop_id = 0, painting = "mingshi_h", 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 = "mingshi_h", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官一直这么照顾{namecode:98}的生意,{namecode:98}只能以身相许了喵!……喵哈哈,开玩笑的~{namecode:98}我可是最喜欢指挥官了哦,没错,比钻石还要喜欢喵!", voice_actor = 28, 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 = { { 1.441, 1.165, 0 } }, vicegun = { { 1.47, 1.208, 0 } }, torpedo = { { 0.001, 0.001, 0 } }, antiaircraft = { { 1.498, 1.221, 0 } } }, smoke = { { 50, { { "smoke", { -0.47, 2.26, 0 } } } } } }, [317010] = { ship_group = 31701, name = "{namecode:163}", bullet_skin_secondary = "", hand_id = 6, bgm = "", illustrator2 = -1, bg = "", id = 317010, group_index = 0, shop_id = 0, painting = "I13", 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 = "I13", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:282}型潜艇{namecode:163}", voice_actor = 186, 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.1, 0.41, 0 } }, torpedo = { { 0.77, -0.18, 0 } } }, smoke = { { 50, { { "smoke", { -0.55, 2.21, 0 } } } } } }, [319010] = { ship_group = 31901, name = "{namecode:188}", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "", id = 319010, group_index = 0, shop_id = 0, painting = "jianye", 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 = "jianye", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "运输舰—{namecode:188}", voice_actor = 243, 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.323, 1.205, 0 } }, vicegun = { { 1.366, 1.162, 0 } }, torpedo = { { 0.01, -0.01, 0 } }, antiaircraft = { { 1.323, 1.274, 0 } } }, smoke = { { 50, { { "smoke", { -0.367, 2.434, 0 } } } } } }, [319011] = { ship_group = 31901, name = "温泉放松时间", bullet_skin_secondary = "", hand_id = 2, bgm = "", illustrator2 = -1, bg = "106", id = 319011, group_index = 1, shop_id = 70406, painting = "jianye_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 6, lip_smoothing = 0, bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "jianye_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "啊…疼疼疼…对不起指挥官,好像踩着什么东西摔了一跤…想注意脚下有时候也很难呢…呜……", voice_actor = 243, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = { 1, 2 }, live2d_offset = { 30, 110, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.409, 1.214, 0 } }, vicegun = { { 1.409, 1.197, 0 } }, torpedo = { { 0.01, -0.018, 0 } }, antiaircraft = { { 1.383, 1.24, 0 } } }, smoke = { { 50, { { "smoke", { -0.323, 2.322, 0 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_voice_calibrate = { home = 0.35, login = 1 } }, [331050] = { ship_group = 30105, name = "新年的愿望", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "126", id = 331050, group_index = 10, shop_id = 70294, painting = "lingbo_8", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 2, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lingbo_8", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,新年快乐。新的一年,也请多多指教…的说。", voice_actor = 32, spine_offset = "", illustrator = 2, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.364, 1.163, 0 } }, vicegun = { { 1.338, 1.253, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.304, 1.224, 0 } } }, smoke = { { 50, { { "smoke", { -0.63, 2.53, 0 } } } } } }, [331051] = { ship_group = 30105, name = "黯然礼装", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "135", id = 331051, group_index = 11, shop_id = 70420, painting = "lingbo_10", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 7, lip_smoothing = 0, bullet_skin_main = "", skin_type = 4, bg_sp = "1102", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lingbo_10", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,谢谢你能来参加宴会。{namecode:6}在这里等了很久了。……有点可怕?{namecode:6}不大明白…的说。", voice_actor = 32, spine_offset = "", illustrator = 2, rarity_bg = "", time = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 1, 4 }, live2d_offset = { 0, -70, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.279, 1.071, 0 } }, vicegun = { { 1.274, 1.175, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.304, 1.139, 0 } } }, smoke = { { 50, { { "smoke", { -0.63, 2.53, 0 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_para_range = { ParamAngleY = { 0, 0 }, ParamEyeBallX = { -0.2, 0.2 }, ParamEyeBallY = { -10, 10 }, ParamBodyAngleY = { 0, 0 } } }, [331052] = { ship_group = 30105, name = "微速战斗姿势", bullet_skin_secondary = "", hand_id = 14, bgm = "", illustrator2 = -1, bg = "109", id = 331052, group_index = 12, shop_id = 0, painting = "lingbo_11", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 9, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "lingbo_11", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "{namecode:90},boss战武士不能冲那么前面的!啊…指挥官,欢迎的说。对不起,现在是boss战的关键时刻…请先自己找个位置随便坐坐吧。", voice_actor = 32, spine_offset = "", illustrator = 2, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.18, 1.16, 0 } }, vicegun = { { 1.23, 1.175, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.22, 1.07, 0 } } }, smoke = { { 50, { { "smoke", { -0.63, 2.53, 0 } } } } } }, [401010] = { ship_group = 40101, name = "Z1", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401010, group_index = 0, shop_id = 0, painting = "z1", 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 = "z1", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1934型驱逐舰—Z1 莱伯勒希特·马斯", voice_actor = 17, 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.787, 0.431, 0 } }, torpedo = { { -0.439, 0.673, 0 } }, antiaircraft = { { 0.787, 0.431, 0 }, { 0.802, 0.802, 0 } } }, smoke = { { 70, { { "smoke", { -0.484, 0.465, 0 } } } }, { 30, { { "smoke", { 0.476, 0.527, 0 } } } } } }, [401011] = { ship_group = 40101, name = "“叛逆”的优等生", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "103", id = 401011, group_index = 1, shop_id = 70056, painting = "Z1_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 4, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z1_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "因为是Z1,成绩当然也是NO.1!哼哼,无论到哪里,Z1大人都是最厉害的!", voice_actor = 17, spine_offset = "", illustrator = 10, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.22, 1.11, 0 } }, torpedo = { { 0.18, 0.1, 0 } }, antiaircraft = { { 1.22, 1.11, 0 } } }, smoke = { { 40, { { "smoke", { -0.5, 2.24, 0 } } } } } }, [401019] = { ship_group = 40101, name = "Z1.改", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401019, group_index = 9, shop_id = 0, painting = "Z1_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 = "Z1_g", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "哼~这就是改造吗…?感觉不错!再次欢呼吧,指挥官!万事继续交给变得更强的Z1大人就没问题啦!", voice_actor = 17, 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.68, 0.96, 0 } }, torpedo = { { 0.011, 0, 0 } }, antiaircraft = { { 0.61, 0.87, 0 } } }, smoke = { { 50, { { "smoke", { -0.5, 2.24, 0 } } } } } }, [401020] = { ship_group = 40102, name = "Z2", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401020, group_index = 0, shop_id = 0, painting = "z2", 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 = "z2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1934型驱逐舰—Z2 格奥尔格·蒂勒", voice_actor = 172, 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.25, 1.47, 0 } }, torpedo = { { 0.18, 0.1, 0 } }, antiaircraft = { { 1.14, 1.23, 0 } } }, smoke = { { 50, { { "smoke", { -0.5, 2.24, 0 } } } } } }, [401021] = { ship_group = 40102, name = "异色的日常风景", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401021, group_index = 1, shop_id = 70444, painting = "z2_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 9, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z2_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,“不穿制服上班也没关系”这种命令,其实只是您想要看大家便服的样子吧?……我倒是无所谓,您高兴就好。", voice_actor = 172, 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.039, 1.037, 0 } }, torpedo = { { 0.005, 0.008, 0 } }, antiaircraft = { { 1.04, 1.039, 0 } } }, smoke = { { 50, { { "smoke", { -0.5, 2.579, 0 } } } } } }, [401022] = { ship_group = 40102, name = "夜色锦鲤", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "114", id = 401022, group_index = 2, shop_id = 70579, painting = "z2_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 10, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z2_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "能看到指挥官这么精彩的表情,花了那么多时间换上这一身也算是有价值了呢。…呆站在那做什么?过来一起坐会吧,也许还能看到烟花呢。", voice_actor = 172, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.061, 1.028, 0 } }, torpedo = { { 0.005, 0.008, 0 } }, antiaircraft = { { 1.071, 1.039, 0 } } }, smoke = { { 50, { { "smoke", { -0.356, 2.649, 0 } } } } } }, [401180] = { ship_group = 40118, name = "Z18", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401180, group_index = 0, shop_id = 0, painting = "z18", 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 = "z18", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936型驱逐舰—Z18 汉斯·吕德曼", voice_actor = 18, 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.5, 1.25, 0 } }, torpedo = { { 0.16, 0.09, 0 } }, antiaircraft = { { 0.23, 0.65, 0 } } }, smoke = { { 50, { { "smoke", { -0.43, 2.31, -0.03 } } } } } }, [401190] = { ship_group = 40119, name = "Z19", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401190, group_index = 0, shop_id = 0, painting = "z19", 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 = "z19", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936型驱逐舰—Z19 赫尔曼·库纳", voice_actor = 59, spine_offset = "", illustrator = 28, 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.38, 0.5, 0 } }, torpedo = { { 0.43, 0.26, 0 } }, antiaircraft = { { -0.38, 0.5, 0 } } }, smoke = { { 70, { { "smoke", { -0.67, 0.36, -0.06 } } } }, { 30, { { "smoke", { 0.72, 0.31, -0.03 } } } } } }, [401200] = { ship_group = 40120, name = "Z20", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401200, group_index = 0, shop_id = 0, painting = "z20", 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 = "z20", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936型驱逐舰—Z20 卡尔·加尔斯特", voice_actor = 59, spine_offset = "", illustrator = 28, 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.23, 1, 0 } }, vicegun = { { 1.23, 1, 0 } }, torpedo = { { 0.29, 0.15, 0 } }, antiaircraft = { { 1.23, 1, 0 } } }, smoke = { { 70, { { "smoke", { -0.37, 0.44, -0.16 } } } }, { 40, { { "smoke", { -0.46, 1.64, -0.86 } } } } } }, [401210] = { ship_group = 40121, name = "Z21", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401210, group_index = 0, shop_id = 0, painting = "z21", 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 = "z21", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936型驱逐舰—Z21 威尔海姆·海德坎姆", voice_actor = 59, spine_offset = "", illustrator = 28, 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.1, 0.45, 0 } }, vicegun = { { 1.1, 0.45, 0 } }, torpedo = { { 0.21, 0.12, 0 } }, antiaircraft = { { 1.1, 0.45, 0 } } }, smoke = { { 70, { { "smoke", { -0.17, 0.42, -0.17 } } } }, { 40, { { "smoke", { -0.37, 1.73, -0.93 } } } } } }, [401230] = { ship_group = 40123, name = "Z23", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401230, 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 = 3, 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 } }, [401231] = { ship_group = 40123, name = "哲学讲师", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401231, group_index = 1, shop_id = 0, painting = "z23_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "这里是重点!(敲黑板)不乖乖记笔记的话,Z23老师就要惩罚你了哦!", voice_actor = 3, 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.005, 0.804, 0 } }, vicegun = { { 1.005, 0.804, 0 } }, torpedo = { { 0.247, 0.073, 0 } }, antiaircraft = { { 1.005, 0.804, 0 } } }, smoke = { { 70, { { "smoke", { -0.531, 0.89, -0.27 } } } }, { 30, { { "smoke", { -0.53, 2.92, -0.38 } } } } } }, [401232] = { ship_group = 40123, name = "非正式沙滩排球赛", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "106", id = 401232, group_index = 2, shop_id = 70368, painting = "z23_7", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 6, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_7", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嘿~!{namecode:6},进攻就交给你了!—呼…指挥官,有好好计分了吗?就算是非正式的沙滩排球比赛,裁判成天发呆也是不行的哦?", voice_actor = 3, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.896, 0.804, 0 } }, vicegun = { { 1.005, 0.804, 0 } }, torpedo = { { -0.006, 0.005, 0 } }, antiaircraft = { { 0.841, 0.859, 0 } } }, smoke = { { 50, { { "smoke", { -0.53, 2.231, -0.38 } } } } } }, [401233] = { ship_group = 40123, name = "标准笑容?", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401233, group_index = 3, shop_id = 70178, painting = "z23_4", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_4", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "欢迎光临,请问客人只有一位吗?……那个,指挥官,我的笑容看起来应该不算僵硬……吧?", voice_actor = 3, 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.92, 0.87, 0 } }, vicegun = { { 1.005, 0.804, 0 } }, torpedo = { { 0.03, 0.06, 0 } }, antiaircraft = { { 1.005, 0.804, 0 } } }, smoke = { { 50, { { "smoke", { -0.62, 2.74, -0.38 } } } } } }, [401234] = { ship_group = 40123, name = "宴会上的优等生", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "115", id = 401234, group_index = 4, shop_id = 70187, painting = "z23_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 7, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "咦,指挥官,晚上好。我正在找标枪她们……那个,不介意的话,一起在会场里走一走如何?", voice_actor = 3, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.982, 0.878, 0 } }, vicegun = { { 1.005, 0.804, 0 } }, torpedo = { { 0.03, 0.06, 0 } }, antiaircraft = { { 1.005, 0.804, 0 } } }, smoke = { { 50, { { "smoke", { -0.473, 2.485, -0.38 } } } } } }, [401235] = { ship_group = 40123, name = "新设基地・茶店体验", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401235, group_index = 5, shop_id = 0, painting = "z23_8", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 0, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_8", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "欢迎光临!一名客人…指挥官?!啊,唔,这个是重樱的喫茶店服务生体验活动…所以才换上这身…你觉得…怎么样?", voice_actor = 3, 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.14, 1.176, 0 } }, vicegun = { { 1.163, 1.133, 0 } }, torpedo = { { -0.008, 0.016, 0 } }, antiaircraft = { { 1.189, 1.146, 0 } } }, smoke = { { 50, { { "smoke", { -0.473, 2.485, -0.38 } } } } } }, [401236] = { ship_group = 40123, name = "正经偶像·经纪人担当?", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "120", id = 401236, group_index = 6, shop_id = 70265, painting = "z23_5", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 11, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_5", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "真是的,标枪还好,拉菲和{namecode:6}这两个人做偶像根本让人放心不下。没有办法,只好由我来帮她们规划了…啊,指挥官,也请不要忘记支持我哦?", voice_actor = 3, spine_offset = "", illustrator = 1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 4 }, 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.982, 0.878, 0 } }, vicegun = { { 0.955, 0.804, 0 } }, torpedo = { { -0.012, 0.001, 0 } }, antiaircraft = { { 0.955, 0.921, 0 } } }, smoke = { { 50, { { "smoke", { -0.473, 2.485, -0.38 } } } } } }, [401237] = { ship_group = 40123, name = "书架边的“风景”?", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401237, group_index = 7, shop_id = 0, painting = "z23_6", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 9999, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z23_6", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,要好好扶着梯子哦。我要把这本书给放上去…嘿咻…好啦,这样就…指挥官!?不要往上看啊!!", voice_actor = 3, 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.07, 1.07, 0 } }, vicegun = { { 1.11, 1.02, 0 } }, torpedo = { { 0.01, 0, 0 } }, antiaircraft = { { 1.07, 1.01, 0 } } }, smoke = { { 50, { { "smoke", { -0.473, 2.15, -0.38 } } } } } }, [401238] = { ship_group = 40123, name = "黑曜的嫁衣", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401238, group_index = 8, shop_id = 0, painting = "z23_h", 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 = "z23_h", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "呼…让你久等了。挑选衣服花费了不少时间,因为每一件都很好看……那个,这件感觉怎么样?", voice_actor = 3, 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.435, 1.07, 0 } }, vicegun = { { 1.411, 1.106, 0 } }, torpedo = { { 0.01, 0, 0 } }, antiaircraft = { { 1.335, 1.146, 0 } } }, smoke = { { 50, { { "smoke", { -0.473, 2.372, -0.38 } } } } } }, [401239] = { ship_group = 40123, name = "Z23.改", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401239, group_index = 9, shop_id = 0, painting = "z23_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 = "z23_g", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "既然能力提升了,效率也要提升,公文也好,作战计划也好,尽管来吧!指挥官,做好心理准备,接下来会很忙哦~", voice_actor = 3, 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.96, 0.83, 0 } }, vicegun = { { 1.93, 0.83, 0 } }, torpedo = { { 0.18, 0.08, 0 } }, antiaircraft = { { 1.55, 1.16, 0 } } }, smoke = { { 40, { { "smoke", { -0.37, 2.6, -0.27 } } } } } }, [401240] = { ship_group = 40124, name = "Z24", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401240, group_index = 0, shop_id = 0, painting = "Z24", 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 = "Z24", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936A “纳尔维克”型驱逐舰—Z24", voice_actor = 227, 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.467, 0.978, 0 } }, vicegun = { { 1.461, 1.003, 0 } }, torpedo = { { -0.004, -0.016, 0 } }, antiaircraft = { { 1.488, 1.012, 0 } } }, smoke = { { 50, { { "smoke", { -0.58, 2.417, -1.05 } } } } } }, [401241] = { ship_group = 40124, name = "「魔王」的祝祭", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "143", id = 401241, group_index = 1, shop_id = 70472, painting = "Z24_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 2, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z24_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "祝祭之钟声已然敲响,来得正好,凡人!到吾身边,与吾一同享受这愉快的异邦佳节吧!", voice_actor = 227, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 4 }, 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.123, 1.067, 0 } }, vicegun = { { 1.122, 1.097, 0 } }, torpedo = { { 0.004, 0.014, 0 } }, antiaircraft = { { 1.102, 1.096, 0 } } }, smoke = { { 50, { { "smoke", { -0.504, 2.673, -1.05 } } } } } }, [401250] = { ship_group = 40125, name = "Z25", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401250, group_index = 0, shop_id = 0, painting = "Z25", 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 = "Z25", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936A “纳尔维克”型驱逐舰—Z25", voice_actor = 3, 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.13, 0.97, 0 } }, vicegun = { { -0.12, 0.91, 0 } }, torpedo = { { 0.1, 0.07, 0 } }, antiaircraft = { { -0.17, 0.91, 0 } } }, smoke = { { 50, { { "smoke", { -0.58, 2.14, -1.05 } } } } } }, [401251] = { ship_group = 40125, name = "暑夏的海风", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "106", id = 401251, group_index = 1, shop_id = 70081, painting = "Z25_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 6, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z25_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "即使是在海边也不能掉以轻心!指挥官,准备活动做充分了吗?", voice_actor = 3, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.22, 0.87, 0 } }, vicegun = { { -0.25, 0.83, 0 } }, torpedo = { { 0.12, 0.1, 0 } }, antiaircraft = { { -0.31, 0.87, 0 } } }, smoke = { { 50, { { "smoke", { -0.6, 2.28, -1.05 } } } } } }, [401260] = { ship_group = 40126, name = "Z26", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401260, group_index = 0, shop_id = 0, painting = "Z26", 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 = "Z26", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936A “纳尔维克”型驱逐舰—Z26", voice_actor = 247, 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.402, 1.267, 0 } }, vicegun = { { 1.31, 1.274, 0 } }, torpedo = { { -0.007, -0.008, 0 } }, antiaircraft = { { 1.331, 1.168, 0 } } }, smoke = { { 50, { { "smoke", { -0.58, 2.14, -1.05 } } } } } }, [401261] = { ship_group = 40126, name = "友好的分享时间", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "109", id = 401261, group_index = 1, shop_id = 70405, painting = "Z26_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 9999, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z26_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,欢迎来到我的房间!啊,稍等一下,我把吃的喝的还有玩的都拿出来!", voice_actor = 247, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.644, 1.267, 0 } }, vicegun = { { 1.674, 1.274, 0 } }, torpedo = { { 0, 0, 0 } }, antiaircraft = { { 1.672, 1.342, 0 } } }, smoke = { { 50, { { "smoke", { -0.58, 2.14, -1.05 } } } } } }, [401280] = { ship_group = 40128, name = "Z28", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401280, group_index = 0, shop_id = 0, painting = "Z28", 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 = "Z28", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936A “纳尔维克”型驱逐舰—Z28", voice_actor = 257, 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.35, 1.064, 0 } }, vicegun = { { 1.366, 1.055, 0 } }, torpedo = { { 0.005, 0.001, 0 } }, antiaircraft = { { 1.366, 1.072, 0 } } }, smoke = { { 50, { { "smoke", { -0.528, 2.495, -1.05 } } } } } }, [401281] = { ship_group = 40128, name = "新年大杂烩!", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "126", id = 401281, group_index = 1, shop_id = 70476, painting = "Z28_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 2, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z28_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,新年快乐哦!新年节日里有什么想做的事情吗?那就趁现在,一口气把它们全部实现吧!", voice_actor = 257, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.401, 1.029, 0 } }, vicegun = { { 1.384, 1.029, 0 } }, torpedo = { { 0.005, -0.008, 0 } }, antiaircraft = { { 1.384, 1.012, 0 } } }, smoke = { { 50, { { "smoke", { -0.433, 2.512, -1.05 } } } } } }, [401350] = { ship_group = 40135, name = "Z35", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401350, group_index = 0, shop_id = 0, painting = "Z35", 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 = "Z35", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936B型驱逐舰—Z35", voice_actor = 123, 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.18, 0.9, 0 } }, vicegun = { { -0.19, 0.88, 0 } }, torpedo = { { 0.08, 0.11, 0 } }, antiaircraft = { { -0.17, 0.88, 0 } } }, smoke = { { 50, { { "smoke", { -0.62, 2.24, -1.05 } } } } } }, [401351] = { ship_group = 40135, name = "projekt Kirschblüte", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "126", id = 401351, group_index = 1, shop_id = 70292, painting = "z35_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 2, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "z35_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,舰队的各位,新年快乐~这次小35给大家带来的,是与重樱的新年所结合的新企划《projekt Kirschblüte 》!大家请多多关注哦!", voice_actor = 123, spine_offset = "", illustrator = -1, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 2 }, 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.18, 0.9, 0 } }, vicegun = { { -0.19, 0.88, 0 } }, torpedo = { { 0.08, 0.11, 0 } }, antiaircraft = { { -0.17, 0.88, 0 } } }, smoke = { { 50, { { "smoke", { -0.62, 2.24, -1.05 } } } } } }, [401360] = { ship_group = 40136, name = "Z36", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401360, group_index = 0, shop_id = 0, painting = "Z36", 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 = "Z36", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936B型驱逐舰—Z36", voice_actor = 185, 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.2, 0.55, 0 } }, vicegun = { { 0.22, 0.5, 0 } }, torpedo = { { 0.023, 0.028, 0 } }, antiaircraft = { { 0.35, 0.6, 0 } } }, smoke = { { 50, { { "smoke", { -0.62, 2.24, -1.05 } } } } } }, [401460] = { ship_group = 40146, name = "Z46", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 401460, group_index = 0, shop_id = 0, painting = "Z46", 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 = "Z46", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "1936C型驱逐舰—Z46", voice_actor = 60, spine_offset = "", illustrator = 5, 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.82, 0.4, 0 } }, vicegun = { { 0.82, 0.4, 0 } }, torpedo = { { 0.22, 0.13, 0 } }, antiaircraft = { { 0.82, 0.4, 0 } } }, smoke = { { 70, { { "smoke", { -0.43, 0.37, -0.14 } } } }, { 40, { { "smoke", { -0.19, 1.94, -1.05 } } } } } }, [401461] = { ship_group = 40146, name = "夏之初体验", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "106", id = 401461, group_index = 1, shop_id = 70076, painting = "Z46_2", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 6, lip_smoothing = 0, bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z46_2", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "躁动的沙滩,欢笑的海边…初次体验到的别样夏天,我并不讨厌", voice_actor = 60, spine_offset = "", illustrator = 5, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = { 1, 2 }, live2d_offset = { 45, -21.24, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 0.7, 0.41, 0 } }, vicegun = { { 0.77, 0.4, 0 } }, torpedo = { { 0.19, 0.1, 0 } }, antiaircraft = { { 0.82, 0.4, 0 } } }, smoke = { { 50, { { "smoke", { -0.61, 2.14, -1.05 } } } } }, 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 } }, [401462] = { ship_group = 40146, name = "少女的借物竞赛", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "112", id = 401462, group_index = 2, shop_id = 70328, painting = "Z46_3", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 13, lip_smoothing = 0, bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z46_3", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "奔跑与汗水,努力与希望,失落与欢笑……这就是…“运动会”…有点期待", voice_actor = 60, spine_offset = "", illustrator = 5, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", tag = { 1, 2 }, 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.309, 1.209, 0 } }, vicegun = { { 1.284, 1.32, 0 } }, torpedo = { { -0.013, 0.011, 0 } }, antiaircraft = { { 1.321, 1.206, 0 } } }, smoke = { { 50, { { "smoke", { -0.61, 2.14, -1.05 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" }, l2d_voice_calibrate = { login = 0.67 } }, [401463] = { ship_group = 40146, name = "未知的闪亮舞台", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "120", id = 401463, group_index = 3, shop_id = 70436, painting = "Z46_4", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 11, lip_smoothing = 0, bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z46_4", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "挥舞的彩色荧光,闪耀的舞台,热烈的欢呼与跃动的音符…我正站在…未知的舞台之上。这种悸动的感觉…并不坏", voice_actor = 60, spine_offset = "", illustrator = 5, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 1, 4 }, live2d_offset = { 0, -65, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.633, 1.34, 0 } }, vicegun = { { 1.596, 1.389, 0 } }, torpedo = { { 0, 0.225, 0 } }, antiaircraft = { { 1.596, 1.399, 0 } } }, smoke = { { 50, { { "smoke", { -0.523, 2.645, -1.05 } } } } }, l2d_animations = { "idle", "main_1", "main_2", "main_3", "mission", "mission_complete", "complete", "login", "home", "mail", "touch_body", "touch_head" } }, [401464] = { ship_group = 40146, name = "剪纸幻梦", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "144", id = 401464, group_index = 4, shop_id = 70483, painting = "Z46_5", air_bomb_skin = "", air_bullet_skin = "", shop_type_id = 3, lip_smoothing = 0, l2d_animations = "", bullet_skin_main = "", skin_type = 4, bg_sp = "", voice_actor_2 = -1, air_torpedo_skin = "", prefab = "Z46_5", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "剪裁纸张,构造出动物之造型…这个世界再次超出了我的理解范围。把这些装饰起来便能够招财转运…莫非是等同于纹章、亦或是圣印之物?", voice_actor = 60, spine_offset = "", illustrator = 5, rarity_bg = "", time = "", l2d_para_range = "", lip_sync_gain = 0, show_skin = "stand", l2d_voice_calibrate = "", tag = { 4 }, live2d_offset = { 0, -65, 0 }, fx_container = { { 0, 1.99185, 1.15 }, { 0, 0, 0 }, { 0, 0.75, -1.299 }, { 0, 0, 0 } }, bound_bone = { cannon = { { 1.393, 1.009, 0 } }, vicegun = { { 1.41, 1, 0 } }, torpedo = { { 0, 0.005, 0 } }, antiaircraft = { { 1.422, 1.004, 0 } } }, smoke = { { 50, { { "smoke", { -0.432, 2.471, -1.05 } } } } } }, [402010] = { ship_group = 40201, name = "柯尼斯堡", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 402010, group_index = 0, shop_id = 0, painting = "kenisibao", 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 = "kenisibao", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "柯尼斯堡级轻巡洋舰—柯尼斯堡", voice_actor = 78, 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 = { { -0.425, 0.786, 0 } }, vicegun = { { -0.425, 0.786, 0 } }, torpedo = { { 0.369, 0.232, 0 } }, antiaircraft = { { -0.425, 0.786, 0 } } }, smoke = { { 70, { { "smoke", { -0.531, 0.427, 0 } } } }, { 30, { { "smoke", { 0.24, 2.74, -0.46 } } } } } }, [402020] = { ship_group = 40202, name = "卡尔斯鲁厄", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 402020, group_index = 0, shop_id = 0, painting = "kaersilue", 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 = "kaersilue", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "柯尼斯堡级轻巡洋舰—卡尔斯鲁厄", voice_actor = 78, 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 = { { -0.36, 0.73, 0 } }, vicegun = { { -0.36, 0.73, 0 } }, torpedo = { { 0.16, 0.17, 0 } }, antiaircraft = { { -0.35, 0.73, 0 } } }, smoke = { { 70, { { "smoke", { -0.82, 0.86, -0.31 } } } }, { 30, { { "smoke", { 0.6, 2.59, -0.38 } } } } } }, [402029] = { ship_group = 40202, name = "卡尔斯鲁厄.改", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 402029, group_index = 9, shop_id = 0, painting = "kaersilue_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 = "kaersilue_g", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "指挥官,你看你看,新武装的色泽,线条还有质感是不是好棒?感觉再遇到风暴也不会出事了!大概!", voice_actor = 78, 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.16, 0.97, 0 } }, vicegun = { { 1.16, 0.97, 0 } }, torpedo = { { 0.1, 0.19, 0 } }, antiaircraft = { { 1.16, 0.97, 0 } } }, smoke = { { 50, { { "smoke", { -0.43, 2.52, 0 } } } } } }, [402030] = { ship_group = 40203, name = "科隆", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 402030, group_index = 0, shop_id = 0, painting = "kelong", 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 = "kelong", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "柯尼斯堡级轻巡洋舰—科隆", voice_actor = 78, 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 = { { 0.92, 0.75, 0 } }, vicegun = { { 0.92, 0.75, 0 } }, torpedo = { { 0.23, 0.23, 0 } }, antiaircraft = { { -0.44, 0.94, 0 } } }, smoke = { { 70, { { "smoke", { 0.57, 0.81, -0.568 } } } }, { 30, { { "smoke", { -0.64, 2.606, -0.472 } } } } } }, [402039] = { ship_group = 40203, name = "科隆.改", bullet_skin_secondary = "", hand_id = 1, bgm = "", illustrator2 = -1, bg = "", id = 402039, group_index = 9, shop_id = 0, painting = "kelong_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 = "kelong_g", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "嗯哼,感觉能够比以前更加进一步地进行辅佐工作了呢。放心吧指挥官,科隆不会让你的器重与期待白费的", voice_actor = 78, 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.24, 0.389, 0 } }, vicegun = { { 1.216, 0.372, 0 } }, torpedo = { { 0.008, 0.041, 0 } }, antiaircraft = { { 1.25, 0.4, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.401, -0.472 } } } } } }, [402040] = { ship_group = 40204, name = "莱比锡", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 402040, group_index = 0, shop_id = 0, painting = "laibixi", 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 = "laibixi", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "莱比锡级轻巡洋舰—莱比锡\n<color=#ffde38>获得后将解锁建造</color>", voice_actor = 78, 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.19, 1.2, 0 } }, vicegun = { { 1.19, 1.2, 0 } }, torpedo = { { -0.13, 0.37, 0 } }, antiaircraft = { { 1.19, 1.2, 0 } } }, smoke = { { 70, { { "smoke", { 0.57, 0.81, -0.568 } } } }, { 30, { { "smoke", { -0.64, 2.606, -0.472 } } } } } }, [402049] = { ship_group = 40204, name = "莱比锡.改", bullet_skin_secondary = "", hand_id = 13, bgm = "", illustrator2 = -1, bg = "", id = 402049, group_index = 9, shop_id = 0, painting = "laibixi_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 = "laibixi_g", l2d_se = "", aircraft_skin = "", main_UI_FX = "", special_effects = "", desc = "总觉得鱼鱼比以前能干了许多,而我却没有什么变化……难道是鱼鱼代替我变强了吗…!?", voice_actor = 78, 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.19, 1.15, 0 } }, vicegun = { { 1.19, 1.15, 0 } }, torpedo = { { 0.239, -0.109, 0 } }, antiaircraft = { { 1.19, 1.17, 0 } } }, smoke = { { 50, { { "smoke", { -0.64, 2.462, -0.472 } } } } } } } return
--Reading "user agent" string from internetoptions.h function userAgent() local f = io.open("../idp/internetoptions.h") for l in f:lines() do local s = l:match("InnoDownloadPlugin/%d%.%d") if s then f:close() return s end end io.write("Error parsing internetoptions.h\n") return '<font color="#ff0000">Error building docs</font>' end function parseVer() local f = io.open("../idp/idp.rc") for l in f:lines() do local s = l:match("PRODUCTVERSION %d,%d,%d,%d") if s then f:close() return string.gsub(s:match("%d,%d,%d,%d"), ",", ".") end end io.write("Error parsing idp.rc\n") return "0.0.0.0" end verStr = parseVer() verMajor = verStr:sub(1, 1) verMinor = verStr:sub(3, 3) verRev = verStr:sub(5, 5) verBuild = verStr:sub(7, 7) verDword = string.format("0x%02X%02X%02X%02X", verMajor, verMinor, verRev, verBuild)
--[[ Copyright 2016 Whizzbang Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --]] return { -- http://notebook.kulchenko.com/zerobrane/debugging-lightroom-plugins-zerobrane-studio-ide -- tail -f ~/Documents/libraryLogger.log LrSdkVersion = 5.0, LrSdkMinimumVersion = 5.0, LrToolkitIdentifier = 'com.thewhizzbang.focuspoint', LrPluginName = "Focus Point Viewer", LrLibraryMenuItems = { { title = "Show Focus Point", file = "FocusPoint.lua", enabledWhen = "photosSelected" }, { title = "Show Metadata", file = "ShowMetadata.lua", enabledWhen = "photosSelected" }, }, VERSION = { major=0, minor=0, revision=1, build=1, }, LrPluginInfoProvider = 'FocusPointsInfoProvider.lua', } --[[ KNOWN BUGS: 1. LrPhoto.getDevelopmentSettings()["Orientation"] return nil. I have no way of knowing if the photo was rotated in development mode 2. Orientation must be determined from the metadata. The metdata does not tell me if the camera was upside down e.g. rotation of 180 degrees. It only tells me normal, 90, or 270 --]]
Bullet = Class{} function Bullet:init(x, y) self.x = x + 10 self.y = y + 10 self.dy = 1 self.dx = 1 self.width = 5 self.height = 5 self.mouseX = love.mouse.getX() - 12 self.mouseY = love.mouse.getY() - 12 self.Vy = self.mouseY - y self.Vx = self.mouseX - x self.M = math.sqrt((self.mouseX - x)^2 + (self.mouseY - y)^2 ) self.Vy = self.Vy/self.M self.Vx = self.Vx/self.M end function Bullet:update() self.x = self.x + self.Vx * 15 self.y = self.y + self.Vy * 15 end function Bullet:render() love.graphics.setColor(252 / 255, 211 / 255, 3 / 255, 1) love.graphics.rectangle('fill', self.x, self.y, self.width, self.height) end function Bullet:collsion() if self.x < 0 then return true end if self.x + self.width > VIRTUAL_WIDTH then return true end if self.y < 0 then return true end if self.y + self.height > VIRTUAL_HEIGHT then return true end return false end
local o = vim.bo o.shiftwidth = 8 o.expandtab = false
local Color3 = require("datatypes.Color3") return { [1] = { "White", Color3.fromRGB(242, 243, 243) }, [2] = { "Grey", Color3.fromRGB(161, 165, 162) }, [3] = { "Light yellow", Color3.fromRGB(249, 233, 153) }, [5] = { "Brick yellow", Color3.fromRGB(215, 197, 154) }, [6] = { "Light green (Mint)", Color3.fromRGB(194, 218, 184) }, [9] = { "Light reddish violet", Color3.fromRGB(232, 186, 200) }, [11] = { "Pastel Blue", Color3.fromRGB(128, 187, 219) }, [12] = { "Light orange brown", Color3.fromRGB(203, 132, 66) }, [18] = { "Nougat", Color3.fromRGB(204, 142, 105) }, [21] = { "Bright red", Color3.fromRGB(196, 40, 28) }, [22] = { "Med. reddish violet", Color3.fromRGB(196, 112, 160) }, [23] = { "Bright blue", Color3.fromRGB(13, 105, 172) }, [24] = { "Bright yellow", Color3.fromRGB(245, 205, 48) }, [25] = { "Earth orange", Color3.fromRGB(98, 71, 50) }, [26] = { "Black", Color3.fromRGB(27, 42, 53) }, [27] = { "Dark grey", Color3.fromRGB(109, 110, 108) }, [28] = { "Dark green", Color3.fromRGB(40, 127, 71) }, [29] = { "Medium green", Color3.fromRGB(161, 196, 140) }, [36] = { "Lig. Yellowich orange", Color3.fromRGB(243, 207, 155) }, [37] = { "Bright green", Color3.fromRGB(75, 151, 75) }, [38] = { "Dark orange", Color3.fromRGB(160, 95, 53) }, [39] = { "Light bluish violet", Color3.fromRGB(193, 202, 222) }, [40] = { "Transparent", Color3.fromRGB(236, 236, 236) }, [41] = { "Tr. Red", Color3.fromRGB(205, 84, 75) }, [42] = { "Tr. Lg blue", Color3.fromRGB(193, 223, 240) }, [43] = { "Tr. Blue", Color3.fromRGB(123, 182, 232) }, [44] = { "Tr. Yellow", Color3.fromRGB(247, 241, 141) }, [45] = { "Light blue", Color3.fromRGB(180, 210, 228) }, [47] = { "Tr. Flu. Reddish orange", Color3.fromRGB(217, 133, 108) }, [48] = { "Tr. Green", Color3.fromRGB(132, 182, 141) }, [49] = { "Tr. Flu. Green", Color3.fromRGB(248, 241, 132) }, [50] = { "Phosph. White", Color3.fromRGB(236, 232, 222) }, [100] = { "Light red", Color3.fromRGB(238, 196, 182) }, [101] = { "Medium red", Color3.fromRGB(218, 134, 122) }, [102] = { "Medium blue", Color3.fromRGB(110, 153, 202) }, [103] = { "Light grey", Color3.fromRGB(199, 193, 183) }, [104] = { "Bright violet", Color3.fromRGB(107, 50, 124) }, [105] = { "Br. yellowish orange", Color3.fromRGB(226, 155, 64) }, [106] = { "Bright orange", Color3.fromRGB(218, 133, 65) }, [107] = { "Bright bluish green", Color3.fromRGB(0, 143, 156) }, [108] = { "Earth yellow", Color3.fromRGB(104, 92, 67) }, [110] = { "Bright bluish violet", Color3.fromRGB(67, 84, 147) }, [111] = { "Tr. Brown", Color3.fromRGB(191, 183, 177) }, [112] = { "Medium bluish violet", Color3.fromRGB(104, 116, 172) }, [113] = { "Tr. Medi. reddish violet", Color3.fromRGB(229, 173, 200) }, [115] = { "Med. yellowish green", Color3.fromRGB(199, 210, 60) }, [116] = { "Med. bluish green", Color3.fromRGB(85, 165, 175) }, [118] = { "Light bluish green", Color3.fromRGB(183, 215, 213) }, [119] = { "Br. yellowish green", Color3.fromRGB(164, 189, 71) }, [120] = { "Lig. yellowish green", Color3.fromRGB(217, 228, 167) }, [121] = { "Med. yellowish orange", Color3.fromRGB(231, 172, 88) }, [123] = { "Br. reddish orange", Color3.fromRGB(211, 111, 76) }, [124] = { "Bright reddish violet", Color3.fromRGB(146, 57, 120) }, [125] = { "Light orange", Color3.fromRGB(234, 184, 146) }, [126] = { "Tr. Bright bluish violet", Color3.fromRGB(165, 165, 203) }, [127] = { "Gold", Color3.fromRGB(220, 188, 129) }, [128] = { "Dark nougat", Color3.fromRGB(174, 122, 89) }, [131] = { "Silver", Color3.fromRGB(156, 163, 168) }, [133] = { "Neon orange", Color3.fromRGB(213, 115, 61) }, [134] = { "Neon green", Color3.fromRGB(216, 221, 86) }, [135] = { "Sand blue", Color3.fromRGB(116, 134, 157) }, [136] = { "Sand violet", Color3.fromRGB(135, 124, 144) }, [137] = { "Medium orange", Color3.fromRGB(224, 152, 100) }, [138] = { "Sand yellow", Color3.fromRGB(149, 138, 115) }, [140] = { "Earth blue", Color3.fromRGB(32, 58, 86) }, [141] = { "Earth green", Color3.fromRGB(39, 70, 45) }, [143] = { "Tr. Flu. Blue", Color3.fromRGB(207, 226, 247) }, [145] = { "Sand blue metallic", Color3.fromRGB(121, 136, 161) }, [146] = { "Sand violet metallic", Color3.fromRGB(149, 142, 163) }, [147] = { "Sand yellow metallic", Color3.fromRGB(147, 135, 103) }, [148] = { "Dark grey metallic", Color3.fromRGB(87, 88, 87) }, [149] = { "Black metallic", Color3.fromRGB(22, 29, 50) }, [150] = { "Light grey metallic", Color3.fromRGB(171, 173, 172) }, [151] = { "Sand green", Color3.fromRGB(120, 144, 130) }, [153] = { "Sand red", Color3.fromRGB(149, 121, 119) }, [154] = { "Dark red", Color3.fromRGB(123, 46, 47) }, [157] = { "Tr. Flu. Yellow", Color3.fromRGB(255, 246, 123) }, [158] = { "Tr. Flu. Red", Color3.fromRGB(225, 164, 194) }, [168] = { "Gun metallic", Color3.fromRGB(117, 108, 98) }, [176] = { "Red flip/flop", Color3.fromRGB(151, 105, 91) }, [178] = { "Yellow flip/flop", Color3.fromRGB(180, 132, 85) }, [179] = { "Silver flip/flop", Color3.fromRGB(137, 135, 136) }, [180] = { "Curry", Color3.fromRGB(215, 169, 75) }, [190] = { "Fire Yellow", Color3.fromRGB(249, 214, 46) }, [191] = { "Flame yellowish orange", Color3.fromRGB(232, 171, 45) }, [192] = { "Reddish brown", Color3.fromRGB(105, 64, 40) }, [193] = { "Flame reddish orange", Color3.fromRGB(207, 96, 36) }, [194] = { "Medium stone grey", Color3.fromRGB(163, 162, 165) }, [195] = { "Royal blue", Color3.fromRGB(70, 103, 164) }, [196] = { "Dark Royal blue", Color3.fromRGB(35, 71, 139) }, [198] = { "Bright reddish lilac", Color3.fromRGB(142, 66, 133) }, [199] = { "Dark stone grey", Color3.fromRGB(99, 95, 98) }, [200] = { "Lemon metalic", Color3.fromRGB(130, 138, 93) }, [208] = { "Light stone grey", Color3.fromRGB(229, 228, 223) }, [209] = { "Dark Curry", Color3.fromRGB(176, 142, 68) }, [210] = { "Faded green", Color3.fromRGB(112, 149, 120) }, [211] = { "Turquoise", Color3.fromRGB(121, 181, 181) }, [212] = { "Light Royal blue", Color3.fromRGB(159, 195, 233) }, [213] = { "Medium Royal blue", Color3.fromRGB(108, 129, 183) }, [216] = { "Rust", Color3.fromRGB(144, 76, 42) }, [217] = { "Brown", Color3.fromRGB(124, 92, 70) }, [218] = { "Reddish lilac", Color3.fromRGB(150, 112, 159) }, [219] = { "Lilac", Color3.fromRGB(107, 98, 155) }, [220] = { "Light lilac", Color3.fromRGB(167, 169, 206) }, [221] = { "Bright purple", Color3.fromRGB(205, 98, 152) }, [222] = { "Light purple", Color3.fromRGB(228, 173, 200) }, [223] = { "Light pink", Color3.fromRGB(220, 144, 149) }, [224] = { "Light brick yellow", Color3.fromRGB(240, 213, 160) }, [225] = { "Warm yellowish orange", Color3.fromRGB(235, 184, 127) }, [226] = { "Cool yellow", Color3.fromRGB(253, 234, 141) }, [232] = { "Dove blue", Color3.fromRGB(125, 187, 221) }, [268] = { "Medium lilac", Color3.fromRGB(52, 43, 117) }, [301] = { "Slime green", Color3.fromRGB(80, 109, 84) }, [302] = { "Smoky grey", Color3.fromRGB(91, 93, 105) }, [303] = { "Dark blue", Color3.fromRGB(0, 16, 176) }, [304] = { "Parsley green", Color3.fromRGB(44, 101, 29) }, [305] = { "Steel blue", Color3.fromRGB(82, 124, 174) }, [306] = { "Storm blue", Color3.fromRGB(51, 88, 130) }, [307] = { "Lapis", Color3.fromRGB(16, 42, 220) }, [308] = { "Dark indigo", Color3.fromRGB(61, 21, 133) }, [309] = { "Sea green", Color3.fromRGB(52, 142, 64) }, [310] = { "Shamrock", Color3.fromRGB(91, 154, 76) }, [311] = { "Fossil", Color3.fromRGB(159, 161, 172) }, [312] = { "Mulberry", Color3.fromRGB(89, 34, 89) }, [313] = { "Forest green", Color3.fromRGB(31, 128, 29) }, [314] = { "Cadet blue", Color3.fromRGB(159, 173, 192) }, [315] = { "Electric blue", Color3.fromRGB(9, 137, 207) }, [316] = { "Eggplant", Color3.fromRGB(123, 0, 123) }, [317] = { "Moss", Color3.fromRGB(124, 156, 107) }, [318] = { "Artichoke", Color3.fromRGB(138, 171, 133) }, [319] = { "Sage green", Color3.fromRGB(185, 196, 177) }, [320] = { "Ghost grey", Color3.fromRGB(202, 203, 209) }, [321] = { "Lilac", Color3.fromRGB(167, 94, 155) }, [322] = { "Plum", Color3.fromRGB(123, 47, 123) }, [323] = { "Olivine", Color3.fromRGB(148, 190, 129) }, [324] = { "Laurel green", Color3.fromRGB(168, 189, 153) }, [325] = { "Quill grey", Color3.fromRGB(223, 223, 222) }, [327] = { "Crimson", Color3.fromRGB(151, 0, 0) }, [328] = { "Mint", Color3.fromRGB(177, 229, 166) }, [329] = { "Baby blue", Color3.fromRGB(152, 194, 219) }, [330] = { "Carnation pink", Color3.fromRGB(255, 152, 220) }, [331] = { "Persimmon", Color3.fromRGB(255, 89, 89) }, [332] = { "Maroon", Color3.fromRGB(117, 0, 0) }, [333] = { "Gold", Color3.fromRGB(239, 184, 56) }, [334] = { "Daisy orange", Color3.fromRGB(248, 217, 109) }, [335] = { "Pearl", Color3.fromRGB(231, 231, 236) }, [336] = { "Fog", Color3.fromRGB(199, 212, 228) }, [337] = { "Salmon", Color3.fromRGB(255, 148, 148) }, [338] = { "Terra Cotta", Color3.fromRGB(190, 104, 98) }, [339] = { "Cocoa", Color3.fromRGB(86, 36, 36) }, [340] = { "Wheat", Color3.fromRGB(241, 231, 199) }, [341] = { "Buttermilk", Color3.fromRGB(254, 243, 187) }, [342] = { "Mauve", Color3.fromRGB(224, 178, 208) }, [343] = { "Sunrise", Color3.fromRGB(212, 144, 189) }, [344] = { "Tawny", Color3.fromRGB(150, 85, 85) }, [345] = { "Rust", Color3.fromRGB(143, 76, 42) }, [346] = { "Cashmere", Color3.fromRGB(211, 190, 150) }, [347] = { "Khaki", Color3.fromRGB(226, 220, 188) }, [348] = { "Lily white", Color3.fromRGB(237, 234, 234) }, [349] = { "Seashell", Color3.fromRGB(233, 218, 218) }, [350] = { "Burgundy", Color3.fromRGB(136, 62, 62) }, [351] = { "Cork", Color3.fromRGB(188, 155, 93) }, [352] = { "Burlap", Color3.fromRGB(199, 172, 120) }, [353] = { "Beige", Color3.fromRGB(202, 191, 163) }, [354] = { "Oyster", Color3.fromRGB(187, 179, 178) }, [355] = { "Pine Cone", Color3.fromRGB(108, 88, 75) }, [356] = { "Fawn brown", Color3.fromRGB(160, 132, 79) }, [357] = { "Hurricane grey", Color3.fromRGB(149, 137, 136) }, [358] = { "Cloudy grey", Color3.fromRGB(171, 168, 158) }, [359] = { "Linen", Color3.fromRGB(175, 148, 131) }, [360] = { "Copper", Color3.fromRGB(150, 103, 102) }, [361] = { "Dirt brown", Color3.fromRGB(86, 66, 54) }, [362] = { "Bronze", Color3.fromRGB(126, 104, 63) }, [363] = { "Flint", Color3.fromRGB(105, 102, 92) }, [364] = { "Dark taupe", Color3.fromRGB(90, 76, 66) }, [365] = { "Burnt Sienna", Color3.fromRGB(106, 57, 9) }, [1001] = { "Institutional white", Color3.fromRGB(248, 248, 248) }, [1002] = { "Mid gray", Color3.fromRGB(205, 205, 205) }, [1003] = { "Really black", Color3.fromRGB(17, 17, 17) }, [1004] = { "Really red", Color3.fromRGB(255, 0, 0) }, [1005] = { "Deep orange", Color3.fromRGB(255, 176, 0) }, [1006] = { "Alder", Color3.fromRGB(180, 128, 255) }, [1007] = { "Dusty Rose", Color3.fromRGB(163, 75, 75) }, [1008] = { "Olive", Color3.fromRGB(193, 190, 66) }, [1009] = { "New Yeller", Color3.fromRGB(255, 255, 0) }, [1010] = { "Really blue", Color3.fromRGB(0, 0, 255) }, [1011] = { "Navy blue", Color3.fromRGB(0, 32, 96) }, [1012] = { "Deep blue", Color3.fromRGB(33, 84, 185) }, [1013] = { "Cyan", Color3.fromRGB(4, 175, 236) }, [1014] = { "CGA brown", Color3.fromRGB(170, 85, 0) }, [1015] = { "Magenta", Color3.fromRGB(170, 0, 170) }, [1016] = { "Pink", Color3.fromRGB(255, 102, 204) }, [1017] = { "Deep orange", Color3.fromRGB(255, 175, 0) }, [1018] = { "Teal", Color3.fromRGB(18, 238, 212) }, [1019] = { "Toothpaste", Color3.fromRGB(0, 255, 255) }, [1020] = { "Lime green", Color3.fromRGB(0, 255, 0) }, [1021] = { "Camo", Color3.fromRGB(58, 125, 21) }, [1022] = { "Grime", Color3.fromRGB(127, 142, 100) }, [1023] = { "Lavender", Color3.fromRGB(140, 91, 159) }, [1024] = { "Pastel light blue", Color3.fromRGB(175, 221, 255) }, [1025] = { "Pastel orange", Color3.fromRGB(255, 201, 201) }, [1026] = { "Pastel violet", Color3.fromRGB(177, 167, 255) }, [1027] = { "Pastel blue-green", Color3.fromRGB(159, 243, 233) }, [1028] = { "Pastel green", Color3.fromRGB(204, 255, 204) }, [1029] = { "Pastel yellow", Color3.fromRGB(255, 255, 204) }, [1030] = { "Pastel brown", Color3.fromRGB(255, 204, 153) }, [1031] = { "Royal purple", Color3.fromRGB(98, 37, 209) }, [1032] = { "Hot pink", Color3.fromRGB(255, 0, 191) }, }
--[[ File system utilities. A thin wrapper around `lua-file-system` and `io`, tailored to Lettersmith's particular needs. ]]-- local lfs = require("lfs") local attributes = lfs.attributes local mkdir = lfs.mkdir local rmdir = lfs.rmdir local transducers = require("lettersmith.transducers") local reductions = transducers.reductions local transduce = transducers.transduce local into = transducers.into local path_utils = require("lettersmith.path_utils") local exports = {} -- @TODO can we replace is_file and is_dir with this general function? -- Could we instead have a function that returns the type of the location -- and nil could mean "location does not exist"? local function location_exists(location) -- Check if a location (file/directory) exists -- Returns boolean local f = io.open(location, "r") if f ~= nil then io.close(f) return true else return false end end exports.location_exists = location_exists local function is_dir(location) return attributes(location, "mode") == "directory" end exports.is_dir = is_dir local function is_file(location) return attributes(location, "mode") == "file" end exports.is_file = is_file local function mkdir_if_missing(location) if location_exists(location) then return true else return mkdir(location) end end local function is_plain_location(location_chunk) -- Returns true if file or directory is not a traversal (.. or .), not hidden -- (.something) return location_chunk:find("^%.") == nil end local function children(location) return coroutine.wrap(function () -- We use a for-loop instead of reject because lfs.dir requires the -- context of a userdata table it returns as a second argument. for sub_location in lfs.dir(location) do if is_plain_location(sub_location) then coroutine.yield(sub_location) end end end) end exports.children = children local function step_traversal(dir, path) if dir == "" then return path else return dir .. "/" .. path end end -- Returns every iteration of a path traversal: -- -- traversals("foo/bar/baz") -- > {"foo", "foo/bar", "foo/bar/baz"} local function traversals(path_string) local parts = path_utils.parts(path_string) return into(reductions(step_traversal, ""), ipairs(parts)) end local function mkdir_deep(path_string) -- Create deeply nested directory at `location`. -- Returns `true` on success, or `nil, message` on failure. local traversal_paths = traversals(path_string) for i, path_substring in ipairs(traversal_paths) do local is_success, message = mkdir_if_missing(path_substring) if not is_success then return is_success, message end end return true end local function remove_recursive(location) if is_dir(location) then for sub_location in children(location) do local sub_path = path_utils.join(location, sub_location) local is_success, message = remove_recursive(sub_path) if not is_success then return is_success, message end end end return os.remove(location) end exports.remove_recursive = remove_recursive local function read_entire_file(filepath) -- Read entire contents of file and return as string. -- Will return string, or throw error if file can not be read. local f = assert(io.open(filepath, "r")) local contents = f:read("*all") f:close() return contents end exports.read_entire_file = read_entire_file local function write_entire_file(filepath, contents) local f, message = io.open(filepath, "w") if f == nil then return f, message end f:write(contents) return f:close() end exports.write_entire_file = write_entire_file local function write_entire_file_deep(filepath, contents) -- Write entire contents to file at deep directory location. -- This function will make sure all the necessary directories exist before -- creating the file. local basename, dirs = path_utils.basename(filepath) local d, message = mkdir_deep(dirs) if d == nil then return d, message end return write_entire_file(filepath, contents) end exports.write_entire_file_deep = write_entire_file_deep -- Recursively walk through directory at `path_string` calling -- `callback` with each file path found. local function walk_file_paths_cps(callback, path_string) for f in children(path_string) do local filepath = path_utils.join(path_string, f) if is_file(filepath) then callback(filepath) elseif is_dir(filepath) then walk_file_paths_cps(callback, filepath) end end end -- Given `path_string` -- a path to a directory -- recursively walks through -- directory for all file paths. -- Returns a coroutine iterator. local function walk_file_paths(path_string) return coroutine.wrap(function() walk_file_paths_cps(coroutine.yield, path_string) end) end exports.walk_file_paths = walk_file_paths return exports
supportedplatforms { "Android", "POSIX", "GLES", } defines { "PLATFORM_ANDROID", "PLATFORM_POSIX", "PLATFORM_GLES", }
--[[ * Natural Selection 2 - Combat++ Mod * Authors: * WhiteWizard * * Allows PowerPoints to be used in an 'Unsocketed' state. Marines can use the 'Use' key * to socket PowerPoints now. * * Overriden Functions: * 'PowerPoint:GetCanBeUsed' - Removed the 'not socketed' check. * * Wrapped Functions * 'PowerPoint:OnUse' - Add additional logic for when the player uses the PowerPoint in the 'Unsocketed' state. ]] function PowerPoint:GetCanBeUsed(player, useSuccessTable) if player:isa("Exo") then useSuccessTable.useSuccess = false return end useSuccessTable.useSuccess = not GetPowerPointRecentlyDestroyed(self) and (not self:GetIsBuilt() or (self:GetIsBuilt() and self:GetHealthScalar() < 1)) end local ns2_PowerPoint_OnUse = PowerPoint.OnUse function PowerPoint:OnUse(player, elapsedTime, useSuccessTable) if Client and player:isa("Marine") and self.powerState == PowerPoint.kPowerState.unsocketed then Client.SendNetworkMessage("RequestSocketPowerPoint", { powerPointId = self:GetId() }, true) useSuccessTable.useSuccess = true else ns2_PowerPoint_OnUse(self, player, elapsedTime, useSuccessTable) end end
LANGUAGE = { TeamName = "PT-%s", TeamStatus = "PT-%s %s", TeamMemberStatus = "MEMBER", TeamOwnerStatus = "LEADER", tabProtectionTeam = "Protection Team", tabCreateTeam = "CREATE PT", tabJoinTeam = "JOIN PT", tabLeaveTeam = "LEAVE PT", TeamTransferOwner = "Transfer Lead", TeamKickMember = "Kick Member", TeamReassign = "Reassign Index", CannotUseTeamCommands = "You cannot use PT commands!", CannotPromoteTeamMembers = "You cannot promote PT members!", CannotKickTeamMembers = "You cannot kick PT members!", CannotReassignTeamIndex = "You cannot reassign PT index!", NoCurrentTeam = "You are not apart of a PT!", TargetNoCurrentTeam = "The person you are trying to promote is not apart of a PT!", TargetNotSameTeam = "The person you are trying to promote is not apart of the same PT!", TeamMustClamp = "You must provide a number between 1-99!", TeamMustLeave = "You must leave your current PT before joining a new one!", TeamAlreadyHasOwner = "There is already a PT lead!", TeamAlreadyExists = "A PT with index '%s' already exists!", TeamNonExistent = "PT '%s' doesn't exist!", AlreadyHasTeam = "You are already apart of a PT!", KickedFromTeam = "You've kicked %s from the PT.", TeamCreated = "PT '%s' successfully created.", TeamReassigned = "PT '%s' successfully reassigned to '%s'.", TeamOwnerSet = "The new PT lead has been set to %s.", TeamOwnerAssume = "You've assumed PT lead.", JoinedTeam = "Successfully joined PT '%s'.", LeftTeam = "Successfully left PT '%s'.", cmdCreatePTDesc = "Enter the number index for your new Protection Team. (1-99)", cmdReassignPTDesc = "Enter a new number index for your current Squad. (1-99)", cmdPTCreate = "Create a Protection Team.", cmdPTLeave = "Leave your Protection Team.", cmdPTLead = "Promote a PT member to PT lead or assume the lead position.", cmdPTKick = "Kick a PT member.", cmdPTReassign = "Reassign PT number index.", cmdPTJoin = "Join a Protection Team." }
FindMetaTable("Player").GeoIP = function(pl) if not GeoIP then require 'geoip' end if not GeoIP then error "GeoIP not found" end return GeoIP.Get(pl:IP()) end
local calc_util = require("scripts.calc.util") --- @param rates table --- @param entity LuaEntity --- @param emissions_per_second number --- @param prototypes table<string, table<string, LuaEntityPrototype>> return function(rates, entity, emissions_per_second, prototypes) local entity_prototype = entity.prototype local entity_productivity_bonus = entity.productivity_bonus local entity_speed_bonus = entity.speed_bonus -- Look for resource entities under the drill local position = entity.position local radius = entity_prototype.mining_drill_radius + 0.01 local resource_entities = entity.surface.find_entities_filtered({ area = { left_top = { x = position.x - radius, y = position.y - radius, }, right_bottom = { x = position.x + radius, y = position.y + radius, }, }, type = "resource", }) local resource_entities_len = #resource_entities if resource_entities_len == 0 then return emissions_per_second end -- Process entities local resources = {} local num_resource_entities = 0 for i = 1, resource_entities_len do local resource = resource_entities[i] local resource_name = resource.name -- Check if this resource has already been processed local resource_data = resources[resource_name] if resource_data then resource_data.occurrences = resource_data.occurrences + 1 num_resource_entities = num_resource_entities + 1 else local resource_prototype = resource.prototype -- Check if this resource can be mined by this drill if entity_prototype.resource_categories[resource_prototype.resource_category] then num_resource_entities = num_resource_entities + 1 local mineable_properties = resource_prototype.mineable_properties -- Add data to table resources[resource_name] = { occurrences = 1, products = mineable_properties.products, required_fluid = nil, mining_time = mineable_properties.mining_time, } resource_data = resources[resource_name] -- Account for infinite resource yield if resource_prototype.infinite_resource then resource_data.mining_time = ( resource_data.mining_time / (resource.amount / resource_prototype.normal_resource_amount) ) end -- Add required fluid local required_fluid = mineable_properties.required_fluid if required_fluid then resource_data.required_fluid = { name = required_fluid, amount = mineable_properties.fluid_amount / 10, -- Ten mining operations per consumed } end end end end -- Process resource entities if num_resource_entities > 0 then local adjusted_mining_speed = ( entity_prototype.mining_speed * (entity_speed_bonus + 1) * (entity_productivity_bonus + 1) ) -- Iterate each resource for _, resource_data in pairs(resources) do local resource_multiplier = ( (adjusted_mining_speed / resource_data.mining_time) * (resource_data.occurrences / num_resource_entities) ) -- Add required fluid to inputs local required_fluid = resource_data.required_fluid if required_fluid then -- Productivity does not apply to ingredients local fluid_per_second = required_fluid.amount * resource_multiplier / (entity_productivity_bonus + 1) -- Add to inputs table local fluid_name = required_fluid.name calc_util.add_rate( rates.materials, "input", "fluid", fluid_name, prototypes.fluid[fluid_name].localised_name, fluid_per_second ) end -- Iterate each product for _, product in pairs(resource_data.products) do -- Get rate per second for this product on this drill local product_per_second if product.amount then product_per_second = product.amount * resource_multiplier else product_per_second = product.amount_max - (product.amount_max - product.amount_min) / 2 * resource_multiplier end -- Account for probability local adjusted_product_per_second = product_per_second * (product.probability or 1) -- Add to outputs table local product_type = product.type local product_name = product.name local product_localised_name = prototypes[product_type][product_name].localised_name calc_util.add_rate( rates.materials, "output", product_type, product_name, product_localised_name, adjusted_product_per_second ) end end end return emissions_per_second end
assert(#hv.Globals == 0) assert(hv.Test == nil)
----------------------------------------- -- ID: 5002 -- Scroll of Valor Minuet -- Teaches the song Valor Minuet ----------------------------------------- function onItemCheck(target) return target:canLearnSpell(394) end function onItemUse(target) target:addSpell(394) end
C_AreaPoiInfo = {} ---@param uiMapID number ---@return number[] areaPoiIDs ---[Documentation](https://wow.gamepedia.com/API_C_AreaPoiInfo.GetAreaPOIForMap) function C_AreaPoiInfo.GetAreaPOIForMap(uiMapID) end ---@param uiMapID number ---@param areaPoiID number ---@return AreaPOIInfo poiInfo ---[Documentation](https://wow.gamepedia.com/API_C_AreaPoiInfo.GetAreaPOIInfo) function C_AreaPoiInfo.GetAreaPOIInfo(uiMapID, areaPoiID) end ---@param areaPoiID number ---@return number secondsLeft ---[Documentation](https://wow.gamepedia.com/API_C_AreaPoiInfo.GetAreaPOISecondsLeft) ---Returns the number of seconds until the POI expires. function C_AreaPoiInfo.GetAreaPOISecondsLeft(areaPoiID) end ---@param areaPoiID number ---@return boolean isTimed ---[Documentation](https://wow.gamepedia.com/API_C_AreaPoiInfo.IsAreaPOITimed) ---This statically determines if the POI is timed, GetAreaPOITimeLeft retrieves the value from the server and may return nothing for long intervals function C_AreaPoiInfo.IsAreaPOITimed(areaPoiID) end ---@class AreaPOIInfo ---@field areaPoiID number ---@field position Vector2DMixin ---@field name string ---@field description string|nil ---@field textureIndex number|nil ---@field widgetSetID number|nil ---@field atlasName string|nil ---@field uiTextureKit string|nil ---@field shouldGlow boolean local AreaPOIInfo = {}
local busted_path = "c:/lua/share/lua/5.4/?.lua;c:/lua/share/lua/5.4/?/init.lua;".. "c:/lua/luarocks/lua/?.lua;c:/lua/luarocks/lua/?/init.lua;".. "c:/lua/share/lua/5.4/busted/modules/files/?.lua;" package.path=busted_path..package.path; package.cpath="c:/lua/lib/lua/5.4/?.dll;"..package.cpath; local k,l,_=pcall(require,'luarocks.loader') _=k and l.add_context('busted','2.0.0-1')
--[[ ============================================================================================================ Author: Rook Date: February 18, 2015 Called when Frost Nova is cast. Damages the target as well as nearby enemies, and slows them. Additional parameters: keys.AreaRadius ================================================================================================================= ]] function invoker_retro_frost_nova_on_spell_start(keys) if keys.target:TriggerSpellAbsorb(keys.ability) then return end local frost_nova_particle_effect = ParticleManager:CreateParticle("particles/units/heroes/hero_invoker/invoker_retro_frost_nova.vpcf", PATTACH_ABSORIGIN_FOLLOW, keys.target) keys.target:EmitSound("Ability.FrostNova") --Frost Nova's area damage is dependent on the level of Quas. local iQuasLevel if keys.caster:FindAbilityByName(keys.ability:GetAbilityName()) and keys.caster:FindAbilityByName(keys.ability:GetAbilityName()) == keys.ability then iQuasLevel = keys.caster.iQuasLevel if keys.caster:HasScepter() then iQuasLevel = iQuasLevel+1 end else iQuasLevel = keys.target.iQuasLevel if keys.caster:HasScepter() then iQuasLevel = iQuasLevel+1 end end frost_nova_area_damage = keys.ability:GetSpecialValueFor("area_damage_level_quas")*iQuasLevel local nearby_enemy_units = FindUnitsInRadius(keys.caster:GetTeam(), keys.target:GetAbsOrigin(), nil, keys.AreaRadius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false) for i, individual_unit in ipairs(nearby_enemy_units) do ApplyDamageTestDummy({victim = individual_unit, attacker = keys.caster, damage = frost_nova_area_damage, damage_type = DAMAGE_TYPE_MAGICAL,}) keys.ability:ApplyDataDrivenModifier(keys.caster, individual_unit, "modifier_invoker_retro_frost_nova_slow", nil) end end
local addonName, addon = ... function addon.createOptionsPanel(title, subtext) local optionsPanel = CreateFrame("Frame") optionsPanel:Hide() optionsPanel.name = addonName local fontTitle = optionsPanel:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") fontTitle:SetJustifyH("LEFT") fontTitle:SetJustifyV("TOP") fontTitle:SetPoint("TOPLEFT", 16, -16) fontTitle:SetText(title or GetAddOnMetadata(addonName,"title")) local fontSubText = optionsPanel:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") fontSubText:SetNonSpaceWrap(true) fontSubText:SetMaxLines(3) fontSubText:SetJustifyH("LEFT") fontSubText:SetJustifyV("TOP") fontSubText:SetHeight(32) fontSubText:SetPoint("TOPLEFT", fontTitle, "BOTTOMLEFT", 0, -8) fontSubText:SetPoint("RIGHT", -32, 0) fontSubText:SetText(subtext or GetAddOnMetadata(addonName,"notes")) _G.InterfaceOptions_AddCategory(optionsPanel) return optionsPanel end function addon.createOptionsButton(parent, labelText, tooltipText, smallText) local checkButton = CreateFrame("CheckButton", nil, parent) checkButton:SetSize(26,26) checkButton:SetNormalTexture(130755) -- "Interface\\Buttons\\UI-CheckBox-Up" checkButton:SetPushedTexture(130752) -- "Interface\\Buttons\\UI-CheckBox-Down" checkButton:SetHighlightTexture(130753,"ADD") -- "Interface\\Buttons\\UI-CheckBox-Highlight" checkButton:SetCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check") -- 130751 checkButton:SetDisabledCheckedTexture("Interface\\Buttons\\UI-CheckBox-Check-Disabled") -- 130750 checkButton:SetHitRectInsets(0, -100, 0, 0) if smallText then checkButton.label = checkButton:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") checkButton.label:SetPoint("LEFT", checkButton, "RIGHT", 2, 1) else checkButton.label = checkButton:CreateFontString(nil, "ARTWORK", "GameFontHighlightLeft") checkButton.label:SetPoint("LEFT", checkButton, "RIGHT", 0, 1) end checkButton.label:SetText(labelText) checkButton:SetScript("OnDisable", function(self) local fontColor = _G.GRAY_FONT_COLOR self.label:SetTextColor(fontColor.r, fontColor.g, fontColor.b) end) checkButton:SetScript("OnEnable", function(self) local fontColor = _G.HIGHLIGHT_FONT_COLOR self.label:SetTextColor(fontColor.r, fontColor.g, fontColor.b) end) checkButton:SetScript("OnClick", function(self) if self.OnClick then if self:GetChecked() then _G.PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON) self:OnClick(true) else _G.PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF) self:OnClick(false) end end end) if tooltipText then checkButton:SetScript("OnEnter", function(self) _G.GameTooltip:SetOwner(self, "ANCHOR_RIGHT") _G.GameTooltip:SetText(tooltipText, nil, nil, nil, nil, true) end) checkButton:SetScript("OnLeave", function() _G.GameTooltip:Hide() end) end return checkButton end
local sawing_registry = assert(yatm.sawing.sawing_registry) local wood_types = {} local has_stairs = rawget(_G, "stairs") ~= nil if rawget(_G, "nokore_world_tree_acacia") then wood_types.acacia = true end if rawget(_G, "nokore_world_tree_big_oak") then wood_types.big_oak = true end if rawget(_G, "nokore_world_tree_birch") then wood_types.birch = true end if rawget(_G, "nokore_world_tree_fir") then wood_types.fir = true end if rawget(_G, "nokore_world_tree_jungle") then wood_types.jungle = true end if rawget(_G, "nokore_world_tree_oak") then wood_types.oak = true end if rawget(_G, "nokore_world_tree_sakura") then wood_types.sakura = true end if rawget(_G, "nokore_world_tree_spruce") then wood_types.spruce = true end if rawget(_G, "nokore_world_tree_willow") then wood_types.willow = true end -- -- Sawing Recipes -- local reg = sawing_registry:method("register_sawing_recipe") for wood_type,_ in pairs(wood_types) do local log_name = "nokore_world_tree_"..wood_type..":"..wood_type.."_log" local core_name = "yatm_woodcraft:"..wood_type.."_log_core" local bark_name = "yatm_woodcraft:"..wood_type.."_log_bark" local planks_name = "nokore_world_tree_"..wood_type..":"..wood_type.."_planks" local slab_name = "nokore_world_tree_"..wood_type..":"..wood_type.."_slab" local panel_name = "yatm_woodcraft:"..wood_type.."_planks_panel" -- Log to Core & Bark reg("yatm_woodcraft:"..wood_type.."_log_to_core_and_barks", ItemStack(log_name), { ItemStack(core_name), ItemStack(bark_name .. " 4"), }, 0.25) -- Core to Planks reg("yatm_woodcraft:"..wood_type.."log_core_to_slabs", ItemStack(core_name), { ItemStack(planks_name .. " 6"), }, 0.25) -- Planks to Slabs if has_stairs then reg("yatm_woodcraft:"..wood_type.."_planks_to_slabs", ItemStack(planks_name), { ItemStack(slab_name.." 2"), }, 0.25) end -- Slabs to Panels -- Slabs are half of a plank, which doing the math, is 8px tall -- Panels or Plates are 2px tall, so `slab > panel` should produce 4 panels. if has_stairs then reg("yatm_woodcraft:"..wood_type.."_slabs_to_panels", ItemStack(slab_name), { ItemStack(panel_name.." 4"), }, 0.25) end -- Fallback Plank to Panels if not has_stairs then yatm.info("Falling back to plank to panel recipes") reg("yatm_woodcraft:"..wood_type.."_planks_to_panels", ItemStack(planks_name), { ItemStack(panel_name.." 8"), }, 0.25) end end
-- ====================================================================== -- Jurassic Jigsaw -- Advent of Code 2020 Day 20 -- Eric Wastl -- https://adventofcode.com -- -- lua implementation by Dr. Dean Earl Wright III -- ====================================================================== -- ====================================================================== -- t e s t _ t i l e . l u a -- ====================================================================== -- Test Tile for Advent of Code 2020 day 20, Jurassic Jigsaw -- ---------------------------------------------------------------------- -- require -- ---------------------------------------------------------------------- local luaunit = require('luaunit') local tile = require('tile') -- ---------------------------------------------------------------------- -- from_text -- ---------------------------------------------------------------------- function from_text(text) -- Break the text into trimed, non-comment lines -- 1. We start with no lines local result = {} -- 2. Loop for lines in the text for line in text:gmatch('[^\r\n]+') do -- 3. But ignore blank and comment lines line = line:gsub("%s*$", "") if #line > 0 and "!" ~= line:sub(1, 1) then -- 4. Add the line table.insert(result, line) end end -- 5. Return a table of cleaned lines return result end -- ---------------------------------------------------------------------- -- constants -- ---------------------------------------------------------------------- local EXAMPLE_TEXT = [[ Tile 2311: ..##.#..#. ##..#..... #...##..#. ####.#...# ##.##.###. ##...#.### .#.#.#..## ..#....#.. ###...#.#. ..###..### ]] local EXAMPLE_DISPLAY = [[..##.#..#. ##..#..... #...##..#. ####.#...# ##.##.###. ##...#.### .#.#.#..## ..#....#.. ###...#.#. ..###..###]] local EXAMPLE_ROTATED = [[.#..#####. .#.####.#. ###...#..# #..#.##..# #....#.##. ...##.##.# .#...#.... #.#.##.... ##.###.#.# #..##.#...]] local EXAMPLE_FLIP_HOR = [[#..##.#... ##.###.#.# #.#.##.... .#...#.... ...##.##.# #....#.##. #..#.##..# ###...#..# .#.####.#. .#..#####.]] local BORDERS = "#..##.#...,.#..#.##..,.#..#####.,###..###.." local EXAMPLE_IMAGE = [[#.###.#. .#.##... #...#... ..##.##. ....#.## ..#.##.. ##...#.. #.####.#]] local EXAMPLE_FLIP_VER = [[...#.##..# #.#.###.## ....##.#.# ....#...#. #.##.##... .##.#....# #..##.#..# #..#...### .#.####.#. .#####..#.]] local BORDERSV = "...#.##..#,###..###..,.#####..#.,.#..#.##.." local IMAGE = { ".#.#..#.##...#.##..#####", "###....#.#....#..#......", "##.##.###.#.#..######...", "###.#####...#.#####.#..#", "##.#....#.##.####...#.##", "...########.#....#####.#", "....#..#...##..#.#.###..", ".####...#..#.....#......", "#..#.##..#..###.#.##....", "#.####..#.####.#.#.###..", "###.#.#...#.######.#..##", "#.####....##..########.#", "##..##.#...#...#.#.#.#..", "...#..#..#.#.##..###.###", ".#.#....#.##.#...###.##.", "###.#...#..#.##.######..", ".#.#.###.##.##.#..#.##..", ".####.###.#...###.#..#.#", "..#.#..#..#.#.#.####.###", "#..####...#.#.#.###.###.", "#####..#####...###....##", "#.##..#..#...#..####...#", ".#.###..##..##..####.##.", "...###...##...#...#..###" } local MONSTER_IMAGE = [[.####...#####..#...###.. #####..#..#.#.####..#.#. .#.#...#.###...#.##.##.. #.#.##.###.#.##.##.##### ..##.###.####..#.####.## ...#.#..##.##...#..#..## #.##.#..#.#..#..##.#.#.. .###.##.....#...###.#... #.####.#.#....##.#..#.#. ##...#..#....#..#...#### ..#.##...###..#.#####..# ....#.##.#.#####....#... ..##.##.###.....#.##..#. #...#...###..####....##. .#.##...#.##.#.#.###...# #.###.#..####...##..#... #.###...#.##...#.######. .###.###.#######..#####. ..##.#..#..#.#######.### #.#..##.########..#..##. #.#####..#.#...##..#.... #....##..#.#########..## #...#.....#..##...###.## #..###....##.#...##.##.#]] -- ====================================================================== -- TestTile -- ====================================================================== function test_empty_init() -- Test the default Tile creation -- 1. Create default Tile object local myobj = tile:Tile() -- 2. Make sure it has the default values luaunit.assertEquals(myobj.part2, false) luaunit.assertEquals(#myobj.text, 0) luaunit.assertEquals(myobj.number, 0) luaunit.assertEquals(#myobj.rows, 0) luaunit.assertEquals(#myobj.flip, 0) luaunit.assertEquals(#myobj.alt, 0) end function test_text_init() -- Test the Tile object creation from text -- 1. Create Image object from text local myobj = tile:Tile({text=from_text(EXAMPLE_TEXT)}) -- 2. Make sure it has the expected values luaunit.assertEquals(myobj.part2, false) luaunit.assertEquals(#myobj.text, 11) luaunit.assertEquals(myobj.number, 2311) luaunit.assertEquals(#myobj.rows, 10) luaunit.assertEquals(myobj.rows[1]:len(), 10) luaunit.assertEquals(myobj.rows[1], "..##.#..#.") luaunit.assertEquals(myobj.rows[10]:len(), 10) luaunit.assertEquals(myobj.rows[10], "..###..###") luaunit.assertEquals(#myobj.flip, 10) luaunit.assertEquals(table.concat(myobj.alt[BORDERS],'\n'), EXAMPLE_IMAGE) luaunit.assertEquals(myobj:count_alt(), 8) -- 3. Check methods luaunit.assertEquals(myobj:display(), EXAMPLE_DISPLAY) myobj:_initial_rotation() luaunit.assertEquals(myobj:display_rot(), EXAMPLE_DISPLAY) myobj:rotate() luaunit.assertEquals(myobj:display_rot(), EXAMPLE_ROTATED) myobj:_initial_flip() luaunit.assertEquals(myobj:display_flip(), EXAMPLE_ROTATED) myobj:flip_hor() luaunit.assertEquals(myobj:display_flip(), EXAMPLE_FLIP_HOR) local top, right, bottom, left, image = myobj:borders_and_image() luaunit.assertEquals(table.concat({top, right, bottom, left}, ','), BORDERS) luaunit.assertEquals(table.concat(image,'\n'), EXAMPLE_IMAGE) myobj:flip_ver() luaunit.assertEquals(myobj:display_flip(), EXAMPLE_FLIP_VER) top, right, bottom, left, image = myobj:borders_and_image() luaunit.assertEquals(table.concat({top, right, bottom, left}, ','), BORDERSV) luaunit.assertEquals(myobj:border(BORDERS, 'T'), "#..##.#...") luaunit.assertEquals(myobj:border(BORDERS, 'R'), ".#..#.##..") luaunit.assertEquals(myobj:border(BORDERS, 'B'), ".#..#####.") luaunit.assertEquals(myobj:border(BORDERS, 'L'), "###..###..") end function test_image() -- Test the default Tile creation -- 1. Create default Tile object local myobj = tile:Tile() -- 2. Make sure it has the default values luaunit.assertEquals(myobj.part2, false) luaunit.assertEquals(#myobj.text, 0) luaunit.assertEquals(myobj.number, 0) luaunit.assertEquals(#myobj.rows, 0) -- 3. Set the image myobj.rows = IMAGE -- 4. Methods luaunit.assertEquals(myobj:display(), table.concat(myobj.rows, '\n')) myobj:construct_alternatives(true) luaunit.assertEquals(#myobj.alt, 16) local found = false for _, altimg in ipairs(myobj.alt) do if table.concat(altimg,'\n') == MONSTER_IMAGE then found = true end end luaunit.assertEquals(found, true) end -- ---------------------------------------------------------------------- -- module initialization -- ---------------------------------------------------------------------- os.exit( luaunit.LuaUnit.run() ) -- ====================================================================== -- end t e s t _ t i l e . p y end -- ======================================================================
function Skada:FormatNumber(number) if number then if self.db.profile.numberformat == 1 then if number > 10e8 then return ("%02.1f億"):format(number / 1e8) elseif number > 1e8 then return ("%02.2f億"):format(number / 1e8) elseif number > 10e4 then return ("%02.0f萬"):format(number / 1e4) elseif number > 1e4 then return ("%02.1f萬"):format(number / 1e4) else return math.floor(number) end else return math.floor(number) end end end
---------------------------------------------------------------------------------- --- Total RP 3 --- Dashboard --- --------------------------------------------------------------------------- --- Copyright 2014 Sylvain Cossement (telkostrasz@telkostrasz.be) --- Copyright 2018 Renaud "Ellypse" Parize <ellypse@totalrp3.info> @EllypseCelwe --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. ---------------------------------------------------------------------------------- ---@type TRP3_API local _, TRP3_API = ...; TRP3_API.dashboard = { NOTIF_CONFIG_PREFIX = "notification_" }; -- imports local GetMouseFocus, _G, TRP3_DashboardStatus_Currently, RaidNotice_AddMessage, TRP3_DashboardStatus_OOCInfo = GetMouseFocus, _G, TRP3_DashboardStatus_Currently, RaidNotice_AddMessage, TRP3_DashboardStatus_OOCInfo; local getPlayerCharacter, getPlayerCurrentProfileID = TRP3_API.profile.getPlayerCharacter, TRP3_API.profile.getPlayerCurrentProfileID; local getProfiles = TRP3_API.profile.getProfiles; local Utils, Events, Globals = TRP3_API.utils, TRP3_API.events, TRP3_API.globals; local setupListBox = TRP3_API.ui.listbox.setupListBox; local setTooltipForSameFrame = TRP3_API.ui.tooltip.setTooltipForSameFrame; local icon, color = Utils.str.icon, Utils.str.color; local playUISound = TRP3_API.ui.misc.playUISound; local getConfigValue, registerConfigKey, registerConfigHandler = TRP3_API.configuration.getValue, TRP3_API.configuration.registerConfigKey, TRP3_API.configuration.registerHandler; local setTooltipForFrame, refreshTooltip, mainTooltip = TRP3_API.ui.tooltip.setTooltipForFrame, TRP3_API.ui.tooltip.refresh, TRP3_MainTooltip; local getCurrentContext, getCurrentPageID = TRP3_API.navigation.page.getCurrentContext, TRP3_API.navigation.page.getCurrentPageID; local registerMenu, registerPage = TRP3_API.navigation.menu.registerMenu, TRP3_API.navigation.page.registerPage; local registerPage, setPage = TRP3_API.navigation.page.registerPage, TRP3_API.navigation.page.setPage; local assert, tostring, tinsert, date, time, pairs, tremove, EMPTY, unpack, wipe, strconcat = assert, tostring, tinsert, date, time, pairs, tremove, TRP3_API.globals.empty, unpack, wipe, strconcat; local initList, handleMouseWheel = TRP3_API.ui.list.initList, TRP3_API.ui.list.handleMouseWheel; local TRP3_DashboardNotifications, TRP3_DashboardNotificationsSlider, TRP3_DashboardNotifications_No = TRP3_DashboardNotifications, TRP3_DashboardNotificationsSlider, TRP3_DashboardNotifications_No; local setupFieldSet = TRP3_API.ui.frame.setupFieldPanel; local displayDropDown = TRP3_API.ui.listbox.displayDropDown; local displayMessage, RaidWarningFrame = TRP3_API.utils.message.displayMessage, RaidWarningFrame; local GetInventoryItemID, GetItemInfo = GetInventoryItemID, GetItemInfo; local tconcat = table.concat; -- Total RP 3 imports local loc = TRP3_API.loc; --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -- SCHEMA --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* local get, getDefaultProfile = TRP3_API.profile.getData, TRP3_API.profile.getDefaultProfile; getDefaultProfile().player.character = { v = 1, } local function incrementCharacterVernum() local character = get("player/character"); character.v = Utils.math.incrementNumber(character.v or 1, 2); Events.fireEvent(Events.REGISTER_DATA_UPDATED, Globals.player_id, getPlayerCurrentProfileID(), "character"); end --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -- STATUS --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* local function onStatusChange(status) local character = get("player/character"); local old = character.RP; character.RP = status; if old ~= status then incrementCharacterVernum(); end end local function switchStatus() if get("player/character/RP") == 1 then onStatusChange(2); else onStatusChange(1); end end TRP3_API.dashboard.switchStatus = switchStatus; local function onStatusXPChange(status) local character = get("player/character"); local old = character.XP; character.XP = status; if old ~= status then incrementCharacterVernum(); end end local function onShow(context) local character = get("player/character"); TRP3_DashboardStatus_CharactStatusList:SetSelectedValue(character.RP or 1); TRP3_DashboardStatus_XPStatusList:SetSelectedValue(character.XP or 2); end function TRP3_API.dashboard.isPlayerIC() return get("player/character/RP") == 1; end function TRP3_API.dashboard.getCharacterExchangeData() return get("player/character"); end --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -- SANITIZE --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* local FIELDS_TO_SANITIZE = { "CO", "CU" } ---@param structure table ---@return boolean function TRP3_API.dashboard.sanitizeCharacter(structure) local somethingWasSanitized = false; if structure then for _, field in pairs(FIELDS_TO_SANITIZE) do if structure[field] then local sanitizedValue = Utils.str.sanitize(structure[field]); if sanitizedValue ~= structure[field] then structure[field] = sanitizedValue; somethingWasSanitized = true; end end end end return somethingWasSanitized; end --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* -- INIT --*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* local DASHBOARD_PAGE_ID = "dashboard"; local ShowingHelm, ShowingCloak, ShowCloak, ShowHelm = ShowingHelm, ShowingCloak, ShowCloak, ShowHelm; local Button_Cape, Button_Helmet, Button_Status, Button_RPStatus; local SendChatMessage, UnitIsDND, UnitIsAFK = SendChatMessage, UnitIsDND, UnitIsAFK; TRP3_API.dashboard.init = function() local TUTORIAL_STRUCTURE = { { box = { allPoints = TRP3_DashboardStatus }, button = { x = -50, y = 0, anchor = "RIGHT", text = loc("DB_TUTO_1"):format(TRP3_API.globals.player_id), textWidth = 425, arrow = "UP" } }, } registerMenu({ id = "main_00_dashboard", align = "CENTER", text = TRP3_API.globals.addon_name, onSelected = function() setPage(DASHBOARD_PAGE_ID); end, }); registerPage({ id = DASHBOARD_PAGE_ID, frame = TRP3_Dashboard, onPagePostShow = onShow, tutorialProvider = function() return TUTORIAL_STRUCTURE; end }); setupFieldSet(TRP3_DashboardStatus, loc("DB_STATUS"), 150); TRP3_DashboardStatus_CharactStatus:SetText(loc("DB_STATUS_RP")); local OOC_ICON = "|TInterface\\COMMON\\Indicator-Red:15|t"; local IC_ICON = "|TInterface\\COMMON\\Indicator-Green:15|t"; local statusTab = { {IC_ICON .. " " .. loc("DB_STATUS_RP_IC"), 1, loc("DB_STATUS_RP_IC_TT")}, {OOC_ICON .. " " .. loc("DB_STATUS_RP_OOC"), 2, loc("DB_STATUS_RP_OOC_TT")}, }; setupListBox(TRP3_DashboardStatus_CharactStatusList, statusTab, onStatusChange, nil, 170, true); TRP3_DashboardStatus_XPStatus:SetText(loc("DB_STATUS_XP")); local BEGINNER_ICON = "|TInterface\\TARGETINGFRAME\\UI-TargetingFrame-Seal:20|t"; local VOLUNTEER_ICON = "|TInterface\\TARGETINGFRAME\\PortraitQuestBadge:15|t"; local xpTab = { {BEGINNER_ICON .. " " .. loc("DB_STATUS_XP_BEGINNER"), 1, loc("DB_STATUS_XP_BEGINNER_TT")}, {loc("DB_STATUS_RP_EXP"), 2, loc("DB_STATUS_RP_EXP_TT")}, {VOLUNTEER_ICON .. " " .. loc("DB_STATUS_RP_VOLUNTEER"), 3, loc("DB_STATUS_RP_VOLUNTEER_TT")}, }; setupListBox(TRP3_DashboardStatus_XPStatusList, xpTab, onStatusXPChange, nil, 170, true); Events.listenToEvent(Events.REGISTER_DATA_UPDATED, function(unitID, profileID, dataType) if (not dataType or dataType == "character") and getCurrentPageID() == DASHBOARD_PAGE_ID then onShow(nil); end end); Events.listenToEvent(Events.NOTIFICATION_CHANGED, function() if getCurrentPageID() == DASHBOARD_PAGE_ID then onShow(nil); end end); -- Tab bar local whatsNewText = loc("WHATS_NEW_17"); local moreModuleText = loc("MORE_MODULES_2"); local aboutText = loc("THANK_YOU_1"); moreModuleText = Utils.str.toHTML(moreModuleText); whatsNewText = Utils.str.toHTML(whatsNewText); aboutText = Utils.str.toHTML(aboutText:format(TRP3_API.globals.version_display, TRP3_API.globals.version, ELLYPSE_PATREON_SUPPORTERS)); local frame = CreateFrame("Frame", "TRP3_DashboardBottomTabBar", TRP3_DashboardBottom); frame:SetSize(400, 30); frame:SetPoint("TOPLEFT", 17, 30); frame:SetFrameLevel(1); local tabGroup = TRP3_API.ui.frame.createTabPanel(frame, { { loc("DB_NEW"), 1, 150 }, { loc("DB_ABOUT"), 2, 175 }, { loc("DB_MORE"), 3, 150 }, }, function(tabWidget, value) if value == 1 then TRP3_DashboardBottomContent:SetText(whatsNewText); TRP3_DashboardBottomContent.text = whatsNewText; elseif value == 2 then TRP3_DashboardBottomContent:SetText(aboutText); TRP3_DashboardBottomContent.text = aboutText; elseif value == 3 then TRP3_DashboardBottomContent:SetText(moreModuleText); TRP3_DashboardBottomContent.text = moreModuleText; end end ); local function toggleSettingWithToast(settingName) if TRP3_API.configuration.getValue(settingName) then TRP3_API.configuration.setValue(settingName, false); TRP3_API.ui.tooltip.toast(loc("OPTION_DISABLED_TOAST"), 3); else TRP3_API.configuration.setValue(settingName, true); TRP3_API.ui.tooltip.toast(loc("OPTION_ENABLED_TOAST"), 3); end end TRP3_DashboardBottomContent:SetFontObject("p", GameFontNormal); TRP3_DashboardBottomContent:SetFontObject("h1", GameFontNormalHuge3); TRP3_DashboardBottomContent:SetFontObject("h2", GameFontNormalHuge); TRP3_DashboardBottomContent:SetFontObject("h3", GameFontNormalLarge); TRP3_DashboardBottomContent:SetTextColor("h1", 1, 1, 1); TRP3_DashboardBottomContent:SetTextColor("h2", 1, 1, 1); TRP3_DashboardBottomContent:SetTextColor("h3", 1, 1, 1); TRP3_DashboardBottomContent:SetScript("OnHyperlinkClick", function(self, url, text, button) --[[ -- Twitter links ]] if url:sub(1, 7) == "twitter" then if Social_ToggleShow and button == "LeftButton" then Social_ToggleShow(url:gsub("twitter", "|cff61AAEE@") .. "|r "); else url = url:gsub("twitter", "http://twitter.com/"); TRP3_API.Ellyb.Popups:OpenURL(url, "|cff55aceeTwitter profile|r\n"); end --[[ -- Links relative to the What's new section (valid for version 1.3.0) ]] elseif url == "right_click_profile" then toggleSettingWithToast("CONFIG_RIGHT_CLICK_OPEN_PROFILE") -- Toggle the option to replace companion name in NPC speeches elseif url == "companion_speeches" then toggleSettingWithToast("chat_npcspeech_replacement") -- Toggle the option to use the default color picker elseif url == "default_color_picker" then toggleSettingWithToast("default_color_picker") -- Toggle the option to disable chat while OOC elseif url == "disable_chat_ooc" then toggleSettingWithToast("chat_disable_ooc") -- Mature filter settings slider elseif url == "open_mature_filter_settings" then TRP3_API.navigation.menu.selectMenu("main_91_config_main_config_register"); --[[ -- Fallback, open URL in a popup ]] else TRP3_API.Ellyb.Popups:OpenURL(url, loc.UI_LINK_SAFE); end end); TRP3_DashboardBottomContent:SetScript("OnHyperlinkEnter", function(self, link, text) TRP3_MainTooltip:Hide(); TRP3_MainTooltip:SetOwner(TRP3_DashboardBottomContent, "ANCHOR_CURSOR"); if Social_ToggleShow and link:sub(1, 7) == "twitter" then TRP3_MainTooltip:AddLine(link:gsub("twitter", "|cff61AAEE@"), 1, 1, 1, true); TRP3_MainTooltip:AddLine("|cffffff00" .. loc("CM_CLICK") .. ":|r " .. loc("CM_TWEET") .. "|n|cffffff00" .. loc("CM_R_CLICK") .. ":|r " .. loc("CM_TWEET_PROFILE"), 1, 1, 1, true); else TRP3_MainTooltip:AddLine(text, 1, 1, 1, true); TRP3_MainTooltip:AddLine("|cffffff00" .. loc("CM_CLICK") .. ":|r " .. loc("CM_OPEN"), 1, 1, 1, true); end TRP3_MainTooltip:Show(); end); TRP3_DashboardBottomContent:SetScript("OnHyperlinkLeave", function() TRP3_MainTooltip:Hide(); end); tabGroup:SelectTab(1); -- Resizing TRP3_API.events.listenToEvent(TRP3_API.events.NAVIGATION_RESIZED, function(containerwidth, containerHeight) TRP3_DashboardBottomContent:SetSize(containerwidth - 54, 5); TRP3_DashboardBottomContent:SetText(TRP3_DashboardBottomContent.text); end); end local function profileSelected(profileID) TRP3_API.profile.selectProfile(profileID); end TRP3_API.events.listenToEvent(TRP3_API.events.WORKFLOW_ON_LOADED, function() if TRP3_API.toolbar then local updateToolbarButton = TRP3_API.toolbar.updateToolbarButton; -- away/dnd local status1Text = color("w")..loc("TB_STATUS")..": "..color("r")..loc("TB_DND_MODE"); local status1SubText = color("y")..loc("CM_CLICK")..": "..color("w")..(loc("TB_GO_TO_MODE"):format(color("g")..loc("TB_NORMAL_MODE")..color("w"))); local status2Text = color("w")..loc("TB_STATUS")..": "..color("o")..loc("TB_AFK_MODE"); local status2SubText = color("y")..loc("CM_CLICK")..": "..color("w")..(loc("TB_GO_TO_MODE"):format(color("g")..loc("TB_NORMAL_MODE")..color("w"))); local status3Text = color("w")..loc("TB_STATUS")..": "..color("g")..loc("TB_NORMAL_MODE"); local status3SubText = color("y")..loc("CM_L_CLICK")..": "..color("w")..(loc("TB_GO_TO_MODE"):format(color("o")..loc("TB_AFK_MODE")..color("w"))).."\n"..color("y")..loc("CM_R_CLICK")..": "..color("w")..(loc("TB_GO_TO_MODE"):format(color("r")..loc("TB_DND_MODE")..color("w"))); Button_Status = { id = "aa_trp3_c", icon = "Ability_Rogue_MasterOfSubtlety", configText = loc("CO_TOOLBAR_CONTENT_STATUS"), onUpdate = function(Uibutton, buttonStructure) updateToolbarButton(Uibutton, buttonStructure); if GetMouseFocus() == Uibutton then refreshTooltip(Uibutton); end end, onModelUpdate = function(buttonStructure) if UnitIsDND("player") then buttonStructure.tooltip = status1Text; buttonStructure.tooltipSub = status1SubText; buttonStructure.icon = "Ability_Mage_IncantersAbsorbtion"; elseif UnitIsAFK("player") then buttonStructure.tooltip = status2Text; buttonStructure.tooltipSub = status2SubText; buttonStructure.icon = "Spell_Nature_Sleep"; else buttonStructure.tooltip = status3Text; buttonStructure.tooltipSub = status3SubText; buttonStructure.icon = "Ability_Rogue_MasterOfSubtlety"; end end, onClick = function(Uibutton, buttonStructure, button) if UnitIsAFK("player") then SendChatMessage("","AFK"); elseif UnitIsDND("player") then SendChatMessage("","DND"); else if button == "LeftButton" then SendChatMessage("","AFK"); else SendChatMessage("","DND"); end end playUISound("igMainMenuOptionCheckBoxOn"); end, }; TRP3_API.toolbar.toolbarAddButton(Button_Status); -- Toolbar RP status local RP_ICON, OOC_ICON = "spell_shadow_charm", "Inv_misc_grouplooking"; local rpTextOn = loc("TB_RPSTATUS_ON"); local rpTextOff = loc("TB_RPSTATUS_OFF"); local rpText2 = color("y")..loc("CM_L_CLICK")..": "..color("w")..loc("TB_RPSTATUS_TO_ON"); rpText2 = rpText2.."\n"..color("y")..loc("CM_R_CLICK")..": "..color("w")..loc("TB_SWITCH_PROFILE"); local rpText3 = color("y")..loc("CM_L_CLICK")..": "..color("w")..loc("TB_RPSTATUS_TO_OFF"); rpText3 = rpText3.."\n"..color("y")..loc("CM_R_CLICK")..": "..color("w")..loc("TB_SWITCH_PROFILE"); local get = TRP3_API.profile.getData; local defaultIcon = TRP3_API.globals.player_icon; local Button_RPStatus = { id = "aa_trp3_rpstatus", icon = "Inv_misc_grouplooking", configText = loc("CO_TOOLBAR_CONTENT_RPSTATUS"), onEnter = function(Uibutton, buttonStructure) end, onUpdate = function(Uibutton, buttonStructure) updateToolbarButton(Uibutton, buttonStructure); if GetMouseFocus() == Uibutton then refreshTooltip(Uibutton); end end, onModelUpdate = function(buttonStructure) if get("player/character/RP") == 1 then buttonStructure.tooltip = rpTextOn; buttonStructure.tooltipSub = rpText3; buttonStructure.icon = RP_ICON; else buttonStructure.tooltip = rpTextOff; buttonStructure.tooltipSub = rpText2; buttonStructure.icon = OOC_ICON; end end, onClick = function(Uibutton, buttonStructure, button) if button == "RightButton" then local list = getProfiles(); local dropdownItems = {}; tinsert(dropdownItems,{loc("TB_SWITCH_PROFILE"), nil}); local currentProfileID = getPlayerCurrentProfileID() for key, value in pairs(list) do local icon = value.player.characteristics.IC or Globals.icons.profile_default; if key == currentProfileID then tinsert(dropdownItems,{"|Tinterface\\icons\\"..icon..":15|t|cff00ff00 "..value.profileName.."|r", nil}); else tinsert(dropdownItems,{"|Tinterface\\icons\\"..icon..":15|t "..value.profileName, key}); end end displayDropDown(Uibutton, dropdownItems, profileSelected, 0, true); else switchStatus(); playUISound("igMainMenuOptionCheckBoxOn"); end end, onLeave = function() mainTooltip:Hide(); end, visible = 1 }; TRP3_API.toolbar.toolbarAddButton(Button_RPStatus); end end);
-- 游戏服数据库 -- auth:diandian -- date:2017/6/15 local skynet = require 'skynet' local mysql = require "skynet.db.mysql" local cjson = require "cjson" local ex_log = require "ex_log" local NO_ERR = nil local _db local _dbname local CMD = {} local TS = tostring local function QS(v) return mysql.quote_sql_str(TS(v)) end function CMD.get(tname, key) local query = string.format("SELECT * FROM `%s` WHERE `key` = '%s';", tname, key) local res = _db:query(query) return res[0] end function CMD.get_table(tname, key) local query = string.format("SELECT * FROM `%s` WHERE `key` = '%s';", tname, key) local res = _db:query(query) if not res[1] then return nil end return cjson.decode(res[1].value) end function CMD.set(tname, key, value) local query if value then query = string.format( "REPLACE INTO `%s` (`key`, `value`) VALUES ('%s', '%s');", tname, key, value) else query = string.format( "DELETE FROM `%s` WHERE (`key`='%s');", tname, key) end return _db:query(query) end function CMD.set_table(tname, key, obj) local query if obj then query = string.format( "REPLACE INTO `%s` (`key`, `value`) VALUES ('%s', '%s');", tname, key, cjson.encode(obj)) else query = string.format( "DELETE FROM `%s` WHERE (`key`='%s');", tname, key) end return _db:query(query) end function CMD.incr(tname, key) local query = string.format( "UPDATE `%s` SET `incr`=`incr`+1 WHERE `key`='%s'; SELECT `incr` FROM `%s` WHERE `key`='%s'", tname, key, tname, key) local res = _db:query(query) return res[2][1].incr end function CMD.incr_init(tname, key, value) local query = string.format("SELECT * FROM `%s` WHERE `key`='%s';", tname, key) local res = _db:query(query) if res[1] then return res[1].incr end query = string.format("REPLACE INTO `%s` (`key`, `incr`) VALUES ('%s', %d);", tname, key, value) res = _db:query(query) return value end function CMD.desc_table(tname) local sql = string.format("show full columns from `%s`", tname) local res = _db:query(sql) if res.err then return res.err end return NO_ERR, res end local function db_heart() _db:query("use " .. _dbname) skynet.timeout(5000, db_heart) end function CMD.create_table(name, fields, prikey, comment) local sql = {} table.insert(sql, string.format("CREATE TABLE IF NOT EXISTS `%s` (", name)) for k, v in ipairs(fields) do local fs = string.format("`%s` %s %s NULL %s COMMENT \"%s\",", v.name, v.type, v.null or "", v.extra or "", v.comment or "") table.insert(sql, fs) end if prikey then table.insert(sql, string.format("PRIMARY KEY (`%s`)", prikey)) end table.insert(sql, string.format(") COMMENT \"%s\";", comment or "")) local sqltr = table.concat(sql, "\n") skynet.error("create table:\n", sqltr) local res = _db:query(sqltr) if res.err then return res.err end return NO_ERR, res end function CMD.drop_table(name) local sql = string.format("DROP TABLE `%s`;", name) skynet.error("drop table:\n", name) local res = _db:query(sql) if res.err then return res.err end return NO_ERR, res end local function insert_field(table_name, field_name, field) local sql = string.format( "ALTER TABLE `%s` ADD COLUMN `%s` %s %s NULL %s COMMENT \"%s\";", table_name, field_name, field.type, field.null or "", field.extra or "", field.comment or "") skynet.error("insert field:\n", sql) local res = _db:query(sql) if res.err then return res.err end return NO_ERR, res end local function modify_field(table_name, field_name, field) local sql = string.format( "alter table `%s` change `%s` `%s` %s %s NULL %s COMMENT \"%s\";", table_name, field_name, field_name, field.type, field.null or "", field.extra or "", field.comment or "") skynet.error("modify field:\n", sql) local res = _db:query(sql) if res.err then return res.err end return NO_ERR, res end local function check_fields(table_name, fields) local err, descs = CMD.desc_table(table_name) local cur_fields = {} for i, v in pairs(descs) do cur_fields[v.Field] = { type = v.Type, null = v.Null == "NO" and "NOT" or "", extra = v.Extra, comment = v.Comment, } end local creates = {} local executes = {} for i, v in ipairs(fields) do if cur_fields[v.name] then executes[v.name] = v else assert(v.name, v.comment) creates[v.name] = v end end for k, v in pairs(creates) do local err, res = insert_field(table_name, k, v) assert(not err, err) end local ckmap = { "type", "null", "extra", "comment", } for k, v in pairs(executes) do local sv = cur_fields[k] for i, f in ipairs(ckmap) do if v[f] and sv[f] and string.upper(v[f]) ~= string.upper(sv[f]) then skynet.error("field diff:", f, v[f], "~=", sv[f]) local err, res = modify_field(table_name, k, v) assert(not err, err) break; end end end end function CMD.check_tables(registers) local query_tables = _db:query("show tables;") local cur_tables = {} for i, v in ipairs(query_tables) do local n = v[next(v)] cur_tables[n] = n end local creates = {} local deletes = {} local executes = {} for k, v in pairs(cur_tables) do if not registers[k] then deletes[k] = k else executes[k] = registers[k] end end for k, v in pairs(registers) do if not cur_tables[k] then creates[k] = v end end for k, v in pairs(creates) do local err, res = CMD.create_table(k, v.fields, v.prikey, v.comment) assert(not err, err) end --[[ not delete table for k, v in pairs(deletes) do local err, res = CMD.drop_table(k) assert(not err, err) end --]] for k, v in pairs(executes) do check_fields(k, v.fields) end end function CMD.query(sql) local res = _db:query(sql) if res.err then return res.err .. sql, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res end function CMD.select(tname, fields, where, limit) local sql = { "SELECT", table.concat(fields, ","), "FROM", "`" .. tname .. "`", } if where and next(where) then table.insert(sql, "WHERE") for _, v in ipairs(where) do if type(v) == "table" then table.insert(sql, string.format("%s%s", TS(v[1]), QS(v[2]))) else table.insert(sql, TS(v)) end end end if limit and next(limit) then table.insert(sql, "LIMIT") table.insert(sql, table.concat(limit, ",")) end local sql = table.concat(sql, " ") local res = _db:query(sql) if res.err then return res.err .. sql, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res end function CMD.select_count(tname, where) local sql = { "SELECT count(*) FROM", string.format("`%s`", tname), } if where and next(where) then table.insert(sql, "WHERE") for _, v in ipairs(where) do if type(v) == "table" then table.insert(sql, string.format("%s%s", TS(v[1]), QS(v[2]))) else table.insert(sql, TS(v)) end end end local sql = table.concat(sql, " ") local res = _db:query(sql) if res.err then return res.err .. sql, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res[1]["count(*)"] end function CMD.insert(tname, data, exc) local tk = {} local tv = {} for k, v in pairs(data) do table.insert(tk, string.format("`%s`", TS(k))) table.insert(tv, QS(v)) end local t = { "INSERT INTO", string.format("`%s`", tname), "(", table.concat(tk, ","), ")", "VALUES", "(", table.concat(tv, ","), ")", ";", exc, } local sql = table.concat(t, " ") local res = _db:query(sql) if res.err then return res.err .. sql, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res end function CMD.replace(tname, data, exc) local tk = {} local tv = {} for k, v in pairs(data) do table.insert(tk, string.format("`%s`", k)) table.insert(tv, QS(v)) end local t = { "REPLACE INTO", string.format("`%s`", tname), "(", table.concat(tk, ","), ")", "VALUES", "(", table.concat(tv, ","), ")", ";", exc, } local sql = table.concat(t, " ") local res = _db:query(sql) if res.err then return res.err .. sql, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res end function CMD.update(tname, fields, where, exc) local values = {} for k, v in pairs(fields) do table.insert(values, string.format("%s=%s", TS(k), QS(v))) end local sql = { "UPDATE", tname, "SET", table.concat(values, ","), } if where and next(where) then table.insert(sql, "WHERE") for _, v in ipairs(where) do if type(v) == "table" then table.insert(sql, string.format("%s%s", TS(v[1]), QS(v[2]))) else table.insert(sql, TS(v)) end end end if exc then table.insert(sql, TS(exc)) end local sql = table.concat(sql, " ") local res = _db:query(sql) if res.err then return res.err .. sql, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res end function CMD.delete(tname, where, exc) local sql = { "DELETE FROM", tname } if where and next(where) then table.insert(sql, "WHERE") for _, v in ipairs(where) do if type(v) == "table" then table.insert(sql, string.format("%s%s", TS(v[1]), QS(v[2]))) else table.insert(sql, TS(v)) end end end if exc then table.insert(sql, TS(exc)) end local sql = table.concat(sql, " ") local res = _db:query(sql) if res.err then return res.err, ex_log.error("sql err:", res.err, sql) end return NO_ERR, res end function CMD.connect(config_, dbname_) local config = { host = config_.host or "127.0.0.1", port = config_.port or 3306, user = config_.user or "root", password = config_.password or "", database = dbname_, on_connect = function(db_) _db = db_ skynet.error("mysql connected:", dbname_) end, } _dbname = dbname_ skynet.error("connecting mysql:", config.host, config.port, config.database) _db = mysql.connect(config) end skynet.start(function() skynet.timeout(5000, db_heart) skynet.dispatch("lua", function(session, source, cmd, ...) assert(CMD[cmd], cmd) return skynet.retpack(CMD[cmd](...)) end) end)
-- TODO: Consider contributing this to Roact itself local Packages = script.Parent.Parent local Roact = require(Packages.Roact) --[[ Passed a provided ref to given render callback. Can be used to treat class components as host components and assign the passed-in ref to the underlying host component ]] local function forwardRef(render) local ForwardRefComponent = Roact.Component:extend("ForwardRefContainer") function ForwardRefComponent:init() self.defaultRef = Roact.createRef() end function ForwardRefComponent:render() return render(self.props, self.props[Roact.Ref] or self.defaultRef) end return ForwardRefComponent end return forwardRef
local bmp = require( "bitmap" ) local test = require( "test" ) local reference = bmp.open( test.get_resource_file( "reference.bmp" ) ) local tests = {} function tests.blit() local dst = bmp.create( 10, 10, 0xFFFF0000 ) local src1 = bmp.create( 4, 4, 0xFF00FF00 ) local src2 = bmp.create( 4, 4, 0xFF0000FF ) -- Center bmp.blit( dst, 4, 4, src1 ) -- Partial verlap bmp.blit( dst, -2, -2, src1 ) bmp.blit( dst, -2, 9, src1 ) bmp.blit( dst, 9, 9, src1 ) bmp.blit( dst, 9, -2, src1 ) if not test.is_same_bitmap( reference, dst ) then bmp.save( dst, test.get_results_file( "blit_partial_overlap.bmp" ), "RGB24" ) end -- No overlap bmp.blit( dst, 11, 1, src2 ) bmp.blit( dst, 1, 11, src2 ) bmp.blit( dst, -4, 1, src2 ) bmp.blit( dst, 1, -4, src2 ) if not test.is_same_bitmap( reference, dst ) then bmp.save( dst, test.get_results_file( "blit_no_overlap.bmp" ), "RGB24" ) end end local function _fill_vp( vp, color ) for y = 1, #vp do local row = vp[ y ] for x = 1, #row do row[ x ] = color end end end function tests.modify_via_viewport() local dst = bmp.create( 10, 10, 0xFFFF0000 ) local vp1 = bmp.make_viewport( dst, 4, 4, 4, 4 ) -- center local vp2 = bmp.make_viewport( dst, 1, 1, 2, 2 ) -- ll local vp3 = bmp.make_viewport( dst, 1, 9, 2, 2 ) -- ul local vp4 = bmp.make_viewport( dst, 9, 9, 2, 2 ) -- ur local vp5 = bmp.make_viewport( dst, 9, 1, 2, 2 ) -- lr _fill_vp( vp1, 0xFF00FF00 ) _fill_vp( vp2, 0xFF00FF00 ) _fill_vp( vp3, 0xFF00FF00 ) _fill_vp( vp4, 0xFF00FF00 ) _fill_vp( vp5, 0xFF00FF00 ) if not test.is_same_bitmap( reference, dst ) then bmp.save( dst, test.get_results_file( "modify_via_viewport.bmp" ), "RGB24" ) end end function tests.save_viewport_content() local dst = bmp.create( 12, 12, 0xFFFF0000 ) local src = bmp.create( 4, 4, 0xFF00FF00 ) bmp.blit( dst, 5, 5, src ) bmp.blit( dst, -1, -1, src ) bmp.blit( dst, -1, 10, src ) bmp.blit( dst, 10, 10, src ) bmp.blit( dst, 10, -1, src ) local vp = bmp.make_viewport( dst, 2, 2, 10, 10 ) if not test.is_same_bitmap( reference, vp ) then bmp.save( vp, test.get_results_file( "save_viewport_content.bmp" ), "RGB24" ) end end function test.iterate_pixels() local pixel_count = 0 local pixels = bmp.pixels( reference ) test.is_same( #pixels, reference:width() * reference:height() ) for i = 1, #pixels do test.is_not_nil( pixels[ i ] ) end end function test.iterate_pixels_ipairs() for i, pixel in ipairs( reference:pixels() ) do test.is_not_nil( pixel ) end end return tests
-- http://127.0.0.1/test/cgilua/lfi3.lua?file=c:\boot.ini%00 local file = cgilua.QUERY.file if file ~= nil then cgilua.handlelp(file..".lp") end
WireToolSetup.setCategory( "Physics/Force" ) WireToolSetup.open( "hoverball", "Hoverball", "gmod_wire_hoverball", nil, "Hoverballs" ) if CLIENT then language.Add( "tool.wire_hoverball.name", "Wired Hoverball Tool" ) language.Add( "tool.wire_hoverball.desc", "Spawns a hoverball for use with the wire system." ) language.Add( "tool.wire_hoverball.0", "Primary: Create/Update Hoverball" ) language.Add( "tool.wire_hoverball.starton", "Create with hover mode on" ) end WireToolSetup.BaseLang("Hoverballs") WireToolSetup.SetupMax( 30 ) TOOL.ClientConVar = { model = "models/dav0r/hoverball.mdl", speed = 1, resistance = 0, strength = 1, starton = 1, } if SERVER then function TOOL:GetConVars() return self:GetClientNumber( "speed" ), math.Clamp(self:GetClientNumber( "resistance" ), 0, 20), math.Clamp(self:GetClientNumber( "strength" ), 0.1, 20), self:GetClientNumber( "starton" ) == 1 end end function TOOL:GetAngle(trace) return Angle(0, 0, 0) end function TOOL:GetGhostMin( min, trace ) if trace.Entity:IsWorld() then return -8 end return 0 end function TOOL.BuildCPanel(panel) WireToolHelpers.MakePresetControl(panel, "wire_hoverball") WireDermaExts.ModelSelect(panel, "wire_hoverball_model", list.Get("HoverballModels"), 2, true) panel:NumSlider("#Movement Speed", "wire_hoverball_speed", 1, 10, 0) panel:NumSlider("#Air Resistance", "wire_hoverball_resistance", 1, 20, 0) panel:NumSlider("#Strength", "wire_hoverball_strength", .1, 20, 2) panel:CheckBox("#tool.wire_hoverball.starton", "wire_hoverball_starton") end
-- Copyright (C) 2018 The Dota IMBA Development Team -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. -- -- Editors: -- Firetoad -- Moujiozi -- EarthSalamander #42 -- suthernfriend -- --------------------------------------------------------------------------------------------------- -- Barebones basics ------------------------------------------------------------------------------------------------- USE_TEAM_COURIER = true PICKING_SCREEN_OVER = false ENABLE_HERO_RESPAWN = true -- Should the heroes automatically respawn on a timer or stay dead until manually respawned UNIVERSAL_SHOP_MODE = false -- Should the main shop contain Secret Shop items as well as regular items if IsInToolsMode() then UNIVERSAL_SHOP_MODE = true end AP_GAME_TIME = 60.0 -- How long should we let people select their hero? CAPTAINS_MODE_CAPTAIN_TIME = 20 -- how long players have to claim the captain chair CAPTAINS_MODE_PICK_BAN_TIME = 30 -- how long you have to do each pick/ban CAPTAINS_MODE_HERO_PICK_TIME = 30 -- time to choose which hero you're going to play CAPTAINS_MODE_RESERVE_TIME = 130 -- total bonus time that can be used throughout any selection PRE_GAME_TIME = 90.0 if GetMapName() == "cavern" then PRE_GAME_TIME = 30.0 end PRE_GAME_TIME = PRE_GAME_TIME + AP_GAME_TIME -- How long after people select their heroes should the horn blow and the game start? POST_GAME_TIME = 600.0 -- How long should we let people look at the scoreboard before closing the server automatically? AUTO_LAUNCH_DELAY = 5.0 -- How long should we wait for the host to setup the game, after all players have loaded in? if IsFranticMap() then AUTO_LAUNCH_DELAY = 10.0 end TREE_REGROW_TIME = 180.0 -- How long should it take individual trees to respawn after being cut down/destroyed? SHOWCASE_TIME = 0.0 -- How long should showcase time last? STRATEGY_TIME = 0.0 -- How long should strategy time last? GOLD_PER_TICK = 1 -- How much gold should players get per tick? RECOMMENDED_BUILDS_DISABLED = false -- Should we disable the recommened builds for heroes MINIMAP_ICON_SIZE = 1 -- What icon size should we use for our heroes? MINIMAP_CREEP_ICON_SIZE = 1 -- What icon size should we use for creeps? MINIMAP_RUNE_ICON_SIZE = 1 -- What icon size should we use for runes? RUNE_SPAWN_TIME = 120 -- How long in seconds should we wait between rune spawns? BOUNTY_RUNE_SPAWN_TIME = 300 CUSTOM_BUYBACK_COST_ENABLED = true -- Should we use a custom buyback cost setting? CUSTOM_BUYBACK_COOLDOWN_ENABLED = true -- Should we use a custom buyback time? BUYBACK_ENABLED = true -- Should we allow people to buyback when they die? -- Note: DISABLE_FOG_OF_WAR_ENTIRELY must be false for USE_UNSEEN_FOG_OF_WAR to work USE_STANDARD_DOTA_BOT_THINKING = false -- Should we have bots act like they would in Dota? (This requires 3 lanes, normal items, etc) USE_NONSTANDARD_HERO_GOLD_BOUNTY = false -- Should heroes follow their own gold bounty rules instead of the default DOTA ones? USE_NONSTANDARD_HERO_XP_BOUNTY = true -- Should heroes follow their own XP bounty rules instead of the default DOTA ones? USE_CUSTOM_TOP_BAR_VALUES = false -- Should we do customized top bar values or use the default kill count per team? TOP_BAR_VISIBLE = true -- Should we display the top bar score/count at all? ENABLE_TOWER_BACKDOOR_PROTECTION = true -- Should we enable backdoor protection for our towers? REMOVE_ILLUSIONS_ON_DEATH = false -- Should we remove all illusions if the main hero dies? DISABLE_GOLD_SOUNDS = false -- Should we disable the gold sound when players get gold? ENABLE_FIRST_BLOOD = true -- Should we enable first blood for the first kill in this game? HIDE_KILL_BANNERS = false -- Should we hide the kill banners that show when a player is killed? LOSE_GOLD_ON_DEATH = true -- Should we have players lose the normal amount of dota gold on death? FORCE_PICKED_HERO = "npc_dota_hero_dummy_dummy" -- What hero should we force all players to spawn as? (e.g. "npc_dota_hero_axe"). Use nil to allow players to pick their own hero. FIXED_RESPAWN_TIME = -1 -- What time should we use for a fixed respawn timer? Use -1 to keep the default dota behavior. FOUNTAIN_CONSTANT_MANA_REGEN = 14 -- What should we use for the constant fountain mana regen? Use -1 to keep the default dota behavior. FOUNTAIN_PERCENTAGE_MANA_REGEN = 6 -- What should we use for the percentage fountain mana regen? Use -1 to keep the default dota behavior. FOUNTAIN_PERCENTAGE_HEALTH_REGEN = 6 -- What should we use for the percentage fountain health regen? Use -1 to keep the default dota behavior. MAXIMUM_ATTACK_SPEED = 1000 -- What should we use for the maximum attack speed? MINIMUM_ATTACK_SPEED = 0 -- What should we use for the minimum attack speed? DOTA_MAX_PLAYERS = 24 -- Maximum amount of players allowed in a game ------------------------------------------------------------------------------------------------- -- IMBA: gameplay globals ------------------------------------------------------------------------------------------------- BUYBACK_COOLDOWN_ENABLED = true -- Is the buyback cooldown enabled? BUYBACK_BASE_COST = 100 -- Base cost to buyback BUYBACK_COST_PER_LEVEL = 1.25 -- Level-based buyback cost BUYBACK_COST_PER_LEVEL_AFTER_25 = 20 -- Level-based buyback cost growth after level 25 BUYBACK_COST_PER_SECOND = 0.25 -- Time-based buyback cost BUYBACK_COOLDOWN_START_POINT = 600 -- Game time (in seconds) after which buyback cooldown is activated BUYBACK_COOLDOWN_GROW_FACTOR = 0.167 -- Buyback cooldown increase per second BUYBACK_COOLDOWN_MAXIMUM = 360 -- Maximum buyback cooldown ABANDON_TIME = 180 -- Time for a player to be considered as having abandoned the game (in seconds) FULL_ABANDON_TIME = 15 -- Time for a team to be considered as having abandoned the game (in seconds) GAME_ROSHAN_KILLS = 0 -- Tracks amount of Roshan kills ROSHAN_RESPAWN_TIME = RandomInt(2, 4) * 60 -- Roshan respawn timer (in seconds) AEGIS_DURATION = 300 -- Aegis expiration timer (in seconds) IMBA_DAMAGE_EFFECTS_DISTANCE_CUTOFF = 2500 -- Range at which most on-damage effects no longer trigger COMEBACK_BOUNTY_SCORE = {} -- Extra comeback gold based on hero and tower kills COMEBACK_BOUNTY_SCORE[DOTA_TEAM_GOODGUYS] = 0 COMEBACK_BOUNTY_SCORE[DOTA_TEAM_BADGUYS] = 0 COMEBACK_BOUNTY_BONUS = {} -- Extra comeback gold based on hero and tower kills COMEBACK_BOUNTY_BONUS[DOTA_TEAM_GOODGUYS] = 0 COMEBACK_BOUNTY_BONUS[DOTA_TEAM_BADGUYS] = 0 COMEBACK_EXP_BONUS = 100 -- Hero respawn time per leve -- Formula: (42/srqt(50)) * (-1*(50-sqrt(lvl))+50) HERO_RESPAWN_TIME_PER_LEVEL = {} HERO_RESPAWN_TIME_PER_LEVEL[1] = 5 HERO_RESPAWN_TIME_PER_LEVEL[2] = 10 HERO_RESPAWN_TIME_PER_LEVEL[3] = 13 HERO_RESPAWN_TIME_PER_LEVEL[4] = 15 HERO_RESPAWN_TIME_PER_LEVEL[5] = 18 HERO_RESPAWN_TIME_PER_LEVEL[6] = 20 HERO_RESPAWN_TIME_PER_LEVEL[7] = 22 HERO_RESPAWN_TIME_PER_LEVEL[8] = 24 HERO_RESPAWN_TIME_PER_LEVEL[9] = 25 HERO_RESPAWN_TIME_PER_LEVEL[10] = 27 HERO_RESPAWN_TIME_PER_LEVEL[11] = 29 HERO_RESPAWN_TIME_PER_LEVEL[12] = 30 HERO_RESPAWN_TIME_PER_LEVEL[13] = 32 HERO_RESPAWN_TIME_PER_LEVEL[14] = 33 HERO_RESPAWN_TIME_PER_LEVEL[15] = 34 HERO_RESPAWN_TIME_PER_LEVEL[16] = 35 HERO_RESPAWN_TIME_PER_LEVEL[17] = 37 HERO_RESPAWN_TIME_PER_LEVEL[18] = 38 HERO_RESPAWN_TIME_PER_LEVEL[19] = 39 HERO_RESPAWN_TIME_PER_LEVEL[20] = 40 HERO_RESPAWN_TIME_PER_LEVEL[21] = 41 HERO_RESPAWN_TIME_PER_LEVEL[22] = 42 HERO_RESPAWN_TIME_PER_LEVEL[23] = 43 HERO_RESPAWN_TIME_PER_LEVEL[24] = 44 HERO_RESPAWN_TIME_PER_LEVEL[25] = 45 HERO_RESPAWN_TIME_PER_LEVEL[26] = 46 HERO_RESPAWN_TIME_PER_LEVEL[27] = 47 HERO_RESPAWN_TIME_PER_LEVEL[28] = 48 HERO_RESPAWN_TIME_PER_LEVEL[29] = 49 HERO_RESPAWN_TIME_PER_LEVEL[30] = 50 HERO_RESPAWN_TIME_PER_LEVEL[31] = 51 HERO_RESPAWN_TIME_PER_LEVEL[32] = 52 HERO_RESPAWN_TIME_PER_LEVEL[33] = 53 HERO_RESPAWN_TIME_PER_LEVEL[34] = 54 HERO_RESPAWN_TIME_PER_LEVEL[35] = 55 HERO_RESPAWN_TIME_PER_LEVEL[36] = 55 HERO_RESPAWN_TIME_PER_LEVEL[37] = 56 HERO_RESPAWN_TIME_PER_LEVEL[38] = 57 HERO_RESPAWN_TIME_PER_LEVEL[39] = 58 HERO_RESPAWN_TIME_PER_LEVEL[40] = 59 HERO_RESPAWN_TIME_PER_LEVEL[41] = 60 HERO_RESPAWN_TIME_PER_LEVEL[42] = 60 ------------------------------------------------------------------------------------------------- -- IMBA: map-based settings ------------------------------------------------------------------------------------------------- MAX_NUMBER_OF_TEAMS = 2 -- How many potential teams can be in this game mode? IMBA_PLAYERS_ON_GAME = 10 -- Number of players in the game USE_CUSTOM_TEAM_COLORS = false -- Should we use custom team colors? USE_CUSTOM_TEAM_COLORS_FOR_PLAYERS = false -- Should we use custom team colors to color the players/minimap? PLAYER_COLORS = {} -- Stores individual player colors PLAYER_COLORS[0] = { 67, 133, 255 } PLAYER_COLORS[1] = { 170, 255, 195 } PLAYER_COLORS[2] = { 130, 0, 150 } PLAYER_COLORS[3] = { 255, 234, 0 } PLAYER_COLORS[4] = { 255, 153, 0 } PLAYER_COLORS[5] = { 190, 255, 0 } PLAYER_COLORS[6] = { 255, 0, 0 } PLAYER_COLORS[7] = { 0, 128, 128 } PLAYER_COLORS[8] = { 255, 250, 200 } PLAYER_COLORS[9] = { 49, 49, 49 } PLAYER_COLORS[10] = { 255, 0, 255 } PLAYER_COLORS[11] = { 128, 128, 0 } PLAYER_COLORS[12] = { 100, 255, 255 } PLAYER_COLORS[13] = { 0, 190, 0 } PLAYER_COLORS[14] = { 170, 110, 40 } PLAYER_COLORS[15] = { 0, 0, 128 } PLAYER_COLORS[16] = { 230, 190, 255 } PLAYER_COLORS[17] = { 128, 0, 0 } PLAYER_COLORS[18] = { 144, 144, 144 } PLAYER_COLORS[19] = { 254, 254, 254 } PLAYER_COLORS[20] = { 166, 166, 166 } PLAYER_COLORS[21] = { 255, 89, 255 } PLAYER_COLORS[22] = { 203, 255, 89 } PLAYER_COLORS[23] = { 108, 167, 255 } USE_AUTOMATIC_PLAYERS_PER_TEAM = false -- Should we set the number of players to 10 / MAX_NUMBER_OF_TEAMS? TEAM_COLORS = {} -- If USE_CUSTOM_TEAM_COLORS is set, use these colors. TEAM_COLORS[DOTA_TEAM_GOODGUYS] = { 61, 210, 150 } -- Teal TEAM_COLORS[DOTA_TEAM_BADGUYS] = { 243, 201, 9 } -- Yellow CUSTOM_TEAM_PLAYER_COUNT = {} CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 5 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 5 if GetMapName() == "imba_1v1" then IMBA_PLAYERS_ON_GAME = 2 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 1 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 1 IMBA_1V1_SCORE = 3 PRE_GAME_TIME = 30.0 + AP_GAME_TIME elseif GetMapName() == "imba_ranked_10v10" or GetMapName() == "imba_frantic_10v10" or GetMapName() == "imba_mutation_10v10" then IMBA_PLAYERS_ON_GAME = 20 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 10 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 10 elseif GetMapName() == "imba_12v12" then IMBA_PLAYERS_ON_GAME = 24 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 12 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 12 elseif GetMapName() == "imba_overthrow" then require("libraries/overthrow/items") PRE_GAME_TIME = 20.0 + AP_GAME_TIME UNIVERSAL_SHOP_MODE = true FIXED_RESPAWN_TIME = 10 MAX_NUMBER_OF_TEAMS = 4 IMBA_PLAYERS_ON_GAME = 16 USE_CUSTOM_TEAM_COLORS = true -- Should we use custom team colors? USE_CUSTOM_TEAM_COLORS_FOR_PLAYERS = true -- Should we use custom team colors to color the players/minimap? TEAM_COLORS[DOTA_TEAM_GOODGUYS] = { 61, 210, 150 } -- Teal TEAM_COLORS[DOTA_TEAM_BADGUYS] = { 243, 201, 9 } -- Yellow TEAM_COLORS[DOTA_TEAM_CUSTOM_1] = { 197, 77, 168 } -- Pink TEAM_COLORS[DOTA_TEAM_CUSTOM_2] = { 255, 108, 0 } -- Orange m_GoldRadiusMin = 250 m_GoldRadiusMax = 550 m_GoldDropPercent = 4 nNextSpawnItemNumber = 1 spawnTime = 120 leadingTeam = -1 runnerupTeam = -1 leadingTeamScore = 0 OVERTHROW_CAMP_NUMBER = 5 CLOSE_TO_VICTORY_THRESHOLD = 5 hasWarnedSpawn = false allSpawned = false countdownEnabled = false isGameTied = false itemSpawnIndex = 1 itemSpawnLocation = Entities:FindByName( nil, "greevil" ) tier1ItemBucket = {} tier2ItemBucket = {} tier3ItemBucket = {} tier4ItemBucket = {} m_VictoryMessages = {} m_VictoryMessages[DOTA_TEAM_GOODGUYS] = "#VictoryMessage_GoodGuys" m_VictoryMessages[DOTA_TEAM_BADGUYS] = "#VictoryMessage_BadGuys" m_VictoryMessages[DOTA_TEAM_CUSTOM_1] = "#VictoryMessage_Custom1" m_VictoryMessages[DOTA_TEAM_CUSTOM_2] = "#VictoryMessage_Custom2" m_GatheredShuffledTeams = {} -- if PlayerResource:GetPlayerCount() > 7 then TEAM_KILLS_TO_WIN = 50 nCOUNTDOWNTIMER = 901 -- elseif PlayerResource:GetPlayerCount() > 4 and PlayerResource:GetPlayerCount() <= 7 then -- TEAM_KILLS_TO_WIN = 20 -- nCOUNTDOWNTIMER = 721 -- else -- TEAM_KILLS_TO_WIN = 15 -- nCOUNTDOWNTIMER = 601 -- end CustomNetTables:SetTableValue( "game_state", "victory_condition", { kills_to_win = TEAM_KILLS_TO_WIN } ); elseif GetMapName() == "cavern" then IMBA_PLAYERS_ON_GAME = 24 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_GOODGUYS] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_BADGUYS] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_CUSTOM_1] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_CUSTOM_2] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_CUSTOM_3] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_CUSTOM_4] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_CUSTOM_5] = 3 CUSTOM_TEAM_PLAYER_COUNT[DOTA_TEAM_CUSTOM_6] = 3 end ------------------------------------------------------------------------------------------------- -- IMBA: game mode globals ------------------------------------------------------------------------------------------------- GAME_WINNER_TEAM = 0 -- Tracks game winner GG_TEAM = {} GG_TEAM[2] = 0 GG_TEAM[3] = 0 if IsFranticMap() then IMBA_FRANTIC_MODE_ON = true else IMBA_FRANTIC_MODE_ON = false end _G.IMBA_FRANTIC_VALUE = 50 IMBA_PICK_MODE_ALL_PICK = true -- Activates All Pick mode when true IMBA_PICK_MODE_ALL_RANDOM = false -- Activates All Random mode when true IMBA_PICK_MODE_ALL_RANDOM_SAME_HERO = false -- Activates All Random Same Hero mode when true IMBA_ALL_RANDOM_HERO_SELECTION_TIME = 5.0 -- Time we need to wait before the game starts when all heroes are randomed -- Global Gold earning, values are doubled with Hyper for non-custom maps CUSTOM_GOLD_BONUS = {} -- 1 = Normal, 2 = Hyper CUSTOM_GOLD_BONUS["imba_1v1"] = 250 CUSTOM_GOLD_BONUS["imba_overthrow"] = 250 CUSTOM_GOLD_BONUS["imba_ranked_5v5"] = 250 CUSTOM_GOLD_BONUS["imba_ranked_10v10"] = 250 CUSTOM_GOLD_BONUS["imba_tournament"] = 250 CUSTOM_GOLD_BONUS["imba_mutation_5v5"] = 400 CUSTOM_GOLD_BONUS["imba_mutation_10v10"] = 400 CUSTOM_GOLD_BONUS["imba_frantic_5v5"] = 400 CUSTOM_GOLD_BONUS["imba_frantic_10v10"] = 400 CUSTOM_GOLD_BONUS["cavern"] = 200 -- Global XP earning, values are doubled with Hyper for non-custom maps (right now this is not used anymore, but i'll keep it there just in case) CUSTOM_XP_BONUS = {} -- 1 = Normal, 2 = Hyper CUSTOM_XP_BONUS["imba_1v1"] = 200 CUSTOM_XP_BONUS["imba_overthrow"] = 200 CUSTOM_XP_BONUS["imba_ranked_5v5"] = 200 CUSTOM_XP_BONUS["imba_ranked_10v10"] = 200 CUSTOM_XP_BONUS["imba_tournament"] = 200 CUSTOM_XP_BONUS["imba_mutation_5v5"] = 200 CUSTOM_XP_BONUS["imba_mutation_10v10"] = 200 CUSTOM_XP_BONUS["imba_frantic_5v5"] = 200 CUSTOM_XP_BONUS["imba_frantic_10v10"] = 200 CUSTOM_XP_BONUS["cavern"] = 100 -- Hero base level, values are doubled with Hyper for non-custom maps HERO_STARTING_LEVEL = {} -- 1 = Normal, 2 = Hyper HERO_STARTING_LEVEL["imba_1v1"] = 1 HERO_STARTING_LEVEL["imba_overthrow"] = 1 HERO_STARTING_LEVEL["imba_ranked_5v5"] = 1 HERO_STARTING_LEVEL["imba_ranked_10v10"] = 1 HERO_STARTING_LEVEL["imba_tournament"] = 1 HERO_STARTING_LEVEL["imba_mutation_5v5"] = 3 HERO_STARTING_LEVEL["imba_mutation_10v10"] = 3 HERO_STARTING_LEVEL["imba_frantic_5v5"] = 5 HERO_STARTING_LEVEL["imba_frantic_10v10"] = 5 HERO_STARTING_LEVEL["cavern"] = 1 MAX_LEVEL = {} MAX_LEVEL["imba_1v1"] = 42 MAX_LEVEL["imba_overthrow"] = 42 MAX_LEVEL["imba_ranked_5v5"] = 42 MAX_LEVEL["imba_ranked_10v10"] = 42 MAX_LEVEL["imba_tournament"] = 42 MAX_LEVEL["imba_mutation_5v5"] = 42 MAX_LEVEL["imba_mutation_10v10"] = 42 MAX_LEVEL["imba_frantic_5v5"] = 42 MAX_LEVEL["imba_frantic_10v10"] = 42 MAX_LEVEL["cavern"] = 42 HERO_INITIAL_GOLD = {} HERO_INITIAL_GOLD["imba_1v1"] = 1200 HERO_INITIAL_GOLD["imba_overthrow"] = 1200 HERO_INITIAL_GOLD["imba_ranked_5v5"] = 1200 HERO_INITIAL_GOLD["imba_ranked_10v10"] = 1200 HERO_INITIAL_GOLD["imba_tournament"] = 1200 HERO_INITIAL_GOLD["imba_mutation_5v5"] = 2000 HERO_INITIAL_GOLD["imba_mutation_10v10"] = 2000 HERO_INITIAL_GOLD["imba_frantic_5v5"] = 4000 HERO_INITIAL_GOLD["imba_frantic_10v10"] = 4000 HERO_INITIAL_GOLD["cavern"] = 1200 GOLD_TICK_TIME = {} GOLD_TICK_TIME["imba_1v1"] = 0.6 GOLD_TICK_TIME["imba_overthrow"] = 0.6 GOLD_TICK_TIME["imba_ranked_5v5"] = 0.6 GOLD_TICK_TIME["imba_ranked_10v10"] = 0.4 GOLD_TICK_TIME["imba_tournament"] = 0.6 GOLD_TICK_TIME["imba_mutation_5v5"] = 0.6 GOLD_TICK_TIME["imba_mutation_10v10"] = 0.4 GOLD_TICK_TIME["imba_frantic_5v5"] = 0.4 GOLD_TICK_TIME["imba_frantic_10v10"] = 0.4 GOLD_TICK_TIME["cavern"] = 9999.0 BANNED_ITEMS = {} BANNED_ITEMS["imba_1v1"] = { "item_imba_bottle", "item_infused_raindrop", "item_soul_ring", "item_tome_of_knowledge", } BANNED_ITEMS["imba_overthrow"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_ranked_5v5"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_ranked_10v10"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_tournament"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_mutation_5v5"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_mutation_10v10"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_frantic_5v5"] = { "item_cavern_dynamite", } BANNED_ITEMS["imba_frantic_10v10"] = { "item_cavern_dynamite", } BANNED_ITEMS["cavern"] = { "item_imba_aegis", "item_imba_bottle", "item_imba_hand_of_midas", "item_recipe_imba_hand_of_midas", "item_imba_heart", "item_helm_of_the_dominator", "item_smoke_of_deceit", "item_tome_of_knowledge", "item_tpscroll", "item_imba_blink", "item_imba_blink_boots", } REMAINING_GOODGUYS = 0 -- Remaining players on Radiant REMAINING_BADGUYS = 0 -- Remaining players on Dire ANCIENT_ABILITIES_LIST = {} -- Initializes the ancients' abilities list SPAWN_ANCIENT_BEHEMOTHS = true -- Should the ancients spawn behemoths? TOWER_ABILITIES = {} TOWER_ABILITIES["tower1"] = { "imba_tower_healing_tower", "imba_tower_tenacity", } TOWER_ABILITIES["tower2"] = { "imba_tower_healing_tower", "imba_tower_regeneration", "imba_tower_tenacity", "imba_tower_toughness", } TOWER_ABILITIES["tower3"] = { "imba_tower_healing_tower", "imba_tower_regeneration", "imba_tower_tenacity", "imba_tower_toughness", } TOWER_ABILITIES["tower4"] = { "imba_tower_healing_tower", "imba_tower_regeneration", "imba_tower_tenacity", "imba_tower_toughness", } MAP_INITIAL_GOLD = 0 -- Gold granted to players at the start of the game on a normal pick USE_CUSTOM_HERO_LEVELS = true -- Should we allow heroes to have custom levels? -- Update game mode net tables CustomNetTables:SetTableValue("game_options", "all_pick", {IMBA_PICK_MODE_ALL_PICK}) CustomNetTables:SetTableValue("game_options", "all_random", {IMBA_PICK_MODE_ALL_RANDOM}) CustomNetTables:SetTableValue("game_options", "all_random_same_hero", {IMBA_PICK_MODE_ALL_RANDOM_SAME_HERO}) CustomNetTables:SetTableValue("game_options", "frantic_mode", {IMBA_FRANTIC_MODE_ON}) CustomNetTables:SetTableValue("game_options", "gold_tick", {GOLD_TICK_TIME[GetMapName()]}) CustomNetTables:SetTableValue("game_options", "max_level", {MAX_LEVEL[GetMapName()]}) -- XP per level table (only active if custom hero levels are enabled) XP_PER_LEVEL_TABLE = {} -- Vanilla XP_PER_LEVEL_TABLE[1] = 0 -- +0 XP_PER_LEVEL_TABLE[2] = 200 -- +200 XP_PER_LEVEL_TABLE[3] = 600 -- +400 XP_PER_LEVEL_TABLE[4] = 1080 -- +480 XP_PER_LEVEL_TABLE[5] = 1680 -- +600 XP_PER_LEVEL_TABLE[6] = 2300 -- +620 XP_PER_LEVEL_TABLE[7] = 2940 -- +640 XP_PER_LEVEL_TABLE[8] = 3600 -- +660 XP_PER_LEVEL_TABLE[9] = 4280 -- +680 XP_PER_LEVEL_TABLE[10] = 5080 -- +800 XP_PER_LEVEL_TABLE[11] = 5900 -- +820 XP_PER_LEVEL_TABLE[12] = 6740 -- +840 XP_PER_LEVEL_TABLE[13] = 7640 -- +900 XP_PER_LEVEL_TABLE[14] = 8865 -- +1225 XP_PER_LEVEL_TABLE[15] = 10115 -- +1250 XP_PER_LEVEL_TABLE[16] = 11390 -- +1275 XP_PER_LEVEL_TABLE[17] = 12690 -- +1300 XP_PER_LEVEL_TABLE[18] = 14015 -- +1325 XP_PER_LEVEL_TABLE[19] = 15415 -- +1400 XP_PER_LEVEL_TABLE[20] = 16905 -- +1490 XP_PER_LEVEL_TABLE[21] = 18405 -- +1500 XP_PER_LEVEL_TABLE[22] = 20155 -- +1750 XP_PER_LEVEL_TABLE[23] = 22155 -- +2000 XP_PER_LEVEL_TABLE[24] = 24405 -- +2250 XP_PER_LEVEL_TABLE[25] = 26905 -- +2500 -- XP AWARDED per level table (how much bounty heroes are worth beyond level 25) HERO_XP_BOUNTY_PER_LEVEL = {} HERO_XP_BOUNTY_PER_LEVEL[1] = 125 HERO_XP_BOUNTY_PER_LEVEL[2] = 170 HERO_XP_BOUNTY_PER_LEVEL[3] = 215 HERO_XP_BOUNTY_PER_LEVEL[4] = 260 HERO_XP_BOUNTY_PER_LEVEL[5] = 305 HERO_XP_BOUNTY_PER_LEVEL[6] = 350 HERO_XP_BOUNTY_PER_LEVEL[7] = 395 for i = 8, 25 do HERO_XP_BOUNTY_PER_LEVEL[i] = HERO_XP_BOUNTY_PER_LEVEL[i-1] + 135 end for i = 26, 100 do HERO_XP_BOUNTY_PER_LEVEL[i] = HERO_XP_BOUNTY_PER_LEVEL[i-1] + 135 + i * 3 end USE_MEME_SOUNDS = true -- Should we use meme/fun sounds on abilities occasionally? BOTS_ENABLED = false ------------------------------------------------------------------------------------------------- -- IMBA: Test mode variables ------------------------------------------------------------------------------------------------- IMBA_TESTBED_INITIALIZED = false ------------------------------------------------------------------------------------------------- -- IMBA: Keyvalue tables ------------------------------------------------------------------------------------------------- PURGE_BUFF_LIST = LoadKeyValues("scripts/npc/KV/purge_buffs_list.kv") DISPELLABLE_DEBUFF_LIST = LoadKeyValues("scripts/npc/KV/dispellable_debuffs_list.kv") PLAYER_TEAM = {} DONATOR_COLOR = {} DONATOR_COLOR[1] = {160, 20, 20} DONATOR_COLOR[2] = {100, 20, 20} DONATOR_COLOR[3] = {0, 102, 255} DONATOR_COLOR[4] = {240, 50, 50} DONATOR_COLOR[5] = {218, 165, 32} DONATOR_COLOR[6] = {45, 200, 45} DONATOR_COLOR[7] = {47, 91, 151} DONATOR_COLOR[8] = {153, 51, 153} DONATOR_COLOR[9] = {255, 135, 42} IMBA_INVISIBLE_MODIFIERS = { "modifier_imba_moonlight_shadow_invis", "modifier_item_imba_shadow_blade_invis", "modifier_imba_vendetta", "modifier_nyx_assassin_burrow", "modifier_item_imba_silver_edge_invis", "modifier_item_glimmer_cape_fade", "modifier_weaver_shukuchi", "modifier_treant_natures_guise_invis", "modifier_templar_assassin_meld", "modifier_imba_skeleton_walk_dummy", "modifier_invoker_ghost_walk_self", "modifier_rune_invis", "modifier_imba_skeleton_walk_invis", "modifier_imba_riki_invisibility", "modifier_imba_shadow_walk_buff_invis", "modifier_imba_invisibility_rune", } IGNORE_FOUNTAIN_UNITS = { "npc_dota_elder_titan_ancestral_spirit", "npc_dummy_unit", "npc_dota_hero_dummy_dummy", "npc_imba_donator_companion", "npc_dota_wisp_spirit", } RESTRICT_FOUNTAIN_UNITS = { "npc_dota_unit_tombstone1", "npc_dota_unit_tombstone2", "npc_dota_unit_tombstone3", "npc_dota_unit_tombstone4", "npc_dota_unit_undying_zombie", "npc_dota_unit_undying_zombie_torso", "npc_imba_ember_spirit_remnant", "npc_imba_dota_stormspirit_remnant", "npc_dota_earth_spirit_stone", "npc_dota_tusk_frozen_sigil1", "npc_dota_tusk_frozen_sigil2", "npc_dota_tusk_frozen_sigil3", "npc_dota_tusk_frozen_sigil4", "imba_witch_doctor_death_ward", "npc_imba_techies_proximity_mine", "npc_imba_techies_proximity_mine_big_boom", "npc_imba_techies_stasis_trap", } MORPHLING_RESTRICTED_MODIFIERS = { "modifier_imba_riki_invisibility", "modifier_imba_ebb_and_flow_thinker", "modifier_imba_ebb_and_flow_tide_low", "modifier_imba_ebb_and_flow_tide_red", "modifier_imba_ebb_and_flow_tide_flood", "modifier_imba_ebb_and_flow_tide_high", "modifier_imba_ebb_and_flow_tide_wave", "modifier_imba_ebb_and_flow_tsunami", "modifier_imba_tidebringer", "modifier_imba_tidebringer_sword_particle", "modifier_imba_tidebringer_manual", "modifier_imba_tidebringer_slow", "modifier_imba_tidebringer_cleave_hit_target", } SHARED_NODRAW_MODIFIERS = { "modifier_item_shadow_amulet_fade", "modifier_monkey_king_tree_dance_hidden", "modifier_monkey_king_transform", "modifier_pangolier_gyroshell", "modifier_smoke_of_deceit", } IMBA_DONATOR_COMPANION = {} IMBA_DONATOR_COMPANION["76561198015161808"] = "npc_imba_donator_companion_cookies" IMBA_DONATOR_COMPANION["76561198094835750"] = "npc_imba_donator_companion_zonnoz" IMBA_DONATOR_COMPANION["76561198003571172"] = "npc_imba_donator_companion_baumi" IMBA_DONATOR_COMPANION["76561198014254115"] = "npc_imba_donator_companion_icefrog" IMBA_DONATOR_COMPANION["76561198014254115"] = "npc_imba_donator_companion_admiral_bulldog" IMBA_DONATOR_COMPANION["76561198021465788"] = "npc_imba_donator_companion_suthernfriend" IMBA_DONATOR_COMPANION["76561198073163389"] = "npc_imba_donator_companion_terdic" IMBA_DONATOR_COMPANION["76561197970766309"] = "npc_imba_donator_companion_hamahe" IMBA_DONATOR_COMPANION["76561193687456266"] = "npc_imba_donator_companion_exzas" -- IMBA_DONATOR_COMPANION["76561198330946475"] = "npc_imba_donator_companion_deadknight" IMBA_DONATOR_STATUE = {} IMBA_DONATOR_STATUE["76561198015161808"] = "npc_imba_donator_statue_cookies" IMBA_DONATOR_STATUE["76561193714760494"] = "npc_imba_donator_statue_acalia" IMBA_DONATOR_STATUE["76561193684594183"] = "npc_imba_donator_statue_lily" IMBA_DONATOR_STATUE["76561198021465788"] = "npc_imba_donator_statue_suthernfriend" IMBA_DONATOR_STATUE["76561193687456266"] = "npc_imba_donator_statue_exzas" IMBA_DONATOR_STATUE["76561198094835750"] = "npc_imba_donator_statue_zonnoz" -- IMBA_DONATOR_STATUE["76561198043254407"] = "npc_imba_donator_statue_tabisama" IMBA_DONATOR_STATUE["76561197980558838"] = "npc_imba_donator_statue_january0000" IMBA_DONATOR_STATUE["76561198073163389"] = "npc_imba_donator_statue_terdic" IMBA_DONATOR_STATUE["76561198077187165"] = "npc_imba_donator_statue_toc" IMBA_DONATOR_STATUE["76561198187809623"] = "npc_imba_donator_statue_oviakin" IMBA_DONATOR_STATUE["76561197970766309"] = "npc_imba_donator_statue_hamahe" -- IMBA_DONATOR_STATUE["76561198330946475"] = "npc_imba_donator_statue_deadknight" UNIT_EQUIPMENT = {} UNIT_EQUIPMENT["models/heroes/crystal_maiden/crystal_maiden.vmdl"] = { "models/heroes/crystal_maiden/crystal_maiden_staff.vmdl", "models/heroes/crystal_maiden/crystal_maiden_cuffs.vmdl", "models/heroes/crystal_maiden/crystal_maiden_cape.vmdl", "models/heroes/crystal_maiden/head_item.vmdl", "models/heroes/crystal_maiden/crystal_maiden_shoulders.vmdl", } UNIT_EQUIPMENT["models/heroes/crystal_maiden/crystal_maiden_arcana.vmdl"] = { "models/heroes/crystal_maiden/crystal_maiden_staff.vmdl", "models/heroes/crystal_maiden/crystal_maiden_cuffs.vmdl", "models/heroes/crystal_maiden/crystal_maiden_arcana_back.vmdl", "models/heroes/crystal_maiden/head_item.vmdl", "models/heroes/crystal_maiden/crystal_maiden_shoulders.vmdl", } UNIT_EQUIPMENT["models/heroes/shredder/shredder.vmdl"] = { "models/heroes/shredder/shredder_armor.vmdl", "models/heroes/shredder/shredder_blade.vmdl", "models/heroes/shredder/shredder_body.vmdl", "models/heroes/shredder/shredder_chainsaw.vmdl", "models/heroes/shredder/shredder_driver_hat.vmdl", "models/heroes/shredder/shredder_hook.vmdl", "models/heroes/shredder/shredder_shoulders.vmdl", } UNIT_EQUIPMENT["models/items/pudge/arcana/pudge_arcana_base.vmdl"] = { "models/items/pudge/blackdeath_offhand/blackdeath_offhand.vmdl", "models/items/pudge/blackdeath_head_s3/blackdeath_head_s3.vmdl", "models/items/pudge/immortal_arm/immortal_arm.vmdl", "models/items/pudge/scorching_talon/scorching_talon.vmdl", "models/items/pudge/doomsday_ripper_belt/doomsday_ripper_belt.vmdl", "models/items/pudge/pudge_deep_sea_abomination_arms/pudge_deep_sea_abomination_arms.vmdl", "models/items/pudge/arcana/pudge_arcana_back.vmdl", } UNIT_EQUIPMENT["models/heroes/huskar/huskar.vmdl"] = { "models/items/huskar/searing_dominator/searing_dominator.vmdl", "models/heroes/huskar/huskar_bracer.vmdl", "models/heroes/huskar/huskar_dagger.vmdl", "models/heroes/huskar/huskar_shoulder.vmdl", "models/heroes/huskar/huskar_spear.vmdl", } UNIT_EQUIPMENT["models/heroes/rubick/rubick.vmdl"] = { "models/items/rubick/force_staff/force_staff.vmdl", "models/items/rubick/kuroky_rubick_back/kuroky_rubick_back.vmdl", "models/items/rubick/kuroky_rubick_shoulders/kuroky_rubick_shoulders.vmdl", "models/items/rubick/kuroky_rubick_weapon/kuroky_rubick_weapon.vmdl", "models/items/rubick/rubick_kuroky_head/rubick_kuroky_head.vmdl", } IMBA_DISABLED_SKULL_BASHER = { "npc_dota_hero_faceless_void", "npc_dota_hero_slardar", "npc_dota_hero_spirit_breaker", "npc_dota_hero_troll_warlord", }
-- This file uses models and textures taken from TomTom. The 3d arrow model was created by Guillotine (curse.guillotine@gmail.com) and 2d minimap textures by Cladhaire. ---------------------------- -- Initialize variables -- ---------------------------- -- globals DBM.Arrow = {} -- locals local arrowFrame = DBM.Arrow local runAwayArrow local targetType local targetPlayer local targetX, targetY, targetMapId local hideTime, hideDistance -- cached variables local pi, pi2 = math.pi, math.pi * 2 local floor = math.floor local sin, cos, atan2, sqrt, min = math.sin, math.cos, math.atan2, math.sqrt, math.min local UnitPosition = UnitPosition local GetTime = GetTime -------------------- -- Create Frame -- -------------------- local frame = CreateFrame("Button", "DBMArrow", UIParent) frame:Hide() frame:SetFrameStrata("HIGH") frame:SetWidth(56) frame:SetHeight(42) frame:SetMovable(true) frame:EnableMouse(false) frame:RegisterForDrag("LeftButton", "RightButton") frame:SetScript("OnDragStart", function(self) self:StartMoving() end) frame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() local point, _, _, x, y = self:GetPoint(1) DBM.Options.ArrowPoint = point DBM.Options.ArrowPosX = x DBM.Options.ArrowPosY = y end) local arrow = frame:CreateTexture(nil, "OVERLAY") arrow:SetTexture("Interface\\AddOns\\DBM-Core\\textures\\arrows\\Arrow.blp") arrow:SetAllPoints(frame) --------------------- -- Map Utilities -- --------------------- local calculateDistance do function calculateDistance(x1, y1, x2, y2) local dX = x1 - x2 local dY = y1 - y2 return sqrt(dX * dX + dY * dY) end end -- GetPlayerFacing seems to return values between -pi and pi instead of 0 - 2pi sometimes since 3.3.3 local GetPlayerFacing = function(...) local result = GetPlayerFacing(...) if result < 0 then result = result + pi2 end return result end ------------------------ -- Update the arrow -- ------------------------ local updateArrow do local currentCell function updateArrow(direction, distance) local cell = floor(direction / pi2 * 108 + 0.5) % 108 if cell ~= currentCell then currentCell = cell local column = cell % 9 local row = floor(cell / 9) local xStart = (column * 56) / 512 local yStart = (row * 42) / 512 local xEnd = ((column + 1) * 56) / 512 local yEnd = ((row + 1) * 42) / 512 arrow:SetTexCoord(xStart, xEnd, yStart, yEnd) end if distance then if runAwayArrow then local perc = distance / hideDistance arrow:SetVertexColor(1 - perc, perc, 0) if distance >= hideDistance then frame:Hide() end else local perc = min(distance, 100) / 100 arrow:SetVertexColor(1, 1 - perc, 0) if distance <= hideDistance then frame:Hide() end end else if runAwayArrow then arrow:SetVertexColor(1, 0.3, 0) else arrow:SetVertexColor(1, 1, 0) end end end end ------------------------ -- OnUpdate Handler -- ------------------------ do local rotateState = 0 -- local skipFrame -- todo: skipping frames makes the arrow laggy, maybe skip frames if frame rate >= 45 frame:SetScript("OnUpdate", function(self, elapsed) -- skipFrame = not skipFrame -- if skipFrame then -- return -- end if hideTime and GetTime() > hideTime then frame:Hide() end arrow:Show() -- the static arrow type is special because it doesn't depend on the player's orientation or position if targetType == "static" then return updateArrow(targetX) -- targetX contains the static angle to show end local x, y, _, mapId = UnitPosition("player") if targetType == "player" then targetX, targetY, _, targetMapId = UnitPosition(targetPlayer) if not targetX or mapId ~= targetMapId then self:Hide() -- hide the arrow if the target doesn't exist. TODO: just hide the texture and add a timeout end elseif targetType == "rotate" then rotateState = rotateState + elapsed targetX = x + cos(rotateState) targetY = y + sin(rotateState) end if not targetX or not targetY then return end local angle = atan2(targetY - y, x - targetX) if angle <= 0 then -- -pi < angle < pi but we need/want a value between 0 and 2 pi if runAwayArrow then angle = -angle -- 0 < angle < pi else angle = pi - angle -- pi < angle < 2pi end else if runAwayArrow then angle = pi2 - angle -- pi < angle < 2pi else angle = pi - angle -- 0 < angle < pi end end updateArrow(angle - GetPlayerFacing(), calculateDistance(x, y, targetX, targetY)) end) end ---------------------- -- Public Methods -- ---------------------- local function MapToWorldCoords(x, y) SetMapToCurrentZone() local isMapDungeon = true local _, a, b, c, d = GetCurrentMapDungeonLevel() --local floorIndex, minX, minY, maxX, maxY = GetCurrentMapDungeonLevel() if not (a and b and c and d) then isMapDungeon = false _, a, b, c, d = GetCurrentMapZone() --local zoneIndex, locLeft, locTop, locRight, locBottom = GetCurrentMapZone() end if not (a and b and c and d) then return x, y end local h, w = c - a, d - b local dx, dy = x / 100, y / 100 if isMapDungeon then x = d - w * dy y = c - h * dx else x = b + w * dy y = a + h * dx end --print("x=" .. x .. ", y=" .. y) return x, y end local function show(runAway, x, y, distance, time, legacy) if DBM.Options.EnablePatchRestrictions and IsInInstance() then return end local player if type(x) == "string" then player, hideDistance, hideTime = x, y, hideDistance end frame:Show() runAwayArrow = runAway hideDistance = distance or runAway and 100 or 3 if time then hideTime = time + GetTime() else hideTime = nil end if player then targetType = "player" targetPlayer = player else targetType = "fixed" if legacy and x >= 0 and x <= 100 and y >= 0 and y <= 100 then x, y = MapToWorldCoords(x, y) end targetX, targetY = x, y end end function arrowFrame:ShowRunTo(...) return show(false, ...) end function arrowFrame:ShowRunAway(...) return show(true, ...) end -- shows a static arrow function arrowFrame:ShowStatic(angle, time) --Static arrows do not need restrictions, and are still permitted even in 7.1 runAwayArrow = false hideDistance = 0 targetType = "static" targetX = angle * pi2 / 360 if time then hideTime = time + GetTime() else hideTime = nil end frame:Show() end function arrowFrame:IsShown() return frame and frame:IsShown() end function arrowFrame:Hide(autoHide) frame:Hide() end local function endMove() frame:EnableMouse(false) arrowFrame:Hide() end function arrowFrame:Move() targetType = "rotate" runAwayArrow = false hideDistance = 0 frame:EnableMouse(true) frame:Show() DBM.Bars:CreateBar(25, DBM_ARROW_MOVABLE, "Interface\\Icons\\Spell_Holy_BorrowedTime") DBM:Unschedule(endMove) DBM:Schedule(25, endMove) end function arrowFrame:LoadPosition() frame:SetPoint(DBM.Options.ArrowPoint, DBM.Options.ArrowPosX, DBM.Options.ArrowPosY) end
mp = Map("ipsec", translate("IPSec VPN Server")) mp.description = translate("IPSec VPN connectivity using the native built-in VPN Client on iOS or Andriod (IKEv1 with PSK and Xauth)") mp:section(SimpleSection).template = "ipsec/ipsec_status" s = mp:section(NamedSection, "ipsec", "service") s.anonymouse = true enabled = s:option(Flag, "enabled", translate("Enable")) enabled.default = 0 enabled.rmempty = false clientip = s:option(Value, "clientip", translate("VPN Client IP")) clientip.datatype = "ip4addr" clientip.description = translate("LAN DHCP reserved started IP addresses with the same subnet mask") clientip.optional = false clientip.rmempty = false clientdns = s:option(Value, "clientdns", translate("VPN Client DNS")) clientdns.datatype = "ip4addr" clientdns.description = translate("DNS using in VPN tunnel.Set to the router's LAN IP is recommended") clientdns.optional = false clientdns.rmempty = false account = s:option(Value, "account", translate("Account")) account.datatype = "string" password = s:option(Value, "password", translate("Password")) password.password = true secret = s:option(Value, "secret", translate("Secret Pre-Shared Key")) secret.password = true return mp
require "util" require "shared" local entity_mapping = { -- t1 ["replicating-ultra-fast-belt"] = { copy = "ultra-fast-belt", icon = "__replicating-belts__/graphics/icons/ultimate/replicating-ultra-fast-belt.png", tint = {r=0,g=211,b=37}, }, -- t2 ["replicating-extreme-fast-belt"] = { copy = "extreme-fast-belt", icon = "__replicating-belts__/graphics/icons/ultimate/replicating-extreme-fast-belt.png", tint = {r=245,g=17,b=24}, }, -- t3 ["replicating-ultra-express-belt"] = { copy = "ultra-express-belt", icon = "__replicating-belts__/graphics/icons/ultimate/replicating-ultra-express-belt.png", tint = {r=86,g=0,b=204}, }, -- t4 ["replicating-extreme-express-belt"] = { copy = "extreme-express-belt", icon = "__replicating-belts__/graphics/icons/ultimate/replicating-extreme-express-belt.png", tint = {r=0,g=0,b=204}, }, -- t5 ["replicating-ultimate-transport-belt"] = { copy = "ultimate-belt", icon = "__replicating-belts__/graphics/icons/ultimate/replicating-ultimate-transport-belt.png", tint = {r=0,g=230,b=204}, }, } for k, v in pairs(entity_mapping) do replicating_belts.entity(k, v) end
require 'customizations' cppdialect 'C++17' debugdir '../assets' exceptionhandling 'Off' flags { 'MultiProcessorCompile' } --gradleversion( '3.1.4' ) includedirs { '../include/' } --maxsdkversion '28' --minsdkversion '23' objdir '../obj/%{cfg.platform}/%{cfg.buildcfg}' rtti 'Off' targetdir '../%{iif(prj.kind == "StaticLib","lib","bin")}/%{cfg.platform}/%{cfg.buildcfg}' warnings 'Extra' filter 'configurations:Debug' optimize 'Off' symbols 'On' filter 'configurations:Release' optimize 'Full' symbols 'Off' defines { 'NDEBUG' } filter 'system:windows' toolset 'msc' defines { 'NOMINMAX' } filter 'system:not windows' toolset 'gcc' filter 'system:linux' debugenvs { 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../%{OUTDIR}' } filter 'system:android' --androidabis { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' } filter { }
package.path = package.path .. ";../../?.lua" iffy=require 'iffy' iffy.newImage("dice.png") --same as iffy.newImage("dice","dice.png") iffy.newSprite("dice","dice3",68,0,68,68) iffy.newSprite("dice","dice4",68,136,68,68) iffy.exportXML("dice") --same as iffy.exportCSV("dice","","dice.csv") --if you want to export to XML then use exportXML function love.draw() iffy.drawSprite('dice3',400-32,300-32) end
dofile(ModPath .. "infcore.lua") -- If sydch's skill overhaul is enabled then touch the trees differently if IreNFist.mod_compatibility.sso then -- I checked the BLT source and registering the same hook twice isn't a big deal, the second call is ignored. -- What *is* a big deal is trying to add a hook before it's registered, so let's not do that! Hooks:RegisterHook("sso_skilltweak_init_complete") -- Listen for SSO having completed its work -- Thanks to Sydch helpfully providing a Hook, we can ensure our code always runs after theirs. Hooks:AddHook("sso_skilltweak_init_complete", "inf_skilltweakinit_after_sso", function(self) -- Rifleman self.skills.rifleman[1].upgrades = {"weapon_enter_steelsight_speed_multiplier", "snp_reload_speed_multiplier"} self.skills.rifleman[2].upgrades = {"smg_reload_speed_multiplier", "assault_rifle_reload_speed_multiplier"} -- Ammo Efficiency self.skills.spotter_teamwork[1].upgrades = { "head_shot_ammo_return_1" } self.skills.spotter_teamwork[2].upgrades = { "head_shot_ammo_return_2" } -- Aggressive Reload self.skills.speedy_reload[1].upgrades = {"snp_headshot_armor"} self.skills.speedy_reload[2].upgrades = {"snp_headshot_armor_2"} -- Shotgun Impact/Solid Impact self.skills.shotgun_impact[1].upgrades = {"advmov_stamina_on_kill"} self.skills.shotgun_impact[2].upgrades = {"advmov_stamina_on_kill_2"} -- Shotgun CQB self.skills.shotgun_cqb[1].upgrades = {"shotgun_reload_speed_multiplier_1"} self.skills.shotgun_cqb[2].upgrades = {"shotgun_reload_speed_multiplier_2"} -- Far Away/Surgical Shot self.skills.far_away[1].upgrades = {"pellet_penalty_reduction"} self.skills.far_away[2].upgrades = {"pellet_penalty_reduction_2"} -- Close By (no shotgun mag plus pls) self.skills.close_by[2].upgrades = {"shotgun_switchspeed_buff"} -- Overkill/Last Word -- These damage bonuses are a bit OP in InF self.skills.overkill[1].upgrades = {"shotgun_last_shell_amount", "shotgun_last_shell_dmg_mult"} self.skills.overkill[2].upgrades = {"shotgun_last_shell_amount_2"} -- Technician -- Bunker/Fire Control instead of Mag Plus and reload bonuses self.skills.fire_control[1].upgrades = {"bipod_deploy_speed_mult"} self.skills.fire_control[2].upgrades = {"bipod_dmg_taken_mult"} -- Lock and load, add low magazine reload bonus to the new hipfire skill rather than to Surefire table.insert(self.skills.shock_and_awe[2].upgrades, "locknload_reload") table.insert(self.skills.shock_and_awe[2].upgrades, "locknload_reload_partial") -- Fire control horizontal recoil -- Confusingly, some skills were swapped self.skills.fast_fire[1].upgrades = {"recoil_h_mult"} self.skills.fast_fire[2].upgrades = {"recoil_h_mult_2"} -- Shockproof, add taser bullets table.insert(self.skills.hitman[2].upgrades, "player_electric_bullets_while_tased") -- body expertise self.skills.body_expertise[1].upgrades = { "weapon_automatic_head_shot_add_1", "weapon_automatic_head_shot_add_2" } self.skills.body_expertise[2].upgrades = {"weapon_lmg_pierce_enemies"} -- Specialized Killing, remove the silencer damage bonus and spread the other bonuses out over the 2 tiers self.skills.unseen_strike[1].upgrades = { "weapon_silencer_recoil_index_addend" } self.skills.unseen_strike[2].upgrades = { "weapon_silencer_enter_steelsight_speed_multiplier", "weapon_silencer_spread_index_addend" } -- Fugitive -- Pistol/Dexterous tree -- Itchy Finger, remove reload speed bonus and mag size increase self.skills.dance_instructor[1].upgrades = {"pistol_switchspeed_buff"} self.skills.dance_instructor[2].upgrades = {"pistol_switchspeed_buff_2"} -- Akimbo/Two-Hands/Dual Wielder skill, replace stability and ammo bonuses with switch speed and reload bonuses instead self.skills.akimbo[1].upgrades = {"empty_akimbo_switch"} self.skills.akimbo[2].upgrades = {"empty_akimbo_reload"} self.skills.expert_handling[1].upgrades = {"pistol_enter_steelsight_speed_multiplier"} self.skills.expert_handling[2].upgrades = {"pistol_reload_speed_multiplier"} -- one handed talent/off-handed reload self.skills.gun_fighter[1].upgrades = {"offhand_reload_time_mult", "pistol_gives_offhand_reload"} self.skills.gun_fighter[2].upgrades = {"offhand_reload_time_mult_2", "ar_gives_offhand_reload", "smg_gives_offhand_reload", "shotgun_gives_offhand_reload", "xbow_gives_offhand_reload"} -- Trigger Happy/Coordination self.skills.trigger_happy[1].upgrades = {"pistol_stacking_hit_damage_multiplier_1"} self.skills.trigger_happy[2].upgrades = {"pistol_stacking_hit_damage_multiplier_2"} -- Add guardian perk deck -- Re-use common perks from SSO -- Get the default perks from crew chief -- Except perk 2. I like SSO, but vanilla PD2's take on headshot damage is bad --local deck2 = deep_clone(self.specializations[1][2]) local deck2 = { cost = 300, desc_id = "menu_deckall_2_desc", name_id = "menu_deckall_2", upgrades = { "passive_player_xp_multiplier" }, icon_xy = { 1, 0 } } local deck4 = deep_clone(self.specializations[1][4]) local deck6 = deep_clone(self.specializations[1][6]) local deck8 = deep_clone(self.specializations[1][8]) -- Define the deck local holdout_deck = { { cost = 200, desc_id = "menu_deck_holdout1_desc", name_id = "menu_deck_holdout1", upgrades = { "player_holdout_consecutive_kills", -- Enables the holdout feature to begin with "player_holdout_killcount_1" -- Required kills in zone is 3 }, icon_xy = { 0, 5 } }, deck2, { cost = 400, desc_id = "menu_deck_holdout3_desc", name_id = "menu_deck_holdout3", texture_bundle_folder = "opera", upgrades = { "player_holdout_distant_kill_health_regen_1", -- Far away kills regenerate 10 health "player_holdout_close_kill_armor_regen_1", -- Close-by kills regenerate 10 armor instead "player_holdout_regen_cooldown_1" -- Cooldown is 5 seconds }, icon_xy = { 0, 1 } }, deck4, { cost = 1000, desc_id = "menu_deck_holdout5_desc", name_id = "menu_deck_holdout5", texture_bundle_folder = "opera", upgrades = { "player_holdout_killcount_2", -- Lower required kills to 2 "player_holdout_dmg_reduction_1" -- Add 12% damage reduction while inside your zone }, icon_xy = { 0, 0 } }, deck6, { cost = 2400, desc_id = "menu_deck_holdout7_desc", name_id = "menu_deck_holdout7", upgrades = { "player_holdout_distant_kill_health_regen_2", -- Far away kills regenerate 20 health instead of 10 "player_holdout_close_kill_armor_regen_2" -- Close-by kills regenerate 20 armor instead of 10 }, icon_xy = { 0, 3 } }, deck8, { cost = 4000, desc_id = "menu_deck_holdout9_desc", name_id = "menu_deck_holdout9", upgrades = { "player_holdout_consecutive_kill_ammo", -- Every 10th consecutive zone kill drops 1 extra ammo "player_holdout_regen_cooldown_2", -- Cooldown of Bunker reduced to 4 seconds "player_passive_loot_drop_multiplier" -- Should always be in any perk deck, is infamous chance }, icon_xy = { 4, 5 } }, desc_id = "menu_deck_holdout_desc", name_id = "menu_deck_holdout", custom = true, custom_id = "inf_holdout_perkdeck", } -- Insert the new perk deck and remember its ID -- This is better compatible with other perkdeck-adding mods and also future-proof local i = #self.specializations + 1 self.specializations[i] = holdout_deck IreNFist.holdout_deck_index = i end) else Hooks:PostHook(SkillTreeTweakData, "init", "remove_denbts", function(self, params) local digest = function(value) return Application:digest_value(value, true) end self.tier_unlocks = { digest(0), digest(1), digest(3), digest(16) } -- Common decks -- Remove headshot dmg multiplier, replace with XP -- Also add the former Parkour movement speed bonus to it local deck2 = { cost = 300, desc_id = "menu_deckall_2_desc", name_id = "menu_deckall_2", upgrades = { "passive_player_xp_multiplier", "player_movement_speed_multiplier" }, icon_xy = { 1, 0 } } -- Remove XP and detection buffs, add instant cash pickup value local deck4 = { cost = 600, desc_id = "menu_deckall_4_desc", name_id = "menu_deckall_4", upgrades = { "player_passive_armor_movement_penalty_multiplier", "player_small_loot_multiplier_1" }, icon_xy = { 3, 0 } } -- No ammo pickup multiplier, add further bag throwing local deck6 = { cost = 1600, desc_id = "menu_deckall_6_desc", name_id = "menu_deckall_6", upgrades = { "armor_kit", "carry_throw_distance_multiplier" }, icon_xy = { 5, 0 } } -- No random damage multiplier, add sprint speed from Sprinter skillf -- Also add insider assets because limiting expert driver to a skill is kinda gay -- And you never need them outside of stealth anyway -- Dumb goldfarb era holdover that doesn't really work well anymore local deck8 = { cost = 3200, desc_id = "menu_deckall_8_desc", name_id = "menu_deckall_8", upgrades = { "passive_doctor_bag_interaction_speed_multiplier", "player_run_speed_multiplier", "player_buy_bodybags_asset", "player_additional_assets", "player_cleaner_cost_multiplier", "player_buy_spotter_asset" }, icon_xy = { 7, 0 } } -- Change common perks in each deck for a = 1, #self.specializations, 1 do self.specializations[a][2] = deck2 self.specializations[a][4] = deck4 self.specializations[a][6] = deck6 self.specializations[a][8] = deck8 end -- Add brand-new Bunker/Holdout/Defender perk deck local holdout_deck = { { cost = 200, desc_id = "menu_deck_holdout1_desc", name_id = "menu_deck_holdout1", upgrades = { "player_holdout_consecutive_kills", -- Enables the holdout feature to begin with "player_holdout_killcount_1" -- Required kills in zone is 3 }, icon_xy = { 0, 5 } }, deck2, { cost = 400, desc_id = "menu_deck_holdout3_desc", name_id = "menu_deck_holdout3", texture_bundle_folder = "opera", upgrades = { "player_holdout_distant_kill_health_regen_1", -- Far away kills regenerate 10 health "player_holdout_close_kill_armor_regen_1", -- Close-by kills regenerate 10 armor instead "player_holdout_regen_cooldown_1" -- Cooldown is 5 seconds }, icon_xy = { 0, 1 } }, deck4, { cost = 1000, desc_id = "menu_deck_holdout5_desc", name_id = "menu_deck_holdout5", texture_bundle_folder = "opera", upgrades = { "player_holdout_killcount_2", -- Lower required kills to 2 "player_holdout_dmg_reduction_1" -- Add 12% damage reduction while inside your zone }, icon_xy = { 0, 0 } }, deck6, { cost = 2400, desc_id = "menu_deck_holdout7_desc", name_id = "menu_deck_holdout7", upgrades = { "player_holdout_distant_kill_health_regen_2", -- Far away kills regenerate 20 health instead of 10 "player_holdout_close_kill_armor_regen_2" -- Close-by kills regenerate 20 armor instead of 10 }, icon_xy = { 0, 3 } }, deck8, { cost = 4000, desc_id = "menu_deck_holdout9_desc", name_id = "menu_deck_holdout9", upgrades = { "player_holdout_consecutive_kill_ammo", -- Every 10th consecutive zone kill drops 1 extra ammo "player_holdout_regen_cooldown_2", -- Cooldown of Bunker reduced to 4 seconds "player_passive_loot_drop_multiplier" -- Should always be in any perk deck, is infamous chance }, icon_xy = { 4, 5 } }, desc_id = "menu_deck_holdout_desc", name_id = "menu_deck_holdout", custom = true, custom_id = "inf_holdout_perkdeck", } -- Insert the new perk deck and remember its ID -- This is better compatible with other perkdeck-adding mods and also future-proof local i = #self.specializations + 1 self.specializations[i] = holdout_deck IreNFist.holdout_deck_index = i -- Rogue -- Give yet more dodge to the final perk, replace "pierce body armor" with "pierce enemies" since piercing body armor is redundant self.specializations[4][9].upgrades = { "player_passive_loot_drop_multiplier", "weapon_all_pierce_enemies", "weapon_passive_swap_speed_multiplier_1", "player_passive_dodge_chance_4" } -- MASTERMIND -- tier 1 cool under pressure self.skills.stable_shot[1].upgrades = {"ugh_its_a_reload_bonus"} self.skills.stable_shot[2].upgrades = {"ugh_its_a_reload_bonus_2"} -- marksman self.skills.sharpshooter[2].upgrades = {"weapon_passive_headshot_damage_multiplier"} -- rifleman self.skills.rifleman[1].upgrades = {"weapon_enter_steelsight_speed_multiplier", "snp_reload_speed_multiplier"} self.skills.rifleman[2].upgrades = {"smg_reload_speed_multiplier", "assault_rifle_reload_speed_multiplier"} -- aggressive reload self.skills.speedy_reload[1].upgrades = {"snp_headshot_armor"} self.skills.speedy_reload[2].upgrades = {"snp_headshot_armor_2"} -- Re-add old stockholm syndrome to stockholm syndrome skill table.insert(self.skills.stockholm_syndrome[1].upgrades, "player_civilian_reviver") -- GHOST -- Duck and cover -- Extra sprint speed moved to perk self.skills.sprinter[1].upgrades = { "player_stamina_regen_timer_multiplier", "player_stamina_regen_multiplier" } -- Chameleon, make extra loot value innate to a shared perk instead of some random skill self.skills.jail_workout[2].upgrades = { "player_mask_off_pickup" } -- Sixth Sense, replace insider assets with pager snatch -- Pager snatch auto-answers pagers if you kill an unalerted ("cool") guard with melee self.skills.chameleon[2].upgrades = { "player_cleaner_cost_multiplier", "player_inf_snatch_pager" -- Inf prefix added because I vaguely remember other mods or even PD2 itself using this } self.skills.sprinter[2].upgrades = {"player_run_dodge_chance", "slide_dodge_chance"} -- replace dire need with moving target self.skills.dire_need[1].upgrades = {"player_detection_risk_add_movement_speed_1"} self.skills.dire_need[2].upgrades = {"player_detection_risk_add_movement_speed_2"} self.skills.dire_need.name_id = "menu_moving_target" self.skills.dire_need.desc_id = "menu_moving_target_desc" self.skills.dire_need.icon_xy = {2, 4} -- Moving Target icon -- Shockproof Ace: taser bullets (lol) table.insert(self.skills.insulation[2].upgrades, "player_electric_bullets_while_tased") -- Parkour skill: replace movement speed bonus with the ability to break your fall with advanced movement self.skills.awareness[1].upgrades = { "player_climb_speed_multiplier_1", "player_adv_movement_breaks_fall" } -- FUGITIVE -- gun nut -- fuck your mag capacity -- fuck your stryk magic too -- basically just eat a bag of dicks for managing to trigger what precious little gun autism i have self.skills.dance_instructor[1].upgrades = {"pistol_switchspeed_buff"} self.skills.dance_instructor[2].upgrades = {"pistol_switchspeed_buff_2"} -- akimbo self.skills.akimbo[1].upgrades = {"empty_akimbo_switch"} self.skills.akimbo[2].upgrades = {"empty_akimbo_reload"} -- pumping iron self.skills.steroids[1].upgrades = {"player_non_special_melee_multiplier", "player_melee_damage_multiplier"} self.skills.steroids[2].upgrades = {"imma_chargin_mah_melee"} -- desperado self.skills.expert_handling[1].upgrades = {"pistol_enter_steelsight_speed_multiplier"} -- one handed talent/off-handed reload self.skills.gun_fighter[1].upgrades = {"offhand_reload_time_mult", "pistol_gives_offhand_reload"} self.skills.gun_fighter[2].upgrades = {"offhand_reload_time_mult_2", "ar_gives_offhand_reload", "smg_gives_offhand_reload", "shotgun_gives_offhand_reload", "xbow_gives_offhand_reload"} -- equilibrium self.skills.equilibrium[1].upgrades = {"pistol_base_switchspeed_add"} self.skills.equilibrium[2].upgrades = {"pistol_base_switchspeed_add_2"} -- Counter-Strike table.insert(self.skills.drop_soap[1].upgrades, "player_arrest_knockdown") table.insert(self.skills.drop_soap[2].upgrades, "player_counter_arrest") -- ENFORCER -- Transporter self.skills.pack_mule[1].upgrades = { "player_sprint_any_bag" } -- overkill self.skills.overkill[1].upgrades = {"shotgun_last_shell_amount", "shotgun_last_shell_dmg_mult"} self.skills.overkill[2].upgrades = {"shotgun_last_shell_amount_2"} -- far away self.skills.far_away[1].upgrades = {"pellet_penalty_reduction"} self.skills.far_away[2].upgrades = {"pellet_penalty_reduction_2"} -- close by self.skills.close_by[2].upgrades = {"shotgun_switchspeed_buff"} -- shotgun cqb self.skills.shotgun_cqb[2].upgrades = {"shotgun_reload_speed_multiplier_2"} -- shotgun impact --self.skills.shotgun_impact[1].upgrades = {"shotgun_damage_addend"} --self.skills.shotgun_impact[2].upgrades = {"shotgun_damage_addend_2"} self.skills.shotgun_impact[1].upgrades = {"advmov_stamina_on_kill"} self.skills.shotgun_impact[2].upgrades = {"advmov_stamina_on_kill_2"} -- Carbon Blade replaced, saw skills merged down into Portable Saw skill self.skills.portable_saw[1].upgrades = { "saw_secondary", "saw_enemy_slicer" } self.skills.portable_saw[2].upgrades = { "saw_extra_ammo_multiplier", "player_saw_speed_multiplier_2", "saw_lock_damage_multiplier_2", "saw_ignore_shields_1", "saw_panic_when_kill_1" } -- Weird discount "bulletstorm" mechanic -- Pick up ammo boxes and you'll charge up a bar -- Press a keybind to gain temporary bulletstorm during that time -- NOTE: Bulletstorm no longer gives you a bottomless mag, it only prevents ammo consumption. -- You still have to reload but your reserve ammo temporarily doesn't run out. self.skills.carbon_blade[1].upgrades = { "player_inf_charge_bulletstorm", "player_inf_bulletstorm_second_gain_1" } -- Use your own ammo to refill an ammo bag self.skills.carbon_blade[2].upgrades = { "player_inf_refill_ammobag", "player_inf_bulletstorm_second_gain_2" } -- Change icon to a pack mule originally used for Transporter pre-U100 self.skills.carbon_blade.icon_xy = { 6, 0 } -- Fully loaded -- Basic now contains a 25% ammo pickup bonus -- Aced now gives an additional 25% ammo pickup (so 150% scavenge rate total, aced is same as before but basic feels less useless) self.skills.bandoliers[1].upgrades = { "extra_ammo_multiplier1", "player_pick_up_ammo_multiplier", } self.skills.bandoliers[2].upgrades = { "player_pick_up_ammo_multiplier_2", "player_regain_throwable_from_ammo_1" } -- TECHNICIAN -- surefire/bunker self.skills.fast_fire[1].upgrades = {"bipod_deploy_speed_mult"} self.skills.fast_fire[2].upgrades = {"bipod_dmg_taken_mult"} -- steady grip self.skills.steady_grip[1].upgrades = {"player_stability_increase_bonus_1"} self.skills.steady_grip[2].upgrades = {"player_stability_increase_bonus_2"} -- fire control self.skills.fire_control[1].upgrades = {"recoil_h_mult"} self.skills.fire_control[2].upgrades = {"recoil_h_mult_2"} -- body expertise self.skills.body_expertise[1].upgrades = { "weapon_automatic_head_shot_add_1", "weapon_automatic_head_shot_add_2" } self.skills.body_expertise[2].upgrades = {"weapon_lmg_pierce_enemies"} -- lock 'n load --self.skills.shock_and_awe[1].upgrades = {} self.skills.shock_and_awe[2].upgrades = {"locknload_reload", "locknload_reload_partial"} -- Add armor ammo multiplier to default upgrades if not table.contains(self.default_upgrades, "player_add_armor_stat_skill_ammo_mul") then table.insert(self.default_upgrades, "player_add_armor_stat_skill_ammo_mul") end end) end
User = game.Players.LocalPlayer Char = User.Character cen = Instance.new("Part", User.Character) cen.BottomSurface = "Smooth" cen.TopSurface = "Smooth" cen.CanCollide = false cen.formFactor = "Symmetric" cen.Size = Vector3.new(1,1,1) cen.BrickColor = BrickColor.new("Really black") cen.Transparency = 1 cen2 = Instance.new("Part", User.Character) cen2.BottomSurface = "Smooth" cen2.TopSurface = "Smooth" cen2.CanCollide = false cen2.formFactor = "Symmetric" cen2.Size = Vector3.new(1,1,1) cen2.BrickColor = BrickColor.new("Really black") cen2.Transparency = 1 cenw = Instance.new("Weld", cen) cenw.Part0 = Char["Torso"] cenw.Part1 = cen cenw.C1 = CFrame.new(-1.5,-0.5,0) cenw2 = Instance.new("Weld", cen2) cenw2.Part0 = Char["Torso"] cenw2.Part1 = cen2 cenw2.C1 = CFrame.new(1.5,-0.5,0) haw = Instance.new("Weld", cen) haw.Part0 = cen haw.Part1 = Char["Right Arm"] haw.C1 = CFrame.new(0,0.5,0) haw2 = Instance.new("Weld", cen2) haw2.Part0 = cen2 haw2.Part1 = Char["Left Arm"] haw2.C1 = CFrame.new(0,0.5,0) haw.Part1 = nil haw2.Part1 = nil Torso = Instance.new("Part", Char) Torso.formFactor = "Symmetric" Torso.BrickColor = Char.Torso.BrickColor Torso.Size = Char.Torso.Size Torso.Transparency = 1 Torso.Reflectance = 0 Torso:BreakJoints() Torsow = Instance.new("Weld", Torso) Torsow.Part0 = Char["Torso"] Torsow.Part1 = Torso Torsow.C1 = CFrame.Angles(0,math.rad(0),0) Hw = Instance.new("Weld", Torso) Hw.Part0 = Torso Hw.Part1 = Char.Head Hw.C1 = CFrame.new(0,-1.5,0) prt1f = Instance.new("Part", Char) prt1f.Size = Vector3.new(1,1,1) prt1f.CanCollide = false prt1f.BrickColor = BrickColor.new("Institutional white") prt1f.TopSurface = "Smooth" prt1f.Transparency = 1 prt1f.BottomSurface = "Smooth" prtfM = Instance.new("CylinderMesh", prt1f) prtfM.Scale = Vector3.new(0.2,4,0.2) prt1f:BreakJoints() prtfW = Instance.new("Weld", prt1f) prtfW.Part0 = Char["Right Arm"] prtfW.Part1 = prt1f prtfW.C1 = CFrame.new(0,-0.5,1)*CFrame.Angles(math.rad(90),0,math.rad(0)) prt1 = Instance.new("Part", Char) prt1.Size = Vector3.new(1,1,1) prt1.CanCollide = false prt1.BrickColor = BrickColor.new("Institutional white") prt1.TopSurface = "Smooth" prt1.Transparency = 0.5 prt1.BottomSurface = "Smooth" prtM = Instance.new("CylinderMesh", prt1) prtM.Scale = Vector3.new(0.2,4,0.2) prt1:BreakJoints() prtW = Instance.new("Weld", prt1) prtW.Part0 = prt1f prtW.Part1 = prt1 prtW.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) for i = 0,17 do prt = Instance.new("Part", Char) prt.formFactor = "Custom" prt.Size = Vector3.new(1,1,1) prt.CanCollide = false prt.BrickColor = BrickColor.new("Really black") prt.TopSurface = "Smooth" prt.Transparency = 0 prt.BottomSurface = "Smooth" prtMm = Instance.new("SpecialMesh", prt) prtMm.MeshType = "Sphere" prtMm.Scale = Vector3.new(0.15,0.15,0.15) prt:BreakJoints() prtWw = Instance.new("Weld", prt) prtWw.Part0 = prt1 prtWw.Part1 = prt prtWw.C1 = CFrame.new(0,-i/8,0.07)*CFrame.Angles(math.rad(0),math.rad(i*50),math.rad(0)) end for i = 1,17 do prt = Instance.new("Part", Char) prt.formFactor = "Custom" prt.Size = Vector3.new(1,1,1) prt.CanCollide = false prt.BrickColor = BrickColor.new("Really black") prt.TopSurface = "Smooth" prt.Transparency = 0 prt.BottomSurface = "Smooth" prtMm = Instance.new("SpecialMesh", prt) prtMm.MeshType = "Sphere" prtMm.Scale = Vector3.new(0.15,0.15,0.15) prt:BreakJoints() prtWw = Instance.new("Weld", prt) prtWw.Part0 = prt1 prtWw.Part1 = prt prtWw.C1 = CFrame.new(0,i/8,0.07)*CFrame.Angles(math.rad(0),math.rad(-(i*50)),math.rad(0)) end prt2 = Instance.new("Part", Char) prt2.Size = Vector3.new(1,1,1) prt2.CanCollide = false prt2.BrickColor = BrickColor.new("Really red") prt2.TopSurface = "Smooth" prt2.Transparency = 0.5 prt2.BottomSurface = "Smooth" prt2M = Instance.new("SpecialMesh", prt2) prt2M.MeshId = "http://www.roblox.com/asset/?id=9756362" prt2M.Scale = Vector3.new(0.5,1,0.5) prt2:BreakJoints() prt2W = Instance.new("Weld", prt2) prt2W.Part0 = prt1 prt2W.Part1 = prt2 prt2W.C1 = CFrame.new(0,-3.5,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt3 = Instance.new("Part", Char) prt3.Size = Vector3.new(1,1,1) prt3.CanCollide = false prt3.BrickColor = BrickColor.new("Institutional white") prt3.TopSurface = "Smooth" prt3.Transparency = 0.8 prt3.BottomSurface = "Smooth" prt3M = Instance.new("SpecialMesh", prt3) prt3M.MeshId = "http://www.roblox.com/asset/?id=9982590" prt3M.Scale = Vector3.new(0.75,0.6,0.75) prt3:BreakJoints() prt3W = Instance.new("Weld", prt3) prt3W.Part0 = prt2 prt3W.Part1 = prt3 prt3W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt4 = Instance.new("Part", Char) prt4.formFactor = "Custom" prt4.Size = Vector3.new(1,1,1) prt4.CanCollide = false prt4.BrickColor = BrickColor.new("Really black") prt4.TopSurface = "Smooth" prt4.Transparency = 0 prt4.BottomSurface = "Smooth" prt4M = Instance.new("SpecialMesh", prt4) prt4M.MeshType = "Sphere" prt4M.Scale = Vector3.new(0.5,0.5,0.5) prt4:BreakJoints() prt4W = Instance.new("Weld", prt4) prt4W.Part0 = prt1 prt4W.Part1 = prt4 prt4W.C1 = CFrame.new(0,2.5,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt5 = Instance.new("Part", Char) prt5.Size = Vector3.new(1,1,1) prt5.CanCollide = false prt5.BrickColor = BrickColor.new("Really black") prt5.TopSurface = "Smooth" prt5.Transparency = 0.5 prt5.BottomSurface = "Smooth" prt5M = Instance.new("SpecialMesh", prt5) prt5M.MeshType = "FileMesh" prt5M.MeshId = "http://www.roblox.com/asset/?id=20329976" prt5M.Scale = Vector3.new(0.2,0.5,0.2) prt5:BreakJoints() prt5W = Instance.new("Weld", prt5) prt5W.Part0 = prt1 prt5W.Part1 = prt5 prt5W.C1 = CFrame.new(0,-2.5,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt6 = Instance.new("Part", Char) prt6.formFactor = "Custom" prt6.Size = Vector3.new(1,1,1) prt6.CanCollide = false prt6.BrickColor = BrickColor.new("Institutional white") prt6.TopSurface = "Smooth" prt6.Transparency = 1 prt6.BottomSurface = "Smooth" prt6M = Instance.new("BlockMesh", prt6) prt6M.Scale = Vector3.new(1,1,1) prt6:BreakJoints() prt6W = Instance.new("Weld", prt6) prt6W.Part0 = prt2 prt6W.Part1 = prt6 prt6W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt7 = Instance.new("Part", Char) prt7.formFactor = "Custom" prt7.Size = Vector3.new(1,1,1) prt7.CanCollide = false prt7.BrickColor = BrickColor.new("Institutional white") prt7.TopSurface = "Smooth" prt7.Transparency = 1 prt7.BottomSurface = "Smooth" prt7M = Instance.new("BlockMesh", prt7) prt7M.Scale = Vector3.new(1,1,1) prt7:BreakJoints() prt7W = Instance.new("Weld", prt7) prt7W.Part0 = prt2 prt7W.Part1 = prt7 prt7W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt8 = Instance.new("Part", Char) prt8.formFactor = "Custom" prt8.Size = Vector3.new(1,1,1) prt8.CanCollide = false prt8.BrickColor = BrickColor.new("Institutional white") prt8.TopSurface = "Smooth" prt8.Transparency = 1 prt8.BottomSurface = "Smooth" prt8M = Instance.new("BlockMesh", prt8) prt8M.Scale = Vector3.new(1,1,1) prt8:BreakJoints() prt8W = Instance.new("Weld", prt8) prt8W.Part0 = prt2 prt8W.Part1 = prt8 prt8W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),0,math.rad(0)) prt9 = Instance.new("Part", Char) prt9.formFactor = "Custom" prt9.Size = Vector3.new(1,1,1) prt9.CanCollide = false prt9.BrickColor = BrickColor.new("Institutional white") prt9.TopSurface = "Smooth" prt9.Transparency = 1 prt9.BottomSurface = "Smooth" prt9M = Instance.new("SpecialMesh", prt9) prt9M.MeshId = "http://www.roblox.com/asset/?id=3270017" prt9M.Scale = Vector3.new(1,1,1) prt9:BreakJoints() prt9W = Instance.new("Weld", prt9) prt9W.Part0 = prt2 prt9W.Part1 = prt9 prt9W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(90),0,math.rad(0)) delay(0, function() while true do for i = 1,360 do prt3W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0),math.rad(i),math.rad(0)) wait(0.1) end end end) ------------------------------------------------------------------------------------------ function Blast() for i = 1,60,15 do haw.C0 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(90),math.rad(45-i),math.rad(-45+i)) wait(0.03) end Char["Torso"].Transparency = 1 Torso.Transparency = 0 cenw2.Part0 = Torso cenw.Part0 = Torso Char.Torso["Right Hip"].Part0 = Torso Char.Torso["Left Hip"].Part0 = Torso haw2.Part1 = Char["Left Arm"] for i = 1,120,30 do Torsow.C0 = CFrame.Angles(math.rad(0),math.rad(i),0) Hw.C0 = CFrame.Angles(math.rad(0),math.rad(-i),0) haw.C0 = CFrame.Angles(math.rad(i),0,math.rad(i)) haw2.C0 = CFrame.Angles(math.rad(0),0,math.rad(-i/2)) prtW.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(i),0,math.rad(0)) wait() end prt6.Transparency = 0.7 prt7.Transparency = 0.7 for i = 1,1050,50 do prt6W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(i),math.rad(i),math.rad(i)) prt6M.Scale = Vector3.new(i/500,i/500,i/500) prt7W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(-i/2),math.rad(-i/2),math.rad(-i/2)) prt7M.Scale = Vector3.new(i/500,i/500,i/500) wait(0.03) end prt6.Transparency = 1 prt7.Transparency = 1 shot = Instance.new("Part", workspace) shot.Size = Vector3.new(1,1,1) shot.CanCollide = false shot.BrickColor = BrickColor.new("Institutional white") shot.TopSurface = "Smooth" shot.Transparency = 0 shot.BottomSurface = "Smooth" shotM = Instance.new("SpecialMesh", shot) shotM.MeshId = "http://www.roblox.com/asset/?id=4770583" shotM.Scale = Vector3.new(1,1,1) shot:BreakJoints() shot.CFrame = prt2.CFrame local shotv = Instance.new("BodyVelocity", shot) shotv.velocity = prt1f.CFrame.lookVector*200 prt9.Transparency = 0 prt9W.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(90),0,math.rad(0)) loadstring([[Char = workspace.Deadworld432 function sound(id, pt) local sd = Instance.new("Sound", Char.Head) sd.SoundId = "http://www.roblox.com/asset/?id="..tostring(id) sd.Pitch = pt sd.Volume = 1 delay(0, function() sd:Play() wait(2) sd:Remove() end) end sound(2767090, 1)]])() for i = 1,1050,50 do delay(0,function() for i,v in pairs(workspace:children()) do if v:FindFirstChild("Humanoid") and v:FindFirstChild("Head") then if (v.Head.Position - shot.Position).magnitude < 5 then v:BreakJoints() end end end end) prt9M.Scale = Vector3.new(i/100,i/100,i/100) prt9.Transparency = i/1000 prt9W.C1 = CFrame.new(0,0,i/500)*CFrame.Angles(math.rad(90),0,math.rad(0)) local shot2 = Instance.new("Part", workspace) shot2.Size = Vector3.new(1,1,1) shot2.CanCollide = true shot2.BrickColor = BrickColor.new("Institutional white") shot2.TopSurface = "Smooth" shot2.Transparency = 0 shot2.Anchored = true shot2.BottomSurface = "Smooth" local shot2M = Instance.new("SpecialMesh", shot2) shot2M.MeshId = "http://www.roblox.com/asset/?id=4770583" shot2M.Scale = Vector3.new(1,1,1) shot2:BreakJoints() shot2.CFrame = shot.CFrame delay(0,function() for i = 1,10 do shot2.Transparency = shot2.Transparency+0.1 shot2.CFrame = shot2.CFrame+Vector3.new(math.random(-10,10)/10,0,math.random(-10,10)/10) shot2M.Scale = shot2M.Scale + Vector3.new(0.1,0.1,0.1) wait(0.03) end shot2:Remove() end) wait(0.03) end shot:remove() for i = 1,100,10 do Torsow.C0 = CFrame.Angles(math.rad(0),math.rad(90-i),0) Hw.C0 = CFrame.Angles(math.rad(0),math.rad(-90+i),0) haw.C0 = CFrame.Angles(math.rad(i),0,math.rad(90-i)) haw2.C0 = CFrame.Angles(math.rad(0),0,math.rad(-45+i/2)) prtW.C1 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(90-i),0,math.rad(0)) wait() end haw2.Part1 = nil Char["Torso"].Transparency = 0 Torso.Transparency = 1 cenw2.Part0 = Char.Torso cenw.Part0 = Char.Torso Char.Torso["Right Hip"].Part0 = Char.Torso Char.Torso["Left Hip"].Part0 = Char.Torso Equip() end function Equip() haw.Part1 = Char["Right Arm"] for i = 1,60,15 do haw.C0 = CFrame.new(0,0,0)*CFrame.Angles(math.rad(i*2),math.rad(i),math.rad(-i)) wait(0.03) end end function UnEquip() for i = 1,60,15 do haw.C0 = CFrame.new(0,0,0)*CFrame.Angles(math.rad((45/2)-(i/2)),math.rad(45-i),math.rad(-45+i)) wait(0.03) end haw.Part1 = nil end function Arcrain() end -------------------------------------------- local _ = false if not script.Parent:IsA("HopperBin") then h = Instance.new("HopperBin", User.Backpack) h.Name = "Staff" script.Parent = h end script.Parent.Selected:connect(function(mouse) Equip() mouse.Button1Down:connect(function() if _ == false then _ = true Blast() _ = false end end) mouse.KeyDown:connect(function(key) if key == "q" and _ == false then _ = true CircleBlast() _ = false end end) end) script.Parent.Deselected:connect(function() UnEquip() end) --mediafire gtfo password
slot0 = class("MiniHubMediator", import("..BaseMiniGameMediator")) slot0.register = function (slot0) slot0.super.register(slot0) slot0.viewComponent:SetExtraData({}) end slot0.OnMiniGameOPeration = function (slot0, slot1, slot2) slot0:sendNotification(GAME.SEND_MINI_GAME_OP, { hubid = slot0.miniGameProxy:GetHubByGameId(slot0.miniGameId).id, cmd = slot1, args1 = slot2 }) end slot0.OnMiniGameSuccess = function (slot0, slot1) if slot0.miniGameProxy:GetHubByGameId(slot0.miniGameId).count <= 0 then return end slot0:sendNotification(GAME.SEND_MINI_GAME_OP, { hubid = slot2.id, cmd = MiniGameOPCommand.CMD_COMPLETE, args1 = { slot1 } }) end slot0.OnMiniGameFailure = function (slot0, slot1) return end slot0.listNotificationInterests = function (slot0) table.insertto({}, slot0.super.listNotificationInterests(slot0)) return end slot0.handleNotification = function (slot0, slot1) slot0.super.handleNotification(slot0, slot1) end return slot0
--[[ © 2020 TERRANOVA do not share, re-distribute or modify without permission of its author. --]] ITEM.name = "Approved Noodles"; ITEM.model = "models/props_junk/garbage_takeoutcarton001a.mdl"; ITEM.width = 1; ITEM.height = 1; ITEM.description = "A takeout shaped box with cooked hokkien 'egg' noodles and some light seasoning. It's still quite bad."; ITEM.category = "Civil-Approved Food"; ITEM.permit = "consumables"; ITEM.price = 13; ITEM.restoreHealth = 14; ITEM.flag = "f"
function mult(value) for t=1,value*3 do Note("I AM LUA!") end return value*3 end function auto(cmd,start,stop,target) for t=start,stop do Note(cmd.." "..t.."."..target) end end function updateRoomInfo(room) --room = gmcpTable("room.info") --now we are called directly from java, with an argument in room. --check to see if it is a mappable room --Note("Staring room save") if(room.num == -1) then --probably some more cases to check. Kind of looks like this one is the easiest. return --room not mappable end --check to see if we already have this room/area cur = db:rawQuery("SELECT uid FROM rooms WHERE uid="..room.num,nil) count = cur:getCount() if(count > 0) then Note("MAPPER: already mapped room:"..room.num) return end cur:close() cur = nil; --Note("Starting room save") local vals_tmp = {uid=room.num,name=room.name,area=room.zone,terrain=room.terrain,info=room.details,x=room.coord.x,y=room.coord.y} local vals = fields(vals_tmp) db:insert("rooms",nil,vals) --Note("Room Inserted - Doing Exits") for key,value in pairs(room.exits) do if(value == nil or value ~= "") then local e_tmp = {fromuid=room.num,dir=key,touid=value} local e = fields(e_tmp) db:insert("exits",nil,e) else Note("Not mapping exits. Room: "..room.num.." is a maze.") end end --Note("exits finished") end function dumpRooms() local rows = row("_id","name","area","terrain") local cur = db:query("rooms",rows,nil,nil,nil,nil,nil) local i = 0 repeat cur:moveToNext() local id = cur:getString(0) local name = cur:getString(1) local zone = cur:getString(2) local terrain = cur:getString(3) Note(id.."=> "..name.." zone:"..zone.." terrain:"..terrain); i = i + 1 until cur:isLast()==true cur:close() end function dumpExits() local rows = row("_id","command","destination") local cur = db:query("exits",rows,nil,nil,nil,nil,nil) local i = 0 repeat sup = rowify(cur) cur:moveToNext() local id = cur:getString(0) local name = cur:getString(1) local destination = cur:getString(2) Note(id.."=>"..name.." dest:"..destination); i = i + 1 until cur:isLast()==true cur:close() end function cofun() coroutine.yield(10) coroutine.yield(20) coroutine.yield(30) end function nrows(s) local cursor = db:rawQuery(s,nil) local helper = {} setmetatable(helper, { __index=function(t,name) index = cursor:getColumnIndex(name) if(index == -1) then return "No such column: "..name end var = cursor:getString(index) return var end }) count = cursor:getCount() if(count < 1) then return "No results returned for query: "..s end return function() moved = cursor:moveToNext() if(not moved) then cursor:close() return end return helper end end function betterDumpRows() for room in nrows("SELECT * FROM rooms") do Note(room["name"].." ["..room["zone"].."]:"..room["terrain"]) end end function createTables() --android only supports single queries. this is going to suuuuuck. db:rawQuery("PRAGMA foreign_keys = ON",nil) --db:rawQuery("PRAGMA journal_mode=WAL",nil) db:execSQL([[ CREATE TABLE IF NOT EXISTS areas ( _id INTEGER PRIMARY KEY AUTOINCREMENT, uid TEXT NOT NULL, -- vnum or how the MUD identifies the area name TEXT, -- name of area date_added DATE, -- date added to database texture TEXT, -- background area texture color TEXT, -- ANSI colour code. UNIQUE (uid) ); ]]) db:execSQL("CREATE INDEX IF NOT EXISTS areas_uid_index ON areas (uid);") db:execSQL("CREATE INDEX IF NOT EXISTS areas_name_index ON areas (name);") db:execSQL([[ CREATE TABLE IF NOT EXISTS environments ( _id INTEGER PRIMARY KEY AUTOINCREMENT, uid TEXT NOT NULL, -- code for the environment name TEXT, -- name of environment color INTEGER, -- ANSI colour code date_added DATE, -- date added to database UNIQUE (uid) );]]) db:execSQL("CREATE INDEX IF NOT EXISTS name_index ON environments (name);") db:execSQL([[ CREATE TABLE IF NOT EXISTS rooms ( _id INTEGER PRIMARY KEY AUTOINCREMENT, uid TEXT NOT NULL, -- vnum or how the MUD identifies the room name TEXT, -- name of room area TEXT, -- which area building TEXT, -- which building it is in terrain TEXT, -- eg. road OR water info TEXT, -- eg. shop,healer notes TEXT, -- player notes x INTEGER, y INTEGER, z INTEGER, date_added DATE, -- date added to database UNIQUE (uid), FOREIGN KEY(area) REFERENCES areas(uid) ); ]]) db:execSQL("CREATE INDEX IF NOT EXISTS info_index ON rooms (info);") db:execSQL("CREATE INDEX IF NOT EXISTS terrain_index ON rooms (terrain);") db:execSQL("CREATE INDEX IF NOT EXISTS area_index ON rooms (area);") db:execSQL("CREATE INDEX IF NOT EXISTS rname_index ON rooms (name);") db:execSQL([[ CREATE TABLE IF NOT EXISTS exits ( _id INTEGER PRIMARY KEY AUTOINCREMENT, dir TEXT NOT NULL, -- direction, eg. "n", "s" fromuid STRING NOT NULL, -- exit from which room (in rooms table) touid STRING NOT NULL, -- exit to which room (in rooms table) level STRING NOT NULL DEFAULT '0', -- minimum level to make use of this exit date_added DATE, -- date added to database --PRIMARY KEY(fromuid, dir), FOREIGN KEY(fromuid) REFERENCES rooms(uid)); ]]) db:execSQL("CREATE INDEX IF NOT EXISTS fromuid_index ON exits (fromuid);") db:execSQL("CREATE INDEX IF NOT EXISTS touid_index ON exits (touid);") end function dumpMaster() --nrows may be a bit to flashy to use here. local cur = db:rawQuery("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name",nil) --cur:moveToNext() while (cur:moveToNext()) do local val = cur:getString(0) Note("DB TABLE: "..val) end cur:close() cur=nil; end function dumpIndicies() --nrows may be a bit to flashy to use here. local cur = db:rawQuery("SELECT name FROM sqlite_master WHERE type='index' ORDER BY name",nil) --cur:moveToNext() while (cur:moveToNext()) do local val = cur:getString(0) Note("DB TABLE: "..val) end cur:close() cur=nil; end
local TESTING_LOCALLY = false -- If true, there must be a module named `api` that returns the api dump json local util = require(script.Parent.Util) local pluginWarn, pluginError = util.pluginWarn, util.pluginError local HttpService = game:GetService("HttpService") local API_URL = "https://raw.githubusercontent.com/CloneTrooper1019/Roblox-Client-Tracker/roblox/API-Dump.json" local PROPERTY_RESTRICTED_TAGS = { "ReadOnly", "NotScriptable" } local INSTANCE_RESTRICTED_TAGS = { "NotScriptable" } local SECURITY_RESTRICTED_TAGS = { ["RobloxSecurity"] = true, ["NotAccessibleSecurity"] = true, ["RobloxScriptSecurity"] = true, } local FORBIDDEN_PROPERTIES = { ["BasePart"] = { ["Position"] = true, -- Position, Rotation, and Orientation are all overruled by CFrame ["Rotation"] = true, ["Orientation"] = true, ["BrickColor"] = true, ["brickColor"] = true, -- Could be solved by moving how forbidden properties are handled but I don't care enough to fix it }, ["FormFactorPart"] = { ["FormFactor"] = true, ["formFactor"] = false, }, ["GuiObject"] = { ["Transparency"] = true, }, } local PRELOAD_CLASSES = { "Part", "Frame", "ScrollingFrame", "TextLabel", "TextButton", "TextBox", "ImageLabel", "ImageButton", "Humanoid", } local function tablesOverlap(tbl1, tbl2) local longTbl = #tbl1 > #tbl2 and tbl1 or tbl2 local shortTbl = longTbl == tbl1 and tbl2 or tbl1 for _, v1 in ipairs(longTbl) do -- This is probably the best way to do this for _, v2 in ipairs(shortTbl) do if v1 == v2 then return true end end end return false end local requestData = { Url = API_URL, Method = "GET", } local function generateAPI() local jsonSuccess, apiJson if TESTING_LOCALLY then jsonSuccess, apiJson = pcall(HttpService.JSONDecode, HttpService, require(game.ServerScriptService.api)) else local requestSuccess, requestResponse = pcall(HttpService.RequestAsync, HttpService, requestData) if not requestSuccess then -- HttpService not on pluginWarn("HttpService.HttpEnabled is not true. HttpService is required briefly upon loading the serializer to get the Roblox API.") pluginWarn("Please enable HttpEnabled and retry.") return false end if not requestResponse.Success then pluginWarn("RequestAsync failed to get the API dump (status: %i %s)", requestResponse.StatusCode, requestResponse.StatusMessage) pluginWarn("Please retry. If this persists, contact Dekkonot.") return false end jsonSuccess, apiJson = pcall(HttpService.JSONDecode, HttpService, requestResponse.Body) end if not jsonSuccess then pluginWarn("API dump failed to decode. Please retry. If this persists, contact Dekkonot.") return false end local classMap = {} local inheritanceMap = {} local classCache = { normal = {}, plugin = {}, } for _, classApi in ipairs(apiJson.Classes) do if not classApi.Tags or not tablesOverlap(INSTANCE_RESTRICTED_TAGS, classApi.Tags) then -- Boy I really wish I had `continue` right now :/ local forbiddenTable = FORBIDDEN_PROPERTIES[classApi.Name] local classTable = { ["$superclass"] = classApi.Superclass, ["$service"] = not not (classApi.Tags and table.find(classApi.Tags, "Service")), } for _, memberTable in ipairs(classApi.Members) do if memberTable.MemberType == "Property" then if not forbiddenTable or not forbiddenTable[memberTable.Name] then if not memberTable.Tags or not tablesOverlap(PROPERTY_RESTRICTED_TAGS, memberTable.Tags) then if not (SECURITY_RESTRICTED_TAGS[memberTable.Security.Write] or SECURITY_RESTRICTED_TAGS[memberTable.Security.Read]) then classTable[memberTable.Name] = memberTable.Security.Write ~= "None" or memberTable.Security.Read ~= "None" end end end end end for name in pairs(classTable) do if string.find(name, "Color$") and classTable[name.."3"] ~= nil then -- Kill BrickColor properties classTable[name] = nil elseif name:find("^%l") then if classTable[name:sub(1, 1):upper()..name:sub(2)] ~= nil then classTable[name] = nil end end end classMap[classApi.Name] = classTable end end for _, classApi in ipairs(apiJson.Classes) do local superRoute = {} local root = classApi.Name while classMap[root] do table.insert(superRoute, 1, root) -- This is because properties may be overwritten by descendant classes (Value objects...) root = classMap[root]["$superclass"] end inheritanceMap[classApi.Name] = superRoute end local function getProperties(class, pluginContext) if pluginContext == nil then pluginError("pluginContext must be passed to API.getProperties") end local cacheTable = classCache[pluginContext and "plugin" or "normal"] if cacheTable[class] then return cacheTable[class] else local properties = {} if pluginContext then for _, superClass in ipairs(inheritanceMap[class]) do for k in pairs(classMap[superClass]) do if k ~= "$service" and k ~= "$superclass" then properties[#properties+1] = k end end end else for _, superClass in ipairs(inheritanceMap[class]) do for k, v in pairs(classMap[superClass]) do if not v then if k ~= "$service" and k ~= "$superclass" then properties[#properties+1] = k end end end end end cacheTable[class] = properties return properties end end local function isService(class) local map = classMap[class] return map["$service"] end for _, v in ipairs(PRELOAD_CLASSES) do getProperties(v, false) getProperties(v, true) end return true, { getProperties = getProperties, isService = isService, } end return generateAPI
local fs = require('fs') local uv = require('luv') local rpc = require('app/rpc') local core = require('core') local config = require('app/conf') local path = require('path') local json = require('json') local util = require('util') local devices = require('devices') local exports = {} local context = {} local modemManager = nil local STARTING = 1 local RUNNING = 0 local IDLE = 2 ---@class ModemManager local ModemManager = core.Emitter:extend() function ModemManager:initialize(options) options = options or {} self.id = options.id or '1' self.name = options.name or 'dt02-4G-module' self.status = {} self.enable = false self.uartDevice = nil self.uartFile = -1 self.uartName = '/dev/ttyUSB2' self.uartPoll = nil self.uartTimer = nil self.step = 1 self.atCommands = { "ATE0\r\n", "AT+CSQ\r\n", "AT+QCCID\r", "AT+CIMI\r", "AT+COPS?\r" } return self end -- 关闭 USB 4G 模块通信串口 function ModemManager:closeUart() if (self.uartTimer) then clearTimeout(self.uartTimer) self.uartTimer = nil end if (self.uartPoll) then uv.poll_stop(self.uartPoll) self.uartPoll = nil end if (self.uartDevice) then self.uartDevice:close() self.uartDevice = nil end self.uartFile = -1; end -- 返回当前网络状态 function ModemManager:getStatus() -- ppp0 local status = {} status.ifname = 'ppp0' status.iccid = self.iccid status.imsi = self.imsi status.operater = self.operater status.signalStrength = tonumber(self.signalStrength) status.updated = Date.now() -- interface local interfaces = os.networkInterfaces() or {} local interface = interfaces[status.ifname] interface = interface and interface[1] if (interface) then status.ip = interface.ip status.netmask = interface.netmask end return status end -- 打开 USB 4G 模块通信串口 function ModemManager:openUart() self:closeUart() if (not fs.existsSync(self.uartName)) then return end -- device local lmodbus = require("lmodbus") local uartDevice = lmodbus.new(self.uartName, 115200, 78, 8, 1) -- N: 78, O: 79, E: 69 self.uartDevice = uartDevice; uartDevice:connect() -- file local uartFile = uartDevice:getFD() if (uartFile < 0 ) then console.info("open device error") return -1 end self.uartFile = uartFile local atCmd = self.atCommands local function onNextStep() self.step = self.step + 1 if (self.step == 3) then if (self.iccid) then self.step = self.step + 1 end end if (self.step == 4) then if (self.imsi) then self.step = self.step + 1 end end if (self.step == 5) then if (self.operater) then self.step = self.step + 1 end end if (self.step <= 5) then fs.writeSync(uartFile, nil, atCmd[self.step]) elseif (self.step > 5) then self:closeUart() self:onSaveStatus() end end local function onData(data) if (data == nil or #data < 2) then return end -- console.log('onData', self.step, data) if (self.step == 1) then if (string.find(data, "OK\r\n")) then onNextStep() end elseif (self.step == 2) then if (string.find(data, "+CSQ: ")) then self.signalStrength = tonumber(string.match(data, "%d+")) console.log('signalStrength', self.signalStrength) onNextStep() end elseif (self.step == 3) then if (string.find(data, "+QCCID: ")) then self.iccid = string.match(data, "%d+") onNextStep() end elseif (self.step == 4) then if (string.find(data, "OK\r\n")) then self.imsi = string.match(data, "%d+") onNextStep() end elseif (self.step == 5) then if (string.find(data, "+COPS: ")) then local a, b, string = string.find(data, '(["].*["])') if (string) then self.operater = string.sub(string, 2, b - a); end onNextStep() end end end local function onUartData() fs.read(uartFile, function(err, data, bytesRead) onData(data) end) end -- poll self.uartPoll = uv.new_poll(uartFile) if (self.uartPoll) then uv.poll_start(self.uartPoll, "r", onUartData) end end -- 当开始拨号 function ModemManager:onConnect() local MIN_CONNECT_INTERVAL = 10 local MAX_CONNECT_INTERVAL = 60 local checkTimer local retrtTimes = 0 local now = os.time() local function checkPppdProcess() local filename = '/var/run/ppp0.pid' local filedata = fs.readFileSync(filename) local pid = tonumber(filedata) or '' filename = '/proc/' .. pid local ret = fs.existsSync(filename) if (ret) then clearInterval(checkTimer) checkTimer = nil self.status.pppd = RUNNING self.connectInterval = MIN_CONNECT_INTERVAL console.info("start pppd task success") else retrtTimes = retrtTimes + 1 if (retrtTimes >= 5) then retrtTimes = 0 clearInterval(checkTimer) checkTimer = nil self.status.pppd = IDLE os.execute("killall pppd") console.info("start pppd task failed") end end end if (not self.connectTime) then self.connectTime = now self.connectInterval = MIN_CONNECT_INTERVAL end if (self.connectTime > now) then return end self.connectTime = now + self.connectInterval self.connectInterval = self.connectInterval * 2 if (self.connectInterval > MAX_CONNECT_INTERVAL) then self.connectInterval = MAX_CONNECT_INTERVAL end console.info("start pppd connect") self.status.pppd = STARTING os.execute("route del default") os.execute("killall pppd") os.execute("pppd call quectel-ppp &") checkTimer = setInterval(1000, checkPppdProcess) self:onUpdateStatus() end -- 对 4G 模块进行复位 function ModemManager:onReset() console.info("pppd reset") self:closeUart() self.status.pppd = IDLE devices.setSwitchState("ec20", '0', function() setTimeout(300, function() devices.setSwitchState("ec20", '1', function() os.execute("rm -rf /tmp/ppp/connect-errors") end) end) end) end function ModemManager:onSaveStatus() local data = self:getStatus() local filename = path.join(os.tmpdir, 'run/wan.json') local filedata = json.stringify(data) fs.writeFile(filename, filedata) end -- 定时查询拨号状态 function ModemManager:onUpdateStatus() if (not self.enable) then return end self:openUart() local atCmd = self.atCommands if (self.uartFile and self.uartFile > 0) then self.step = 1 -- start command send fs.writeSync(self.uartFile, nil, atCmd[self.step]) self.uartTimer = setTimeout(1000 * 5, function() self.uartTimer = nil self:closeUart() end) end return 0 end -- 设置是否启用 4G 拨号 -- @param {boolean} isEnabled function ModemManager:setEnabled(isEnabled) if (self.enable == isEnabled) then return end self.enable = isEnabled if (self.enable) then console.info("ppp set enable") self:onConnect() else console.info("ppp set disable") os.execute("killall pppd") end end -- 开始监控 4G 拨号状态 function ModemManager:start() print("Network: start network monitor") -- disconnect timer local disconnectCount = 1 setInterval(1000 * 30, function() if (not self.enable) then return end local params = {} rpc.call('wotc', 'network', params, function(err, result) if (result) then disconnectCount = 1 else disconnectCount = disconnectCount + 1 end end) if (disconnectCount > 5) then console.warn("network status false") disconnectCount = 1 self:onReset() end end) -- update status timer setInterval(1000 * 30, function() self:onUpdateStatus() end) setInterval(1000 * 10, function() if (self.status.pppd == STARTING) then return end local filename = '/var/run/ppp0.pid' local ret = fs.existsSync(filename) if (self.enable) then if (ret) then return end self:onConnect() else if (not ret) then return end os.execute("killall pppd") end end) end -- //////////////////////////////////////////////////////////////////////////// -- networkManager local networkManager = { lanConfig = {}, dhcpConfig = {}} function networkManager.applyNetworkConfig(options) if (not options) then return end networkManager.updateNetworkNameServer(options) -- dns networkManager.updateNetworkAddress(options) networkManager.updateNetworkRouter(options) end function networkManager.getDomainServers() local result = {} local filedata = fs.readFileSync('/etc/resolv.conf') if (not filedata) then return end local lines = filedata:split('\n') for _, line in ipairs(lines) do local tokens = line:split(' ') local server = tokens and tokens[2] if (tokens[1]) and (tokens[1] == 'nameserver') and server then table.insert(result, server) end end return result end function networkManager.getStatus() local status = {} local lanConfig = networkManager.lanConfig or {} status.ifname = lanConfig.ifname or 'eth0' status.dns = networkManager.getDomainServers(); if (lanConfig.proto == "dhcp") then status.dhcp = true local dhcpConfig = networkManager.dhcpConfig or {} status.router = dhcpConfig.router else status.router = lanConfig.router end -- interface local interfaces = os.networkInterfaces() or {} local interface = interfaces[status.ifname] or interfaces['enp3s0'] interface = interface and interface[1] if (interface) then status.ip = interface.ip status.mac = util.hexEncode(interface.mac) status.netmask = interface.netmask end return status end -- update network address & netmask function networkManager.updateNetworkAddress(options) if (not options) or (not options.ip) then return end local ifname = options.ifname or 'eth0' local cmd = "ifconfig " .. ifname .. " " .. options.ip if (options.netmask) then cmd = cmd .. " netmask " .. options.netmask end os.execute(cmd) end -- update default gateway route function networkManager.updateNetworkRouter(options) local ifname = options.ifname or 'eth0' if (modemManager.enable) then return end os.execute("route del default") os.execute("ip route del dev " .. "ppp0") if (not options.router) then return end local cmd = "ip route add default via " .. options.router .. ' dev ' .. ifname os.execute(cmd) end -- update DNS server function networkManager.updateNetworkNameServer(options) if (not options.dns or modemManager.enable) then return end local dns = tostring(options.dns) local tokens = dns:split(' ') local data = '' for _, name in ipairs(tokens) do if (name and #name > 0) then data = data .. 'nameserver ' .. name .. "\n" end end local filename = '/etc/resolv.conf' fs.writeFileSync(filename, data) end function networkManager.readConfigTimer() config.load("network", function(ret, profile) local staticConfig = profile:get('static') or {} local lanConfig = profile:get('lan') or staticConfig local wanConfig = profile:get('wan') or {} lanConfig.ifname = 'eth0' networkManager.lanConfig = lanConfig -- console.log('dhcpConfig', dhcpConfig) -- console.log('networkConfig', networkConfig) -- 向后兼容 if (not wanConfig.proto) and (staticConfig.net_mode == 'ppp') then wanConfig.proto = "ppp" end if (not lanConfig.proto) and (staticConfig.ip_mode == 'dhcp') then lanConfig.proto = "dhcp" end -- LAN settings local isEnabled = (wanConfig.proto == "ppp") modemManager:setEnabled(isEnabled) if (lanConfig.proto == "dhcp") then -- dhcp local filename = path.join(os.tmpdir, 'run/dhcp.json') local dhcpProfile = config.Profile:new(filename) local dhcpConfig = dhcpProfile.settings or {} local updated = dhcpConfig.updated if (updated == networkManager.configUpdated) then return end networkManager.applyNetworkConfig(dhcpConfig) networkManager.configUpdated = updated networkManager.dhcpConfig = dhcpConfig else -- static local updated = profile:get('updated') if (updated == networkManager.configUpdated) then return end networkManager.applyNetworkConfig(lanConfig) networkManager.configUpdated = updated end end) end -- 在后台检测网络配置状态 ---@param interval integer function networkManager.start(interval) interval = (tonumber(interval) or 10) * 1000 networkManager.readConfigTimer() setInterval(interval, function() networkManager.readConfigTimer() end) end -- -------------------- -- exports function exports.getModemManager(callback) if (not modemManager) then modemManager = ModemManager:new() end if (callback) then callback(modemManager) end return modemManager end function exports.getNetworkStatus() local status = {} status.lan = networkManager and networkManager.getStatus() or {} status.wan = modemManager and modemManager:getStatus() or {} return status end function exports.start(interval) modemManager = exports.getModemManager() if (modemManager) then modemManager:start() end networkManager.start(interval) end return exports
-- Roblox character sound script -- brandonisabillionare 2021 local Players = game:GetService("Players") local RunService = game:GetService("RunService") local FootstepsSoundGroup = game:GetService("SoundService"):WaitForChild("Footsteps") local SOUND_DATA = { Climbing = { SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3", Looped = true, }, Died = { SoundId = "rbxasset://sounds/uuhhh.mp3", }, FreeFalling = { SoundId = "rbxasset://sounds/action_falling.mp3", Looped = true, }, GettingUp = { SoundId = "rbxasset://sounds/action_get_up.mp3", }, Jumping = { SoundId = "rbxasset://sounds/action_jump.mp3", }, Landing = { SoundId = "rbxasset://sounds/action_jump_land.mp3", }, Running = { SoundId = '' , Looped = true, Playing = true, Pitch = 1, }, Splash = { SoundId = "rbxasset://sounds/impact_water.mp3", }, Swimming = { SoundId = "rbxasset://sounds/action_swim.mp3", Looped = true, Pitch = 1.6, }, } -- wait for the first of the passed signals to fire local function waitForFirst(...) local shunt = Instance.new("BindableEvent") local slots = {...} local function fire(...) for i = 1, #slots do slots[i]:Disconnect() end return shunt:Fire(...) end for i = 1, #slots do slots[i] = slots[i]:Connect(fire) end return shunt.Event:Wait() end -- map a value from one range to another local function map(x, inMin, inMax, outMin, outMax) return (x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin end local function playSound(sound) sound.TimePosition = 0 sound.Playing = true end local function stopSound(sound) sound.Playing = false sound.TimePosition = 0 end local function initializeSoundSystem(player, humanoid, rootPart) local sounds = {} -- initialize sounds for name, props in pairs(SOUND_DATA) do local sound = Instance.new("Sound") sound.Name = name -- set default values sound.Archivable = false sound.EmitterSize = 5 sound.MaxDistance = 150 sound.Volume = 0.65 for propName, propValue in pairs(props) do sound[propName] = propValue end sound.Parent = rootPart sounds[name] = sound end local playingLoopedSounds = {} local function stopPlayingLoopedSounds(except) for sound in pairs(playingLoopedSounds) do if sound ~= except then sound.Playing = false playingLoopedSounds[sound] = nil end end end -- state transition callbacks local stateTransitions = { [Enum.HumanoidStateType.FallingDown] = function() stopPlayingLoopedSounds() end, [Enum.HumanoidStateType.GettingUp] = function() stopPlayingLoopedSounds() playSound(sounds.GettingUp) end, [Enum.HumanoidStateType.Jumping] = function() stopPlayingLoopedSounds() playSound(sounds.Jumping) end, [Enum.HumanoidStateType.Swimming] = function() local verticalSpeed = math.abs(rootPart.Velocity.Y) if verticalSpeed > 0.1 then sounds.Splash.Volume = math.clamp(map(verticalSpeed, 100, 350, 0.28, 1), 0, 1) playSound(sounds.Splash) end stopPlayingLoopedSounds(sounds.Swimming) sounds.Swimming.Playing = true playingLoopedSounds[sounds.Swimming] = true end, [Enum.HumanoidStateType.Freefall] = function() sounds.FreeFalling.Volume = 0 stopPlayingLoopedSounds(sounds.FreeFalling) playingLoopedSounds[sounds.FreeFalling] = true end, [Enum.HumanoidStateType.Landed] = function() stopPlayingLoopedSounds() local verticalSpeed = math.abs(rootPart.Velocity.Y) if verticalSpeed > 75 then sounds.Landing.Volume = math.clamp(map(verticalSpeed, 50, 100, 0, 1), 0, 1) playSound(sounds.Landing) end end, [Enum.HumanoidStateType.Running] = function() stopPlayingLoopedSounds(sounds.Running) sounds.Running.Playing = true playingLoopedSounds[sounds.Running] = true end, [Enum.HumanoidStateType.Climbing] = function() local sound = sounds.Climbing if math.abs(rootPart.Velocity.Y) > 0.1 then sound.Playing = true stopPlayingLoopedSounds(sound) else stopPlayingLoopedSounds() end playingLoopedSounds[sound] = true end, [Enum.HumanoidStateType.Seated] = function() stopPlayingLoopedSounds() end, [Enum.HumanoidStateType.Dead] = function() stopPlayingLoopedSounds() playSound(sounds.Died) end, } -- updaters for looped sounds local loopedSoundUpdaters = { [sounds.Climbing] = function(dt, sound, vel) sound.Playing = vel.Magnitude > 0.1 end, [sounds.FreeFalling] = function(dt, sound, vel) if vel.Magnitude > 75 then sound.Volume = math.clamp(sound.Volume + 0.9*dt, 0, 1) else sound.Volume = 0 end end, [sounds.Running] = function(dt, sound, vel) --sound.Playing = vel.Magnitude > 0.5 and humanoid.MoveDirection.Magnitude > 0.5 sound.SoundId = FootstepsSoundGroup:WaitForChild(humanoid.FloorMaterial).SoundId sound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild(humanoid.FloorMaterial).PlaybackSpeed * (vel.Magnitude/20) sound.Volume = FootstepsSoundGroup:WaitForChild(humanoid.FloorMaterial).Volume * (vel.Magnitude/12) * humanoid.Parent.Saude.Stances.Loudness.Value sound.EmitterSize = FootstepsSoundGroup:WaitForChild(humanoid.FloorMaterial).Volume * (vel.Magnitude/12) * 50 * humanoid.Parent.Saude.Stances.Loudness.Value if FootstepsSoundGroup:FindFirstChild(humanoid.FloorMaterial) == nil then sound.SoundId = FootstepsSoundGroup:WaitForChild("nil Sound").SoundId sound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild("nil Sound").PlaybackSpeed sound.EmitterSize = FootstepsSoundGroup:WaitForChild("nil Sound").Volume sound.Volume = FootstepsSoundGroup:WaitForChild("nil Sound").Volume end end, } -- state substitutions to avoid duplicating entries in the state table local stateRemap = { [Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running, } local activeState = stateRemap[humanoid:GetState()] or humanoid:GetState() local activeConnections = {} local stateChangedConn = humanoid.StateChanged:Connect(function(_, state) state = stateRemap[state] or state if state ~= activeState then local transitionFunc = stateTransitions[state] if transitionFunc then transitionFunc() end activeState = state end end) local steppedConn = RunService.Stepped:Connect(function(_, worldDt) -- update looped sounds on stepped for sound in pairs(playingLoopedSounds) do local updater = loopedSoundUpdaters[sound] if updater then updater(worldDt, sound, rootPart.Velocity) end end end) local humanoidAncestryChangedConn local rootPartAncestryChangedConn local characterAddedConn local function terminate() stateChangedConn:Disconnect() steppedConn:Disconnect() humanoidAncestryChangedConn:Disconnect() rootPartAncestryChangedConn:Disconnect() characterAddedConn:Disconnect() end humanoidAncestryChangedConn = humanoid.AncestryChanged:Connect(function(_, parent) if not parent then terminate() end end) rootPartAncestryChangedConn = rootPart.AncestryChanged:Connect(function(_, parent) if not parent then terminate() end end) characterAddedConn = player.CharacterAdded:Connect(terminate) end local function playerAdded(player) local function characterAdded(character) -- Avoiding memory leaks in the face of Character/Humanoid/RootPart lifetime has a few complications: -- * character deparenting is a Remove instead of a Destroy, so signals are not cleaned up automatically. -- ** must use a waitForFirst on everything and listen for hierarchy changes. -- * the character might not be in the dm by the time CharacterAdded fires -- ** constantly check consistency with player.Character and abort if CharacterAdded is fired again -- * Humanoid may not exist immediately, and by the time it's inserted the character might be deparented. -- * RootPart probably won't exist immediately. -- ** by the time RootPart is inserted and Humanoid.RootPart is set, the character or the humanoid might be deparented. if not character.Parent then waitForFirst(character.AncestryChanged, player.CharacterAdded) end if player.Character ~= character or not character.Parent then return end local humanoid = character:FindFirstChildOfClass("Humanoid") while character:IsDescendantOf(game) and not humanoid do waitForFirst(character.ChildAdded, character.AncestryChanged, player.CharacterAdded) humanoid = character:FindFirstChildOfClass("Humanoid") end if player.Character ~= character or not character:IsDescendantOf(game) then return end -- must rely on HumanoidRootPart naming because Humanoid.RootPart does not fire changed signals local rootPart = character:FindFirstChild("HumanoidRootPart") while character:IsDescendantOf(game) and not rootPart do waitForFirst(character.ChildAdded, character.AncestryChanged, humanoid.AncestryChanged, player.CharacterAdded) rootPart = character:FindFirstChild("HumanoidRootPart") end if rootPart and humanoid:IsDescendantOf(game) and character:IsDescendantOf(game) and player.Character == character then initializeSoundSystem(player, humanoid, rootPart) end end if player.Character then characterAdded(player.Character) end player.CharacterAdded:Connect(characterAdded) end Players.PlayerAdded:Connect(playerAdded) for _, player in ipairs(Players:GetPlayers()) do playerAdded(player) end repeat wait() until game.Players.LocalPlayer.Character local Character = game.Players.LocalPlayer.Character local Head = Character:WaitForChild("HumanoidRootPart") local RunningSound = Head:WaitForChild("Running") local Humanoid = Character:WaitForChild("Humanoid") local vel = 0 Humanoid.Changed:Connect(function(property) end) Humanoid.Running:connect(function(a) RunningSound.PlaybackSpeed = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).PlaybackSpeed * (a/20) * (math.random(30,50)/40) RunningSound.Volume = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).Volume * (vel/12) RunningSound.EmitterSize = FootstepsSoundGroup:WaitForChild(Humanoid.FloorMaterial).Volume * (vel/12) * 50 vel = a end)
--[[ Click Gui author: Cattyn the code is bad.. sorry. ]]-- function main() local module = Module.new("SimpleGui", "Funny", "VISUAL", this) module:body(function(mod) local gui = GuiBuilder.new("simple gui") local current = 0 local help = { "§eControls: ", "§bUp Arrow§r - step forward", "§bDown Arrow§r - step backward", "§bRight Arrow§r - next page", "§bLeft Arrow§r - previous page", "§bEnter§r - toggle" } local pagesName = { "§eScript Page", "§eModule Page", "§eOption Page" } function page(index) if index == 1 then return client:getScripts() elseif index == 2 then return client:getModuleManager() else return client:getOptions() end end local typing = false local text = "" local currentType = -1 local currentPage = 1 function drawList(matrix, point) renderer:textWithShadow(matrix, pagesName[currentPage], vec2d(point:x() + 6, point:y() - 11 * (current + 1)), color(255, 255, 255, 255)) for i = 0, page(currentPage):size() - 1 do local script = page(currentPage):get(i) local l_text = "s" if currentPage ~= 3 then if script:isToggled() then l_text = string.format("§b%s", script:getName()) else l_text = string.format("%s", script:getName()) end else if typing and i == currentType then l_text = string.format("§b%s§r %s[§e%s§r] <- Editing", script:getFeature():getName(), script:getName(), text) else l_text = string.format("§b%s§r %s[§e%s§r]", script:getFeature():getName(), script:getName(), tostring(script:getValue())) end end renderer:textWithShadow(matrix, l_text, vec2d(point:x() + 6, point:y() + 11 * i - 11 * current), color(255, 255, 255, 255)) end end gui:setRender(function(matrix, point) renderer:rectFilled(matrix, vec2d(0,0), vec2d(renderer:windowWidth(), renderer:windowHeight()), color(0, 0, 0, 150)) for j = 1, #help do renderer:textWithShadow(matrix, help[j], vec2d(2, 2 + 11 * j), color(255, 255, 255, 255)) end drawList(matrix, point) end) function handleType(key, iskeyboard) if key == 257 and iskeyboard or key == 0 and not iskeyboard then if currentPage ~= 3 then page(currentPage):get(current):toggle() else local option = page(currentPage):get(current) if option:is("bool") then option:setValue(not option:getValue()) elseif option:is("combo") then option:increase() elseif option:is("number") or option:is("text") then currentType = current typing = not typing if not typing then option:setStringValue(text) return else text = tostring(option:getValue()) end end end end end gui:setKeyPressed(function(key, scan, modifiers) handleType(key, true) if typing then if key == 259 then text = text:sub(1, -2) end else if key == 265 then current = current - 1 elseif key == 264 then current = current + 1 elseif key == 263 then currentPage = currentPage - 1 elseif key == 262 then currentPage = currentPage + 1 end currentPage = math.min(math.max(1, currentPage), 3) current = math.min(math.max(0, current), page(currentPage):size() - 1) end end) gui:setMouseClicked(function(point, button) handleType(button, false) end) gui:setMouseScrolled(function (point, amount) current = current - amount current = math.min(math.max(0, current), page(currentPage):size() - 1) end) gui:setCharTyped(function (char, modi) if typing then text = text .. string.char(char) end end) local theGui = gui:build() module:onEnable(function() mc:setScreen(theGui) module:setToggled(false) end) end) end
data:extend{ { type = "item-with-entity-data", name = "diesel-locomotive", icon = "__base__/graphics/icons/locomotive.png", icon_size = 64, icon_mipmaps = 4, subgroup = "train-transport", order = "a[train-system]-g[diesel-locomotive]", place_result = "diesel-locomotive", stack_size = 5 }, { type = "item", name = "diesel-locomotive-fuel", icon = "__core__/graphics/empty.png", icon_size = 1, icon_mipmaps = 0, fuel_category = "diesel-locomotive-fuel", fuel_value = data.raw.fluid.diesel.fuel_value, fuel_top_speed_multiplier = 1.3, fuel_acceleration_multiplier = 2.8, subgroup = "train-transport", order = "a[train-system]-g[diesel-locomotive]-z[fuel]", stack_size = 5, flags = { "hidden", "hide-from-fuel-tooltip", "hide-from-bonus-gui" }, } }
a = {} a[2 ^ 31] = 10; a[2 ^ 31 + 1] = 11; a[-2 ^ 31] = 12;
--[[ Config Here ]] local Radio = false -- Radio On/ Off after the engine starts local Time = 15 * 1000 -- Time for each stage (ms) --[[ Hotwire Anim --]] local animDict = "anim@amb@clubhouse@tutorial@bkr_tut_ig3@" local anim = "machinic_loop_mechandplayer" local flags = 49 --[[ Load Anim Dict Function --]] local function loadAnimDict(dict) while (not HasAnimDictLoaded(dict)) do RequestAnimDict(dict) Citizen.Wait(5) end end local vehicle local function disableEngine() Citizen.CreateThread(function() while hotwiring do SetVehicleEngineOn(vehicle, false, true, false) if not hotwiring then break end Citizen.Wait(0) end end) end local function enableUI(time, text) TriggerEvent("mythic_progbar:client:progress", { name = "hotwire_bar", duration = time, label = text, useWhileDead = false, canCancel = true, controlDisables = { disableMovement = true, disableCarMovement = true, disableMouse = false, disableCombat = true, }, animation = { animDict = animDict, anim = anim, }, prop = {} }, function(status) if not status then -- Do Something If Event Wasn't Cancelled end end) end -- --[[ NUI progressBar -- Thanks to https://github.com/chipsahoy6/progressBars --]] -- function startUI(time, text, bgcolor) -- local dcolor = 'rgba(179, 57, 57,0.7)' -- if bgcolor then -- dcolor = bgcolor -- end -- SendNUIMessage({ -- type = "ui", -- display = true, -- time = time, -- text = text, -- color = dcolor -- }) -- end --[[ Main Thread --]] Citizen.CreateThread(function() local player_entity = PlayerPedId() local isOwned = false local model, cid while true do Citizen.Wait(1) if GetSeatPedIsTryingToEnter(player_entity) == -1 then Citizen.Wait(10) vehicle = GetVehiclePedIsTryingToEnter(player_entity) model, cid = exports['vrp']:getVehicleInfo(vehicle) isOwned = false if cid then isOwned = true end if IsVehicleNeedsToBeHotwired(vehicle) then disableEngine() hotwiring = true --loadAnimDict(animDict) Citizen.Wait(7000) ClearPedTasks(player_entity) --TaskPlayAnim(player_entity, animDict, anim, 3.0, 1.0, -1, flags, 1, 0, 0, 0) if hotwiring then enableUI(Time, "Hotwire Stage 1") --startUI(Time, "Hotwire Stage 1", "rgba(194, 54, 22,0.7)") Citizen.Wait(Time+500) enableUI(Time, "Hotwire Stage 2") --startUI(Time, "Hotwire Stage 2", "rgba(232, 65, 24,0.7)") Citizen.Wait(Time+500) if isOwned then enableUI(Time, "Hotwire Stage 3") Citizen.Wait(Time+500) end end if GetVehiclePedIsIn(player_entity, false) == vehicle then hotwiring = false --StopAnimTask(player_entity, animDict, anim, 1.0) Citizen.Wait(1000) SetVehicleEngineOn(vehicle, true, true, false) SetVehicleJetEngineOn(vehicle, true) --RemoveAnimDict(animDict) if not Radio then SetVehicleRadioEnabled(vehicle, false) end end end end end end)
local baseroom, moveroom local dirs = {"n", "s", "w", "e", "nw", "ne", "sw", "se", "u", "d"} if not matches[3] then cecho("\n<white:red>Invalid Usage.<reset>\n") cecho("<blue>/------------------------------------------------------\\<reset>\n") cecho("<blue>| <white>repos [me] <direction> [roomID#]<blue> |<reset>\n") cecho("<blue>\\------------------------------------------------------/<reset>\n") cecho( "<cyan>me and roomID are optional, roomID must be an existing room#. If me is specified, it will place your current room just to the direction specified of your previous room, or of roomID if specified.<reset>\n" ) return end if matches[2] == "me" then baseroom = matches[4] or mmpkg.previousRoom.ID moveroom = gmcp.room.info.num else baseroom = gmcp.room.info.num for _, dir in pairs(dirs) do if matches[3] == dir then if matches[4] then moveroom = matches[4] elseif gmcp.room.info.exits[dir] then moveroom = gmcp.room.info.exits[dir] else cecho("\n<white:red>ERROR: No exit in that direction!.<reset>\n") return end end end end if not roomExists(baseroom) or not roomExists(moveroom) then cecho("\n<white:red>ERROR: RoomID specified does not exist.<reset>\n") return end local x, y, z = getRoomCoordinates(baseroom) local diradd = { u = {x, y, z + 1}, d = {x, y, z - 1}, n = {x, y + 1, z}, s = {x, y - 1, z}, e = {x + 1, y, z}, w = {x - 1, y, z}, ne = {x + 1, y + 1, z}, se = {x + 1, y - 1, z}, nw = {x - 1, y + 1, z}, sw = {x - 1, y - 1, z}, } local repos_str = string.format("\n<white>Repositioning Room# <magenta>%s <white>to the <magenta>%s <white>of Room# <magenta>%s<white>.<reset>\n", moveroom, matches[3], baseroom) cecho(repos_str) setRoomCoordinates(moveroom,unpack(diradd[matches[3]])) updateMap()
local Min, parent = torch.class('nn.Min', 'nn.Module') function Min:__init(dimension) parent.__init(self) dimension = dimension or 1 self.dimension = dimension self.indices = torch.Tensor() end function Min:updateOutput(input) return input.nn.Min_updateOutput(self, input) end function Min:updateGradInput(input, gradOutput) return input.nn.Min_updateGradInput(self, input, gradOutput) end
local myData = {} local messagesDB = require("classes.messagesDB") myData.platform = "iOS" if "simulator" == system.getInfo("environment") and "iP" ~= string.sub( system.getInfo("model"), 1, 2 ) then myData.platform = "Android" elseif "device" == system.getInfo("environment") and "Android" == system.getInfo("platformName" ) then myData.platform = "Android" end myData.init= function() messagesDB.open() myData.messages = {} messagesDB.nrows(function(row) row.selected = false row.noDelete = false table.insert(myData.messages, row) end) end myData.close = function() messagesDB.close() end return myData
local t = Def.ActorFrame {} if NSMAN:IsETTP() then t[#t + 1] = LoadActor("../ScreenSelectMusic decorations/default") return t end t[#t + 1] = LoadActor("../_chatbox") t[#t + 1] = LoadActor("../ScreenSelectMusic decorations/profile") t[#t + 1] = LoadActor("../ScreenSelectMusic decorations/msd") t[#t + 1] = LoadActor("../ScreenSelectMusic decorations/songsearch") t[#t + 1] = LoadActor("tabs") t[#t + 1] = LoadActor("../ScreenSelectMusic decorations/score") t[#t + 1] = LoadActor("dumbrate") t[#t + 1] = LoadActor("../ScreenSelectMusic decorations/filters") local g = Def.ActorFrame { TabChangedMessageCommand = function(self) local top = SCREENMAN:GetTopScreen() if getTabIndex() == 0 then self:visible(true) top:ChatboxVisible(true) top:ChatboxInput(true) else self:visible(false) top:ChatboxVisible(false) top:ChatboxInput(false) end end } g[#g + 1] = Def.Banner { InitCommand = function(self) self:x(10):y(60):halign(0):valign(0) end, SetMessageCommand = function(self) local top = SCREENMAN:GetTopScreen() if top:GetName() == "ScreenSelectMusic" or top:GetName() == "ScreenNetSelectMusic" then local song = GAMESTATE:GetCurrentSong() local group = top:GetMusicWheel():GetSelectedSection() if song then self:LoadFromSong(song) elseif group then self:LoadFromSongGroup(group) end end self:scaletoclipped(capWideScale(get43size(384), 384), capWideScale(get43size(120), 120)) end, CurrentSongChangedMessageCommand = function(self) self:queuecommand("Set") end, CurrentStepsP1ChangedMessageCommand = function(self) self:queuecommand("Set") end, CurrentStepsP2ChangedMessageCommand = function(self) self:queuecommand("Set") end } g[#g + 1] = Def.Quad { InitCommand = function(self) self:xy(10, 60 + capWideScale(get43size(120), 120) - capWideScale(get43size(10), 10)):zoomto( capWideScale(get43size(384), 384), capWideScale(get43size(20), 20) ):halign(0):diffuse(color("#000000")):diffusealpha(0.7) end } g[#g + 1] = LoadFont("Common Normal") .. { Name = "songTitle", InitCommand = function(self) self:xy(15, 60 + capWideScale(get43size(120), 120) - capWideScale(get43size(10), 10)):visible(true):halign(0):zoom( capWideScale(get43size(0.45), 0.45) ):maxwidth(capWideScale(get43size(340), 340) / capWideScale(get43size(0.45), 0.45)) end, BeginCommand = function(self) self:queuecommand("Set") end, SetCommand = function(self) local song = GAMESTATE:GetCurrentSong() if song ~= nil then self:settext(song:GetDisplayMainTitle() .. " // " .. song:GetDisplayArtist()) else self:settext("") end end, CurrentSongChangedMessageCommand = function(self) self:queuecommand("Set") end } g[#g + 1] = LoadActor("wifeonline") g[#g + 1] = LoadActor("onlinebpm") g[#g + 1] = LoadActor("radaronline") g[#g + 1] = Def.ActorFrame { InitCommand = function(self) self:xy(capWideScale(get43size(384), 384) + 26, 70, halign, 0):valign(0):zoom(math.min(1, SCREEN_WIDTH / 854)) end, OffCommand = function(self) self:bouncebegin(0.2):xy(capWideScale(get43size(384), 384) + 26 - 500, 70) -- visible(false() end, OnCommand = function(self) self:bouncebegin(0.2):xy(capWideScale(get43size(384), 384) + 26, 70) end, TabChangedMessageCommand = function(self) self:finishtweening() if getTabIndex() == 0 then self:playcommand("On") else self:playcommand("Off") end end, CurrentSongChangedMessageCommand = function(self) local song = GAMESTATE:GetCurrentSong() if song then self:finishtweening() self:playcommand("TweenOn") elseif not song and self:GetZoomX() == 1 then self:finishtweening() self:playcommand("TweenOff") end end, Def.StepsDisplayList { Name = "StepsDisplayListRow", CursorP1 = Def.ActorFrame { InitCommand = function(self) self:x(55):player(PLAYER_1) end, PlayerJoinedMessageCommand = function(self, params) if params.Player == PLAYER_1 then self:visible(true) self:zoom(0):bounceend(1):zoom(1) end end, PlayerUnjoinedMessageCommand = function(self, params) if params.Player == PLAYER_1 then self:visible(true) self:bouncebegin(1):zoom(0) end end, Def.Quad { InitCommand = function(self) self:zoomto(6, 22):halign(1):valign(0.5) end, BeginCommand = function(self) self:queuecommand("Set") end, SetCommand = function(self) if GAMESTATE:GetNumPlayersEnabled() >= 2 then self:zoomy(11) self:valign(1) else self:zoomy(22) self:valign(0.5) end end, PlayerJoinedMessageCommand = function(self) self:playcommand("Set") end, PlayerUnjoinedMessageCommand = function(self) self:playcommand("Set") end }, LoadFont("Common Normal") .. { InitCommand = function(self) self:x(-1):halign(1):valign(0.5):zoom(0.3):diffuse(color("#000000")) end, BeginCommand = function(self) self:queuecommand("Set") end, SetCommand = function(self) self:settext("1") if GAMESTATE:GetNumPlayersEnabled() >= 2 then self:y(-6) else self:y(0) end end, PlayerJoinedMessageCommand = function(self) self:playcommand("Set") end, PlayerUnjoinedMessageCommand = function(self) self:playcommand("Set") end } }, CursorP2 = Def.ActorFrame { InitCommand = function(self) self:x(55):player(PLAYER_2) end, PlayerJoinedMessageCommand = function(self, params) if params.Player == PLAYER_2 then self:visible(true) self:zoom(0):bounceend(1):zoom(1) end end, PlayerUnjoinedMessageCommand = function(self, params) if params.Player == PLAYER_2 then self:visible(true) self:bouncebegin(1):zoom(0) end end, Def.Quad { InitCommand = function(self) self:zoomto(6, 22):halign(1):valign(0.5) end, BeginCommand = function(self) self:queuecommand("Set") end, SetCommand = function(self) if GAMESTATE:GetNumPlayersEnabled() >= 2 then self:zoomy(11) self:valign(0) else self:zoomy(22) self:valign(0.5) end end, PlayerJoinedMessageCommand = function(self) self:playcommand("Set") end, PlayerUnjoinedMessageCommand = function(self) self:playcommand("Set") end }, LoadFont("Common Normal") .. { InitCommand = function(self) self:x(-1):halign(1):valign(0.5):zoom(0.3):diffuse(color("#000000")) end, BeginCommand = function(self) self:queuecommand("Set") end, SetCommand = function(self) self:settext("2") if GAMESTATE:GetNumPlayersEnabled() >= 2 then self:y(6) else self:y(0) end end, PlayerJoinedMessageCommand = function(self) self:playcommand("Set") end, PlayerUnjoinedMessageCommand = function(self) self:playcommand("Set") end } }, CursorP1Frame = Def.Actor { ChangeCommand = function(self) self:stoptweening():decelerate(0.05) end }, CursorP2Frame = Def.Actor { ChangeCommand = function(self) self:stoptweening():decelerate(0.05) end } } } t[#t + 1] = g return t
bastion_power_flux = class({}) LinkLuaModifier("modifier_bastion_power_flux_lua", "heroes/bastion/bastion_modifiers.lua", LUA_MODIFIER_MOTION_NONE) function bastion_power_flux:OnSpellStart(keys) local level = self:GetLevel() local caster = self:GetCaster() local countNeed = self:GetSpecialValueFor("count_need") local maxValue = self:GetSpecialValueFor("max_value") local buff = caster:FindModifierByName(self:GetIntrinsicModifierName()) local attributeStack = buff:GetStackCount() local target = self:GetCursorTarget() self.powerFluxUseCount = self.powerFluxUseCount or 0 self.powerFluxUseCount = self.powerFluxUseCount+1 if self.powerFluxUseCount == countNeed then self.powerFluxUseCount = 0 if (attributeStack < self:GetSpecialValueFor("max_value") or caster:FindAbilityByName("special_bonus_bastion_1"):GetLevel() > 0) and not caster:PassivesDisabled() then buff:IncrementStackCount() end end target:EmitSound("Hero_Omniknight.Purification") local particle = ParticleManager:CreateParticle("particles/units/heroes/hero_omniknight/omniknight_purification.vpcf", PATTACH_ABSORIGIN_FOLLOW, target) ParticleManager:SetParticleControl(particle, 1, Vector(260, 260, 260)) target:Heal(caster:GetStrength()*self:GetSpecialValueFor("heal_per_str"), caster) end function bastion_power_flux:GetIntrinsicModifierName() return "modifier_bastion_power_flux_lua" end function bastion_power_flux:IsHiddenWhenStolen() return false end
local _ local LIST_WITHDRAW = 1 local LIST_DEPOSIT = 2 local lastUsedBank = 0 local currentUsedBank = 0 local lastActionName local esoSubscriber local function GetCategoryTypeFromWeaponType(bagId, slotIndex) local weaponType = GetItemWeaponType(bagId, slotIndex) if weaponType == WEAPONTYPE_AXE or weaponType == WEAPONTYPE_HAMMER or weaponType == WEAPONTYPE_SWORD or weaponType == WEAPONTYPE_DAGGER then return GAMEPAD_WEAPON_CATEGORY_ONE_HANDED_MELEE elseif weaponType == WEAPONTYPE_TWO_HANDED_SWORD or weaponType == WEAPONTYPE_TWO_HANDED_AXE or weaponType == WEAPONTYPE_TWO_HANDED_HAMMER then return GAMEPAD_WEAPON_CATEGORY_TWO_HANDED_MELEE elseif weaponType == WEAPONTYPE_FIRE_STAFF or weaponType == WEAPONTYPE_FROST_STAFF or weaponType == WEAPONTYPE_LIGHTNING_STAFF then return GAMEPAD_WEAPON_CATEGORY_DESTRUCTION_STAFF elseif weaponType == WEAPONTYPE_HEALING_STAFF then return GAMEPAD_WEAPON_CATEGORY_RESTORATION_STAFF elseif weaponType == WEAPONTYPE_BOW then return GAMEPAD_WEAPON_CATEGORY_TWO_HANDED_BOW elseif weaponType ~= WEAPONTYPE_NONE then return GAMEPAD_WEAPON_CATEGORY_UNCATEGORIZED end end local function GetBestItemCategoryDescription(itemData) local isItemStolen = IsItemStolen(itemData.bagId, itemData.slotIndex) if isItemStolen then return 'Stolen' end if itemData.equipType == EQUIP_TYPE_INVALID then return GetString("SI_ITEMTYPE", itemData.itemType) end local categoryType = GetCategoryTypeFromWeaponType(itemData.bagId, itemData.slotIndex) if categoryType == GAMEPAD_WEAPON_CATEGORY_UNCATEGORIZED then local weaponType = GetItemWeaponType(itemData.bagId, itemData.slotIndex) return GetString("SI_WEAPONTYPE", weaponType) elseif categoryType then return GetString("SI_GAMEPADWEAPONCATEGORY", categoryType) end local armorType = GetItemArmorType(itemData.bagId, itemData.slotIndex) local itemLink = GetItemLink(itemData.bagId,itemData.slotIndex) if armorType ~= ARMORTYPE_NONE then return GetString("SI_ARMORTYPE", armorType).." "..GetString("SI_EQUIPTYPE",GetItemLinkEquipType(itemLink)) end local fullDesc = GetString("SI_ITEMTYPE", itemData.itemType) -- Stops types like "Poison" displaying "Poison" twice if( fullDesc ~= GetString("SI_EQUIPTYPE",GetItemLinkEquipType(itemLink))) then fullDesc = fullDesc.." "..GetString("SI_EQUIPTYPE",GetItemLinkEquipType(itemLink)) end return fullDesc end local function SetupLabelListing(control, data) control:GetNamedChild("Label"):SetText(data.label) if BETTERUI.Settings.Modules["CIM"].skinSize == "Medium" then control:GetNamedChild("Label"):SetFont("ZoFontGamepadCondensed34") elseif BETTERUI.Settings.Modules["CIM"].skinSize == "Large" then control:GetNamedChild("Label"):SetFont("ZoFontGamepad36") end end BETTERUI.Banking.Class = BETTERUI.Interface.Window:Subclass() function BETTERUI.Banking.Class:New(...) return BETTERUI.Interface.Window.New(self, ...) end function BETTERUI.Banking.Class:CurrentUsedBank() if(IsHouseBankBag(GetBankingBag()) == false) then currentUsedBank = BAG_BANK elseif (IsHouseBankBag(GetBankingBag()) == true) then currentUsedBank = GetBankingBag() else currentUsedBank = BAG_BANK end end function BETTERUI.Banking.Class:LastUsedBank() if(IsHouseBankBag(GetBankingBag()) == false) then lastUsedBank = BAG_BANK elseif (IsHouseBankBag(GetBankingBag()) == true) then lastUsedBank = GetBankingBag() else lastUsedBank = BAG_BANK end end function BETTERUI.Banking.Class:RefreshFooter() if(currentUsedBank == BAG_BANK) then --d(IsHouseBankBag()) --IsBankOpen() self.footer.footer:GetNamedChild("DepositButtonSpaceLabel"):SetText(zo_strformat("|t24:24:/esoui/art/inventory/gamepad/gp_inventory_icon_all.dds|t <<1>>",zo_strformat(SI_GAMEPAD_INVENTORY_CAPACITY_FORMAT, GetNumBagUsedSlots(BAG_BACKPACK), GetBagSize(BAG_BACKPACK)))) self.footer.footer:GetNamedChild("WithdrawButtonSpaceLabel"):SetText(zo_strformat("|t24:24:/esoui/art/icons/mapkey/mapkey_bank.dds|t <<1>>",zo_strformat(SI_GAMEPAD_INVENTORY_CAPACITY_FORMAT, GetNumBagUsedSlots(BAG_BANK) + GetNumBagUsedSlots(BAG_SUBSCRIBER_BANK), GetBagUseableSize(BAG_BANK) + GetBagUseableSize(BAG_SUBSCRIBER_BANK)))) else self.footer.footer:GetNamedChild("DepositButtonSpaceLabel"):SetText(zo_strformat("|t24:24:/esoui/art/inventory/gamepad/gp_inventory_icon_all.dds|t <<1>>",zo_strformat(SI_GAMEPAD_INVENTORY_CAPACITY_FORMAT, GetNumBagUsedSlots(BAG_BACKPACK), GetBagSize(BAG_BACKPACK)))) self.footer.footer:GetNamedChild("WithdrawButtonSpaceLabel"):SetText(zo_strformat("|t24:24:/esoui/art/icons/mapkey/mapkey_bank.dds|t <<1>>",zo_strformat(SI_GAMEPAD_INVENTORY_CAPACITY_FORMAT, GetNumBagUsedSlots(currentUsedBank), GetBagUseableSize(currentUsedBank)))) end if((self.currentMode == LIST_WITHDRAW) and (currentUsedBank == BAG_BANK)) then self.footerFragment.control:GetNamedChild("Data1Value"):SetText(BETTERUI.DisplayNumber(GetBankedCurrencyAmount(CURT_MONEY))) self.footerFragment.control:GetNamedChild("Data2Value"):SetText(BETTERUI.DisplayNumber(GetBankedCurrencyAmount(CURT_TELVAR_STONES))) else self.footerFragment.control:GetNamedChild("Data1Value"):SetText(BETTERUI.DisplayNumber(GetCarriedCurrencyAmount(CURT_MONEY))) self.footerFragment.control:GetNamedChild("Data2Value"):SetText(BETTERUI.DisplayNumber(GetCarriedCurrencyAmount(CURT_TELVAR_STONES))) end end function BETTERUI.Banking.Class:RefreshList() lastActionName = nil --d("tt refresh bank list") self.list:OnUpdate() self.list:Clear() self:CurrentUsedBank() -- We have to add 2 rows to the list, one for Withdraw/Deposit GOLD and one for Withdraw/Deposit TEL-VAR local wdString = self.currentMode == LIST_WITHDRAW and GetString(SI_BETTERUI_BANKING_WITHDRAW) or GetString(SI_BETTERUI_BANKING_DEPOSIT) wdString = zo_strformat("<<Z:1>>", wdString) if(currentUsedBank == BAG_BANK) then self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFF"..wdString.." " .. GetString(SI_BETTERUI_CURRENCY_GOLD) .. "|r", currencyType = CURT_MONEY}) self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFF"..wdString.." " .. GetString(SI_BETTERUI_CURRENCY_TEL_VAR) .. "|r", currencyType = CURT_TELVAR_STONES}) self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFF"..wdString.." " .. GetString(SI_BETTERUI_CURRENCY_ALLIANCE_POINT) .. "|r", currencyType = CURT_ALLIANCE_POINTS}) self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFF"..wdString.." " .. GetString(SI_BETTERUI_CURRENCY_WRIT_VOUCHER) .. "|r", currencyType = CURT_WRIT_VOUCHERS}) else if(self.currentMode == LIST_WITHDRAW) then if(GetNumBagUsedSlots(currentUsedBank) == 0) then self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFFHOUSE BANK IS EMPTY!|r"}) else self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFFHOUSE BANK|r"}) end else if(GetNumBagUsedSlots(BAG_BACKPACK) == 0) then self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFFPLAYER BAG IS EMPTY!|r"}) else self.list:AddEntry("BETTERUI_HeaderRow_Template", {label="|cFFFFFFPLAYER BAG|r"}) end end end --fix subscriber bank bag issue checking_bags = {} local slotType if(self.currentMode == LIST_WITHDRAW) then if(currentUsedBank == BAG_BANK) then checking_bags[1] = BAG_BANK checking_bags[2] = BAG_SUBSCRIBER_BANK slotType = SLOT_TYPE_BANK_ITEM else checking_bags[1] = currentUsedBank slotType = SLOT_TYPE_BANK_ITEM end else checking_bags[1] = BAG_BACKPACK slotType = SLOT_TYPE_GAMEPAD_INVENTORY_ITEM end local function IsNotStolenItem(itemData) local isNotStolen = not itemData.stolen return isNotStolen end --excludes stolen items local filteredDataTable = SHARED_INVENTORY:GenerateFullSlotData(IsNotStolenItem, unpack(checking_bags)) --d("tt bank refreshed items: " .. #filteredDataTable) local tempDataTable = {} for i = 1, #filteredDataTable do local itemData = filteredDataTable[i] --use custom categories local customCategory, matched, catName, catPriority = BETTERUI.GetCustomCategory(itemData) if customCategory and not matched then itemData.bestItemTypeName = zo_strformat(SI_INVENTORY_HEADER, GetBestItemCategoryDescription(itemData)) itemData.bestItemCategoryName = AC_UNGROUPED_NAME itemData.sortPriorityName = string.format("%03d%s", 999 , catName) else if customCategory then itemData.bestItemTypeName = zo_strformat(SI_INVENTORY_HEADER, GetBestItemCategoryDescription(itemData)) itemData.bestItemCategoryName = catName itemData.sortPriorityName = string.format("%03d%s", 100 - catPriority , catName) else itemData.bestItemTypeName = zo_strformat(SI_INVENTORY_HEADER, GetBestItemCategoryDescription(itemData)) itemData.bestItemCategoryName = itemData.bestItemTypeName itemData.sortPriorityName = itemData.bestItemCategoryName end end local slotIndex = GetItemCurrentActionBarSlot(itemData.bagId, itemData.slotIndex) itemData.isEquippedInCurrentCategory = slotIndex and true or nil table.insert(tempDataTable, itemData) ZO_InventorySlot_SetType(itemData, slotType) end filteredDataTable = tempDataTable table.sort(filteredDataTable, BETTERUI_GamepadInventory_DefaultItemSortComparator) local currentBestCategoryName for i, itemData in ipairs(filteredDataTable) do local data = ZO_GamepadEntryData:New(itemData.name, itemData.iconFile) data.InitializeInventoryVisualData = BETTERUI.Inventory.Class.InitializeInventoryVisualData data:InitializeInventoryVisualData(itemData) local remaining, duration remaining, duration = GetItemCooldownInfo(itemData.bagId, itemData.slotIndex) if remaining > 0 and duration > 0 then data:SetCooldown(remaining, duration) end data.bestItemCategoryName = itemData.bestItemCategoryName data.bestGamepadItemCategoryName = itemData.bestItemCategoryName data.isEquippedInCurrentCategory = itemData.isEquippedInCurrentCategory data.isEquippedInAnotherCategory = itemData.isEquippedInAnotherCategory data.isJunk = itemData.isJunk if (not data.isJunk and not showJunkCategory) or (data.isJunk and showJunkCategory) then if data.bestGamepadItemCategoryName ~= currentBestCategoryName then currentBestCategoryName = data.bestGamepadItemCategoryName data:SetHeader(currentBestCategoryName) if((AutoCategory) and ((GetNumBagUsedSlots(currentUsedBank) ~= 0) or (GetNumBagUsedSlots(BAG_BACKPACK) ~= 0))) then self.list:AddEntryWithHeader("BETTERUI_GamepadItemSubEntryTemplate", data) else self.list:AddEntry("BETTERUI_GamepadItemSubEntryTemplate", data) end else self.list:AddEntry("BETTERUI_GamepadItemSubEntryTemplate", data) end end end self.list:Commit() self:ReturnToSaved() self:UpdateActions() self:RefreshFooter() end function BETTERUI.Banking.Class:RefreshCurrencyTooltip() if SCENE_MANAGER.scenes['gamepad_banking']:IsShowing() and self:GetList().selectedData.label ~= nil then GAMEPAD_TOOLTIPS:LayoutBankCurrencies(GAMEPAD_LEFT_TOOLTIP, ZO_BANKABLE_CURRENCIES) end end local function OnItemSelectedChange(self, list, selectedData) -- Check if we are on the "Deposit/withdraw" gold/telvar row if not SCENE_MANAGER.scenes['gamepad_banking']:IsShowing() then return end if(currentUsedBank == BAG_BANK) then if(selectedData.label ~= nil) then -- Yes! We are, so add the "withdraw/deposit gold/telvar" keybinds here KEYBIND_STRIP:RemoveKeybindButtonGroup(self.withdrawDepositKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.currencyKeybinds) KEYBIND_STRIP:UpdateKeybindButtonGroup(self.currencyKeybinds) --GAMEPAD_TOOLTIPS:ClearTooltip(GAMEPAD_LEFT_TOOLTIP) self:RefreshCurrencyTooltip() else -- We are not, add the "withdraw/deposit" keybinds here KEYBIND_STRIP:RemoveKeybindButtonGroup(self.currencyKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.withdrawDepositKeybinds) KEYBIND_STRIP:UpdateKeybindButtonGroup(self.withdrawDepositKeybinds) GAMEPAD_TOOLTIPS:LayoutBagItem(GAMEPAD_LEFT_TOOLTIP, selectedData.bagId, selectedData.slotIndex) end else KEYBIND_STRIP:RemoveKeybindButtonGroup(self.currencyKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.withdrawDepositKeybinds) KEYBIND_STRIP:UpdateKeybindButtonGroup(self.withdrawDepositKeybinds) GAMEPAD_TOOLTIPS:LayoutBagItem(GAMEPAD_LEFT_TOOLTIP, selectedData.bagId, selectedData.slotIndex) self:RefreshCurrencyTooltip() end self:UpdateActions() end local function SetupItemList(list) list:AddDataTemplate("BETTERUI_GamepadItemSubEntryTemplate", BETTERUI_SharedGamepadEntry_OnSetup, ZO_GamepadMenuEntryTemplateParametricListFunction, MenuEntryTemplateEquality) list:AddDataTemplateWithHeader("BETTERUI_GamepadItemSubEntryTemplate", BETTERUI_SharedGamepadEntry_OnSetup, ZO_GamepadMenuEntryTemplateParametricListFunction, MenuEntryTemplateEquality, "ZO_GamepadMenuEntryHeaderTemplate") end function BETTERUI.Banking.Class:Initialize(tlw_name, scene_name) BETTERUI.Interface.Window.Initialize(self, tlw_name, scene_name) self:InitializeKeybind() self:InitializeList() self.itemActions = BETTERUI.Inventory.SlotActions:New(KEYBIND_STRIP_ALIGN_LEFT) self.itemActions:SetUseKeybindStrip(false) self:InitializeActionsDialog() local function CallbackSplitStackFinished() --refresh list if SCENE_MANAGER.scenes['gamepad_banking']:IsShowing() then --d("tt bank split") SHARED_INVENTORY:PerformFullUpdateOnBagCache(currentUsedBank) self:RefreshList() self:ReturnToSaved() end end CALLBACK_MANAGER:RegisterCallback("BETTERUI_EVENT_SPLIT_STACK_DIALOG_FINISHED", CallbackSplitStackFinished) self.list.maxOffset = 30 self.list:SetHeaderPadding(GAMEPAD_HEADER_DEFAULT_PADDING * 0.75, GAMEPAD_HEADER_SELECTED_PADDING * 0.75) self.list:SetUniversalPostPadding(GAMEPAD_DEFAULT_POST_PADDING * 0.75) -- Setup data templates of the lists SetupItemList(self.list) self:AddTemplate("BETTERUI_HeaderRow_Template",SetupLabelListing) self.currentMode = LIST_WITHDRAW self.lastPositions = { [LIST_WITHDRAW] = 1, [LIST_DEPOSIT] = 1 } self.selectedDataCallback = OnItemSelectedChange -- this is essentially a way to encapsulate a function which allows us to override "selectedDataCallback" but still keep some logic code local function SelectionChangedCallback(list, selectedData) local selectedControl = list:GetSelectedControl() if self.selectedDataCallback then self:selectedDataCallback(selectedControl, selectedData) end if selectedControl and selectedControl.bagId then SHARED_INVENTORY:ClearNewStatus(selectedControl.bagId, selectedControl.slotIndex) self:GetParametricList():RefreshList() end end -- these are event handlers which are specific to the banking interface. Handling the events this way encapsulates the banking interface -- these local functions are essentially just router functions to other functions within this class. it is done in this way to allow for -- us to access this classes' members (through "self") local function UpdateSingle_Handler(eventId, bagId, slotId, isNewItem, itemSound) self:UpdateSingleItem(bagId, slotId) self:RefreshList() self:selectedDataCallback(self.list:GetSelectedControl(), self.list:GetSelectedData()) end local function UpdateCurrency_Handler() self:RefreshFooter() KEYBIND_STRIP:UpdateKeybindButtonGroup(self.coreKeybinds) self:RefreshCurrencyTooltip() end local function OnEffectivelyShown() self:CurrentUsedBank() if self.isDirty then self:RefreshList() elseif self.selectedDataCallback then self:selectedDataCallback(self.list:GetSelectedControl(), self.list:GetSelectedData()) end self.list:Activate() if wykkydsToolbar then wykkydsToolbar:SetHidden(true) end self.control:RegisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE, UpdateSingle_Handler) self:RefreshList() end local function OnEffectivelyHidden() self:LastUsedBank() self:CancelWithdrawDeposit(self.list) self.list:Deactivate() self.selector:Deactivate() KEYBIND_STRIP:RemoveAllKeyButtonGroups() GAMEPAD_TOOLTIPS:Reset(GAMEPAD_LEFT_TOOLTIP) if wykkydsToolbar then wykkydsToolbar:SetHidden(false) end self.control:UnregisterForEvent(EVENT_INVENTORY_FULL_UPDATE) self.control:UnregisterForEvent(EVENT_INVENTORY_SINGLE_SLOT_UPDATE) end local selectorContainer = self.control:GetNamedChild("Container"):GetNamedChild("InputContainer") self.selector = ZO_CurrencySelector_Gamepad:New(selectorContainer:GetNamedChild("Selector")) self.selector:SetClampValues(true) self.selectorCurrency = selectorContainer:GetNamedChild("CurrencyTexture") self.list:SetOnSelectedDataChangedCallback(SelectionChangedCallback) self.control:SetHandler("OnEffectivelyShown", OnEffectivelyShown) self.control:SetHandler("OnEffectivelyHidden", OnEffectivelyHidden) -- Always-running event listeners, these don't add much overhead self.control:RegisterForEvent(EVENT_CARRIED_CURRENCY_UPDATE, UpdateCurrency_Handler) self.control:RegisterForEvent(EVENT_BANKED_CURRENCY_UPDATE, UpdateCurrency_Handler) end -- Calling this function will add keybinds to the strip, likely using the primary key -- The primary key will conflict with the category keybind descriptor if added function BETTERUI.Banking.Class:RefreshItemActions() local targetData = self:GetList().selectedData --self:SetSelectedInventoryData(targetData) instead: self.itemActions:SetInventorySlot(targetData) end function BETTERUI.Banking.Class:ActionsDialogSetup(dialog) dialog.entryList:SetOnSelectedDataChangedCallback( function(list, selectedData) self.itemActions:SetSelectedAction(selectedData and selectedData.action) end) local parametricList = dialog.info.parametricList ZO_ClearNumericallyIndexedTable(parametricList) self:RefreshItemActions() --self:RefreshItemActions() local actions = self.itemActions:GetSlotActions() local numActions = actions:GetNumSlotActions() for i = 1, numActions do local action = actions:GetSlotAction(i) local actionName = actions:GetRawActionName(action) local entryData = ZO_GamepadEntryData:New(actionName) entryData:SetIconTintOnSelection(true) entryData.action = action entryData.setup = ZO_SharedGamepadEntry_OnSetup local listItem = { template = "ZO_GamepadItemEntryTemplate", entryData = entryData, } --if actionName ~= "Use" and actionName ~= "Equip" and i ~= 1 then table.insert(parametricList, listItem) --end end dialog:setupFunc() end function BETTERUI.Banking.Class:InitializeActionsDialog() local function ActionDialogSetup(dialog) if SCENE_MANAGER.scenes['gamepad_banking']:IsShowing() then --d("tt bank action setup") dialog.entryList:SetOnSelectedDataChangedCallback( function(list, selectedData) self.itemActions:SetSelectedAction(selectedData and selectedData.action) end) local parametricList = dialog.info.parametricList ZO_ClearNumericallyIndexedTable(parametricList) self:RefreshItemActions() local actions = self.itemActions:GetSlotActions() local numActions = actions:GetNumSlotActions() for i = 1, numActions do local action = actions:GetSlotAction(i) local actionName = actions:GetRawActionName(action) local entryData = ZO_GamepadEntryData:New(actionName) entryData:SetIconTintOnSelection(true) entryData.action = action entryData.setup = ZO_SharedGamepadEntry_OnSetup local listItem = { template = "ZO_GamepadItemEntryTemplate", entryData = entryData, } lastActionName = actionName --if actionName ~= "Use" and actionName ~= "Equip" and i ~= 1 then table.insert(parametricList, listItem) end dialog:setupFunc() end end local function ActionDialogFinish() if SCENE_MANAGER.scenes['gamepad_banking']:IsShowing() then --d("tt bank action finish") -- make sure to wipe out the keybinds added by actions self:AddKeybinds() --restore the selected inventory item self:RefreshItemActions() --refresh so keybinds react to newly selected item --self:RefreshActiveKeybinds() self:RefreshList() --if self.actionMode == CATEGORY_ITEM_ACTION_MODE then -- self:RefreshCategoryList() --end end end local function ActionDialogButtonConfirm(dialog) if SCENE_MANAGER.scenes['gamepad_banking']:IsShowing() then --d(ZO_InventorySlotActions:GetRawActionName(self.itemActions.selectedAction)) if (lastActionName ~= nil) then if ((ZO_InventorySlotActions:GetRawActionName(self.itemActions.selectedAction) == GetString(SI_ITEM_ACTION_LINK_TO_CHAT)) and (ZO_InventorySlotActions:GetRawActionName(self.itemActions.selectedAction) ~= nil)) then --Also perform bag stack! --StackBag(BAG_BACKPACK) --link in chat local targetData = self:GetList().selectedData local itemLink local bag, slot = ZO_Inventory_GetBagAndIndex(targetData) if bag and slot then itemLink = GetItemLink(bag, slot) end if itemLink then ZO_LinkHandler_InsertLink(zo_strformat("[<<2>>]", SI_TOOLTIP_ITEM_NAME, itemLink)) end else self.itemActions:DoSelectedAction() end else return end lastActionName = nil end end CALLBACK_MANAGER:RegisterCallback("BETTERUI_EVENT_ACTION_DIALOG_SETUP", ActionDialogSetup) CALLBACK_MANAGER:RegisterCallback("BETTERUI_EVENT_ACTION_DIALOG_FINISH", ActionDialogFinish) CALLBACK_MANAGER:RegisterCallback("BETTERUI_EVENT_ACTION_DIALOG_BUTTON_CONFIRM", ActionDialogButtonConfirm) end -- Thanks to Ayantir for the following method to quickly return the next free slotIndex! local tinyBagCache = { [BAG_BACKPACK] = {}, [currentUsedBank] = {}, } -- Thanks Merlight & circonian, FindFirstEmptySlotInBag don't refresh in realtime. local function FindEmptySlotInBag(bagId) if false then for slotIndex = 0, (GetBagSize(bagId) - 1) do if not SHARED_INVENTORY.bagCache[bagId][slotIndex] and not tinyBagCache[bagId][slotIndex] then tinyBagCache[bagId][slotIndex] = true return slotIndex end end return nil else return FindFirstEmptySlotInBag(bagId) end end local function FindEmptySlotInBank() if(IsHouseBankBag(GetBankingBag()) == false) then local emptySlotIndexBank = FindEmptySlotInBag(BAG_BANK) local emptySlotIndexSubscriber = FindEmptySlotInBag(BAG_SUBSCRIBER_BANK) if emptySlotIndexBank ~= nil then return BAG_BANK, emptySlotIndexBank elseif esoSubscriber and emptySlotIndexSubscriber ~= nil then return BAG_SUBSCRIBER_BANK, emptySlotIndexSubscriber else return nil end else local emptySlotIndex = FindEmptySlotInBag(currentUsedBank) if emptySlotIndex ~= nil then return currentUsedBank, emptySlotIndex else return currentUsedBank, nil end end end function BETTERUI.Banking.Class:ActivateSpinner() self.spinner:SetHidden(false) self.spinner:Activate() if(self:GetList() ~= nil) then self:GetList():Deactivate() KEYBIND_STRIP:RemoveAllKeyButtonGroups() KEYBIND_STRIP:AddKeybindButtonGroup(self.spinnerKeybindStripDescriptor) end end function BETTERUI.Banking.Class:DeactivateSpinner() self.spinner:SetValue(1) self.spinner:SetHidden(true) self.spinner:Deactivate() if(self:GetList() ~= nil) then self:GetList():Activate() KEYBIND_STRIP:RemoveAllKeyButtonGroups() KEYBIND_STRIP:AddKeybindButtonGroup(self.withdrawDepositKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.coreKeybinds) end end function BETTERUI.Banking.Class:MoveItem(list, quantity) local fromBag, fromBagIndex = ZO_Inventory_GetBagAndIndex(list:GetSelectedData()) local stackCount = GetSlotStackSize(fromBag, fromBagIndex) local fromBagItemLink = GetItemLink(fromBag, fromBagIndex) local toBag local toBagEmptyIndex local toBagIndex local toBagItemLink local toBagStackCount local toBagStackCountMax local isToBagItemStackable local inSpinner = false if quantity ~= nil then --in spinner inSpinner = true else --not in spinner if(stackCount > 1) then -- display the spinner self:UpdateSpinnerConfirmation(true, self.list) self:SetSpinnerValue(list:GetSelectedData().stackCount, list:GetSelectedData().stackCount) return else --since stackcount = 1 quantity = 1 end end if self.currentMode == LIST_WITHDRAW then --we are withdrawing item from bank/subscriber bank bag toBag = BAG_BACKPACK toBagEmptyIndex = FindEmptySlotInBag(toBag) else --we are depositing item to bank/subscriber bank bag toBag, toBagEmptyIndex = FindEmptySlotInBank() end if toBagEmptyIndex ~= nil then --good to move CallSecureProtected("RequestMoveItem", fromBag, fromBagIndex, toBag, toBagEmptyIndex, quantity) if inSpinner then self:UpdateSpinnerConfirmation(false, self.list) end -- Accomodates full banks with stackable item slots available else if toBag ~= nil then local errorStringId = (toBag == BAG_BACKPACK) and SI_INVENTORY_ERROR_INVENTORY_FULL or SI_INVENTORY_ERROR_BANK_FULL -- Get bag size local bagSize = GetBagSize(toBag) -- Iterate through BAG for i = 0, bagSize do local currentItemLink = GetItemLink(toBag, i) -- Matches items from origin bag to destination bag if currentItemLink == fromBagItemLink then toBagItemLink = currentItemLink isToBagItemStackable = IsItemLinkStackable(toBagItemLink) -- Confirms item matched is stackable if isToBagItemStackable then toBagStackCount, toBagStackCountMax = GetSlotStackSize(toBag, i) if toBagStackCount < toBagStackCountMax then toBagIndex = i end end end end if toBagIndex then --good to move item that already has a non-full stack in the destination bag CallSecureProtected("RequestMoveItem", fromBag, fromBagIndex, toBag, toBagIndex, quantity) if inSpinner then self:UpdateSpinnerConfirmation(false, self.list) end else ZO_Alert(UI_ALERT_CATEGORY_ERROR, SOUNDS.NEGATIVE_CLICK, errorStringId) if inSpinner then self:UpdateSpinnerConfirmation(false, self.list) end end else local banks = {BAG_BANK, BAG_SUBSCRIBER_BANK} for bankBags = 1, 2 do local bank = banks[bankBags] -- Get bag size local bagSize = GetBagSize(bank) -- Iterate through BAG for i = 0, bagSize do local currentItemLink = GetItemLink(bank, i) -- Matches items from origin bag to destination bag if currentItemLink == fromBagItemLink then toBagItemLink = currentItemLink isToBagItemStackable = IsItemLinkStackable(toBagItemLink) -- Confirms item matched is stackable if isToBagItemStackable then toBagStackCount, toBagStackCountMax = GetSlotStackSize(bank, i) if toBagStackCount < toBagStackCountMax then toBagIndex = i toBag = bank end end end end end if toBagIndex and toBag then CallSecureProtected("RequestMoveItem", fromBag, fromBagIndex, toBag, toBagIndex, quantity) if inSpinner then self:UpdateSpinnerConfirmation(false, self.list) end else local errorStringId = (toBag == BAG_BACKPACK) and SI_INVENTORY_ERROR_INVENTORY_FULL or SI_INVENTORY_ERROR_BANK_FULL ZO_Alert(UI_ALERT_CATEGORY_ERROR, SOUNDS.NEGATIVE_CLICK, errorStringId) if inSpinner then self:UpdateSpinnerConfirmation(false, self.list) end end end end end function BETTERUI.Banking.Class:CancelWithdrawDeposit(list) local DEACTIVATE_SPINNER = false if self.confirmationMode then self:UpdateSpinnerConfirmation(DEACTIVATE_SPINNER, list) else SCENE_MANAGER:HideCurrentScene() end end function BETTERUI.Banking.Class:DisplaySelector(currencyType) local currency_max if(self.currentMode == LIST_DEPOSIT) then currency_max = GetCarriedCurrencyAmount(currencyType) else currency_max = GetBankedCurrencyAmount(currencyType) end -- Does the player actually have anything that can be transferred? if(currency_max ~= 0) then self.selector:SetMaxValue(currency_max) self.selector:SetClampValues(0, currency_max) self.selector.control:GetParent():SetHidden(false) local CURRENCY_TYPE_TO_TEXTURE = { [CURT_MONEY] = "EsoUI/Art/currency/gamepad/gp_gold.dds", [CURT_TELVAR_STONES] = "EsoUI/Art/currency/gamepad/gp_telvar.dds", [CURT_ALLIANCE_POINTS] = "esoui/art/currency/gamepad/gp_alliancepoints.dds", [CURT_WRIT_VOUCHERS] = "EsoUI/Art/currency/gamepad/gp_writvoucher.dds", } self.selectorCurrency:SetTexture(CURRENCY_TYPE_TO_TEXTURE[currencyType]) self.selector:Activate() self.list:Deactivate() KEYBIND_STRIP:RemoveKeybindButtonGroup(self.currencyKeybinds) KEYBIND_STRIP:RemoveKeybindButtonGroup(self.coreKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.currencySelectorKeybinds) else -- No, display an alert ZO_AlertNoSuppression(UI_ALERT_CATEGORY_ALERT, nil, "Not enough funds available for transfer.") end end function BETTERUI.Banking.Class:HideSelector() self.selector.control:GetParent():SetHidden(true) self.selector:Deactivate() self.list:Activate() KEYBIND_STRIP:RemoveKeybindButtonGroup(self.currencySelectorKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.currencyKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.coreKeybinds) end function BETTERUI.Banking.Class:CreateListTriggerKeybindDescriptors(list) local leftTrigger = { keybind = "UI_SHORTCUT_LEFT_TRIGGER", ethereal = true, callback = function() local list = self.list if not list:IsEmpty() then list:SetSelectedIndex(list.selectedIndex-tonumber(BETTERUI.Settings.Modules["CIM"].triggerSpeed)) end end } local rightTrigger = { keybind = "UI_SHORTCUT_RIGHT_TRIGGER", ethereal = true, callback = function() local list = self.list if not list:IsEmpty() then list:SetSelectedIndex(list.selectedIndex+tonumber(BETTERUI.Settings.Modules["CIM"].triggerSpeed)) end end, } return leftTrigger, rightTrigger end function BETTERUI.Banking.Class:UpdateActions() local targetData = self:GetList().selectedData -- since SetInventorySlot also adds/removes keybinds, the order which we call these 2 functions is important -- based on whether we are looking at an item or a faux-item if ZO_GamepadBanking.IsEntryDataCurrencyRelated(targetData) then --d("tt currency") self.itemActions:SetInventorySlot(nil) else --d("tt targetData, slotType:" .. targetData.slotType) self.itemActions:SetInventorySlot(targetData) end end function BETTERUI.Banking.Class:AddKeybinds() KEYBIND_STRIP:RemoveAllKeyButtonGroups() KEYBIND_STRIP:AddKeybindButtonGroup(self.withdrawDepositKeybinds) KEYBIND_STRIP:AddKeybindButtonGroup(self.coreKeybinds) self:UpdateActions() end function BETTERUI.Banking.Class:RemoveKeybinds() KEYBIND_STRIP:RemoveKeybindButtonGroup(self.withdrawDepositKeybinds) KEYBIND_STRIP:RemoveKeybindButton(self.coreKeybinds) end function BETTERUI.Banking.Class:ShowActions() self:RemoveKeybinds() local function OnActionsFinishedCallback() self:AddKeybinds() end local dialogData = { targetData = self:GetList().selectedData, finishedCallback = OnActionsFinishedCallback, itemActions = self.itemActions, } ZO_Dialogs_ShowPlatformDialog(ZO_GAMEPAD_INVENTORY_ACTION_DIALOG, dialogData) end function BETTERUI.Banking.Class:InitializeKeybind() if not BETTERUI.Settings.Modules["Banking"].m_enabled then return end self.coreKeybinds = { alignment = KEYBIND_STRIP_ALIGN_LEFT, { name = GetString(SI_BETTERUI_BANKING_TOGGLE_LIST), keybind = "UI_SHORTCUT_SECONDARY", callback = function() self:ToggleList(self.currentMode == LIST_DEPOSIT) end, visible = function() return true end, enabled = true, }, { keybind = "UI_SHORTCUT_RIGHT_STICK", name = function() local cost = GetNextBankUpgradePrice() if GetCarriedCurrencyAmount(CURT_MONEY) >= cost then return zo_strformat(SI_BANK_UPGRADE_TEXT, ZO_CurrencyControl_FormatCurrency(cost), ZO_GAMEPAD_GOLD_ICON_FORMAT_24) end return zo_strformat(SI_BANK_UPGRADE_TEXT, ZO_ERROR_COLOR:Colorize(ZO_CurrencyControl_FormatCurrency(cost)), ZO_GAMEPAD_GOLD_ICON_FORMAT_24) end, visible = function() return IsBankUpgradeAvailable() end, enabled = function() return GetCarriedCurrencyAmount(CURT_MONEY) >= GetNextBankUpgradePrice() end, callback = function() if GetNextBankUpgradePrice() > GetCarriedCurrencyAmount(CURT_MONEY) then ZO_AlertNoSuppression(UI_ALERT_CATEGORY_ALERT, nil, GetString(SI_BUY_BANK_SPACE_CANNOT_AFFORD)) else KEYBIND_STRIP:RemoveKeybindButtonGroup(self.mainKeybindStripDescriptor) DisplayBankUpgrade() end end }, { name = GetString(SI_GAMEPAD_INVENTORY_ACTION_LIST_KEYBIND), keybind = "UI_SHORTCUT_TERTIARY", order = 1000, visible = function() return self.selectedItemUniqueId ~= nil or self:GetList().selectedData ~= nil end, callback = function() self:SaveListPosition() self:ShowActions() end, }, { alignment = KEYBIND_STRIP_ALIGN_LEFT, name = GetString(SI_ITEM_ACTION_STACK_ALL), keybind = "UI_SHORTCUT_LEFT_STICK", order = 1500, disabledDuringSceneHiding = true, callback = function() if(self.currentMode == LIST_WITHDRAW) then if(currentUsedBank == BAG_BANK) then StackBag(BAG_BANK) StackBag(BAG_SUBSCRIBER_BANK) else StackBag(currentUsedBank) end else StackBag(BAG_BACKPACK) end end, }, } self.withdrawDepositKeybinds = { alignment = KEYBIND_STRIP_ALIGN_LEFT, { name = function() return (self.currentMode == LIST_WITHDRAW) and GetString(SI_BETTERUI_BANKING_WITHDRAW) or GetString(SI_BETTERUI_BANKING_DEPOSIT) end, keybind = "UI_SHORTCUT_PRIMARY", callback = function() self:SaveListPosition() self:MoveItem(self.list) end, visible = function() return true end, enabled = true, }, } self.currencySelectorKeybinds = { alignment = KEYBIND_STRIP_ALIGN_LEFT, { name = GetString(SI_BETTERUI_CONFIRM_AMOUNT), keybind = "UI_SHORTCUT_PRIMARY", visible = function() return true end, callback = function() local amount = self.selector:GetValue() local currencyType = self:GetList().selectedData.currencyType if(self.currentMode == LIST_WITHDRAW) then WithdrawCurrencyFromBank(currencyType, amount) else DepositCurrencyIntoBank(currencyType, amount) end self:HideSelector() self:RefreshFooter() KEYBIND_STRIP:UpdateKeybindButtonGroup(self.coreKeybinds) end, } } self.currencyKeybinds = { alignment = KEYBIND_STRIP_ALIGN_LEFT, { name = function() return self:GetList().selectedData.label end, keybind = "UI_SHORTCUT_PRIMARY", callback = function() self:SaveListPosition() self:DisplaySelector(self:GetList().selectedData.currencyType) end, visible = function() return true end, enabled = true, }, } ZO_Gamepad_AddBackNavigationKeybindDescriptors(self.coreKeybinds, GAME_NAVIGATION_TYPE_BUTTON) -- "Back" ZO_Gamepad_AddBackNavigationKeybindDescriptors(self.currencySelectorKeybinds, GAME_NAVIGATION_TYPE_BUTTON, function() self:HideSelector() end) self.triggerSpinnerBinds = {} local leftTrigger, rightTrigger = self:CreateListTriggerKeybindDescriptors(self.list) table.insert(self.coreKeybinds, leftTrigger) table.insert(self.coreKeybinds, rightTrigger) self.spinnerKeybindStripDescriptor = { alignment = KEYBIND_STRIP_ALIGN_LEFT, { name = GetString(SI_BETTERUI_CONFIRM), keybind = "UI_SHORTCUT_PRIMARY", callback = function() self:SaveListPosition() self:MoveItem(self.list, self.spinner:GetValue()) end, visible = function() return true end, enabled = true, }, } ZO_Gamepad_AddBackNavigationKeybindDescriptors(self.spinnerKeybindStripDescriptor, GAME_NAVIGATION_TYPE_BUTTON, function() local list = self.list self:CancelWithdrawDeposit(list) KEYBIND_STRIP:AddKeybindButtonGroup(self.coreKeybinds) end) end function BETTERUI.Banking.Class:SaveListPosition() -- Able to return to the current position again! self.lastPositions[self.currentMode] = self.list.selectedIndex end function BETTERUI.Banking.Class:ReturnToSaved() self:CurrentUsedBank() local lastPosition = self.lastPositions[self.currentMode] if(self.currentMode == LIST_WITHDRAW) then if(lastUsedBank ~= currentUsedBank) then self.list:SetSelectedIndexWithoutAnimation(1, true, false) self:SaveListPosition() self.currentMode = LIST_DEPOSIT self.list:SetSelectedIndexWithoutAnimation(1, true, false) self:SaveListPosition() self.currentMode = LIST_WITHDRAW self:LastUsedBank() self:RefreshList() else self.list:SetSelectedIndexWithoutAnimation(lastPosition, true, false) end else if(lastUsedBank ~= currentUsedBank) then self.list:SetSelectedIndexWithoutAnimation(1, true, false) self:SaveListPosition() self:LastUsedBank() self.currentMode = LIST_WITHDRAW self:ToggleList(self.currentMode == LIST_WITHDRAW) else self.list:SetSelectedIndexWithoutAnimation(lastPosition, true, false) end end end -- Go through and get the item which has been passed to us through the event function BETTERUI.Banking.Class:UpdateSingleItem(bagId, slotIndex) if GetSlotStackSize(bagId, slotIndex) > 0 then self:RefreshList() return else self:RefreshList() end for index = 1, #self.list.dataList do if self.list.dataList[index].bagId == bagId and self.list.dataList[index].slotIndex == slotIndex then self:RemoveItemStack(index) break end end end -- This is the final function for the Event "EVENT_INVENTORY_SINGLE_SLOT_UPDATE". function BETTERUI.Banking.Class:RemoveItemStack(itemIndex) if(itemIndex >= #self.list.dataList) then self.list:MovePrevious() end table.remove(self.list.dataList,itemIndex) table.remove(self.list.templateList,itemIndex) table.remove(self.list.prePadding,itemIndex) table.remove(self.list.postPadding,itemIndex) table.remove(self.list.preSelectedOffsetAdditionalPadding,itemIndex) table.remove(self.list.postSelectedOffsetAdditionalPadding,itemIndex) table.remove(self.list.selectedCenterOffset,itemIndex) self:RefreshList() end function BETTERUI.Banking.Class:ToggleList(toWithdraw) self:SaveListPosition() self.currentMode = toWithdraw and LIST_WITHDRAW or LIST_DEPOSIT local footer = self.footer:GetNamedChild("Footer") if(self.currentMode == LIST_WITHDRAW) then footer:GetNamedChild("SelectBg"):SetTextureRotation(0) footer:GetNamedChild("DepositButtonLabel"):SetColor(0.26,0.26,0.26,1) footer:GetNamedChild("WithdrawButtonLabel"):SetColor(1,1,1,1) else footer:GetNamedChild("SelectBg"):SetTextureRotation(3.1415) footer:GetNamedChild("DepositButtonLabel"):SetColor(1,1,1,1) footer:GetNamedChild("WithdrawButtonLabel"):SetColor(0.26,0.26,0.26,1) end KEYBIND_STRIP:UpdateKeybindButtonGroup(self.coreKeybinds) --KEYBIND_STRIP:UpdateKeybindButtonGroup(self.spinnerKeybindStripDescriptor) self:RefreshList() end function BETTERUI.Banking.Init() BETTERUI.Banking.Window = BETTERUI.Banking.Class:New("BETTERUI_TestWindow", BETTERUI_TEST_SCENE) BETTERUI.Banking.Window:SetTitle("|c0066FFBanking Enhanced|r") -- Set the column headings up, maybe put them into a table? BETTERUI.Banking.Window:AddColumn(GetString(SI_BETTERUI_BANKING_COLUMN_NAME),87) BETTERUI.Banking.Window:AddColumn(GetString(SI_BETTERUI_BANKING_COLUMN_TYPE),637) BETTERUI.Banking.Window:AddColumn(GetString(SI_BETTERUI_BANKING_COLUMN_TRAIT),897) BETTERUI.Banking.Window:AddColumn(GetString(SI_BETTERUI_BANKING_COLUMN_STAT),1067) BETTERUI.Banking.Window:AddColumn(GetString(SI_BETTERUI_BANKING_COLUMN_VALUE),1187) BETTERUI.Banking.Window:RefreshList() SCENE_MANAGER.scenes['gamepad_banking'] = SCENE_MANAGER.scenes['BETTERUI_BANKING'] esoSubscriber = IsESOPlusSubscriber() --tw = BETTERUI.Banking.Window --dev mode end
local b4,_ = {},{} -- Find and report local variables that accidently became globals. b4={}; for k,_ in pairs(_ENV) do b4[k]=k end function _.rogues() for k,v in pairs(_ENV) do if not b4[k] then _.yellow("-- rogue? %s %s",k,type(v)) end end end -- Print colored text to standard error. function _.hue(n,s) return string.format("\27[1m\27[%sm%s\27[0m",n,s) end function _.btw(n,...) io.stderr:write(_.hue(n,string.format(...)).."\n") end function _.red(...) return _.btw(31,...) end function _.green(...) return _.btw(32,...) end function _.yellow(...) return _.btw(33,...) end -- all keys, sorted function _.keys(t, u) u={}; for k,_ in pairs(t) do u[1+#u]=k ; print(k) end; table.sort(u); return u end -- Run some of the "acts", resetting system back to defaults before each run. -- Return to operating system the number of fails (so returning "0" means no errors) function _.main(all,acts) local makeDefaults,reset2Defaults,runWithStackDumps,runWithNoStackDumps,known local fails, defaults,ok,msg known = function(x) return assert(acts[x],"unknown "..x) and x end makeDefaults = function() for k,v in pairs(all) do defaults[k]=v end end reset2Defaults = function() for k,v in pairs(defaults) do all[k]=v end end runWithStackDumps = function(x) acts[ known(x) ]() end runWithNoStackDumps = function(x) return pcall( acts[ known(x) ] ) end --------------- fails,defaults = 0,{} makeDefaults() runWithStackDumps(all.debug) -- used when debugging one action if all.todo then for __,todo in pairs(all.todo=="all" and _.keys(acts) or {all.todo}) do reset2Defaults() ok,msg = runWithNoStackDumps(todo) if ok then _.green("%s%s", "-- PASS ",todo) else _.red( "%s%s %s","-- FAIL ",todo,msg); fails=fails+1 end end end _.yellow("-- %s errors",fails) _.rogues() -- check for stray locals on the way out os.exit(fails) end -- Turn strings into their right types. function _.coerce(x) if x=="true" then return true elseif x=="false" then return false end return tonumber(x) or x end -- Check for any updated to "flag" on command line. Boolean flags have -- no arguments (and if we see them on the command line, then flip their -- default value). Other flags have one argument, immediately after the flag. -- Flags do not have be spelt out in full on the command line (e.g. -t X -- will match to the flag -todo). function _.update(flag,x) for n,word in ipairs(arg) do if flag:match("^"..word:sub(2)..".*") then x= x=="true" and"false" or x=="false" and "true" or arg[n+1] end end return _.coerce(x) end -- For help text lines starting with " -", create a flag with a default value -- from the first and last word on that line. Ensure that we have a random -- number seed. Print help text (if asked to). Add a hook into "_.main". function _.cli(s, t) t={} s:gsub("\n [-]([^%s]+)[^\n]*%s([^%s]+)", function(k,x) t[k]=_.update(k,x) end) t.seed = t.seed or 10019 if t.h then print(s) end return setmetatable(t, {__call= _.main}) end return _.cli
class 'ItemEquipable' extends 'ItemBase' ItemEquipable.name = 'Equipment Base' ItemEquipable.description = 'An item that can be equipped.' ItemEquipable.category = 'item.category.equipment' ItemEquipable.stackable = false ItemEquipable.equip_slot = 'item.slot.accessory' ItemEquipable.equip_inv = 'hotbar' ItemEquipable.disabled_inventories = {} ItemEquipable.action_sounds = { ['equip'] = 'items/battery_pickup.wav', ['unequip'] = 'items/battery_pickup.wav' } ItemEquipable:add_button('equip', { get_name = function(item_obj) return item_obj:is_equipped() and 'item.option.unequip' or 'item.option.equip' end, icon = 'icon16/user_suit.png', callback = 'on_equip' }) function ItemEquipable:is_equipped() return self.inventory_type == self.equip_inv end function ItemEquipable:can_transfer(inventory, x, y) local player = self:get_player() local inv_type = inventory.type if inv_type == self.equip_inv then if self:can_equip(player) == false then return false end for k, v in pairs(inventory:get_items()) do if v.equip_slot and v:is_equipped() and v.instance_id != self.instance_id then if v.equip_slot == self.equip_slot then return false elseif istable(self.equip_slot) then for k1, v1 in pairs(self.equip_slot) do if v1 == v.equip_slot then return false elseif istable(v.equip_slot) then for k2, v2 in pairs(v.equip_slot) do if v1 == v2 then return false end end end end end end end elseif inv_type != self.equip_inv and self.inventory_type == self.equip_inv then if self:can_unequip(player) == false then return false end end end function ItemEquipable:can_equip(player) end function ItemEquipable:can_unequip(player) end function ItemEquipable:post_equipped(player) end function ItemEquipable:post_unequipped(player) end function ItemEquipable:equip(player, should_equip) if should_equip then for k, v in pairs(self.disabled_inventories) do local inventory = player:get_inventory(v) if inventory then for k1, v1 in pairs(inventory:get_items()) do local success, error_text = player:transfer_item(v1.instance_id, 'main_inventory') if !success then player:notify(error_text) return end end inventory:set_disabled(true) end end self:post_equipped(player) hook.run('OnItemEquipped', player, self) else for k, v in pairs(self.disabled_inventories) do local inventory = player:get_inventory(v) if inventory then inventory:set_disabled(false) end end self:post_unequipped(player) hook.run('OnItemUnequipped', player, self) end end function ItemEquipable:on_transfer(new_inventory, old_inventory) if new_inventory and new_inventory.type == self.equip_inv then local player = new_inventory.owner player:EmitSound(self.action_sounds['equip']) self:equip(player, true) end if old_inventory and old_inventory.type == self.equip_inv then local player = old_inventory.owner player:EmitSound(self.action_sounds['unequip']) self:equip(player, false) end end function ItemEquipable:on_equip(player) if IsValid(self.entity) then self:do_menu_action('on_take', player, { inv_type = self.equip_inv }) else if self:is_equipped() then player:transfer_item(self.instance_id, 'main_inventory') else player:transfer_item(self.instance_id, self.equip_inv) end end end function ItemEquipable:on_loadout(player) if self:is_equipped() then self:equip(player, true) end end
------------------------------------------------------------------------------- -- message.lua ------------------------------------------------------------------------------- local _PACKAGE = (...):match("^(.+)[%./][^%./]+") or "" local INFO_MSG = tengine.INFO_MSG local DEBUG_MSG = tengine.DEBUG_MSG local ERROR_MSG = tengine.ERROR_MSG local p = tengine.p local _M = require (_PACKAGE.."/player") --- 系统消息 function _M:send_system_message(...) end
--[[ Normalize Audio Author: Native Instruments Written by: Yaron Eshkar Modified: June 4, 2021 --]] -- Imports local root_path = filesystem.parentPath(scriptPath) package.path = root_path .. "/?.lua;" .. package.path local ctAudio = require("Modules.CtAudio") local ctUtil = require("Modules.CtUtil") -----------------------USER VARIABLES-------------------------------- -- Path to the samples local current_path = root_path .. filesystem.preferred("/Samples/") -- normalize value local normalize_db = "-1.0" -----------------------SCRIPT---------------------------------------- local sample_paths_table = {} sample_paths_table = ctUtil.paths_to_table(current_path,".wav") table.sort(sample_paths_table) for index, file in pairs(sample_paths_table) do ctAudio.run_audio_process(file,"normalize",normalize_db,true) end
local P = require("levelhead.data.properties") local LHS = {} function LHS:serializeHeaders(level) local s = level.settings local h = self.rawHeaders h.prefix = s.prefix h.zone = s.zone h.campaignMarker = s.campaignMarker h.width = level:getWidth() h.height = level:getHeight() --title for k,v in pairs(s.title) do h.title[k] = v end h.settingsList.entries = {} for id, setting in pairs(self.settingsList) do local value = s[setting] if type(value)=="boolean" then value = value and 1 or 0 end table.insert(h.settingsList.entries,{ id = id, value = value, }) end h.settingsList.amount = #h.settingsList.entries end function LHS:serializeObjects(level,layer) --init local s = {} self.rawContentEntries["single"..layer:sub(1,1):upper()..layer:sub(2)] = s s.entries = {} local r = {} self.rawContentEntries[layer.."Rows"] = r r.entries = {} local c = {} self.rawContentEntries[layer.."Columns"] = c c.entries = {} --state local idMap = {} local done = {} for x=level.left, level.right, 1 do done[x] = {} end --process for y=level.bottom, level.top, -1 do for x=level.left, level.right, 1 do local o = level[layer][x][y] if o and not done[x][y] then --check the max size of a possible row/column local rowSize = 1 while rowSize + x <= level.right do local oo = level[layer][x+rowSize][y] if oo and oo.id==o.id and not done[x+rowSize][y] then rowSize = rowSize + 1 else break end end local colSize = 1 while y - colSize >= level.top do local oo = level[layer][x][y-colSize] if oo and oo.id==o.id and not done[x][y-colSize] then colSize = colSize + 1 else break end end --select the biggest one, row on ties, single object when they're both 1 if rowSize == 1 and colSize == 1 then --make it a single foreground object if not idMap[o.id] then local entry = {} entry.id = o.id entry.subentries = {} table.insert(s.entries, entry) idMap[o.id] = entry end table.insert(idMap[o.id].subentries,{ x = level:worldToFileX(o.x), y = level:worldToFileY(o.y) }) done[x][y] = true elseif rowSize >= colSize then local entry = { length = rowSize-1, id = o.id, x = level:worldToFileX(o.x), y = level:worldToFileY(o.y) } table.insert(r.entries, entry) for i=0, rowSize-1, 1 do done[x+i][y] = true end elseif colSize > rowSize then local entry = { length = colSize-1, id = o.id, x = level:worldToFileX(o.x), y = level:worldToFileY(o.y) } table.insert(c.entries, entry) for i=0, colSize-1, 1 do done[x][y-i] = true end else error("Col./row comparison went wrong: "..colSize.." c/r "..rowSize) end end end end --finalize for _,v in ipairs(s.entries) do v.amount = #v.subentries end s.nEntries = #s.entries r.nEntries = #r.entries c.nEntries = #c.entries end function LHS:serializeProperties(level,pathIdMap) local c = { entries = {} } if pathIdMap then self.rawContentEntries.pathProperties = c else self.rawContentEntries.objectProperties = c end local singleLookup = {} local doubleLookup = {} --process local toIterate if pathIdMap then toIterate = level.paths else toIterate = level.objects end for thing in toIterate:iterate() do if thing.properties then for id,value in pairs(thing.properties) do local go = true if not singleLookup[id] then singleLookup[id] = { id = id, entries = {} } table.insert(c.entries, singleLookup[id]) doubleLookup[id] = {} end local entry = singleLookup[id] local subentry if not doubleLookup[id][value] then subentry = { value = value, entries = {} } doubleLookup[id][value] = subentry table.insert(entry.entries,subentry) else subentry = doubleLookup[id][value] end if go then if pathIdMap then table.insert(subentry.entries,pathIdMap[thing]) else table.insert(subentry.entries,{ x = level:worldToFileX(thing.x), y = level:worldToFileY(thing.y) }) end end end end end --finalize for _,entry in ipairs(c.entries) do for _,subentry in ipairs(entry.entries) do subentry.amount = #subentry.entries end entry.amount = #entry.entries end c.nEntries = #c.entries end function LHS:serializeContainedObjects(level) --init local c = { entries = {} } self.rawContentEntries.containedObjects = c --state local idMap = {} --process for obj in level.objects:iterate() do if obj.contents then if not idMap[obj.id] then local entry = {} entry.id = obj.contents entry.subentries = {} table.insert(c.entries, entry) idMap[obj.contents] = entry end table.insert(idMap[obj.contents].subentries,{ x = level:worldToFileX(obj.x), y = level:worldToFileY(obj.y) }) end end --finalize for _,v in ipairs(c.entries) do v.amount = #v.subentries end c.nEntries = #c.entries end function LHS:serializePaths(level) local idMap = {} local c = { entries = {}, } self.rawContentEntries.paths = c local idCounter = 0x0000 for path in level.paths:iterate() do local entry = { id = idCounter, subentries = {} } idMap[path] = entry.id idCounter = idCounter + 1 for n in path:iterateNodes() do table.insert(entry.subentries,{ x = level:worldToFileX(n.x), y = level:worldToFileY(n.y), }) end entry.amount = #entry.subentries table.insert(c.entries,entry) end c.nEntries = #c.entries return idMap end function LHS:serializeAll(level) self:serializeHeaders(level) self.rawContentEntries = {} self:serializeObjects(level,"foreground") self:serializeProperties(level) self:serializeContainedObjects(level) local idMap = self:serializePaths(level) self:serializeProperties(level,idMap) self:serializeObjects(level,"background") end return LHS
object_draft_schematic_droid_component_chassis_droid_mining = object_draft_schematic_droid_component_shared_chassis_droid_mining:new { } ObjectTemplates:addTemplate(object_draft_schematic_droid_component_chassis_droid_mining, "object/draft_schematic/droid/component/chassis_droid_mining.iff")
ui_page 'html/index.html' files { 'html/index.html', 'html/static/css/app.css', 'html/static/js/app.js', 'html/static/js/manifest.js', 'html/static/js/vendor.js', 'html/static/config/config.json', -- Coque 'html/static/img/coque/s8.png', 'html/static/img/coque/iphonex.png', 'html/static/img/coque/base.png', 'html/static/img/coque/transparent.png', -- Background 'html/static/img/background/back001.jpg', 'html/static/img/background/back002.jpg', 'html/static/img/background/back003.jpg', 'html/static/img/background/back004.jpg', 'html/static/img/background/back005.jpg', 'html/static/img/background/back006.jpg', 'html/static/img/background/back007.jpg', 'html/static/img/background/back008.jpg', 'html/static/img/background/back009.jpg', 'html/static/img/background/back0010.jpg', 'html/static/img/background/back0011.jpg', 'html/static/img/background/back0012.jpg', 'html/static/img/background/back0013.jpg', 'html/static/img/background/back0014.jpg', 'html/static/img/background/back0015.jpg', 'html/static/img/background/back0016.jpg', 'html/static/img/background/back0017.jpg', 'html/static/img/background/back0018.jpg', 'html/static/img/background/back0019.jpg', 'html/static/img/background/back0020.jpg', 'html/static/img/background/back0021.jpg', 'html/static/img/background/back0022.jpg', 'html/static/img/background/back0023.jpg', 'html/static/img/background/back0024.jpg', 'html/static/img/background/back0025.jpg', 'html/static/img/background/back0026.jpg', 'html/static/img/background/back0027.jpg', 'html/static/img/icons_app/call.png', 'html/static/img/icons_app/contacts.png', 'html/static/img/icons_app/sms.png', 'html/static/img/icons_app/settings.png', 'html/static/img/icons_app/menu.png', 'html/static/img/icons_app/bourse.png', 'html/static/img/icons_app/tchat.png', 'html/static/img/icons_app/photo.png', 'html/static/img/icons_app/bank.png', 'html/static/img/icons_app/9gag.png', 'html/static/img/app_bank/logo_mazebank.jpg', 'html/static/img/app_tchat/splashtchat.png', 'html/static/img/courbure.png', 'html/static/fonts/fontawesome-webfont.ttf', 'html/static/sound/ring.ogg', 'html/static/sound/tchatNotification.ogg', 'html/static/sound/Phone_Call_Sound_Effect.ogg', } client_script { "config.lua", "client/animation.lua", "client/client.lua", "client/photo.lua", "client/app_tchat.lua", "client/bank.lua", } server_script { '@mysql-async/lib/MySQL.lua', "config.lua", "server/server.lua", "server/app_tchat.lua", }
require('cosmic-ui').setup({ border_style = "rounded", })
if RaidSystem then return end RaidSystem = {} local function AddFile(File, dir) local fileSide = string.lower(string.Left(File, 3)) if SERVER and fileSide == "sv_" then include(dir .. File) print("[RaidSystem] SV INCLUDE: " .. File) elseif fileSide == "sh_" then if SERVER then AddCSLuaFile(dir .. File) print("[RaidSystem] SH ADDCS: " .. File) end include(dir .. File) print("[RaidSystem] SH INCLUDE: " .. File) elseif fileSide == "cl_" then if SERVER then AddCSLuaFile(dir .. File) print("[RaidSystem] CL ADDCS: " .. File) elseif CLIENT then include(dir .. File) print("[RaidSystem] CL INCLUDE: " .. File) end end end local function IncludeDir(dir) dir = dir .. "/" local File, Directory = file.Find(dir .. "*", "LUA") for k, v in ipairs(File) do if string.EndsWith(v, ".lua") then AddFile(v, dir) end end for k, v in ipairs(Directory) do print("[RaidSystem] Directory: " .. v) IncludeDir(dir .. v) end end hook.Add("postLoadCustomDarkRPItems", "RaidSystem_Load", function() IncludeDir("raidsystem_config") IncludeDir("raidsystem_code") IncludeDir("raidsystem_modules") timer.Simple(5, SpawnBaseItems) end)
------------------------------------------------------------------------------- --- AUTHOR: Nostrademous --- GITHUB REPO: https://github.com/Nostrademous/Dota2-WebAI ------------------------------------------------------------------------------- BotsInit = require( "game/botsinit" ) local X = BotsInit.CreateGeneric() function X:GetName() return "none" end function X:OnStart() end function X:OnEnd() end function X:Think() end return X
--[[ © CloudSixteen.com do not share, re-distribute or modify without permission of its author (kurozael@gmail.com). Clockwork was created by Conna Wiles (also known as kurozael.) http://cloudsixteen.com/license/clockwork.html --]] Clockwork.kernel:IncludePrefixed("shared.lua"); AddCSLuaFile("cl_init.lua"); AddCSLuaFile("shared.lua"); -- Called when the entity initializes. function ENT:Initialize() self:SetModel("models/extras/info_speech.mdl"); self:SetMoveType(MOVETYPE_NONE); self:SetSolid(SOLID_NONE); end
-- -- Created by IntelliJ IDEA. -- User: ${USER} -- Date: ${YEAR}-${MONTH}-${DAY} -- Time: ${HOUR}:${MINUTE} -- To change this template use File | Settings | File Templates. --
-- Script to find the install path for a C module. Public domain. if not arg or not arg[1] then io.write("Usage: lua installpath.lua modulename\n") os.exit(1) end for p in string.gfind(package.cpath, "[^;]+") do if string.sub(p, 1, 1) ~= "." then local p2 = string.gsub(arg[1], "%.", string.sub(package.config, 1, 1)) io.write(string.gsub(p, "%?", p2), "\n") return end end error("no suitable installation path found")
require( "components/cavern/cavern_encounter" ) -------------------------------------------------------------------- if encounter_combat_spirit_breaker == nil then encounter_combat_spirit_breaker = class( {}, {}, CCavernEncounter ) end -------------------------------------------------------------------- function encounter_combat_spirit_breaker:GetEncounterType() return CAVERN_ROOM_TYPE_MOB end -------------------------------------------------------------------- function encounter_combat_spirit_breaker:GetEncounterLevels() return { 1 } end -------------------------------------------------------------------- function encounter_combat_spirit_breaker:Start() CCavernEncounter.Start( self ) self.nNumUnitsToSpawn = 16 local flOffsetMin = 250 local flOffsetMax = 1000 for i = 1, self.nNumUnitsToSpawn do local vSpawnPoint = self.hRoom.vRoomCenter + ( RandomVector( 1 ) * RandomFloat( flOffsetMin, flOffsetMax ) ) local hUnit = self:SpawnCreepByName( "npc_dota_creature_spirit_breaker", vSpawnPoint, true, nil, nil, DOTA_TEAM_BADGUYS ) hUnit:FaceTowards( vSpawnPoint + RandomVector( 1 ) * flOffsetMin ) end return true end --------------------------------------------------------------------
module 'mock' CLASS: AnimatorTrackVecComponent ( AnimatorValueTrack ) :MODEL { Field 'comId' :int() :no_edit(); } -------------------------------------------------------------------- function AnimatorTrackVecComponent:__init( comId, name ) self.comId = comId self.name = name end function AnimatorTrackVecComponent:createKey( pos ) local key = AnimatorKeyNumber( pos ) key:setPos( pos ) return self:addKey( key ) end function AnimatorTrackVecComponent:isPlayable() return false end function AnimatorTrackVecComponent:getIcon() return 'track_number' end function AnimatorTrackVecComponent:isCurveTrack() return true end function AnimatorTrackVecComponent:canReparent( target ) return false end -------------------------------------------------------------------- CLASS: AnimatorTrackFieldVecCommon ( AnimatorTrackField ) function AnimatorTrackFieldVecCommon:__init() self.splitted = false end function AnimatorTrackFieldVecCommon:getComponentCount() return 1 end function AnimatorTrackFieldVecCommon:getComponentTrack( id ) for i, sub in ipairs( self.children ) do if sub.comId == id then return sub end end return nil end function AnimatorTrackFieldVecCommon:createSubComponentTrack( id, name ) local track = AnimatorTrackVecComponent( id, name ) self:addChild( track ) end function AnimatorTrackFieldVecCommon:createKey( pos, context ) local target = context.target local x,y,z = self.targetField:getValue( target ) local keyX = self:createSubComponentTrackKey( 1, pos, x ) local keyY = self:createSubComponentTrackKey( 2, pos, y ) local keyZ = self:createSubComponentTrackKey( 3, pos, z ) return keyX, keyY, keyZ end function AnimatorTrackFieldVecCommon:createSubComponentTrackKey( comId, pos, value ) local track = self:getComponentTrack( comId ) local key = track:createKey( pos ) key:setValue( value ) return key end function AnimatorTrackFieldVecCommon:updateParentKey( parentKey, changedKey ) local childKeys = parentKey:getChildKeys() if not childKeys then return end local vec = {} for i, k in ipairs( childKeys ) do local childTrack = k:getTrack() local comId = childTrack.comId vec[ comId ] = k.value k.pos = parentKey.pos end parentKey:setValue( unpack( vec ) ) end function AnimatorTrackFieldVecCommon:updateChildKeys( parentKey ) local childKeys = parentKey:getChildKeys() if not childKeys then return end local vec = { parentKey:getValue() } for i, k in ipairs( childKeys ) do local childTrack = k:getTrack() local comId = childTrack.comId k.value = vec[ i ] k.pos = parentKey.pos end end function AnimatorTrackFieldVecCommon:unsplitKeys() if not self.splitted then return end self.splitted = false local keys = {} end function AnimatorTrackFieldVecCommon:splitKeys() if self.splitted then return end self.splitted = true self.keys = {} end function AnimatorTrackFieldVecCommon:apply( state, target, t ) local x = self.curveX:getValueAtTime( t ) local y = self.curveY:getValueAtTime( t ) local z = self.curveZ:getValueAtTime( t ) return self.targetField:setValue( target, x, y, z ) end function AnimatorTrackFieldVecCommon:isEmpty() return self:getComponentTrack(1):isEmpty() and self:getComponentTrack(2):isEmpty() and self:getComponentTrack(3):isEmpty() end function AnimatorTrackFieldVecCommon:build( context ) --building shared data self.curveX = self:getComponentTrack( 1 ):buildCurve() self.curveY = self:getComponentTrack( 2 ):buildCurve() self.curveZ = self:getComponentTrack( 3 ):buildCurve() context:updateLength( self:calcLength() ) end function AnimatorTrackFieldVecCommon:calcLength() local length = math.max( self:getComponentTrack(1):calcLength(), self:getComponentTrack(2):calcLength(), self:getComponentTrack(3):calcLength() ) return length end function AnimatorTrackFieldVecCommon:getIcon() return 'track_vec' end -------------------------------------------------------------------- CLASS: AnimatorTrackFieldVec3 ( AnimatorTrackFieldVecCommon ) function AnimatorTrackFieldVec3:init() --create sub component track self:createSubComponentTrack( 1, 'x' ) self:createSubComponentTrack( 2, 'y' ) self:createSubComponentTrack( 3, 'z' ) end function AnimatorTrackFieldVec3:getComponentCount() return 3 end function AnimatorTrackFieldVec3:createKey( pos, context ) local target = context.target local x,y,z = self.targetField:getValue( target ) local keyX = self:createSubComponentTrackKey( 1, pos, x ) local keyY = self:createSubComponentTrackKey( 2, pos, y ) local keyZ = self:createSubComponentTrackKey( 3, pos, z ) local masterKey = AnimatorKeyVec3() masterKey.pos = pos masterKey:addChildKey( keyX ) masterKey:addChildKey( keyY ) masterKey:addChildKey( keyZ ) masterKey:setValue( x,y,z ) self:addKey( masterKey ) return keyX, keyY, keyZ, masterKey end function AnimatorTrackFieldVec3:apply( state, target, t ) local x = self.curveX:getValueAtTime( t ) local y = self.curveY:getValueAtTime( t ) local z = self.curveZ:getValueAtTime( t ) return self.targetField:setValue( target, x, y, z ) end function AnimatorTrackFieldVec3:build( context ) --building shared data self.curveX = self:getComponentTrack( 1 ):buildCurve() self.curveY = self:getComponentTrack( 2 ):buildCurve() self.curveZ = self:getComponentTrack( 3 ):buildCurve() context:updateLength( self:calcLength() ) end function AnimatorTrackFieldVec3:calcLength() local length = math.max( self:getComponentTrack(1):calcLength(), self:getComponentTrack(2):calcLength(), self:getComponentTrack(3):calcLength() ) return length end function AnimatorTrackFieldVec3:getIcon() return 'track_vec3' end function AnimatorTrackFieldVec3:isEmpty() return self:getComponentTrack(1):isEmpty() and self:getComponentTrack(2):isEmpty() and self:getComponentTrack(3):isEmpty() end -------------------------------------------------------------------- CLASS: AnimatorTrackFieldVec2 ( AnimatorTrackFieldVecCommon ) function AnimatorTrackFieldVec2:init() --create sub component track self:createSubComponentTrack( 1, 'x' ) self:createSubComponentTrack( 2, 'y' ) end function AnimatorTrackFieldVec3:getComponentCount() return 2 end function AnimatorTrackFieldVec2:createKey( pos, context ) local target = context.target local x,y = self.targetField:getValue( target ) local keyX = self:createSubComponentTrackKey( 1, pos, x ) local keyY = self:createSubComponentTrackKey( 2, pos, y ) local masterKey = AnimatorKeyVec2() masterKey.pos = pos masterKey:addChildKey( keyX ) masterKey:addChildKey( keyY ) masterKey:setValue( x,y ) self:addKey( masterKey ) return keyX, keyY, masterKey end function AnimatorTrackFieldVec2:apply( state, target, t ) local x = self.curveX:getValueAtTime( t ) local y = self.curveY:getValueAtTime( t ) return self.targetField:setValue( target, x, y ) end function AnimatorTrackFieldVec2:build( context ) --building shared data self.curveX = self:getComponentTrack( 1 ):buildCurve() self.curveY = self:getComponentTrack( 2 ):buildCurve() context:updateLength( self:calcLength() ) end function AnimatorTrackFieldVec2:isEmpty() return self:getComponentTrack(1):isEmpty() and self:getComponentTrack(2):isEmpty() end function AnimatorTrackFieldVec2:calcLength() local length = math.max( self:getComponentTrack(1):calcLength(), self:getComponentTrack(2):calcLength() ) return length end
return {'kepen','keper','keperband','keperen','keperflanel','kepie','keppel','keppeltje','keppel','kepel','kepser','keperbanden','keperlijnen','kepers','kepert','kepertje','kepertjes','kepies','keppeltjes','kepietje','keperbandje'}
local utils = {} function utils.set(t) local s = {} for _, v in ipairs(t) do s[v] = true end return s end function utils.copy(t) local n = {} for k, v in pairs(t) do n[k] = v end return n end -- Returns an IO stream suitable for use with io.write() which writes -- its output to a string. function utils.string_io() return { stream = "", write = function(self, s) self.stream = self.stream .. s end } end -- from penlight local function cycle_aware_copy(t, cache) if type(t) ~= 'table' then return t end if cache[t] then return cache[t] end local res = {} cache[t] = res local mt = getmetatable(t) for k,v in pairs(t) do k = cycle_aware_copy(k, cache) v = cycle_aware_copy(v, cache) res[k] = v end setmetatable(res,mt) return res end function utils.deepcopy(t) return cycle_aware_copy(t,{}) end function utils.replace_table(tbl, other) if tbl == other then return tbl end for k, _ in pairs(tbl) do tbl[k] = nil end for k, v in pairs(other) do tbl[k] = v end local mt = getmetatable(other) setmetatable(tbl, mt) return tbl end function utils.is_valid_lua_ident(str) return type(str) == "string" and string.match(str, "^[_%a][_%w]*$") end function utils.quote_string(str) if str:match('"') and not str:match("'") then return "'" .. str .. "'" end return '"' .. str:gsub('"', '\\"') .. '"' end local short_control_char_escapes = { ["\a"] = "\\a", ["\b"] = "\\b", ["\f"] = "\\f", ["\n"] = "\\n", ["\r"] = "\\r", ["\t"] = "\\t", ["\v"] = "\\v" } local long_control_char_escapes = {} -- \a => nil, \0 => \000, 31 => \031 for i=0, 31 do local ch = string.char(i) if not short_control_char_escapes[ch] then short_control_char_escapes[ch] = "\\"..i long_control_char_escapes[ch] = string.format("\\%03d", i) end end function utils.escape_string(str) return (str:gsub("\\", "\\\\") :gsub("(%c)%f[0-9]", long_control_char_escapes) :gsub("%c", short_control_char_escapes)) end function utils.table_length(tbl) local i = 0 for _, _ in pairs(tbl) do i = i + 1 end return i end function utils.tostring_raw(tbl) if type(tbl) ~= "table" then return tostring(tbl) end local mt = getmetatable(tbl) setmetatable(tbl, {}) local s = tostring(tbl) setmetatable(tbl, mt) return s end local string_buffer = {} function string_buffer:append(s) table.insert(self, s) for i=#self-1, 1, -1 do if string.len(self[i]) > string.len(self[i+1]) then break end self[i] = self[i] .. table.remove(self) end end function string_buffer:__tostring() return table.concat(self) end function utils.string_buffer() return setmetatable({""}, { __index = string_buffer, __tostring = string_buffer.__tostring }) end function utils.split_string(s, delimiter) local result = {} for match in (s..delimiter):gmatch("(.-)"..delimiter) do table.insert(result, match) end return result end return utils
Config = {} Config.Display = { allowGPS = true -- Display callouts on the GPS }
local robbing = false local bank = "" local secondsRemaining = 0 function bank_DisplayHelpText(str) SetTextComponentFormat("STRING") AddTextComponentString(str) DisplayHelpTextFromStringLabel(0, 0, 1, -1) end function bank_drawTxt(x,y ,width,height,scale, text, r,g,b,a, outline) SetTextFont(0) SetTextProportional(0) SetTextScale(scale, scale) SetTextColour(r, g, b, a) SetTextDropShadow(0, 0, 0, 0,255) SetTextEdge(1, 0, 0, 0, 255) SetTextDropShadow() if(outline)then SetTextOutline() end SetTextEntry("STRING") AddTextComponentString(text) DrawText(x - width/2, y - height/2 + 0.005) end local banks = { ["fleeca"] = { position = { ['x'] = 147.04908752441, ['y'] = -1044.9448242188, ['z'] = 29.36802482605 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil", lastrobbed = 0 }, ["fleeca2"] = { position = { ['x'] = -2957.6674804688, ['y'] = 481.45776367188, ['z'] = 15.697026252747 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil (Rodovia)", lastrobbed = 0 }, ["blainecounty"] = { position = { ['x'] = -107.06505584717, ['y'] = 6474.8012695313, ['z'] = 31.62670135498 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil Poupança", lastrobbed = 0 }, ["fleeca3"] = { position = { ['x'] = -1212.2568359375, ['y'] = -336.128295898438, ['z'] = 36.7907638549805 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil (Vinewood Hills)", lastrobbed = 0 }, ["fleeca4"] = { position = { ['x'] = -354.452575683594, ['y'] = -53.8204879760742, ['z'] = 48.0463104248047 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil (Burton)", lastrobbed = 0 }, ["fleeca5"] = { position = { ['x'] = 309.967376708984, ['y'] = -283.033660888672, ['z'] = 53.1745223999023 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil (Alta)", lastrobbed = 0 }, ["fleeca6"] = { position = { ['x'] = 1176.86865234375, ['y'] = 2711.91357421875, ['z'] = 38.097785949707 }, reward = 30000 + math.random(50000,200000), nameofbank = "Banco do Brasil (Deserto)", lastrobbed = 0 }, ["joalheria"] = { position = { ['x'] = -622.01617431641, ['y'] = -230.71072387695, ['z'] = 38.057056427002 }, reward = 50000 + math.random(50000,300000), nameofbank = "Joalheria", lastrobbed = 0 }, ["bancoprincipal"] = { position = { ['x'] = 265.60995483398, ['y'] = 213.61218261719, ['z'] = 101.68347930908 }, reward = 150000 + math.random(50000,200000), nameofbank = "Banco do Brasil (Centro da Cidade)", lastrobbed = 0 } } RegisterNetEvent('es_bank:currentlyrobbing') AddEventHandler('es_bank:currentlyrobbing', function(robb) robbing = true bank = robb secondsRemaining = 300 end) RegisterNetEvent('es_bank:toofarlocal') AddEventHandler('es_bank:toofarlocal', function(robb) robbing = false TriggerEvent('chatMessage', 'SYSTEM', {255, 0, 0}, "O Assalto ao Banco foi cancelado, voce não receberá nada.") robbingName = "" secondsRemaining = 0 incircle = false end) RegisterNetEvent('es_bank:playerdiedlocal') AddEventHandler('es_bank:playerdiedlocal', function(robb) robbing = false TriggerEvent('chatMessage', 'SYSTEM', {255, 0, 0}, "O Assalto ao Banco foi cancelado, Voce Morreu!") robbingName = "" secondsRemaining = 0 incircle = false end) RegisterNetEvent('es_bank:robberycomplete') AddEventHandler('es_bank:robberycomplete', function(reward) robbing = false TriggerEvent('chatMessage', 'SYSTEM', {255, 0, 0}, "Roubo terminado, Voce Recebeu :^2" .. reward) bank = "" secondsRemaining = 0 incircle = false end) Citizen.CreateThread(function() while true do if robbing then Citizen.Wait(1000) if(secondsRemaining > 0)then secondsRemaining = secondsRemaining - 1 end end Citizen.Wait(0) end end) Citizen.CreateThread(function() while true do local pos = GetEntityCoords(GetPlayerPed(-1), true) for k,v in pairs(banks)do local pos2 = v.position if(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 15.0)then if IsPlayerWantedLevelGreater(PlayerId(),0) or ArePlayerFlashingStarsAboutToDrop(PlayerId()) then local wanted = GetPlayerWantedLevel(PlayerId()) Citizen.Wait(5000) SetPlayerWantedLevel(PlayerId(), wanted, 0) SetPlayerWantedLevelNow(PlayerId(), 0) end end end Citizen.Wait(0) end end) Citizen.CreateThread(function() for k,v in pairs(banks)do local ve = v.position local blip = AddBlipForCoord(ve.x, ve.y, ve.z) SetBlipSprite(blip, 278) SetBlipScale(blip, 0.8) SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString("Robbable Bank") EndTextCommandSetBlipName(blip) end end) incircle = false Citizen.CreateThread(function() while true do local pos = GetEntityCoords(GetPlayerPed(-1), true) for k,v in pairs(banks)do local pos2 = v.position if(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 15.0)then if not robbing then DrawMarker(1, v.position.x, v.position.y, v.position.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 1555, 0, 0,255, 0, 0, 0,0) if(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 2)then if (incircle == false) then bank_DisplayHelpText("Pressione ~INPUT_CONTEXT~ para iniciar um assalto ao Banco ~b~" .. v.nameofbank .. "~w~ Cuidado, a Policia Militar será Alertada!") end incircle = true if(IsControlJustReleased(1, 51))then TriggerServerEvent('es_bank:rob', k) end elseif(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) > 2)then incircle = false end end end end if robbing then SetPlayerWantedLevel(PlayerId(), 4, 0) SetPlayerWantedLevelNow(PlayerId(), 0) bank_drawTxt(0.66, 1.44, 1.0,1.0,0.4, "Roubo a Banco em Andamento: falta ~r~" .. secondsRemaining .. "~w~ segundos restantes para concluir o Assalto", 255, 255, 255, 255) local pos2 = banks[bank].position local ped = GetPlayerPed(-1) if IsEntityDead(ped) then TriggerServerEvent('es_bank:playerdied', bank) elseif (Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) > 15)then TriggerServerEvent('es_bank:toofar', bank) end end Citizen.Wait(0) end end)
return { _fold = true, _id = "solarSystem1", _type = "SolarSystem", height = "$fill", width = "$fill", _children = { { _id = "drawNodeCircle1", _type = "DrawNodeCircle", radius = 10, scaleX = "$minScale", scaleY = "$minScale", x = 640, y = 384, c4f = { a = 1, b = 0, g = 0, r = 0.8}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "particleSystemQuad1", _type = "cc.ParticleSystemQuad", angleVar = 360, life = 1, lifeVar = 0.2, particle = "gk/res/particle/Galaxy.plist", speed = 10, speedVar = 1, startSize = 5, startSizeVar = 1, startSpin = 0, totalParticles = 50, x = 10, y = 10, posVar = { x = 2, y = 2}, sourcePosition = { x = 0, y = 0}, startColor = { a = 1, b = 0.75999999046326, g = 0.25, r = 0.9}}}}, { _id = "circle_mercury", _type = "DrawNodeCircle", radius = 40, rotation = 23, scaleX = "$minScale", scaleY = "$minScale", skewX = 55.1, x = 640, y = 384, c4f = { a = 0.5, b = 0, g = 1, r = 0}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "mercury", _type = "DrawNodeCircle", radius = 1.149, skewX = -55.1, solid = 0, x = 100, y = -60}}}, { _id = "circle_venus", _type = "DrawNodeCircle", radius = 70, rotation = 23, scaleX = "$minScale", scaleY = "$minScale", skewX = 55.1, x = 640, y = 384, c4f = { a = 0.5, b = 0, g = 1, r = 0}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "venus", _type = "DrawNodeCircle", radius = 2.85, skewX = -55.1, solid = 0, x = 90, y = -30}}}, { _id = "circle_earth", _type = "DrawNodeCircle", radius = 100, rotation = 23, scaleX = "$minScale", scaleY = "$minScale", skewX = 55.1, x = 640, y = 384, c4f = { a = 0.5, b = 1, g = 1, r = 0}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "earth", _type = "DrawNodeCircle", radius = 3, skewX = -55.1, solid = 0, x = 100, c4f = { a = 1, b = 1, g = 1, r = 0}, _children = { { _id = "circle_moon", _type = "DrawNodeCircle", lineWidth = 0.5, radius = 6, rotation = -5, skewX = 55.1, x = 3, y = 3, c4f = { a = 0.5, b = 1, g = 1, r = 1}, _children = { { _id = "moon", _type = "DrawNodeCircle", radius = 1.5, skewX = -55.1, solid = 0, x = 3, c4f = { a = 1, b = 1, g = 0, r = 1}}}}}}}}, { _id = "circle_mars", _type = "DrawNodeCircle", radius = 150, rotation = 23, scaleX = "$minScale", scaleY = "$minScale", skewX = 55.1, x = 660, y = 384, c4f = { a = 0.5, b = 0, g = 1, r = 0}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "mars", _type = "DrawNodeCircle", radius = 1.596, skewX = -55.1, solid = 0, x = 150, y = 50}}}, { _id = "circle_jupiter", _type = "DrawNodeCircle", radius = 520, rotation = 23, scaleX = "$minScale", scaleY = "$minScale", skewX = 55.1, x = 640, y = 384, c4f = { a = 0.5, b = 0, g = 1, r = 0}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "jupiter", _type = "DrawNodeCircle", radius = 32.91, skewX = -55.1, solid = 0, x = 560, y = 420}}}, { _id = "circle_saturn", _type = "DrawNodeCircle", drawLineToCenter = 1, radius = 950, rotation = 23, scaleX = "$minScale", scaleY = "$minScale", skewX = 55.1, x = 640, y = 384, c4f = { a = 0.5, b = 0, g = 1, r = 0}, scaleXY = { x = "$scaleX", y = "$scaleY"}, _children = { { _id = "saturn", _type = "DrawNodeCircle", radius = 27.42, skewX = -55.1, solid = 0, x = 1010, y = 850}}}}}
require("packer").use { -- Package info {{{ "rcarriga/vim-ultest"; requires = "vim-test/vim-test"; run = ":UpdateRemotePlugins"; -- vim:set fdm=marker fdl=0: }}} config = function() vim.cmd [[let test#javascript#jest#options = "--color=always"]] vim.g.ultest_pass_sign = "" vim.g.ultest_fail_sign = "" vim.g.ultest_skip_sign = "ﮖ" vim.g.ultest_not_run_sign = "" vim.g.ultest_running_sign = "•" vim.g.ultest_output_on_line = false require("nest").applyKeymaps { { "<Space>R", "<Plug>(ultest-run-file)" }; { "<Space>r", "<Plug>(ultest-run-nearest)" }; { "<Space>s", "<Plug>(ultest-summary-jump)" }; { "<Space>o", "<Plug>(ultest-output-show)" }; { "[f", "<Plug>(ultest-prev-fail)" }; { "]f", "<Plug>(ultest-next-fail)" }; } end; }
-- Automatically subbed strings: -- that/those -- %S -- a/an -- this/these local strings = { ground = { "Look here!", "Look at this spot!", "Look over here!", "Look!", "See here.", "Here!", }, item = { "Look at that/those %S there!", "Look at this/these %S!", "See the %S here!", "There's a/an %S here!", "%S here!", "%S!", }, structure = { "Cool looking %S here!", "Found a/an %S!", "See here for a/an %S!", "Look here, it's a/an %S.", }, mob = { "This %S seems to be alive!", "Watch out for the %S!", "I spy with my eye a/an %S!", "Be careful of the %S here!", "Look at the %S!", "Hmm, there's a/an %S here.", "There is a/an %S here!", }, boss = { "The %S seems dangerous here!", "The %S boss is here!", "Look at that huge %S!", "The %S might be able to digest me!", "Danger! There's a/an %S here!", "Watch out, %S is here!", }, map = { "Check your maps here!", "Look at the map position!", "Look at your maps!", "New point of interest added to the map!" }, other = { "Woah, look at this %S!", "What a glamorous %S.", "Quite a fascinating %S here.", "Behold it's a/an... %S.", "Is this a/an %S?", -- *points to butterfly* "Huh, it's a/an %S.", }, generic = { "Look!", "See this!", "Here!", }, custom = { -- Lists are nice when they are sorted even a bit. -- Mobs and some interactable entities go here: mole = { "You shouldn't eat precious minerals, %S, it will get you killed.", }, monkey = { "%S! Smells like poop.", }, molehill = { "%S here! I bet it's hiding precious minerals and trinkets.", }, lureplant = { "Be careful of the %S here. Don't let the food fool you!", }, hound = { "%S, a minion of evil here!", }, firehound = { "Watch the fire, %S here!", }, icehound = { "Teeths of frost! %S here.", }, lavae = { "Stay back from that %S, it's unstable!", }, red_mushroom = { "Mushroom.", }, blue_mushroom = { "Mushroom.", }, green_mushroom = { "Mushroom.", }, -- Characters go here: wilson = { "I see %S looking for a base.", -- Yes, don't judge me. "Mad scientist %S is here.", }, willow = { "The master of flames %S is here!", }, wolfgang = { "The muscleman %S is here.", }, wendy = { "The ectoherbologist %S, I wonder if she has any potions.", }, wx78 = { "The robot %S, are your gears running well?", }, wickerbottom = { "Librarian %S is here!", }, woodie = { "I see lumberjack %S.", }, wes = { "As silent as he is deadly, %S is here." }, waxwell = { "Shadow pupeteer %S is here!", }, wathgrithr = { "The mighty warrior %S is here!", }, warly = { "The master chef %S is here!", }, webber = { "The spider child %S is here!", }, wormwood = { "The plant friend %S is here!", }, winona = { "Factory worker %S is here!", }, wortox = { "The mischievous imp %S is travelling here!", }, wurt = { "Mermfolk %S is here.", }, walter = { "The fearless Pinetree Pioneer %S is here.", }, -- Items go here: goldnugget = { "%S here. We're rich!", }, }, } return strings
function getRequiredComponents() return {accelerationEntities = {"acceleration", "accelerationController"}} end function update() for i, entity in ipairs(accelerationEntities) do entity.acceleration.movingUp = game.input:isKeyDown(game.input:keyFromString(entity.accelerationController.keyUp)) entity.acceleration.movingDown = game.input:isKeyDown(game.input:keyFromString(entity.accelerationController.keyDown)) entity.acceleration.movingLeft = game.input:isKeyDown(game.input:keyFromString(entity.accelerationController.keyLeft)) entity.acceleration.movingRight = game.input:isKeyDown(game.input:keyFromString(entity.accelerationController.keyRight)) end end
RMenu.Add('Job', 'Interim', RageUI.CreateMenu("", "Missions disponnible", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Interim'):DisplayGlare(false); RMenu:Get('Job', 'Interim').Closable = false; RMenu.Add('Job', 'Ouvrier', RageUI.CreateMenu("", "Prise de service", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Ouvrier'):DisplayGlare(false); RMenu:Get('Job', 'Ouvrier').Closable = false; RMenu.Add('Job', 'Pêcheur', RageUI.CreateMenu("", "Prise de service", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Pêcheur'):DisplayGlare(false); RMenu:Get('Job', 'Pêcheur').Closable = false; RMenu.Add('Job', 'Fermier', RageUI.CreateMenu("", "Prise de service", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Fermier'):DisplayGlare(false); RMenu:Get('Job', 'Fermier').Closable = false; RMenu.Add('Job', 'Chest', RageUI.CreateMenu("", "Coffre", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Chest'):DisplayGlare(false); RMenu:Get('Job', 'Chest').Closable = false; RMenu.Add('Job', 'Chest_Item_Ply', RageUI.CreateSubMenu(RMenu:Get('Job', 'Chest'), "", "Inventaire")) RMenu:Get('Job', 'Chest_Item_Ply'):DisplayGlare(false); RMenu.Add('Job', 'Chest_Item_Sct', RageUI.CreateSubMenu(RMenu:Get('Job', 'Chest'), "", "Coffre")) RMenu:Get('Job', 'Chest_Item_Sct'):DisplayGlare(false); RMenu.Add('Job', 'Shop', RageUI.CreateMenu("", "Fournisseur", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Shop'):DisplayGlare(false); RMenu:Get('Job', 'Shop').Closable = false; RMenu.Add('Job', 'Garage', RageUI.CreateMenu("", "Garage", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Garage'):DisplayGlare(false); RMenu:Get('Job', 'Garage').Closable = false; RMenu.Add('Job', 'Cloackroom', RageUI.CreateMenu("", "Vestiaire", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Cloackroom'):DisplayGlare(false); RMenu:Get('Job', 'Cloackroom').Closable = false; RMenu.Add('Job', 'Stand', RageUI.CreateMenu("", "Stand", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Stand'):DisplayGlare(false); RMenu:Get('Job', 'Stand').Closable = false; RMenu.Add('Job', 'Stand_Custom', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand'), "", "Estéthique")) RMenu:Get('Job', 'Stand_Custom'):DisplayGlare(false); RMenu.Add('Job', 'Stand_Color', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Custom'), "", "Estéthique")) RMenu:Get('Job', 'Stand_Color'):DisplayGlare(false); RMenu.Add('Job', 'Stand_Wheels', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Custom'), "", "Roues")) RMenu:Get('Job', 'Stand_Wheels'):DisplayGlare(false); RMenu.Add('Job', 'Wheels_Color', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Wheels'), "", "Roues")) RMenu:Get('Job', 'Wheels_Color'):DisplayGlare(false); RMenu.Add('Job', 'Wheels_Found', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Wheels'), "", "Articles disponnible")) RMenu:Get('Job', 'Wheels_Found'):DisplayGlare(false); RMenu.Add('Job', 'Primary_Color', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Color'), "", "Couleur principale")) RMenu:Get('Job', 'Primary_Color'):DisplayGlare(false); RMenu.Add('Job', 'Secondary_Color', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Color'), "", "Couleur secondaire")) RMenu:Get('Job', 'Secondary_Color'):DisplayGlare(false); RMenu.Add('Job', 'Pearless_Color', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand_Color'), "", "Nacrage")) RMenu:Get('Job', 'Pearless_Color'):DisplayGlare(false); RMenu.Add('Job', 'Stand_Perfs', RageUI.CreateSubMenu(RMenu:Get('Job', 'Stand'), "", "Performance")) RMenu:Get('Job', 'Stand_Perfs'):DisplayGlare(false); RMenu.Add('Job', 'Crafting', RageUI.CreateMenu("", "Plan de travail", nil, nil, "root_cause", "Banner"), true) RMenu:Get('Job', 'Crafting'):DisplayGlare(false); RMenu:Get('Job', 'Crafting').Closable = false; function ShowMenu(Type) if Type == "Interim" then if PlayerData.job.name == "unemployed" then RageUI.Visible(RMenu:Get('Job', Type), not RageUI.Visible(RMenu:Get('Job', Type))) FreezeEntityPosition(PlayerPedId(), true) InMenu = true else ESX.ShowNotification("Vous avez déjà un emploi.") end elseif Type == "Eboueur" or Type == "Ouvrier" or Type == "Pêcheur" or Type == "Fermier" then ESX.TriggerServerCallback('MissionState', function(InJob) if InJob then Job.MissionTxt = "Terminer votre mission." else Job.MissionTxt = "Commencer votre mission." end end, Type) RageUI.Visible(RMenu:Get('Job', Type), not RageUI.Visible(RMenu:Get('Job', Type))) FreezeEntityPosition(PlayerPedId(), true) InMenu = true elseif Type == "Chest" then if Job.Wl.DuttyState then ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(Money) Job.Wl.Society_Money = Money end, PlayerData.job.name) RageUI.Visible(RMenu:Get('Job', Type), not RageUI.Visible(RMenu:Get('Job', Type))) FreezeEntityPosition(PlayerPedId(), true) InMenu = true else ESX.ShowNotification("Vous devez être en service.") end elseif Type == "DeleteCar" then if Job.Wl.DuttyState then CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false) CrtPlate = GetVehicleNumberPlateText(CrtVhc) if CrtPlate == "JOBSLASV" then DeleteEntity(CrtVhc) ESX.ShowNotification("Vous avez rentrer le véhicule dans le garage.") else ESX.ShowNotification("Ce véhicule ne peut pas rentrer dans le garage.") end else ESX.ShowNotification("Vous devez être en service.") end elseif Type == "Stand" then CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false) if CrtVhc then Job.Stand.FinalPrice = 0 SetVehicleModKit(CrtVhc, 0) RageUI.Visible(RMenu:Get('Job', Type), not RageUI.Visible(RMenu:Get('Job', Type))) FreezeEntityPosition(CrtVhc, true) SetVehicleEngineOn(CrtVhc, false, true, true) InMenu = true Job.Stand.LastProps = ESX.Game.GetVehicleProperties(CrtVhc) else end elseif Type == "Crafting" then if Job.Wl.DuttyState then RageUI.Visible(RMenu:Get('Job', Type), not RageUI.Visible(RMenu:Get('Job', Type))) FreezeEntityPosition(PlayerPedId(), true) InMenu = true else ESX.ShowNotification("Vous devez être en service.") end else if Job.Wl.DuttyState then RageUI.Visible(RMenu:Get('Job', Type), not RageUI.Visible(RMenu:Get('Job', Type))) FreezeEntityPosition(PlayerPedId(), true) InMenu = true else ESX.ShowNotification("Vous devez être en service.") end end while InMenu do Citizen.Wait(0) RageUI.IsVisible(RMenu:Get('Job', 'Interim'), function() for _,v in pairs(Job.Interim) do RageUI.Item.Button("~r~>~s~ "..v.JobName, v.JobDesc, {}, true, { onSelected = function() SetNewWaypoint(v.Pos.x, v.Pos.y) ESX.ShowNotification("Vous devez vous rendre sur place pour accepter la mission.") ESX.ShowNotification("Votre mission vous est indiquer sur la carte.") end, }) end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Ouvrier'), function() RageUI.Item.Button("~r~>~s~ "..Job.MissionTxt, "", {}, true, { onSelected = function() if not PlyInJob then TriggerServerEvent("StartJob", Type) PlyInJob = true else TriggerServerEvent("StopJob", Type) end end, }) RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Pêcheur'), function() RageUI.Item.Button("~r~>~s~ "..Job.MissionTxt, "", {}, true, { onSelected = function() if not PlyInJob then TriggerServerEvent("StartJob", Type) PlyInJob = true else TriggerServerEvent("StopJob", Type) end end, }) RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Fermier'), function() RageUI.Item.Button("~r~>~s~ "..Job.MissionTxt, "", {}, true, { onSelected = function() if not PlyInJob then TriggerServerEvent("StartJob", Type) PlyInJob = true else TriggerServerEvent("StopJob", Type) end end, }) RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Chest'), function() RageUI.Item.Separator("Compte : ~g~"..Job.Wl.Society_Money.." $~s~") RageUI.Item.Button("~r~>~s~ Déposer de l'argent", "", {}, true, { onSelected = function() Input = KeyboardInput("Somme à déposer", "", 20) if tonumber(Input) ~= nil then TriggerServerEvent('esx_society:depositMoney', PlayerData.job.name, tonumber(Input)) ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(Money) Job.Wl.Society_Money = Money end, PlayerData.job.name) else ESX.ShowNotification("Utilisation invalide.") end end, }) RageUI.Item.Button("~r~>~s~ Déposer un objet", "", {}, true, { onSelected = function() Job.Wl.PlyInv = {} ESX.TriggerServerCallback('getPlayerInventory', function(inventory) for i=1, #inventory.items, 1 do local item = inventory.items[i] if item.count > 0 then table.insert(Job.Wl.PlyInv, {label = item.label .. ' x' .. tonumber(item.count), type = 'item_standard', value = item.name}) end end end) end, },RMenu:Get('Job', 'Chest_Item_Ply')) if PlayerData.job.grade_name == "boss" then RageUI.Item.Button("~r~>~s~ Retirer de l'argent", "", {}, true, { onSelected = function() Input = KeyboardInput("Somme à retirer", "", 20) if tonumber(Input) ~= nil then TriggerServerEvent('esx_society:withdrawMoney', PlayerData.job.name, tonumber(Input)) ESX.TriggerServerCallback('esx_society:getSocietyMoney', function(Money) Job.Wl.Society_Money = Money end, PlayerData.job.name) else ESX.ShowNotification("Utilisation invalide.") end end, }) RageUI.Item.Button("~r~>~s~ Retirer un objet", "", {}, true, { onSelected = function() Job.Wl.SctInv = {} ESX.TriggerServerCallback('getStockItems', function(Sitems) for i=1, #Sitems,1 do table.insert(Job.Wl.SctInv, {label = Sitems[i].label..' x ' .. tonumber(Sitems[i].count), value = Sitems[i].name, Count = tonumber(Sitems[i].count)}) end end) end, },RMenu:Get('Job', 'Chest_Item_Sct')) end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Chest_Item_Ply'), function() if Job.Wl.PlyInv then for _,v in pairs (Job.Wl.PlyInv) do RageUI.Item.Button("~r~>~s~ "..v.label, "", {}, true, { onSelected = function() Input = KeyboardInput("Quantité à déposer", "", 20) if tonumber(Input) ~= nil then TriggerServerEvent('putStockItems', v.value, tonumber(Input)) RageUI.GoBack() else ESX.ShowNotification("Utilisation invalide.") end end, }) end end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() RageUI.GoBack() end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Chest_Item_Sct'), function() if Job.Wl.SctInv then for _,v in pairs (Job.Wl.SctInv) do if v.Count >= 1 then RageUI.Item.Button("~r~>~s~ "..v.label, "", {}, true, { onSelected = function() Input = KeyboardInput("Quantité à retirer", "", 20) if tonumber(Input) ~= nil then TriggerServerEvent('getStockItem', v.value, tonumber(Input)) RageUI.GoBack() else ESX.ShowNotification("Utilisation invalide.") end end, }) end end end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() RageUI.GoBack() end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Shop'), function() if Job.Wl[PlayerData.job.name].Items then for _,v in pairs (Job.Wl[PlayerData.job.name].Items) do RageUI.Item.Button("~r~>~s~ "..v.Label, "", {RightLabel = "~g~"..v.Price.." $~s~"}, true, { onSelected = function(Index, Items) if v.Type == "Items" then Input = KeyboardInput("Quantité à acheter ("..v.Limite.." maximum)", "", 20) if tonumber(Input) ~= nil then TriggerServerEvent("Job:BuyItems", v, tonumber(Input)) else ESX.ShowNotification("Utilisation invalide.") end else if not HasPedGotWeapon(PlayerPedId(), GetHashKey("weapon_"..v.Value), false) then TriggerServerEvent("Job:BuyItems", v, tonumber(Input)) else ESX.ShowNotification("Vous avez déja cette arme sur vous.") end end end, }) end end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Garage'), function() if Job.Wl[PlayerData.job.name].Vehicle[PlayerData.job.grade_name].Value then for _,v in pairs (Job.Wl[PlayerData.job.name].Vehicle[PlayerData.job.grade_name].Value) do RageUI.Item.Button("~r~>~s~ "..v.Label, "", {}, true, { onSelected = function() SpawnJobCar(v.Value, Job.Wl[PlayerData.job.name].Vehicle.Spawn) end, }) end end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Cloackroom'), function() if Job.Wl[PlayerData.job.name].Clothe[PlayerData.job.grade_name].Value then for _,v in pairs (Job.Wl[PlayerData.job.name].Clothe[PlayerData.job.grade_name].Value) do RageUI.Item.Button("~r~>~s~ "..v.Label, "", {}, true, { onSelected = function() TriggerEvent("ApplySkin", PlayerPedId(), json.encode(v.Value)) end, }) end end RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() FreezeEntityPosition(PlayerPedId(), false) Timing = 2000 RageUI.CloseAll() InMenu = false end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Stand'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.Btn() RageUI.Item.Button("~r~>~s~ Retour", "", {}, true, { onSelected = function() if not Job.Stand.Buyed then ESX.Game.SetVehicleProperties(CrtVhc, Job.Stand.LastProps) LeaveStand(CrtVhc) else Plate = GetVehicleNumberPlateText(CrtVhc) ESX.TriggerServerCallback('BuyMods', function(Result) if Result then CrtVhc = GetVehiclePedIsIn(PlayerPedId(), false) LeaveStand(CrtVhc) end end, Job.Stand.FinalPrice, Plate) end end, }) end) RageUI.IsVisible(RMenu:Get('Job', 'Stand_Perfs'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.PerfsBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Stand_Custom'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.CustomBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Stand_Color'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.ColorBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Primary_Color'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.PrimaryBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Secondary_Color'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.SecondaryBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Pearless_Color'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.PearlessBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Wheels_Color'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.WheelColorBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Stand_Wheels'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.WheelsBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Wheels_Found'), function() RageUI.Item.Separator("[Prix total] : ~g~"..Job.Stand.FinalPrice.." $~s~") Job.Stand.WheelsTypeBtn() end) RageUI.IsVisible(RMenu:Get('Job', 'Crafting'), function() Job.Crafting.Btn() end) end end
if table.getn(arg) > 2 then print("Too many arguments passed in.") print("Usage: wget <url> <file_name>") elseif table.getn(arg) < 2 then print("Not enough arguments passed in.") print("Usage: wget <url> <file_name>") else local url = arg[1] local file_name = arg[2] local url_content = http.get(url) local output_file = io.open(file_name, "w") io.output(output_file) io.write(url_content.readAll()) io.close(output_file) url_content.close() end
local chronos = require"chronos" --local profiler = require"profiler" local total = chronos.chronos() local quiet = false local function stderr(...) if not quiet then io.stderr:write(string.format(...)) end end -- print help and exit local function help() io.stderr:write([=[ Usage: lua process.lua [options] <driver> [<input.rvg> [<output-name>]] where options are: -profile:<output> write profiling info to <output> (slows down significantly) -width:<number> set viewport width (and height proportionally if not set) -height:<number> set viewport height (and width proportionally if not set) ]=]) os.exit() end -- locals for width and height override local width, height -- locals for driver, input, and output local drivername, inputname, outputname, profilename -- list of supported options -- in each option, -- first entry is the pattern to match -- second entry is a callback -- if callback returns true, the option is accepted. -- if callback returns false, the option is rejected. local options = { { "^%-help$", function(w) if w then help() return true else return false end end }, { "^%-quiet$", function(d) if not d then return false end quiet = true; return true end }, { "^%-profile%:(.*)$", function(o) if not o or #o < 1 then return false end profilename = o return true end }, { "^(%-width%:(%d*)(.*))$", function(all, n, e) if not n then return false end assert(e == "", "invalid option " .. all) n = assert(tonumber(n), "invalid option " .. all) assert(n >= 1, "invalid option " .. all) width = math.floor(n) return true end }, { "^(%-height%:(%d+)(.*))$", function(all, n, e) if not n then return false end assert(e == "", "invalid option " .. all) n = assert(tonumber(n), "invalid option " .. all) assert(n >= 1, "invalid option " .. all) height = math.floor(n) return true end }, } -- rejected options are passed to driver local rejected = {} local nrejected = 0 -- value do not start with - local values = {} local nvalues = 0 -- go over command-line arguments -- processes recognized options -- collect unrecognized ones into rejected list, -- collect values into another list for i, argument in ipairs({...}) do if argument:sub(1,1) == "-" then local recognized = false for j, option in ipairs(options) do if option[2](argument:match(option[1])) then recognized = true break end end if not recognized then nrejected = nrejected + 1 rejected[nrejected] = argument end else nvalues = nvalues + 1 values[nvalues] = argument end end drivername = values[1] inputname = values[2] outputname = values[3] -- load driver assert(drivername, "missing <driver> argument") local driver = require(drivername) assert(type(driver) == "table", "invalid driver") -- load and run the Lua program that defines the scene, window, and viewport -- the only globals visible are the ones exported by the stderr("processing %s\n", inputname) local time = chronos.chronos() local input if _VERSION == "Lua 5.1" then input = assert(setfenv(assert(loadfile(inputname)), driver)()) else input = assert(assert(loadfile(inputname, "bt", driver))()) end stderr("loaded in %gs\n", time:elapsed()) -- by default, dump to stadard out local output = io.stdout -- if another argument was given, replace with the open file if outputname then output = assert(io.open(outputname, "wb")) end -- print options that will be passed down to driver if #rejected > 0 then stderr("options passed down to driver\n") for i,v in ipairs(rejected) do stderr(" %s\n", v) end end -- update viewport if width or height were given local viewport = input.viewport local vxmin, vymin, vxmax, vymax = table.unpack(viewport) local vwidth = vxmax-vxmin local vheight = vymax-vymin if width and not height then assert(vwidth > 0, "empty viewport") vheight = math.floor(vheight*width/vwidth+0.5) assert(vheight > 0, "empty viewport") vwidth = width end if height and not width then assert(vheight > 0, "empty viewport") vwidth = math.floor(vwidth*height/vheight+0.5) assert(vwidth > 0, "empty viewport") vheight = height end if height and width then vwidth = width vheight = height end viewport = driver.viewport(0, 0, vwidth, vheight) -- apply window-viewport transformation to scene local scene = input.scene:windowviewport(input.window,viewport) local prof if profilename then stderr("profiling...\n") prof = profiler.profiler() prof:begin() end -- invoke driver-defined accelerate() function on scene -- pass rejected options as last argument time:reset() local accel = driver.accelerate(scene, viewport, rejected) stderr("accelerate in %gs\n", time:elapsed()) -- invoke driver-defined render() on result of accelerate() -- pass rejected options as last argument driver.render(accel, viewport, output, rejected) if profilename then stderr("writing profile results into '%s'\n", profilename) prof:finish() prof:write_results(profilename) end -- close output file if we created it if outputname then output:close() end stderr("done in %gs\n", total:elapsed())
--- Tools for working with entities. -- @module Entity -- @usage local Entity = require('stdlib/entity/entity') local Entity = {_module_name = 'Entity'} setmetatable(Entity, {__index = require('stdlib/core')}) local Is = require('stdlib/utils/is') --- Tests whether an entity has access to a given field. -- @tparam LuaEntity entity the entity to test the access to a field -- @tparam string field_name the field name -- @treturn boolean true if the entity has access to the field, false if the entity threw an exception when trying to access the field function Entity.has(entity, field_name) Is.Assert(entity, 'missing entity argument') Is.Assert(field_name, 'missing field name argument') local status = pcall( function() return entity[field_name] end ) return status end --- Gets the user data that is associated with an entity. -- The user data is stored in the global object and it persists between loads. --> The user data will be removed from an entity when the entity becomes invalid. -- @tparam LuaEntity entity the entity to look up -- @param Optional field to access data like a table -- @treturn ?|nil|Mixed the user data, or nil if no data exists for the entity function Entity.get_data(entity, field) Is.Assert(entity, 'missing entity argument') if not global._entity_data then return nil end local dest local code, unit_number = pcall(function() return entity.unit_number end) if code then dest = global._entity_data[unit_number] else local prototype_name = entity.name if not global._entity_data[prototype_name] then return nil end local prototype_category = global._entity_data[prototype_name] for i = #prototype_category, 1, -1 do local cur_entity_data = prototype_category[i] if not cur_entity_data.entity.valid then table.remove(prototype_category, i) elseif Entity._are_equal(cur_entity_data.entity, entity) then dest = cur_entity_data.data break end end end if dest and field then if type(dest) == "table" then return dest[field] else return nil end end return dest end --- Associates the user data to an entity. -- The user data will be stored in the global object and it will persist between loads. --> The user data will be removed from an entity when the entity becomes invalid. -- @tparam LuaEntity entity the entity with which to associate the user data -- @tparam ?|nil|Mixed data the data to set, or nil to delete the data associated with the entity -- @param Optional field to set data to, treats the entity data like a table -- @treturn ?|nil|Mixed the previous data associated with the entity, or nil if the entity had no previous data function Entity.set_data(entity, data, field) Is.Assert(entity, 'missing entity argument') if not global._entity_data then global._entity_data = {} end local dest_table, dest_key local code, unit_number = pcall(function() return entity.unit_number end) if code then dest_table = global._entity_data dest_key = unit_number else local prototype_name = entity.name dest_key = "data" if not global._entity_data[prototype_name] then global._entity_data[prototype_name] = {} end local prototype_category = global._entity_data[prototype_name] for i = #prototype_category, 1, -1 do local cur_entity_data = prototype_category[i] if not cur_entity_data.entity.valid then table.remove(prototype_category, i) elseif Entity._are_equal(cur_entity_data.entity, entity) then if not field and data == nil then local prev = cur_entity_data.data table.remove(prototype_category, i) return prev end dest_table = cur_entity_data break end end if not dest_table then table.insert(prototype_category, {entity = entity}) dest_table = prototype_category[#prototype_category] end end local prev if field then if type(dest_table[dest_key]) ~= "table" then dest_table[dest_key] = {} end prev = dest_table[dest_key][field] dest_table[dest_key][field] = data else prev = dest_table[dest_key] dest_table[dest_key] = data end return prev end --- Freezes an entity, by making it inactive, inoperable, and non-rotatable, or unfreezes by doing the reverse. -- @tparam LuaEntity entity the entity to freeze or unfreeze -- @tparam[opt=true] boolean mode if true, freezes the entity, if false, unfreezes the entity. If not specified, it is set to true -- @treturn LuaEntity the entity that has been frozen or unfrozen function Entity.set_frozen(entity, mode) Is.Assert(entity, 'missing entity argument') mode = mode == false and true or false entity.active = mode entity.operable = mode entity.rotatable = mode return entity end --- Makes an entity indestructible so that it cannot be damaged or mined neither by the player nor by their enemy factions. -- @tparam LuaEntity entity the entity to make indestructable -- @tparam[opt=true] boolean mode if true, makes the entity indestructible, if false, makes the entity destructable -- @treturn LuaEntity the entity that has been made indestructable or destructable function Entity.set_indestructible(entity, mode) Is.Assert(entity, 'missing entity argument') mode = mode == false and true or false entity.minable = mode entity.destructible = mode return entity end --- Tests if two entities are equal. -- If they don't have a reference equality and ***entity\_a*** has ***equals*** function, it will be called with ***entity\_b*** as its first argument. -- @tparam LuaEntity entity_a -- @tparam LuaEntity entity_b -- @treturn boolean function Entity._are_equal(entity_a, entity_b) if entity_a == nil then return entity_a == entity_b elseif entity_a == entity_b then return true elseif Entity.has(entity_a, 'equals') and entity_a.equals ~= nil then return entity_a.equals(entity_b) else return false end end --- Functions that raise events -- @section Raise-Events -- from @{https://github.com/aubergine10/lifecycle-events lifecycle-events} -- <br>Used for raising `on_built and on_died` events for other mods --- Destroy an entity by first raising the event. --> Some entities can't be destroyed, such as the rails with trains on them. -- @tparam LuaEntity entity the entity to be destroyed -- @tparam[opt=false] boolean died raise on_entity_died event -- @tparam[opt] LuaEntity cause the entity if available that did the killing for on_entity_died -- @tparam[opt] LuaForce force the force if any that did the killing -- @treturn boolean was the entity destroyed? function Entity.destroy_entity(entity, died, cause, force) if entity and entity.valid and entity.can_be_destroyed then local event = { name = died and defines.events.on_entity_died or defines.events.script_raised_destroy, entity = entity, cause = cause, force = force, script = true } -- If no event name is passed, assume script_raised_destroy, otherwise raise the event -- with the passed event name. ie. defines.events.on_preplayer_mined_item event.script = true event.mod_name = 'stdlib' script.raise_event(event.name, event) return entity.destroy() end end --- Create an entity and raise a build event. -- @tparam LuaSurface surface the surface to create the entity on -- @tparam table settings settings to pass to create_entity see @{LuaSurface.create_entity} -- @tparam[opt] uint player_index the index of the player, when not present and not raise_script_event pass a fake robot -- @tparam[opt] boolean raise_script_event raise script_raised_built -- @treturn LuaEntity the created entity function Entity.create_entity(surface, settings, player_index, raise_script_event) surface = game.surfaces[surface] local entity = surface.create_entity(settings) if entity then local event = { created_entity = entity, script = true } if raise_script_event then event.name = defines.events.script_raised_built event.player_index = player_index elseif player_index then event.name = defines.events.on_built_entity event.player_index = player_index else event.name = defines.events.on_robot_built_entity event.robot = {} end script.raise_event(event.name, event) return entity end end --- Revivie an entity ghost and raise the `on_built` or `on_robot_built` event. -- @tparam LuaEntity ghost the ghost entity to revivie -- @tparam[opt] uint player_index if present, raise `on_built_entity` with player_index, if not present raise `on_robot_built_entity` -- @tparam[opt] boolean raise_script_event, if true raise script_raised_built as the event -- @treturn table the item stacks this entity collided with -- @treturn LuaEntity the new revived entity -- @treturn LuaEntity the item request proxy if present function Entity.revive(ghost, player_index, raise_script_event) if ghost and ghost.valid then local collided, revived, proxy = ghost.revive(true) if revived then local event = { created_entity = revived, revived = true, script = true, modname = 'stdlib' } if raise_script_event then event.name = defines.events.script_raised_built event.player_index = player_index elseif player_index then event.name = defines.events.on_built_entity event.player_index = player_index else event.name = defines.events.on_robot_built_entity event.robot = {} end script.raise_event(event.name, event) return collided, revived, proxy end end end return Entity
---@class BaseState BaseState = class() function BaseState:ctor() self.stateMachine = nil end function BaseState:OnEnter(data, subState) end function BaseState:OnExit() end function BaseState:OnUpdate() end StateMachine = class() function StateMachine:ctor(name, invalidId) self.name = name or "UnnamedStateMachine" self.invalidId = invalidId or 0 self.currentId = self.invalidId self.states = {} end function StateMachine:AddState(stateId, state) if stateId == self.invalidId then Debugger.LogError("invalid state id") return end if not BaseState.is(state, BaseState) then Debugger.LogError("invalid state") return end if self.states[stateId] then Debugger.LogWarning("overriding existing state") end self.states[stateId] = state state.stateMachine = self end function StateMachine:ChangeState(stateId, data, subState) if stateId ~= self.invalidId and self.states[stateId] == nil then Debugger.LogWarning(self.name .. " state machine doesn't have the state: " .. tostring(stateId)) stateId = self.invalidId end if self.currentId ~= self.invalidId then self.states[self.currentId]:OnExit() end self.currentId = stateId if stateId ~= self.invalidId then self.states[stateId]:OnEnter(data, subState) end end function StateMachine:Update() if self.states[self.currentId] then self.states[self.currentId]:OnUpdate() end end function StateMachine:RemoveState(stateId) if stateId ~= self.invalidId and stateId == self.currentId then self:ChangeState(self.invalidId) end self.states[stateId] = nil end function StateMachine:ClearAll() if self.currentId ~= self.invalidId then self:ChangeState(self.invalidId) end self.states = {} end function StateMachine:GetCurrentStateId() return self.currentId end function StateMachine:GetCurrentState() if self.currentId ~= self.invalidId then return self.states[self.currentId] else return nil end end function StateMachine:GetState(stateId) return self.states[stateId] end