content
stringlengths
5
1.05M
-------------- COPYRIGHT AND CONFIDENTIALITY INFORMATION NOTICE ------------- -- Copyright (c) [2019] – [Technicolor Delivery Technologies, SAS] - -- All Rights Reserved - -- The source code form of this Open Source Project components - -- is subject to the terms of the BSD-2-Clause-Patent. - -- You can redistribute it and/or modify it under the terms of - -- the BSD-2-Clause-Patent. (https://opensource.org/licenses/BSDplusPatent) - -- See COPYING file/LICENSE file for more details. - ----------------------------------------------------------------------------- local ubus = require("libubus_map_tch") local proxy = require("datamodel") local json = require ("dkjson") local uci = require("uci") local format = string.format function get_ap_from_if(if_name) local ap cursor = uci.cursor() cursor:foreach("wireless", "wifi-ap", function(s) for key, value in pairs(s) do if value == if_name then ap = s[".name"] end end end) cursor:close() return ap end function set_controller_link_name (if_name) local cursor = uci.cursor() if if_name ~= nil then local config, section = "multiap", "agent" cursor:set(config,section,"backhaul_link",if_name) cursor:commit(config) end cursor:close() return nil end function set_wifi_params(data_str) local ssid, passwd, if_name, ssid_path, passwd_path, ap, old_ssid, old_password, flag, auth_type, old_auth, auth_type_path local fronthaul_path, backhaul_path, old_fronthaul, old_backhaul, fronthaul, backhaul fronthaul = nil backhaul = nil flag = 0 if (data_str == nil) then print("Input Data is NULL") return nil end local data = json.decode(data_str) if (type(data) == "table") then ssid = data["ssid"] passwd = data["passwd"] if_name = data["interface"] auth_type = data["auth_type"] fronthaul = data["fronthaul_bit"] backhaul = data["backhaul_bit"] end if ((if_name ~= nil) and (passwd ~= nil) and (if_name ~= nil)) then if_name = if_name:gsub(" ","") ssid_path = format ('rpc.wireless.ssid.@%s.ssid', if_name) old_ssid = proxy.get(ssid_path)[1].value if (old_ssid ~= ssid) then print("Changing ssid...") proxy.set(ssid_path,ssid) flag = 1 end ap = get_ap_from_if(if_name) passwd_path = format ('rpc.wireless.ap.@%s.security.wpa_psk_passphrase',ap) old_passwd = proxy.get(passwd_path)[1].value if( old_passwd ~= passwd) then print("Changing password...") proxy.set(passwd_path,passwd) flag = 1 end auth_type_path = format ('rpc.wireless.ap.@%s.security.mode',ap) old_auth = proxy.get(auth_type_path)[1].value if(auth_type ~= old_auth)then proxy.set(auth_type_path,auth_type) flag = 1 end if fronthaul ~= nil then fronthaul_path = format ('uci.wireless.wifi-iface.@%s.fronthaul', if_name) old_fronthaul = proxy.get(fronthaul_path)[1].value if (old_fronthaul ~= fronthaul) then print("Changing fronthaul...") proxy.set(fronthaul_path,tostring(fronthaul)) flag = 1 end end if backhaul ~= nil then backhaul_path = format ('uci.wireless.wifi-iface.@%s.backhaul', if_name) old_backhaul = proxy.get(backhaul_path)[1].value if (old_backhaul ~= backhaul) then print("Changing backhaul...") proxy.set(backhaul_path,tostring(backhaul)) flag = 1 end end if flag == 1 then proxy.apply() end end return nil end function get_ap_from_bssid(bssid) if (bssid == nil) then return nil end ubus_conn,txt = ubus.connecttch() if not ubus_conn then ubus_conn = ubus.connect() if not ubus_conn then log:error("Failed to connect to ubus") return nil end end ssid_table = ubus_conn:call("wireless.ssid","get",{}) or {} ap_table = ubus_conn:call("wireless.accesspoint","get",{}) or {} ubus_conn:close() if (type(ssid_table) == "table") then for if_nam, params in pairs(ssid_table) do if (params["bssid"] == bssid) then ifname = if_nam break end end end if (type(ap_table) == "table") then for ap_name, ap_data in pairs(ap_table) do if (ap_data["ssid"] == ifname) then return ap_name end end end return nil end function map_apply_acl(acl_data) if (acl_data == nil) then print("Acl data is NULL") return nil end local data = json.decode(acl_data) if (type(data) == "table") then ap = get_ap_from_bssid(data["bssid"]) if (ap == nil) then return nil end ubus_conn,txt = ubus.connecttch() if not ubus_conn then ubus_conn = ubus.connect() if not ubus_conn then log:error("Failed to connect to ubus") return nil end end if (data["block"] == 1) then action = "deny" elseif(data["block"] == 0) then action = "delete" else return nil end for _, value in pairs(data["stations"]) do if (type(value) == "table") then for _,mac in pairs(value) do local acl_req = {} acl_req["name"] = ap acl_req["macaddr"] = mac ubus_conn:call("wireless.accesspoint.acl",action,acl_req) end end end ubus_conn:close() end return nil end function get_radio_from_if(interface_name) ubus_conn,txt = ubus.connecttch() if not ubus_conn then ubus_conn = ubus.connect() if not ubus_conn then log:error("Failed to connect to ubus") return nil end end local data = ubus_conn:call("wireless.ssid", "get", {}) if (type(data) == "table") then if_data = data[interface_name] radio_name = if_data["radio"] end ubus_conn:close() return radio_name end function switch_off_bss(data_str) if (data_str == nil) then print("Input Data is NULL") return nil end local data = json.decode(data_str) local if_name,path if (type(data) == "table") then if_name = data["interface"] -- fronthaul = data["fronthaul_bit"] -- backhaul = data["backhaul_bit"] end if(if_name ~= nil) then path = format("uci.wireless.wifi-iface.@%s.state",if_name) proxy.set(path,"0") proxy.apply() end end function switch_off_radio(data_str) if (data_str == nil) then print("Input Data is NULL") return nil end local if_name,radio,path local data = json.decode(data_str) if (type(data) == "table") then if_name = data["interface"] end radio = get_radio_from_if(if_name) path = format ("uci.wireless.wifi-device.@%s.state", radio) proxy.set(path,"0") proxy.apply() end
-- ============================= -- -- Copyright 2018 FiatAccompli -- -- ============================= -- -- A very simple example of using mod setting provided by the Mod Settings Manager mod. -- All this does is print out the values of the declared settings when they are changed. include("mod_settings"); include("mod_settings_key_binding_helper"); local actionSetting = ModSettings.Action:new( "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_KEY_ACTION_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local booleanSetting = ModSettings.Boolean:new(false, "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_BOOLEAN_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local booleanSetting2 = ModSettings.Boolean:new(false, "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_BOOLEAN_SETTING_2", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local steppedRangeSetting = ModSettings.Range:new(50, 0, 100, "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_STEPPED_RANGE_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP", { Steps = 10, ValueFormatter = ModSettings.Range.PERCENT_FORMATTER }); local rangeSetting = ModSettings.Range:new(0, 0, 100, "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_RANGE_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local textSetting = ModSettings.Text:new("Default value", "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_TEXT_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local selectValues = {"LOC_MOD_SETTING_EXAMPLE_SELECT_SETTING_VALUE_1", "LOC_MOD_SETTING_EXAMPLE_SELECT_SETTING_VALUE_2", "LOC_MOD_SETTING_EXAMPLE_SELECT_SETTING_VALUE_3"}; local selectSetting = ModSettings.Select:new(selectValues, 2, "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_SELECT_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local headerSetting = ModSettings.Header:new( "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_HEADER_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local keybindSetting = ModSettings.KeyBinding:new(ModSettings.KeyBinding.MakeValue(Keys.B, {Alt=true, Ctrl=true}), "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_KEY_BINDING_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); -- Note that this will show the "conflict" UI for key bindings since it conflicts with a base game binding. local keybindSetting2 = ModSettings.KeyBinding:new(ModSettings.KeyBinding.MakeValue(Keys.B), "LOC_MOD_SETTING_EXAMPLE_CATEGORY", "LOC_MOD_SETTING_EXAMPLE_KEY_BINDING_SETTING_2", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); -- Create enough category tabs that it will have to scroll. And also add a bunch of settings to the example category. for i = 1, 20 do ModSettings.Boolean:new(math.fmod(i, 2) == 0, "z" .. tostring(i), "LOC_MOD_SETTING_EXAMPLE_BOOLEAN_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local booleanSetting = ModSettings.Boolean:new(math.fmod(i, 2) == 0, "LOC_MOD_SETTING_EXAMPLE_CATEGORY", tostring(i), "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); local keybindSetting = ModSettings.KeyBinding:new(ModSettings.KeyBinding.MakeValue(Keys.K, {Alt=true, Ctrl=true}), "z" .. tostring(i), "LOC_MOD_SETTING_EXAMPLE_KEY_BINDING_SETTING", "LOC_MOD_SETTING_EXAMPLE_SETTING_TOOLTIP"); end local function PrintSettings() print("Settings are: ---------------------------------------"); print("Boolean: ", booleanSetting.Value); print("Boolean2: ", booleanSetting2.Value); print("Range: ", rangeSetting.Value); print("Stepped range: ", steppedRangeSetting.Value); print("Text: ", textSetting.Value); print("Select: ", selectSetting.Value); print("-----------------------------------------------------"); end booleanSetting:AddChangedHandler(PrintSettings); booleanSetting2:AddChangedHandler(PrintSettings); rangeSetting:AddChangedHandler(PrintSettings); steppedRangeSetting:AddChangedHandler(PrintSettings); textSetting:AddChangedHandler(PrintSettings); selectSetting:AddChangedHandler(PrintSettings); actionSetting:AddChangedHandler( function() print("Action!!!!!!"); booleanSetting:Change(not booleanSetting.Value); booleanSetting2:Change(not booleanSetting2.Value); rangeSetting:Change(math.max(rangeSetting.Value - 10, 0)); textSetting:Change(textSetting.Value .. '+'); end); ContextPtr:SetInputHandler( function(input) --[[ local count = 100000; local start = os.clock(); for i = 1,count do KeyBindingHelper.InputMatches(keybindSetting.Value, input); end print("Processed input events", count, os.clock() - start); --]] if KeyBindingHelper.InputMatches(keybindSetting.Value, input) then print("The bound key was pressed!"); return true; end end, true);
local Knit = require(game:GetService("ReplicatedStorage").Test.Knit) local MyService = Knit.CreateService { Name = "MyService"; Client = { TestEvent = Knit.CreateSignal(); }; } MyService.Client.TestEvent:Connect(function(player, msg) print("Got message from client event:", player, msg) MyService.Client.TestEvent:Fire(player, msg:lower()) end) function MyService.Client:TestMethod(player, msg) print("TestMethod from client:", player, msg) return msg:upper() end Knit.Start():andThen(function() print("KnitServer started") end):catch(warn)
data:extend({ -- Item { type = "item", name = "5d-furnace", icon = "__5dim_resources__/graphics/icon/icon_5d_steel-furnace_3_.png", flags = {"goes-to-quickbar"}, icon_size = 32, subgroup = "furnace-coal", order = "c", place_result = "5d-furnace", stack_size = 50 }, --Recipe { type = "recipe", name = "5d-furnace", enabled = "false", ingredients = { {"steel-furnace", 1}, {"steel-plate", 10}, {"stone-brick", 7} }, result = "5d-furnace", energy_required = 3, }, --Entity { type = "furnace", name = "5d-furnace", icon = "__5dim_resources__/graphics/icon/icon_5d_steel-furnace_3_.png", flags = {"placeable-neutral", "placeable-player", "player-creation"}, minable = {mining_time = 1, result = "5d-furnace"}, icon_size = 32, max_health = 200, corpse = "medium-remnants", working_sound = { sound = { filename = "__base__/sound/furnace.ogg" } }, resistances = { { type = "fire", percent = 100 } }, collision_box = {{-0.7, -0.7}, {0.7, 0.7}}, selection_box = {{-0.8, -1}, {0.8, 1}}, crafting_categories = {"smelting"}, result_inventory_size = 1, energy_usage = "270kW", crafting_speed = 3, source_inventory_size = 1, energy_source = { type = "burner", effectivity = 1, emissions = 0.02, fuel_inventory_size = 1, smoke = { { name = "smoke", deviation = {0.1, 0.1}, frequency = 0.5, position = {0, 0}, starting_vertical_speed = 0.05 } } }, animation = { filename = "__5dim_resources__/graphics/icon/icon_5d_steel-furnace_3.png", priority = "high", width = 91, height = 69, frame_count = 1, shift = {0.5, 0.05} }, working_visualisations = { { north_position = {0.0, 0.0}, east_position = {0.0, 0.0}, south_position = {0.0, 0.0}, west_position = {0.0, 0.0}, animation = { filename = "__5dim_resources__/graphics/icon/icon_5d_steel-furnace-fire_3.png", priority = "high", width = 36, height = 19, frame_count = 12, shift = { 0.0625, 0.375} }, light = {intensity = 1, size = 1} } }, fast_replaceable_group = "furnace" }, })
wait(.2) lp=game.Players.LocalPlayer pl=lp.Character tor=pl.Torso mouse=lp:GetMouse() rw2=tor['Right Hip'] lw2=tor['Left Hip'] mo=Instance.new("Model",pl) dednum=math.huge pi=math.pi Key={} sec=5 cleanup=sec*10 a=false deb=false hitdeb=false isblocking=false swing=1 equi=false smode='knife' rad=math.rad ca=CFrame.Angles cf=CFrame.new skull=30 bg = Instance.new("BodyGyro") bg.P = 20e+003 bg.maxTorque = Vector3.new(4e+005,4e+005,4e+005)*math.huge descro=pl lwc1=cf(-0.5,1,0,-0,-0,-1,0,1,0,1,0,0) rwc1=cf(0.5,1,0,0,0,1,0,1,0,-1,-0,-0) Part = function(x,y,z,color,tr,cc,an,parent) local p = Instance.new('Part',parent or Weapon) p.formFactor = 'Custom' p.Size = Vector3.new(x,y,z) p.BrickColor = BrickColor.new(color) p.CanCollide = cc p.Transparency = tr p.Anchored = an p.TopSurface,p.BottomSurface = 0,0 p.Locked=true p:BreakJoints() return p end so = function(id,par,lo,pi,tm) local s = Instance.new("Sound",par) s.Looped=lo s.Pitch=pi s.SoundId = "http://roblox.com/asset/?id="..id s:play() s.Volume=.1 game.Debris:AddItem(s,tm) return s end so2 = function(id,par,lo,pi,tm) s = Instance.new("Sound",par) s.Looped=lo s.Pitch=pi s.SoundId = id s:play() s.Volume=.1 game.Debris:AddItem(s,tm) end wPart = function(x,y,z,color,tr,cc,an,parent) local wp = Instance.new('WedgePart',parent or Weapon) wp.formFactor = 'Custom' wp.Size = Vector3.new(x,y,z) wp.BrickColor = BrickColor.new(color) wp.CanCollide = cc wp.Transparency = tr wp.Locked=true wp.Anchored = an wp.TopSurface,wp.BottomSurface = 0,0 wp:BreakJoints() return wp end Weld = function(p0,p1,x,y,z,rx,ry,rz,par) local w = Instance.new('Motor',par or p0) w.Part0 = p0 w.Part1 = p1 w.C1 = CFrame.new(x,y,z)*CFrame.Angles(rx,ry,rz) return w end Mesh = function(par,num,x,y,z) local msh = nil if num == 1 then msh = Instance.new("CylinderMesh",par) elseif num == 2 then msh = Instance.new("SpecialMesh",par) msh.MeshType = 3 elseif num == 3 then msh = Instance.new("BlockMesh",par) elseif num == 4 then msh = Instance.new("SpecialMesh",par) msh.MeshType = "Wedge" elseif type(num) == 'string' then msh = Instance.new("SpecialMesh",par) msh.MeshId = num end msh.Scale = Vector3.new(x,y,z) return msh end Tween = function(Weld, Stop, Step,a) ypcall(function() local func = function() local Start = Weld.C1 local X1, Y1, Z1 = Start:toEulerAnglesXYZ() local Stop = Stop local X2, Y2, Z2 = Stop:toEulerAnglesXYZ() Spawn(function() for i = 0, 1, Step or .1 do wait() Weld.C1 = cf( (Start.p.X * (1 - i)) + (Stop.p.X * i),(Start.p.Y * (1 - i)) + (Stop.p.Y * i),(Start.p.Z * (1 - i)) + (Stop.p.Z * i)) * ca((X1 * (1 - i)) + (X2 * i), (Y1 * (1 - i)) + (Y2 * i),(Z1 * (1 - i)) + (Z2 * i) ) end Weld.C1 = Stop end) end if a then coroutine.wrap(func)() else func() end end) end Lightning = function(Start,End,Times,Offset,Color,Thickness,Transparency) local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset} Spawn(function() for i=1,Times do wait() local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = Transparency or 0.4 li.BrickColor = Color li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(1,1,1) li.Material="Neon" Instance.new('BlockMesh',li).Scale = Vector3.new(Thickness,Thickness,magz/Times) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz if Times == i then local magz2 = (curpos - End).magnitude li.Mesh.Scale = Vector3.new(Thickness,Thickness,magz2) li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2) else li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2) end curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p Spawn(function() for i=1,10 do wait() li.Transparency = li.Transparency+.1 end li:Destroy() end) end end) end function ani(val) if val==true then la = Part(.1,.1,.1,'',0,false,false,mo) ra = Part(.1,.1,.1,'',0,false,false,mo) hp = Part(.1,.1,.1,'',1,false,false,mo) prj = Part(.1,.1,.1,'',1,false,false,mo) lw = Weld(la,pl.Torso,-1.5,.5,0,0,0,0,mo) rw = Weld(ra,pl.Torso,1.5,.5,0,0,0,0,mo) hw = Weld(hp,pl.Torso,0,2,0,0,0,0,mo) rj = Weld(prj,pl.HumanoidRootPart,0,0,0,0,0,0,mo) Weld(pl['Right Arm'],ra,0,-.5,0,0,0,0,mo) Weld(pl['Left Arm'],la,0,-.5,0,0,0,0,mo) Weld(pl.Torso,prj,0,0,0,0,0,0,mo) Weld(pl.Head,hp,0,-.5,0,0,0,0,mo) else ra:Destroy()la:Destroy()hp:Destroy()prj:Destroy()rw2.C1=rwc1 lw2.C1=lwc1 end end function gradient(prnt,col,rng,brt,tm) local f=Instance.new('PointLight',prnt) f.Color=col f.Range=rng f.Brightness=brt Spawn(function() while wait(tm) do if f.Brightness <= 0 then f:Destroy() break end f.Brightness=f.Brightness-0.05 end end) end function skul(v) if v:findFirstChild("Torso") ~= nil then for i=1,30 do local prt= Part(1,.2,1,'Black',0,true,false,workspace) prt.Material='Concrete' prt.CFrame=v.Torso.CFrame*CFrame.new(math.random(-30,30)/10,math.random(-20,30)/10,math.random(-20,20)/10) game.Debris:AddItem(prt,math.random(50,70)/10) end ypcall(function()v.Head.face:Destroy()end) local ms= Mesh(v.Head,'http://www.roblox.com/asset/?id=4770583',3.2,3.2,3.2) ms.TextureId='http://www.roblox.com/asset/?id=4770560' local ded=so('16433289',v.Head,false,1,1) ded.Volume=100 for _,a in pairs(v:GetChildren()) do if a.Name ~= 'Head' and a.Name ~= 'Humanoid' then a:remove() end end end end function trail(pos,tim,col) Spawn(function() for i=1,tim do local oldpos=pos.CFrame.p wait() local newpos=pos.CFrame.p local mag = (oldpos-newpos).magnitude local a= Part(1,1,1,col,0,false,true,mo) local m= Mesh(a,1,.25,mag,.25) a.CFrame=cf(oldpos,newpos)*cf(0,0,-mag/2)*ca(pi/2,0,0) a.Material="Neon" Spawn(function() for i=1,10 do wait() m.Scale=m.Scale-Vector3.new(0.025,0,0.025) end wait(.5) a:Destroy() end) end end) end function mgblock(pa,cfr,tm,col1,col2,sz,wa) local cols={col1,col2} Spawn(function() for i=1,tm do local a= Part(1,1,1,cols[math.random(1,2)],0,false,true,mo) a.Material="Neon" curre=a v1,v2,v3=sz.x,sz.y,sz.z local m= Mesh(a,3,v1,v2,v3) a.CFrame=pa.CFrame*cfr*ca(math.random(),math.random(),math.random()) Spawn(function() while wait() do if a.Transparency >= 1 then a:Destroy() break end m.Scale=m.Scale-Vector3.new(.1,0.1,0.1) a.CFrame=a.CFrame+Vector3.new(0,0.1,0) a.Transparency=a.Transparency+0.05 end end) wait(wa) end end) return curre end function explosion(col1,col2,cfr,sz,rng,dmg) local a= Part(1,1,1,col1,.5,false,true,mo) local a2= Part(1,1,1,col2,.5,false,true,mo) local a3= Part(1,1,1,col2,.5,false,true,mo) a.Material="Neon" a2.Material="Neon" a3.Material="Neon" v1,v2,v3=sz.x,sz.y,sz.z local m= Mesh(a,'http://www.roblox.com/asset/?id=1185246',v1,v2,v3) local m2= Mesh(a2,3,v1/3,v2/3,v3/3) local m3= Mesh(a3,3,v1/3,v2/3,v3/3) a.CFrame=cfr a2.CFrame=cfr*ca(math.random(),math.random(),math.random()) a3.CFrame=cfr*ca(math.random(),math.random(),math.random()) so('219338733',a,false,1,1) for i,v in pairs(workspace:children()) do if v:IsA("Model") and v:findFirstChild("Humanoid") then if v:findFirstChild("Head") and v:findFirstChild("Torso") then if (v:findFirstChild("Torso").Position - a.Position).magnitude < rng and v.Name ~= pl.Name then v.Humanoid.Health=v.Humanoid.Health-dmg end end end end Spawn(function() while wait() do if a.Transparency >= 1 then a:Destroy() a2:Destroy() a3:Destroy() break end m.Scale=m.Scale+Vector3.new(.1,0.1,0.1) m2.Scale=m2.Scale+Vector3.new(.1,0.1,0.1) m3.Scale=m3.Scale+Vector3.new(.1,0.1,0.1) a.Transparency=a.Transparency+0.05 a2.Transparency=a2.Transparency+0.05 a3.Transparency=a3.Transparency+0.05 end end) end function hit(tm,parent,dmg) local dodmg=parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent.Name ~= pl.Name and hitdeb==false then hitdeb=true hit.Parent.Humanoid.Health=hit.Parent.Humanoid.Health-dmg so('46153268',hit.Parent,false,math.random(50,100)/100,1) if hit.Parent.Humanoid.Health<=dednum then skul(hit.Parent) end wait(.1) hitdeb=false end end) Spawn(function() wait(tm) dodmg:disconnect() end) end Lightning2 = function(Start,End,Times,Offset,Color,Thickness) local magz = (Start - End).magnitude local curpos = Start local trz = {-Offset,Offset} for i=1,Times do local li = Instance.new("Part",workspace) li.TopSurface =0 li.BottomSurface = 0 li.Anchored = true li.Transparency = 0 li.BrickColor = Color li.formFactor = "Custom" li.CanCollide = false li.Size = Vector3.new(Thickness,Thickness,magz/Times) local ofz = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)]) li.Material="Neon" local trolpos = CFrame.new(curpos,End)*CFrame.new(0,0,magz/Times).p+ofz if Times == i then local magz2 = (curpos - End).magnitude li.Size = Vector3.new(Thickness,Thickness,magz2) li.CFrame = CFrame.new(curpos,End)*CFrame.new(0,0,-magz2/2) else li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2) end curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p Spawn(function() for i=1,10 do wait() li.Transparency = li.Transparency+.1 end li:Destroy() end) end end function tmdmg(tm,pa,dmg,rng) Spawn(function() for i=1,tm do wait() for i,v in pairs(workspace:children()) do if v:IsA("Model") and v:findFirstChild("Humanoid") then if v:findFirstChild("Head") and v:findFirstChild("Torso") then if (v:findFirstChild("Torso").Position - pa.Position).magnitude < rng and v.Name ~= pl.Name then v.Humanoid:TakeDamage(dmg) end end end end end end) end function stratle() Tween(rw,cf(1.5,.75,0)*ca(0,0,rad(120)),.2) so('206083107',tor,false,.7,1) Spawn(function() for i=1,7 do wait(.1) for i=1,math.random(3,7) do mgblock(dmnd,cf(math.random(-3,3),math.random(-3,3),math.random(-3,3)),2,'Lime green','White',Vector3.new(1,1,1),0) end end end) wait(.2) mgblock(pl['Right Arm'],cf(0,-1,0),10,'Lime green','White',Vector3.new(1.5,1.5,1.5),0) so('200633433',tor,false,1,1) wait(1) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.2) for i=1,3 do local pa= Part(1,1,1,'Lime green',0,false,true,workspace) pa.Reflectance=1 pa.CFrame=dmnd.CFrame*CFrame.Angles(math.random(),math.random(),math.random()) local ms=Mesh(pa,'http://www.roblox.com/asset/?id=3270017',2,2,.02) Spawn(function() for i=1,20 do wait() pa.Reflectance=pa.Reflectance-.05 pa.Transparency=pa.Transparency+.05 ms.Scale=ms.Scale+Vector3.new(.5,.5,0) end pa:Destroy() end) end wait(.1) local goto=dmnd.Position+Vector3.new(0,1000,0) Lightning2(dmnd.Position,goto,math.random(5,10),math.random(-2.5,2.5),BrickColor.new'Lime green',2) so('219338923',tor,false,1,1) so('206083093',tor,false,1,1) wait(2) for i=1,math.random(4,7) do local start=dmnd.Position+Vector3.new(math.random(-50,50),1000,math.random(-50,50)) local goto=mouse.Hit.p+Vector3.new(math.random(-15,15),1,math.random(-15,15)) so('219339064',workspace,false,1,1) Lightning2(start,goto,math.random(5,10),math.random(-2.5,2.5),BrickColor.new'Lime green',.2) explosion('Really black','Lime green',CFrame.new(goto),Vector3.new(10,10,10),15,30) wait(math.random(1,10)/10) end end function plc() if x then Tween(lw,cf(-1,.5,-.5)*ca(rad(120),0,rad(45)),.2) Tween(rw,cf(1,.5,-.5)*ca(rad(120),0,-rad(45)),.2) so('206083107',tor,false,.7,1) wait(.4) so('206083107',tor,false,.5,1) Tween(lw,cf(-1,.5,-.5)*ca(rad(90),0,rad(45)),.4) Tween(rw,cf(1,.5,-.5)*ca(rad(90),0,-rad(45)),.4) Tween(rj,cf(0,-1.3,0)*ca(0,0,0),.4) Tween(rw2,rwc1*cf(-.75,-1.3,0),.4) Tween(lw2,lwc1*cf(0,-.7,0)*ca(0,0,-rad(60)),.4) wait(.5) mwl:Destroy() mpa.Anchored=true so('219338674',tor,false,1,1) for i=1,3 do for i=1,math.random(3,7) do mgblock(dmnd,cf(math.random(-3,3),math.random(-3,3),math.random(-3,3)),2,'Lime green','White',Vector3.new(1,1,1),0) end local pa= Part(1,1,1,'Lime green',0,false,true,workspace) pa.Reflectance=1 pa.CFrame=dmnd.CFrame*CFrame.Angles(math.random(),math.random(),math.random()) local ms=Mesh(pa,'http://www.roblox.com/asset/?id=3270017',5,5,.02) Spawn(function() for i=1,20 do wait() pa.Reflectance=pa.Reflectance-.05 pa.Transparency=pa.Transparency+.05 ms.Scale=ms.Scale+Vector3.new(.5,.5,0) end pa:Destroy() end) end wait(.1) Tween(mwl2,cf(0,-1,-0.2)*ca(-pi/2,0,0),.5) Tween(mowl3,cf(-0.0125,.9+.75,-0.075)*ca(0,0,pi/2),.1) Tween(mowl4,cf(0.0125,.9+.75,-0.075)*ca(pi/1,pi/1,pi/2),.1) Tween(mowl5,cf(0.0125,.9+.75,0.075)*ca(0,pi/1,pi/2),.1) Tween(mowl6,cf(-0.0125,.9+.75,0.075)*ca(pi/1,0,pi/2),.1) Tween(mowl7,cf(0,1.4+1.5,0),.1) Spawn(function() for i=1,5 do wait() mom3.Scale=mom3.Scale+Vector3.new(0.3,0,0) mom4.Scale=mom4.Scale+Vector3.new(0.3,0,0) mom5.Scale=mom5.Scale+Vector3.new(0.3,0,0) mom6.Scale=mom6.Scale+Vector3.new(0.3,0,0) end end) smode='sword' so('219339134',tor,false,1,1) --Tween(mwl,cf(0,-1,0)*ca(-pi/2,pi/2,0),.1) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.1) Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(18)),.1) Tween(rj,cf(0,0,0)*ca(0,0,0),.2) Tween(rw2,rwc1,.2) Tween(lw2,lwc1,.2) else for i=1,10 do wait() for _,v in pairs(mo:GetChildren()) do if v.ClassName=="Part" then v.Reflectance=v.Reflectance-.1 v.Transparency=v.Transparency+.1 end end end mpa.Anchored=false mwl= Weld(mpa,pl['Right Arm'],0,-1,0,-pi/2,0,0,mo) for i=1,10 do wait() for _,v in pairs(mo:GetChildren()) do if v.ClassName=="Part" then v.Reflectance=v.Reflectance+.1 v.Transparency=v.Transparency-.1 end end end Tween(mwl2,cf(0,-1,-0.2)*ca(-pi/2,0,0),.5) Tween(mowl3,cf(-0.0125,.9,-0.075)*ca(0,0,pi/2),.2) Tween(mowl4,cf(0.0125,.9,-0.075)*ca(pi/1,pi/1,pi/2),.2) Tween(mowl5,cf(0.0125,.9,0.075)*ca(0,pi/1,pi/2),.2) Tween(mowl6,cf(-0.0125,.9,0.075)*ca(pi/1,0,pi/2),.2) Tween(mowl7,cf(0,1.4,0),.2) Spawn(function() for i=1,5 do wait() mom3.Scale=mom3.Scale-Vector3.new(0.3,0,0) mom4.Scale=mom4.Scale-Vector3.new(0.3,0,0) mom5.Scale=mom5.Scale-Vector3.new(0.3,0,0) mom6.Scale=mom6.Scale-Vector3.new(0.3,0,0) end end) so('206083252',tor,false,.9,1) for i=1,3 do for i=1,math.random(3,7) do mgblock(tp,cf(math.random(-3,3)/2,math.random(-3,3)/2,math.random(-3,3)/2),2,'Lime green','White',Vector3.new(.1,.1,.1),0) end end Tween(mwl2,cf(0,-1,0.2)*ca(pi/2,0,0),.1) smode='knife' end end function eq() deb=true so('31758934',pl.Torso,false,1,1) ani(true) Tween(rw,cf(1.5,.5,0)*ca(-rad(60),0,-rad(50)),.1) Tween(lw,cf(-1.5,.5,0)*ca(-rad(60),0,rad(50)),.1) wait(.4) mwl.Part1 = pl['Right Arm'] Tween(mwl,cf(0,-1,0)*ca(-pi/2,pi/2,0),.1) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.1) mwl2.Part1 = pl['Left Arm'] Tween(mwl2,cf(0,-1,0.2)*ca(pi/2,0,0),.1) Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(18)),.1) wait(.4) equi=true deb=false end function dc() deb=true equi=false so('31758934',pl.Torso,false,1,1) Tween(rw,cf(1.5,.5,0)*ca(-rad(60),0,-rad(50)),.1) Tween(lw,cf(-1.5,.5,0)*ca(-rad(60),0,rad(50)),.1) wait(.4) mwl.Part1 = tor Tween(mwl,cf(0,0,0.5)*ca(0,0,rad(45)),.5) Tween(rw,cf(1.5,.5,0)*ca(0,0,0),.1) mwl2.Part1 = tor Tween(mwl2,cf(-.5,-1,.5)*ca(pi/2,0,-pi/2),.5) Tween(lw,cf(-1.5,.5,0)*ca(0,0,0),.1) wait(.4) ani(false) deb=false end mo=Instance.new("Model",pl) mo.Name='s_Celestial' -- staff mpa= Part(1,1,1,'Black',0,false,false,mo) Mesh(mpa,1,.15,4,.15) mwl= Weld(mpa,tor,0,0,0.5,0,0,rad(45),mo)--0,-1,0,-pi/2,0,0 pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,1,.175,.75,.175) wl= Weld(pa,mpa,0,0,0,0,0,0,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,3,.175,.05,.175) wl= Weld(pa,mpa,0,.375,0,0,0,0,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,3,.175,.05,.175) wl= Weld(pa,mpa,0,-.375,0,0,0,0,mo) pa= Part(1,1,1,'Black',0,false,false,mo) Mesh(pa,'http://www.roblox.com/asset/?id=1778999',.17,.2,.17) wl= Weld(pa,mpa,0,-1.7,0,0,0,0,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,1,.225,.2,.225) wl= Weld(pa,mpa,0,-1.967,0,0,0,0,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=1778999',.17,.2,.17) wl= Weld(pa,mpa,0,-2.22,0,pi/1,0,0,mo) pa= Part(1,1,1,'Lime green',0,false,false,mo) pa.Material='Granite' Mesh(pa,1,.1,.27,.1) wl= Weld(pa,mpa,0,-1.967,0,pi/2,0,0,mo) pa= Part(1,1,1,'Lime green',0,false,false,mo) pa.Material='Granite' Mesh(pa,1,.1,.27,.1) wl= Weld(pa,mpa,0,-1.967,0,pi/2,0,pi/2,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=1778999',.17,.2,.17) wl= Weld(pa,mpa,0,1.7,0,pi/1,0,0,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,1,.225,.2,.225) wl= Weld(pa,mpa,0,1.967,0,0,0,0,mo) pa= Part(1,1,1,'New Yeller',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/Asset/?id=9756362',.255,.05,.255) wl= Weld(pa,mpa,0,2.05,0,0,rad(45),0,mo) dmnd= Part(.25,.25,.25,'Lime green',1,false,false,mo) dmndwl= Weld(dmnd,mpa,0,2.2,0,0,0,0,mo) dmndp= Part(.25,.25,.25,'Lime green',0,false,false,mo) dmndp.Material="Neon" dmndpwl= Weld(dmndp,dmnd,0,0,0,rad(45),rad(45),rad(90),mo) pa= Part(1,1,1,'Black',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=3270017',1.5,1.5,.2) wl= Weld(pa,dmnd,0,0,0,0,0,0,mo) pa= Part(1,1,1,'Black',0,false,false,mo) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=3270017',1.5,1.5,.2) wl= Weld(pa,dmnd,0,0,0,0,pi/2,0,mo) for i=1,3 do for i = 1, 360, 24 do local pa= Part(.2,.2,.2,'New Yeller',0.5,false,false,mo) m=Mesh(pa,'http://www.roblox.com/Asset/?id=9756362',.05,.1,.05) pa.Material="Neon" pa.Reflectance=.75 local weld = Instance.new("Weld") weld.Parent = mo weld.Part0 = dmnd weld.Part1 = pa weld.C0 = CFrame.Angles(0,-rad(i),0) * CFrame.new(0.25*math.cos(rad(i/100)),-0.75,0.25*math.sin(rad(i/100))) * CFrame.Angles(0,0,pi/2) local pa= Part(.2,.2,.2,'New Yeller',0.5,false,false,mo) m=Mesh(pa,'http://www.roblox.com/Asset/?id=9756362',.05,.1,.05) pa.Material="Neon" pa.Reflectance=.75 local weld = Instance.new("Weld") weld.Parent = mo weld.Part0 = dmnd weld.Part1 = pa weld.C0 = CFrame.Angles(0,0,-math.rad(i)) * CFrame.new(0.25*math.cos(math.rad(i/100)),0.25*math.sin(math.rad(i/100))-0.75,0) local pa= Part(.2,.2,.2,'New Yeller',0.5,false,false,mo) m=Mesh(pa,'http://www.roblox.com/Asset/?id=9756362',.05,.1,.05) pa.Material="Neon" pa.Reflectance=.75 local weld = Instance.new("Weld") weld.Parent = mo weld.Part0 = dmnd weld.Part1 = pa weld.C0 = CFrame.Angles(0,pi/2,-math.rad(i)) * CFrame.new(0.25*math.cos(math.rad(i/100)),0.25*math.sin(math.rad(i/100))-0.75,0) end end --knife mo2=Instance.new('Model',pl) mo2.Name='k_Celestial' mpa2= Part(1,1,1,'Black',0,false,false,mo2) Mesh(mpa2,1,.15,.75,.15) mwl2= Weld(mpa2,tor,-.5,-1,.5,pi/2,0,-pi/2,mo2)--0,-1,-0.2,-pi/2,0,0 pa= Part(1,1,1,'New Yeller',0,false,false,mo2) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=3270017',.175,.6,.175) wl= Weld(pa,mpa2,0,0,0,rad(15),0,0,mo2) pa= Part(1,1,1,'New Yeller',0,false,false,mo2) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=3270017',.175,.6,.175) wl= Weld(pa,mpa2,0,0,0,-rad(15),0,0,mo2) pa= Part(1,1,1,'New Yeller',0,false,false,mo2) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=3270017',.175,.6,.175) wl= Weld(pa,mpa2,0,0,0,rad(15),pi/2,0,mo2) pa= Part(1,1,1,'New Yeller',0,false,false,mo2) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=3270017',.175,.6,.175) wl= Weld(pa,mpa2,0,0,0,-rad(15),pi/2,0,mo2) pa= Part(1,1,1,'Black',0,false,false,mo2) Mesh(pa,'http://www.roblox.com/asset/?id=1778999',.17,.2,.17) wl= Weld(pa,mpa2,0,-.25,0,0,0,0,mo2) pa= Part(1,1,1,'New Yeller',0,false,false,mo2) pa.Reflectance=.75 Mesh(pa,1,.225,.2,.225) wl= Weld(pa,mpa2,0,-.515,0,0,0,0,mo2) pa= Part(1,1,1,'New Yeller',0,false,false,mo2) pa.Reflectance=.75 Mesh(pa,'http://www.roblox.com/asset/?id=1778999',.17,.2,.17) wl= Weld(pa,mpa2,0,-.775,0,pi/1,0,0,mo2) pa= Part(1,1,1,'Lime green',0,false,false,mo2) pa.Material='Granite' Mesh(pa,1,.1,.27,.1) wl= Weld(pa,mpa2,0,-.515,0,pi/2,0,0,mo2) pa= Part(1,1,1,'Lime green',0,false,false,mo2) pa.Material='Granite' Mesh(pa,1,.1,.27,.1) wl= Weld(pa,mpa2,0,-.515,0,pi/2,0,pi/2,mo2) pa= Part(1,1,1,'Black',0,false,false,mo2) mom1=Mesh(pa,3,.5,.15,.15) mowl1= Weld(pa,mpa2,0,.5,-0.15,0,pi/2,rad(45),mo2) pa= Part(1,1,1,'Black',0,false,false,mo2) mom2=Mesh(pa,3,.5,.15,.15) mowl2= Weld(pa,mpa2,0,.5,0.15,0,pi/2,-rad(45),mo2) pa= Part(1,1,1,'Lime green',0,false,false,mo2) pa.Reflectance=.75 mom3=Mesh(pa,4,1,.025,.15) mowl3= Weld(pa,mpa2,-0.0125,.9,-0.075,0,0,pi/2,mo2) pa= Part(1,1,1,'Lime green',0,false,false,mo2) pa.Reflectance=.75 mom4=Mesh(pa,4,1,.025,.15) mowl4= Weld(pa,mpa2,0.0125,.9,-0.075,pi/1,pi/1,pi/2,mo2) pa= Part(1,1,1,'Lime green',0,false,false,mo2) pa.Reflectance=.75 mom5=Mesh(pa,4,1,.025,.15) mowl5= Weld(pa,mpa2,0.0125,.9,0.075,0,pi/1,pi/2,mo2) pa= Part(1,1,1,'Lime green',0,false,false,mo2) pa.Reflectance=.75 mom6=Mesh(pa,4,1,.025,.15) mowl6= Weld(pa,mpa2,-0.0125,.9,0.075,pi/1,0,pi/2,mo2) tp= Part(1,1,1,'Lime green',0,false,false,mo2) tp.Reflectance=.75 Mesh(tp,'http://www.roblox.com/Asset/?id=9756362',.035,.5,.2) mowl7= Weld(tp,mpa2,0,1.4,0,0,0,0,mo2) --pa.Material='Granite' function onKeyDown(key) key = key:lower() if deb==true then return end if key == "q" then a=not a if a then eq()else dc()end elseif key == "x" then if equi==false then return end x=not x plc() elseif key == "c" then if equi==false or smode=='knife' then return end c=c stratle() end end --so('62777105',tor,false,1) function onClicked() if equi==false or deb==true then return end if smode=='knife' then deb=true Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(90)),.2) wait(.3) trail(tp,7,'White') tmdmg(10,tp,4,2) so('206083107',tor,false,.9,1) Tween(lw,cf(-1.5,.5,0)*ca(0,-rad(90),-rad(90)),.2) Tween(rj,cf(0,0,0)*ca(0,-rad(90),0),.2) Tween(hw,cf(0,2,0)*ca(0,rad(90),0),.2) wait(.3) Tween(mwl2,cf(0,-1,-0.2)*ca(-pi/2,0,0),.5) wait(.05) tmdmg(10,tp,4,2) so('206083107',tor,false,.7,1) Tween(lw,cf(-1.5,.5,0)*ca(0,rad(30),-rad(90)),.2) wait(.001) trail(tp,7,'White') wait(.3) so('206083107',tor,false,.5,1) Tween(rj,cf(0,0,0)*ca(0,rad(90),0),.2) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(90)),.2) Tween(mwl,cf(0,-1,0)*ca(-pi/1,pi/2,0),.2) Tween(hw,cf(0,2,0)*ca(0,-rad(90),0),.2) wait(.3) for i=1,5 do so('206083293',tor,false,1,100) end for i,v in pairs(workspace:children()) do if v:IsA("Model") and v:findFirstChild("Humanoid") then if v:findFirstChild("Head") and v:findFirstChild("Torso") then if (v:findFirstChild("Torso").Position - dmnd.Position).magnitude < 8 and v.Name ~= pl.Name then for i=1,5 do wait() local goto=v.Torso.Position+Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1)) Lightning(dmnd.Position,goto,math.random(5,10),math.random(-2.5,2.5),BrickColor.new'Lime green',.1) v.Humanoid:TakeDamage(4) end end end end end Tween(mwl,cf(0,-1,0)*ca(-pi/2,pi/2,0),.1) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.1) Tween(mwl2,cf(0,-1,0.2)*ca(pi/2,0,0),.1) Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(18)),.1) Tween(rj,cf(0,0,0)*ca(0,0,0),.2) Tween(hw,cf(0,2,0)*ca(0,0,0),.2) wait(.3) deb=false elseif smode=='sword' then deb=true Tween(lw,cf(-1.5,.5,0)*ca(rad(120),0,-rad(40)),.3) Tween(rw,cf(1.5,.5,0)*ca(rad(20),0,rad(20)),.3) wait(.18) so('206083107',pl.Torso,false,.6,1) trail(tp,7,'White') tmdmg(10,tp,4,2) Tween(lw,cf(-1.5,.5,0)*ca(rad(15),0,rad(30)),.3) Tween(rw,cf(1.5,.5,0)*ca(-rad(20),0,rad(20)),.3) wait(.18) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.3) Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(18)),.3) wait(.18) Tween(lw,cf(-1.5,.5,0)*ca(rad(120),0,rad(40)),.3) Tween(rw,cf(1.5,.5,0)*ca(rad(20),0,rad(20)),.3) wait(.18) so('206083107',pl.Torso,false,.45,1) trail(tp,7,'White') tmdmg(10,tp,4,2) Tween(lw,cf(-1.5,.5,0)*ca(rad(15),0,-rad(30)),.3) Tween(rw,cf(1.5,.5,0)*ca(-rad(20),0,rad(20)),.3) wait(.18) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.3) Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(18)),.3) wait(.18) Tween(rw,cf(1.5,.5,0)*ca(0,-rad(30),rad(90)),.3) its=so('219338993',pl.Torso,false,1,3) for i=1,15 do wait(.1) local goto=mgblock(pl['Right Arm'],cf(0,-1,0),2,'Lime green','White',Vector3.new(1.5,1.5,1.5),0) Lightning2(dmnd.Position,goto.Position,math.random(5,10),math.random(-2.5,2.5),BrickColor.new'Lime green',.2) end mgblock(pl['Right Arm'],cf(0,-1,0),7,'Lime green','White',Vector3.new(1.5,1.5,1.5),0) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(90)),.3) Tween(rj,cf(0,0,0)*ca(0,rad(90),0),.3) Tween(hw,cf(0,2,0)*ca(0,-rad(90),0),.3) wait(.3) its:Stop() explosion('Really black','Lime green',pl['Right Arm'].CFrame*CFrame.new(0,-2,0),Vector3.new(5,5,5),10,20) Tween(rw,cf(1.5,.5,0)*ca(0,0,rad(18)),.1) Tween(lw,cf(-1.5,.5,0)*ca(0,0,-rad(18)),.1) Tween(rj,cf(0,0,0)*ca(0,0,0),.2) Tween(hw,cf(0,2,0)*ca(0,0,0),.2) wait(.3) deb=false end end mouse.Button1Down:connect(function() onClicked(mouse) end) mouse.KeyDown:connect(onKeyDown)
----------------------------------------- -- ID: 4666 -- Scroll of Paralyze -- Teaches the white magic Paralyze ----------------------------------------- function onItemCheck(target) return target:canLearnSpell(58) end function onItemUse(target) target:addSpell(58) end
local dap = require('dap') dap.adapters.node2 = { type = 'executable', command = 'node', args = {os.getenv('HOME') .. '.local/share/dap/vscode-node-debug2/out/src/nodeDebug.js'} } dap.configurations.javascript = { { type = 'node2', request = 'launch', program = '${workspaceFolder}/${file}', cwd = vim.fn.getcwd(), sourceMaps = true, protocol = 'inspector', console = 'integratedTerminal', } } dap.adapters.firefox = { type = 'executable', command = 'node', args = {os.getenv('HOME') .. '.local/share/dap/vscode-firefox-debug/dist/adapter.bundle.js'} } dap.adapters.chrome = { type = 'executable', command = 'node', args = {os.getenv('HOME') .. '.local/share/dap/vscode-chrome-debug/out/src/chromeDebug.js'} } dap.configurations.javascript = { { name = 'node', type = 'node2', request = 'launch', program = '${workspaceFolder}/${file}', cwd = vim.fn.getcwd(), sourceMaps = true, protocol = 'inspector', console = 'integratedTerminal', }, { name = 'firefox', type = 'firefox', request = 'launch', reAttach = true, url = 'http://localhost:5000', webRoot = '${workspaceFolder}', firefoxExecutable = '/usr/bin/firefox' }, -- chrome must be started with a remote debugging port: -- google-chrome-stable --remote-debugging-port=9222 { type = "chrome", request = "attach", program = "${file}", cwd = vim.fn.getcwd(), sourceMaps = true, protocol = "inspector", port = 9222, webRoot = "${workspaceFolder}" } }
local cf = require "cf" local cf_fork = cf.fork local cf_sleep = cf.sleep local wbproto = require "protocol.websocket.protocol" local _recv_frame = wbproto.recv_frame local _send_frame = wbproto.send_frame local Log = require "logging":new { dump = true, path = 'protocol-websocket-server'} local type = type local pcall = pcall local ipairs = ipairs local assert = assert local insert = table.insert local char = string.char local class = require "class" local ws = class("ws") function ws:ctor(opt) self.sock = opt.sock self.send_masked = nil self.max_payload_len = 65535 self.ext = opt.ext end -- 设置发送掩码 function ws:set_send_masked(send_masked) self.send_masked = send_masked end -- 设置最大数据载荷长度 function ws:set_max_payload_len(max_payload_len) self.max_payload_len = max_payload_len end -- 异步消息发送 function ws:add_to_queue (f) if not self.queue then self.queue = {f} return cf_fork(function (...) for index, func in ipairs(self.queue) do local ok, writeable = pcall(func) if not ok then Log:ERROR(writeable) end if not ok or not writeable then break end end self.queue = nil end) end return self.queue and insert(self.queue, f) end -- 发送text/binary消息 function ws:send (data, binary) if self.closed then return end assert(type(data) == 'string' and data ~= '', "websoket error: send need string data.") self:add_to_queue(function () return _send_frame(self.sock, true, binary and 0x2 or 0x1, data, self.max_payload_len, self.send_masked, self.ext) end) end -- 发送close帧 function ws:close(data) if self.closed then return end self.closed = true self:add_to_queue(function () return _send_frame(self.sock, true, 0x8, char(((1000 >> 8) & 0xff), (1000 & 0xff))..(type(data) == 'string' and data or ""), self.max_payload_len, self.send_masked, self.ext) end) self:add_to_queue(function () return self.sock:close() end) end local Websocket = { __Version__ = 1.0 } -- Websocket Server 事件循环 function Websocket.start(opt) local sock = opt.sock local ext = opt.ext local w = ws:new { sock = sock, ext = ext } local cls = opt.cls:new { ws = w } local on_open = assert(type(cls.on_open) == 'function' and cls.on_open, "'on_open' method is not implemented.") local on_message = assert(type(cls.on_message) == 'function' and cls.on_message, "'on_message' method is not implemented.") local on_error = assert(type(cls.on_error) == 'function' and cls.on_error, "'on_error' method is not implemented.") local on_close = assert(type(cls.on_close) == 'function' and cls.on_close, "'on_close' method is not implemented.") sock._timeout = cls.timeout or nil local send_masked = cls.send_masked or nil local max_payload_len = cls.max_payload_len or 65535 w:set_send_masked(send_masked) w:set_max_payload_len(max_payload_len) local ok, err = pcall(on_open, cls) if not ok then Log:ERROR(err) return end while 1 do local data, typ, err = _recv_frame(sock, max_payload_len, send_masked) if (not data and not typ) or typ == 'close' then w.closed = true if err and err ~= 'read timeout' then local ok, err = pcall(on_error, cls, err) if not ok then Log:ERROR(err) end end local ok, err = pcall(on_close, cls, data or err) if not ok then Log:ERROR(err) end break end if typ == 'ping' then w:add_to_queue(function () return _send_frame(sock, true, 0xA, data or '', max_payload_len, send_masked, ext) end) end if typ == 'text' or typ == 'binary' then cf_fork(on_message, cls, data, typ == 'binary') end end return end return Websocket
print("Better Trade Screen loaded") -- =========================================================================== -- SETTINGS -- =========================================================================== local alignTradeYields = true local showNoBenefitsString = false local showSortOrdersPermanently = false local hideTradingPostIcon = false local blockPanelInBetweenTurns = true -- Color Settings for Headers local colorCityPlayerHeader = true local backdropGridColorOffset = 20 local backdropGridColorOpacity = 140 local backdropColorOffset = -15 local backdropColorOpacity = 55 local labelColorOffset = -27 local labelColorOpacity = 255 -- Color Settings for Route Entry local hideHeaderOpaqueBackdrop = false local tintTradeRouteEntry = true local tintColorOffset = 80 local tintColorOpacity = 205 local tintLabelColorOffset = 10 local tintLabelColorOpacity = 210 -- =========================================================================== -- INCLUDES -- =========================================================================== include("AnimSidePanelSupport"); include("InstanceManager"); include("SupportFunctions"); include("TradeSupport"); -- =========================================================================== -- CONSTANTS -- =========================================================================== local RELOAD_CACHE_ID :string = "TradeOverview"; -- Must be unique (usually the same as the file name) local OUTSIDE_SUPPORT_CACHE_ID :string = "TradeOverviewSupport"; local DATA_ICON_PREFIX :string = "ICON_"; local TRADE_TABS :table = { MY_ROUTES = 0; ROUTES_TO_CITIES = 1; AVAILABLE_ROUTES = 2; }; local GROUP_BY_SETTINGS :table = { NONE = 1; ORIGIN = 2; DESTINATION = 3; }; local SORT_BY_ID :table = { FOOD = 1; PRODUCTION = 2; GOLD = 3; SCIENCE = 4; CULTURE = 5; FAITH = 6; TURNS_TO_COMPLETE = 7; } local SORT_ASCENDING = 1 local SORT_DESCENDING = 2 local GROUP_DESTINATION_ROUTE_SHOW_COUNT :number = 2; local GROUP_ORIGIN_ROUTE_SHOW_COUNT :number = 4; local GROUP_NONE_ROUTE_SHOW_COUNT :number = 100; local m_shiftDown :boolean = false; local m_ctrlDown :boolean = false; -- =========================================================================== -- VARIABLES -- =========================================================================== local m_RouteInstanceIM :table = InstanceManager:new("RouteInstance", "Top", Controls.BodyStack); local m_HeaderInstanceIM :table = InstanceManager:new("HeaderInstance", "Top", Controls.BodyStack); local m_SimpleButtonInstanceIM :table = InstanceManager:new("SimpleButtonInstance", "Top", Controls.BodyStack); local m_AnimSupport :table; -- AnimSidePanelSupport local m_currentTab :number = TRADE_TABS.MY_ROUTES; local m_processingTurn :boolean = false; -- Trade Routes Tables local m_AvailableTradeRoutes :table = {}; -- Stores all available routes local m_LocalPlayerRunningRoutes :table = {}; -- Stores the current running routes local m_TraderAutomated :table = {}; -- Stores filter list and tracks the currently selected list local m_filterList :table = {}; local m_filterCount :number = 0; local m_filterSelected :number = 1; local m_groupBySelected :number = 1; local m_groupByList :table = {}; local m_cityRouteLimitExclusionList :table = {}; -- Variables used for cycle trade units function local m_TradeUnitIndex :number = 0; local m_CurrentCyclingUnitsTradeRoute :number = -1; local m_DisplayedTradeRoutes :number = 0; local m_HasBuiltTradeRouteTable :boolean = false; local m_LastTurnBuiltTradeRouteTable :number = -1; local m_LastTurnUpdatedMyRoutes :number = -1; local m_GroupShowAll :boolean = false; -- Stores the sort settings. local m_SortBySettings = {}; local m_GroupSortBySettings = {}; -- Default is ascending in turns to complete trade route m_SortBySettings[1] = { SortByID = SORT_BY_ID.TURNS_TO_COMPLETE; SortOrder = SORT_ASCENDING; }; -- Default is ascending in turns to complete trade route m_GroupSortBySettings[1] = { SortByID = SORT_BY_ID.GOLD; SortOrder = SORT_DESCENDING; }; local m_CompareFunctionByID = {}; m_CompareFunctionByID[SORT_BY_ID.FOOD] = function(a, b) return CompareByFood(a, b) end; m_CompareFunctionByID[SORT_BY_ID.PRODUCTION] = function(a, b) return CompareByProduction(a, b) end; m_CompareFunctionByID[SORT_BY_ID.GOLD] = function(a, b) return CompareByGold(a, b) end; m_CompareFunctionByID[SORT_BY_ID.SCIENCE] = function(a, b) return CompareByScience(a, b) end; m_CompareFunctionByID[SORT_BY_ID.CULTURE] = function(a, b) return CompareByCulture(a, b) end; m_CompareFunctionByID[SORT_BY_ID.FAITH] = function(a, b) return CompareByFaith(a, b) end; m_CompareFunctionByID[SORT_BY_ID.TURNS_TO_COMPLETE] = function(a, b) return CompareByTurnsToComplete(a, b) end; -- Finds and adds all possible trade routes function RebuildAvailableTradeRoutesTable() print("Rebuilding Trade Routes table"); m_AvailableTradeRoutes = {}; local sourceCities :table = Players[Game.GetLocalPlayer()]:GetCities(); local players :table = Game:GetPlayers(); local tradeManager :table = Game.GetTradeManager(); print("Group setting: " .. m_groupByList[m_groupBySelected].groupByString); -- Build tables differently for group settings if m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.ORIGIN then for i, sourceCity in sourceCities:Members() do m_AvailableTradeRoutes[i] = {}; local hasTradeRoute = false for j, destinationPlayer in ipairs(players) do local destinationCities :table = destinationPlayer:GetCities(); for k, destinationCity in destinationCities:Members() do -- Can we trade with this city / civ if tradeManager:CanStartRoute(sourceCity:GetOwner(), sourceCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID()) then hasTradeRoute = true -- Create the trade route entry local tradeRoute = { OriginCityPlayer = Game.GetLocalPlayer(), OriginCityID = sourceCity:GetID(), DestinationCityPlayer = destinationPlayer:GetID(), DestinationCityID = destinationCity:GetID() }; table.insert(m_AvailableTradeRoutes[i], tradeRoute); end end end -- Remove entry if no trade route existed if not hasTradeRoute then table.remove(m_AvailableTradeRoutes, i); end end elseif m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.DESTINATION then local destinationCityCounter :number = 0; for i, destinationPlayer in ipairs(players) do local destinationCities :table = destinationPlayer:GetCities(); for j, destinationCity in destinationCities:Members() do local hasTradeRoute = false destinationCityCounter = destinationCityCounter + 1; m_AvailableTradeRoutes[destinationCityCounter] = {}; for k, sourceCity in sourceCities:Members() do -- Can we trade with this city / civ if tradeManager:CanStartRoute(sourceCity:GetOwner(), sourceCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID()) then hasTradeRoute = true -- Create the trade route entry local tradeRoute = { OriginCityPlayer = Game.GetLocalPlayer(), OriginCityID = sourceCity:GetID(), DestinationCityPlayer = destinationPlayer:GetID(), DestinationCityID = destinationCity:GetID() }; table.insert(m_AvailableTradeRoutes[destinationCityCounter], tradeRoute); end end -- Remove entry if no trade route existed if not hasTradeRoute then table.remove(m_AvailableTradeRoutes, destinationCityCounter); destinationCityCounter = destinationCityCounter - 1; end end end else for i, sourceCity in sourceCities:Members() do for j, destinationPlayer in ipairs(players) do local destinationCities :table = destinationPlayer:GetCities(); for k, destinationCity in destinationCities:Members() do -- Can we trade with this city / civ if tradeManager:CanStartRoute(sourceCity:GetOwner(), sourceCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID()) then -- Create the trade route entry local tradeRoute = { OriginCityPlayer = Game.GetLocalPlayer(), OriginCityID = sourceCity:GetID(), DestinationCityPlayer = destinationPlayer:GetID(), DestinationCityID = destinationCity:GetID() }; table.insert(m_AvailableTradeRoutes, tradeRoute); end end end end end m_HasBuiltTradeRouteTable = true; m_LastTurnBuiltTradeRouteTable = Game.GetCurrentGameTurn(); end function Refresh() PreRefresh(); RefreshGroupByPulldown(); RefreshFilters(); RefreshSortBar(); if m_currentTab == TRADE_TABS.MY_ROUTES then ViewMyRoutes(); elseif m_currentTab == TRADE_TABS.ROUTES_TO_CITIES then ViewRoutesToCities(); elseif m_currentTab == TRADE_TABS.AVAILABLE_ROUTES then ViewAvailableRoutes(); else ViewMyRoutes(); end PostRefresh(); end function PreRefresh() -- Reset Stack m_RouteInstanceIM:ResetInstances(); m_HeaderInstanceIM:ResetInstances(); m_SimpleButtonInstanceIM:ResetInstances(); end function PostRefresh() -- Calculate Stack Sizess Controls.HeaderStack:CalculateSize(); Controls.HeaderStack:ReprocessAnchoring(); Controls.BodyScrollPanel:CalculateSize(); Controls.BodyScrollPanel:ReprocessAnchoring(); Controls.BodyScrollPanel:CalculateInternalSize(); end -- =========================================================================== -- Tab functions -- =========================================================================== -- Show My Routes Tab function ViewMyRoutes() m_DisplayedTradeRoutes = 0; -- Update Tabs SetMyRoutesTabSelected(true); SetRoutesToCitiesTabSelected(false); SetAvailableRoutesTabSelected(false); -- Update Header local playerTrade :table = Players[Game.GetLocalPlayer()]:GetTrade(); local routesActive :number = playerTrade:GetNumOutgoingRoutes(); local routesCapacity :number = playerTrade:GetOutgoingRouteCapacity(); Controls.HeaderLabel:SetText(Locale.ToUpper("LOC_TRADE_OVERVIEW_MY_ROUTES")); Controls.ActiveRoutesLabel:SetHide(false); -- If our active routes exceed our route capacity then color active route number red local routesActiveText :string = "" if routesActive > routesCapacity then routesActiveText = "[COLOR_RED]" .. tostring(routesActive) .. "[ENDCOLOR]"; else routesActiveText = tostring(routesActive); end Controls.ActiveRoutesLabel:SetText(Locale.Lookup("LOC_TRADE_OVERVIEW_ACTIVE_ROUTES", routesActiveText, routesCapacity)); -- Run a safety check, to make all running routes are present in table, -- and routes completed are removed. CheckConsistencyWithMyRunningRoutes(m_LocalPlayerRunningRoutes); -- Gather data and apply filter local routesSortedByPlayer :table = {}; for i, route in ipairs(m_LocalPlayerRunningRoutes) do if m_filterList[m_filterSelected].FilterFunction and m_filterList[m_filterSelected].FilterFunction(Players[route.DestinationCityPlayer]) then -- Make sure we have a table for each destination player if routesSortedByPlayer[route.DestinationCityPlayer] == nil then routesSortedByPlayer[route.DestinationCityPlayer] = {}; end table.insert(routesSortedByPlayer[route.DestinationCityPlayer], route); end end -- Add routes to local player cities if routesSortedByPlayer[Game.GetLocalPlayer()] ~= nil then CreatePlayerHeader(Players[Game.GetLocalPlayer()]); SortTradeRoutes(routesSortedByPlayer[Game.GetLocalPlayer()]); for i, route in ipairs(routesSortedByPlayer[Game.GetLocalPlayer()]) do AddRouteInstanceFromRouteInfo(route); end end -- Add routes to other civs local haveAddedCityStateHeader :boolean = false; for playerID, routes in pairs(routesSortedByPlayer) do if playerID ~= Game.GetLocalPlayer() then SortTradeRoutes(routes); -- Skip City States as these are added below local playerInfluence :table = Players[playerID]:GetInfluence(); if not playerInfluence:CanReceiveInfluence() then CreatePlayerHeader(Players[playerID]); for i, route in ipairs(routes) do AddRouteInstanceFromRouteInfo(route); end else -- Add city state routes if not haveAddedCityStateHeader then haveAddedCityStateHeader = true; CreateCityStateHeader(); end for i, route in ipairs(routes) do AddRouteInstanceFromRouteInfo(route); end end end end -- Determine how many unused routes we have local unusedRoutes :number = routesCapacity - routesActive; if unusedRoutes > 0 then CreateUnusedRoutesHeader(); local idleTradeUnits :table = GetIdleTradeUnits(Game.GetLocalPlayer()); -- Assign idle trade units to unused routes for i = 1, unusedRoutes, 1 do if #idleTradeUnits > 0 then -- Add button to choose a route for this trader AddChooseRouteButtonInstance(idleTradeUnits[1]); table.remove(idleTradeUnits, 1); else -- Add button to produce new trade unit AddProduceTradeUnitButtonInstance(); end end end end -- Show Routes To My Cities Tab function ViewRoutesToCities() m_DisplayedTradeRoutes = 0; -- Update Tabs SetMyRoutesTabSelected(false); SetRoutesToCitiesTabSelected(true); SetAvailableRoutesTabSelected(false); -- Update Header Controls.HeaderLabel:SetText(Locale.ToUpper("LOC_TRADE_OVERVIEW_ROUTES_TO_MY_CITIES")); Controls.ActiveRoutesLabel:SetHide(true); -- Gather data local routesSortedByPlayer :table = {}; local players = Game.GetPlayers(); for i, player in ipairs(players) do if m_filterList[m_filterSelected].FilterFunction and m_filterList[m_filterSelected].FilterFunction(player) then local playerCities :table = player:GetCities(); for i, city in playerCities:Members() do local outgoingRoutes = city:GetTrade():GetOutgoingRoutes(); for i, route in ipairs(outgoingRoutes) do -- Check that the destination city owner is the local palyer local isDestinationOwnedByLocalPlayer :boolean = false; if route.DestinationCityPlayer == Game.GetLocalPlayer() then isDestinationOwnedByLocalPlayer = true; end if isDestinationOwnedByLocalPlayer then -- Make sure we have a table for each destination player if routesSortedByPlayer[route.OriginCityPlayer] == nil then local routes :table = {}; routesSortedByPlayer[route.OriginCityPlayer] = {}; end table.insert(routesSortedByPlayer[route.OriginCityPlayer], route); end end end end end -- Add routes to stack for playerID, routes in pairs(routesSortedByPlayer) do CreatePlayerHeader(Players[playerID]); -- Sort the routes SortTradeRoutes(routes) for i, route in ipairs(routes) do AddRouteInstanceFromRouteInfo(route); end end end -- Show Available Routes Tab function ViewAvailableRoutes() m_DisplayedTradeRoutes = 0; -- Update Tabs SetMyRoutesTabSelected(false); SetRoutesToCitiesTabSelected(false); SetAvailableRoutesTabSelected(true); -- Update Header Controls.HeaderLabel:SetText(Locale.ToUpper("LOC_TRADE_OVERVIEW_AVAILABLE_ROUTES")); Controls.ActiveRoutesLabel:SetHide(true); -- Dont rebuild if the turn has not advanced if (not m_HasBuiltTradeRouteTable) or Game.GetCurrentGameTurn() > m_LastTurnBuiltTradeRouteTable then print("Trade Route table last built on: " .. m_LastTurnBuiltTradeRouteTable .. ". Current game turn: " .. Game.GetCurrentGameTurn()); RebuildAvailableTradeRoutesTable(); end if m_groupByList[m_groupBySelected].groupByID ~= GROUP_BY_SETTINGS.NONE then -- Sort and filter the routes within each group local filteredAndSortedRoutes :table = {}; for i, groupedRoutes in ipairs(m_AvailableTradeRoutes) do local filteredRoutes :table = FilterTradeRoutes(groupedRoutes); if tableLength(filteredRoutes) > 0 then SortTradeRoutes(filteredRoutes); table.insert(filteredAndSortedRoutes, filteredRoutes); end end -- Sort the order of groups SortGroupedRoutes(filteredAndSortedRoutes); for i, filteredSortedRoutes in ipairs(filteredAndSortedRoutes) do if m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.ORIGIN then local originPlayer :table = Players[filteredSortedRoutes[1].OriginCityPlayer]; local originCity :table = originPlayer:GetCities():FindID(filteredSortedRoutes[1].OriginCityID); local routeCount :number = tableLength(filteredSortedRoutes); if routeCount > 0 then -- Find if the city is in exclusion list local originCityEntry :table = { OwnerID = originPlayer:GetID(), CityID = originCity:GetID() }; local cityExclusionIndex = findIndex(m_cityRouteLimitExclusionList, originCityEntry, CompareCityEntries); if (cityExclusionIndex > 0) then CreateCityHeader(originCity, routeCount, routeCount); AddRouteInstancesFromTable(filteredSortedRoutes); else if not m_GroupShowAll then CreateCityHeader(originCity, math.min(GROUP_ORIGIN_ROUTE_SHOW_COUNT, routeCount), routeCount); AddRouteInstancesFromTable(filteredSortedRoutes, GROUP_ORIGIN_ROUTE_SHOW_COUNT); else -- If showing all, add city to exclusion list, and display all table.insert(m_cityRouteLimitExclusionList, originCityEntry); CreateCityHeader(originCity, routeCount, routeCount); AddRouteInstancesFromTable(filteredSortedRoutes); end end end elseif m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.DESTINATION then local destinationPlayer :table = Players[filteredSortedRoutes[1].DestinationCityPlayer]; local destinationCity :table = destinationPlayer:GetCities():FindID(filteredSortedRoutes[1].DestinationCityID); local routeCount :number = tableLength(filteredSortedRoutes); if routeCount > 0 then -- Find if the city is in exclusion list local destinationCityEntry :table = { OwnerID = destinationPlayer:GetID(), CityID = destinationCity:GetID() }; local cityExclusionIndex = findIndex(m_cityRouteLimitExclusionList, destinationCityEntry, CompareCityEntries); if (cityExclusionIndex > 0) then CreateCityHeader(destinationCity, routeCount, routeCount); AddRouteInstancesFromTable(filteredSortedRoutes); else if m_GroupShowAll then -- If showing all, add city to exclusion list, and display all table.insert(m_cityRouteLimitExclusionList, destinationCityEntry); CreateCityHeader(destinationCity, routeCount, routeCount); AddRouteInstancesFromTable(filteredSortedRoutes); else CreateCityHeader(destinationCity, math.min(GROUP_DESTINATION_ROUTE_SHOW_COUNT, routeCount), routeCount); AddRouteInstancesFromTable(filteredSortedRoutes, GROUP_DESTINATION_ROUTE_SHOW_COUNT); end end end end end else local filteredRoutes :table = FilterTradeRoutes(m_AvailableTradeRoutes); if tableLength(filteredRoutes) > 0 then SortTradeRoutes(filteredRoutes); AddRouteInstancesFromTable(filteredRoutes, GROUP_NONE_ROUTE_SHOW_COUNT); end end end -- --------------------------------------------------------------------------- -- Tab UI Helpers -- --------------------------------------------------------------------------- function SetMyRoutesTabSelected(isSelected: boolean) Controls.MyRoutesButton:SetSelected(isSelected); Controls.MyRoutesTabLabel:SetHide(isSelected); Controls.MyRoutesSelectedArrow:SetHide(not isSelected); Controls.MyRoutesTabSelectedLabel:SetHide(not isSelected); end function SetRoutesToCitiesTabSelected(isSelected: boolean) Controls.RoutesToCitiesButton:SetSelected(isSelected); Controls.RoutesToCitiesTabLabel:SetHide(isSelected); Controls.RoutesToCitiesSelectedArrow:SetHide(not isSelected); Controls.RoutesToCitiesTabSelectedLabel:SetHide(not isSelected); end function SetAvailableRoutesTabSelected(isSelected: boolean) Controls.AvailableRoutesButton:SetSelected(isSelected); Controls.AvailableRoutesTabLabel:SetHide(isSelected); Controls.AvailableRoutesSelectedArrow:SetHide(not isSelected); Controls.AvailableRoutesTabSelectedLabel:SetHide(not isSelected); end -- =========================================================================== -- Route Instance Creators -- =========================================================================== function AddChooseRouteButtonInstance(tradeUnit: table) local simpleButtonInstance :table = m_SimpleButtonInstanceIM:GetInstance(); simpleButtonInstance.GridButton:SetText(Locale.Lookup("LOC_TRADE_OVERVIEW_CHOOSE_ROUTE")); simpleButtonInstance.GridButton:RegisterCallback(Mouse.eLClick, function() SelectUnit(tradeUnit); end); end function AddProduceTradeUnitButtonInstance() local simpleButtonInstance :table = m_SimpleButtonInstanceIM:GetInstance(); simpleButtonInstance.GridButton:SetText(Locale.Lookup("LOC_TRADE_OVERVIEW_PRODUCE_TRADE_UNIT")); simpleButtonInstance.GridButton:SetDisabled(true); end function AddRouteInstancesFromTable(tradeRoutes: table, showCount:number) for index, tradeRoute in ipairs(tradeRoutes) do if showCount then if index <= showCount then AddRouteInstanceFromRouteInfo(tradeRoute); end else AddRouteInstanceFromRouteInfo(tradeRoute); end end end function AddRouteInstanceFromRouteInfo(routeInfo: table) local originPlayer :table = Players[routeInfo.OriginCityPlayer]; local originCity :table = originPlayer:GetCities():FindID(routeInfo.OriginCityID); local destinationPlayer :table = Players[routeInfo.DestinationCityPlayer]; local destinationCity :table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID); AddRouteInstance(originPlayer, originCity, destinationPlayer, destinationCity, routeInfo.TraderUnitID, routeInfo.TurnsRemaining, routeInfo.AddedFromCheck); end function AddRouteInstance(originPlayer: table, originCity:table, destinationPlayer:table, destinationCity:table, traderUnitID:number, TurnsRemaining:number, AddedFromCheck:boolean) m_DisplayedTradeRoutes = m_DisplayedTradeRoutes + 1; -- print("Adding route: " .. Locale.Lookup(originCity:GetName()) .. " to " .. Locale.Lookup(destinationCity:GetName())); local routeInstance :table = m_RouteInstanceIM:GetInstance(); local backColor, frontColor = UI.GetPlayerColors(destinationPlayer:GetID()); local darkerBackColor :number = DarkenLightenColor(backColor, (-85), 238); local brighterBackColor :number = DarkenLightenColor(backColor, 90, 250); -- Update colors if tintTradeRouteEntry then tintBackColor = DarkenLightenColor(backColor, tintColorOffset, tintColorOpacity); tintFrontColor = DarkenLightenColor(frontColor, tintLabelColorOffset, tintLabelColorOpacity); routeInstance.GridButton:SetColor(tintBackColor); routeInstance.RouteLabel:SetColor(tintFrontColor); routeInstance.RouteLabel2:SetColor(tintFrontColor); routeInstance.TurnsToComplete:SetColor(frontColor); routeInstance.BannerBase:SetColor(DarkenLightenColor(backColor, -10, 200)); routeInstance.BannerDarker:SetColor(darkerBackColor); routeInstance.BannerLighter:SetColor(brighterBackColor); if hideHeaderOpaqueBackdrop then routeInstance.BannerBase:SetHide(true); routeInstance.BannerDarker:SetHide(true); routeInstance.BannerLighter:SetHide(true); routeInstance.DividerLine:SetHide(false); else routeInstance.RouteLabel:SetColor(frontColor); routeInstance.RouteLabel2:SetColor(frontColor); routeInstance.BannerBase:SetHide(false); routeInstance.BannerDarker:SetHide(false); routeInstance.BannerLighter:SetHide(false); routeInstance.RouteLabel2:SetHide(true); routeInstance.DividerLine:SetHide(true); end else routeInstance.BannerBase:SetHide(true); routeInstance.BannerDarker:SetHide(true); routeInstance.BannerLighter:SetHide(true); routeInstance.RouteLabel2:SetHide(false); end -- Update Route Label routeInstance.RouteLabel:SetText(Locale.ToUpper(originCity:GetName()) .. " " .. Locale.ToUpper("LOC_TRADE_OVERVIEW_TO") .. " " .. Locale.ToUpper(destinationCity:GetName())); routeInstance.RouteLabel2:SetText(Locale.ToUpper(originCity:GetName()) .. " " .. Locale.ToUpper("LOC_TRADE_OVERVIEW_TO") .. " " .. Locale.ToUpper(destinationCity:GetName())); -- Update yield directional arrows local originBackColor, originFrontColor = UI.GetPlayerColors(originPlayer:GetID()); local destinationBackColor, destinationFrontColor = UI.GetPlayerColors(destinationPlayer:GetID()); routeInstance.OriginCivArrow:SetColor(DarkenLightenColor(originFrontColor, 30, 255)); routeInstance.DestinationCivArrow:SetColor(DarkenLightenColor(destinationFrontColor, 30, 255)); -- Update Route Yields routeInstance.OriginResourceStack:DestroyAllChildren(); routeInstance.DestinationResourceStack:DestroyAllChildren(); if showNoBenefitsString then routeInstance.OriginResourceStack:SetHide(true); routeInstance.DestinationResourceStack:SetHide(true); routeInstance.OriginNoBenefitsLabel:SetHide(false); routeInstance.OriginNoBenefitsLabel:SetString(Locale.Lookup(originCity:GetName()) .. " gains no benefits from this route.") routeInstance.DestinationNoBenefitsLabel:SetHide(false); routeInstance.DestinationNoBenefitsLabel:SetString(Locale.Lookup(destinationCity:GetName()) .. " gains no benefits from this route.") else routeInstance.OriginNoBenefitsLabel:SetHide(true); routeInstance.DestinationNoBenefitsLabel:SetHide(true); end for yieldInfo in GameInfo.Yields() do local originCityYieldValue = GetYieldFromCity(yieldInfo.Index, originCity, destinationCity); local destinationCityYieldValue = GetYieldForDestinationCity(yieldInfo.Index, originCity, destinationCity); local originResourceInstance :table = {}; local destinationResourceInstance :table = {}; if alignTradeYields then ContextPtr:BuildInstanceForControl("ResourceInstance", originResourceInstance, routeInstance.OriginResourceStack); ContextPtr:BuildInstanceForControl("ResourceInstance", destinationResourceInstance, routeInstance.DestinationResourceStack); end if (originCityYieldValue ~= 0) then routeInstance.OriginResourceStack:SetHide(false); if not alignTradeYields then ContextPtr:BuildInstanceForControl("ResourceInstance", originResourceInstance, routeInstance.OriginResourceStack); end originResourceInstance.ResourceIconLabel:SetText(yieldInfo.IconString); originResourceInstance.ResourceValueLabel:SetText("+" .. originCityYieldValue); -- Set tooltip to resource name originResourceInstance.Top:LocalizeAndSetToolTip(yieldInfo.Name); -- Update Label Color if (yieldInfo.YieldType == "YIELD_FOOD") then originResourceInstance.ResourceValueLabel:SetColorByName("ResFoodLabelCS"); elseif (yieldInfo.YieldType == "YIELD_PRODUCTION") then originResourceInstance.ResourceValueLabel:SetColorByName("ResProductionLabelCS"); elseif (yieldInfo.YieldType == "YIELD_GOLD") then originResourceInstance.ResourceValueLabel:SetColorByName("ResGoldLabelCS"); elseif (yieldInfo.YieldType == "YIELD_SCIENCE") then originResourceInstance.ResourceValueLabel:SetColorByName("ResScienceLabelCS"); elseif (yieldInfo.YieldType == "YIELD_CULTURE") then originResourceInstance.ResourceValueLabel:SetColorByName("ResCultureLabelCS"); elseif (yieldInfo.YieldType == "YIELD_FAITH") then originResourceInstance.ResourceValueLabel:SetColorByName("ResFaithLabelCS"); end routeInstance.OriginNoBenefitsLabel:SetHide(true); elseif alignTradeYields then originResourceInstance.ResourceIconLabel:SetHide(true); originResourceInstance.ResourceValueLabel:SetHide(true); end if (destinationCityYieldValue ~= 0) then routeInstance.DestinationResourceStack:SetHide(false); if not alignTradeYields then ContextPtr:BuildInstanceForControl("ResourceInstance", destinationResourceInstance, routeInstance.DestinationResourceStack); end destinationResourceInstance.ResourceIconLabel:SetText(yieldInfo.IconString); destinationResourceInstance.ResourceValueLabel:SetText("+" .. destinationCityYieldValue); -- Set tooltip to resouce name destinationResourceInstance.Top:LocalizeAndSetToolTip(yieldInfo.Name); -- Update Label Color if (yieldInfo.YieldType == "YIELD_FOOD") then destinationResourceInstance.ResourceValueLabel:SetColorByName("ResFoodLabelCS"); elseif (yieldInfo.YieldType == "YIELD_PRODUCTION") then destinationResourceInstance.ResourceValueLabel:SetColorByName("ResProductionLabelCS"); elseif (yieldInfo.YieldType == "YIELD_GOLD") then destinationResourceInstance.ResourceValueLabel:SetColorByName("ResGoldLabelCS"); elseif (yieldInfo.YieldType == "YIELD_SCIENCE") then destinationResourceInstance.ResourceValueLabel:SetColorByName("ResScienceLabelCS"); elseif (yieldInfo.YieldType == "YIELD_CULTURE") then destinationResourceInstance.ResourceValueLabel:SetColorByName("ResCultureLabelCS"); elseif (yieldInfo.YieldType == "YIELD_FAITH") then destinationResourceInstance.ResourceValueLabel:SetColorByName("ResFaithLabelCS"); end routeInstance.DestinationNoBenefitsLabel:SetHide(true); elseif alignTradeYields then destinationResourceInstance.ResourceIconLabel:SetHide(true); destinationResourceInstance.ResourceValueLabel:SetHide(true); end end routeInstance.OriginResourceStack:CalculateSize(); routeInstance.DestinationResourceStack:CalculateSize(); -- Update City State Quest Icon routeInstance.CityStateQuestIcon:SetHide(true); local questTooltip :string = Locale.Lookup("LOC_CITY_STATES_QUESTS"); local tradeRouteQuestInfo :table = GameInfo.Quests["QUEST_SEND_TRADE_ROUTE"]; local questsManager :table = Game.GetQuestsManager(); if IsCityStateWithTradeQuest(destinationPlayer) then questTooltip = questTooltip .. "[NEWLINE]" .. tradeRouteQuestInfo.IconString .. questsManager:GetActiveQuestName(Game.GetLocalPlayer(), destinationCity:GetOwner(), tradeRouteQuestInfo.Index); routeInstance.CityStateQuestIcon:SetHide(false); routeInstance.CityStateQuestIcon:SetToolTipString(questTooltip); end -- Update Diplomatic Visibility routeInstance.VisibilityBonusGrid:SetHide(false); routeInstance.TourismBonusGrid:SetHide(false); -- Do we display the tourism or visibilty bonus? Hide them if we are showing them somewhere else, or it is a city state, or it is domestic route if IsCityState(originPlayer) or IsCityState(destinationPlayer) or originPlayer:GetID() == destinationPlayer:GetID() or m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.DESTINATION or m_currentTab ~= TRADE_TABS.AVAILABLE_ROUTES then routeInstance.VisibilityBonusGrid:SetHide(true); routeInstance.TourismBonusGrid:SetHide(true); -- Also hide the trading post if grouping by destination (will be shown in the header) if m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.DESTINATION then routeInstance.TradingPostIndicator:SetHide(true); elseif not hideTradingPostIcon then routeInstance.TradingPostIndicator:SetHide(false); end else -- Determine are diplomatic visibility status local visibilityIndex :number = Players[Game.GetLocalPlayer()]:GetDiplomacy():GetVisibilityOn(destinationPlayer); -- Determine this player has a trade route with the local player local hasTradeRoute :boolean = false; local playerCities :table = destinationPlayer:GetCities(); for i, city in playerCities:Members() do if city:GetTrade():HasActiveTradingPost(Game.GetLocalPlayer()) then hasTradeRoute = true; end end -- Display trade route tourism modifier local baseTourismModifier = GlobalParameters.TOURISM_TRADE_ROUTE_BONUS; local extraTourismModifier = Players[Game.GetLocalPlayer()]:GetCulture():GetExtraTradeRouteTourismModifier(); -- TODO: Use LOC_TRADE_OVERVIEW_TOURISM_BONUS when we can update the text routeInstance.TourismBonusPercentage:SetText("+" .. Locale.ToPercent((baseTourismModifier + extraTourismModifier) / 100)); if hasTradeRoute then routeInstance.TourismBonusPercentage:SetColorByName("TradeOverviewTextCS"); routeInstance.TourismBonusIcon:SetTexture(0, 0, "Tourism_VisitingSmall"); routeInstance.TourismBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_TOURISM_BONUS"); routeInstance.VisibilityBonusIcon:SetTexture("Diplomacy_VisibilityIcons"); routeInstance.VisibilityBonusIcon:SetVisState(math.min(math.max(visibilityIndex - 1, 0), 3)); routeInstance.VisibilityBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_DIPLOMATIC_VIS_BONUS"); else routeInstance.TourismBonusPercentage:SetColorByName("TradeOverviewTextDisabledCS"); routeInstance.TourismBonusIcon:SetTexture(0, 0, "Tourism_VisitingSmallGrey"); routeInstance.TourismBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_TOURISM_BONUS"); routeInstance.VisibilityBonusIcon:SetTexture("Diplomacy_VisibilityIconsGrey"); routeInstance.VisibilityBonusIcon:SetVisState(math.min(math.max(visibilityIndex, 0), 3)); routeInstance.VisibilityBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_DIPLOMATIC_VIS_BONUS"); end end -- Update Trading Post Icon if m_groupBySelected == GROUP_BY_SETTINGS.NONE or m_groupBySelected == GROUP_BY_SETTINGS.ORIGIN then routeInstance.TradingPostIndicator:SetHide(false); else routeInstance.TradingPostIndicator:SetHide(true); end if destinationCity:GetTrade():HasActiveTradingPost(originPlayer) then routeInstance.TradingPostIndicator:SetAlpha(1.0); routeInstance.TradingPostIndicator:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_TRADE_POST_ESTABLISHED"); else routeInstance.TradingPostIndicator:SetAlpha(0.2); routeInstance.TradingPostIndicator:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_TRADE_POST"); end -- Update turns to complete route local tooltipString :string; local tradePathLength, tripsToDestination, turnsToCompleteRoute = GetRouteInfo(originCity, destinationCity); if TurnsRemaining then if AddedFromCheck then routeInstance.TurnsToComplete:SetText("< " .. TurnsRemaining); tooltipString = (Locale.Lookup("LOC_TRADE_TURNS_REMAINING_ALT2_HELP_TOOLTIP", TurnsRemaining) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TOOLTIP_BREAKER") .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_ROUTE_LENGTH_TOOLTIP", tradePathLength) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TRIPS_COUNT_TOOLTIP", tripsToDestination)); else routeInstance.TurnsToComplete:SetText(TurnsRemaining); tooltipString = (Locale.Lookup("LOC_TRADE_TURNS_REMAINING_ALT_HELP_TOOLTIP", TurnsRemaining) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TOOLTIP_BREAKER") .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_ROUTE_LENGTH_TOOLTIP", tradePathLength) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TRIPS_COUNT_TOOLTIP", tripsToDestination) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TURN_COMPLETION_TOOLTIP", (Game.GetCurrentGameTurn() + TurnsRemaining))); end elseif m_currentTab == TRADE_TABS.ROUTES_TO_CITIES then routeInstance.TurnsToComplete:SetText(turnsToCompleteRoute); tooltipString = (Locale.Lookup("LOC_TRADE_TURNS_REMAINING_HELP_TOOLTIP") .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TOOLTIP_BREAKER") .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_ROUTE_LENGTH_TOOLTIP", tradePathLength) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TRIPS_COUNT_TOOLTIP", tripsToDestination)); else routeInstance.TurnsToComplete:SetText(turnsToCompleteRoute); tooltipString = (Locale.Lookup("LOC_TRADE_TURNS_REMAINING_HELP_TOOLTIP") .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TOOLTIP_BREAKER") .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_ROUTE_LENGTH_TOOLTIP", tradePathLength) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TRIPS_COUNT_TOOLTIP", tripsToDestination) .. "[NEWLINE]" .. Locale.Lookup("LOC_TRADE_TURNS_REMAINING_TURN_COMPLETION_ALT_TOOLTIP", (Game.GetCurrentGameTurn() + turnsToCompleteRoute))); end routeInstance.TurnsToComplete:SetToolTipString(tooltipString); -- Update Origin Civ Icon local originPlayerConfig :table = PlayerConfigurations[originPlayer:GetID()]; local originPlayerIconString :string = "ICON_" .. originPlayerConfig:GetCivilizationTypeName(); local textureOffsetX, textureOffsetY, textureSheet = IconManager:FindIconAtlas(originPlayerIconString, 30); local secondaryColor, primaryColor = UI.GetPlayerColors(originPlayer:GetID()); routeInstance.OriginCivIcon:SetTexture(textureOffsetX, textureOffsetY, textureSheet); routeInstance.OriginCivIcon:LocalizeAndSetToolTip(originPlayerConfig:GetCivilizationDescription()); routeInstance.OriginCivIcon:SetColor(primaryColor); routeInstance.OriginCivIconBacking:SetColor(secondaryColor); local destinationPlayerConfig :table = PlayerConfigurations[destinationPlayer:GetID()]; local destinationPlayerInfluence :table = Players[destinationPlayer:GetID()]:GetInfluence(); if not destinationPlayerInfluence:CanReceiveInfluence() then -- Destination Icon for Civilizations if destinationPlayerConfig ~= nil then local iconString :string = "ICON_" .. destinationPlayerConfig:GetCivilizationTypeName(); local textureOffsetX, textureOffsetY, textureSheet = IconManager:FindIconAtlas(iconString, 30); routeInstance.DestinationCivIcon:SetTexture(textureOffsetX, textureOffsetY, textureSheet); routeInstance.DestinationCivIcon:LocalizeAndSetToolTip(destinationPlayerConfig:GetCivilizationDescription()); end local secondaryColor, primaryColor = UI.GetPlayerColors(destinationPlayer:GetID()); routeInstance.DestinationCivIcon:SetColor(primaryColor); routeInstance.DestinationCivIconBacking:SetColor(secondaryColor); else -- Destination Icon for City States if destinationPlayerConfig ~= nil then local secondaryColor, primaryColor = UI.GetPlayerColors(destinationPlayer:GetID()); local leader :string = destinationPlayerConfig:GetLeaderTypeName(); local leaderInfo :table = GameInfo.Leaders[leader]; local iconString :string; if (leader == "LEADER_MINOR_CIV_SCIENTIFIC" or leaderInfo.InheritFrom == "LEADER_MINOR_CIV_SCIENTIFIC") then iconString = "ICON_CITYSTATE_SCIENCE"; elseif (leader == "LEADER_MINOR_CIV_RELIGIOUS" or leaderInfo.InheritFrom == "LEADER_MINOR_CIV_RELIGIOUS") then iconString = "ICON_CITYSTATE_FAITH"; elseif (leader == "LEADER_MINOR_CIV_TRADE" or leaderInfo.InheritFrom == "LEADER_MINOR_CIV_TRADE") then iconString = "ICON_CITYSTATE_TRADE"; elseif (leader == "LEADER_MINOR_CIV_CULTURAL" or leaderInfo.InheritFrom == "LEADER_MINOR_CIV_CULTURAL") then iconString = "ICON_CITYSTATE_CULTURE"; elseif (leader == "LEADER_MINOR_CIV_MILITARISTIC" or leaderInfo.InheritFrom == "LEADER_MINOR_CIV_MILITARISTIC") then iconString = "ICON_CITYSTATE_MILITARISTIC"; elseif (leader == "LEADER_MINOR_CIV_INDUSTRIAL" or leaderInfo.InheritFrom == "LEADER_MINOR_CIV_INDUSTRIAL") then iconString = "ICON_CITYSTATE_INDUSTRIAL"; end if iconString ~= nil then local textureOffsetX, textureOffsetY, textureSheet = IconManager:FindIconAtlas(iconString, 30); routeInstance.DestinationCivIcon:SetTexture(textureOffsetX, textureOffsetY, textureSheet); routeInstance.DestinationCivIcon:SetColor(primaryColor); routeInstance.DestinationCivIconBacking:SetColor(secondaryColor); routeInstance.DestinationCivIcon:LocalizeAndSetToolTip(destinationCity:GetName()); end end end -- Should we display the cancel automation? if (m_currentTab == TRADE_TABS.MY_ROUTES) and (traderUnitID ~= nil and m_TraderAutomated[traderUnitID]) then -- Unhide the cancel automation routeInstance.CancelAutomation:SetHide(false); -- Add button callback routeInstance.CancelAutomation:RegisterCallback(Mouse.eLClick, function() LuaEvents.TraderOverview_SetTraderAutomated(traderUnitID, false); m_TraderAutomated[traderUnitID] = false; Refresh(); end); else -- Hide the cancel automation button routeInstance.CancelAutomation:SetHide(true); end -- Add buttton hookups if m_currentTab == TRADE_TABS.AVAILABLE_ROUTES then -- Find trader unit / units and set button callback to select that unit local tradeUnits = {}; local pPlayerUnits :table = Players[Game.GetLocalPlayer()]:GetUnits(); for i, pUnit in pPlayerUnits:Members() do -- Ignore trade units that have a pending operation if not pUnit:HasPendingOperations() then -- Find Each Trade Unit local unitInfo :table = GameInfo.Units[pUnit:GetUnitType()]; if unitInfo.MakeTradeRoute == true then local tradeUnitEntry :table = { OwnerID = pUnit:GetOwner(); UnitID = pUnit:GetID(); }; table.insert(tradeUnits, tradeUnitEntry); -- Find if the current location of the trade unit matches the origin city if pUnit:GetX() == originCity:GetX() and pUnit:GetY() == originCity:GetY() then -- If selecting an available route, select unit and select route in route chooser routeInstance.GridButton:RegisterCallback(Mouse.eLClick, function() SelectUnit(pUnit); LuaEvents.TradeOverview_SelectRouteFromOverview(destinationPlayer:GetID(), destinationCity:GetID()); end); return; end end end end -- Cycle through trade units on mouse click, if no local trade unit was found routeInstance.GridButton:RegisterCallback(Mouse.eLClick, function() CycleTradeUnit(tradeUnits, m_DisplayedTradeRoutes, originCity); end); else if traderUnitID then local tradeUnit :table = originPlayer:GetUnits():FindID(traderUnitID); routeInstance.GridButton:RegisterCallback(Mouse.eLClick, function() SelectUnit(tradeUnit); end); end end end -- --------------------------------------------------------------------------- -- Route button hookups -- --------------------------------------------------------------------------- function CycleTradeUnit(tradeUnits: table, tradeRouteID:number, newOriginCity:table) -- Did we just start a new cycle? if m_CurrentCyclingUnitsTradeRoute ~= tradeRouteID then m_TradeUnitIndex = 1; m_CurrentCyclingUnitsTradeRoute = tradeRouteID; end print("Cycling units. Select unit with index: " .. m_TradeUnitIndex .. " and length: " .. tableLength(tradeUnits)) local pPlayer = Players[tradeUnits[m_TradeUnitIndex].OwnerID]; local pUnit = pPlayer:GetUnits():FindID(tradeUnits[m_TradeUnitIndex].UnitID); -- Open the change origin city window, and select the new city -- FIXME: Bug, sometimes, the choose a route opens, and you need to click again. -- The issue lies in when the trade unit gets selected, it auto opens the choose a route screen. SelectUnit(pUnit); LuaEvents.TradeOverview_ChangeOriginCityFromOverview(newOriginCity); m_TradeUnitIndex = m_TradeUnitIndex + 1; if m_TradeUnitIndex > tableLength(tradeUnits) then m_TradeUnitIndex = 1; end end -- =========================================================================== -- Header Instance Creators -- =========================================================================== function CreatePlayerHeader(player: table) local headerInstance :table = m_HeaderInstanceIM:GetInstance(); local pPlayerConfig :table = PlayerConfigurations[player:GetID()]; headerInstance.HeaderLabel:SetText(Locale.ToUpper(pPlayerConfig:GetPlayerName())); -- If the current tab is not available routes, hide the collapse button, and trading post if m_currentTab ~= TRADE_TABS.AVAILABLE_ROUTES then headerInstance.RoutesExpand:SetHide(true); headerInstance.RouteCountLabel:SetHide(true); headerInstance.TradingPostIndicator:SetHide(true); end if colorCityPlayerHeader then headerInstance.CityBannerFill:SetHide(false); local backColor, frontColor = UI.GetPlayerColors(player:GetID()); headerBackColor = DarkenLightenColor(backColor, backdropColorOffset, backdropColorOpacity); headerFrontColor = DarkenLightenColor(frontColor, labelColorOffset, labelColorOpacity); gridBackColor = DarkenLightenColor(backColor, backdropGridColorOffset, backdropGridColorOpacity); headerInstance.CityBannerFill:SetColor(headerBackColor); headerInstance.HeaderLabel:SetColor(headerFrontColor); headerInstance.HeaderGrid:SetColor(gridBackColor); else -- Hide the colored UI elements headerInstance.CityBannerFill:SetHide(true); end -- If not local player or a city state if (player:GetID() ~= Game.GetLocalPlayer() and (not IsCityState(player))) then -- Determine are diplomatic visibility status headerInstance.TourismBonusGrid:SetHide(false); headerInstance.VisibilityBonusGrid:SetHide(false) local visibilityIndex :number = Players[Game.GetLocalPlayer()]:GetDiplomacy():GetVisibilityOn(player); -- Determine this player has a trade route with the local player local hasTradeRoute :boolean = false; local playerCities :table = player:GetCities(); for i, city in playerCities:Members() do if city:GetTrade():HasActiveTradingPost(Game.GetLocalPlayer()) then hasTradeRoute = true; end end -- Display trade route tourism modifier local baseTourismModifier = GlobalParameters.TOURISM_TRADE_ROUTE_BONUS; local extraTourismModifier = Players[Game.GetLocalPlayer()]:GetCulture():GetExtraTradeRouteTourismModifier(); -- TODO: Use LOC_TRADE_OVERVIEW_TOURISM_BONUS when we can update the text headerInstance.TourismBonusPercentage:SetText("+" .. Locale.ToPercent((baseTourismModifier + extraTourismModifier) / 100)); if hasTradeRoute then headerInstance.TourismBonusPercentage:SetColorByName("TradeOverviewTextCS"); headerInstance.TourismBonusIcon:SetTexture(0, 0, "Tourism_VisitingSmall"); headerInstance.TourismBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_TOURISM_BONUS"); headerInstance.VisibilityBonusIcon:SetTexture("Diplomacy_VisibilityIcons"); headerInstance.VisibilityBonusIcon:SetVisState(math.min(math.max(visibilityIndex - 1, 0), 3)); headerInstance.VisibilityBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_DIPLOMATIC_VIS_BONUS"); else headerInstance.TourismBonusPercentage:SetColorByName("TradeOverviewTextDisabledCS"); headerInstance.TourismBonusIcon:SetTexture(0, 0, "Tourism_VisitingSmallGrey"); headerInstance.TourismBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_TOURISM_BONUS"); headerInstance.VisibilityBonusIcon:SetTexture("Diplomacy_VisibilityIconsGrey"); headerInstance.VisibilityBonusIcon:SetVisState(math.min(math.max(visibilityIndex, 0), 3)); headerInstance.VisibilityBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_DIPLOMATIC_VIS_BONUS"); end else -- print("Not displaying vis bonuses") headerInstance.TourismBonusGrid:SetHide(true); headerInstance.VisibilityBonusGrid:SetHide(true); end end function CreateCityStateHeader() local headerInstance :table = m_HeaderInstanceIM:GetInstance(); -- If the current tab is not available routes, hide the collapse button, and trading post if m_currentTab ~= TRADE_TABS.AVAILABLE_ROUTES then headerInstance.RoutesExpand:SetHide(true); headerInstance.RouteCountLabel:SetHide(true); headerInstance.TradingPostIndicator:SetHide(true); end -- Reset Color for city states headerInstance.HeaderGrid:SetColor(0xFF666666); headerInstance.CityBannerFill:SetHide(true); headerInstance.HeaderLabel:SetColorByName("Beige"); headerInstance.HeaderLabel:SetText(Locale.ToUpper("LOC_TRADE_OVERVIEW_CITY_STATES")); headerInstance.VisibilityBonusGrid:SetHide(true); headerInstance.TourismBonusGrid:SetHide(true); end function CreateUnusedRoutesHeader() local headerInstance :table = m_HeaderInstanceIM:GetInstance(); headerInstance.HeaderLabel:SetText(Locale.ToUpper("LOC_TRADE_OVERVIEW_UNUSED_ROUTES")); -- Reset Color for city states headerInstance.HeaderGrid:SetColor(0xFF666666); headerInstance.CityBannerFill:SetHide(true); headerInstance.HeaderLabel:SetColorByName("Beige"); headerInstance.RoutesExpand:SetHide(true); headerInstance.RouteCountLabel:SetHide(true); headerInstance.TradingPostIndicator:SetHide(true); headerInstance.VisibilityBonusGrid:SetHide(true); headerInstance.TourismBonusGrid:SetHide(true); end function CreateCityHeader(city: table, currentRouteShowCount:number, totalRoutes:number) local headerInstance :table = m_HeaderInstanceIM:GetInstance(); local playerID :number = city:GetOwner(); local pPlayer = Players[playerID]; headerInstance.HeaderLabel:SetText(Locale.ToUpper(city:GetName())); if m_currentTab == TRADE_TABS.AVAILABLE_ROUTES then headerInstance.RoutesExpand:SetHide(false); headerInstance.RouteCountLabel:SetHide(false); headerInstance.TradingPostIndicator:SetHide(false); end headerInstance.RouteCountLabel:SetText(currentRouteShowCount .. " / " .. totalRoutes); -- If grouping by destination, show and refresh bonuses if m_groupByList[m_groupBySelected].groupByID == GROUP_BY_SETTINGS.DESTINATION then -- Update Trading Post Icon headerInstance.TradingPostIndicator:SetHide(false); if city:GetTrade():HasActiveTradingPost(Players[Game.GetLocalPlayer()]) then headerInstance.TradingPostIndicator:SetAlpha(1.0); headerInstance.TradingPostIndicator:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_TRADE_POST_ESTABLISHED"); else headerInstance.TradingPostIndicator:SetAlpha(0.2); headerInstance.TradingPostIndicator:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_TRADE_POST"); end -- Update Diplomatic Visibility headerInstance.VisibilityBonusGrid:SetHide(false); headerInstance.TourismBonusGrid:SetHide(false); -- Do we display the tourism or visibilty bonus? Hide them if it is a city state, or it is domestic route if IsCityState(pPlayer) or pPlayer:GetID() == Game.GetLocalPlayer() then headerInstance.VisibilityBonusGrid:SetHide(true); headerInstance.TourismBonusGrid:SetHide(true); else -- Determine are diplomatic visibility status local visibilityIndex :number = Players[Game.GetLocalPlayer()]:GetDiplomacy():GetVisibilityOn(pPlayer); -- Determine this player has a trade route with the local player local hasTradeRoute :boolean = false; local playerCities :table = pPlayer:GetCities(); for i, pCity in playerCities:Members() do if pCity:GetTrade():HasActiveTradingPost(Game.GetLocalPlayer()) then hasTradeRoute = true; end end -- Display trade route tourism modifier local baseTourismModifier = GlobalParameters.TOURISM_TRADE_ROUTE_BONUS; local extraTourismModifier = Players[Game.GetLocalPlayer()]:GetCulture():GetExtraTradeRouteTourismModifier(); -- TODO: Use LOC_TRADE_OVERVIEW_TOURISM_BONUS when we can update the text headerInstance.TourismBonusPercentage:SetText("+" .. Locale.ToPercent((baseTourismModifier + extraTourismModifier) / 100)); if hasTradeRoute then headerInstance.TourismBonusPercentage:SetColorByName("TradeOverviewTextCS"); headerInstance.TourismBonusIcon:SetTexture(0, 0, "Tourism_VisitingSmall"); headerInstance.TourismBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_TOURISM_BONUS"); headerInstance.VisibilityBonusIcon:SetTexture("Diplomacy_VisibilityIcons"); headerInstance.VisibilityBonusIcon:SetVisState(math.min(math.max(visibilityIndex - 1, 0), 3)); headerInstance.VisibilityBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_DIPLOMATIC_VIS_BONUS"); else headerInstance.TourismBonusPercentage:SetColorByName("TradeOverviewTextDisabledCS"); headerInstance.TourismBonusIcon:SetTexture(0, 0, "Tourism_VisitingSmallGrey"); headerInstance.TourismBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_TOURISM_BONUS"); headerInstance.VisibilityBonusIcon:SetTexture("Diplomacy_VisibilityIconsGrey"); headerInstance.VisibilityBonusIcon:SetVisState(math.min(math.max(visibilityIndex, 0), 3)); headerInstance.VisibilityBonusGrid:LocalizeAndSetToolTip("LOC_TRADE_OVERVIEW_TOOLTIP_NO_DIPLOMATIC_VIS_BONUS"); end end else headerInstance.TourismBonusGrid:SetHide(true); headerInstance.VisibilityBonusGrid:SetHide(true); headerInstance.TradingPostIndicator:SetHide(true); end local cityEntry :table = { OwnerID = playerID, CityID = city:GetID() }; local cityExclusionIndex = findIndex(m_cityRouteLimitExclusionList, cityEntry, CompareCityEntries); if cityExclusionIndex == -1 then headerInstance.RoutesExpand:SetCheck(false); headerInstance.RoutesExpand:SetCheckTextureOffsetVal(0, 0); else headerInstance.RoutesExpand:SetCheck(true); headerInstance.RoutesExpand:SetCheckTextureOffsetVal(0, 22); end headerInstance.RoutesExpand:RegisterCallback(Mouse.eLClick, function() OnExpandRoutes(headerInstance.RoutesExpand, city:GetOwner(), city:GetID()); end); headerInstance.RoutesExpand:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); if colorCityPlayerHeader then headerInstance.CityBannerFill:SetHide(false); local backColor, frontColor = UI.GetPlayerColors(playerID); -- local darkerBackColor = DarkenLightenColor(backColor,(-85),238); -- local brighterBackColor = DarkenLightenColor(backColor,90,255); headerBackColor = DarkenLightenColor(backColor, backdropColorOffset, backdropColorOpacity); headerFrontColor = DarkenLightenColor(frontColor, labelColorOffset, labelColorOpacity); gridBackColor = DarkenLightenColor(backColor, backdropGridColorOffset, backdropGridColorOpacity); headerInstance.CityBannerFill:SetColor(gridBackColor); -- headerInstance.CityBannerFill2:SetColor( darkerBackColor ); -- headerInstance.CityBannerFill3:SetColor( brighterBackColor ); headerInstance.HeaderLabel:SetColor(headerFrontColor); --headerInstance.RouteCountLabel:SetColor(frontColor); headerInstance.CityBannerFill:SetColor(headerBackColor); headerInstance.HeaderGrid:SetColor(gridBackColor); else -- Hide the colored UI elements headerInstance.CityBannerFill:SetHide(true); end end function OnExpandRoutes(checkbox, cityOwnerID: number, cityID:number) -- If expand button clicked with the expand all selected, unselect it if m_GroupShowAll then m_GroupShowAll = false; Controls.GroupShowAllCheckBox:SetCheck(false); Controls.GroupShowAllCheckBoxLabel:SetText(Locale.Lookup("LOC_TRADE_EXPAND_ALL_BUTTON_TEXT")); end -- For some reason the Uncheck texture does not apply, so I had to hard code the offset in. -- TODO: Find a fix for this if (checkbox:IsChecked()) then Controls.GroupShowAllCheckBox:SetCheck(true); Controls.GroupShowAllCheckBoxLabel:SetText(Locale.Lookup("LOC_TRADE_COLLAPSE_ALL_BUTTON_TEXT")); checkbox:SetCheckTextureOffsetVal(0, 22); local cityEntry = { OwnerID = cityOwnerID, CityID = cityID }; -- Only add entry if it isn't already in the list if findIndex(m_cityRouteLimitExclusionList, cityEntry, CompareCityEntries) == -1 then print("Adding " .. GetCityEntryString(cityEntry) .. " to the exclusion list"); table.insert(m_cityRouteLimitExclusionList, cityEntry); else print("City already exists in exclusion list"); end else checkbox:SetCheckTextureOffsetVal(0, 0); local cityEntry = { OwnerID = cityOwnerID, CityID = cityID }; local cityIndex = findIndex(m_cityRouteLimitExclusionList, cityEntry, CompareCityEntries) if findIndex(m_cityRouteLimitExclusionList, cityEntry, CompareCityEntries) > 0 then print("Removing " .. GetCityEntryString(cityEntry) .. " to the exclusion list"); table.remove(m_cityRouteLimitExclusionList, cityIndex); -- If the exclusion list is empty, update the collapse all button if tableLength(m_cityRouteLimitExclusionList) <= 0 then Controls.GroupShowAllCheckBox:SetCheck(false); Controls.GroupShowAllCheckBoxLabel:SetText(Locale.Lookup("LOC_TRADE_EXPAND_ALL_BUTTON_TEXT")); end else print("City does not exist in exclusion list"); end end Refresh(); end function CompareCityEntries(cityEntry1: table, cityEntry2:table) if (cityEntry1.OwnerID == cityEntry2.OwnerID) then if (cityEntry1.CityID == cityEntry2.CityID) then return true; end end return false; end function GetCityEntryString(cityEntry: table) local pPlayer :table = Players[cityEntry.OwnerID]; local pCity :table = pPlayer:GetCities():FindID(cityEntry.CityID); return Locale.Lookup(pCity:GetName()); end -- =========================================================================== -- Trade Route Tracker -- =========================================================================== -- --------------------------------------------------------------------------- -- Current running routes tracker -- --------------------------------------------------------------------------- -- Adds the route turns remaining to the table, if it does not exist already function AddRouteWithTurnsRemaining(routeInfo: table, routesTable:table, addedFromConsistencyCheck:boolean) print("Adding route: " .. GetTradeRouteString(routeInfo)); local originPlayer :table = Players[routeInfo.OriginCityPlayer]; local originCity :table = originPlayer:GetCities():FindID(routeInfo.OriginCityID); local destinationPlayer :table = Players[routeInfo.DestinationCityPlayer]; local destinationCity :table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID); local tradePathLength, tripsToDestination, turnsToCompleteRoute = GetRouteInfo(originCity, destinationCity); local routeIndex = findIndex(routesTable, routeInfo, CheckRouteEquality); if routeIndex == -1 then -- Build entry local routeEntry :table = { OriginCityPlayer = routeInfo.OriginCityPlayer; OriginCityID = routeInfo.OriginCityID; DestinationCityPlayer = routeInfo.DestinationCityPlayer; DestinationCityID = routeInfo.DestinationCityID; TraderUnitID = routeInfo.TraderUnitID; TurnsRemaining = turnsToCompleteRoute; }; -- Optional flag if addedFromConsistencyCheck ~= nil then routeEntry.AddedFromCheck = addedFromConsistencyCheck; end -- Append entry table.insert(routesTable, routeEntry); SaveRunningRoutesInfo(); else print("Route already exists in table."); end end -- Returns the remaining turns, if it exists in the table. Else returns -1 function GetRouteTurnsRemaining(routeInfo: table) local routeIndex = findIndex(m_LocalPlayerRunningRoutes, routeInfo, CheckRouteEquality); if routeIndex > 0 then return m_LocalPlayerRunningRoutes[routeIndex].TurnsRemaining; end return -1; end -- Decrements routes present. Removes those that completed function UpdateRoutesWithTurnsRemaining(routesTable: table) -- Manually control the indices, so that you can iterate over the table while deleting items within it local i = 1; while i <= tableLength(routesTable) do routesTable[i].TurnsRemaining = routesTable[i].TurnsRemaining - 1; print("Updated route " .. GetTradeRouteString(routesTable[i]) .. " with turns remaining " .. routesTable[i].TurnsRemaining) if routesTable[i].TurnsRemaining <= 0 then print("Removing route: " .. GetTradeRouteString(routesTable[i])); LuaEvents.TradeOverview_SetLastRoute(routesTable[i]); table.remove(routesTable, i); else i = i + 1; end end m_LastTurnUpdatedMyRoutes = Game.GetCurrentGameTurn(); end -- Checks if routes running in game and the routesTable are consistent with each other function CheckConsistencyWithMyRunningRoutes(routesTable: table) -- Build currently running routes local routesCurrentlyRunning :table = {}; local localPlayerCities :table = Players[Game.GetLocalPlayer()]:GetCities(); for i, city in localPlayerCities:Members() do local outgoingRoutes = city:GetTrade():GetOutgoingRoutes(); for j, routeInfo in ipairs(outgoingRoutes) do table.insert(routesCurrentlyRunning, routeInfo); end end -- Add all routes in routesCurrentlyRunning table that are not in routesTable for i, route in ipairs(routesCurrentlyRunning) do local routeIndex = findIndex(routesTable, route, CheckRouteEquality); -- Is the route not present? if routeIndex == -1 then -- Add it to the list, and set the optional flag print(GetTradeRouteString(route) .. " was not present. Adding it to the table."); AddRouteWithTurnsRemaining(route, routesTable, true); end end -- Remove all routes in routesTable, that are not in routesCurrentlyRunning. -- Manually control the indices, so that you can iterate over the table while deleting items within it local i = 1; while i <= tableLength(routesTable) do local routeIndex = findIndex(routesCurrentlyRunning, routesTable[i], CheckRouteEquality); -- Is the route not present? if routeIndex == -1 then print("Route " .. GetTradeRouteString(routesTable[i]) .. " is no longer running. Removing it."); -- Send info trade overview screen LuaEvents.TradeOverview_SetLastRoute(routesTable[i]); table.remove(routesTable, i) else i = i + 1 end end SaveRunningRoutesInfo(); end function SaveRunningRoutesInfo() -- Dump active routes info print("Dumping routes in PlayerConfig database") local dataDump = DataDumper(m_LocalPlayerRunningRoutes, "localPlayerRunningRoutes", true); -- print(dataDump); PlayerConfigurations[Game.GetLocalPlayer()]:SetValue("BTS_LocalPlayerRunningRotues", dataDump); end function LoadRunningRoutesInfo() local localPlayerID = Game.GetLocalPlayer(); if (PlayerConfigurations[localPlayerID]:GetValue("BTS_LocalPlayerRunningRotues") ~= nil) then print("Retrieving previous routes PlayerConfig database") local dataDump = PlayerConfigurations[localPlayerID]:GetValue("BTS_LocalPlayerRunningRotues"); -- print(dataDump); loadstring(dataDump)(); m_LocalPlayerRunningRoutes = localPlayerRunningRoutes; else print("No running route data was found, on load.") end -- Check for consistency CheckConsistencyWithMyRunningRoutes(m_LocalPlayerRunningRoutes); end -- --------------------------------------------------------------------------- -- Trader Route history tracker -- --------------------------------------------------------------------------- function UpdateRouteHistoryForTrader(routeInfo: table, routesTable:table) if routeInfo.TraderUnitID ~= nil then print("Updating trader " .. routeInfo.TraderUnitID .. " with route history: " .. GetTradeRouteString(routeInfo)); routesTable[routeInfo.TraderUnitID] = routeInfo; else print("Could not find the trader unit") end end -- =========================================================================== -- Group By Pulldown functions -- =========================================================================== function RefreshGroupByPulldown() -- Clear current group by entries Controls.OverviewGroupByPulldown:ClearEntries(); m_groupByList = {}; -- Build entries AddGroupByEntry("无", GROUP_BY_SETTINGS.NONE); AddGroupByEntry("起始城市", GROUP_BY_SETTINGS.ORIGIN); AddGroupByEntry("目标城市", GROUP_BY_SETTINGS.DESTINATION); -- Calculate Internals Controls.OverviewGroupByPulldown:CalculateInternals(); Controls.OverviewGroupByButton:SetText(m_groupByList[m_groupBySelected].groupByString); UpdateGroupByArrow(); end function AddGroupByEntry(text: string, id:number) local entry :table = { groupByString = text, groupByID = id }; table.insert(m_groupByList, entry); AddPulldownEntry(text, id); end function AddPulldownEntry(pulldownText: string, index:number) local groupByPulldownEntry :table = {}; Controls.OverviewGroupByPulldown:BuildEntry("OverviewGroupByEntry", groupByPulldownEntry); groupByPulldownEntry.Button:SetText(pulldownText); groupByPulldownEntry.Button:SetVoids(i, index); end function UpdateGroupByArrow() if Controls.OverviewGroupByPulldown:IsOpen() then Controls.OverviewGroupByPulldownOpenedArrow:SetHide(true); Controls.OverviewGroupByPulldownClosedArrow:SetHide(false); else Controls.OverviewGroupByPulldownOpenedArrow:SetHide(false); Controls.OverviewGroupByPulldownClosedArrow:SetHide(true); end end -- =========================================================================== -- Filter, Filter Pulldown functions -- =========================================================================== function FilterTradeRoutes(tradeRoutes: table) -- print("Current filter: " .. m_filterList[m_filterSelected].FilterText); local filtertedRoutes :table = {}; for index, tradeRoute in ipairs(tradeRoutes) do local pPlayer = Players[tradeRoute.DestinationCityPlayer]; if m_filterList[m_filterSelected].FilterFunction and m_filterList[m_filterSelected].FilterFunction(pPlayer) then table.insert(filtertedRoutes, tradeRoute); end end return filtertedRoutes; end -- --------------------------------------------------------------------------- -- Filter pulldown functions -- --------------------------------------------------------------------------- function RefreshFilters() -- Clear current filters Controls.OverviewDestinationFilterPulldown:ClearEntries(); m_filterList = {}; m_filterCount = 0; -- Add "All" Filter AddFilter(Locale.Lookup("LOC_ROUTECHOOSER_FILTER_ALL"), function(a) return true; end); -- Add "International Routes" Filter AddFilter(Locale.Lookup("LOC_TRADE_FILTER_INTERNATIONAL_ROUTES_TEXT"), IsOtherCiv); -- Add "City States with Trade Quest" Filter AddFilter(Locale.Lookup("LOC_TRADE_FILTER_CS_WITH_QUEST_TOOLTIP"), IsCityStateWithTradeQuest); -- Add Local Player Filter local localPlayerConfig :table = PlayerConfigurations[Game.GetLocalPlayer()]; local localPlayerName = Locale.Lookup(GameInfo.Civilizations[localPlayerConfig:GetCivilizationTypeID()].Name); AddFilter(localPlayerName, function(a) return a:GetID() == Game.GetLocalPlayer(); end); -- Add Filters by Civ local players :table = Game.GetPlayers(); for index, pPlayer in ipairs(players) do if pPlayer and pPlayer:IsAlive() and pPlayer:IsMajor() then -- Has the local player met the civ? if pPlayer:GetDiplomacy():HasMet(Game.GetLocalPlayer()) then local playerConfig :table = PlayerConfigurations[pPlayer:GetID()]; local name = Locale.Lookup(GameInfo.Civilizations[playerConfig:GetCivilizationTypeID()].Name); AddFilter(name, function(a) return a:GetID() == pPlayer:GetID() end); end end end -- Add "City States" Filter AddFilter("城市状态", IsCityState); -- Add filters to pulldown for index, filter in ipairs(m_filterList) do AddFilterEntry(index); end -- Select first filter Controls.OverviewFilterButton:SetText(m_filterList[m_filterSelected].FilterText); -- Calculate Internals Controls.OverviewDestinationFilterPulldown:CalculateInternals(); UpdateFilterArrow(); end function AddFilter(filterName: string, filterFunction) -- Make sure we don't add duplicate filters for index, filter in ipairs(m_filterList) do if filter.FilterText == filterName then return; end end m_filterCount = m_filterCount + 1; m_filterList[m_filterCount] = { FilterText = filterName, FilterFunction = filterFunction }; end function AddFilterEntry(filterIndex: number) local filterEntry :table = {}; Controls.OverviewDestinationFilterPulldown:BuildEntry("OverviewFilterEntry", filterEntry); filterEntry.Button:SetText(m_filterList[filterIndex].FilterText); filterEntry.Button:SetVoids(i, filterIndex); end function UpdateFilterArrow() if Controls.OverviewDestinationFilterPulldown:IsOpen() then Controls.OverviewFilterPulldownOpenedArrow:SetHide(true); Controls.OverviewFilterPulldownClosedArrow:SetHide(false); else Controls.OverviewFilterPulldownOpenedArrow:SetHide(false); Controls.OverviewFilterPulldownClosedArrow:SetHide(true); end end -- =========================================================================== -- Trade Routes Sorter -- =========================================================================== function SortTradeRoutes(tradeRoutes: table) if tableLength(m_SortBySettings) > 0 then -- If we are grouping by none, apply sort for groups if m_groupBySelected == GROUP_BY_SETTINGS.NONE then table.sort(tradeRoutes, CompleteGroupCompareBy) else table.sort(tradeRoutes, CompleteCompareBy) end end end function SortGroupedRoutes(groupedRoutes: table) if tableLength(m_GroupSortBySettings) > 0 then table.sort(groupedRoutes, CompareGroupedRoutes) end end function InsertSortEntry(sortByID: number, sortOrder:number, sortSettings:table) local sortEntry = { SortByID = sortByID, SortOrder = sortOrder }; -- Only insert if it does not exist local sortEntryIndex = findIndex(sortSettings, sortEntry, CompareSortEntries); if sortEntryIndex == -1 then print("Inserting " .. sortEntry.SortByID); table.insert(sortSettings, sortEntry); else -- If it exists, just update the sort oder print("Index: " .. sortEntryIndex); sortSettings[sortEntryIndex].SortOrder = sortOrder; end end function RemoveSortEntry(sortByID: number, sortSettings:table) local sortEntry = { SortByID = sortByID, SortOrder = sortOrder }; -- Only delete if it exists local sortEntryIndex :number = findIndex(sortSettings, sortEntry, CompareSortEntries); if (sortEntryIndex > 0) then table.remove(sortSettings, sortEntryIndex); end end -- --------------------------------------------------------------------------- -- Compare functions -- --------------------------------------------------------------------------- -- Checks for the same ID, not the same order function CompareSortEntries(sortEntry1: table, sortEntry2:table) if sortEntry1.SortByID == sortEntry2.SortByID then return true; end return false; end -- Compares the top route of passed groups function CompareGroupedRoutes(groupedRoutes1: table, groupedRoutes2:table) return CompleteGroupCompareBy(groupedRoutes1[1], groupedRoutes2[1]); end -- Identitical to CompleteCompareBy but uses the group sort settings function CompleteGroupCompareBy(tradeRoute1: table, tradeRoute2:table) for index, sortEntry in ipairs(m_GroupSortBySettings) do local compareFunction = m_CompareFunctionByID[sortEntry.SortByID]; local compareResult :boolean = compareFunction(tradeRoute1, tradeRoute2); if compareResult then if (sortEntry.SortOrder == SORT_DESCENDING) then return false; else return true; end elseif not CheckEquality(tradeRoute1, tradeRoute2, compareFunction) then if (sortEntry.SortOrder == SORT_DESCENDING) then return true; else return false; end end end -- If it reaches here, we used all the settings, and all of them were equal. -- Do net yield compare. 'not' because order should be in descending return CompareByNetYield(tradeRoute1, tradeRoute2); end -- Uses the list of compare functions, to make one global compare function function CompleteCompareBy(tradeRoute1: table, tradeRoute2:table) for index, sortEntry in ipairs(m_SortBySettings) do local compareFunction = m_CompareFunctionByID[sortEntry.SortByID]; local compareResult :boolean = compareFunction(tradeRoute1, tradeRoute2); if compareResult then if (sortEntry.SortOrder == SORT_DESCENDING) then return false; else return true; end elseif not CheckEquality(tradeRoute1, tradeRoute2, compareFunction) then if (sortEntry.SortOrder == SORT_DESCENDING) then return true; else return false; end end end -- If it reaches here, we used all the settings, and all of them were equal. -- Do net yield compare. 'not' because order should be in descending return CompareByNetYield(tradeRoute1, tradeRoute2); end function CompareByFood(tradeRoute1: table, tradeRoute2:table) return CompareByYield(GameInfo.Yields["YIELD_FOOD"].Index, tradeRoute1, tradeRoute2); end function CompareByProduction(tradeRoute1: table, tradeRoute2:table) return CompareByYield(GameInfo.Yields["YIELD_PRODUCTION"].Index, tradeRoute1, tradeRoute2); end function CompareByGold(tradeRoute1: table, tradeRoute2:table) return CompareByYield(GameInfo.Yields["YIELD_GOLD"].Index, tradeRoute1, tradeRoute2); end function CompareByScience(tradeRoute1: table, tradeRoute2:table) return CompareByYield(GameInfo.Yields["YIELD_SCIENCE"].Index, tradeRoute1, tradeRoute2); end function CompareByCulture(tradeRoute1: table, tradeRoute2:table) return CompareByYield(GameInfo.Yields["YIELD_CULTURE"].Index, tradeRoute1, tradeRoute2); end function CompareByFaith(tradeRoute1: table, tradeRoute2:table) return CompareByYield(GameInfo.Yields["YIELD_FAITH"].Index, tradeRoute1, tradeRoute2); end function CompareByYield(yieldIndex: number, tradeRoute1:table, tradeRoute2:table) local originPlayer1 :table = Players[tradeRoute1.OriginCityPlayer]; local destinationPlayer1 :table = Players[tradeRoute1.DestinationCityPlayer]; local originCity1 :table = originPlayer1:GetCities():FindID(tradeRoute1.OriginCityID); local destinationCity1 :table = destinationPlayer1:GetCities():FindID(tradeRoute1.DestinationCityID); local originPlayer2 :table = Players[tradeRoute2.OriginCityPlayer]; local destinationPlayer2 :table = Players[tradeRoute2.DestinationCityPlayer]; local originCity2 :table = originPlayer2:GetCities():FindID(tradeRoute2.OriginCityID); local destinationCity2 :table = destinationPlayer2:GetCities():FindID(tradeRoute2.DestinationCityID); local yieldForRoute1 = GetYieldFromCity(yieldIndex, originCity1, destinationCity1); local yieldForRoute2 = GetYieldFromCity(yieldIndex, originCity2, destinationCity2); return yieldForRoute1 < yieldForRoute2; end function CompareByTurnsToComplete(tradeRoute1: table, tradeRoute2:table) if m_currentTab == TRADE_TABS.MY_ROUTES then return GetRouteTurnsRemaining(tradeRoute1) < GetRouteTurnsRemaining(tradeRoute2); end local originPlayer1 :table = Players[tradeRoute1.OriginCityPlayer]; local destinationPlayer1 :table = Players[tradeRoute1.DestinationCityPlayer]; local originCity1 :table = originPlayer1:GetCities():FindID(tradeRoute1.OriginCityID); local destinationCity1 :table = destinationPlayer1:GetCities():FindID(tradeRoute1.DestinationCityID); local originPlayer2 :table = Players[tradeRoute2.OriginCityPlayer]; local destinationPlayer2 :table = Players[tradeRoute2.DestinationCityPlayer]; local originCity2 :table = originPlayer2:GetCities():FindID(tradeRoute2.OriginCityID); local destinationCity2 :table = destinationPlayer2:GetCities():FindID(tradeRoute2.DestinationCityID); local tradePathLength1, tripsToDestination1, turnsToCompleteRoute1 = GetRouteInfo(originCity1, destinationCity1); local tradePathLength2, tripsToDestination2, turnsToCompleteRoute2 = GetRouteInfo(originCity2, destinationCity2); return turnsToCompleteRoute1 < turnsToCompleteRoute2; end function CompareByNetYield(tradeRoute1: table, tradeRoute2:table) local originPlayer1 :table = Players[tradeRoute1.OriginCityPlayer]; local destinationPlayer1 :table = Players[tradeRoute1.DestinationCityPlayer]; local originCity1 :table = originPlayer1:GetCities():FindID(tradeRoute1.OriginCityID); local destinationCity1 :table = destinationPlayer1:GetCities():FindID(tradeRoute1.DestinationCityID); local originPlayer2 :table = Players[tradeRoute2.OriginCityPlayer]; local destinationPlayer2 :table = Players[tradeRoute2.DestinationCityPlayer]; local originCity2 :table = originPlayer2:GetCities():FindID(tradeRoute2.OriginCityID); local destinationCity2 :table = destinationPlayer2:GetCities():FindID(tradeRoute2.DestinationCityID); local yieldForRoute1 :number = 0; local yieldForRoute2 :number = 0; for yieldInfo in GameInfo.Yields() do yieldForRoute1 = yieldForRoute1 + GetYieldFromCity(yieldInfo.Index, originCity1, destinationCity1); yieldForRoute2 = yieldForRoute2 + GetYieldFromCity(yieldInfo.Index, originCity2, destinationCity2); end return yieldForRoute1 > yieldForRoute2; end -- =========================================================================== -- Sort bar functions -- =========================================================================== -- Hides all the ascending/descending arrows function ResetSortBar() Controls.FoodDescArrow:SetHide(true); Controls.ProductionDescArrow:SetHide(true); Controls.GoldDescArrow:SetHide(true); Controls.ScienceDescArrow:SetHide(true); Controls.CultureDescArrow:SetHide(true); Controls.FaithDescArrow:SetHide(true); Controls.TurnsToCompleteDescArrow:SetHide(true); Controls.FoodAscArrow:SetHide(true); Controls.ProductionAscArrow:SetHide(true); Controls.GoldAscArrow:SetHide(true); Controls.ScienceAscArrow:SetHide(true); Controls.CultureAscArrow:SetHide(true); Controls.FaithAscArrow:SetHide(true); Controls.TurnsToCompleteAscArrow:SetHide(true); end function RefreshSortBar() if m_ctrlDown then RefreshSortButtons(m_SortBySettings); else RefreshSortButtons(m_GroupSortBySettings); end if showSortOrdersPermanently or m_shiftDown then -- Hide the order texts HideSortOrderLabels(); -- Show them based on current settings ShowSortOrderLabels(); end end function ShowSortOrderLabels() -- Refresh and show sort orders if m_ctrlDown then RefreshSortOrderLabels(m_SortBySettings); else RefreshSortOrderLabels(m_GroupSortBySettings); end end function HideSortOrderLabels() Controls.FoodSortOrder:SetHide(true); Controls.ProductionSortOrder:SetHide(true); Controls.GoldSortOrder:SetHide(true); Controls.ScienceSortOrder:SetHide(true); Controls.CultureSortOrder:SetHide(true); Controls.FaithSortOrder:SetHide(true); Controls.TurnsToCompleteSortOrder:SetHide(true); end -- Shows and hides arrows based on the passed sort order function SetSortArrow(ascArrow: table, descArrow:table, sortOrder:number) if sortOrder == SORT_ASCENDING then descArrow:SetHide(true); ascArrow:SetHide(false); else descArrow:SetHide(false); ascArrow:SetHide(true); end end function RefreshSortButtons(sortSettings: table) -- Hide all arrows ResetSortBar(); -- Set disabled color Controls.FoodSortButton:SetColorByName("ButtonDisabledCS"); Controls.ProductionSortButton:SetColorByName("ButtonDisabledCS"); Controls.GoldSortButton:SetColorByName("ButtonDisabledCS"); Controls.ScienceSortButton:SetColorByName("ButtonDisabledCS"); Controls.CultureSortButton:SetColorByName("ButtonDisabledCS"); Controls.FaithSortButton:SetColorByName("ButtonDisabledCS"); Controls.TurnsToCompleteSortButton:SetColorByName("ButtonDisabledCS"); -- Go through settings and display arrows for index, sortEntry in ipairs(sortSettings) do if sortEntry.SortByID == SORT_BY_ID.FOOD then SetSortArrow(Controls.FoodAscArrow, Controls.FoodDescArrow, sortEntry.SortOrder) Controls.FoodSortButton:SetColorByName("ButtonCS"); elseif sortEntry.SortByID == SORT_BY_ID.PRODUCTION then SetSortArrow(Controls.ProductionAscArrow, Controls.ProductionDescArrow, sortEntry.SortOrder) Controls.ProductionSortButton:SetColorByName("ButtonCS"); elseif sortEntry.SortByID == SORT_BY_ID.GOLD then SetSortArrow(Controls.GoldAscArrow, Controls.GoldDescArrow, sortEntry.SortOrder) Controls.GoldSortButton:SetColorByName("ButtonCS"); elseif sortEntry.SortByID == SORT_BY_ID.SCIENCE then SetSortArrow(Controls.ScienceAscArrow, Controls.ScienceDescArrow, sortEntry.SortOrder) Controls.ScienceSortButton:SetColorByName("ButtonCS"); elseif sortEntry.SortByID == SORT_BY_ID.CULTURE then SetSortArrow(Controls.CultureAscArrow, Controls.CultureDescArrow, sortEntry.SortOrder) Controls.CultureSortButton:SetColorByName("ButtonCS"); elseif sortEntry.SortByID == SORT_BY_ID.FAITH then SetSortArrow(Controls.FaithAscArrow, Controls.FaithDescArrow, sortEntry.SortOrder) Controls.FaithSortButton:SetColorByName("ButtonCS"); elseif sortEntry.SortByID == SORT_BY_ID.TURNS_TO_COMPLETE then SetSortArrow(Controls.TurnsToCompleteAscArrow, Controls.TurnsToCompleteDescArrow, sortEntry.SortOrder) Controls.TurnsToCompleteSortButton:SetColorByName("ButtonCS"); end end end function RefreshSortOrderLabels(sortSettings: table) for index, sortEntry in ipairs(sortSettings) do if sortEntry.SortByID == SORT_BY_ID.FOOD then Controls.FoodSortOrder:SetHide(false); Controls.FoodSortOrder:SetText(index); Controls.FoodSortOrder:SetColorByName("ResFoodLabelCS"); elseif sortEntry.SortByID == SORT_BY_ID.PRODUCTION then Controls.ProductionSortOrder:SetHide(false); Controls.ProductionSortOrder:SetText(index); Controls.ProductionSortOrder:SetColorByName("ResProductionLabelCS"); elseif sortEntry.SortByID == SORT_BY_ID.GOLD then Controls.GoldSortOrder:SetHide(false); Controls.GoldSortOrder:SetText(index); Controls.GoldSortOrder:SetColorByName("ResGoldLabelCS"); elseif sortEntry.SortByID == SORT_BY_ID.SCIENCE then Controls.ScienceSortOrder:SetHide(false); Controls.ScienceSortOrder:SetText(index); Controls.ScienceSortOrder:SetColorByName("ResScienceLabelCS"); elseif sortEntry.SortByID == SORT_BY_ID.CULTURE then Controls.CultureSortOrder:SetHide(false); Controls.CultureSortOrder:SetText(index); Controls.CultureSortOrder:SetColorByName("ResCultureLabelCS"); elseif sortEntry.SortByID == SORT_BY_ID.FAITH then Controls.FaithSortOrder:SetHide(false); Controls.FaithSortOrder:SetText(index); Controls.FaithSortOrder:SetColorByName("ResFaithLabelCS"); elseif sortEntry.SortByID == SORT_BY_ID.TURNS_TO_COMPLETE then Controls.TurnsToCompleteSortOrder:SetHide(false); Controls.TurnsToCompleteSortOrder:SetText(index); end end end -- =========================================================================== -- Applicaton level functions -- =========================================================================== function Open() m_AnimSupport.Show(); UI.PlaySound("CityStates_Panel_Open"); LuaEvents.TradeOverview_UpdateContextStatus(true); Refresh(); end function Close() if not ContextPtr:IsHidden() then UI.PlaySound("CityStates_Panel_Close"); end m_AnimSupport.Hide(); LuaEvents.TradeOverview_UpdateContextStatus(false); end -- =========================================================================== -- General helper functions -- =========================================================================== function SelectUnit(unit: table) local localPlayer = Game.GetLocalPlayer(); if UI.GetHeadSelectedUnit() ~= unit and localPlayer ~= -1 and localPlayer == unit:GetOwner() then UI.DeselectAllUnits(); UI.DeselectAllCities(); UI.SelectUnit(unit); end UI.LookAtPlotScreenPosition(unit:GetX(), unit:GetY(), 0.42, 0.5); end function IsCityState(player: table) local playerInfluence :table = player:GetInfluence(); if playerInfluence:CanReceiveInfluence() then return true end return false end -- Checks if the player is a city state, with "Send a trade route" quest function IsCityStateWithTradeQuest(player: table) local questsManager :table = Game.GetQuestsManager(); local questTooltip :string = Locale.Lookup("LOC_CITY_STATES_QUESTS"); if (questsManager ~= nil and Game.GetLocalPlayer() ~= nil) then local tradeRouteQuestInfo :table = GameInfo.Quests["QUEST_SEND_TRADE_ROUTE"]; if (tradeRouteQuestInfo ~= nil) then if (questsManager:HasActiveQuestFromPlayer(Game.GetLocalPlayer(), player:GetID(), tradeRouteQuestInfo.Index)) then return true end end end return false end -- Checks if the player is a civ, other than the local player function IsOtherCiv(player: table) if player:GetID() ~= Game.GetLocalPlayer() then return true end return false end -- --------------------------------------------------------------------------- -- Trade route helper functions -- --------------------------------------------------------------------------- -- Returns yield for the origin city function GetYieldFromCity(yieldIndex: number, originCity:table, destinationCity:table) local tradeManager = Game.GetTradeManager(); -- From route local yieldValue = tradeManager:CalculateOriginYieldFromPotentialRoute(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID(), yieldIndex); -- From path yieldValue = yieldValue + tradeManager:CalculateOriginYieldFromPath(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID(), yieldIndex); -- From modifiers local resourceID = -1; yieldValue = yieldValue + tradeManager:CalculateOriginYieldFromModifiers(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID(), yieldIndex, resourceID); return yieldValue; end -- Returns yield for the destination city function GetYieldForDestinationCity(yieldIndex: number, originCity:table, destinationCity:table) local tradeManager = Game.GetTradeManager(); -- From route local yieldValue = tradeManager:CalculateDestinationYieldFromPotentialRoute(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID(), yieldIndex); -- From path yieldValue = yieldValue + tradeManager:CalculateDestinationYieldFromPath(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID(), yieldIndex); -- From modifiers local resourceID = -1; yieldValue = yieldValue + tradeManager:CalculateDestinationYieldFromModifiers(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID(), yieldIndex, resourceID); return yieldValue; end -- Returns length of trade path, number of trips to destination, turns to complete route function GetRouteInfo(originCity: table, destinationCity:table) local eSpeed = GameConfiguration.GetGameSpeedType(); if GameInfo.GameSpeeds[eSpeed] ~= nil then local iSpeedCostMultiplier = GameInfo.GameSpeeds[eSpeed].CostMultiplier; local tradeManager = Game.GetTradeManager(); local pathPlots = tradeManager:GetTradeRoutePath(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID()); local tradePathLength :number = tableLength(pathPlots) - 1; local multiplierConstant :number = 0.1; local tripsToDestination = 1 + math.floor(iSpeedCostMultiplier / tradePathLength * multiplierConstant); --print("Error: Playing on an unrecognized speed. Defaulting to standard for route turns calculation"); local turnsToCompleteRoute = (tradePathLength * 2 * tripsToDestination); return tradePathLength, tripsToDestination, turnsToCompleteRoute; else print("Speed type index " .. eSpeed); print("Error: Could not find game speed type. Defaulting to first entry in table"); local iSpeedCostMultiplier = GameInfo.GameSpeeds[1].CostMultiplier; local tradeManager = Game.GetTradeManager(); local pathPlots = tradeManager:GetTradeRoutePath(originCity:GetOwner(), originCity:GetID(), destinationCity:GetOwner(), destinationCity:GetID()); local tradePathLength :number = tableLength(pathPlots) - 1; local multiplierConstant :number = 0.1; local tripsToDestination = 1 + math.floor(iSpeedCostMultiplier / tradePathLength * multiplierConstant); local turnsToCompleteRoute = (tradePathLength * 2 * tripsToDestination); return tradePathLength, tripsToDestination, turnsToCompleteRoute; end end -- Finds and removes routeToDelete from routeTable function RemoveRouteFromTable(routeToDelete: table, routeTable:table) if m_groupBySelected == GROUP_BY_SETTINGS.NONE then local targetIndex :number; for i, route in ipairs(routeTable) do if CheckRouteEquality(route, routeToDelete) then targetIndex = i; end end -- Remove route if targetIndex then table.remove(routeTable, targetIndex); end -- If grouping by something, go one level deeper else local targetIndex :number; local targetGroupIndex :number; for i, groupedRoutes in ipairs(routeTable) do for j, route in ipairs(groupedRoutes) do if CheckRouteEquality(route, routeToDelete) then targetIndex = j; targetGroupIndex = i; end end end -- Remove route if targetIndex then table.remove(routeTable[targetGroupIndex], targetIndex); end -- If that group is empty, remove that group if tableLength(routeTable[targetGroupIndex]) <= 0 then if targetGroupIndex then table.remove(routeTable, targetGroupIndex); end end end end -- Returns a string of the route in format "[ORIGIN_CITY_NAME]-[DESTINATION_CITY_NAME]" function GetTradeRouteString(routeInfo: table) local originPlayer :table = Players[routeInfo.OriginCityPlayer]; local originCity :table = originPlayer:GetCities():FindID(routeInfo.OriginCityID); local destinationPlayer :table = Players[routeInfo.DestinationCityPlayer]; local destinationCity :table = destinationPlayer:GetCities():FindID(routeInfo.DestinationCityID); local s :string = Locale.Lookup(originCity:GetName()) .. "-" .. Locale.Lookup(destinationCity:GetName()) return s; end -- Checks if the two routes are the same (does not compare traderUnit) function CheckRouteEquality(tradeRoute1: table, tradeRoute2:table) if (tradeRoute1.OriginCityPlayer == tradeRoute2.OriginCityPlayer and tradeRoute1.OriginCityID == tradeRoute2.OriginCityID and tradeRoute1.DestinationCityPlayer == tradeRoute2.DestinationCityPlayer and tradeRoute1.DestinationCityID == tradeRoute2.DestinationCityID) then return true; end return false; end -- Checks equality with the passed sorting compare function function CheckEquality(tradeRoute1: table, tradeRoute2:table, compareFunction) if not compareFunction(tradeRoute1, tradeRoute2) then if not compareFunction(tradeRoute2, tradeRoute1) then return true; end end return false; end -- =========================================================================== -- Button handler functions -- =========================================================================== function OnOpen() if blockPanelInBetweenTurns then if not m_processingTurn then Open(); else print("In between turns. Blocking Trade Panel from opening.") end else Open(); end end function OnClose() Close(); end -- --------------------------------------------------------------------------- -- Tab buttons -- --------------------------------------------------------------------------- function OnMyRoutesButton() m_currentTab = TRADE_TABS.MY_ROUTES; Refresh(); end function OnRoutesToCitiesButton() m_currentTab = TRADE_TABS.ROUTES_TO_CITIES; Refresh(); end function OnAvailableRoutesButton() m_currentTab = TRADE_TABS.AVAILABLE_ROUTES; Refresh(); end -- --------------------------------------------------------------------------- -- Pulldowns -- --------------------------------------------------------------------------- function OnFilterSelected(index: number, filterIndex:number) m_filterSelected = filterIndex; Controls.OverviewFilterButton:SetText(m_filterList[m_filterSelected].FilterText); Refresh(); end function OnGroupBySelected(index: number, groupByIndex:number) m_groupBySelected = groupByIndex; Controls.OverviewGroupByButton:SetText(m_groupByList[m_groupBySelected].groupByString); -- Have to rebuild table m_HasBuiltTradeRouteTable = false; Refresh(); end -- --------------------------------------------------------------------------- -- Checkbox -- --------------------------------------------------------------------------- function OnGroupShowAll() -- Dont do anything, if grouping is none if m_groupBySelected == GROUP_BY_SETTINGS.NONE then return; end m_GroupShowAll = Controls.GroupShowAllCheckBox:IsChecked(); if not m_GroupShowAll then Controls.GroupShowAllCheckBoxLabel:LocalizeAndSetText("LOC_TRADE_EXPAND_ALL_BUTTON_TEXT"); m_cityRouteLimitExclusionList = {}; else Controls.GroupShowAllCheckBoxLabel:LocalizeAndSetText("LOC_TRADE_COLLAPSE_ALL_BUTTON_TEXT"); m_cityRouteLimitExclusionList = {}; end Refresh(); end -- --------------------------------------------------------------------------- -- Sort bar insert buttons -- --------------------------------------------------------------------------- function OnSortByFood() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.FoodDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.FOOD, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.FOOD, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.FOOD, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.FOOD, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end function OnSortByProduction() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.ProductionDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.PRODUCTION, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.PRODUCTION, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.PRODUCTION, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.PRODUCTION, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end function OnSortByGold() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.GoldDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.GOLD, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.GOLD, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.GOLD, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.GOLD, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end function OnSortByScience() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.ScienceDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.SCIENCE, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.SCIENCE, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.SCIENCE, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.SCIENCE, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end function OnSortByCulture() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.CultureDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.CULTURE, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.CULTURE, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.CULTURE, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.CULTURE, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end function OnSortByFaith() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.FaithDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.FAITH, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.FAITH, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.FAITH, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.FAITH, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end function OnSortByTurnsToComplete() -- If shift is not being pressed, reset sort settings if not m_shiftDown then if m_ctrlDown then m_SortBySettings = {}; else m_GroupSortBySettings = {}; end end -- Sort based on currently showing icon toggled if Controls.TurnsToCompleteDescArrow:IsHidden() then if m_ctrlDown then InsertSortEntry(SORT_BY_ID.TURNS_TO_COMPLETE, SORT_DESCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.TURNS_TO_COMPLETE, SORT_DESCENDING, m_GroupSortBySettings); end else if m_ctrlDown then InsertSortEntry(SORT_BY_ID.TURNS_TO_COMPLETE, SORT_ASCENDING, m_SortBySettings); else InsertSortEntry(SORT_BY_ID.TURNS_TO_COMPLETE, SORT_ASCENDING, m_GroupSortBySettings); end end Refresh(); end -- --------------------------------------------------------------------------- -- Sort bar delete buttons -- --------------------------------------------------------------------------- function OnNotSortByFood() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.FOOD, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.FOOD, m_GroupSortBySettings); end Refresh(); end function OnNotSortByProduction() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.PRODUCTION, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.PRODUCTION, m_GroupSortBySettings); end Refresh(); end function OnNotSortByGold() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.GOLD, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.GOLD, m_GroupSortBySettings); end Refresh(); end function OnNotSortByScience() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.SCIENCE, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.SCIENCE, m_GroupSortBySettings); end Refresh(); end function OnNotSortByCulture() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.CULTURE, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.CULTURE, m_GroupSortBySettings); end Refresh(); end function OnNotSortByFaith() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.FAITH, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.FAITH, m_GroupSortBySettings); end Refresh(); end function OnNotSortByTurnsToComplete() if m_ctrlDown then RemoveSortEntry(SORT_BY_ID.TURNS_TO_COMPLETE, m_SortBySettings); else RemoveSortEntry(SORT_BY_ID.TURNS_TO_COMPLETE, m_GroupSortBySettings); end Refresh(); end -- =========================================================================== -- Helper Utility functions -- =========================================================================== function tableLength(T) local count = 0 for _ in pairs(T) do count = count + 1 end return count end function reverseTable(T) table_length = tableLength(T); for i = 1, math.floor(table_length / 2) do local tmp = T[i] T[i] = T[table_length - i + 1] T[table_length - i + 1] = tmp end end function findIndex(T, searchItem, compareFunc) for index, item in ipairs(T) do if compareFunc(item, searchItem) then return index; end end return -1; end -- TODO: Move these to external file, when Firaxis patches the gameplay scripts not loading bug -- ========== START OF DataDumper.lua ================= --[[ License DataDumper.lua Copyright (c) 2007 Olivetti-Engineering SA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ]] function dump(...) print(DataDumper(...), "\n---") end local dumplua_closure = [[ local closures = {} local function closure(t) closures[#closures+1] = t t[1] = assert(loadstring(t[1])) return t[1] end for _,t in pairs(closures) do for i = 2,#t do debug.setupvalue(t[1], i-1, t[i]) end end ]] local lua_reserved_keywords = { 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true', 'until', 'while' } local function keys(t) local res = {} local oktypes = { stringstring = true, numbernumber = true } local function cmpfct(a, b) if oktypes[type(a) .. type(b)] then return a < b else return type(a) < type(b) end end for k in pairs(t) do res[#res + 1] = k end table.sort(res, cmpfct) return res end local c_functions = {} for _, lib in pairs { '_G', 'string', 'table', 'math', 'io', 'os', 'coroutine', 'package', 'debug' } do local t = {} lib = lib .. "." if lib == "_G." then lib = "" end for k, v in pairs(t) do if type(v) == 'function' and not pcall(string.dump, v) then c_functions[v] = lib .. k end end end function DataDumper(value, varname, fastmode, ident) local defined, dumplua = {} -- Local variables for speed optimization local string_format, type, string_dump, string_rep = string.format, type, string.dump, string.rep local tostring, pairs, table_concat = tostring, pairs, table.concat local keycache, strvalcache, out, closure_cnt = {}, {}, {}, 0 setmetatable(strvalcache, { __index = function(t, value) local res = string_format('%q', value) t[value] = res return res end }) local fcts = { string = function(value) return strvalcache[value] end, number = function(value) return value end, boolean = function(value) return tostring(value) end, ['nil'] = function(value) return 'nil' end, ['function'] = function(value) return string_format("loadstring(%q)", string_dump(value)) end, userdata = function() error("Cannot dump userdata") end, thread = function() error("Cannot dump threads") end, } local function test_defined(value, path) if defined[value] then if path:match("^getmetatable.*%)$") then out[#out + 1] = string_format("s%s, %s)\n", path:sub(2, -2), defined[value]) else out[#out + 1] = path .. " = " .. defined[value] .. "\n" end return true end defined[value] = path end local function make_key(t, key) local s if type(key) == 'string' and key:match('^[_%a][_%w]*$') then s = key .. "=" else s = "[" .. dumplua(key, 0) .. "]=" end t[key] = s return s end for _, k in ipairs(lua_reserved_keywords) do keycache[k] = '["' .. k .. '"] = ' end if fastmode then fcts.table = function(value) -- Table value local numidx = 1 out[#out + 1] = "{" for key, val in pairs(value) do if key == numidx then numidx = numidx + 1 else out[#out + 1] = keycache[key] end local str = dumplua(val) out[#out + 1] = str .. "," end if string.sub(out[#out], -1) == "," then out[#out] = string.sub(out[#out], 1, -2); end out[#out + 1] = "}" return "" end else fcts.table = function(value, ident, path) if test_defined(value, path) then return "nil" end -- Table value local sep, str, numidx, totallen = " ", {}, 1, 0 local meta, metastr = getmetatable(value) if meta then ident = ident + 1 metastr = dumplua(meta, ident, "getmetatable(" .. path .. ")") totallen = totallen + #metastr + 16 end for _, key in pairs(keys(value)) do local val = value[key] local s = "" local subpath = path or "" if key == numidx then subpath = subpath .. "[" .. numidx .. "]" numidx = numidx + 1 else s = keycache[key] if not s:match "^%[" then subpath = subpath .. "." end subpath = subpath .. s:gsub("%s*=%s*$", "") end s = s .. dumplua(val, ident + 1, subpath) str[#str + 1] = s totallen = totallen + #s + 2 end if totallen > 80 then sep = "\n" .. string_rep(" ", ident + 1) end str = "{" .. sep .. table_concat(str, "," .. sep) .. " " .. sep:sub(1, -3) .. "}" if meta then sep = sep:sub(1, -3) return "setmetatable(" .. sep .. str .. "," .. sep .. metastr .. sep:sub(1, -3) .. ")" end return str end fcts['function'] = function(value, ident, path) if test_defined(value, path) then return "nil" end if c_functions[value] then return c_functions[value] elseif debug == nil or debug.getupvalue(value, 1) == nil then return string_format("loadstring(%q)", string_dump(value)) end closure_cnt = closure_cnt + 1 local res = { string.dump(value) } for i = 1, math.huge do local name, v = debug.getupvalue(value, i) if name == nil then break end res[i + 1] = v end return "closure " .. dumplua(res, ident, "closures[" .. closure_cnt .. "]") end end function dumplua(value, ident, path) return fcts[type(value)](value, ident, path) end if varname == nil then varname = "" elseif varname:match("^[%a_][%w_]*$") then varname = varname .. " = " end if fastmode then setmetatable(keycache, { __index = make_key }) out[1] = varname table.insert(out, dumplua(value, 0)) return table.concat(out) else setmetatable(keycache, { __index = make_key }) local items = {} for i = 1, 10 do items[i] = '' end items[3] = dumplua(value, ident or 0, "t") if closure_cnt > 0 then items[1], items[6] = dumplua_closure:match("(.*\n)\n(.*)") out[#out + 1] = "" end if #out > 0 then items[2], items[4] = "local t = ", "\n" items[5] = table.concat(out) items[7] = varname .. "t" else items[2] = varname end return table.concat(items) end end -- ========== END OF DataDumper.lua ================= -- =========================================================================== -- LUA Event -- Explicit close (from partial screen hooks), part of closing everything, -- =========================================================================== function OnCloseAllExcept(contextToStayOpen: string) if contextToStayOpen == ContextPtr:GetID() then return; end Close(); end function OnTraderAutomated(traderID: number, isAutomated:boolean) m_TraderAutomated[traderID] = isAutomated; end -- =========================================================================== -- Game Event -- =========================================================================== function OnInterfaceModeChanged(eOldMode: number, eNewMode:number) if eNewMode == InterfaceModeTypes.VIEW_MODAL_LENS then Close(); end end function OnLocalPlayerTurnEnd() if (GameConfiguration.IsHotseat()) then Close(); end m_HasBuiltTradeRouteTable = false; m_processingTurn = true; end function OnLocalPlayerTurnBegin() -- Dont call update, if game turn has not changed. Needs this check, otherwise it calls this hook -- even if the turn has not started. if m_LastTurnUpdatedMyRoutes < Game.GetCurrentGameTurn() then UpdateRoutesWithTurnsRemaining(m_LocalPlayerRunningRoutes); end m_processingTurn = false; end function OnUnitOperationsCleared(playerID, unitID, hOperation, iData1) if playerID == Game.GetLocalPlayer() then local pPlayer :table = Players[playerID]; local pUnit :table = pPlayer:GetUnits():FindID(unitID); if pUnit ~= nil then local unitInfo :table = GameInfo.Units[pUnit:GetUnitType()]; if (unitInfo.MakeTradeRoute == true) then -- Remove entry from local players running routes for i, route in ipairs(m_LocalPlayerRunningRoutes) do if route.TraderUnitID == unitID then print("Removing route: " .. GetTradeRouteString(route) .. " since it completed."); LuaEvents.TradeOverview_SetLastRoute(route); table.remove(m_LocalPlayerRunningRoutes, i); return; end end print("Error: Could not find the route in m_LocalPlayerRunningRoutes"); end end end end -- =========================================================================== -- UI EVENTS -- =========================================================================== function OnInit(isReload: boolean) if isReload then LuaEvents.GameDebug_GetValues(RELOAD_CACHE_ID); end end function OnShutdown() LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "isHidden", ContextPtr:IsHidden()); LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "currentTab", m_currentTab); LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "filterSelected", m_filterSelected); LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "groupBySelected", m_groupBySelected); end -- --------------------------------------------------------------------------- -- Input handlers. -- --------------------------------------------------------------------------- function KeyDownHandler(key: number) if key == Keys.VK_SHIFT then m_shiftDown = true; if not showSortOrdersPermanently then ShowSortOrderLabels(); end -- let it fall through end if key == Keys.VK_CONTROL then m_ctrlDown = true; RefreshSortBar(); end return false; end function KeyUpHandler(key: number) if key == Keys.VK_SHIFT then m_shiftDown = false; if not showSortOrdersPermanently then HideSortOrderLabels(); end -- let it fall through end if key == Keys.VK_CONTROL then m_ctrlDown = false; RefreshSortBar(); end if key == Keys.VK_ESCAPE then Close(); return true; end if key == Keys.VK_RETURN then -- Don't let enter propigate or it will hit action panel which will raise a screen (potentially this one again) tied to the action. return true; end return false; end function OnInputHandler(pInputStruct: table) -- Call the animation input handler -- m_AnimSupport.OnInputHandler ( pInputStruct ); local uiMsg = pInputStruct:GetMessageType(); if uiMsg == KeyEvents.KeyDown then return KeyDownHandler(pInputStruct:GetKey()); end if uiMsg == KeyEvents.KeyUp then return KeyUpHandler(pInputStruct:GetKey()); end return false; end -- =========================================================================== -- LUA EVENT -- Reload support -- =========================================================================== function OnGameDebugReturn(context: string, contextTable:table) if context == RELOAD_CACHE_ID then if contextTable["isHidden"] ~= nil and not contextTable["isHidden"] then Open(); end -- TODO: Add reload support for sort bar if contextTable["filterSelected"] ~= nil then m_filterSelected = contextTable["filterSelected"]; Refresh(); end if contextTable["currentTab"] ~= nil then m_currentTab = contextTable["currentTab"]; Refresh(); end if contextTable["groupBySelected"] ~= nil then m_groupBySelected = contextTable["groupBySelected"]; -- Have to rebuild table m_HasBuiltTradeRouteTable = false; Refresh(); end end end function OnUnitOperationStarted(ownerID: number, unitID:number, operationID:number) if ownerID == Game.GetLocalPlayer() and operationID == UnitOperationTypes.MAKE_TRADE_ROUTE then -- Unit was just started a trade route. Find the route, and update the tables local localPlayerCities :table = Players[ownerID]:GetCities(); for i, city in localPlayerCities:Members() do local outgoingRoutes = city:GetTrade():GetOutgoingRoutes(); for j, route in ipairs(outgoingRoutes) do if route.TraderUnitID == unitID then -- Add it to the local players runnning routes AddRouteWithTurnsRemaining(route, m_LocalPlayerRunningRoutes); -- Remove it from the available routes RemoveRouteFromTable(route, m_AvailableTradeRoutes); end end end -- Dont refresh, if the window is hidden if not ContextPtr:IsHidden() then Refresh(); end end end function OnPolicyChanged(ePlayer) if m_AnimSupport.IsVisible() and ePlayer == Game.GetLocalPlayer() then Refresh(); end end function Initialize() -- Load Previous Routes LoadRunningRoutesInfo(); -- Input handler ContextPtr:SetInputHandler(OnInputHandler, true); -- Control Events Controls.CloseButton:RegisterCallback(Mouse.eLClick, OnClose); Controls.CloseButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.MyRoutesButton:RegisterCallback(Mouse.eLClick, OnMyRoutesButton); Controls.MyRoutesButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.RoutesToCitiesButton:RegisterCallback(Mouse.eLClick, OnRoutesToCitiesButton); Controls.RoutesToCitiesButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.AvailableRoutesButton:RegisterCallback(Mouse.eLClick, OnAvailableRoutesButton); Controls.AvailableRoutesButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); -- Control events - sort bar Controls.FoodSortButton:RegisterCallback(Mouse.eLClick, OnSortByFood); Controls.FoodSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByFood); Controls.FoodSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.ProductionSortButton:RegisterCallback(Mouse.eLClick, OnSortByProduction); Controls.ProductionSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByProduction); Controls.ProductionSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.GoldSortButton:RegisterCallback(Mouse.eLClick, OnSortByGold); Controls.GoldSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByGold); Controls.GoldSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.ScienceSortButton:RegisterCallback(Mouse.eLClick, OnSortByScience); Controls.ScienceSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByScience); Controls.ScienceSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.CultureSortButton:RegisterCallback(Mouse.eLClick, OnSortByCulture); Controls.CultureSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByCulture); Controls.CultureSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.FaithSortButton:RegisterCallback(Mouse.eLClick, OnSortByFaith); Controls.FaithSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByFaith); Controls.FaithSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); Controls.TurnsToCompleteSortButton:RegisterCallback(Mouse.eLClick, OnSortByTurnsToComplete); Controls.TurnsToCompleteSortButton:RegisterCallback(Mouse.eRClick, OnNotSortByTurnsToComplete); Controls.TurnsToCompleteSortButton:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); --Filter Pulldown Controls.OverviewFilterButton:RegisterCallback(eLClick, UpdateFilterArrow); Controls.OverviewDestinationFilterPulldown:RegisterSelectionCallback(OnFilterSelected); -- Group By Pulldown Controls.OverviewGroupByButton:RegisterCallback(eLClick, UpdateGroupByArrow); Controls.OverviewGroupByPulldown:RegisterSelectionCallback(OnGroupBySelected); Controls.GroupShowAllCheckBox:RegisterCallback(eLClick, OnGroupShowAll); Controls.GroupShowAllCheckBox:RegisterCallback(Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end); -- Lua Events LuaEvents.PartialScreenHooks_OpenTradeOverview.Add(OnOpen); LuaEvents.PartialScreenHooks_CloseTradeOverview.Add(OnClose); LuaEvents.PartialScreenHooks_CloseAllExcept.Add(OnCloseAllExcept); LuaEvents.TradeRouteChooser_TraderAutomated.Add(OnTraderAutomated); -- Animation Controller m_AnimSupport = CreateScreenAnimation(Controls.SlideAnim); -- Rundown / Screen Events Events.SystemUpdateUI.Add(m_AnimSupport.OnUpdateUI); Controls.Title:SetText(Locale.Lookup("LOC_TRADE_OVERVIEW_TITLE")); -- Game Engine Events Events.UnitOperationStarted.Add(OnUnitOperationStarted); Events.GovernmentPolicyChanged.Add(OnPolicyChanged); Events.GovernmentPolicyObsoleted.Add(OnPolicyChanged); Events.LocalPlayerTurnEnd.Add(OnLocalPlayerTurnEnd); Events.InterfaceModeChanged.Add(OnInterfaceModeChanged); Events.LocalPlayerTurnBegin.Add(OnLocalPlayerTurnBegin); Events.UnitOperationsCleared.Add(OnUnitOperationsCleared); -- Hot-Reload Events ContextPtr:SetInitHandler(OnInit); ContextPtr:SetShutdown(OnShutdown); LuaEvents.GameDebug_Return.Add(OnGameDebugReturn); end Initialize();
--[[ Made by Megumu#8008 <3 ]] local f=string.byte;local i=string.char;local c=string.sub;local C=table.concat;local u=math.ldexp;local E=getfenv or function()return _ENV end;local l=setmetatable;local r=select;local t=unpack;local h=tonumber;local function s(t)local e,o,n="","",{}local a=256;local d={}for l=0,a-1 do d[l]=i(l)end;local l=1;local function f()local e=h(c(t,l,l),36)l=l+1;local o=h(c(t,l,l+e-1),36)l=l+e;return o end;e=i(f())n[1]=e;while l<#t do local l=f()if d[l]then o=d[l]else o=e..c(e,1,1)end;d[a]=e..c(o,1,1)n[#n+1],e,a=o,o,a+1 end;return table.concat(n)end;local a=s('25424X25427625725A27625427326525O26R26525D25725827A26726125X26525724P27A26I26525K25W25T26326125O26526426J25O25Z25M26126727O25727A27327126K25725027A26P25Y25Q25Z25V26526J26525M25Q28O25724W27A28325N25O25M25T25Y26727I27A25S26526125W28E27A26O29525W25O25S26Z26525Y27Z25M29827629A29626T26126325S28Z26523T25527A27427A25725927A25K26125T25M25N29Z27K27D26726329227625O25D25K27O28T27626625P25Y26325O25T25Z25Y2A727626426526225P29124Z2A825O25P25K25Q29625P2652A627927628W28Y2902AC25426628Z2642BE26125P29D29W24M27A26224W22021Z24K2AI26624O2BS24H24O2762672AI24H2AI26325426W25424H27A2611G2BY1G25421K25Q24G2BY24G27625F2482772CO25425R24O2CO24Z2C025425O21C2C823Q21C2CG26121K2BS24T21K2CG25Q2BR21Z2C427625E2402BS2592402CM23S2602C923S27625J2CQ24H2CQ25F2CW2BZ27625R2C72C92CB23K2BY23K2CG26Q2E22DC2E425426R26G2D824O26G27626V2C82C92EI26I26O2BY26O27626R24G2CO24H2CL25426O2C328T21K2612542D627621K2732CW25B2CW2DY2CO24J2CB1G21Z21Z24T2FD25J2C62FA2E12FE24T23K21Z2FI2AI2542AI2532BP2F121Z2E92542BQ2BS24M2AI2622BX2DC2CW2C62DO2CA2762C62C82GA2542C62EF2GE25U23S2BY2DO25425Y2DB2DD25425Z2EX27625V2542ES27A25Y2E724H2E925M26W2BS24X2EI25Q2EM21Z24X2EO2GF23S2C02582GM2632FR2AI');local n=bit and bit.bxor or function(l,e)local o,n=1,0 while l>0 and e>0 do local a,c=l%2,e%2 if a~=c then n=n+o end l,e,o=(l-a)/2,(e-c)/2,o*2 end if l<e then l=e end while l>0 do local e=l%2 if e>0 then n=n+o end l,o=(l-e)/2,o*2 end return n end local function e(e,l,o)if o then local l=(e/2^(l-1))%2^((o-1)-(l-1)+1);return l-l%1;else local l=2^(l-1);return(e%(l+l)>=l)and 1 or 0;end;end;local l=1;local function o()local c,o,e,a=f(a,l,l+3);c=n(c,184)o=n(o,184)e=n(e,184)a=n(a,184)l=l+4;return(a*16777216)+(e*65536)+(o*256)+c;end;local function d()local e=n(f(a,l,l),184);l=l+1;return e;end;local function A()local l=o();local n=o();local c=1;local o=(e(n,1,20)*(2^32))+l;local l=e(n,21,31);local e=((-1)^e(n,32));if(l==0)then if(o==0)then return e*0;else l=1;c=0;end;elseif(l==2047)then return(o==0)and(e*(1/0))or(e*(0/0));end;return u(e,l-1023)*(c+(o/(2^52)));end;local s=o;local function h(e)local o;if(not e)then e=s();if(e==0)then return'';end;end;o=c(a,l,l+e-1);l=l+e;local e={}for l=1,#o do e[l]=i(n(f(c(o,l,l)),184))end return C(e);end;local l=o;local function s(...)return{...},r('#',...)end local function B()local t={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};local f={0};local l={};local a={t,nil,f,nil,l};a[4]=d();local l=o()local c={0,0,0,0,0,0,0,0,0};for o=1,l do local e=d();local l;if(e==2)then l=(d()~=0);elseif(e==1)then l=A();elseif(e==3)then l=h();end;c[o]=l;end;a[2]=c for l=1,o()do f[l-1]=B();end;for a=1,o()do local c=n(o(),99);local o=n(o(),25);local n=e(c,1,2);local l=e(o,1,11);local l={l,e(c,3,11),nil,nil,o};if(n==0)then l[3]=e(c,12,20);l[5]=e(c,21,29);elseif(n==1)then l[3]=e(o,12,33);elseif(n==2)then l[3]=e(o,12,32)-1048575;elseif(n==3)then l[3]=e(o,12,32)-1048575;l[5]=e(c,21,29);end;t[a]=l;end;return a;end;local function A(l,e,i)local e=l[1];local n=l[2];local o=l[3];local l=l[4];return function(...)local d=e;local c=n;local O=o;local n=l;local h=s local o=1;local a=-1;local s={};local f={...};local r=r('#',...)-1;local l={};local e={};for l=0,r do if(l>=n)then s[l-n]=f[l+1];else e[l]=f[l+1];end;end;local l=r-n+1 local l;local n;while true do l=d[o];n=l[1];if n<=19 then if n<=9 then if n<=4 then if n<=1 then if n>0 then if e[l[2]]then o=o+1;else o=o+l[3];end;else e[l[2]]=i[c[l[3]]];end;elseif n<=2 then local n=l[2];local c=l[5];local l=n+2;local a={e[n](e[n+1],e[l])};for o=1,c do e[l+o]=a[o];end;local n=e[n+3];if n then e[l]=n else o=o+1;end;elseif n>3 then local o=l[2];local n=e[l[3]];e[o+1]=n;e[o]=n[c[l[5]]];else local n=l[2];local d={};local o=0;local c=n+l[3]-1;for l=n+1,c do o=o+1;d[o]=e[l];end;local c={e[n](t(d,1,c-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;a=l;end;elseif n<=6 then if n>5 then local n=l[2];local c={};local o=0;local d=a;for l=n+1,d do o=o+1;c[o]=e[l];end;local c={e[n](t(c,1,d-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;a=l;else local n;local n;local u;local n;local s,f;local r;e[l[2]]=i[c[l[3]]];o=o+1;l=d[o];e[l[2]]=i[c[l[3]]];o=o+1;l=d[o];r=l[2];s,f=h(e[r]());a=r-1;f=f+r-1;n=0;for l=r,f do n=n+1;e[l]=s[n];end;a=f;o=o+1;l=d[o];r=l[2];u={};n=0;f=a;for l=r+1,f do n=n+1;u[n]=e[l];end;s={e[r](t(u,1,f-r))};f=r+l[5]-2;n=0;for l=r,f do n=n+1;e[l]=s[n];end;a=f;o=o+1;l=d[o];o=o+l[3];end;elseif n<=7 then local n;local n;local u;local f;local s,r;local C;local n;i[c[l[3]]]=e[l[2]];o=o+1;l=d[o];e[l[2]]=i[c[l[3]]];o=o+1;l=d[o];e[l[2]]=e[l[3]][c[l[5]]];o=o+1;l=d[o];e[l[2]]=e[l[3]][c[l[5]]];o=o+1;l=d[o];n=l[2];C=e[l[3]];e[n+1]=C;e[n]=C[c[l[5]]];o=o+1;l=d[o];e[l[2]]=i[c[l[3]]];o=o+1;l=d[o];e[l[2]]=i[c[l[3]]];o=o+1;l=d[o];n=l[2];s,r=h(e[n]());a=n-1;r=r+n-1;f=0;for l=n,r do f=f+1;e[l]=s[f];end;a=r;o=o+1;l=d[o];n=l[2];u={};f=0;r=a;for l=n+1,r do f=f+1;u[f]=e[l];end;s={e[n](t(u,1,r-n))};r=n+l[5]-2;f=0;for l=n,r do f=f+1;e[l]=s[f];end;a=r;o=o+1;l=d[o];e[l[2]]=c[l[3]];elseif n==8 then local o=l[2];local n=e[l[3]];e[o+1]=n;e[o]=n[c[l[5]]];else local h;local i;local n;local r;local f;e[l[2]]=e[l[3]][c[l[5]]];o=o+1;l=d[o];e[l[2]]=e[l[3]];o=o+1;l=d[o];e[l[2]]=c[l[3]];o=o+1;l=d[o];f=l[2];r={};n=0;i=f+l[3]-1;for l=f+1,i do n=n+1;r[n]=e[l];end;h={e[f](t(r,1,i-f))};i=f+l[5]-2;n=0;for l=f,i do n=n+1;e[l]=h[n];end;a=i;o=o+1;l=d[o];if e[l[2]]then o=o+1;else o=o+l[3];end;end;elseif n<=14 then if n<=11 then if n>10 then local n=l[2];local c={};local o=0;local l=n+l[3]-1;for l=n+1,l do o=o+1;c[o]=e[l];end;local c,l=h(e[n](t(c,1,l-n)));l=l+n-1;o=0;for l=n,l do o=o+1;e[l]=c[o];end;a=l;else if(e[l[2]]==c[l[5]])then o=o+1;else o=o+l[3];end;end;elseif n<=12 then o=o+l[3];elseif n>13 then e[l[2]]=i[c[l[3]]];else o=o+l[3];end;elseif n<=16 then if n>15 then e[l[2]]=c[l[3]];else local o=l[2];local c={};local n=0;local l=o+l[3]-1;for l=o+1,l do n=n+1;c[n]=e[l];end;e[o](t(c,1,l-o));a=o;end;elseif n<=17 then local n=l[2];local d={};local o=0;local c=a;for l=n+1,c do o=o+1;d[o]=e[l];end;local c={e[n](t(d,1,c-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;a=l;elseif n==18 then local n=l[2];local d={};local o=0;local c=n+l[3]-1;for l=n+1,c do o=o+1;d[o]=e[l];end;local c={e[n](t(d,1,c-n))};local l=n+l[5]-2;o=0;for l=n,l do o=o+1;e[l]=c[o];end;a=l;else local o=l[2];local c,l=h(e[o]());a=o-1;l=l+o-1;local n=0;for l=o,l do n=n+1;e[l]=c[n];end;a=l;end;elseif n<=29 then if n<=24 then if n<=21 then if n>20 then i[c[l[3]]]=e[l[2]];else local n=l[2];local c=l[5];local l=n+2;local a={e[n](e[n+1],e[l])};for o=1,c do e[l+o]=a[o];end;local n=e[n+3];if n then e[l]=n else o=o+1;end;end;elseif n<=22 then e[l[2]]=A(O[l[3]],nil,i);elseif n==23 then e[l[2]]=c[l[3]];else local n=l[2];local c={};local o=0;local l=n+l[3]-1;for l=n+1,l do o=o+1;c[o]=e[l];end;local c,l=h(e[n](t(c,1,l-n)));l=l+n-1;o=0;for l=n,l do o=o+1;e[l]=c[o];end;a=l;end;elseif n<=26 then if n>25 then e[l[2]]=e[l[3]];else do return end;end;elseif n<=27 then e[l[2]]=e[l[3]][c[l[5]]];elseif n==28 then local n;local u,n;local f;local n;local s;local r;e[l[2]]=i[c[l[3]]];o=o+1;l=d[o];e[l[2]]=e[l[3]][c[l[5]]];o=o+1;l=d[o];e[l[2]]=e[l[3]];o=o+1;l=d[o];r=l[2];s={};n=0;f=r+l[3]-1;for l=r+1,f do n=n+1;s[n]=e[l];end;u,f=h(e[r](t(s,1,f-r)));f=f+r-1;n=0;for l=r,f do n=n+1;e[l]=u[n];end;a=f;o=o+1;l=d[o];r=l[2];s={};n=0;f=a;for l=r+1,f do n=n+1;s[n]=e[l];end;u={e[r](t(s,1,f-r))};f=r+l[5]-2;n=0;for l=r,f do n=n+1;e[l]=u[n];end;a=f;o=o+1;l=d[o];o=o+l[3];else local o=l[2];local c={};local n=0;local l=o+l[3]-1;for l=o+1,l do n=n+1;c[n]=e[l];end;e[o](t(c,1,l-o));a=o;end;elseif n<=34 then if n<=31 then if n>30 then i[c[l[3]]]=e[l[2]];else local o=l[2];local c=o+l[3]-2;local n={};local l=0;for o=o,c do l=l+1;n[l]=e[o];end;do return t(n,1,l)end;end;elseif n<=32 then if e[l[2]]then o=o+1;else o=o+l[3];end;elseif n==33 then e[l[2]]=A(O[l[3]],nil,i);else e[l[2]]=e[l[3]][c[l[5]]];end;elseif n<=36 then if n>35 then local o=l[2];local c,l=h(e[o]());a=o-1;l=l+o-1;local n=0;for l=o,l do n=n+1;e[l]=c[n];end;a=l;else do return end;end;elseif n<=37 then e[l[2]]=e[l[3]];elseif n>38 then if(e[l[2]]==c[l[5]])then o=o+1;else o=o+l[3];end;else local o=l[2];local c=o+l[3]-2;local n={};local l=0;for o=o,c do l=l+1;n[l]=e[o];end;do return t(n,1,l)end;end;o=o+1;end;end;end;return A(B(),{},E())();
local assign = import("../assign") local RenderSettings = import("./settings/RenderSettings") local Settings = {} setmetatable(Settings, { __tostring = function() return "Settings" end, }) local prototype = {} function prototype:GetFFlag(name) return self.settings[name] or false end local metatable = {} metatable.type = Settings function metatable:__index(key) local internal = getmetatable(self).internal if internal[key] ~= nil then return internal[key] end if prototype[key] ~= nil then return prototype[key] end error(string.format("%s is not a valid member of Settings", tostring(key)), 2) end function Settings.new(settings) local internalInstance = { settings = settings or {}, Rendering = RenderSettings.new() } local instance = newproxy(true) assign(getmetatable(instance), metatable) getmetatable(instance).internal = internalInstance return instance end local instance = Settings.new({}) return function() return instance end
object_draft_schematic_dance_prop_prop_double_ribbon_magic_r_s04 = object_draft_schematic_dance_prop_shared_prop_double_ribbon_magic_r_s04:new { } ObjectTemplates:addTemplate(object_draft_schematic_dance_prop_prop_double_ribbon_magic_r_s04, "object/draft_schematic/dance_prop/prop_double_ribbon_magic_r_s04.iff")
local sw, sh = ScrW(), ScrH() local w, h = 400, 600 local x, y = sw/2 - w/2, sh/2 - h/2 local entSounds = { ["Exit"] = { "vo/npc/female01/answer25.wav", "vo/npc/female01/answer32.wav", "vo/npc/female01/answer34.wav", "vo/npc/female01/answer36.wav", "vo/npc/female01/answer38.wav", "vo/npc/female01/fantastic01.wav", "vo/npc/female01/fantastic02.wav" }, ["Enter"] = { "vo/npc/female01/answer30.wav", "vo/npc/female01/finally.wav", "vo/npc/female01/gordead_ques16.wav", "vo/npc/female01/readywhenyouare01.wav", "vo/npc/female01/readywhenyouare02.wav" }, ["Moan"] = { "vo/npc/female01/moan01.wav", "vo/npc/female01/moan02.wav", "vo/npc/female01/moan03.wav", "vo/npc/female01/moan04.wav" } } -- 5% chance of a moan lmao xdddd local function PlaySound(sound) local roll = math.random(1, 100) if roll < 95 then surface.PlaySound(table.Random(entSounds[sound])) else surface.PlaySound(table.Random(entSounds["Moan"])) end end net.Receive("OpenClothingShop", function() local models = characterCustomModels[LocalPlayer():GetNWString("characterFace")] PlaySound("Enter") -- TODO: Make this a DPanel instead of DFrame and make it look perty local Shop = vgui.Create("DFrame") Shop:SetSize(w, h) Shop:SetTitle("") Shop:MakePopup() Shop:Center() Shop:ShowCloseButton(false) Shop.Menubar = vgui.Create("DMenuBar", Shop) Shop.Menubar:DockMargin( -3, -6, -3, 0 ) --corrects MenuBar pos Shop.Menubar.Bodygroups = Shop.Menubar:AddMenu("Bodygroups") Shop.Menubar.Skins = Shop.Menubar:AddMenu("Skins") local function updateBodygroupMenu(ent) Shop.Menubar.Bodygroups:Clear() Shop.Menubar.Skins:Clear() for id = 0, ent:GetNumBodyGroups() - 1 do if ent:GetBodygroupCount(id) <= 1 then continue end local bg = Shop.Menubar.Bodygroups:AddSubMenu(ent:GetBodygroupName(id)) bg:SetDeleteSelf(false) for k, item in SortedPairs(ent:GetBodyGroups()[id + 1].submodels) do bg:AddOption(item, function() ent:SetBodygroup(id, k) end) end end for skin = 0, ent:SkinCount() - 1 do Shop.Menubar.Skins:AddOption(skin, function() ent:SetSkin(skin) end) end end Shop.Model = vgui.Create("DModelPanel", Shop) Shop.Model:Dock(FILL) Shop.modelIndex = 1 Shop.Model:SetModel(models[Shop.modelIndex]) updateBodygroupMenu(Shop.Model.Entity) Shop.Model:SetFOV( 45 ) Shop.Model:SetLookAt(Vector(0, 0, 38)) -- orig Vector(0, 0, 30) Shop.Model:SetCamPos(Vector(50, 0, 45)) -- orig Vector(50, 0, 25) Shop.Model:SetAnimated(true) Shop.Model.Angles = Angle(0, 0, 0) -- Hold to rotate function Shop.Model:DragMousePress() self.PressX, self.PressY = gui.MousePos() self.Pressed = true end function Shop.Model:DragMouseRelease() self.Pressed = false end function Shop.Model:LayoutEntity( ent ) if ( self.bAnimated ) then self:RunAnimation() end if ( self.Pressed ) then local mx, my = gui.MousePos() self.Angles = self.Angles - Angle( 0, ( ( self.PressX or mx ) - mx ) / 2, 0 ) self.PressX, self.PressY = gui.MousePos() end ent:SetAngles( self.Angles ) end -- TODO: Style these buttons a LOT better Shop.Next = vgui.Create("DButton", Shop) Shop.Next:Dock(RIGHT) Shop.Next:SetText(">") Shop.Next.DoClick = function(s) Shop.modelIndex = math.Clamp((Shop.modelIndex + 1) % #models, 1, #models) -- weird workaround xddd Shop.Model:SetModel(models[Shop.modelIndex]) updateBodygroupMenu(Shop.Model.Entity) end Shop.Previous = vgui.Create("DButton", Shop) Shop.Previous:Dock(LEFT) Shop.Previous:SetText("<") Shop.Previous.DoClick = function(s) Shop.modelIndex = (Shop.modelIndex - 1) % #models Shop.Model:SetModel(models[Shop.modelIndex] or models[#models]) updateBodygroupMenu(Shop.Model.Entity) end Shop.Exit = vgui.Create("DButton", Shop) Shop.Exit:SetPos(w-90,2) Shop.Exit:SetSize(80,20) Shop.Exit:SetText("Close") Shop.Exit.DoClick = function(s) Shop:Stop() Shop:MoveTo(sw,y,0.4,0,-1,function(anim,panel) panel:Remove() Shop = nil end) PlaySound("Exit") end -- TODO: Make this price change -- Should probably be serverside/shared Shop.Purchase = vgui.Create("DButton", Shop) Shop.Purchase:Dock(BOTTOM) Shop.Purchase:SetText("PURCHASE FOR " .. DarkRP.formatMoney(300)) Shop.Purchase.DoClick = function(s) local ent = Shop.Model.Entity local bodygroups = "" local skin = ent:GetSkin() for id = 0, ent:GetNumBodyGroups() - 1 do bodygroups = bodygroups .. ent:GetBodygroup(id) end if skin > 0 then bodygroups = bodygroups .. "x" .. skin end net.Start("ReceiveClothingShopPurchase") net.WriteString(ent:GetModel()) net.WriteString(bodygroups) net.SendToServer() notification.AddLegacy("You paid $300 for your new outfit!", NOTIFY_GENERIC, 4) Shop.Exit.DoClick() end Shop:Stop() Shop:SetVisible(true) Shop:MoveTo(x,y,0.4,0,-1,function(anim,panel) end) end)
local m = require 'lpeg' return m.R('\1\8', '\11\12', '\14\31') + '\127'
local settings = { header = { type = "text", oldfiles_directory = false, align = "center", fold_section = false, title = "Header", content = { " ⣀⣀⣀⣀ ", " ⣀⣤⣤⣤⡄⢀⠰⠿⣿⣿⣿⠿⠛⣂⡀⢴⣶⣦⣤⣀ ", " ⠰⠿⠿⠿⠿⠋⠴⠿⠿⠖⠂⠨⠐⠚⠿⠿⠿⠦⠙⠿⠿⠿⠷ ", " ⣀⣤⡖⣰⣶⣶⡶⠂⠔⢂⣠⣴⣶⣶⣶⣶⣶⣶⣶⣶⣤⣄⣐⠢⠐⢶⣶⣶⡐⣶⣤⣀ ", " ⣼⣿⡿⠠⠟⠛⢉⣤⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣦⡈⢙⡓⠘⢿⣿⣧⡀ ", " ⠸⢛⣉⢁⡶⢋⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡙⢧⠰⣤⣍⡃ ", " ⣠⡄⢸⣿⠏⢈⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⡀⢻⣿⡇⢸⣦ ", " ⣼⣿⡇⠸⠋⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠙⠇⢸⣿⣷ ", " ⢰⣿⡿⠃⢰⢡⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡌⠆⠘⢿⣿ ", " ⠈⢋⣴⡇ ⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⠿⣿⣿⣿⡿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⢸⣦⡉ ", " ⣴⠘⣿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⡱⡈⣦⡡⣢⣍⢶⣩⢔⣬⢱⡎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠘⡿⢠⣦ ", "⢸⣿⣧⠹ ⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⣣⢱⡟⣼⣿⡇⣿⢣⣿⡿⣸⡇⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢠⠁⣿⣿⡇ ", "⢸⣿⣿⢀⠁⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⣾⢣⣿⣿⢱⡏⣾⣿⢇⡿⣸⢫⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇ ⣄⢻⣿⡇ ", " ⠻⠇⣼⡆⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢱⡟⣼⣿⡏⣾⢱⣿⣿⠸⣇⡣⢣⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢰⣿⡆⠟⠁ ", " ⣈⠻⡇⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⣷⣶⣿⣿⣿⣷⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠁⢸⡿⢋⡀ ", " ⣿⣷⡄⠰⡘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⡆⢈⣴⣿⡇ ", " ⢻⣿⡇⢰⣄⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⢈⡄⢸⣿⡿ ", " ⠻⡇⢸⣿⣧⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⢰⣿⡇⠸⠋ ", " ⢈⣙⠛⠆⢳⣌⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢋⠴⠁⣋⣥⡄ ", " ⢻⣿⣷⡄⢨⣁⡈⠻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⢋⣠⣴⠆⣾⣿⡿⠁ ", " ⠉⠻⠿⠌⠿⠿⠷ ⠢⠍⠙⠛⠿⠿⠿⠿⠿⠿⠿⠿⠟⠛⠩⠴⠂⠴⠿⠿⠏⠸⠟⠋ ", " ⢶⣶⣶⣶⣄⠲⣶⣶⣶⡤ ⠒⠠⢤⣶⣶⡶⢂⣴⣶⣶⣶⠖ ", " ⠉⠛⠿⠿⠗⠈⠉⣥⣶⣿⣿⣿⣶⠤⠉⠐⠛⠛⠛⠋⠁ ", " ⠉⠉⠉⠉⠁ ", }, highlight = "Function", default_color = "", oldfiles_amount = 0, }, body = { type = "mapping", oldfiles_directory = false, align = "center", fold_section = false, title = "Basic Commands", margin = 5, content = { { "λ LOC f", "Telescope find_files", "f" }, { "Ƒ LOC rf", "Telescope oldfiles", "rf" }, { "Σ COL", "Telescope colorscheme", "co" }, { "δ FSB", "Telescope file_browser", "bf" }, { " NF", "lua require'startup'.new_file()", "nf" }, }, highlight = "Function", default_color = "", oldfiles_amount = 0, }, footer = { type = "text", oldfiles_directory = false, align = "center", fold_section = false, title = "Footer", margin = 5, content = { "mattglei.ch" }, highlight = "Number", default_color = "", oldfiles_amount = 0, }, options = { mapping_keys = true, cursor_column = 0.5, empty_lines_between_mappings = true, disable_statuslines = true, paddings = { 1, 3, 3, 0 }, }, mappings = { execute_command = "<CR>", open_file = "o", open_file_split = "<c-o>", open_section = "<TAB>", open_help = "?", }, colors = { background = "#1f2227", folded_section = "#56b6c2", }, parts = { "header", "body", "footer" }, } return settings
--Check for diabling global if gDisableUWEBalance then return end GBM_version = 201806151 --year month day versionofday if AddModPanel then local panel = PrecacheAsset("materials/ghoulsbalancemod/panel.material") AddModPanel(panel, "https://ghoulofgsg9.github.io/Ghouls-Balance-Mod/") end
require('lovestates') require('startstate') require('gamestate') require('gameoverstate') states = { start_state = build_start_state(), game_state = build_game_state(), gameover_state = build_gameover_state() } -- LOVE 2D WRAPPERS function love.load() love.window.setTitle( 'K-Type - Defender of the Sky!' ) w, h, flags = love.window.getMode( ) switch_state( 'start_state' ) font = love.graphics.newFont( '1942.ttf', 40 ) love.graphics.setFont( font ) -- debugtxt = 'hello' soundtrack = love.audio.newSource("music.mod") -- soundtrack:setVolume(0.9) -- soundtrack:setPitch(0.5) soundtrack:play() soundtrack:setLooping( true ) end function love.update( dt ) state.update( dt ) end function love.draw() if debugtxt then local posy = SCREEN_HEIGHT-40 love.graphics.setColor(0, 0, 0, 255) love.graphics.print(debugtxt, 0, posy, 0, 0.5, 0.5) love.graphics.print('FPS:' .. love.timer.getFPS(), SCREEN_WIDTH-150, posy, 0, 0.5, 0.5) end state.draw() end function love.keypressed( key ) state.keypressed( key ) -- debugtxt = 'Key string: ' .. key end function love.keyreleased( key ) state.keyreleased( key ) -- debugtxt = 'Key string: ' .. key end
-- ui.lua (currently includes Button class with labels, font selection and optional event model) -- Version 1.5 (works with multitouch, adds setText() method to buttons) -- -- Copyright (C) 2010 ANSCA Inc. All Rights Reserved. -- -- Permission is hereby granted, free of charge, to any person obtaining a copy of -- this software and associated documentation files (the "Software"), to deal in the -- Software without restriction, including without limitation the rights to use, copy, -- modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, -- and to permit persons to whom the Software is furnished to do so, subject to the -- following conditions: -- -- The above copyright notice and this permission notice shall be included in all copies -- or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. module(..., package.seeall) ----------------- -- Helper function for newButton utility function below local function newButtonHandler( self, event ) local result = true local default = self[1] local over = self[2] -- General "onEvent" function overrides onPress and onRelease, if present local onEvent = self._onEvent local onPress = self._onPress local onRelease = self._onRelease local onCancelled = self._onCancelled local buttonEvent = {} if (self._id) then buttonEvent.id = self._id end local phase = event.phase if "began" == phase then if over then default.isVisible = false over.isVisible = true end if onEvent then buttonEvent.phase = "press" result = onEvent( buttonEvent ) elseif onPress then result = onPress( event ) end -- Subsequent touch events will target button even if they are outside the contentBounds of button display.getCurrentStage():setFocus( self, event.id ) self.isFocus = true elseif self.isFocus then local bounds = self.contentBounds local x,y = event.x,event.y local isWithinBounds = bounds.xMin <= x and bounds.xMax >= x and bounds.yMin <= y and bounds.yMax >= y if "moved" == phase then if over then -- The rollover image should only be visible while the finger is within button's contentBounds default.isVisible = not isWithinBounds over.isVisible = isWithinBounds end elseif "ended" == phase or "cancelled" == phase then if over then default.isVisible = true over.isVisible = false end if "ended" == phase and isWithinBounds then -- Only consider this a "click" if the user lifts their finger inside button's contentBounds if onEvent then buttonEvent.phase = "release" result = onEvent( buttonEvent ) elseif onRelease then result = onRelease( event ) end else if onEvent then buttonEvent.phase = "cancelled" result = onEvent ( buttonEvent ) elseif onCancelled then result = onCancelled( event ) end end -- Allow touch events to be sent normally to the objects they "hit" display.getCurrentStage():setFocus( self, nil ) self.isFocus = false end end return result end --------------- -- Button class function newButton( params ) local button, default, over, size, font, textColor, offset if params.default then button = display.newGroup() default = display.newImage( params.default ) button:insert( default, true ) end if params.over then over = display.newImage( params.over ) over.isVisible = false button:insert( over, true ) end -- Public methods function button:setText( newText ) local labelText = self.text if ( labelText ) then labelText:removeSelf() self.text = nil end local labelShadow = self.shadow if ( labelShadow ) then labelShadow:removeSelf() self.shadow = nil end local labelHighlight = self.highlight if ( labelHighlight ) then labelHighlight:removeSelf() self.highlight = nil end if ( params.size and type(params.size) == "number" ) then size=params.size else size=20 end if ( params.font ) then font=params.font else font=native.systemFontBold end if ( params.textColor ) then textColor=params.textColor else textColor={ 255, 255, 255, 255 } end -- Optional vertical correction for fonts with unusual baselines (I'm looking at you, Zapfino) if ( params.offset and type(params.offset) == "number" ) then offset=params.offset else offset = 0 end if ( params.emboss ) then -- Make the label text look "embossed" (also adjusts effect for textColor brightness) local textBrightness = ( textColor[1] + textColor[2] + textColor[3] ) / 3 labelHighlight = display.newText( newText, 0, 0, font, size ) if ( textBrightness > 127) then labelHighlight:setTextColor( 255, 255, 255, 20 ) else labelHighlight:setTextColor( 255, 255, 255, 140 ) end button:insert( labelHighlight, true ) labelHighlight.x = labelHighlight.x + 1.5; labelHighlight.y = labelHighlight.y + 1.5 + offset self.highlight = labelHighlight labelShadow = display.newText( newText, 0, 0, font, size ) if ( textBrightness > 127) then labelShadow:setTextColor( 0, 0, 0, 128 ) else labelShadow:setTextColor( 0, 0, 0, 20 ) end button:insert( labelShadow, true ) labelShadow.x = labelShadow.x - 1; labelShadow.y = labelShadow.y - 1 + offset self.shadow = labelShadow end labelText = display.newText( newText, 0, 0, font, size ) labelText:setTextColor( textColor[1], textColor[2], textColor[3], textColor[4] ) button:insert( labelText, true ) labelText.y = labelText.y + offset self.text = labelText end if params.text then button:setText( params.text ) end if ( params.onPress and ( type(params.onPress) == "function" ) ) then button._onPress = params.onPress end if ( params.onRelease and ( type(params.onRelease) == "function" ) ) then button._onRelease = params.onRelease end if ( params.onCancelled and ( type(params.onCancelled) == "function" ) ) then button._onCancelled = params.onCancelled end if (params.onEvent and ( type(params.onEvent) == "function" ) ) then button._onEvent = params.onEvent end -- Set button as a table listener by setting a table method and adding the button as its own table listener for "touch" events button.touch = newButtonHandler button:addEventListener( "touch", button ) if params.x then button.x = params.x end if params.y then button.y = params.y end if params.id then button._id = params.id end return button end -------------- -- Label class function newLabel( params ) local labelText local size, font, textColor, align local t = display.newGroup() if ( params.bounds ) then local bounds = params.bounds local left = bounds[1] local top = bounds[2] local width = bounds[3] local height = bounds[4] if ( params.size and type(params.size) == "number" ) then size=params.size else size=20 end if ( params.font ) then font=params.font else font=native.systemFontBold end if ( params.textColor ) then textColor=params.textColor else textColor={ 255, 255, 255, 255 } end if ( params.offset and type(params.offset) == "number" ) then offset=params.offset else offset = 0 end if ( params.align ) then align = params.align else align = "center" end if ( params.text ) then labelText = display.newText( params.text, 0, 0, font, size ) labelText:setTextColor( textColor[1], textColor[2], textColor[3], textColor[4] ) t:insert( labelText ) -- TODO: handle no-initial-text case by creating a field with an empty string? if ( align == "left" ) then labelText.x = left + labelText.contentWidth * 0.5 elseif ( align == "right" ) then labelText.x = (left + width) - labelText.contentWidth * 0.5 else labelText.x = ((2 * left) + width) * 0.5 end end labelText.y = top + labelText.contentHeight * 0.5 -- Public methods function t:setText( newText ) if ( newText ) then labelText.text = newText if ( "left" == align ) then labelText.x = left + labelText.contentWidth / 2 elseif ( "right" == align ) then labelText.x = (left + width) - labelText.contentWidth / 2 else labelText.x = ((2 * left) + width) / 2 end end end function t:setTextColor( r, g, b, a ) local newR = 255 local newG = 255 local newB = 255 local newA = 255 if ( r and type(r) == "number" ) then newR = r end if ( g and type(g) == "number" ) then newG = g end if ( b and type(b) == "number" ) then newB = b end if ( a and type(a) == "number" ) then newA = a end labelText:setTextColor( r, g, b, a ) end end -- Return instance (as display group) return t end
local mod = ... local str = mod.require('mod/utils/str') local Quality = mod.require('mod/enums/Quality') local SimpleDb = mod.require('mod/helpers/SimpleDb') local TweakDb = {} TweakDb.__index = TweakDb setmetatable(TweakDb, { __index = SimpleDb }) local searchSchema = { { field = 'name', weight = 1 }, { field = 'tag', weight = 2 }, { field = 'set', weight = 2 }, { field = 'kind', weight = 2 }, { field = 'type', weight = 3 }, } local kindOrders = { ['Weapon'] = 1, ['Clothing'] = 2, ['Cyberware'] = 3, ['Mod'] = 11, ['Grenade'] = 21, ['Consumable'] = 22, ['Progression'] = 23, ['Quickhack'] = 31, ['Junk'] = 71, ['Recipe'] = 81, ['Component'] = 82, ['Misc'] = 91, ['Shard'] = 92, } local groupOrders = { ['Head'] = 11, ['Face'] = 12, ['Outer Torso'] = 13, ['Inner Torso'] = 14, ['Legs'] = 15, ['Feet'] = 16, ['Special'] = 17, } local itemModPrefixes = { ['Clo_Face'] = 'FaceFabricEnhancer', ['Clo_Feet'] = 'FootFabricEnhancer', ['Clo_Head'] = 'HeadFabricEnhancer', ['Clo_InnerChest'] = 'InnerChestFabricEnhancer', ['Clo_Legs'] = 'LegsFabricEnhancer', ['Clo_OuterChest'] = 'OuterChestFabricEnhancer', --['Cyb_Ability'] = 'ModPrefix', ['Cyb_Launcher'] = 'ProjectileLauncher', ['Cyb_MantisBlades'] = 'MantisBlades', ['Cyb_NanoWires'] = 'NanoWires', ['Cyb_StrongArms'] = 'StrongArms', --['Fla_Launcher'] = 'ModPrefix', --['Fla_Rifle'] = 'ModPrefix', --['Fla_Shock'] = 'ModPrefix', --['Fla_Support'] = 'ModPrefix', ['Wea_AssaultRifle'] = 'GenericWeaponMod', ['Wea_Fists'] = 'GenericWeaponMod', ['Wea_Hammer'] = 'GenericWeaponMod', ['Wea_Handgun'] = 'GenericWeaponMod', ['Wea_HeavyMachineGun'] = 'GenericWeaponMod', ['Wea_Katana'] = 'GenericWeaponMod', ['Wea_Knife'] = 'GenericWeaponMod', ['Wea_LightMachineGun'] = 'GenericWeaponMod', ['Wea_LongBlade'] = 'GenericWeaponMod', ['Wea_Melee'] = 'GenericWeaponMod', ['Wea_OneHandedClub'] = 'GenericWeaponMod', ['Wea_PrecisionRifle'] = 'GenericWeaponMod', ['Wea_Revolver'] = 'GenericWeaponMod', ['Wea_Rifle'] = 'GenericWeaponMod', ['Wea_ShortBlade'] = 'GenericWeaponMod', ['Wea_Shotgun'] = 'GenericWeaponMod', ['Wea_ShotgunDual'] = 'GenericWeaponMod', ['Wea_SniperRifle'] = 'GenericWeaponMod', ['Wea_SubmachineGun'] = 'GenericWeaponMod', ['Wea_TwoHandedClub'] = 'GenericWeaponMod', } function TweakDb:load(path) if not path or path == true then path = 'mod/data/tweakdb-meta' end SimpleDb.load(self, path) end function TweakDb:resolve(tweakId) return self:get(TweakDb.toKey(tweakId)) end function TweakDb:resolvable(tweakId) return self:has(TweakDb.toKey(tweakId)) end function TweakDb:search(term) return SimpleDb.search(self, term, searchSchema) end function TweakDb:complete(itemMeta) if itemMeta and itemMeta.ref and itemMeta.ref ~= true then local refMeta = self:get(itemMeta.ref) for prop, value in pairs(refMeta) do if itemMeta[prop] == nil then itemMeta[prop] = value end end itemMeta.ref = true end return itemMeta end function TweakDb:isTaggedAsSet(itemMeta) return itemMeta.set and itemMeta.kind ~= 'Pack' and itemMeta.set:find(' Set$') end function TweakDb:describe(itemMeta, extended, sets, ellipsis) local comment = '' if itemMeta.name then comment = itemMeta.name end if sets and self:isTaggedAsSet(itemMeta) then comment = string.upper(itemMeta.set) .. ': ' .. comment end if ellipsis then comment = str.ellipsis(comment, ellipsis) end if extended then comment = comment .. ' / ' .. itemMeta.kind if itemMeta.kind ~= 'Pack' then if itemMeta.group then comment = comment .. ' / ' .. itemMeta.group end if itemMeta.kind == 'Weapon' or (itemMeta.kind == 'Mod' and itemMeta.group == 'Cyberware') then comment = comment .. ' / ' .. itemMeta.group2 end end end if itemMeta.quality then comment = comment .. ' / ' .. itemMeta.quality elseif itemMeta.kind == 'Pack' and itemMeta.max then comment = comment .. ' / ' .. itemMeta.max end return comment end function TweakDb:order(itemMeta, orderKind, orderPrefix) local order = '' if orderPrefix then order = orderPrefix .. '|' end if orderKind then order = order .. ('%02d'):format(kindOrders[itemMeta.kind] or 99) .. '|' end if itemMeta.kind == 'Mod' then order = order .. itemMeta.group .. '|' if itemMeta.group == 'Cyberware' then order = order .. itemMeta.group2 .. '|' end elseif itemMeta.kind == 'Pack' then if itemMeta.pack == 'Clothing' and itemMeta.set == false and itemMeta.tag == false then order = order .. 'Z' .. ('%02d'):format(groupOrders[itemMeta.group] or 99) end elseif self:isTaggedAsSet(itemMeta) then order = order .. itemMeta.set .. '|' end if itemMeta.name then order = order .. itemMeta.name elseif itemMeta.id then order = order .. TweakDb.toItemAlias(itemMeta.id) end if itemMeta.quality then order = order .. '|' .. Quality.toValue(itemMeta.quality) --order = order .. '|' .. (Quality.maxValue() - Quality.toValue(itemMeta.quality)) elseif itemMeta.kind == 'Pack' and itemMeta.max then order = order .. '|' .. Quality.toValue(itemMeta.max) else order = order .. '|0' end if itemMeta.name and itemMeta.id then order = order .. '|' .. TweakDb.toItemAlias(itemMeta.id) end return string.upper(order) end function TweakDb:orderLast() return '99' end function TweakDb:sort(items) SimpleDb.sort(self, items, '_order') end function TweakDb.toKey(data) if type(data) == 'number' then return data end if type(data) == 'string' then data = TweakDb.toTweakId(data) end if type(data) == 'userdata' then data = TweakDb.extract(data) end if type(data) == 'table' then return data.length * 0x100000000 + data.hash --return (data.length << 32 | data.hash) end return 0 end function TweakDb.isRealKey(key) return key <= 0xFFFFFFFFFF end function TweakDb.toStruct(data) if type(data) == 'table' then return data end if type(data) == 'number' then -- { hash = data & 0xFFFFFFFF, length = data >> 32 } local length = math.floor(data / 0x100000000) local hash = data - (length * 0x100000000) return { hash = hash, length = length } end if type(data) == 'string' then data = TweakDb.toTweakId(data) end if type(data) == 'userdata' then return TweakDb.extract(data) end return nil end function TweakDb.toType(tweakId, prefix) if type(tweakId) == 'string' then return str.with(tweakId, prefix) end return '' end function TweakDb.toAlias(tweakId--[[, prefix]]) return tweakId --if type(tweakId) == 'string' then -- return str.without(tweakId, prefix) --end -- --return '' end function TweakDb.toTweakId(tweakId, prefix) if type(tweakId) == 'number' then tweakId = TweakDb.toStruct(tweakId) end if type(tweakId) == 'table' then return TweakDBID.new(tweakId.hash, tweakId.length) end if type(tweakId) == 'string' then local hashHex, lenHex = tweakId:match('^<TDBID:([0-9A-Z]+):([0-9A-Z]+)>$') if hashHex and lenHex then return TweakDBID.new(tonumber(hashHex, 16), tonumber(lenHex, 16)) elseif tweakId:find('%.') then return TweakDBID.new(tweakId) else return TweakDBID.new(str.with(tweakId, prefix)) end end if type(tweakId) == 'userdata' then return tweakId end end function TweakDb.toItemId(tweakId, seed) if type(tweakId) == 'string' then tweakId = TweakDb.toItemTweakId(tweakId) end if seed then return ItemID.new(tweakId, seed) elseif seed == false then return ItemID.new(tweakId) else return GetSingleton('gameItemID'):FromTDBID(tweakId) end end function TweakDb.toItemTweakId(tweakId) return TweakDb.toTweakId(tweakId, 'Items.') end function TweakDb.toItemType(alias) return TweakDb.toType(alias, 'Items.') end function TweakDb.toItemAlias(type) return TweakDb.toAlias(type, 'Items.') end function TweakDb.toVehicleTweakId(tweakId) return TweakDb.toTweakId(tweakId, 'Vehicle.') end function TweakDb.toVehicleType(alias) return TweakDb.toType(alias, 'Vehicle.') end function TweakDb.toVehicleAlias(type) return TweakDb.toAlias(type, 'Vehicle.') end function TweakDb:toSlotTweakId(slotAlias, itemMeta) if slotAlias == 'Muzzle' then slotAlias = 'PowerModule' end local slotName = str.with(slotAlias, 'AttachmentSlots.') local tweakId = TweakDBID.new(slotName) --if not TDB.GetAttachmentSlotRecord(tweakId) if not self:resolvable(tweakId) then local slotPrefix if type(itemMeta) == 'table' and itemMeta.mod then if slotAlias == 'Mod' and itemMeta.kind == 'Cyberware' and itemMeta.group == 'Arms' then slotName = 'AttachmentSlots.ArmsCyberwareGeneralSlot' else slotPrefix = itemMeta.mod end elseif type(itemMeta) == 'string' then slotPrefix = itemModPrefixes[itemMeta] end if slotPrefix then local slotMeta = self:find({ kind = 'Slot', name = slotAlias:upper(), mod = slotPrefix }) if slotMeta then slotName = slotMeta.id else local index = string.match(slotAlias, '%d$') if index ~= nil then slotName = 'AttachmentSlots.' .. slotPrefix .. index else if slotPrefix == 'GenericWeaponMod' and Quality.toValue(slotAlias) then slotName = 'AttachmentSlots.PowerWeaponMod' .. slotAlias else slotName = 'AttachmentSlots.' .. slotPrefix .. slotAlias end end end end tweakId = TweakDBID.new(slotName) end return tweakId end function TweakDb.toSlotType(alias) return TweakDb.toType(alias, 'AttachmentSlots.') end function TweakDb.localize(tweakId) tweakId = TweakDb.toTweakId(tweakId) return { name = Game.GetLocalizedTextByKey(Game['TDB::GetLocKey;TweakDBID'](TweakDBID.new(tweakId, '.displayName'))), comment = Game.GetLocalizedTextByKey(Game['TDB::GetLocKey;TweakDBID'](TweakDBID.new(tweakId, '.localizedDescription'))), } end function TweakDb.extract(data) if data.hash then return { hash = data.hash, length = data.length } end if data.id then return { id = { data.id.hash, length = data.id.length }, rng_seed = data.rng_seed } end return data end return TweakDb
-- SPDX-License-Identifier: MIT -- Copyright (c) 2019 oO (https://github.com/oocytanb) ---@type cytanb @See `cytanb_annotations.lua` local cytanb = require('cytanb')(_ENV) local vciLoaded = false local UpdateCw; UpdateCw = cytanb.CreateUpdateRoutine( function (deltaTime, unscaledDeltaTime) if deltaTime <= TimeSpan.Zero then return end end, function () cytanb.LogTrace('OnLoad') vciLoaded = true --vci.assets.SetMaterialColorFromName('field-mat', Color.red) local field = vci.assets.GetSubItem('pin-field-base') print(tostring(field.GetPosition())) end, function (reason) cytanb.LogError('Error on update routine: ', reason) UpdateCw = function () end end ) updateAll = function () UpdateCw() end onGrab = function (target) if not vciLoaded then return end end onUngrab = function (target) if not vciLoaded then return end end onUse = function (use) if not vciLoaded then return end end
-- $Id: testes/files.lua $ -- See Copyright Notice in file all.lua local debug = require "debug" local maxint = math.maxinteger assert(type(os.getenv"PATH") == "string") assert(io.input(io.stdin) == io.stdin) assert(not pcall(io.input, "non-existent-file")) assert(io.output(io.stdout) == io.stdout) local function testerr (msg, f, ...) local stat, err = pcall(f, ...) return (not stat and string.find(err, msg, 1, true)) end local function checkerr (msg, f, ...) assert(testerr(msg, f, ...)) end -- cannot close standard files assert(not io.close(io.stdin) and not io.stdout:close() and not io.stderr:close()) -- cannot call close method without an argument (new in 5.3.5) checkerr("got no value", io.stdin.close) assert(type(io.input()) == "userdata" and io.type(io.output()) == "file") assert(type(io.stdin) == "userdata" and io.type(io.stderr) == "file") assert(not io.type(8)) local a = {}; setmetatable(a, {}) assert(not io.type(a)) assert(getmetatable(io.input()).__name == "FILE*") local a,b,c = io.open('xuxu_nao_existe') assert(not a and type(b) == "string" and type(c) == "number") a,b,c = io.open('/a/b/c/d', 'w') assert(not a and type(b) == "string" and type(c) == "number") local file = os.tmpname() local f, msg = io.open(file, "w") if not f then (Message or print)("'os.tmpname' file cannot be open; skipping file tests") else --{ most tests here need tmpname f:close() print('testing i/o') local otherfile = os.tmpname() checkerr("invalid mode", io.open, file, "rw") checkerr("invalid mode", io.open, file, "rb+") checkerr("invalid mode", io.open, file, "r+bk") checkerr("invalid mode", io.open, file, "") checkerr("invalid mode", io.open, file, "+") checkerr("invalid mode", io.open, file, "b") assert(io.open(file, "r+b")):close() assert(io.open(file, "r+")):close() assert(io.open(file, "rb")):close() assert(os.setlocale('C', 'all')) io.input(io.stdin); io.output(io.stdout); os.remove(file) assert(not loadfile(file)) checkerr("", dofile, file) assert(not io.open(file)) io.output(file) assert(io.output() ~= io.stdout) if not _port then -- invalid seek local status, msg, code = io.stdin:seek("set", 1000) assert(not status and type(msg) == "string" and type(code) == "number") end assert(io.output():seek() == 0) assert(io.write("alo alo"):seek() == string.len("alo alo")) assert(io.output():seek("cur", -3) == string.len("alo alo")-3) assert(io.write("joao")) assert(io.output():seek("end") == string.len("alo joao")) assert(io.output():seek("set") == 0) assert(io.write('"álo"', "{a}\n", "second line\n", "third line \n")) assert(io.write('çfourth_line')) io.output(io.stdout) collectgarbage() -- file should be closed by GC assert(io.input() == io.stdin and rawequal(io.output(), io.stdout)) print('+') -- test GC for files collectgarbage() for i=1,120 do for i=1,5 do io.input(file) assert(io.open(file, 'r')) io.lines(file) end collectgarbage() end io.input():close() io.close() assert(os.rename(file, otherfile)) assert(not os.rename(file, otherfile)) io.output(io.open(otherfile, "ab")) assert(io.write("\n\n\t\t ", 3450, "\n")); io.close() do -- closing file by scope local F = nil do local f <close> = assert(io.open(file, "w")) F = f end assert(tostring(F) == "file (closed)") end assert(os.remove(file)) do -- test writing/reading numbers local f <close> = assert(io.open(file, "w")) f:write(maxint, '\n') f:write(string.format("0X%x\n", maxint)) f:write("0xABCp-3", '\n') f:write(0, '\n') f:write(-maxint, '\n') f:write(string.format("0x%X\n", -maxint)) f:write("-0xABCp-3", '\n') assert(f:close()) local f <close> = assert(io.open(file, "r")) assert(f:read("n") == maxint) assert(f:read("n") == maxint) assert(f:read("n") == 0xABCp-3) assert(f:read("n") == 0) assert(f:read("*n") == -maxint) -- test old format (with '*') assert(f:read("n") == -maxint) assert(f:read("*n") == -0xABCp-3) -- test old format (with '*') end assert(os.remove(file)) -- testing multiple arguments to io.read do local f <close> = assert(io.open(file, "w")) f:write[[ a line another line 1234 3.45 one two three ]] local l1, l2, l3, l4, n1, n2, c, dummy assert(f:close()) local f <close> = assert(io.open(file, "r")) l1, l2, n1, n2, dummy = f:read("l", "L", "n", "n") assert(l1 == "a line" and l2 == "another line\n" and n1 == 1234 and n2 == 3.45 and dummy == nil) assert(f:close()) local f <close> = assert(io.open(file, "r")) l1, l2, n1, n2, c, l3, l4, dummy = f:read(7, "l", "n", "n", 1, "l", "l") assert(l1 == "a line\n" and l2 == "another line" and c == '\n' and n1 == 1234 and n2 == 3.45 and l3 == "one" and l4 == "two" and dummy == nil) assert(f:close()) local f <close> = assert(io.open(file, "r")) -- second item failing l1, n1, n2, dummy = f:read("l", "n", "n", "l") assert(l1 == "a line" and not n1) end assert(os.remove(file)) -- test yielding during 'dofile' f = assert(io.open(file, "w")) f:write[[ local x, z = coroutine.yield(10) local y = coroutine.yield(20) return x + y * z ]] assert(f:close()) f = coroutine.wrap(dofile) assert(f(file) == 10) assert(f(100, 101) == 20) assert(f(200) == 100 + 200 * 101) assert(os.remove(file)) f = assert(io.open(file, "w")) -- test number termination f:write[[ -12.3- -0xffff+ .3|5.E-3X +234e+13E 0xDEADBEEFDEADBEEFx 0x1.13Ap+3e ]] -- very long number f:write("1234"); for i = 1, 1000 do f:write("0") end; f:write("\n") -- invalid sequences (must read and discard valid prefixes) f:write[[ .e+ 0.e; --; 0xX; ]] assert(f:close()) f = assert(io.open(file, "r")) assert(f:read("n") == -12.3); assert(f:read(1) == "-") assert(f:read("n") == -0xffff); assert(f:read(2) == "+ ") assert(f:read("n") == 0.3); assert(f:read(1) == "|") assert(f:read("n") == 5e-3); assert(f:read(1) == "X") assert(f:read("n") == 234e13); assert(f:read(1) == "E") assert(f:read("n") == 0Xdeadbeefdeadbeef); assert(f:read(2) == "x\n") assert(f:read("n") == 0x1.13aP3); assert(f:read(1) == "e") do -- attempt to read too long number assert(not f:read("n")) -- fails local s = f:read("L") -- read rest of line assert(string.find(s, "^00*\n$")) -- lots of 0's left end assert(not f:read("n")); assert(f:read(2) == "e+") assert(not f:read("n")); assert(f:read(1) == ";") assert(not f:read("n")); assert(f:read(2) == "-;") assert(not f:read("n")); assert(f:read(1) == "X") assert(not f:read("n")); assert(f:read(1) == ";") assert(not f:read("n")); assert(not f:read(0)) -- end of file assert(f:close()) assert(os.remove(file)) -- test line generators assert(not pcall(io.lines, "non-existent-file")) assert(os.rename(otherfile, file)) io.output(otherfile) local n = 0 local f = io.lines(file) while f() do n = n + 1 end; assert(n == 6) -- number of lines in the file checkerr("file is already closed", f) checkerr("file is already closed", f) -- copy from file to otherfile n = 0 for l in io.lines(file) do io.write(l, "\n"); n = n + 1 end io.close() assert(n == 6) -- copy from otherfile back to file local f = assert(io.open(otherfile)) assert(io.type(f) == "file") io.output(file) assert(not io.output():read()) n = 0 for l in f:lines() do io.write(l, "\n"); n = n + 1 end assert(tostring(f):sub(1, 5) == "file ") assert(f:close()); io.close() assert(n == 6) checkerr("closed file", io.close, f) assert(tostring(f) == "file (closed)") assert(io.type(f) == "closed file") io.input(file) f = io.open(otherfile):lines() n = 0 for l in io.lines() do assert(l == f()); n = n + 1 end f = nil; collectgarbage() assert(n == 6) assert(os.remove(otherfile)) do -- bug in 5.3.1 io.output(otherfile) io.write(string.rep("a", 300), "\n") io.close() local t ={}; for i = 1, 250 do t[i] = 1 end t = {io.lines(otherfile, table.unpack(t))()} -- everything ok here assert(#t == 250 and t[1] == 'a' and t[#t] == 'a') t[#t + 1] = 1 -- one too many checkerr("too many arguments", io.lines, otherfile, table.unpack(t)) collectgarbage() -- ensure 'otherfile' is closed assert(os.remove(otherfile)) end io.input(file) do -- test error returns local a,b,c = io.input():write("xuxu") assert(not a and type(b) == "string" and type(c) == "number") end checkerr("invalid format", io.read, "x") assert(io.read(0) == "") -- not eof assert(io.read(5, 'l') == '"álo"') assert(io.read(0) == "") assert(io.read() == "second line") local x = io.input():seek() assert(io.read() == "third line ") assert(io.input():seek("set", x)) assert(io.read('L') == "third line \n") assert(io.read(1) == "ç") assert(io.read(string.len"fourth_line") == "fourth_line") assert(io.input():seek("cur", -string.len"fourth_line")) assert(io.read() == "fourth_line") assert(io.read() == "") -- empty line assert(io.read('n') == 3450) assert(io.read(1) == '\n') assert(not io.read(0)) -- end of file assert(not io.read(1)) -- end of file assert(not io.read(30000)) -- end of file assert(({io.read(1)})[2] == undef) assert(not io.read()) -- end of file assert(({io.read()})[2] == undef) assert(not io.read('n')) -- end of file assert(({io.read('n')})[2] == undef) assert(io.read('a') == '') -- end of file (OK for 'a') assert(io.read('a') == '') -- end of file (OK for 'a') collectgarbage() print('+') io.close(io.input()) checkerr(" input file is closed", io.read) assert(os.remove(file)) local t = '0123456789' for i=1,10 do t = t..t; end assert(string.len(t) == 10*2^10) io.output(file) io.write("alo"):write("\n") io.close() checkerr(" output file is closed", io.write) local f = io.open(file, "a+b") io.output(f) collectgarbage() assert(io.write(' ' .. t .. ' ')) assert(io.write(';', 'end of file\n')) f:flush(); io.flush() f:close() print('+') io.input(file) assert(io.read() == "alo") assert(io.read(1) == ' ') assert(io.read(string.len(t)) == t) assert(io.read(1) == ' ') assert(io.read(0)) assert(io.read('a') == ';end of file\n') assert(not io.read(0)) assert(io.close(io.input())) -- test errors in read/write do local function ismsg (m) -- error message is not a code number return (type(m) == "string" and not tonumber(m)) end -- read local f = io.open(file, "w") local r, m, c = f:read() assert(not r and ismsg(m) and type(c) == "number") assert(f:close()) -- write f = io.open(file, "r") r, m, c = f:write("whatever") assert(not r and ismsg(m) and type(c) == "number") assert(f:close()) -- lines f = io.open(file, "w") r, m = pcall(f:lines()) assert(r == false and ismsg(m)) assert(f:close()) end assert(os.remove(file)) -- test for L format io.output(file); io.write"\n\nline\nother":close() io.input(file) assert(io.read"L" == "\n") assert(io.read"L" == "\n") assert(io.read"L" == "line\n") assert(io.read"L" == "other") assert(not io.read"L") io.input():close() local f = assert(io.open(file)) local s = "" for l in f:lines("L") do s = s .. l end assert(s == "\n\nline\nother") f:close() io.input(file) s = "" for l in io.lines(nil, "L") do s = s .. l end assert(s == "\n\nline\nother") io.input():close() s = "" for l in io.lines(file, "L") do s = s .. l end assert(s == "\n\nline\nother") s = "" for l in io.lines(file, "l") do s = s .. l end assert(s == "lineother") io.output(file); io.write"a = 10 + 34\na = 2*a\na = -a\n":close() local t = {} assert(load(io.lines(file, "L"), nil, nil, t))() assert(t.a == -((10 + 34) * 2)) do -- testing closing file in line iteration -- get the to-be-closed variable from a loop local function gettoclose (lv) lv = lv + 1 local stvar = 0 -- to-be-closed is 4th state variable in the loop for i = 1, 1000 do local n, v = debug.getlocal(lv, i) if n == "(for state)" then stvar = stvar + 1 if stvar == 4 then return v end end end end local f for l in io.lines(file) do f = gettoclose(1) assert(io.type(f) == "file") break end assert(io.type(f) == "closed file") f = nil local function foo (name) for l in io.lines(name) do f = gettoclose(1) assert(io.type(f) == "file") error(f) -- exit loop with an error end end local st, msg = pcall(foo, file) assert(st == false and io.type(msg) == "closed file") end -- test for multipe arguments in 'lines' io.output(file); io.write"0123456789\n":close() for a,b in io.lines(file, 1, 1) do if a == "\n" then assert(not b) else assert(tonumber(a) == tonumber(b) - 1) end end for a,b,c in io.lines(file, 1, 2, "a") do assert(a == "0" and b == "12" and c == "3456789\n") end for a,b,c in io.lines(file, "a", 0, 1) do if a == "" then break end assert(a == "0123456789\n" and not b and not c) end collectgarbage() -- to close file in previous iteration io.output(file); io.write"00\n10\n20\n30\n40\n":close() for a, b in io.lines(file, "n", "n") do if a == 40 then assert(not b) else assert(a == b - 10) end end -- test load x lines io.output(file); io.write[[ local y = X X = X * 2 + X; X = X - y; ]]:close() _G.X = 1 assert(not load((io.lines(file)))) collectgarbage() -- to close file in previous iteration load((io.lines(file, "L")))() assert(_G.X == 2) load((io.lines(file, 1)))() assert(_G.X == 4) load((io.lines(file, 3)))() assert(_G.X == 8) print('+') local x1 = "string\n\n\\com \"\"''coisas [[estranhas]] ]]'" io.output(file) assert(io.write(string.format("x2 = %q\n-- comment without ending EOS", x1))) io.close() assert(loadfile(file))() assert(x1 == x2) print('+') assert(os.remove(file)) assert(not os.remove(file)) assert(not os.remove(otherfile)) -- testing loadfile local function testloadfile (s, expres) io.output(file) if s then io.write(s) end io.close() local res = assert(loadfile(file))() assert(os.remove(file)) assert(res == expres) end -- loading empty file testloadfile(nil, nil) -- loading file with initial comment without end of line testloadfile("# a non-ending comment", nil) -- checking Unicode BOM in files testloadfile("\xEF\xBB\xBF# some comment\nreturn 234", 234) testloadfile("\xEF\xBB\xBFreturn 239", 239) testloadfile("\xEF\xBB\xBF", nil) -- empty file with a BOM -- checking line numbers in files with initial comments testloadfile("# a comment\nreturn require'debug'.getinfo(1).currentline", 2) -- loading binary file io.output(io.open(file, "wb")) assert(io.write(string.dump(function () return 10, '\0alo\255', 'hi' end))) io.close() a, b, c = assert(loadfile(file))() assert(a == 10 and b == "\0alo\255" and c == "hi") assert(os.remove(file)) -- bug in 5.2.1 do io.output(io.open(file, "wb")) -- save function with no upvalues assert(io.write(string.dump(function () return 1 end))) io.close() f = assert(loadfile(file, "b", {})) assert(type(f) == "function" and f() == 1) assert(os.remove(file)) end -- loading binary file with initial comment io.output(io.open(file, "wb")) assert(io.write("#this is a comment for a binary file\0\n", string.dump(function () return 20, '\0\0\0' end))) io.close() a, b, c = assert(loadfile(file))() assert(a == 20 and b == "\0\0\0" and c == nil) assert(os.remove(file)) -- 'loadfile' with 'env' do local f = io.open(file, 'w') f:write[[ if (...) then a = 15; return b, c, d else return _ENV end ]] f:close() local t = {b = 12, c = "xuxu", d = print} local f = assert(loadfile(file, 't', t)) local b, c, d = f(1) assert(t.a == 15 and b == 12 and c == t.c and d == print) assert(f() == t) f = assert(loadfile(file, 't', nil)) assert(f() == nil) f = assert(loadfile(file)) assert(f() == _G) assert(os.remove(file)) end -- 'loadfile' x modes do io.open(file, 'w'):write("return 10"):close() local s, m = loadfile(file, 'b') assert(not s and string.find(m, "a text chunk")) io.open(file, 'w'):write("\27 return 10"):close() local s, m = loadfile(file, 't') assert(not s and string.find(m, "a binary chunk")) assert(os.remove(file)) end io.output(file) assert(io.write("qualquer coisa\n")) assert(io.write("mais qualquer coisa")) io.close() assert(io.output(assert(io.open(otherfile, 'wb'))) :write("outra coisa\0\1\3\0\0\0\0\255\0") :close()) local filehandle = assert(io.open(file, 'r+')) local otherfilehandle = assert(io.open(otherfile, 'rb')) assert(filehandle ~= otherfilehandle) assert(type(filehandle) == "userdata") assert(filehandle:read('l') == "qualquer coisa") io.input(otherfilehandle) assert(io.read(string.len"outra coisa") == "outra coisa") assert(filehandle:read('l') == "mais qualquer coisa") filehandle:close(); assert(type(filehandle) == "userdata") io.input(otherfilehandle) assert(io.read(4) == "\0\1\3\0") assert(io.read(3) == "\0\0\0") assert(io.read(0) == "") -- 255 is not eof assert(io.read(1) == "\255") assert(io.read('a') == "\0") assert(not io.read(0)) assert(otherfilehandle == io.input()) otherfilehandle:close() assert(os.remove(file)) assert(os.remove(otherfile)) collectgarbage() io.output(file) :write[[ 123.4 -56e-2 not a number second line third line and the rest of the file ]] :close() io.input(file) local _,a,b,c,d,e,h,__ = io.read(1, 'n', 'n', 'l', 'l', 'l', 'a', 10) assert(io.close(io.input())) assert(_ == ' ' and not __) assert(type(a) == 'number' and a==123.4 and b==-56e-2) assert(d=='second line' and e=='third line') assert(h==[[ and the rest of the file ]]) assert(os.remove(file)) collectgarbage() -- testing buffers do local f = assert(io.open(file, "w")) local fr = assert(io.open(file, "r")) assert(f:setvbuf("full", 2000)) f:write("x") assert(fr:read("all") == "") -- full buffer; output not written yet f:close() fr:seek("set") assert(fr:read("all") == "x") -- `close' flushes it f = assert(io.open(file), "w") assert(f:setvbuf("no")) f:write("x") fr:seek("set") assert(fr:read("all") == "x") -- no buffer; output is ready f:close() f = assert(io.open(file, "a")) assert(f:setvbuf("line")) f:write("x") fr:seek("set", 1) assert(fr:read("all") == "") -- line buffer; no output without `\n' f:write("a\n"):seek("set", 1) assert(fr:read("all") == "xa\n") -- now we have a whole line f:close(); fr:close() assert(os.remove(file)) end if not _soft then print("testing large files (> BUFSIZ)") io.output(file) for i=1,5001 do io.write('0123456789123') end io.write('\n12346'):close() io.input(file) local x = io.read('a') io.input():seek('set', 0) local y = io.read(30001)..io.read(1005)..io.read(0).. io.read(1)..io.read(100003) assert(x == y and string.len(x) == 5001*13 + 6) io.input():seek('set', 0) y = io.read() -- huge line assert(x == y..'\n'..io.read()) assert(not io.read()) io.close(io.input()) assert(os.remove(file)) x = nil; y = nil end if not _port then local progname do -- get name of running executable local arg = arg or ARG local i = 0 while arg[i] do i = i - 1 end progname = '"' .. arg[i + 1] .. '"' end print("testing popen/pclose and execute") -- invalid mode for popen checkerr("invalid mode", io.popen, "cat", "") checkerr("invalid mode", io.popen, "cat", "r+") checkerr("invalid mode", io.popen, "cat", "rw") do -- basic tests for popen local file = os.tmpname() local f = assert(io.popen("cat - > " .. file, "w")) f:write("a line") assert(f:close()) local f = assert(io.popen("cat - < " .. file, "r")) assert(f:read("a") == "a line") assert(f:close()) assert(os.remove(file)) end local tests = { -- command, what, code {"ls > /dev/null", "ok"}, {"not-to-be-found-command", "exit"}, {"exit 3", "exit", 3}, {"exit 129", "exit", 129}, {"kill -s HUP $$", "signal", 1}, {"kill -s KILL $$", "signal", 9}, {"sh -c 'kill -s HUP $$'", "exit"}, {progname .. ' -e " "', "ok"}, {progname .. ' -e "os.exit(0, true)"', "ok"}, {progname .. ' -e "os.exit(20, true)"', "exit", 20}, } print("\n(some error messages are expected now)") for _, v in ipairs(tests) do local x, y, z = io.popen(v[1]):close() local x1, y1, z1 = os.execute(v[1]) assert(x == x1 and y == y1 and z == z1) if v[2] == "ok" then assert(x and y == 'exit' and z == 0) else assert(not x and y == v[2]) -- correct status and 'what' -- correct code if known (but always different from 0) assert((v[3] == nil and z > 0) or v[3] == z) end end end -- testing tmpfile f = io.tmpfile() assert(io.type(f) == "file") f:write("alo") f:seek("set") assert(f:read"a" == "alo") end --} print'+' print("testing date/time") assert(os.date("") == "") assert(os.date("!") == "") assert(os.date("\0\0") == "\0\0") assert(os.date("!\0\0") == "\0\0") local x = string.rep("a", 10000) assert(os.date(x) == x) local t = os.time() D = os.date("*t", t) assert(os.date(string.rep("%d", 1000), t) == string.rep(os.date("%d", t), 1000)) assert(os.date(string.rep("%", 200)) == string.rep("%", 100)) local function checkDateTable (t) _G.D = os.date("*t", t) assert(os.time(D) == t) load(os.date([[assert(D.year==%Y and D.month==%m and D.day==%d and D.hour==%H and D.min==%M and D.sec==%S and D.wday==%w+1 and D.yday==%j)]], t))() _G.D = nil end checkDateTable(os.time()) if not _port then -- assume that time_t can represent these values checkDateTable(0) checkDateTable(1) checkDateTable(1000) checkDateTable(0x7fffffff) checkDateTable(0x80000000) end checkerr("invalid conversion specifier", os.date, "%") checkerr("invalid conversion specifier", os.date, "%9") checkerr("invalid conversion specifier", os.date, "%") checkerr("invalid conversion specifier", os.date, "%O") checkerr("invalid conversion specifier", os.date, "%E") checkerr("invalid conversion specifier", os.date, "%Ea") checkerr("not an integer", os.time, {year=1000, month=1, day=1, hour='x'}) checkerr("not an integer", os.time, {year=1000, month=1, day=1, hour=1.5}) checkerr("missing", os.time, {hour = 12}) -- missing date if string.packsize("i") == 4 then -- 4-byte ints checkerr("field 'year' is out-of-bound", os.time, {year = -(1 << 31) + 1899, month = 1, day = 1}) end if not _port then -- test Posix-specific modifiers assert(type(os.date("%Ex")) == 'string') assert(type(os.date("%Oy")) == 'string') -- test large dates (assume at least 4-byte ints and time_t) local t0 = os.time{year = 1970, month = 1, day = 0} local t1 = os.time{year = 1970, month = 1, day = 0, sec = (1 << 31) - 1} assert(t1 - t0 == (1 << 31) - 1) t0 = os.time{year = 1970, month = 1, day = 1} t1 = os.time{year = 1970, month = 1, day = 1, sec = -(1 << 31)} assert(t1 - t0 == -(1 << 31)) -- test out-of-range dates (at least for Unix) if maxint >= 2^62 then -- cannot do these tests in Small Lua -- no arith overflows checkerr("out-of-bound", os.time, {year = -maxint, month = 1, day = 1}) if string.packsize("i") == 4 then -- 4-byte ints if testerr("out-of-bound", os.date, "%Y", 2^40) then -- time_t has 4 bytes and therefore cannot represent year 4000 print(" 4-byte time_t") checkerr("cannot be represented", os.time, {year=4000, month=1, day=1}) else -- time_t has 8 bytes; an int year cannot represent a huge time print(" 8-byte time_t") checkerr("cannot be represented", os.date, "%Y", 2^60) -- this is the maximum year assert(tonumber(os.time {year=(1 << 31) + 1899, month=12, day=31, hour=23, min=59, sec=59})) -- this is too much checkerr("represented", os.time, {year=(1 << 31) + 1899, month=12, day=31, hour=23, min=59, sec=60}) end -- internal 'int' fields cannot hold these values checkerr("field 'day' is out-of-bound", os.time, {year = 0, month = 1, day = 2^32}) checkerr("field 'month' is out-of-bound", os.time, {year = 0, month = -((1 << 31) + 1), day = 1}) checkerr("field 'year' is out-of-bound", os.time, {year = (1 << 31) + 1900, month = 1, day = 1}) else -- 8-byte ints -- assume time_t has 8 bytes too print(" 8-byte time_t") assert(tonumber(os.date("%Y", 2^60))) -- but still cannot represent a huge year checkerr("cannot be represented", os.time, {year=2^60, month=1, day=1}) end end end do local D = os.date("*t") local t = os.time(D) if D.isdst == nil then print("no daylight saving information") else assert(type(D.isdst) == 'boolean') end D.isdst = nil local t1 = os.time(D) assert(t == t1) -- if isdst is absent uses correct default end local D = os.date("*t") t = os.time(D) D.year = D.year-1; local t1 = os.time(D) -- allow for leap years assert(math.abs(os.difftime(t,t1)/(24*3600) - 365) < 2) -- should not take more than 1 second to execute these two lines t = os.time() t1 = os.time(os.date("*t")) local diff = os.difftime(t1,t) assert(0 <= diff and diff <= 1) diff = os.difftime(t,t1) assert(-1 <= diff and diff <= 0) local t1 = os.time{year=2000, month=10, day=1, hour=23, min=12} local t2 = os.time{year=2000, month=10, day=1, hour=23, min=10, sec=19} assert(os.difftime(t1,t2) == 60*2-19) -- since 5.3.3, 'os.time' normalizes table fields t1 = {year = 2005, month = 1, day = 1, hour = 1, min = 0, sec = -3602} os.time(t1) assert(t1.day == 31 and t1.month == 12 and t1.year == 2004 and t1.hour == 23 and t1.min == 59 and t1.sec == 58 and t1.yday == 366) io.output(io.stdout) local t = os.date('%d %m %Y %H %M %S') local d, m, a, h, min, s = string.match(t, "(%d+) (%d+) (%d+) (%d+) (%d+) (%d+)") d = tonumber(d) m = tonumber(m) a = tonumber(a) h = tonumber(h) min = tonumber(min) s = tonumber(s) io.write(string.format('test done on %2.2d/%2.2d/%d', d, m, a)) io.write(string.format(', at %2.2d:%2.2d:%2.2d\n', h, min, s)) io.write(string.format('%s\n', _VERSION))
local filename = ... local file = io.open(filename, 'r') local sum = nil while true do local num1, num2 = file:read("*n","*n") if num1 or num2 then if not sum then sum = 0 end if num1 then sum = sum + num1 end if num2 then sum = sum + num2 end else break end end io.close(file) --print(sum) return sum
local Collection = {} function Collection:new ( type ) return { type = type, } end return Collection
local load_module = require('utils.helpers').load_module local diffview = load_module 'diffview' if diffview == nil then return false end local nvim = require 'neovim' local get_mapping = require('neovim.mappings').get_mapping local cb = require('diffview.config').diffview_callback local has_devicons = load_module 'nvim-web-devicons' local M = {} local mappings = { ['<leader>c'] = { rhs = '<cmd>DiffviewClose<CR>', args = { noremap = true, silent = true, nowait = true }, }, ['<leader>q'] = { rhs = '<cmd>DiffviewClose<CR>', args = { noremap = true, silent = true, nowait = true }, }, } local function is_diffview() local ft = vim.opt_local.filetype:get() local tab_diffview = (ft == 'DiffviewFiles' or ft == 'DiffFileHistory') if not tab_diffview then local current_tab = nvim.get_current_tabpage() local wins = nvim.tab.list_wins(current_tab) for _, win in pairs(wins) do local buf_win_ft = nvim.buf.get_option(nvim.win.get_buf(win), 'filetype') tab_diffview = buf_win_ft == 'DiffviewFiles' or buf_win_ft == 'DiffFileHistory' if tab_diffview then break end end end return tab_diffview end function M.set_mappings() if is_diffview() and not vim.g.restore_diffview_maps then local diff_mappings = {} for map, args in pairs(mappings) do table.insert(diff_mappings, get_mapping { mode = 'n', lhs = map }) pcall(vim.keymap.del, 'n', map) vim.keymap.set('n', map, args.rhs, args.args) end vim.g.restore_diffview_maps = diff_mappings local diff_ft = vim.opt_local.filetype:get() if diff_ft == 'DiffviewFiles' or diff_ft == 'DiffFileHistory' then pcall(vim.keymap.del, 'n', 'q') vim.keymap.set( 'n', 'q', '<cmd>DiffviewClose<CR>', { noremap = true, silent = true, nowait = true, buffer = true } ) end elseif vim.g.restore_diffview_maps then for _, map in pairs(vim.g.restore_diffview_maps) do local args = { noremap = map.noremap, expr = map.expr, nowait = map.nowait, silent = map.silent, script = map.script, } pcall(vim.keymap.del, map.mode, map.lhs) vim.keymap.set(map.mode, map.lhs, map.rhs, args) end vim.g.restore_diffview_maps = nil end end diffview.setup { diff_binaries = false, -- Show diffs for binaries use_icons = has_devicons ~= nil, -- Requires nvim-web-devicons file_panel = { win_config = { width = 35, }, }, key_bindings = { disable_defaults = false, -- Disable the default key bindings -- The `view` bindings are active in the diff buffers, only when the current -- tabpage is a Diffview. -- stylua: ignore view = { ['<tab>'] = cb 'select_next_entry', -- Open the diff for the next file ['<s-tab>'] = cb 'select_prev_entry', -- Open the diff for the previous file ['<C-j>'] = cb 'select_next_entry', ['<C-k>'] = cb 'select_prev_entry', ['<leader>p'] = cb 'focus_files', -- Bring focus to the files panel ['<leader>f'] = cb 'toggle_files', -- Toggle the files panel. }, -- stylua: ignore file_panel = { ['j'] = cb 'next_entry', -- Bring the cursor to the next file entry ['<down>'] = cb 'next_entry', ['k'] = cb 'prev_entry', -- Bring the cursor to the previous file entry. ['<up>'] = cb 'prev_entry', ['<cr>'] = cb 'select_entry', -- Open the diff for the selected entry. ['o'] = cb 'select_entry', ['<2-LeftMouse>'] = cb 'select_entry', ['-'] = cb 'toggle_stage_entry', -- Stage / unstage the selected entry. ['S'] = cb 'stage_all', -- Stage all entries. ['U'] = cb 'unstage_all', -- Unstage all entries. ['R'] = cb 'refresh_files', -- Update stats and entries in the file list. ['<tab>'] = cb 'select_next_entry', ['<s-tab>'] = cb 'select_prev_entry', ['<bs>'] = cb 'select_prev_entry', ['<C-j>'] = cb 'select_next_entry', ['<C-k>'] = cb 'select_prev_entry', ['<leader>p'] = cb 'focus_files', -- Bring focus to the files panel ['<leader>f'] = cb 'toggle_files', -- Toggle the files panel. }, }, } return M
-- -- Copyright (c) 2017, Jesse Freeman. All rights reserved. -- -- Licensed under the Microsoft Public License (MS-PL) License. -- See LICENSE file in the project root for full license information. -- -- Contributors -- -------------------------------------------------------- -- This is the official list of Pixel Vision 8 contributors: -- -- Jesse Freeman - @JesseFreeman -- Christer Kaitila - @McFunkypants -- Pedro Medeiros - @saint11 -- Shawn Rakowski - @shwany -- function EditorUI:CreateButton(flag, rect, spriteName, toolTip, forceDraw) -- Create the button's default data local data = self:CreateData(flag, rect, spriteName, toolTip, forceDraw) data.doubleClick = false data.doubleClickTime = 0 data.doubleClickDelay = .45 data.doubleClickActive = false -- Customize the default name by adding Button to it data.name = "Button" .. data.name data.onClick = function(tmpData) self:ClickButton(tmpData, true, tmpData.doubleClickActive and tmpData.doubleClickTime < tmpData.doubleClickDelay) tmpData.doubleClickTime = 0 tmpData.doubleClickActive = true -- self:ClickButton(tmpData) end -- Make sure the button correctly sizes itself based on the cached sprite data self:UpdateButtonSizeFromCache(data) return data end function EditorUI:UpdateButtonSizeFromCache(data) local spriteData = nil -- Get the default sprite data for the button if(data.cachedSpriteData ~= nil) then spriteData = data.cachedSpriteData.up or data.cachedSpriteData.disabled end -- Calculate rect and hit rect if(spriteData ~= nil) then -- Update the UI tile width and height data.tiles.w = spriteData.width data.tiles.h = math.floor(#spriteData.spriteIDs / spriteData.width) -- Update the rect width and height with the new sprite size data.rect.w = data.tiles.w * self.spriteSize.x data.rect.h = data.tiles.h * self.spriteSize.y -- Cache the tile draw arguments for rendering data.spriteDrawArgs = {spriteData.spriteIDs, 0, 0, spriteData.width, false, false, DrawMode.SpriteAbove, 0, false, false} data.tileDrawArgs = {spriteData.spriteIDs, data.tiles.c, data.tiles.r, spriteData.width, DrawMode.Tile, 0}--{0, 0, spriteData.width, spriteData.spriteIDs, 0, data.flagID} -- self:SetUIFlags(data.tiles.c, data.tiles.r, data.tiles.w, data.tiles.h, data.flagID) end end function EditorUI:UpdateButton(data, hitRect) -- Make sure we have data to work with and the component isn't disabled, if not return out of the update method if(data == nil) then return end -- If the button has data but it's not enabled exit out of the update if(data.enabled == false) then -- If the button is disabled but still in focus we need to remove focus if(data.inFocus == true) then self:ClearFocus(data) end -- See if the button needs to be redrawn. self:RedrawButton(data) -- Shouldn't update the button if its disabled return end -- Make sure we don't detect a collision if the mouse is down but not over this button if(self.collisionManager.mouseDown and data.inFocus == false) then -- See if the button needs to be redrawn. self:RedrawButton(data) return end -- If the hit rect hasn't been overridden, then use the buttons own hit rect if(hitRect == nil) then hitRect = data.hitRect or data.rect end local overrideFocus = (data.inFocus == true and self.collisionManager.mouseDown) -- Ready to test finer collision if needed if(self.collisionManager:MouseInRect(hitRect) == true or overrideFocus) then if(data.doubleClick == true) then -- If the button wasn't in focus before, reset the timer since it's about to get focus if(data.inFocus == false) then data.doubleClickTime = 0 data.doubleClickActive = false end data.doubleClickTime = data.doubleClickTime + self.timeDelta if(data.doubleClickActive and data.doubleClickTime > data.doubleClickDelay) then data.doubleClickActive = false end end -- If we are in the collision area, set the focus self:SetFocus(data) -- calculate the correct button over state local state = "over" if(data.selected == true) then state = "selected" .. state end local spriteData = data.cachedSpriteData[state] if(spriteData ~= nil and data.spriteDrawArgs ~= nil) then -- Sprite Data data.spriteDrawArgs[1] = spriteData.spriteIDs -- X pos data.spriteDrawArgs[2] = data.rect.x -- Y pos data.spriteDrawArgs[3] = data.rect.y -- Color Offset data.spriteDrawArgs[8] = spriteData.colorOffset or 0 self:NewDraw("DrawSprites", data.spriteDrawArgs) end -- TODO need to make sure we only register a click when over the right button. If the mouse was down and rolls over then releases, that shouldn't trigger a click -- Check to see if the button is pressed and has an onAction callback if(self.collisionManager.mouseReleased == true) then -- Click the button data.onClick(data) -- end end else if(data.inFocus == true) then -- If we are not in the button's rect, clear the focus self:ClearFocus(data) end end -- else -- -- -- If the mouse is not over the button, clear the focus for this button -- self:ClearFocus(data) -- -- end -- Make sure we don't need to redraw the button. self:RedrawButton(data) end function EditorUI:RedrawButton(data) if(data == nil) then return end -- If the button changes state we need to redraw it to the tilemap if(data.invalid == true) then -- The default state is up local state = "up" -- If the button is selected, we will use the selected up state if(data.selected == true) then state = "selected" .. state end -- Test to see if the button is disabled. If there is a disabled sprite data, we'll change the state to disabled. By default, always use the up state. if(data.enabled == false and data.cachedSpriteData["disabled"] ~= nil and data.selected ~= true) then --_G[spriteName .. "disabled"] ~= nil) then state = "disabled" end -- Test to see if the sprite data exist before updating the tiles if(data.cachedSpriteData[state] ~= nil and data.tileDrawArgs ~= nil) then -- Update the tile draw arguments data.tileDrawArgs[1] = data.cachedSpriteData[state].spriteIDs -- Color offset data.tileDrawArgs[6] = data.cachedSpriteData[state].colorOffset or 0 self:NewDraw("DrawTiles", data.tileDrawArgs) end self:ResetValidation(data) end end -- TODO make sure this still works function EditorUI:ClearButton(data, flag) -- We want to clear the flag if no value is supplied flag = flag or - 1 -- Get the cached empty sprite data local spriteData = data.cachedSpriteData["empty"] -- make sure we have sprite data to draw if(spriteData ~= nil) then -- Update the tile draw arguments data.tileDrawArgs[1] = spriteData.spriteIDs -- Color offset data.tileDrawArgs[6] = spriteData.colorOffset or 0 self:NewDraw("DrawTiles", data.tileDrawArgs) -- self:SetUIFlags(data.tiles.c, data.tiles.r, data.tiles.w, data.tiles.h, flag) end end -- Use this to perform a click action on a button. It's used internally when a mouse click is detected. function EditorUI:ClickButton(data, callAction, doubleClick) if(data.onAction ~= nil and callAction ~= false) then -- Trigger the onAction call back and pass in the double click value if the button is set up to use it data.onAction(doubleClick) end end function EditorUI:SelectButton(data, value) data.selected = value self:Invalidate(data) end
 module(..., package.seeall) --;=========================================================== --; LOAD DATA --;=========================================================== -- Data loading from data_sav.lua local file = io.open("script/data_sav.lua","r") s_dataLUA = file:read("*all") file:close() -- Data loading from config.ssz local file = io.open("ssz/config.ssz","r") s_configSSZ = file:read("*all") file:close() resolutionWidth = tonumber(s_configSSZ:match('const int Width%s*=%s*(%d+)')) resolutionHeight = tonumber(s_configSSZ:match('const int Height%s*=%s*(%d+)')) b_screenMode = (s_configSSZ:match('const bool FullScreen%s*=%s*([^;%s]+)')) gl_vol = math.floor(tonumber(s_configSSZ:match('const float GlVol%s*=%s*(%d%.*%d*)') * 100)) se_vol = math.floor(tonumber(s_configSSZ:match('const float SEVol%s*=%s*(%d%.*%d*)') * 100)) bgm_vol = math.floor(tonumber(s_configSSZ:match('const float BGMVol%s*=%s*(%d%.*%d*)') * 100)) gameSpeed = tonumber(s_configSSZ:match('const int GameSpeed%s*=%s*(%d+)')) b_saveMemory = s_configSSZ:match('const bool SaveMemory%s*=%s*([^;%s]+)') b_openGL = s_configSSZ:match('const bool OpenGL%s*=%s*([^;%s]+)') -- Data loading from sound.ssz local file = io.open("lib/sound.ssz","r") s_soundSSZ = file:read("*all") file:close() freq = tonumber(s_soundSSZ:match('const int Freq%s*=%s*(%d+)')) channels = tonumber(s_soundSSZ:match('const int Channels%s*=%s*(%d+)')) buffer = tonumber(s_soundSSZ:match('const int BufferSamples%s*=%s*(%d+)')) -- Data loading from lifebar local file = io.open(data.lifebar,"r") s_lifebarDEF = file:read("*all") file:close() roundsNum = tonumber(s_lifebarDEF:match('match.wins%s*=%s*(%d+)')) drawNum = tonumber(s_lifebarDEF:match('match.maxdrawgames%s*=%s*(%d+)')) --Variable setting based on loaded data if gameSpeed == 48 then s_gameSpeed = 'Slow' --elseif gameSpeed == 56 then --s_gameSpeed = '93.33%' elseif gameSpeed == 60 then s_gameSpeed = 'Normal' --elseif gameSpeed == 64 then --s_gameSpeed = '106.66%' elseif gameSpeed == 72 then s_gameSpeed = 'Turbo' end if b_screenMode == 'true' then b_screenMode = true s_screenMode = 'Yes' elseif b_screenMode == 'false' then b_screenMode = false s_screenMode = 'No' end if channels == 6 then s_channels = '5.1' elseif channels == 4 then s_channels = 'Quad' elseif channels == 2 then s_channels = 'Stereo' elseif channels == 1 then s_channels = 'Mono' end if b_saveMemory == 'true' then b_saveMemory = true s_saveMemory = 'Yes' elseif b_saveMemory == 'false' then b_saveMemory = false s_saveMemory = 'No' end if b_openGL == 'true' then b_openGL = true s_openGL = 'Yes' elseif b_openGL == 'false' then b_openGL = false s_openGL = 'No' end if data.teamLifeShare then s_teamLifeShare = 'Yes' else s_teamLifeShare = 'No' end if data.zoomActive then s_zoomActive = 'Yes' else s_zoomActive = 'No' end if data.p1Controller == -1 then s_p1Controller = 'Keyboard' else s_p1Controller = 'Gamepad' end if data.p2Controller == -1 then s_p2Controller = 'Keyboard' else s_p2Controller = 'Gamepad' end if data.contSelection then s_contSelection = 'Yes' else s_contSelection = 'No' end if data.aiRamping then s_aiRamping = 'Yes' else s_aiRamping = 'No' end if data.autoguard then s_autoguard = 'Yes' else s_autoguard = 'No' end if data.vsDisplayWin then s_vsDisplayWin = 'Yes' else s_vsDisplayWin = 'No' end --;=========================================================== --; BACKGROUND DEFINITION --;=========================================================== --Scrolling background optionsBG0 = animNew(sysSff, [[ 100,0, 0,0, -1 ]]) animAddPos(optionsBG0, 160, 0) animSetTile(optionsBG0, 1, 1) animSetColorKey(optionsBG0, -1) --Transparent background optionsBG1 = animNew(sysSff, [[ 100,1, 0,0, -1 ]]) animSetTile(optionsBG1, 1, 1) animSetAlpha(optionsBG1, 20, 100) animUpdate(optionsBG1) --;=========================================================== --; ON EXIT --;=========================================================== modified = 0 needReload = 0 function f_strSub(str, t) local txt = '' for row, val in pairs(t) do if type(val) == 'string' then val = "'" .. tostring(val) .. "'" elseif type(var) == 'number' then val = var else val = tostring(val) end str = str:gsub(row .. '%s*=%s*[^\n]+', row .. ' = ' .. val) txt = txt .. row .. ' = ' .. val .. '\n' end return str, txt end function f_saveCfg() -- Data saving to data_sav.lua local t_saves = { ['data.lifeMul'] = data.lifeMul, ['data.team1VS2Life'] = data.team1VS2Life, ['data.turnsRecoveryRate'] = data.turnsRecoveryRate, ['data.teamLifeShare'] = data.teamLifeShare, ['data.zoomActive'] = data.zoomActive, ['data.zoomMin'] = data.zoomMin, ['data.zoomMax'] = data.zoomMax, ['data.zoomSpeed'] = data.zoomSpeed, ['data.roundTime'] = data.roundTime, ['data.numTurns'] = data.numTurns, ['data.numSimul'] = data.numSimul, ['data.simulType'] = data.simulType, ['data.p1Controller'] = data.p1Controller, ['data.p2Controller'] = data.p2Controller, ['data.difficulty'] = data.difficulty, ['data.coins'] = data.coins, ['data.contSelection'] = data.contSelection, ['data.vsDisplayWin'] = data.vsDisplayWin, ['data.aiRamping'] = data.aiRamping, ['data.autoguard'] = data.autoguard, ['data.lifebar'] = data.lifebar, ['data.sffConversion'] = data.sffConversion } s_dataLUA = f_strSub(s_dataLUA, t_saves) local file = io.open("script/data_sav.lua","w+") file:write(s_dataLUA) file:close() -- Data saving to config.ssz if b_saveMemory then s_saveMemory = s_saveMemory:gsub('const bool SaveMemory%s*=%s*[^;%s]+', 'const bool SaveMemory = true') else s_saveMemory = s_saveMemory:gsub('const bool SaveMemory%s*=%s*[^;%s]+', 'const bool SaveMemory = false') end if b_openGL then s_configSSZ = s_configSSZ:gsub('const bool OpenGL%s*=%s*[^;%s]+', 'const bool OpenGL = true') else s_configSSZ = s_configSSZ:gsub('const bool OpenGL%s*=%s*[^;%s]+', 'const bool OpenGL = false') end if b_screenMode then s_configSSZ = s_configSSZ:gsub('const bool FullScreen%s*=%s*[^;%s]+', 'const bool FullScreen = true') else s_configSSZ = s_configSSZ:gsub('const bool FullScreen%s*=%s*[^;%s]+', 'const bool FullScreen = false') end s_configSSZ = s_configSSZ:gsub('const int Width%s*=%s*%d+', 'const int Width = ' .. resolutionWidth) s_configSSZ = s_configSSZ:gsub('const int Height%s*=%s*%d+', 'const int Height = ' .. resolutionHeight) s_configSSZ = s_configSSZ:gsub('const float GlVol%s*=%s*%d%.*%d*', 'const float GlVol = ' .. gl_vol / 100) s_configSSZ = s_configSSZ:gsub('const float SEVol%s*=%s*%d%.*%d*', 'const float SEVol = ' .. se_vol / 100) s_configSSZ = s_configSSZ:gsub('const float BGMVol%s*=%s*%d%.*%d*', 'const float BGMVol = ' .. bgm_vol / 100) s_configSSZ = s_configSSZ:gsub('const int GameSpeed%s*=%s*%d+', 'const int GameSpeed = ' .. gameSpeed) local file = io.open("ssz/config.ssz","w+") file:write(s_configSSZ) file:close() -- Data saving to sound.ssz s_soundSSZ = s_soundSSZ:gsub('const int Freq%s*=%s*%d+', 'const int Freq = ' .. freq) s_soundSSZ = s_soundSSZ:gsub('const int Channels%s*=%s*%d+', 'const int Channels = ' .. channels) s_soundSSZ = s_soundSSZ:gsub('const int BufferSamples%s*=%s*%d+', 'const int BufferSamples = ' .. buffer) local file = io.open("lib/sound.ssz","w+") file:write(s_soundSSZ) file:close() -- Data saving to lifebar s_lifebarDEF = s_lifebarDEF:gsub('match.wins%s*=%s*%d+', 'match.wins = ' .. roundsNum) s_lifebarDEF = s_lifebarDEF:gsub('match.maxdrawgames%s*=%s*%d+', 'match.maxdrawgames = ' .. drawNum) local file = io.open(data.lifebar,"w+") file:write(s_lifebarDEF) file:close() -- Reload lifebar loadLifebar(data.lifebar) -- Reload game if needed if needReload == 1 then os.execute("reload.bat") os.exit() end end --;=========================================================== --; INFO BOX --;=========================================================== txt_exitInfo = createTextImg(jgFnt, 0, 0, 'INFORMATION', 159, 13) t_exitInfo = { {id = '', text = "Some selected options require restart Ikemen. Press"}, {id = '', text = "start key to reboot Ikemen and load your new settings."}, } for i=1, #t_exitInfo do t_exitInfo[i].id = createTextImg(font2, 0, 1, t_exitInfo[i].text, 25, 15+i*15) end function f_exitInfo() cmdInput() while true do if btnPalNo(p1Cmd) > 0 or esc() then sndPlay(sysSnd, 100, 2) f_saveCfg() break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 20,20, 280,#t_exitInfo*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_exitInfo) for i=1, #t_exitInfo do textImgDraw(t_exitInfo[i].id) end cmdInput() refresh() end end t_restart = { {id = '', text = "The changes that you have made"}, {id = '', text = "require Save and Back. "}, } for i=1, #t_restart do t_restart[i].id = createTextImg(font2, 0, -1, t_restart[i].text, 236, 155+i*15) end t_newinput = { {id = '', text = "Press any key to assign"},--{id = '', text = "Enter new input..."}, } for i=1, #t_newinput do t_newinput[i].id = createTextImg(font2, 0, -1, t_newinput[i].text, 236, 180+i*15) end --;=========================================================== --; MAIN LOOP --;=========================================================== txt_mainCfg = createTextImg(jgFnt, 0, 0, 'OPTIONS', 159, 13) t_mainCfg = { {id = '', text = 'Gameplay Settings'}, {id = '', text = 'Video Settings'}, {id = '', text = 'Audio Settings'}, {id = '', text = 'Input Settings'}, {id = '', text = 'Engine Settings'}, {id = '', text = 'Port Change', varID = textImgNew(), varText = getListenPort()}, {id = '', text = 'Default Values'}, {id = '', text = 'Save and Back'}, {id = '', text = 'Back Without Saving'}, } for i=1, #t_mainCfg do t_mainCfg[i].id = createTextImg(font2, 0, 1, t_mainCfg[i].text, 85, 15+i*15) end function f_mainCfg() cmdInput() local mainCfg = 1 data.fadeTitle = f_fadeAnim(10, 'fadein', 'black', fadeSff) while true do if esc() then --data.fadeTitle = f_fadeAnim(10, 'fadein', 'black', fadeSff) --sndPlay(sysSnd, 100, 2) --if needReload == 1 then --f_exitInfo() --end --break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) mainCfg = mainCfg - 1 if mainCfg < 1 then mainCfg = #t_mainCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) mainCfg = mainCfg + 1 if mainCfg > #t_mainCfg then mainCfg = 1 end --Port Change elseif mainCfg == 6 and (btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 1) inputDialogPopup(inputdia, 'Introduce a new Port (Default: 7500)') while not inputDialogIsDone(inputdia) do animDraw(f_animVelocity(optionsBG0, -1, -1)) refresh() end setListenPort(inputDialogGetStr(inputdia)) modified = 1 elseif btnPalNo(p1Cmd) > 0 then --Gameplay Settings if mainCfg == 1 then sndPlay(sysSnd, 100, 1) f_gameCfg() --Video Settings elseif mainCfg == 2 then sndPlay(sysSnd, 100, 1) f_videoCfg() --Audio Settings elseif mainCfg == 3 then sndPlay(sysSnd, 100, 1) f_audioCfg() --Input Settings elseif mainCfg == 4 then sndPlay(sysSnd, 100, 1) f_inputCfg() --Engine Settings elseif mainCfg == 5 then sndPlay(sysSnd, 100, 1) f_engineCfg() --Default Values elseif mainCfg == 7 then sndPlay(sysSnd, 100, 1) --saves.ini data.lifeMul = 100 data.team1VS2Life = 120 data.turnsRecoveryRate = 300 data.teamLifeShare = false s_teamLifeShare = 'No' data.zoomActive = true s_zoomActive = 'Yes' data.zoomMin = 0.75 data.zoomMax = 1.1 data.zoomSpeed = 1.0 data.roundTime = 99 data.numTurns = 4 data.numSimul = 4 data.simulType = 'Assist' data.p1Controller = -1 data.p2Controller = -1 data.difficulty = 8 data.coins = 10 data.contSelection = true s_contSelection = 'Yes' data.aiRamping = true s_aiRamping = 'Yes' data.autoguard = false s_autoguard = 'No' data.vsDisplayWin = true s_vsDisplayWin = 'Yes' data.lifebar = 'data/fight.def' data.sffConversion = true --config.ssz f_inputDefault() --b_saveMemory = false --s_saveMemory = 'No' b_openGL = false s_openGL = 'No' resolutionWidth = 640 resolutionHeight = 480 b_screenMode = false s_screenMode = 'No' setScreenMode(b_screenMode) gl_vol = 100 se_vol = 50 bgm_vol = 80 setVolume(gl_vol / 100, se_vol / 100, bgm_vol / 100) gameSpeed = 60 s_gameSpeed = 'Normal' --sound.ssz freq = 48000 channels = 2 s_channels = 'Stereo' buffer = 2048 --lifebar roundsNum = 2 drawNum = 2 --other setListenPort(7500) modified = 1 needReload = 1 --Save and Back elseif mainCfg == 8 then data.fadeTitle = f_fadeAnim(10, 'fadein', 'black', fadeSff) sndPlay(sysSnd, 100, 2) if needReload == 1 then f_exitInfo() end f_saveCfg() break --Back Without Save else data.fadeTitle = f_fadeAnim(10, 'fadein', 'black', fadeSff) sndPlay(sysSnd, 100, 2) break end end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_mainCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_mainCfg) if needReload == 1 then for i=1, #t_restart do textImgDraw(t_restart[i].id) end end t_mainCfg[6].varText = getListenPort() for i=1, #t_mainCfg do textImgDraw(t_mainCfg[i].id) if t_mainCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_mainCfg[i].varID, font2, 0, -1, t_mainCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+mainCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) animDraw(data.fadeTitle) animUpdate(data.fadeTitle) cmdInput() refresh() end end function f_inputDefault() if data.p1Controller ~= -1 then data.p1Controller = -1 s_p1Controller = 'Keyboard' f_swapController(0, 2, 0, -1) end if data.p2Controller ~= -1 then data.p2Controller = -1 s_p2Controller = 'Keyboard' f_swapController(1, 3, 1, -1) end t_keyCfg[1].varText = 'UP' t_keyCfg[2].varText = 'DOWN' t_keyCfg[3].varText = 'LEFT' t_keyCfg[4].varText = 'RIGHT' t_keyCfg[5].varText = 'z' t_keyCfg[6].varText = 'x' t_keyCfg[7].varText = 'c' t_keyCfg[8].varText = 'a' t_keyCfg[9].varText = 's' t_keyCfg[10].varText = 'd' t_keyCfg[11].varText = 'RETURN' f_keySave(0,-1) t_keyCfg[1].varText = 't' t_keyCfg[2].varText = 'g' t_keyCfg[3].varText = 'f' t_keyCfg[4].varText = 'h' t_keyCfg[5].varText = 'j' t_keyCfg[6].varText = 'k' t_keyCfg[7].varText = 'l' t_keyCfg[8].varText = 'i' t_keyCfg[9].varText = 'o' t_keyCfg[10].varText = 'p' t_keyCfg[11].varText = 'q' f_keySave(1,-1) t_keyCfg[1].varText = '-7' t_keyCfg[2].varText = '-8' t_keyCfg[3].varText = '-5' t_keyCfg[4].varText = '-6' t_keyCfg[5].varText = '0' t_keyCfg[6].varText = '1' t_keyCfg[7].varText = '4' t_keyCfg[8].varText = '2' t_keyCfg[9].varText = '3' t_keyCfg[10].varText = '5' t_keyCfg[11].varText = '7' f_keySave(2,0) t_keyCfg[1].varText = '-7' t_keyCfg[2].varText = '-8' t_keyCfg[3].varText = '-5' t_keyCfg[4].varText = '-6' t_keyCfg[5].varText = '0' t_keyCfg[6].varText = '1' t_keyCfg[7].varText = '4' t_keyCfg[8].varText = '2' t_keyCfg[9].varText = '3' t_keyCfg[10].varText = '5' t_keyCfg[11].varText = '7' f_keySave(3,1) end --;=========================================================== --; GAMEPLAY SETTINGS --;=========================================================== txt_gameCfg = createTextImg(jgFnt, 0, 0, 'GAMEPLAY SETTINGS', 159, 13) t_gameCfg = { {id = '', text = 'Difficulty Level', varID = textImgNew(), varText = data.difficulty}, {id = '', text = 'Round Time', varID = textImgNew(), varText = data.roundTime}, {id = '', text = 'Rounds to Win', varID = textImgNew(), varText = roundsNum}, {id = '', text = 'Max Draw Games', varID = textImgNew(), varText = drawNum}, {id = '', text = 'Life', varID = textImgNew(), varText = data.lifeMul .. '%'}, {id = '', text = 'Arcade Coins', varID = textImgNew(), varText = data.coins}, {id = '', text = 'Char change at Continue', varID = textImgNew(), varText = s_contSelection}, {id = '', text = 'Versus Win Counter', varID = textImgNew(), varText = s_vsDisplayWin}, {id = '', text = 'AI ramping', varID = textImgNew(), varText = s_aiRamping}, {id = '', text = 'Auto-Guard', varID = textImgNew(), varText = s_autoguard}, {id = '', text = 'Team Settings'}, {id = '', text = 'Back'}, } for i=1, #t_gameCfg do t_gameCfg[i].id = createTextImg(font2, 0, 1, t_gameCfg[i].text, 85, 15+i*15) end function f_gameCfg() cmdInput() local gameCfg = 1 local bufl = 0 local bufr = 0 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) gameCfg = gameCfg - 1 if gameCfg < 1 then gameCfg = #t_gameCfg end if bufl then bufl = 0 end if bufr then bufr = 0 end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) gameCfg = gameCfg + 1 if gameCfg > #t_gameCfg then gameCfg = 1 end if bufl then bufl = 0 end if bufr then bufr = 0 end --Difficulty Level elseif gameCfg == 1 then if commandGetState(p1Cmd, 'r') and data.difficulty < 8 then sndPlay(sysSnd, 100, 0) data.difficulty = data.difficulty + 1 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.difficulty > 1 then sndPlay(sysSnd, 100, 0) data.difficulty = data.difficulty - 1 modified = 1 end --Round Time elseif gameCfg == 2 then if commandGetState(p1Cmd, 'r') or (commandGetState(p1Cmd, 'holdr') and bufr >= 30) then if data.roundTime < 1000 then data.roundTime = data.roundTime + 1 else data.roundTime = -1 end if commandGetState(p1Cmd, 'r') then sndPlay(sysSnd, 100, 0) end modified = 1 elseif commandGetState(p1Cmd, 'l') or (commandGetState(p1Cmd, 'holdl') and bufl >= 30) then if data.roundTime > -1 then data.roundTime = data.roundTime - 1 else data.roundTime = 1000 end if commandGetState(p1Cmd, 'l') then sndPlay(sysSnd, 100, 0) end modified = 1 end if commandGetState(p1Cmd, 'holdr') then bufl = 0 bufr = bufr + 1 elseif commandGetState(p1Cmd, 'holdl') then bufr = 0 bufl = bufl + 1 else bufr = 0 bufl = 0 end --Rounds to Win elseif gameCfg == 3 then if commandGetState(p1Cmd, 'r') and roundsNum < 10 then sndPlay(sysSnd, 100, 0) roundsNum = roundsNum + 1 modified = 1 elseif commandGetState(p1Cmd, 'l') and roundsNum > 1 then sndPlay(sysSnd, 100, 0) roundsNum = roundsNum - 1 modified = 1 end --Max Draw Games elseif gameCfg == 4 then if commandGetState(p1Cmd, 'r') and drawNum < 10 then sndPlay(sysSnd, 100, 0) drawNum = drawNum + 1 modified = 1 elseif commandGetState(p1Cmd, 'l') and drawNum > 0 then sndPlay(sysSnd, 100, 0) drawNum = drawNum - 1 modified = 1 end --Life elseif gameCfg == 5 then if commandGetState(p1Cmd, 'r') and data.lifeMul < 300 then sndPlay(sysSnd, 100, 0) data.lifeMul = data.lifeMul + 10 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.lifeMul > 10 then sndPlay(sysSnd, 100, 0) data.lifeMul = data.lifeMul - 10 modified = 1 end --Arcade Coins elseif gameCfg == 6 then if commandGetState(p1Cmd, 'r') and data.coins < 99 then sndPlay(sysSnd, 100, 0) data.coins = data.coins + 1 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.coins > 0 then sndPlay(sysSnd, 100, 0) data.coins = data.coins - 1 modified = 1 end --Char change at Continue elseif gameCfg == 7 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.contSelection then data.contSelection = false s_contSelection = 'No' modified = 1 else data.contSelection = true s_contSelection = 'Yes' modified = 1 end --Display Versus Win Counter elseif gameCfg == 8 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.vsDisplayWin then data.vsDisplayWin = false s_vsDisplayWin = 'No' modified = 1 else data.vsDisplayWin = true s_vsDisplayWin = 'Yes' modified = 1 end --AI ramping elseif gameCfg == 9 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.aiRamping then data.aiRamping = false s_aiRamping = 'No' modified = 1 else data.aiRamping = true s_aiRamping = 'Yes' modified = 1 end --Auto-Guard elseif gameCfg == 10 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.autoguard then data.autoguard = false s_autoguard = 'No' modified = 1 else data.autoguard = true s_autoguard = 'Yes' modified = 1 end --Team Settings elseif gameCfg == 11 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 1) f_teamCfg() --Back elseif gameCfg == 12 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 2) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_gameCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_gameCfg) t_gameCfg[1].varText = data.difficulty if data.roundTime ~= -1 then t_gameCfg[2].varText = data.roundTime else t_gameCfg[2].varText = 'Infinite' end t_gameCfg[3].varText = roundsNum t_gameCfg[4].varText = drawNum t_gameCfg[5].varText = data.lifeMul .. '%' t_gameCfg[6].varText = data.coins t_gameCfg[7].varText = s_contSelection t_gameCfg[8].varText = s_vsDisplayWin t_gameCfg[9].varText = s_aiRamping t_gameCfg[10].varText = s_autoguard for i=1, #t_gameCfg do textImgDraw(t_gameCfg[i].id) if t_gameCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_gameCfg[i].varID, font2, 0, -1, t_gameCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+gameCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end --;=========================================================== --; TEAM SETTINGS --;=========================================================== txt_teamCfg = createTextImg(jgFnt, 0, 0, 'TEAM SETTINGS', 159, 13) t_teamCfg = { {id = '', text = 'Single Vs Team Life', varID = textImgNew(), varText = data.team1VS2Life .. '%'}, {id = '', text = 'Turns HP Recovery', varID = textImgNew(), varText = data.turnsRecoveryRate .. '%'}, {id = '', text = 'Disadvantage Life Share', varID = textImgNew(), varText = s_teamLifeShare}, {id = '', text = 'Turns Players Limit', varID = textImgNew(), varText = data.numTurns}, {id = '', text = 'Simul Players Limit', varID = textImgNew(), varText = data.numSimul}, {id = '', text = 'Simul Type', varID = textImgNew(), varText = data.simulType}, {id = '', text = 'Back'}, } for i=1, #t_teamCfg do t_teamCfg[i].id = createTextImg(font2, 0, 1, t_teamCfg[i].text, 85, 15+i*15) end function f_teamCfg() cmdInput() local teamCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) teamCfg = teamCfg - 1 if teamCfg < 1 then teamCfg = #t_teamCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) teamCfg = teamCfg + 1 if teamCfg > #t_teamCfg then teamCfg = 1 end --1P Vs Team Life elseif teamCfg == 1 then if commandGetState(p1Cmd, 'r') and data.team1VS2Life < 3000 then sndPlay(sysSnd, 100, 0) data.team1VS2Life = data.team1VS2Life + 10 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.team1VS2Life > 10 then sndPlay(sysSnd, 100, 0) data.team1VS2Life = data.team1VS2Life - 10 modified = 1 end --Turns HP Recovery elseif teamCfg == 2 then if commandGetState(p1Cmd, 'r') and data.turnsRecoveryRate < 3000 then sndPlay(sysSnd, 100, 0) data.turnsRecoveryRate = data.turnsRecoveryRate + 10 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.turnsRecoveryRate > 10 then sndPlay(sysSnd, 100, 0) data.turnsRecoveryRate = data.turnsRecoveryRate - 10 modified = 1 end --Disadvantage Life Share elseif teamCfg == 3 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.teamLifeShare then data.teamLifeShare = false s_teamLifeShare = 'No' modified = 1 else data.teamLifeShare = true s_teamLifeShare = 'Yes' modified = 1 end --Turns Limit (by default also requires editing 'if(!.m.inRange!int?(1, 4, nt)){' in ssz/system-script.ssz) elseif teamCfg == 4 then if commandGetState(p1Cmd, 'r') and data.numTurns < 4 then sndPlay(sysSnd, 100, 0) data.numTurns = data.numTurns + 1 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.numTurns > 2 then sndPlay(sysSnd, 100, 0) data.numTurns = data.numTurns - 1 modified = 1 end --Simul Limit (by default also requires editing 'const int maxSimul = 4;' in ssz/common.ssz) elseif teamCfg == 5 then if commandGetState(p1Cmd, 'r') and data.numSimul < 4 then sndPlay(sysSnd, 100, 0) data.numSimul = data.numSimul + 1 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.numSimul > 2 then sndPlay(sysSnd, 100, 0) data.numSimul = data.numSimul - 1 modified = 1 end --Simul Type elseif teamCfg == 6 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.simulType == 'Tag' then data.simulType = 'Assist' modified = 1 else data.simulType = 'Tag' modified = 1 end --Back elseif teamCfg == 7 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 2) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_teamCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_teamCfg) t_teamCfg[1].varText = data.team1VS2Life .. '%' t_teamCfg[2].varText = data.turnsRecoveryRate .. '%' t_teamCfg[3].varText = s_teamLifeShare t_teamCfg[4].varText = data.numTurns t_teamCfg[5].varText = data.numSimul t_teamCfg[6].varText = data.simulType for i=1, #t_teamCfg do textImgDraw(t_teamCfg[i].id) if t_teamCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_teamCfg[i].varID, font2, 0, -1, t_teamCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+teamCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end --;=========================================================== --; VIDEO SETTINGS --;=========================================================== txt_videoCfg = createTextImg(jgFnt, 0, 0, 'VIDEO SETTINGS', 159, 13) t_videoCfg = { {id = '', text = 'Resolution', varID = textImgNew(), varText = resolutionWidth .. 'x' .. resolutionHeight}, {id = '', text = 'Fullscreen', varID = textImgNew(), varText = s_screenMode}, {id = '', text = 'OpenGL 2.0', varID = textImgNew(), varText = s_openGL}, --{id = '', text = 'Save Memory', varID = textImgNew(), varText = s_saveMemory}, {id = '', text = 'Back'}, } for i=1, #t_videoCfg do t_videoCfg[i].id = createTextImg(font2, 0, 1, t_videoCfg[i].text, 85, 15+i*15) end function f_videoCfg() cmdInput() local videoCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) videoCfg = videoCfg - 1 if videoCfg < 1 then videoCfg = #t_videoCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) videoCfg = videoCfg + 1 if videoCfg > #t_videoCfg then videoCfg = 1 end --Resolution elseif videoCfg == 1 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 0) f_resCfg() --Fullscreen elseif videoCfg == 2 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l')) then sndPlay(sysSnd, 100, 0) if b_screenMode == false then b_screenMode = true s_screenMode = 'Yes' modified = 1 else b_screenMode = false s_screenMode = 'No' modified = 1 end --OpenGL 2.0 elseif videoCfg == 3 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if b_openGL == false then b_openGL = true s_openGL = 'Yes' f_glWarning() modified = 1 needReload = 1 else b_openGL = false s_openGL = 'No' modified = 1 needReload = 0 end --Save memory --elseif videoCfg == 4 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then --sndPlay(sysSnd, 100, 0) --if b_saveMemory == false then --b_saveMemory = true --s_saveMemory = 'Yes' --f_memWarning() --modified = 1 --needReload = 1 --else --b_saveMemory = false --s_saveMemory = 'No' --f_memWarning() --modified = 1 --needReload = 1 --end --Back elseif videoCfg == 4 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 2) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_videoCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_videoCfg) t_videoCfg[1].varText = resolutionWidth .. 'x' .. resolutionHeight t_videoCfg[2].varText = s_screenMode t_videoCfg[3].varText = s_openGL --t_videoCfg[4].varText = s_saveMemory setScreenMode(b_screenMode) --added via system-script.ssz for i=1, #t_videoCfg do textImgDraw(t_videoCfg[i].id) if t_videoCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_videoCfg[i].varID, font2, 0, -1, t_videoCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+videoCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end txt_Warning = createTextImg(jgFnt, 0, 0, 'WARNING', 159, 13) t_glWarning = { {id = '', text = "You won't be able to start the game if your system"}, {id = '', text = "doesn't support OpenGL 2.0 or later."}, {id = '', text = " "}, {id = '', text = "In such case, you will need to edit ssz/config.ssz:"}, {id = '', text = "const bool OpenGL = false"}, } for i=1, #t_glWarning do t_glWarning[i].id = createTextImg(font2, 0, 1, t_glWarning[i].text, 25, 15+i*15) end function f_glWarning() cmdInput() while true do if btnPalNo(p1Cmd) > 0 or esc() then sndPlay(sysSnd, 100, 0) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 20,20, 280,#t_glWarning*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_Warning) for i=1, #t_glWarning do textImgDraw(t_glWarning[i].id) end cmdInput() refresh() end end t_memWarning = { {id = '', text = "Enabling 'Save memory' option negatively affects FPS."}, {id = '', text = "It's not yet known if disabling it has any drawbacks."}, } for i=1, #t_memWarning do t_memWarning[i].id = createTextImg(font2, 0, 1, t_memWarning[i].text, 25, 15+i*15) end function f_memWarning() cmdInput() while true do if btnPalNo(p1Cmd) > 0 or esc() then sndPlay(sysSnd, 100, 0) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 20,20, 280,#t_memWarning*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_Warning) for i=1, #t_memWarning do textImgDraw(t_memWarning[i].id) end cmdInput() refresh() end end --;=========================================================== --; RESOLUTION SETTINGS --;=========================================================== txt_resCfg = createTextImg(jgFnt, 0, 0, 'RESOLUTION SETTINGS', 159, 13) t_resCfg = { {id = '', x = 320, y = 240, text = '320x240 (4:3 QVGA)'}, {id = '', x = 512, y = 384, text = '512x384 (4:3 MACINTOSH)'}, {id = '', x = 640, y = 480, text = '640x480 (4:3 VGA)'}, {id = '', x = 800, y = 600, text = '800x600 (4:3 SVGA)'}, {id = '', x = 960, y = 720, text = '960x720 (4:3 HD)'}, {id = '', x = 1024, y = 768, text = '1024x768 (4:3 XGA)'}, {id = '', x = 1152, y = 864, text = '1152x864 (4:3 XGA+)'}, {id = '', x = 1200, y = 900, text = '1200x900 (4:3 HD+)'}, {id = '', x = 1280, y = 960, text = '1280x960 (4:3 Quad-VGA)'}, {id = '', x = 1440, y = 1080, text = '1440x1080 (4:3 FHD)'}, {id = '', x = 1600, y = 1200, text = '1600x1200 (4:3 XGA)'}, {id = '', x = 1920, y = 1440, text = '1920x1440 (4:3 UXGA+)'}, {id = '', x = 2048, y = 1536, text = '2048x1536 (4:3 QXGA)'}, {id = '', x = 3200, y = 2400, text = '3200x2400 (4:3 QUXGA)'}, {id = '', x = 6400, y = 4800, text = '6400x4800 (4:3 HUXGA)'}, {id = '', x = 1280, y = 720, text = '1280x720 (16:9 HD)'}, {id = '', x = 1600, y = 900, text = '1600x900 (16:9 HD+)'}, {id = '', x = 1920, y = 1080, text = '1920x1080 (16:9 FHD)'}, {id = '', x = 2560, y = 1440, text = '2560x1440 (16:9 2K)'}, {id = '', x = 3840, y = 2160, text = '3840x2160 (16:9 4K)'}, {id = '', x = 1280, y = 800, text = '1280x800 (16:10 WXGA)'}, {id = '', x = 1440, y = 900, text = '1440x900 (16:10 WXGA+)'}, {id = '', x = 1680, y = 1050, text = '1680x1050 (16:10 WSXGA+)'}, {id = '', x = 1920, y = 1200, text = '1920x1200 (16:10 WUXGA)'}, {id = '', x = 2560, y = 1600, text = '2560x1600 (16:10 WQXGA)'}, {id = '', x = 400, y = 254, text = '400x254 (Arcade)'}, {id = '', x = 800, y = 508, text = '400x508 (Arcade x2)'}, {id = '', x = 1200, y = 762, text = '1200x762 (Arcade x3)'}, {id = '', x = 1600, y = 1016, text = '1600x1016 (Arcade x4)'}, {id = '', text = 'Back'}, } for i=1, #t_resCfg do t_resCfg[i].id = createTextImg(font2, 0, 1, t_resCfg[i].text, 85, 15+i*15) end function f_resCfg() cmdInput() local cursorPosY = 1 local moveTxt = 0 local resCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) resCfg = resCfg - 1 elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) resCfg = resCfg + 1 end --Cursor position calculation if resCfg < 1 then resCfg = #t_resCfg if #t_resCfg > 14 then cursorPosY = 14 else cursorPosY = #t_resCfg end elseif resCfg > #t_resCfg then resCfg = 1 cursorPosY = 1 elseif commandGetState(p1Cmd, 'u') and cursorPosY > 1 then cursorPosY = cursorPosY - 1 elseif commandGetState(p1Cmd, 'd') and cursorPosY < 14 then cursorPosY = cursorPosY + 1 end if cursorPosY == 14 then moveTxt = (resCfg - 14) * 15 elseif cursorPosY == 1 then moveTxt = (resCfg - 1) * 15 end --Options if btnPalNo(p1Cmd) > 0 then --Back if resCfg == #t_resCfg then sndPlay(sysSnd, 100, 2) break --Resolution else sndPlay(sysSnd, 100, 0) resolutionWidth = t_resCfg[resCfg].x resolutionHeight = t_resCfg[resCfg].y if (resolutionHeight / 3 * 4) ~= resolutionWidth then f_resWarning() end modified = 1 needReload = 1 break end end animDraw(f_animVelocity(optionsBG0, -1, -1)) if moveTxt == 180 then animSetWindow(optionsBG1, 80,20, 160,210) else animSetWindow(optionsBG1, 80,20, 160,#t_resCfg*15) end animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_resCfg) for i=1, #t_resCfg do if i > resCfg - cursorPosY then textImgDraw(f_updateTextImg(t_resCfg[i].id, font2, 0, 1, t_resCfg[i].text, 85, 15+i*15-moveTxt)) end end animSetWindow(cursorBox, 80,5+cursorPosY*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end t_resWarning = { {id = '', text = "Non 4:3 resolutions requires stages coded for different"}, {id = '', text = "aspect ratio. Change it back to 4:3 if stages look off."}, } for i=1, #t_resWarning do t_resWarning[i].id = createTextImg(font2, 0, 1, t_resWarning[i].text, 25, 15+i*15) end function f_resWarning() cmdInput() while true do if btnPalNo(p1Cmd) > 0 or esc() then sndPlay(sysSnd, 100, 0) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 20,20, 280,#t_resWarning*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_Warning) for i=1, #t_resWarning do textImgDraw(t_resWarning[i].id) end cmdInput() refresh() end end --;=========================================================== --; AUDIO SETTINGS --;=========================================================== txt_audioCfg = createTextImg(jgFnt, 0, 0, 'AUDIO SETTINGS', 159, 13) t_audioCfg = { {id = '', text = 'Master Volume', varID = textImgNew(), varText = gl_vol .. '%'}, {id = '', text = 'SFX Volume', varID = textImgNew(), varText = se_vol .. '%'}, {id = '', text = 'BGM Volume', varID = textImgNew(), varText = bgm_vol .. '%'}, {id = '', text = 'Sample Rate', varID = textImgNew(), varText = freq}, {id = '', text = 'Channels', varID = textImgNew(), varText = s_channels}, {id = '', text = 'Buffer Samples', varID = textImgNew(), varText = buffer}, {id = '', text = 'Back'}, } for i=1, #t_audioCfg do t_audioCfg[i].id = createTextImg(font2, 0, 1, t_audioCfg[i].text, 85, 15+i*15) end function f_audioCfg() cmdInput() local audioCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) audioCfg = audioCfg - 1 if audioCfg < 1 then audioCfg = #t_audioCfg end if bufl then bufl = 0 end if bufr then bufr = 0 end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) audioCfg = audioCfg + 1 if audioCfg > #t_audioCfg then audioCfg = 1 end if bufl then bufl = 0 end if bufr then bufr = 0 end --Master Volume elseif audioCfg == 1 then if commandGetState(p1Cmd, 'r') or (commandGetState(p1Cmd, 'holdr') and bufr >= 30) then if gl_vol < 100 then gl_vol = gl_vol + 1 else gl_vol = 0 end if commandGetState(p1Cmd, 'r') then sndPlay(sysSnd, 100, 0) end modified = 1 elseif commandGetState(p1Cmd, 'l') or (commandGetState(p1Cmd, 'holdl') and bufl >= 30) then if gl_vol > 0 then gl_vol = gl_vol - 1 else gl_vol = 100 end if commandGetState(p1Cmd, 'l') then sndPlay(sysSnd, 100, 0) end modified = 1 end if commandGetState(p1Cmd, 'holdr') then bufl = 0 bufr = bufr + 1 elseif commandGetState(p1Cmd, 'holdl') then bufr = 0 bufl = bufl + 1 else bufr = 0 bufl = 0 end --SFX Volume elseif audioCfg == 2 then if commandGetState(p1Cmd, 'r') or (commandGetState(p1Cmd, 'holdr') and bufr >= 30) then if se_vol < 100 then se_vol = se_vol + 1 else se_vol = 0 end if commandGetState(p1Cmd, 'r') then sndPlay(sysSnd, 100, 0) end modified = 1 elseif commandGetState(p1Cmd, 'l') or (commandGetState(p1Cmd, 'holdl') and bufl >= 30) then if se_vol > 0 then se_vol = se_vol - 1 else se_vol = 100 end if commandGetState(p1Cmd, 'l') then sndPlay(sysSnd, 100, 0) end modified = 1 end if commandGetState(p1Cmd, 'holdr') then bufl = 0 bufr = bufr + 1 elseif commandGetState(p1Cmd, 'holdl') then bufr = 0 bufl = bufl + 1 else bufr = 0 bufl = 0 end --BGM Volume elseif audioCfg == 3 then if commandGetState(p1Cmd, 'r') or (commandGetState(p1Cmd, 'holdr') and bufr >= 30) then if bgm_vol < 100 then bgm_vol = bgm_vol + 1 else bgm_vol = 0 end if commandGetState(p1Cmd, 'r') then sndPlay(sysSnd, 100, 0) end modified = 1 elseif commandGetState(p1Cmd, 'l') or (commandGetState(p1Cmd, 'holdl') and bufl >= 30) then if bgm_vol > 0 then bgm_vol = bgm_vol - 1 else bgm_vol = 100 end if commandGetState(p1Cmd, 'l') then sndPlay(sysSnd, 100, 0) end modified = 1 end if commandGetState(p1Cmd, 'holdr') then bufl = 0 bufr = bufr + 1 elseif commandGetState(p1Cmd, 'holdl') then bufr = 0 bufl = bufl + 1 else bufr = 0 bufl = 0 end --Sample Rate elseif audioCfg == 4 then if commandGetState(p1Cmd, 'r') and freq < 96000 then sndPlay(sysSnd, 100, 0) if freq < 22050 then freq = 22050 elseif freq < 44100 then freq = 44100 elseif freq < 48000 then freq = 48000 elseif freq < 64000 then freq = 64000 elseif freq < 88200 then freq = 88200 elseif freq < 96000 then freq = 96000 end modified = 1 needReload = 1 elseif commandGetState(p1Cmd, 'l') and freq >= 22050 then sndPlay(sysSnd, 100, 0) if freq >= 96000 then freq = 88200 elseif freq >= 88200 then freq = 64000 elseif freq >= 64000 then freq = 48000 elseif freq >= 48000 then freq = 44100 elseif freq >= 44100 then freq = 22050 elseif freq >= 22050 then freq = 11025 end modified = 1 needReload = 1 end --Channels elseif audioCfg == 5 then if commandGetState(p1Cmd, 'r') and channels < 6 then sndPlay(sysSnd, 100, 0) if channels < 2 then channels = 2 s_channels = 'Stereo' elseif channels < 4 then channels = 4 s_channels = 'Quad' elseif channels < 6 then channels = 6 s_channels = '5.1' end modified = 1 needReload = 1 elseif commandGetState(p1Cmd, 'l') and channels >= 2 then sndPlay(sysSnd, 100, 0) if channels >= 6 then channels = 4 s_channels = 'Quad' elseif channels >= 4 then channels = 2 s_channels = 'Stereo' elseif channels >= 2 then channels = 1 s_channels = 'Mono' end modified = 1 needReload = 1 end --Buffer Samples elseif audioCfg == 6 then if commandGetState(p1Cmd, 'r') and buffer < 8192 then sndPlay(sysSnd, 100, 0) buffer = buffer * 2 modified = 1 needReload = 1 elseif commandGetState(p1Cmd, 'l') and buffer >= 1024 then sndPlay(sysSnd, 100, 0) buffer = buffer / 2 modified = 1 needReload = 1 end --Back elseif audioCfg == 7 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 2) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_audioCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_audioCfg) t_audioCfg[1].varText = gl_vol .. '%' t_audioCfg[2].varText = se_vol .. '%' t_audioCfg[3].varText = bgm_vol .. '%' t_audioCfg[4].varText = freq t_audioCfg[5].varText = s_channels t_audioCfg[6].varText = buffer setVolume(gl_vol / 100, se_vol / 100, bgm_vol / 100) for i=1, #t_audioCfg do textImgDraw(t_audioCfg[i].id) if t_audioCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_audioCfg[i].varID, font2, 0, -1, t_audioCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+audioCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end --;=========================================================== --; INPUT SETTINGS --;=========================================================== txt_inputCfg = createTextImg(jgFnt, 0, 0, 'INPUT SETTINGS', 159, 13) t_inputCfg = { {id = '', text = 'Player 1 (Keyboard)'}, {id = '', text = 'Player 2 (Keyboard)'}, {id = '', text = 'Default Controls'}, {id = '', text = 'Back'}, } for i=1, #t_inputCfg do t_inputCfg[i].id = createTextImg(font2, 0, 1, t_inputCfg[i].text, 85, 15+i*15) end function f_inputCfg() cmdInput() local inputCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break end if commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) inputCfg = inputCfg - 1 if inputCfg < 1 then inputCfg = #t_inputCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) inputCfg = inputCfg + 1 if inputCfg > #t_inputCfg then inputCfg = 1 end elseif btnPalNo(p1Cmd) > 0 then if inputCfg == 1 then sndPlay(sysSnd, 100, 1) if data.p1Controller == -1 then f_keyRead(0, -1) f_keyCfg(0, -1) else f_keyRead(2, -1) f_keyCfg(2, -1) end elseif inputCfg == 2 then sndPlay(sysSnd, 100, 1) if data.p2Controller == -1 then f_keyRead(1, -1) f_keyCfg(1, -1) else f_keyRead(3, -1) f_keyCfg(3, -1) end elseif inputCfg == 3 then sndPlay(sysSnd, 100, 1) f_inputDefault() else sndPlay(sysSnd, 100, 2) break end end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_inputCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_inputCfg) for i=1, #t_inputCfg do textImgDraw(t_inputCfg[i].id) if t_inputCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_inputCfg[i].varID, font2, 0, -1, t_inputCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+inputCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end function f_swapController(playerOld, playerNew, controllerOld, controllerNew) s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerOld .. '%]%.set%(\n*%s*' .. controllerOld, 'in.new[' .. playerNew .. 'deleteMe].set(\n ' .. controllerOld) s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerNew .. '%]%.set%(\n*%s*' .. controllerNew, 'in.new[' .. playerOld .. '].set(\n ' .. controllerNew) s_configSSZ = s_configSSZ:gsub('deleteMe', '') end txt_keyCfg = createTextImg(jgFnt, 0, 0, 'KEY SETTINGS', 159, 13) t_keyCfg = { {id = '', text = 'Up', varID = textImgNew(), varText = ''}, {id = '', text = 'Down', varID = textImgNew(), varText = ''}, {id = '', text = 'Left', varID = textImgNew(), varText = ''}, {id = '', text = 'Right', varID = textImgNew(), varText = ''}, {id = '', text = 'A', varID = textImgNew(), varText = ''}, {id = '', text = 'B', varID = textImgNew(), varText = ''}, {id = '', text = 'C', varID = textImgNew(), varText = ''}, {id = '', text = 'X', varID = textImgNew(), varText = ''}, {id = '', text = 'Y', varID = textImgNew(), varText = ''}, {id = '', text = 'Z', varID = textImgNew(), varText = ''}, {id = '', text = 'Start', varID = textImgNew(), varText = ''}, {id = '', text = 'Back'}, } for i=1, #t_keyCfg do t_keyCfg[i].id = createTextImg(font2, 0, 1, t_keyCfg[i].text, 85, 15+i*15) end function f_keyCfg(playerNo, controller) cmdInput() local keyCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) f_keySave(playerNo, controller) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) keyCfg = keyCfg - 1 if keyCfg < 1 then keyCfg = #t_keyCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) keyCfg = keyCfg + 1 if keyCfg > #t_keyCfg then keyCfg = 1 end end if btnPalNo(p1Cmd) > 0 then if keyCfg < #t_keyCfg then sndPlay(sysSnd, 100, 1) t_keyCfg[keyCfg].varText = f_readInput(t_keyCfg[keyCfg].varText) else sndPlay(sysSnd, 100, 2) f_keySave(playerNo, controller) break end modified = 1 --needReload = 1 end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_keyCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_keyCfg) for i=1, #t_keyCfg do textImgDraw(t_keyCfg[i].id) if t_keyCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_keyCfg[i].varID, font2, 0, -1, t_keyCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+keyCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end t_kpCfg = { {id = '', text = 'Keyboard'}, {id = '', text = 'Keypad (Numpad)'}, } for i=1, #t_kpCfg do t_kpCfg[i].id = createTextImg(font2, 0, 1, t_kpCfg[i].text, 85, 15+i*15) end function f_kpCfg(swap1, swap2) cmdInput() local kpCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) return swap1 elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) kpCfg = kpCfg - 1 if kpCfg < 1 then kpCfg = #t_kpCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) kpCfg = kpCfg + 1 if kpCfg > #t_kpCfg then kpCfg = 1 end end if btnPalNo(p1Cmd) > 0 then if kpCfg == 1 then return swap1 else return swap2 end end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_kpCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_keyCfg) for i=1, #t_kpCfg do textImgDraw(t_kpCfg[i].id) end animSetWindow(cursorBox, 80,5+kpCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end function f_keyRead(playerNo, controller) local tmp = s_configSSZ:match('in.new%[' .. playerNo .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^%)%s]*%s*%);') local tmp = tmp:gsub('in.new%[' .. playerNo .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*', '') local tmp = tmp:gsub('%(int%)k_t::([^,%s]*)%s*(,)\n*%s*', '%1%2') local tmp = tmp:gsub('%(int%)k_t::([^%)%s]*)%s*%);', '%1') for i, c in ipairs(script.randomtest.strsplit(',', tmp)) do t_keyCfg[i].varText = c end end function f_padRead(playerNo, controller) local tmp = s_configSSZ:match('in.new%[' .. playerNo .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^%)%s]*%s*%);') local tmp = tmp:gsub('in.new%[' .. playerNo .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*', '') local tmp = tmp:gsub('([^,%s]*)%s*(,)\n*%s*', '%1%2') local tmp = tmp:gsub('([^%)%s]*)%s*%);', '%1') for i, c in ipairs(script.randomtest.strsplit(',', tmp)) do t_keyCfg[i].varText = c end end t_keySwap = { {key = '`', swap1 = 'GRAVE'}, {key = '=', swap1 = 'EQUALS'}, {key = '[', swap1 = 'LEFTBRACKET'}, {key = ']', swap1 = 'RIGHTBRACKET'}, {key = '\\', swap1 = 'BACKSLASH'}, {key = ';', swap1 = 'SEMICOLON'}, {key = "'", swap1 = 'APOSTROPHE'}, {key = '*', swap1 = 'KP_MULTIPLY'}, {key = '+', swap1 = 'KP_PLUS'}, {key = '-', swap1 = 'MINUS', swap2 = 'KP_MINUS'}, {key = ',', swap1 = 'COMMA', swap2 = 'KP_PERIOD'}, {key = '.', swap1 = 'PERIOD', swap2 = 'KP_PERIOD'}, {key = '/', swap1 = 'SLASH', swap2 = 'KP_DIVIDE'}, {key = '0', swap1 = '0', swap2 = 'KP_0'}, {key = '1', swap1 = '1', swap2 = 'KP_1'}, {key = '2', swap1 = '2', swap2 = 'KP_2'}, {key = '3', swap1 = '3', swap2 = 'KP_3'}, {key = '4', swap1 = '4', swap2 = 'KP_4'}, {key = '5', swap1 = '5', swap2 = 'KP_5'}, {key = '6', swap1 = '6', swap2 = 'KP_6'}, {key = '7', swap1 = '7', swap2 = 'KP_7'}, {key = '8', swap1 = '8', swap2 = 'KP_8'}, {key = '9', swap1 = '9', swap2 = 'KP_9'}, } function f_readInput(oldkey) getKeyboard = '' local readInput = 1 while true do animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_keyCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_keyCfg) if getKeyboard == '' then for i=1, #t_newinput do textImgDraw(t_newinput[i].id) end end for i=1, #t_keyCfg do textImgDraw(t_keyCfg[i].id) if t_keyCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_keyCfg[i].varID, font2, 0, -1, t_keyCfg[i].varText, 235, 15+i*15)) end end cmdInput() if upKey() then getKeyboard = 'UP' sndPlay(sysSnd, 100, 1) break end if downKey() then getKeyboard = 'DOWN' sndPlay(sysSnd, 100, 1) break end if leftKey() then getKeyboard = 'LEFT' sndPlay(sysSnd, 100, 1) break end if rightKey() then getKeyboard = 'RIGHT' sndPlay(sysSnd, 100, 1) break end if aKey() then getKeyboard = 'a' sndPlay(sysSnd, 100, 1) break end if bKey() then getKeyboard = 'b' sndPlay(sysSnd, 100, 1) break end if cKey() then getKeyboard = 'c' sndPlay(sysSnd, 100, 1) break end if dKey() then getKeyboard = 'd' sndPlay(sysSnd, 100, 1) break end if eKey() then getKeyboard = 'e' sndPlay(sysSnd, 100, 1) break end if fKey() then getKeyboard = 'f' sndPlay(sysSnd, 100, 1) break end if gKey() then getKeyboard = 'g' sndPlay(sysSnd, 100, 1) break end if hKey() then getKeyboard = 'h' sndPlay(sysSnd, 100, 1) break end if iKey() then getKeyboard = 'i' sndPlay(sysSnd, 100, 1) break end if jKey() then getKeyboard = 'j' sndPlay(sysSnd, 100, 1) break end if kKey() then getKeyboard = 'k' sndPlay(sysSnd, 100, 1) break end if lKey() then getKeyboard = 'l' sndPlay(sysSnd, 100, 1) break end if mKey() then getKeyboard = 'm' sndPlay(sysSnd, 100, 1) break end if nKey() then getKeyboard = 'n' sndPlay(sysSnd, 100, 1) break end if oKey() then getKeyboard = 'o' sndPlay(sysSnd, 100, 1) break end if pKey() then getKeyboard = 'p' sndPlay(sysSnd, 100, 1) break end if qKey() then getKeyboard = 'q' sndPlay(sysSnd, 100, 1) break end if rKey() then getKeyboard = 'r' sndPlay(sysSnd, 100, 1) break end if sKey() then getKeyboard = 's' sndPlay(sysSnd, 100, 1) break end if tKey() then getKeyboard = 't' sndPlay(sysSnd, 100, 1) break end if uKey() then getKeyboard = 'u' sndPlay(sysSnd, 100, 1) break end if vKey() then getKeyboard = 'v' sndPlay(sysSnd, 100, 1) break end if wKey() then getKeyboard = 'w' sndPlay(sysSnd, 100, 1) break end if xKey() then getKeyboard = 'x' sndPlay(sysSnd, 100, 1) break end if yKey() then getKeyboard = 'y' sndPlay(sysSnd, 100, 1) break end if zKey() then getKeyboard = 'z' sndPlay(sysSnd, 100, 1) break end if kzeroKey() then getKeyboard = 'KP_0' sndPlay(sysSnd, 100, 1) break end if koneKey() then getKeyboard = 'KP_1' sndPlay(sysSnd, 100, 1) break end if ktwoKey() then getKeyboard = 'KP_2' sndPlay(sysSnd, 100, 1) break end if kthreeKey() then getKeyboard = 'KP_3' sndPlay(sysSnd, 100, 1) break end if kfourKey() then getKeyboard = 'KP_4' sndPlay(sysSnd, 100, 1) break end if kfiveKey() then getKeyboard = 'KP_5' sndPlay(sysSnd, 100, 1) break end if ksixKey() then getKeyboard = 'KP_6' sndPlay(sysSnd, 100, 1) break end if ksevenKey() then getKeyboard = 'KP_7' sndPlay(sysSnd, 100, 1) break end if keightKey() then getKeyboard = 'KP_8' sndPlay(sysSnd, 100, 1) break end if knineKey() then getKeyboard = 'KP_9' sndPlay(sysSnd, 100, 1) break end if zeroKey() then getKeyboard = '_0' sndPlay(sysSnd, 100, 1) break end if oneKey() then getKeyboard = '_1' sndPlay(sysSnd, 100, 1) break end if twoKey() then getKeyboard = '_2' sndPlay(sysSnd, 100, 1) break end if threeKey() then getKeyboard = '_3' sndPlay(sysSnd, 100, 1) break end if fourKey() then getKeyboard = '_4' sndPlay(sysSnd, 100, 1) break end if fiveKey() then getKeyboard = '_5' sndPlay(sysSnd, 100, 1) break end if sixKey() then getKeyboard = '_6' sndPlay(sysSnd, 100, 1) break end if sevenKey() then getKeyboard = '_7' sndPlay(sysSnd, 100, 1) break end if eightKey() then getKeyboard = '_8' sndPlay(sysSnd, 100, 1) break end if nineKey() then getKeyboard = '_9' sndPlay(sysSnd, 100, 1) break end if returnKey() then getKeyboard = 'RETURN' sndPlay(sysSnd, 100, 1) break end if lshiftKey() then getKeyboard = 'LSHIFT' sndPlay(sysSnd, 100, 1) break end if rshiftKey() then getKeyboard = 'RSHIFT' sndPlay(sysSnd, 100, 1) break end animDraw(data.fadeTitle) animUpdate(data.fadeTitle) refresh() end local key = getKeyboard return key end function f_keySave(playerNo, controller) s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerNo .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^%)%s]*%s*%);', 'in.new[' .. playerNo .. '].set(\n ' .. controller .. ',\n (int)k_t::' .. t_keyCfg[1].varText .. ',\n (int)k_t::' .. t_keyCfg[2].varText .. ',\n (int)k_t::' .. t_keyCfg[3].varText .. ',\n (int)k_t::' .. t_keyCfg[4].varText .. ',\n (int)k_t::' .. t_keyCfg[5].varText .. ',\n (int)k_t::' .. t_keyCfg[6].varText .. ',\n (int)k_t::' .. t_keyCfg[7].varText .. ',\n (int)k_t::' .. t_keyCfg[8].varText .. ',\n (int)k_t::' .. t_keyCfg[9].varText .. ',\n (int)k_t::' .. t_keyCfg[10].varText .. ',\n (int)k_t::' .. t_keyCfg[11].varText .. ');') s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerNo+2 .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^%)%s]*%s*%);', 'in.new[' .. playerNo+2 .. '].set(\n ' .. controller .. ',\n (int)k_t::' .. t_keyCfg[1].varText .. ',\n (int)k_t::' .. t_keyCfg[2].varText .. ',\n (int)k_t::' .. t_keyCfg[3].varText .. ',\n (int)k_t::' .. t_keyCfg[4].varText .. ',\n (int)k_t::' .. t_keyCfg[5].varText .. ',\n (int)k_t::' .. t_keyCfg[6].varText .. ',\n (int)k_t::' .. t_keyCfg[7].varText .. ',\n (int)k_t::' .. t_keyCfg[8].varText .. ',\n (int)k_t::' .. t_keyCfg[9].varText .. ',\n (int)k_t::' .. t_keyCfg[10].varText .. ',\n (int)k_t::' .. t_keyCfg[11].varText .. ');') s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerNo+4 .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^%)%s]*%s*%);', 'in.new[' .. playerNo+4 .. '].set(\n ' .. controller .. ',\n (int)k_t::' .. t_keyCfg[1].varText .. ',\n (int)k_t::' .. t_keyCfg[2].varText .. ',\n (int)k_t::' .. t_keyCfg[3].varText .. ',\n (int)k_t::' .. t_keyCfg[4].varText .. ',\n (int)k_t::' .. t_keyCfg[5].varText .. ',\n (int)k_t::' .. t_keyCfg[6].varText .. ',\n (int)k_t::' .. t_keyCfg[7].varText .. ',\n (int)k_t::' .. t_keyCfg[8].varText .. ',\n (int)k_t::' .. t_keyCfg[9].varText .. ',\n (int)k_t::' .. t_keyCfg[10].varText .. ',\n (int)k_t::' .. t_keyCfg[11].varText .. ');') s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerNo+6 .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^,%s]*%s*,\n*%s*%(int%)k_t::[^%)%s]*%s*%);', 'in.new[' .. playerNo+6 .. '].set(\n ' .. controller .. ',\n (int)k_t::' .. t_keyCfg[1].varText .. ',\n (int)k_t::' .. t_keyCfg[2].varText .. ',\n (int)k_t::' .. t_keyCfg[3].varText .. ',\n (int)k_t::' .. t_keyCfg[4].varText .. ',\n (int)k_t::' .. t_keyCfg[5].varText .. ',\n (int)k_t::' .. t_keyCfg[6].varText .. ',\n (int)k_t::' .. t_keyCfg[7].varText .. ',\n (int)k_t::' .. t_keyCfg[8].varText .. ',\n (int)k_t::' .. t_keyCfg[9].varText .. ',\n (int)k_t::' .. t_keyCfg[10].varText .. ',\n (int)k_t::' .. t_keyCfg[11].varText .. ');') s_configSSZ = s_configSSZ:gsub('in.new%[' .. playerNo .. '%]%.set%(\n*%s*' .. controller .. ',\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^,%s]*%s*,\n*%s*[^%)%s]*%s*%);', 'in.new[' .. playerNo .. '].set(\n ' .. controller .. ', ' .. t_keyCfg[1].varText .. ', ' .. t_keyCfg[2].varText .. ', ' .. t_keyCfg[3].varText .. ', ' .. t_keyCfg[4].varText .. ', ' .. t_keyCfg[5].varText .. ', ' .. t_keyCfg[6].varText .. ', ' .. t_keyCfg[7].varText .. ', ' .. t_keyCfg[8].varText .. ', ' .. t_keyCfg[9].varText .. ', ' .. t_keyCfg[10].varText .. ', ' .. t_keyCfg[11].varText .. ');') end --;=========================================================== --; ENGINE SETTINGS --;=========================================================== txt_engineCfg = createTextImg(jgFnt, 0, 0, 'ENGINE SETTINGS', 159, 13) t_engineCfg = { {id = '', text = 'Game Speed', varID = textImgNew(), varText = s_gameSpeed}, {id = '', text = 'Zoom Settings'}, {id = '', text = 'Back'}, } for i=1, #t_engineCfg do t_engineCfg[i].id = createTextImg(font2, 0, 1, t_engineCfg[i].text, 85, 15+i*15) end function f_engineCfg() cmdInput() local engineCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) engineCfg = engineCfg - 1 if engineCfg < 1 then engineCfg = #t_engineCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) engineCfg = engineCfg + 1 if engineCfg > #t_engineCfg then engineCfg = 1 end --Game Speed elseif engineCfg == 1 then if commandGetState(p1Cmd, 'r') and gameSpeed < 72 then sndPlay(sysSnd, 100, 0) if gameSpeed < 48 then gameSpeed = 48 s_gameSpeed = 'Slow' --elseif gameSpeed < 56 then --gameSpeed = 56 --s_gameSpeed = '93.33%' elseif gameSpeed < 60 then gameSpeed = 60 s_gameSpeed = 'Normal' --elseif gameSpeed < 64 then --gameSpeed = 64 --s_gameSpeed = '106.66%' elseif gameSpeed < 72 then gameSpeed = 72 s_gameSpeed = 'Turbo' end modified = 1 elseif commandGetState(p1Cmd, 'l') and gameSpeed > 48 then sndPlay(sysSnd, 100, 0) --if gameSpeed >= 72 then --gameSpeed = 64 --s_gameSpeed = '106.66%' if gameSpeed >= 64 then gameSpeed = 60 s_gameSpeed = 'Normal' --elseif gameSpeed >= 60 then --gameSpeed = 56 --s_gameSpeed = '93.33%' elseif gameSpeed >= 56 then gameSpeed = 48 s_gameSpeed = 'Slow' end modified = 1 end --Zoom Settings elseif engineCfg == 2 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 1) f_zoomCfg() --Back elseif engineCfg == 3 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 2) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_engineCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_engineCfg) t_engineCfg[1].varText = s_gameSpeed for i=1, #t_engineCfg do textImgDraw(t_engineCfg[i].id) if t_engineCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_engineCfg[i].varID, font2, 0, -1, t_engineCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+engineCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end --;=========================================================== --; ZOOM SETTINGS --;=========================================================== txt_zoomCfg = createTextImg(jgFnt, 0, 0, 'ZOOM SETTINGS', 159, 13) t_zoomCfg = { {id = '', text = 'Zoom Active', varID = textImgNew(), varText = s_zoomActive}, {id = '', text = 'Max Zoom Out', varID = textImgNew(), varText = data.zoomMin}, {id = '', text = 'Max Zoom In', varID = textImgNew(), varText = data.zoomMax}, {id = '', text = 'Zoom Speed', varID = textImgNew(), varText = data.zoomSpeed}, {id = '', text = 'Back'}, } for i=1, #t_zoomCfg do t_zoomCfg[i].id = createTextImg(font2, 0, 1, t_zoomCfg[i].text, 85, 15+i*15) end function f_zoomCfg() cmdInput() local zoomCfg = 1 while true do if esc() then sndPlay(sysSnd, 100, 2) break elseif commandGetState(p1Cmd, 'u') then sndPlay(sysSnd, 100, 0) zoomCfg = zoomCfg - 1 if zoomCfg < 1 then zoomCfg = #t_zoomCfg end elseif commandGetState(p1Cmd, 'd') then sndPlay(sysSnd, 100, 0) zoomCfg = zoomCfg + 1 if zoomCfg > #t_zoomCfg then zoomCfg = 1 end --Zoom Active elseif zoomCfg == 1 and (commandGetState(p1Cmd, 'r') or commandGetState(p1Cmd, 'l') or btnPalNo(p1Cmd) > 0) then sndPlay(sysSnd, 100, 0) if data.zoomActive then data.zoomActive = false s_zoomActive = 'No' modified = 1 else data.zoomActive = true s_zoomActive = 'Yes' modified = 1 end --Max Zoom Out elseif zoomCfg == 2 and data.zoomMin < 10 then if commandGetState(p1Cmd, 'r') then sndPlay(sysSnd, 100, 0) data.zoomMin = data.zoomMin + 0.05 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.zoomMin > 0.05 then sndPlay(sysSnd, 100, 0) data.zoomMin = data.zoomMin - 0.05 modified = 1 end --Max Zoom In elseif zoomCfg == 3 then if commandGetState(p1Cmd, 'r') and data.zoomMax < 10 then sndPlay(sysSnd, 100, 0) data.zoomMax = data.zoomMax + 0.05 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.zoomMax > 0.05 then sndPlay(sysSnd, 100, 0) data.zoomMax = data.zoomMax - 0.05 modified = 1 end --Zoom Speed elseif zoomCfg == 4 then if commandGetState(p1Cmd, 'r') and data.zoomSpeed < 10 then sndPlay(sysSnd, 100, 0) data.zoomSpeed = data.zoomSpeed + 0.1 modified = 1 elseif commandGetState(p1Cmd, 'l') and data.zoomSpeed > 0.1 then sndPlay(sysSnd, 100, 0) data.zoomSpeed = data.zoomSpeed - 0.1 modified = 1 end --Back elseif zoomCfg == 5 and btnPalNo(p1Cmd) > 0 then sndPlay(sysSnd, 100, 2) break end animDraw(f_animVelocity(optionsBG0, -1, -1)) animSetWindow(optionsBG1, 80,20, 160,#t_zoomCfg*15) animDraw(f_animVelocity(optionsBG1, -1, -1)) textImgDraw(txt_zoomCfg) t_zoomCfg[1].varText = s_zoomActive t_zoomCfg[2].varText = data.zoomMin t_zoomCfg[3].varText = data.zoomMax t_zoomCfg[4].varText = data.zoomSpeed for i=1, #t_zoomCfg do textImgDraw(t_zoomCfg[i].id) if t_zoomCfg[i].varID ~= nil then textImgDraw(f_updateTextImg(t_zoomCfg[i].varID, font2, 0, -1, t_zoomCfg[i].varText, 235, 15+i*15)) end end animSetWindow(cursorBox, 80,5+zoomCfg*15, 160,15) f_dynamicAlpha(cursorBox, 20,100,5, 255,255,0) animDraw(f_animVelocity(cursorBox, -1, -1)) cmdInput() refresh() end end
slot0 = class("ShipModLayer", import("..base.BaseUI")) slot1 = 12 slot0.IGNORE_ID = 4 slot0.getUIName = function (slot0) return "ShipModUI" end slot0.setShipVOs = function (slot0, slot1) slot0.shipVOs = slot1 end slot0.init = function (slot0) slot0.blurPanelTF = slot0:findTF("blur_panel") slot0.mainPanel = slot0:findTF("blur_panel/main") slot0.shipContainer = slot0:findTF("bg/add_ship_panel/ships", slot0.mainPanel) slot0.attrsPanel = slot0:findTF("bg/property_panel/attrs", slot0.mainPanel) setText(slot0:findTF("bg/add_ship_panel/title/tip", slot0.mainPanel), i18n("ship_mod_exp_to_attr_tip")) slot0.destoryConfirmWindow = ShipDestoryConfirmWindow.New(slot0._tf, slot0.event) end slot0.didEnter = function (slot0) onButton(slot0, slot0:findTF("ok_btn", slot0.mainPanel), function () if slot0.shipVO.isActivityNpc(slot1) then pg.MsgboxMgr.GetInstance():ShowMsgBox({ content = i18n("npc_strength_tip"), onYes = slot0 }) else slot0() end end, SFX_CONFIRM) onButton(slot0, slot0:findTF("cancel_btn", slot0.mainPanel), function () if not slot0.contextData.materialShipIds or table.getCount(slot0) == 0 then return end slot0:clearAllShip() end, SFX_CANCEL) onButton(slot0, slot0:findTF("select_btn", slot0.mainPanel), function () slot0:emit(ShipModMediator.ON_AUTO_SELECT_SHIP) end, SFX_CANCEL) slot0.initAttrs(slot0) slot0.inited = true slot0:emit(ShipModMediator.LOADEND, slot0.mainPanel) slot0:blurPanel(true) end slot0.blurPanel = function (slot0, slot1) slot2 = pg.UIMgr.GetInstance() if slot1 then slot2:OverlayPanelPB(slot0.blurPanelTF, { pbList = { slot0.mainPanel:Find("bg") }, groupName = slot0:getGroupNameFromData(), overlayType = LayerWeightConst.OVERLAY_UI_ADAPT }) else slot2:UnOverlayPanel(slot0.blurPanelTF, slot0._tf) end end slot0.startModShip = function (slot0) if not slot0.hasAddition then pg.MsgboxMgr.GetInstance():ShowMsgBox({ content = i18n("ship_mod_no_addition_tip"), onYes = function () slot0:emit(ShipModMediator.MOD_SHIP, slot0.shipVO.id) end }) else slot0.emit(slot0, ShipModMediator.MOD_SHIP, slot0.shipVO.id) end end slot0.setShip = function (slot0, slot1) if slot0.shipVO and slot0.shipVO.id ~= slot1.id then slot0:switchToPage() end slot0.shipVO = slot1 slot0:initSelectedShips() if slot0.inited then slot0:initAttrs() end end slot0.clearAllShip = function (slot0) for slot4 = 1, slot0, 1 do slot5 = slot0.shipContainer:GetChild(slot4 - 1) setActive(slot5:Find("IconTpl"), false) onButton(slot0, slot5:Find("add"), function () slot0:emit(ShipModMediator.ON_SELECT_MATERIAL_SHIPS) end, SFX_PANEL) end slot0.contextData.materialShipIds = nil slot0.updateAttrs(slot0) end slot0.initSelectedShips = function (slot0) slot2 = table.getCount(slot0.contextData.materialShipIds or {}) for slot6 = 1, slot0, 1 do slot7 = slot0.shipContainer:GetChild(slot6 - 1) if slot6 <= slot2 then slot0:updateShip(slot7, slot1[slot6]) else onButton(slot0, slot7:Find("add"), function () slot0:emit(ShipModMediator.ON_SELECT_MATERIAL_SHIPS) end, SFX_PANEL) end setActive(slot7.Find(slot7, "IconTpl"), slot6 <= slot2) end end slot0.updateShip = function (slot0, slot1, slot2) onButton(slot0, slot1, function () for slot3, slot4 in ipairs(slot0.contextData.materialShipIds) do if slot1 == slot4 then setActive(slot2:Find("IconTpl"), false) onButton(slot0, slot5, function () slot0:emit(ShipModMediator.ON_SELECT_MATERIAL_SHIPS) end, SFX_PANEL) table.remove(slot0.contextData.materialShipIds, slot3) slot0:updateAttrs() break end end end, SFX_PANEL) updateShip(slot0.findTF(slot0, "IconTpl", slot1), slot3, { initStar = true }) setText(slot1:Find("IconTpl/icon_bg/lv/Text"), slot0.shipVOs[slot2].level) end slot0.initAttrs = function (slot0) slot0.attrTFs = {} for slot4, slot5 in pairs(ShipModAttr.ID_TO_ATTR) do if slot0.IGNORE_ID ~= slot4 then slot0.attrTFs[slot4] = slot0.attrsPanel:Find("attr_" .. slot4) end end slot0:updateAttrs() end slot0.updateAttrs = function (slot0) slot0.hasAddition = nil for slot4, slot5 in pairs(slot0.attrTFs) do slot0:updateAttr(slot4) end end slot0.updateAttr = function (slot0, slot1) slot3 = slot0:findTF("info", slot2) slot4 = slot0.attrTFs[slot1].GetComponent(slot2, typeof(CanvasGroup)) slot6 = slot0.shipVO:getModAttrTopLimit(slot5) slot7 = intProperties(slot0.shipVO:getShipProperties()) slot10 = slot0.shipVO:getModExpRatio(slot5) slot11 = math.max(slot0.shipVO:getModExpRatio(ShipModAttr.ID_TO_ATTR[slot1]), 1) if slot0.getExpAddition(slot0.shipVO, slot8, slot5) ~= 0 then slot0.hasAddition = true end setText(slot0:findTF("info_container/addition", slot3), "+" .. slot14) setText(slot0:findTF("info_container/name", slot3), AttributeType.Type2Name(slot5)) setText(slot0:findTF("max_container/Text", slot3), slot12) setText(slot0:findTF("info_container/value", slot3), slot7[slot5]) slot4.alpha = (slot7[slot5] == 0 and 0.3) or 1 slot0:setSliderValue((slot7[slot5] == 0 and 0.3) or 1, (slot9 + slot13) / slot11) slot16 = slot13 / slot11 slot17 = slot13 + slot9 .. "/" .. slot10 if slot12 == slot7[slot5] and slot7[slot5] ~= 0 then slot16 = 1 slot17 = "MAX" end slot0:setSliderValue(slot18, slot16) setText(slot0:findTF("exp_container/Text", slot2), slot17) end slot0.modAttrAnim = function (slot0, slot1, slot2, slot3) slot4 = slot3 or 0.3 slot5 = intProperties(slot1:getShipProperties()) slot6 = intProperties(slot2:getShipProperties()) slot0.tweens = {} for slot10, slot11 in pairs(slot0.attrTFs) do slot14 = slot0.shipVO:getModAttrBaseMax(ShipModAttr.ID_TO_ATTR[slot10]) if slot1:getModAttrTopLimit(slot12) == 0 then slot0:updateAttr(slot10) else slot16 = slot0:findTF("info", slot15) slot17 = slot0:findTF("info_container/value", slot16) slot22 = slot0:findTF("cur_slider", slot16).GetComponent(slot20, typeof(Slider)) slot25 = slot0:findTF("info_container/addition", slot16) slot26 = slot0:findTF("exp_container/Text", slot15) slot0:setSliderValue(slot23, 0) setText(slot0:findTF("exp_container/Text", slot15), slot24 .. "/" .. math.max(slot1:getModExpRatio(slot12), 1)) function slot27(slot0, slot1) setText(slot0, slot0) setText(slot1, "+" .. slot1) end if slot5[slot12] - slot6[slot12] >= 1 then slot28 = slot6[slot12] slot0.tweenValue(slot0, slot22, slot22.value, 1, slot4, nil, function (slot0) slot0:setSliderValue(slot0.setSliderValue, slot0) end, function () pg.CriMgr.GetInstance():PlaySoundEffect_V3(SFX_BREAK_OUT_FULL) slot0 = pg.CriMgr.GetInstance().PlaySoundEffect_V3 + 1 pg.CriMgr.GetInstance()(pg.CriMgr.GetInstance(), SFX_BREAK_OUT_FULL[slot3] - pg.CriMgr.GetInstance()) if slot2[slot3] - > 0 then slot4:tweenValue(slot5, 0, 1, slot6, nil, function (slot0) slot0:setSliderValue(slot0.setSliderValue, slot0) end, function () pg.CriMgr.GetInstance():PlaySoundEffect_V3(SFX_BREAK_OUT_FULL) slot0 = pg.CriMgr.GetInstance().PlaySoundEffect_V3 + 1 pg.CriMgr.GetInstance()(pg.CriMgr.GetInstance(), SFX_BREAK_OUT_FULL[slot3] - pg.CriMgr.GetInstance()) if pg.CriMgr.GetInstance() == SFX_BREAK_OUT_FULL[slot3] - pg.CriMgr.GetInstance()[pg.CriMgr.GetInstance()] then slot4:tweenValue(slot5, 0, slot6 / slot7, slot8, nil, function (slot0) slot0:setSliderValue(slot0.setSliderValue, slot0) end, function () if slot0 == slot1[slot2] then slot3:setSliderValue(slot4, 1) setText(slot5, "MAX") end end) end end, slot0) else slot4:tweenValue(slot5, 0, slot7 / slot8, slot8, nil, function (slot0) slot0:setSliderValue(slot0.setSliderValue, slot0) end, function () if slot0 == slot1[slot2] then slot3:setSliderValue(slot4, 1) setText(slot5, "MAX") end end) end end) else slot0.tweenValue(slot0, slot22, slot22.value, slot24 / slot19, slot4, nil, function (slot0) slot0:setSliderValue(slot0.setSliderValue, slot0) end, function () if slot0 == slot1[slot2] then slot3:setSliderValue(slot4, 1) setText(slot5, "MAX") end end) end end end end slot0.tweenValue = function (slot0, slot1, slot2, slot3, slot4, slot5, slot6, slot7, slot8) slot0.tweens[slot1] = slot1 slot9 = LeanTween.value(go(slot1), slot2, slot3, slot4):setOnUpdate(System.Action_float(function (slot0) if slot0 then slot0(slot0) end end)).setDelay(slot9, slot5 or 0):setOnComplete(System.Action(function () if slot0 then slot0() end end)) if slot8 and slot8 > 0 then slot9.setRepeat(slot9, slot8) end end slot0.getModExpAdditions = function (slot0, slot1) slot3 = pg.ship_data_template[slot0.configId].group_type slot4 = pg.ship_data_strengthen slot5 = {} for slot9, slot10 in pairs(ShipModAttr.ID_TO_ATTR) do slot11 = 0 if slot9 ~= ShipModLayer.IGNORE_ID then for slot15, slot16 in pairs(slot1) do slot19 = slot4[slot2[slot16.configId].strengthen_id].attr_exp[slot9 - 1] if slot2[slot16.configId].group_type == slot3 then slot19 = slot19 * 2 end slot11 = slot11 + slot19 end end slot5[slot10] = slot11 end return slot5 end slot0.getMaterialShips = function (slot0, slot1) slot2 = {} slot3 = ipairs slot4 = slot1 or {} for slot6, slot7 in slot3(slot4) do table.insert(slot2, slot0.shipVOs[slot7]) end return slot2 end slot0.getExpAddition = function (slot0, slot1, slot2) slot3 = slot0:getModExpAdditions(slot1) if slot0:getModAttrTopLimit(slot2) == 0 then return 0, 0 else slot4 = Clone(slot0) slot4:addModAttrExp(slot2, slot3[slot2]) return slot4:getModProperties(slot2) - slot0:getModProperties(slot2) end end slot0.getRemainExp = function (slot0, slot1) return slot0:getModProperties(slot1) % math.max(slot0:getModExpRatio(slot1), 1) end slot0.setSliderValue = function (slot0, slot1, slot2) slot1.value = (slot2 == 0 and slot2) or math.max(slot2, 0.08) end slot0.willExit = function (slot0) slot0:blurPanel(false) slot1 = pairs slot2 = slot0.tweens or {} for slot4, slot5 in slot1(slot2) do if LeanTween.isTweening(go(slot5)) then LeanTween.cancel(go(slot5)) end end slot0.tweens = nil if slot0.destoryConfirmWindow then slot0.destoryConfirmWindow:Destroy() slot0.destoryConfirmWindow = nil end end slot0.onBackPressed = function (slot0) if slot0.destoryConfirmWindow and slot0.destoryConfirmWindow:GetLoaded() and slot0.destoryConfirmWindow:isShowing() then slot0.destoryConfirmWindow:Hide() return end slot0:emit(BaseUI.ON_BACK_PRESSED, true) end return slot0
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5' files { 'vehicles.meta', 'carvariations.meta', 'carcols.meta', 'handling.meta', 'vehiclelayouts.meta' } data_file 'HANDLING_FILE' 'handling.meta' data_file 'VEHICLE_METADATA_FILE' 'vehicles.meta' data_file 'CARCOLS_FILE' 'carcols.meta' data_file 'VEHICLE_VARIATION_FILE' 'carvariations.meta' data_file 'VEHICLE_LAYOUTS_FILE' 'vehiclelayouts.META'
return { init_effect = "", name = "最终阶段", time = 0, picture = "", desc = "最终阶段开始", stack = 1, id = 100005, icon = 100005, last_effect = "", effect_list = { { type = "BattleBuffNewWeapon", trigger = { "onAttach" }, arg_list = { weapon_id = 311079 } }, { type = "BattleBuffNewWeapon", trigger = { "onAttach" }, arg_list = { weapon_id = 311080 } }, { type = "BattleBuffNewWeapon", trigger = { "onAttach" }, arg_list = { weapon_id = 311081 } } } }
CloneClass(MenuSceneManager) local ids_unit = Idstring("unit") local sky_orientation_data_key = Idstring("sky_orientation/rotation"):key() function MenuSceneManager:_setup_bg() local yaw = 180 self._bg_unit = World:spawn_unit(Idstring("units/menu/menu_scene/menu_cylinder"), Vector3(0, 0, 0), Rotation(yaw, 0, 0)) self._menu_cylinder_pattern = World:spawn_unit(Idstring("units/menu/menu_scene/menu_cylinder_pattern"), Vector3(0, 0, 0), Rotation(yaw, 0, 0)) self._menu_cylinder1 = World:spawn_unit(Idstring("units/menu/menu_scene/menu_smokecylinder1"), Vector3(0, 0, 0), Rotation(yaw, 0, 0)) self._menu_cylinder2 = World:spawn_unit(Idstring("units/menu/menu_scene/menu_smokecylinder2"), Vector3(0, 0, 0), Rotation(yaw, 0, 0)) self._menu_cylinder3 = World:spawn_unit(Idstring("units/menu/menu_scene/menu_smokecylinder3"), Vector3(0, 0, 0), Rotation(yaw, 0, 0)) self._menu_logo = World:spawn_unit(Idstring("units/menu/menu_scene/menu_logo"), Vector3(0, 0, 0), Rotation(yaw, 0, 0)) self._menu_cylinder1:set_enabled(Poser.loaded_options.Menu.Smoke) self._menu_cylinder2:set_enabled(Poser.loaded_options.Menu.Smoke) self._menu_cylinder3:set_enabled(Poser.loaded_options.Menu.Smoke) self._menu_logo:set_enabled(Poser.loaded_options.Menu.Logo) self._menu_cylinder_pattern:set_enabled(Poser.loaded_options.Menu.Pattern) for character_id, data in pairs(tweak_data.blackmarket.characters) do if Global.blackmarket_manager.characters[character_id].equipped then self:set_character(character_id) end end --[[if managers.dlc:is_dlc_unlocked("complete_overkill_pack") then local a = self._bg_unit:get_object(Idstring("a_reference")) local rot = Rotation(60, 0, 0) local pos = Vector3(-180, 160, -120) self._complete_overkill_pack_safe = World:spawn_unit(Idstring("units/payday2/equipment/gen_interactable_sec_safe_overkill/gen_interactable_sec_safe_overkill"), pos, rot) self._complete_overkill_pack_safe:set_enabled(Poser.loaded_options.Menu.COPSafe) end]]-- --[[local a = self._bg_unit:get_object(Idstring("a_reference")) self._snow_effect = World:effect_manager():spawn({ effect = Idstring("effects/payday2/menu/menu_snow_xmas_5x5"), position = Vector3(0, 0, 0), rotation = Rotation() }) self._xmas_tree = World:spawn_unit(Idstring("units/pd2_dlc2/props/com_props_christmas_tree/com_prop_christmas_tree"), a:position() + Vector3(-150, 250, -50), Rotation(-45 + (math.random(2) - 1) * 180, 0, 0)) self._snow_pile = World:spawn_unit(Idstring("units/pd2_dlc_cane/props/cne_prop_snow_pile_01/cne_prop_snow_pile_01"), a:position() + Vector3(-35, 275, -75), Rotation(305, 0, 0)) World:effect_manager():set_hidden(self._snow_effect, not Poser.loaded_options.Menu.ChristmasEffect) self._xmas_tree:set_enabled(Poser.loaded_options.Menu.ChristmasEffect) self._snow_pile:set_enabled(Poser.loaded_options.Menu.ChristmasEffect)]]-- local e_money = self._bg_unit:effect_spawner(Idstring("e_money")) if e_money then e_money:set_enabled(Poser.loaded_options.Menu.Particles) end self:_setup_lobby_characters() end function MenuSceneManager:set_scene_template(template, data, custom_name, skip_transition) if not skip_transition and (self._current_scene_template == template or self._current_scene_template == custom_name) then return end local template_data if not skip_transition then managers.menu_component:play_transition() self._fov_mod = 0 self._camera_object:set_fov(self._current_fov + (self._fov_mod or 0)) template_data = data or self._scene_templates[template] self._current_scene_template = custom_name or template self._character_values = self._character_values or {} if self._character_unit then self._character_values.pos_target = Poser.loaded_options.Menu.Position_save and Vector3(Poser.loaded_options.Menu.Position_x, Poser.loaded_options.Menu.Position_y, Poser.loaded_options.Menu.Position_z) or self._character_unit:position() end if self._character_values.pos_target then self._character_values.pos_current = self._character_values.pos_current or Vector3() mvector3.set(self._character_values.pos_current, self._character_values.pos_target) elseif template_data.character_pos then self._character_values.pos_current = self._character_values.pos_current or Vector3() mvector3.set(self._character_values.pos_current, template_data.character_pos) end local set_character_position = false if self._character_values.pos_current then self._character_values.pos_target = self._character_values.pos_target or Vector3() mvector3.set(self._character_values.pos_target, self._character_values.pos_current) set_character_position = true elseif template_data.character_pos then self._character_values.pos_target = self._character_values.pos_target or Vector3() mvector3.set(self._character_values.pos_target, template_data.character_pos) set_character_position = true end if set_character_position and self._character_values.pos_target then self._character_unit:set_position(self._character_values.pos_target) end if template_data.character_rot then self._character_unit:set_rotation(Rotation(template_data.character_rot, self._character_pitch)) self._character_yaw = template_data.character_rot end self:_chk_character_visibility(self._character_unit) --self:_chk_complete_overkill_pack_safe_visibility() self:reset_character_deployables() if self._lobby_characters then for _, unit in pairs(self._lobby_characters) do self:_chk_character_visibility(unit) end end self:_use_environment(template_data.environment or "standard") self:post_ambience_event(template_data.ambience_event or "menu_main_ambience") self._camera_values.camera_pos_current = self._camera_values.camera_pos_target self._camera_values.target_pos_current = self._camera_values.target_pos_target self._camera_values.fov_current = self._camera_values.fov_target if self._transition_time then self:dispatch_transition_done() end self._transition_time = 1 self._camera_values.camera_pos_target = template_data.camera_pos or self._camera_values.camera_pos_current self._camera_values.target_pos_target = template_data.target_pos or self._camera_values.target_pos_current self._camera_values.fov_target = template_data.fov or self._standard_fov self:_release_item_grab() self:_release_character_grab() self._use_item_grab = template_data.use_item_grab self._use_character_grab = template_data.use_character_grab self._use_character_grab2 = template_data.use_character_grab2 self._use_character_pan = template_data.use_character_pan self._disable_rotate = template_data.disable_rotate or false self._disable_item_updates = template_data.disable_item_updates or false self._can_change_fov = template_data.can_change_fov or false self._can_move_item = template_data.can_move_item or false self._change_fov_sensitivity = template_data.change_fov_sensitivity or 1 self._characters_deployable_visible = template_data.characters_deployable_visible or false self:set_character_deployable(Global.player_manager.kit.equipment_slots[1], false, 0) if template_data.remove_infamy_card and self._card_units and self._card_units[self._character_unit:key()] then local secondary = managers.blackmarket:equipped_secondary() if secondary then self:set_character_equipped_weapon(nil, secondary.factory_id, secondary.blueprint, "secondary", secondary.cosmetic) end end if template_data._set_character_pose then self:_select_character_pose() end if alive(self._menu_logo) then self._menu_logo:set_visible(not template_data.hide_menu_logo) end end if template_data and template_data.upgrade_object then self._temp_upgrade_object = template_data.upgrade_object self:_set_item_offset(template_data.upgrade_object:oobb()) elseif self._use_item_grab and self._item_unit then if self._item_unit.unit then managers.menu_scene:_set_weapon_upgrades(self._current_weapon_id) self:_set_item_offset(self._current_item_oobb_object:oobb()) else self._item_unit.scene_template = { template = template, data = data, custom_name = custom_name } end end if not skip_transition then local fade_lights = {} for _, light in ipairs(self._fade_down_lights) do if light:multiplier() ~= 0 and template_data.lights and not table.contains(template_data.lights, light) then table.insert(fade_lights, light) end end for _, light in ipairs(self._active_lights) do table.insert(fade_lights, light) end self._fade_down_lights = fade_lights self._active_lights = {} if template_data.lights then for _, light in ipairs(template_data.lights) do light:set_enable(true) table.insert(self._active_lights, light) end end end managers.network.account:inventory_load() end function MenuSceneManager:get_deployables(var) local new_table = {} for _, deployable in pairs(tweak_data.equipments) do if deployable[var] then table.insert(new_table, deployable[var]) end end return new_table end function MenuSceneManager.set_lobby_character_out_fit(self, i, outfit_string, rank) self:reset_character_deployables(self._lobby_characters[i]) self.orig.set_lobby_character_out_fit(self, i, outfit_string, rank) end --[[function MenuSceneManager:set_lobby_character_visible(i, visible, no_state) local unit = self._lobby_characters[i] self._character_visibilities[unit:key()] = visible self:_chk_character_visibility(unit) if self._current_profile_slot == i then managers.menu_component:close_lobby_profile_gui() self._current_profile_slot = 0 end end]]-- function MenuSceneManager:set_character_deployable(deployable_id, unit, peer_id) unit = unit or self._character_unit if self._deployable_equipped[peer_id] then local tweak_data = tweak_data.equipments[self._deployable_equipped[peer_id]] local object_name = tweak_data.visual_object unit:get_object(Idstring(object_name)):set_visibility(false) end self:reset_character_deployables(unit) if deployable_id and deployable_id ~= "nil" then local tweak_data = tweak_data.equipments[deployable_id] local object_name = tweak_data.visual_object unit:get_object(Idstring(object_name)):set_visibility(self._characters_deployable_visible) self._deployable_equipped[peer_id] = deployable_id end end local deployables = MenuSceneManager:get_deployables("visual_object") function MenuSceneManager:reset_character_deployables(unit) unit = unit or self._character_unit for _, deployable in pairs(deployables) do unit:get_object(Idstring(deployable)):set_visibility(false) end end function MenuSceneManager._select_character_pose(self, unit) unit = unit or self._character_unit if Poser.loaded_options.Menu.Pose_save then local SavedPose = Poser.poses[Poser.loaded_options.Menu.SavedPose] MenuCallbackHandler:poser_pose(nil, self, {Poser.loaded_options.Menu.SavedPose, SavedPose.weaptype}, unit, true) return end self.orig._select_character_pose(self, unit) end function MenuSceneManager:set_character_equipped_card(unit, card, IsPoser) unit = unit or self._character_unit local card_unit = World:spawn_unit(Idstring("units/menu/menu_scene/infamy_card"), Vector3(0, 0, 0), Rotation(0, 0, 0)) card_unit:damage():run_sequence_simple("enable_card_" .. (card < 10 and "0" or "") .. tostring(math.min(card, 24))) unit:link(Idstring("a_weapon_left_front"), card_unit, card_unit:orientation_object():name()) self:_delete_character_weapon(unit, "secondary") self._card_units = self._card_units or {} self._card_units[unit:key()] = card_unit if not IsPoser then self:_select_character_pose() end end function MenuSceneManager:_set_character_unit_pose(pose, unit, IsPoser) local new_pose = pose if Poser.loaded_options.Menu.Pose_save and IsPoser ~= true then new_pose = Poser.poses[tonumber(Poser.loaded_options.Menu.SavedPose)].name end local state = unit:play_redirect(Idstring("idle_menu")) unit:anim_state_machine():set_parameter(state, new_pose, 1) if self._character_unit == unit then self:add_one_frame_delayed_clbk(callback(self, self, "_character_unit_pose_updated")) end Poser.current_pose = new_pose end function MenuSceneManager._setup_gui(self) self.orig._setup_gui(self) self._character_grab:set_w(750) self._character_grab2:set_w(self._main_panel:w() * 0.8) end function MenuSceneManager._set_up_templates(self) self.orig._set_up_templates(self) local ref = self._bg_unit:get_object(Idstring("a_camera_reference")) local c_ref = self._bg_unit:get_object(Idstring("a_reference")) local target_pos = Vector3(0, 0, ref:position().z) local offset = Vector3(ref:position().x, ref:position().y, 0) self._scene_templates = self._scene_templates or {} self._scene_templates.standard = self._scene_templates.standard or {} self._scene_templates.standard.use_character_grab2 = true self._scene_templates.standard.use_character_grab = true self._scene_templates.standard.use_character_pan = true self._scene_templates.standard.character_visible = true self._scene_templates.standard.characters_deployable_visible = Poser.loaded_options.Menu.menu_deploy self._scene_templates.standard.complete_overkill_pack_safe_visible = true self._scene_templates.standard.camera_pos = ref:position() self._scene_templates.standard.target_pos = target_pos self._scene_templates.standard.character_rot = Poser.loaded_options.Menu.Save_yaw and Poser.loaded_options.Menu.SavedYaw or nil self._scene_templates.standard.character_pos = Poser.loaded_options.Menu.Position_save and Vector3(Poser.loaded_options.Menu.Position_x, Poser.loaded_options.Menu.Position_y, Poser.loaded_options.Menu.Position_z) or c_ref:position() local l_pos = self._scene_templates.standard.camera_pos local rot = Rotation(self._scene_templates.standard.target_pos - l_pos, math.UP) local l1_pos = l_pos + rot:x() * -200 + rot:y() * 200 self._scene_templates.standard.lights = { self:_create_light({ far_range = 400, color = Vector3(0.86, 0.37, 0.21) * 4, position = Vector3(80, 33, 20) }), self:_create_light({ far_range = 180, color = Vector3(0.3, 0.5, 0.8) * 6, position = Vector3(-120, -6, 32), specular_multiplier = 8 }), self:_create_light({ far_range = 800, color = Vector3(1, 1, 1) * 0.35, position = Vector3(160, -250, -40), specular_multiplier = 0 }) } --[[self._scene_templates.blackmarket = {} self._scene_templates.blackmarket.fov = 20 self._scene_templates.blackmarket.use_item_grab = true self._scene_templates.blackmarket.camera_pos = offset:rotate_with(Rotation(90)) self._scene_templates.blackmarket.target_pos = Vector3(-100, -100, 0) + self._camera_start_rot:x() * 100 + self._camera_start_rot:y() * 6 + self._camera_start_rot:z() * 0 self._scene_templates.blackmarket.lights = {} self._scene_templates.blackmarket_item = {} self._scene_templates.blackmarket_item.fov = 40 self._scene_templates.blackmarket_item.can_change_fov = true self._scene_templates.blackmarket_item.use_item_grab = true self._scene_templates.blackmarket_item.camera_pos = offset:rotate_with(Rotation(45)) + Vector3(0, 0, 200) self._scene_templates.blackmarket_item.target_pos = target_pos + Vector3(0, 0, 200) self._scene_templates.blackmarket_item.character_pos = c_ref:position() + Vector3(0, 500, 0) local l_pos = self._scene_templates.blackmarket_item.camera_pos local rot = Rotation(self._scene_templates.blackmarket_item.target_pos - l_pos, math.UP) local l1_pos = l_pos + rot:x() * 50 + rot:y() * 50 local l2_pos = l_pos + rot:x() * -50 + rot:y() * 100 self._scene_templates.blackmarket_item.lights = { self:_create_light({ far_range = 270, color = Vector3(0.86, 0.67, 0.31) * 3, position = Vector3(160, -130, 220), specular_multiplier = 155 }), self:_create_light({ far_range = 270, color = Vector3(0.86, 0.67, 0.41) * 2, position = Vector3(50, -150, 220), specular_multiplier = 155 }), self:_create_light({ far_range = 270, color = Vector3(0.86, 0.67, 0.41) * 2, position = Vector3(160, 0, 220), specular_multiplier = 155 }), self:_create_light({ far_range = 250, color = Vector3(0.5, 1.5, 2) * 2, position = Vector3(50, -100, 280), specular_multiplier = 55 }), self:_create_light({ far_range = 370, color = Vector3(1, 0.4, 0.04) * 1.5, position = Vector3(200, 60, 180), specular_multiplier = 55 }) } self._scene_templates.blackmarket_mask = {} self._scene_templates.blackmarket_mask.fov = 40 self._scene_templates.blackmarket_mask.can_change_fov = true self._scene_templates.blackmarket_mask.use_item_grab = true self._scene_templates.blackmarket_mask.camera_pos = offset:rotate_with(Rotation(45)) + Vector3(0, 0, 200) self._scene_templates.blackmarket_mask.target_pos = target_pos + Vector3(0, 0, 200) self._scene_templates.blackmarket_mask.character_pos = c_ref:position() + Vector3(0, 500, 0) local l_pos = self._scene_templates.blackmarket_mask.camera_pos local rot = Rotation(self._scene_templates.blackmarket_mask.target_pos - l_pos, math.UP) local l1_pos = l_pos + rot:x() * 50 + rot:y() * 50 local l2_pos = l_pos + rot:x() * -50 + rot:y() * 100 self._scene_templates.blackmarket_mask.lights = { self:_create_light({ far_range = 250, color = Vector3(0.2, 0.5, 1) * 4.3, position = Vector3(0, -200, 280), specular_multiplier = 55 }), self:_create_light({ far_range = 370, color = Vector3(1, 0.7, 0.5) * 2.3, position = Vector3(200, 60, 280), specular_multiplier = 55 }), self:_create_light({ far_range = 270, color = Vector3(1, 1, 1) * 0.8, position = Vector3(160, -130, 220), specular_multiplier = 0 }) } self._scene_templates.character_customization = {} self._scene_templates.character_customization.use_character_grab = true self._scene_templates.character_customization.camera_pos = Vector3(-73.1618, -168.021, -35.0786) self._scene_templates.character_customization.target_pos = Vector3(-73.1618, -168.021, -35.0786) + Vector3(0.31113, 0.944697, -0.103666) * 100 self._scene_templates.character_customization.lights = {} self._scene_templates.play_online = {} self._scene_templates.play_online.camera_pos = offset:rotate_with(Rotation(90)) self._scene_templates.play_online.target_pos = Vector3(-206.4, 56.0677, -135.539) + Vector3(-0.418134, 0.889918, 0.182234) * 100 self._scene_templates.play_online.lights = {} self._scene_templates.options = {} self._scene_templates.options.use_character_grab = true self._scene_templates.options.camera_pos = Vector3(0, 60, -60) self._scene_templates.options.target_pos = self._camera_start_rot:y() * 100 + self._camera_start_rot:x() * -6 + self._camera_start_rot:z() * -60 self._scene_templates.options.lights = {}]]-- self._scene_templates.lobby = {} self._scene_templates.lobby.use_character_grab = false self._scene_templates.lobby.characters_deployable_visible = Poser.loaded_options.Menu.Deployables self._scene_templates.lobby.camera_pos = offset:rotate_with(Rotation(90)) self._scene_templates.lobby.target_pos = target_pos self._scene_templates.lobby.character_pos = c_ref:position() + Vector3(0, 500, 0) self._scene_templates.lobby.lobby_characters_visible = true self._scene_templates.lobby.fov = 40 self._scene_templates.lobby.lights = { self:_create_light({ far_range = 300, color = Vector3(0.86, 0.57, 0.31) * 3, position = Vector3(56, 100, -10) }), self:_create_light({ far_range = 3000, color = Vector3(1, 2.5, 4.5) * 3, position = Vector3(-1000, -300, 800), specular_multiplier = 6 }), self:_create_light({ far_range = 800, color = Vector3(1, 1, 1) * 0.35, position = Vector3(300, 100, 0), specular_multiplier = 0 }) } --[[self._scene_templates.lobby1 = {} self._scene_templates.lobby1.use_character_grab = false self._scene_templates.lobby1.lobby_characters_visible = true self._scene_templates.lobby1.camera_pos = Vector3(-90.5634, -157.226, -28.6729) self._scene_templates.lobby1.target_pos = Vector3(-90.5634, -157.226, -28.6729) + Vector3(-0.58315, 0.781811, 0.220697) * 100 self._scene_templates.lobby1.fov = 30 self._scene_templates.lobby1.lights = clone(self._scene_templates.lobby.lights) self._scene_templates.lobby2 = {} self._scene_templates.lobby2.use_character_grab = false self._scene_templates.lobby2.lobby_characters_visible = true self._scene_templates.lobby2.camera_pos = Vector3(-21.2779, -264.36, -56.7304) self._scene_templates.lobby2.target_pos = Vector3(-21.2779, -264.36, -56.7304) + Vector3(-0.633319, 0.758269, 0.154709) * 100 self._scene_templates.lobby2.fov = 30 self._scene_templates.lobby2.lights = clone(self._scene_templates.lobby.lights) self._scene_templates.lobby3 = {} self._scene_templates.lobby3.use_character_grab = false self._scene_templates.lobby3.lobby_characters_visible = true self._scene_templates.lobby3.camera_pos = Vector3(149.695, -363.069, -110.613) self._scene_templates.lobby3.target_pos = Vector3(149.695, -363.069, -110.613) + Vector3(-0.648856, 0.748553, 0.136579) * 100 self._scene_templates.lobby3.fov = 30 self._scene_templates.lobby3.lights = clone(self._scene_templates.lobby.lights) self._scene_templates.lobby4 = {} self._scene_templates.lobby4.use_character_grab = false self._scene_templates.lobby4.lobby_characters_visible = true self._scene_templates.lobby4.camera_pos = Vector3(210.949, -449.61, -126.709) self._scene_templates.lobby4.target_pos = Vector3(210.949, -449.61, -126.709) + Vector3(-0.668524, 0.734205, 0.118403) * 100 self._scene_templates.lobby4.fov = 30 self._scene_templates.lobby4.lights = clone(self._scene_templates.lobby.lights)]]-- self._scene_templates.inventory = {} self._scene_templates.inventory.fov = 50 self._scene_templates.inventory.can_change_fov = true self._scene_templates.inventory.change_fov_sensitivity = 3 self._scene_templates.inventory.use_character_grab2 = true self._scene_templates.inventory.use_character_pan = true self._scene_templates.inventory.character_visible = true self._scene_templates.inventory.lobby_characters_visible = false self._scene_templates.inventory.hide_menu_logo = true self._scene_templates.inventory.characters_deployable_visible = Poser.loaded_options.Menu.menu_deploy self._scene_templates.inventory.camera_pos = ref:position() self._scene_templates.inventory.character_rot = Poser.loaded_options.Menu.Save_yaw and Poser.loaded_options.Menu.SavedYaw or nil self._scene_templates.inventory.target_pos = target_pos - self._camera_start_rot:x() * 40 - self._camera_start_rot:z() * 5 --self._scene_templates.inventory.character_pos = c_ref:position() --self._scene_templates.inventory.remove_infamy_card = true if not managers.menu:is_pc_controller() then end local l_pos = self._scene_templates.inventory.camera_pos local rot = Rotation(self._scene_templates.inventory.target_pos - l_pos, math.UP) local l1_pos = l_pos + rot:x() * -200 + rot:y() * 200 self._scene_templates.inventory.lights = { self:_create_light({ far_range = 400, color = Vector3(0.86, 0.37, 0.21) * 4, position = Vector3(80, 33, 20) }), self:_create_light({ far_range = 180, color = Vector3(0.3, 0.5, 0.8) * 6, position = Vector3(-120, -6, 32), specular_multiplier = 8 }), self:_create_light({ far_range = 800, color = Vector3(1, 1, 1) * 0.35, position = Vector3(160, -250, -40), specular_multiplier = 0 }) } end function MenuSceneManager.mouse_pressed(self, o, button, x, y) if button == Idstring("1") then local pos = self._workspace:screen_to_world(self._camera_object, Vector3(x, y, 0)) local to = self._workspace:screen_to_world(self._camera_object, Vector3(x, y, 1000)) local data = World:raycast("ray", pos, to, "slot_mask", 16) if data and data.unit then local slot for i, unit in ipairs(self._lobby_characters) do if unit == data.unit and unit:visible() then slot = i end end if slot then if self._current_profile_slot == slot then managers.menu_component:close_lobby_profile_gui() self._current_profile_slot = 0 else local pos = data.unit:get_object(Idstring("Spine")):position() pos = self._workspace:world_to_screen(self._camera_object, pos) self._current_profile_slot = slot end end end if self._use_character_grab and self._character_grab:inside(x, y) then self._character_grabbed_x = true self._character_grabbed_current_x = x self._character_grabbed_current_y = y return true end if self._use_character_grab2 and self._character_grab2:inside(x, y) then self._character_grabbed_x = true self._character_grabbed_current_x = x self._character_grabbed_current_y = y return true end end return self.orig.mouse_pressed(self, o, button, x, y) end function MenuSceneManager.mouse_released(self, o, button, x, y) self.orig.mouse_released(self, o, button, x, y) if button == Idstring("1") then self._character_grabbed_x = false end end function MenuSceneManager:mouse_moved(o, x, y) if managers.menu_component:input_focus() == true or managers.menu_component:input_focus() == 1 then return false, "arrow" end if self._character_grabbed then self._character_yaw = self._character_yaw + (x - self._character_grabbed_current_x) / 4 if self._use_character_pan and self._character_values and self._scene_templates and self._scene_templates[self._current_scene_template] then local new_z = mvector3.z(self._character_values.pos_target) - (y - self._character_grabbed_current_y) / 12 local default_z = mvector3.z(self._scene_templates and self._scene_templates[self._current_scene_template].character_pos or self._character_values.pos_current) --new_z = math.clamp(new_z, default_z - 20, default_z + 10) mvector3.set_z(self._character_values.pos_target, new_z) end if Poser.loaded_options.Menu.Position_save then Poser.loaded_options.Menu.Position_x = self._character_values.pos_target.x Poser.loaded_options.Menu.Position_y = self._character_values.pos_target.y Poser.loaded_options.Menu.Position_z = self._character_values.pos_target.z Poser:Save() end self._character_unit:set_rotation(Rotation(self._character_yaw, self._character_pitch)) if Poser.loaded_options.Menu.Save_yaw then Poser.loaded_options.Menu.SavedYaw = self._character_yaw self._scene_templates.inventory.character_rot = self._character_yaw self._scene_templates.standard.character_rot = self._character_yaw Poser:Save() end self._character_grabbed_current_x = x self._character_grabbed_current_y = y return true, "grab" elseif self._character_grabbed_x then if self._use_character_grab2 and self._character_values and self._scene_templates and self._scene_templates[self._current_scene_template] then local new_x = mvector3.x(self._character_values.pos_target) + (x - self._character_grabbed_current_x) / 12 local default_x = mvector3.x(self._scene_templates and self._scene_templates[self._current_scene_template].character_pos or self._character_values.pos_current) --new_x = math.clamp(new_x, default_x - 20, default_x + 10) mvector3.set_x(self._character_values.pos_target, new_x) local new_y = mvector3.y(self._character_values.pos_target) - (y - self._character_grabbed_current_y) / 12 local default_y = mvector3.y(self._scene_templates and self._scene_templates[self._current_scene_template].character_pos or self._character_values.pos_current) --new_y = math.clamp(new_y, default_y - 20, default_y + 10) mvector3.set_y(self._character_values.pos_target, new_y) end if Poser.loaded_options.Menu.Position_save then Poser.loaded_options.Menu.Position_x = self._character_values.pos_target.x Poser.loaded_options.Menu.Position_y = self._character_values.pos_target.y Poser.loaded_options.Menu.Position_z = self._character_values.pos_target.z Poser:Save() end self._character_grabbed_current_x = x self._character_grabbed_current_y = y return true, "grab" end if self._item_grabbed then if self._item_unit and alive(self._item_unit.unit) then local diff = (y - self._item_grabbed_current_y) / 4 self._item_yaw = (self._item_yaw + (x - self._item_grabbed_current_x) / 4) % 360 local yaw_sin = math.sin(self._item_yaw) local yaw_cos = math.cos(self._item_yaw) local treshhold = math.sin(45) if yaw_cos > -treshhold and yaw_cos < treshhold then else self._item_pitch = math.clamp(self._item_pitch + diff * yaw_cos, -30, 30) end if yaw_sin > -treshhold and yaw_sin < treshhold then else self._item_roll = math.clamp(self._item_roll - diff * yaw_sin, -30, 30) end mrotation.set_yaw_pitch_roll(self._item_rot_temp, self._item_yaw, self._item_pitch, self._item_roll) mrotation.set_zero(self._item_rot) mrotation.multiply(self._item_rot, self._camera_object:rotation()) mrotation.multiply(self._item_rot, self._item_rot_temp) mrotation.multiply(self._item_rot, self._item_rot_mod) self._item_unit.unit:set_rotation(self._item_rot) local new_pos = self._item_rot_pos + self._item_offset:rotate_with(self._item_rot) self._item_unit.unit:set_position(new_pos) self._item_unit.unit:set_moving(2) end self._item_grabbed_current_x = x self._item_grabbed_current_y = y return true, "grab" elseif self._item_move_grabbed and self._item_unit and alive(self._item_unit.unit) then local diff_x = (x - self._item_move_grabbed_current_x) / 4 local diff_y = (y - self._item_move_grabbed_current_y) / 4 local move_v = Vector3(diff_x, 0, -diff_y):rotate_with(self._camera_object:rotation()) mvector3.add(self._item_rot_pos, move_v) local new_pos = self._item_rot_pos + self._item_offset:rotate_with(self._item_rot) self._item_unit.unit:set_position(new_pos) self._item_unit.unit:set_moving(2) self._item_move_grabbed_current_x = x self._item_move_grabbed_current_y = y return true, "grab" end if self._use_item_grab and self._item_grab:inside(x, y) then return true, "hand" end if self._use_character_grab and self._character_grab:inside(x, y) then return true, "hand" end if self._use_character_grab2 and self._character_grab2:inside(x, y) then return true, "hand" end end function MenuSceneManager._set_up_environments(self) self.orig._set_up_environments(self) self._environments.standard.environment = "environments/pd2_cash/env_cash_02" end function MenuSceneManager:set_character_equipped_weapon(unit, factory_id, blueprint, type, cosmetics, poser, lobby) if not Poser:ShouldUpdateWeap(type) and not poser and not lobby then return end unit = unit or self._character_unit self:_delete_character_weapon(unit, type) if factory_id then local factory_weapon = tweak_data.weapon.factory[factory_id] local ids_unit_name = Idstring(factory_weapon.unit) self._weapon_units[unit:key()] = self._weapon_units[unit:key()] or {} self._weapon_units[unit:key()][type] = { unit = false, name = ids_unit_name, assembly_complete = false } local clbk = callback(self, self, "clbk_weapon_base_unit_loaded", { owner = unit, factory_id = factory_id, blueprint = blueprint, cosmetics = cosmetics, type = type, poser = poser }) managers.dyn_resource:load(ids_unit, ids_unit_name, DynamicResourceManager.DYN_RESOURCES_PACKAGE, clbk) end self:_chk_character_visibility(unit) end local null_vector = Vector3() local null_rotation = Rotation() function MenuSceneManager:clbk_weapon_base_unit_loaded(params, status, asset_type, asset_name) local owner = params.owner if not alive(owner) then return end local owner_weapon_data = self._weapon_units[owner:key()] if not owner_weapon_data or not owner_weapon_data[params.type] or owner_weapon_data[params.type].unit or owner_weapon_data[params.type].name ~= asset_name then return end owner_weapon_data = owner_weapon_data[params.type] local weapon_unit = World:spawn_unit(asset_name, null_vector, self.null_rotation) owner_weapon_data.unit = weapon_unit weapon_unit:base():set_npc(true) weapon_unit:base():set_factory_data(params.factory_id) weapon_unit:base():set_cosmetics_data(params.cosmetics) if params.blueprint then weapon_unit:base():assemble_from_blueprint(params.factory_id, params.blueprint, nil, callback(self, self, "clbk_weapon_assembly_complete", params)) else weapon_unit:base():assemble(params.factory_id) end local align_name = params.type == "primary" and Idstring("a_weapon_right_front") or Idstring("a_weapon_left_front") owner:link(align_name, weapon_unit, weapon_unit:orientation_object():name()) if not params.poser and Poser.loaded_options.Menu.Weapon_update and not Poser.loaded_options.Menu.Pose_save and owner == self._character_unit then self:_select_character_pose() end self:_chk_character_visibility(owner) end
local debug = require("tw-debug")("devtool:ui:ConsoleComponent") local devtool = require("devtool/devtool") local removeComponent = require("devtool/utils/ui/removeComponent") local positionComponentRelativeTo = require("devtool/utils/ui/positionComponentRelativeTo") local resizeComponent = require("devtool/utils/ui/resizeComponent") local createButton = require("devtool/utils/ui/createButton") local _ = require("devtool/utils/ui/_") local mixins = require("devtool/ui/mixins") local includeMixins = mixins.includeMixins local ComponentMixin = mixins.ComponentMixin local ConsoleComponent = { frameName = "devtool_text_tab_component", devtool = nil, component = nil, textbox = nil, listView = nil, codeListView = nil, codeListViewText = nil, enterButton = nil, executeButton = nil, clearLogsButton = nil, clearCodeButton = nil, upButton = nil, downButton = nil, currentLineNumberComponent = nil, secondPanelWidth = 600, textPanes = {} } function ConsoleComponent:new(devtool) self.devtool = devtool self.isTroy = cm:get_campaign_name() == "main_troy" self:createFrame() self:createComponents() return self end function ConsoleComponent:createFrame() local content = self.devtool.component content:CreateComponent(self.frameName, "script/ui/devtool/campaign ui/script_dummy") self.component = find_uicomponent(content, self.frameName) self.component:PropagatePriority(content:Priority()) content:Adopt(self.component:Address()) end function ConsoleComponent:createComponents() -- add the text box self:addTextBox() -- creating up / down arrow self.upButton = self:createUpArrow() self.downButton = self:createDownArrow() -- create enter button self.enterButton = self:createEnterButton() -- create execute button self.executeButton = self:createExecuteButton() -- create clear logs button self.clearLogsButton = self:createClearLogsButton() -- create clear code button self.clearCodeButton = self:createClearCodeButton() -- create line numerical display self:createLineNumberDisplay() -- create input file hint self:createInputFileHint() -- creating list box for scrolling self:createListView() -- creating list box for code viewin self:createCodeListView() -- update up / down arrows state self:updateUpDownArrowState() end function ConsoleComponent:addTextBox() local name = self.frameName .. "_TextBox" local filepath = "script/ui/devtool/common ui/file_requester" local content = self.component content:CreateComponent(name .. "_UITEMP", filepath) local tempUI = UIComponent(content:Find(name .. "_UITEMP")) local textbox = find_uicomponent(tempUI, "input_name") self.textbox = textbox textbox:PropagatePriority(content:Priority()) content:Adopt(textbox:Address()) removeComponent(find_uicomponent(textbox, "input_name_label")) removeComponent(tempUI) -- resize local contentWidth, contentHeight = self.devtool.content:Bounds() resizeComponent(textbox, contentWidth - self.secondPanelWidth) positionComponentRelativeTo(textbox, self.devtool.content, 20, 20) end function ConsoleComponent:createUpArrow() local name = self.frameName .. "_TextBox" local content = self.component local textbox = self.textbox -- creating button content:CreateComponent(name .. "_UpButton", "script/ui/devtool/templates/round_medium_button") local upButton = UIComponent(content:Find(name .. "_UpButton")) content:Adopt(upButton:Address()) upButton:PropagatePriority(content:Priority()) upButton:SetImagePath("ui/skins/default/parchment_sort_arrow_up.png") resizeComponent(upButton, 17, 17) self:positionComponentRelativeToWithOffset(upButton, textbox, 5, -30) local listenerName = "ConsoleComponent_TextBox_UpButtonListener" core:add_listener( listenerName, "ComponentLClickUp", function(context) return upButton == UIComponent(context.component) end, function(context) self.devtool:decrementLines() self:updateUpDownArrowState() end, true ) return upButton end function ConsoleComponent:createDownArrow() local name = self.frameName .. "_TextBox" local content = self.component local textbox = self.textbox -- creating button content:CreateComponent(name .. "_DownButton", "script/ui/devtool/templates/round_medium_button") local downButton = UIComponent(content:Find(name .. "_DownButton")) content:Adopt(downButton:Address()) downButton:PropagatePriority(content:Priority()) downButton:SetImagePath("ui/skins/default/parchment_sort_arrow_down.png") resizeComponent(downButton, 17, 17) self:positionComponentRelativeToWithOffset(downButton, textbox, 5, -15) local listenerName = "ConsoleComponent_TextBox_DownButtonListener" core:add_listener( listenerName, "ComponentLClickUp", function(context) return downButton == UIComponent(context.component) end, function(context) self.devtool:incrementLines() self:updateUpDownArrowState() end, true ) return downButton end function ConsoleComponent:createLineNumberDisplay() local componentName = self.frameName .. "_LineNumberComponent" local content = self.component content:CreateComponent(componentName .. "_UITEMP", "script/ui/devtool/campaign ui/mission_details") local tempUI = UIComponent(content:Find(componentName .. "_UITEMP")) local component = find_uicomponent(tempUI, "mission_details_child", "description_background", "description_view", "dy_description") content:Adopt(component:Address()) component:PropagatePriority(content:Priority()) removeComponent(tempUI) local contentWidth, contentHeight = content:Bounds() resizeComponent(component, 250, 30) positionComponentRelativeTo(component, self.textbox, 0, 35) self.currentLineNumberComponent = component self:updateLineNumberDisplay() end function ConsoleComponent:createInputFileHint() local componentName = self.frameName .. "_inputfile_hint" local content = self.component content:CreateComponent(componentName .. "_UITEMP", "script/ui/devtool/campaign ui/mission_details") local tempUI = UIComponent(content:Find(componentName .. "_UITEMP")) local component = find_uicomponent(tempUI, "mission_details_child", "description_background", "description_view", "dy_description") content:Adopt(component:Address()) component:PropagatePriority(content:Priority()) removeComponent(tempUI) local contentWidth, contentHeight = content:Bounds() local text = "You can also use the data/text/console_input.lua file" local textWidth, textHeight = component:TextDimensionsForText(text) resizeComponent(component, textWidth, textHeight) local textboxWidth, textboxHeight = self.textbox:Bounds() positionComponentRelativeTo(component, self.textbox, textboxWidth - textWidth, 35) component:SetStateText("[[col:help_page_link]]" .. text .. "[[/col]]") component:SetTooltipText("Open the file data/text/console_input.lua in your text editor, edit the content and save.\n\nThe content of the file will be executed on each save as if you were using the console textbox.", true) local savedValue = cm:get_saved_value("devtool_options_fileWatch") -- compare against false to account for nil value when saved value has not been saved yet if savedValue == false then component:SetVisible(false) end core:remove_listener("devtool_options_fileWatch_changed_hint_listener") core:add_listener( "devtool_options_fileWatch_changed_hint_listener", "devtool_options_fileWatch_changed", true, function(context) local shouldWatchFile = context.bool debug("devtool_options_fileWatch_changed_hint_listener", shouldWatchFile) component:SetVisible(shouldWatchFile) end, true ) return component end function ConsoleComponent:createListView() local content = self.component content:CreateComponent(self.frameName .. "_ListBox_UITEMP", "script/ui/devtool/campaign ui/finance_screen") -- content:CreateComponent(self.frameName .. "_ListBox_UITEMP", "script/ui/devtool/templates/finance_screen") local tempUI = UIComponent(content:Find(self.frameName .. "_ListBox_UITEMP")) local listView = find_uicomponent(tempUI, "tab_trade", "trade", "exports", "trade_partners_list", "listview") removeComponent(find_uicomponent(listView, "headers")) self.listView = listView content:Adopt(listView:Address()) listView:PropagatePriority(content:Priority()) removeComponent(tempUI) local contentWidth, contentHeight = self.devtool.content:Bounds() local textboxWidth, textboxHeight = self.textbox:Bounds() local lineNumberWidth, lineNumberHeight = self.currentLineNumberComponent:Bounds() resizeComponent(listView, contentWidth - self.secondPanelWidth, contentHeight - (textboxHeight + lineNumberHeight + 40)) positionComponentRelativeTo(listView, self.textbox, 0, textboxHeight + lineNumberHeight + 10) if self.isTroy then local slider = _(listView, "vslider") local w, h = slider:Bounds() resizeComponent(slider, w, h + 100) end end function ConsoleComponent:createCodeListView() local content = self.component local listViewWidth, listViewHeight = self.listView:Bounds() -- list view title local componentTitleName = self.frameName .. "ListBoxTextTitle_UITEMP" content:CreateComponent(componentTitleName, "script/ui/devtool/campaign ui/mission_details") -- content:CreateComponent(componentTitleName, "script/ui/devtool/templates/mission_details") local tempTitleTextUI = UIComponent(content:Find(componentTitleName)) local title = find_uicomponent(tempTitleTextUI, "mission_details_child", "description_background", "description_view", "dy_description") content:Adopt(title:Address()) title:PropagatePriority(content:Priority()) removeComponent(tempTitleTextUI) title:SetStateText("Current Code:") resizeComponent(title, self.secondPanelWidth, 30) positionComponentRelativeTo(title, self.listView, listViewWidth, -self.currentLineNumberComponent:Height()) -- list view content:CreateComponent(self.frameName .. "_ListBox_UITEMP", "script/ui/devtool/campaign ui/finance_screen") -- content:CreateComponent(self.frameName .. "_ListBox_UITEMP", "script/ui/devtool/templates/finance_screen") local tempUI = UIComponent(content:Find(self.frameName .. "_ListBox_UITEMP")) local codeListView = find_uicomponent(tempUI, "tab_trade", "trade", "exports", "trade_partners_list", "listview") removeComponent(find_uicomponent(codeListView, "headers")) self.codeListView = codeListView content:Adopt(codeListView:Address()) codeListView:PropagatePriority(content:Priority()) removeComponent(tempUI) resizeComponent(codeListView, self.secondPanelWidth, listViewHeight) positionComponentRelativeTo(codeListView, self.listView, listViewWidth, 0) -- text code pane local componentName = self.frameName .. "ListBoxText_UITEMP" local listBoxContent = find_uicomponent(codeListView, "list_clip", "list_box") listBoxContent:CreateComponent(componentName, "script/ui/devtool/campaign ui/mission_details") -- listBoxContent:CreateComponent(componentName, "script/ui/devtool/templates/mission_details") local tempTextUI = UIComponent(listBoxContent:Find(componentName)) local component = find_uicomponent(tempTextUI, "mission_details_child", "description_background", "description_view", "dy_description") self.codeListViewText = component listBoxContent:Adopt(component:Address()) component:PropagatePriority(listBoxContent:Priority()) removeComponent(tempTextUI) if self.isTroy then local slider = _(codeListView, "vslider") local w, h = slider:Bounds() resizeComponent(slider, w, h + 100) local x, y = slider:Position() slider:MoveTo(x - 30, y) end end function ConsoleComponent:createEnterButton() local upButton = self.upButton local textbox = self.textbox local id = self.frameName .. "_enter_btn" local button = createButton(id, self.component, "Enter", "Save current line and go into next", 120, function(context) self.devtool:incrementLines() self:updateUpDownArrowState() self.enterButton:SetState("down_off") end) self:positionComponentRelativeToWithOffset(button, upButton, 10, -(textbox:Height() / 2 + 5)) return button end function ConsoleComponent:createExecuteButton() local textbox = self.textbox local enterButton = self.enterButton local id = self.frameName .. "_exec_btn" local button = createButton(id, self.component, "Execute", "Execute Code", 120, function(context) self.devtool:executeCode() self.executeButton:SetState("down_off") end) local offset = self.isTroy and 10 or 0 self:positionComponentRelativeToWithOffset(button, enterButton, offset, -enterButton:Height()) return button end function ConsoleComponent:createClearLogsButton() local executeButton = self.executeButton local width = self.isTroy and 120 or 150 local id = self.frameName .. "_clear_logs_btn" local button = createButton(id, self.component, "Clear Logs", "Clear all output lines below the textbox", width, function(context) self:clearLogsOutput() self.clearLogsButton:SetState("down_off") end) local offset = self.isTroy and 10 or 0 self:positionComponentRelativeToWithOffset(button, executeButton, offset, -executeButton:Height()) return button end function ConsoleComponent:createClearCodeButton() local clearLogsButton = self.clearLogsButton local width = self.isTroy and 120 or 150 local id = self.frameName .. "_clear_code_btn" local button = createButton(id, self.component, "Clear Code", "Clear all previously entered code in the textbox", width, function(context) self.devtool:clearCodeLines() self.clearCodeButton:SetState("down_off") end) local offset = self.isTroy and 10 or 0 self:positionComponentRelativeToWithOffset(button, clearLogsButton, offset, -clearLogsButton:Height()) return button end function ConsoleComponent:addTextOutput(text) local componentName = self.frameName .. "_Text" .. #self.textPanes local content = find_uicomponent(self.listView, "list_clip", "list_box") content:CreateComponent(componentName .. "_UITEMP", "script/ui/devtool/campaign ui/mission_details") -- content:CreateComponent(componentName .. "_UITEMP", "script/ui/devtool/templates/mission_details") local tempUI = UIComponent(content:Find(componentName .. "_UITEMP")) local component = find_uicomponent(tempUI, "mission_details_child", "description_background", "description_view", "dy_description") content:Adopt(component:Address()) component:PropagatePriority(content:Priority()) removeComponent(tempUI) local contentWidth, contentHeight = content:Bounds() local textWidth, textHeight = component:TextDimensionsForText(text) resizeComponent(component, textWidth, textHeight) local lastComponent = self.textPanes[#self.textPanes] if not lastComponent then positionComponentRelativeTo(component, self.listView, 0, 0) else local lastWidth, lastHeight = lastComponent:Bounds() positionComponentRelativeTo(component, lastComponent, 0, lastHeight) end component:SetStateText(text) table.insert(self.textPanes, component) return component end function ConsoleComponent:updateUpDownArrowState() local currentLineNumber = self.devtool.currentLineNumber local lines = self.devtool.lines if currentLineNumber == 1 then self.upButton:SetState("inactive") if #lines == 0 then self.downButton:SetState("inactive") else self.downButton:SetState("active") end elseif currentLineNumber >= #lines then self.upButton:SetState("active") self.downButton:SetState("inactive") else self.upButton:SetState("active") self.downButton:SetState("active") end end function ConsoleComponent:updateLineNumberDisplay() local component = self.currentLineNumberComponent component:SetStateText("Current Line: " .. self.devtool.currentLineNumber) end function ConsoleComponent:updateTextBox() local content = self.component local text = self.devtool.lines[self.devtool.currentLineNumber] or "" removeComponent(find_uicomponent(content, "input_name")) self:addTextBox() self.textbox:SimulateLClick() for i in string.gmatch(text, ".") do self.textbox:SimulateKey(i) end end function ConsoleComponent:clearLogsOutput() self.textPanes = {} local toClear = find_uicomponent(self.listView, "list_clip", "list_box") toClear:DestroyChildren() end function ConsoleComponent:hideFrame() self.component:SetVisible(false) end function ConsoleComponent:showFrame() self.component:SetVisible(true) self:updateTextBox() end includeMixins(ConsoleComponent, ComponentMixin) return ConsoleComponent
local class = require 'libs.middleclass' local Ship = class('Ship') function Ship:initialize(x, y ,w, h) self.x = x self.y = y self.w = w self.h = h end function Ship:Move(dt) if love.keyboard.isDown("d") then self.x = self.x + 200 * dt elseif love.keyboard.isDown("a") then self.x = self.x - 200 * dt end end function Ship:CheckCollision() if self.x <= 0 then self.x = 0 end if self.x >= love.graphics.getWidth() - self.w then self.x = love.graphics.getWidth() - self.w end end function Ship:Draw() love.graphics.setColor(255, 0, 0) love.graphics.rectangle("fill", self.x, self.y, self.w, self.h) end return Ship
---@class CS.UnityEngine.SliderJoint2D : CS.UnityEngine.AnchoredJoint2D ---@field public autoConfigureAngle boolean ---@field public angle number ---@field public useMotor boolean ---@field public useLimits boolean ---@field public motor CS.UnityEngine.JointMotor2D ---@field public limits CS.UnityEngine.JointTranslationLimits2D ---@field public limitState number ---@field public referenceAngle number ---@field public jointTranslation number ---@field public jointSpeed number ---@type CS.UnityEngine.SliderJoint2D CS.UnityEngine.SliderJoint2D = { } ---@return CS.UnityEngine.SliderJoint2D function CS.UnityEngine.SliderJoint2D.New() end ---@return number ---@param timeStep number function CS.UnityEngine.SliderJoint2D:GetMotorForce(timeStep) end return CS.UnityEngine.SliderJoint2D
------------------------------------------------------------------------------ -- Val class ------------------------------------------------------------------------------ local ctrl = { nick = "val", parent = WIDGET, creation = "s", callback = { mousemove_cb = "d", button_press_cb = "d", button_release_cb = "d", }, } function ctrl.createElement(class, arg) return Val(arg[1]) end iupRegisterWidget(ctrl) iupSetClass(ctrl, "iup widget")
local Selection = game:GetService("Selection") local Plugin = script.Parent.Parent local Constants = require(Plugin.Constants) local Layers = require(Plugin.Layers) local Roact = require(Plugin.Vendor.Roact) local StudioComponents = require(Plugin.Vendor.StudioComponents) local Button = StudioComponents.Button local MainButton = StudioComponents.MainButton local List = require(script.Parent.List) local Move = require(script.Parent.Move) local CreateLayerWidget = require(script.Parent.CreateLayerWidget) local DeleteLayerWidget = require(script.Parent.DeleteLayerWidget) local EditLayerWidget = require(script.Parent.EditLayerWidget) local App = Roact.Component:extend("App") function App:init() self:setState({ Layers = Layers.Stack, SelectedLayerId = 1, CreatingLayer = false, EditingLayer = false, DeletingLayer = false, MaxLayers = false }) self.Connections = {} self.batchSetLayer = function(instances, id) Layers:AddChildren(id, instances) self:update(id) self:setState({ Layers = Layers.Stack }) end self.setLayer = function(instance, id) Layers:AddChild(id, instance) self:update(id) self:setState({ Layers = Layers.Stack }) end self.removeFromLayer = function(instance, id) Layers:RemoveChild(id, instance) self:update(id) self:setState({ Layers = Layers.Stack}) end self.createLayer = function(name) local res = Layers:New(name) if res then self:update(res) self:setState({ Layers = Layers.Stack }) if res == Constants.MaxLayers then self:setState({ MaxLayers = true }) end else warn(("Reached maximum number of layers (%s)."):format(Constants.MaxLayers)) end end self.editLayer = function(id, newProperties) if newProperties.transparency then newProperties.transparency = nil end Layers:Edit(id, newProperties) end self.deleteLayer = function(id) local res = Layers:Remove(id) if res then self:update(res) self:setState({ MaxLayers = false, Layers = Layers.Stack }) else warn(("Id %s does not exist."):format(id)) -- this should never happen anyway end end self.toggleVisibility = function(id) Layers:ToggleProperty(id, "Visible") self:setState({ Layers = Layers.Stack }) end self.toggleLock = function(id) Layers:ToggleProperty(id, "Locked") self:setState({ Layers = Layers.Stack }) end self.updateSelection = function() --Layers.updateSelection(self.state.SelectedLayerId) local objects = {} for instance, _ in pairs(Layers.Stack[self.state.SelectedLayerId].Children) do if instance.Parent ~= nil then table.insert(objects, instance) end end Selection:Set(objects) self:setState({ Layers = Layers.Stack }) end self.moveLayerUp = function(id) if id ~= 1 and Layers.Stack[id + 1] then Layers:Move(id, 1) self:update(id + 1) self:setState({ Layers = Layers.Stack }) end end self.moveLayerDown = function(id) if id ~= 1 and id - 1 > 1 then Layers:Move(id, -1) self:update(id - 1) self:setState({ Layers = Layers.Stack }) end end -- keybinds table.insert(self.Connections, self.props.Actions["NewLayer"].Triggered:Connect(function() if not self.state.CreatingLayer or self.state.DeletingLayer then self:setState({ CreatingLayer = true }) end end)) table.insert(self.Connections, self.props.Actions["RemoveLayer"].Triggered:Connect(function() if not self.state.CreatingLayer or self.state.DeletingLayer then self:setState({ DeletingLayer = true }) end end)) table.insert(self.Connections, self.props.Actions["MoveLayerUp"].Triggered:Connect(function() self.moveLayerUp(self.state.SelectedLayerId) end)) table.insert(self.Connections, self.props.Actions["MoveLayerDown"].Triggered:Connect(function() self.moveLayerDown(self.state.SelectedLayerId) end)) table.insert(self.Connections, self.props.Actions["MoveActiveUp"].Triggered:Connect(function() local newId = self.state.SelectedLayerId + 1 if newId <= #Layers.Stack then self:update(newId) end end)) table.insert(self.Connections, self.props.Actions["MoveActiveDown"].Triggered:Connect(function() local newId = self.state.SelectedLayerId - 1 if newId > 0 then self:update(newId) end end)) table.insert(self.Connections, self.props.Actions["GetSelection"].Triggered:Connect(function() self.updateSelection() end)) table.insert(self.Connections, self.props.Actions["MoveSelection"].Triggered:Connect(function() local targets = {} for _, obj in pairs(Selection:Get()) do if obj:IsA("BasePart") and obj.Parent ~= nil then table.insert(targets, obj) end end self.batchSetLayer(targets, self.state.SelectedLayerId) end)) table.insert(self.Connections, self.props.Actions["ToggleVisibility"].Triggered:Connect(function() self.toggleVisibility(self.state.SelectedLayerId) end)) table.insert(self.Connections, self.props.Actions["ToggleLocked"].Triggered:Connect(function() self.toggleLock(self.state.SelectedLayerId) end)) end function App:willUnmount() for _, conn in pairs(self.Connections) do conn:Disconnect() end end function App:update(id) self:setState({SelectedLayerId = id}) Layers:SetCurrentLayer(id) end function App:render() local isModalActive = self.state.CreatingLayer or self.state.DeletingLayer local selectedLayerName = Layers.Stack[self.state.SelectedLayerId].Name local selectedLayerTransparency = Layers.Stack[self.state.SelectedLayerId].Properties.Transparency return Roact.createFragment({ CreateWidget = self.state.CreatingLayer and Roact.createElement(CreateLayerWidget, { Title = "Create Layer", Layers = self.state.Layers, OnClosed = function() self:setState({ CreatingLayer = false }) end, OnSubmitted = function(name) self.createLayer(name) self:setState({ CreatingLayer = false }) end }), DeleteWidget = self.state.DeletingLayer and Roact.createElement(DeleteLayerWidget, { Title = ("Delete Layer (%s"):format(selectedLayerName), LayerName = selectedLayerName, OnClosed = function() self:setState({ DeletingLayer = false }) end, OnActivated = function() self.deleteLayer(self.state.SelectedLayerId) self:setState({ DeletingLayer = false }) end }), EditWidget = self.state.EditingLayer and Roact.createElement(EditLayerWidget, { Title = ("Edit Layer (%s)"):format(selectedLayerName), Layers = self.state.Layers, LayerName = selectedLayerName, Transparency = selectedLayerTransparency, OnClosed = function() self:setState({ EditingLayer = false }) --Layers.resetTransparency(self.state.SelectedLayerId) self:update() end, OnUpdate = function(properties) self.editLayer(self.state.SelectedLayerId, properties) self:update() end, OnReset = function() --Layers.resetTransparency(self.state.SelectedLayerId) end, OnSubmitted = function(properties) self.editLayer(self.state.SelectedLayerId, properties) self:setState({ EditingLayer = false }) self:update() end }), UI = Roact.createElement("Frame", { AnchorPoint = Vector2.new(0, 1), BackgroundTransparency = 1, Position = UDim2.fromScale(0, 1), Size = UDim2.new(1, 0, 1, -5) }, { Padding = Roact.createElement("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 4), }), List = Roact.createElement(List, { Layers = self.state.Layers, SelectedLayerId = self.state.SelectedLayerId, Disabled = isModalActive, Size = UDim2.new(1, 0, 1, -35), SetSelectedLayerId = function(id) self:update(id) if self.state.EditingLayer then self:setState({ EditingLayer = false }) self:setState({ EditingLayer = true }) end end, ToggleVisibility = function(id) self.toggleVisibility(id) end, ToggleLock = function(id) self.toggleLock(id) end, MoveLayerUp = function(id) self.moveLayerUp(id) end, MoveLayerDown = function(id) self.moveLayerDown(id) end }), Bar = Roact.createElement("Frame", { AnchorPoint = Vector2.new(0, 1), Position = UDim2.fromScale(0, 1), Size = UDim2.new(1, 0, 0, 28), BackgroundTransparency = 1 }, { Layout = Roact.createElement("UIListLayout", { SortOrder = Enum.SortOrder.LayoutOrder, FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 6), }), Create = Roact.createElement(MainButton, { LayoutOrder = 0, Size = UDim2.new(0, 28, 1, 0), Text = "", OnActivated = function() self:setState({ CreatingLayer = true }) end, Disabled = isModalActive or self.state.MaxLayers, }, { Icon = Roact.createElement("ImageLabel", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(16, 16), BackgroundTransparency = 1, Image = "rbxassetid://6688839343", ImageTransparency = (isModalActive or self.state.MaxLayers) and 0.75 or 0, }), }), Delete = Roact.createElement(Button, { LayoutOrder = 1, Size = UDim2.new(0, 28, 1, 0), Text = "", OnActivated = function() self:setState({ DeletingLayer = true }) end, Disabled = self.state.SelectedLayerId == 1 or isModalActive }, { Icon = Roact.createElement("ImageLabel", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(32, 32), BackgroundTransparency = 1, Image = "rbxassetid://7203108940", ImageColor3 = settings().Studio.Theme:GetColor(Enum.StudioStyleGuideColor.MainText), ImageTransparency = (self.state.SelectedLayerId == 1 or isModalActive) and 0.75 or 0, }), }), Edit = Roact.createElement(Button, { LayoutOrder = 2, Size = UDim2.new(0.3, -18, 1, 0), Text = "Edit", OnActivated = function() --Layers.saveTransparency(self.state.SelectedLayerId) self:setState({ EditingLayer = true }) end, Disabled = isModalActive }), Move = Roact.createElement(Move, { BatchSetLayer = function(targets) self.batchSetLayer(targets, self.state.SelectedLayerId) end }), Select = Roact.createElement(Button, { LayoutOrder = 4, Size = UDim2.new(0.3, -18, 1, 0), Text = "Select All", OnActivated = self.updateSelection, Disabled = isModalActive }) }) }) }) end return App
Auctionator.Constants = { History = { NUMBER_OF_LINES = 20 }, RESULTS_DISPLAY_LIMIT = 100, AdvancedSearchDivider = ';', PET_CAGE_ID = 82800, WOW_TOKEN_ID = 122270, SCAN_DAY_0 = time({year=2020, month=1, day=1, hour=0}), SORT = { ASCENDING = 1, DESCENDING = 0 }, ITEM_TYPES = { ITEM = 1, COMMODITY = 2 }, ITEM_CLASS_IDS = { Enum.ItemClass.Weapon, Enum.ItemClass.Armor, Enum.ItemClass.Container, Enum.ItemClass.Gem, Enum.ItemClass.ItemEnhancement, Enum.ItemClass.Consumable, Enum.ItemClass.Glyph, Enum.ItemClass.Tradegoods, Enum.ItemClass.Recipe, Enum.ItemClass.Battlepet, Enum.ItemClass.Questitem, Enum.ItemClass.Miscellaneous }, INVENTORY_TYPE_IDS = { Enum.InventoryType.IndexHeadType, Enum.InventoryType.IndexShoulderType, Enum.InventoryType.IndexChestType, Enum.InventoryType.IndexWaistType, Enum.InventoryType.IndexLegsType, Enum.InventoryType.IndexFeetType, Enum.InventoryType.IndexWristType, Enum.InventoryType.IndexHandType, }, EXPORT_TYPES = { STRING = 0, WHISPER = 1 }, NO_LIST = "", ITEM_LEVEL_THRESHOLD = 168, SHOPPING_LIST_SORTS = {{sortOrder = Enum.AuctionHouseSortOrder.Name, reverseSort = false}, {sortOrder = Enum.AuctionHouseSortOrder.Price, reverseSort = true}}, ShoppingListViews = { Lists = 1, Recents = 2, }, RecentsListLimit = 30, }
--[[ 包管理器 ]] local THIS_MODULE = ... local C_LOGTAG = "PackManager" local utils = cc.safe_require("utils") local PackLoader = import(".PackLoader") local PackManager = class("PackManager") -- 获得单例对象 local instance = nil function PackManager:getInstance() if instance == nil then instance = PackManager:create() end return instance end -- 构造函数 function PackManager:ctor() self._identify = 0 end -- 创建指定包名的包加载器 function PackManager:createPackLoader(packname) local plua = utils.get_real_luafile("app/" .. packname .. "/loader.lua") local loadcls = plua and dofile(plua) or PackLoader return loadcls:create(packname) end -- 加载指定包 function PackManager:loadPack(packname) local pack = PACK.LOADED[packname] if not pack then local packpath = PACKSPATH .. packname .. PACK.FORMAT if fileMgr:loadFilePack(packpath) then pack = { name = packname, file = packname .. PACK.FORMAT, path = packpath, version = fileMgr:getPackVersion(packname), loader = self:createPackLoader(packname) } PACK.LOADED[packname] = pack pack.loader:onLoad() logMgr:info(C_LOGTAG, "LOADED PACK { name=%s, version=%s }", pack.name, utils.get_version_name(pack.version)) self._identify = os.time() end end return pack end -- 释放指定包 function PackManager:releasePack(packname) local pack = PACK.LOADED[packname] if pack then pack.loader:onRelease() fileMgr:releaseFilePack(packname) PACK.LOADED[packname] = nil utils.remove_module("^app[.]" .. packname .. "[.].*$") logMgr:info(C_LOGTAG, "RELEASED PACK { name=%s, version=%s }", pack.name, utils.get_version_name(pack.version)) self._identify = os.time() end end -- 获得加载的包 function PackManager:getPacks() return PACK.LOADED end -- 获得指定加载的包 function PackManager:getPack(packname) return PACK.LOADED[packname] end -- 获得启动包 function PackManager:getBootPack() return PACK.BOOT end -- 检查是否是基础包 function PackManager:isBasePack(packname) for _, pname in ipairs(PACK.BASES) do if packname == pname then return true end end end -- 获得当前包识别ID function PackManager:getIdentify() return self._identify end return PackManager
local PLUGIN = PLUGIN ix.chat.Register("consulcast", { format = "PA system broadcasts \"%s\"", color = Color(175, 54, 45), CanSay = function(_, speaker) return not IsValid(speaker) end, OnChatAdd = function(self, _, text) chat.AddText(self.color, string.format(self.format, text)) end })
-- -- (C) 2013 [email protected] -- local coroutine,package,string,table,math,io,os,debug,assert,dofile,error,_G,getfenv,getmetatable,ipairs,Gload,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,_VERSION,xpcall,module,require=coroutine,package,string,table,math,io,os,debug,assert,dofile,error,_G,getfenv,getmetatable,ipairs,load,loadfile,loadstring,next,pairs,pcall,print,rawequal,rawget,rawset,select,setfenv,setmetatable,tonumber,tostring,type,unpack,_VERSION,xpcall,module,require local log,dump=require("wetgenes.logs"):export("log","dump") -- do a reverse enum lookup, get a name from a value local lookup=function(tab,num) for n,v in pairs(tab) do if v==num then return n end end end local sdl={} sdl.pads_map={} sdl.pads={} -- build a map of pads idx to player idx sdl.pads_fix=function() local idx=0 for i=1,#sdl.pads do local v=sdl.pads[i] if type(v)~="string" then idx=idx+1 sdl.pads_map[i]=idx else sdl.pads_map[i]=nil end end end local SDL=require("SDL") local wstr=require("wetgenes.string") local dprint=function(a) print(wstr.dump(a)) end sdl.print=print sdl.video_init_done=false sdl.video_init=function() if not sdl.video_init_done then sdl.video_init_done=true SDL.init{ SDL.flags.Video, SDL.flags.Joystick, SDL.flags.GameController, SDL.flags.Events, } -- SDL.init{ SDL.flags.Everything, } -- SDL.videoInit() end end sdl.screen=function() -- print("SDL screen") sdl.video_init() local b=SDL.getDisplayBounds(0) -- PI SDL may return nil at this point? -- in which case just lie and return 640x480 if not b then return 640,480 end return b.w,b.h end sdl.create=function(t) -- print("SDL create") sdl.video_init() if not t.console then -- try and free the windows console unless asked not to pcall( function() -- we dont care if this fails, just means we are not running on windows local ffi=require("ffi") ffi.cdef(" void FreeConsole(void); ") if ffi.C.FreeConsole then log( "oven","detaching from windows console") ffi.C.FreeConsole() end end) end local it={} sdl.it=it local flags={ SDL.window.Resizable , SDL.window.OpenGL } if jit and jit.os=="Windows" then -- windows does not do borderless resize, so, meh else if not t.border then flags[#flags+1]=SDL.window.Borderless end end --[[ if view=="full" then flags={SDL.window.Desktop,SDL.window.OpenGL} elseif view=="max" then flags={SDL.window.Maximized,SDL.window.OpenGL} end ]] it.win= assert(SDL.createWindow { title = t.title, width = t.width, height = t.height, flags = flags,--{ SDL.window.Resizable , SDL.window.OpenGL }, x = t.x, y = t.y, }) if not t.border then require("wetgenes.win.core").sdl_attach_resize_hax(it.win) --[[ it.win:setHitTest(function(...) print(...) end) ]] end return it end sdl.destroy=function(it) -- print("SDL destroy") if it then SDL.destroyWindow(it.win) elseif sdl.it then SDL.destroyWindow(sdl.it.win) sdl.it=nil end return nil end sdl.info=function(it,w) -- print("SDL info") it=it or sdl.it w=w or {} w.width,w.height=it.win:getSize() end sdl.resize=function(it,w,h) it=it or sdl.it if it and it.win then it.win:setSize(w,h) end end sdl.show=function(it,view) -- print("SDL show") it=it or sdl.it it.win:show() if view=="full" then it.win:setFullscreen(SDL.window.Desktop) -- if view=="full" then it.win:setFullscreen(SDL.window.Fullscreen) elseif view=="max" then it.win:maximize() else it.win:setFullscreen(0) it.win:restore() end -- sdl.mousexy_init() return nil end sdl.context=function(it) -- print("SDL context") it=it or sdl.it --[[ if string.find(SDL.getPlatform(),"Mac") then -- OSX requires some fluffing to get a working GL context print("SDL detected OSX : "..SDL.getPlatform()) SDL.glSetAttribute(SDL.glAttr.ContextProfileMask,SDL.glProfile.Core) SDL.glSetAttribute(SDL.glAttr.ContextFlags,SDL.glFlags.ForwardCompatible) SDL.glSetAttribute(SDL.glAttr.ContextMajorVersion,3) SDL.glSetAttribute(SDL.glAttr.ContextMinorVersion,2) elseif string.find(SDL.getPlatform(),"Emscripten") then print("SDL detected EMCC : "..SDL.getPlatform()) --ask emscripten for a webgl 2.0 / es 3.0 context SDL.glSetAttribute(SDL.glAttr.ContextMajorVersion,3) end ]] if not it.ctx then -- request an opengl 3.2 core context SDL.glSetAttribute(SDL.glAttr.ContextProfileMask,SDL.glProfile.Core) SDL.glSetAttribute(SDL.glAttr.ContextMajorVersion,3) SDL.glSetAttribute(SDL.glAttr.ContextMinorVersion,2) it.ctx=SDL.glCreateContext(it.win) end if not it.ctx then -- request an opengl es 3.0 context SDL.glSetAttribute(SDL.glAttr.ContextProfileMask, SDL.glProfile.ES) SDL.glSetAttribute(SDL.glAttr.ContextMajorVersion, 3) SDL.glSetAttribute(SDL.glAttr.ContextMinorVersion, 0) it.ctx=SDL.glCreateContext(it.win) end assert(it.ctx) SDL.glMakeCurrent(it.win, it.ctx) SDL.glSetSwapInterval(1) -- enable vsync by default local gles=require("gles") log( "oven","vendor",(gles.Get(gles.VENDOR) or "")) log( "oven","render",(gles.Get(gles.RENDERER) or "")) log( "oven","version",(gles.Get(gles.VERSION) or "")) return it.ctx end sdl.swap=function(it) it=it or sdl.it SDL.glSwapWindow(it.win) end sdl.sleep=function(sec) -- print("SDL sleep") SDL.delay(sec*1000) -- convert seconds to milliseconds return nil end sdl.time=function() -- print("SDL time") return SDL.getTicks()/1000 end sdl.queue={} sdl.msg=function() -- print("SDL msg") sdl.msg_fetch() if sdl.queue[1] then return table.remove(sdl.queue,1) end end sdl.peek=function() -- print("SDL peek") sdl.msg_fetch() return sdl.queue[1] end sdl.wait=function() log("sdl","wait") return nil end sdl.mousexy={-1,-1} -- add current mouse position to the queue -- this does not help, we still get 0,0 at the start until the mouse moves... --[[ sdl.mousexy_init=function() local b,x,y=SDL.getMouseState() local t={} t.time=sdl.time() t.class="mouse" t.action=0 t.x=x t.y=y sdl.queue[#sdl.queue+1]=t sdl.mousexy[1]=t.x sdl.mousexy[2]=t.y print("MOUSE",t.x,t.y) end ]] sdl.msg_fetch=function() for e in SDL.pollEvent() do if (e.type == SDL.event.KeyDown) or (e.type == SDL.event.KeyUp) then local t={} t.time=sdl.time() t.class="key" t.action=(e.type==SDL.event.KeyUp) and -1 or ( e["repeat"] and 0 or 1 ) t.keyname=SDL.getKeyName(e.keysym.sym) -- dprint(t) sdl.queue[#sdl.queue+1]=t elseif (e.type == SDL.event.TextInput) then local t={} t.time=sdl.time() t.class="text" t.text=e.text sdl.queue[#sdl.queue+1]=t elseif (e.type == SDL.event.MouseWheel) then -- dprint(e) local t={} t.time=sdl.time() t.class="mouse" t.action=0 t.x=sdl.mousexy[1] t.y=sdl.mousexy[2] if e.y>0 then t.keycode=4 t.action=-1 elseif e.y<0 then t.keycode=5 t.action=-1 end -- dprint(t) sdl.queue[#sdl.queue+1]=t elseif (e.type == SDL.event.MouseButtonDown) or (e.type == SDL.event.MouseButtonUp) or (e.type == SDL.event.MouseMotion) then local t={} t.time=sdl.time() t.class="mouse" t.action=(e.type==SDL.event.MouseButtonUp) and -1 or ( (e.type==SDL.event.MouseButtonDown) and 1 or 0 ) t.x=e.x t.y=e.y t.keycode=e.button -- dprint(t) sdl.queue[#sdl.queue+1]=t sdl.mousexy[1]=e.x sdl.mousexy[2]=e.y if not sdl.relative_mouse_mode then if SDL.captureMouse then -- sanity test if e.type == SDL.event.MouseButtonDown then SDL.captureMouse(true) elseif e.type == SDL.event.MouseButtonUp then SDL.captureMouse(false) end end end elseif (e.type == SDL.event.FingerDown) or (e.type == SDL.event.FingerUp) or (e.type == SDL.event.FingerMotion) then local t={} t.time=sdl.time() t.class="touch" t.action=(e.type==SDL.event.FingerUp) and -1 or ( (e.type==SDL.event.FingerDown) and 1 or 0 ) t.x=e.x t.y=e.y t.id=e.fingerId t.pressure=e.pressure -- dprint(t) sdl.queue[#sdl.queue+1]=t -- sdl.mousexy[1]=e.x -- sdl.mousexy[2]=e.y elseif (e.type == SDL.event.WindowEvent) then -- window related, eg focus resize etc if ( e.event == SDL.eventWindow.SizeChanged ) then local t={} t.time=sdl.time() t.class="resize" sdl.queue[#sdl.queue+1]=t end elseif (e.type == SDL.event.Quit) then -- window close button, or alt f4 local t={} t.time=sdl.time() t.class="close" sdl.queue[#sdl.queue+1]=t elseif (e.type == SDL.event.JoyDeviceAdded) then --ignore elseif (e.type == SDL.event.ControllerDeviceAdded) then sdl.pads[#sdl.pads+1]=SDL.gameControllerOpen(e.which) sdl.pads_fix() --print("SDL","Open",e.which) elseif (e.type == SDL.event.JoyDeviceRemoved) then --ignore elseif (e.type == SDL.event.ControllerDeviceRemoved) then sdl.pads[e.which+1]="CLOSED" sdl.pads_fix() --print("SDL","Close",e.which) elseif (e.type == SDL.event.JoyAxisMotion) then --ignore elseif (e.type == SDL.event.ControllerAxisMotion) then local dev=sdl.pads[e.which+1] local id=sdl.pads_map[e.which+1] --print("SDL","AXIS",e.which,id,lookup(SDL.controllerAxis,e.axis),e.value) local t={} t.time=sdl.time() t.class="padaxis" t.value=e.value t.code=e.axis t.name=lookup(SDL.controllerAxis,e.axis) t.id=id sdl.queue[#sdl.queue+1]=t elseif (e.type == SDL.event.JoyButtonDown) or (e.type == SDL.event.JoyButtonUp) then --ignore elseif (e.type == SDL.event.ControllerButtonDown) or (e.type == SDL.event.ControllerButtonUp) then local dev=sdl.pads[e.which+1] local id=sdl.pads_map[e.which+1] --print("SDL","KEY",e.which,id,lookup(SDL.controllerButton,e.button),e.state) local t={} t.time=sdl.time() t.class="padkey" t.value=e.state and 1 or -1 t.code=e.button t.name=lookup(SDL.controllerButton,e.button) t.id=id sdl.queue[#sdl.queue+1]=t else -- handle JoyHatMotion ? -- local s=lookup(SDL.event,e.type) -- print(s.." : "..e.type) -- dprint(e) end end end sdl.relative_mouse_mode=false sdl.relative_mouse=function(it,mode) local oldmode=sdl.relative_mouse_mode sdl.relative_mouse_mode=mode SDL.setRelativeMouseMode(mode) it.win:setGrab(mode and 1 or 0) SDL.captureMouse(mode) return oldmode end sdl.warp_mouse=function(it,x,y) it=it or sdl.it it.win:warpMouse(x,y) return true end -- -- kinda hacky, but turn a grd into a surface via a bitmap structure... -- local _grd_to_surface=function(g) local wgrd=require("wetgenes.grd") local pack=require("wetgenes.pack") if type(g)=="string" then -- assume swanky32 bitdown format and convert to grd g=require("wetgenes.gamecake.fun.bitdown").pix_grd(g) -- convert to grd end assert(g:convert(wgrd.U8_RGBA)) -- make sure it is this format assert(g:flipy()) -- needs to be the other way up local argb=g:pixels(0,0,g.width,g.height) for i=0,g.width*g.height*4-1,4 do argb[i+1],argb[i+3]=argb[i+3],argb[i+1] end -- swap red and blue -- create a bmp in memory local bmp_data=pack.save_array(argb,"u8",0,#argb) local bmp_file=pack.save{2,"BM","u32",14+40+#bmp_data,"u16",0,"u16",0,"u32",14+40} local bmp_head=pack.save{"u32",40,"u32",g.width,"u32",g.height,"u16",1,"u16",32,"u32",0,"u32",#bmp_data,"u32",0,"u32",0,"u32",0,"u32",0} -- create a bmp stream for SDL to read... local it={} it.dat=bmp_file..bmp_head..bmp_data it.off=0 function it.size() return #it.dat end function it.close() end function it.seek(offset, whence) if whence == SDL.rwopsSeek.Set then it.off=offset elseif whence == SDL.rwopsSeek.Current then it.off=it.off+offset elseif whence == SDL.rwopsSeek.End then it.off=#it.dat-offset end if it.off<0 then it.off=0 end if it.off>#it.dat then it.off=#it.dat end return it.off end function it.read(n, size) local i=n*size if i>0 then local d=it.dat:sub(it.off+1,it.off+i) it.off=it.off+i return d,#d else return nil end end function it.write(data, n, size) end local rw=assert(SDL.RWCreate(it)) local surf=assert(SDL.loadBMP_RW(rw)) return surf end sdl.icon=function(w,g) w.win:setIcon(_grd_to_surface(g)) end sdl.has_clipboard=function() return SDL.hasClipboardText() end sdl.get_clipboard=function() return SDL.getClipboardText() end sdl.set_clipboard=function(s) return SDL.setClipboardText(s) end -- we want lowercase only, and map to these capitals local _cursor_names={ "Arrow","Ibeam","Wait","Crosshair","WaitArrow", "SizeNWSE","SizeNESW","SizeWE","SizeNS","SizeAll", "No","Hand", } -- 24x24 is probably a safe and reasonable size? --[=[ wwin.cursor("test",[[ 0 0 0 0 . . . . . . . . . . . . 0 0 0 0 . . . . 0 7 7 0 . . . . . . . . . . . . 0 7 7 0 . . . . 0 7 7 0 . . . . . . . . . . . . 0 7 7 0 . . . . 0 0 0 7 . . . . . . . . . . . . 0 0 0 7 . . . . . . . . 7 . . . . . . . . . . . . . . . 7 . . . . . . . . 7 . . . . . . . . . . . . . . . 7 . . . . . . . . R R R R . . . . . . . . . . . . R R . . . . . . R R R R . . . . . . . . . . . . R R . . . . . . R R R R . . . . . . . . . . . . R R . . . . . . R R R R . . . . . . . . . . . . R R . . . . . . . . . . 7 . . . . . . . . . . . . . . . . . . . . . . . . 7 . . . . . . . . . . . . . . . . . . . . . . . . 7 0 0 0 . . . . . . . . . . . . . . . . . . . . 0 7 7 0 . . . . . . . . . . . . . . . . . . . . 0 7 7 0 . . . . . . . . . . . . . . . . . . . . 0 0 0 0 . . . . . . . . 0 0 0 0 . . . . . . . . . . . . 0 0 0 0 . . . . 0 7 7 0 . . . . . . . . . . . . 0 7 7 0 . . . . 0 7 7 0 . . . . . . . . . . . . 0 7 7 0 . . . . 0 0 0 7 . . . . . . . . . . . . 0 0 0 7 . . . . . . . . 7 . . . . . . . . . . . . . . . 7 . . . . . . . . 7 . . . . . . . . . . . . . . . 7 . . . . . . . . 7 . . . . . . . . . . . . . . . 7 . . . . . . . . 7 . . . . . . . . . . . . . . . 7 ]]) ]=] local _cursors={} local _cursor=function(s,dat,px,py) if dat then -- remember a new one dat=_grd_to_surface(dat) -- convert from grd to surface _cursors[s]=assert(SDL.createColorCursor(dat , px or 0 , py or 0 )) end local v=_cursors[s] if v then return v end if type(s)~="string" then return end local S=s -- fix capitals for i,v in ipairs(_cursor_names) do if v:lower()==s then S=v break end end v=assert( SDL.createSystemCursor( SDL.systemCursor[S] ) ) _cursors[s]=v return v end sdl.cursor=function(s,dat,px,py) local v=_cursor(s,dat,px,py) if not dat then -- if not setting an image then change the actual cursor if v then SDL.setCursor(v) else if type(s)=="nil" then -- default local v=_cursor("arrow") if v then SDL.setCursor(v) end SDL.showCursor(true) elseif type(s)=="boolean" then -- show/hide SDL.showCursor(s) end end end end sdl.platform=SDL.getPlatform() -- remember platform return sdl
-- ========================== -- LSP-STATUS MESSAGES BUBBLE -- ========================== -- Created by kuznetsss <github.com/kuznetsss> local settings = { color = vim.g.bubbly_colors, style = vim.g.bubbly_styles, timing = vim.g.bubbly_timing, filter = vim.g.bubbly_filter, } ---@type fun(settings: table, module_name: string): table local process_settings = require("bubbly.utils.module").process_settings settings = process_settings(settings, "lsp_status.messages") local lsp_status = require("bubbly.utils.prerequire")("lsp-status") if not lsp_status then require("bubbly.utils.io").error( [[Couldn't load 'lsp-status' for the component 'lsp_status.messages', the component will be disabled.]] ) end ---@type fun(filter: table): boolean local process_filter = require("bubbly.utils.module").process_filter local spinner_frames = { "⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣾", "⣽" } local timer = vim.loop.new_timer() local show_new_messages_allowed = true local last_messages = nil -- Enables updates of new messages local function allow_update() show_new_messages_allowed = true end -- Returns bubble that shows lsp-status messages ---@param inactive boolean ---@return Segment[] return function(inactive) if inactive then return nil end if lsp_status == nil then return nil end if not process_filter(settings.filter) then return nil end local messages = lsp_status.messages() if not show_new_messages_allowed then return last_messages end local contents = {} for _, msg in ipairs(messages) do local parsed_message = "" if msg.progress then parsed_message = parsed_message .. msg.title if msg.message then parsed_message = parsed_message .. " " .. msg.message end if msg.percentage then parsed_message = parsed_message .. " (" .. math.floor(msg.percentage + 0.5) .. "%%)" end if msg.spinner then parsed_message = spinner_frames[(msg.spinner % #spinner_frames) + 1] .. " " .. parsed_message end elseif msg.status then parsed_message = parsed_message .. msg.content else parsed_message = parsed_message .. msg.content end if contents[msg.name] == nil then contents[msg.name] = parsed_message else contents[msg.name] = contents[msg.name] .. ", " .. parsed_message end end local result_str = "" for name, msg in pairs(contents) do result_str = result_str .. name .. ": " .. msg .. " | " end result_str = result_str:sub(1, -4) local result = { { data = result_str, color = settings.color, style = settings.style, } } show_new_messages_allowed = false last_messages = result timer:start(settings.timing.update_delay, 0, vim.schedule_wrap(allow_update)) return result end
--↔ local obj = { __gc = true } setmetatable(obj, obj) obj.__gc = function(t) t:endPresentation() end -- Metadata obj.name = "BCSPresentation" obj.version = "1.0" obj.author = "Chris Jones <[email protected]>" obj.homepage = "https://github.com/Hammerspoon/presentation" obj.license = "MIT - https://opensource.org/licenses/MIT" -- Internal function used to find our location, so we know where to load files from local function script_path() local str = debug.getinfo(2, "S").source:sub(2) return str:match("(.*/)") end obj.spoonPath = script_path() function obj:init() -- Preload the modules we're going to need require("hs.chooser") require("hs.webview") require("hs.canvas") -- Create a menubar object to initiate the presentation self.presentationControl = hs.menubar.new() --presentationControl:setIcon(hs.image.imageFromName(hs.image.systemImageNames["EnterFullScreenTemplate"])) --self.presentationControl:setIcon(hs.image.imageFromName("NSSecurity")) self.presentationControl:setTitle("Presentation") self.presentationControl:setMenu({{ title = "Start Presentation", fn = obj.setupPresentation }}) end -- Storage for persistent screen objects obj.presentationControl = nil obj.presentationScreen = nil obj.screenFrame = nil obj.slideView = nil obj.numDefaultElements = nil obj.slideHeaderFrame = nil obj.slideBodyFrame = nil obj.slideFooterFrame = nil obj.slideModal = nil -- Configuration for persistent screen objects obj.slideHeaderFont = nil obj.slideHeaderSize = nil obj.slideBodyFont = nil obj.slideBodySize = nil obj.slideFooterFont = nil obj.slideFooterSize = nil -- Metadata for slide progression obj.startSlide = 1 obj.currentSlide = 0 -- Storage for transient screen objects obj.refs = {} function obj.setDefaultFontSizes() obj.slideHeaderSize = obj.screenFrame["h"] / 15 obj.slideBodySize = obj.screenFrame["h"] / 22 obj.slideFooterSize = obj.screenFrame["h"] / 30 end function obj.get_left_frame(percent) local factor = percent/100 local fakeBodyFrame = obj.get_body_frame(obj.screenFrame, 100) local x = fakeBodyFrame["x"] local y = obj.slideHeaderFrame["y"] + obj.slideHeaderFrame["h"] + 10 local w = fakeBodyFrame["w"] * factor - 5 local h = fakeBodyFrame["h"] return {x=x, y=y, w=w, h=h} end function obj.get_right_frame(percent) local factor = percent/100 local fakeBodyFrame = obj.get_body_frame(obj.screenFrame, 100) local x = fakeBodyFrame["x"] + (fakeBodyFrame["w"] *(1-factor)) + 5 local y = obj.slideHeaderFrame["y"] + obj.slideHeaderFrame["h"] + 10 local w = fakeBodyFrame["w"] * factor - 5 local h = fakeBodyFrame["h"] return {x=x, y=y, w=w, h=h} end function obj.get_body_frame(frame, percent) local factor = percent/100 local x = frame["x"] + 50 local y = obj.slideHeaderFrame["y"] + obj.slideHeaderFrame["h"] + 10 local w = (frame["w"] - 100)*factor local h = obj.slideFooterFrame["y"] - y return {x=x, y=y, w=w, h=h} end function obj.makecodeview(slideView, name, place, code, percent) print("Creating codeview "..name) local codeViewRect if place == "right" then codeViewRect = obj.get_right_frame(33) elseif place == "righthalf" then codeViewRect = obj.get_right_frame(50) elseif place == "lefthalf" then codeViewRect = obj.get_left_frame(50) elseif place == "body" then codeViewRect = obj.get_body_frame(obj.screenFrame, 100) end slideView:appendElements({action="fill", type="rectangle", frame=codeViewRect, fillColor=hs.drawing.color.x11.white}, {action="fill", type="text", frame=codeViewRect, text=code, textSize=obj.slideBodySize*0.5, textFont="SF Mono", textColor=hs.drawing.color.x11.black}) end function obj.makeimageview(slideView, name, place, imageName, percent) print("Creating imageview"..name) local imageViewRect if place == "right" then imageViewRect = obj.get_right_frame(33) elseif place == "righthalf" then imageViewRect = obj.get_right_frame(50) elseif place == "body" then imageViewRect = obj.get_body_frame(obj.screenFrame, 100) end local image = hs.image.imageFromPath(obj.spoonPath .. "/" .. imageName) slideView:appendElements({action="fill", type="image", frame=imageViewRect, image=image, imageAnimates=true, imageScaling="scaleProportionally" }) end function obj.makewebview(name, place, url, html) if obj.refs[name] then return obj.refs[name] else print("Creating webview "..name) local webViewRect if place == "right" then webViewRect = obj.get_right_frame(33) elseif place == "righthalf" then webViewRect = obj.get_right_frame(50) elseif place == "lefthalf" then webViewRect = obj.get_left_frame(50) elseif place == "body" then webViewRect = obj.get_body_frame(obj.screenFrame, 100) end local webview = hs.webview.new(webViewRect) webview:setLevel(hs.drawing.windowLevels["normal"]+1) if url then webview:url(url) elseif html then webview:html(html) else webview:html("NO CONTENT!") end obj.refs[name] = webview return webview end end -- Definitions of the slides obj.slides = { { ["header"] = "Hammerspoon - Chris Jones", ["body"] = [[ • Ng on IRC • cmsj everywhere else • Work at Red Hat on OpenStack • Any Mac users in? • Anyone used Objective C? • Anyone used Lua? ]], ["enterFn"] = function() obj.makeimageview(obj.slideView, "hammerspoon", "righthalf", "hammerspoon.png") end, ["bodyWidth"] = 50, }, { ["header"] = "Agenda", ["body"] = [[We will cover: • A little Apple history • How Hammerspoon came to exist • What can it do? • How Hammerspoon works • Questions? ]], }, { ["header"] = "A little Apple history", ["body"] = [[First party: • 1991 - Apple Events (System 7) • 1993 - AppleScript (System 7.1.1) • 2005 - Automator (OS X 10.4) • 2007 - ScriptingBridge (OS X 10.5) Third party: • 1991 onwards - AppleScript libraries, many utilities • 2014 - Hammerspoon is forked from Mjolnir]] }, -- { -- ["header"] = "AppleScript", -- ["enterFn"] = function() -- obj.makecodeview(obj.slideView, "appleScriptCodeView", "righthalf", [[tell application "Hammerspoon" -- execute lua code "hs.reload()" -- end tell -- -- tell application "Safari" -- set currentURL to URL of document 1 -- end tell -- return currentURL]]) -- end, -- ["bodyWidth"] = 50, -- ["body"] = [[ • Supposedly simple, natural language -- • Very powerful despite its awful syntax -- • High level messages passed to apps via Apple Events -- • Apps expected to expose their functionality -- • Apps can expose object hierarchies (e.g. a browser can expose page elements within tabs within windows)]] -- }, -- { -- ["header"] = "Receiving AppleScript events", -- ["enterFn"] = function() -- obj.makecodeview(obj.slideView, "appleScriptCodeView", "righthalf", [[@implementation executeLua -- -(id)performDefaultImplementation { -- // Get the arguments: -- NSDictionary *args = [self evaluatedArguments]; -- NSString *stringToExecute = [args valueForKey:@""]; -- if (HSAppleScriptEnabled()) { -- // Execute Lua Code: -- return executeLua(self, stringToExecute); -- } else { -- // Raise AppleScript Error: -- [self setScriptErrorNumber:-50]; -- [self setScriptErrorString:someErrorMessage]; -- return @"Error"; -- } -- } -- @end]]) -- end, -- ["body"] = [[ • Application defines the commands it accepts (in this case "executeLua") in an XML "dictionary" -- • Commands are mapped to Objective C interfaces (like protocols/traits in other languages) -- • Foundation.framework calls the implementation method of the relevant interface -- • Dictionaries can be browsed by the user using Script Editor.app]], -- ["bodyWidth"] = 50 -- }, -- { -- ["header"] = "How Hammerspoon came to exist: Motivation", -- ["enterFn"] = function() -- obj.makeimageview(obj.slideView, "keyboardMaestro", "righthalf", "keyboardmaestro.png") -- end, -- ["bodyWidth"] = 50, -- ["body"] = [[ • I was using Keyboard Maestro to automate tasks -- • Very powerful, can react to lots of system events -- • Ideal for non-programmer power users -- • As a programmer, became frustrated with graphical programming -- • Not open source]] -- }, -- { -- ["header"] = "How Hammerspoon came to exist: Circumstance", -- ["body"] = [[ • Others also wanted something programmable -- • First notable app was Slate (used JavaScript) -- • Quickly went unmaintained, never really recovered -- • Steven Degutis began a series of open source experiments -- • Hydra, Phoenix, Penknife (used various languages) -- • Culminated in Mjolnir, simple bridge between Lua and OS X]] -- }, { ["header"] = "How Hammerspoon came to exist: The Fork", ["body"] = [[ • Mjolnir is a very simple Lua ↔ ObjC bridge • Shipped with no OS integrations • They were supposed to be distributed separately • Small group of us disagreed and decided to fork in October 2014 • Aim was a "batteries included" automation app • Started with ~15000 lines of code (13000 being Lua) • Now have ~100000 lines of code (37500 being OS integrations)]] }, { ["header"] = "So what can it do?", ["body"] = [[• Reacting to all kinds of events • WiFi, USB, path/file changes, • Location, audio devices • Keyboard/Mouse/Scroll inputs • Application launch/hide/quit • Battery, Screen, Speech • Window management • Interacting with applications (menus) • Drawing custom interfaces on the screen • HTTP client/server • Raw socket client/server • URL handling/mangling • MIDI, SQLite3, Timers, Processes, etc.]], ["enterFn"] = function() local webview = obj.makewebview("whatCanItDoWebview", "righthalf", "http://www.hammerspoon.org/docs/", nil) webview:show(0.3) local webviewRect = webview:frame() local webviewCentrePoint = hs.geometry.point(webviewRect.x + webviewRect.w/2, webviewRect.y + webviewRect.h/2) hs.mouse.setAbsolutePosition(webviewCentrePoint) obj.refs["whatCanItDoCounter"] = 100 obj.refs["whatCanItDoTimer"] = hs.timer.doUntil(function() return obj.refs["whatCanItDoCounter"] <= 0 end, function() obj.refs["whatCanItDoCounter"] = obj.refs["whatCanItDoCounter"] - 1 hs.eventtap.event.newScrollEvent({0, -100}, {}, "pixel"):post() end, 0.1):start() end, ["exitFn"] = function() obj.refs["whatCanItDoTimer"]:stop() local webview = obj.refs["whatCanItDoWebview"] webview:hide(0.2) end }, { ["header"] = "How does it work?", ["body"] = [[• Lua is really easy to embed in C • Lots of boilerplate • Ripe for abstraction • Handles errors with setjmp/longjmp • We built "LuaSkin" • Lua state lifecycle • Argument checking • Library/Object creation • Lua ↔ ObjC type translation (including ObjC objects) • Lua errors → ObjC exceptions ]], }, -- { -- ["header"] = "Lua vs LuaSkin - Lifecycle", -- ["enterFn"] = function() -- obj.makecodeview(obj.slideView, "LuaVsLuaSkinILeft", "lefthalf", [[lua_State *createLua() { -- lua_State *L = luaL_newstate(); -- luaL_openlibs(); -- luaL_loadfile(L, "~/.hammerspoon/init.lua"); -- lua_pcall(L, 0, 0, 0); -- return L; --} -- --void destroyLua(lua_State *L) { -- lua_close(L); -- L = NULL; --} --]]) -- obj.makecodeview(obj.slideView, "LuaVsLuaSkinIRight", "righthalf", [[LuaSkin *createLua() { -- return [LuaSkin shared]; --} -- --void destroyLua(LuaSkin *skin) { -- [skin destroyLuaState]; --} --]]) -- end, -- }, { ["header"] = "Lua vs LuaSkin - Argument checking", ["enterFn"] = function() obj.makecodeview(obj.slideView, "LuaVsLuaSkinArgCheckLeft", "lefthalf", [[static int foo(lua_State *L) { if (lua_type(L, 1) != LUA_TINTEGER && \ lua_type(L, 1) != LUA_TSTRING) { luaL_error(L, "argument 1 must be an integer or a string"); } if (lua_type(L, 2) != LUA_TSTRING && \ lua_type(L, 2) != LUA_TBOOLEAN) { luaL_error(L, "argument 2 must be a string or a boolean"); } ]]) obj.makecodeview(obj.slideView, "LuaVsLuaSkinArgCheckRight", "righthalf", [[LuaSkin *skin = [LuaSkin shared]; [skin argcheck:LS_TINTEGER|LS_TSTRING, LS_TSTRING|LS_TBOOLEAN, LS_TBREAK]; ]]) end, }, -- { -- ["header"] = "Lua vs LuaSkin - Library creation", -- ["enterFn"] = function() -- obj.makecodeview(obj.slideView, "LuaVsLuaSkinLibCreationLeft", "lefthalf", [[luaL_Reg lib[] = { -- {"someUsefulThing", someCFunction}, -- {NULL, NULL} --}; -- --luaL_Reg lib_meta[] = { -- {"__gc", someCleanupFunction}, -- {NULL, NULL} --}; -- --luaL_newlib(L, lib); --luaL_newlib(L, lib_meta); --lua_setmetatable(L, -2); --]]) -- obj.makecodeview(obj.slideView, "LuaVsLuaSkinLibCreationRight", "righthalf", [[luaL_Reg lib[] = { -- {"someUsefulThing", someCFunction}, -- {NULL, NULL} --}; -- --luaL_Reg lib_meta[] = { -- {"__gc", someCleanupFunction}, -- {NULL, NULL} --}; -- --LuaSkin *skin = [LuaSkin shared]; --[skin registerLibrary:lib metaFunctions:lib_meta]; --]]) -- end, -- }, { ["header"] = "Lua vs LuaSkin - Object creation", ["enterFn"] = function() obj.makecodeview(obj.slideView, "LuaVsLuaSkinObjCreationLeft", "lefthalf", [[luaL_Reg obj[] = { {"methodA", someCFunction}, {"methodB", otherCFunction}, {NULL, NULL} }; luaL_newlib(L, obj); lua_pushvalue(L, -1); lua_setfield(L, -2, "__index"); lua_pushstring(L, "objectName"); lua_setfield(L, -2, "__type"); lua_pushstring(L, "objectName"); lua_setfield(L, -2, "__name"); lua_setfield(L, LUA_REGISTRYINDEX, "objectName"); ]]) obj.makecodeview(obj.slideView, "LuaVsLuaSkinObjCreationRight", "righthalf", [[luaL_Reg obj[] = { {"methodA", someCFunction}, {"methodB", otherCFunction}, {NULL, NULL} }; LuaSkin *skin = [LuaSkin shared]; [skin registerObject:"objectName" objectFunctions:obj]; ]]) end }, { ["header"] = "Lua vs LuaSkin - Type translation", ["enterFn"] = function() obj.makecodeview(obj.slideView, "LuaVsLuaSkinTypeTransLeft", "lefthalf", [[NSString *obj = @"hello world"; size_t size = [obj lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; lua_pushlstring(L, obj.UTF8String, size); NSString *foo = [NSString stringWithUTF8String:lua_tostring(L, 1)]; NSArray *list = @[@"hi", @(42), [SomeClass newClass] ]; for (int i=0; i < list.allKeys; i++) { id obj = [list objectAtIndex:i]; if ([obj isKindOfClass:[NSNull class] ]) lua_pushnil(L); else if ([obj isKindOfClass:[NSNumber class] ]) lua_pushinteger(L, [(NSNumber *)obj intValue]); else if ([obj isKindOfClass:[NSArray class] ]) { // Oh no, we need to recurse lua_pushSOMETHING(L, I_HATE_MY_LIFE); } // Repeat for every type of class and cry } ]]) obj.makecodeview(obj.slideView, "LuaVsLuaSkinTypeTransRight", "righthalf", [[NSString *obj = @"hello world"; [skin pushNSObject:obj]; NSString *foo = [skin toNSObjectAtIndex:1]; NSArray *list = @[@"hi", @(42), [SomeClass newClass] ]; [skin pushNSObject:list]; ]]) end }, -- { -- ["header"] = "Lua vs LuaSkin Part 2", -- ["exitFn"] = function() -- local webview = obj.refs["LuaVsLuaSkinIILeft"] -- webview:hide(0.1) -- end, -- ["enterFn"] = function() -- local webview = obj.makewebview("LuaVsLuaSkinIILeft", "lefthalf", nil, [[<html><head><style> -- pre { -- width: 100%; -- font-size: 28px; -- } -- </style></head> -- <body><pre>luaL_Reg lib[] = {{"new", new}, {NULL, NULL}}; -- luaL_Reg obj[] = {{"inc", inc}, {NULL, NULL}}; -- void main() { -- lua_State *L = luaL_newstate(); luaL_openlibs(); -- luaL_newlib(L, lib); -- luaL_newlib(L, obj); -- lua_pushvalue(L, -1); -- lua_setfield(L, -2, "__index"); -- lua_setfield(L, LUA_REGISTRYINDEX, "counter"); -- } -- static int new(lua_State *L) { -- if (lua_type(L, 1) != LUA_TINTEGER) { -- lua_pushnil(L); -- return; -- } -- int *c_ptr = lua_newuserdata(L, sizeof(int)); -- *c_ptr = lua_tointeger(L, 1); -- luaL_getmetatable(L, "counter"); -- lua_setmetatable(L, -2); -- return 1; -- } -- static int inc(lua_State *L) { -- luaL_checktype(L, 1, LUA_TUSERDATA); -- int *c_ptr = luaL_checkudata(L, 1, "counter"); -- if (!c_ptr) luaL_typerror(L, 1, "counter"); -- (*c_ptr)++; -- return 0; -- } -- </pre></body></html>]]) -- webview:show(0.1) -- obj.makecodeview(obj.slideView, "LuaVsLuaSkinIIRight", "righthalf", [[luaL_Reg lib[] = {{"new", new}, {NULL, NULL}}; -- luaL_Reg obj[] = {{"inc", inc}, {NULL, NULL}}; -- void main() { -- LuaSkin *skin = [LuaSkin shared]; -- [skin registerLibrary:lib metaFunctions:nil]; -- [skin registerObject:"counter" objectFunctions:obj]; -- } -- static int new(lua_State *L) { -- LuaSkin *skin = [LuaSkin shared]; -- [skin checkArgs:LS_TINTEGER, LS_TBREAK]; -- Counter *c = [SomeCounterClass newClass]; -- c.value = lua_tointeger(L, 1); -- [skin pushNSObject:c]; -- return 1; -- } -- static int inc(lua_State *L) { -- LuaSkin *skin = [LuaSkin shared]; -- [skin checkArgs:LS_TUSERDATA, "counter", LS_TBREAK]; -- Counter *c = get_object(Counter, L, 1, "counter"); -- c.value++; -- return 0; -- } -- ]]) -- end, -- }, { ["header"] = "LuaSkin - Custom object translation", ["enterFn"] = function() obj.makeimageview(obj.slideView, "streamdeck", "body", "streamdeck.jpg") end, }, { ["header"] = "LuaSkin - Custom object translation", ["enterFn"] = function() obj.makecodeview(obj.slideView, "luaSkinPart2", "body", [[ static int pushHSStreamDeckDevice(lua_State *L, id obj) { HSStreamDeckDevice *value = obj; value.selfRefCount++; void** valuePtr = lua_newuserdata(L, sizeof(HSStreamDeckDevice *)); *valuePtr = (__bridge_retained void *)value; luaL_getmetatable(L, "hs.streamdeck"); lua_setmetatable(L, -2); return 1; } static id toHSStreamDeckDeviceFromLua(lua_State *L, int idx) { LuaSkin *skin = [LuaSkin shared]; HSStreamDeckDevice *value; if (luaL_testudata(L, idx, "hs.streamdeck")) { value = get_objectFromUserdata(__bridge HSStreamDeckDevice, L, idx, "hs.streamdeck"); } else { [skin logError:[NSString stringWithFormat:@"expected %s object, found %s", "hs.streamdeck", lua_typename(L, lua_type(L, idx))] ]; } return value; } ]]) end, }, { ["header"] = "LuaSkin - Custom object translation", ["enterFn"] = function() obj.makecodeview(obj.slideView, "luaSkinPart3", "body", [[ static int streamdeck_setButtonImage(lua_State *L __unused) { LuaSkin *skin = [LuaSkin shared]; [skin checkArgs:LS_TUSERDATA, "hs.streamdeck", LS_TNUMBER, LS_TUSERDATA, "hs.image", LS_TBREAK]; HSStreamDeckDevice *device = [skin luaObjectAtIndex:1 toClass:"HSStreamDeckDevice"]; [device setImage:[skin luaObjectAtIndex:3 toClass:"NSImage"] forButton:(int)lua_tointeger(skin.L, 2)]; lua_pushvalue(skin.L, 1); return 1; } ]]) end, }, { ["header"] = "Questions?", ["body"] = [[ Resources: • http://www.hammerspoon.org/ • https://github.com/Hammerspoon/ • #hammerspoon on Freenode ]], } } -- Draw a slide on the screen, creating persistent screen objects if necessary function obj:renderSlide(slideNum) print("renderSlide") if not slideNum then slideNum = self.currentSlide end print(" slide number: "..slideNum) local slideData = self.slides[slideNum] local frame = self.screenFrame self.slideHeaderFrame = {x=frame["x"] + 50, y=frame["y"] + 50, w=frame["w"] - 100, h=frame["h"] / 10} self.slideFooterFrame = {x=frame["x"] + 50, y=frame["y"] + frame["h"] - 50 - self.slideFooterSize, w=frame["w"] - 100, h=frame["h"] / 25} self.slideBodyFrame = self.get_body_frame(frame, (slideData["bodyWidth"] or 100)) if not self.slideView then self.slideView = hs.canvas.new(frame):level(hs.canvas.windowLevels["normal"] + 1) end if self.slideView:elementCount() == 0 then self.slideView:appendElements({ action="fill", type="rectangle", fillColor=hs.drawing.color.hammerspoon.osx_yellow, }, { action="fill", type="text", frame=self.slideFooterFrame, text=("Hammerspoon: Staggeringly powerful macOS desktop automation"), textColor=hs.drawing.color.x11.black, textSize=self.slideFooterSize }) self.slideView:show(1.2) self.numDefaultElements = self.slideView:elementCount() end if self.slideView:elementCount() > self.numDefaultElements then print("Removing "..(self.slideView:elementCount() - self.numDefaultElements).." elements") for i=self.numDefaultElements+1,self.slideView:elementCount() do self.slideView:removeElement(self.numDefaultElements + 1) end end -- Render the header self.slideView:appendElements({ action="fill", type="text", frame=self.slideHeaderFrame, text=(slideData["header"] or "Hammerspoon"), textColor = hs.drawing.color.x11.black, textSize=self.slideHeaderSize }) -- Render the body --[[ self.slideView:appendElements({ action="fill", type="rectangle", frame=self.slideBodyFrame, fillColor=hs.drawing.color.x11.white}) ]] self.slideView:appendElements({ action="fill", type="text", frame=self.slideBodyFrame, text=(slideData["body"] or ""), textColor = hs.drawing.color.x11.black, textSize=self.slideBodySize }) end -- Move one slide forward function obj:nextSlide() hs.mouse.setAbsolutePosition(hs.geometry.point(obj.screenFrame.x + obj.screenFrame.w, obj.screenFrame.y + obj.screenFrame.h/2)) if self.currentSlide < #self.slides then if self.slides[self.currentSlide] and self.slides[self.currentSlide]["exitFn"] then print("running exitFn for slide") self.slides[self.currentSlide]["exitFn"]() end self.currentSlide = self.currentSlide + 1 self:renderSlide() if self.slides[self.currentSlide] and self.slides[self.currentSlide]["enterFn"] then print("running enterFn for slide") self.slides[self.currentSlide]["enterFn"]() end end end -- Move one slide back function obj:previousSlide() if self.currentSlide > 1 then if self.slides[self.currentSlide] and self.slides[self.currentSlide]["exitFn"] then print("running exitFn for slide") self.slides[self.currentSlide]["exitFn"]() end self.currentSlide = self.currentSlide - 1 self:renderSlide() if self.slides[self.currentSlide] and self.slides[self.currentSlide]["enterFn"] then print("running enterFn for slide") self.slides[self.currentSlide]["enterFn"]() end end end -- Update the current slide function obj:updateSlide() self:renderSlide() if self.slides[self.currentSlide] and self.slides[self.currentSlide]["enterFn"] then print("running enterFn for slide") self.slides[self.currentSlide]["enterFn"]() end end -- Change font sizes function obj:resizeFonts(delta) self.slideHeaderSize = self.slideHeaderSize + delta self.slideBodySize = self.slideBodySize + delta self.slideFooterSize = self.slideFooterSize + delta end -- Increase font size function obj:fontBigger() self:resizeFonts(1) self:updateSlide() end -- Decrease font size function obj:fontSmaller() self:resizeFonts(-1) self:updateSlide() end -- Exit the presentation function obj:endPresentation() hs.caffeinate.set("displayIdle", false, true) if self.slides[self.currentSlide] and self.slides[self.currentSlide]["exitFn"] then print("running exitFn for slide") self.slides[self.currentSlide]["exitFn"]() end obj.slideView:delete(1.2) obj.slideView = nil obj.refs = {} if obj.slideModal.delete then obj.slideModal:delete() -- FIXME: This isn't in the current release of Hammerspoon end obj.slideModal = nil obj.currentSlide = 0 end -- Prepare the modal hotkeys for the presentation function obj.setupModal() print("setupModal") obj.slideModal = hs.hotkey.modal.new({}, nil, nil) obj.slideModal:bind({}, "left", function() obj:previousSlide() end) obj.slideModal:bind({}, "right", function() obj:nextSlide() end) obj.slideModal:bind({}, "escape", function() obj:endPresentation() end) obj.slideModal:bind({}, "=", function() obj:fontBigger() end) obj.slideModal:bind({}, "-", function() obj:fontSmaller() end) obj.slideModal:bind({}, "0", function() obj:setDefaultFontSizes() obj:updateSlide() end) obj.slideModal:enter() end -- Callback for when we've chosen a screen to present on function obj.didChooseScreen(choice) if not choice then print("Chooser cancelled") return end print("didChooseScreen: "..choice["text"]) obj.presentationScreen = hs.screen.find(choice["uuid"]) if not obj.presentationScreen then hs.notify.show("Unable to find that screen, using primary screen") obj.presentationScreen = hs.screen.primaryScreen() else print("Found screen") end obj.screenFrame = obj.presentationScreen:fullFrame() -- DEBUG OVERRIDE TO 1080p obj.screenFrame = hs.geometry.rect(0, 0, 1920, 1080) obj.setupModal() obj.setDefaultFontSizes() obj:nextSlide() end -- Prepare a table of screens for hs.chooser function obj.screensToChoices() print("screensToChoices") local choices = hs.fnutils.map(hs.screen.allScreens(), function(screen) local name = screen:name() local id = screen:id() local image = screen:snapshot() local mode = screen:currentMode()["desc"] return { ["text"] = name, ["subText"] = mode, ["uuid"] = id, ["image"] = image, } end) return choices end -- Initiate the hs.chosoer for choosing a screen to present on function obj.chooseScreen() print("chooseScreen") local chooser = hs.chooser.new(obj.didChooseScreen) chooser:choices(obj.screensToChoices) chooser:show() end -- Prepare the presentation function obj.setupPresentation() print("setupPresentation") if #obj.slides == 0 then hs.alert("No slides defined") return end hs.caffeinate.set("displayIdle", true, true) obj.chooseScreen() end return obj
-------- LIBRARY ------------------------------------------------------------------------------------ local cairo = require("lgi").cairo local module = {} function module:custom_shape(cr, width, height) cr:move_to(0,0) cr:line_to(width,0) cr:line_to(width,height - height/4) cr:line_to(width - height/4,height) cr:line_to(0,height) cr:close_path() end return module
kill_spikes = { wood_durability_index = 0.7, iron_durability_index = 0.95, dia_durability_index = 256 } -- add damage to any object. kill_spikes.do_damage = function(obj, durability_index) if obj == nil then return end if obj:is_player() or (obj:get_luaentity() ~= nil and obj:get_luaentity().name ~= "__builtin:item") then obj:punch(obj, 1.0, {full_punch_interval = 1.0, damage_groups = {fleshy=5}}, nil) if durability_index ~= nil and kill_spikes.is_broken(durability_index) then return 1 end end return 0 end -- check nodes below/above to forbid construct spikes in two vertical rows. kill_spikes.is_allowed_position = function(pos) local node = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) if minetest.get_node_group(node.name, "spikes") > 0 then return false end node = minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}) if minetest.get_node_group(node.name, "spikes") > 0 then return false end return true end --ramdomly decide if spike is broken. kill_spikes.is_broken = function(durability_index) if (durability_index < math.random()) then return true end return false end minetest.register_node("kill_spikes:wood_spikes", { description = "Wood spikes", drawtype = "plantlike", visual_scale = 1, tile_images = {"kill_spikes_wood_spikes.png"}, inventory_image = ("kill_spikes_wood_spikes.png"), paramtype = "light", walkable = false, drop = "default:stick 3", sunlight_propagates = true, groups = {spikes=1, flammable=2, choppy = 2, oddly_breakable_by_hand = 1}, on_punch = function(pos, node, puncher, tool_capabilities, pointed_thing) kill_spikes.do_damage(puncher, nil) end, on_construct = function(pos) if kill_spikes.is_allowed_position(pos) == false then minetest.dig_node(pos) end end, }) minetest.register_node("kill_spikes:broken_wood_spikes", { description = "Broken wood spikes", drawtype = "plantlike", visual_scale = 1, tile_images = {"kill_spikes_broken_wood_spikes.png"}, inventory_image = ("kill_spikes_broken_wood_spikes.png"), paramtype = "light", walkable = false, sunlight_propagates = true, drop = "default:stick 3", groups = {spikes=1, flammable=2, choppy = 2, oddly_breakable_by_hand = 1}, }) minetest.register_craft({ output = 'kill_spikes:wood_spikes 4', recipe = { {'default:stick', '', 'default:stick'}, {'', 'default:stick', ''}, {'default:stick', '', 'default:stick'}, }, on_place = function(itemstack, placer, pointed_thing, param2) if (kill_spikes.is_spikes_below(pointed_thing)) then return end end, }) minetest.register_node("kill_spikes:iron_spikes", { description = "Iron spikes", drawtype = "plantlike", visual_scale = 1, tile_images = {"kill_spikes_iron_spikes.png"}, inventory_image = ("kill_spikes_iron_spikes.png"), paramtype = "light", walkable = false, sunlight_propagates = true, drop = "default:steel_ingot 2", groups = {cracky=2, spikes=1}, on_punch = function(pos, node, puncher, tool_capabilities, pointed_thing) kill_spikes.do_damage(puncher, nil) end, on_construct = function(pos) if kill_spikes.is_allowed_position(pos) == false then minetest.dig_node(pos) end end, }) minetest.register_node("kill_spikes:broken_iron_spikes", { description = "Broken iron spikes", drawtype = "plantlike", visual_scale = 1, tile_images = {"kill_spikes_broken_iron_spikes.png"}, inventory_image = ("kill_spikes_broken_iron_spikes.png"), paramtype = "light", walkable = false, sunlight_propagates = true, drop = "default:steel_ingot 2", groups = {cracky=2, spikes=1}, }) minetest.register_craft({ output = 'kill_spikes:iron_spikes 4', recipe = { {'default:steel_ingot', '', 'default:steel_ingot'}, {'', 'kill_spikes:wood_spikes', ''}, {'default:steel_ingot', '', 'default:steel_ingot'}, }, on_place = function(itemstack, placer, pointed_thing, param2) if (kill_spikes.is_spikes_below(pointed_thing)) then return end end, }) minetest.register_abm( {nodenames = {"kill_spikes:wood_spikes"}, interval = 1.0, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local times_broken = 0 local objs = minetest.get_objects_inside_radius(pos, 1) for k, obj in pairs(objs) do times_broken = times_broken + kill_spikes.do_damage(obj, kill_spikes.wood_durability_index) end if times_broken > 0 then minetest.remove_node(pos) minetest.place_node(pos, {name="kill_spikes:broken_wood_spikes"}) end end, }) minetest.register_abm( {nodenames = {"kill_spikes:iron_spikes"}, interval = 1.0, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local times_broken = 0 local objs = minetest.get_objects_inside_radius(pos, 1) for k, obj in pairs(objs) do times_broken = times_broken + kill_spikes.do_damage(obj, kill_spikes.iron_durability_index) end if times_broken > 0 then minetest.remove_node(pos) minetest.place_node(pos, {name="kill_spikes:broken_iron_spikes"}) end end, }) --Diamond spikes minetest.register_node("kill_spikes:dia_spikes", { description = "Diamond spikes", drawtype = "plantlike", visual_scale = 1, tile_images = {"kill_spikes_dia_spikes.png"}, inventory_image = ("kill_spikes_dia_spikes.png"), paramtype = "light", walkable = false, sunlight_propagates = true, drop = "default:diamond 2", groups = {cracky=2, spikes=1}, on_punch = function(pos, node, puncher, pointed_thing) kill_spikes.do_damage(puncher, nil) end, on_construct = function(pos) if kill_spikes.is_allowed_position(pos) == false then minetest.dig_node(pos) end end, }) minetest.register_node("kill_spikes:broken_dia_spikes", { description = "Broken diamond spikes", drawtype = "plantlike", visual_scale = 1, tile_images = {"kill_spikes_broken_dia_spikes.png"}, inventory_image = ("kill_spikes_broken_dia_spikes.png"), paramtype = "light", walkable = false, sunlight_propagates = true, drop = "default:diamond 2", groups = {cracky=2, spikes=1}, }) minetest.register_craft({ output = 'kill_spikes:dia_spikes 4', recipe = { {'default:diamond', '', 'default:diamond'}, {'', 'kill_spikes:iron_spikes', ''}, {'default:diamond', '', 'default:diamond'}, }, on_place = function(itemstack, placer, pointed_thing, param2) if (kill_spikes.is_spikes_below(pointed_thing)) then return end end, }) minetest.register_abm( {nodenames = {"kill_spikes:dia_spikes"}, interval = 1.0, chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local times_broken = 0 local objs = minetest.get_objects_inside_radius(pos, 1) for k, obj in pairs(objs) do times_broken = times_broken + kill_spikes.do_damage(obj, kill_spikes.dia_durability_index) end if times_broken > 0 then minetest.remove_node(pos) minetest.place_node(pos, {name="kill_spikes:broken_dia_spikes"}) end end, })
local tcheck = require 'tcheck' local token = require 'tulip.pkg.token.token' local xerror = require 'tulip.xerror' local xtable = require 'tulip.xtable' local function make_token(cfg) local lookup_types if cfg.allowed_types then lookup_types = xtable.toset(cfg.allowed_types) end return function(app, t, conn, tok) tcheck({'*', 'table', 'table|nil', 'string|nil'}, app, t, conn, tok) if lookup_types then local ok, err = xerror.inval(lookup_types[t.type], 'token type is invalid', 'type', t.type) if not ok then return nil, err end end local close = not conn if not conn then local err; conn, err = app:db() if not conn then return nil, err end end return conn:with(close, function() if tok or t.delete then -- validate or delete the token return token.validate(t, conn, tok) else -- generate a token return token.generate(t, conn) end end) end end local M = { requires = { 'tulip.pkg.database', }, } -- The token package registers an App:token method that either -- generates a one-time secret token, validates such a token, -- or deletes token(s). -- -- Requires: database package -- -- Config: -- -- * allowed_types: array of string = if set, only those types -- will be allowed for the tokens. -- -- v, err = App:token(t[, conn[, tok]]) -- -- Generates a one-time secret token, validates such a token, -- or deletes token(s). -- -- If the generated token has 'once' set, then when it is validated, -- its type and ref_id must match, and it must not be expired. -- If it does not have 'once' set, then when validated only its -- type must match, and it must not be expired. The ref_id value -- is returned as second value when the token is valid (if the first -- returned value is true). This is because the not-once tokens -- are typically used to associate a token with an id (e.g. session -- tokens), while once tokens are used for extra validation so the -- ref_id must be provided and must be associated with that token -- (e.g. reset password, change email address tokens, where the -- relevant user ID is known). -- -- > t: table = a table with the following fields: -- * t.type: string = the type of the token (e.g. resetpwd) -- * t.ref_id: number = the reference id of the token (e.g. user id) -- * t.max_age: number = number of seconds before token expires -- * t.once: boolean|nil = if true, generate a single-use token -- that is deleted when validated. Otherwise the token stays -- alive until expired (e.g. a session id token). -- * t.delete: boolean|nil = if true, deletes the token upon validation, -- even if it is not a single-use token (e.g. for logout behaviour). -- If no tok value is provided and delete is true, deletes all tokens -- associated with type and ref_id (without validation). -- > conn: connection = optional database connection to use -- > tok: string = if provided, validates that token, otherwise -- generate a new token. -- < v: bool|string|nil = if tok is provided, returns a boolean -- that indicates if the token is valid, otherwise returns a -- string that is the base64-encoded generated token. Is -- nil on error or invalid token. If it returns true, returns the -- associated ref_id as second value. -- < err: string|nil = error message if v is nil. function M.register(cfg, app) tcheck({'table', 'tulip.App'}, cfg, app) app.token = make_token(cfg) app:register_migrations('tulip.pkg.token', token.migrations) end return M
local tools = require('Utils.ToolSet') GGraph = class('GGraph', GObject) local getters = GGraph.getters local setters = GGraph.setters function GGraph:ctor() GGraph.super.ctor(self) self._type = 0 end function getters:color() return self._fillColor or 0 end function setters:color(value) if self.displayObject then self._fillColor = value self.displayObject:setFillColor(tools.unpackColor(value)) end end function GGraph:drawRect(lineSize, lineColor, lineAlpha, fillColor, fillAlpha) local w,h,offset = self:getDrawInfo(lineSize) local obj = display.newRect(0,0,w,h) obj:setFillColor(tools.unpackColor(fillColor, fillAlpha)) obj.strokeWidth = lineSize or 0 obj:setStrokeColor(tools.unpackColor(lineColor, lineAlpha)) obj.path.x1 = offset obj.path.x2 = offset obj.path.x3 = offset obj.path.x4 = offset obj.path.y1 = offset obj.path.y2 = offset obj.path.y3 = offset obj.path.y4 = offset self:updateGraphObj(1, obj, fillColor) end function GGraph:drawRoundRect(lineSize, lineColor, lineAlpha, fillColor, fillAlpha, cornerRadius ) local w,h,offset = self:getDrawInfo(lineSize) local obj = display.newRoundedRect(0,0,w,h,cornerRadius ) obj:setFillColor(tools.unpackColor(fillColor, fillAlpha)) obj.strokeWidth = lineSize or 0 obj:setStrokeColor(tools.unpackColor(lineColor, lineAlpha)) self:updateGraphObj(2, obj, fillColor) end function GGraph:drawCircle(lineSize, lineColor, lineAlpha, fillColor, fillAlpha) local w,h,offset = self:getDrawInfo(lineSize) local obj = display.newCircle(w*0.5,h*0.5,w*0.5) obj:setFillColor(tools.unpackColor(fillColor, fillAlpha)) obj.strokeWidth = lineSize or 0 obj:setStrokeColor(tools.unpackColor(lineColor, lineAlpha)) self:updateGraphObj(3, obj, fillColor) end function GGraph:drawPolygon(vertices, fillColor, fillAlpha) local obj = display.newPolygon(0,0,vertices) obj:setFillColor(tools.unpackColor(fillColor, fillAlpha)) obj.strokeWidth = lineSize or 0 obj:setStrokeColor(tools.unpackColor(lineColor, lineAlpha)) self:updateGraphObj(4, obj, fillColor) end function GGraph:clear() self._type = 0 self:replaceDisplayObject(nil) end function getters:isEmpty() return self._type==0 end function GGraph:updateGraphObj(type, obj, fillColor) self._type = type self._sourceWidth = self._width self._sourceHeight = self._height self._fillColor = fillColor self:replaceDisplayObject(obj) obj:addEventListener("touch", self) end function GGraph:getDrawInfo(lineSize) local w = self._width local h = self._height local offset = 0 --调整至描边为内包围 if lineSize>0 then offset = math.ceil(lineSize*0.5) w = w-offset*2 h = h-offset*2 end if w<0 then w=0 end if h<0 then h=0 end return w,h,offset end function GGraph:setup_BeforeAdd(buffer, beginPos) GGraph.super.setup_BeforeAdd(self, buffer, beginPos) buffer:seek(beginPos, 5) local type = buffer:readByte() if type ~= 0 then local lineSize = buffer:readInt() local lineColor,lineAlpha = buffer:readColor() local fillColor,fillAlpha = buffer:readColor() local roundedRect = buffer:readBool() local cornerRadius if roundedRect then cornerRadius = {} for i=1,4 do cornerRadius[i] = buffer:readFloat() end end if type == 1 then if roundedRect then self:drawRoundRect(lineSize, lineColor, lineAlpha, fillColor, fillAlpha, cornerRadius[1]) else self:drawRect(lineSize, lineColor, lineAlpha, fillColor, fillAlpha) end else self:drawCircle(lineSize, lineColor, lineAlpha, fillColor, fillAlpha) end end end function GGraph:handlePivotChanged() local obj = self.displayObject if obj then obj.anchorX = self._pivotX * (self._width / self._sourceWidth) obj.anchorY = self._pivotY * (self._height / self._sourceHeight) self:handlePositionChanged() end end function GGraph:handleSizeChanged() if self._type==0 then return end local obj = self.displayObject local w,h,offset = self:getDrawInfo(obj.strokeWidth) if self._type==1 then local dw = w - self._sourceWidth local dh = h - self._sourceHeight obj.path.x1 = offset obj.path.x2 = offset obj.path.x3 = offset+dw obj.path.x4 = offset+dw obj.path.y1 = offset obj.path.y2 = offset+dh obj.path.y3 = offset+dh obj.path.y4 = offset elseif self._type==2 then obj.path.width = w obj.path.height = h elseif self._type==3 then obj.path.radius = w*0.5 end obj.anchorX = self._pivotX * (self._width / self._sourceWidth) obj.anchorY = self._pivotY * (self._height / self._sourceHeight) end
-- Copyright 2014 Aedan Renner <[email protected]> -- Copyright 2018 Florian Eckert <[email protected]> -- Licensed to the public under the GNU General Public License v2. local dsp = require "luci.dispatcher" local m, s, o m = Map("mwan3", translate("MWAN - Members")) s = m:section(TypedSection, "member", nil, translate("Members are profiles attaching a metric and weight to an MWAN interface<br />" .. "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" .. "Members may not share the same name as configured interfaces, policies or rules")) s.addremove = true s.dynamic = false s.sectionhead = translate("Member") s.sortable = true s.template = "cbi/tblsection" s.extedit = dsp.build_url("admin", "network", "mwan", "member", "%s") function s.create(self, section) TypedSection.create(self, section) m.uci:save("mwan3") luci.http.redirect(dsp.build_url("admin", "network", "mwan", "member", section)) end o = s:option(DummyValue, "interface", translate("Interface")) o.rawhtml = true function o.cfgvalue(self, s) return self.map:get(s, "interface") or "&#8212;" end o = s:option(DummyValue, "metric", translate("Metric")) o.rawhtml = true function o.cfgvalue(self, s) return self.map:get(s, "metric") or "1" end o = s:option(DummyValue, "weight", translate("Weight")) o.rawhtml = true function o.cfgvalue(self, s) return self.map:get(s, "weight") or "1" end return m
fx_version "adamant" game "gta5" client_scripts {"utk.lua", "client.lua"} server_scripts {"utk.lua", "server.lua"}
require "/scripts/util.lua" function tileAnchors(grid, pos) pos = copy(pos) pos[1] = pos[1] < 0 and pos[1] + grid.size[1] or pos[1] pos[1] = pos[1] >= grid.size[1] and pos[1] - grid.size[1] or pos[1] return grid.tiles[tostring(pos[1])][tostring(pos[2])] end function claimTile(grid, pos, anchors) pos = copy(pos) pos[1] = pos[1] < 0 and pos[1] + grid.size[1] or pos[1] pos[1] = pos[1] >= grid.size[1] and pos[1] - grid.size[1] or pos[1] if not grid.tiles[tostring(pos[1])] then grid.tiles[tostring(pos[1])] = jobject() end grid.tiles[tostring(pos[1])][tostring(pos[2])] = anchors end function tileAvailable(grid, pos) pos = copy(pos) pos[1] = pos[1] < 0 and pos[1] + grid.size[1] or pos[1] pos[1] = pos[1] >= grid.size[1] and pos[1] - grid.size[1] or pos[1] if not grid.tiles[tostring(pos[1])] then return true end if not grid.tiles[tostring(pos[1])][tostring(pos[2])] then return true end return false end function partSize(part) local max = {0, 0} for _,tile in pairs(part.tiles) do if tile[1] + 1 > max[1] then max[1] = tile[1] + 1 end if tile[2] + 1 > max[2] then max[2] = tile[2] + 1 end end return max end function partTiles(part, pos) local tiles = {} for _,tile in pairs(part.tiles) do table.insert(tiles, vec2.add(pos, tile)) end return tiles end function partTileAnchors(part, tile) return util.map(util.filter(part.anchors, function(a) return compare(a[2], tile) end), function(a) return a[1] end) end -- returns the part offset if anchored to the specified direction function anchoredPartOffset(part, direction) local partAnchor = vec2.mul(direction, -1) for _,v in pairs(part.anchors) do local dir, offset = v[1], v[2] if compare(dir, partAnchor) then return vec2.mul(offset, -1) end end end -- A part can be placed if it doesn't overlap other parts -- and all its anchors anchor to empty spaces or other anchors function partAllowedAt(grid, part, tilePos) for _,tile in pairs(part.tiles) do if tile[2] + tilePos[2] < 0 or tile[2] + tilePos[2] > grid.size[2] then return false, {"range", vec2.add(tile, tilePos)} end if not tileAvailable(grid, vec2.add(tile, tilePos)) then return false, {"overlap", vec2.add(tile, tilePos)} end -- check all anchors lead to empty space or other parts' anchors local matchingAnchors = {} for _,anchor in pairs(partTileAnchors(part, tile)) do local anchorTo = vec2.add(vec2.add(tile, tilePos), anchor) if not tileAvailable(grid, anchorTo) then local hasMatchingAnchor = false for _,otherAnchor in pairs(tileAnchors(grid, anchorTo)) do if compare(anchor, vec2.mul(otherAnchor, -1)) then hasMatchingAnchor = true table.insert(matchingAnchors, anchorTo) end end if not hasMatchingAnchor then return false, {"invalid", vec2.add(tile, tilePos), anchor} end end end -- check the part doesn't block anchors of other parts for _,dir in pairs({{1, 0}, {0, 1}, {-1, 0}, {0, -1}}) do local neighbor = vec2.add(vec2.add(tile, tilePos), dir) if not tileAvailable(grid, neighbor) and not contains(matchingAnchors, neighbor) then for _,anchor in pairs(tileAnchors(grid, neighbor)) do if compare(anchor, vec2.mul(dir, -1)) then return false, {"blocking", neighbor, anchor} end end end end end return true end function allowedParts(parts, grid, tilePos) local parts = {} for partName,part in (self.partConfig.parts) do if part.placeable and partAllowedAt(grid, tilePos) then table.insert(parts, partName) end end return parts end function tileWorldPos(grid, tilePos) local worldPos = vec2.add(grid.worldOffset, vec2.mul(tilePos, grid.tileSize)) return vec2.add(worldPos, vec2.mul(grid.tileBorder, tilePos)) end -- nil means the position is at a seam between two tiles function worldToTile(grid, worldPos) local relativePos = world.distance(worldPos, grid.worldOffset) -- no negative tile coordinates, they don't serialize well if relativePos[1] < 0 then relativePos[1] = relativePos[1] + world.size()[1] end if relativePos[1] % (grid.tileSize[1] + grid.tileBorder[1]) >= grid.tileSize[1] or relativePos[2] % (grid.tileSize[2] + grid.tileBorder[2]) >= grid.tileSize[2] then return nil end return { math.floor(relativePos[1] / (grid.tileSize[1] + grid.tileBorder[1])), math.floor(relativePos[2] / (grid.tileSize[2] + grid.tileBorder[2])) } end
temp = {} cifre = {}; out = {}; order = {} max = 8 for i = 1,10 do temp[i] = i - 1 end out = lib.math.random_shuffle(temp) for i = 1,max do cifre[i] = out[i] end order = lib.math.argsort(cifre) numb = cifre[order[max]] for i = 1,2 do numb = numb * 10 + cifre[order[max-i]] end value_max = numb * 10 + cifre[order[max - 3]] value_max1 = numb * 10 + cifre[order[max - 4]] if (cifre[order[1]] == 0) then numb = (cifre[order[2]] * 10 + cifre[order[1]]) * 10 + cifre[order[3]] else numb = (cifre[order[1]] * 10 + cifre[order[2]]) * 10 + cifre[order[3]] end value_min = numb * 10 + cifre[order[4]] value_min1 = numb * 10 + cifre[order[5]] summ_max = value_max + value_max1 summ_min = value_min + value_min1 diff_max = value_max - value_min
Common_UnitConsumeActPoint(attacker, 1); if Common_Break_Skill(attacker, _Skill) then return end local info = ... -- [[ if attacker[30081] > 0 then if not info.SingSkill then Common_ChangeEp(attacker, -_Skill.skill_consume_ep) Common_UnitConsumeActPoint(attacker, 1); Common_Sleep(attacker, 0.3) Common_UnitAddBuff(attacker, attacker, attacker[30081], 1, { singskill_index = _Skill.sort_index }) Common_Sleep(attacker, 0.4) return end end --]] if not info.SingSkill then Common_ChangeEp(attacker, -_Skill.skill_consume_ep) end local target, all_targets = Common_GetTargets(...) Common_ShowCfgFlagEffect(_Skill) Common_UnitPlayAttack(attacker, _Skill.id); Common_ShowCfgStageEffect(_Skill) OtherEffectInCfg(attacker, target, _Skill) --[[子弹类型定义!! 1 普攻 2 单体攻击 3 群体攻击 4 召唤物攻击 5 dot伤害 6 反弹伤害 7 反击伤害 8 其他伤害来源,溅射,穿刺,链接 9 链接伤害 20 技能治疗 21 持续治疗 22 宠物治疗 23 其他治疗 30 其他效果--- ]] --[FindAllEnemy() FindAllPartner()] Common_FireBullet(0, attacker, target, _Skill, { -- Duration = 0.1, --子弹速度 -- Hurt = 10000, --伤害 -- Type = 1, --子弹类型 -- Attacks_Total = 3, --次数 -- Element = 6, --元素类型 -- parameter = { -- damagePromote = 10000, -- damageReduce = 10000, -- critPer = 10000, -- critValue = 10000, -- ignoreArmor = 10000, -- ignoreArmorPer = 10000, -- shieldHurt = 10000, -- shieldHurtPer = 10000, -- healPromote = 10000, -- healReduce = 10000, -- damageAdd = 10000, -- suck = 10000, -- } }) AddConfigBuff(attacker, target, _Skill) Common_Sleep(attacker, 0.3)
-- -- Please see the license.html file included with this distribution for -- attribution and copyright information. -- function onDeliverMessage(messagedata, mode) if super and super.onDeliverMessage then local messagedata = super.onDeliverMessage(messagedata, mode); if messagedata then ChatManagerCL.resolveFont(messagedata); end return messagedata; end end
if 1 ~= vim.fn.has "nvim-0.7.0" then vim.api.nvim_err_writeln "Telescope.nvim requires at least nvim-0.7.0. See `:h telescope.changelog-1851`" return end if vim.g.loaded_telescope == 1 then return end vim.g.loaded_telescope = 1 local highlights = { -- Sets the highlight for selected items within the picker. TelescopeSelection = { default = true, link = "Visual" }, TelescopeSelectionCaret = { default = true, link = "TelescopeSelection" }, TelescopeMultiSelection = { default = true, link = "Type" }, TelescopeMultiIcon = { default = true, link = "Identifier" }, -- "Normal" in the floating windows created by telescope. TelescopeNormal = { default = true, link = "Normal" }, TelescopePreviewNormal = { default = true, link = "TelescopeNormal" }, TelescopePromptNormal = { default = true, link = "TelescopeNormal" }, TelescopeResultsNormal = { default = true, link = "TelescopeNormal" }, -- Border highlight groups. -- Use TelescopeBorder to override the default. -- Otherwise set them specifically TelescopeBorder = { default = true, link = "TelescopeNormal" }, TelescopePromptBorder = { default = true, link = "TelescopeBorder" }, TelescopeResultsBorder = { default = true, link = "TelescopeBorder" }, TelescopePreviewBorder = { default = true, link = "TelescopeBorder" }, -- Title highlight groups. -- Use TelescopeTitle to override the default. -- Otherwise set them specifically TelescopeTitle = { default = true, link = "TelescopeBorder" }, TelescopePromptTitle = { default = true, link = "TelescopeTitle" }, TelescopeResultsTitle = { default = true, link = "TelescopeTitle" }, TelescopePreviewTitle = { default = true, link = "TelescopeTitle" }, TelescopePromptCounter = { default = true, link = "NonText" }, -- Used for highlighting characters that you match. TelescopeMatching = { default = true, link = "Special" }, -- Used for the prompt prefix TelescopePromptPrefix = { default = true, link = "Identifier" }, -- Used for highlighting the matched line inside Previewer. Works only for (vim_buffer_ previewer) TelescopePreviewLine = { default = true, link = "Visual" }, TelescopePreviewMatch = { default = true, link = "Search" }, TelescopePreviewPipe = { default = true, link = "Constant" }, TelescopePreviewCharDev = { default = true, link = "Constant" }, TelescopePreviewDirectory = { default = true, link = "Directory" }, TelescopePreviewBlock = { default = true, link = "Constant" }, TelescopePreviewLink = { default = true, link = "Special" }, TelescopePreviewSocket = { default = true, link = "Statement" }, TelescopePreviewRead = { default = true, link = "Constant" }, TelescopePreviewWrite = { default = true, link = "Statement" }, TelescopePreviewExecute = { default = true, link = "String" }, TelescopePreviewHyphen = { default = true, link = "NonText" }, TelescopePreviewSticky = { default = true, link = "Keyword" }, TelescopePreviewSize = { default = true, link = "String" }, TelescopePreviewUser = { default = true, link = "Constant" }, TelescopePreviewGroup = { default = true, link = "Constant" }, TelescopePreviewDate = { default = true, link = "Directory" }, TelescopePreviewMessage = { default = true, link = "TelescopePreviewNormal" }, TelescopePreviewMessageFillchar = { default = true, link = "TelescopePreviewMessage" }, -- Used for Picker specific Results highlighting TelescopeResultsClass = { default = true, link = "Function" }, TelescopeResultsConstant = { default = true, link = "Constant" }, TelescopeResultsField = { default = true, link = "Function" }, TelescopeResultsFunction = { default = true, link = "Function" }, TelescopeResultsMethod = { default = true, link = "Method" }, TelescopeResultsOperator = { default = true, link = "Operator" }, TelescopeResultsStruct = { default = true, link = "Struct" }, TelescopeResultsVariable = { default = true, link = "SpecialChar" }, TelescopeResultsLineNr = { default = true, link = "LineNr" }, TelescopeResultsIdentifier = { default = true, link = "Identifier" }, TelescopeResultsNumber = { default = true, link = "Number" }, TelescopeResultsComment = { default = true, link = "Comment" }, TelescopeResultsSpecialComment = { default = true, link = "SpecialComment" }, TelescopeResultsFileIcon = { default = true, link = "Normal" }, -- Used for git status Results highlighting TelescopeResultsDiffChange = { default = true, link = "DiffChange" }, TelescopeResultsDiffAdd = { default = true, link = "DiffAdd" }, TelescopeResultsDiffDelete = { default = true, link = "DiffDelete" }, TelescopeResultsDiffUntracked = { default = true, link = "NonText" }, } for k, v in pairs(highlights) do vim.api.nvim_set_hl(0, k, v) end -- This is like "<C-R>" in your terminal. -- To use it, do `cmap <C-R> <Plug>(TelescopeFuzzyCommandSearch) vim.keymap.set( "c", "<Plug>(TelescopeFuzzyCommandSearch)", "<C-\\>e \"lua require('telescope.builtin').command_history " .. '{ default_text = [=[" . escape(getcmdline(), \'"\') . "]=] }"<CR><CR>', { silent = true, noremap = true } ) vim.api.nvim_create_user_command("Telescope", function(opts) require("telescope.command").load_command(unpack(opts.fargs)) end, { nargs = "*", complete = function(_, line) local builtin_list = vim.tbl_keys(require "telescope.builtin") local extensions_list = vim.tbl_keys(require("telescope._extensions").manager) local l = vim.split(line, "%s+") local n = #l - 2 if n == 0 then return vim.tbl_filter(function(val) return vim.startswith(val, l[2]) end, vim.tbl_extend("force", builtin_list, extensions_list)) end if n == 1 then local is_extension = vim.tbl_filter(function(val) return val == l[2] end, extensions_list) if #is_extension > 0 then local extensions_subcommand_dict = require("telescope.command").get_extensions_subcommand() return vim.tbl_filter(function(val) return vim.startswith(val, l[3]) end, extensions_subcommand_dict[l[2]]) end end local options_list = vim.tbl_keys(require("telescope.config").values) return vim.tbl_filter(function(val) return vim.startswith(val, l[#l]) end, options_list) end, })
globals("grammar") local lpeg = require "lpeg" local P = lpeg.P local V = lpeg.V local C = lpeg.C local R = lpeg.R local S = lpeg.S local Ct = lpeg.Ct local Cc = lpeg.Cc local ESCAPES = { ["\\"] = "\\", a="\x07", n="\n", t="\t", r="\r", } grammar = P{ "loc"; loc = V"label" * (V"instruction" + V"eol"); label = (-1 * Cc"") + (C(V"identifier") * (P":")^-1 + Cc"") * (V"whitespace"^1+V"eol"); eol = V"whitespace"^0 * (P";" + -1); identifier = (R("az","AZ")+S"_") * (R("az","AZ","09")+S"_")^0 + P"-"^1 + P"+"^1; instruction = (Cc"instruction"*(C(V"identifier")/string.upper)*((P"."*C(V"identifier")/string.upper)+C"")*(P"?"*Cc(true)+Cc(false))+(Cc"directive"*P"."*(C(V"identifier")/string.upper)*Cc""*Cc(false))) * Ct(V"whitespace"^1 * V"nonterminal_parameter"^0 * V"parameter" + V"eol"); nonterminal_parameter = V"parameter" * V"whitespace"^0 * P"," * V"whitespace"^0; parameter = V"param_string" + V"param_id" + V"param_literal"; param_string = V"squot_string" + V"dquot_string"; squot_string = Ct(Cc"string"*P"'"*C((P(1)-P"'")^0)*"'"); dquot_string = Ct(Cc"string"*P'"'*(Ct((V"dquot_string_char"-P'"')^0)/table.concat)*P'"'); dquot_string_char = V"dquot_escaped_char" + C(1); dquot_escaped_char = P"\\" * (C(S"\\antr") / ESCAPES); param_id = Ct(Cc"identifier"*C(V"identifier")); param_literal = Ct(Cc"integer"*(V"num_hex" + V"num_bin" + V"num_dec")); num_hex = P"0x" * C(R("09","AF","af")^1)/function(x) return tonumber(x,16) end; num_bin = P"%" * C(S"01"^1)/function(x) return tonumber(x,2) end; num_dec = C(P"-"^-1*R("09")^1)/function(x) return tonumber(x,10) end; whitespace = S" \r\t"; }
function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerskin = getPedSkin ( source ) setAccountData ( playeraccount, "skin", playerskin ) end end function onPlayerJoin ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerskin = getAccountData ( playeraccount, "skin" ) if ( playerskin ) then setPedSkin ( source, playerskin ) end end end function onPlayerSpawn ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerskin = getAccountData ( playeraccount, "skin" ) if ( playerskin ) then setPedSkin ( source, playerskin ) end end end function onPlayerWasted ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerskin = getPedSkin ( source ) setAccountData ( playeraccount, "skin", playerskin ) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin ) addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn ) addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted )
termID = nil local function startTurtle(width, length, startx, starty) while turtle.detect() do end --if the turtle needs fuel, get it if turtle.getFuelLevel() < 100 and turtle.getItemCount(2) > 0 then turtle.select(2) turtle.placeUp() turtle.suckUp() turtle.refuel() turtle.digUp() turtle.select(1) end turtle.forward() paramsFile = io.open(disk.getMountPath("bottom") .. "/params", "w") if termID == nil then paramsFile:write("-1\n") else paramsFile:write(termID .. "\n") end paramsFile:write(width .. "\n" .. length .. "\n" .. startx .. "\n" .. starty) paramsFile:close() turtle.back() turtle.select(1) if turtle.getItemCount(1) == 0 then turtle.turnRight() turtle.turnRight() turtle.suck() turtle.turnLeft() turtle.turnLeft() if turtle.getItemCount(1) == 0 then if termID ~= nil then rednet.send(termID, "ERRNOTUR") else print("ERROR: not enough turtles") end return false end end turtle.place() peripheral.call("front", "turnOn") return true end local function distributeTurtles(numTurtles, width, length, startx, starty) if numTurtles == 1 then return startTurtle(width, length, startx, starty) else if width < length then firstGood = distributeTurtles(math.floor(numTurtles/2), width, math.floor(length/2), startx, starty) secondGood = distributeTurtles(math.ceil(numTurtles/2), width, math.ceil(length/2), startx, starty + math.floor(length/2)) return firstGood or secondGood else firstGood = distributeTurtles(math.floor(numTurtles/2), math.floor(width/2), length, startx, starty) secondGood = distributeTurtles(math.ceil(numTurtles/2), math.ceil(width/2), length, startx + math.floor(width/2), starty) return firstGood or secondGood end end end local argv = { ... } if #argv > 3 or #argv == 2 then print("Usage: startMaster [num_turtles [quarry_width quarry_length]]") return end numTurtles = 2 width = 16 length = 16 if #argv == 0 then rednet.open("right") termID,message = rednet.receive() while message ~= "QUARRYINIT" do termID,message = rednet.receive() end rednet.send(termID, "QUARRYREPLY") id, numTurtles = rednet.receive() id, width = rednet.receive() id, length = rednet.receive() elseif #argv == 1 then numTurtles = argv[1] else numTurtles = argv[1] width = argv[2] length = argv[3] end turtlesOut = distributeTurtles(tonumber(numTurtles), tonumber(width), tonumber(length), math.ceil(-1/2*tonumber(width)), 0) if not turtlesOut then return end if turtle.getItemCount(1) > 0 then turtle.turnRight() turtle.turnRight() turtle.drop() turtle.turnLeft() turtle.turnLeft() end --wait for last turtle while turtle.detect() do end for i=1,tonumber(numTurtles),1 do while not turtle.detect() do end turtle.dig() turtle.turnRight() turtle.turnRight() turtle.drop() turtle.turnLeft() turtle.turnLeft() end if termID ~= nil then --run through terminal rednet.send(termID, "QUARRYDONE") rednet.close("right") end
require('settings.options')
-- ========== THIS IS AN AUTOMATICALLY GENERATED FILE! ========== PlaceObj('PopupNotificationPreset', { group = "Default", id = "AllMilestonesCompleted", text = T(676455960275, --[[PopupNotificationPreset AllMilestonesCompleted text]] "Through the devotion and self-sacrifice of our Colonists and your vision and leadership, Commander, the dream has come true. \nThanks to you, humanity has a new future, a new path to follow."), title = T(569680890599, --[[PopupNotificationPreset AllMilestonesCompleted title]] "A dream fulfilled"), voiced_text = T(554780175922, --[[voice:narrator]] "In the beginning, it was just a dream - setting foot on another planet, surviving it, building a new future for humanity."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000100, choice1 = T(5685, --[[PopupNotificationPreset AnomalyAnalyzed choice1]] "Open Research Screen"), choice2 = T(1011, --[[PopupNotificationPreset AnomalyAnalyzed choice2]] "Close"), group = "Default", id = "AnomalyAnalyzed", image = "UI/Messages/exploration.tga", text = T(5684, --[[PopupNotificationPreset AnomalyAnalyzed text]] "Even the tiniest, simple-looking rock can contain the answers to mysteries which perplexed the human mind for generations. Sometimes it takes just a simple discovery to assure us of the vastness of the Universe, an encouragement to make us look beyond the boundaries of our existence and into the future.\n\n<effect> The following Techs have been revealed on the Research screen:\n<list_text>"), title = T(5683, --[[PopupNotificationPreset AnomalyAnalyzed title]] "New Techs Available for Research"), voiced_text = T(7073, --[[voice:narrator]] "There's more to the barren environs of the Red Planet than meets the eye - a veritable treasure trove of undiscovered knowledge and wonder… So long as you know where to look."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005300, group = "Default", id = "SuggestedBuildingConcreteExtractor", image = "UI/Messages/deposits.tga", text = T(7937, --[[PopupNotificationPreset SuggestedBuildingConcreteExtractor text]] "Many of the colony buildings require Concrete for their construction. Due to the heavy weight of the material continuous imports from Earth are not practical in the long run and we have to secure its production in the colony.\n\nConcrete extractors must be placed over or within proximity to sulfur-rich regolith deposits. Like many other colony buildings, concrete extractors will require Power and regular maintenance from Drones."), title = T(5518, --[[PopupNotificationPreset SuggestedBuildingConcreteExtractor title]] "Suggested Building: Concrete Extractor"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005305, group = "Default", id = "SuggestedShortcutBuildMenu", image = "UI/Messages/deposits.tga", text = T(152511844749, --[[PopupNotificationPreset SuggestedShortcutBuildMenu text]] "Commander, did you know that you can open the Build Menu with <right_click> or <em><ShortcutName('actionOpenBuildMenu', 'keyboard')></em>?\n\nThis is quicker and more efficient than using the HUD button."), title = T(445678751622, --[[PopupNotificationPreset SuggestedShortcutBuildMenu title]] "Opening the Build Menu"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005310, group = "Default", id = "SuggestedResupplyMission", image = "UI/Messages/deposits.tga", text = T(534811629364, --[[PopupNotificationPreset SuggestedResupplyMission text]] "Back on Earth, a dutiful team is standing by for our call. In mere hours they can prepare a new Rocket or Supply Pod and fill it with whatever resources we request, within the limits of the funding provided by our sponsor. Don’t hesitate to make the call and secure valuable resources which we still can’t produce ourselves, or we are deprived of on the surface of the Red Planet.\n\n<hint><if(gamepad)>You can open the Resupply screen from the <LT> menu and order a new Rocket or Supply Pod with resources, buildings and vehicles from Earth.</if><if(kbmouse)>You can open the Resupply screen from the <em>HUD button</em> and order a new Rocket or Supply Pod with resources, buildings and vehicles from Earth.</if>\n\n<hint>Resupply missions can be used as long as you have Funding to order a payload from Earth. Supply Pods cost extra, but Rockets will require refueling for the return trip."), title = T(430535344144, --[[PopupNotificationPreset SuggestedResupplyMission title]] "Resupply"), voiced_text = T(983388575800, --[[voice:narrator]] "Mission Control suggests that we order a Rocket or Supply Pod with valuable payload from Earth. We still need all the help we can get to survive the harsh environment of the Red Planet."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007300, choice1 = T(5755, --[[PopupNotificationPreset FirstDomeConstructed choice1]] "Continue playing"), group = "Default", id = "FirstDomeConstructed", image = "UI/Messages/dome.tga", log_entry = true, text = T(5754, --[[PopupNotificationPreset FirstDomeConstructed text]] "Sol <day> of our mission will be remembered. Our greatest project to date has been completed – the Dome is ready to harbor the first Colonists on Mars. We, the team at Mission Control, are honored to be among the ones chosen to mark the beginning of a new age.\n\nWe created a place for humanity to call home, a place which reminds us of Earth. The Dome seems so fragile, like a glittering snow globe resting among the red sands. This makes us wonder – will our future be just as fragile? Would we be able to leave our cradle and thrive on this cold, distant world?"), title = T(5753, --[[PopupNotificationPreset FirstDomeConstructed title]] "First Dome Constructed!"), voiced_text = T(7125, --[[voice:narrator]] "It's been a stellar day. Not just for the mission, but for humanity itself."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007900, choice1 = T(1138, --[[PopupNotificationPreset RocketCancelWarning choice1]] "Yes"), choice2 = T(4165, --[[PopupNotificationPreset RocketCancelWarning choice2]] "Back"), group = "Default", id = "RocketCancelWarning", image = "UI/Messages/rocket.tga", text = T(5761, --[[PopupNotificationPreset RocketCancelWarning text]] "Are you sure you want to cancel the Rocket’s launch order?"), title = T(7129, --[[PopupNotificationPreset RocketCancelWarning title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017700, choice1 = T(1011, --[[PopupNotificationPreset GameOver choice1]] "Close"), group = "Default", id = "GameOver", image = "UI/Messages/game_over.tga", start_minimized = false, text = T(5766, --[[PopupNotificationPreset GameOver text]] "Failure's just another step in the process. The only thing is to dust ourselves off and try again. And when the future generations return to Mars, our experience, our mistakes and achievements will help them succeed where we could not.\n\n<effect> All Founders have either died or left Mars. The Colony couldn't live up to the dream of human colonization. Game over. But don't give up!"), title = T(5765, --[[PopupNotificationPreset GameOver title]] "Game Over"), voiced_text = T(7154, --[[voice:narrator]] "Humanity had such high hopes and we failed them. We failed the Founders. But is this really the end?"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017800, choice1 = T(1011, --[[PopupNotificationPreset GameOver_PostFounder choice1]] "Close"), group = "Default", id = "GameOver_PostFounder", image = "UI/Messages/game_over.tga", start_minimized = false, text = T(8156, --[[PopupNotificationPreset GameOver_PostFounder text]] "Now, our goal as a species is to not despair. To not look away from the stars. The path has proven to be hard and rocky, but hardship had only made humans more determined – and that’s what defines us as a species! We are sure that one day people will walk the red sands and call Mars their home.\n\n<effect> All Colonists have either died or left Mars. Game over. But don't give up!"), title = T(5765, --[[PopupNotificationPreset GameOver_PostFounder title]] "Game Over"), voiced_text = T(8157, --[[voice:narrator]] "The Colony has failed. The lives and the dreams of our Colonists are lost, washed away by despair and grief."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000200, group = "Disaster", id = "Disaster_DustStorm", text = T(10477, --[[PopupNotificationPreset Disaster_DustStorm text]] "A Dust Storm is set to hit the colony soon. It will cause damage to Pipes and Cables and also will place a serious strain on all buildings – pushing them towards needing maintenance sooner than usual. \n\nStocking up on Power, Water and Oxygen in batteries and tanks is a wise precaution. Disabling non-vital buildings that consume these resources prior and during a Dust Storm will help get by on the available reserves. \n\nThe following buildings do not function during Dust Storms:\n- MOXIEs\n- Moisture Vaporators\n- Solar Panels outside Domes"), title = T(4250, --[[PopupNotificationPreset Disaster_DustStorm title]] "Dust Storm"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000300, group = "Disaster", id = "Disaster_MeteorStorm", text = T(10478, --[[PopupNotificationPreset Disaster_MeteorStorm text]] "The region is about to experience a Meteor Storm. Buildings directly hit by meteors will be in need of repairs in order to function again while Pipes and Cables will get destroyed. Rovers hit by meteors will also need repairs while Drones may become irreversibly damaged. \n\nMeteor Storms cannot be avoided but some good practices may minimize their damage potential, such as not clustering vital buildings next to each other, Pipe and Cable redundancy and researching the tech for MDS Lasers from the Physics field."), title = T(5620, --[[PopupNotificationPreset Disaster_MeteorStorm title]] "Meteor Storm"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000400, group = "Disaster", id = "Disaster_ColdWave", text = T(10479, --[[PopupNotificationPreset Disaster_ColdWave text]] "A Cold Wave is imminent. While most of our machinery is designed and able to function in such low temperatures, if a building outside stops working for more than a Sol, it will freeze and may not be repaired until after the Cold Wave has lifted.\n\nCold Waves put an extra strain on the electrical grid and buildings will consume more electricity. One way to negate the effects of a Cold Wave is to place Subsurface Heaters (researched from the Physics field) near vulnerable buildings.\n\nThe following buildings will freeze during a Cold Wave:\n- Water Tanks\n- Outside buildings that are not operational for more than a Sol"), title = T(4149, --[[PopupNotificationPreset Disaster_ColdWave title]] "Cold Wave"), }) PlaceObj('PopupNotificationPreset', { group = "POI", id = "CompletedCaptureMeteors", minimized_notification_priority = "CriticalBlue", text = T(768080004870, --[[PopupNotificationPreset CompletedCaptureMeteors text]] "Although this is a controlled operation, the exact impact locations are outside our control and may endanger our colony.\n"), title = T(195953271943, --[[PopupNotificationPreset CompletedCaptureMeteors title]] "Capture Meteors"), voiced_text = T(443985878555, --[[voice:narrator]] "We have succeeded in capturing and diverting meteors towards our general vicinity in a gambit to bring precious resources and even scientific insight withing our reach."), }) PlaceObj('PopupNotificationPreset', { group = "POI", id = "CompletedHeighSpeedComSatellite", minimized_notification_priority = "CriticalBlue", text = T(491282077872, --[[PopupNotificationPreset CompletedHeighSpeedComSatellite text]] "The resulting speed at which data is now transferred makes everyone wonder how we got anything done before."), title = T(201673496950, --[[PopupNotificationPreset CompletedHeighSpeedComSatellite title]] "High-speed Comm Satellite"), voiced_text = T(12146, --[[voice:narrator]] "Our high-speed Comm Satellite is now online."), }) PlaceObj('PopupNotificationPreset', { group = "POI", id = "CompletedSETISatellite", minimized_notification_priority = "CriticalBlue", text = T(392168173764, --[[PopupNotificationPreset CompletedSETISatellite text]] "It is now operational and will contribute towards the decades old mission of finding signs of intelligent life elsewhere in the galaxy."), title = T(311475854684, --[[PopupNotificationPreset CompletedSETISatellite title]] "SETI Satellite"), voiced_text = T(439602669281, --[[voice:narrator]] "Our very own SETI Satellite has been delivered and launched into Martian orbit."), }) PlaceObj('PopupNotificationPreset', { group = "POI", id = "CompletedStoryBit_ContractExplorationAccess", minimized_notification_priority = "CriticalTerraforming", text = T(622650641152, --[[PopupNotificationPreset CompletedStoryBit_ContractExplorationAccess text]] "Our partners on Earth are delighted by the fulfillment of the contract and have expressed their gratitude in a hefty amount of Funding."), title = T(949945570603, --[[PopupNotificationPreset CompletedStoryBit_ContractExplorationAccess title]] "Contract Exploration Access"), voiced_text = T(948001628351, --[[voice:narrator]] "The remote scientific outpost is set and has started transmitting intriguing data from the Red Planet."), }) PlaceObj('PopupNotificationPreset', { group = "System", id = "NewFeatures", image = "UI/Messages/hints.tga", no_ccc_button = true, text = T(12420, --[[PopupNotificationPreset NewFeatures text]] "Free Update (Piazzi)\n- <em>Amphitheater</em> - a new building to comfort your colonists and increase tourists' satisfaction.\n- <em>UI Improvements</em> - you can see dust ranges during construction, reorder the research queue, see icons above cable and pipe leaks, cycle between grids with the top UI, and find more information per resource in the top UI.\n- <em>More Colony Control</em> - rename your colony, easily limit births when domes are full, and a new filter option to always include colonists with a specific trait or specialization.\n\nBelow and Beyond\n- <em>Underground</em> - a new area to explore right beneath your colony. Uncovering what the Martian Underground hid from us, and expand into the Underground for its resources and shelter from hazards. Just be careful of cave-ins.\n- <em>Asteroids</em> - a new environment to visit while they travel past Mars. Visit them with an <em>Asteroid Lander</em> to set up a temporary mining outpost. Gather as much as you can before the asteroid moves out of range again.\n- <em>Exotic Minerals</em> - a new resource obtained from <em>Asteroids</em>, required for several of the new buildings.\n- <em>Recon & Expansion Research</em> - new field that unlocks new buildings and upgrades for the underground and asteroids.\n- <em>Uncover new wonders</em> - buried deep below the Martian surface."), title = T(428742818526, --[[PopupNotificationPreset NewFeatures title]] "New Update"), voiced_text = T(562110201672, --[[voice:narrator]] "Surviving Mars has been recently updated. You can check the full patch notes online, but here are few highlights:"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006400, choice1 = T(7116, --[[PopupNotificationPreset ModsWarning choice1]] "OK"), choice2 = T(4165, --[[PopupNotificationPreset ModsWarning choice2]] "Back"), group = "System", id = "ModsWarning", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(4164, --[[PopupNotificationPreset ModsWarning text]] "Mods are player created software packages that modify your game experience. USE THEM AT YOUR OWN RISK! We do not examine, monitor, support or guarantee this user created content. You should take all precautions you normally take regarding downloading files from the Internet before using mods."), title = T(7115, --[[PopupNotificationPreset ModsWarning title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006500, choice1 = T(1138, --[[PopupNotificationPreset SaveDeleteWarning choice1]] "Yes"), choice2 = T(1139, --[[PopupNotificationPreset SaveDeleteWarning choice2]] "No"), group = "System", id = "SaveDeleteWarning", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(4189, --[[PopupNotificationPreset SaveDeleteWarning text]] "Are you sure you want to delete the savegame <savename>?"), title = T(7117, --[[PopupNotificationPreset SaveDeleteWarning title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006600, choice1 = T(1138, --[[PopupNotificationPreset SaveOverwriteWarning choice1]] "Yes"), choice2 = T(1139, --[[PopupNotificationPreset SaveOverwriteWarning choice2]] "No"), group = "System", id = "SaveOverwriteWarning", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(4183, --[[PopupNotificationPreset SaveOverwriteWarning text]] "Are you sure you want to overwrite <savename>?"), title = T(7118, --[[PopupNotificationPreset SaveOverwriteWarning title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006700, choice1 = T(1000136, --[[PopupNotificationPreset SaveUnableToDelete choice1]] "OK"), group = "System", id = "SaveUnableToDelete", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(8049, --[[PopupNotificationPreset SaveUnableToDelete text]] "Unable to delete <name>."), title = T(7119, --[[PopupNotificationPreset SaveUnableToDelete title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006800, choice1 = T(1000136, --[[PopupNotificationPreset SaveUnableToLoad choice1]] "OK"), group = "System", id = "SaveUnableToLoad", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(4187, --[[PopupNotificationPreset SaveUnableToLoad text]] "Could not load <name>."), title = T(7120, --[[PopupNotificationPreset SaveUnableToLoad title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006900, choice1 = T(1000136, --[[PopupNotificationPreset SaveDiskFull choice1]] "OK"), group = "System", id = "SaveDiskFull", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(4184, --[[PopupNotificationPreset SaveDiskFull text]] "Not enough space to create savegame <savename>!"), title = T(7121, --[[PopupNotificationPreset SaveDiskFull title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007000, choice1 = T(1000136, --[[PopupNotificationPreset SaveUnknownError choice1]] "OK"), group = "System", id = "SaveUnknownError", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(5750, --[[PopupNotificationPreset SaveUnknownError text]] "Unidentified error while saving <savename>!"), title = T(7122, --[[PopupNotificationPreset SaveUnknownError title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007100, choice1 = T(1000136, --[[PopupNotificationPreset SaveFileCorrupted choice1]] "OK"), group = "System", id = "SaveFileCorrupted", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(4188, --[[PopupNotificationPreset SaveFileCorrupted text]] "The savegame is corrupted."), title = T(7123, --[[PopupNotificationPreset SaveFileCorrupted title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1008000, choice1 = T(1138, --[[PopupNotificationPreset ExitGame choice1]] "Yes"), choice2 = T(1139, --[[PopupNotificationPreset ExitGame choice2]] "No"), group = "System", id = "ExitGame", image = "UI/Messages/outsource.tga", no_ccc_button = true, text = T(4168, --[[PopupNotificationPreset ExitGame text]] "Are you sure you want to exit the game?"), title = T(5762, --[[PopupNotificationPreset ExitGame title]] "Exit game"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009300, choice1 = T(1138, --[[PopupNotificationPreset ExitToMainMenu choice1]] "Yes"), choice2 = T(1139, --[[PopupNotificationPreset ExitToMainMenu choice2]] "No"), group = "System", id = "ExitToMainMenu", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(1141, --[[PopupNotificationPreset ExitToMainMenu text]] "Exit to the main menu?"), title = T(7130, --[[PopupNotificationPreset ExitToMainMenu title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017400, choice1 = T(7127, --[[PopupNotificationPreset AutosaveFailedNoSpace choice1]] "OK"), group = "System", id = "AutosaveFailedNoSpace", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(7765, --[[PopupNotificationPreset AutosaveFailedNoSpace text]] "There is not enough storage space. Delete old save data or disable Autosave from the Options menu."), title = T(7130, --[[PopupNotificationPreset AutosaveFailedNoSpace title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017500, choice1 = T(7127, --[[PopupNotificationPreset AutosaveFailedNoSpacePS4 choice1]] "OK"), group = "System", id = "AutosaveFailedNoSpacePS4", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(7766, --[[PopupNotificationPreset AutosaveFailedNoSpacePS4 text]] "The save data limit for this game was reached. Delete old save data or disable Autosave from the Options menu."), title = T(7130, --[[PopupNotificationPreset AutosaveFailedNoSpacePS4 title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017600, choice1 = T(7127, --[[PopupNotificationPreset AutosaveFailedGeneric choice1]] "OK"), group = "System", id = "AutosaveFailedGeneric", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(7881, --[[PopupNotificationPreset AutosaveFailedGeneric text]] "Autosave failed.<newline>Error code: <error_code>."), title = T(7130, --[[PopupNotificationPreset AutosaveFailedGeneric title]] "Warning"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017900, choice1 = T(1011, --[[PopupNotificationPreset WelcomeGameInfo choice1]] "Close"), group = "System", id = "WelcomeGameInfo", log_entry = true, no_ccc_button = true, start_minimized = false, text = T(5768, --[[PopupNotificationPreset WelcomeGameInfo text]] "Everyone at Mission Control is impatient to see the rocket touching down and unloading its precious cargo - our remotely controlled eyes and hands on the Red Planet - the drones and rovers. Our goal is to secure a foothold for humanity by building the first Martian Dome. This daunting endeavor will allow the brave pioneers - the Founders - to settle on Mars and prove that the colony is sustainable. But until then we have to make sure the colony has enough construction resources, Water, Oxygen and Power.\n\nMission Sponsor: <em><sponsor_name></em>\n\nCommander Profile: <em><commander_name></em>\n"), title = T(5767, --[[PopupNotificationPreset WelcomeGameInfo title]] "Welcome to Mars, Commander!"), voiced_text = T(7155, --[[voice:narrator]] "Welcome to Mars!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018000, choice1 = T(7828, --[[PopupNotificationPreset LegalAgreement choice1]] "Read the Terms of Use (opens a web browser)"), choice2 = T(7829, --[[PopupNotificationPreset LegalAgreement choice2]] "Read the Privacy Policy (opens a web browser)"), choice3 = T(7830, --[[PopupNotificationPreset LegalAgreement choice3]] "I agree to the Terms of Use and the Privacy Policy"), choice3_img = "UI/CommonNew/message_box_ok.tga", choice4 = T(7831, --[[PopupNotificationPreset LegalAgreement choice4]] "I do not agree to the Terms of Use and the Privacy Policy"), choice4_img = "UI/CommonNew/message_box_cancel.tga", group = "System", id = "LegalAgreement", image = "UI/Messages/marsgate_mystery_02.tga", no_ccc_button = true, start_minimized = false, text = T(7827, --[[PopupNotificationPreset LegalAgreement text]] "Welcome to Surviving Mars!\n\nBefore you get started, please take a moment to read our Terms of Use and Privacy Policy."), title = T(7826, --[[PopupNotificationPreset LegalAgreement title]] "Legal Agreements"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000500, group = "Evaluation", id = "Evaluation_Colonist_Deaths", image = "UI/Messages/death.tga", text = T(7789, --[[PopupNotificationPreset Evaluation_Colonist_Deaths text]] "While the Applicants who came to Mars were aware of the many risks that would await them, the near-criminal neglect from our side is something different. We cannot keep this information from the public – and opinions are swaying in the direction that our Colony is a “death trap”.\n\nThis troublesome rumor deters many valuable candidates from coming to the new frontier – and these are people we desperately need to fulfill the great mission of colonizing Mars and bringing our vision of the future closer.\n\n<hint> Each time a Colonist dies from a non-natural death, <ApplicantsLostOnColonistDeath> Applicants leave the pool."), title = T(7788, --[[PopupNotificationPreset Evaluation_Colonist_Deaths title]] "A Mission In Jeopardy"), voiced_text = T(8124, --[[voice:narrator]] "The recent Colonist deaths are a worrisome trend which cannot be ignored!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000600, choice1 = T(7737, --[[PopupNotificationPreset Evaluation_Colonists_Beginning choice1]] "OK"), group = "Evaluation", id = "Evaluation_Colonists_Beginning", image = "UI/Messages/hints.tga", text = T(7736, --[[PopupNotificationPreset Evaluation_Colonists_Beginning text]] "The dwindling resources on our planet, overpopulation and environmental crisis, as well as the risk of a global-scale Armageddon create a powerful argument for anyone doubting the importance of our mission.\n\nIt is a well understood fact that it’s a matter of “when” not “if” for a major extinction event to happen. Having a self-sustaining population on a world other than Earth when the time comes should drastically increase humankind’s odds of survival.\n\n<goal><objective>"), title = T(7735, --[[PopupNotificationPreset Evaluation_Colonists_Beginning title]] "Mission Evaluation: The Exodus"), voiced_text = T(8125, --[[voice:narrator]] "Scientists and visionaries have promoted the idea of “Humanity as a multi-planetary species” as the only way to prevent a possible mass extinction."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000700, group = "Evaluation", id = "Evaluation_Colonist_Bad_Fail", image = "UI/Messages/debris.tga", text = T(7738, --[[PopupNotificationPreset Evaluation_Colonist_Bad_Fail text]] "But this failure shouldn't throw us into despair. We still have to strive to create a stable, self-sustaining foothold from which humanity would reach the stars and conquer them.\n\n<effect>Mission Evaluation objective failed - you have <count> Colonists out of <target> present on the planet. Final Score: <Score>."), title = T(7735, --[[PopupNotificationPreset Evaluation_Colonist_Bad_Fail title]] "Mission Evaluation: The Exodus"), voiced_text = T(8126, --[[voice:narrator]] "We have to admit that we failed to accomplish one of the main goals set before our mission. Sadly, we underestimated the difficulties of sustaining a large population on the Red Planet."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000800, group = "Evaluation", id = "Evaluation_Colonist_Good", image = "UI/Messages/colonists.tga", text = T(7739, --[[PopupNotificationPreset Evaluation_Colonist_Good text]] "Even that we didn't surpass the expectations, the stable trends of development of the colony are encouraging.\n\nOur achievement is still a tremendous success – we did something which no one imagined to be possible. The Colony would now be a symbol of hope and new beginning, a proof that humanity would persevere and live on regardless of the challenges we face.\n\n<effect> Mission Evaluation objective completed - you have <count> Colonists out of <target> present on the planet. Final Score: <Score>."), title = T(7735, --[[PopupNotificationPreset Evaluation_Colonist_Good title]] "Mission Evaluation: The Exodus"), voiced_text = T(8127, --[[voice:narrator]] "As the Evaluation Day dawns upon us we can clearly say that the mission to Mars was a success."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1000900, group = "Evaluation", id = "Evaluation_Colonist_Great", image = "UI/Messages/colonists.tga", text = T(7740, --[[PopupNotificationPreset Evaluation_Colonist_Great text]] "We managed not only to achieve our goals, but also to surpass all expectations as the size of our current Colony is far beyond the initial estimations. This day will be marked in human history by the importance of our accomplishment – we secured the future of humankind as interplanetary species. The Colony would now be a symbol of hope and new beginning, a proof that humanity would persevere and live on regardless of the challenges we face.\n\n<effect> Mission Evaluation objective completed - you have <count> Colonists out of <target> present on the planet. Final Score: <Score>."), title = T(7735, --[[PopupNotificationPreset Evaluation_Colonist_Great title]] "Mission Evaluation: The Exodus"), voiced_text = T(8128, --[[voice:narrator]] "Congratulations! Everyone at Mission Control rejoices as the Colony has been marked as “extremely successful” in the Evaluation Report."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001000, choice1 = T(7737, --[[PopupNotificationPreset Evaluation_Martianborn_Beginning choice1]] "OK"), group = "Evaluation", id = "Evaluation_Martianborn_Beginning", image = "UI/Messages/hints.tga", text = T(7742, --[[PopupNotificationPreset Evaluation_Martianborn_Beginning text]] "New horizons open new possibilities. Mars can be viewed as a blank canvas – a hostile, uncultivated place where humanity can start anew. A fresh start needs new people – people born on Mars, raised in a society where people cooperate and fight the odds instead of each other.\n\n<goal><objective>"), title = T(7741, --[[PopupNotificationPreset Evaluation_Martianborn_Beginning title]] "Mission Evaluation: A Fresh Start"), voiced_text = T(8129, --[[voice:narrator]] "Our civilization, in all its glory, still bears the mark of obsolete cultural and ideological beliefs, from times when people didn't know any better. If we remain ignorant of our own flaws we risk destroying the future for our children."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001100, group = "Evaluation", id = "Evaluation_Matianborn_BadFail", image = "UI/Messages/debris.tga", text = T(7743, --[[PopupNotificationPreset Evaluation_Matianborn_BadFail text]] "Martian birthrate trends are still susceptible to malicious undercurrents and the Colony depends largely on the arrival of Applicants from Earth.\n\nThe Sponsors are disappointed that their program goal - a new human civilization on Mars - can't be achieved yet. Probably it was too early to expect that humanity can beat the odds of survival on such a hostile world and reach the level of everyday comfort required to start thinking about children and the future. The burden to disprove the evil tongues who would say this is impossible now lies on our shoulders. There's still work to be done\n\n<effect>Mission Evaluation objective failed - you have <count> Martianborn Colonists out of <target> present in the Colony. Final Score: <Score>."), title = T(7741, --[[PopupNotificationPreset Evaluation_Matianborn_BadFail title]] "Mission Evaluation: A Fresh Start"), voiced_text = T(8130, --[[voice:narrator]] "The Mission Evaluation period is over and the progress we've made was marked as... sub-optimal, to say the least."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001200, group = "Evaluation", id = "Evaluation_Matianborn_Good", image = "UI/Messages/dome.tga", text = T(7744, --[[PopupNotificationPreset Evaluation_Matianborn_Good text]] "If we keep up the good work, in several generations the concept of the Martian civilization would exit the state of the hypothetical and become a reality.\n\n<effect> Mission Evaluation objective completed - you have <count> Colonists present on the planet out of the target <target>. Final Score: <Score>."), title = T(7741, --[[PopupNotificationPreset Evaluation_Matianborn_Good title]] "Mission Evaluation: A Fresh Start"), voiced_text = T(8131, --[[voice:narrator]] "The Mission Evaluation period is over and the results we have achieved are quite satisfactory."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001300, group = "Evaluation", id = "Evaluation_Matianborn_Great", image = "UI/Messages/dome.tga", text = T(7745, --[[PopupNotificationPreset Evaluation_Matianborn_Great text]] "The number of Colonists born on Mars have reached beyond the wildest expectations! This solid base would serve us to promote new values of the new society, to allow the culture of the Red Planet to flourish and develop independent of the bad influence of Earth.\n\nThe path ahead of us is rough and uncertain, but who knows, maybe one day the people on Earth would admire the achievements of the Martians in awe, learning from them.\n\n<effect> Mission Evaluation objective completed - you have <count> Martianborn Colonists present on the planet out of the target <target>. Final Score: <Score>."), title = T(7741, --[[PopupNotificationPreset Evaluation_Matianborn_Great title]] "Mission Evaluation: A Fresh Start"), voiced_text = T(8132, --[[voice:narrator]] "The Mission Evaluation period is over and it’s not wrong to say that we managed to outdo ourselves."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001400, choice1 = T(7737, --[[PopupNotificationPreset Evaluation_Tech_Beginning choice1]] "OK"), group = "Evaluation", id = "Evaluation_Tech_Beginning", image = "UI/Messages/hints.tga", text = T(7747, --[[PopupNotificationPreset Evaluation_Tech_Beginning text]] "A new era of scientific discovery is ahead of us and we are the ones who are blessed with the opportunity to be on Mars – a completely new territory where new scientific discoveries lie behind the corner. We’re talking about new ideas which would sweep the human minds and the market and give us a tremendous head start in the future.\n\nThe primary reason behind the creation of this Colony is scientific and this is what we’re expected to do – to push the boundaries of human knowledge!\n\n<goal><objective>"), title = T(7746, --[[PopupNotificationPreset Evaluation_Tech_Beginning title]] "Mission Evaluation: New Dawn"), voiced_text = T(8133, --[[voice:narrator]] "Humankind might be on the verge of a new Golden Age! And we have to be the ones who ride the crest of that wave!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001500, group = "Evaluation", id = "Evaluation_Tech_BadFail", image = "UI/Messages/debris.tga", text = T(7748, --[[PopupNotificationPreset Evaluation_Tech_BadFail text]] "The harsh conditions of Mars proved too overwhelming and the technological leap desired is very far off.\n\n<effect>Mission Evaluation objective failed - you have <count> researched Technologies out of <target>. Final Score: <Score>."), title = T(7746, --[[PopupNotificationPreset Evaluation_Tech_BadFail title]] "Mission Evaluation: New Dawn"), voiced_text = T(8134, --[[voice:narrator]] "At the end of the Mission Evaluation period we have to admit that the pursuit of technological progress on a hostile alien world is an unaccessible luxury, when we're preoccupied with short-term survival."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001600, group = "Evaluation", id = "Evaluation_Tech_Good", image = "UI/Messages/research.tga", text = T(7749, --[[PopupNotificationPreset Evaluation_Tech_Good text]] "The colony has proven its worth as a cradle of scientific thought and everyone is sure that the future is hiding more secrets to be uncovered and more mysteries solved.\n\n<effect> Mission Evaluation objective completed - you have <count> researched Technologies out of the target <target>. Final Score: <Score>."), title = T(7746, --[[PopupNotificationPreset Evaluation_Tech_Good title]] "Mission Evaluation: New Dawn"), voiced_text = T(8135, --[[voice:narrator]] "The Mission Evaluation period is over and the results of our efforts are visible – a steady track of technological milestones can be traced back to the moment the very first rocket landed on the Red Planet."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001700, group = "Evaluation", id = "Evaluation_Tech_Great", image = "UI/Messages/research.tga", text = T(7750, --[[PopupNotificationPreset Evaluation_Tech_Great text]] "What’s more important is that we demonstrated to the world that the future is really just behind the corner. Our brightest minds have become icons of prosperity and progress, paving the way for future generations to create a better tomorrow – on Mars, on Earth or any other place in the Universe!\n\n<effect> Mission Evaluation objective completed - you have <count> researched Technologies out of the target <target>! Final Score: <Score>."), title = T(7746, --[[PopupNotificationPreset Evaluation_Tech_Great title]] "Mission Evaluation: New Dawn"), voiced_text = T(8136, --[[voice:narrator]] "Our contribution towards the scientific advancement of humankind will be forever remembered. The Evaluation Day report shows accomplishments beyond even our wildest expectations."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001800, choice1 = T(7737, --[[PopupNotificationPreset Evaluation_Anomalies_Beginning choice1]] "OK"), group = "Evaluation", id = "Evaluation_Anomalies_Beginning", image = "UI/Messages/hints.tga", text = T(7752, --[[PopupNotificationPreset Evaluation_Anomalies_Beginning text]] "Our nature is one of discovery and novelty – our curiosity will never be satisfied. To this we owe much of our civilization’s prosperity and progress.\n\nExploring the mysteries beyond our world caters to the best in us and by capturing our collective imagination as a species, we bring the focus back to what we can accomplish together instead of bickering and fighting amongst each other.\n\n<goal><objective>"), title = T(7751, --[[PopupNotificationPreset Evaluation_Anomalies_Beginning title]] "Mission Evaluation: The Final Frontier"), voiced_text = T(8137, --[[voice:narrator]] "We are all descendants of those who dared to look beyond the nice, cozy valley they inhabited and enter a world full of mystery and wonder. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1001900, group = "Evaluation", id = "Evaluation_Anomalies_BadFail", image = "UI/Messages/debris.tga", text = T(7753, --[[PopupNotificationPreset Evaluation_Anomalies_BadFail text]] "The planet turned out to be even more hostile and uninviting than we thought, thwarting any attempts to make a breakthrough in its exploration.\n\nIt seems that Mars will continue to be an uncharted territory for the next generations to explore. What matters now is to turn our failure into success by making sure that the Colony is a good starting point for these crews and expeditions that would set off into the red deserts to satisfy their wanderlust.\n\n<effect>Mission Evaluation objective failed – you have analyzed <count> Anomalies out of the target <target>. Final score: <Score>."), title = T(7751, --[[PopupNotificationPreset Evaluation_Anomalies_BadFail title]] "Mission Evaluation: The Final Frontier"), voiced_text = T(8138, --[[voice:narrator]] "The Mission Evaluation report confirms what we knew – the target goals were far off from the very beginning."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002000, group = "Evaluation", id = "Evaluation_Anomalies_Good", image = "UI/Messages/exploration.tga", text = T(7754, --[[PopupNotificationPreset Evaluation_Anomalies_Good text]] "We found unexpected treasures buried in the sand of Mars and they only fueled our growing interest to find out more.\n\nWhat’s more important is that the wave of inspiration has swept over Earth, sparking immense interest and the desire to work together towards a common goal.\n\n<effect>Mission Evaluation objective completed – you have analyzed <count> Anomalies out of the target <target>. Final score: <Score>."), title = T(7751, --[[PopupNotificationPreset Evaluation_Anomalies_Good title]] "Mission Evaluation: The Final Frontier"), voiced_text = T(8139, --[[voice:narrator]] "The final Mission Evaluation report concludes that the Colony has scored a significant progress in the exploration of the Red Planet."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002100, choice1 = T(6294, --[[PopupNotificationPreset LaunchIssue_MissionSuspended choice1]] "OK"), group = "Launch Issues", id = "LaunchIssue_MissionSuspended", image = "UI/Messages/rocket.tga", no_ccc_button = true, start_minimized = false, text = T(8141, --[[PopupNotificationPreset LaunchIssue_MissionSuspended text]] "All resupply missions are temporarily suspended."), title = T(8140, --[[PopupNotificationPreset LaunchIssue_MissionSuspended title]] "Launch Issue: Suspended Missions"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002200, choice1 = T(6294, --[[PopupNotificationPreset LaunchIssue_DustStorm choice1]] "OK"), group = "Launch Issues", id = "LaunchIssue_DustStorm", image = "UI/Messages/dust_storm.tga", start_minimized = false, text = T(8143, --[[PopupNotificationPreset LaunchIssue_DustStorm text]] "Rockets cannot land or launch during Dust Storms. We will have to wait until the storm is over."), title = T(8142, --[[PopupNotificationPreset LaunchIssue_DustStorm title]] "Launch Issue: Dust Storm"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002300, choice1 = T(6294, --[[PopupNotificationPreset LaunchIssue_Fuel choice1]] "OK"), group = "Launch Issues", id = "LaunchIssue_Fuel", image = "UI/Messages/rocket.tga", start_minimized = false, text = T(8145, --[[PopupNotificationPreset LaunchIssue_Fuel text]] "This Rocket is not yet refueled for the next voyage.<newline><newline>Fuel is produced in a Fuel Refinery building supplied with Water. It is then transported by Drones to the Rocket."), title = T(8144, --[[PopupNotificationPreset LaunchIssue_Fuel title]] "Launch Issue: Fuel"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002400, choice1 = T(6294, --[[PopupNotificationPreset LaunchIssue_NotLanded choice1]] "OK"), group = "Launch Issues", id = "LaunchIssue_NotLanded", image = "UI/Messages/rocket.tga", start_minimized = false, text = T(8766, --[[PopupNotificationPreset LaunchIssue_NotLanded text]] "The Rocket is not currently landed. It will have to land and refuel for re-launch."), title = T(8765, --[[PopupNotificationPreset LaunchIssue_NotLanded title]] "Launch Issue: Not Landed"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002500, group = "Launch Issues", id = "LaunchIssue_Cargo", image = "UI/Messages/rocket.tga", start_minimized = false, text = T(8147, --[[PopupNotificationPreset LaunchIssue_Cargo text]] "Not all resources from this Rocket have been unloaded yet. If the Rocket launches now, the remaining resources on board will be lost.<newline><newline>To complete the unloading process, make sure there is enough available storage space in the vicinity as well as operational Drones to transport the resources."), title = T(8146, --[[PopupNotificationPreset LaunchIssue_Cargo title]] "Launch Issue: Remaining Resources on Board"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002600, group = "Launch Issues", id = "LaunchIssue_Housing", image = "UI/Messages/rocket.tga", no_ccc_button = true, start_minimized = false, text = T(8148, --[[PopupNotificationPreset LaunchIssue_Housing text]] "There are <em><number1></em> passengers on board but there's only space for <em><number2></em> new residents in the Colony."), title = T(648845139046, --[[PopupNotificationPreset LaunchIssue_Housing title]] "Launch Issue: Residential Space"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002700, choice1 = T(1000136, --[[PopupNotificationPreset LaunchIssue_Maintenance choice1]] "OK"), group = "Launch Issues", id = "LaunchIssue_Maintenance", image = "UI/Messages/rocket.tga", start_minimized = false, text = T(809411461416, --[[PopupNotificationPreset LaunchIssue_Maintenance text]] "The Rocket has malfunctioned and needs repairs."), title = T(623462076855, --[[PopupNotificationPreset LaunchIssue_Maintenance title]] "Launch Issue: Maintenance"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002800, choice1 = T(1000136, --[[PopupNotificationPreset LaunchIssue_Disabled choice1]] "OK"), group = "Launch Issues", id = "LaunchIssue_Disabled", image = "UI/Messages/rocket.tga", start_minimized = false, text = T(229343936631, --[[PopupNotificationPreset LaunchIssue_Disabled text]] "You can't launch this rocket currently."), title = T(622366848807, --[[PopupNotificationPreset LaunchIssue_Disabled title]] "Launch Issue: Launch Disabled"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1002900, group = "Launch Issues", id = "LaunchIssue_NoMatchingApplicants", image = "UI/Messages/rocket.tga", no_ccc_button = true, start_minimized = false, text = T(11602, --[[PopupNotificationPreset LaunchIssue_NoMatchingApplicants text]] "No applicants match the selected filters"), title = T(11696, --[[PopupNotificationPreset LaunchIssue_NoMatchingApplicants title]] "Launch Issue: No Passengers"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003000, group = "Launch Issues", id = "LaunchIssue_NoPassengers", image = "UI/Messages/rocket.tga", no_ccc_button = true, start_minimized = false, text = T(11695, --[[PopupNotificationPreset LaunchIssue_NoPassengers text]] "No applicants selected"), title = T(11696, --[[PopupNotificationPreset LaunchIssue_NoPassengers title]] "Launch Issue: No Passengers"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003400, choice1 = T(5688, --[[PopupNotificationPreset Mystery3_PierceTheShell choice1]] "That is most worrying"), group = "Mystery", id = "Mystery3_PierceTheShell", image = "UI/Messages/sphere_mystery_01.tga", text = T(5687, --[[PopupNotificationPreset Mystery3_PierceTheShell text]] "Whatever lies within the Sphere is pretty capable of harnessing any energy projected at it. Furthermore, the energy used by our instruments seems to have furthered its power-up process.\n\n<effect>The Sphere charges a bit"), title = T(5686, --[[PopupNotificationPreset Mystery3_PierceTheShell title]] "Spheres: The Trusty Screwdriver"), voiced_text = T(7074, --[[voice:narrator]] "Our attempts to penetrate the outer layer of the Sphere were unsuccessful, though they did yield some interesting results."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003500, choice1 = T(5691, --[[PopupNotificationPreset Mystery3_Communicate choice1]] "I kinda hope it stays quiet"), group = "Mystery", id = "Mystery3_Communicate", image = "UI/Messages/sphere_mystery_01.tga", text = T(5690, --[[PopupNotificationPreset Mystery3_Communicate text]] "So thorough is the absorption process that we fail to detect even the slightest reflected wave being thrown back at us. Aside from that the Sphere remains, unsurprisingly, quiet.\n\n<effect>The Sphere charges a bit"), title = T(5689, --[[PopupNotificationPreset Mystery3_Communicate title]] "Spheres: Metallic Silence"), voiced_text = T(7075, --[[voice:narrator]] "Our test results tell us the Sphere accumulates energy by absorbing radio waves,"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003600, choice1 = T(5694, --[[PopupNotificationPreset Mystery3_FeedPower choice1]] "Whose idea was this anyway?"), group = "Mystery", id = "Mystery3_FeedPower", image = "UI/Messages/sphere_mystery_01.tga", text = T(5693, --[[PopupNotificationPreset Mystery3_FeedPower text]] "While energy direction by itself is not something so unusual, utilizing it for a purpose implies intent or at least programming of some kind. Our current test-grade proof will most certainly help encourage our scientists currently tackling this mystery.\n \n<effect>The Sphere charges a bit"), title = T(5692, --[[PopupNotificationPreset Mystery3_FeedPower title]] "Spheres: Is it Alive?"), voiced_text = T(7076, --[[voice:narrator]] "Our running hypothesis seems to be correct. It’s releasing energy to charge faster. Maybe it’s alive?"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003700, choice1 = T(5697, --[[PopupNotificationPreset Mystery3_OnAnomalyScanned choice1]] "Keep me up to speed on any finds."), group = "Mystery", id = "Mystery3_OnAnomalyScanned", image = "UI/Messages/sphere_mystery_01.tga", text = T(5696, --[[PopupNotificationPreset Mystery3_OnAnomalyScanned text]] "Its surface is perfectly smooth and also seems to sport mirror-like features.\n\nThe way this sphere reflects its surroundings has struck our team as being especially odd. It reflects not what one would expect, and in some instances seems to entirely ignore the observer from the reflection. \n\nThis has the potential to be something monumental. Further excavation is most definitely encouraged by everyone here at Mission Control.\n\n<effect> A half-buried sphere is revealed"), title = T(5695, --[[PopupNotificationPreset Mystery3_OnAnomalyScanned title]] "Spheres: A Buried Secret"), voiced_text = T(7077, --[[voice:narrator]] "A short dig following an off-the-charts reading revealed a metallic spheroid buried just beneath the surface."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003800, choice1 = T(5700, --[[PopupNotificationPreset Mystery3_FirstInteraction choice1]] "That’s some B-movie material right there."), group = "Mystery", id = "Mystery3_FirstInteraction", image = "UI/Messages/sphere_mystery_01.tga", text = T(5699, --[[PopupNotificationPreset Mystery3_FirstInteraction text]] "Our most sensitive instruments detect a very weak, yet constant low frequency vibration, giving the Sphere a sort of hum. At least no harmful particles are detected. \n\nWe will be waiting for further test results.\n\n<effect>The Sphere begins charging."), title = T(5698, --[[PopupNotificationPreset Mystery3_FirstInteraction title]] "Spheres: System Shock"), voiced_text = T(7078, --[[voice:narrator]] "We tried interacting with it, which triggered some sort of response. The Sphere isn’t dormant anymore."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1003900, choice1 = T(5703, --[[PopupNotificationPreset Mystery3_SphereLaunch choice1]] "The Sphere should be watched closely at all times!"), group = "Mystery", id = "Mystery3_SphereLaunch", image = "UI/Messages/sphere_mystery_01.tga", text = T(5702, --[[PopupNotificationPreset Mystery3_SphereLaunch text]] "Mission Control was struck speechless as the half excavated Sphere finished the job itself and un-burrowed fully on its own, then began moving - levitating with the aid of some propulsion method unknown to us. \n\nAround it, temperatures fell drastically, creating a cold area that moved around with it. Mission Control is scrambling to predict where it’s headed to and if this cold zone is a byproduct of its propulsion method. Or more like its function. \n\nThese are exciting times – scary, but exciting.\n\n<effect>The Sphere begins moving."), title = T(5701, --[[PopupNotificationPreset Mystery3_SphereLaunch title]] "Spheres: Hello, Goodbye"), voiced_text = T(7079, --[[voice:narrator]] "Definitive contact with an extraterrestrial being, for the first time in the history of mankind."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004000, choice1 = T(5706, --[[PopupNotificationPreset Mystery3_FirstCharge choice1]] "Son of a…"), group = "Mystery", id = "Mystery3_FirstCharge", image = "UI/Messages/sphere_mystery_02.tga", text = T(5705, --[[PopupNotificationPreset Mystery3_FirstCharge text]] "While we aren’t sure if the Sphere has any set destination it is hovering towards, we have enough evidence to say that a new process has been initiated by the Sphere. For what purpose, we cannot say as of now.\n\n<hint> The Sphere drains batteries and charges quicker."), title = T(5704, --[[PopupNotificationPreset Mystery3_FirstCharge title]] "Spheres: The Sphere is a Sucker!"), voiced_text = T(7080, --[[voice:narrator]] "It seems to be absorbing any sort of electrical current in close proximity. In other words, it’s feeding on our batteries."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004100, choice1 = T(5709, --[[PopupNotificationPreset Mystery3_FirstDamage choice1]] "The safety of our citizens is always a priority!"), group = "Mystery", id = "Mystery3_FirstDamage", image = "UI/Messages/sphere_mystery_02.tga", text = T(5708, --[[PopupNotificationPreset Mystery3_FirstDamage text]] "While it does not seem to be lethal in any moderate doses, any Colonist, subject to the Sphere’s influence, shows signs of deteriorating health and needs a solid few days at the Infirmary.\n\nOur researchers have several theories on what this phenomenon is and should we prioritize it, we may be able to come up with a way to protect our citizens from the harmful influence of any such Sphere. \n\n<effect> <em>Sphere Protection</em> research available."), title = T(5707, --[[PopupNotificationPreset Mystery3_FirstDamage title]] "Spheres: Bad Vibrations"), voiced_text = T(7081, --[[voice:narrator]] "The humming’s less than subtle now, with the added bonus that it’s clearly harming any Colonists that come too close."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005800, choice1 = T(5734, --[[PopupNotificationPreset Mystery3_FirstSplit choice1]] "Well, this can’t be good..."), group = "Mystery", id = "Mystery3_FirstSplit", image = "UI/Messages/sphere_mystery_02.tga", text = T(5733, --[[PopupNotificationPreset Mystery3_FirstSplit text]] "In a moment of pure awesomeness the Sphere split into two identical Spheres. The new objects have grown to the exact same size as the previous one.\n\nThe second Sphere is now entirely independent from the first, moving in a direction of its own choosing, yet the two Spheres are clearly interacting with each other at a distance. Their humming frequencies are changing simultaneously and the more they resonate, the more a slight ionization of the atmosphere around them becomes evident.\n\nAt the moment of the splitting a vast amount of data was gathered by our instruments, so we may have the means to dig deeper within this mystery. Until then we can only predict that some event will trigger when a certain resonance frequency has been reached by both Spheres.\n\n<effect>The Sphere divided into two separate Spheres."), title = T(5732, --[[PopupNotificationPreset Mystery3_FirstSplit title]] "Spheres: More to Come"), voiced_text = T(7109, --[[voice:narrator]] "The Mirror Sphere has Mission Control in total chaos. Though that’s expected given what we saw."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005900, choice1 = T(5737, --[[PopupNotificationPreset Mystery3_FirstCatch choice1]] "Aced it!"), group = "Mystery", id = "Mystery3_FirstCatch", image = "UI/Messages/sphere_mystery_02.tga", text = T(5736, --[[PopupNotificationPreset Mystery3_FirstCatch text]] "Apart from controlling where it goes and what damage it does, this is of little use to us at the moment as we can’t dismantle them or even hinder their function in any way. \n\nHowever, this is critical for closer observation and research.\n\n<effect> A Sphere is being held motionless."), title = T(5735, --[[PopupNotificationPreset Mystery3_FirstCatch title]] "Spheres: It Works!"), voiced_text = T(7110, --[[voice:narrator]] "Those decoy buildings worked just like we planned, much to the dismay of our hardworking engineers. We've captured our first Sphere!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006000, choice1 = T(5740, --[[PopupNotificationPreset Mystery3_FirstDeposit choice1]] "My thoughts exactly."), group = "Mystery", id = "Mystery3_FirstDeposit", image = "UI/Messages/sphere_mystery_02.tga", text = T(5739, --[[PopupNotificationPreset Mystery3_FirstDeposit text]] "The Sphere is converted back to its precious ingredients.\n\nOur scientists are quick to inform us that any Sphere free from our decoy buildings will roll back to its splitting phase and will most probably try to retrieve the critical amount needed for their collective purpose.\n\nWe feel we have gathered enough information from these Spheres. It’s been deemed that decomposing all the Spheres is our best road of action.\n\n<effect> A Sphere was converted into resources."), title = T(5738, --[[PopupNotificationPreset Mystery3_FirstDeposit title]] "Spheres: Choose Your Poison"), voiced_text = T(7111, --[[voice:narrator]] "Humanity applied its knowledge of an alien technology for the first time ever. And it was a complete success."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006100, choice1 = T(5743, --[[PopupNotificationPreset Mystery3_PowerDecoysTech choice1]] "Can’t decide if this is good news or bad."), group = "Mystery", id = "Mystery3_PowerDecoysTech", image = "UI/Messages/sphere_mystery_02.tga", text = T(5742, --[[PopupNotificationPreset Mystery3_PowerDecoysTech text]] "The new Sphere also exhibits the humming of the previous two and is also resonating with them and the atmosphere around it. We have adjusted the predicted trigger point of the unknown event, as now it is expected to come earlier due to the higher Sphere count. \n\nThe good news is that the more there are, the more observation material is available for our scientists.\n\nWe should be able to paint a general picture of their purpose after investing some time to research them. \n\n<effect> <em>Purpose of the Spheres</em> research available."), title = T(5741, --[[PopupNotificationPreset Mystery3_PowerDecoysTech title]] "Spheres: 3 Up, More to Come"), voiced_text = T(7112, --[[voice:narrator]] "The Spheres just keep dividing. This level of technology… We can't even begin to comprehend it."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006200, choice1 = T(5746, --[[PopupNotificationPreset Mystery3_ColdWave choice1]] "This is now officially a fight for survival."), group = "Mystery", id = "Mystery3_ColdWave", image = "UI/Messages/sphere_mystery_02.tga", text = T(5745, --[[PopupNotificationPreset Mystery3_ColdWave text]] "What or who needs to lower the atmospheric temperature of contemporary Mars is beyond any of us – yet it is most evident that the Spheres are effective at what they are doing. \n\nIf we want to stop the change, we must find a breakthrough based on what we already know and learn how to control or cancel this process.\n\n<effect> A prolonged, extremely strong Cold Wave has begun.\n<effect> <em>Xeno-Terraforming</em> research available."), title = T(5744, --[[PopupNotificationPreset Mystery3_ColdWave title]] "Spheres: Climate Change "), voiced_text = T(7113, --[[voice:narrator]] "The Colony is expecting some sort of artificial cold wave. How’s that even possible?"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1006300, choice1 = T(5749, --[[PopupNotificationPreset Mystery3_Ending choice1]] "The end of an era."), group = "Mystery", id = "Mystery3_Ending", image = "UI/Messages/sphere_mystery_02.tga", text = T(5748, --[[PopupNotificationPreset Mystery3_Ending text]] "The Cold Wave that had gripped our Colony has finally been dispelled. Temperatures have returned to the normal, cruelly cold levels we are used to.\n\nOur scientists are confident that we have recorded and gathered all data necessary for making sense of this encounter in the coming decades. Also, they are confident that the Spheres themselves had overstayed their welcome. \n\nKeeping them around would have meant living with the ever-present danger of re-activating the endless Cold Wave once more, even if we had managed to find a way to halt it without destroying all the Spheres. \n\nAnd despite the risks, despite the purely pragmatic reasons for destroying all the Spheres, one can’t help but wonder how the generations to come will feel of this deed. Will we go down in history as cowards? Or maybe as too insensitive to the magnitude of the encounter, the very first non-man-made technology ever found?\n\nWhen our scientists give up on trying to determine the origin of these Spheres, will textbooks mention that because of the rash actions and fears of the few pioneers that lived on Mars at the time, the riddle will never be solved?\n\n<effect> No more Spheres are left.\n<effect> Cold Wave dispelled."), title = T(5747, --[[PopupNotificationPreset Mystery3_Ending title]] "Spheres: To Future Generations"), voiced_text = T(7114, --[[voice:narrator]] "We’ve dismantled the last Sphere, yet our unease with the alien technology still lingers."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007800, choice1 = T(1011, --[[PopupNotificationPreset MysteryLog choice1]] "Close"), group = "Mystery", id = "MysteryLog", image = "UI/Messages/space.tga", no_ccc_button = true, text = T(5760, --[[PopupNotificationPreset MysteryLog text]] "...."), title = T(5661, --[[PopupNotificationPreset MysteryLog title]] "Mystery Log"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004200, choice1 = T(7987, --[[PopupNotificationPreset FirstColonistDeath choice1]] "View."), choice2 = T(5712, --[[PopupNotificationPreset FirstColonistDeath choice2]] "Thank you, fellow Colonists."), group = "Colonist", id = "FirstColonistDeath", image = "UI/Messages/death.tga", text = T(5711, --[[PopupNotificationPreset FirstColonistDeath text]] "As difficult and painful as it is, we must accept that <ColonistName(colonist)> is dead. As friends, as a community, we express our sadness, we acknowledge our loss, acknowledge the great importance of <ColonistName(colonist)>’s life.\n\n<ColonistName(colonist)>’s life has been a journey towards a vision, a journey which brought us all towards the possibility of living on the Red Planet, one small step after at a time. <ColonistName(colonist)> didn’t try to make their mark in human history, for there is no room for attempts in success. <ColonistName(colonist)> knew what the calling of fate was, knew the risks and the opportunities and made the best of it, for the good of us all.\n\nWhat is it that takes a person through all of this is a question only we can answer. This is a question whose answer is the spirit of <ColonistName(colonist)>, and this is a legacy for us.\n\n<effect><ColonistName(colonist)> has died. Cause: <reason>\n<hint> Each time a Colonist dies from a non-natural death, two Applicants leave the pool"), title = T(5710, --[[PopupNotificationPreset FirstColonistDeath title]] "A Eulogy for an Everyday Hero"), voiced_text = T(7082, --[[voice:narrator]] "We gather here today to bid a final farewell to one of our finest."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004300, choice1 = T(7987, --[[PopupNotificationPreset FirstStatusEffect_StressedOut choice1]] "View."), choice2 = T(5715, --[[PopupNotificationPreset FirstStatusEffect_StressedOut choice2]] "Troubling."), group = "Colonist", id = "FirstStatusEffect_StressedOut", image = "UI/Messages/colonists.tga", text = T(5714, --[[PopupNotificationPreset FirstStatusEffect_StressedOut text]] "<ColonistName(colonist)>, as every other Colonist, went through psychological conditioning before arriving on Mars to guarantee their most basic ability to cope with the adverse environment. Indeed, the people live on a barren, dead-cold world with a toxic, almost non-existent atmosphere, protected only by a fragile-looking Dome and relying on machines to keep them alive.\n\nThe unparalleled everyday stress levels slowly drain the people of their resolve – thus even the slightest shock or frustration can send someone over the edge. On Earth entertainment and recreation are just for fun, but here they are a tool for basic survival.\n\n<hint> The Colonist <ColonistName(colonist)> has reached critically low Sanity. Provide operational Healthcare buildings in the Domes and avoid Heavy workload or Nighttime work to prevent this situation."), title = T(5713, --[[PopupNotificationPreset FirstStatusEffect_StressedOut title]] "Mental Breakdown"), voiced_text = T(7083, --[[voice:narrator]] "A Colonist just snapped!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004400, choice1 = T(7987, --[[PopupNotificationPreset FirstStatusEffect_Suffocating choice1]] "View."), choice2 = T(5715, --[[PopupNotificationPreset FirstStatusEffect_Suffocating choice2]] "Troubling."), group = "Colonist", id = "FirstStatusEffect_Suffocating", image = "UI/Messages/colonists.tga", text = T(5717, --[[PopupNotificationPreset FirstStatusEffect_Suffocating text]] "Our Domes are large enough to contain tons of breathable air, but when the systems fail to refresh the supply, the amount of carbon dioxide will steadily increase until the atmosphere becomes unbreathable.\n\n<hint> Colonists with the Suffocating status effect have no access to Oxygen and will die within a short time. Connect their Dome to operational MOXIEs and Oxygen Tanks or plant Oxygen-Producing Crops in Farms to supply them with Oxygen."), title = T(5716, --[[PopupNotificationPreset FirstStatusEffect_Suffocating title]] "Suffocation!"), voiced_text = T(7084, --[[voice:narrator]] "Our Colonists are suffocating! We only have a few hours to get them more Oxygen before they run out!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004500, choice1 = T(7987, --[[PopupNotificationPreset FirstStatusEffect_Dehydrated choice1]] "View."), choice2 = T(5720, --[[PopupNotificationPreset FirstStatusEffect_Dehydrated choice2]] "Oh my!"), group = "Colonist", id = "FirstStatusEffect_Dehydrated", image = "UI/Messages/colonists.tga", text = T(5719, --[[PopupNotificationPreset FirstStatusEffect_Dehydrated text]] "Water is the vital fluid which sustains all life. The human body requires a constant access to fresh, drinkable water and quickly deteriorates when none is present. Thus the extraction of Water is one of our utmost priorities.\n\n<hint> Colonists with the Dehydrated status effect have no access to Water and will die within a short time. Connect their Dome to operational Water Producers or filled Water Towers to supply them with Water."), title = T(5718, --[[PopupNotificationPreset FirstStatusEffect_Dehydrated title]] "Dehydration!"), voiced_text = T(7085, --[[voice:narrator]] "The Colonists are on the brink of dehydration! We need to figure out something quick before they die."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004600, choice1 = T(7987, --[[PopupNotificationPreset FirstStatusEffect_Freezing choice1]] "View."), choice2 = T(5715, --[[PopupNotificationPreset FirstStatusEffect_Freezing choice2]] "Troubling."), group = "Colonist", id = "FirstStatusEffect_Freezing", image = "UI/Messages/colonists.tga", text = T(5722, --[[PopupNotificationPreset FirstStatusEffect_Freezing text]] "Domes feature heaters which maintain a pleasant temperature of 23 degrees Celsius around the clock, protecting against the fluctuating temperature of the fickle Martian atmosphere outside. The temperature inside the Dome quickly decreases when the power supply is cut and the Colonists sure do feel the effects. If the situation remains unchanged, I'm afraid that it could be fatal.\n\n<hint> Colonists with the Freezing status effect reside in a Dome with an insufficient supply of Power. Increase the amount of Power accessible to the Dome to prevent this."), title = T(5721, --[[PopupNotificationPreset FirstStatusEffect_Freezing title]] "Hypothermia!"), voiced_text = T(7086, --[[voice:narrator]] "Our Colonists are suffering from hypothermia!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004700, choice1 = T(7987, --[[PopupNotificationPreset FirstStatusEffect_Starving choice1]] "View."), choice2 = T(5715, --[[PopupNotificationPreset FirstStatusEffect_Starving choice2]] "Troubling."), group = "Colonist", id = "FirstStatusEffect_Starving", image = "UI/Messages/colonists.tga", text = T(5724, --[[PopupNotificationPreset FirstStatusEffect_Starving text]] "Constant supply of fresh nutrients is vital to the survival of the Colony. The Colonists can go on for some time before they suffer more adverse effects from the lack of food, but if you don't feed them soon, they will die.\n\n<hint> Colonists with the Starving status effect have no access to Food. Deliver Food from Earth or produce it by farming to supply the starving."), title = T(5723, --[[PopupNotificationPreset FirstStatusEffect_Starving title]] "Starvation!"), voiced_text = T(7087, --[[voice:narrator]] "Our Colonists are starving!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004800, choice1 = T(7987, --[[PopupNotificationPreset LastFounderDies choice1]] "View."), choice2 = T(5727, --[[PopupNotificationPreset LastFounderDies choice2]] "Rest in peace, friend."), group = "Colonist", id = "LastFounderDies", image = "UI/Messages/death.tga", text = T(5726, --[[PopupNotificationPreset LastFounderDies text]] "<ColonistName(colonist)> had a dream – to see humanity united, conquering the stars. And <ColonistName(colonist)> allowed nothing to stand in the path of this dream. No hardship, no loss, not even personal safety. What more can anyone be asked to do?\n\nWe had known many women and men of character, of strength and virtue. Any one of them might have stepped into <ColonistName(colonist)>'s place and we would be none the wiser. But we know why <ColonistName(colonist)> chose this path. When a heart as big and strong beats in one's chest it gives no other option but to follow its call.\n\nWhen <ColonistName(colonist)> fell, it left a void. Do not let it take over your hearts, friends. Do not mourn the icon of good that we have lost, rather rise up and become the icon yourself. Let this death be not a blow against the will of humanity to grow, learn and conquer new frontiers.\n\n<hint>The Founder <ColonistName(colonist)> died. Cause: <reason>."), title = T(5725, --[[PopupNotificationPreset LastFounderDies title]] "End of an Age"), voiced_text = T(7088, --[[voice:narrator]] "The day claimed our last living Founder, spelling the end of an era for us all."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1004900, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderDiesOfOldAge choice1]] "View."), choice2 = T(5727, --[[PopupNotificationPreset FirstFounderDiesOfOldAge choice2]] "Rest in peace, friend."), group = "Colonist", id = "FirstFounderDiesOfOldAge", image = "UI/Messages/death.tga", text = T(5729, --[[PopupNotificationPreset FirstFounderDiesOfOldAge text]] "We will all have our own special memories of the mark <ColonistName(colonist)> left in our hearts and in our lives. I am certain that <ColonistName(colonist)> would have wanted us all to be here today filled not with grief but with strength, vision and hope for the future. This is what <ColonistName(colonist)> lived for and doing otherwise would make this cause pointless.\n\nWe are all here today not only because <ColonistName(colonist)> laid down the foundations of our Colony. We were all personally touched and inspired by their strong character, personality and presence. We were all very lucky to have had <ColonistName(colonist)> beside us in both good and bad moments and, as much as will be missing our comrade, their memory will live on as long as we remain united.\n\n<hint>The Founder <ColonistName(colonist)> passed away due to old age."), title = T(5728, --[[PopupNotificationPreset FirstFounderDiesOfOldAge title]] "Do Not Go Gentle Into That Good Night"), voiced_text = T(7089, --[[voice:narrator]] "Today was a tough one. We lost one of our Founders."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005000, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderAlcoholic choice1]] "View."), choice2 = T(7093, --[[PopupNotificationPreset FirstFounderAlcoholic choice2]] "Alcohol is not the answer."), group = "Colonist", id = "FirstFounderAlcoholic", image = "UI/Messages/colonists.tga", text = T(7091, --[[PopupNotificationPreset FirstFounderAlcoholic text]] "Despite the great lengths we go through to make it seem safe and as close as possible to home, one’s mind is never too far from the dangers that the privilege of being an interplanetary pioneer carries. We all find our own ways to cope with this pressure. <ColonistName(colonist)> finds it in the bottle.\n\n<hint>The Founder <ColonistName(colonist)> has the <em>Alcoholic</em> Trait."), title = T(7090, --[[PopupNotificationPreset FirstFounderAlcoholic title]] "Nobody Knows The Trouble I've Seen..."), voiced_text = T(7092, --[[voice:narrator]] "It's a rough life here on Mars. You can't prepare for addiction."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005100, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderWhiner choice1]] "View."), choice2 = T(7445, --[[PopupNotificationPreset FirstFounderWhiner choice2]] "Oh boy..."), group = "Colonist", id = "FirstFounderWhiner", image = "UI/Messages/colonists.tga", text = T(7443, --[[PopupNotificationPreset FirstFounderWhiner text]] "For they are meant to tread and live where no man has ever lived before – in an environment not meant for man to live in to begin with. This is why it came as a shock to us all when <ColonistName(colonist)> turned out to be such a whiner!\n\n<hint>The Founder <ColonistName(colonist)> has the <em>Whiner</em> Trait. "), title = T(7442, --[[PopupNotificationPreset FirstFounderWhiner title]] "In Space, No One Can Hear you Whine"), voiced_text = T(7444, --[[voice:narrator]] "The Founders are supposed to be the pillars of the future Colony – destined to be remembered for generations."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005200, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderCoward choice1]] "View."), choice2 = T(7097, --[[PopupNotificationPreset FirstFounderCoward choice2]] "Courage is finite."), group = "Colonist", id = "FirstFounderCoward", image = "UI/Messages/colonists.tga", text = T(7095, --[[PopupNotificationPreset FirstFounderCoward text]] "They face uncertainty which no humans have faced before. <ColonistName(colonist)> on the other hand, albeit a pioneer, doesn’t seem especially brave and makes jumping in fright after seeing one’s own shadow look like a normal thing. \n\n<hint>The Founder <ColonistName(colonist)> has the <em>Coward</em> Trait."), title = T(7094, --[[PopupNotificationPreset FirstFounderCoward title]] "Courage Has Layers"), voiced_text = T(7096, --[[voice:narrator]] "It takes more than bravery to be a pioneer of the Martian frontier. Or at least it should."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005400, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderEnthusiast choice1]] "View."), choice2 = T(7101, --[[PopupNotificationPreset FirstFounderEnthusiast choice2]] "That's the spirit!"), group = "Colonist", id = "FirstFounderEnthusiast", image = "UI/Messages/colonists.tga", text = T(7099, --[[PopupNotificationPreset FirstFounderEnthusiast text]] "After all, purpose is the strongest long-term driver. Since arriving on Mars, <ColonistName(colonist)>'s enthusiasm has proven to be above average, even by Founder norms, and the prodigious productivity displayed can be boiled down to one simple explanation – <ColonistName(colonist)> really loves doing what <ColonistName(colonist)>‘s doing.\n\n<hint>The Founder <ColonistName(colonist)> has the <em>Enthusiast</em> trait."), title = T(7098, --[[PopupNotificationPreset FirstFounderEnthusiast title]] "When Life Gives You Lemons..."), voiced_text = T(7100, --[[voice:narrator]] "Building a new home on an alien world? That takes guts, to say the least."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005500, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderGambler choice1]] "View."), choice2 = T(7446, --[[PopupNotificationPreset FirstFounderGambler choice2]] "OK"), group = "Colonist", id = "FirstFounderGambler", image = "UI/Messages/colonists.tga", text = T(7103, --[[PopupNotificationPreset FirstFounderGambler text]] "They travel through 50 million miles to a rocky, inhospitable world and try to bend it to humanity's will. <ColonistName(colonist)> , on the other hand, seems to also be a gambler in the more traditional sense. \n\nWe must not judge. On the contrary, we must be supportive and help our dear comrade with whom we’ve traversed the void, spearheaded humanity’s expansion on other worlds, only to find that we are no safer from vices so Earthly, it’s as if we never left.\n\n<hint>The Founder <ColonistName(colonist)> has the <em>Gambler</em> trait."), title = T(7102, --[[PopupNotificationPreset FirstFounderGambler title]] "Gambling Midst The Stars "), voiced_text = T(7104, --[[voice:narrator]] "The first Colonists are all gamblers coming to Mars. It's the ultimate roll of the dice."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005600, choice1 = T(7987, --[[PopupNotificationPreset FirstFounderIdiot choice1]] "View."), choice2 = T(7447, --[[PopupNotificationPreset FirstFounderIdiot choice2]] "OK"), group = "Colonist", id = "FirstFounderIdiot", image = "UI/Messages/colonists.tga", text = T(7106, --[[PopupNotificationPreset FirstFounderIdiot text]] "Warning signs and instructions are, usually, enough to prevent most of them being done by most people. <ColonistName(colonist)> is not like most people and instructions and warnings seem to be of little to no use. \n\nWe, as a small community, have come to accept the obvious: \n\n<hint>The Founder <ColonistName(colonist)> has the <em>Idiot</em> trait."), title = T(7105, --[[PopupNotificationPreset FirstFounderIdiot title]] "Call It What You Will"), voiced_text = T(7107, --[[voice:narrator]] "Living in cramped quarters, tinkering with intricate machinery day-in, day-out. There's plenty of opportunities for slip-ups."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1005700, choice1 = T(7987, --[[PopupNotificationPreset LastFounderLeavingMars choice1]] "View."), choice2 = T(5731, --[[PopupNotificationPreset LastFounderLeavingMars choice2]] "Farewell, friend."), group = "Colonist", id = "LastFounderLeavingMars", image = "UI/Messages/colonists.tga", text = T(5730, --[[PopupNotificationPreset LastFounderLeavingMars text]] "The Founders had always been more than explorers and pioneers. They shared a vision of the future of the civilization on the Red Planet and worked ceaselessly towards their common goal.\n\nBut, as it often happens during the course of history the, societal standpoint changes. <ColonistName(colonist)> could not adapt to the changing times and decided to leave Mars. I know <ColonistName(colonist)> personally and I'm sure that this isn't caused by disappointment but instead is a rational decision. I remember one time when we talked about the future of the Colony and <ColonistName(colonist)>'s words: “We are the progenitors of the Colony but parents have to eventually step down and give way to their children.”\n\nAs I watch the rocket fly towards Earth I cannot force myself to think that <ColonistName(colonist)> is abandoning us. Something tells me that we will be in contact and will continue to receive wise council from our last Founder.\n\n<hint>The last Founder <ColonistName(colonist)> has left Mars."), title = T(5725, --[[PopupNotificationPreset LastFounderLeavingMars title]] "End of an Age"), voiced_text = T(7108, --[[voice:narrator]] "Mars has ways of crushing the hope out of our very best."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007200, choice1 = T(1011, --[[PopupNotificationPreset FirstPassengerRocket choice1]] "Close"), group = "Colonist", id = "FirstPassengerRocket", image = "UI/Messages/colony_founding.tga", text = T(5752, --[[PopupNotificationPreset FirstPassengerRocket text]] "The next 10 Sols will be full of difficulties and dangers, but also with great promises and opportunities. It is now to us to prove that Mars can be a doorway to greater riches and the future of the human civilization. Even the most epic adventures begin with a single step.\n\n<effect> Arrival of additional Colonists temporarily suspended until the Colony proves able to sustain human life. Your Founder Colonists must survive for 10 Sols before additional people can arrive.\n\n<hint> The Colony will be evaluated positively before the period ends in the event the first human is born on Mars. If you feel you are up to the challenge, try constructing a Medical Building and raising the Comfort of the Founders as much as possible with Service Buildings."), title = T(5751, --[[PopupNotificationPreset FirstPassengerRocket title]] "A New Beginning"), voiced_text = T(7124, --[[voice:narrator]] "Full of hope and determination, the first Founders have set foot on the Red Planet."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007400, choice1 = T(7127, --[[PopupNotificationPreset ColonyViabilityExit_MartianBorn choice1]] "OK"), group = "Colonist", id = "ColonyViabilityExit_MartianBorn", image = "UI/Messages/birth.tga", text = T(5757, --[[PopupNotificationPreset ColonyViabilityExit_MartianBorn text]] "The Colonists have always felt like a family. But what makes the family stronger and more united is the promise of new life and better future. We have truly been blessed with a rewarding responsibility – to carry the torch of hope.\n\nLet this blooming of life serve as a symbol for all humans. Mars is no longer a dead world.\n\n<effect> The Colony has been evaluated positively. Additional Colonists can be called from Earth."), title = T(5756, --[[PopupNotificationPreset ColonyViabilityExit_MartianBorn title]] "The Door towards the Stars"), voiced_text = T(7126, --[[voice:narrator]] "For the first time, a human has been born on Mars. It's truly a unique miracle."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007500, choice1 = T(6294, --[[PopupNotificationPreset ColonyViabilityExit_MartianBorn_LastArk choice1]] "OK"), group = "Colonist", id = "ColonyViabilityExit_MartianBorn_LastArk", image = "UI/Messages/birth.tga", text = T(8856, --[[PopupNotificationPreset ColonyViabilityExit_MartianBorn_LastArk text]] "The Colonists have always felt like a family. But what makes the family stronger and more united is the promise of new life and better future. We have truly been blessed with a rewarding responsibility – to carry the torch of hope.\n\nLet this blooming of life serve as a symbol for all humans. Mars is no longer a dead world.\n\n<effect> The Colony has been evaluated positively. You can't call anymore colonists from Earth due to the Last Ark game rule."), title = T(5756, --[[PopupNotificationPreset ColonyViabilityExit_MartianBorn_LastArk title]] "The Door towards the Stars"), voiced_text = T(7126, --[[voice:narrator]] "For the first time, a human has been born on Mars. It's truly a unique miracle."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007600, choice1 = T(5759, --[[PopupNotificationPreset ColonyViabilityExit_Delay choice1]] "Looks like we’ve got a serious adventure ahead of us!"), group = "Colonist", id = "ColonyViabilityExit_Delay", image = "UI/Messages/hints.tga", text = T(5758, --[[PopupNotificationPreset ColonyViabilityExit_Delay text]] "The long-time dream of the human civilization as a whole – to settle another world – has come true. To be among the people who made this happen makes me feel enthusiastic and proud.\n\nWe are already swarmed with applications for relocation on Mars and the wanderlust and enthusiasm of these people makes me proud to be a human being. The Red Planet continues to be inhospitable and even dangerous but we as a species had always displayed the ability to adapt and improve – the adverse conditions will only make us try harder. So I say bring it on!\n\n<effect> The Colony has been evaluated positively. Additional Colonists can be called from Earth."), title = T(5756, --[[PopupNotificationPreset ColonyViabilityExit_Delay title]] "The Door towards the Stars"), voiced_text = T(7128, --[[voice:narrator]] "This will go down in history."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1007700, choice1 = T(5759, --[[PopupNotificationPreset ColonyViabilityExit_Delay_LastArk choice1]] "Looks like we’ve got a serious adventure ahead of us!"), group = "Colonist", id = "ColonyViabilityExit_Delay_LastArk", image = "UI/Messages/hints.tga", text = T(8857, --[[PopupNotificationPreset ColonyViabilityExit_Delay_LastArk text]] "The long-time dream of the human civilization as a whole – to settle another world – has come true. To be among the people who made this happen makes me feel enthusiastic and proud.\n\nWe are already swarmed with applications for relocation on Mars and the wanderlust and enthusiasm of these people makes me proud to be a human being. The Red Planet continues to be inhospitable and even dangerous but we as a species had always displayed the ability to adapt and improve – the adverse conditions will only make us try harder. So I say bring it on!\n\n<effect> The Colony has been evaluated positively. You can't call anymore colonists from Earth due to the Last Ark game rule."), title = T(5756, --[[PopupNotificationPreset ColonyViabilityExit_Delay_LastArk title]] "The Door towards the Stars"), voiced_text = T(7128, --[[voice:narrator]] "This will go down in history."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009400, group = "Tutorial", id = "Tutorial1_Popup1_Intro", image = "UI/Messages/outsource.tga", no_ccc_button = true, start_minimized = false, text = T(9229, --[[PopupNotificationPreset Tutorial1_Popup1_Intro text]] "In this training exercise you will learn how to gather basic resources from the Martian surface, how to construct a small base and how to refuel the Rocket in order to send it back to Earth.\n\nLet’s get started!\n\n<effect><TutorialDisabledAchievementsText()>"), title = T(9227, --[[PopupNotificationPreset Tutorial1_Popup1_Intro title]] "IMM Training Simulation"), voiced_text = T(7155, --[[voice:narrator]] "Welcome to Mars!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009500, group = "Tutorial", id = "Tutorial1_Popup2_ZoomAndCamera", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_ZoomAndCamera.tga", no_ccc_button = true, start_minimized = false, text = T(9231, --[[PopupNotificationPreset Tutorial1_Popup2_ZoomAndCamera text]] "<goal>Zoom in towards the suggested landing site."), title = T(5497, --[[PopupNotificationPreset Tutorial1_Popup2_ZoomAndCamera title]] "Camera Controls"), voiced_text = T(9230, --[[voice:narrator]] "You need to master the camera controls and familiarize yourself with the terrain around the prospective colony site."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009600, group = "Tutorial", id = "Tutorial1_Popup3_LandRocket", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_LandRocket.tga", no_ccc_button = true, start_minimized = false, text = T(9234, --[[PopupNotificationPreset Tutorial1_Popup3_LandRocket text]] "Proceed by selecting the pinned icon representing the Rocket that is currently in orbit around Mars.\n\n<goal>Land the Rocket on Mars."), title = T(9232, --[[PopupNotificationPreset Tutorial1_Popup3_LandRocket title]] "Landing the Rocket"), voiced_text = T(9233, --[[voice:narrator]] "Now it's time to land your first Rocket."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009700, group = "Tutorial", id = "Tutorial1_Popup4_DronesAndResources", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_DronesAndResources.tga", no_ccc_button = true, start_minimized = false, text = T(9237, --[[PopupNotificationPreset Tutorial1_Popup4_DronesAndResources text]] "It carries Drones - remotely controlled robots which constitute your construction and resources gathering workforce.\n\nGathering basic resources for building construction is one of the first things our Martian base needs. Place a Metals Depot so the Drones begin automatically bringing Metals from the scattered surface deposits nearby.\n\n<goal>Gather 5 Metals in a Metals Depot."), title = T(9235, --[[PopupNotificationPreset Tutorial1_Popup4_DronesAndResources title]] "Drones and Resources"), voiced_text = T(9236, --[[voice:narrator]] "...and we have touchdown! The Rocket has landed on Mars."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009800, group = "Tutorial", id = "Tutorial1_Popup5_UnloadRocket", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_UnloadRocket.tga", no_ccc_button = true, start_minimized = false, text = T(9240, --[[PopupNotificationPreset Tutorial1_Popup5_UnloadRocket text]] "<goal>Place a Universal Depot near your Rocket."), title = T(9238, --[[PopupNotificationPreset Tutorial1_Popup5_UnloadRocket title]] "Unloading the Payload"), voiced_text = T(9239, --[[voice:narrator]] "Our Rocket carries valuable resources that will be essential for the construction and maintenance of the Colony. Initially it's best to designate a Universal Depot, so the Drones have a place to store them."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1009900, group = "Tutorial", id = "Tutorial1_Popup6_ConcreteExtractor", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_ConcreteExtractor.tga", no_ccc_button = true, start_minimized = false, text = T(9242, --[[PopupNotificationPreset Tutorial1_Popup6_ConcreteExtractor text]] "The Concrete Extractor building must be placed over or within proximity of a Concrete deposit.\n\n<goal>From the build menu, select to build a Concrete Extractor and place it at the proposed location."), title = T(5032, --[[PopupNotificationPreset Tutorial1_Popup6_ConcreteExtractor title]] "Concrete Extractor"), voiced_text = T(9241, --[[voice:narrator]] "Along with Metals, Concrete is the other vital basic construction resource."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010000, group = "Tutorial", id = "Tutorial1_Popup7_DroneRange", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_DronesAndDroneHubs.tga", no_ccc_button = true, start_minimized = false, text = T(9245, --[[PopupNotificationPreset Tutorial1_Popup7_DroneRange text]] "Buildings are constructed by Drones. If you place a building outside the Drones' work range it won't be constructed. When placing buildings, make sure that those buildings are within range of drone controllers like the Rocket, Drone Hubs or RC Commanders.\n\nYou can select the Rocket to view its control radius."), title = T(9243, --[[PopupNotificationPreset Tutorial1_Popup7_DroneRange title]] "Drone Range"), voiced_text = T(9244, --[[voice:narrator]] "You are trying to place a construction outside of the work range of your Drones."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010100, group = "Tutorial", id = "Tutorial1_Popup8_Power", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_Power.tga", no_ccc_button = true, start_minimized = false, text = T(9247, --[[PopupNotificationPreset Tutorial1_Popup8_Power text]] "Stirling Generators are excellent power sources but they are too complex to be built on Mars during the early stages of our colonization effort. That is why we ship them from Earth partially assembled in prefabs. Prefabs do not require any resources, only drones to unpack and assemble them.\n\nWe've provided you with a Stirling Generator prefab.\n\n<goal>Construct a Stirling Generator and then connect it to the Concrete extractor with a Power Cable or place the Stirling Generator adjacent to the Concrete Extractor for a direct connection."), title = T(79, --[[PopupNotificationPreset Tutorial1_Popup8_Power title]] "Power"), voiced_text = T(9246, --[[voice:narrator]] "Like most buildings, the Concrete Extractor needs power in order to operate. Having a reliable electrical grid and supply is essential for the success of the colony."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010200, group = "Tutorial", id = "Tutorial1_Popup9_WasteRockConcreteDepot", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_WasteRockConcreteDepot.tga", no_ccc_button = true, start_minimized = false, text = T(9250, --[[PopupNotificationPreset Tutorial1_Popup9_WasteRockConcreteDepot text]] "The amount of Waste Rock per resource extracted depends on the Grade of the resource deposit. You can select a resource deposit to view its Grade and the amount of resources remaining in it.\n\n<goal>Place a Dumping Site and a Concrete Depot to store the extracted Concrete."), title = T(9248, --[[PopupNotificationPreset Tutorial1_Popup9_WasteRockConcreteDepot title]] "Waste Rock and the Concrete Depot"), voiced_text = T(9249, --[[voice:narrator]] "Waste Rock is a byproduct of all extractors and is best stored at designated locations. This way you can ensure that it will not be in the way of future construction."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010300, group = "Tutorial", id = "Tutorial1_Popup10_DronesAndDroneHubs", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_DronesAndDroneHubs.tga", no_ccc_button = true, start_minimized = false, text = T(9253, --[[PopupNotificationPreset Tutorial1_Popup10_DronesAndDroneHubs text]] "Currently all Drones are assigned to the Rocket. When the Rocket is selected the work range of all Drones assigned to it will be visualized. If the Rocket takes off, however, all these Drones will need another controller.\n\n<goal>Build a Drone Hub and make sure it is supplied with power."), title = T(9251, --[[PopupNotificationPreset Tutorial1_Popup10_DronesAndDroneHubs title]] "Drones and Drone Hubs"), voiced_text = T(9252, --[[voice:narrator]] "Drones will pick pending tasks on their own within the range of the drone controllers they are assigned to."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010400, group = "Tutorial", id = "Tutorial1_Popup11_DroneBatteries", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_DronesRecharge.tga", no_ccc_button = true, start_minimized = false, text = T(9255, --[[PopupNotificationPreset Tutorial1_Popup11_DroneBatteries text]] "Every Drone Hub has two Recharge Stations built-in, but you might need additional ones as the Colony spreads out. Constructing Recharge Stations, especially along areas with heavy Drone activity, will prove vital for maintaining an efficient work force.\n\n<goal>Build a Recharge Station near the Concrete Extractor."), title = T(5541, --[[PopupNotificationPreset Tutorial1_Popup11_DroneBatteries title]] "Drone Batteries"), voiced_text = T(9254, --[[voice:narrator]] "Drones run on batteries that have to be recharged periodically."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010500, group = "Tutorial", id = "Tutorial1_Popup12_RefuelingRocket", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_Pipes.tga", no_ccc_button = true, start_minimized = false, text = T(9257, --[[PopupNotificationPreset Tutorial1_Popup12_RefuelingRocket text]] "Every Rocket has enough fuel for a one-way trip to Mars and has to be refueled on site, so it can return to Earth and be reused.\n \nFuel is produced in a Fuel Refinery. To setup the production chain, we will also need Water.\n\n<goal>Build a Moisture Vaporator and then a Fuel Refinery."), title = T(5503, --[[PopupNotificationPreset Tutorial1_Popup12_RefuelingRocket title]] "Refueling the Rocket"), voiced_text = T(9256, --[[voice:narrator]] "Maintaining a steady supply chain between Earth and Mars is essential, especially during the early colonization stages. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010600, group = "Tutorial", id = "Tutorial1_Popup12_RefuelingRocket_1", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_DronesAndDroneHubs.tga", no_ccc_button = true, start_minimized = false, text = T(9260, --[[PopupNotificationPreset Tutorial1_Popup12_RefuelingRocket_1 text]] "Luckily, we have an extra Stirling Generator Prefab we could use.\n\n<goal>Build a new Stirling Generator along the power network."), title = T(9258, --[[PopupNotificationPreset Tutorial1_Popup12_RefuelingRocket_1 title]] "Insufficient Power"), voiced_text = T(9259, --[[voice:narrator]] "We don't have sufficient Power for all the buildings in the colony."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010700, group = "Tutorial", id = "Tutorial1_Popup13_Pipes", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_Pipes.tga", no_ccc_button = true, start_minimized = false, text = T(9262, --[[PopupNotificationPreset Tutorial1_Popup13_Pipes text]] "The Moisture Vaporator has to be connected with Pipes to the Fuel Refinery. \n\n<goal>Connect the Moisture Vaporator to the Fuel Refinery with Pipes."), title = T(882, --[[PopupNotificationPreset Tutorial1_Popup13_Pipes title]] "Pipes"), voiced_text = T(9261, --[[voice:narrator]] "A system of Pipes is used to deliver resources such as Water and Air where they are needed."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010800, group = "Tutorial", id = "Tutorial1_Popup14_Fuel", image = "UI/Messages/Tutorials/Tutorial1/Tutorial1_Fuel.tga", no_ccc_button = true, start_minimized = false, text = T(9264, --[[PopupNotificationPreset Tutorial1_Popup14_Fuel text]] "Use the Speed Controls to increase the game speed, so the Rocket refuels faster.\n\n<effect>For the purposes of this tutorial simulation the Rocket needs far less fuel (5) than it would during a normal playthrough (50).\n\n<goal>Refuel the Rocket."), title = T(4765, --[[PopupNotificationPreset Tutorial1_Popup14_Fuel title]] "Fuel"), voiced_text = T(9263, --[[voice:narrator]] "Fuel production is now underway and the Drones will begin to deliver the Fuel to the Rocket."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1010900, choice1 = T(9268, --[[PopupNotificationPreset Tutorial1_Popup15_Epilogue choice1]] 'Play Next Tutorial - "Rovers, Exploration & Research"'), choice2 = T(1010, --[[PopupNotificationPreset Tutorial1_Popup15_Epilogue choice2]] "Main Menu"), group = "Tutorial", id = "Tutorial1_Popup15_Epilogue", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(9267, --[[PopupNotificationPreset Tutorial1_Popup15_Epilogue text]] "You've learned how to setup a basic outpost on Mars that can gather resources for further expansion and refuel Rockets. Using Rockets to bring in additional supplies from Earth is essential for a fledgling colony."), title = T(9265, --[[PopupNotificationPreset Tutorial1_Popup15_Epilogue title]] "Mission Complete!"), voiced_text = T(9266, --[[voice:narrator]] "Congratulations, you have finished the first tutorial!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011000, group = "Tutorial", id = "Tutorial2_Popup1_Intro", image = "UI/Messages/outsource.tga", no_ccc_button = true, start_minimized = false, text = T(9270, --[[PopupNotificationPreset Tutorial2_Popup1_Intro text]] "Rovers are vehicles with a variety of useful functions like transporting resources, commanding Drones and analyzing Anomalies. You have direct control over all Rovers in the colony.\n\n<goal>Select the RC Transport and move it to the designated area."), title = T(5438, --[[PopupNotificationPreset Tutorial2_Popup1_Intro title]] "Rovers"), voiced_text = T(9269, --[[voice:narrator]] "Welcome, Commander! In this training exercise you will get acquainted with one of your most valuable tools - Rovers."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011200, group = "Tutorial", id = "Tutorial2_Popup3_RCTransport", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_RCTransport.tga", no_ccc_button = true, start_minimized = false, text = T(9274, --[[PopupNotificationPreset Tutorial2_Popup3_RCTransport text]] "Use the RC Transport to load Fuel from the fuel depot in the base, then unload it close to the Rocket, so that its drones can load it into the rocket.\n\nDrones can also take resources directly from the RC Transport if they need them, however unloading the resources is quicker and will free up the RC Transport for other tasks.\n\n<goal>Load Fuel on to the RC Transport and unload it next to the Rocket."), title = T(1683, --[[PopupNotificationPreset Tutorial2_Popup3_RCTransport title]] "RC Transport"), voiced_text = T(9273, --[[voice:narrator]] "The RC Transport can load and carry resources around the map. Let's use it to refuel the nearby Rocket."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011300, group = "Tutorial", id = "Tutorial2_Popup4_OrphanedDrones", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_OrphanedDrones.tga", no_ccc_button = true, start_minimized = false, text = T(9276, --[[PopupNotificationPreset Tutorial2_Popup4_OrphanedDrones text]] "If Drones lose their controller they will look for new controllers nearby. However, when there are no controllers nearby you'll have to manually reassign them to a new controller.\n\nThe \"Reassign\" command also allows you to reassign Drones to understaffed controllers with heavy Drone load.\n\n<goal>Assign these Drones to the nearby Drone Hub."), title = T(5672, --[[PopupNotificationPreset Tutorial2_Popup4_OrphanedDrones title]] "Orphaned Drones"), voiced_text = T(9275, --[[voice:narrator]] "Some Drones are left without a controller after the Rocket launch."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011400, group = "Tutorial", id = "Tutorial2_Popup4_1_Gathering Metals", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_Gathering Metals.tga", no_ccc_button = true, start_minimized = false, text = T(9278, --[[PopupNotificationPreset Tutorial2_Popup4_1_Gathering Metals text]] "Send the RC Transport to gather some Metals from the deposit indicated by the arrow.\n\n<goal>Gather 5 Metals with the RC Transport."), title = T(9096, --[[PopupNotificationPreset Tutorial2_Popup4_1_Gathering Metals title]] "RC Transport - Gathering Metals"), voiced_text = T(9277, --[[voice:narrator]] "The RC Transport is able to gather resources directly from surface deposits without the help of Drones."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011500, group = "Tutorial", id = "Tutorial2_Popup5_TransporRoute", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_TransporRoute.tga", no_ccc_button = true, start_minimized = false, text = T(9280, --[[PopupNotificationPreset Tutorial2_Popup5_TransporRoute text]] 'We will need resources for the new base. The RC Transport can be ordered to transfer a large amount of resources in multiple goes via the "Create Transport Route" command.\n\n<goal>Set a transport route between the Universal Storage in the base and the marked location above the main base.'), title = T(9099, --[[PopupNotificationPreset Tutorial2_Popup5_TransporRoute title]] "RC Transport - Transport Routes"), voiced_text = T(9279, --[[voice:narrator]] "Let's set up a small expand some distance away from the main base."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011600, group = "Tutorial", id = "Tutorial2_Popup6_RCRover", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_RCRover.tga", no_ccc_button = true, start_minimized = false, text = T(9282, --[[PopupNotificationPreset Tutorial2_Popup6_RCRover text]] "The RC Commander is a mobile drone controller that carries its own drones. With its help you can gather resources from surface deposits, construct and maintain buildings.\n\nWhen moving far distances the RC Commander will first recall its drones before moving off to its destination.\n\n<goal>Move the RC Commander to the site of the expand."), title = T(1682, --[[PopupNotificationPreset Tutorial2_Popup6_RCRover title]] "RC Commander"), voiced_text = T(9429, --[[voice:narrator]] "Commander, one other thing."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011700, group = "Tutorial", id = "Tutorial2_Popup7_SensorTower", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_SensorTower.tga", no_ccc_button = true, start_minimized = false, text = T(9285, --[[PopupNotificationPreset Tutorial2_Popup7_SensorTower text]] "Use the resources that the RC Transport delivered to build and power a new Sensor Tower that will help us scan the nearby locations for new resources and Anomalies.\n\n<goal> Construct a Sensor Tower and a Stirling Generator to power it."), title = T(9283, --[[PopupNotificationPreset Tutorial2_Popup7_SensorTower title]] "New Expand"), voiced_text = T(9284, --[[voice:narrator]] "We need to construct a new Sensor Tower to scan the nearby environment."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011800, group = "Tutorial", id = "Tutorial2_Popup8_GoToOverview", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_GoToOverview.tga", no_ccc_button = true, start_minimized = false, text = T(9287, --[[PopupNotificationPreset Tutorial2_Popup8_GoToOverview text]] "You can scan new sectors to discover more resource deposits and Anomalies. This is done from the Map Overview.\n\n<goal>Go to the Map Overview."), title = T(5422, --[[PopupNotificationPreset Tutorial2_Popup8_GoToOverview title]] "Exploration"), voiced_text = T(9286, --[[voice:narrator]] "It is time to learn about scanning sectors and exploration."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1011900, group = "Tutorial", id = "Tutorial2_Popup9_Exploration", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_Exploration.tga", no_ccc_button = true, start_minimized = false, text = T(9289, --[[PopupNotificationPreset Tutorial2_Popup9_Exploration text]] "There are two main ways to scan - one is to queue sectors for scanning. These sectors will be scanned one by one gradually over time. Sensor Towers speed up the scanning process of sectors near them.\n\nThe other way is to use Probes which you can buy using funding and bring on resupply Rockets from Earth.\n\n<goal>Use a Probe to explore a sector."), title = T(5422, --[[PopupNotificationPreset Tutorial2_Popup9_Exploration title]] "Exploration"), voiced_text = T(9288, --[[voice:narrator]] "You can scan sectors of the map to discover new resources and Anomalies."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012000, group = "Tutorial", id = "Tutorial2_Popup11_AnalyzeAnomaly", image = "UI/Messages/Tutorials/Tutorial2/Tutorial2_AnalyzeAnomaly.tga", no_ccc_button = true, start_minimized = false, text = T(9293, --[[PopupNotificationPreset Tutorial2_Popup11_AnalyzeAnomaly text]] 'Select the RC Explorer and use the "Move/Interact" action to order it to analyze the Anomaly. This will take a while, so consider increasing the game speed to fastest.\n\n<goal>Use the RC Explorer to analyze the Anomaly.'), title = T(3984, --[[PopupNotificationPreset Tutorial2_Popup11_AnalyzeAnomaly title]] "Anomalies"), voiced_text = T(9292, --[[voice:narrator]] "Well done! Now it's time to use our fully operational RC Explorer to analyze the Anomaly."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012100, group = "Tutorial", id = "Tutorial2_Popup12_OpenResearch", image = "UI/Messages/research.tga", no_ccc_button = true, start_minimized = false, text = T(9295, --[[PopupNotificationPreset Tutorial2_Popup12_OpenResearch text]] "Researching new technologies unlocks new options for the colony such as new Buildings, Domes and Upgrades.\n\nAnomalies often provide bonuses to research, such as unlocking new technologies for research or providing Research Points.\n\n<goal>Open the Research Screen."), title = T(311, --[[PopupNotificationPreset Tutorial2_Popup12_OpenResearch title]] "Research"), voiced_text = T(9294, --[[voice:narrator]] "The Anomaly has yielded interesting insights into new technologies."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012200, group = "Tutorial", id = "Tutorial2_Popup13_Research", image = "UI/Messages/hints.tga", no_ccc_button = true, start_minimized = false, text = T(9297, --[[PopupNotificationPreset Tutorial2_Popup13_Research text]] "Techs are divided into five basic fields and a field for special breakthrough Techs. When you research a Tech from a given basic field you will unlock a new tech in that field. Breakthrough techs are special unique techs that are unlocked via Anomalies.\n\n<goal>Queue at least one technology for research."), title = T(311, --[[PopupNotificationPreset Tutorial2_Popup13_Research title]] "Research"), voiced_text = T(9296, --[[voice:narrator]] "This is the Research screen. From here you can choose and queue techs for Research."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012300, group = "Tutorial", id = "Tutorial2_Popup13_1_Research2", image = "UI/Messages/research.tga", no_ccc_button = true, start_minimized = false, text = T(9756, --[[PopupNotificationPreset Tutorial2_Popup13_1_Research2 text]] "Each tech has a cost in Research Points which are generated in various ways. Your sponsor provides some Research Points to start with. Once colonists arrive you will be able to construct Research Labs which generate Research Points faster.\n\nYou can view a breakdown of the Research Points generated per Sol on the right side of the Research screen.\n\n<goal>Close the Research screen to complete this tutorial. "), title = T(9755, --[[PopupNotificationPreset Tutorial2_Popup13_1_Research2 title]] "Research Points"), voiced_text = T(9429, --[[voice:narrator]] "Commander, one other thing."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012400, choice1 = T(9300, --[[PopupNotificationPreset Tutorial2_Popup14_Epilogue choice1]] 'Play Next Tutorial - "Power, Water & Maintenance"'), choice2 = T(1010, --[[PopupNotificationPreset Tutorial2_Popup14_Epilogue choice2]] "Main Menu"), group = "Tutorial", id = "Tutorial2_Popup14_Epilogue", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(9299, --[[PopupNotificationPreset Tutorial2_Popup14_Epilogue text]] "In this tutorial you learned how to command and use the different Rover vehicles at your disposal as well as how to scan sectors and how to research new technologies."), title = T(9265, --[[PopupNotificationPreset Tutorial2_Popup14_Epilogue title]] "Mission Complete!"), voiced_text = T(9298, --[[voice:narrator]] "Nice work! Now you know how to handle Rovers."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012500, group = "Tutorial", id = "Tutorial3_Popup1_Intro", image = "UI/Messages/outsource.tga", no_ccc_button = true, start_minimized = false, text = T(9303, --[[PopupNotificationPreset Tutorial3_Popup1_Intro text]] "Now it is your job to fix it up and prepare it for the first Colonists.\n\nIn this tutorial you will learn how to handle Power, Life Support grids and Building maintenance as well as how to construct your first Dome."), title = T(9301, --[[PopupNotificationPreset Tutorial3_Popup1_Intro title]] "The Aftermath"), voiced_text = T(9302, --[[voice:narrator]] "Welcome Commander! It looks like this forward base has gone through a major dust storm. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012600, group = "Tutorial", id = "Tutorial3_Popup2_SalvageBuilding", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_SalvageBuilding.tga", no_ccc_button = true, start_minimized = false, text = T(9306, --[[PopupNotificationPreset Tutorial3_Popup2_SalvageBuilding text]] "This Concrete Extractor has depleted its deposit and will be of no use now. We can salvage some construction materials from it.\n\n<goal>Salvage the Concrete Extractor."), title = T(9304, --[[PopupNotificationPreset Tutorial3_Popup2_SalvageBuilding title]] "Salvaging Buildings"), voiced_text = T(9305, --[[voice:narrator]] "First things first! Let's remove some unnecessary structures."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012700, group = "Tutorial", id = "Tutorial3_Popup3_PowerDroneHub", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_PowerDroneHub.tga", no_ccc_button = true, start_minimized = false, text = T(9309, --[[PopupNotificationPreset Tutorial3_Popup3_PowerDroneHub text]] "We need to supply the Drone Hub with Power. The resources from the salvaged Concrete Extractor should be enough to construct a Solar Panel. It would be best to use the existing Power Cables to connect the two buildings and avoid wasting more Metals on Cables.\n\n<goal>Power the Drone Hub with the help of a Solar Panel."), title = T(9307, --[[PopupNotificationPreset Tutorial3_Popup3_PowerDroneHub title]] "Powering The Drone Hub"), voiced_text = T(9308, --[[voice:narrator]] "Now let's get that Drone Hub operational."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012800, group = "Tutorial", id = "Tutorial3_Popup4_Priority", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_Priority.tga", no_ccc_button = true, start_minimized = false, text = T(9312, --[[PopupNotificationPreset Tutorial3_Popup4_Priority text]] "You can change the Priority of buildings manually. Buildings on higher Priority get Power, Maintenance and workers first. \n\n<goal>Set the Drone Hub to High Priority."), title = T(9310, --[[PopupNotificationPreset Tutorial3_Popup4_Priority title]] "Building Priority"), voiced_text = T(9311, --[[voice:narrator]] "We have some Power but it's not enough. We should prioritize the Drone Hub."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1012900, group = "Tutorial", id = "Tutorial3_Popup5_WindTurbine", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_WindTurbine.tga", no_ccc_button = true, start_minimized = false, text = T(9314, --[[PopupNotificationPreset Tutorial3_Popup5_WindTurbine text]] "Wind Turbines are a good alternative to Solar Panels as they operate day and night. They also get bonus Power production if built on high ground. However Wind Turbines have high upkeep cost and require maintenance more often than Solar Panels.\n\n<goal>Construct a Wind Turbine and connect it to the existing Power network."), title = T(5316, --[[PopupNotificationPreset Tutorial3_Popup5_WindTurbine title]] "Wind Turbines"), voiced_text = T(9313, --[[voice:narrator]] "We can use the Machine Parts left from the Concrete Extractor to build a Wind Turbine."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013000, group = "Tutorial", id = "Tutorial3_Popup6_NightShifts", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_NightShifts.tga", no_ccc_button = true, start_minimized = false, text = T(9316, --[[PopupNotificationPreset Tutorial3_Popup6_NightShifts text]] "Solar Panels provide power only during the day and we don't have Accumulators to compensate at night. You can set some of the base buildings to automatically turn off at night using the building's shifts. \n\nThere are three shifts - First Shift, Second Shift and Night Shift. Buildings will require Power, Resources and workers only during their active shifts.\n\n<goal>Disable the Night Shifts of the Moisture Vaporator and Fuel Refinery."), title = T(9137, --[[PopupNotificationPreset Tutorial3_Popup6_NightShifts title]] "Shifts & Power Management"), voiced_text = T(9315, --[[voice:narrator]] "Even with the Wind Turbine there won't be enough electricity to power the base, especially during the night."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013100, group = "Tutorial", id = "Tutorial3_Popup7_Maintenance", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_Maintenance.tga", no_ccc_button = true, start_minimized = false, text = T(9318, --[[PopupNotificationPreset Tutorial3_Popup7_Maintenance text]] "Buildings require maintenance with Resources roughly every 6 or 7 Sols. Buildings that don't get maintenance break and won't function until repaired.\n\nTo showcase this we have simulated a breakdown of your Solar Panel. Drones will automatically repair this breakdown provided that there are Metals in range of their controller.\n\n<goal>Examine the broken down Solar Panel."), title = T(619281504128, --[[PopupNotificationPreset Tutorial3_Popup7_Maintenance title]] "Maintenance"), voiced_text = T(9317, --[[voice:narrator]] "You managed to get things operational, but this won't last as buildings require maintenance and we are out of Resources."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013200, group = "Tutorial", id = "Tutorial3_Popup8_MoreMetals", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_MoreMetals.tga", no_ccc_button = true, start_minimized = false, text = T(9320, --[[PopupNotificationPreset Tutorial3_Popup8_MoreMetals text]] "The RC Transport can mine surface Metal deposits. Use it to gather 20-30 Metals and bring them back to the base. \n\nYou can then use these Metals to setup additional Solar Panels and power up everything.\n\n<goal>Deliver at least 20 Metals to the base with the help of the RC Transport."), title = T(9096, --[[PopupNotificationPreset Tutorial3_Popup8_MoreMetals title]] "RC Transport - Gathering Metals"), voiced_text = T(9319, --[[voice:narrator]] "We need more Metals to secure this base. Use the RC Transport to collect some Metals and transport them back."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013300, group = "Tutorial", id = "Tutorial3_Popup9_AdvancedResources", image = "UI/Messages/universal_depot.tga", no_ccc_button = true, start_minimized = false, text = T(9323, --[[PopupNotificationPreset Tutorial3_Popup9_AdvancedResources text]] "Using Rockets to resupply from Earth is the best way to secure Resources early on. You'll need funding to buy the Resources but your sponsor usually will provide you with enough to get a basic colony up and running.\n\n<goal>Open the Resupply screen and order Advanced resources from Earth."), title = T(9321, --[[PopupNotificationPreset Tutorial3_Popup9_AdvancedResources title]] "Advanced Resources and Resupply"), voiced_text = T(9322, --[[voice:narrator]] "Good job! However we need more than just Metals. Fortunately we can call a resupply Rocket from Earth."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013400, group = "Tutorial", id = "Tutorial3_Popup10_ClearingBuildings", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_ClearingBuildings.tga", no_ccc_button = true, start_minimized = false, text = T(9325, --[[PopupNotificationPreset Tutorial3_Popup10_ClearingBuildings text]] "The remains of destroyed or salvaged Buildings will obstruct other constructions. To clear such ruins you'll need to research the \"Decommission Protocol\" technology in the Engineering field. For the purposes of this simulation we have provided you with the tech.\n\n<goal>Clear the ruins of the Concrete Extractor."), title = T(9147, --[[PopupNotificationPreset Tutorial3_Popup10_ClearingBuildings title]] "Clearing Buildings"), voiced_text = T(9324, --[[voice:narrator]] "Let's do some cleaning up around the base while we wait for the Rocket to arrive."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013500, group = "Tutorial", id = "Tutorial3_Popup11_DeletingCables", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_DeletingCables.tga", no_ccc_button = true, start_minimized = false, text = T(9328, --[[PopupNotificationPreset Tutorial3_Popup11_DeletingCables text]] "You can use the Salvage tools in the Build Menu to remove Cables and Pipes, as well as an alternative way to salvage Buildings.\n\n<goal>Remove the Cables that were connected to the Concrete Extractor."), title = T(9326, --[[PopupNotificationPreset Tutorial3_Popup11_DeletingCables title]] "Deleting Cables & Pipes"), voiced_text = T(9327, --[[voice:narrator]] "Now let's remove some of the unnecessary Cables."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013600, group = "Tutorial", id = "Tutorial3_Popup12_Battery", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_Battery.tga", no_ccc_button = true, start_minimized = false, text = T(9330, --[[PopupNotificationPreset Tutorial3_Popup12_Battery text]] "Let's start with a Power Accumulator - it allows you to store power for nighttime or emergencies. Keep in mind that accumulators have a capped maximum output so a single one may not be enough to power all Buildings at night.\n\n<goal>Construct a Power Accumulator and connect it to the Power grid.\n\n<hint>You may want to construct some additional Solar Panels and Wind Turbines in advance to sustain the base expansion."), title = T(5206, --[[PopupNotificationPreset Tutorial3_Popup12_Battery title]] "Power Accumulators"), voiced_text = T(9329, --[[voice:narrator]] "The supplies from Earth have arrived and we can use them to expand the base."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013700, group = "Tutorial", id = "Tutorial3_Popup13_WaterExtractor", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_WaterExtractor.tga", no_ccc_button = true, start_minimized = false, text = T(9333, --[[PopupNotificationPreset Tutorial3_Popup13_WaterExtractor text]] "Let us build a Water Extractor near the deposit. All Extractors must be placed near a deposit of the corresponding type. Remember to then connect it with Power. You may also have to build more Power producers to generate the required Power.\n\n<goal>Construct and power a Water Extractor."), title = T(9331, --[[PopupNotificationPreset Tutorial3_Popup13_WaterExtractor title]] "Extracting Water"), voiced_text = T(9332, --[[voice:narrator]] "Water is essential for a sustainable Martian colony. Fortunately there is a Water deposit nearby."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013800, group = "Tutorial", id = "Tutorial3_Popup14_WaterTower", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_WaterTower.tga", no_ccc_button = true, start_minimized = false, text = T(9335, --[[PopupNotificationPreset Tutorial3_Popup14_WaterTower text]] "We will need Water for Domes, Farming and Polymer production but for now we don't have any of that so we can store some water in a Water Tower. Storages are important safety measures for your colony as they will provide Water, Oxygen or Power in the case of a producer breaking down or ceasing operation during a disaster.\n\n<goal>Construct a Water Tower and connect it to the Water Extractor with Pipes."), title = T(956519352717, --[[PopupNotificationPreset Tutorial3_Popup14_WaterTower title]] "Water Storage"), voiced_text = T(9334, --[[voice:narrator]] "The Water Extractor is ready but we don't have a storage for the Water it will extract."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1013900, group = "Tutorial", id = "Tutorial3_Popup15_Dome", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_Dome.tga", no_ccc_button = true, start_minimized = false, text = T(9337, --[[PopupNotificationPreset Tutorial3_Popup15_Dome text]] "Domes are large superstructures that house Colonists. You can construct many buildings inside Domes. Some of them will require Colonists as workforce. Domes have limited space but can be connected via Passages to form larger systems.\n\nRemember to use the RC Transport to mine Metals and to call resupply Rockets if you need Advanced resources to finish the Dome.\n\n<goal>Construct a Basic Dome. This will take a long time so you might wish to speed things up with the speed controls."), title = T(83, --[[PopupNotificationPreset Tutorial3_Popup15_Dome title]] "Domes"), voiced_text = T(9336, --[[voice:narrator]] "The time has finally come to build the first Dome that will house our Colonists."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014000, group = "Tutorial", id = "Tutorial3_Popup16_DomeSupply", image = "UI/Messages/Tutorials/Tutorial3/Tutorial3_DomeSupply.tga", no_ccc_button = true, start_minimized = false, text = T(9340, --[[PopupNotificationPreset Tutorial3_Popup16_DomeSupply text]] "Domes require life-support. Namely Water, Power and Oxygen. Connect the Dome to the existing Power and Water infrastructure. You may need to build additional Power producers.\n\nFor Oxygen you will need to construct a MOXIE - a device that extracts Oxygen from the carbon dioxide in the Martian atmosphere. Once the MOXIE is ready and powered up connect it to the Dome with Pipes. It may be wise to build an Oxygen Storage as well.\n\n<goal>Provide Water, Power and Oxygen to the Dome."), title = T(9338, --[[PopupNotificationPreset Tutorial3_Popup16_DomeSupply title]] "Domes - Water, Power and Oxygen"), voiced_text = T(9339, --[[voice:narrator]] "The Dome is complete but we have to supply it with Water, Power and Oxygen before we can use it."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014100, choice1 = T(9343, --[[PopupNotificationPreset Tutorial3_Popup17_Epilogue choice1]] 'Play Next Tutorial - "Colonists"'), choice2 = T(1010, --[[PopupNotificationPreset Tutorial3_Popup17_Epilogue choice2]] "Main Menu"), group = "Tutorial", id = "Tutorial3_Popup17_Epilogue", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(9342, --[[PopupNotificationPreset Tutorial3_Popup17_Epilogue text]] "You have learned how to handle Power, Water and Oxygen, as well as how building maintenance works. You are ready to setup a basic colony, ready to accept the first human pioneers on Mars.\n\nThe next tutorial deals with Colonists and their needs. You can continue to it now or simply start a new game and return later when you are ready to learn more."), title = T(9265, --[[PopupNotificationPreset Tutorial3_Popup17_Epilogue title]] "Mission Complete!"), voiced_text = T(9341, --[[voice:narrator]] "Well done! You have completed the simulation successfully."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014200, group = "Tutorial", id = "Tutorial4_Popup1_Intro", image = "UI/Messages/outsource.tga", no_ccc_button = true, start_minimized = false, text = T(9346, --[[PopupNotificationPreset Tutorial4_Popup1_Intro text]] "Everything done beforehand was a prelude to this very moment – the arrival of The Founders. \n\nOur first Colonists are called Founders. After they set foot on Mars, a trial period meant to test how humans fare on Mars will begin. No more Colonists will arrive from Earth until the Founder stage ends. Be careful, if all of your Colonists die during this period the mission will be terminated. \n\nBest of luck, Commander!"), title = T(9344, --[[PopupNotificationPreset Tutorial4_Popup1_Intro title]] "The Founders"), voiced_text = T(9345, --[[voice:narrator]] "Welcome back, Commander! In this tutorial you will finally familiarize yourself with the challenges of sustaining a society on Mars."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014300, group = "Tutorial", id = "Tutorial4_Popup2_Housing", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Housing.tga", no_ccc_button = true, start_minimized = false, text = T(9349, --[[PopupNotificationPreset Tutorial4_Popup2_Housing text]] "Living Complexes are built inside the Dome. The space within the Dome is limited, so each building has to be carefully planned.\n\n<goal>Construct a Living Complex at the indicated location."), title = T(9347, --[[PopupNotificationPreset Tutorial4_Popup2_Housing title]] "Housing"), voiced_text = T(9348, --[[voice:narrator]] "The foundations for bringing your first Colonists have already been laid down. One of the final things left to do is to provide the Founders with living space."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014400, group = "Tutorial", id = "Tutorial4_Popup3_Founders", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Founders.tga", no_ccc_button = true, start_minimized = false, text = T(9351, --[[PopupNotificationPreset Tutorial4_Popup3_Founders text]] "<goal>Order a Passenger Rocket from the Resupply screen."), title = T(1116, --[[PopupNotificationPreset Tutorial4_Popup3_Founders title]] "Passenger Rocket"), voiced_text = T(9350, --[[voice:narrator]] "With all preparations complete, the Colony is ready for the arrival of the Founders."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014500, group = "Tutorial", id = "Tutorial4_PopUp4_FilterUI", image = "UI/Messages/research.tga", no_ccc_button = true, start_minimized = false, text = T(9354, --[[PopupNotificationPreset Tutorial4_PopUp4_FilterUI text]] "Colonists are organized by their age, specialization and various traits. You can set desired and undesired traits in every category using the Thumbs Up and Thumbs Down icons.\n\nColonists with MORE of the desired traits will board the Rocket while colonists with ANY undesired traits will be rejected."), title = T(9352, --[[PopupNotificationPreset Tutorial4_PopUp4_FilterUI title]] "Applicants Filter"), voiced_text = T(9353, --[[voice:narrator]] "From this screen you can inspect all available applicants and determine which ones will travel to the Colony."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014600, group = "Tutorial", id = "Tutorial4_PopUp5_ReviewUI", image = "UI/Messages/colonists.tga", no_ccc_button = true, start_minimized = false, text = T(9356, --[[PopupNotificationPreset Tutorial4_PopUp5_ReviewUI text]] "By highlighting individual applicants one by one you can review their Perks and Flaws. It may be a good idea to do this for the Founders in order to get an exact number of specialists you desire as well as hand pick the traits of these Colonists. "), title = T(4071, --[[PopupNotificationPreset Tutorial4_PopUp5_ReviewUI title]] "Review Applicants"), voiced_text = T(9355, --[[voice:narrator]] "You may want to review and hand pick individual candidates for the Founders."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014700, group = "Tutorial", id = "Tutorial4_PopUp6_Food", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Food.tga", no_ccc_button = true, start_minimized = false, text = T(9358, --[[PopupNotificationPreset Tutorial4_PopUp6_Food text]] "<goal>Construct a Hydroponic Farm and a Grocer inside your Dome."), title = T(1022, --[[PopupNotificationPreset Tutorial4_PopUp6_Food title]] "Food"), voiced_text = T(9357, --[[voice:narrator]] "Colonists will arrive on Mars with a small amount of Food, but it will not last long. We need to make sure that they will be able to produce their own Food on the red planet. The Hydroponic Farm can produce Food. Although the Colonists can take Food directly from a Food Depot, they will be happier if they can pick it up from a Grocer."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014800, group = "Tutorial", id = "Tutorial4_PopUp7_Services", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Services.tga", no_ccc_button = true, start_minimized = false, text = T(9360, --[[PopupNotificationPreset Tutorial4_PopUp7_Services text]] "Different services satisfy different interests colonists may have. A colonist will feel more comfortable inside a Dome which has his interests covered but you don't need to cover every interest and in smaller Dome this might not be even possible.\n\nIf the comfort of colonists falls too low they may become Earthsick and decide to leave Mars and go back to Earth. However, Martianborn colonists will never get Earthsick.\n\n<goal>Construct a Spacebar inside the Dome."), title = T(5439, --[[PopupNotificationPreset Tutorial4_PopUp7_Services title]] "Service Buildings"), voiced_text = T(9359, --[[voice:narrator]] "Colonists need service buildings to keep them comfortable on Mars. The Grocer that you already constructed is one such service building."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1014900, group = "Tutorial", id = "Tutorial4_PopUp8_ManagingJobs", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_ManagingJobs.tga", no_ccc_button = true, start_minimized = false, text = T(9362, --[[PopupNotificationPreset Tutorial4_PopUp8_ManagingJobs text]] "The Founders that just arrived have taken available jobs automatically, but you can customize their work assignments.\n\nWith the building selected, notice the three available work shifts on the info panel. Two of them are active, with two workers employed at each shift.\n\nThe more workers assigned to a building, the better the building performes. Initially, however, we won’t be needing so many people working at the Space Bar as there will be other important jobs to fill and limited people to fill them – especially during the Founder Stage.\n\n<goal>Disable one job slot in every active shift."), title = T(9177, --[[PopupNotificationPreset Tutorial4_PopUp8_ManagingJobs title]] "Managing Jobs"), voiced_text = T(9361, --[[voice:narrator]] "Great! Now that you have a Spacebar you can customize its work settings."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015000, group = "Tutorial", id = "Tutorial4_PopUp9_Research", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Research.tga", no_ccc_button = true, start_minimized = false, text = T(9365, --[[PopupNotificationPreset Tutorial4_PopUp9_Research text]] "Some buildings are more effective with workers with a certain specialization. For example, Scientists are the best workers for a Research Lab.\n\n<goal>Construct a Research Lab inside the Dome."), title = T(9363, --[[PopupNotificationPreset Tutorial4_PopUp9_Research title]] "Colonist Specializations "), voiced_text = T(9364, --[[voice:narrator]] "Healthy colonists at working age are able to fill any position but how well they perform at a certain position varies between colonists. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015100, group = "Tutorial", id = "Tutorial4_PopUp10_Shifts", image = "UI/Messages/emergency.tga", no_ccc_button = true, start_minimized = false, text = T(9367, --[[PopupNotificationPreset Tutorial4_PopUp10_Shifts text]] "Colonists don't like to work at night and will lose Sanity while doing so. Furthermore, you may activate the Heavy Workload option which boosts the performance of a building during that shift but inflicts Sanity and Health problems on the workers due to the increased stress at their job.\n\n<goal> With the Research Lab selected, activate the second Work Shift."), title = T(217, --[[PopupNotificationPreset Tutorial4_PopUp10_Shifts title]] "Work Shifts"), voiced_text = T(9366, --[[voice:narrator]] "Work Shifts, among other things, are a way to manage your work force. The more shifts a building has open the more colonists it will attract to work there. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015200, group = "Tutorial", id = "Tutorial4_PopUp11_HightPriority", image = "UI/Messages/research_lab.tga", no_ccc_button = true, start_minimized = false, text = T(9369, --[[PopupNotificationPreset Tutorial4_PopUp11_HightPriority text]] "On-site research is very important for the long-term prosperity and survival of your colony, so let us prioritize it!\n\n<goal>Set the priority of the Research Lab to High."), title = T(9310, --[[PopupNotificationPreset Tutorial4_PopUp11_HightPriority title]] "Building Priority"), voiced_text = T(9368, --[[voice:narrator]] "Buildings with higher priority will be allocated workers, Power and Maintenance before others. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015300, group = "Tutorial", id = "Tutorial4_PopUp12_Research_2", image = "UI/Messages/hints.tga", no_ccc_button = true, start_minimized = false, text = T(9371, --[[PopupNotificationPreset Tutorial4_PopUp12_Research_2 text]] "<goal>From the Research screen, queue at least three of the available technologies. "), title = T(311, --[[PopupNotificationPreset Tutorial4_PopUp12_Research_2 title]] "Research"), voiced_text = T(9370, --[[voice:narrator]] "With the Research Lab up and running let's begin researching some technologies."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015400, group = "Tutorial", id = "Tutorial4_PopUp13_FounderStage", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Founders.tga", no_ccc_button = true, start_minimized = false, text = T(9374, --[[PopupNotificationPreset Tutorial4_PopUp13_FounderStage text]] "The Founder Stage takes ten Sols to complete. Be careful, if all of your colonists die during this period the mission will be terminated. \n\nHaving a baby born on Mars before the end of this period will also complete the Founder Stage. This can happen if the comfort of your Colonists is very high."), title = T(9372, --[[PopupNotificationPreset Tutorial4_PopUp13_FounderStage title]] "The Founder Stage"), voiced_text = T(9373, --[[voice:narrator]] "Congratulations! You have provided everything needed for a successful Founder Stage."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015500, group = "Tutorial", id = "Tutorial4_PopUp13_FounderStage_2", image = "UI/Messages/Tutorials/Tutorial4/Tutorial4_Founders.tga", no_ccc_button = true, start_minimized = false, text = T(9377, --[[PopupNotificationPreset Tutorial4_PopUp13_FounderStage_2 text]] "Normally the Founder Stage takes ten Sols to complete, but you have performed beyond expectations as the first born Martian baby proves. The founder stage is now over and you are free to invite more colonists to Mars. "), title = T(9375, --[[PopupNotificationPreset Tutorial4_PopUp13_FounderStage_2 title]] "The First Baby"), voiced_text = T(9376, --[[voice:narrator]] "Congratulations! A baby has been born on Mars and the Founder stage is completed!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015600, choice1 = T(9380, --[[PopupNotificationPreset Tutorial4_PopUp14_Epilogue choice1]] 'Play Next Tutorial - "Multiple Domes"'), choice2 = T(1010, --[[PopupNotificationPreset Tutorial4_PopUp14_Epilogue choice2]] "Main Menu"), group = "Tutorial", id = "Tutorial4_PopUp14_Epilogue", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(9379, --[[PopupNotificationPreset Tutorial4_PopUp14_Epilogue text]] "The Founder Stage takes ten Sols to complete normally, but for the purposes of this tutorial it has already been completed.\n\nIn the next and final tutorial you will learn how to manage a larger colony, consisting of multiple Domes."), title = T(9265, --[[PopupNotificationPreset Tutorial4_PopUp14_Epilogue title]] "Mission Complete!"), voiced_text = T(9378, --[[voice:narrator]] "You have completed the tutorial for the Founder Stage."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015700, group = "Tutorial", id = "Tutorial5_Popup1_Intro", image = "UI/Messages/outsource.tga", no_ccc_button = true, start_minimized = false, text = T(9383, --[[PopupNotificationPreset Tutorial5_Popup1_Intro text]] "As you expand your base and try to obtain various resources scattered across the map you will inevitably end up with a colony that consists of several Domes. This tutorial will introduce you to a lot of the typical situations that you can expect to come up in a big colony."), title = T(9381, --[[PopupNotificationPreset Tutorial5_Popup1_Intro title]] "Multiple Domes Tutorial"), voiced_text = T(9382, --[[voice:narrator]] "Welcome back, Commander! In this tutorial you will manage a larger colony that consists of multiple Domes."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015800, group = "Tutorial", id = "Tutorial5_Popup2_Shuttles", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup2_Shuttles.tga", no_ccc_button = true, start_minimized = false, text = T(9385, --[[PopupNotificationPreset Tutorial5_Popup2_Shuttles text]] "The complex technology needed for Shuttles flying in the thin Martian atmosphere typically must be researched. For the purposes of this tutorial, however, it has been already granted to you.\n\n<goal>Construct a Shuttle Hub."), title = T(745, --[[PopupNotificationPreset Tutorial5_Popup2_Shuttles title]] "Shuttles"), voiced_text = T(9384, --[[voice:narrator]] "Shuttles can transport resources and colonists across great distances. "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1015900, group = "Tutorial", id = "Tutorial5_Popup3_Mining", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup3_Mining.tga", no_ccc_button = true, start_minimized = false, text = T(9388, --[[PopupNotificationPreset Tutorial5_Popup3_Mining text]] "Colonists can work in some outside buildings placed close to their Domes - such as extractors for Metals and Rare Metals. Since colonists will be needed for the extraction of these underground deposits, it is a good practice to place Domes near such deposits, as is the case in this simulation.\n\n<goal>Construct a Rare Metals Extractor next to the Rare Metals Deposit and connect it to the power grid."), title = T(9386, --[[PopupNotificationPreset Tutorial5_Popup3_Mining title]] "Workplaces Outside the Domes"), voiced_text = T(9387, --[[voice:narrator]] "Now that we have operational Shuttles it's time to establish a mining Dome."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016000, group = "Tutorial", id = "Tutorial5_Popup4_Housing", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup4_Housing.tga", no_ccc_button = true, start_minimized = false, text = T(9390, --[[PopupNotificationPreset Tutorial5_Popup4_Housing text]] "Once you have provided a Dome with living space, colonists from other Domes will be able to resettle in it, provided it is within walkable distance or there are available Shuttles to fly them there.\n\n<goal>Construct a Living Complex inside the mining Dome."), title = T(9347, --[[PopupNotificationPreset Tutorial5_Popup4_Housing title]] "Housing"), voiced_text = T(9389, --[[voice:narrator]] "There are no Colonists in the mining Dome. We must provide living space for the Colonists so they can move there."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016100, group = "Tutorial", id = "Tutorial5_Popup5_FilterUI", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup5_FilterUI.tga", no_ccc_button = true, start_minimized = false, text = T(9393, --[[PopupNotificationPreset Tutorial5_Popup5_FilterUI text]] "<goal>Select a Dome and open the Filter Screen from its Info Panel."), title = T(9391, --[[PopupNotificationPreset Tutorial5_Popup5_FilterUI title]] "Filter Colonists"), voiced_text = T(9392, --[[voice:narrator]] "You can setup filters for every Dome to attract colonists with desired traits and block or push out colonists with undesired ones."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016200, group = "Tutorial", id = "Tutorial5_Popup6_FilterUI_2_Research", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup6_FilterUI_2_Research.tga", no_ccc_button = true, start_minimized = false, text = T(9396, --[[PopupNotificationPreset Tutorial5_Popup6_FilterUI_2_Research text]] "And because we want to make sure that the mining Dome gets all the available Geologists (which are best suited for work inside extractor buildings) we will also ban Geologists from inhabiting this Dome.\n\n<goal> From the Specialization Category, activate the Thumbs Up icon for Scientists and the Thumbs Down one for Geologists."), title = T(9394, --[[PopupNotificationPreset Tutorial5_Popup6_FilterUI_2_Research title]] "Research Dome"), voiced_text = T(9395, --[[voice:narrator]] "This Dome has been designated for research purposes so it's best to attract more colonists with the Scientist specialization."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016300, group = "Tutorial", id = "Tutorial5_Popup7_FilterUI_3_Mining", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup6_FilterUI_2_Research.tga", no_ccc_button = true, start_minimized = false, text = T(9399, --[[PopupNotificationPreset Tutorial5_Popup7_FilterUI_3_Mining text]] "And because we want to make sure that the research Dome gets all the available Scientists we will also ban Scientists from inhabiting this Dome.\n\n<goal> From the Specialization Category, activate the Thumbs Up icon for Geologists and the Thumbs Down one for Scientists."), title = T(9397, --[[PopupNotificationPreset Tutorial5_Popup7_FilterUI_3_Mining title]] "Mining Dome"), voiced_text = T(9398, --[[voice:narrator]] "Being near a Rare Metals Deposit, this Dome is best suited as a mining hub so it's best to encourage Geologists to migrate here."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016400, group = "Tutorial", id = "Tutorial5_Popup8_NewDome", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup8_NewDome.tga", no_ccc_button = true, start_minimized = false, text = T(9402, --[[PopupNotificationPreset Tutorial5_Popup8_NewDome text]] "To demonstrate Dome connections, let's first build a new Dome near our research Dome.\n\n<goal>Construct a Dome at the indicated location."), title = T(9400, --[[PopupNotificationPreset Tutorial5_Popup8_NewDome title]] "Third Dome"), voiced_text = T(9401, --[[voice:narrator]] "Colonists can migrate between Domes using shuttles or walking when they are positioned close to one another. However, they cannot usually visit buildings in nearby Domes on a daily basis, unless they are connected to their own Dome."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016500, group = "Tutorial", id = "Tutorial5_Popup9_Passages", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup9_Passages.tga", no_ccc_button = true, start_minimized = false, text = T(9404, --[[PopupNotificationPreset Tutorial5_Popup9_Passages text]] "Passages allow colonists to travel safely to Domes directly connected to their own, seeking work or services there.\n\n<goal>Connect the Research Dome and the newly constructed dome with a Passage."), title = T(8776, --[[PopupNotificationPreset Tutorial5_Popup9_Passages title]] "Passages"), voiced_text = T(9403, --[[voice:narrator]] "Domes positioned closely to each other may be connected with Passages."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016600, group = "Tutorial", id = "Tutorial5_Popup10_Passages_2", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup9_Passages.tga", no_ccc_button = true, start_minimized = false, text = T(9406, --[[PopupNotificationPreset Tutorial5_Popup10_Passages_2 text]] "Now that the two Domes are connected, colonists from the first can start working on the newly built farms in the third Dome. The Passage will also connect the two Domes for the purposes of distributing Power, Water and Oxygen."), title = T(8776, --[[PopupNotificationPreset Tutorial5_Popup10_Passages_2 title]] "Passages"), voiced_text = T(9405, --[[voice:narrator]] "Good job!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016700, group = "Tutorial", id = "Tutorial5_Popup11_Upgrades", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup11_Upgrades.tga", no_ccc_button = true, start_minimized = false, text = T(9409, --[[PopupNotificationPreset Tutorial5_Popup11_Upgrades text]] "All upgrades become available after specific technologies are researched and have construction costs. Furthermore, some upgrades will increase the resource consumption of the building.\n\n<goal>Research the Extractor Amplification tech from the Research screen."), title = T(9407, --[[PopupNotificationPreset Tutorial5_Popup11_Upgrades title]] "Upgrades"), voiced_text = T(9408, --[[voice:narrator]] "Some buildings can have upgrades that can improve them in various ways."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016800, group = "Tutorial", id = "Tutorial5_Popup12_Upgrades_2", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup12_Upgrades_2.tga", no_ccc_button = true, start_minimized = false, text = T(9412, --[[PopupNotificationPreset Tutorial5_Popup12_Upgrades_2 text]] "<goal>Select the Water Extractor and then select the indicated Upgrade Icon."), title = T(9410, --[[PopupNotificationPreset Tutorial5_Popup12_Upgrades_2 title]] "Upgrades "), voiced_text = T(9411, --[[voice:narrator]] "Congratulations - with the research complete, a new upgrade for your Extractors is now available. It is not automatically activated in your buildings, you must construct it first."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1016900, group = "Tutorial", id = "Tutorial5_Popup13_Upgrades_3", image = "UI/Messages/Tutorials/Tutorial5/Tutorial5_Popup12_Upgrades_2.tga", no_ccc_button = true, start_minimized = false, text = T(9415, --[[PopupNotificationPreset Tutorial5_Popup13_Upgrades_3 text]] "Some Upgrades will consume more Power or Water while active. After an Upgrade has been constructed it may be turned On and Off from the same button that was used for its construction."), title = T(9413, --[[PopupNotificationPreset Tutorial5_Popup13_Upgrades_3 title]] "Upgrade Complete"), voiced_text = T(9414, --[[voice:narrator]] "The Upgrade has been constructed."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017000, group = "Tutorial", id = "Tutorial5_Popup14_CommandCenterUI", image = "UI/Messages/research.tga", no_ccc_button = true, start_minimized = false, text = T(9417, --[[PopupNotificationPreset Tutorial5_Popup14_CommandCenterUI text]] "It offers historical data for various colony metrics as well as overviews of Domes, Buildings, Colonists and transportation.\n\n<goal>Open the Command Center and try it out. "), title = T(137542936955, --[[PopupNotificationPreset Tutorial5_Popup14_CommandCenterUI title]] "Command Center"), voiced_text = T(9416, --[[voice:narrator]] "The Command Center is a treasure trove of information about the colony."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017100, choice1 = T(1010, --[[PopupNotificationPreset Tutorial5_Popup15_Epilogue choice1]] "Main Menu"), group = "Tutorial", id = "Tutorial5_Popup15_Epilogue", image = "UI/Messages/space.tga", no_ccc_button = true, start_minimized = false, text = T(9420, --[[PopupNotificationPreset Tutorial5_Popup15_Epilogue text]] "The team at Mission Control is eager to meet you and serve under your command. The challenge of conquering Mars for the sake of humankind is still a tough one, but with a Commander as skillful and resourceful as you the task seems a bit easier now.\n\nThe colonization of Mars awaits! Good luck, Commander, and may the Cosmos be with you!"), title = T(9418, --[[PopupNotificationPreset Tutorial5_Popup15_Epilogue title]] "Mission Complete"), voiced_text = T(9419, --[[voice:narrator]] "Congratulations, Commander! You have graduated from the International Mars Mission training simulation! "), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017200, choice1 = T(9423, --[[PopupNotificationPreset Tutorial_FirstTimePlayers choice1]] "Play the tutorials"), choice2 = T(9424, --[[PopupNotificationPreset Tutorial_FirstTimePlayers choice2]] "Skip the tutorials"), group = "Tutorial", id = "Tutorial_FirstTimePlayers", no_ccc_button = true, start_minimized = false, text = T(9422, --[[PopupNotificationPreset Tutorial_FirstTimePlayers text]] "Colonizing Mars is hard.<newline>Over 60% of all colonies fail even before a single human sets foot on the Red Planet.<newline>Several tutorials are available to familiarize you with Surviving Mars.<newline>Don't let the Red Planet defeat you! Play the tutorials."), title = T(9421, --[[PopupNotificationPreset Tutorial_FirstTimePlayers title]] "Tutorials Save Lives!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1017300, choice1 = T(9427, --[[PopupNotificationPreset Tutorial_ActiveMods choice1]] "Disable All Mods"), choice2 = T(9428, --[[PopupNotificationPreset Tutorial_ActiveMods choice2]] "Skip"), group = "Tutorial", id = "Tutorial_ActiveMods", no_ccc_button = true, start_minimized = false, text = T(9426, --[[PopupNotificationPreset Tutorial_ActiveMods text]] "You have active mods that may affect the tutorial in unexpected ways and result in an unplayable tutorial. We recommend disabling all mods before continuing."), title = T(9425, --[[PopupNotificationPreset Tutorial_ActiveMods title]] "Active Mods"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018100, group = "Placeholders", id = "Placeholder_1", voiced_text = T(9429, --[[voice:narrator]] "Commander, one other thing."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018200, group = "Placeholders", id = "Placeholder_2", voiced_text = T(9430, --[[voice:narrator]] "A new situation has arisen."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018300, group = "Placeholders", id = "Placeholder_3", voiced_text = T(9431, --[[voice:narrator]] "Commander, some interesting readings are just in."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018400, group = "Placeholders", id = "Placeholder_4", voiced_text = T(9432, --[[voice:narrator]] "On another note, Commander..."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018500, group = "Placeholders", id = "Placeholder_5", voiced_text = T(9433, --[[voice:narrator]] "Things just took a turn for the weird."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018600, group = "Placeholders", id = "Placeholder_6", voiced_text = T(9434, --[[voice:narrator]] "What just transpired has left us speechless."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018700, group = "Placeholders", id = "Placeholder_7", voiced_text = T(9435, --[[voice:narrator]] "Our Explorer just stumbled upon something fascinating."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018800, group = "Placeholders", id = "Placeholder_8", voiced_text = T(9436, --[[voice:narrator]] "Bad news, Commander!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1018900, group = "Placeholders", id = "Placeholder_9", voiced_text = T(9437, --[[voice:narrator]] "Commander, good news!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1019000, choice1 = T(10319, --[[PopupNotificationPreset Challenge_Failed choice1]] "Keep playing with this colony"), choice2 = T(10480, --[[PopupNotificationPreset Challenge_Failed choice2]] "Retry the challenge"), choice3 = T(10320, --[[PopupNotificationPreset Challenge_Failed choice3]] "Return to main menu"), group = "Challenge", id = "Challenge_Failed", start_minimized = false, text = T(10318, --[[PopupNotificationPreset Challenge_Failed text]] "We didn't manage to complete the <challenge_name> challenge within the <challenge_sols> Sols limit.\n\nAs a great man famously said, failure is not fatal, it is the courage to continue that counts. Let's take this opportunity to learn from our mistakes and try again."), title = T(10316, --[[PopupNotificationPreset Challenge_Failed title]] "Challenge Failed"), voiced_text = T(10317, --[[voice:narrator]] "Sadly, we have failed this challenge."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1019100, choice1 = T(1011, --[[PopupNotificationPreset Challenge_Welcome choice1]] "Close"), group = "Challenge", id = "Challenge_Welcome", start_minimized = false, text = T(10481, --[[PopupNotificationPreset Challenge_Welcome text]] "Our mission should focus on a single objective: <challenge_objective>.\n\nWe have to accomplish this goal within <challenge_deadline> Sols or only <perfect_deadline> Sols for a perfect completion."), title = T(10482, --[[PopupNotificationPreset Challenge_Welcome title]] "<challenge_name>"), voiced_text = T(5500, --[[voice:narrator]] "Welcome to Mars!"), }) PlaceObj('PopupNotificationPreset', { SortKey = 1019200, choice1 = T(10319, --[[PopupNotificationPreset Challenge_Completed choice1]] "Keep playing with this colony"), choice2 = T(10324, --[[PopupNotificationPreset Challenge_Completed choice2]] "Take a screenshot (overwrites any existing screenshot for this Challenge)"), choice3 = T(10320, --[[PopupNotificationPreset Challenge_Completed choice3]] "Return to main menu"), group = "Challenge", id = "Challenge_Completed", start_minimized = false, text = T(10323, --[[PopupNotificationPreset Challenge_Completed text]] "You have completed the <challenge_name> challenge for <elapsed_sols> Sols out of the <challenge_sols> Sols limit.\n\nThe score of our colony is <score>.\n\nIf you feel you can do even better, feel free to retry the challenge and complete the objective for under <perfected_sols> Sols for a perfect evaluation."), title = T(10321, --[[PopupNotificationPreset Challenge_Completed title]] "Challenge Completed"), voiced_text = T(10322, --[[voice:narrator]] "Good work, Commander! Your colony has passed the challenge."), }) PlaceObj('PopupNotificationPreset', { SortKey = 1019300, choice1 = T(10319, --[[PopupNotificationPreset Challenge_Perfected choice1]] "Keep playing with this colony"), choice2 = T(10324, --[[PopupNotificationPreset Challenge_Perfected choice2]] "Take a screenshot (overwrites any existing screenshot for this Challenge)"), choice3 = T(10320, --[[PopupNotificationPreset Challenge_Perfected choice3]] "Return to main menu"), group = "Challenge", id = "Challenge_Perfected", start_minimized = false, text = T(10327, --[[PopupNotificationPreset Challenge_Perfected text]] "You have perfected the <challenge_name> challenge for <elapsed_sols> Sols out of the <perfected_sols> Sols limit for perfect score.\n\nThe score of our colony is <score>."), title = T(10325, --[[PopupNotificationPreset Challenge_Perfected title]] "Challenge Perfected"), voiced_text = T(10326, --[[voice:narrator]] "Congratulations are in order, Commander! Your colony has passed the challenge with flying colors."), })
do local keys = {} for i=1,100 do keys[i] = "foo" end keys[95] = "__index" local function fidx(t, k) return 12345 end local mt = { foo = 1, __index = "" } local t = setmetatable({ 1 }, mt) t[1] = nil mt.__index = nil local x = nil for i=1,100 do mt[keys[i]] = fidx if t[1] then if not x then x = i end assert(t[1] == 12345) end end assert(x == 95) end
gavyn_sykes_missions = { { missionType = "assassinate", primarySpawns = { { npcTemplate = "zim_zam_blattis", npcName = "Zim Zam Blattis" } }, secondarySpawns = {}, itemSpawns = {}, rewards = { { rewardType = "credits", amount = 50 } } }, { missionType = "assassinate", primarySpawns = { { npcTemplate = "large_berzerk_ikopi", npcName = "Large Berzerk Ikopi" } }, secondarySpawns = {}, itemSpawns = {}, rewards = { { rewardType = "credits", amount = 100 }, } }, { missionType = "escort", primarySpawns = { { npcTemplate = "haf_mandrox", npcName = "Haf Mandrox" } }, secondarySpawns = { { npcTemplate = "gungan_thug", npcName = "Gungan Thug" }, { npcTemplate = "gungan_thug", npcName = "Gungan Thug" }, { npcTemplate = "gungan_thug", npcName = "Gungan Thug" } }, itemSpawns = {}, rewards = { { rewardType = "credits", amount = 150 } } }, { missionType = "assassinate", primarySpawns = { { npcTemplate = "gungan_leader", npcName = "Gungan Leader" } }, secondarySpawns = { { npcTemplate = "gungan_thug", npcName = "Gungan Thug" }, { npcTemplate = "gungan_thug", npcName = "Gungan Thug" }, { npcTemplate = "gungan_thug", npcName = "Gungan Thug" } }, itemSpawns = {}, rewards = { { rewardType = "credits", amount = 200 } } } } npcMapGavynSykes = { { spawnData = { npcTemplate = "gavyn_sykes", x = 8.5, z = 0.6, y = 66.7, direction = 110, cellID = 2125382, position = STAND }, worldPosition = { x = 1419.1, y = 2761.7 }, npcNumber = 1, stfFile = "@static_npc/naboo/gavyn_sykes", missions = gavyn_sykes_missions }, } GavynSykes = ThemeParkLogic:new { npcMap = npcMapGavynSykes, className = "GavynSykes", screenPlayState = "gavyn_sykes_task", planetName = "naboo", distance = 800, } registerScreenPlay("GavynSykes", true) gavyn_sykes_mission_giver_conv_handler = mission_giver_conv_handler:new { themePark = GavynSykes } gavyn_sykes_mission_target_conv_handler = mission_target_conv_handler:new { themePark = GavynSykes }
gg_rct_Spawn0 = nil gg_rct_Spawn1 = nil gg_rct_Check0 = nil gg_rct_Check1 = nil gg_rct_Check2 = nil gg_rct_Check3 = nil gg_rct_Check4 = nil gg_rct_Check5 = nil gg_rct_PlayArea = nil gg_rct_Spawn2 = nil gg_rct_Spawn3 = nil gg_rct_ClassSelection = nil gg_rct_ModShops = nil gg_trg_Untitled_Trigger_001 = nil gg_trg_Untitled_Trigger_002 = nil function InitGlobals() end function ItemTable000000_DropItems() local trigWidget = nil local trigUnit = nil local itemID = 0 local canDrop = true trigWidget = bj_lastDyingWidget if (trigWidget == nil) then trigUnit = GetTriggerUnit() end if (trigUnit ~= nil) then canDrop = not IsUnitHidden(trigUnit) if (canDrop and GetChangingUnit() ~= nil) then canDrop = (GetChangingUnitPrevOwner() == Player(PLAYER_NEUTRAL_AGGRESSIVE)) end end if (canDrop) then RandomDistReset() RandomDistAddItem(FourCC("modt"), 20) RandomDistAddItem(-1, 80) itemID = RandomDistChoose() if (trigUnit ~= nil) then UnitDropItem(trigUnit, itemID) else WidgetDropItem(trigWidget, itemID) end end bj_lastDyingWidget = nil DestroyTrigger(GetTriggeringTrigger()) end function CreateNeutralHostileBuildings() local p = Player(PLAYER_NEUTRAL_AGGRESSIVE) local u local unitID local t local life u = BlzCreateUnitWithSkin(p, FourCC("h001"), -4608.0, 4224.0, 270.000, FourCC("h001")) u = BlzCreateUnitWithSkin(p, FourCC("h004"), -4480.0, 4416.0, 270.000, FourCC("h004")) u = BlzCreateUnitWithSkin(p, FourCC("h003"), -4608.0, 4416.0, 270.000, FourCC("h003")) u = BlzCreateUnitWithSkin(p, FourCC("h002"), -4736.0, 4416.0, 270.000, FourCC("h002")) u = BlzCreateUnitWithSkin(p, FourCC("h00I"), -2560.0, 4416.0, 270.000, FourCC("h00I")) u = BlzCreateUnitWithSkin(p, FourCC("h00J"), -2432.0, 4416.0, 270.000, FourCC("h00J")) u = BlzCreateUnitWithSkin(p, FourCC("h006"), -3584.0, 4096.0, 270.000, FourCC("h006")) u = BlzCreateUnitWithSkin(p, FourCC("h007"), -3584.0, 4416.0, 270.000, FourCC("h007")) u = BlzCreateUnitWithSkin(p, FourCC("h008"), -3712.0, 4416.0, 270.000, FourCC("h008")) u = BlzCreateUnitWithSkin(p, FourCC("h009"), -3456.0, 4416.0, 270.000, FourCC("h009")) u = BlzCreateUnitWithSkin(p, FourCC("h00A"), -3584.0, 4288.0, 270.000, FourCC("h00A")) u = BlzCreateUnitWithSkin(p, FourCC("h00B"), -3456.0, 4288.0, 270.000, FourCC("h00B")) u = BlzCreateUnitWithSkin(p, FourCC("h00C"), -3712.0, 4288.0, 270.000, FourCC("h00C")) u = BlzCreateUnitWithSkin(p, FourCC("h00D"), -3584.0, 4544.0, 270.000, FourCC("h00D")) u = BlzCreateUnitWithSkin(p, FourCC("h00E"), -3456.0, 4544.0, 270.000, FourCC("h00E")) u = BlzCreateUnitWithSkin(p, FourCC("h00F"), -3712.0, 4544.0, 270.000, FourCC("h00F")) u = BlzCreateUnitWithSkin(p, FourCC("h00G"), -2560.0, 4096.0, 270.000, FourCC("h00G")) u = BlzCreateUnitWithSkin(p, FourCC("h00H"), -1536.0, 4096.0, 270.000, FourCC("h00H")) u = BlzCreateUnitWithSkin(p, FourCC("h00K"), -2688.0, 4416.0, 270.000, FourCC("h00K")) u = BlzCreateUnitWithSkin(p, FourCC("h00L"), -2560.0, 4544.0, 270.000, FourCC("h00L")) u = BlzCreateUnitWithSkin(p, FourCC("h00M"), -2688.0, 4544.0, 270.000, FourCC("h00M")) u = BlzCreateUnitWithSkin(p, FourCC("h00N"), -2432.0, 4544.0, 270.000, FourCC("h00N")) u = BlzCreateUnitWithSkin(p, FourCC("h00O"), -2560.0, 4288.0, 270.000, FourCC("h00O")) u = BlzCreateUnitWithSkin(p, FourCC("h00Q"), -2688.0, 4288.0, 270.000, FourCC("h00Q")) u = BlzCreateUnitWithSkin(p, FourCC("h00P"), -2432.0, 4288.0, 270.000, FourCC("h00P")) u = BlzCreateUnitWithSkin(p, FourCC("h00R"), -1664.0, 4544.0, 270.000, FourCC("h00R")) u = BlzCreateUnitWithSkin(p, FourCC("h00S"), -1536.0, 4544.0, 270.000, FourCC("h00S")) u = BlzCreateUnitWithSkin(p, FourCC("h00T"), -1664.0, 4416.0, 270.000, FourCC("h00T")) u = BlzCreateUnitWithSkin(p, FourCC("h00U"), -1536.0, 4416.0, 270.000, FourCC("h00U")) u = BlzCreateUnitWithSkin(p, FourCC("h00V"), -1664.0, 4288.0, 270.000, FourCC("h00V")) end function CreateNeutralHostile() local p = Player(PLAYER_NEUTRAL_AGGRESSIVE) local u local unitID local t local life u = BlzCreateUnitWithSkin(p, FourCC("n001"), 4624.7, 4978.5, 270.000, FourCC("n001")) u = BlzCreateUnitWithSkin(p, FourCC("n000"), 4712.7, 4990.7, 270.000, FourCC("n000")) u = BlzCreateUnitWithSkin(p, FourCC("n007"), 4794.3, 4982.1, 270.000, FourCC("n007")) u = BlzCreateUnitWithSkin(p, FourCC("n006"), 4873.9, 4996.1, 270.000, FourCC("n006")) u = BlzCreateUnitWithSkin(p, FourCC("n005"), 4965.5, 4986.4, 270.000, FourCC("n005")) u = BlzCreateUnitWithSkin(p, FourCC("n004"), 5068.3, 4999.0, 270.000, FourCC("n004")) u = BlzCreateUnitWithSkin(p, FourCC("n003"), 5147.2, 4996.1, 270.000, FourCC("n003")) u = BlzCreateUnitWithSkin(p, FourCC("n002"), 5232.9, 4996.6, 270.000, FourCC("n002")) end function CreateNeutralPassiveBuildings() local p = Player(PLAYER_NEUTRAL_PASSIVE) local u local unitID local t local life u = BlzCreateUnitWithSkin(p, FourCC("n008"), 4608.0, -4800.0, 270.000, FourCC("n008")) SetUnitColor(u, ConvertPlayerColor(0)) u = BlzCreateUnitWithSkin(p, FourCC("n00C"), -3328.0, 192.0, 270.000, FourCC("n00C")) u = BlzCreateUnitWithSkin(p, FourCC("n00A"), -3520.0, -768.0, 270.000, FourCC("n00A")) u = BlzCreateUnitWithSkin(p, FourCC("n00B"), -3776.0, -384.0, 270.000, FourCC("n00B")) u = BlzCreateUnitWithSkin(p, FourCC("n009"), -2880.0, -384.0, 270.000, FourCC("n009")) u = BlzCreateUnitWithSkin(p, FourCC("n00D"), -3712.0, 0.0, 270.000, FourCC("n00D")) u = BlzCreateUnitWithSkin(p, FourCC("n00E"), -3136.0, -768.0, 270.000, FourCC("n00E")) u = BlzCreateUnitWithSkin(p, FourCC("n00F"), -2944.0, 0.0, 270.000, FourCC("n00F")) end function CreateNeutralPassive() local p = Player(PLAYER_NEUTRAL_PASSIVE) local u local unitID local t local life u = BlzCreateUnitWithSkin(p, FourCC("u001"), 4378.2, -4499.7, 270.000, FourCC("u001")) u = BlzCreateUnitWithSkin(p, FourCC("u000"), 4476.1, -4502.2, 270.000, FourCC("u000")) u = BlzCreateUnitWithSkin(p, FourCC("u003"), 4557.2, -4495.4, 270.000, FourCC("u003")) u = BlzCreateUnitWithSkin(p, FourCC("u002"), 4658.2, -4501.4, 270.000, FourCC("u002")) u = BlzCreateUnitWithSkin(p, FourCC("u004"), 4750.6, -4509.8, 271.870, FourCC("u004")) u = BlzCreateUnitWithSkin(p, FourCC("u005"), 4834.3, -4508.1, 261.820, FourCC("u005")) end function CreatePlayerBuildings() end function CreatePlayerUnits() end function CreateAllUnits() CreateNeutralHostileBuildings() CreateNeutralPassiveBuildings() CreatePlayerBuildings() CreateNeutralHostile() CreateNeutralPassive() CreatePlayerUnits() end function CreateRegions() local we gg_rct_Spawn0 = Rect(1248.0, 3008.0, 1312.0, 3072.0) gg_rct_Spawn1 = Rect(3008.0, -1312.0, 3072.0, -1248.0) gg_rct_Check0 = Rect(-1312.0, -1312.0, -1248.0, -1248.0) gg_rct_Check1 = Rect(-32.0, -1312.0, 32.0, -1248.0) gg_rct_Check2 = Rect(-32.0, 1248.0, 32.0, 1312.0) gg_rct_Check3 = Rect(1248.0, 1248.0, 1312.0, 1312.0) gg_rct_Check4 = Rect(1248.0, -32.0, 1312.0, 32.0) gg_rct_Check5 = Rect(-1312.0, -32.0, -1248.0, 32.0) gg_rct_PlayArea = Rect(-2240.0, -2240.0, 2240.0, 2240.0) gg_rct_Spawn2 = Rect(-1312.0, -3072.0, -1248.0, -3008.0) gg_rct_Spawn3 = Rect(-3072.0, 1248.0, -3008.0, 1312.0) gg_rct_ClassSelection = Rect(4192.0, -5280.0, 5024.0, -4448.0) gg_rct_ModShops = Rect(-3872.0, -1376.0, -2592.0, 288.0) end function Trig_Untitled_Trigger_001_Actions() end function InitTrig_Untitled_Trigger_001() gg_trg_Untitled_Trigger_001 = CreateTrigger() TriggerAddAction(gg_trg_Untitled_Trigger_001, Trig_Untitled_Trigger_001_Actions) end function Trig_Untitled_Trigger_002_Actions() BlzSetUnitWeaponRealFieldBJ(GetTriggerUnit(), UNIT_WEAPON_RF_ATTACK_RANGE, 0, 600.00) end function InitTrig_Untitled_Trigger_002() gg_trg_Untitled_Trigger_002 = CreateTrigger() TriggerAddAction(gg_trg_Untitled_Trigger_002, Trig_Untitled_Trigger_002_Actions) end function InitCustomTriggers() InitTrig_Untitled_Trigger_001() InitTrig_Untitled_Trigger_002() end function InitCustomPlayerSlots() SetPlayerStartLocation(Player(0), 0) ForcePlayerStartLocation(Player(0), 0) SetPlayerColor(Player(0), ConvertPlayerColor(0)) SetPlayerRacePreference(Player(0), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(0), false) SetPlayerController(Player(0), MAP_CONTROL_USER) SetPlayerStartLocation(Player(1), 1) ForcePlayerStartLocation(Player(1), 1) SetPlayerColor(Player(1), ConvertPlayerColor(1)) SetPlayerRacePreference(Player(1), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(1), false) SetPlayerController(Player(1), MAP_CONTROL_USER) SetPlayerStartLocation(Player(2), 2) ForcePlayerStartLocation(Player(2), 2) SetPlayerColor(Player(2), ConvertPlayerColor(2)) SetPlayerRacePreference(Player(2), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(2), false) SetPlayerController(Player(2), MAP_CONTROL_USER) SetPlayerStartLocation(Player(3), 3) ForcePlayerStartLocation(Player(3), 3) SetPlayerColor(Player(3), ConvertPlayerColor(3)) SetPlayerRacePreference(Player(3), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(3), false) SetPlayerController(Player(3), MAP_CONTROL_USER) SetPlayerStartLocation(Player(4), 4) ForcePlayerStartLocation(Player(4), 4) SetPlayerColor(Player(4), ConvertPlayerColor(4)) SetPlayerRacePreference(Player(4), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(4), false) SetPlayerController(Player(4), MAP_CONTROL_USER) SetPlayerStartLocation(Player(5), 5) ForcePlayerStartLocation(Player(5), 5) SetPlayerColor(Player(5), ConvertPlayerColor(5)) SetPlayerRacePreference(Player(5), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(5), false) SetPlayerController(Player(5), MAP_CONTROL_USER) SetPlayerStartLocation(Player(10), 6) ForcePlayerStartLocation(Player(10), 6) SetPlayerColor(Player(10), ConvertPlayerColor(10)) SetPlayerRacePreference(Player(10), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(10), false) SetPlayerController(Player(10), MAP_CONTROL_COMPUTER) SetPlayerStartLocation(Player(11), 7) ForcePlayerStartLocation(Player(11), 7) SetPlayerColor(Player(11), ConvertPlayerColor(11)) SetPlayerRacePreference(Player(11), RACE_PREF_HUMAN) SetPlayerRaceSelectable(Player(11), false) SetPlayerController(Player(11), MAP_CONTROL_COMPUTER) end function InitCustomTeams() SetPlayerTeam(Player(0), 0) SetPlayerTeam(Player(1), 0) SetPlayerTeam(Player(2), 0) SetPlayerTeam(Player(3), 0) SetPlayerTeam(Player(4), 0) SetPlayerTeam(Player(5), 0) SetPlayerAllianceStateAllyBJ(Player(0), Player(1), true) SetPlayerAllianceStateAllyBJ(Player(0), Player(2), true) SetPlayerAllianceStateAllyBJ(Player(0), Player(3), true) SetPlayerAllianceStateAllyBJ(Player(0), Player(4), true) SetPlayerAllianceStateAllyBJ(Player(0), Player(5), true) SetPlayerAllianceStateAllyBJ(Player(1), Player(0), true) SetPlayerAllianceStateAllyBJ(Player(1), Player(2), true) SetPlayerAllianceStateAllyBJ(Player(1), Player(3), true) SetPlayerAllianceStateAllyBJ(Player(1), Player(4), true) SetPlayerAllianceStateAllyBJ(Player(1), Player(5), true) SetPlayerAllianceStateAllyBJ(Player(2), Player(0), true) SetPlayerAllianceStateAllyBJ(Player(2), Player(1), true) SetPlayerAllianceStateAllyBJ(Player(2), Player(3), true) SetPlayerAllianceStateAllyBJ(Player(2), Player(4), true) SetPlayerAllianceStateAllyBJ(Player(2), Player(5), true) SetPlayerAllianceStateAllyBJ(Player(3), Player(0), true) SetPlayerAllianceStateAllyBJ(Player(3), Player(1), true) SetPlayerAllianceStateAllyBJ(Player(3), Player(2), true) SetPlayerAllianceStateAllyBJ(Player(3), Player(4), true) SetPlayerAllianceStateAllyBJ(Player(3), Player(5), true) SetPlayerAllianceStateAllyBJ(Player(4), Player(0), true) SetPlayerAllianceStateAllyBJ(Player(4), Player(1), true) SetPlayerAllianceStateAllyBJ(Player(4), Player(2), true) SetPlayerAllianceStateAllyBJ(Player(4), Player(3), true) SetPlayerAllianceStateAllyBJ(Player(4), Player(5), true) SetPlayerAllianceStateAllyBJ(Player(5), Player(0), true) SetPlayerAllianceStateAllyBJ(Player(5), Player(1), true) SetPlayerAllianceStateAllyBJ(Player(5), Player(2), true) SetPlayerAllianceStateAllyBJ(Player(5), Player(3), true) SetPlayerAllianceStateAllyBJ(Player(5), Player(4), true) SetPlayerAllianceStateVisionBJ(Player(0), Player(1), true) SetPlayerAllianceStateVisionBJ(Player(0), Player(2), true) SetPlayerAllianceStateVisionBJ(Player(0), Player(3), true) SetPlayerAllianceStateVisionBJ(Player(0), Player(4), true) SetPlayerAllianceStateVisionBJ(Player(0), Player(5), true) SetPlayerAllianceStateVisionBJ(Player(1), Player(0), true) SetPlayerAllianceStateVisionBJ(Player(1), Player(2), true) SetPlayerAllianceStateVisionBJ(Player(1), Player(3), true) SetPlayerAllianceStateVisionBJ(Player(1), Player(4), true) SetPlayerAllianceStateVisionBJ(Player(1), Player(5), true) SetPlayerAllianceStateVisionBJ(Player(2), Player(0), true) SetPlayerAllianceStateVisionBJ(Player(2), Player(1), true) SetPlayerAllianceStateVisionBJ(Player(2), Player(3), true) SetPlayerAllianceStateVisionBJ(Player(2), Player(4), true) SetPlayerAllianceStateVisionBJ(Player(2), Player(5), true) SetPlayerAllianceStateVisionBJ(Player(3), Player(0), true) SetPlayerAllianceStateVisionBJ(Player(3), Player(1), true) SetPlayerAllianceStateVisionBJ(Player(3), Player(2), true) SetPlayerAllianceStateVisionBJ(Player(3), Player(4), true) SetPlayerAllianceStateVisionBJ(Player(3), Player(5), true) SetPlayerAllianceStateVisionBJ(Player(4), Player(0), true) SetPlayerAllianceStateVisionBJ(Player(4), Player(1), true) SetPlayerAllianceStateVisionBJ(Player(4), Player(2), true) SetPlayerAllianceStateVisionBJ(Player(4), Player(3), true) SetPlayerAllianceStateVisionBJ(Player(4), Player(5), true) SetPlayerAllianceStateVisionBJ(Player(5), Player(0), true) SetPlayerAllianceStateVisionBJ(Player(5), Player(1), true) SetPlayerAllianceStateVisionBJ(Player(5), Player(2), true) SetPlayerAllianceStateVisionBJ(Player(5), Player(3), true) SetPlayerAllianceStateVisionBJ(Player(5), Player(4), true) SetPlayerTeam(Player(10), 1) SetPlayerTeam(Player(11), 1) SetPlayerAllianceStateAllyBJ(Player(10), Player(11), true) SetPlayerAllianceStateAllyBJ(Player(11), Player(10), true) SetPlayerAllianceStateVisionBJ(Player(10), Player(11), true) SetPlayerAllianceStateVisionBJ(Player(11), Player(10), true) end function InitAllyPriorities() SetStartLocPrioCount(0, 5) SetStartLocPrio(0, 0, 1, MAP_LOC_PRIO_HIGH) SetStartLocPrio(0, 1, 2, MAP_LOC_PRIO_HIGH) SetStartLocPrio(0, 2, 3, MAP_LOC_PRIO_HIGH) SetStartLocPrio(0, 3, 4, MAP_LOC_PRIO_HIGH) SetStartLocPrio(0, 4, 5, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(1, 5) SetStartLocPrio(1, 0, 0, MAP_LOC_PRIO_HIGH) SetStartLocPrio(1, 1, 2, MAP_LOC_PRIO_HIGH) SetStartLocPrio(1, 2, 3, MAP_LOC_PRIO_HIGH) SetStartLocPrio(1, 3, 4, MAP_LOC_PRIO_HIGH) SetStartLocPrio(1, 4, 5, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(2, 5) SetStartLocPrio(2, 0, 0, MAP_LOC_PRIO_HIGH) SetStartLocPrio(2, 1, 1, MAP_LOC_PRIO_HIGH) SetStartLocPrio(2, 2, 3, MAP_LOC_PRIO_HIGH) SetStartLocPrio(2, 3, 4, MAP_LOC_PRIO_HIGH) SetStartLocPrio(2, 4, 5, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(3, 5) SetStartLocPrio(3, 0, 0, MAP_LOC_PRIO_HIGH) SetStartLocPrio(3, 1, 1, MAP_LOC_PRIO_HIGH) SetStartLocPrio(3, 2, 2, MAP_LOC_PRIO_HIGH) SetStartLocPrio(3, 3, 4, MAP_LOC_PRIO_HIGH) SetStartLocPrio(3, 4, 5, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(4, 5) SetStartLocPrio(4, 0, 0, MAP_LOC_PRIO_HIGH) SetStartLocPrio(4, 1, 1, MAP_LOC_PRIO_HIGH) SetStartLocPrio(4, 2, 2, MAP_LOC_PRIO_HIGH) SetStartLocPrio(4, 3, 3, MAP_LOC_PRIO_HIGH) SetStartLocPrio(4, 4, 5, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(5, 5) SetStartLocPrio(5, 0, 0, MAP_LOC_PRIO_HIGH) SetStartLocPrio(5, 1, 1, MAP_LOC_PRIO_HIGH) SetStartLocPrio(5, 2, 2, MAP_LOC_PRIO_HIGH) SetStartLocPrio(5, 3, 3, MAP_LOC_PRIO_HIGH) SetStartLocPrio(5, 4, 4, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(6, 3) SetStartLocPrio(6, 0, 0, MAP_LOC_PRIO_LOW) SetStartLocPrio(6, 1, 1, MAP_LOC_PRIO_LOW) SetStartLocPrio(6, 2, 7, MAP_LOC_PRIO_LOW) SetEnemyStartLocPrioCount(6, 2) SetEnemyStartLocPrio(6, 0, 1, MAP_LOC_PRIO_HIGH) SetEnemyStartLocPrio(6, 1, 5, MAP_LOC_PRIO_HIGH) SetStartLocPrioCount(7, 1) SetStartLocPrio(7, 0, 5, MAP_LOC_PRIO_LOW) SetEnemyStartLocPrioCount(7, 4) SetEnemyStartLocPrio(7, 0, 0, MAP_LOC_PRIO_LOW) SetEnemyStartLocPrio(7, 1, 1, MAP_LOC_PRIO_LOW) SetEnemyStartLocPrio(7, 2, 5, MAP_LOC_PRIO_LOW) end function main() SetCameraBounds(-5376.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), -5632.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM), 5376.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), 5120.0 - GetCameraMargin(CAMERA_MARGIN_TOP), -5376.0 + GetCameraMargin(CAMERA_MARGIN_LEFT), 5120.0 - GetCameraMargin(CAMERA_MARGIN_TOP), 5376.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT), -5632.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM)) SetDayNightModels("Environment\\DNC\\DNCDalaran\\DNCDalaranTerrain\\DNCDalaranTerrain.mdl", "Environment\\DNC\\DNCDalaran\\DNCDalaranUnit\\DNCDalaranUnit.mdl") NewSoundEnvironment("Default") SetAmbientDaySound("DalaranDay") SetAmbientNightSound("DalaranNight") SetMapMusic("Music", true, 0) CreateRegions() CreateAllUnits() InitBlizzard() InitGlobals() InitCustomTriggers() end function config() SetMapName("TRIGSTR_001") SetMapDescription("") SetPlayers(8) SetTeams(8) SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER) DefineStartLocation(0, 0.0, 0.0) DefineStartLocation(1, 0.0, 0.0) DefineStartLocation(2, 0.0, 0.0) DefineStartLocation(3, 0.0, 0.0) DefineStartLocation(4, 0.0, 0.0) DefineStartLocation(5, 0.0, 0.0) DefineStartLocation(6, 1280.0, 2944.0) DefineStartLocation(7, -1280.0, -3008.0) InitCustomPlayerSlots() InitCustomTeams() InitAllyPriorities() end
iggungan = Creature:new { customName = "Gungan", socialGroup = "mercenary", faction = "", level = 300, chanceHit = 25.00, damageMin = 100, damageMax = 200, baseXp = 100000, baseHAM = 100000, baseHAMmax = 110000, armor = 0, resists = {40,40,40,40,40,40,40,40,40}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY, creatureBitmask = PACK + KILLER, optionsBitmask = AIENABLED, diet = HERBIVORE, scale = 1.15, templates = {"object/mobile/gungan_male.iff"}, lootGroups = { }, weapons = {"tusken_weapons"}, reactionStf = "@npc_reaction/slang", attacks = merge(commandomaster,marksmanmaster,tkamaster,brawlermaster,fencermaster,swordsmanmaster,pikemanmaster,riflemanmaster,pistoleermaster) } CreatureTemplates:addCreatureTemplate(iggungan, "iggungan")
local g = vim.g g.gruvbox_contrast_dark = 'hard' g.gruvbox_invert_selection = false g.tokyonight_italic_functions = true g.tokyonight_style = 'night'
--[[ FiveM Scripts Copyright C 2018 Sighmir This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or at your option any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ]] vRPidd = {} Tunnel.bindInterface("vrp_id_display",vRPidd) users = {} blips = {} myteam = nil function vRPidd.insertUser(user_id,source) users[user_id] = GetPlayerFromServerId(source) end function vRPidd.removeUser(user_id) users[user_id] = nil end function vRPidd.insertBlip(user_id,source,group,btype) blips[user_id] = {player = GetPlayerFromServerId(source), job = group, team = btype} if GetPlayerPed( blips[user_id].player ) == GetPlayerPed( -1 ) then myteam = btype end end function vRPidd.removeBlip(user_id) local blip = GetBlipFromEntity(ped) RemoveBlip(blip) blips[user_id] = {player = nil, job = nil, team = nil} if ped == GetPlayerPed( -1 ) then myteam = nil end end function vRPidd.getGroupColour(group) return cfg.blips[group].id.r, cfg.blips[group].id.g, cfg.blips[group].id.b end function DrawText3D(x,y,z, text, r,g,b) -- some useful function, use it if you want! local onScreen,_x,_y=World3dToScreen2d(x,y,z) local px,py,pz=table.unpack(GetGameplayCamCoords()) local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1) local scale = (1/dist)*2 local fov = (1/GetGameplayCamFov())*100 local scale = scale*fov if onScreen then SetTextScale(0.0*scale, 0.55*scale) SetTextFont(0) SetTextProportional(1) -- SetTextScale(0.0, 0.55) SetTextColour(r, g, b, 255) SetTextDropshadow(0, 0, 0, 0, 255) SetTextEdge(2, 0, 0, 0, 150) SetTextDropShadow() SetTextOutline() SetTextEntry("STRING") SetTextCentre(1) AddTextComponentString(text) DrawText(_x,_y) end end function UpdateBlip(player, blip, sprite, colour, alpha) local blipSprite = GetBlipSprite( blip ) HideNumberOnBlip( blip ) if blipSprite ~= sprite then SetBlipSprite( blip, sprite ) Citizen.InvokeNative( 0x5FBCA48327B914DF, blip, true ) end SetBlipNameToPlayerName( blip, player ) SetBlipScale( blip, 0.85 ) SetBlipColour( blip, colour ) SetBlipAlpha( blip, alpha ) end Citizen.CreateThread(function() while true do for i=0,255 do N_0x31698aa80e0223f8(i) end for k,v in pairs(users) do if v ~= nil then if ((GetPlayerPed( v ) ~= GetPlayerPed( -1 )) or cfg.showself) then -- disable your own x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) ) x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( v ), true ) ) distance = math.floor(GetDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, true)) if IsControlPressed(0,173) then -- MOVE UP showID = true end if IsControlReleased(0,173) then -- MOVE UP showID = false end if ((distance < cfg.distance)) and showID == true then if NetworkIsPlayerTalking( v ) then DrawText3D(x2, y2, z2+1, k, cfg.talker.r, cfg.talker.g, cfg.talker.b) -- talker color elseif blips[k].team ~= nil and (blips[k].team == myteam or cfg.showteam) and not cfg.hideteam then DrawText3D(x2, y2, z2+1, k, cfg.blips[blips[k].job].id.r, cfg.blips[blips[k].job].id.g, cfg.blips[blips[k].job].id.b) else DrawText3D(x2, y2, z2+1, k, cfg.default.r, cfg.default.g, cfg.default.b) end end end end end Citizen.Wait(0) end end) Citizen.CreateThread(function() while true do for k,v in pairs(blips) do if v.player ~= nil then local ped = GetPlayerPed( v.player ) if ((ped ~= GetPlayerPed( -1 )) or cfg.showself) then local blip = GetBlipFromEntity(ped) x1, y1, z1 = table.unpack( GetEntityCoords( GetPlayerPed( -1 ), true ) ) x2, y2, z2 = table.unpack( GetEntityCoords( ped, true ) ) distance = math.floor(GetDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, true)) if v.job ~= nil then if cfg.blips[v.job] ~= nil then if distance < cfg.blips[v.job].distance and v.team == myteam then local alpha = 255 - (255*(distance/cfg.blips[v.job].distance)) if not DoesBlipExist( blip ) then blip = AddBlipForEntity( ped ) UpdateBlip(v.player, blip, cfg.blips[v.job].sprite, cfg.blips[v.job].colour, alpha) else UpdateBlip(v.player, blip, cfg.blips[v.job].sprite, cfg.blips[v.job].colour, alpha) end else if DoesBlipExist( blip ) then RemoveBlip(blip) end end end end end end end Citizen.Wait(0) end end)
require("rrpg.lua"); local __o_rrpgObjs = require("rrpgObjs.lua"); require("rrpgGUI.lua"); require("rrpgDialogs.lua"); require("rrpgLFM.lua"); require("ndb.lua"); function newfrmBase() __o_rrpgObjs.beginObjectsLoading(); local obj = gui.fromHandle(_obj_newObject("form")); local self = obj; local sheet = nil; rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject")); function obj:setNodeObject(nodeObject) sheet = nodeObject; self.sheet = nodeObject; self:_oldSetNodeObjectFunction(nodeObject); end; function obj:setNodeDatabase(nodeObject) self:setNodeObject(nodeObject); end; _gui_assignInitialParentForForm(obj.handle); obj:beginUpdate(); obj:setName("frmBase"); obj:setAlign("client"); obj.scrollBox1 = gui.fromHandle(_obj_newObject("scrollBox")); obj.scrollBox1:setParent(obj); obj.scrollBox1:setAlign("client"); obj.scrollBox1:setName("scrollBox1"); obj.rectangle1 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle1:setParent(obj.scrollBox1); obj.rectangle1:setLeft(0); obj.rectangle1:setTop(0); obj.rectangle1:setWidth(600); obj.rectangle1:setHeight(60); obj.rectangle1:setColor("black"); obj.rectangle1:setStrokeColor("white"); obj.rectangle1:setStrokeSize(1); obj.rectangle1:setName("rectangle1"); obj.label1 = gui.fromHandle(_obj_newObject("label")); obj.label1:setParent(obj.rectangle1); obj.label1:setTop(5); obj.label1:setWidth(100); obj.label1:setHeight(25); obj.label1:setHorzTextAlign("center"); obj.label1:setText("Nome"); obj.label1:setName("label1"); obj.edit1 = gui.fromHandle(_obj_newObject("edit")); obj.edit1:setParent(obj.rectangle1); obj.edit1:setLeft(105); obj.edit1:setTop(5); obj.edit1:setWidth(150); obj.edit1:setHeight(25); obj.edit1:setField("nome"); obj.edit1:setName("edit1"); obj.label2 = gui.fromHandle(_obj_newObject("label")); obj.label2:setParent(obj.rectangle1); obj.label2:setLeft(255); obj.label2:setTop(5); obj.label2:setWidth(100); obj.label2:setHeight(25); obj.label2:setHorzTextAlign("center"); obj.label2:setText("Nível"); obj.label2:setName("label2"); obj.rectangle2 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle2:setParent(obj.rectangle1); obj.rectangle2:setLeft(355); obj.rectangle2:setTop(5); obj.rectangle2:setWidth(50); obj.rectangle2:setHeight(25); obj.rectangle2:setColor("black"); obj.rectangle2:setStrokeColor("white"); obj.rectangle2:setStrokeSize(1); obj.rectangle2:setName("rectangle2"); obj.label3 = gui.fromHandle(_obj_newObject("label")); obj.label3:setParent(obj.rectangle1); obj.label3:setLeft(355); obj.label3:setTop(5); obj.label3:setWidth(50); obj.label3:setHeight(25); obj.label3:setHorzTextAlign("center"); obj.label3:setField("nivel"); obj.label3:setName("label3"); obj.label4 = gui.fromHandle(_obj_newObject("label")); obj.label4:setParent(obj.rectangle1); obj.label4:setLeft(405); obj.label4:setTop(5); obj.label4:setWidth(100); obj.label4:setHeight(25); obj.label4:setHorzTextAlign("center"); obj.label4:setText("Experiência"); obj.label4:setName("label4"); obj.edit2 = gui.fromHandle(_obj_newObject("edit")); obj.edit2:setParent(obj.rectangle1); obj.edit2:setLeft(505); obj.edit2:setTop(5); obj.edit2:setWidth(50); obj.edit2:setHeight(25); obj.edit2:setField("experiencia"); obj.edit2:setType("number"); obj.edit2:setName("edit2"); obj.label5 = gui.fromHandle(_obj_newObject("label")); obj.label5:setParent(obj.rectangle1); obj.label5:setTop(30); obj.label5:setWidth(100); obj.label5:setHeight(25); obj.label5:setHorzTextAlign("center"); obj.label5:setText("Aptidão"); obj.label5:setName("label5"); obj.comboBox1 = gui.fromHandle(_obj_newObject("comboBox")); obj.comboBox1:setParent(obj.rectangle1); obj.comboBox1:setLeft(105); obj.comboBox1:setTop(30); obj.comboBox1:setWidth(150); obj.comboBox1:setHeight(25); obj.comboBox1:setField("aptidao"); obj.comboBox1:setItems({'Alquimista', 'Arcanista', 'Caçador', 'Cavaleiro', 'Monge', 'Necromante', 'Xamã'}); obj.comboBox1:setValues({'1', '2', '3', '4', '5', '6', '7'}); obj.comboBox1:setName("comboBox1"); obj.label6 = gui.fromHandle(_obj_newObject("label")); obj.label6:setParent(obj.rectangle1); obj.label6:setLeft(255); obj.label6:setTop(30); obj.label6:setWidth(100); obj.label6:setHeight(25); obj.label6:setHorzTextAlign("center"); obj.label6:setText("Rank"); obj.label6:setName("label6"); obj.rectangle3 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle3:setParent(obj.rectangle1); obj.rectangle3:setLeft(355); obj.rectangle3:setTop(30); obj.rectangle3:setWidth(50); obj.rectangle3:setHeight(25); obj.rectangle3:setColor("black"); obj.rectangle3:setStrokeColor("white"); obj.rectangle3:setStrokeSize(1); obj.rectangle3:setName("rectangle3"); obj.label7 = gui.fromHandle(_obj_newObject("label")); obj.label7:setParent(obj.rectangle1); obj.label7:setLeft(355); obj.label7:setTop(30); obj.label7:setWidth(50); obj.label7:setHeight(25); obj.label7:setHorzTextAlign("center"); obj.label7:setField("rank"); obj.label7:setName("label7"); obj.label8 = gui.fromHandle(_obj_newObject("label")); obj.label8:setParent(obj.rectangle1); obj.label8:setLeft(405); obj.label8:setTop(30); obj.label8:setWidth(100); obj.label8:setHeight(25); obj.label8:setHorzTextAlign("center"); obj.label8:setText("Progresso"); obj.label8:setName("label8"); obj.edit3 = gui.fromHandle(_obj_newObject("edit")); obj.edit3:setParent(obj.rectangle1); obj.edit3:setLeft(505); obj.edit3:setTop(30); obj.edit3:setWidth(50); obj.edit3:setHeight(25); obj.edit3:setField("progresso"); obj.edit3:setType("number"); obj.edit3:setName("edit3"); obj.dataLink1 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink1:setParent(obj.rectangle1); obj.dataLink1:setField("nivel"); obj.dataLink1:setName("dataLink1"); obj.rectangle4 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle4:setParent(obj.scrollBox1); obj.rectangle4:setLeft(0); obj.rectangle4:setTop(65); obj.rectangle4:setWidth(310); obj.rectangle4:setHeight(85); obj.rectangle4:setColor("black"); obj.rectangle4:setStrokeColor("white"); obj.rectangle4:setStrokeSize(1); obj.rectangle4:setName("rectangle4"); obj.label9 = gui.fromHandle(_obj_newObject("label")); obj.label9:setParent(obj.rectangle4); obj.label9:setLeft(105); obj.label9:setTop(5); obj.label9:setWidth(75); obj.label9:setHeight(25); obj.label9:setHorzTextAlign("center"); obj.label9:setText("Naturais"); obj.label9:setName("label9"); obj.label10 = gui.fromHandle(_obj_newObject("label")); obj.label10:setParent(obj.rectangle4); obj.label10:setLeft(180); obj.label10:setTop(5); obj.label10:setWidth(75); obj.label10:setHeight(25); obj.label10:setHorzTextAlign("center"); obj.label10:setText("Adicional"); obj.label10:setName("label10"); obj.label11 = gui.fromHandle(_obj_newObject("label")); obj.label11:setParent(obj.rectangle4); obj.label11:setLeft(255); obj.label11:setTop(5); obj.label11:setWidth(50); obj.label11:setHeight(25); obj.label11:setHorzTextAlign("center"); obj.label11:setText("Atual"); obj.label11:setName("label11"); obj.label12 = gui.fromHandle(_obj_newObject("label")); obj.label12:setParent(obj.rectangle4); obj.label12:setLeft(5); obj.label12:setTop(30); obj.label12:setWidth(100); obj.label12:setHeight(25); obj.label12:setHorzTextAlign("center"); obj.label12:setText("Vida"); obj.label12:setName("label12"); obj.rectangle5 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle5:setParent(obj.rectangle4); obj.rectangle5:setLeft(105); obj.rectangle5:setTop(30); obj.rectangle5:setWidth(75); obj.rectangle5:setHeight(25); obj.rectangle5:setColor("black"); obj.rectangle5:setStrokeColor("white"); obj.rectangle5:setStrokeSize(1); obj.rectangle5:setName("rectangle5"); obj.label13 = gui.fromHandle(_obj_newObject("label")); obj.label13:setParent(obj.rectangle4); obj.label13:setLeft(105); obj.label13:setTop(30); obj.label13:setWidth(75); obj.label13:setHeight(25); obj.label13:setHorzTextAlign("center"); obj.label13:setField("vidaBase"); obj.label13:setName("label13"); obj.edit4 = gui.fromHandle(_obj_newObject("edit")); obj.edit4:setParent(obj.rectangle4); obj.edit4:setLeft(180); obj.edit4:setTop(30); obj.edit4:setWidth(75); obj.edit4:setHeight(25); obj.edit4:setField("vidaCompensacao"); obj.edit4:setHorzTextAlign("center"); obj.edit4:setType("number"); obj.edit4:setName("edit4"); obj.rectangle6 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle6:setParent(obj.rectangle4); obj.rectangle6:setLeft(255); obj.rectangle6:setTop(30); obj.rectangle6:setWidth(50); obj.rectangle6:setHeight(25); obj.rectangle6:setColor("black"); obj.rectangle6:setStrokeColor("white"); obj.rectangle6:setStrokeSize(1); obj.rectangle6:setName("rectangle6"); obj.label14 = gui.fromHandle(_obj_newObject("label")); obj.label14:setParent(obj.rectangle4); obj.label14:setLeft(255); obj.label14:setTop(30); obj.label14:setWidth(50); obj.label14:setHeight(25); obj.label14:setHorzTextAlign("center"); obj.label14:setField("vidaAtual"); obj.label14:setName("label14"); obj.dataLink2 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink2:setParent(obj.rectangle4); obj.dataLink2:setFields({'vidaBase','vidaCompensacao'}); obj.dataLink2:setName("dataLink2"); obj.label15 = gui.fromHandle(_obj_newObject("label")); obj.label15:setParent(obj.rectangle4); obj.label15:setLeft(5); obj.label15:setTop(55); obj.label15:setWidth(100); obj.label15:setHeight(25); obj.label15:setHorzTextAlign("center"); obj.label15:setText("Fadiga"); obj.label15:setName("label15"); obj.rectangle7 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle7:setParent(obj.rectangle4); obj.rectangle7:setLeft(105); obj.rectangle7:setTop(55); obj.rectangle7:setWidth(75); obj.rectangle7:setHeight(25); obj.rectangle7:setColor("black"); obj.rectangle7:setStrokeColor("white"); obj.rectangle7:setStrokeSize(1); obj.rectangle7:setName("rectangle7"); obj.label16 = gui.fromHandle(_obj_newObject("label")); obj.label16:setParent(obj.rectangle4); obj.label16:setLeft(105); obj.label16:setTop(55); obj.label16:setWidth(75); obj.label16:setHeight(25); obj.label16:setHorzTextAlign("center"); obj.label16:setField("fadigaBase"); obj.label16:setName("label16"); obj.edit5 = gui.fromHandle(_obj_newObject("edit")); obj.edit5:setParent(obj.rectangle4); obj.edit5:setLeft(180); obj.edit5:setTop(55); obj.edit5:setWidth(75); obj.edit5:setHeight(25); obj.edit5:setField("fadigaCompensacao"); obj.edit5:setHorzTextAlign("center"); obj.edit5:setType("number"); obj.edit5:setName("edit5"); obj.rectangle8 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle8:setParent(obj.rectangle4); obj.rectangle8:setLeft(255); obj.rectangle8:setTop(55); obj.rectangle8:setWidth(50); obj.rectangle8:setHeight(25); obj.rectangle8:setColor("black"); obj.rectangle8:setStrokeColor("white"); obj.rectangle8:setStrokeSize(1); obj.rectangle8:setName("rectangle8"); obj.label17 = gui.fromHandle(_obj_newObject("label")); obj.label17:setParent(obj.rectangle4); obj.label17:setLeft(255); obj.label17:setTop(55); obj.label17:setWidth(50); obj.label17:setHeight(25); obj.label17:setHorzTextAlign("center"); obj.label17:setField("fadigaAtual"); obj.label17:setName("label17"); obj.dataLink3 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink3:setParent(obj.rectangle4); obj.dataLink3:setFields({'fadigaBase','fadigaCompensacao'}); obj.dataLink3:setName("dataLink3"); obj.rectangle9 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle9:setParent(obj.scrollBox1); obj.rectangle9:setLeft(0); obj.rectangle9:setTop(155); obj.rectangle9:setWidth(310); obj.rectangle9:setHeight(35); obj.rectangle9:setColor("black"); obj.rectangle9:setStrokeColor("white"); obj.rectangle9:setStrokeSize(1); obj.rectangle9:setName("rectangle9"); obj.label18 = gui.fromHandle(_obj_newObject("label")); obj.label18:setParent(obj.rectangle9); obj.label18:setLeft(5); obj.label18:setTop(5); obj.label18:setWidth(150); obj.label18:setHeight(25); obj.label18:setHorzTextAlign("center"); obj.label18:setText("Peças de Aruman"); obj.label18:setFontSize(13); obj.label18:setName("label18"); obj.edit6 = gui.fromHandle(_obj_newObject("edit")); obj.edit6:setParent(obj.rectangle9); obj.edit6:setLeft(155); obj.edit6:setTop(5); obj.edit6:setWidth(100); obj.edit6:setHeight(25); obj.edit6:setField("pecas"); obj.edit6:setHorzTextAlign("center"); obj.edit6:setType("number"); obj.edit6:setName("edit6"); obj.rectangle10 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle10:setParent(obj.scrollBox1); obj.rectangle10:setLeft(0); obj.rectangle10:setTop(195); obj.rectangle10:setWidth(310); obj.rectangle10:setHeight(35); obj.rectangle10:setColor("black"); obj.rectangle10:setStrokeColor("white"); obj.rectangle10:setStrokeSize(1); obj.rectangle10:setName("rectangle10"); obj.label19 = gui.fromHandle(_obj_newObject("label")); obj.label19:setParent(obj.rectangle10); obj.label19:setLeft(10); obj.label19:setTop(5); obj.label19:setWidth(310); obj.label19:setHeight(25); obj.label19:setText("Carma"); obj.label19:setName("label19"); obj.comboBox2 = gui.fromHandle(_obj_newObject("comboBox")); obj.comboBox2:setParent(obj.rectangle10); obj.comboBox2:setLeft(65); obj.comboBox2:setTop(5); obj.comboBox2:setWidth(200); obj.comboBox2:setHeight(25); obj.comboBox2:setField("carma"); obj.comboBox2:setItems({'Divino 2','Divino 1','Humano','Demoníaco 1','Demoníaco 2'}); obj.comboBox2:setName("comboBox2"); obj.rectangle11 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle11:setParent(obj.scrollBox1); obj.rectangle11:setLeft(0); obj.rectangle11:setTop(235); obj.rectangle11:setWidth(310); obj.rectangle11:setHeight(85); obj.rectangle11:setColor("black"); obj.rectangle11:setStrokeColor("white"); obj.rectangle11:setStrokeSize(1); obj.rectangle11:setName("rectangle11"); obj.label20 = gui.fromHandle(_obj_newObject("label")); obj.label20:setParent(obj.rectangle11); obj.label20:setLeft(0); obj.label20:setTop(5); obj.label20:setWidth(310); obj.label20:setHeight(25); obj.label20:setHorzTextAlign("center"); obj.label20:setText("Bençãos e Sentinelas"); obj.label20:setName("label20"); obj.edit7 = gui.fromHandle(_obj_newObject("edit")); obj.edit7:setParent(obj.rectangle11); obj.edit7:setLeft(5); obj.edit7:setTop(30); obj.edit7:setWidth(300); obj.edit7:setHeight(25); obj.edit7:setField("bencao1"); obj.edit7:setName("edit7"); obj.edit8 = gui.fromHandle(_obj_newObject("edit")); obj.edit8:setParent(obj.rectangle11); obj.edit8:setLeft(5); obj.edit8:setTop(55); obj.edit8:setWidth(300); obj.edit8:setHeight(25); obj.edit8:setField("bencao2"); obj.edit8:setName("edit8"); obj.rectangle12 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle12:setParent(obj.scrollBox1); obj.rectangle12:setLeft(0); obj.rectangle12:setTop(325); obj.rectangle12:setWidth(310); obj.rectangle12:setHeight(355); obj.rectangle12:setColor("black"); obj.rectangle12:setStrokeColor("white"); obj.rectangle12:setStrokeSize(1); obj.rectangle12:setName("rectangle12"); obj.label21 = gui.fromHandle(_obj_newObject("label")); obj.label21:setParent(obj.rectangle12); obj.label21:setLeft(0); obj.label21:setTop(5); obj.label21:setWidth(310); obj.label21:setHeight(20); obj.label21:setHorzTextAlign("center"); obj.label21:setText("Resistência"); obj.label21:setName("label21"); obj.layout1 = gui.fromHandle(_obj_newObject("layout")); obj.layout1:setParent(obj.rectangle12); obj.layout1:setLeft(0); obj.layout1:setTop(25); obj.layout1:setWidth(155); obj.layout1:setHeight(25); obj.layout1:setName("layout1"); obj.label22 = gui.fromHandle(_obj_newObject("label")); obj.label22:setParent(obj.layout1); obj.label22:setLeft(0); obj.label22:setTop(0); obj.label22:setWidth(100); obj.label22:setHeight(25); obj.label22:setHorzTextAlign("center"); obj.label22:setText("Física"); obj.label22:setName("label22"); obj.edit9 = gui.fromHandle(_obj_newObject("edit")); obj.edit9:setParent(obj.layout1); obj.edit9:setLeft(100); obj.edit9:setTop(0); obj.edit9:setWidth(50); obj.edit9:setHeight(25); obj.edit9:setHorzTextAlign("center"); obj.edit9:setField("resistenciaFisica"); obj.edit9:setName("edit9"); obj.layout2 = gui.fromHandle(_obj_newObject("layout")); obj.layout2:setParent(obj.rectangle12); obj.layout2:setLeft(0); obj.layout2:setTop(50); obj.layout2:setWidth(155); obj.layout2:setHeight(25); obj.layout2:setName("layout2"); obj.label23 = gui.fromHandle(_obj_newObject("label")); obj.label23:setParent(obj.layout2); obj.label23:setLeft(0); obj.label23:setTop(0); obj.label23:setWidth(100); obj.label23:setHeight(25); obj.label23:setHorzTextAlign("center"); obj.label23:setText("Desaceleração"); obj.label23:setName("label23"); obj.edit10 = gui.fromHandle(_obj_newObject("edit")); obj.edit10:setParent(obj.layout2); obj.edit10:setLeft(100); obj.edit10:setTop(0); obj.edit10:setWidth(50); obj.edit10:setHeight(25); obj.edit10:setHorzTextAlign("center"); obj.edit10:setField("resistenciaDesaceleracao"); obj.edit10:setName("edit10"); obj.layout3 = gui.fromHandle(_obj_newObject("layout")); obj.layout3:setParent(obj.rectangle12); obj.layout3:setLeft(0); obj.layout3:setTop(75); obj.layout3:setWidth(155); obj.layout3:setHeight(25); obj.layout3:setName("layout3"); obj.label24 = gui.fromHandle(_obj_newObject("label")); obj.label24:setParent(obj.layout3); obj.label24:setLeft(0); obj.label24:setTop(0); obj.label24:setWidth(100); obj.label24:setHeight(25); obj.label24:setHorzTextAlign("center"); obj.label24:setText("Sangramento"); obj.label24:setName("label24"); obj.edit11 = gui.fromHandle(_obj_newObject("edit")); obj.edit11:setParent(obj.layout3); obj.edit11:setLeft(100); obj.edit11:setTop(0); obj.edit11:setWidth(50); obj.edit11:setHeight(25); obj.edit11:setHorzTextAlign("center"); obj.edit11:setField("resistenciaSangramento"); obj.edit11:setName("edit11"); obj.layout4 = gui.fromHandle(_obj_newObject("layout")); obj.layout4:setParent(obj.rectangle12); obj.layout4:setLeft(0); obj.layout4:setTop(100); obj.layout4:setWidth(155); obj.layout4:setHeight(25); obj.layout4:setName("layout4"); obj.label25 = gui.fromHandle(_obj_newObject("label")); obj.label25:setParent(obj.layout4); obj.label25:setLeft(0); obj.label25:setTop(0); obj.label25:setWidth(100); obj.label25:setHeight(25); obj.label25:setHorzTextAlign("center"); obj.label25:setText("Impelimento"); obj.label25:setName("label25"); obj.edit12 = gui.fromHandle(_obj_newObject("edit")); obj.edit12:setParent(obj.layout4); obj.edit12:setLeft(100); obj.edit12:setTop(0); obj.edit12:setWidth(50); obj.edit12:setHeight(25); obj.edit12:setHorzTextAlign("center"); obj.edit12:setField("resistenciaImpelimento"); obj.edit12:setName("edit12"); obj.layout5 = gui.fromHandle(_obj_newObject("layout")); obj.layout5:setParent(obj.rectangle12); obj.layout5:setLeft(0); obj.layout5:setTop(125); obj.layout5:setWidth(155); obj.layout5:setHeight(25); obj.layout5:setName("layout5"); obj.label26 = gui.fromHandle(_obj_newObject("label")); obj.label26:setParent(obj.layout5); obj.label26:setLeft(0); obj.label26:setTop(0); obj.label26:setWidth(100); obj.label26:setHeight(25); obj.label26:setHorzTextAlign("center"); obj.label26:setText("Imobilização"); obj.label26:setName("label26"); obj.edit13 = gui.fromHandle(_obj_newObject("edit")); obj.edit13:setParent(obj.layout5); obj.edit13:setLeft(100); obj.edit13:setTop(0); obj.edit13:setWidth(50); obj.edit13:setHeight(25); obj.edit13:setHorzTextAlign("center"); obj.edit13:setField("resistenciaImobilizacao"); obj.edit13:setName("edit13"); obj.layout6 = gui.fromHandle(_obj_newObject("layout")); obj.layout6:setParent(obj.rectangle12); obj.layout6:setLeft(0); obj.layout6:setTop(150); obj.layout6:setWidth(155); obj.layout6:setHeight(25); obj.layout6:setName("layout6"); obj.label27 = gui.fromHandle(_obj_newObject("label")); obj.label27:setParent(obj.layout6); obj.label27:setLeft(0); obj.label27:setTop(0); obj.label27:setWidth(100); obj.label27:setHeight(25); obj.label27:setHorzTextAlign("center"); obj.label27:setText("Fratura"); obj.label27:setName("label27"); obj.edit14 = gui.fromHandle(_obj_newObject("edit")); obj.edit14:setParent(obj.layout6); obj.edit14:setLeft(100); obj.edit14:setTop(0); obj.edit14:setWidth(50); obj.edit14:setHeight(25); obj.edit14:setHorzTextAlign("center"); obj.edit14:setField("resistenciaFratura"); obj.edit14:setName("edit14"); obj.layout7 = gui.fromHandle(_obj_newObject("layout")); obj.layout7:setParent(obj.rectangle12); obj.layout7:setLeft(0); obj.layout7:setTop(175); obj.layout7:setWidth(155); obj.layout7:setHeight(25); obj.layout7:setName("layout7"); obj.label28 = gui.fromHandle(_obj_newObject("label")); obj.label28:setParent(obj.layout7); obj.label28:setLeft(0); obj.label28:setTop(0); obj.label28:setWidth(100); obj.label28:setHeight(25); obj.label28:setHorzTextAlign("center"); obj.label28:setText("Fragilização"); obj.label28:setName("label28"); obj.edit15 = gui.fromHandle(_obj_newObject("edit")); obj.edit15:setParent(obj.layout7); obj.edit15:setLeft(100); obj.edit15:setTop(0); obj.edit15:setWidth(50); obj.edit15:setHeight(25); obj.edit15:setHorzTextAlign("center"); obj.edit15:setField("resistenciaFragilizacao"); obj.edit15:setName("edit15"); obj.layout8 = gui.fromHandle(_obj_newObject("layout")); obj.layout8:setParent(obj.rectangle12); obj.layout8:setLeft(155); obj.layout8:setTop(25); obj.layout8:setWidth(155); obj.layout8:setHeight(25); obj.layout8:setName("layout8"); obj.label29 = gui.fromHandle(_obj_newObject("label")); obj.label29:setParent(obj.layout8); obj.label29:setLeft(0); obj.label29:setTop(0); obj.label29:setWidth(100); obj.label29:setHeight(25); obj.label29:setHorzTextAlign("center"); obj.label29:setText("Paranormal"); obj.label29:setName("label29"); obj.edit16 = gui.fromHandle(_obj_newObject("edit")); obj.edit16:setParent(obj.layout8); obj.edit16:setLeft(100); obj.edit16:setTop(0); obj.edit16:setWidth(50); obj.edit16:setHeight(25); obj.edit16:setHorzTextAlign("center"); obj.edit16:setField("resistenciaParanormal"); obj.edit16:setName("edit16"); obj.layout9 = gui.fromHandle(_obj_newObject("layout")); obj.layout9:setParent(obj.rectangle12); obj.layout9:setLeft(155); obj.layout9:setTop(50); obj.layout9:setWidth(155); obj.layout9:setHeight(25); obj.layout9:setName("layout9"); obj.label30 = gui.fromHandle(_obj_newObject("label")); obj.label30:setParent(obj.layout9); obj.label30:setLeft(0); obj.label30:setTop(0); obj.label30:setWidth(100); obj.label30:setHeight(25); obj.label30:setHorzTextAlign("center"); obj.label30:setText("Envenenamento"); obj.label30:setName("label30"); obj.edit17 = gui.fromHandle(_obj_newObject("edit")); obj.edit17:setParent(obj.layout9); obj.edit17:setLeft(100); obj.edit17:setTop(0); obj.edit17:setWidth(50); obj.edit17:setHeight(25); obj.edit17:setHorzTextAlign("center"); obj.edit17:setField("resistenciaEnvenenamento"); obj.edit17:setName("edit17"); obj.layout10 = gui.fromHandle(_obj_newObject("layout")); obj.layout10:setParent(obj.rectangle12); obj.layout10:setLeft(155); obj.layout10:setTop(75); obj.layout10:setWidth(155); obj.layout10:setHeight(25); obj.layout10:setName("layout10"); obj.label31 = gui.fromHandle(_obj_newObject("label")); obj.label31:setParent(obj.layout10); obj.label31:setLeft(0); obj.label31:setTop(0); obj.label31:setWidth(100); obj.label31:setHeight(25); obj.label31:setHorzTextAlign("center"); obj.label31:setText("Incendiado"); obj.label31:setName("label31"); obj.edit18 = gui.fromHandle(_obj_newObject("edit")); obj.edit18:setParent(obj.layout10); obj.edit18:setLeft(100); obj.edit18:setTop(0); obj.edit18:setWidth(50); obj.edit18:setHeight(25); obj.edit18:setHorzTextAlign("center"); obj.edit18:setField("resistenciaIncendiado"); obj.edit18:setName("edit18"); obj.layout11 = gui.fromHandle(_obj_newObject("layout")); obj.layout11:setParent(obj.rectangle12); obj.layout11:setLeft(155); obj.layout11:setTop(100); obj.layout11:setWidth(155); obj.layout11:setHeight(25); obj.layout11:setName("layout11"); obj.label32 = gui.fromHandle(_obj_newObject("label")); obj.label32:setParent(obj.layout11); obj.label32:setLeft(0); obj.label32:setTop(0); obj.label32:setWidth(100); obj.label32:setHeight(25); obj.label32:setHorzTextAlign("center"); obj.label32:setText("Atordoamento"); obj.label32:setName("label32"); obj.edit19 = gui.fromHandle(_obj_newObject("edit")); obj.edit19:setParent(obj.layout11); obj.edit19:setLeft(100); obj.edit19:setTop(0); obj.edit19:setWidth(50); obj.edit19:setHeight(25); obj.edit19:setHorzTextAlign("center"); obj.edit19:setField("resistenciaAtordoamento"); obj.edit19:setName("edit19"); obj.layout12 = gui.fromHandle(_obj_newObject("layout")); obj.layout12:setParent(obj.rectangle12); obj.layout12:setLeft(155); obj.layout12:setTop(125); obj.layout12:setWidth(155); obj.layout12:setHeight(25); obj.layout12:setName("layout12"); obj.label33 = gui.fromHandle(_obj_newObject("label")); obj.label33:setParent(obj.layout12); obj.label33:setLeft(0); obj.label33:setTop(0); obj.label33:setWidth(100); obj.label33:setHeight(25); obj.label33:setHorzTextAlign("center"); obj.label33:setText("Paralisação"); obj.label33:setName("label33"); obj.edit20 = gui.fromHandle(_obj_newObject("edit")); obj.edit20:setParent(obj.layout12); obj.edit20:setLeft(100); obj.edit20:setTop(0); obj.edit20:setWidth(50); obj.edit20:setHeight(25); obj.edit20:setHorzTextAlign("center"); obj.edit20:setField("resistenciaParalisacao"); obj.edit20:setName("edit20"); obj.layout13 = gui.fromHandle(_obj_newObject("layout")); obj.layout13:setParent(obj.rectangle12); obj.layout13:setLeft(155); obj.layout13:setTop(150); obj.layout13:setWidth(155); obj.layout13:setHeight(25); obj.layout13:setName("layout13"); obj.label34 = gui.fromHandle(_obj_newObject("label")); obj.label34:setParent(obj.layout13); obj.label34:setLeft(0); obj.label34:setTop(0); obj.label34:setWidth(100); obj.label34:setHeight(25); obj.label34:setHorzTextAlign("center"); obj.label34:setText("Provocação"); obj.label34:setName("label34"); obj.edit21 = gui.fromHandle(_obj_newObject("edit")); obj.edit21:setParent(obj.layout13); obj.edit21:setLeft(100); obj.edit21:setTop(0); obj.edit21:setWidth(50); obj.edit21:setHeight(25); obj.edit21:setHorzTextAlign("center"); obj.edit21:setField("resistenciaProvocacao"); obj.edit21:setName("edit21"); obj.layout14 = gui.fromHandle(_obj_newObject("layout")); obj.layout14:setParent(obj.rectangle12); obj.layout14:setLeft(155); obj.layout14:setTop(175); obj.layout14:setWidth(155); obj.layout14:setHeight(25); obj.layout14:setName("layout14"); obj.label35 = gui.fromHandle(_obj_newObject("label")); obj.label35:setParent(obj.layout14); obj.label35:setLeft(0); obj.label35:setTop(0); obj.label35:setWidth(100); obj.label35:setHeight(25); obj.label35:setHorzTextAlign("center"); obj.label35:setText("Silenciado"); obj.label35:setName("label35"); obj.edit22 = gui.fromHandle(_obj_newObject("edit")); obj.edit22:setParent(obj.layout14); obj.edit22:setLeft(100); obj.edit22:setTop(0); obj.edit22:setWidth(50); obj.edit22:setHeight(25); obj.edit22:setHorzTextAlign("center"); obj.edit22:setField("resistenciaSilenciado"); obj.edit22:setName("edit22"); obj.label36 = gui.fromHandle(_obj_newObject("label")); obj.label36:setParent(obj.rectangle12); obj.label36:setLeft(0); obj.label36:setTop(200); obj.label36:setWidth(310); obj.label36:setHeight(20); obj.label36:setHorzTextAlign("center"); obj.label36:setText("Benefícios"); obj.label36:setName("label36"); obj.layout15 = gui.fromHandle(_obj_newObject("layout")); obj.layout15:setParent(obj.rectangle12); obj.layout15:setLeft(0); obj.layout15:setTop(225); obj.layout15:setWidth(155); obj.layout15:setHeight(25); obj.layout15:setName("layout15"); obj.label37 = gui.fromHandle(_obj_newObject("label")); obj.label37:setParent(obj.layout15); obj.label37:setLeft(0); obj.label37:setTop(0); obj.label37:setWidth(100); obj.label37:setHeight(25); obj.label37:setHorzTextAlign("center"); obj.label37:setText("Reg. de Vida"); obj.label37:setName("label37"); obj.edit23 = gui.fromHandle(_obj_newObject("edit")); obj.edit23:setParent(obj.layout15); obj.edit23:setLeft(100); obj.edit23:setTop(0); obj.edit23:setWidth(50); obj.edit23:setHeight(25); obj.edit23:setHorzTextAlign("center"); obj.edit23:setField("beneficioRegVida"); obj.edit23:setName("edit23"); obj.layout16 = gui.fromHandle(_obj_newObject("layout")); obj.layout16:setParent(obj.rectangle12); obj.layout16:setLeft(0); obj.layout16:setTop(250); obj.layout16:setWidth(155); obj.layout16:setHeight(25); obj.layout16:setName("layout16"); obj.label38 = gui.fromHandle(_obj_newObject("label")); obj.label38:setParent(obj.layout16); obj.label38:setLeft(0); obj.label38:setTop(0); obj.label38:setWidth(100); obj.label38:setHeight(25); obj.label38:setHorzTextAlign("center"); obj.label38:setText("Reg. de Fadiga"); obj.label38:setName("label38"); obj.edit24 = gui.fromHandle(_obj_newObject("edit")); obj.edit24:setParent(obj.layout16); obj.edit24:setLeft(100); obj.edit24:setTop(0); obj.edit24:setWidth(50); obj.edit24:setHeight(25); obj.edit24:setHorzTextAlign("center"); obj.edit24:setField("beneficioRegFadiga"); obj.edit24:setName("edit24"); obj.layout17 = gui.fromHandle(_obj_newObject("layout")); obj.layout17:setParent(obj.rectangle12); obj.layout17:setLeft(0); obj.layout17:setTop(275); obj.layout17:setWidth(155); obj.layout17:setHeight(25); obj.layout17:setName("layout17"); obj.label39 = gui.fromHandle(_obj_newObject("label")); obj.label39:setParent(obj.layout17); obj.label39:setLeft(0); obj.label39:setTop(0); obj.label39:setWidth(100); obj.label39:setHeight(25); obj.label39:setHorzTextAlign("center"); obj.label39:setText("Conjuração"); obj.label39:setName("label39"); obj.edit25 = gui.fromHandle(_obj_newObject("edit")); obj.edit25:setParent(obj.layout17); obj.edit25:setLeft(100); obj.edit25:setTop(0); obj.edit25:setWidth(50); obj.edit25:setHeight(25); obj.edit25:setHorzTextAlign("center"); obj.edit25:setField("beneficioConjuração"); obj.edit25:setName("edit25"); obj.layout18 = gui.fromHandle(_obj_newObject("layout")); obj.layout18:setParent(obj.rectangle12); obj.layout18:setLeft(155); obj.layout18:setTop(225); obj.layout18:setWidth(155); obj.layout18:setHeight(25); obj.layout18:setName("layout18"); obj.label40 = gui.fromHandle(_obj_newObject("label")); obj.label40:setParent(obj.layout18); obj.label40:setLeft(0); obj.label40:setTop(0); obj.label40:setWidth(100); obj.label40:setHeight(25); obj.label40:setHorzTextAlign("center"); obj.label40:setText("Ampliação"); obj.label40:setName("label40"); obj.edit26 = gui.fromHandle(_obj_newObject("edit")); obj.edit26:setParent(obj.layout18); obj.edit26:setLeft(100); obj.edit26:setTop(0); obj.edit26:setWidth(50); obj.edit26:setHeight(25); obj.edit26:setHorzTextAlign("center"); obj.edit26:setField("beneficioAmpliacao"); obj.edit26:setName("edit26"); obj.layout19 = gui.fromHandle(_obj_newObject("layout")); obj.layout19:setParent(obj.rectangle12); obj.layout19:setLeft(155); obj.layout19:setTop(250); obj.layout19:setWidth(155); obj.layout19:setHeight(25); obj.layout19:setName("layout19"); obj.label41 = gui.fromHandle(_obj_newObject("label")); obj.label41:setParent(obj.layout19); obj.label41:setLeft(0); obj.label41:setTop(0); obj.label41:setWidth(100); obj.label41:setHeight(25); obj.label41:setHorzTextAlign("center"); obj.label41:setText("Negação"); obj.label41:setName("label41"); obj.edit27 = gui.fromHandle(_obj_newObject("edit")); obj.edit27:setParent(obj.layout19); obj.edit27:setLeft(100); obj.edit27:setTop(0); obj.edit27:setWidth(50); obj.edit27:setHeight(25); obj.edit27:setHorzTextAlign("center"); obj.edit27:setField("beneficioNegacao"); obj.edit27:setName("edit27"); obj.layout20 = gui.fromHandle(_obj_newObject("layout")); obj.layout20:setParent(obj.rectangle12); obj.layout20:setLeft(155); obj.layout20:setTop(275); obj.layout20:setWidth(155); obj.layout20:setHeight(25); obj.layout20:setName("layout20"); obj.label42 = gui.fromHandle(_obj_newObject("label")); obj.label42:setParent(obj.layout20); obj.label42:setLeft(0); obj.label42:setTop(0); obj.label42:setWidth(100); obj.label42:setHeight(25); obj.label42:setHorzTextAlign("center"); obj.label42:setText("Esquiva"); obj.label42:setName("label42"); obj.edit28 = gui.fromHandle(_obj_newObject("edit")); obj.edit28:setParent(obj.layout20); obj.edit28:setLeft(100); obj.edit28:setTop(0); obj.edit28:setWidth(50); obj.edit28:setHeight(25); obj.edit28:setHorzTextAlign("center"); obj.edit28:setField("beneficioEsquiva"); obj.edit28:setName("edit28"); obj.label43 = gui.fromHandle(_obj_newObject("label")); obj.label43:setParent(obj.rectangle12); obj.label43:setLeft(0); obj.label43:setTop(300); obj.label43:setWidth(310); obj.label43:setHeight(20); obj.label43:setHorzTextAlign("center"); obj.label43:setText("Redutores"); obj.label43:setName("label43"); obj.layout21 = gui.fromHandle(_obj_newObject("layout")); obj.layout21:setParent(obj.rectangle12); obj.layout21:setLeft(5); obj.layout21:setTop(325); obj.layout21:setWidth(75); obj.layout21:setHeight(25); obj.layout21:setName("layout21"); obj.label44 = gui.fromHandle(_obj_newObject("label")); obj.label44:setParent(obj.layout21); obj.label44:setLeft(0); obj.label44:setTop(0); obj.label44:setWidth(50); obj.label44:setHeight(25); obj.label44:setHorzTextAlign("center"); obj.label44:setText("Físi."); obj.label44:setName("label44"); obj.edit29 = gui.fromHandle(_obj_newObject("edit")); obj.edit29:setParent(obj.layout21); obj.edit29:setLeft(50); obj.edit29:setTop(0); obj.edit29:setWidth(25); obj.edit29:setHeight(25); obj.edit29:setHorzTextAlign("center"); obj.edit29:setField("redutorFisico"); obj.edit29:setName("edit29"); obj.layout22 = gui.fromHandle(_obj_newObject("layout")); obj.layout22:setParent(obj.rectangle12); obj.layout22:setLeft(80); obj.layout22:setTop(325); obj.layout22:setWidth(75); obj.layout22:setHeight(25); obj.layout22:setName("layout22"); obj.label45 = gui.fromHandle(_obj_newObject("label")); obj.label45:setParent(obj.layout22); obj.label45:setLeft(0); obj.label45:setTop(0); obj.label45:setWidth(50); obj.label45:setHeight(25); obj.label45:setHorzTextAlign("center"); obj.label45:setText("Para."); obj.label45:setName("label45"); obj.edit30 = gui.fromHandle(_obj_newObject("edit")); obj.edit30:setParent(obj.layout22); obj.edit30:setLeft(50); obj.edit30:setTop(0); obj.edit30:setWidth(25); obj.edit30:setHeight(25); obj.edit30:setHorzTextAlign("center"); obj.edit30:setField("redutorParanormal"); obj.edit30:setName("edit30"); obj.layout23 = gui.fromHandle(_obj_newObject("layout")); obj.layout23:setParent(obj.rectangle12); obj.layout23:setLeft(155); obj.layout23:setTop(325); obj.layout23:setWidth(75); obj.layout23:setHeight(25); obj.layout23:setName("layout23"); obj.label46 = gui.fromHandle(_obj_newObject("label")); obj.label46:setParent(obj.layout23); obj.label46:setLeft(0); obj.label46:setTop(0); obj.label46:setWidth(50); obj.label46:setHeight(25); obj.label46:setHorzTextAlign("center"); obj.label46:setText("Corr."); obj.label46:setName("label46"); obj.edit31 = gui.fromHandle(_obj_newObject("edit")); obj.edit31:setParent(obj.layout23); obj.edit31:setLeft(50); obj.edit31:setTop(0); obj.edit31:setWidth(25); obj.edit31:setHeight(25); obj.edit31:setHorzTextAlign("center"); obj.edit31:setField("redutorCorrosivo"); obj.edit31:setName("edit31"); obj.layout24 = gui.fromHandle(_obj_newObject("layout")); obj.layout24:setParent(obj.rectangle12); obj.layout24:setLeft(230); obj.layout24:setTop(325); obj.layout24:setWidth(75); obj.layout24:setHeight(25); obj.layout24:setName("layout24"); obj.label47 = gui.fromHandle(_obj_newObject("label")); obj.label47:setParent(obj.layout24); obj.label47:setLeft(0); obj.label47:setTop(0); obj.label47:setWidth(50); obj.label47:setHeight(25); obj.label47:setHorzTextAlign("center"); obj.label47:setText("Proj."); obj.label47:setName("label47"); obj.edit32 = gui.fromHandle(_obj_newObject("edit")); obj.edit32:setParent(obj.layout24); obj.edit32:setLeft(50); obj.edit32:setTop(0); obj.edit32:setWidth(25); obj.edit32:setHeight(25); obj.edit32:setHorzTextAlign("center"); obj.edit32:setField("redutorProjetil"); obj.edit32:setName("edit32"); obj.rectangle13 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle13:setParent(obj.scrollBox1); obj.rectangle13:setLeft(315); obj.rectangle13:setTop(65); obj.rectangle13:setWidth(285); obj.rectangle13:setHeight(240); obj.rectangle13:setColor("black"); obj.rectangle13:setStrokeColor("white"); obj.rectangle13:setStrokeSize(1); obj.rectangle13:setName("rectangle13"); obj.label48 = gui.fromHandle(_obj_newObject("label")); obj.label48:setParent(obj.rectangle13); obj.label48:setLeft(0); obj.label48:setTop(5); obj.label48:setWidth(285); obj.label48:setHeight(25); obj.label48:setHorzTextAlign("center"); obj.label48:setText("Atributos"); obj.label48:setName("label48"); obj.label49 = gui.fromHandle(_obj_newObject("label")); obj.label49:setParent(obj.rectangle13); obj.label49:setLeft(75); obj.label49:setTop(30); obj.label49:setWidth(50); obj.label49:setHeight(25); obj.label49:setHorzTextAlign("center"); obj.label49:setText("Total"); obj.label49:setName("label49"); obj.label50 = gui.fromHandle(_obj_newObject("label")); obj.label50:setParent(obj.rectangle13); obj.label50:setLeft(125); obj.label50:setTop(30); obj.label50:setWidth(50); obj.label50:setHeight(25); obj.label50:setHorzTextAlign("center"); obj.label50:setText("Perícia"); obj.label50:setName("label50"); obj.label51 = gui.fromHandle(_obj_newObject("label")); obj.label51:setParent(obj.rectangle13); obj.label51:setLeft(175); obj.label51:setTop(30); obj.label51:setWidth(50); obj.label51:setHeight(25); obj.label51:setHorzTextAlign("center"); obj.label51:setText("Nível"); obj.label51:setName("label51"); obj.label52 = gui.fromHandle(_obj_newObject("label")); obj.label52:setParent(obj.rectangle13); obj.label52:setLeft(225); obj.label52:setTop(30); obj.label52:setWidth(50); obj.label52:setHeight(25); obj.label52:setHorzTextAlign("center"); obj.label52:setText("Adicional"); obj.label52:setFontSize(11); obj.label52:setName("label52"); obj.label53 = gui.fromHandle(_obj_newObject("label")); obj.label53:setParent(obj.rectangle13); obj.label53:setLeft(0); obj.label53:setTop(55); obj.label53:setWidth(75); obj.label53:setHeight(25); obj.label53:setHorzTextAlign("center"); obj.label53:setText("Agilidade"); obj.label53:setFontSize(13); obj.label53:setName("label53"); obj.rectangle14 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle14:setParent(obj.rectangle13); obj.rectangle14:setLeft(75); obj.rectangle14:setTop(55); obj.rectangle14:setWidth(50); obj.rectangle14:setHeight(25); obj.rectangle14:setColor("black"); obj.rectangle14:setStrokeColor("white"); obj.rectangle14:setStrokeSize(1); obj.rectangle14:setName("rectangle14"); obj.label54 = gui.fromHandle(_obj_newObject("label")); obj.label54:setParent(obj.rectangle13); obj.label54:setLeft(75); obj.label54:setTop(55); obj.label54:setWidth(50); obj.label54:setHeight(25); obj.label54:setHorzTextAlign("center"); obj.label54:setField("agilidade_total"); obj.label54:setName("label54"); obj.rectangle15 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle15:setParent(obj.rectangle13); obj.rectangle15:setLeft(125); obj.rectangle15:setTop(55); obj.rectangle15:setWidth(50); obj.rectangle15:setHeight(25); obj.rectangle15:setColor("black"); obj.rectangle15:setStrokeColor("white"); obj.rectangle15:setStrokeSize(1); obj.rectangle15:setName("rectangle15"); obj.label55 = gui.fromHandle(_obj_newObject("label")); obj.label55:setParent(obj.rectangle13); obj.label55:setLeft(125); obj.label55:setTop(55); obj.label55:setWidth(50); obj.label55:setHeight(25); obj.label55:setHorzTextAlign("center"); obj.label55:setField("agilidade_inicial"); obj.label55:setName("label55"); obj.edit33 = gui.fromHandle(_obj_newObject("edit")); obj.edit33:setParent(obj.rectangle13); obj.edit33:setLeft(175); obj.edit33:setTop(55); obj.edit33:setWidth(50); obj.edit33:setHeight(25); obj.edit33:setField("agilidade_nivel"); obj.edit33:setHorzTextAlign("center"); obj.edit33:setType("number"); obj.edit33:setName("edit33"); obj.edit34 = gui.fromHandle(_obj_newObject("edit")); obj.edit34:setParent(obj.rectangle13); obj.edit34:setLeft(225); obj.edit34:setTop(55); obj.edit34:setWidth(50); obj.edit34:setHeight(25); obj.edit34:setField("agilidade_outros"); obj.edit34:setHorzTextAlign("center"); obj.edit34:setType("number"); obj.edit34:setName("edit34"); obj.dataLink4 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink4:setParent(obj.rectangle13); obj.dataLink4:setFields({'agilidade_inicial', 'agilidade_nivel', 'agilidade_outros'}); obj.dataLink4:setName("dataLink4"); obj.label56 = gui.fromHandle(_obj_newObject("label")); obj.label56:setParent(obj.rectangle13); obj.label56:setLeft(0); obj.label56:setTop(80); obj.label56:setWidth(75); obj.label56:setHeight(25); obj.label56:setHorzTextAlign("center"); obj.label56:setText("Corpo-a-Corpo"); obj.label56:setFontSize(10); obj.label56:setName("label56"); obj.rectangle16 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle16:setParent(obj.rectangle13); obj.rectangle16:setLeft(75); obj.rectangle16:setTop(80); obj.rectangle16:setWidth(50); obj.rectangle16:setHeight(25); obj.rectangle16:setColor("black"); obj.rectangle16:setStrokeColor("white"); obj.rectangle16:setStrokeSize(1); obj.rectangle16:setName("rectangle16"); obj.label57 = gui.fromHandle(_obj_newObject("label")); obj.label57:setParent(obj.rectangle13); obj.label57:setLeft(75); obj.label57:setTop(80); obj.label57:setWidth(50); obj.label57:setHeight(25); obj.label57:setHorzTextAlign("center"); obj.label57:setField("cac_total"); obj.label57:setName("label57"); obj.rectangle17 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle17:setParent(obj.rectangle13); obj.rectangle17:setLeft(125); obj.rectangle17:setTop(80); obj.rectangle17:setWidth(50); obj.rectangle17:setHeight(25); obj.rectangle17:setColor("black"); obj.rectangle17:setStrokeColor("white"); obj.rectangle17:setStrokeSize(1); obj.rectangle17:setName("rectangle17"); obj.label58 = gui.fromHandle(_obj_newObject("label")); obj.label58:setParent(obj.rectangle13); obj.label58:setLeft(125); obj.label58:setTop(80); obj.label58:setWidth(50); obj.label58:setHeight(25); obj.label58:setHorzTextAlign("center"); obj.label58:setField("cac_inicial"); obj.label58:setName("label58"); obj.edit35 = gui.fromHandle(_obj_newObject("edit")); obj.edit35:setParent(obj.rectangle13); obj.edit35:setLeft(175); obj.edit35:setTop(80); obj.edit35:setWidth(50); obj.edit35:setHeight(25); obj.edit35:setField("cac_nivel"); obj.edit35:setHorzTextAlign("center"); obj.edit35:setType("number"); obj.edit35:setName("edit35"); obj.edit36 = gui.fromHandle(_obj_newObject("edit")); obj.edit36:setParent(obj.rectangle13); obj.edit36:setLeft(225); obj.edit36:setTop(80); obj.edit36:setWidth(50); obj.edit36:setHeight(25); obj.edit36:setField("cac_outros"); obj.edit36:setHorzTextAlign("center"); obj.edit36:setType("number"); obj.edit36:setName("edit36"); obj.dataLink5 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink5:setParent(obj.rectangle13); obj.dataLink5:setFields({'cac_inicial', 'cac_nivel', 'cac_outros'}); obj.dataLink5:setName("dataLink5"); obj.label59 = gui.fromHandle(_obj_newObject("label")); obj.label59:setParent(obj.rectangle13); obj.label59:setLeft(0); obj.label59:setTop(105); obj.label59:setWidth(75); obj.label59:setHeight(25); obj.label59:setHorzTextAlign("center"); obj.label59:setText("Manuseio"); obj.label59:setFontSize(13); obj.label59:setName("label59"); obj.rectangle18 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle18:setParent(obj.rectangle13); obj.rectangle18:setLeft(75); obj.rectangle18:setTop(105); obj.rectangle18:setWidth(50); obj.rectangle18:setHeight(25); obj.rectangle18:setColor("black"); obj.rectangle18:setStrokeColor("white"); obj.rectangle18:setStrokeSize(1); obj.rectangle18:setName("rectangle18"); obj.label60 = gui.fromHandle(_obj_newObject("label")); obj.label60:setParent(obj.rectangle13); obj.label60:setLeft(75); obj.label60:setTop(105); obj.label60:setWidth(50); obj.label60:setHeight(25); obj.label60:setHorzTextAlign("center"); obj.label60:setField("manuseio_total"); obj.label60:setName("label60"); obj.rectangle19 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle19:setParent(obj.rectangle13); obj.rectangle19:setLeft(125); obj.rectangle19:setTop(105); obj.rectangle19:setWidth(50); obj.rectangle19:setHeight(25); obj.rectangle19:setColor("black"); obj.rectangle19:setStrokeColor("white"); obj.rectangle19:setStrokeSize(1); obj.rectangle19:setName("rectangle19"); obj.label61 = gui.fromHandle(_obj_newObject("label")); obj.label61:setParent(obj.rectangle13); obj.label61:setLeft(125); obj.label61:setTop(105); obj.label61:setWidth(50); obj.label61:setHeight(25); obj.label61:setHorzTextAlign("center"); obj.label61:setField("manuseio_inicial"); obj.label61:setName("label61"); obj.edit37 = gui.fromHandle(_obj_newObject("edit")); obj.edit37:setParent(obj.rectangle13); obj.edit37:setLeft(175); obj.edit37:setTop(105); obj.edit37:setWidth(50); obj.edit37:setHeight(25); obj.edit37:setField("manuseio_nivel"); obj.edit37:setHorzTextAlign("center"); obj.edit37:setType("number"); obj.edit37:setName("edit37"); obj.edit38 = gui.fromHandle(_obj_newObject("edit")); obj.edit38:setParent(obj.rectangle13); obj.edit38:setLeft(225); obj.edit38:setTop(105); obj.edit38:setWidth(50); obj.edit38:setHeight(25); obj.edit38:setField("manuseio_outros"); obj.edit38:setHorzTextAlign("center"); obj.edit38:setType("number"); obj.edit38:setName("edit38"); obj.dataLink6 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink6:setParent(obj.rectangle13); obj.dataLink6:setFields({'manuseio_inicial', 'manuseio_nivel', 'manuseio_outros'}); obj.dataLink6:setName("dataLink6"); obj.label62 = gui.fromHandle(_obj_newObject("label")); obj.label62:setParent(obj.rectangle13); obj.label62:setLeft(0); obj.label62:setTop(130); obj.label62:setWidth(75); obj.label62:setHeight(25); obj.label62:setHorzTextAlign("center"); obj.label62:setText("Pontaria"); obj.label62:setFontSize(13); obj.label62:setName("label62"); obj.rectangle20 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle20:setParent(obj.rectangle13); obj.rectangle20:setLeft(75); obj.rectangle20:setTop(130); obj.rectangle20:setWidth(50); obj.rectangle20:setHeight(25); obj.rectangle20:setColor("black"); obj.rectangle20:setStrokeColor("white"); obj.rectangle20:setStrokeSize(1); obj.rectangle20:setName("rectangle20"); obj.label63 = gui.fromHandle(_obj_newObject("label")); obj.label63:setParent(obj.rectangle13); obj.label63:setLeft(75); obj.label63:setTop(130); obj.label63:setWidth(50); obj.label63:setHeight(25); obj.label63:setHorzTextAlign("center"); obj.label63:setField("pontaria_total"); obj.label63:setName("label63"); obj.rectangle21 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle21:setParent(obj.rectangle13); obj.rectangle21:setLeft(125); obj.rectangle21:setTop(130); obj.rectangle21:setWidth(50); obj.rectangle21:setHeight(25); obj.rectangle21:setColor("black"); obj.rectangle21:setStrokeColor("white"); obj.rectangle21:setStrokeSize(1); obj.rectangle21:setName("rectangle21"); obj.label64 = gui.fromHandle(_obj_newObject("label")); obj.label64:setParent(obj.rectangle13); obj.label64:setLeft(125); obj.label64:setTop(130); obj.label64:setWidth(50); obj.label64:setHeight(25); obj.label64:setHorzTextAlign("center"); obj.label64:setField("pontaria_inicial"); obj.label64:setName("label64"); obj.edit39 = gui.fromHandle(_obj_newObject("edit")); obj.edit39:setParent(obj.rectangle13); obj.edit39:setLeft(175); obj.edit39:setTop(130); obj.edit39:setWidth(50); obj.edit39:setHeight(25); obj.edit39:setField("pontaria_nivel"); obj.edit39:setHorzTextAlign("center"); obj.edit39:setType("number"); obj.edit39:setName("edit39"); obj.edit40 = gui.fromHandle(_obj_newObject("edit")); obj.edit40:setParent(obj.rectangle13); obj.edit40:setLeft(225); obj.edit40:setTop(130); obj.edit40:setWidth(50); obj.edit40:setHeight(25); obj.edit40:setField("pontaria_outros"); obj.edit40:setHorzTextAlign("center"); obj.edit40:setType("number"); obj.edit40:setName("edit40"); obj.dataLink7 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink7:setParent(obj.rectangle13); obj.dataLink7:setFields({'pontaria_inicial', 'pontaria_nivel', 'pontaria_outros'}); obj.dataLink7:setName("dataLink7"); obj.label65 = gui.fromHandle(_obj_newObject("label")); obj.label65:setParent(obj.rectangle13); obj.label65:setLeft(0); obj.label65:setTop(155); obj.label65:setWidth(75); obj.label65:setHeight(25); obj.label65:setHorzTextAlign("center"); obj.label65:setText("Paranormalidade"); obj.label65:setFontSize(9); obj.label65:setName("label65"); obj.rectangle22 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle22:setParent(obj.rectangle13); obj.rectangle22:setLeft(75); obj.rectangle22:setTop(155); obj.rectangle22:setWidth(50); obj.rectangle22:setHeight(25); obj.rectangle22:setColor("black"); obj.rectangle22:setStrokeColor("white"); obj.rectangle22:setStrokeSize(1); obj.rectangle22:setName("rectangle22"); obj.label66 = gui.fromHandle(_obj_newObject("label")); obj.label66:setParent(obj.rectangle13); obj.label66:setLeft(75); obj.label66:setTop(155); obj.label66:setWidth(50); obj.label66:setHeight(25); obj.label66:setHorzTextAlign("center"); obj.label66:setField("paranormalidade_total"); obj.label66:setName("label66"); obj.rectangle23 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle23:setParent(obj.rectangle13); obj.rectangle23:setLeft(125); obj.rectangle23:setTop(155); obj.rectangle23:setWidth(50); obj.rectangle23:setHeight(25); obj.rectangle23:setColor("black"); obj.rectangle23:setStrokeColor("white"); obj.rectangle23:setStrokeSize(1); obj.rectangle23:setName("rectangle23"); obj.label67 = gui.fromHandle(_obj_newObject("label")); obj.label67:setParent(obj.rectangle13); obj.label67:setLeft(125); obj.label67:setTop(155); obj.label67:setWidth(50); obj.label67:setHeight(25); obj.label67:setHorzTextAlign("center"); obj.label67:setField("paranormalidade_inicial"); obj.label67:setName("label67"); obj.edit41 = gui.fromHandle(_obj_newObject("edit")); obj.edit41:setParent(obj.rectangle13); obj.edit41:setLeft(175); obj.edit41:setTop(155); obj.edit41:setWidth(50); obj.edit41:setHeight(25); obj.edit41:setField("paranormalidade_nivel"); obj.edit41:setHorzTextAlign("center"); obj.edit41:setType("number"); obj.edit41:setName("edit41"); obj.edit42 = gui.fromHandle(_obj_newObject("edit")); obj.edit42:setParent(obj.rectangle13); obj.edit42:setLeft(225); obj.edit42:setTop(155); obj.edit42:setWidth(50); obj.edit42:setHeight(25); obj.edit42:setField("paranormalidade_outros"); obj.edit42:setHorzTextAlign("center"); obj.edit42:setType("number"); obj.edit42:setName("edit42"); obj.dataLink8 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink8:setParent(obj.rectangle13); obj.dataLink8:setFields({'paranormalidade_inicial', 'paranormalidade_nivel', 'paranormalidade_outros'}); obj.dataLink8:setName("dataLink8"); obj.label68 = gui.fromHandle(_obj_newObject("label")); obj.label68:setParent(obj.rectangle13); obj.label68:setLeft(0); obj.label68:setTop(180); obj.label68:setWidth(75); obj.label68:setHeight(25); obj.label68:setHorzTextAlign("center"); obj.label68:setText("Sorte"); obj.label68:setFontSize(13); obj.label68:setName("label68"); obj.rectangle24 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle24:setParent(obj.rectangle13); obj.rectangle24:setLeft(75); obj.rectangle24:setTop(180); obj.rectangle24:setWidth(50); obj.rectangle24:setHeight(25); obj.rectangle24:setColor("black"); obj.rectangle24:setStrokeColor("white"); obj.rectangle24:setStrokeSize(1); obj.rectangle24:setName("rectangle24"); obj.label69 = gui.fromHandle(_obj_newObject("label")); obj.label69:setParent(obj.rectangle13); obj.label69:setLeft(75); obj.label69:setTop(180); obj.label69:setWidth(50); obj.label69:setHeight(25); obj.label69:setHorzTextAlign("center"); obj.label69:setField("sorte_total"); obj.label69:setName("label69"); obj.rectangle25 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle25:setParent(obj.rectangle13); obj.rectangle25:setLeft(125); obj.rectangle25:setTop(180); obj.rectangle25:setWidth(50); obj.rectangle25:setHeight(25); obj.rectangle25:setColor("black"); obj.rectangle25:setStrokeColor("white"); obj.rectangle25:setStrokeSize(1); obj.rectangle25:setName("rectangle25"); obj.label70 = gui.fromHandle(_obj_newObject("label")); obj.label70:setParent(obj.rectangle13); obj.label70:setLeft(125); obj.label70:setTop(180); obj.label70:setWidth(50); obj.label70:setHeight(25); obj.label70:setHorzTextAlign("center"); obj.label70:setField("sorte_inicial"); obj.label70:setName("label70"); obj.edit43 = gui.fromHandle(_obj_newObject("edit")); obj.edit43:setParent(obj.rectangle13); obj.edit43:setLeft(175); obj.edit43:setTop(180); obj.edit43:setWidth(50); obj.edit43:setHeight(25); obj.edit43:setField("sorte_nivel"); obj.edit43:setHorzTextAlign("center"); obj.edit43:setType("number"); obj.edit43:setName("edit43"); obj.edit44 = gui.fromHandle(_obj_newObject("edit")); obj.edit44:setParent(obj.rectangle13); obj.edit44:setLeft(225); obj.edit44:setTop(180); obj.edit44:setWidth(50); obj.edit44:setHeight(25); obj.edit44:setField("sorte_outros"); obj.edit44:setHorzTextAlign("center"); obj.edit44:setType("number"); obj.edit44:setName("edit44"); obj.dataLink9 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink9:setParent(obj.rectangle13); obj.dataLink9:setFields({'sorte_inicial', 'sorte_nivel', 'sorte_outros'}); obj.dataLink9:setName("dataLink9"); obj.rectangle26 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle26:setParent(obj.rectangle13); obj.rectangle26:setLeft(15); obj.rectangle26:setTop(210); obj.rectangle26:setWidth(50); obj.rectangle26:setHeight(25); obj.rectangle26:setColor("black"); obj.rectangle26:setStrokeColor("white"); obj.rectangle26:setStrokeSize(1); obj.rectangle26:setName("rectangle26"); obj.atr_max = gui.fromHandle(_obj_newObject("label")); obj.atr_max:setParent(obj.rectangle13); obj.atr_max:setLeft(15); obj.atr_max:setTop(210); obj.atr_max:setWidth(50); obj.atr_max:setHeight(25); obj.atr_max:setHorzTextAlign("center"); obj.atr_max:setField("atr_max"); obj.atr_max:setName("atr_max"); obj.rectangle27 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle27:setParent(obj.rectangle13); obj.rectangle27:setLeft(75); obj.rectangle27:setTop(210); obj.rectangle27:setWidth(50); obj.rectangle27:setHeight(25); obj.rectangle27:setColor("black"); obj.rectangle27:setStrokeColor("white"); obj.rectangle27:setStrokeSize(1); obj.rectangle27:setName("rectangle27"); obj.label71 = gui.fromHandle(_obj_newObject("label")); obj.label71:setParent(obj.rectangle13); obj.label71:setLeft(75); obj.label71:setTop(210); obj.label71:setWidth(50); obj.label71:setHeight(25); obj.label71:setHorzTextAlign("center"); obj.label71:setField("sum_total"); obj.label71:setName("label71"); obj.rectangle28 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle28:setParent(obj.rectangle13); obj.rectangle28:setLeft(125); obj.rectangle28:setTop(210); obj.rectangle28:setWidth(50); obj.rectangle28:setHeight(25); obj.rectangle28:setColor("black"); obj.rectangle28:setStrokeColor("white"); obj.rectangle28:setStrokeSize(1); obj.rectangle28:setName("rectangle28"); obj.label72 = gui.fromHandle(_obj_newObject("label")); obj.label72:setParent(obj.rectangle13); obj.label72:setLeft(125); obj.label72:setTop(210); obj.label72:setWidth(50); obj.label72:setHeight(25); obj.label72:setHorzTextAlign("center"); obj.label72:setField("sum_inicial"); obj.label72:setName("label72"); obj.rectangle29 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle29:setParent(obj.rectangle13); obj.rectangle29:setLeft(175); obj.rectangle29:setTop(210); obj.rectangle29:setWidth(50); obj.rectangle29:setHeight(25); obj.rectangle29:setColor("black"); obj.rectangle29:setStrokeColor("white"); obj.rectangle29:setStrokeSize(1); obj.rectangle29:setName("rectangle29"); obj.label73 = gui.fromHandle(_obj_newObject("label")); obj.label73:setParent(obj.rectangle13); obj.label73:setLeft(175); obj.label73:setTop(210); obj.label73:setWidth(50); obj.label73:setHeight(25); obj.label73:setHorzTextAlign("center"); obj.label73:setField("sum_nivel"); obj.label73:setName("label73"); obj.dataLink10 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink10:setParent(obj.rectangle13); obj.dataLink10:setFields({'atr_max','sum_total'}); obj.dataLink10:setName("dataLink10"); obj.dataLink11 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink11:setParent(obj.rectangle13); obj.dataLink11:setFields({'cac_total'}); obj.dataLink11:setName("dataLink11"); obj.dataLink12 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink12:setParent(obj.rectangle13); obj.dataLink12:setFields({'paranormalidade_total'}); obj.dataLink12:setName("dataLink12"); obj.dataLink13 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink13:setParent(obj.rectangle13); obj.dataLink13:setFields({'sum_inicial', 'sum_nivel'}); obj.dataLink13:setName("dataLink13"); obj.dataLink14 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink14:setParent(obj.rectangle13); obj.dataLink14:setFields({'agilidade_inicial', 'cac_inicial', 'manuseio_inicial', 'pontaria_inicial', 'paranormalidade_inicial', 'sorte_inicial'}); obj.dataLink14:setName("dataLink14"); obj.dataLink15 = gui.fromHandle(_obj_newObject("dataLink")); obj.dataLink15:setParent(obj.rectangle13); obj.dataLink15:setFields({'agilidade_nivel', 'cac_nivel', 'manuseio_nivel', 'pontaria_nivel', 'paranormalidade_nivel', 'sorte_nivel'}); obj.dataLink15:setName("dataLink15"); obj.rectangle30 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle30:setParent(obj.scrollBox1); obj.rectangle30:setLeft(315); obj.rectangle30:setTop(310); obj.rectangle30:setWidth(910); obj.rectangle30:setHeight(370); obj.rectangle30:setColor("black"); obj.rectangle30:setStrokeColor("white"); obj.rectangle30:setStrokeSize(1); obj.rectangle30:setName("rectangle30"); obj.label74 = gui.fromHandle(_obj_newObject("label")); obj.label74:setParent(obj.rectangle30); obj.label74:setLeft(0); obj.label74:setTop(5); obj.label74:setWidth(460); obj.label74:setHeight(25); obj.label74:setHorzTextAlign("trailing"); obj.label74:setText("Habilidades"); obj.label74:setName("label74"); obj.label75 = gui.fromHandle(_obj_newObject("label")); obj.label75:setParent(obj.rectangle30); obj.label75:setLeft(0); obj.label75:setTop(5); obj.label75:setWidth(870); obj.label75:setHeight(25); obj.label75:setHorzTextAlign("trailing"); obj.label75:setText("Estágio"); obj.label75:setFontSize(11); obj.label75:setName("label75"); obj.rectangle31 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle31:setParent(obj.rectangle30); obj.rectangle31:setLeft(460); obj.rectangle31:setTop(5); obj.rectangle31:setWidth(50); obj.rectangle31:setHeight(25); obj.rectangle31:setColor("black"); obj.rectangle31:setStrokeColor("white"); obj.rectangle31:setStrokeSize(1); obj.rectangle31:setName("rectangle31"); obj.label76 = gui.fromHandle(_obj_newObject("label")); obj.label76:setParent(obj.rectangle30); obj.label76:setLeft(460); obj.label76:setTop(5); obj.label76:setWidth(50); obj.label76:setHeight(25); obj.label76:setHorzTextAlign("center"); obj.label76:setField("habilidadesNivel"); obj.label76:setName("label76"); obj.rectangle32 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle32:setParent(obj.rectangle30); obj.rectangle32:setLeft(510); obj.rectangle32:setTop(5); obj.rectangle32:setWidth(50); obj.rectangle32:setHeight(25); obj.rectangle32:setColor("black"); obj.rectangle32:setStrokeColor("white"); obj.rectangle32:setStrokeSize(1); obj.rectangle32:setName("rectangle32"); obj.label77 = gui.fromHandle(_obj_newObject("label")); obj.label77:setParent(obj.rectangle30); obj.label77:setLeft(510); obj.label77:setTop(5); obj.label77:setWidth(50); obj.label77:setHeight(25); obj.label77:setHorzTextAlign("center"); obj.label77:setField("habilidadesDisponivel"); obj.label77:setName("label77"); obj.rclHabilidades = gui.fromHandle(_obj_newObject("recordList")); obj.rclHabilidades:setParent(obj.rectangle30); obj.rclHabilidades:setLeft(5); obj.rclHabilidades:setTop(30); obj.rclHabilidades:setWidth(900); obj.rclHabilidades:setHeight(335); obj.rclHabilidades:setName("rclHabilidades"); obj.rclHabilidades:setField("listaDeHabilidades"); obj.rclHabilidades:setTemplateForm("frmAbilities"); obj.rclHabilidades:setLayout("vertical"); obj.rclHabilidades:setMinQt(5); obj.rectangle33 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle33:setParent(obj.scrollBox1); obj.rectangle33:setLeft(605); obj.rectangle33:setTop(0); obj.rectangle33:setWidth(305); obj.rectangle33:setHeight(305); obj.rectangle33:setColor("black"); obj.rectangle33:setStrokeColor("white"); obj.rectangle33:setStrokeSize(1); obj.rectangle33:setName("rectangle33"); obj.image1 = gui.fromHandle(_obj_newObject("image")); obj.image1:setParent(obj.scrollBox1); obj.image1:setLeft(606); obj.image1:setTop(1); obj.image1:setWidth(303); obj.image1:setHeight(303); obj.image1:setField("avatar"); obj.image1:setEditable(true); obj.image1:setStyle("autoFit"); obj.image1:setName("image1"); obj.rectangle34 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle34:setParent(obj.scrollBox1); obj.rectangle34:setLeft(915); obj.rectangle34:setTop(0); obj.rectangle34:setWidth(310); obj.rectangle34:setHeight(195); obj.rectangle34:setColor("black"); obj.rectangle34:setStrokeColor("white"); obj.rectangle34:setStrokeSize(1); obj.rectangle34:setName("rectangle34"); obj.label78 = gui.fromHandle(_obj_newObject("label")); obj.label78:setParent(obj.rectangle34); obj.label78:setLeft(0); obj.label78:setTop(5); obj.label78:setWidth(310); obj.label78:setHeight(25); obj.label78:setHorzTextAlign("center"); obj.label78:setText("Ultimato"); obj.label78:setName("label78"); obj.textEditor1 = gui.fromHandle(_obj_newObject("textEditor")); obj.textEditor1:setParent(obj.rectangle34); obj.textEditor1:setLeft(5); obj.textEditor1:setTop(30); obj.textEditor1:setWidth(300); obj.textEditor1:setHeight(160); obj.textEditor1:setField("ultimato"); obj.textEditor1:setName("textEditor1"); obj.rectangle35 = gui.fromHandle(_obj_newObject("rectangle")); obj.rectangle35:setParent(obj.scrollBox1); obj.rectangle35:setLeft(915); obj.rectangle35:setTop(200); obj.rectangle35:setWidth(310); obj.rectangle35:setHeight(105); obj.rectangle35:setColor("black"); obj.rectangle35:setStrokeColor("white"); obj.rectangle35:setStrokeSize(1); obj.rectangle35:setName("rectangle35"); obj.label79 = gui.fromHandle(_obj_newObject("label")); obj.label79:setParent(obj.rectangle35); obj.label79:setLeft(0); obj.label79:setTop(5); obj.label79:setWidth(310); obj.label79:setHeight(25); obj.label79:setHorzTextAlign("center"); obj.label79:setText("Privilégio"); obj.label79:setName("label79"); obj.textEditor2 = gui.fromHandle(_obj_newObject("textEditor")); obj.textEditor2:setParent(obj.rectangle35); obj.textEditor2:setLeft(5); obj.textEditor2:setTop(30); obj.textEditor2:setWidth(300); obj.textEditor2:setHeight(70); obj.textEditor2:setField("privilegio"); obj.textEditor2:setName("textEditor2"); obj._e_event0 = obj.edit2:addEventListener("onChange", function (self) if sheet==nil then return end; local mod = (tonumber(sheet.experiencia) or 0); local mod2 = 0; local mod3 = 0; while mod>=mod2 do mod3 = mod3+1; mod2 = mod2 + mod3*5; end sheet.nivel = mod3; end, obj); obj._e_event1 = obj.comboBox1:addEventListener("onChange", function (self) if sheet==nil then return end; -- Alquimista if sheet.aptidao == "1" then sheet.agilidade_inicial = 1; sheet.cac_inicial = 1; sheet.manuseio_inicial = 4; sheet.pontaria_inicial = 2; sheet.paranormalidade_inicial = 2; sheet.sorte_inicial = 3; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[Optimização (Passiva) Estágio 1-3: Itens Consumíveis têm seus efeitos ampliados a cada Estágio desta Habilidade. Estágio 2: Recebe mais do mesmo Item do tipo Consumível. Estágio 3: Equipamentos concedem 20% a mais de Resistência.]] end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[Círculo de Alquimia (Instantânea) Estágio 1: Cria uma área que concede Vigor ao Personagem sobre ela (1-6pt + 1pt p/ Rodada). Estágio 2-3(+1): Copia a última Habilidade usada por um Aliado no Círculo (+ efeito). Estágio 3(+1): Receber Dano no Círculo restitui parte da Fadiga gasta na Rodada (+ efeito).]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[As Três Etapas Estágio 1: Mistura Itens Consumíveis para lhes dar novos efeitos (1pt). Estágio 2: A mistura de Itens libera Dano Paranormal em área no processo (2pt). Estágio 3: Fundir Itens iguais concede a versão Superior que pode ser guardado (1pt).]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[Colecionador (Passiva) Estágio 1: Aprimora o estaque de Itens iguais. Estágio 2: Recebe Itens extras de Drops. Estágio 3: Melhora as chances no texte de Drop. ]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[Transmutação Estágio 1-3: Modifica a Arma que empunha para outra do mesmo tipo (1pt p/ Rodada). Estágio 2(+1): Pode usar Transmutação na Arma do Aliado no Círculo (+ efeito). Estágio 3(+1): Usa mais Fadiga para conceder Aprimoramentos à Arma (xpt). ]] end; -- Arcanista elseif sheet.aptidao=="2" then sheet.agilidade_inicial = 1; sheet.cac_inicial = 1; sheet.manuseio_inicial = 2; sheet.pontaria_inicial = 3; sheet.paranormalidade_inicial = 4; sheet.sorte_inicial = 2; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[6º Sentido (Passiva): Estágio 1-3: Ganha 2 pontos de Fadiga máximos a cada Estágio desta Habilidade. Estágio 2: Concede bônus de Conjuração. Estágio 3: Habilidades do Arcanista causam Dano Paranormal aumentado.]] end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[Aura Protetora (Instantânea): Estágio 1: Concede uma Aura a um Personagem que nega Dano recebido (1pt). Estágio 2(+1): Cria mais Auras Protetoras na mesma Ação (máx. 3pt). Estágio 3(+1): Aumenta a força das Aura Protetoras (+ efeito)(máx. 3pt p/ Aura).]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[Símbolo Arcano: Estágio 1: Concede uma marca de energia Paranormal a um Personagem (1pt p/ estaque)(máx. 3pt). Estágio 2(+1): A marca concede bônus de Conjuração e Ampliação ao portador (+ efeito). Estágio 3(+1): A marca concede Imunidade ao portador (+ efeito).]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[Essência Paranormal (Passiva): Estágio 1: Concede Amplificação. Estágio 2: Concede Negação passiva além de causar Negação escalável a cada Habilidade no mesmo Inimigo. Estágio 3: Concede Regeneração de Fadiga baseado no Nível do Personagem.]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[Conjuração Telecinética: Estágio 1: Usa Telecinese para flutuar um Inimigo ou um objeto (1pt p/ Rodada). Estágio 2(+1): Telecinese Paralisa Inimigos e causa Dano Paranormal (2pt p/ Inimigo). Estágio 3(+2): Gastar mais Fadiga aumenta o Dano Paranormal da Telecinese (+ efeito)(máx. 3pt p/ Telecinese).]] end; -- Caçador elseif sheet.aptidao=="3" then sheet.agilidade_inicial = 3; sheet.cac_inicial = 1; sheet.manuseio_inicial = 2; sheet.pontaria_inicial = 4; sheet.paranormalidade_inicial = 1; sheet.sorte_inicial = 2; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[Focus (Passiva) Estágio 1: O Caçador tem passivamente 40% de resistência a Desaceleração e Imobilização. Estágio 1-3: Concede aumento da chance de Esquiva a cada Estágio desta Habilidade. Estágio 3: Concede passivamente Dano ampliado para lançamentos de Pontaria.]] end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[Armadilha Estágio 1: Em modo Furtivo posiciona até duas Armadilhas em campo (1 Mat.). Estágio 2-3(+1): Causa Atordoamento e Desaceleração em Inimigos que ativarem uma Armadilha (+ efeito). Estágio 3(+1): Confecciona Armadilhas mais fortes usando mais Materiais (+ efeito)(máx. 3 Mat. p/ Armadilha).]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[Veterano na Caçada (Passiva) Estágio 1: Materiais para Armadilha não consomem espaço no Inventário. Estágio 1-3: A cada Estágio melhora a técnica de Arrombamento. Estágio 3: Amplifica os efeitos do modo Furtivo.]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[Furtividade (Instantânea) Estágio 1: Entra em modo Furtivo se não for alvo de ataques (1pt p/ Rodada). Estágio 2(+1): Entrar em modo Furtivo não consome a Ação (+ efeito). Estágio 3(+1): Entrar em modo Furtivo retira Desaceleração, Paralização, Imobilização e Atordoamento (+ efeito)(2pt).]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[Letalidade Silenciosa Estágio 1: Em modo Furtivo utiliza um ataque de Dano Físico elevado se estiver atrás do Inimigo (2pt). Estágio 2(+1): Se esta Habilidade derrotar o Inimigo seu custo de Fadiga é restituído (+ efeito) Estágio 3(+1): Se esta Habilidade derrotar o Inimigo Caçador não sai do modo Furtivo (+ efeito).]] end; -- Cavaleiro elseif sheet.aptidao=="4" then sheet.agilidade_inicial = 3; sheet.cac_inicial = 4; sheet.manuseio_inicial = 1; sheet.pontaria_inicial = 2; sheet.paranormalidade_inicial = 1; sheet.sorte_inicial = 2; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[Constituição (Passiva) Estágio 1: É Imune à Paralisação, Impelimento e Atordoamento proveniente de ataques Físicos. Estágio 1-3: Concede aumento de Resistência Física a cada Estágio desta Habilidade. Estágio 3: Concede passivamente Dano ampliado para lançamentos de Corpo-a-Corpo.]] end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[Brado de Glória Estágio 1: Provoca Inimigos Físicos em campo e recebe redução de Dano Físico (2pt). Estágio 2(+1): Concede Vigor de Corpo-a-Corpo contra Inimigos Provocados (+ efeito). Estágio 3(+1): Enquanto houver Inimigos Provocados pelo Brado de Glória, concede Amplificação (+ efeito).]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[Força Destrutiva Estágio 1: Aplica um golpe com Dano Físico elevado (1pt). Estágio 2(+1): Pode concentrar mais Dano em Força Destrutiva (+ efeito)(máx. 3pt). Estágio 3(+1): Esta Habilidade causa Paralisação e Fratura ao alvo (+ efeito).]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[Mestre da Batalha (Passiva) Estágio 1: Concede Regeneração de Vida baseado no Nível do Personagem. Estágio 2: Crítico de Corpo-a-Corpo causa ainda mais Dano Físico. Estágio 3: Cavaleiro não pode perder mais de 30% da sua Vida máxima em uma Rodada. ]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[Defesa Inabalável (Instantânea) Estágio 1: Concede um teste que reduz muito o Dano Físico recebido (1pt). Estágio 2: Defesa não consome a Ação. (+ efeito). Estágio 3: Concede Contra-Ataque após a Defesa. (+efeito).]] end; -- Monge elseif sheet.aptidao=="5" then sheet.agilidade_inicial = 4; sheet.cac_inicial = 3; sheet.manuseio_inicial = 2; sheet.pontaria_inicial = 1; sheet.paranormalidade_inicial = 2; sheet.sorte_inicial = 1; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[Taijutsu (Passiva) Estágio 1: Pode atacar sem usar Armas (2 de Dano Físico)(sem Dano Crítico). Estágio 1-3: Aumenta a chance de Crítico para o lançamento de CaC a cada Estágio desta Habilidade. Estágio 3: Consome menos Ação para dar Bloqueio.]] end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[O Estilo Secreto Estágio 1: Acerto Crítico de Taijutsu concede chance de usar Taijutsu novamente (1pt). Estágio 2-3(+1): O número de repetições desta Habilidade é o mesmo de seu Estágio (1pt p/ repetição). Estágio 3: Acerto Crítico da Palma do Dragão e do Estilo do Leopardo ativam o Estilo Secreto (+efeito). ]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[Chacra (Passiva) Estágio 1: Ataques do Monge causam Impelimento escalável a cada golpe no mesmo Inimigo. Estágio 2: Concede Taijutsu Sacerdotal (Paranormalidade também ativa o Estilo Secreto). Estágio 3: Causar três vezes Dano a um Inimigo, na mesma Rodada, o deixa Silenciado. ]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[A Palma do Dragão (Instantânea) Estágio 1: Causa todo Dano Físico recebido na Rodada em Dano a um Inimigo + Dano do Taijutsu (2pt). Estágio 2(+1): Palma do Dragão como Contra-Ataque não consome a Ação (+ efeito). Estágio 3(+1): Reverte Status Anormais recebidos no ataque Inimigo (+efeito). ]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[O Estilo do Leopardo Estágio 1: Ataca dois Inimigos com o Dano do Taijutsu (1pt). Estágio 2(+1): Pode encadear mais Inimigos , porém, o lançamento fica mais difícil a cada golpe (1pt p/ repetição). Estágio 3(+1): Depois de atacar três Inimigos pode atacar novamente o primeiro o deixando Fragilizado (+ efeito). ]] end; -- Necromante elseif sheet.aptidao=="6" then sheet.agilidade_inicial = 1; sheet.cac_inicial = 1; sheet.manuseio_inicial = 2; sheet.pontaria_inicial = 3; sheet.paranormalidade_inicial = 4; sheet.sorte_inicial = 2; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[Profanador Sanguinolento (Passiva) Estágio 1: Ataques e Habilidades do Necromante causam Dano do tipo Corrosivo, caso queira. Estágio 1-3: Concede 10% de resistência a Status Anormais a cada Estágio desta Habilidade. Estágio 3: Inimigos com Sangramento e Envenenamento recebem Dano ampliado do Necromante. ]] end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[Reanimação Estágio 1: Reanima um Inimigo Inconsciente ao seu favor na Batalha (x pontos de Vida + 1 ponto de Vida p/ Rodada). Estágio 2(+1): Ordena o Inimigo reanimado a utilizar uma Habilidade sua, porém, ele morre em seguida (1-3pt). Estágio 3(+1): Reanima mais Inimigos Inconscientes em campo (+ efeito)(x pontos de Vida p/ Inimigo).]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[Exército de Almas (Instantânea) Estágio 1: Invoca a alma dos Inimigos Inconscientes no campo para atacar adversários ou defender a si e Aliados (2pt). Estágio 2(+1): Dependendo da quantidade de almas atacantes causa Status Anormais variados aos alvos (+ efeito) Estágio 3(+1): Exército de Almas não consome a Ação (+ efeito).]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[Hemodominus Estágio 1: Absorve parte da Vida de um Inimigo do tipo Físico em campo (1pt). Estágio 2: Inimigos atingidos pelo Hemodominus recebem Sangramento (+efeito). Estágio 3: Pode aumentar a quantidade de absorção de Vida (máx. 3pt).]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[Senhor da Morte (Passiva) Estágio 1: Concede Negação baseada no Nível do Personagem. Estágio 2: Concede aumento dos efeitos causados pelos Status Anormais aplicados pelas Habilidades do Necromante. Estágio 3: Concede Regeneração de Vida e Fadiga (não regenera caso esteja usando "Reanimação").]] end; -- Xamã elseif sheet.aptidao=="7" then sheet.agilidade_inicial = 2; sheet.cac_inicial = 3; sheet.manuseio_inicial = 2; sheet.pontaria_inicial = 2; sheet.paranormalidade_inicial = 3; sheet.sorte_inicial = 1; local habilidades = ndb.getChildNodes(sheet.listaDeHabilidades); if habilidades[1].habilidade == nil then habilidades[1].habilidade = [[Tatuagem Rúnica (Passiva) Estágio 1: Pode usar todos os pontos do Atributo nos testes de Resistência. Estágio 2: Sobre efeito de Status Anormais Xamã ganha redução de Dano aumentado. Estágio 1-3: Ganha 3 pontos de Vida máximos a cada Estágio desta Habilidade. ]]end; if habilidades[2].habilidade == nil then habilidades[2].habilidade = [[Oração Ancestral (Instantânea) Estágio 1: Concede Vigor a Aliados, mas Xamã fica Atordoado (xpt + 1pt p/ Rodada). Estágio 2(+1): Aliados com Vigor desta Habilidade recebem redução de Dano aumentado (+ efeito). Estágio 3(+1): Aliados com Vigor desta Habilidade recebem Resistência a Status Anormais aumentado (+ efeito).]] end; if habilidades[3].habilidade == nil then habilidades[3].habilidade = [[O Voo Sagrado do Condor Estágio 1: Colide contra um Inimigo o Paralisando e Provocando os demais (1pt). Estágio 2(+1): Inimigos Provocados ficam Atordoados para ataques sobre o Xamã (+ efeito). Estágio 3(+1): O Inimigo colidido pelo Xamã perde Tenacidade, Aceleração e recebe Desaceleração (+ efeito).]] end; if habilidades[4].habilidade == nil then habilidades[4].habilidade = [[O Chamado dos Espíritos (Passiva) Estágio 1: Inimigos derrotados com ajuda de Oração Ancestral curam um pouco da Vida do Xamã. Estágio 2: Curas excedentes desta Habilidade curam Aliados ao invés do Xamã. Estágio 3: A cura desta Habilidade remove Status Anormais.]] end; if habilidades[5].habilidade == nil then habilidades[5].habilidade = [[Chama Violeta Estágio 1: Cura um pouco da Vida de um Aliado (1pt). Estágio 2(+1): Aumenta a quantidade de Cura ou a quantidade de Aliados curados (máx. 3pt). Estágio 3(+1): Chama Violeta concede Ampliação (+ efeito).]] end; end; end, obj); obj._e_event2 = obj.edit3:addEventListener("onChange", function (self) if sheet==nil then return end; local mod = (tonumber(sheet.progresso) or 0); local mod2 = 0; local mod3 = 0; while mod>=mod2 do mod3 = mod3+1; mod2 = mod2 + mod3*5; end sheet.rank = mod3; end, obj); obj._e_event3 = obj.dataLink1:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local nivel = (tonumber(sheet.nivel) or 0); sheet.vidaBase = 5 + (nivel * 3); sheet.fadigaBase = 1 + (nivel * 2); sheet.atr_max = 64 + (nivel * 3); sheet.habilidadesDisponivel = math.min((nivel * 2) + 1, 15); end, obj); obj._e_event4 = obj.dataLink2:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local vida = (tonumber(sheet.vidaBase) or 0) + (tonumber(sheet.vidaCompensacao) or 0); sheet.vidaAtual = vida; end, obj); obj._e_event5 = obj.dataLink3:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local fadiga = (tonumber(sheet.fadigaBase) or 0) + (tonumber(sheet.fadigaCompensacao) or 0); sheet.fadigaAtual = fadiga; end, obj); obj._e_event6 = obj.dataLink4:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local total = (tonumber(sheet.agilidade_inicial) or 0) + (tonumber(sheet.agilidade_nivel) or 0) + (tonumber(sheet.agilidade_outros) or 0); sheet.agilidade_total = total; end, obj); obj._e_event7 = obj.dataLink5:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local total = (tonumber(sheet.cac_inicial) or 0) + (tonumber(sheet.cac_nivel) or 0) + (tonumber(sheet.cac_outros) or 0); sheet.cac_total = total; end, obj); obj._e_event8 = obj.dataLink6:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local total = (tonumber(sheet.manuseio_inicial) or 0) + (tonumber(sheet.manuseio_nivel) or 0) + (tonumber(sheet.manuseio_outros) or 0); sheet.manuseio_total = total; end, obj); obj._e_event9 = obj.dataLink7:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local total = (tonumber(sheet.pontaria_inicial) or 0) + (tonumber(sheet.pontaria_nivel) or 0) + (tonumber(sheet.pontaria_outros) or 0); sheet.pontaria_total = total; end, obj); obj._e_event10 = obj.dataLink8:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local total = (tonumber(sheet.paranormalidade_inicial) or 0) + (tonumber(sheet.paranormalidade_nivel) or 0) + (tonumber(sheet.paranormalidade_outros) or 0); sheet.paranormalidade_total = total; end, obj); obj._e_event11 = obj.dataLink9:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local total = (tonumber(sheet.sorte_inicial) or 0) + (tonumber(sheet.sorte_nivel) or 0) + (tonumber(sheet.sorte_outros) or 0); sheet.sorte_total = total; end, obj); obj._e_event12 = obj.dataLink10:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local max = tonumber(sheet.atr_max) or 0; local gastos = tonumber(sheet.sum_total) or 0; if max > gastos then self.atr_max.fontColor = "#00FF00"; elseif max < gastos then self.atr_max.fontColor = "#FF0000"; else self.atr_max.fontColor = "#FFFFFF"; end; end, obj); obj._e_event13 = obj.dataLink11:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local res = (tonumber(sheet.cac_total) or 0); res = math.floor(res/2); end, obj); obj._e_event14 = obj.dataLink12:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local res = (tonumber(sheet.paranormalidade_total) or 0); res = math.floor(res/2); end, obj); obj._e_event15 = obj.dataLink13:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local sum = (tonumber(sheet.sum_inicial) or 0) + (tonumber(sheet.sum_nivel) or 0); sheet.sum_total = sum; end, obj); obj._e_event16 = obj.dataLink14:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local sum = (tonumber(sheet.agilidade_inicial) or 0) + (tonumber(sheet.cac_inicial) or 0) + (tonumber(sheet.manuseio_inicial) or 0) + (tonumber(sheet.pontaria_inicial) or 0) + (tonumber(sheet.paranormalidade_inicial) or 0) + (tonumber(sheet.sorte_inicial) or 0); sheet.sum_inicial = sum; end, obj); obj._e_event17 = obj.dataLink15:addEventListener("onChange", function (self, field, oldValue, newValue) if sheet==nil then return end; local sum = (tonumber(sheet.agilidade_nivel) or 0) + (tonumber(sheet.cac_nivel) or 0) + (tonumber(sheet.manuseio_nivel) or 0) + (tonumber(sheet.pontaria_nivel) or 0) + (tonumber(sheet.paranormalidade_nivel) or 0) + (tonumber(sheet.sorte_nivel) or 0); sheet.sum_nivel = sum; end, obj); obj._e_event18 = obj.rclHabilidades:addEventListener("onEndEnumeration", function (self) if sheet== nil then return end; local objetos = ndb.getChildNodes(sheet.listaDeHabilidades); if objetos[1].nivel == nil then objetos[1].nivel = 1; end; end, obj); obj._e_event19 = obj.image1:addEventListener("onStartDrag", function (self, drag, x, y) drag:addData("imageURL", sheet.avatar); end, obj); function obj:_releaseEvents() __o_rrpgObjs.removeEventListenerById(self._e_event19); __o_rrpgObjs.removeEventListenerById(self._e_event18); __o_rrpgObjs.removeEventListenerById(self._e_event17); __o_rrpgObjs.removeEventListenerById(self._e_event16); __o_rrpgObjs.removeEventListenerById(self._e_event15); __o_rrpgObjs.removeEventListenerById(self._e_event14); __o_rrpgObjs.removeEventListenerById(self._e_event13); __o_rrpgObjs.removeEventListenerById(self._e_event12); __o_rrpgObjs.removeEventListenerById(self._e_event11); __o_rrpgObjs.removeEventListenerById(self._e_event10); __o_rrpgObjs.removeEventListenerById(self._e_event9); __o_rrpgObjs.removeEventListenerById(self._e_event8); __o_rrpgObjs.removeEventListenerById(self._e_event7); __o_rrpgObjs.removeEventListenerById(self._e_event6); __o_rrpgObjs.removeEventListenerById(self._e_event5); __o_rrpgObjs.removeEventListenerById(self._e_event4); __o_rrpgObjs.removeEventListenerById(self._e_event3); __o_rrpgObjs.removeEventListenerById(self._e_event2); __o_rrpgObjs.removeEventListenerById(self._e_event1); __o_rrpgObjs.removeEventListenerById(self._e_event0); end; obj._oldLFMDestroy = obj.destroy; function obj:destroy() self:_releaseEvents(); if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then self:setNodeDatabase(nil); end; if self.edit20 ~= nil then self.edit20:destroy(); self.edit20 = nil; end; if self.rectangle34 ~= nil then self.rectangle34:destroy(); self.rectangle34 = nil; end; if self.label14 ~= nil then self.label14:destroy(); self.label14 = nil; end; if self.layout15 ~= nil then self.layout15:destroy(); self.layout15 = nil; end; if self.edit41 ~= nil then self.edit41:destroy(); self.edit41 = nil; end; if self.layout10 ~= nil then self.layout10:destroy(); self.layout10 = nil; end; if self.edit36 ~= nil then self.edit36:destroy(); self.edit36 = nil; end; if self.edit9 ~= nil then self.edit9:destroy(); self.edit9 = nil; end; if self.label40 ~= nil then self.label40:destroy(); self.label40 = nil; end; if self.label43 ~= nil then self.label43:destroy(); self.label43 = nil; end; if self.edit33 ~= nil then self.edit33:destroy(); self.edit33 = nil; end; if self.dataLink4 ~= nil then self.dataLink4:destroy(); self.dataLink4 = nil; end; if self.edit29 ~= nil then self.edit29:destroy(); self.edit29 = nil; end; if self.label77 ~= nil then self.label77:destroy(); self.label77 = nil; end; if self.rectangle35 ~= nil then self.rectangle35:destroy(); self.rectangle35 = nil; end; if self.layout17 ~= nil then self.layout17:destroy(); self.layout17 = nil; end; if self.edit28 ~= nil then self.edit28:destroy(); self.edit28 = nil; end; if self.label45 ~= nil then self.label45:destroy(); self.label45 = nil; end; if self.label57 ~= nil then self.label57:destroy(); self.label57 = nil; end; if self.label71 ~= nil then self.label71:destroy(); self.label71 = nil; end; if self.rectangle16 ~= nil then self.rectangle16:destroy(); self.rectangle16 = nil; end; if self.label75 ~= nil then self.label75:destroy(); self.label75 = nil; end; if self.label63 ~= nil then self.label63:destroy(); self.label63 = nil; end; if self.label22 ~= nil then self.label22:destroy(); self.label22 = nil; end; if self.layout24 ~= nil then self.layout24:destroy(); self.layout24 = nil; end; if self.label70 ~= nil then self.label70:destroy(); self.label70 = nil; end; if self.layout13 ~= nil then self.layout13:destroy(); self.layout13 = nil; end; if self.label35 ~= nil then self.label35:destroy(); self.label35 = nil; end; if self.label13 ~= nil then self.label13:destroy(); self.label13 = nil; end; if self.layout8 ~= nil then self.layout8:destroy(); self.layout8 = nil; end; if self.label27 ~= nil then self.label27:destroy(); self.label27 = nil; end; if self.label59 ~= nil then self.label59:destroy(); self.label59 = nil; end; if self.layout23 ~= nil then self.layout23:destroy(); self.layout23 = nil; end; if self.label68 ~= nil then self.label68:destroy(); self.label68 = nil; end; if self.rclHabilidades ~= nil then self.rclHabilidades:destroy(); self.rclHabilidades = nil; end; if self.label67 ~= nil then self.label67:destroy(); self.label67 = nil; end; if self.rectangle5 ~= nil then self.rectangle5:destroy(); self.rectangle5 = nil; end; if self.label8 ~= nil then self.label8:destroy(); self.label8 = nil; end; if self.edit26 ~= nil then self.edit26:destroy(); self.edit26 = nil; end; if self.label69 ~= nil then self.label69:destroy(); self.label69 = nil; end; if self.edit34 ~= nil then self.edit34:destroy(); self.edit34 = nil; end; if self.edit11 ~= nil then self.edit11:destroy(); self.edit11 = nil; end; if self.layout9 ~= nil then self.layout9:destroy(); self.layout9 = nil; end; if self.label31 ~= nil then self.label31:destroy(); self.label31 = nil; end; if self.edit19 ~= nil then self.edit19:destroy(); self.edit19 = nil; end; if self.image1 ~= nil then self.image1:destroy(); self.image1 = nil; end; if self.rectangle17 ~= nil then self.rectangle17:destroy(); self.rectangle17 = nil; end; if self.label34 ~= nil then self.label34:destroy(); self.label34 = nil; end; if self.edit5 ~= nil then self.edit5:destroy(); self.edit5 = nil; end; if self.label15 ~= nil then self.label15:destroy(); self.label15 = nil; end; if self.dataLink9 ~= nil then self.dataLink9:destroy(); self.dataLink9 = nil; end; if self.label41 ~= nil then self.label41:destroy(); self.label41 = nil; end; if self.label49 ~= nil then self.label49:destroy(); self.label49 = nil; end; if self.label72 ~= nil then self.label72:destroy(); self.label72 = nil; end; if self.rectangle15 ~= nil then self.rectangle15:destroy(); self.rectangle15 = nil; end; if self.label12 ~= nil then self.label12:destroy(); self.label12 = nil; end; if self.rectangle33 ~= nil then self.rectangle33:destroy(); self.rectangle33 = nil; end; if self.atr_max ~= nil then self.atr_max:destroy(); self.atr_max = nil; end; if self.rectangle28 ~= nil then self.rectangle28:destroy(); self.rectangle28 = nil; end; if self.label16 ~= nil then self.label16:destroy(); self.label16 = nil; end; if self.label52 ~= nil then self.label52:destroy(); self.label52 = nil; end; if self.edit10 ~= nil then self.edit10:destroy(); self.edit10 = nil; end; if self.edit16 ~= nil then self.edit16:destroy(); self.edit16 = nil; end; if self.edit31 ~= nil then self.edit31:destroy(); self.edit31 = nil; end; if self.label47 ~= nil then self.label47:destroy(); self.label47 = nil; end; if self.edit1 ~= nil then self.edit1:destroy(); self.edit1 = nil; end; if self.label48 ~= nil then self.label48:destroy(); self.label48 = nil; end; if self.comboBox2 ~= nil then self.comboBox2:destroy(); self.comboBox2 = nil; end; if self.label76 ~= nil then self.label76:destroy(); self.label76 = nil; end; if self.rectangle26 ~= nil then self.rectangle26:destroy(); self.rectangle26 = nil; end; if self.label78 ~= nil then self.label78:destroy(); self.label78 = nil; end; if self.label1 ~= nil then self.label1:destroy(); self.label1 = nil; end; if self.rectangle7 ~= nil then self.rectangle7:destroy(); self.rectangle7 = nil; end; if self.layout4 ~= nil then self.layout4:destroy(); self.layout4 = nil; end; if self.label58 ~= nil then self.label58:destroy(); self.label58 = nil; end; if self.comboBox1 ~= nil then self.comboBox1:destroy(); self.comboBox1 = nil; end; if self.layout5 ~= nil then self.layout5:destroy(); self.layout5 = nil; end; if self.layout20 ~= nil then self.layout20:destroy(); self.layout20 = nil; end; if self.edit23 ~= nil then self.edit23:destroy(); self.edit23 = nil; end; if self.layout18 ~= nil then self.layout18:destroy(); self.layout18 = nil; end; if self.dataLink3 ~= nil then self.dataLink3:destroy(); self.dataLink3 = nil; end; if self.label56 ~= nil then self.label56:destroy(); self.label56 = nil; end; if self.label29 ~= nil then self.label29:destroy(); self.label29 = nil; end; if self.dataLink7 ~= nil then self.dataLink7:destroy(); self.dataLink7 = nil; end; if self.rectangle2 ~= nil then self.rectangle2:destroy(); self.rectangle2 = nil; end; if self.rectangle6 ~= nil then self.rectangle6:destroy(); self.rectangle6 = nil; end; if self.rectangle23 ~= nil then self.rectangle23:destroy(); self.rectangle23 = nil; end; if self.label21 ~= nil then self.label21:destroy(); self.label21 = nil; end; if self.edit40 ~= nil then self.edit40:destroy(); self.edit40 = nil; end; if self.label30 ~= nil then self.label30:destroy(); self.label30 = nil; end; if self.dataLink6 ~= nil then self.dataLink6:destroy(); self.dataLink6 = nil; end; if self.dataLink2 ~= nil then self.dataLink2:destroy(); self.dataLink2 = nil; end; if self.label51 ~= nil then self.label51:destroy(); self.label51 = nil; end; if self.label19 ~= nil then self.label19:destroy(); self.label19 = nil; end; if self.edit38 ~= nil then self.edit38:destroy(); self.edit38 = nil; end; if self.dataLink15 ~= nil then self.dataLink15:destroy(); self.dataLink15 = nil; end; if self.rectangle12 ~= nil then self.rectangle12:destroy(); self.rectangle12 = nil; end; if self.label54 ~= nil then self.label54:destroy(); self.label54 = nil; end; if self.layout11 ~= nil then self.layout11:destroy(); self.layout11 = nil; end; if self.textEditor1 ~= nil then self.textEditor1:destroy(); self.textEditor1 = nil; end; if self.rectangle18 ~= nil then self.rectangle18:destroy(); self.rectangle18 = nil; end; if self.rectangle14 ~= nil then self.rectangle14:destroy(); self.rectangle14 = nil; end; if self.edit6 ~= nil then self.edit6:destroy(); self.edit6 = nil; end; if self.label18 ~= nil then self.label18:destroy(); self.label18 = nil; end; if self.label2 ~= nil then self.label2:destroy(); self.label2 = nil; end; if self.edit3 ~= nil then self.edit3:destroy(); self.edit3 = nil; end; if self.label38 ~= nil then self.label38:destroy(); self.label38 = nil; end; if self.label62 ~= nil then self.label62:destroy(); self.label62 = nil; end; if self.rectangle32 ~= nil then self.rectangle32:destroy(); self.rectangle32 = nil; end; if self.layout14 ~= nil then self.layout14:destroy(); self.layout14 = nil; end; if self.edit27 ~= nil then self.edit27:destroy(); self.edit27 = nil; end; if self.layout16 ~= nil then self.layout16:destroy(); self.layout16 = nil; end; if self.layout21 ~= nil then self.layout21:destroy(); self.layout21 = nil; end; if self.edit18 ~= nil then self.edit18:destroy(); self.edit18 = nil; end; if self.edit25 ~= nil then self.edit25:destroy(); self.edit25 = nil; end; if self.scrollBox1 ~= nil then self.scrollBox1:destroy(); self.scrollBox1 = nil; end; if self.layout7 ~= nil then self.layout7:destroy(); self.layout7 = nil; end; if self.label33 ~= nil then self.label33:destroy(); self.label33 = nil; end; if self.rectangle11 ~= nil then self.rectangle11:destroy(); self.rectangle11 = nil; end; if self.label44 ~= nil then self.label44:destroy(); self.label44 = nil; end; if self.rectangle9 ~= nil then self.rectangle9:destroy(); self.rectangle9 = nil; end; if self.edit7 ~= nil then self.edit7:destroy(); self.edit7 = nil; end; if self.label55 ~= nil then self.label55:destroy(); self.label55 = nil; end; if self.edit12 ~= nil then self.edit12:destroy(); self.edit12 = nil; end; if self.rectangle21 ~= nil then self.rectangle21:destroy(); self.rectangle21 = nil; end; if self.label66 ~= nil then self.label66:destroy(); self.label66 = nil; end; if self.label73 ~= nil then self.label73:destroy(); self.label73 = nil; end; if self.edit35 ~= nil then self.edit35:destroy(); self.edit35 = nil; end; if self.label26 ~= nil then self.label26:destroy(); self.label26 = nil; end; if self.dataLink13 ~= nil then self.dataLink13:destroy(); self.dataLink13 = nil; end; if self.label23 ~= nil then self.label23:destroy(); self.label23 = nil; end; if self.label32 ~= nil then self.label32:destroy(); self.label32 = nil; end; if self.rectangle19 ~= nil then self.rectangle19:destroy(); self.rectangle19 = nil; end; if self.dataLink10 ~= nil then self.dataLink10:destroy(); self.dataLink10 = nil; end; if self.label24 ~= nil then self.label24:destroy(); self.label24 = nil; end; if self.layout3 ~= nil then self.layout3:destroy(); self.layout3 = nil; end; if self.dataLink5 ~= nil then self.dataLink5:destroy(); self.dataLink5 = nil; end; if self.label61 ~= nil then self.label61:destroy(); self.label61 = nil; end; if self.rectangle10 ~= nil then self.rectangle10:destroy(); self.rectangle10 = nil; end; if self.label65 ~= nil then self.label65:destroy(); self.label65 = nil; end; if self.layout1 ~= nil then self.layout1:destroy(); self.layout1 = nil; end; if self.rectangle22 ~= nil then self.rectangle22:destroy(); self.rectangle22 = nil; end; if self.rectangle1 ~= nil then self.rectangle1:destroy(); self.rectangle1 = nil; end; if self.rectangle29 ~= nil then self.rectangle29:destroy(); self.rectangle29 = nil; end; if self.label60 ~= nil then self.label60:destroy(); self.label60 = nil; end; if self.label64 ~= nil then self.label64:destroy(); self.label64 = nil; end; if self.edit24 ~= nil then self.edit24:destroy(); self.edit24 = nil; end; if self.layout12 ~= nil then self.layout12:destroy(); self.layout12 = nil; end; if self.edit14 ~= nil then self.edit14:destroy(); self.edit14 = nil; end; if self.dataLink8 ~= nil then self.dataLink8:destroy(); self.dataLink8 = nil; end; if self.edit4 ~= nil then self.edit4:destroy(); self.edit4 = nil; end; if self.edit44 ~= nil then self.edit44:destroy(); self.edit44 = nil; end; if self.dataLink14 ~= nil then self.dataLink14:destroy(); self.dataLink14 = nil; end; if self.label6 ~= nil then self.label6:destroy(); self.label6 = nil; end; if self.label4 ~= nil then self.label4:destroy(); self.label4 = nil; end; if self.textEditor2 ~= nil then self.textEditor2:destroy(); self.textEditor2 = nil; end; if self.rectangle25 ~= nil then self.rectangle25:destroy(); self.rectangle25 = nil; end; if self.label74 ~= nil then self.label74:destroy(); self.label74 = nil; end; if self.label37 ~= nil then self.label37:destroy(); self.label37 = nil; end; if self.edit8 ~= nil then self.edit8:destroy(); self.edit8 = nil; end; if self.layout19 ~= nil then self.layout19:destroy(); self.layout19 = nil; end; if self.edit2 ~= nil then self.edit2:destroy(); self.edit2 = nil; end; if self.label9 ~= nil then self.label9:destroy(); self.label9 = nil; end; if self.rectangle8 ~= nil then self.rectangle8:destroy(); self.rectangle8 = nil; end; if self.label28 ~= nil then self.label28:destroy(); self.label28 = nil; end; if self.label53 ~= nil then self.label53:destroy(); self.label53 = nil; end; if self.edit30 ~= nil then self.edit30:destroy(); self.edit30 = nil; end; if self.edit21 ~= nil then self.edit21:destroy(); self.edit21 = nil; end; if self.label42 ~= nil then self.label42:destroy(); self.label42 = nil; end; if self.edit43 ~= nil then self.edit43:destroy(); self.edit43 = nil; end; if self.rectangle20 ~= nil then self.rectangle20:destroy(); self.rectangle20 = nil; end; if self.label17 ~= nil then self.label17:destroy(); self.label17 = nil; end; if self.edit13 ~= nil then self.edit13:destroy(); self.edit13 = nil; end; if self.edit39 ~= nil then self.edit39:destroy(); self.edit39 = nil; end; if self.dataLink1 ~= nil then self.dataLink1:destroy(); self.dataLink1 = nil; end; if self.rectangle27 ~= nil then self.rectangle27:destroy(); self.rectangle27 = nil; end; if self.label36 ~= nil then self.label36:destroy(); self.label36 = nil; end; if self.rectangle3 ~= nil then self.rectangle3:destroy(); self.rectangle3 = nil; end; if self.edit37 ~= nil then self.edit37:destroy(); self.edit37 = nil; end; if self.label10 ~= nil then self.label10:destroy(); self.label10 = nil; end; if self.edit17 ~= nil then self.edit17:destroy(); self.edit17 = nil; end; if self.layout2 ~= nil then self.layout2:destroy(); self.layout2 = nil; end; if self.rectangle30 ~= nil then self.rectangle30:destroy(); self.rectangle30 = nil; end; if self.label46 ~= nil then self.label46:destroy(); self.label46 = nil; end; if self.label39 ~= nil then self.label39:destroy(); self.label39 = nil; end; if self.label79 ~= nil then self.label79:destroy(); self.label79 = nil; end; if self.rectangle31 ~= nil then self.rectangle31:destroy(); self.rectangle31 = nil; end; if self.label11 ~= nil then self.label11:destroy(); self.label11 = nil; end; if self.edit15 ~= nil then self.edit15:destroy(); self.edit15 = nil; end; if self.label3 ~= nil then self.label3:destroy(); self.label3 = nil; end; if self.label20 ~= nil then self.label20:destroy(); self.label20 = nil; end; if self.label25 ~= nil then self.label25:destroy(); self.label25 = nil; end; if self.label7 ~= nil then self.label7:destroy(); self.label7 = nil; end; if self.label50 ~= nil then self.label50:destroy(); self.label50 = nil; end; if self.edit42 ~= nil then self.edit42:destroy(); self.edit42 = nil; end; if self.edit22 ~= nil then self.edit22:destroy(); self.edit22 = nil; end; if self.label5 ~= nil then self.label5:destroy(); self.label5 = nil; end; if self.layout6 ~= nil then self.layout6:destroy(); self.layout6 = nil; end; if self.rectangle4 ~= nil then self.rectangle4:destroy(); self.rectangle4 = nil; end; if self.layout22 ~= nil then self.layout22:destroy(); self.layout22 = nil; end; if self.rectangle13 ~= nil then self.rectangle13:destroy(); self.rectangle13 = nil; end; if self.dataLink11 ~= nil then self.dataLink11:destroy(); self.dataLink11 = nil; end; if self.edit32 ~= nil then self.edit32:destroy(); self.edit32 = nil; end; if self.rectangle24 ~= nil then self.rectangle24:destroy(); self.rectangle24 = nil; end; if self.dataLink12 ~= nil then self.dataLink12:destroy(); self.dataLink12 = nil; end; self:_oldLFMDestroy(); end; obj:endUpdate(); __o_rrpgObjs.endObjectsLoading(); return obj; end; local _frmBase = { newEditor = newfrmBase, new = newfrmBase, name = "frmBase", dataType = "", formType = "undefined", formComponentName = "form", title = "", description=""}; frmBase = _frmBase; rrpg.registrarForm(_frmBase); return _frmBase;
--[[ Desc: Drawable base (high-layer) Author: SerDing Since: 2020-02-09 Alter: 2020-02-09 ]] local _Vector3 = require("utils.vector3") local _Vector2 = require("utils.vector2") local _Event = require("core.event") local _GRAPHICS = require("engine.graphics") local _Blendmode = require("engine.graphics.config.blendmode") local _Color = require("engine.graphics.config.color") local _Shader = require("engine.graphics.config.shader") local _Radian = require("engine.graphics.config.radian") ---@class Engine.Graphics.Drawable.Base ---@field protected _quad Quad ---@field protected _children table<number, Engine.Graphics.Drawable.Base> ---@field public order number local _Drawable = require("core.class")() local _eventNotifyMap = { position = "setPosition", scale = "setScale", origin = "setOrigin" } function _Drawable:Ctor() self._baseValues = { -- basic render values position = _Vector3.New(0, 0, 0), radian = _Radian.New(), scale = _Vector2.New(1, 1), origin = _Vector2.New(0, 0), blendmode = _Blendmode.New(), color = _Color.White(), shader = _Shader.New(), } self._upperValues = {} self._actualValues = { position = _Vector3.New(0, 0, 0), radian = _Radian.New(), scale = _Vector2.New(1, 1), origin = self._baseValues.origin, blendmode = self._baseValues.blendmode, color = _Color.White(), shader = self._baseValues.shader, } self._values = { -- simplified basic render values x = 0, y = 0, r = 0, sx = 1, sy = 1, ox = 0, oy = 0 } self.eventMap = { setPosition = _Event.New(), setScale = _Event.New(), setOrigin = _Event.New(), } self._quad = nil self._children = {} self.order = 0 end function _Drawable:Apply() self._actualValues.color:Apply() self._actualValues.blendmode:Apply() self._actualValues.shader:Apply() end function _Drawable:Draw(...) _Drawable.Apply(self) self._OnDraw(self, ...) _Drawable.Reset(self) end function _Drawable:Reset() -- self._actualValues.color:Reset() -- self._actualValues.blendmode:Reset() -- self._actualValues.shader:Reset() if self._upperValues.color then self._upperValues.color:Apply() end if self._upperValues.blendmode then self._upperValues.blendmode:Apply() end if self._upperValues.shader then self._upperValues.shader:Apply() end end --- draw an object of love2d drawable type ---@param obj Drawable function _Drawable:DrawObj(obj) local v = self._values if self._quad then _GRAPHICS.Draw(obj, self._quad, v.x, v.y, v.r, v.sx, v.sy, v.ox, v.oy) else _GRAPHICS.Draw(obj, v.x, v.y, v.r, v.sx, v.sy, v.ox, v.oy) end end function _Drawable:_OnDraw(...) end ---@param type string ---@param ... any function _Drawable:SetRenderValue(type, ...) self._baseValues[type]:Set(...) self:Merge(type) self:RefreshValues(type) for i=1,#self._children do self._children[i]:SetUpperValue(type, self._actualValues[type]) end local eventKey = _eventNotifyMap[type] if eventKey then self.eventMap[eventKey]:Notify() end end ---@param type string local function _NewValueObj(type, ...) local _newValuefns = { position = function () return _Vector3.New(0, 0, 0) end, radian = function () return _Radian.New(0) end, scale = function () return _Vector2.New(1, 1) end, origin = function () return _Vector2.New(0, 0) end, blendmode = function () return _Blendmode.New() end, color = function () return _Color.White() end, shader = function () return _Shader.New() end } return _newValuefns[type]() end ---@param type string ---@param value table function _Drawable:SetUpperValue(type, value) self._upperValues[type] = value self:Merge(type) self:RefreshValues(type) for i=1,#self._children do self._children[i]:SetUpperValue(type, self._actualValues[type]) end local eventKey = _eventNotifyMap[type] if eventKey then self.eventMap[eventKey]:Notify() end end ---@param type string function _Drawable:Merge(type) local mergeFuncs = { ---@param obj Engine.Graphics.Drawable.Base position = function (obj) if obj._upperValues.position then local bx, by, bz = obj._baseValues.position:Get() local ux, uy, uz = obj._upperValues.position:Get() obj._actualValues.position:Set(bx + ux, by + uy, bz + uz) else obj._actualValues.position:Set(obj._baseValues.position:Get()) end end, ---@param obj Engine.Graphics.Drawable.Base radian = function (obj) if obj._upperValues.radian then obj._actualValues.radian:Set(obj._baseValues.radian:Get(true) + obj._upperValues.radian:Get(true)) else obj._actualValues.radian:Set(obj._baseValues.radian:Get(true)) end end, ---@param obj Engine.Graphics.Drawable.Base scale = function (obj) if obj._upperValues.scale then local bx, by = obj._baseValues.scale:Get() local ux, uy = obj._upperValues.scale:Get() obj._actualValues.scale:Set(bx * ux, by * uy) else obj._actualValues.scale:Set(obj._baseValues.scale:Get()) end end, ---@param obj Engine.Graphics.Drawable.Base origin = function (obj) if obj._upperValues.origin then local bx, by = obj._baseValues.origin:Get() local ux, uy = obj._upperValues.origin:Get() obj._actualValues.origin:Set(bx + ux, by + uy) else obj._actualValues.origin:Set(obj._baseValues.origin:Get()) end end, ---@param obj Engine.Graphics.Drawable.Base blendmode = function (obj) obj._actualValues.blendmode = obj._baseValues.blendmode end, ---@param obj Engine.Graphics.Drawable.Base color = function (obj) if obj._upperValues.color then local br, bg, bb, ba = obj._baseValues.color:Get() local ur, ug, ub, ua = obj._upperValues.color:Get() obj._actualValues.color:Set(br * ur / 255, bg * ug / 255, bb * ub / 255, ba * ua / 255) else obj._actualValues.color:Set(obj._baseValues.color:Get()) end end, ---@param obj Engine.Graphics.Drawable.Base shader = function (obj) obj._actualValues.shader = obj._baseValues.shader end, } mergeFuncs[type](self) end ---@param type string function _Drawable:RefreshValues(type) local refreshFuncs = { ---@param obj Engine.Graphics.Drawable.Base position = function(obj) obj._values.x = obj._actualValues.position.x obj._values.y = obj._actualValues.position.y + obj._actualValues.position.z end, ---@param obj Engine.Graphics.Drawable.Base radian = function(obj) obj._values.r = obj._actualValues.radian:Get() end, ---@param obj Engine.Graphics.Drawable.Base scale = function(obj) obj._values.sx = obj._actualValues.scale.x obj._values.sy = obj._actualValues.scale.y end, ---@param obj Engine.Graphics.Drawable.Base origin = function(obj) obj._values.ox = obj._baseValues.origin.x obj._values.oy = obj._baseValues.origin.y end } if refreshFuncs[type] then refreshFuncs[type](self) end end ---@param type string ---@param relative boolean function _Drawable:GetRenderValue(type, relative) if relative then return self._baseValues[type]:Get() else return self._actualValues[type]:Get() end end ---@param quad Quad function _Drawable:SetQuad(quad) self._quad = quad end ---@param parentObj Engine.Graphics.Drawable.Base function _Drawable:SetParent(parentObj) for key, _ in pairs(self._baseValues) do self:SetUpperValue(key, parentObj._actualValues[key]) end end ---@param child Engine.Graphics.Drawable.Base function _Drawable:AddChild(child) self._children[#self._children + 1] = child end ---@param index int ---@return Engine.Graphics.Drawable.Base function _Drawable:GetChild(index) return self._children[index] end return _Drawable
-- -- _Control = { scene = { -- -- Escape ESC = function() Gamestate.current():onQuit() end, -- Direction - Analog AL = function(...) Gamestate.current():on('axis', ...) end, -- Direction - Up U = { on = function() Gamestate.current():on('axis', { y = -1 }) end, off = function() Gamestate.current():on('axis', { y = 0 }) end, }, -- Direction - Down D = { on = { function() Gamestate.current():on('axis', { y = 1 }) end, function() Gamestate.current():on('crouch') end, }, off = { function() Gamestate.current():on('axis', { y = 0 }) end, function() Gamestate.current():off('crouch') end, } }, -- Direction - Left L = { on = function() Gamestate.current():on('axis', { x = -1 }) end, off = { function() Gamestate.current():on('axis', { x = 0 }) end, function() Gamestate.current():off('dash') end, }, }, -- Direction - Right R = { on = function() Gamestate.current():on('axis', { x = 1 }) end, off = { function() Gamestate.current():on('axis', { x = 0 }) end, function() Gamestate.current():off('dash') end, }, }, -- (A) Attack Button A = function() Gamestate.current():on('attack', 'slash') end, -- (B) Jump Button B = { on = function() Gamestate.current():on('jump') end, off = function() Gamestate.current():off('jump') end, }, -- Reload Button R1 = function() Gamestate.current():on('reload') end, -- Aim Button R2 = { on = function() Gamestate.current():on('aim') end, off = function() Gamestate.current():off('aim') end, }, -- Combo - Aim/Fire ['R2+A'] = function() Gamestate.current():on('attack', 'arrow') end, -- Guard Button ['L1'] = { on = function() Gamestate.current():on('guard') end, off = function() Gamestate.current():off('guard') end, }, -- Combo - Roll ['D+J'] = function() Gamestate.current():on('roll') end, -- Combo - Dash ['R,R'] = function() Gamestate.current():on('dash') end, ['L,L'] = function() Gamestate.current():on('dash') end, } }
------------------------------------------------------------------------------- -- A test suite for Leg -- -- Author: Humberto Anjos -- Copyright (c) 2007 Leg -- -- $Id: test.lua,v 1.4 2007/12/07 14:23:56 hanjos Exp $ -- ------------------------------------------------------------------------------- print '==================== PARSER =====================' dofile 'test_parser.lua' print () print 'All done!'
function HealingWave( keys ) local caster = keys.caster local caster_location = caster:GetAbsOrigin() local target = keys.target local target_location = target:GetAbsOrigin() local ability = keys.ability local ability_level = ability:GetLevel() - 1 -- Ability variables local bounce_radius = ability:GetLevelSpecialValueFor("bounce_radius", ability_level) local max_targets = ability:GetLevelSpecialValueFor("max_targets", ability_level) local heal = ability:GetLevelSpecialValueFor("heal", ability_level) local unit_healed = false -- Particles local shadow_wave_particle = keys.healing_wave_particle -- Setting up the hit table local hit_table = {} -- If the target is not the caster then do the extra bounce for the caster if target ~= caster then -- Insert the caster into the hit table table.insert(hit_table, caster) -- Heal the caster caster:Heal(heal, caster) end -- Mark the target as already hit table.insert(hit_table, target) -- Heal the initial target target:Heal(heal, caster) -- we start from 2 first because we healed 1 target already for i = 2, max_targets do -- Helper variable to keep track if we healed a unit already unit_healed = false -- Find all the heroes in bounce radius local heroes = FindUnitsInRadius(caster:GetTeam(), target_location, nil, bounce_radius, ability:GetAbilityTargetTeam(), DOTA_UNIT_TARGET_HERO, 0, FIND_CLOSEST, false) -- HURT HEROES -- -- First we check for hurt heroes for _,unit in pairs(heroes) do local check_unit = 0 -- Helper variable to determine if a unit has been hit or not -- Checking the hit table to see if the unit is hit for c = 0, #hit_table do if hit_table[c] == unit then check_unit = 1 end end -- If its not hit then check if the unit is hurt if check_unit == 0 then if unit:GetHealth() ~= unit:GetMaxHealth() then -- After we find the hurt hero unit then we insert it into the hit table to keep track of it -- and we also get the unit position table.insert(hit_table, unit) local unit_location = unit:GetAbsOrigin() -- Create the particle for the visual effect local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster) ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true) ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true) -- Set the unit as the new target target = unit target_location = unit_location -- Heal it target:Heal(heal, caster) -- Set the helper variable to true unit_healed = true -- Exit the loop for finding hurt heroes break end end end -- Find all the units in bounce radius local units = FindUnitsInRadius(caster:GetTeam(), target_location, nil, bounce_radius, ability:GetAbilityTargetTeam(), DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_MECHANICAL, 0, FIND_CLOSEST, false) -- HURT UNITS -- -- check for hurt units if we havent healed a unit yet if not unit_healed then for _,unit in pairs(units) do local check_unit = 0 -- Helper variable to determine if the unit has been hit or not -- Checking the hit table to see if the unit is hit for c = 0, #hit_table do if hit_table[c] == unit then check_unit = 1 end end -- If its not hit then check if the unit is hurt if check_unit == 0 then if unit:GetHealth() ~= unit:GetMaxHealth() then -- After we find the hurt hero unit then we insert it into the hit table to keep track of it -- and we also get the unit position table.insert(hit_table, unit) local unit_location = unit:GetAbsOrigin() -- Create the particle for the visual effect local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster) ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true) ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true) -- Set the unit as the new target target = unit target_location = unit_location -- Heal it target:Heal(heal, caster) -- Set the helper variable to true unit_healed = true -- Exit the loop for finding hurt heroes break end end end end -- HEROES -- -- In this loop we search for valid heroes regardless if it is hurt or not -- Search only if we havent healed a unit yet if not unit_healed then for _,unit in pairs(heroes) do local check_unit = 0 -- Helper variable to determine if a unit has been hit or not -- Checking the hit table to see if the unit is hit for c = 0, #hit_table do if hit_table[c] == unit then check_unit = 1 end end -- If its not hit then do the bounce if check_unit == 0 then -- Insert the found unit into the hit table -- and we also get the unit position table.insert(hit_table, unit) local unit_location = unit:GetAbsOrigin() -- Create the particle for the visual effect local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster) ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true) ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true) -- Set the unit as the new target target = unit target_location = unit_location -- Heal it target:Heal(heal, caster) -- Set the helper variable to true unit_healed = true -- Exit the loop break end end end -- UNITS -- -- Search for units regardless if it is hurt or not -- Search only if we havent healed a unit yet if not unit_healed then for _,unit in pairs(units) do local check_unit = 0 -- Helper variable to determine if a unit has been hit or not -- Checking the hit table to see if the unit is hit for c = 0, #hit_table do if hit_table[c] == unit then check_unit = 1 end end -- If its not hit then do the bounce if check_unit == 0 then -- Insert the found unit into the hit table -- and we also get the unit position table.insert(hit_table, unit) local unit_location = unit:GetAbsOrigin() -- Create the particle for the visual effect local particle = ParticleManager:CreateParticle(shadow_wave_particle, PATTACH_CUSTOMORIGIN, caster) ParticleManager:SetParticleControlEnt(particle, 0, target, PATTACH_POINT_FOLLOW, "attach_hitloc", target_location, true) ParticleManager:SetParticleControlEnt(particle, 1, unit, PATTACH_POINT_FOLLOW, "attach_hitloc", unit_location, true) -- Set the unit as the new target target = unit target_location = unit_location -- Heal it target:Heal(heal, caster) -- Set the helper variable to true unit_healed = true -- Exit the loop for finding hurt heroes break end end end end end -- Handles AutoCast Logic function HealAutocast( event ) local caster = event.caster local ability = event.ability local autocast_radius = ability:GetSpecialValueFor("autocast_radius") -- Get if the ability is on autocast mode and cast the ability on a valid target if ability:GetAutoCastState() and ability:IsFullyCastable() then -- Find damaged targets in radius local target local allies = FindUnitsInRadius(caster:GetTeamNumber(), caster:GetAbsOrigin(), nil, autocast_radius, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO, 0, FIND_CLOSEST, false) for k,unit in pairs(allies) do if unit:GetHealthDeficit() > 150 then target = unit break end end if not target then return else caster:CastAbilityOnTarget(target, ability, caster:GetPlayerOwnerID()) end end end -- Automatically toggled on function ToggleOnAutocast( event ) local caster = event.caster local ability = event.ability ability:ToggleAutoCast() end
-- Copyright (c) 2019 Redfern, Trevor <[email protected]> -- -- This software is released under the MIT License. -- https://opensource.org/licenses/MIT describe("Node", function() local MockLove = require "moonpie.test_helpers.mock_love" local Node = require "moonpie.ui.node" local Styles = require "moonpie.ui.styles" it("can be initialized with a parent node", function() local p = Node({}) local c = Node({}, p) assert.equals(p, c.parent) assert.equals(p.box, c.box.parent) end) it("updates statistics when nodes are created and destroyed", function() local stats = require "moonpie.statistics" local start = stats.nodes or 0 local n = Node({}) Node({}) Node({}) assert.equals(start + 3, stats.nodes) n:destroy() assert.equals(start + 2, stats.nodes) end) it("can have child nodes", function() local b = Node() local c1, c2 = Node({}), Node({}) b:add(c1, c2) assert.equals(c1, b.children[1]) assert.equals(c2, b.children[2]) assert.equals(b, b.children[1].parent) assert.equals(b.box, b.children[1].box.parent) end) it("can remove children", function() local b = Node() local c1, c2 = Node({}), Node({}) b:add(c1, c2) b:clear_children() assert.equals(0, #b.children) end) it("calls destroy on all children when cleared", function() local b = Node() local c1, c2 = Node(), Node() spy.on(c1, "destroy") spy.on(c2, "destroy") b:add(c1, c2) b:clear_children() assert.spy(c1.destroy).was.called() assert.spy(c2.destroy).was.called() end) it("looks like the component plus any styles", function() Styles.add("test1", { padding = 10 }) local c = { style = "test1", width = 100, click = spy.new(function() end) } local n = Node(c) assert.equals(10, n.padding) assert.equals(100, n.width) n:click() assert.spy(c.click).was.called.with(n) end) it("passes the hover flag to the computed styles", function() Styles.add("text", { color = "green", _hover_ = { color = "red" } }) local c = { style = "text" } local n = Node(c) n.hover = function() return true end -- just override the hover check n:refreshStyle() assert.equals("red", n.color) end) it("assigns itself to the component", function() local c = { } local n = Node(c) assert.equals(n, c.node) end) describe("Initializing the box", function() it("uses styles for box definition", function() Styles.add("box_test", { padding = 10, margin = 20, width = 100 }) local b = Node({ style = "box_test" }) assert.equals(20, b.box.margin.left) assert.equals(20, b.box.margin.top) assert.equals(20, b.box.margin.bottom) assert.equals(20, b.box.margin.right) assert.equals(10, b.box.padding.right) assert.equals(10, b.box.padding.left) assert.equals(10, b.box.padding.bottom) assert.equals(10, b.box.padding.top) assert.equals(100, b.width) end) it("has the margins of the component", function() local b = Node({ margin = 5 }) local b2 = Node({ margin = { left = 9 } }) assert.equals(5, b.box.margin.left) assert.equals(5, b.box.margin.top) assert.equals(5, b.box.margin.right) assert.equals(5, b.box.margin.bottom) assert.equals(9, b2.box.margin.left) end) end) describe("Layout", function() it("uses the layout defined in the component if available", function() local c = { layout = spy.new(function() end) } local n = Node(c) n:layout("values") assert.spy(c.layout).was.called.with(n, "values") end) end) describe("Status Checks", function() local b before_each(function() b = Node({ width = 20, height = 30 }) b:layout() end) it("can flag that the mouse is hovering", function() MockLove.moveMouse(3, 5) assert.is_true(b:hover()) end) it("returns false for hover if mouse is outside the region", function() MockLove.moveMouse(300, 500) assert.is_false(b:hover()) end) it("triggers the hover sound if this is the first time hovering", function() MockLove.moveMouse(3, 5) b.hoverSound = { play = spy.new(function() end)} b:hover() assert.spy(b.hoverSound.play).was.called(1) b:hover() assert.spy(b.hoverSound.play).was.called(1) MockLove.moveMouse(300, 500) b:hover() assert.spy(b.hoverSound.play).was.called(1) MockLove.moveMouse(3, 5) b:hover() assert.spy(b.hoverSound.play).was.called(2) end) end) describe("Painting", function() it("uses the components paint method if provided", function() local c = { paint = spy.new(function() end) } local n = Node(c) n:paint() assert.spy(c.paint).was.called_with(n) end) end) describe("destroy", function() it("sets the component and parent to nil", function() local p = Node({}) local c = {} local n = Node(c, p) n:destroy() assert.is_nil(n.c) assert.is_nil(n.p) assert.is_nil(c.node) end) it("calls destroy on it's children", function() local p = Node({}) local c = Node({}, p) p:add(c) p:destroy() assert.is_nil(c.parent) end) it("calls unmount on component if defined", function() local unmount = spy.new(function() end) local c = Node({ unmounted = unmount }) c:destroy() assert.spy(unmount).was.called() end) end) end)
--<<<WRATH OF THE LAMB>>>-- OLD VERSION (REPLACED BY SLIGHTLY BETTER WORKING VERSION) function Exodus:wotlUpdate() local player = Isaac.GetPlayer(0) local level = game:GetLevel() local room = game:GetRoom() if ItemVariables.WRATH_OF_THE_LAMB.FrameCount ~= nil and player:HasCollectible(ItemId.WRATH_OF_THE_LAMB) then local summonMark = Isaac.Spawn(Entities.SUMMONING_MARK.id, 0, 0, ItemVariables.WRATH_OF_THE_LAMB.Position, NullVector, player) local sprite = summonMark:GetSprite() sprite:Play("Idle", false) sprite:SetFrame("Idle", (game:GetFrameCount() % 21)) summonMark:AddEntityFlags(EntityFlag.FLAG_RENDER_FLOOR) room:SetClear(false) if game:GetFrameCount() >= ItemVariables.WRATH_OF_THE_LAMB.FrameCount + 65 and ItemVariables.WRATH_OF_THE_LAMB.BossSpawned == false then if music:GetCurrentMusicID() ~= MusicId.LOCUS then music:PitchSlide(1) music:Play(MusicId.LOCUS, 0.15) end ItemVariables.WRATH_OF_THE_LAMB.BossSpawned = true ItemVariables.WRATH_OF_THE_LAMB.RoomIndex = game:GetLevel():GetCurrentRoomIndex() local absoluteStage = level:GetAbsoluteStage() local enemyPool = {} for i, entity in pairs(Isaac.GetRoomEntities()) do if entity.Type == Entities.SUMMONING_MARK.id then if absoluteStage == 1 or absoluteStage == 2 then enemyPool = {EntityType.ENTITY_THE_HAUNT, EntityType.ENTITY_DINGLE, EntityType.ENTITY_MONSTRO, EntityType.ENTITY_LITTLE_HORN, EntityType.ENTITY_GURDY_JR, EntityType.ENTITY_FISTULA_BIG, EntityType.ENTITY_DUKE, EntityType.ENTITY_GEMINI, EntityType.ENTITY_RAG_MAN, EntityType.ENTITY_PIN, EntityType.ENTITY_WIDOW, EntityType.ENTITY_FAMINE, EntityType.ENTITY_GREED} elseif absoluteStage == 3 or absoluteStage == 4 then enemyPool = {EntityType.ENTITY_CHUB, EntityType.ENTITY_POLYCEPHALUS, EntityType.ENTITY_RAG_MEGA, EntityType.ENTITY_DARK_ONE, EntityType.ENTITY_MEGA_FATTY, EntityType.ENTITY_BIG_HORN, EntityType.ENTITY_MEGA_MAW, EntityType.ENTITY_PESTILENCE, EntityType.ENTITY_PEEP, EntityType.ENTITY_GURDY } elseif absoluteStage == 5 or absoluteStage == 6 then enemyPool = {EntityType.ENTITY_MONSTRO2, EntityType.ENTITY_ADVERSARY, EntityType.ENTITY_GATE, EntityType.ENTITY_LOKI, EntityType.ENTITY_MONSTRO2, EntityType.ENTITY_ADVERSARY, EntityType.ENTITY_BROWNIE, EntityType.ENTITY_WAR, EntityType.ENTITY_URIEL } elseif absoluteStage == 7 or absoluteStage == 8 then enemyPool = {EntityType.ENTITY_MR_FRED, EntityType.ENTITY_BLASTOCYST_BIG, EntityType.ENTITY_CAGE, EntityType.ENTITY_MASK_OF_INFAMY, EntityType.ENTITY_GABRIEL, EntityType.ENTITY_MAMA_GURDY} elseif absoluteStage == 9 then enemyPool = {EntityType.ENTITY_FORSAKEN, EntityType.ENTITY_STAIN} elseif absoluteStage == 10 then enemyPool = {EntityType.ENTITY_DEATH, EntityType.ENTITY_DADDYLONGLEGS, EntityType.ENTITY_SISTERS_VIS} elseif absoluteStage == 11 then if level:GetStageType() == StageType.STAGETYPE_WOTL then Isaac.ExecuteCommand("stage 11") else player:UseCard(Card.CARD_EMPEROR) end else enemyPool = {EntityType.ENTITY_MOMS_HEART, EntityType.ENTITY_SATAN, EntityType.ENTITY_ISAAC} end Isaac.Spawn(enemyPool[rng:RandomInt(#enemyPool) + 1], 0, 0, entity.Position, NullVector, nil) ItemVariables.WRATH_OF_THE_LAMB.FrameCount = nil ItemVariables.WRATH_OF_THE_LAMB.BossSpawned = false entity:Remove() end end end end if ItemVariables.WRATH_OF_THE_LAMB.RoomIndex == level:GetCurrentRoomIndex() and player:HasCollectible(ItemId.WRATH_OF_THE_LAMB) then if room:IsClear() then music:Play(Music.MUSIC_BOSS_OVER, 0.1) local limit = 1 if player:HasCollectible(CollectibleType.COLLECTIBLE_CAR_BATTERY) then limit = 2 end for i = 1, limit do local payout = rng:RandomInt(100) if payout < 70 then Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) elseif payout < 75 then Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) elseif payout < 80 then Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) elseif payout < 85 then Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) elseif payout < 90 then Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_GRAB_BAG, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_GRAB_BAG, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_GRAB_BAG, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) elseif payout < 95 then Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_GRAB_BAG, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) else Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_TRINKET, 0, Isaac.GetFreeNearPosition(ItemVariables.WRATH_OF_THE_LAMB.Position, 20), Vector(0, 0), entity) end end ItemVariables.WRATH_OF_THE_LAMB.RoomIndex = nil else for i = 0, DoorSlot.NUM_DOOR_SLOTS - 1 do local door = room:GetDoor(i) if door ~= nil then local tarType = door.TargetRoomType local curType = door.CurrentRoomType if tarType ~= RoomType.ROOM_SECRET and tarType ~= RoomType.ROOM_SUPERSECRET and curType ~= RoomType.ROOM_SECRET and curType ~= RoomType.ROOM_SUPERSECRET then door:Bar() elseif door:IsOpen() then door:Bar() end end end end end end Exodus:AddCallback(ModCallbacks.MC_POST_UPDATE, Exodus.wotlUpdate) function Exodus:wotlCache(player, flag) if flag == CacheFlag.CACHE_RANGE then player.TearHeight = player.TearHeight + ItemVariables.WRATH_OF_THE_LAMB.RangeLost end if flag == CacheFlag.CACHE_DAMAGE then player.Damage = player.Damage - ItemVariables.WRATH_OF_THE_LAMB.DamageLost end if flag == CacheFlag.CACHE_SPEED then player.MoveSpeed = player.MoveSpeed - ItemVariables.WRATH_OF_THE_LAMB.SpeedLost end if flag == CacheFlag.CACHE_FIREDELAY then player.MaxFireDelay = player.MaxFireDelay + ItemVariables.WRATH_OF_THE_LAMB.FireDelayLost end end Exodus:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Exodus.wotlCache) function Exodus:wotlUse() local player = Isaac.GetPlayer(0) local statdown = rng:RandomInt(4) if statdown == 0 then ItemVariables.WRATH_OF_THE_LAMB.DamageLost = ItemVariables.WRATH_OF_THE_LAMB.DamageLost + 0.5 player:AddCacheFlags(CacheFlag.CACHE_DAMAGE) elseif statdown == 1 then ItemVariables.WRATH_OF_THE_LAMB.FireDelayLost = ItemVariables.WRATH_OF_THE_LAMB.FireDelayLost + 2 player:AddCacheFlags(CacheFlag.CACHE_FIREDELAY) elseif statdown == 2 then ItemVariables.WRATH_OF_THE_LAMB.RangeLost = ItemVariables.WRATH_OF_THE_LAMB.RangeLost + 2.5 player:AddCacheFlags(CacheFlag.CACHE_RANGE) elseif statdown == 3 then ItemVariables.WRATH_OF_THE_LAMB.SpeedLost = ItemVariables.WRATH_OF_THE_LAMB.SpeedLost + 0.15 player:AddCacheFlags(CacheFlag.CACHE_SPEED) end player:EvaluateItems() music:PitchSlide(0.5) local room = game:GetRoom() for i = 0, DoorSlot.NUM_DOOR_SLOTS - 1 do local door = room:GetDoor(i) if door ~= nil then local tarType = door.TargetRoomType local curType = door.CurrentRoomType if tarType ~= RoomType.ROOM_SECRET and tarType ~= RoomType.ROOM_SUPERSECRET and curType ~= RoomType.ROOM_SECRET and curType ~= RoomType.ROOM_SUPERSECRET then door:Bar() elseif door:IsOpen() then door:Bar() end end end local summonMark = Isaac.Spawn(Entities.SUMMONING_MARK.id, 0, 0, player.Position, NullVector, player) local sprite = summonMark:GetSprite() sprite:Play("Idle",false) summonMark:AddEntityFlags(EntityFlag.FLAG_RENDER_FLOOR) ItemVariables.WRATH_OF_THE_LAMB.Position = summonMark.Position game:GetRoom():SetClear(false) ItemVariables.WRATH_OF_THE_LAMB.FrameCount = game:GetFrameCount() end Exodus:AddCallback(ModCallbacks.MC_USE_ITEM, Exodus.wotlUse, ItemId.WRATH_OF_THE_LAMB) --<<<DEFECATION>>>-- DEFECATION = Isaac.GetItemIdByName("Defecation"), DEFECATION = { HasDefecation = false }, function Exodus:defecationUpdate() local player = Isaac.GetPlayer(0) if player:HasCollectible(ItemId.DEFECATION) and not ItemVariables.DEFECATION.HasDefecation then ItemVariables.DEFECATION.HasDefecation = true if player:GetPlayerType() == PlayerType.PLAYER_THELOST then player:AddNullCostume(CostumeId.OWW_WHITE) elseif player:GetPlayerType() == PlayerType.PLAYER_KEEPER or player:GetPlayerType() == PlayerType.PLAYER_APOLLYON then player:AddNullCostume(CostumeId.OWW_GRAY) elseif player:GetPlayerType() == PlayerType.PLAYER_BLACKJUDAS then player:AddNullCostume(CostumeId.OWW_BLACK) elseif player:GetPlayerType() == PlayerType.PLAYER_XXX then player:AddNullCostume(CostumeId.OWW_BLUE) elseif player:GetPlayerType() == PlayerType.PLAYER_AZAZEL then player:AddNullCostume(CostumeId.OWW_BLACK_RED_EYES) else player:AddNullCostume(CostumeId.OWW) end for i, entity in pairs(Isaac.GetRoomEntities()) do if entity:ToTear() then local data = entity:GetData() entity = entity:ToTear() if data.HasReversed == nil then entity.Velocity = entity.Velocity * -1 entity.Position = entity.Position + entity.Velocity data.HasReversed = true end end end end end Exodus:AddCallback(ModCallbacks.MC_POST_UPDATE, Exodus.defecationUpdate) function Exodus:defecationCache(player, flag) if flag == CacheFlag.CACHE_FIREDELAY then if player:HasCollectible(ItemId.DEFECATION) then player.MaxFireDelay = player.MaxFireDelay + 12 end end if flag == CacheFlag.CACHE_DAMAGE then if player:HasCollectible(ItemId.DEFECATION) then player.Damage = player.Damage + 5 end end if flag == CacheFlag.CACHE_RANGE then if player:HasCollectible(ItemId.DEFECATION) then player.TearHeight = player.TearHeight + 12 end end if flag == CacheFlag.CACHE_TEARCOLOR then if player:HasCollectible(ItemId.DEFECATION) then player.TearColor = Color(0.545, 0.27, 0.075, 1, 0, 0, 0) end end end Exodus:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, Exodus.defecationCache) --<<<BEENADES>>>-- BEENADES = Isaac.GetItemIdByName("Beenades"), BEENADES = Isaac.GetCostumeIdByPath("gfx/characters/costume_Beenades.anm2"), BEENADES = { HasBeenades = false }, function Exodus:beenadesUpdate() local player = Isaac.GetPlayer(0) if player:HasCollectible(ItemId.BEENADES) then if ItemVariables.BEENADES.HasBeenades == false then player:AddNullCostume(CostumeId.BEENADES) ItemVariables.BEENADES.HasBeenades = true end for i, entity in pairs(Isaac.GetRoomEntities()) do local sprite = entity:GetSprite() if entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == EffectVariant.ROCKET and entity:IsDead() and player:HasCollectible(CollectibleType.COLLECTIBLE_EPIC_FETUS) then if not string.find(sprite:GetFilename(), "gfx/effects/bee") then sprite:ReplaceSpritesheet(0, "gfx/effects/effect_035_beemissile.png") sprite:LoadGraphics() end Exodus:FireXHoney(15, entity) end if entity.Type == EntityType.ENTITY_BOMBDROP and (entity.SpawnerType == EntityType.ENTITY_PLAYER or entity.SpawnerType == EntityType.ENTITY_BOMBDROP) then if string.find(sprite:GetFilename(), "gfx/004") then sprite:ReplaceSpritesheet(0, "gfx/items/pick ups/pickup_016_beebomb.png") sprite:LoadGraphics() end if entity:IsDead() then entity:Remove() Exodus:FireXHoney(15, entity) end end if entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == Entities.HONEY_POOF.variant and sprite:IsFinished("Poof") then entity:Remove() end if entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == Entities.HONEY_POOF.variant then entity.SpriteRotation = entity.Velocity:GetAngleDegrees() if entity:CollidesWithGrid() or entity.FrameCount > 15 then Isaac.Spawn(EntityType.ENTITY_EFFECT, Entities.HONEY_POOF.variant, 0, entity.Position, NullVector, entity) local creep = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.PLAYER_CREEP_BLACK, 0, entity.Position, NullVector, player):ToEffect() creep:SetTimeout(200) creep:SetColor(Color(0, 0, 0, 1, math.random(200,250), math.random(150,200), math.random(0,10)), -1, 1, false, false) creep:GetData().IsHoneyCreep = true entity:Remove() if player:HasCollectible(CollectibleType.COLLECTIBLE_ANTI_GRAVITY) then creep.Velocity = entity.Velocity * 100 end if player:HasCollectible(CollectibleType.COLLECTIBLE_BRIMSTONE) then local brim = player:FireBrimstone(RandomVector()) brim.Position = entity.Position brim.DisableFollowParent = true end if player:HasCollectible(CollectibleType.COLLECTIBLE_TECHNOLOGY) then local tech = player:FireTechLaser(entity.Position, 0, RandomVector(), false, false) tech.DisableFollowParent = true end end end if player:HasCollectible(CollectibleType.COLLECTIBLE_BOBS_ROTTEN_HEAD) and entity.Type == EntityType.ENTITY_TEAR and entity.Variant == EntityType.ENTITY_BOMBDROP and entity:IsDead() then Exodus:FireXHoney(15, entity) end if entity:GetData().IsHoneyCreep and entity.Type == EntityType.ENTITY_EFFECT and entity.Variant == EffectVariant.PLAYER_CREEP_BLACK then for u, enemy in pairs(Isaac.GetRoomEntities()) do if enemy:IsVulnerableEnemy() and enemy:IsActiveEnemy(false) and not enemy:IsFlying() then if enemy:HasEntityFlags(EntityFlag.FLAG_SLOW) then enemy:GetSprite():Stop() enemy.Velocity = NullVector enemy.Friction = enemy.Friction / 2 end end end end end end end Exodus:AddCallback(ModCallbacks.MC_POST_UPDATE, Exodus.beenadesUpdate) --<<<CANMAN>>>-- function Exodus:canmanTakeDamage(target, amount, flags, source, cdtimer) if target.Variant == Entities.CANMAN.variant then local data = target:GetData() if data.ExplosionTimer == nil then data.ExplosionTimer = 30 end end end Exodus:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, Exodus.canmanTakeDamage, Entities.CANMAN.id) function Exodus:canmanEntityUpdate(can) if can.Variant == Entities.CANMAN.variant then local sprite = can:GetSprite() local data = can:GetData() local player = Isaac.GetPlayer(0) if not sprite:IsPlaying("Idle") or can.FrameCount == 1 then sprite:Play("Idle",true) end if not can:HasEntityFlags(EntityFlag.FLAG_NO_FLASH_ON_DAMAGE) then can:AddEntityFlags(EntityFlag.FLAG_NO_FLASH_ON_DAMAGE) end if not can:HasEntityFlags(EntityFlag.FLAG_NO_PHYSICS_KNOCKBACK) then can:AddEntityFlags(EntityFlag.FLAG_NO_PHYSICS_KNOCKBACK) end if not can:HasEntityFlags(EntityFlag.FLAG_NO_BLOOD_SPLASH) then can:AddEntityFlags(EntityFlag.FLAG_NO_BLOOD_SPLASH) end if (player.Position:DistanceSquared(can.Position) < 70^2 or math.random(200) == 1 and can.FrameCount > 200) and data.ExplosionTimer == nil then data.ExplosionTimer = 30 end if data.ExplosionTimer ~= nil then can.Color = Color(1, 1, 1, 1, math.abs(math.ceil(math.sin(data.ExplosionTimer / 2) * 100)), 0, 0) if data.ExplosionTimer > 0 then data.ExplosionTimer = data.ExplosionTimer - 1 else can:Die() end end if can:IsDead() then Isaac.Explode(can.Position, can, 60) end end end Exodus:AddCallback(ModCallbacks.MC_NPC_UPDATE, Exodus.canmanEntityUpdate, Entities.CANMAN.id) --<<<SPOOK>>>-- function Exodus:spookEntityUpdate(spook) if spook.Variant == Entities.SPOOK.variant then local sprite = spook:GetSprite() local data = spook:GetData() local player = Isaac.GetPlayer(0) local target = spook:GetPlayerTarget() local angle = (target.Position - spook.Position):GetAngleDegrees() if spook:IsDead() then for i = 1, math.random(10, 20) do local ectoexplosion = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.BLOOD_PARTICLE, 0, spook.Position, Vector(math.random(-5, 5), math.random(-5, 5)), player):GetSprite() ectoexplosion.Color = Color(1, 1, 1, 0.4, 50, 128, 128) ectoexplosion.Scale = ectoexplosion.Scale * 0.5 ectoexplosion.Rotation = math.random(1, 3600) / 10 ectoexplosion:Update() end end if spook.State ~= 4 then data.State4Frame = 0 end if spook.FrameCount <= 1 then spook.State = 2 data.State0Frame = 0 data.State3Countdown = 0 end if spook.State == 2 then sprite:Play("Appear",false) if sprite:IsFinished("Appear") then spook.State = 0 end elseif spook.State == 0 then if data.State0Frame then data.State0Frame = data.State0Frame + 1 if (data.State0Frame % 30 or data.State0Frame == 0) and data.State0Frame <= 90 then spook:AddVelocity((target.Position - spook.Position):Normalized() * 0.2) elseif data.State0Frame > 90 then spook.Velocity = (target.Position - spook.Position):Normalized() * 3 if player:GetHeadDirection() == Direction.LEFT or player:GetMovementDirection() == Direction.LEFT then if spook.Position.X < player.Position.X and math.abs(player.Position.Y - spook.Position.Y) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end elseif player:GetHeadDirection() == Direction.RIGHT or player:GetMovementDirection() == Direction.RIGHT then if spook.Position.X > player.Position.X and math.abs(player.Position.Y - spook.Position.Y) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end elseif player:GetHeadDirection() == Direction.UP or player:GetMovementDirection() == Direction.UP then if spook.Position.Y < player.Position.Y and math.abs(player.Position.X - spook.Position.X) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end elseif (player:GetHeadDirection() == Direction.DOWN or player:GetMovementDirection() == Direction.DOWN) or player:GetHeadDirection() == Direction.NO_DIRECTION then if spook.Position.Y > player.Position.Y and math.abs(player.Position.X - spook.Position.X) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end end end else data.State0Frame = 0 end spook:AnimWalkFrame("Float", "Float", 0.1) elseif spook.State == 3 then spook:AnimWalkFrame("FloatHide", "FloatHide", 0.1) spook.Velocity = (spook.Position - player.Position):Resized(1) data.State3Countdown = data.State3Countdown - 1 if data.State3Countdown <= 0 then spook.State = 4 data.State0Frame = 0 data.State3Countdown = 60 end if player:GetHeadDirection() == Direction.LEFT or player:GetMovementDirection() == Direction.LEFT then if spook.Position.X < player.Position.X and math.abs(player.Position.Y - spook.Position.Y) < 40 then data.State3Countdown = 60 end elseif player:GetHeadDirection() == Direction.RIGHT or player:GetMovementDirection() == Direction.RIGHT then if spook.Position.X > player.Position.X and math.abs(player.Position.Y - spook.Position.Y) < 40 then data.State3Countdown = 60 end elseif player:GetHeadDirection() == Direction.UP or player:GetMovementDirection() == Direction.UP then if spook.Position.Y < player.Position.Y and math.abs(player.Position.X - spook.Position.X) < 40 then data.State3Countdown = 60 end elseif (player:GetHeadDirection() == Direction.DOWN or player:GetMovementDirection() == Direction.DOWN) or player:GetHeadDirection() == Direction.NO_DIRECTION then if spook.Position.Y > player.Position.Y and math.abs(player.Position.X - spook.Position.X) < 40 then data.State3Countdown = 60 end end elseif spook.State == 4 then data.State4Frame = data.State4Frame + 1 if data.State4Frame < 31 or data.State4Frame > 63 then spook.Velocity = (target.Position - spook.Position):Normalized() * 3 spook:AnimWalkFrame("Float", "Float", 0.1) end if data.State4Frame % 10 == 0 and data.State4Frame <= 30 then local offset = Vector(0, 28) if sprite.FlipX then offset = Vector(-15, 28) else offset = Vector(15, 28) end sprite:Play("Shoot", false) local shot = Isaac.Spawn(EntityType.ENTITY_PROJECTILE, 0, 0, spook.Position + offset, Vector.FromAngle(1 * angle):Resized(10), spook) local shotSprite = shot:GetSprite() local color = shotSprite.Color shotSprite.Color = Color(color.R, color.G, color.B, 0.5, 0, 0, 0) shotSprite:ReplaceSpritesheet(0,"gfx/Ghost Tear.png") shotSprite:LoadGraphics() shot.SplatColor = Color(0, 1, 1, 0.5, 0, 0, 0) shot.GridCollisionClass = GridCollisionClass.COLLISION_NONE sfx:Play(SoundEffect.SOUND_LITTLE_SPIT, 1, 0, false, 0.8) end if data.State4Frame >= 31 and data.State4Frame < 60 then if data.State4Frame == 31 then spook.Velocity = NullVector sprite:Play("Disappear", false) end if sprite:IsFinished("Disappear") then sprite:Play("Appear", false) spook.Position = game:GetRoom():GetRandomPosition(1) spook.CollisionDamage = 0 end end if data.State4Frame > 70 or data.State4Frame == 0 then spook.CollisionDamage = 1 end if data.State4Frame > 80 then if player:GetHeadDirection() == Direction.LEFT or player:GetMovementDirection() == Direction.LEFT then if spook.Position.X < player.Position.X and math.abs(player.Position.Y - spook.Position.Y) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end elseif player:GetHeadDirection() == Direction.RIGHT or player:GetMovementDirection() == Direction.RIGHT then if spook.Position.X > player.Position.X and math.abs(player.Position.Y - spook.Position.Y) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end elseif player:GetHeadDirection() == Direction.UP or player:GetMovementDirection() == Direction.UP then if spook.Position.Y < player.Position.Y and math.abs(player.Position.X - spook.Position.X) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end elseif (player:GetHeadDirection() == Direction.DOWN or player:GetMovementDirection() == Direction.DOWN) or player:GetHeadDirection() == Direction.NO_DIRECTION then if spook.Position.Y > player.Position.Y and math.abs(player.Position.X - spook.Position.X) < 40 then spook.State = 3 data.State0Frame = 0 data.State3Countdown = 60 end end end end end end Exodus:AddCallback(ModCallbacks.MC_NPC_UPDATE, Exodus.spookEntityUpdate, Entities.SPOOK.id) --<<<GRIDSIES>>>-- function Exodus:gridsieEntityUpdate(entity) if entity.Variant == Entities.GRIDSIE.variant or entity.Variant == Entities.BOMB_GRIDSIE.variant or entity.Variant == Entities.POLYP_GRIDSIE.variant then local sprite = entity:GetSprite() local data = entity:GetData() local target = entity:GetPlayerTarget() local player = Isaac.GetPlayer(0) if entity:HasEntityFlags(EntityFlag.FLAG_APPEAR) then entity:ClearEntityFlags(EntityFlag.FLAG_APPEAR) end if not entity:HasEntityFlags(EntityFlag.FLAG_NO_PHYSICS_KNOCKBACK) then entity:AddEntityFlags(EntityFlag.FLAG_NO_PHYSICS_KNOCKBACK) end if entity:IsDead() then Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.ROCK_PARTICLE, 0, entity.Position, NullVector, entity) sfx:Play(SoundEffect.SOUND_ROCK_CRUMBLE, 1, 0, false, 1) end if (player:HasCollectible(CollectibleType.COLLECTIBLE_LEO) or player:HasCollectible(CollectibleType.COLLECTIBLE_THUNDER_THIGHS)) and entity.Position:DistanceSquared(player.Position) < 30^2 then entity:Die() end if sprite:IsFinished("Appear") then entity.CollisionDamage = 0 entity.Velocity = NullVector entity.Friction = entity.Friction / 2 if (entity.FrameCount > 130 and entity.Position:DistanceSquared(player.Position) < 100^2) or entity.HitPoints <= entity.MaxHitPoints / 2 then sprite:Play("Stand",true) end end if sprite:IsFinished("Stand") or sprite:IsPlaying("WalkVert") or sprite:IsPlaying("WalkHori") then if entity.Friction ~= 1 then entity.Friction = 1 end if entity.CollisionDamage ~= 1 then entity.CollisionDamage = 1 end if data.GridCountdown == nil then data.GridCountdown = 0 end if entity.Velocity:GetAngleDegrees() >= 45 and entity.Velocity:GetAngleDegrees() <= 135 then sprite:Play("WalkVert",false) else sprite:Play("WalkHori",false) end if entity.Position.X < player.Position.X then sprite.FlipX = false else sprite.FlipX = true end if entity:CollidesWithGrid() or data.GridCountdown > 0 then if entity.Variant == Entities.POLYP_GRIDSIE.variant then entity.Pathfinder:FindGridPath(player.Position, 0.8, 1, false) else entity.Pathfinder:FindGridPath(player.Position, 0.5, 1, false) end if data.GridCountdown <= 0 then data.GridCountdown = 30 else data.GridCountdown = data.GridCountdown - 1 end else if entity.Variant == Entities.POLYP_GRIDSIE.variant then entity.Velocity = (player.Position - entity.Position):Resized(5) else entity.Velocity = (player.Position - entity.Position):Resized(3.5) end end if entity.Variant == Entities.BOMB_GRIDSIE.variant and entity.Position:DistanceSquared(player.Position) <= 30^2 then entity:Die() end end if entity.Variant == Entities.GRIDSIE.variant then if data.HasStateChange ~= true then if math.random(20) == 1 then entity:Remove() Isaac.Spawn(Entities.BOMB_GRIDSIE.id, Entities.BOMB_GRISIDE.variant, 0, entity.Position, NullVector, entity) else local rand = math.random(3) sprite:ReplaceSpritesheet(1, "gfx/monsters/Gridsie " .. rand .. ".png") sprite:LoadGraphics() end entity:GetData().HasStateChange = true end elseif entity.Variant == Entities.POLYP_GRIDSIE.variant then if entity.FrameCount == 1 then local rand = math.random(2) if rand == 1 then sprite:ReplaceSpritesheet(1, "gfx/monsters/Gridsie Polyp.png") sprite:LoadGraphics() elseif rand == 2 then sprite:ReplaceSpritesheet(1, "gfx/monsters/Gridsie Polyp 2.png") sprite:LoadGraphics() end end if entity:IsDead() then for i = 1, 8 do Isaac.Spawn(EntityType.ENTITY_PROJECTILE, ProjectileVariant.BLOOD, 0, entity.Position, Vector.FromAngle(i * 45):Resized(9), entity) end end elseif entity.Variant == Entities.BOMB_GRIDSIE.variant then if entity.FrameCount == 1 then sprite:ReplaceSpritesheet(1, "gfx/monsters/Bomb Gridsie.png") sprite:LoadGraphics() end if entity:IsDead() then Isaac.Explode(entity.Position, entity, 60) end end end end Exodus:AddCallback(ModCallbacks.MC_NPC_UPDATE, Exodus.gridsieEntityUpdate, Entities.GRIDSIE.id) --<<<HUSHED HORF>>>-- function Exodus:hushedHorfUpdate() local player = Isaac.GetPlayer(0) for i, entity in pairs(Isaac.GetRoomEntities()) do local data = entity:GetData() if data.IsFromHushedHorfTear then local degress = 0 if entity.Position.X < player.Position.X and not player:IsDead() then degress = rng:RandomInt(3) + 6 else degress = (rng:RandomInt(3) + 6) * -1 end entity.Velocity = entity.Velocity:Rotated(degress):Resized(1.5 * (math.sqrt(player.Position:Distance(entity.Position) / 10))) + (player.Position - entity.Position):Resized(0.5) if entity.FrameCount > 10 then entity:Remove() local tear = Isaac.Spawn(EntityType.ENTITY_PROJECTILE, ProjectileVariant.HUSH, 0, entity.Position + Vector(0, 6), entity.Velocity, entity) tear:GetData().IsFromHushedHorfTear = true tear.Color = Color(0.83529411764, 0.7294117647, 0, 1, 0, 0, 0) end end if entity.Type == EntityType.ENTITY_PROJECTILE and entity.Variant == 0 and entity.SpawnerType == EntityType.ENTITY_HORF and entity.SpawnerVariant == Entities.HUSHED_HORF.variant then entity:Remove() local tear = Isaac.Spawn(EntityType.ENTITY_PROJECTILE, ProjectileVariant.HUSH, 0, entity.Position, entity.Velocity, entity) tear:GetData().IsFromHushedHorfTear = true tear.Color = Color(0.83529411764, 0.7294117647, 0, 1, 0, 0, 0) end end end Exodus:AddCallback(ModCallbacks.MC_POST_UPDATE, Exodus.hushedHorfUpdate) --<<<BOTH SILENT ENEMIES>>>-- function Exodus:silentEnemiesUpdate() local player = Isaac.GetPlayer(0) for i, entity in pairs(Isaac.GetRoomEntities()) do local data = entity:GetData() if entity.SpawnerType == Entities.SILENT_FATTY.id and entity.SpawnerVariant == Entities.SILENT_FATTY.variant and entity.Type == EntityType.ENTITY_PROJECTILE and entity.Variant == 0 then entity:Remove() for u = 1, 8 do local tear = Isaac.Spawn(EntityType.ENTITY_PROJECTILE, ProjectileVariant.HUSH, 0, entity.Position, entity.Velocity:Rotated(i * 45):Resized(6), entity) tear.SpawnerType = Entities.SILENT_FATTY.id end end if entity.Type == EntityType.ENTITY_PROJECTILE and entity.Variant == 6 then if entity.SpawnerType == Entities.SILENT_FATTY.id then entity.Velocity = (player.Position - entity.Position) / 50 + (entity.Velocity * 0.8) if entity.FrameCount % 100 == 0 then entity:Die() elseif entity.FrameCount > 10 then entity:Remove() local tear = Isaac.Spawn(EntityType.ENTITY_PROJECTILE, ProjectileVariant.HUSH, 0, entity.Position, RandomVector() * 10, entity.Parent) tear.SpawnerType = Entities.SILENT_FATTY.id end end end if entity.SpawnerType == Entities.SILENT_HOST.id and entity.SpawnerVariant == Entities.SILENT_HOST.variant and entity.Type == EntityType.ENTITY_PROJECTILE then if entity.Variant == 6 then entity.Velocity = entity.Velocity:Rotated(15):Resized(entity.FrameCount) else entity:Remove() for i = 1, 4 do local tear = Isaac.Spawn(EntityType.ENTITY_PROJECTILE, ProjectileVariant.HUSH, 0, entity.Position, entity.Velocity:Rotated(i * 90):Resized(10), entity) tear.SpawnerType = Entities.SILENT_HOST.id tear.SpawnerVariant = Entities.SILENT_HOST.variant end end end end end Exodus:AddCallback(ModCallbacks.MC_POST_UPDATE, Exodus.silentEnemiesUpdate)
local settings = require('settings') -- Return a name that doesn't appear in any of the provided tables' keys local function getUniqueName(name, ...) local function exists(key) local match = nil for i,tbl in ipairs(arg) do match = match or tbl[key] end return match ~= nil end local index = 0 local newName = name while exists(newName) do index = index + 1 newName = name .. index end return newName end local function appendJsonChars(fileName) -- Remove trailing comma local fdr = file.open(fileName, 'r+') fdr:seek('end', -2) local isComma = file.read(1) == ',' if isComma then fdr:seek('end', -2) fdr:write(' ') end fdr:close() -- Add array and object close local fda = file.open(fileName, 'a+') fda:writeline(']}') fda:close() end local function prepDataFiles() local dataPrefix = '^' .. settings.dataFilePrefix local oldQueuedFiles = file.list('^' .. settings.queuedFilePrefix) local newQueuedFiles = {} for n,b in pairs(file.list(dataPrefix)) do appendJsonChars(n) local queuedName = n:gsub(dataPrefix, settings.queuedFilePrefix, 1) queuedName = getUniqueName(queuedName, newQueuedFiles, oldQueuedFiles) -- Store the new name for the next getUniqueName() and rename the file newQueuedFiles[queuedName] = b file.rename(n, queuedName) end end local function queueFiles() prepDataFiles() QueuedFileNames = {} local queuedFiles = file.list('^' .. settings.queuedFilePrefix) for n,b in pairs(queuedFiles) do table.insert(QueuedFileNames, n) end end queueFiles()
--[[ © 2020 TERRANOVA do not share, re-distribute or modify without permission of its author. --]] local PANEL = {} -- Called when the panel is first initialized. function PANEL:Init() self:Dock(FILL) self:SetDrawBackground(false) self.backHeader = self:Add(ix.gui.record:AddBackHeader(function() ix.gui.record:SendToServer(VIEWDATA_UPDATEVAR, { var = "note", info = self.textEntry:GetText() }) ix.gui.record:SetStage("Home") end)) local title = self:Add(ix.gui.record:BuildLabel("Editing Note", true)) title:DockMargin(0,0,0,4) local recordName = self:Add(ix.gui.record:BuildLabel("You can type up to 1024 characters.")) recordName:DockMargin(0,0,0,4) self.textEntry = self:Add("DTextEntry") self.textEntry:SetMultiline(true) self.textEntry:DockMargin(8, 0, 8, 8) self.textEntry:Dock(FILL) self.textEntry:SetText(ix.gui.record:GetRecord().vars["note"] or "") function self.textEntry:PerformLayout() self:SetBGColor( Color(50, 50, 50, 50) ) end -- A function to set the text entry's real value. function self.textEntry:SetRealValue(text) self:SetValue(text); self:SetCaretPos( string.len(text) ); end; -- Called each frame. function self.textEntry:Think() local text = self:GetValue(); if (string.len(text) > 1024) then self:SetRealValue( string.sub(text, 0, 1024) ); surface.PlaySound("common/talk.wav"); end; end; end vgui.Register("ixCombineViewDataViewNote", PANEL, "DPanel")
local lunit, RUN = lunit do RUN = lunit and function()end or function () local res = lunit.run() if res.errors + res.failed > 0 then os.exit(-1) end return os.exit(0) end lunit = require "lunit" end local _,luacov = pcall(require, "luacov") local TEST_CASE = assert(lunit.TEST_CASE) local skip = lunit.skip or function() end local curl = require "cURL" local scurl = require "cURL.safe" local json = require "dkjson" local fname = "./test.download" local utils = require "utils" local function weak_ptr(val) return setmetatable({value = val},{__mode = 'v'}) end local function gc_collect() for i = 1, 5 do collectgarbage("collect") end end -- Bug. libcurl 7.56.0 does not add `Content-Type: text/plain` local text_plain = utils.is_curl_eq(7,56,0) and 'test/plain' or 'text/plain' local GET_URL = "http://127.0.0.1:7090/get" local ENABLE = true local _ENV = TEST_CASE'version' if ENABLE then function test() assert_match("^%d+%.%d+%.%d+%-?", curl._VERSION) assert_equal("Lua-cURL", curl._NAME ) end end local _ENV = TEST_CASE'easy' if ENABLE then local e1, e2 function teardown() if e1 then e1:close() end if e2 then e2:close() end e1, e2 = nil end if curl.OPT_STREAM_DEPENDS then function test_easy_setopt_stream_depends_1() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt_stream_depends(e2) end) end function test_easy_setopt_stream_depends_2() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt(curl.OPT_STREAM_DEPENDS, e2) end) end function test_easy_setopt_stream_depends_3() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt{[curl.OPT_STREAM_DEPENDS] = e2} end) end function test_easy_setopt_stream_depends_4() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt{stream_depends = e2} end) end function test_easy_setopt_stream_depends_e_1() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt_stream_depends_e(e2) end) end function test_easy_setopt_stream_depends_e_2() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt(curl.OPT_STREAM_DEPENDS_E, e2) end) end function test_easy_setopt_stream_depends_e_3() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt{[curl.OPT_STREAM_DEPENDS_E] = e2} end) end function test_easy_setopt_stream_depends_e_4() e1 = assert(scurl.easy()) e2 = assert(scurl.easy()) assert_pass(function() e1:setopt{stream_depends_e = e2} end) end end function test_easy_setopt_share() e1 = assert(scurl.easy()) e2 = assert(scurl.share()) assert_pass(function() e1:setopt_share(e2) end) end end local _ENV = TEST_CASE'multi_iterator' if ENABLE then local url = GET_URL local c, t, m local function json_data() return json.decode(table.concat(t)) end function setup() t = {} m = assert(scurl.multi()) end function teardown() if m then m:close() end if c then c:close() end m, c, t = nil end function test_add_handle() local base_url = url .. '?key=' local urls = { base_url .. "1", base_url .. "2", "###" .. base_url .. "3", base_url .. "4", base_url .. "5", } local i = 0 local function next_easy() i = i + 1 local url = urls[i] if url then c = assert(scurl.easy{url = url}) t = {} return c end end assert_equal(m, m:add_handle(next_easy())) for data, type, easy in m:iperform() do if type == "done" or type == "error" then assert_equal(urls[i], easy:getinfo_effective_url()) assert_equal(easy, c) easy:close() c = nil if i == 3 then assert_equal(curl.error(curl.ERROR_EASY, curl.E_UNSUPPORTED_PROTOCOL), data) else local data = json_data() assert_table(data.args) assert_equal(tostring(i), data.args.key) end easy = next_easy() if easy then m:add_handle(easy) end end if type == "data" then table.insert(t, data) end end assert_equal(#urls + 1, i) assert_nil(c) end function test_info_read() local url = GET_URL .. '?key=1' c = assert(curl.easy{url=url, writefunction=function() end}) assert_equal(m, m:add_handle(c)) while m:perform() > 0 do m:wait() end local h, ok, err = m:info_read() assert_equal(c, h) local h, ok, err = m:info_read() assert_equal(0, h) end end local _ENV = TEST_CASE'multi memory leak' if ENABLE then local m function teardown() if m then m:close() end m = nil end function test_basic() local ptr do local multi = assert(scurl.multi()) ptr = weak_ptr(multi) end gc_collect() assert_nil(ptr.value) end function test_socket_action() local ptr do local multi = assert(scurl.multi()) multi:setopt_socketfunction(function() end) ptr = weak_ptr(multi) end gc_collect() assert_nil(ptr.value) end end local _ENV = TEST_CASE'form' if ENABLE then local post function teardown() if post then post:free() end post = nil end function test_content_01() post = assert(scurl.form{name01 = 'value01'}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue01\r\n", data) assert_match('name="name01"', data) end function test_content_02() post = assert(scurl.form{name02 = {'value02', type = text_plain}}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue02\r\n", data) assert_match('name="name02"', data) assert_match('Content%-Type: ' .. text_plain .. '\r\n', data) end function test_content_03() post = assert(scurl.form{name03 = {content = 'value03', headers = {"Content-Encoding: gzip"}}}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue03\r\n", data) assert_match('name="name03"', data) assert_match('Content%-Encoding: gzip\r\n', data) end function test_content_04() post = assert(scurl.form{name04 = {'value04', type = text_plain, headers = {"Content-Encoding: gzip"}}}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue04\r\n", data) assert_match('name="name04"', data) assert_match('Content%-Encoding: gzip\r\n', data) assert_match('Content%-Type: ' .. text_plain .. '\r\n', data) end function test_buffer_01() post = assert(scurl.form{name01 = { name = 'file01', data = 'value01', }}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue01\r\n", data) assert_match('name="name01"', data) assert_match('filename="file01"', data) assert_match('Content%-Type: application/octet%-stream\r\n', data) end function test_buffer_02() post = assert(scurl.form{name02 = { name = 'file02', data = 'value02', type = text_plain, }}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue02\r\n", data) assert_match('name="name02"', data) assert_match('filename="file02"', data) assert_match('Content%-Type: ' .. text_plain .. '\r\n', data) assert_not_match('Content%-Type: application/octet%-stream\r\n', data) end function test_buffer_03() post = assert(scurl.form{name03 = { name = 'file03', data = 'value03', headers = {"Content-Encoding: gzip"}, }}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue03\r\n", data) assert_match('name="name03"', data) assert_match('filename="file03"', data) assert_match('Content%-Type: application/octet%-stream\r\n', data) assert_match('Content%-Encoding: gzip\r\n', data) end function test_buffer_04() post = assert(scurl.form{name04 = { name = 'file04', data = 'value04', type = text_plain, headers = {"Content-Encoding: gzip"}, }}) local data = assert_string(post:get()) assert_match("\r\n\r\nvalue04\r\n", data) assert_match('name="name04"', data) assert_match('filename="file04"', data) assert_match('Content%-Type: ' .. text_plain .. '\r\n', data) assert_not_match('Content%-Type: application/octet%-stream\r\n', data) assert_match('Content%-Encoding: gzip\r\n', data) end function test_stream_01() post = assert(scurl.form{name01 = { stream = function() end, length = 128, }}) local data = assert_string(post:get()) assert_match('name="name01"', data) assert_not_match('filename', data) end function test_stream_02() post = assert(scurl.form{name02 = { name = 'file02', stream = function() end, length = 128, }}) local data = assert_string(post:get()) assert_match('name="name02"', data) assert_match('filename="file02"', data) end function test_stream_03() post = assert(scurl.form{name03 = { name = 'file03', stream = function() end, length = 128, type = text_plain, }}) local data = assert_string(post:get()) assert_match('name="name03"', data) assert_match('filename="file03"', data) assert_match('Content%-Type: ' .. text_plain .. '\r\n', data) end function test_stream_04() post = assert(scurl.form{name04 = { name = 'file04', stream = function() end, length = 128, type = text_plain, headers = {"Content-Encoding: gzip"}, }}) local data = assert_string(post:get()) assert_match('name="name04"', data) assert_match('filename="file04"', data) assert_match('Content%-Type: ' .. text_plain .. '\r\n', data) assert_match('Content%-Encoding: gzip\r\n', data) end function test_stream_05() post = assert(scurl.form{name05 = { stream = { length = function() return 128 end; read = function() end; } }}) local data = assert_string(post:get()) assert_match('name="name05"', data) assert_not_match('filename', data) end function test_error() assert_error(function() post = scurl.form{name = {content = 1}} end) assert_error(function() post = scurl.form{name = {1}} end) assert_error(function() post = scurl.form{name = {data = {}}} end) assert_error(function() post = scurl.form{name = {file = true}} end) assert_error(function() post = scurl.form{name = {stream = function() end}} end) assert_error(function() post = scurl.form{name = {stream = {}}} end) assert_error(function() post = scurl.form{name = {stream = { read=function()end;length=function()end }}}end) assert_error(function() post = scurl.form{name = {stream = { read=function()end;length=function() return "123" end }}}end) assert_error(function() post = scurl.form{name = {stream = { read=function()end;length=function() return "hello" end }}}end) end function test_ignore_unknown() post = assert(scurl.form{ name01 = {}, name02 = {name = "helo"}, }) local data = assert_string(post:get()) assert_not_match('name="name01"', data) assert_not_match('name="name02"', data) end function test_empty() post = assert(scurl.form{}) end end RUN()
serial_version = 1.0 TILE = {} TILE.initializeEnt = function (self,ent, x, y) if ent.max_anims <= 1 then ent.anim_type = "" ent.variants = false else ent.anim_type = math.floor((global_run_time + math.random() * 1000) % ent.max_anims) end end TILE.executeAI = function (self,ent) local pl = getPlayer() local x = (ent.xpos + ent.col_width / 2) - (pl.xpos + pl.col_width / 2) local y = (ent.ypos + ent.eye_height) - (pl.ypos + ent.col_height) local dist = getDistance(ent, pl) local size = math.sqrt(ent.col_width * ent.col_width + ent.eye_height * ent.eye_height) if x + pl.col_width / 2 < ent.col_width + pl.col_width / 2 and x + pl.col_width / 2 > 0 then ePrint("Height="..y) if y < pl.col_height / -4 then getPlayer().col_obj = ent if x + pl.col_width / 2 > pl.col_width and getPlayer().right then ent.allow_right_movement = false ent.allow_left_movement = true elseif x + pl.col_width / 2 <= pl.col_width and getPlayer().left then ent.allow_right_movement = true ent.allow_left_movement = false end else ent.allow_right_movement = true ent.allow_left_movement = true if y > pl.col_height / -8 and y < pl.col_height and math.abs(x + pl.col_width / 2) > ent.col_width / 2 then ent.allow_fall_movement = false else ent.allow_fall_movement = true end end elseif getPlayer().col_obj == ent then getPlayer().col_obj = nil end end TILE.renderEnt = function (self,ent) if ent.variants ~= nil and ent.variants == false then renderAnimation(ent.animpath, "idle", ent.xpos, ent.ypos + ent.col_height / 2, ent.rot, 1.0, 1.0, ent.program_age) else renderAnimation(ent.animpath, "idle"..ent.anim_type, ent.xpos, ent.ypos + ent.col_height / 2, ent.rot, 1.0, 1.0, ent.program_age) end end return TILE
-- Niblib -- Biblioteca de API utilitária para o Nibble -- https://github.com/pongboy/nibble -- Apaga variáveis globais desnecessárias time = os.clock os = nil dprint = print -- Cria esqueleto de funções function init() end function update(dt) end function draw() end -- Importa implementação das funções local gpu = require('frameworks/niblib/gpu') local input = require('frameworks/niblib/input') local vid = require('frameworks/niblib/vid') local audio = require('frameworks/niblib/audio') -- Helpers da linguagem lang = require('frameworks/niblib/lang') -- Exporta a API gráfica -- Limpar a tela clr = gpu.clr -- Sprites spr = gpu.spr pspr = gpu.pspr -- Cores pal = gpu.pal col = gpu.col mix = gpu.mix -- Formas rectf = gpu.rectf quadf = gpu.quadf trif = gpu.trif circf = gpu.circf line = gpu.line circ = gpu.circ rect = gpu.rect quad = gpu.quad tri = gpu.tri mask = gpu.mask setcol = gpu.setcol cppal = gpu.cppal col = gpu.col screen = gpu.screen -- GIF start_recording = gpu.start_recording stop_recording = gpu.stop_recording -- Print print = gpu.print -- Exporta a API de entrada btd = function (b) return input.bt(b) == input.STDOWN; end btu = function (b) return input.bt(b) == input.STUP; end btp = function (b) return input.bt(b) == input.STPRESSED; end btr = function (b) return input.bt(b) == input.STRELEASED; end -- Manimulação direta da memória de vídeo putp = vid.putp getp = vid.getp UP = input.UP DOWN = input.DOWN LEFT = input.LEFT RIGHT = input.RIGHT RED = input.RED BLUE = input.BLUE BLACK = input.BLACK WHITE = input.WHITE -- Áudio snd = audio.snd mksnd = audio.mksnd note = audio.note skip = audio.skip rep = audio.rep loop = audio.loop stop = audio.stop adsr = audio.adsr
local Assert = require('util.assert') local ItemChestTransport = {} function ItemChestTransport.update(portal) Assert.Portal(portal) local source_inv = portal.from_entity.get_inventory(portal.type_params.source_inventory_type or defines.inventory.chest) local target_inv = portal.to_entity.get_inventory(portal.type_params.target_inventory_type or defines.inventory.chest) local source_contents = source_inv.get_contents() local start_rate = portal.type_params.rate local rate = start_rate for item, count in pairs(source_contents) do local new_count = count if start_rate then if rate > 0 then count = math.min(rate, count) rate = rate - new_count else break end end if count > 0 then local target_count = target_inv.insert{name = item, count = count} if target_count > 0 then source_inv.remove{name = item, count = target_count} end end end return portal.type_params.delay or 60 end return ItemChestTransport
if not nyagos then print("This is a script for nyagos not lua.exe") os.exit() end share.maincmds = {} -- git local githelp=io.popen("git help -a 2>nul","r") if githelp then local gitcmds={} for line in githelp:lines() do if string.match(line,"^ %S") then for word in string.gmatch(line,"%S+") do gitcmds[ #gitcmds+1 ] = word end end end githelp:close() if #gitcmds > 1 then local maincmds = share.maincmds maincmds["git"] = gitcmds maincmds["git.exe"] = gitcmds share.maincmds = maincmds end end -- Subversion local svnhelp=io.popen("svn help 2>nul","r") if svnhelp then local svncmds={} for line in svnhelp:lines() do local m=string.match(line,"^ ([a-z]+)") if m then svncmds[ #svncmds+1 ] = m end end svnhelp:close() if #svncmds > 1 then local maincmds = share.maincmds maincmds["svn"] = svncmds maincmds["svn.exe"] = svncmds share.maincmds = maincmds end end -- Mercurial local hghelp=io.popen("hg debugcomplete 2>nul","r") if hghelp then local hgcmds={} for line in hghelp:lines() do for word in string.gmatch(line,"[a-z]+") do hgcmds[#hgcmds+1] = word end end hghelp:close() if #hgcmds > 1 then local maincmds=share.maincmds maincmds["hg"] = hgcmds maincmds["hg.exe"] = hgcmds share.maincmds = maincmds end end -- Rclone local rclonehelp=io.popen("rclone --help 2>nul","r") if rclonehelp then local rclonecmds={} local startflag = false for line in rclonehelp:lines() do if string.match(line,"Available Commands:") then startflag = true end if string.match(line,"Flags:") then break end if startflag then local m=string.match(line,"^%s+([a-z]+)") if m then rclonecmds[ #rclonecmds+1 ] = m end end end rclonehelp:close() if #rclonecmds > 1 then local maincmds=share.maincmds maincmds["rclone"] = rclonecmds maincmds["rclone.exe"] = rclonecmds share.maincmds = maincmds end end if next(share.maincmds) then nyagos.completion_hook = function(c) if c.pos <= 1 then return nil end local cmdname = string.match(c.text,"^%S+") if not cmdname then return nil end --[[ 2nd command completion like :git bisect go[od] user define-able local subcommands={"good", "bad"} local maincmds=share.maincmds maincmds["git bisect"] = subcommands share.maincmds = maincmds --]] local cmd2nd = string.match(c.text,"^%S+%s+%S+") if share.maincmds[cmd2nd] then cmdname = cmd2nd end local subcmds = {} local subcmdData = share.maincmds[cmdname] if not subcmdData then return nil end local subcmdType = type(subcmdData) if "table" == subcmdType then subcmds = subcmdData elseif "function" == subcmdType then subcmds = subcmdData() end for i=1,#subcmds do table.insert(c.list,subcmds[i]) end return c.list end end
object_tangible_container_drum_shared_nonopening_treasure_drum = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/container/drum/shared_nonopening_treasure_drum.iff" } ObjectTemplates:addClientTemplate(object_tangible_container_drum_shared_nonopening_treasure_drum, "object/tangible/container/drum/shared_nonopening_treasure_drum.iff") ------------------------------------------------------------------------------------------------------------------------------------ object_tangible_container_drum_shared_supply_drop_crate = SharedTangibleObjectTemplate:new { clientTemplateFileName = "object/tangible/container/drum/shared_supply_drop_crate.iff" } ObjectTemplates:addClientTemplate(object_tangible_container_drum_shared_supply_drop_crate, "object/tangible/container/drum/shared_supply_drop_crate.iff") ------------------------------------------------------------------------------------------------------------------------------------
slot0 = class("FushunAdventureGameConst") slot0.BGM_NAME = "main-chunjie2" slot0.GAME_BGM_NAME = "bgm-cccp3" slot0.A_BTN_VOICE = "event:/ui/quanji" slot0.B_BTN_VOICE = "event:/ui/tiji" slot0.COUNT_DOWN_VOICE = "event:/ui/ddldaoshu2" slot0.ENTER_EX_VOICE = "event:/ui/baoqi" slot0.EX_TIP_TIME = 3 slot0.EX_TIME = 10 slot0.EX_CLICK_SCORE = 10 slot0.COMBO_SCORE_TARGET = 20 slot0.COMBO_EXTRA_SCORE = 5 slot0.LEVEL_CNT = 7 slot0.SHAKE_RANGE = 0.1 slot0.SHAKE_TIME = 0.05 slot0.SHAKE_LOOP_CNT = 2 slot0.FUSHUN_INIT_POSITION = Vector2(-655.7, -205) slot0.FUSHUN_ATTACK_DISTANCE = 230 slot0.FUSHUN_ATTACK_RANGE = 300 slot0.ENEMY_SPAWN_POSITION = Vector2(1300, -351) slot0.EX_ENEMY_SPAWN_TIME = 0.5 slot0.SPEED_ADDITION = { { { 0, 1000 }, 2.5 }, { { 1001, 3000 }, 3 }, { { 3001, 6000 }, 3.2 }, { { 6001, 8000 }, 3.4 } } slot0.PROPABILITES = { { { 0, 1000 }, 60, 20, 20 }, { { 1001, 3000 }, 50, 30, 20 }, { { 3001, 5000 }, 40, 40, 20 }, { { 5001, 8000 }, 20, 50, 30 } } slot0.ENEMY_SPAWN_TIME_ADDITION = { { { 0, 1000 }, { 2.2, 2.6 } }, { { 1001, 3000 }, { 1.8, 2.2 } }, { { 3001, 5000 }, { 1.5, 1.8 } }, { { 5001, 8000 }, { 1, 1.6 } } } slot0.ENEMYS = { { crazy_speed = 14, name = "beast01", hp = 1, speed = 3, id = 1, score = 10, attackDistance = 150, energyScore = 3 }, { crazy_speed = 13, name = "beast02", hp = 2, speed = 3, id = 2, score = 20, attackDistance = 150, energyScore = 5 }, { crazy_speed = 12, name = "beast03", hp = 3, speed = 3, id = 3, score = 30, attackDistance = 150, energyScore = 8 } } return slot0
local condition = Condition(CONDITION_DROWN) condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, -20) condition:setParameter(CONDITION_PARAM_TICKS, -1) condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000) function onStepIn(creature, item, position, fromPosition) if creature:isPlayer() then if math.random(1, 10) == 1 then position:sendMagicEffect(CONST_ME_BUBBLES) end creature:addCondition(condition) end return true end function onStepOut(creature, item, position, fromPosition) if not creature:isPlayer() then creature:removeCondition(CONDITION_DROWN) end return true end
-- -- tests/actions/vstudio/vc200x/test_assembly_refs.lua -- Validate managed assembly references in Visual Studio 2010 C/C++ projects. -- Copyright (c) 2013 Jason Perkins and the Premake project -- local p = premake local suite = test.declare("vs200x_assembly_refs") local vc200x = p.vstudio.vc200x -- -- Setup -- local wks, prj function suite.setup() p.action.set("vs2005") wks = test.createWorkspace() clr "On" end local function prepare(platform) prj = test.getproject(wks, 1) vc200x.assemblyReferences(prj) end -- -- If there are no managed assemblies listed in links, output nothing. -- function suite.noOutput_onNoAssemblies() prepare() test.isemptycapture() end -- -- To distinguish between managed and unmanaged libraries, the ".dll" -- extension must be explicitly supplied. -- function suite.listsAssemblies() links { "System.dll", "System.Data.dll" } prepare() test.capture [[ <AssemblyReference RelativePath="System.dll" /> <AssemblyReference RelativePath="System.Data.dll" /> ]] end -- -- Any unmanaged libraries included in the list should be ignored. -- function suite.ignoresUnmanagedLibraries() links { "m", "System.dll" } prepare() test.capture [[ <AssemblyReference RelativePath="System.dll" /> ]] end -- -- Local (non-system) assemblies can be referenced with a relative path. -- function suite.canReferenceLocalAssembly() links { "../nunit.framework.dll" } prepare() test.capture [[ <AssemblyReference RelativePath="..\nunit.framework.dll" /> ]] end
local Format do local lpeg = require "lpeg" local P, C, Cs, Ct, Cp, S = lpeg.P, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.Cp, lpeg.S local any = P(1) local sym = any-S':}' local esc = P'%%' / '%%' local var = P'%{' * C(sym^1) * '}' local fmt = P'%{' * C(sym^1) * ':' * C(sym^1) * '}' local function LpegFormat(str, context) local unknown local function fmt_sub(k, fmt) local v = context[k] if v == nil then local n = tonumber(k) if n then v = context[n] end end if v ~= nil then return string.format("%"..fmt, context[k]) end unknown = unknown or {} unknown[k] = '' end local function var_sub(k) local v = context[k] if v == nil then local n = tonumber(k) if n then v = context[n] end end if v ~= nil then return tostring(v) end unknown = unknown or {} unknown[k] = '' end local pattern = Cs((esc + (fmt / fmt_sub) + (var / var_sub) + any)^0) return pattern:match(str), unknown end local function LuaFormat(str, context) local unknown -- %{name:format} str = string.gsub(str, '%%%{([%w_][%w_]*)%:([-0-9%.]*[cdeEfgGiouxXsq])%}', function(k, fmt) local v = context[k] if v == nil then local n = tonumber(k) if n then v = context[n] end end if v ~= nil then return string.format("%"..fmt, context[k]) end unknown = unknown or {} unknown[k] = '' end ) -- %{name} return str:gsub('%%%{([%w_][%w_]*)%}', function(k) local v = context[k] if v == nil then local n = tonumber(k) if n then v = context[n] end end if v ~= nil then return tostring(v) end unknown = unknown or {} unknown[k] = '' end), unknown end Format = function(str, context) if string.find(str, '%%', 1, true) then return LpegFormat(str, context) end return LuaFormat(str, context) end end local combine do local mt = { __index = function(self, k) for i = 1, #self do if self[i][k] ~= nil then return self[i][k] end end end } combine = function(t) return setmetatable(t, mt) end end return { format = Format; combine = combine; }
Citizen.CreateThread(function() local cachedIndex = nil for index, data in ipairs(Config.Zones) do if (data.type == "yellow") then cachedIndex = index break end end while true do for _,vehicle in ipairs(GetAllVehicles()) do for index, bubble in ipairs(Config.Zones[cachedIndex].bubbles) do if Vdist(GetEntityCoords(vehicle), vector3(bubble.x, bubble.y, bubble.z)) < bubble.w then if DoesEntityExist(vehicle) then DeleteEntity(vehicle) end end end end Citizen.Wait(500) end end) Vdist = function(a, b) return math.sqrt( ((b.x - a.x) ^ 2) + ((b.y - a.y) ^ 2) ) end
EditorAlertTrigger = EditorAlertTrigger or class(MissionScriptEditor) function EditorAlertTrigger:create_element() self.super.create_element(self) self._element.class = "ElementAlertTrigger" self._element.values.filter = "0" self._element.values.alert_types = {} end function EditorAlertTrigger:_build_panel() self:_create_panel() local alert_type_table = { "footstep", "vo_ntl", "vo_cbt", "vo_intimidate", "vo_distress", "bullet", "aggression", "explosion" } self._alert_type_check_boxes = {} for i, o in ipairs(alert_type_table) do local check = self._menu:Toggle({ name = o, text = string.pretty(o, true), value = table.contains(self._element.values.alert_types, o), callback = callback(self, self, "on_alert_type_checkbox_changed"), }) self._alert_type_check_boxes[o] = check end self._menu:ComboBox({ name = "preset", text = "Preset:", items = {"clear", "all"}, help = "Select a preset.", callback = callback(self, self, "apply_preset"), }) local opt = NavigationManager.ACCESS_FLAGS local filter_table = managers.navigation:convert_access_filter_to_table(self._element.values.filter) self._filter_check_boxes = {} for i, o in ipairs(opt) do local check = self._menu:Toggle({ name = o, text = string.pretty(o, true), value = table.contains(filter_table, o), callback = callback(self, self, "on_filter_checkbox_changed"), }) self._filter_check_boxes[o] = check end end function EditorAlertTrigger:apply_preset(menu, item) local value = item:SelectedItem() BeardLibEditor.Utils:YesNoQuestion("This will apply the preset" .. (item:SelectedItem() or ""), function() if value == "clear" then self:_set_filter_none() elseif value == "all" then self:_set_filter_all() else BeardLibEditor:log(tostring(value) .. " Didn't have preset yet.") end end) end function EditorAlertTrigger:_set_filter_all() for name, item in pairs(self._filter_check_boxes) do item:SetValue(true) end self._element.values.filter = managers.navigation:convert_access_filter_to_string(managers.navigation.ACCESS_FLAGS) end function EditorAlertTrigger:_set_filter_none() for name, item in pairs(self._filter_check_boxes) do item:SetValue(false) end self._element.values.filter = "0" end function EditorAlertTrigger:on_filter_checkbox_changed(menu, item) local filter_table = managers.navigation:convert_access_filter_to_table(self._element.values.filter) local value = item.value if value then if table.contains(filter_table, item.name) then return end table.insert(filter_table, item.name) else table.delete(filter_table, item.name) end self._element.values.filter = managers.navigation:convert_access_filter_to_string(filter_table) local filter = managers.navigation:convert_access_filter_to_number(self._element.values.filter) end function EditorAlertTrigger:on_alert_type_checkbox_changed(menu, item) local value = item.value if value then if table.contains(self._element.values.alert_types, item.name) then return end table.insert(self._element.values.alert_types, item.name) else table.delete(self._element.values.alert_types, item.name) end end
local common = {} function common.is_utf8_cont(char) local byte = char:byte() return byte >= 0x80 and byte < 0xc0 end function common.utf8_chars(text) return text:gmatch("[%z\001-\127\194-\244][\128-\191]*") end function common.clamp(n, lo, hi) return math.max(math.min(n, hi), lo) end function common.round(n) return n >= 0 and math.floor(n + 0.5) or math.ceil(n - 0.5) end function common.lerp(a, b, t) if type(a) ~= "table" then return a + (b - a) * t end local res = {} for k, v in pairs(b) do res[k] = common.lerp(a[k], v, t) end return res end function common.color(str) local r, g, b, a = str:match("#(%x%x)(%x%x)(%x%x)") if r then r = tonumber(r, 16) g = tonumber(g, 16) b = tonumber(b, 16) a = 1 elseif str:match("rgba?%s*%([%d%s%.,]+%)") then local f = str:gmatch("[%d.]+") r = (f() or 0) g = (f() or 0) b = (f() or 0) a = f() or 1 else error(string.format("bad color string '%s'", str)) end return r, g, b, a * 0xff end local function compare_score(a, b) return a.score > b.score end local function fuzzy_match_items(items, needle) local res = {} for _, item in ipairs(items) do local score = system.fuzzy_match(tostring(item), needle) if score then table.insert(res, { text = item, score = score }) end end table.sort(res, compare_score) for i, item in ipairs(res) do res[i] = item.text end return res end function common.fuzzy_match(haystack, needle) if type(haystack) == "table" then return fuzzy_match_items(haystack, needle) end return system.fuzzy_match(haystack, needle) end function common.path_suggest(text) local path, name = text:match("^(.-)([^/\\]*)$") local files = system.list_dir(path == "" and "." or path) or {} local res = {} for _, file in ipairs(files) do file = path .. file local info = system.get_file_info(file) if info then if info.type == "dir" then file = file .. PATHSEP end if file:lower():find(text:lower(), nil, true) == 1 then table.insert(res, file) end end end return res end function common.match_pattern(text, pattern, ...) if type(pattern) == "string" then return text:find(pattern, ...) end for _, p in ipairs(pattern) do local s, e = common.match_pattern(text, p, ...) if s then return s, e end end return false end function common.draw_text(font, color, text, align, x,y,w,h) local tw, th = font:get_width(text), font:get_height(text) if align == "center" then x = x + (w - tw) / 2 elseif align == "right" then x = x + (w - tw) end y = common.round(y + (h - th) / 2) return renderer.draw_text(font, text, x, y, color), y + th end function common.bench(name, fn, ...) local start = system.get_time() local res = fn(...) local t = system.get_time() - start local ms = t * 1000 local per = (t / (1 / 60)) * 100 print(string.format("*** %-16s : %8.3fms %6.2f%%", name, ms, per)) return res end return common
resource.AddWorkshop("403587498")
local util = require ('gluon.util') local math_polygon = require('math-polygon') local json = require ('jsonc') local uci = require('simple-uci').cursor() local site = require ('gluon.site') local M = {} function M.get_domains() local list = {} for _, domain_path in ipairs(util.glob('/lib/gluon/domains/*.json')) do table.insert(list, { domain_code = domain_path:match('([^/]+)%.json$'), domain = assert(json.load(domain_path)), }) end return list end -- Return the default domain from the domain list. -- This method can return the following data: -- * default domain function M.get_default_domain(jdomains) for _, domain in pairs(jdomains) do if domain.domain_code == site.default_domain() then return domain end end end -- Get Geoposition. -- This method can return the following data: -- * table {lat, lon} function M.get_geolocation() return { lat = tonumber(uci:get('gluon-node-info', uci:get_first('gluon-node-info', 'location'), 'latitude')), lon = tonumber(uci:get('gluon-node-info', uci:get_first('gluon-node-info', 'location'), 'longitude')) } end -- Return domain from the domain list based on geo position or nil if no geo based domain could be -- determined. function M.get_domain_by_geo(jdomains, geo) for _, domain in pairs(jdomains) do if domain.domain_code ~= site.default_domain() then -- Keep record of how many nested shapes we are in, e.g. a polyon with holes. local nesting = 1 for _, area in pairs(domain.domain.hoodselector.shapes) do -- Convert rectangle, defined by to points, into polygon if #area == 2 then area = math_polygon.two_point_rec_to_poly(area) end if (math_polygon.point_in_polygon(area, geo) == 1) then nesting = nesting * (-1) end end if nesting == -1 then return domain end end end return nil end function M.set_domain_config(domain) if uci:get('gluon', 'core', 'domain') ~= domain.domain_code then os.execute(string.format("exec gluon-switch-domain --no-reboot '%s'", domain.domain_code)) util.log('Set domain "' .. domain.domain.domain_names[domain.domain_code] .. '"', true) return true end return false end return M
function render() newView(this, "imgui", "default") setPass(this, "MAIN") clear(this, CLEAR_COLOR | CLEAR_DEPTH, 0x303030ff) setViewMode(this, VIEW_MODE_SEQUENTIAL) end
-- Tests for alpha_beta_pruning.lua local negamax = require 'negamax' local total, pass = 0, 0 local function dec(str, len) return #str < len and str .. (('.'):rep(len-#str)) or str:sub(1,len) end local function run(message, f) total = total + 1 local ok, err = pcall(f) if ok then pass = pass + 1 end local status = ok and 'PASSED' or 'FAILED' print(('%02d. %68s: %s'):format(total, dec(message,68), status)) end run('Testing Negamax', function() local tree = require 'handlers.tree_handler' local t = tree() t:addNode('A',nil,0) t:addNode('B1','A',0) t:addNode('B2','A',0) t:addNode('B3','A',0) t:addNode('C1','B1',4) t:addNode('C2','B1',12) t:addNode('C3','B1',7) t:addNode('C4','B2',10) t:addNode('C5','B2',5) t:addNode('C6','B2',6) t:addNode('C7','B3',1) t:addNode('C8','B3',2) t:addNode('C9','B3',3) local head = t:getNode('A') assert(negamax(head, t, 3, 1) == 5) assert(negamax(head, t, 3, -1) == -3) end) print(('-'):rep(80)) print(('Total : %02d: Pass: %02d - Failed : %02d - Success: %.2f %%') :format(total, pass, total-pass, (pass*100/total)))
---@type Plugin local plugin = ... plugin.name = 'Whitelist' plugin.author = 'jdb' plugin.description = 'Only let in certain players.' plugin.defaultConfig = { -- How many people can be let in regardless of if they're whitelisted maxPublicSlots = 0 } local json = require 'main.json' local whitelistPath = 'whitelist.json' ---@type integer[] local whitelistedPhoneNumbers local function getWhitelistIndex (phoneNumber) for i, p in ipairs(whitelistedPhoneNumbers) do if p == phoneNumber then return i end end return nil end ---Check if a phone number is in the whitelist. ---@param phoneNumber integer The phone number to check. ---@return boolean isWhitelisted function isNumberWhitelisted (phoneNumber) if not plugin.isEnabled then return false end local data = { whitelisted = getWhitelistIndex(phoneNumber) ~= nil } if hook.run('WhitelistCheck', phoneNumber, data) then return false end return not not data.whitelisted end local isNumberWhitelisted = isNumberWhitelisted local function saveWhitelist () local f, errorMessage = io.open(whitelistPath, 'w') if f then f:write(json.encode(whitelistedPhoneNumbers)) f:close() plugin:print('Saved phone numbers') else plugin:warn('Could not save phone numbers: ' .. errorMessage) end end plugin:addEnableHandler(function () local f, errorMessage = io.open(whitelistPath, 'r') if f then whitelistedPhoneNumbers = json.decode(f:read('*all')) f:close() plugin:print('Loaded ' .. #whitelistedPhoneNumbers .. ' phone numbers') else whitelistedPhoneNumbers = {} plugin:warn('Could not load phone numbers: ' .. errorMessage) end end) plugin:addDisableHandler(function () whitelistedPhoneNumbers = nil end) plugin:addHook( 'AccountTicketFound', ---@param acc Account function (acc) local maxPublicSlots = plugin.config.maxPublicSlots local playerCount = #players.getNonBots() if playerCount >= maxPublicSlots then if acc then if isNumberWhitelisted(acc.phoneNumber) then -- Let it through return end hook.once( 'SendConnectResponse', function (_, _, data) if maxPublicSlots == 0 then data.message = 'Whitelisted accounts only' else data.message = string.format('All public slots are taken (%i // %i)', playerCount, maxPublicSlots) end end ) end return hook.override end end ) plugin.commands['listwhitelist'] = { info = 'List all whitelisted players.', call = function () print(table.concat(whitelistedPhoneNumbers, ', ')) end } plugin.commands['/whitelist'] = { info = 'Add a player to the whitelist.', usage = '<phoneNumber>', canCall = function (ply) return ply.isConsole or ply.isAdmin end, ---@param ply Player ---@param args string[] call = function (ply, _, args) assert(#args >= 1, 'usage') local phoneNumber = undashPhoneNumber(args[1]) assert(phoneNumber, 'Invalid phone number') if getWhitelistIndex(phoneNumber) then error('Phone number already whitelisted') end table.insert(whitelistedPhoneNumbers, phoneNumber) saveWhitelist() if adminLog then adminLog('%s whitelisted %s', ply.name, dashPhoneNumber(phoneNumber)) end end } plugin.commands['/unwhitelist'] = { info = 'Remove a player from the whitelist.', usage = '<phoneNumber>', canCall = function (ply) return ply.isConsole or ply.isAdmin end, ---@param ply Player ---@param args string[] call = function (ply, _, args) assert(#args >= 1, 'usage') local phoneNumber = undashPhoneNumber(args[1]) assert(phoneNumber, 'Invalid phone number') local index = getWhitelistIndex(phoneNumber) if not index then error('Phone number not whitelisted') end table.remove(whitelistedPhoneNumbers, index) saveWhitelist() if adminLog then adminLog('%s unwhitelisted %s', ply.name, dashPhoneNumber(phoneNumber)) end end }
return { version = "1.1", luaversion = "5.1", orientation = "orthogonal", width = 30, height = 30, tilewidth = 32, tileheight = 32, properties = { ["blockx"] = "32", ["blocky"] = "32", ["format"] = ".png", ["numx"] = "8", ["numy"] = "8" }, tilesets = { { name = "tmw_desert_spacing", firstgid = 1, tilewidth = 32, tileheight = 32, spacing = 1, margin = 1, image = "../../../media/document/CloudCache/jyqx/tiled-qt-0.8.1/examples/tmw_desert_spacing.png", imagewidth = 265, imageheight = 199, properties = {}, tiles = {} } }, layers = { { type = "tilelayer", name = "Ground", x = 0, y = 0, width = 30, height = 30, visible = true, opacity = 1, properties = {}, encoding = "lua", data = { 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 14, 15, 16, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 46, 14, 15, 16, 30, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 14, 15, 16, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 31, 22, 23, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 1, 2, 3, 30, 30, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 9, 10, 11, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 9, 10, 11, 30, 30, 30, 30, 30, 30, 30, 30, 30, 40, 30, 30, 30, 30, 33, 34, 36, 42, 37, 34, 34, 34, 34, 34, 34, 34, 35, 9, 10, 11, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 34, 35, 30, 33, 34, 34, 34, 34, 34, 34, 34, 35, 9, 10, 11, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 38, 30, 30, 33, 34, 35, 30, 33, 34, 34, 34, 34, 34, 34, 34, 35, 9, 10, 11, 30, 30, 30, 30, 30, 30, 30, 30, 48, 38, 30, 30, 30, 30, 33, 34, 44, 26, 45, 34, 34, 34, 34, 34, 34, 34, 35, 9, 10, 11, 30, 30, 30, 30, 30, 30, 40, 30, 30, 30, 40, 30, 30, 30, 33, 34, 34, 34, 34, 34, 34, 34, 36, 42, 37, 34, 35, 9, 10, 11, 30, 30, 30, 40, 30, 30, 30, 30, 40, 38, 30, 30, 38, 30, 33, 34, 34, 34, 34, 34, 34, 34, 44, 26, 45, 34, 35, 9, 10, 11, 30, 30, 30, 30, 39, 30, 30, 30, 38, 30, 40, 30, 30, 30, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 9, 10, 11, 30, 30, 30, 30, 30, 30, 39, 30, 30, 30, 30, 30, 30, 30, 41, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 43, 9, 10, 11, 30, 30, 30, 7, 7, 8, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 29, 10, 11, 30, 30, 30, 15, 15, 16, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 30, 30, 30, 23, 23, 24, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 30, 30, 30, 30, 30, 39, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 39, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 39, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 25, 26, 26, 26, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 46, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 47, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 39, 30, 30, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 47, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 33, 34, 34, 34, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 41, 42, 42, 42 } } } }
---------------------------------------------------------------------------------------------------- -- -- Copyright (c) Contributors to the Open 3D Engine Project. -- For complete copyright and license terms please see the LICENSE at the root of this distribution. -- -- SPDX-License-Identifier: Apache-2.0 OR MIT -- -- -- ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- -- DropTargetCrossCanvas - script for a drop target element that can be dropped on from other -- canvases. This script is designed to be used with DraggableCrossCanvasElement ---------------------------------------------------------------------------------------------------- local DropTargetCrossCanvas = { Properties = { }, } function DropTargetCrossCanvas:OnActivate() self.dropTargetHandler = UiDropTargetNotificationBus.Connect(self, self.entityId) end function DropTargetCrossCanvas:OnDeactivate() self.dropTargetHandler:Disconnect() end function DropTargetCrossCanvas:OnDropHoverStart(draggable) if (UiDraggableBus.Event.IsProxy(draggable)) then if (UiElementBus.Event.GetNumChildElements(self.entityId) <= 0) then UiDraggableBus.Event.SetDragState(draggable, eUiDragState_Valid) UiDropTargetBus.Event.SetDropState(self.entityId, eUiDropState_Valid) else UiDraggableBus.Event.SetDragState(draggable, eUiDragState_Invalid) UiDropTargetBus.Event.SetDropState(self.entityId, eUiDropState_Invalid) end end end function DropTargetCrossCanvas:OnDropHoverEnd(draggable) if (UiDraggableBus.Event.IsProxy(draggable)) then UiDraggableBus.Event.SetDragState(draggable, eUiDragState_Normal) UiDropTargetBus.Event.SetDropState(self.entityId, eUiDropState_Normal) else UiDraggableBus.Event.SetDragState(draggable, eUiDragState_Normal) UiDropTargetBus.Event.SetDropState(self.entityId, eUiDropState_Normal) end end function DropTargetCrossCanvas:OnDrop(draggable) if (not UiDraggableBus.Event.IsProxy(draggable)) then if (UiElementBus.Event.GetNumChildElements(self.entityId) <= 0) then local myCanvasEntity = UiElementBus.Event.GetCanvas(self.entityId) local draggableCanvasEntity = UiElementBus.Event.GetCanvas(draggable) if (myCanvasEntity == draggableCanvasEntity) then UiElementBus.Event.Reparent(draggable, self.entityId, EntityId()) else -- clone the draggable and remove it from its original canvas UiCanvasBus.Event.CloneElement(myCanvasEntity, draggable, self.entityId, EntityId()) UiElementBus.Event.DestroyElement(draggable) end end end end return DropTargetCrossCanvas
local http = require "http" local os = require "os" local shortport = require "shortport" local stdnse = require "stdnse" local string = require "string" local vulns = require "vulns" local openssl = stdnse.silent_require "openssl" description = [[ Tests for the CVE-2011-3368 (Reverse Proxy Bypass) vulnerability in Apache HTTP server's reverse proxy mode. The script will run 3 tests: * the loopback test, with 3 payloads to handle different rewrite rules * the internal hosts test. According to Contextis, we expect a delay before a server error. * The external website test. This does not mean that you can reach a LAN ip, but this is a relevant issue anyway. References: * http://www.contextis.com/research/blog/reverseproxybypass/ ]] --- -- @usage -- nmap --script http-vuln-cve2011-3368 <targets> -- -- @output -- PORT STATE SERVICE -- 80/tcp open http -- | http-vuln-cve2011-3368: -- | VULNERABLE: -- | Apache mod_proxy Reverse Proxy Security Bypass -- | State: VULNERABLE -- | IDs: CVE:CVE-2011-3368 OSVDB:76079 -- | Description: -- | An exposure was reported affecting the use of Apache HTTP Server in -- | reverse proxy mode. The exposure could inadvertently expose internal -- | servers to remote users who send carefully crafted requests. -- | Disclosure date: 2011-10-05 -- | Extra information: -- | Proxy allows requests to external websites -- | References: -- | http://osvdb.org/76079 -- |_ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-3368 -- -- @args http-vuln-cve2011-3368.prefix sets the path prefix (directory) to check for the vulnerability. -- author = {"Ange Gutek", "Patrik Karlsson"} license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"intrusive", "vuln"} portrule = shortport.http action = function(host, port) local vuln = { title = 'Apache mod_proxy Reverse Proxy Security Bypass', IDS = { CVE='CVE-2011-3368', OSVDB='76079'}, description = [[ An exposure was reported affecting the use of Apache HTTP Server in reverse proxy mode. The exposure could inadvertently expose internal servers to remote users who send carefully crafted requests.]], references = { 'http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-3368' }, dates = { disclosure = { year='2011', month='10', day='05'} }, } local report = vulns.Report:new(SCRIPT_NAME, host, port) local prefix = stdnse.get_script_args("http-vuln-cve2011-3368.prefix") or "" -- Take a reference chrono for a 404 local start = os.time(os.date('*t')) local random_page = stdnse.tohex(openssl.sha1(openssl.rand_pseudo_bytes(512))) local reference = http.get(host,port,("%s/%s.htm"):format(prefix,random_page)) local chrono_404 = os.time(os.date('*t'))-start -- TEST 1: the loopback test, with 3 payloads to handle different rewrite rules local all all = http.pipeline_add(("%s@localhost"):format(prefix),nil, all) all = http.pipeline_add(("%s:@localhost"):format(prefix),nil, all) all = http.pipeline_add(("%s:@localhost:80"):format(prefix), nil, all) local bypass_request = http.pipeline_go(host,port, all) if ( not(bypass_request) ) then stdnse.debug1("got no answers from pipelined queries") return stdnse.format_output(false, "Got no answers from pipelined queries") end -- going through the results of TEST 1 we could see -- * 200 OK -- o This could be the result of the server being vulnerable -- o This could also be the result of a generic error page -- * 40X Error -- o This is most likely the result of the server NOT being vulnerable -- -- We can not determine whether the server is vulnerable or not solely -- by relying on the 200 OK. If we have no 200 OK abort, otherwise continue local got_200_ok for _, response in ipairs(bypass_request) do if ( response.status == 200 ) then got_200_ok = true end end -- if we didn't get at least one 200 OK, the server is most like NOT vulnerable if ( not(got_200_ok) ) then vuln.state = vulns.STATE.NOT_VULN return report:make_output(vuln) end for i=1, #bypass_request, 1 do stdnse.debug1("test %d returned a %d",i,bypass_request[i].status) -- here a 400 should be the evidence for a patched server. if ( bypass_request[i].status == 200 and vuln.state ~= vulns.STATE.VULN ) then -- TEST 2: the internal hosts test. According to Contextis, we expect a delay before a server error. -- According to my (Patrik) tests, internal hosts reachable by the server may return instant responses local tests = { { prefix = "", suffix = "" }, { prefix = ":", suffix = ""}, { prefix = ":", suffix = ":80"} } -- try a bunch of hosts, and hope we hit one that's -- not on the network, this will give us the delay we're expecting local hosts = { "10.10.10.10", "192.168.211.211", "172.16.16.16" } -- perform one request for each host, and stop once we -- receive a timeout for one of them for _, h in ipairs(hosts) do local response = http.get( host, port, ("%s%s@%s%s"):format(prefix, tests[i].prefix, h, tests[i].suffix), { timeout = ( chrono_404 + 5 ) * 1000 } ) -- check if the GET timed out if ( not(response.status) ) then vuln.state = vulns.STATE.VULN break end end end end -- TEST 3: The external website test. This does not mean that you can reach a LAN ip, but this is a relevant issue anyway. local external = http.get(host,port, ("%[email protected]"):format(prefix)) if ( external.status == 200 and string.match(external.body,"Go ahead and ScanMe") ) then vuln.extra_info = "Proxy allows requests to external websites" end return report:make_output(vuln) end
local default_dmg = DamageType("default") skill_manager.RegisterDamageType( default_dmg )
--- Gather informations from the CLI -- @module args -- @usage args(project) local argparse = require 'argparse' local class = require 'middleclass' local utils = require 'love-release.utils' local Args = class('Args') Args.pre = true Args.args = nil function Args:initialize() self.pre = Args.pre local parser = argparse() :name "love-release" :description "Makes LÖVE games releases easier !" :epilog "For more info, see https://github.com/MisterDA/love-release" parser:argument("release", "Project release directory.") :args "?" parser:argument("source", "Project source directory.") :args "?" parser:flag("-D", "Debian package.") :target "debian" parser:flag("-M", "MacOS X application.") :target "macosx" parser:option("-W", "Windows executable.") :target "windows" :args "0-1" :count "0-2" :argname "32|64" parser:option("-a --author", "Author full name.") parser:flag("-b", "Compile new or updated files to LuaJIT bytecode.") :target("compile") parser:option("-d --desc", "Project description.") parser:option("-e --email", "Author email.") parser:option("-l --love", "LÖVE version to use.") :target("loveVersion") parser:option("-p --package", "Package and command name.") parser:option("-t --title", "Project title.") parser:option("-u --url", "Project homepage url.") parser:option("--uti", "Project Uniform Type Identifier.") parser:option("-v", "Project version.") :target("version") parser:option("-x --exclude", "Exclude file patterns."):count("*") :target("excludeFileList") parser:flag("--version", "Show love-release version and exit.") :target("love_release") self.args = parser:parse() end function Args:__call(project) local out = utils.io.out local args = self.args if self.pre then if args.source then project:setProjectDirectory(args.source) end if args.release then project:setReleaseDirectory(args.release) end if args.love_release then local show = require 'luarocks.show' local _, version = show.pick_installed_rock("love-release") out("love-release "..version.."\n") os.exit(0) end self.pre = false return project end if args.author then project:setAuthor(args.author) end if args.compile then project:setCompile(true) end if args.desc then project:setDescription(args.desc) end if args.email then project:setEmail(args.email) end if args.loveVersion then assert(utils.love.isSupported(args.loveVersion), "ARGS: "..args.loveVersion.." is not supported.\n") project:setLoveVersion(args.loveVersion) end if args.package then project:setPackage(args.package) end if args.title then project:setTitle(args.title) end if args.url then project:setHomepage(args.url) end if args.uti then project:setIdentifier(args.uti) end if args.version then project:setVersion(args.version) end if #args.excludeFileList >= 1 then project:setExcludeFileList(args.excludeFileList) end if project.projectDirectory == project.releaseDirectory then project:setReleaseDirectory(project.releaseDirectory.."/releases") end print(project) local script script = require 'love-release.scripts.love' script(project) if args.macosx then script = require 'love-release.scripts.macosx' script(project) end if #args.windows > 0 then local win = args.windows local win32 = win[1][1] == "32" or (win[2] and win[2][1] == "32") local win64 = win[1][1] == "64" or (win[2] and win[2][1] == "64") if not win32 and not win64 then win32, win64 = true, true end script = require 'love-release.scripts.windows' if win32 then script(project, 32) end if win64 then script(project, 64) end end if args.debian then script = require 'love-release.scripts.debian' script(project) end return project end return Args
--this = SceneNode() function create() local towerList = {} towerList[0] = "WallTower" towerList[1] = "MinigunTower" towerList[2] = "ArrowTower" towerList[3] = "SwarmTower" towerList[4] = "ElectricTower" towerList[5] = "BladeTower" towerList[6] = "missileTower" local towerListSize = 1 local island = this:getRootNode():findAllNodeByNameTowardsLeaf("island1") island:loadLuaScript() return true end function update() return false; end
local af = Def.ActorFrame{} -- --------------------------------------------- -- setup involving optional arguments that might have been passed in via a key/value table local args = ... -- a player object, indexed by "Player"; default to GAMESTATE's MasterPlayer if none is provided local player = args.Player or GAMESTATE:GetMasterPlayerNumber() if not player then return af end local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(player) -- the number of HighScores to retrieve, indexed by "NumHighScores"; default to 5 if none is provided local NumHighScores = args.NumHighScores or 5 -- optionally provide a player profile; if none is provided, default to retrieving HighScores from -- the MachineProfile for this stepchart; this is typically what we want local profile = args.Profile or PROFILEMAN:GetMachineProfile() -- optionally provide Song/Course and Steps/Trail objects; if none are provided -- default to using whatever GAMESTATE currently thinks they are local SongOrCourse = args.SongOrCourse or (GAMESTATE:IsCourseMode() and GAMESTATE:GetCurrentCourse() or GAMESTATE:GetCurrentSong()) local StepsOrTrail = args.StepsOrTrail or ((args.RoundsAgo==nil or args.RoundsAgo==1) and (GAMESTATE:IsCourseMode() and GAMESTATE:GetCurrentTrail(player) or GAMESTATE:GetCurrentSteps(player))) if not (SongOrCourse and StepsOrTrail) then return af end local Font = args.Font or "Common Normal" local row_height = 22 -- sigh -- --------------------------------------------- -- setup that can occur now that the arguments have been handled local experimentHighScores = GetScores(player,args.Hash) --add our current song to the list of scores and mark it so we know which one it is local currentScore = {current=true,score=pss:GetPercentDancePoints(),dateTime=GetCurrentDateTime(),rate=SL.Global.ActiveModifiers.MusicRate,grade=pss:GetFailed() and "Failed" or ""} if not experimentHighScores then experimentHighScores = {} experimentHighScores[1]= currentScore else table.insert(experimentHighScores,currentScore) table.sort(experimentHighScores,function(k1,k2) return tonumber(k1.score) > tonumber(k2.score) end) end -- don't attempt to retrieve more HighScores than are actually saved to the desired Profile (machine or player) local MaxHighScores = PREFSMAN:GetPreference("MaxHighScoresPerListFor" .. (profile==PROFILEMAN:GetMachineProfile() and "Machine" or "Player")) NumHighScores = math.min(NumHighScores, MaxHighScores) local months = {} for i=1,12 do table.insert(months, THEME:GetString("HighScoreList", "Month"..i)) end -- --------------------------------------------- -- lower and upper will be used as loop start and end points -- we'll loop through the the list of highscores from lower to upper indices -- initialize them to 1 and NumHighScores now; they may change later local lower = 1 local upper = NumHighScores -- If the we're on Evaluation or EvaluationSummary, we might want to compare the player's recent -- performance to the overall list of highscores. -- --------------------------------------------- for i=lower,upper do local row_index = i-lower local score, rate, date local numbers = {} if experimentHighScores[i] then score = FormatPercentScore(experimentHighScores[i].score) if experimentHighScores[i].grade == 'Failed' then score = score.." (F)" end rate = experimentHighScores[i].rate date = experimentHighScores[i].dateTime -- make the date look nice for number in string.gmatch(date, "%d+") do numbers[#numbers+1] = number end date = months[tonumber(numbers[2])] .. " " .. numbers[3] .. ", " .. numbers[1] else rate = "----" score = "------" date = "----------" end local row = Def.ActorFrame{} -- if we wanted to compare a player's performance against the list of highscores we are returning if args.RoundsAgo then -- then specify and OnCommand that will check if this row represents the player's performance for this round row.OnCommand=function(self) if experimentHighScores[i] and experimentHighScores[i].current then -- apply a diffuseshift effect to draw attentiont to this row self:diffuseshift():effectperiod(4/3) self:effectcolor1( PlayerColor(player) ) self:effectcolor2( Color.White ) end end end row[#row+1] = LoadFont(Font)..{ Text=i..". ", InitCommand=function(self) self:horizalign(right):xy(-120, row_index*row_height) end } row[#row+1] = LoadFont(Font)..{ Text=score, InitCommand=function(self) self:horizalign(left):xy(-110, row_index*row_height) end } row[#row+1] = LoadFont(Font)..{ Text=rate, InitCommand=function(self) self:horizalign(left):xy(-24, row_index*row_height) end } row[#row+1] = LoadFont(Font)..{ Text=date, InitCommand=function(self) self:horizalign(left):xy(50, row_index*row_height) end } af[#af+1] = row row_index = row_index + 1 end return af
local Assert = require("api.test.Assert") local TestUtil = require("api.test.TestUtil") function test_ICharaSkills_init__prototype_default_skills() local chara = TestUtil.stripped_chara("elona.zeome") Assert.eq(true, chara:has_skill("elona.spell_cure_of_jure")) Assert.eq(1, chara:skill_level("elona.spell_cure_of_jure")) end function test_ICharaSkills_init__initial_skills() local chara = TestUtil.stripped_chara("elona.putit") Assert.eq(true, chara:has_skill("elona.axe")) Assert.eq(true, chara:has_skill("elona.blunt")) Assert.eq(true, chara:has_skill("elona.bow")) Assert.eq(true, chara:has_skill("elona.crossbow")) Assert.eq(true, chara:has_skill("elona.evasion")) Assert.eq(true, chara:has_skill("elona.faith")) Assert.eq(true, chara:has_skill("elona.healing")) Assert.eq(true, chara:has_skill("elona.heavy_armor")) Assert.eq(true, chara:has_skill("elona.light_armor")) Assert.eq(true, chara:has_skill("elona.long_sword")) Assert.eq(true, chara:has_skill("elona.martial_arts")) Assert.eq(true, chara:has_skill("elona.meditation")) Assert.eq(true, chara:has_skill("elona.medium_armor")) Assert.eq(true, chara:has_skill("elona.polearm")) Assert.eq(true, chara:has_skill("elona.scythe")) Assert.eq(true, chara:has_skill("elona.shield")) Assert.eq(true, chara:has_skill("elona.short_sword")) Assert.eq(true, chara:has_skill("elona.stat_luck")) Assert.eq(true, chara:has_skill("elona.stave")) Assert.eq(true, chara:has_skill("elona.stealth")) Assert.eq(true, chara:has_skill("elona.throwing")) end
require("prototypes.itemgroup.data") require("prototypes.item.data") require("prototypes.entity.data") require("prototypes.resource.data") require("prototypes.science.data") require("prototypes.recipe.data") require("prototypes.technology.data")
local t -- standard constructor t = {"a", 1, true} assert(t[1] == "a") assert(t[2] == 1) assert(t[3] == true) local function a() return 2, 3 end -- constructor with multiple return values from a function t = {1, a()} assert(t[1] == 1) assert(t[2] == 2) assert(t[3] == 3) -- constructor with more than 50 elements to use C parameter t = {1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} assert(t[1] == 1) assert(t[49] == 9) assert(t[50] == 10) assert(t[51] == 11) assert(t[55] == 15) t = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238,1239,1240,1241,1242,1243,1244,1245,1246,1247,1248,1249,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1280,1281,1282,1283,1284,1285,1286,1287,1288,1289,1290,1291,1292,1293,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1304,1305,1306,1307,1308,1309,1310,1311,1312,1313,1314,1315,1316,1317,1318,1319,1320,1321,1322,1323,1324,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1369,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1386,1387,1388,1389,1390,1391,1392,1393,1394,1395,1396,1397,1398,1399,1400,1401,1402,1403,1404,1405,1406,1407,1408,1409,1410,1411,1412,1413,1414,1415,1416,1417,1418,1419,1420,1421,1422,1423,1424,1425,1426,1427,1428,1429,1430,1431,1432,1433,1434,1435,1436,1437,1438,1439,1440,1441,1442,1443,1444,1445,1446,1447,1448,1449,1450,1451,1452,1453,1454,1455,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1482,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544,1545,1546,1547,1548,1549,1550,1551,1552,1553,1554,1555,1556,1557,1558,1559,1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,1595,1596,1597,1598,1599,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,1619,1620,1621,1622,1623,1624,1625,1626,1627,1628,1629,1630,1631,1632,1633,1634,1635,1636,1637,1638,1639,1640,1641,1642,1643,1644,1645,1646,1647,1648,1649,1650,1651,1652,1653,1654,1655,1656,1657,1658,1659,1660,1661,1662,1663,1664,1665,1666,1667,1668,1669,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1680,1681,1682,1683,1684,1685,1686,1687,1688,1689,1690,1691,1692,1693,1694,1695,1696,1697,1698,1699,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,1820,1821,1822,1823,1824,1825,1826,1827,1828,1829,1830,1831,1832,1833,1834,1835,1836,1837,1838,1839,1840,1841,1842,1843,1844,1845,1846,1847,1848,1849,1850,1851,1852,1853,1854,1855,1856,1857,1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915,1916,1917,1918,1919,1920,1921,1922,1923,1924,1925,1926,1927,1928,1929,1930,1931,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,2060,2061,2062,2063,2064,2065,2066,2067,2068,2069,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2080,2081,2082,2083,2084,2085,2086,2087,2088,2089,2090,2091,2092,2093,2094,2095,2096,2097,2098,2099,2100,2101,2102,2103,2104,2105,2106,2107,2108,2109,2110,2111,2112,2113,2114,2115,2116,2117,2118,2119,2120,2121,2122,2123,2124,2125,2126,2127,2128,2129,2130,2131,2132,2133,2134,2135,2136,2137,2138,2139,2140,2141,2142,2143,2144,2145,2146,2147,2148,2149,2150,2151,2152,2153,2154,2155,2156,2157,2158,2159,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2180,2181,2182,2183,2184,2185,2186,2187,2188,2189,2190,2191,2192,2193,2194,2195,2196,2197,2198,2199,2200,2201,2202,2203,2204,2205,2206,2207,2208,2209,2210,2211,2212,2213,2214,2215,2216,2217,2218,2219,2220,2221,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2290,2291,2292,2293,2294,2295,2296,2297,2298,2299,2300,2301,2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2323,2324,2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2335,2336,2337,2338,2339,2340,2341,2342,2343,2344,2345,2346,2347,2348,2349,2350,2351,2352,2353,2354,2355,2356,2357,2358,2359,2360,2361,2362,2363,2364,2365,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2384,2385,2386,2387,2388,2389,2390,2391,2392,2393,2394,2395,2396,2397,2398,2399,2400,2401,2402,2403,2404,2405,2406,2407,2408,2409,2410,2411,2412,2413,2414,2415,2416,2417,2418,2419,2420,2421,2422,2423,2424,2425,2426,2427,2428,2429,2430,2431,2432,2433,2434,2435,2436,2437,2438,2439,2440,2441,2442,2443,2444,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,2455,2456,2457,2458,2459,2460,2461,2462,2463,2464,2465,2466,2467,2468,2469,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2480,2481,2482,2483,2484,2485,2486,2487,2488,2489,2490,2491,2492,2493,2494,2495,2496,2497,2498,2499,2500,2501,2502,2503,2504,2505,2506,2507,2508,2509,2510,2511,2512,2513,2514,2515,2516,2517,2518,2519,2520,2521,2522,2523,2524,2525,2526,2527,2528,2529,2530,2531,2532,2533,2534,2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546,2547,2548,2549,2550,2551,2552,2553,2554,2555,2556,2557,2558,2559,2560,2561,2562,2563,2564,2565,2566,2567,2568,2569,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2580,2581,2582,2583,2584,2585,2586,2587,2588,2589,2590,2591,2592,2593,2594,2595,2596,2597,2598,2599,2600,2601,2602,2603,2604,2605,2606,2607,2608,2609,2610,2611,2612,2613,2614,2615,2616,2617,2618,2619,2620,2621,2622,2623,2624,2625,2626,2627,2628,2629,2630,2631,2632,2633,2634,2635,2636,2637,2638,2639,2640,2641,2642,2643,2644,2645,2646,2647,2648,2649,2650,2651,2652,2653,2654,2655,2656,2657,2658,2659,2660,2661,2662,2663,2664,2665,2666,2667,2668,2669,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2680,2681,2682,2683,2684,2685,2686,2687,2688,2689,2690,2691,2692,2693,2694,2695,2696,2697,2698,2699,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2800,2801,2802,2803,2804,2805,2806,2807,2808,2809,2810,2811,2812,2813,2814,2815,2816,2817,2818,2819,2820,2821,2822,2823,2824,2825,2826,2827,2828,2829,2830,2831,2832,2833,2834,2835,2836,2837,2838,2839,2840,2841,2842,2843,2844,2845,2846,2847,2848,2849,2850,2851,2852,2853,2854,2855,2856,2857,2858,2859,2860,2861,2862,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2931,2932,2933,2934,2935,2936,2937,2938,2939,2940,2941,2942,2943,2944,2945,2946,2947,2948,2949,2950,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2980,2981,2982,2983,2984,2985,2986,2987,2988,2989,2990,2991,2992,2993,2994,2995,2996,2997,2998,2999,3000,3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,3024,3025,3026,3027,3028,3029,3030,3031,3032,3033,3034,3035,3036,3037,3038,3039,3040,3041,3042,3043,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3056,3057,3058,3059,3060,3061,3062,3063,3064,3065,3066,3067,3068,3069,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3080,3081,3082,3083,3084,3085,3086,3087,3088,3089,3090,3091,3092,3093,3094,3095,3096,3097,3098,3099,3100,3101,3102,3103,3104,3105,3106,3107,3108,3109,3110,3111,3112,3113,3114,3115,3116,3117,3118,3119,3120,3121,3122,3123,3124,3125,3126,3127,3128,3129,3130,3131,3132,3133,3134,3135,3136,3137,3138,3139,3140,3141,3142,3143,3144,3145,3146,3147,3148,3149,3150,3151,3152,3153,3154,3155,3156,3157,3158,3159,3160,3161,3162,3163,3164,3165,3166,3167,3168,3169,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3180,3181,3182,3183,3184,3185,3186,3187,3188,3189,3190,3191,3192,3193,3194,3195,3196,3197,3198,3199,3200,3201,3202,3203,3204,3205,3206,3207,3208,3209,3210,3211,3212,3213,3214,3215,3216,3217,3218,3219,3220,3221,3222,3223,3224,3225,3226,3227,3228,3229,3230,3231,3232,3233,3234,3235,3236,3237,3238,3239,3240,3241,3242,3243,3244,3245,3246,3247,3248,3249,3250,3251,3252,3253,3254,3255,3256,3257,3258,3259,3260,3261,3262,3263,3264,3265,3266,3267,3268,3269,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3280,3281,3282,3283,3284,3285,3286,3287,3288,3289,3290,3291,3292,3293,3294,3295,3296,3297,3298,3299,3300,3301,3302,3303,3304,3305,3306,3307,3308,3309,3310,3311,3312,3313,3314,3315,3316,3317,3318,3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330,3331,3332,3333,3334,3335,3336,3337,3338,3339,3340,3341,3342,3343,3344,3345,3346,3347,3348,3349,3350,3351,3352,3353,3354,3355,3356,3357,3358,3359,3360,3361,3362,3363,3364,3365,3366,3367,3368,3369,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3380,3381,3382,3383,3384,3385,3386,3387,3388,3389,3390,3391,3392,3393,3394,3395,3396,3397,3398,3399,3400,3401,3402,3403,3404,3405,3406,3407,3408,3409,3410,3411,3412,3413,3414,3415,3416,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3439,3440,3441,3442,3443,3444,3445,3446,3447,3448,3449,3450,3451,3452,3453,3454,3455,3456,3457,3458,3459,3460,3461,3462,3463,3464,3465,3466,3467,3468,3469,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3480,3481,3482,3483,3484,3485,3486,3487,3488,3489,3490,3491,3492,3493,3494,3495,3496,3497,3498,3499,3500,3501,3502,3503,3504,3505,3506,3507,3508,3509,3510,3511,3512,3513,3514,3515,3516,3517,3518,3519,3520,3521,3522,3523,3524,3525,3526,3527,3528,3529,3530,3531,3532,3533,3534,3535,3536,3537,3538,3539,3540,3541,3542,3543,3544,3545,3546,3547,3548,3549,3550,3551,3552,3553,3554,3555,3556,3557,3558,3559,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3580,3581,3582,3583,3584,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,3643,3644,3645,3646,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3680,3681,3682,3683,3684,3685,3686,3687,3688,3689,3690,3691,3692,3693,3694,3695,3696,3697,3698,3699,3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,3800,3801,3802,3803,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,3814,3815,3816,3817,3818,3819,3820,3821,3822,3823,3824,3825,3826,3827,3828,3829,3830,3831,3832,3833,3834,3835,3836,3837,3838,3839,3840,3841,3842,3843,3844,3845,3846,3847,3848,3849,3850,3851,3852,3853,3854,3855,3856,3857,3858,3859,3860,3861,3862,3863,3864,3865,3866,3867,3868,3869,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,3880,3881,3882,3883,3884,3885,3886,3887,3888,3889,3890,3891,3892,3893,3894,3895,3896,3897,3898,3899,3900,3901,3902,3903,3904,3905,3906,3907,3908,3909,3910,3911,3912,3913,3914,3915,3916,3917,3918,3919,3920,3921,3922,3923,3924,3925,3926,3927,3928,3929,3930,3931,3932,3933,3934,3935,3936,3937,3938,3939,3940,3941,3942,3943,3944,3945,3946,3947,3948,3949,3950,3951,3952,3953,3954,3955,3956,3957,3958,3959,3960,3961,3962,3963,3964,3965,3966,3967,3968,3969,3970,3971,3972,3973,3974,3975,3976,3977,3978,3979,3980,3981,3982,3983,3984,3985,3986,3987,3988,3989,3990,3991,3992,3993,3994,3995,3996,3997,3998,3999,4000,4001,4002,4003,4004,4005,4006,4007,4008,4009,4010,4011,4012,4013,4014,4015,4016,4017,4018,4019,4020,4021,4022,4023,4024,4025,4026,4027,4028,4029,4030,4031,4032,4033,4034,4035,4036,4037,4038,4039,4040,4041,4042,4043,4044,4045,4046,4047,4048,4049,4050,4051,4052,4053,4054,4055,4056,4057,4058,4059,4060,4061,4062,4063,4064,4065,4066,4067,4068,4069,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093,4094,4095,4096,4097,4098,4099,4100,4101,4102,4103,4104,4105,4106,4107,4108,4109,4110,4111,4112,4113,4114,4115,4116,4117,4118,4119,4120,4121,4122,4123,4124,4125,4126,4127,4128,4129,4130,4131,4132,4133,4134,4135,4136,4137,4138,4139,4140,4141,4142,4143,4144,4145,4146,4147,4148,4149,4150,4151,4152,4153,4154,4155,4156,4157,4158,4159,4160,4161,4162,4163,4164,4165,4166,4167,4168,4169,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4180,4181,4182,4183,4184,4185,4186,4187,4188,4189,4190,4191,4192,4193,4194,4195,4196,4197,4198,4199,4200,4201,4202,4203,4204,4205,4206,4207,4208,4209,4210,4211,4212,4213,4214,4215,4216,4217,4218,4219,4220,4221,4222,4223,4224,4225,4226,4227,4228,4229,4230,4231,4232,4233,4234,4235,4236,4237,4238,4239,4240,4241,4242,4243,4244,4245,4246,4247,4248,4249,4250,4251,4252,4253,4254,4255,4256,4257,4258,4259,4260,4261,4262,4263,4264,4265,4266,4267,4268,4269,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4280,4281,4282,4283,4284,4285,4286,4287,4288,4289,4290,4291,4292,4293,4294,4295,4296,4297,4298,4299,4300,4301,4302,4303,4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4316,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4329,4330,4331,4332,4333,4334,4335,4336,4337,4338,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4349,4350,4351,4352,4353,4354,4355,4356,4357,4358,4359,4360,4361,4362,4363,4364,4365,4366,4367,4368,4369,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4380,4381,4382,4383,4384,4385,4386,4387,4388,4389,4390,4391,4392,4393,4394,4395,4396,4397,4398,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4414,4415,4416,4417,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4434,4435,4436,4437,4438,4439,4440,4441,4442,4443,4444,4445,4446,4447,4448,4449,4450,4451,4452,4453,4454,4455,4456,4457,4458,4459,4460,4461,4462,4463,4464,4465,4466,4467,4468,4469,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4480,4481,4482,4483,4484,4485,4486,4487,4488,4489,4490,4491,4492,4493,4494,4495,4496,4497,4498,4499,4500,4501,4502,4503,4504,4505,4506,4507,4508,4509,4510,4511,4512,4513,4514,4515,4516,4517,4518,4519,4520,4521,4522,4523,4524,4525,4526,4527,4528,4529,4530,4531,4532,4533,4534,4535,4536,4537,4538,4539,4540,4541,4542,4543,4544,4545,4546,4547,4548,4549,4550,4551,4552,4553,4554,4555,4556,4557,4558,4559,4560,4561,4562,4563,4564,4565,4566,4567,4568,4569,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4580,4581,4582,4583,4584,4585,4586,4587,4588,4589,4590,4591,4592,4593,4594,4595,4596,4597,4598,4599,4600,4601,4602,4603,4604,4605,4606,4607,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4626,4627,4628,4629,4630,4631,4632,4633,4634,4635,4636,4637,4638,4639,4640,4641,4642,4643,4644,4645,4646,4647,4648,4649,4650,4651,4652,4653,4654,4655,4656,4657,4658,4659,4660,4661,4662,4663,4664,4665,4666,4667,4668,4669,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4680,4681,4682,4683,4684,4685,4686,4687,4688,4689,4690,4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862,4863,4864,4865,4866,4867,4868,4869,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4880,4881,4882,4883,4884,4885,4886,4887,4888,4889,4890,4891,4892,4893,4894,4895,4896,4897,4898,4899,4900,4901,4902,4903,4904,4905,4906,4907,4908,4909,4910,4911,4912,4913,4914,4915,4916,4917,4918,4919,4920,4921,4922,4923,4924,4925,4926,4927,4928,4929,4930,4931,4932,4933,4934,4935,4936,4937,4938,4939,4940,4941,4942,4943,4944,4945,4946,4947,4948,4949,4950,4951,4952,4953,4954,4955,4956,4957,4958,4959,4960,4961,4962,4963,4964,4965,4966,4967,4968,4969,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4980,4981,4982,4983,4984,4985,4986,4987,4988,4989,4990,4991,4992,4993,4994,4995,4996,4997,4998,4999,5000,5001,5002,5003,5004,5005,5006,5007,5008,5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019,5020,5021,5022,5023,5024,5025,5026,5027,5028,5029,5030,5031,5032,5033,5034,5035,5036,5037,5038,5039,5040,5041,5042,5043,5044,5045,5046,5047,5048,5049,5050,5051,5052,5053,5054,5055,5056,5057,5058,5059,5060,5061,5062,5063,5064,5065,5066,5067,5068,5069,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5080,5081,5082,5083,5084,5085,5086,5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149,5150,5151,5152,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164,5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5180,5181,5182,5183,5184,5185,5186,5187,5188,5189,5190,5191,5192,5193,5194,5195,5196,5197,5198,5199,5200,5201,5202,5203,5204,5205,5206,5207,5208,5209,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5220,5221,5222,5223,5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,5237,5238,5239,5240,5241,5242,5243,5244,5245,5246,5247,5248,5249,5250,5251,5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267,5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283,5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299,5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315,5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331,5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347,5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363,5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5380,5381,5382,5383,5384,5385,5386,5387,5388,5389,5390,5391,5392,5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408,5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424,5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440,5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456,5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520,5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536,5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552,5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568,5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584,5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600,5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616,5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632,5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648,5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664,5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808,5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824,5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840,5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856,5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888,5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904,5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920,5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936,5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952,5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968,5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984,5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000,6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016,6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032,6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048,6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064,6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080,6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096,6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112,6113,6114,6115,6116,6117,6118,6119,6120,6121,6122,6123,6124,6125,6126,6127,6128,6129,6130,6131,6132,6133,6134,6135,6136,6137,6138,6139,6140,6141,6142,6143,6144,6145,6146,6147,6148,6149,6150,6151,6152,6153,6154,6155,6156,6157,6158,6159,6160,6161,6162,6163,6164,6165,6166,6167,6168,6169,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6180,6181,6182,6183,6184,6185,6186,6187,6188,6189,6190,6191,6192,6193,6194,6195,6196,6197,6198,6199,6200,6201,6202,6203,6204,6205,6206,6207,6208,6209,6210,6211,6212,6213,6214,6215,6216,6217,6218,6219,6220,6221,6222,6223,6224,6225,6226,6227,6228,6229,6230,6231,6232,6233,6234,6235,6236,6237,6238,6239,6240,6241,6242,6243,6244,6245,6246,6247,6248,6249,6250,6251,6252,6253,6254,6255,6256,6257,6258,6259,6260,6261,6262,6263,6264,6265,6266,6267,6268,6269,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6280,6281,6282,6283,6284,6285,6286,6287,6288,6289,6290,6291,6292,6293,6294,6295,6296,6297,6298,6299,6300,6301,6302,6303,6304,6305,6306,6307,6308,6309,6310,6311,6312,6313,6314,6315,6316,6317,6318,6319,6320,6321,6322,6323,6324,6325,6326,6327,6328,6329,6330,6331,6332,6333,6334,6335,6336,6337,6338,6339,6340,6341,6342,6343,6344,6345,6346,6347,6348,6349,6350,6351,6352,6353,6354,6355,6356,6357,6358,6359,6360,6361,6362,6363,6364,6365,6366,6367,6368,6369,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6380,6381,6382,6383,6384,6385,6386,6387,6388,6389,6390,6391,6392,6393,6394,6395,6396,6397,6398,6399,6400,6401,6402,6403,6404,6405,6406,6407,6408,6409,6410,6411,6412,6413,6414,6415,6416,6417,6418,6419,6420,6421,6422,6423,6424,6425,6426,6427,6428,6429,6430,6431,6432,6433,6434,6435,6436,6437,6438,6439,6440,6441,6442,6443,6444,6445,6446,6447,6448,6449,6450,6451,6452,6453,6454,6455,6456,6457,6458,6459,6460,6461,6462,6463,6464,6465,6466,6467,6468,6469,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6480,6481,6482,6483,6484,6485,6486,6487,6488,6489,6490,6491,6492,6493,6494,6495,6496,6497,6498,6499,6500,6501,6502,6503,6504,6505,6506,6507,6508,6509,6510,6511,6512,6513,6514,6515,6516,6517,6518,6519,6520,6521,6522,6523,6524,6525,6526,6527,6528,6529,6530,6531,6532,6533,6534,6535,6536,6537,6538,6539,6540,6541,6542,6543,6544,6545,6546,6547,6548,6549,6550,6551,6552,6553,6554,6555,6556,6557,6558,6559,6560,6561,6562,6563,6564,6565,6566,6567,6568,6569,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6580,6581,6582,6583,6584,6585,6586,6587,6588,6589,6590,6591,6592,6593,6594,6595,6596,6597,6598,6599,6600,6601,6602,6603,6604,6605,6606,6607,6608,6609,6610,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,6622,6623,6624,6625,6626,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,6639,6640,6641,6642,6643,6644,6645,6646,6647,6648,6649,6650,6651,6652,6653,6654,6655,6656,6657,6658,6659,6660,6661,6662,6663,6664,6665,6666,6667,6668,6669,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6680,6681,6682,6683,6684,6685,6686,6687,6688,6689,6690,6691,6692,6693,6694,6695,6696,6697,6698,6699,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6800,6801,6802,6803,6804,6805,6806,6807,6808,6809,6810,6811,6812,6813,6814,6815,6816,6817,6818,6819,6820,6821,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6834,6835,6836,6837,6838,6839,6840,6841,6842,6843,6844,6845,6846,6847,6848,6849,6850,6851,6852,6853,6854,6855,6856,6857,6858,6859,6860,6861,6862,6863,6864,6865,6866,6867,6868,6869,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6880,6881,6882,6883,6884,6885,6886,6887,6888,6889,6890,6891,6892,6893,6894,6895,6896,6897,6898,6899,6900,6901,6902,6903,6904,6905,6906,6907,6908,6909,6910,6911,6912,6913,6914,6915,6916,6917,6918,6919,6920,6921,6922,6923,6924,6925,6926,6927,6928,6929,6930,6931,6932,6933,6934,6935,6936,6937,6938,6939,6940,6941,6942,6943,6944,6945,6946,6947,6948,6949,6950,6951,6952,6953,6954,6955,6956,6957,6958,6959,6960,6961,6962,6963,6964,6965,6966,6967,6968,6969,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6980,6981,6982,6983,6984,6985,6986,6987,6988,6989,6990,6991,6992,6993,6994,6995,6996,6997,6998,6999,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8000,8001,8002,8003,8004,8005,8006,8007,8008,8009,8010,8011,8012,8013,8014,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8048,8049,8050,8051,8052,8053,8054,8055,8056,8057,8058,8059,8060,8061,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8091,8092,8093,8094,8095,8096,8097,8098,8099,8100,8101,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8129,8130,8131,8132,8133,8134,8135,8136,8137,8138,8139,8140,8141,8142,8143,8144,8145,8146,8147,8148,8149,8150,8151,8152,8153,8154,8155,8156,8157,8158,8159,8160,8161,8162,8163,8164,8165,8166,8167,8168,8169,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8180,8181,8182,8183,8184,8185,8186,8187,8188,8189,8190,8191,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8208,8209,8210,8211,8212,8213,8214,8215,8216,8217,8218,8219,8220,8221,8222,8223,8224,8225,8226,8227,8228,8229,8230,8231,8232,8233,8234,8235,8236,8237,8238,8239,8240,8241,8242,8243,8244,8245,8246,8247,8248,8249,8250,8251,8252,8253,8254,8255,8256,8257,8258,8259,8260,8261,8262,8263,8264,8265,8266,8267,8268,8269,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8280,8281,8282,8283,8284,8285,8286,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,8304,8305,8306,8307,8308,8309,8310,8311,8312,8313,8314,8315,8316,8317,8318,8319,8320,8321,8322,8323,8324,8325,8326,8327,8328,8329,8330,8331,8332,8333,8334,8335,8336,8337,8338,8339,8340,8341,8342,8343,8344,8345,8346,8347,8348,8349,8350,8351,8352,8353,8354,8355,8356,8357,8358,8359,8360,8361,8362,8363,8364,8365,8366,8367,8368,8369,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8380,8381,8382,8383,8384,8385,8386,8387,8388,8389,8390,8391,8392,8393,8394,8395,8396,8397,8398,8399,8400,8401,8402,8403,8404,8405,8406,8407,8408,8409,8410,8411,8412,8413,8414,8415,8416,8417,8418,8419,8420,8421,8422,8423,8424,8425,8426,8427,8428,8429,8430,8431,8432,8433,8434,8435,8436,8437,8438,8439,8440,8441,8442,8443,8444,8445,8446,8447,8448,8449,8450,8451,8452,8453,8454,8455,8456,8457,8458,8459,8460,8461,8462,8463,8464,8465,8466,8467,8468,8469,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8480,8481,8482,8483,8484,8485,8486,8487,8488,8489,8490,8491,8492,8493,8494,8495,8496,8497,8498,8499,8500,8501,8502,8503,8504,8505,8506,8507,8508,8509,8510,8511,8512,8513,8514,8515,8516,8517,8518,8519,8520,8521,8522,8523,8524,8525,8526,8527,8528,8529,8530,8531,8532,8533,8534,8535,8536,8537,8538,8539,8540,8541,8542,8543,8544,8545,8546,8547,8548,8549,8550,8551,8552,8553,8554,8555,8556,8557,8558,8559,8560,8561,8562,8563,8564,8565,8566,8567,8568,8569,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8580,8581,8582,8583,8584,8585,8586,8587,8588,8589,8590,8591,8592,8593,8594,8595,8596,8597,8598,8599,8600,8601,8602,8603,8604,8605,8606,8607,8608,8609,8610,8611,8612,8613,8614,8615,8616,8617,8618,8619,8620,8621,8622,8623,8624,8625,8626,8627,8628,8629,8630,8631,8632,8633,8634,8635,8636,8637,8638,8639,8640,8641,8642,8643,8644,8645,8646,8647,8648,8649,8650,8651,8652,8653,8654,8655,8656,8657,8658,8659,8660,8661,8662,8663,8664,8665,8666,8667,8668,8669,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8680,8681,8682,8683,8684,8685,8686,8687,8688,8689,8690,8691,8692,8693,8694,8695,8696,8697,8698,8699,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,8800,8801,8802,8803,8804,8805,8806,8807,8808,8809,8810,8811,8812,8813,8814,8815,8816,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8827,8828,8829,8830,8831,8832,8833,8834,8835,8836,8837,8838,8839,8840,8841,8842,8843,8844,8845,8846,8847,8848,8849,8850,8851,8852,8853,8854,8855,8856,8857,8858,8859,8860,8861,8862,8863,8864,8865,8866,8867,8868,8869,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8880,8881,8882,8883,8884,8885,8886,8887,8888,8889,8890,8891,8892,8893,8894,8895,8896,8897,8898,8899,8900,8901,8902,8903,8904,8905,8906,8907,8908,8909,8910,8911,8912,8913,8914,8915,8916,8917,8918,8919,8920,8921,8922,8923,8924,8925,8926,8927,8928,8929,8930,8931,8932,8933,8934,8935,8936,8937,8938,8939,8940,8941,8942,8943,8944,8945,8946,8947,8948,8949,8950,8951,8952,8953,8954,8955,8956,8957,8958,8959,8960,8961,8962,8963,8964,8965,8966,8967,8968,8969,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8980,8981,8982,8983,8984,8985,8986,8987,8988,8989,8990,8991,8992,8993,8994,8995,8996,8997,8998,8999,9000,9001,9002,9003,9004,9005,9006,9007,9008,9009,9010,9011,9012,9013,9014,9015,9016,9017,9018,9019,9020,9021,9022,9023,9024,9025,9026,9027,9028,9029,9030,9031,9032,9033,9034,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9046,9047,9048,9049,9050,9051,9052,9053,9054,9055,9056,9057,9058,9059,9060,9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9080,9081,9082,9083,9084,9085,9086,9087,9088,9089,9090,9091,9092,9093,9094,9095,9096,9097,9098,9099,9100,9101,9102,9103,9104,9105,9106,9107,9108,9109,9110,9111,9112,9113,9114,9115,9116,9117,9118,9119,9120,9121,9122,9123,9124,9125,9126,9127,9128,9129,9130,9131,9132,9133,9134,9135,9136,9137,9138,9139,9140,9141,9142,9143,9144,9145,9146,9147,9148,9149,9150,9151,9152,9153,9154,9155,9156,9157,9158,9159,9160,9161,9162,9163,9164,9165,9166,9167,9168,9169,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9180,9181,9182,9183,9184,9185,9186,9187,9188,9189,9190,9191,9192,9193,9194,9195,9196,9197,9198,9199,9200,9201,9202,9203,9204,9205,9206,9207,9208,9209,9210,9211,9212,9213,9214,9215,9216,9217,9218,9219,9220,9221,9222,9223,9224,9225,9226,9227,9228,9229,9230,9231,9232,9233,9234,9235,9236,9237,9238,9239,9240,9241,9242,9243,9244,9245,9246,9247,9248,9249,9250,9251,9252,9253,9254,9255,9256,9257,9258,9259,9260,9261,9262,9263,9264,9265,9266,9267,9268,9269,9270,9271,9272,9273,9274,9275,9276,9277,9278,9279,9280,9281,9282,9283,9284,9285,9286,9287,9288,9289,9290,9291,9292,9293,9294,9295,9296,9297,9298,9299,9300,9301,9302,9303,9304,9305,9306,9307,9308,9309,9310,9311,9312,9313,9314,9315,9316,9317,9318,9319,9320,9321,9322,9323,9324,9325,9326,9327,9328,9329,9330,9331,9332,9333,9334,9335,9336,9337,9338,9339,9340,9341,9342,9343,9344,9345,9346,9347,9348,9349,9350,9351,9352,9353,9354,9355,9356,9357,9358,9359,9360,9361,9362,9363,9364,9365,9366,9367,9368,9369,9370,9371,9372,9373,9374,9375,9376,9377,9378,9379,9380,9381,9382,9383,9384,9385,9386,9387,9388,9389,9390,9391,9392,9393,9394,9395,9396,9397,9398,9399,9400,9401,9402,9403,9404,9405,9406,9407,9408,9409,9410,9411,9412,9413,9414,9415,9416,9417,9418,9419,9420,9421,9422,9423,9424,9425,9426,9427,9428,9429,9430,9431,9432,9433,9434,9435,9436,9437,9438,9439,9440,9441,9442,9443,9444,9445,9446,9447,9448,9449,9450,9451,9452,9453,9454,9455,9456,9457,9458,9459,9460,9461,9462,9463,9464,9465,9466,9467,9468,9469,9470,9471,9472,9473,9474,9475,9476,9477,9478,9479,9480,9481,9482,9483,9484,9485,9486,9487,9488,9489,9490,9491,9492,9493,9494,9495,9496,9497,9498,9499,9500,9501,9502,9503,9504,9505,9506,9507,9508,9509,9510,9511,9512,9513,9514,9515,9516,9517,9518,9519,9520,9521,9522,9523,9524,9525,9526,9527,9528,9529,9530,9531,9532,9533,9534,9535,9536,9537,9538,9539,9540,9541,9542,9543,9544,9545,9546,9547,9548,9549,9550,9551,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9581,9582,9583,9584,9585,9586,9587,9588,9589,9590,9591,9592,9593,9594,9595,9596,9597,9598,9599,9600,9601,9602,9603,9604,9605,9606,9607,9608,9609,9610,9611,9612,9613,9614,9615,9616,9617,9618,9619,9620,9621,9622,9623,9624,9625,9626,9627,9628,9629,9630,9631,9632,9633,9634,9635,9636,9637,9638,9639,9640,9641,9642,9643,9644,9645,9646,9647,9648,9649,9650,9651,9652,9653,9654,9655,9656,9657,9658,9659,9660,9661,9662,9663,9664,9665,9666,9667,9668,9669,9670,9671,9672,9673,9674,9675,9676,9677,9678,9679,9680,9681,9682,9683,9684,9685,9686,9687,9688,9689,9690,9691,9692,9693,9694,9695,9696,9697,9698,9699,9700,9701,9702,9703,9704,9705,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9738,9739,9740,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,9794,9795,9796,9797,9798,9799,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9812,9813,9814,9815,9816,9817,9818,9819,9820,9821,9822,9823,9824,9825,9826,9827,9828,9829,9830,9831,9832,9833,9834,9835,9836,9837,9838,9839,9840,9841,9842,9843,9844,9845,9846,9847,9848,9849,9850,9851,9852,9853,9854,9855,9856,9857,9858,9859,9860,9861,9862,9863,9864,9865,9866,9867,9868,9869,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9880,9881,9882,9883,9884,9885,9886,9887,9888,9889,9890,9891,9892,9893,9894,9895,9896,9897,9898,9899,9900,9901,9902,9903,9904,9905,9906,9907,9908,9909,9910,9911,9912,9913,9914,9915,9916,9917,9918,9919,9920,9921,9922,9923,9924,9925,9926,9927,9928,9929,9930,9931,9932,9933,9934,9935,9936,9937,9938,9939,9940,9941,9942,9943,9944,9945,9946,9947,9948,9949,9950,9951,9952,9953,9954,9955,9956,9957,9958,9959,9960,9961,9962,9963,9964,9965,9966,9967,9968,9969,9970,9971,9972,9973,9974,9975,9976,9977,9978,9979,9980,9981,9982,9983,9984,9985,9986,9987,9988,9989,9990,9991,9992,9993,9994,9995,9996,9997,9998,9999,10000,10001,10002,10003,10004,10005,10006,10007,10008,10009,10010,10011,10012,10013,10014,10015,10016,10017,10018,10019,10020,10021,10022,10023,10024,10025,10026,10027,10028,10029,10030,10031,10032,10033,10034,10035,10036,10037,10038,10039,10040,10041,10042,10043,10044,10045,10046,10047,10048,10049,10050,10051,10052,10053,10054,10055,10056,10057,10058,10059,10060,10061,10062,10063,10064,10065,10066,10067,10068,10069,10070,10071,10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10084,10085,10086,10087,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,10098,10099,10100,10101,10102,10103,10104,10105,10106,10107,10108,10109,10110,10111,10112,10113,10114,10115,10116,10117,10118,10119,10120,10121,10122,10123,10124,10125,10126,10127,10128,10129,10130,10131,10132,10133,10134,10135,10136,10137,10138,10139,10140,10141,10142,10143,10144,10145,10146,10147,10148,10149,10150,10151,10152,10153,10154,10155,10156,10157,10158,10159,10160,10161,10162,10163,10164,10165,10166,10167,10168,10169,10170,10171,10172,10173,10174,10175,10176,10177,10178,10179,10180,10181,10182,10183,10184,10185,10186,10187,10188,10189,10190,10191,10192,10193,10194,10195,10196,10197,10198,10199,10200,10201,10202,10203,10204,10205,10206,10207,10208,10209,10210,10211,10212,10213,10214,10215,10216,10217,10218,10219,10220,10221,10222,10223,10224,10225,10226,10227,10228,10229,10230,10231,10232,10233,10234,10235,10236,10237,10238,10239,10240,10241,10242,10243,10244,10245,10246,10247,10248,10249,10250,10251,10252,10253,10254,10255,10256,10257,10258,10259,10260,10261,10262,10263,10264,10265,10266,10267,10268,10269,10270,10271,10272,10273,10274,10275,10276,10277,10278,10279,10280,10281,10282,10283,10284,10285,10286,10287,10288,10289,10290,10291,10292,10293,10294,10295,10296,10297,10298,10299,10300,10301,10302,10303,10304,10305,10306,10307,10308,10309,10310,10311,10312,10313,10314,10315,10316,10317,10318,10319,10320,10321,10322,10323,10324,10325,10326,10327,10328,10329,10330,10331,10332,10333,10334,10335,10336,10337,10338,10339,10340,10341,10342,10343,10344,10345,10346,10347,10348,10349,10350,10351,10352,10353,10354,10355,10356,10357,10358,10359,10360,10361,10362,10363,10364,10365,10366,10367,10368,10369,10370,10371,10372,10373,10374,10375,10376,10377,10378,10379,10380,10381,10382,10383,10384,10385,10386,10387,10388,10389,10390,10391,10392,10393,10394,10395,10396,10397,10398,10399,10400,10401,10402,10403,10404,10405,10406,10407,10408,10409,10410,10411,10412,10413,10414,10415,10416,10417,10418,10419,10420,10421,10422,10423,10424,10425,10426,10427,10428,10429,10430,10431,10432,10433,10434,10435,10436,10437,10438,10439,10440,10441,10442,10443,10444,10445,10446,10447,10448,10449,10450,10451,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,10464,10465,10466,10467,10468,10469,10470,10471,10472,10473,10474,10475,10476,10477,10478,10479,10480,10481,10482,10483,10484,10485,10486,10487,10488,10489,10490,10491,10492,10493,10494,10495,10496,10497,10498,10499,10500,10501,10502,10503,10504,10505,10506,10507,10508,10509,10510,10511,10512,10513,10514,10515,10516,10517,10518,10519,10520,10521,10522,10523,10524,10525,10526,10527,10528,10529,10530,10531,10532,10533,10534,10535,10536,10537,10538,10539,10540,10541,10542,10543,10544,10545,10546,10547,10548,10549,10550,10551,10552,10553,10554,10555,10556,10557,10558,10559,10560,10561,10562,10563,10564,10565,10566,10567,10568,10569,10570,10571,10572,10573,10574,10575,10576,10577,10578,10579,10580,10581,10582,10583,10584,10585,10586,10587,10588,10589,10590,10591,10592,10593,10594,10595,10596,10597,10598,10599,10600,10601,10602,10603,10604,10605,10606,10607,10608,10609,10610,10611,10612,10613,10614,10615,10616,10617,10618,10619,10620,10621,10622,10623,10624,10625,10626,10627,10628,10629,10630,10631,10632,10633,10634,10635,10636,10637,10638,10639,10640,10641,10642,10643,10644,10645,10646,10647,10648,10649,10650,10651,10652,10653,10654,10655,10656,10657,10658,10659,10660,10661,10662,10663,10664,10665,10666,10667,10668,10669,10670,10671,10672,10673,10674,10675,10676,10677,10678,10679,10680,10681,10682,10683,10684,10685,10686,10687,10688,10689,10690,10691,10692,10693,10694,10695,10696,10697,10698,10699,10700,10701,10702,10703,10704,10705,10706,10707,10708,10709,10710,10711,10712,10713,10714,10715,10716,10717,10718,10719,10720,10721,10722,10723,10724,10725,10726,10727,10728,10729,10730,10731,10732,10733,10734,10735,10736,10737,10738,10739,10740,10741,10742,10743,10744,10745,10746,10747,10748,10749,10750,10751,10752,10753,10754,10755,10756,10757,10758,10759,10760,10761,10762,10763,10764,10765,10766,10767,10768,10769,10770,10771,10772,10773,10774,10775,10776,10777,10778,10779,10780,10781,10782,10783,10784,10785,10786,10787,10788,10789,10790,10791,10792,10793,10794,10795,10796,10797,10798,10799,10800,10801,10802,10803,10804,10805,10806,10807,10808,10809,10810,10811,10812,10813,10814,10815,10816,10817,10818,10819,10820,10821,10822,10823,10824,10825,10826,10827,10828,10829,10830,10831,10832,10833,10834,10835,10836,10837,10838,10839,10840,10841,10842,10843,10844,10845,10846,10847,10848,10849,10850,10851,10852,10853,10854,10855,10856,10857,10858,10859,10860,10861,10862,10863,10864,10865,10866,10867,10868,10869,10870,10871,10872,10873,10874,10875,10876,10877,10878,10879,10880,10881,10882,10883,10884,10885,10886,10887,10888,10889,10890,10891,10892,10893,10894,10895,10896,10897,10898,10899,10900,10901,10902,10903,10904,10905,10906,10907,10908,10909,10910,10911,10912,10913,10914,10915,10916,10917,10918,10919,10920,10921,10922,10923,10924,10925,10926,10927,10928,10929,10930,10931,10932,10933,10934,10935,10936,10937,10938,10939,10940,10941,10942,10943,10944,10945,10946,10947,10948,10949,10950,10951,10952,10953,10954,10955,10956,10957,10958,10959,10960,10961,10962,10963,10964,10965,10966,10967,10968,10969,10970,10971,10972,10973,10974,10975,10976,10977,10978,10979,10980,10981,10982,10983,10984,10985,10986,10987,10988,10989,10990,10991,10992,10993,10994,10995,10996,10997,10998,10999,11000,11001,11002,11003,11004,11005,11006,11007,11008,11009,11010,11011,11012,11013,11014,11015,11016,11017,11018,11019,11020,11021,11022,11023,11024,11025,11026,11027,11028,11029,11030,11031,11032,11033,11034,11035,11036,11037,11038,11039,11040,11041,11042,11043,11044,11045,11046,11047,11048,11049,11050,11051,11052,11053,11054,11055,11056,11057,11058,11059,11060,11061,11062,11063,11064,11065,11066,11067,11068,11069,11070,11071,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11106,11107,11108,11109,11110,11111,11112,11113,11114,11115,11116,11117,11118,11119,11120,11121,11122,11123,11124,11125,11126,11127,11128,11129,11130,11131,11132,11133,11134,11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149,11150,11151,11152,11153,11154,11155,11156,11157,11158,11159,11160,11161,11162,11163,11164,11165,11166,11167,11168,11169,11170,11171,11172,11173,11174,11175,11176,11177,11178,11179,11180,11181,11182,11183,11184,11185,11186,11187,11188,11189,11190,11191,11192,11193,11194,11195,11196,11197,11198,11199,11200,11201,11202,11203,11204,11205,11206,11207,11208,11209,11210,11211,11212,11213,11214,11215,11216,11217,11218,11219,11220,11221,11222,11223,11224,11225,11226,11227,11228,11229,11230,11231,11232,11233,11234,11235,11236,11237,11238,11239,11240,11241,11242,11243,11244,11245,11246,11247,11248,11249,11250,11251,11252,11253,11254,11255,11256,11257,11258,11259,11260,11261,11262,11263,11264,11265,11266,11267,11268,11269,11270,11271,11272,11273,11274,11275,11276,11277,11278,11279,11280,11281,11282,11283,11284,11285,11286,11287,11288,11289,11290,11291,11292,11293,11294,11295,11296,11297,11298,11299,11300,11301,11302,11303,11304,11305,11306,11307,11308,11309,11310,11311,11312,11313,11314,11315,11316,11317,11318,11319,11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11330,11331,11332,11333,11334,11335,11336,11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,11348,11349,11350,11351,11352,11353,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11392,11393,11394,11395,11396,11397,11398,11399,11400,11401,11402,11403,11404,11405,11406,11407,11408,11409,11410,11411,11412,11413,11414,11415,11416,11417,11418,11419,11420,11421,11422,11423,11424,11425,11426,11427,11428,11429,11430,11431,11432,11433,11434,11435,11436,11437,11438,11439,11440,11441,11442,11443,11444,11445,11446,11447,11448,11449,11450,11451,11452,11453,11454,11455,11456,11457,11458,11459,11460,11461,11462,11463,11464,11465,11466,11467,11468,11469,11470,11471,11472,11473,11474,11475,11476,11477,11478,11479,11480,11481,11482,11483,11484,11485,11486,11487,11488,11489,11490,11491,11492,11493,11494,11495,11496,11497,11498,11499,11500,11501,11502,11503,11504,11505,11506,11507,11508,11509,11510,11511,11512,11513,11514,11515,11516,11517,11518,11519,11520,11521,11522,11523,11524,11525,11526,11527,11528,11529,11530,11531,11532,11533,11534,11535,11536,11537,11538,11539,11540,11541,11542,11543,11544,11545,11546,11547,11548,11549,11550,11551,11552,11553,11554,11555,11556,11557,11558,11559,11560,11561,11562,11563,11564,11565,11566,11567,11568,11569,11570,11571,11572,11573,11574,11575,11576,11577,11578,11579,11580,11581,11582,11583,11584,11585,11586,11587,11588,11589,11590,11591,11592,11593,11594,11595,11596,11597,11598,11599,11600,11601,11602,11603,11604,11605,11606,11607,11608,11609,11610,11611,11612,11613,11614,11615,11616,11617,11618,11619,11620,11621,11622,11623,11624,11625,11626,11627,11628,11629,11630,11631,11632,11633,11634,11635,11636,11637,11638,11639,11640,11641,11642,11643,11644,11645,11646,11647,11648,11649,11650,11651,11652,11653,11654,11655,11656,11657,11658,11659,11660,11661,11662,11663,11664,11665,11666,11667,11668,11669,11670,11671,11672,11673,11674,11675,11676,11677,11678,11679,11680,11681,11682,11683,11684,11685,11686,11687,11688,11689,11690,11691,11692,11693,11694,11695,11696,11697,11698,11699,11700,11701,11702,11703,11704,11705,11706,11707,11708,11709,11710,11711,11712,11713,11714,11715,11716,11717,11718,11719,11720,11721,11722,11723,11724,11725,11726,11727,11728,11729,11730,11731,11732,11733,11734,11735,11736,11737,11738,11739,11740,11741,11742,11743,11744,11745,11746,11747,11748,11749,11750,11751,11752,11753,11754,11755,11756,11757,11758,11759,11760,11761,11762,11763,11764,11765,11766,11767,11768,11769,11770,11771,11772,11773,11774,11775,11776,11777,11778,11779,11780,11781,11782,11783,11784,11785,11786,11787,11788,11789,11790,11791,11792,11793,11794,11795,11796,11797,11798,11799,11800,11801,11802,11803,11804,11805,11806,11807,11808,11809,11810,11811,11812,11813,11814,11815,11816,11817,11818,11819,11820,11821,11822,11823,11824,11825,11826,11827,11828,11829,11830,11831,11832,11833,11834,11835,11836,11837,11838,11839,11840,11841,11842,11843,11844,11845,11846,11847,11848,11849,11850,11851,11852,11853,11854,11855,11856,11857,11858,11859,11860,11861,11862,11863,11864,11865,11866,11867,11868,11869,11870,11871,11872,11873,11874,11875,11876,11877,11878,11879,11880,11881,11882,11883,11884,11885,11886,11887,11888,11889,11890,11891,11892,11893,11894,11895,11896,11897,11898,11899,11900,11901,11902,11903,11904,11905,11906,11907,11908,11909,11910,11911,11912,11913,11914,11915,11916,11917,11918,11919,11920,11921,11922,11923,11924,11925,11926,11927,11928,11929,11930,11931,11932,11933,11934,11935,11936,11937,11938,11939,11940,11941,11942,11943,11944,11945,11946,11947,11948,11949,11950,11951,11952,11953,11954,11955,11956,11957,11958,11959,11960,11961,11962,11963,11964,11965,11966,11967,11968,11969,11970,11971,11972,11973,11974,11975,11976,11977,11978,11979,11980,11981,11982,11983,11984,11985,11986,11987,11988,11989,11990,11991,11992,11993,11994,11995,11996,11997,11998,11999,12000,12001,12002,12003,12004,12005,12006,12007,12008,12009,12010,12011,12012,12013,12014,12015,12016,12017,12018,12019,12020,12021,12022,12023,12024,12025,12026,12027,12028,12029,12030,12031,12032,12033,12034,12035,12036,12037,12038,12039,12040,12041,12042,12043,12044,12045,12046,12047,12048,12049,12050,12051,12052,12053,12054,12055,12056,12057,12058,12059,12060,12061,12062,12063,12064,12065,12066,12067,12068,12069,12070,12071,12072,12073,12074,12075,12076,12077,12078,12079,12080,12081,12082,12083,12084,12085,12086,12087,12088,12089,12090,12091,12092,12093,12094,12095,12096,12097,12098,12099,12100,12101,12102,12103,12104,12105,12106,12107,12108,12109,12110,12111,12112,12113,12114,12115,12116,12117,12118,12119,12120,12121,12122,12123,12124,12125,12126,12127,12128,12129,12130,12131,12132,12133,12134,12135,12136,12137,12138,12139,12140,12141,12142,12143,12144,12145,12146,12147,12148,12149,12150,12151,12152,12153,12154,12155,12156,12157,12158,12159,12160,12161,12162,12163,12164,12165,12166,12167,12168,12169,12170,12171,12172,12173,12174,12175,12176,12177,12178,12179,12180,12181,12182,12183,12184,12185,12186,12187,12188,12189,12190,12191,12192,12193,12194,12195,12196,12197,12198,12199,12200,12201,12202,12203,12204,12205,12206,12207,12208,12209,12210,12211,12212,12213,12214,12215,12216,12217,12218,12219,12220,12221,12222,12223,12224,12225,12226,12227,12228,12229,12230,12231,12232,12233,12234,12235,12236,12237,12238,12239,12240,12241,12242,12243,12244,12245,12246,12247,12248,12249,12250,12251,12252,12253,12254,12255,12256,12257,12258,12259,12260,12261,12262,12263,12264,12265,12266,12267,12268,12269,12270,12271,12272,12273,12274,12275,12276,12277,12278,12279,12280,12281,12282,12283,12284,12285,12286,12287,12288,12289,12290,12291,12292,12293,12294,12295,12296,12297,12298,12299,12300,12301,12302,12303,12304,12305,12306,12307,12308,12309,12310,12311,12312,12313,12314,12315,12316,12317,12318,12319,12320,12321,12322,12323,12324,12325,12326,12327,12328,12329,12330,12331,12332,12333,12334,12335,12336,12337,12338,12339,12340,12341,12342,12343,12344,12345,12346,12347,12348,12349,12350,12351,12352,12353,12354,12355,12356,12357,12358,12359,12360,12361,12362,12363,12364,12365,12366,12367,12368,12369,12370,12371,12372,12373,12374,12375,12376,12377,12378,12379,12380,12381,12382,12383,12384,12385,12386,12387,12388,12389,12390,12391,12392,12393,12394,12395,12396,12397,12398,12399,12400,12401,12402,12403,12404,12405,12406,12407,12408,12409,12410,12411,12412,12413,12414,12415,12416,12417,12418,12419,12420,12421,12422,12423,12424,12425,12426,12427,12428,12429,12430,12431,12432,12433,12434,12435,12436,12437,12438,12439,12440,12441,12442,12443,12444,12445,12446,12447,12448,12449,12450,12451,12452,12453,12454,12455,12456,12457,12458,12459,12460,12461,12462,12463,12464,12465,12466,12467,12468,12469,12470,12471,12472,12473,12474,12475,12476,12477,12478,12479,12480,12481,12482,12483,12484,12485,12486,12487,12488,12489,12490,12491,12492,12493,12494,12495,12496,12497,12498,12499,12500,12501,12502,12503,12504,12505,12506,12507,12508,12509,12510,12511,12512,12513,12514,12515,12516,12517,12518,12519,12520,12521,12522,12523,12524,12525,12526,12527,12528,12529,12530,12531,12532,12533,12534,12535,12536,12537,12538,12539,12540,12541,12542,12543,12544,12545,12546,12547,12548,12549,12550,12551,12552,12553,12554,12555,12556,12557,12558,12559,12560,12561,12562,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12596,12597,12598,12599,12600,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12611,12612,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622,12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12647,12648,12649,12650,12651,12652,12653,12654,12655,12656,12657,12658,12659,12660,12661,12662,12663,12664,12665,12666,12667,12668,12669,12670,12671,12672,12673,12674,12675,12676,12677,12678,12679,12680,12681,12682,12683,12684,12685,12686,12687,12688,12689,12690,12691,12692,12693,12694,12695,12696,12697,12698,12699,12700,12701,12702,12703,12704,12705,12706,12707,12708,12709,12710,12711,12712,12713,12714,12715,12716,12717,12718,12719,12720,12721,12722,12723,12724,12725,12726,12727,12728,12729,12730,12731,12732,12733,12734,12735,12736,12737,12738,12739,12740,12741,12742,12743,12744,12745,12746,12747,12748,12749,12750,12751,12752,12753,12754,12755,12756,12757,12758,12759,12760,12761,12762,12763,12764,12765,12766,12767,12768,12769,12770,12771,12772,12773,12774,12775,12776,12777,12778,12779,12780,12781,12782,12783,12784,12785,12786,12787,12788,12789,12790,12791,12792,12793,12794,12795,12796,12797,12798,12799,12800,12801,12802,12803,12804,12805,12806,12807,12808,12809,12810,12811,12812,12813,12814,12815,12816,12817,12818,12819,12820,12821,12822,12823,12824,12825,12826,12827,12828,12829,12830,12831,12832,12833,12834,12835,12836,12837,12838,12839,12840,12841,12842,12843,12844,12845,12846,12847,12848,12849,12850,12851,12852,12853,12854,12855,12856,12857,12858,12859,12860,12861,12862,12863,12864,12865,12866,12867,12868,12869,12870,12871,12872,12873,12874,12875,12876,12877,12878,12879,12880,12881,12882,12883,12884,12885,12886,12887,12888,12889,12890,12891,12892,12893,12894,12895,12896,12897,12898,12899,12900,12901,12902,12903,12904,12905,12906,12907,12908,12909,12910,12911,12912,12913,12914,12915,12916,12917,12918,12919,12920,12921,12922,12923,12924,12925,12926,12927,12928,12929,12930,12931,12932,12933,12934,12935,12936,12937,12938,12939,12940,12941,12942,12943,12944,12945,12946,12947,12948,12949,12950,12951,12952,12953,12954,12955,12956,12957,12958,12959,12960,12961,12962,12963,12964,12965,12966,12967,12968,12969,12970,12971,12972,12973,12974,12975,12976,12977,12978,12979,12980,12981,12982,12983,12984,12985,12986,12987,12988,12989,12990,12991,12992,12993,12994,12995,12996,12997,12998,12999,13000,13001,13002,13003,13004,13005,13006,13007,13008,13009,13010,13011,13012,13013,13014,13015,13016,13017,13018,13019,13020,13021,13022,13023,13024,13025,13026,13027,13028,13029,13030,13031,13032,13033,13034,13035,13036,13037,13038,13039,13040,13041,13042,13043,13044,13045,13046,13047,13048,13049,13050,13051,13052,13053,13054,13055,13056,13057,13058,13059,13060,13061,13062,13063,13064,13065,13066,13067,13068,13069,13070,13071,13072,13073,13074,13075,13076,13077,13078,13079,13080,13081,13082,13083,13084,13085,13086,13087,13088,13089,13090,13091,13092,13093,13094,13095,13096,13097,13098,13099,13100,13101,13102,13103,13104,13105,13106,13107,13108,13109,13110,13111,13112,13113,13114,13115,13116,13117,13118,13119,13120,13121,13122,13123,13124,13125,13126,13127,13128,13129,13130,13131,13132,13133,13134,13135,13136,13137,13138,13139,13140,13141,13142,13143,13144,13145,13146,13147,13148,13149,13150,13151,13152,13153,13154,13155,13156,13157,13158,13159,13160,13161,13162,13163,13164,13165,13166,13167,13168,13169,13170,13171,13172,13173,13174,13175,13176,13177,13178,13179,13180,13181,13182,13183,13184,13185,13186,13187,13188,13189,13190,13191,13192,13193,13194,13195,13196,13197,13198,13199,13200,13201,13202,13203,13204,13205,13206,13207,13208,13209,13210,13211,13212,13213,13214,13215,13216,13217,13218,13219,13220,13221,13222,13223,13224,13225,13226,13227,13228,13229,13230,13231,13232,13233,13234,13235,13236,13237,13238,13239,13240,13241,13242,13243,13244,13245,13246,13247,13248,13249,13250,13251,13252,13253,13254,13255,13256,13257,13258,13259,13260,13261,13262,13263,13264,13265,13266,13267,13268,13269,13270,13271,13272,13273,13274,13275,13276,13277,13278,13279,13280,13281,13282,13283,13284,13285,13286,13287,13288,13289,13290,13291,13292,13293,13294,13295,13296,13297,13298,13299,13300,13301,13302,13303,13304,13305,13306,13307,13308,13309,13310,13311,13312,13313,13314,13315,13316,13317,13318,13319,13320,13321,13322,13323,13324,13325,13326,13327,13328,13329,13330,13331,13332,13333,13334,13335,13336,13337,13338,13339,13340,13341,13342,13343,13344,13345,13346,13347,13348,13349,13350,13351,13352,13353,13354,13355,13356,13357,13358,13359,13360,13361,13362,13363,13364,13365,13366,13367,13368,13369,13370,13371,13372,13373,13374,13375,13376,13377,13378,13379,13380,13381,13382,13383,13384,13385,13386,13387,13388,13389,13390,13391,13392,13393,13394,13395,13396,13397,13398,13399,13400,13401,13402,13403,13404,13405,13406,13407,13408,13409,13410,13411,13412,13413,13414,13415,13416,13417,13418,13419,13420,13421,13422,13423,13424,13425,13426,13427,13428,13429,13430,13431,13432,13433,13434,13435,13436,13437,13438,13439,13440,13441,13442,13443,13444,13445,13446,13447,13448,13449,13450,13451,13452,13453,13454,13455,13456,13457,13458,13459,13460,13461,13462,13463,13464,13465,13466,13467,13468,13469,13470,13471,13472,13473,13474,13475,13476,13477,13478,13479,13480,13481,13482,13483,13484,13485,13486,13487,13488,13489,13490,13491,13492,13493,13494,13495,13496,13497,13498,13499,13500,13501,13502,13503,13504,13505,13506,13507,13508,13509,13510,13511,13512,13513,13514,13515,13516,13517,13518,13519,13520,13521,13522,13523,13524,13525,13526,13527,13528,13529,13530,13531,13532,13533,13534,13535,13536,13537,13538,13539,13540,13541,13542,13543,13544,13545,13546,13547,13548,13549,13550,13551,13552,13553,13554,13555,13556,13557,13558,13559,13560,13561,13562,13563,13564,13565,13566,13567,13568,13569,13570,13571,13572,13573,13574,13575,13576,13577,13578,13579,13580,13581,13582,13583,13584,13585,13586,13587,13588,13589,13590,13591,13592,13593,13594,13595,13596,13597,13598,13599,13600,13601,13602,13603,13604,13605,13606,13607,13608,13609,13610,13611,13612,13613,13614,13615,13616,13617,13618,13619,13620,13621,13622,13623,13624,13625,13626,13627,13628,13629,13630,13631,13632,13633,13634,13635,13636,13637,13638,13639,13640,13641,13642,13643,13644,13645,13646,13647,13648,13649,13650,13651,13652,13653,13654,13655,13656,13657,13658,13659,13660,13661,13662,13663,13664,13665,13666,13667,13668,13669,13670,13671,13672,13673,13674,13675,13676,13677,13678,13679,13680,13681,13682,13683,13684,13685,13686,13687,13688,13689,13690,13691,13692,13693,13694,13695,13696,13697,13698,13699,13700,13701,13702,13703,13704,13705,13706,13707,13708,13709,13710,13711,13712,13713,13714,13715,13716,13717,13718,13719,13720,13721,13722,13723,13724,13725,13726,13727,13728,13729,13730,13731,13732,13733,13734,13735,13736,13737,13738,13739,13740,13741,13742,13743,13744,13745,13746,13747,13748,13749,13750,13751,13752,13753,13754,13755,13756,13757,13758,13759,13760,13761,13762,13763,13764,13765,13766,13767,13768,13769,13770,13771,13772,13773,13774,13775,13776,13777,13778,13779,13780,13781,13782,13783,13784,13785,13786,13787,13788,13789,13790,13791,13792,13793,13794,13795,13796,13797,13798,13799,13800,13801,13802,13803,13804,13805,13806,13807,13808,13809,13810,13811,13812,13813,13814,13815,13816,13817,13818,13819,13820,13821,13822,13823,13824,13825,13826,13827,13828,13829,13830,13831,13832,13833,13834,13835,13836,13837,13838,13839,13840,13841,13842,13843,13844,13845,13846,13847,13848,13849,13850,13851,13852,13853,13854,13855,13856,13857,13858,13859,13860,13861,13862,13863,13864,13865,13866,13867,13868,13869,13870,13871,13872,13873,13874,13875,13876,13877,13878,13879,13880,13881,13882,13883,13884,13885,13886,13887,13888,13889,13890,13891,13892,13893,13894,13895,13896,13897,13898,13899,13900,13901,13902,13903,13904,13905,13906,13907,13908,13909,13910,13911,13912,13913,13914,13915,13916,13917,13918,13919,13920,13921,13922,13923,13924,13925,13926,13927,13928,13929,13930,13931,13932,13933,13934,13935,13936,13937,13938,13939,13940,13941,13942,13943,13944,13945,13946,13947,13948,13949,13950,13951,13952,13953,13954,13955,13956,13957,13958,13959,13960,13961,13962,13963,13964,13965,13966,13967,13968,13969,13970,13971,13972,13973,13974,13975,13976,13977,13978,13979,13980,13981,13982,13983,13984,13985,13986,13987,13988,13989,13990,13991,13992,13993,13994,13995,13996,13997,13998,13999,14000,14001,14002,14003,14004,14005,14006,14007,14008,14009,14010,14011,14012,14013,14014,14015,14016,14017,14018,14019,14020,14021,14022,14023,14024,14025,14026,14027,14028,14029,14030,14031,14032,14033,14034,14035,14036,14037,14038,14039,14040,14041,14042,14043,14044,14045,14046,14047,14048,14049,14050,14051,14052,14053,14054,14055,14056,14057,14058,14059,14060,14061,14062,14063,14064,14065,14066,14067,14068,14069,14070,14071,14072,14073,14074,14075,14076,14077,14078,14079,14080,14081,14082,14083,14084,14085,14086,14087,14088,14089,14090,14091,14092,14093,14094,14095,14096,14097,14098,14099,14100,14101,14102,14103,14104,14105,14106,14107,14108,14109,14110,14111,14112,14113,14114,14115,14116,14117,14118,14119,14120,14121,14122,14123,14124,14125,14126,14127,14128,14129,14130,14131,14132,14133,14134,14135,14136,14137,14138,14139,14140,14141,14142,14143,14144,14145,14146,14147,14148,14149,14150,14151,14152,14153,14154,14155,14156,14157,14158,14159,14160,14161,14162,14163,14164,14165,14166,14167,14168,14169,14170,14171,14172,14173,14174,14175,14176,14177,14178,14179,14180,14181,14182,14183,14184,14185,14186,14187,14188,14189,14190,14191,14192,14193,14194,14195,14196,14197,14198,14199,14200,14201,14202,14203,14204,14205,14206,14207,14208,14209,14210,14211,14212,14213,14214,14215,14216,14217,14218,14219,14220,14221,14222,14223,14224,14225,14226,14227,14228,14229,14230,14231,14232,14233,14234,14235,14236,14237,14238,14239,14240,14241,14242,14243,14244,14245,14246,14247,14248,14249,14250,14251,14252,14253,14254,14255,14256,14257,14258,14259,14260,14261,14262,14263,14264,14265,14266,14267,14268,14269,14270,14271,14272,14273,14274,14275,14276,14277,14278,14279,14280,14281,14282,14283,14284,14285,14286,14287,14288,14289,14290,14291,14292,14293,14294,14295,14296,14297,14298,14299,14300,14301,14302,14303,14304,14305,14306,14307,14308,14309,14310,14311,14312,14313,14314,14315,14316,14317,14318,14319,14320,14321,14322,14323,14324,14325,14326,14327,14328,14329,14330,14331,14332,14333,14334,14335,14336,14337,14338,14339,14340,14341,14342,14343,14344,14345,14346,14347,14348,14349,14350,14351,14352,14353,14354,14355,14356,14357,14358,14359,14360,14361,14362,14363,14364,14365,14366,14367,14368,14369,14370,14371,14372,14373,14374,14375,14376,14377,14378,14379,14380,14381,14382,14383,14384,14385,14386,14387,14388,14389,14390,14391,14392,14393,14394,14395,14396,14397,14398,14399,14400,14401,14402,14403,14404,14405,14406,14407,14408,14409,14410,14411,14412,14413,14414,14415,14416,14417,14418,14419,14420,14421,14422,14423,14424,14425,14426,14427,14428,14429,14430,14431,14432,14433,14434,14435,14436,14437,14438,14439,14440,14441,14442,14443,14444,14445,14446,14447,14448,14449,14450,14451,14452,14453,14454,14455,14456,14457,14458,14459,14460,14461,14462,14463,14464,14465,14466,14467,14468,14469,14470,14471,14472,14473,14474,14475,14476,14477,14478,14479,14480,14481,14482,14483,14484,14485,14486,14487,14488,14489,14490,14491,14492,14493,14494,14495,14496,14497,14498,14499,14500,14501,14502,14503,14504,14505,14506,14507,14508,14509,14510,14511,14512,14513,14514,14515,14516,14517,14518,14519,14520,14521,14522,14523,14524,14525,14526,14527,14528,14529,14530,14531,14532,14533,14534,14535,14536,14537,14538,14539,14540,14541,14542,14543,14544,14545,14546,14547,14548,14549,14550,14551,14552,14553,14554,14555,14556,14557,14558,14559,14560,14561,14562,14563,14564,14565,14566,14567,14568,14569,14570,14571,14572,14573,14574,14575,14576,14577,14578,14579,14580,14581,14582,14583,14584,14585,14586,14587,14588,14589,14590,14591,14592,14593,14594,14595,14596,14597,14598,14599,14600,14601,14602,14603,14604,14605,14606,14607,14608,14609,14610,14611,14612,14613,14614,14615,14616,14617,14618,14619,14620,14621,14622,14623,14624,14625,14626,14627,14628,14629,14630,14631,14632,14633,14634,14635,14636,14637,14638,14639,14640,14641,14642,14643,14644,14645,14646,14647,14648,14649,14650,14651,14652,14653,14654,14655,14656,14657,14658,14659,14660,14661,14662,14663,14664,14665,14666,14667,14668,14669,14670,14671,14672,14673,14674,14675,14676,14677,14678,14679,14680,14681,14682,14683,14684,14685,14686,14687,14688,14689,14690,14691,14692,14693,14694,14695,14696,14697,14698,14699,14700,14701,14702,14703,14704,14705,14706,14707,14708,14709,14710,14711,14712,14713,14714,14715,14716,14717,14718,14719,14720,14721,14722,14723,14724,14725,14726,14727,14728,14729,14730,14731,14732,14733,14734,14735,14736,14737,14738,14739,14740,14741,14742,14743,14744,14745,14746,14747,14748,14749,14750,14751,14752,14753,14754,14755,14756,14757,14758,14759,14760,14761,14762,14763,14764,14765,14766,14767,14768,14769,14770,14771,14772,14773,14774,14775,14776,14777,14778,14779,14780,14781,14782,14783,14784,14785,14786,14787,14788,14789,14790,14791,14792,14793,14794,14795,14796,14797,14798,14799,14800,14801,14802,14803,14804,14805,14806,14807,14808,14809,14810,14811,14812,14813,14814,14815,14816,14817,14818,14819,14820,14821,14822,14823,14824,14825,14826,14827,14828,14829,14830,14831,14832,14833,14834,14835,14836,14837,14838,14839,14840,14841,14842,14843,14844,14845,14846,14847,14848,14849,14850,14851,14852,14853,14854,14855,14856,14857,14858,14859,14860,14861,14862,14863,14864,14865,14866,14867,14868,14869,14870,14871,14872,14873,14874,14875,14876,14877,14878,14879,14880,14881,14882,14883,14884,14885,14886,14887,14888,14889,14890,14891,14892,14893,14894,14895,14896,14897,14898,14899,14900,14901,14902,14903,14904,14905,14906,14907,14908,14909,14910,14911,14912,14913,14914,14915,14916,14917,14918,14919,14920,14921,14922,14923,14924,14925,14926,14927,14928,14929,14930,14931,14932,14933,14934,14935,14936,14937,14938,14939,14940,14941,14942,14943,14944,14945,14946,14947,14948,14949,14950,14951,14952,14953,14954,14955,14956,14957,14958,14959,14960,14961,14962,14963,14964,14965,14966,14967,14968,14969,14970,14971,14972,14973,14974,14975,14976,14977,14978,14979,14980,14981,14982,14983,14984,14985,14986,14987,14988,14989,14990,14991,14992,14993,14994,14995,14996,14997,14998,14999,15000,15001,15002,15003,15004,15005,15006,15007,15008,15009,15010,15011,15012,15013,15014,15015,15016,15017,15018,15019,15020,15021,15022,15023,15024,15025,15026,15027,15028,15029,15030,15031,15032,15033,15034,15035,15036,15037,15038,15039,15040,15041,15042,15043,15044,15045,15046,15047,15048,15049,15050,15051,15052,15053,15054,15055,15056,15057,15058,15059,15060,15061,15062,15063,15064,15065,15066,15067,15068,15069,15070,15071,15072,15073,15074,15075,15076,15077,15078,15079,15080,15081,15082,15083,15084,15085,15086,15087,15088,15089,15090,15091,15092,15093,15094,15095,15096,15097,15098,15099,15100,15101,15102,15103,15104,15105,15106,15107,15108,15109,15110,15111,15112,15113,15114,15115,15116,15117,15118,15119,15120,15121,15122,15123,15124,15125,15126,15127,15128,15129,15130,15131,15132,15133,15134,15135,15136,15137,15138,15139,15140,15141,15142,15143,15144,15145,15146,15147,15148,15149,15150,15151,15152,15153,15154,15155,15156,15157,15158,15159,15160,15161,15162,15163,15164,15165,15166,15167,15168,15169,15170,15171,15172,15173,15174,15175,15176,15177,15178,15179,15180,15181,15182,15183,15184,15185,15186,15187,15188,15189,15190,15191,15192,15193,15194,15195,15196,15197,15198,15199,15200,15201,15202,15203,15204,15205,15206,15207,15208,15209,15210,15211,15212,15213,15214,15215,15216,15217,15218,15219,15220,15221,15222,15223,15224,15225,15226,15227,15228,15229,15230,15231,15232,15233,15234,15235,15236,15237,15238,15239,15240,15241,15242,15243,15244,15245,15246,15247,15248,15249,15250,15251,15252,15253,15254,15255,15256,15257,15258,15259,15260,15261,15262,15263,15264,15265,15266,15267,15268,15269,15270,15271,15272,15273,15274,15275,15276,15277,15278,15279,15280,15281,15282,15283,15284,15285,15286,15287,15288,15289,15290,15291,15292,15293,15294,15295,15296,15297,15298,15299,15300,15301,15302,15303,15304,15305,15306,15307,15308,15309,15310,15311,15312,15313,15314,15315,15316,15317,15318,15319,15320,15321,15322,15323,15324,15325,15326,15327,15328,15329,15330,15331,15332,15333,15334,15335,15336,15337,15338,15339,15340,15341,15342,15343,15344,15345,15346,15347,15348,15349,15350,15351,15352,15353,15354,15355,15356,15357,15358,15359,15360,15361,15362,15363,15364,15365,15366,15367,15368,15369,15370,15371,15372,15373,15374,15375,15376,15377,15378,15379,15380,15381,15382,15383,15384,15385,15386,15387,15388,15389,15390,15391,15392,15393,15394,15395,15396,15397,15398,15399,15400,15401,15402,15403,15404,15405,15406,15407,15408,15409,15410,15411,15412,15413,15414,15415,15416,15417,15418,15419,15420,15421,15422,15423,15424,15425,15426,15427,15428,15429,15430,15431,15432,15433,15434,15435,15436,15437,15438,15439,15440,15441,15442,15443,15444,15445,15446,15447,15448,15449,15450,15451,15452,15453,15454,15455,15456,15457,15458,15459,15460,15461,15462,15463,15464,15465,15466,15467,15468,15469,15470,15471,15472,15473,15474,15475,15476,15477,15478,15479,15480,15481,15482,15483,15484,15485,15486,15487,15488,15489,15490,15491,15492,15493,15494,15495,15496,15497,15498,15499,15500,15501,15502,15503,15504,15505,15506,15507,15508,15509,15510,15511,15512,15513,15514,15515,15516,15517,15518,15519,15520,15521,15522,15523,15524,15525,15526,15527,15528,15529,15530,15531,15532,15533,15534,15535,15536,15537,15538,15539,15540,15541,15542,15543,15544,15545,15546,15547,15548,15549,15550,15551,15552,15553,15554,15555,15556,15557,15558,15559,15560,15561,15562,15563,15564,15565,15566,15567,15568,15569,15570,15571,15572,15573,15574,15575,15576,15577,15578,15579,15580,15581,15582,15583,15584,15585,15586,15587,15588,15589,15590,15591,15592,15593,15594,15595,15596,15597,15598,15599,15600,15601,15602,15603,15604,15605,15606,15607,15608,15609,15610,15611,15612,15613,15614,15615,15616,15617,15618,15619,15620,15621,15622,15623,15624,15625,15626,15627,15628,15629,15630,15631,15632,15633,15634,15635,15636,15637,15638,15639,15640,15641,15642,15643,15644,15645,15646,15647,15648,15649,15650,15651,15652,15653,15654,15655,15656,15657,15658,15659,15660,15661,15662,15663,15664,15665,15666,15667,15668,15669,15670,15671,15672,15673,15674,15675,15676,15677,15678,15679,15680,15681,15682,15683,15684,15685,15686,15687,15688,15689,15690,15691,15692,15693,15694,15695,15696,15697,15698,15699,15700,15701,15702,15703,15704,15705,15706,15707,15708,15709,15710,15711,15712,15713,15714,15715,15716,15717,15718,15719,15720,15721,15722,15723,15724,15725,15726,15727,15728,15729,15730,15731,15732,15733,15734,15735,15736,15737,15738,15739,15740,15741,15742,15743,15744,15745,15746,15747,15748,15749,15750,15751,15752,15753,15754,15755,15756,15757,15758,15759,15760,15761,15762,15763,15764,15765,15766,15767,15768,15769,15770,15771,15772,15773,15774,15775,15776,15777,15778,15779,15780,15781,15782,15783,15784,15785,15786,15787,15788,15789,15790,15791,15792,15793,15794,15795,15796,15797,15798,15799,15800,15801,15802,15803,15804,15805,15806,15807,15808,15809,15810,15811,15812,15813,15814,15815,15816,15817,15818,15819,15820,15821,15822,15823,15824,15825,15826,15827,15828,15829,15830,15831,15832,15833,15834,15835,15836,15837,15838,15839,15840,15841,15842,15843,15844,15845,15846,15847,15848,15849,15850,15851,15852,15853,15854,15855,15856,15857,15858,15859,15860,15861,15862,15863,15864,15865,15866,15867,15868,15869,15870,15871,15872,15873,15874,15875,15876,15877,15878,15879,15880,15881,15882,15883,15884,15885,15886,15887,15888,15889,15890,15891,15892,15893,15894,15895,15896,15897,15898,15899,15900,15901,15902,15903,15904,15905,15906,15907,15908,15909,15910,15911,15912,15913,15914,15915,15916,15917,15918,15919,15920,15921,15922,15923,15924,15925,15926,15927,15928,15929,15930,15931,15932,15933,15934,15935,15936,15937,15938,15939,15940,15941,15942,15943,15944,15945,15946,15947,15948,15949,15950,15951,15952,15953,15954,15955,15956,15957,15958,15959,15960,15961,15962,15963,15964,15965,15966,15967,15968,15969,15970,15971,15972,15973,15974,15975,15976,15977,15978,15979,15980,15981,15982,15983,15984,15985,15986,15987,15988,15989,15990,15991,15992,15993,15994,15995,15996,15997,15998,15999,16000,16001,16002,16003,16004,16005,16006,16007,16008,16009,16010,16011,16012,16013,16014,16015,16016,16017,16018,16019,16020,16021,16022,16023,16024,16025,16026,16027,16028,16029,16030,16031,16032,16033,16034,16035,16036,16037,16038,16039,16040,16041,16042,16043,16044,16045,16046,16047,16048,16049,16050,16051,16052,16053,16054,16055,16056,16057,16058,16059,16060,16061,16062,16063,16064,16065,16066,16067,16068,16069,16070,16071,16072,16073,16074,16075,16076,16077,16078,16079,16080,16081,16082,16083,16084,16085,16086,16087,16088,16089,16090,16091,16092,16093,16094,16095,16096,16097,16098,16099,16100,16101,16102,16103,16104,16105,16106,16107,16108,16109,16110,16111,16112,16113,16114,16115,16116,16117,16118,16119,16120,16121,16122,16123,16124,16125,16126,16127,16128,16129,16130,16131,16132,16133,16134,16135,16136,16137,16138,16139,16140,16141,16142,16143,16144,16145,16146,16147,16148,16149,16150,16151,16152,16153,16154,16155,16156,16157,16158,16159,16160,16161,16162,16163,16164,16165,16166,16167,16168,16169,16170,16171,16172,16173,16174,16175,16176,16177,16178,16179,16180,16181,16182,16183,16184,16185,16186,16187,16188,16189,16190,16191,16192,16193,16194,16195,16196,16197,16198,16199,16200,16201,16202,16203,16204,16205,16206,16207,16208,16209,16210,16211,16212,16213,16214,16215,16216,16217,16218,16219,16220,16221,16222,16223,16224,16225,16226,16227,16228,16229,16230,16231,16232,16233,16234,16235,16236,16237,16238,16239,16240,16241,16242,16243,16244,16245,16246,16247,16248,16249,16250,16251,16252,16253,16254,16255,16256,16257,16258,16259,16260,16261,16262,16263,16264,16265,16266,16267,16268,16269,16270,16271,16272,16273,16274,16275,16276,16277,16278,16279,16280,16281,16282,16283,16284,16285,16286,16287,16288,16289,16290,16291,16292,16293,16294,16295,16296,16297,16298,16299,16300,16301,16302,16303,16304,16305,16306,16307,16308,16309,16310,16311,16312,16313,16314,16315,16316,16317,16318,16319,16320,16321,16322,16323,16324,16325,16326,16327,16328,16329,16330,16331,16332,16333,16334,16335,16336,16337,16338,16339,16340,16341,16342,16343,16344,16345,16346,16347,16348,16349,16350,16351,16352,16353,16354,16355,16356,16357,16358,16359,16360,16361,16362,16363,16364,16365,16366,16367,16368,16369,16370,16371,16372,16373,16374,16375,16376,16377,16378,16379,16380,16381,16382,16383,16384,16385,16386,16387,16388,16389,16390,16391,16392,16393,16394,16395,16396,16397,16398,16399,16400,16401,16402,16403,16404,16405,16406,16407,16408,16409,16410,16411,16412,16413,16414,16415,16416,16417,16418,16419,16420,16421,16422,16423,16424,16425,16426,16427,16428,16429,16430,16431,16432,16433,16434,16435,16436,16437,16438,16439,16440,16441,16442,16443,16444,16445,16446,16447,16448,16449,16450,16451,16452,16453,16454,16455,16456,16457,16458,16459,16460,16461,16462,16463,16464,16465,16466,16467,16468,16469,16470,16471,16472,16473,16474,16475,16476,16477,16478,16479,16480,16481,16482,16483,16484,16485,16486,16487,16488,16489,16490,16491,16492,16493,16494,16495,16496,16497,16498,16499,16500,16501,16502,16503,16504,16505,16506,16507,16508,16509,16510,16511,16512,16513,16514,16515,16516,16517,16518,16519,16520,16521,16522,16523,16524,16525,16526,16527,16528,16529,16530,16531,16532,16533,16534,16535,16536,16537,16538,16539,16540,16541,16542,16543,16544,16545,16546,16547,16548,16549,16550,16551,16552,16553,16554,16555,16556,16557,16558,16559,16560,16561,16562,16563,16564,16565,16566,16567,16568,16569,16570,16571,16572,16573,16574,16575,16576,16577,16578,16579,16580,16581,16582,16583,16584,16585,16586,16587,16588,16589,16590,16591,16592,16593,16594,16595,16596,16597,16598,16599,16600,16601,16602,16603,16604,16605,16606,16607,16608,16609,16610,16611,16612,16613,16614,16615,16616,16617,16618,16619,16620,16621,16622,16623,16624,16625,16626,16627,16628,16629,16630,16631,16632,16633,16634,16635,16636,16637,16638,16639,16640,16641,16642,16643,16644,16645,16646,16647,16648,16649,16650,16651,16652,16653,16654,16655,16656,16657,16658,16659,16660,16661,16662,16663,16664,16665,16666,16667,16668,16669,16670,16671,16672,16673,16674,16675,16676,16677,16678,16679,16680,16681,16682,16683,16684,16685,16686,16687,16688,16689,16690,16691,16692,16693,16694,16695,16696,16697,16698,16699,16700,16701,16702,16703,16704,16705,16706,16707,16708,16709,16710,16711,16712,16713,16714,16715,16716,16717,16718,16719,16720,16721,16722,16723,16724,16725,16726,16727,16728,16729,16730,16731,16732,16733,16734,16735,16736,16737,16738,16739,16740,16741,16742,16743,16744,16745,16746,16747,16748,16749,16750,16751,16752,16753,16754,16755,16756,16757,16758,16759,16760,16761,16762,16763,16764,16765,16766,16767,16768,16769,16770,16771,16772,16773,16774,16775,16776,16777,16778,16779,16780,16781,16782,16783,16784,16785,16786,16787,16788,16789,16790,16791,16792,16793,16794,16795,16796,16797,16798,16799,16800,16801,16802,16803,16804,16805,16806,16807,16808,16809,16810,16811,16812,16813,16814,16815,16816,16817,16818,16819,16820,16821,16822,16823,16824,16825,16826,16827,16828,16829,16830,16831,16832,16833,16834,16835,16836,16837,16838,16839,16840,16841,16842,16843,16844,16845,16846,16847,16848,16849,16850,16851,16852,16853,16854,16855,16856,16857,16858,16859,16860,16861,16862,16863,16864,16865,16866,16867,16868,16869,16870,16871,16872,16873,16874,16875,16876,16877,16878,16879,16880,16881,16882,16883,16884,16885,16886,16887,16888,16889,16890,16891,16892,16893,16894,16895,16896,16897,16898,16899,16900,16901,16902,16903,16904,16905,16906,16907,16908,16909,16910,16911,16912,16913,16914,16915,16916,16917,16918,16919,16920,16921,16922,16923,16924,16925,16926,16927,16928,16929,16930,16931,16932,16933,16934,16935,16936,16937,16938,16939,16940,16941,16942,16943,16944,16945,16946,16947,16948,16949,16950,16951,16952,16953,16954,16955,16956,16957,16958,16959,16960,16961,16962,16963,16964,16965,16966,16967,16968,16969,16970,16971,16972,16973,16974,16975,16976,16977,16978,16979,16980,16981,16982,16983,16984,16985,16986,16987,16988,16989,16990,16991,16992,16993,16994,16995,16996,16997,16998,16999,17000,17001,17002,17003,17004,17005,17006,17007,17008,17009,17010,17011,17012,17013,17014,17015,17016,17017,17018,17019,17020,17021,17022,17023,17024,17025,17026,17027,17028,17029,17030,17031,17032,17033,17034,17035,17036,17037,17038,17039,17040,17041,17042,17043,17044,17045,17046,17047,17048,17049,17050,17051,17052,17053,17054,17055,17056,17057,17058,17059,17060,17061,17062,17063,17064,17065,17066,17067,17068,17069,17070,17071,17072,17073,17074,17075,17076,17077,17078,17079,17080,17081,17082,17083,17084,17085,17086,17087,17088,17089,17090,17091,17092,17093,17094,17095,17096,17097,17098,17099,17100,17101,17102,17103,17104,17105,17106,17107,17108,17109,17110,17111,17112,17113,17114,17115,17116,17117,17118,17119,17120,17121,17122,17123,17124,17125,17126,17127,17128,17129,17130,17131,17132,17133,17134,17135,17136,17137,17138,17139,17140,17141,17142,17143,17144,17145,17146,17147,17148,17149,17150,17151,17152,17153,17154,17155,17156,17157,17158,17159,17160,17161,17162,17163,17164,17165,17166,17167,17168,17169,17170,17171,17172,17173,17174,17175,17176,17177,17178,17179,17180,17181,17182,17183,17184,17185,17186,17187,17188,17189,17190,17191,17192,17193,17194,17195,17196,17197,17198,17199,17200,17201,17202,17203,17204,17205,17206,17207,17208,17209,17210,17211,17212,17213,17214,17215,17216,17217,17218,17219,17220,17221,17222,17223,17224,17225,17226,17227,17228,17229,17230,17231,17232,17233,17234,17235,17236,17237,17238,17239,17240,17241,17242,17243,17244,17245,17246,17247,17248,17249,17250,17251,17252,17253,17254,17255,17256,17257,17258,17259,17260,17261,17262,17263,17264,17265,17266,17267,17268,17269,17270,17271,17272,17273,17274,17275,17276,17277,17278,17279,17280,17281,17282,17283,17284,17285,17286,17287,17288,17289,17290,17291,17292,17293,17294,17295,17296,17297,17298,17299,17300,17301,17302,17303,17304,17305,17306,17307,17308,17309,17310,17311,17312,17313,17314,17315,17316,17317,17318,17319,17320,17321,17322,17323,17324,17325,17326,17327,17328,17329,17330,17331,17332,17333,17334,17335,17336,17337,17338,17339,17340,17341,17342,17343,17344,17345,17346,17347,17348,17349,17350,17351,17352,17353,17354,17355,17356,17357,17358,17359,17360,17361,17362,17363,17364,17365,17366,17367,17368,17369,17370,17371,17372,17373,17374,17375,17376,17377,17378,17379,17380,17381,17382,17383,17384,17385,17386,17387,17388,17389,17390,17391,17392,17393,17394,17395,17396,17397,17398,17399,17400,17401,17402,17403,17404,17405,17406,17407,17408,17409,17410,17411,17412,17413,17414,17415,17416,17417,17418,17419,17420,17421,17422,17423,17424,17425,17426,17427,17428,17429,17430,17431,17432,17433,17434,17435,17436,17437,17438,17439,17440,17441,17442,17443,17444,17445,17446,17447,17448,17449,17450,17451,17452,17453,17454,17455,17456,17457,17458,17459,17460,17461,17462,17463,17464,17465,17466,17467,17468,17469,17470,17471,17472,17473,17474,17475,17476,17477,17478,17479,17480,17481,17482,17483,17484,17485,17486,17487,17488,17489,17490,17491,17492,17493,17494,17495,17496,17497,17498,17499,17500,17501,17502,17503,17504,17505,17506,17507,17508,17509,17510,17511,17512,17513,17514,17515,17516,17517,17518,17519,17520,17521,17522,17523,17524,17525,17526,17527,17528,17529,17530,17531,17532,17533,17534,17535,17536,17537,17538,17539,17540,17541,17542,17543,17544,17545,17546,17547,17548,17549,17550,17551,17552,17553,17554,17555,17556,17557,17558,17559,17560,17561,17562,17563,17564,17565,17566,17567,17568,17569,17570,17571,17572,17573,17574,17575,17576,17577,17578,17579,17580,17581,17582,17583,17584,17585,17586,17587,17588,17589,17590,17591,17592,17593,17594,17595,17596,17597,17598,17599,17600,17601,17602,17603,17604,17605,17606,17607,17608,17609,17610,17611,17612,17613,17614,17615,17616,17617,17618,17619,17620,17621,17622,17623,17624,17625,17626,17627,17628,17629,17630,17631,17632,17633,17634,17635,17636,17637,17638,17639,17640,17641,17642,17643,17644,17645,17646,17647,17648,17649,17650,17651,17652,17653,17654,17655,17656,17657,17658,17659,17660,17661,17662,17663,17664,17665,17666,17667,17668,17669,17670,17671,17672,17673,17674,17675,17676,17677,17678,17679,17680,17681,17682,17683,17684,17685,17686,17687,17688,17689,17690,17691,17692,17693,17694,17695,17696,17697,17698,17699,17700,17701,17702,17703,17704,17705,17706,17707,17708,17709,17710,17711,17712,17713,17714,17715,17716,17717,17718,17719,17720,17721,17722,17723,17724,17725,17726,17727,17728,17729,17730,17731,17732,17733,17734,17735,17736,17737,17738,17739,17740,17741,17742,17743,17744,17745,17746,17747,17748,17749,17750,17751,17752,17753,17754,17755,17756,17757,17758,17759,17760,17761,17762,17763,17764,17765,17766,17767,17768,17769,17770,17771,17772,17773,17774,17775,17776,17777,17778,17779,17780,17781,17782,17783,17784,17785,17786,17787,17788,17789,17790,17791,17792,17793,17794,17795,17796,17797,17798,17799,17800,17801,17802,17803,17804,17805,17806,17807,17808,17809,17810,17811,17812,17813,17814,17815,17816,17817,17818,17819,17820,17821,17822,17823,17824,17825,17826,17827,17828,17829,17830,17831,17832,17833,17834,17835,17836,17837,17838,17839,17840,17841,17842,17843,17844,17845,17846,17847,17848,17849,17850,17851,17852,17853,17854,17855,17856,17857,17858,17859,17860,17861,17862,17863,17864,17865,17866,17867,17868,17869,17870,17871,17872,17873,17874,17875,17876,17877,17878,17879,17880,17881,17882,17883,17884,17885,17886,17887,17888,17889,17890,17891,17892,17893,17894,17895,17896,17897,17898,17899,17900,17901,17902,17903,17904,17905,17906,17907,17908,17909,17910,17911,17912,17913,17914,17915,17916,17917,17918,17919,17920,17921,17922,17923,17924,17925,17926,17927,17928,17929,17930,17931,17932,17933,17934,17935,17936,17937,17938,17939,17940,17941,17942,17943,17944,17945,17946,17947,17948,17949,17950,17951,17952,17953,17954,17955,17956,17957,17958,17959,17960,17961,17962,17963,17964,17965,17966,17967,17968,17969,17970,17971,17972,17973,17974,17975,17976,17977,17978,17979,17980,17981,17982,17983,17984,17985,17986,17987,17988,17989,17990,17991,17992,17993,17994,17995,17996,17997,17998,17999,18000,18001,18002,18003,18004,18005,18006,18007,18008,18009,18010,18011,18012,18013,18014,18015,18016,18017,18018,18019,18020,18021,18022,18023,18024,18025,18026,18027,18028,18029,18030,18031,18032,18033,18034,18035,18036,18037,18038,18039,18040,18041,18042,18043,18044,18045,18046,18047,18048,18049,18050,18051,18052,18053,18054,18055,18056,18057,18058,18059,18060,18061,18062,18063,18064,18065,18066,18067,18068,18069,18070,18071,18072,18073,18074,18075,18076,18077,18078,18079,18080,18081,18082,18083,18084,18085,18086,18087,18088,18089,18090,18091,18092,18093,18094,18095,18096,18097,18098,18099,18100,18101,18102,18103,18104,18105,18106,18107,18108,18109,18110,18111,18112,18113,18114,18115,18116,18117,18118,18119,18120,18121,18122,18123,18124,18125,18126,18127,18128,18129,18130,18131,18132,18133,18134,18135,18136,18137,18138,18139,18140,18141,18142,18143,18144,18145,18146,18147,18148,18149,18150,18151,18152,18153,18154,18155,18156,18157,18158,18159,18160,18161,18162,18163,18164,18165,18166,18167,18168,18169,18170,18171,18172,18173,18174,18175,18176,18177,18178,18179,18180,18181,18182,18183,18184,18185,18186,18187,18188,18189,18190,18191,18192,18193,18194,18195,18196,18197,18198,18199,18200,18201,18202,18203,18204,18205,18206,18207,18208,18209,18210,18211,18212,18213,18214,18215,18216,18217,18218,18219,18220,18221,18222,18223,18224,18225,18226,18227,18228,18229,18230,18231,18232,18233,18234,18235,18236,18237,18238,18239,18240,18241,18242,18243,18244,18245,18246,18247,18248,18249,18250,18251,18252,18253,18254,18255,18256,18257,18258,18259,18260,18261,18262,18263,18264,18265,18266,18267,18268,18269,18270,18271,18272,18273,18274,18275,18276,18277,18278,18279,18280,18281,18282,18283,18284,18285,18286,18287,18288,18289,18290,18291,18292,18293,18294,18295,18296,18297,18298,18299,18300,18301,18302,18303,18304,18305,18306,18307,18308,18309,18310,18311,18312,18313,18314,18315,18316,18317,18318,18319,18320,18321,18322,18323,18324,18325,18326,18327,18328,18329,18330,18331,18332,18333,18334,18335,18336,18337,18338,18339,18340,18341,18342,18343,18344,18345,18346,18347,18348,18349,18350,18351,18352,18353,18354,18355,18356,18357,18358,18359,18360,18361,18362,18363,18364,18365,18366,18367,18368,18369,18370,18371,18372,18373,18374,18375,18376,18377,18378,18379,18380,18381,18382,18383,18384,18385,18386,18387,18388,18389,18390,18391,18392,18393,18394,18395,18396,18397,18398,18399,18400,18401,18402,18403,18404,18405,18406,18407,18408,18409,18410,18411,18412,18413,18414,18415,18416,18417,18418,18419,18420,18421,18422,18423,18424,18425,18426,18427,18428,18429,18430,18431,18432,18433,18434,18435,18436,18437,18438,18439,18440,18441,18442,18443,18444,18445,18446,18447,18448,18449,18450,18451,18452,18453,18454,18455,18456,18457,18458,18459,18460,18461,18462,18463,18464,18465,18466,18467,18468,18469,18470,18471,18472,18473,18474,18475,18476,18477,18478,18479,18480,18481,18482,18483,18484,18485,18486,18487,18488,18489,18490,18491,18492,18493,18494,18495,18496,18497,18498,18499,18500,18501,18502,18503,18504,18505,18506,18507,18508,18509,18510,18511,18512,18513,18514,18515,18516,18517,18518,18519,18520,18521,18522,18523,18524,18525,18526,18527,18528,18529,18530,18531,18532,18533,18534,18535,18536,18537,18538,18539,18540,18541,18542,18543,18544,18545,18546,18547,18548,18549,18550,18551,18552,18553,18554,18555,18556,18557,18558,18559,18560,18561,18562,18563,18564,18565,18566,18567,18568,18569,18570,18571,18572,18573,18574,18575,18576,18577,18578,18579,18580,18581,18582,18583,18584,18585,18586,18587,18588,18589,18590,18591,18592,18593,18594,18595,18596,18597,18598,18599,18600,18601,18602,18603,18604,18605,18606,18607,18608,18609,18610,18611,18612,18613,18614,18615,18616,18617,18618,18619,18620,18621,18622,18623,18624,18625,18626,18627,18628,18629,18630,18631,18632,18633,18634,18635,18636,18637,18638,18639,18640,18641,18642,18643,18644,18645,18646,18647,18648,18649,18650,18651,18652,18653,18654,18655,18656,18657,18658,18659,18660,18661,18662,18663,18664,18665,18666,18667,18668,18669,18670,18671,18672,18673,18674,18675,18676,18677,18678,18679,18680,18681,18682,18683,18684,18685,18686,18687,18688,18689,18690,18691,18692,18693,18694,18695,18696,18697,18698,18699,18700,18701,18702,18703,18704,18705,18706,18707,18708,18709,18710,18711,18712,18713,18714,18715,18716,18717,18718,18719,18720,18721,18722,18723,18724,18725,18726,18727,18728,18729,18730,18731,18732,18733,18734,18735,18736,18737,18738,18739,18740,18741,18742,18743,18744,18745,18746,18747,18748,18749,18750,18751,18752,18753,18754,18755,18756,18757,18758,18759,18760,18761,18762,18763,18764,18765,18766,18767,18768,18769,18770,18771,18772,18773,18774,18775,18776,18777,18778,18779,18780,18781,18782,18783,18784,18785,18786,18787,18788,18789,18790,18791,18792,18793,18794,18795,18796,18797,18798,18799,18800,18801,18802,18803,18804,18805,18806,18807,18808,18809,18810,18811,18812,18813,18814,18815,18816,18817,18818,18819,18820,18821,18822,18823,18824,18825,18826,18827,18828,18829,18830,18831,18832,18833,18834,18835,18836,18837,18838,18839,18840,18841,18842,18843,18844,18845,18846,18847,18848,18849,18850,18851,18852,18853,18854,18855,18856,18857,18858,18859,18860,18861,18862,18863,18864,18865,18866,18867,18868,18869,18870,18871,18872,18873,18874,18875,18876,18877,18878,18879,18880,18881,18882,18883,18884,18885,18886,18887,18888,18889,18890,18891,18892,18893,18894,18895,18896,18897,18898,18899,18900,18901,18902,18903,18904,18905,18906,18907,18908,18909,18910,18911,18912,18913,18914,18915,18916,18917,18918,18919,18920,18921,18922,18923,18924,18925,18926,18927,18928,18929,18930,18931,18932,18933,18934,18935,18936,18937,18938,18939,18940,18941,18942,18943,18944,18945,18946,18947,18948,18949,18950,18951,18952,18953,18954,18955,18956,18957,18958,18959,18960,18961,18962,18963,18964,18965,18966,18967,18968,18969,18970,18971,18972,18973,18974,18975,18976,18977,18978,18979,18980,18981,18982,18983,18984,18985,18986,18987,18988,18989,18990,18991,18992,18993,18994,18995,18996,18997,18998,18999,19000,19001,19002,19003,19004,19005,19006,19007,19008,19009,19010,19011,19012,19013,19014,19015,19016,19017,19018,19019,19020,19021,19022,19023,19024,19025,19026,19027,19028,19029,19030,19031,19032,19033,19034,19035,19036,19037,19038,19039,19040,19041,19042,19043,19044,19045,19046,19047,19048,19049,19050,19051,19052,19053,19054,19055,19056,19057,19058,19059,19060,19061,19062,19063,19064,19065,19066,19067,19068,19069,19070,19071,19072,19073,19074,19075,19076,19077,19078,19079,19080,19081,19082,19083,19084,19085,19086,19087,19088,19089,19090,19091,19092,19093,19094,19095,19096,19097,19098,19099,19100,19101,19102,19103,19104,19105,19106,19107,19108,19109,19110,19111,19112,19113,19114,19115,19116,19117,19118,19119,19120,19121,19122,19123,19124,19125,19126,19127,19128,19129,19130,19131,19132,19133,19134,19135,19136,19137,19138,19139,19140,19141,19142,19143,19144,19145,19146,19147,19148,19149,19150,19151,19152,19153,19154,19155,19156,19157,19158,19159,19160,19161,19162,19163,19164,19165,19166,19167,19168,19169,19170,19171,19172,19173,19174,19175,19176,19177,19178,19179,19180,19181,19182,19183,19184,19185,19186,19187,19188,19189,19190,19191,19192,19193,19194,19195,19196,19197,19198,19199,19200,19201,19202,19203,19204,19205,19206,19207,19208,19209,19210,19211,19212,19213,19214,19215,19216,19217,19218,19219,19220,19221,19222,19223,19224,19225,19226,19227,19228,19229,19230,19231,19232,19233,19234,19235,19236,19237,19238,19239,19240,19241,19242,19243,19244,19245,19246,19247,19248,19249,19250,19251,19252,19253,19254,19255,19256,19257,19258,19259,19260,19261,19262,19263,19264,19265,19266,19267,19268,19269,19270,19271,19272,19273,19274,19275,19276,19277,19278,19279,19280,19281,19282,19283,19284,19285,19286,19287,19288,19289,19290,19291,19292,19293,19294,19295,19296,19297,19298,19299,19300,19301,19302,19303,19304,19305,19306,19307,19308,19309,19310,19311,19312,19313,19314,19315,19316,19317,19318,19319,19320,19321,19322,19323,19324,19325,19326,19327,19328,19329,19330,19331,19332,19333,19334,19335,19336,19337,19338,19339,19340,19341,19342,19343,19344,19345,19346,19347,19348,19349,19350,19351,19352,19353,19354,19355,19356,19357,19358,19359,19360,19361,19362,19363,19364,19365,19366,19367,19368,19369,19370,19371,19372,19373,19374,19375,19376,19377,19378,19379,19380,19381,19382,19383,19384,19385,19386,19387,19388,19389,19390,19391,19392,19393,19394,19395,19396,19397,19398,19399,19400,19401,19402,19403,19404,19405,19406,19407,19408,19409,19410,19411,19412,19413,19414,19415,19416,19417,19418,19419,19420,19421,19422,19423,19424,19425,19426,19427,19428,19429,19430,19431,19432,19433,19434,19435,19436,19437,19438,19439,19440,19441,19442,19443,19444,19445,19446,19447,19448,19449,19450,19451,19452,19453,19454,19455,19456,19457,19458,19459,19460,19461,19462,19463,19464,19465,19466,19467,19468,19469,19470,19471,19472,19473,19474,19475,19476,19477,19478,19479,19480,19481,19482,19483,19484,19485,19486,19487,19488,19489,19490,19491,19492,19493,19494,19495,19496,19497,19498,19499,19500,19501,19502,19503,19504,19505,19506,19507,19508,19509,19510,19511,19512,19513,19514,19515,19516,19517,19518,19519,19520,19521,19522,19523,19524,19525,19526,19527,19528,19529,19530,19531,19532,19533,19534,19535,19536,19537,19538,19539,19540,19541,19542,19543,19544,19545,19546,19547,19548,19549,19550,19551,19552,19553,19554,19555,19556,19557,19558,19559,19560,19561,19562,19563,19564,19565,19566,19567,19568,19569,19570,19571,19572,19573,19574,19575,19576,19577,19578,19579,19580,19581,19582,19583,19584,19585,19586,19587,19588,19589,19590,19591,19592,19593,19594,19595,19596,19597,19598,19599,19600,19601,19602,19603,19604,19605,19606,19607,19608,19609,19610,19611,19612,19613,19614,19615,19616,19617,19618,19619,19620,19621,19622,19623,19624,19625,19626,19627,19628,19629,19630,19631,19632,19633,19634,19635,19636,19637,19638,19639,19640,19641,19642,19643,19644,19645,19646,19647,19648,19649,19650,19651,19652,19653,19654,19655,19656,19657,19658,19659,19660,19661,19662,19663,19664,19665,19666,19667,19668,19669,19670,19671,19672,19673,19674,19675,19676,19677,19678,19679,19680,19681,19682,19683,19684,19685,19686,19687,19688,19689,19690,19691,19692,19693,19694,19695,19696,19697,19698,19699,19700,19701,19702,19703,19704,19705,19706,19707,19708,19709,19710,19711,19712,19713,19714,19715,19716,19717,19718,19719,19720,19721,19722,19723,19724,19725,19726,19727,19728,19729,19730,19731,19732,19733,19734,19735,19736,19737,19738,19739,19740,19741,19742,19743,19744,19745,19746,19747,19748,19749,19750,19751,19752,19753,19754,19755,19756,19757,19758,19759,19760,19761,19762,19763,19764,19765,19766,19767,19768,19769,19770,19771,19772,19773,19774,19775,19776,19777,19778,19779,19780,19781,19782,19783,19784,19785,19786,19787,19788,19789,19790,19791,19792,19793,19794,19795,19796,19797,19798,19799,19800,19801,19802,19803,19804,19805,19806,19807,19808,19809,19810,19811,19812,19813,19814,19815,19816,19817,19818,19819,19820,19821,19822,19823,19824,19825,19826,19827,19828,19829,19830,19831,19832,19833,19834,19835,19836,19837,19838,19839,19840,19841,19842,19843,19844,19845,19846,19847,19848,19849,19850,19851,19852,19853,19854,19855,19856,19857,19858,19859,19860,19861,19862,19863,19864,19865,19866,19867,19868,19869,19870,19871,19872,19873,19874,19875,19876,19877,19878,19879,19880,19881,19882,19883,19884,19885,19886,19887,19888,19889,19890,19891,19892,19893,19894,19895,19896,19897,19898,19899,19900,19901,19902,19903,19904,19905,19906,19907,19908,19909,19910,19911,19912,19913,19914,19915,19916,19917,19918,19919,19920,19921,19922,19923,19924,19925,19926,19927,19928,19929,19930,19931,19932,19933,19934,19935,19936,19937,19938,19939,19940,19941,19942,19943,19944,19945,19946,19947,19948,19949,19950,19951,19952,19953,19954,19955,19956,19957,19958,19959,19960,19961,19962,19963,19964,19965,19966,19967,19968,19969,19970,19971,19972,19973,19974,19975,19976,19977,19978,19979,19980,19981,19982,19983,19984,19985,19986,19987,19988,19989,19990,19991,19992,19993,19994,19995,19996,19997,19998,19999,20000,20001,20002,20003,20004,20005,20006,20007,20008,20009,20010,20011,20012,20013,20014,20015,20016,20017,20018,20019,20020,20021,20022,20023,20024,20025,20026,20027,20028,20029,20030,20031,20032,20033,20034,20035,20036,20037,20038,20039,20040,20041,20042,20043,20044,20045,20046,20047,20048,20049,20050,20051,20052,20053,20054,20055,20056,20057,20058,20059,20060,20061,20062,20063,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077,20078,20079,20080,20081,20082,20083,20084,20085,20086,20087,20088,20089,20090,20091,20092,20093,20094,20095,20096,20097,20098,20099,20100,20101,20102,20103,20104,20105,20106,20107,20108,20109,20110,20111,20112,20113,20114,20115,20116,20117,20118,20119,20120,20121,20122,20123,20124,20125,20126,20127,20128,20129,20130,20131,20132,20133,20134,20135,20136,20137,20138,20139,20140,20141,20142,20143,20144,20145,20146,20147,20148,20149,20150,20151,20152,20153,20154,20155,20156,20157,20158,20159,20160,20161,20162,20163,20164,20165,20166,20167,20168,20169,20170,20171,20172,20173,20174,20175,20176,20177,20178,20179,20180,20181,20182,20183,20184,20185,20186,20187,20188,20189,20190,20191,20192,20193,20194,20195,20196,20197,20198,20199,20200,20201,20202,20203,20204,20205,20206,20207,20208,20209,20210,20211,20212,20213,20214,20215,20216,20217,20218,20219,20220,20221,20222,20223,20224,20225,20226,20227,20228,20229,20230,20231,20232,20233,20234,20235,20236,20237,20238,20239,20240,20241,20242,20243,20244,20245,20246,20247,20248,20249,20250,20251,20252,20253,20254,20255,20256,20257,20258,20259,20260,20261,20262,20263,20264,20265,20266,20267,20268,20269,20270,20271,20272,20273,20274,20275,20276,20277,20278,20279,20280,20281,20282,20283,20284,20285,20286,20287,20288,20289,20290,20291,20292,20293,20294,20295,20296,20297,20298,20299,20300,20301,20302,20303,20304,20305,20306,20307,20308,20309,20310,20311,20312,20313,20314,20315,20316,20317,20318,20319,20320,20321,20322,20323,20324,20325,20326,20327,20328,20329,20330,20331,20332,20333,20334,20335,20336,20337,20338,20339,20340,20341,20342,20343,20344,20345,20346,20347,20348,20349,20350,20351,20352,20353,20354,20355,20356,20357,20358,20359,20360,20361,20362,20363,20364,20365,20366,20367,20368,20369,20370,20371,20372,20373,20374,20375,20376,20377,20378,20379,20380,20381,20382,20383,20384,20385,20386,20387,20388,20389,20390,20391,20392,20393,20394,20395,20396,20397,20398,20399,20400,20401,20402,20403,20404,20405,20406,20407,20408,20409,20410,20411,20412,20413,20414,20415,20416,20417,20418,20419,20420,20421,20422,20423,20424,20425,20426,20427,20428,20429,20430,20431,20432,20433,20434,20435,20436,20437,20438,20439,20440,20441,20442,20443,20444,20445,20446,20447,20448,20449,20450,20451,20452,20453,20454,20455,20456,20457,20458,20459,20460,20461,20462,20463,20464,20465,20466,20467,20468,20469,20470,20471,20472,20473,20474,20475,20476,20477,20478,20479,20480,20481,20482,20483,20484,20485,20486,20487,20488,20489,20490,20491,20492,20493,20494,20495,20496,20497,20498,20499,20500,20501,20502,20503,20504,20505,20506,20507,20508,20509,20510,20511,20512,20513,20514,20515,20516,20517,20518,20519,20520,20521,20522,20523,20524,20525,20526,20527,20528,20529,20530,20531,20532,20533,20534,20535,20536,20537,20538,20539,20540,20541,20542,20543,20544,20545,20546,20547,20548,20549,20550,20551,20552,20553,20554,20555,20556,20557,20558,20559,20560,20561,20562,20563,20564,20565,20566,20567,20568,20569,20570,20571,20572,20573,20574,20575,20576,20577,20578,20579,20580,20581,20582,20583,20584,20585,20586,20587,20588,20589,20590,20591,20592,20593,20594,20595,20596,20597,20598,20599,20600,20601,20602,20603,20604,20605,20606,20607,20608,20609,20610,20611,20612,20613,20614,20615,20616,20617,20618,20619,20620,20621,20622,20623,20624,20625,20626,20627,20628,20629,20630,20631,20632,20633,20634,20635,20636,20637,20638,20639,20640,20641,20642,20643,20644,20645,20646,20647,20648,20649,20650,20651,20652,20653,20654,20655,20656,20657,20658,20659,20660,20661,20662,20663,20664,20665,20666,20667,20668,20669,20670,20671,20672,20673,20674,20675,20676,20677,20678,20679,20680,20681,20682,20683,20684,20685,20686,20687,20688,20689,20690,20691,20692,20693,20694,20695,20696,20697,20698,20699,20700,20701,20702,20703,20704,20705,20706,20707,20708,20709,20710,20711,20712,20713,20714,20715,20716,20717,20718,20719,20720,20721,20722,20723,20724,20725,20726,20727,20728,20729,20730,20731,20732,20733,20734,20735,20736,20737,20738,20739,20740,20741,20742,20743,20744,20745,20746,20747,20748,20749,20750,20751,20752,20753,20754,20755,20756,20757,20758,20759,20760,20761,20762,20763,20764,20765,20766,20767,20768,20769,20770,20771,20772,20773,20774,20775,20776,20777,20778,20779,20780,20781,20782,20783,20784,20785,20786,20787,20788,20789,20790,20791,20792,20793,20794,20795,20796,20797,20798,20799,20800,20801,20802,20803,20804,20805,20806,20807,20808,20809,20810,20811,20812,20813,20814,20815,20816,20817,20818,20819,20820,20821,20822,20823,20824,20825,20826,20827,20828,20829,20830,20831,20832,20833,20834,20835,20836,20837,20838,20839,20840,20841,20842,20843,20844,20845,20846,20847,20848,20849,20850,20851,20852,20853,20854,20855,20856,20857,20858,20859,20860,20861,20862,20863,20864,20865,20866,20867,20868,20869,20870,20871,20872,20873,20874,20875,20876,20877,20878,20879,20880,20881,20882,20883,20884,20885,20886,20887,20888,20889,20890,20891,20892,20893,20894,20895,20896,20897,20898,20899,20900,20901,20902,20903,20904,20905,20906,20907,20908,20909,20910,20911,20912,20913,20914,20915,20916,20917,20918,20919,20920,20921,20922,20923,20924,20925,20926,20927,20928,20929,20930,20931,20932,20933,20934,20935,20936,20937,20938,20939,20940,20941,20942,20943,20944,20945,20946,20947,20948,20949,20950,20951,20952,20953,20954,20955,20956,20957,20958,20959,20960,20961,20962,20963,20964,20965,20966,20967,20968,20969,20970,20971,20972,20973,20974,20975,20976,20977,20978,20979,20980,20981,20982,20983,20984,20985,20986,20987,20988,20989,20990,20991,20992,20993,20994,20995,20996,20997,20998,20999,21000,21001,21002,21003,21004,21005,21006,21007,21008,21009,21010,21011,21012,21013,21014,21015,21016,21017,21018,21019,21020,21021,21022,21023,21024,21025,21026,21027,21028,21029,21030,21031,21032,21033,21034,21035,21036,21037,21038,21039,21040,21041,21042,21043,21044,21045,21046,21047,21048,21049,21050,21051,21052,21053,21054,21055,21056,21057,21058,21059,21060,21061,21062,21063,21064,21065,21066,21067,21068,21069,21070,21071,21072,21073,21074,21075,21076,21077,21078,21079,21080,21081,21082,21083,21084,21085,21086,21087,21088,21089,21090,21091,21092,21093,21094,21095,21096,21097,21098,21099,21100,21101,21102,21103,21104,21105,21106,21107,21108,21109,21110,21111,21112,21113,21114,21115,21116,21117,21118,21119,21120,21121,21122,21123,21124,21125,21126,21127,21128,21129,21130,21131,21132,21133,21134,21135,21136,21137,21138,21139,21140,21141,21142,21143,21144,21145,21146,21147,21148,21149,21150,21151,21152,21153,21154,21155,21156,21157,21158,21159,21160,21161,21162,21163,21164,21165,21166,21167,21168,21169,21170,21171,21172,21173,21174,21175,21176,21177,21178,21179,21180,21181,21182,21183,21184,21185,21186,21187,21188,21189,21190,21191,21192,21193,21194,21195,21196,21197,21198,21199,21200,21201,21202,21203,21204,21205,21206,21207,21208,21209,21210,21211,21212,21213,21214,21215,21216,21217,21218,21219,21220,21221,21222,21223,21224,21225,21226,21227,21228,21229,21230,21231,21232,21233,21234,21235,21236,21237,21238,21239,21240,21241,21242,21243,21244,21245,21246,21247,21248,21249,21250,21251,21252,21253,21254,21255,21256,21257,21258,21259,21260,21261,21262,21263,21264,21265,21266,21267,21268,21269,21270,21271,21272,21273,21274,21275,21276,21277,21278,21279,21280,21281,21282,21283,21284,21285,21286,21287,21288,21289,21290,21291,21292,21293,21294,21295,21296,21297,21298,21299,21300,21301,21302,21303,21304,21305,21306,21307,21308,21309,21310,21311,21312,21313,21314,21315,21316,21317,21318,21319,21320,21321,21322,21323,21324,21325,21326,21327,21328,21329,21330,21331,21332,21333,21334,21335,21336,21337,21338,21339,21340,21341,21342,21343,21344,21345,21346,21347,21348,21349,21350,21351,21352,21353,21354,21355,21356,21357,21358,21359,21360,21361,21362,21363,21364,21365,21366,21367,21368,21369,21370,21371,21372,21373,21374,21375,21376,21377,21378,21379,21380,21381,21382,21383,21384,21385,21386,21387,21388,21389,21390,21391,21392,21393,21394,21395,21396,21397,21398,21399,21400,21401,21402,21403,21404,21405,21406,21407,21408,21409,21410,21411,21412,21413,21414,21415,21416,21417,21418,21419,21420,21421,21422,21423,21424,21425,21426,21427,21428,21429,21430,21431,21432,21433,21434,21435,21436,21437,21438,21439,21440,21441,21442,21443,21444,21445,21446,21447,21448,21449,21450,21451,21452,21453,21454,21455,21456,21457,21458,21459,21460,21461,21462,21463,21464,21465,21466,21467,21468,21469,21470,21471,21472,21473,21474,21475,21476,21477,21478,21479,21480,21481,21482,21483,21484,21485,21486,21487,21488,21489,21490,21491,21492,21493,21494,21495,21496,21497,21498,21499,21500,21501,21502,21503,21504,21505,21506,21507,21508,21509,21510,21511,21512,21513,21514,21515,21516,21517,21518,21519,21520,21521,21522,21523,21524,21525,21526,21527,21528,21529,21530,21531,21532,21533,21534,21535,21536,21537,21538,21539,21540,21541,21542,21543,21544,21545,21546,21547,21548,21549,21550,21551,21552,21553,21554,21555,21556,21557,21558,21559,21560,21561,21562,21563,21564,21565,21566,21567,21568,21569,21570,21571,21572,21573,21574,21575,21576,21577,21578,21579,21580,21581,21582,21583,21584,21585,21586,21587,21588,21589,21590,21591,21592,21593,21594,21595,21596,21597,21598,21599,21600,21601,21602,21603,21604,21605,21606,21607,21608,21609,21610,21611,21612,21613,21614,21615,21616,21617,21618,21619,21620,21621,21622,21623,21624,21625,21626,21627,21628,21629,21630,21631,21632,21633,21634,21635,21636,21637,21638,21639,21640,21641,21642,21643,21644,21645,21646,21647,21648,21649,21650,21651,21652,21653,21654,21655,21656,21657,21658,21659,21660,21661,21662,21663,21664,21665,21666,21667,21668,21669,21670,21671,21672,21673,21674,21675,21676,21677,21678,21679,21680,21681,21682,21683,21684,21685,21686,21687,21688,21689,21690,21691,21692,21693,21694,21695,21696,21697,21698,21699,21700,21701,21702,21703,21704,21705,21706,21707,21708,21709,21710,21711,21712,21713,21714,21715,21716,21717,21718,21719,21720,21721,21722,21723,21724,21725,21726,21727,21728,21729,21730,21731,21732,21733,21734,21735,21736,21737,21738,21739,21740,21741,21742,21743,21744,21745,21746,21747,21748,21749,21750,21751,21752,21753,21754,21755,21756,21757,21758,21759,21760,21761,21762,21763,21764,21765,21766,21767,21768,21769,21770,21771,21772,21773,21774,21775,21776,21777,21778,21779,21780,21781,21782,21783,21784,21785,21786,21787,21788,21789,21790,21791,21792,21793,21794,21795,21796,21797,21798,21799,21800,21801,21802,21803,21804,21805,21806,21807,21808,21809,21810,21811,21812,21813,21814,21815,21816,21817,21818,21819,21820,21821,21822,21823,21824,21825,21826,21827,21828,21829,21830,21831,21832,21833,21834,21835,21836,21837,21838,21839,21840,21841,21842,21843,21844,21845,21846,21847,21848,21849,21850,21851,21852,21853,21854,21855,21856,21857,21858,21859,21860,21861,21862,21863,21864,21865,21866,21867,21868,21869,21870,21871,21872,21873,21874,21875,21876,21877,21878,21879,21880,21881,21882,21883,21884,21885,21886,21887,21888,21889,21890,21891,21892,21893,21894,21895,21896,21897,21898,21899,21900,21901,21902,21903,21904,21905,21906,21907,21908,21909,21910,21911,21912,21913,21914,21915,21916,21917,21918,21919,21920,21921,21922,21923,21924,21925,21926,21927,21928,21929,21930,21931,21932,21933,21934,21935,21936,21937,21938,21939,21940,21941,21942,21943,21944,21945,21946,21947,21948,21949,21950,21951,21952,21953,21954,21955,21956,21957,21958,21959,21960,21961,21962,21963,21964,21965,21966,21967,21968,21969,21970,21971,21972,21973,21974,21975,21976,21977,21978,21979,21980,21981,21982,21983,21984,21985,21986,21987,21988,21989,21990,21991,21992,21993,21994,21995,21996,21997,21998,21999,22000,22001,22002,22003,22004,22005,22006,22007,22008,22009,22010,22011,22012,22013,22014,22015,22016,22017,22018,22019,22020,22021,22022,22023,22024,22025,22026,22027,22028,22029,22030,22031,22032,22033,22034,22035,22036,22037,22038,22039,22040,22041,22042,22043,22044,22045,22046,22047,22048,22049,22050,22051,22052,22053,22054,22055,22056,22057,22058,22059,22060,22061,22062,22063,22064,22065,22066,22067,22068,22069,22070,22071,22072,22073,22074,22075,22076,22077,22078,22079,22080,22081,22082,22083,22084,22085,22086,22087,22088,22089,22090,22091,22092,22093,22094,22095,22096,22097,22098,22099,22100,22101,22102,22103,22104,22105,22106,22107,22108,22109,22110,22111,22112,22113,22114,22115,22116,22117,22118,22119,22120,22121,22122,22123,22124,22125,22126,22127,22128,22129,22130,22131,22132,22133,22134,22135,22136,22137,22138,22139,22140,22141,22142,22143,22144,22145,22146,22147,22148,22149,22150,22151,22152,22153,22154,22155,22156,22157,22158,22159,22160,22161,22162,22163,22164,22165,22166,22167,22168,22169,22170,22171,22172,22173,22174,22175,22176,22177,22178,22179,22180,22181,22182,22183,22184,22185,22186,22187,22188,22189,22190,22191,22192,22193,22194,22195,22196,22197,22198,22199,22200,22201,22202,22203,22204,22205,22206,22207,22208,22209,22210,22211,22212,22213,22214,22215,22216,22217,22218,22219,22220,22221,22222,22223,22224,22225,22226,22227,22228,22229,22230,22231,22232,22233,22234,22235,22236,22237,22238,22239,22240,22241,22242,22243,22244,22245,22246,22247,22248,22249,22250,22251,22252,22253,22254,22255,22256,22257,22258,22259,22260,22261,22262,22263,22264,22265,22266,22267,22268,22269,22270,22271,22272,22273,22274,22275,22276,22277,22278,22279,22280,22281,22282,22283,22284,22285,22286,22287,22288,22289,22290,22291,22292,22293,22294,22295,22296,22297,22298,22299,22300,22301,22302,22303,22304,22305,22306,22307,22308,22309,22310,22311,22312,22313,22314,22315,22316,22317,22318,22319,22320,22321,22322,22323,22324,22325,22326,22327,22328,22329,22330,22331,22332,22333,22334,22335,22336,22337,22338,22339,22340,22341,22342,22343,22344,22345,22346,22347,22348,22349,22350,22351,22352,22353,22354,22355,22356,22357,22358,22359,22360,22361,22362,22363,22364,22365,22366,22367,22368,22369,22370,22371,22372,22373,22374,22375,22376,22377,22378,22379,22380,22381,22382,22383,22384,22385,22386,22387,22388,22389,22390,22391,22392,22393,22394,22395,22396,22397,22398,22399,22400,22401,22402,22403,22404,22405,22406,22407,22408,22409,22410,22411,22412,22413,22414,22415,22416,22417,22418,22419,22420,22421,22422,22423,22424,22425,22426,22427,22428,22429,22430,22431,22432,22433,22434,22435,22436,22437,22438,22439,22440,22441,22442,22443,22444,22445,22446,22447,22448,22449,22450,22451,22452,22453,22454,22455,22456,22457,22458,22459,22460,22461,22462,22463,22464,22465,22466,22467,22468,22469,22470,22471,22472,22473,22474,22475,22476,22477,22478,22479,22480,22481,22482,22483,22484,22485,22486,22487,22488,22489,22490,22491,22492,22493,22494,22495,22496,22497,22498,22499,22500,22501,22502,22503,22504,22505,22506,22507,22508,22509,22510,22511,22512,22513,22514,22515,22516,22517,22518,22519,22520,22521,22522,22523,22524,22525,22526,22527,22528,22529,22530,22531,22532,22533,22534,22535,22536,22537,22538,22539,22540,22541,22542,22543,22544,22545,22546,22547,22548,22549,22550,22551,22552,22553,22554,22555,22556,22557,22558,22559,22560,22561,22562,22563,22564,22565,22566,22567,22568,22569,22570,22571,22572,22573,22574,22575,22576,22577,22578,22579,22580,22581,22582,22583,22584,22585,22586,22587,22588,22589,22590,22591,22592,22593,22594,22595,22596,22597,22598,22599,22600,22601,22602,22603,22604,22605,22606,22607,22608,22609,22610,22611,22612,22613,22614,22615,22616,22617,22618,22619,22620,22621,22622,22623,22624,22625,22626,22627,22628,22629,22630,22631,22632,22633,22634,22635,22636,22637,22638,22639,22640,22641,22642,22643,22644,22645,22646,22647,22648,22649,22650,22651,22652,22653,22654,22655,22656,22657,22658,22659,22660,22661,22662,22663,22664,22665,22666,22667,22668,22669,22670,22671,22672,22673,22674,22675,22676,22677,22678,22679,22680,22681,22682,22683,22684,22685,22686,22687,22688,22689,22690,22691,22692,22693,22694,22695,22696,22697,22698,22699,22700,22701,22702,22703,22704,22705,22706,22707,22708,22709,22710,22711,22712,22713,22714,22715,22716,22717,22718,22719,22720,22721,22722,22723,22724,22725,22726,22727,22728,22729,22730,22731,22732,22733,22734,22735,22736,22737,22738,22739,22740,22741,22742,22743,22744,22745,22746,22747,22748,22749,22750,22751,22752,22753,22754,22755,22756,22757,22758,22759,22760,22761,22762,22763,22764,22765,22766,22767,22768,22769,22770,22771,22772,22773,22774,22775,22776,22777,22778,22779,22780,22781,22782,22783,22784,22785,22786,22787,22788,22789,22790,22791,22792,22793,22794,22795,22796,22797,22798,22799,22800,22801,22802,22803,22804,22805,22806,22807,22808,22809,22810,22811,22812,22813,22814,22815,22816,22817,22818,22819,22820,22821,22822,22823,22824,22825,22826,22827,22828,22829,22830,22831,22832,22833,22834,22835,22836,22837,22838,22839,22840,22841,22842,22843,22844,22845,22846,22847,22848,22849,22850,22851,22852,22853,22854,22855,22856,22857,22858,22859,22860,22861,22862,22863,22864,22865,22866,22867,22868,22869,22870,22871,22872,22873,22874,22875,22876,22877,22878,22879,22880,22881,22882,22883,22884,22885,22886,22887,22888,22889,22890,22891,22892,22893,22894,22895,22896,22897,22898,22899,22900,22901,22902,22903,22904,22905,22906,22907,22908,22909,22910,22911,22912,22913,22914,22915,22916,22917,22918,22919,22920,22921,22922,22923,22924,22925,22926,22927,22928,22929,22930,22931,22932,22933,22934,22935,22936,22937,22938,22939,22940,22941,22942,22943,22944,22945,22946,22947,22948,22949,22950,22951,22952,22953,22954,22955,22956,22957,22958,22959,22960,22961,22962,22963,22964,22965,22966,22967,22968,22969,22970,22971,22972,22973,22974,22975,22976,22977,22978,22979,22980,22981,22982,22983,22984,22985,22986,22987,22988,22989,22990,22991,22992,22993,22994,22995,22996,22997,22998,22999,23000,23001,23002,23003,23004,23005,23006,23007,23008,23009,23010,23011,23012,23013,23014,23015,23016,23017,23018,23019,23020,23021,23022,23023,23024,23025,23026,23027,23028,23029,23030,23031,23032,23033,23034,23035,23036,23037,23038,23039,23040,23041,23042,23043,23044,23045,23046,23047,23048,23049,23050,23051,23052,23053,23054,23055,23056,23057,23058,23059,23060,23061,23062,23063,23064,23065,23066,23067,23068,23069,23070,23071,23072,23073,23074,23075,23076,23077,23078,23079,23080,23081,23082,23083,23084,23085,23086,23087,23088,23089,23090,23091,23092,23093,23094,23095,23096,23097,23098,23099,23100,23101,23102,23103,23104,23105,23106,23107,23108,23109,23110,23111,23112,23113,23114,23115,23116,23117,23118,23119,23120,23121,23122,23123,23124,23125,23126,23127,23128,23129,23130,23131,23132,23133,23134,23135,23136,23137,23138,23139,23140,23141,23142,23143,23144,23145,23146,23147,23148,23149,23150,23151,23152,23153,23154,23155,23156,23157,23158,23159,23160,23161,23162,23163,23164,23165,23166,23167,23168,23169,23170,23171,23172,23173,23174,23175,23176,23177,23178,23179,23180,23181,23182,23183,23184,23185,23186,23187,23188,23189,23190,23191,23192,23193,23194,23195,23196,23197,23198,23199,23200,23201,23202,23203,23204,23205,23206,23207,23208,23209,23210,23211,23212,23213,23214,23215,23216,23217,23218,23219,23220,23221,23222,23223,23224,23225,23226,23227,23228,23229,23230,23231,23232,23233,23234,23235,23236,23237,23238,23239,23240,23241,23242,23243,23244,23245,23246,23247,23248,23249,23250,23251,23252,23253,23254,23255,23256,23257,23258,23259,23260,23261,23262,23263,23264,23265,23266,23267,23268,23269,23270,23271,23272,23273,23274,23275,23276,23277,23278,23279,23280,23281,23282,23283,23284,23285,23286,23287,23288,23289,23290,23291,23292,23293,23294,23295,23296,23297,23298,23299,23300,23301,23302,23303,23304,23305,23306,23307,23308,23309,23310,23311,23312,23313,23314,23315,23316,23317,23318,23319,23320,23321,23322,23323,23324,23325,23326,23327,23328,23329,23330,23331,23332,23333,23334,23335,23336,23337,23338,23339,23340,23341,23342,23343,23344,23345,23346,23347,23348,23349,23350,23351,23352,23353,23354,23355,23356,23357,23358,23359,23360,23361,23362,23363,23364,23365,23366,23367,23368,23369,23370,23371,23372,23373,23374,23375,23376,23377,23378,23379,23380,23381,23382,23383,23384,23385,23386,23387,23388,23389,23390,23391,23392,23393,23394,23395,23396,23397,23398,23399,23400,23401,23402,23403,23404,23405,23406,23407,23408,23409,23410,23411,23412,23413,23414,23415,23416,23417,23418,23419,23420,23421,23422,23423,23424,23425,23426,23427,23428,23429,23430,23431,23432,23433,23434,23435,23436,23437,23438,23439,23440,23441,23442,23443,23444,23445,23446,23447,23448,23449,23450,23451,23452,23453,23454,23455,23456,23457,23458,23459,23460,23461,23462,23463,23464,23465,23466,23467,23468,23469,23470,23471,23472,23473,23474,23475,23476,23477,23478,23479,23480,23481,23482,23483,23484,23485,23486,23487,23488,23489,23490,23491,23492,23493,23494,23495,23496,23497,23498,23499,23500,23501,23502,23503,23504,23505,23506,23507,23508,23509,23510,23511,23512,23513,23514,23515,23516,23517,23518,23519,23520,23521,23522,23523,23524,23525,23526,23527,23528,23529,23530,23531,23532,23533,23534,23535,23536,23537,23538,23539,23540,23541,23542,23543,23544,23545,23546,23547,23548,23549,23550,23551,23552,23553,23554,23555,23556,23557,23558,23559,23560,23561,23562,23563,23564,23565,23566,23567,23568,23569,23570,23571,23572,23573,23574,23575,23576,23577,23578,23579,23580,23581,23582,23583,23584,23585,23586,23587,23588,23589,23590,23591,23592,23593,23594,23595,23596,23597,23598,23599,23600,23601,23602,23603,23604,23605,23606,23607,23608,23609,23610,23611,23612,23613,23614,23615,23616,23617,23618,23619,23620,23621,23622,23623,23624,23625,23626,23627,23628,23629,23630,23631,23632,23633,23634,23635,23636,23637,23638,23639,23640,23641,23642,23643,23644,23645,23646,23647,23648,23649,23650,23651,23652,23653,23654,23655,23656,23657,23658,23659,23660,23661,23662,23663,23664,23665,23666,23667,23668,23669,23670,23671,23672,23673,23674,23675,23676,23677,23678,23679,23680,23681,23682,23683,23684,23685,23686,23687,23688,23689,23690,23691,23692,23693,23694,23695,23696,23697,23698,23699,23700,23701,23702,23703,23704,23705,23706,23707,23708,23709,23710,23711,23712,23713,23714,23715,23716,23717,23718,23719,23720,23721,23722,23723,23724,23725,23726,23727,23728,23729,23730,23731,23732,23733,23734,23735,23736,23737,23738,23739,23740,23741,23742,23743,23744,23745,23746,23747,23748,23749,23750,23751,23752,23753,23754,23755,23756,23757,23758,23759,23760,23761,23762,23763,23764,23765,23766,23767,23768,23769,23770,23771,23772,23773,23774,23775,23776,23777,23778,23779,23780,23781,23782,23783,23784,23785,23786,23787,23788,23789,23790,23791,23792,23793,23794,23795,23796,23797,23798,23799,23800,23801,23802,23803,23804,23805,23806,23807,23808,23809,23810,23811,23812,23813,23814,23815,23816,23817,23818,23819,23820,23821,23822,23823,23824,23825,23826,23827,23828,23829,23830,23831,23832,23833,23834,23835,23836,23837,23838,23839,23840,23841,23842,23843,23844,23845,23846,23847,23848,23849,23850,23851,23852,23853,23854,23855,23856,23857,23858,23859,23860,23861,23862,23863,23864,23865,23866,23867,23868,23869,23870,23871,23872,23873,23874,23875,23876,23877,23878,23879,23880,23881,23882,23883,23884,23885,23886,23887,23888,23889,23890,23891,23892,23893,23894,23895,23896,23897,23898,23899,23900,23901,23902,23903,23904,23905,23906,23907,23908,23909,23910,23911,23912,23913,23914,23915,23916,23917,23918,23919,23920,23921,23922,23923,23924,23925,23926,23927,23928,23929,23930,23931,23932,23933,23934,23935,23936,23937,23938,23939,23940,23941,23942,23943,23944,23945,23946,23947,23948,23949,23950,23951,23952,23953,23954,23955,23956,23957,23958,23959,23960,23961,23962,23963,23964,23965,23966,23967,23968,23969,23970,23971,23972,23973,23974,23975,23976,23977,23978,23979,23980,23981,23982,23983,23984,23985,23986,23987,23988,23989,23990,23991,23992,23993,23994,23995,23996,23997,23998,23999,24000,24001,24002,24003,24004,24005,24006,24007,24008,24009,24010,24011,24012,24013,24014,24015,24016,24017,24018,24019,24020,24021,24022,24023,24024,24025,24026,24027,24028,24029,24030,24031,24032,24033,24034,24035,24036,24037,24038,24039,24040,24041,24042,24043,24044,24045,24046,24047,24048,24049,24050,24051,24052,24053,24054,24055,24056,24057,24058,24059,24060,24061,24062,24063,24064,24065,24066,24067,24068,24069,24070,24071,24072,24073,24074,24075,24076,24077,24078,24079,24080,24081,24082,24083,24084,24085,24086,24087,24088,24089,24090,24091,24092,24093,24094,24095,24096,24097,24098,24099,24100,24101,24102,24103,24104,24105,24106,24107,24108,24109,24110,24111,24112,24113,24114,24115,24116,24117,24118,24119,24120,24121,24122,24123,24124,24125,24126,24127,24128,24129,24130,24131,24132,24133,24134,24135,24136,24137,24138,24139,24140,24141,24142,24143,24144,24145,24146,24147,24148,24149,24150,24151,24152,24153,24154,24155,24156,24157,24158,24159,24160,24161,24162,24163,24164,24165,24166,24167,24168,24169,24170,24171,24172,24173,24174,24175,24176,24177,24178,24179,24180,24181,24182,24183,24184,24185,24186,24187,24188,24189,24190,24191,24192,24193,24194,24195,24196,24197,24198,24199,24200,24201,24202,24203,24204,24205,24206,24207,24208,24209,24210,24211,24212,24213,24214,24215,24216,24217,24218,24219,24220,24221,24222,24223,24224,24225,24226,24227,24228,24229,24230,24231,24232,24233,24234,24235,24236,24237,24238,24239,24240,24241,24242,24243,24244,24245,24246,24247,24248,24249,24250,24251,24252,24253,24254,24255,24256,24257,24258,24259,24260,24261,24262,24263,24264,24265,24266,24267,24268,24269,24270,24271,24272,24273,24274,24275,24276,24277,24278,24279,24280,24281,24282,24283,24284,24285,24286,24287,24288,24289,24290,24291,24292,24293,24294,24295,24296,24297,24298,24299,24300,24301,24302,24303,24304,24305,24306,24307,24308,24309,24310,24311,24312,24313,24314,24315,24316,24317,24318,24319,24320,24321,24322,24323,24324,24325,24326,24327,24328,24329,24330,24331,24332,24333,24334,24335,24336,24337,24338,24339,24340,24341,24342,24343,24344,24345,24346,24347,24348,24349,24350,24351,24352,24353,24354,24355,24356,24357,24358,24359,24360,24361,24362,24363,24364,24365,24366,24367,24368,24369,24370,24371,24372,24373,24374,24375,24376,24377,24378,24379,24380,24381,24382,24383,24384,24385,24386,24387,24388,24389,24390,24391,24392,24393,24394,24395,24396,24397,24398,24399,24400,24401,24402,24403,24404,24405,24406,24407,24408,24409,24410,24411,24412,24413,24414,24415,24416,24417,24418,24419,24420,24421,24422,24423,24424,24425,24426,24427,24428,24429,24430,24431,24432,24433,24434,24435,24436,24437,24438,24439,24440,24441,24442,24443,24444,24445,24446,24447,24448,24449,24450,24451,24452,24453,24454,24455,24456,24457,24458,24459,24460,24461,24462,24463,24464,24465,24466,24467,24468,24469,24470,24471,24472,24473,24474,24475,24476,24477,24478,24479,24480,24481,24482,24483,24484,24485,24486,24487,24488,24489,24490,24491,24492,24493,24494,24495,24496,24497,24498,24499,24500,24501,24502,24503,24504,24505,24506,24507,24508,24509,24510,24511,24512,24513,24514,24515,24516,24517,24518,24519,24520,24521,24522,24523,24524,24525,24526,24527,24528,24529,24530,24531,24532,24533,24534,24535,24536,24537,24538,24539,24540,24541,24542,24543,24544,24545,24546,24547,24548,24549,24550,24551,24552,24553,24554,24555,24556,24557,24558,24559,24560,24561,24562,24563,24564,24565,24566,24567,24568,24569,24570,24571,24572,24573,24574,24575,24576,24577,24578,24579,24580,24581,24582,24583,24584,24585,24586,24587,24588,24589,24590,24591,24592,24593,24594,24595,24596,24597,24598,24599,24600,24601,24602,24603,24604,24605,24606,24607,24608,24609,24610,24611,24612,24613,24614,24615,24616,24617,24618,24619,24620,24621,24622,24623,24624,24625,24626,24627,24628,24629,24630,24631,24632,24633,24634,24635,24636,24637,24638,24639,24640,24641,24642,24643,24644,24645,24646,24647,24648,24649,24650,24651,24652,24653,24654,24655,24656,24657,24658,24659,24660,24661,24662,24663,24664,24665,24666,24667,24668,24669,24670,24671,24672,24673,24674,24675,24676,24677,24678,24679,24680,24681,24682,24683,24684,24685,24686,24687,24688,24689,24690,24691,24692,24693,24694,24695,24696,24697,24698,24699,24700,24701,24702,24703,24704,24705,24706,24707,24708,24709,24710,24711,24712,24713,24714,24715,24716,24717,24718,24719,24720,24721,24722,24723,24724,24725,24726,24727,24728,24729,24730,24731,24732,24733,24734,24735,24736,24737,24738,24739,24740,24741,24742,24743,24744,24745,24746,24747,24748,24749,24750,24751,24752,24753,24754,24755,24756,24757,24758,24759,24760,24761,24762,24763,24764,24765,24766,24767,24768,24769,24770,24771,24772,24773,24774,24775,24776,24777,24778,24779,24780,24781,24782,24783,24784,24785,24786,24787,24788,24789,24790,24791,24792,24793,24794,24795,24796,24797,24798,24799,24800,24801,24802,24803,24804,24805,24806,24807,24808,24809,24810,24811,24812,24813,24814,24815,24816,24817,24818,24819,24820,24821,24822,24823,24824,24825,24826,24827,24828,24829,24830,24831,24832,24833,24834,24835,24836,24837,24838,24839,24840,24841,24842,24843,24844,24845,24846,24847,24848,24849,24850,24851,24852,24853,24854,24855,24856,24857,24858,24859,24860,24861,24862,24863,24864,24865,24866,24867,24868,24869,24870,24871,24872,24873,24874,24875,24876,24877,24878,24879,24880,24881,24882,24883,24884,24885,24886,24887,24888,24889,24890,24891,24892,24893,24894,24895,24896,24897,24898,24899,24900,24901,24902,24903,24904,24905,24906,24907,24908,24909,24910,24911,24912,24913,24914,24915,24916,24917,24918,24919,24920,24921,24922,24923,24924,24925,24926,24927,24928,24929,24930,24931,24932,24933,24934,24935,24936,24937,24938,24939,24940,24941,24942,24943,24944,24945,24946,24947,24948,24949,24950,24951,24952,24953,24954,24955,24956,24957,24958,24959,24960,24961,24962,24963,24964,24965,24966,24967,24968,24969,24970,24971,24972,24973,24974,24975,24976,24977,24978,24979,24980,24981,24982,24983,24984,24985,24986,24987,24988,24989,24990,24991,24992,24993,24994,24995,24996,24997,24998,24999,25000,25001,25002,25003,25004,25005,25006,25007,25008,25009,25010,25011,25012,25013,25014,25015,25016,25017,25018,25019,25020,25021,25022,25023,25024,25025,25026,25027,25028,25029,25030,25031,25032,25033,25034,25035,25036,25037,25038,25039,25040,25041,25042,25043,25044,25045,25046,25047,25048,25049,25050,25051,25052,25053,25054,25055,25056,25057,25058,25059,25060,25061,25062,25063,25064,25065,25066,25067,25068,25069,25070,25071,25072,25073,25074,25075,25076,25077,25078,25079,25080,25081,25082,25083,25084,25085,25086,25087,25088,25089,25090,25091,25092,25093,25094,25095,25096,25097,25098,25099,25100,25101,25102,25103,25104,25105,25106,25107,25108,25109,25110,25111,25112,25113,25114,25115,25116,25117,25118,25119,25120,25121,25122,25123,25124,25125,25126,25127,25128,25129,25130,25131,25132,25133,25134,25135,25136,25137,25138,25139,25140,25141,25142,25143,25144,25145,25146,25147,25148,25149,25150,25151,25152,25153,25154,25155,25156,25157,25158,25159,25160,25161,25162,25163,25164,25165,25166,25167,25168,25169,25170,25171,25172,25173,25174,25175,25176,25177,25178,25179,25180,25181,25182,25183,25184,25185,25186,25187,25188,25189,25190,25191,25192,25193,25194,25195,25196,25197,25198,25199,25200,25201,25202,25203,25204,25205,25206,25207,25208,25209,25210,25211,25212,25213,25214,25215,25216,25217,25218,25219,25220,25221,25222,25223,25224,25225,25226,25227,25228,25229,25230,25231,25232,25233,25234,25235,25236,25237,25238,25239,25240,25241,25242,25243,25244,25245,25246,25247,25248,25249,25250,25251,25252,25253,25254,25255,25256,25257,25258,25259,25260,25261,25262,25263,25264,25265,25266,25267,25268,25269,25270,25271,25272,25273,25274,25275,25276,25277,25278,25279,25280,25281,25282,25283,25284,25285,25286,25287,25288,25289,25290,25291,25292,25293,25294,25295,25296,25297,25298,25299,25300,25301,25302,25303,25304,25305,25306,25307,25308,25309,25310,25311,25312,25313,25314,25315,25316,25317,25318,25319,25320,25321,25322,25323,25324,25325,25326,25327,25328,25329,25330,25331,25332,25333,25334,25335,25336,25337,25338,25339,25340,25341,25342,25343,25344,25345,25346,25347,25348,25349,25350,25351,25352,25353,25354,25355,25356,25357,25358,25359,25360,25361,25362,25363,25364,25365,25366,25367,25368,25369,25370,25371,25372,25373,25374,25375,25376,25377,25378,25379,25380,25381,25382,25383,25384,25385,25386,25387,25388,25389,25390,25391,25392,25393,25394,25395,25396,25397,25398,25399,25400,25401,25402,25403,25404,25405,25406,25407,25408,25409,25410,25411,25412,25413,25414,25415,25416,25417,25418,25419,25420,25421,25422,25423,25424,25425,25426,25427,25428,25429,25430,25431,25432,25433,25434,25435,25436,25437,25438,25439,25440,25441,25442,25443,25444,25445,25446,25447,25448,25449,25450,25451,25452,25453,25454,25455,25456,25457,25458,25459,25460,25461,25462,25463,25464,25465,25466,25467,25468,25469,25470,25471,25472,25473,25474,25475,25476,25477,25478,25479,25480,25481,25482,25483,25484,25485,25486,25487,25488,25489,25490,25491,25492,25493,25494,25495,25496,25497,25498,25499,25500,25501,25502,25503,25504,25505,25506,25507,25508,25509,25510,25511,25512,25513,25514,25515,25516,25517,25518,25519,25520,25521,25522,25523,25524,25525,25526,25527,25528,25529,25530,25531,25532,25533,25534,25535,25536,25537,25538,25539,25540,25541,25542,25543,25544,25545,25546,25547,25548,25549,25550,25551,25552,25553,25554,25555,25556,25557,25558,25559,25560,25561,25562,25563,25564,25565,25566,25567,25568,25569,25570,25571,25572,25573,25574,25575,25576,25577,25578,25579,25580,25581,25582,25583,25584,25585,25586,25587,25588,25589,25590,25591,25592,25593,25594,25595,25596,25597,25598,25599} assert(t[1] == 0) assert(t[25548] == 25547) assert(t[25549] == 25548) assert(t[25550] == 25549) assert(t[25551] == 25550) assert(t[25552] == 25551) assert(t[25600] == 25599)