content stringlengths 5 1.05M |
|---|
-- Copyright 2016 David Thornley <david.thornley@touchstargroup.com>
-- Licensed to the public under the Apache License 2.0.
local map, section, net = ...
local device, apn, pincode, username, password
local auth, ipv6
device = section:taboption("general", Value, "device", translate("Modem device"))
device.rmempty = false
local device_suggestions = nixio.fs.glob("/dev/cdc-wdm*")
if device_suggestions then
local node
for node in device_suggestions do
device:value(node)
end
end
apn = section:taboption("general", Value, "apn", translate("APN"))
pincode = section:taboption("general", Value, "pincode", translate("PIN"))
username = section:taboption("general", Value, "username", translate("PAP/CHAP username"))
password = section:taboption("general", Value, "password", translate("PAP/CHAP password"))
password.password = true
auth = section:taboption("general", Value, "auth", translate("Authentication Type"))
auth:value("", translate("-- Please choose --"))
auth:value("both", "PAP/CHAP (both)")
auth:value("pap", "PAP")
auth:value("chap", "CHAP")
auth:value("none", "NONE")
if luci.model.network:has_ipv6() then
ipv6 = section:taboption("advanced", Flag, "ipv6", translate("Enable IPv6 negotiation"))
ipv6.default = ipv6.disabled
end
pdptype = section:taboption('general', ListValue, 'pdptype', translate('PDP Type'))
pdptype:value('ipv4v6', 'IPv4/IPv6')
pdptype:value('ipv4', 'IPv4')
pdptype:value('ipv6', 'IPv6')
pdptype.default = 'ipv4v6'
|
ReturnRaidManager.Constants = {}
ReturnRaidManager.Constants.ClassColors = {
HUNTER = {r = 0.67, g = 0.83, b = 0.45},
Hunter = {r = 0.67, g = 0.83, b = 0.45},
WARLOCK = {r = 0.58, g = 0.51, b = 0.79},
Warlock = {r = 0.58, g = 0.51, b = 0.79},
PRIEST = {r = 1.0, g = 1.0, b = 1.0},
Priest = {r = 1.0, g = 1.0, b = 1.0},
PALADIN = {r = 0.96, g = 0.55, b = 0.73},
Paladin = {r = 0.96, g = 0.55, b = 0.73},
MAGE = {r = 0.41, g = 0.8, b = 0.94},
Mage = {r = 0.41, g = 0.8, b = 0.94},
ROGUE = {r = 1.0, g = 0.96, b = 0.41},
Rogue = {r = 1.0, g = 0.96, b = 0.41},
DRUID = {r = 1.0, g = 0.49, b = 0.04},
Druid = {r = 1.0, g = 0.49, b = 0.04},
SHAMAN = {r = 0.14, g = 0.35, b = 1.0},
Shaman = {r = 0.14, g = 0.35, b = 1.0},
WARRIOR = {r = 0.78, g = 0.61, b = 0.43},
Warrior = {r = 0.78, g = 0.61, b = 0.43},
} |
local Sideload = require('sconce.Sideload')
return function(tester)
local suite = torch.TestSuite()
function suite.test_sideload_forward()
local get_tensor = function()
return torch.Tensor{2, 2}
end
local input = torch.Tensor{1, 1}
local sideload = Sideload.new(get_tensor)
local actual = sideload:forward(input)
local expected = {torch.Tensor{1, 1}, torch.Tensor{2, 2}}
tester:eq(actual, expected)
end
function suite.test_sideload_backward()
local get_tensor = function()
return torch.Tensor{2, 2}
end
local input = torch.Tensor{1, 1}
local sideload = Sideload.new(get_tensor)
local grad_output = {torch.Tensor{3, 3}, torch.Tensor{4, 4}}
local actual = sideload:backward(input, grad_output)
local expected = torch.Tensor{3, 3}
tester:eq(actual, expected)
end
tester:add(suite)
return suite
end
|
return function()
local isLight = require(script.Parent.isLight)
it("throws if argument is not a Color3", function()
expect(pcall(isLight, true)).to.equal(false)
end)
it("returns `true` for white", function()
expect(isLight(Color3.new(1, 1, 1))).to.equal(true)
end)
it("returns `false` for black", function()
expect(isLight(Color3.new())).to.equal(false)
end)
it("returns `false` for crimson", function()
expect(isLight(Color3.new(.6, 0, 0)))
end)
end
|
--[[
PlayState Class
Author: Colton Ogden
cogden@cs50.harvard.edu
The PlayState class is the bulk of the game, where the player actually controls the bird and
avoids pipes. When the player collides with a pipe, we should go to the GameOver state, where
we then go back to the main menu.
]]
PlayState = Class{__includes = BaseState}
PIPE_SPEED = 60
PIPE_WIDTH = 70
PIPE_HEIGHT = 288
BIRD_WIDTH = 38
BIRD_HEIGHT = 24
function PlayState:init()
self.bird = Bird()
self.pipePairs = {}
self.timer = 0
self.spawnTime = math.random(1.5, 2.5)
self.score = 0
-- initialize our last recorded Y value for a gap placement to base other gaps off of
self.lastY = -PIPE_HEIGHT + math.random(80) + 20
end
function PlayState:update(dt)
-- update timer for pipe spawning
self.timer = self.timer + dt
-- spawn a new pipe pair every second and a half
if self.timer > self.spawnTime then
-- modify the last Y coordinate we placed so pipe gaps aren't too far apart
-- no higher than 10 pixels below the top edge of the screen,
-- and no lower than a gap length (90 pixels) from the bottom
local y = math.max(-PIPE_HEIGHT + 10,
math.min(self.lastY + math.random(-20, 20), VIRTUAL_HEIGHT - 90 - PIPE_HEIGHT))
self.lastY = y
-- add a new pipe pair at the end of the screen at our new Y
table.insert(self.pipePairs, PipePair(y))
-- reset timer
self.timer = 0
self.spawnTime = math.random(1.5, 3)
end
-- for every pair of pipes..
for k, pair in pairs(self.pipePairs) do
-- score a point if the pipe has gone past the bird to the left all the way
-- be sure to ignore it if it's already been scored
if not pair.scored then
if pair.x + PIPE_WIDTH < self.bird.x then
self.score = self.score + 1
pair.scored = true
sounds['score']:play()
end
end
-- update position of pair
pair:update(dt)
end
-- we need this second loop, rather than deleting in the previous loop, because
-- modifying the table in-place without explicit keys will result in skipping the
-- next pipe, since all implicit keys (numerical indices) are automatically shifted
-- down after a table removal
for k, pair in pairs(self.pipePairs) do
if pair.remove then
table.remove(self.pipePairs, k)
end
end
-- simple collision between bird and all pipes in pairs
for k, pair in pairs(self.pipePairs) do
for l, pipe in pairs(pair.pipes) do
if self.bird:collides(pipe) then
sounds['explosion']:play()
sounds['hurt']:play()
gStateMachine:change('score', {
score = self.score
})
end
end
end
-- update bird based on gravity and input
self.bird:update(dt)
-- reset if we get to the ground
if self.bird.y > VIRTUAL_HEIGHT - 15 then
sounds['explosion']:play()
sounds['hurt']:play()
gStateMachine:change('score', {
score = self.score
})
end
end
function PlayState:render()
for k, pair in pairs(self.pipePairs) do
pair:render()
end
love.graphics.setFont(flappyFont)
love.graphics.print('Score: ' .. tostring(self.score), 8, 8)
self.bird:render()
end
--[[
Called when this state is transitioned to from another state.
]]
function PlayState:enter()
-- if we're coming from death, restart scrolling
scrolling = true
end
--[[
Called when this state changes to another state.
]]
function PlayState:exit()
-- stop scrolling for the death/score screen
scrolling = false
end |
local Game_component = {}
function Game_component:new()
local gc = {}
-- callback for love.load()
function gc:load()
end
-- callback for love.update()
function gc:update(dt)
end
-- callback for love.draw()
function gc:draw()
end
return gc
end
return Game_component
|
local response = require("lib.response")
local _M = {}
-- todo controller extends
function _M:index(request)
return response:json(0, 'index args', request.params)
end
return _M
|
local M = {}
local p = require 'polarmutex.colorschemes.tokyodark.palette'
function M.setup()
vim.g.terminal_color_0 = p.black
vim.g.terminal_color_1 = p.red
vim.g.terminal_color_2 = p.green
vim.g.terminal_color_3 = p.yellow
vim.g.terminal_color_4 = p.blue
vim.g.terminal_color_5 = p.purple
vim.g.terminal_color_6 = p.cyan
vim.g.terminal_color_7 = p.fg
vim.g.terminal_color_8 = p.black
vim.g.terminal_color_9 = p.red
vim.g.terminal_color_10 = p.green
vim.g.terminal_color_11 = p.yellow
vim.g.terminal_color_12 = p.blue
vim.g.terminal_color_13 = p.purple
vim.g.terminal_color_14 = p.cyan
vim.g.terminal_color_15 = p.fg
end
return M
|
local PANEL = {}
--AccessorFunc( PANEL, "m_ConVarR", "ConVarR" )
--[[---------------------------------------------------------
Name: Init
-----------------------------------------------------------]]
function PANEL:Init()
self.ConVars = {}
self.Options = {}
end
--[[---------------------------------------------------------
Name: AddOption
-----------------------------------------------------------]]
function PANEL:AddOption( strName, tabConVars )
self:AddChoice( strName, tabConVars )
for k, v in pairs( tabConVars ) do
self.ConVars[ k ] = 1
end
end
--[[---------------------------------------------------------
Name: OnSelect
-----------------------------------------------------------]]
function PANEL:OnSelect( index, value, data )
for k, v in pairs( data ) do
RunConsoleCommand( k, tostring( v ) )
end
end
--[[---------------------------------------------------------
Name: Think
-----------------------------------------------------------]]
function PANEL:Think( CheckConvarChanges )
self:CheckConVarChanges()
end
--[[---------------------------------------------------------
Name: ConVarsChanged
-----------------------------------------------------------]]
function PANEL:ConVarsChanged()
for k, v in pairs( self.ConVars ) do
if ( self[ k ] == nil ) then return true end
if ( self[ k ] != GetConVarString( k ) ) then return true end
end
return false
end
--[[---------------------------------------------------------
Name: CheckForMatch
-----------------------------------------------------------]]
function PANEL:CheckForMatch( cvars )
if ( table.IsEmpty( cvars ) ) then return false end
for k, v in pairs( cvars ) do
if ( tostring(v) != GetConVarString( k ) ) then
return false
end
end
return true
end
--[[---------------------------------------------------------
Name: CheckConVarChanges
-----------------------------------------------------------]]
function PANEL:CheckConVarChanges()
if (!self:ConVarsChanged()) then return end
for k, v in pairs( self.ConVars ) do
self[ k ] = GetConVarString( k )
end
for k, v in pairs( self.Data ) do
if ( self:CheckForMatch( v ) ) then
self:SetText( self:GetOptionText(k) )
return
end
end
end
vgui.Register( "CtrlListBox", PANEL, "DComboBox" )
|
Citizen.CreateThread(function()
while true do
for k, v in pairs(RecentlyUsedHidden) do
local now = os.time()
if v <= now then
TriggerClientEvent('ND_hospital:client:HiddenSetup', k)
RecentlyUsedHidden[k] = nil
end
end
Citizen.Wait(1000)
end
end)
|
fx_version 'cerulean'
games { 'gta5' }
author 'DISTINCTIVE DEVELOPMENT - Oulsen'
description 'Persistent flashlight'
version '1.1.1'
files{
"Newtonsoft.Json.dll",
"config.json"
}
client_scripts {
"DD-PERSISTENTFLASHLIGHT.Client.net.dll"
}
server_scripts {
"DD-PERSISTENTFLASHLIGHT.Server.net.dll"
} |
local Color3 = import("../types/Color3")
local GuiObject = import("./GuiObject")
local InstanceProperty = import("../InstanceProperty")
local Rect = import("../types/Rect")
local Signal = import("../Signal")
local UDim2 = import("../types/UDim2")
local ScaleType = import("../Enum/ScaleType")
local Vector2 = import("../types/Vector2")
local ImageLabel = GuiObject:extend("ImageLabel", {
creatable = true,
})
ImageLabel.properties.Image = InstanceProperty.typed("string", {
getDefault = function()
return ""
end,
})
ImageLabel.properties.ImageColor3 = InstanceProperty.typed("Color3", {
getDefault = function()
return Color3.new()
end,
})
ImageLabel.properties.ImageRectOffset = InstanceProperty.typed("Vector2", {
getDefault = function()
return Vector2.new(0, 0)
end,
})
ImageLabel.properties.ImageRectSize = InstanceProperty.typed("Vector2", {
getDefault = function()
return Vector2.new(0, 0)
end,
})
ImageLabel.properties.TileSize = InstanceProperty.typed("UDim2", {
getDefault = function()
return UDim2.new(1, 0, 1, 0)
end,
})
ImageLabel.properties.ScaleType = InstanceProperty.enum(ScaleType, {
getDefault = function()
return ScaleType.Stretch
end,
})
ImageLabel.properties.SliceCenter = InstanceProperty.typed("Rect", {
getDefault = function()
return Rect.new(0, 0, 1, 1)
end,
})
ImageLabel.properties.SliceScale = InstanceProperty.typed("number",
{
getDefault = function()
return 1
end
}
)
ImageLabel.properties.MouseEnter =
InstanceProperty.readOnly(
{
getDefault = function()
return Signal.new()
end
}
)
ImageLabel.properties.MouseLeave =
InstanceProperty.readOnly(
{
getDefault = function()
return Signal.new()
end
}
)
ImageLabel.properties.Activated =
InstanceProperty.readOnly(
{
getDefault = function()
return Signal.new()
end
}
)
ImageLabel.properties.InputBegan =
InstanceProperty.readOnly(
{
getDefault = function()
return Signal.new()
end
}
)
ImageLabel.properties.ImageTransparency =
InstanceProperty.typed(
"number",
{
getDefault = function()
return 0
end
}
)
return ImageLabel
|
ITEM.name = "Saiga-12"
ITEM.desc = "A pre-war Automatic Shotgun that fires 12 Gauge Buckshot"
ITEM.model = "models/arxweapon/saiga.mdl"
ITEM.class = "m9k_mrp_saiga"
ITEM.weaponCategory = "primary"
ITEM.width = 4
ITEM.height = 2
ITEM.price = 300 |
--
-- SPDX-FileCopyrightText: Copyright (c) 2019, 2022 Andreas Sandberg <andreas@sandberg.uk>
--
-- SPDX-License-Identifier: BSD-3-Clause
--
local nixio = require "nixio"
m = Map("gosolis", translate("GoSolis"),
translate("GoSolis configuration"))
local hostname = luci.model.uci.cursor():get_first("system", "system", "hostname")
local function time_validate(self, value)
local time, unit = value:match("^(%d+%.%d+)(%a+)$")
if time == nil then
time, unit = value:match("^(%d+)(%a+)$")
end
if time == nil then
return nil
end
if unit == "s" or unit == "ms" or unit == "h" then
return value
else
return nil
end
end
local function glob_values(opt, glob)
for port in nixio.fs.glob(glob) do
opt:value(port)
end
end
--
-- Global configuration
--
global = m:section(TypedSection, "global",
translate("Global Parameters"))
global.anonymous=true
o = global:option(Value, "port", translate("Serial Port"),
translate("Specifies the serial port connected to the RS485 bus"))
o.datatype = "device"
glob_values(o, "/dev/ttyUSB*")
glob_values(o, "/dev/ttyACM*")
glob_values(o, "/dev/ttyS*")
o = global:option(Value, "baud", translate("Baud Rate"),
translate("Baud rate of the RS485 bus"))
o.default = 9600
o.datatype = "uinteger"
o = global:option(Value, "addr", translate("Inverter address"),
translate("Inverter address"))
o.default = 1
o.datatype = "uinteger"
o = global:option(Value, "timeout", translate("Inverter timeout"),
translate("Inverter timeout"))
o.default = "200ms"
o.validate = time_validate
o = global:option(Value, "interval", translate("Sampling interval"),
translate("Sampling interval"))
o.default = "10s"
o.validate = time_validate
--
-- Messaging services
--
msg = m:section(TypedSection, "messaging",
translate("Messaging Services"))
msg.addremove=true
o = msg:option(ListValue, "type", translate("Message Bus Type"))
o:value("mqtt", "MQTT")
o.default = "mqtt"
--
-- Messaging: MQTT
--
o = msg:option(Value, "client_id", translate("MQTT Client ID"))
o:depends("type", "mqtt")
o.default = hostname
o = msg:option(Value, "url", translate("MQTT Server URL"))
o:depends("type", "mqtt")
o.default = "tcp://localhost:1883"
o = msg:option(FileUpload, "ca_cert", translate("server CA file (PEM)"))
o:depends("type", "mqtt")
o = msg:option(FileUpload, "auth_cert", translate("client certificate file (PEM)"))
o:depends("type", "mqtt")
o = msg:option(FileUpload, "auth_key", translate("client private key file (PEM)"))
o:depends("type", "mqtt")
o = msg:option(Value, "topic", translate("MQTT Topic"))
o:depends("type", "mqtt")
o.default = "test/inverter"
o = msg:option(ListValue, "format", translate("MQTT Message Format"))
o:depends("type", "mqtt")
o:value("json", "JSON")
o:value("value", "Value")
o:value("time-value", "UNIX time + value")
o.default = "json"
return m
|
-- border used for customize gameplay primarily but feel free to attempt to use it for something else and have it not work
local borderAlpha = 0.2
local buttonHoverAlpha = 0.6
return Def.ActorFrame {
Name = "BorderContainer", -- not really necessary to have this in an actorframe unless the border is more complex
UIElements.QuadButton(1) .. {
Name = "Border",
OnCommand = function(self)
self:queuecommand("SetUp")
end,
SetUpCommand = function(self)
local pf = self:GetParent():GetParent()
-- avoid shadowing self in the below nested functions, so store self in some variable
local shelf = self
self:GetParent():SetUpdateFunction(function(self)
-- find the largest actor child of the assigned parent we are making a border for
-- assign this border to match its size basically
local bigw = 0
local bigh = 0
local eleh = nil
pf:RunCommandsRecursively(
function(self)
if self:GetName() ~= shelf:GetName() then
local w = self:GetZoomedWidth()
local h = self:GetZoomedHeight()
if w > bigw then bigw = w eleh = self end
if h > bigh then bigh = h eleh = self end
end
end
)
shelf:halign(eleh:GetHAlign())
shelf:valign(eleh:GetVAlign())
shelf:x(eleh:GetX())
shelf:y(eleh:GetY())
shelf:zoomto(bigw, bigh)
end)
self:diffusealpha(borderAlpha)
-- allow this to function as a button
-- even with the comment this makes no sense. basically it has to do with layering stuff
-- buttons on buttons and buttons in front or behind certain elements breaks stuff
-- a higher z value is more "in front"
self:z(10)
-- place the quad behind the whole actorframe we are bordering
self:draworder(-99)
pf:SortByDrawOrder()
self.alphaDeterminingFunction = function(self)
if isOver(self) then
pf:diffusealpha(buttonHoverAlpha)
self:diffusealpha(borderAlpha * buttonHoverAlpha)
else
pf:diffusealpha(1)
self:diffusealpha(borderAlpha)
end
end
self:queuecommand("SetUpFinished")
end,
MouseOverCommand = function(self)
self:alphaDeterminingFunction()
end,
MouseOutCommand = function(self)
self:alphaDeterminingFunction()
end,
MouseDragCommand = function(self, params)
if params.event == "DeviceButton_right mouse button" or not self.canDrag then return end
local screenscale = MovableValues.ScreenZoom
local pp = self:GetParent():GetParent()
local ppp = pp:GetParent()
local trueX = pp:GetTrueX() / screenscale
local trueY = pp:GetTrueY() / screenscale
local zoomfactor = 1
-- this is almost always true but
-- the primary reason this exists is to offset the Player related things properly
-- normally it should be 0, but instead it is 640 for example
-- hindsight comment: gonna be real with u chief this is a huge hack but it works
-- if it stops working RESTRUCTURE YOUR ELEMENTS
-- this only works because 'pp' is the ActorFrame that represents the gameplay element
-- if ppp has been zoomed (breaking everything), then pp is a child of something that isn't a screen,
-- such as the NoteField being pp and the Player being ppp
if ppp ~= nil then
trueX = trueX - (ppp:GetTrueX() / screenscale)
trueY = trueY - (ppp:GetTrueY() / screenscale)
zoomfactor = ppp:GetZoom()
end
local newx = params.MouseX + trueX - ((self.initialClickX or 0) / screenscale)
local newy = params.MouseY + trueY - ((self.initialClickY or 0) / screenscale)
newx = newx / zoomfactor
newy = newy / zoomfactor
local differenceX = newx - pp:GetX()
local differenceY = newy - pp:GetY()
pp:x(newx):y(newy)
setSelectedCustomizeGameplayElementActorPosition(differenceX, differenceY)
end,
MouseDownCommand = function(self, params)
if params.event == "DeviceButton_right mouse button" then return end
local pp = self:GetParent():GetParent()
local screenscale = MovableValues.ScreenZoom
self.initialClickX = params.MouseX * screenscale
self.initialClickY = params.MouseY * screenscale
local name = pp:GetName()
self.canDrag = setSelectedCustomizeGameplayElementActorByName(name)
end,
}
} |
---@class CS.FairyGUI.RichTextField : CS.FairyGUI.Container
---@field public htmlPageContext CS.FairyGUI.Utils.IHtmlPageContext
---@field public htmlParseOptions CS.FairyGUI.Utils.HtmlParseOptions
---@field public emojies CS.System.Collections.Generic.Dictionary_CS.System.UInt32_CS.FairyGUI.Emoji
---@field public textField CS.FairyGUI.TextField
---@field public text string
---@field public htmlText string
---@field public textFormat CS.FairyGUI.TextFormat
---@field public htmlElementCount number
---@type CS.FairyGUI.RichTextField
CS.FairyGUI.RichTextField = { }
---@return CS.FairyGUI.RichTextField
function CS.FairyGUI.RichTextField.New() end
---@return CS.FairyGUI.Utils.HtmlElement
---@param name string
function CS.FairyGUI.RichTextField:GetHtmlElement(name) end
---@return CS.FairyGUI.Utils.HtmlElement
---@param index number
function CS.FairyGUI.RichTextField:GetHtmlElementAt(index) end
---@param index number
---@param show boolean
function CS.FairyGUI.RichTextField:ShowHtmlObject(index, show) end
function CS.FairyGUI.RichTextField:EnsureSizeCorrect() end
---@param context CS.FairyGUI.UpdateContext
function CS.FairyGUI.RichTextField:Update(context) end
function CS.FairyGUI.RichTextField:Dispose() end
return CS.FairyGUI.RichTextField
|
-- Use noise on a grid
VERTEX_SHADER = [[
#version 400
layout (location = 0) in vec3 vp;
layout (location = 1) in vec3 vn;
out vec3 color;
uniform mat4 uViewMatrix, uProjectionMatrix;
uniform float uTime;
void main() {
color = vec3(1.0, 0.0, 0.0);
float force = .6;
float speed = 4.0;
vec2 p = -1.0 + 2.0 * vp.xy / vec2(1.0,1.0);
float len = length(p);
vec2 uv = vp.xy + (p/len) * sin(len * 2.0 - uTime * speed) * force;
uv.x = uv.x + 2.0* sin(uTime/2.0);
vec3 pt = vec3(uv.x, noise1(noise1(uv.x * .287) + noise1(uv.y * 0.393) + uTime * .95), vp.y);
gl_PointSize = 2;
color = vec3(0.26, 0.8-noise1(pt.y*5.0), 1.0-(noise1(pt.y*5.0)));
gl_Position = uProjectionMatrix * uViewMatrix * vec4(pt, 1.0);
}
]]
FRAGMENT_SHADER = [[
#version 400
in vec3 color;
layout (location = 0) out vec4 fragColor;
void main() {
fragColor = vec4(color, 0.95);
}
]]
function setup()
shader = ngl_shader_new(GL_POINTS, VERTEX_SHADER, FRAGMENT_SHADER)
model = ngl_model_new_grid_points(500, 500, 0.05, 0.05)
--model = ngl_model_load_obj("../obj/c004.obj")
end
function draw()
camera = ngl_camera_new_look_at(0, -5, -5)
ngl_clear(0.2, 0.2, 0.2, 1.0)
ngl_draw_model(camera, model, shader)
end
|
-- example HTTP POST script which demonstrates setting the
-- HTTP method, body, and adding a header
counter = 0
request = function()
wrk.method = "POST"
wrk.headers["Content-Type"] = "application/json"
wrk.body = '{ "timestamp": "2020-06-24T15:27:00.123456Z", "ip": ' .. counter .. ', "url": "some/path" }'
counter = counter + 1
return wrk.format(nil, path)
end
|
-- modified by bc1 from 1.0.3.144 brave new world code
-- extend full unit & building info pregame
-- extend AI mood info
-- code is common using gk_mode and bnw_mode switches
-- compatible with Communitas breaking yield types
-- TODO: lots !
local civ5_mode = InStrategicView ~= nil
local civBE_mode = not civ5_mode
local bnw_mode = civBE_mode or ContentManager.IsActive("6DA07636-4123-4018-B643-6575B4EC336B", ContentType.GAMEPLAY)
local gk_mode = bnw_mode or ContentManager.IsActive("0E3751A1-F840-4e1b-9706-519BF484E59D", ContentType.GAMEPLAY)
local civ5gk_mode = civ5_mode and gk_mode
local civ5bnw_mode = civ5_mode and bnw_mode
local g_currencyIcon = civ5_mode and "[ICON_GOLD]" or "[ICON_ENERGY]"
local g_maintenanceCurrency = civ5_mode and "GoldMaintenance" or "EnergyMaintenance"
if not EUI then
include( "EUI_utilities" )
end
local EUI = EUI
local table = EUI.table
local YieldIcons = EUI.YieldIcons
local YieldNames = EUI.YieldNames
--print( "Root contexts:", LookUpControl( "/FrontEnd" ) or "nil", LookUpControl( "/InGame" ) or "nil", LookUpControl( "/LeaderHeadRoot" ) or "nil")
-------------------------------
-- minor lua optimizations
-------------------------------
local math = math
--local os = os
local pairs = pairs
local ipairs = ipairs
local pcall = pcall
--local print = print
local select = select
--local string = string
--local table = table
local tonumber = tonumber
--local tostring = tostring
--local type = type
--local unpack = unpack
local UI = UI
--local UIManager = UIManager
--local Controls = Controls
--local ContextPtr = ContextPtr
local Players = Players
local Teams = Teams
local GameInfo = EUI.GameInfoCache -- warning! use iterator ONLY with table field conditions, NOT string SQL query
--local GameInfoActions = GameInfoActions
local GameInfoTypes = GameInfoTypes
local GameDefines = GameDefines
--local InterfaceDirtyBits = InterfaceDirtyBits
--local CityUpdateTypes = CityUpdateTypes
--local ButtonPopupTypes = ButtonPopupTypes
local YieldTypes = YieldTypes
local GameOptionTypes = GameOptionTypes
--local DomainTypes = DomainTypes
--local FeatureTypes = FeatureTypes
--local FogOfWarModeTypes = FogOfWarModeTypes
--local OrderTypes = OrderTypes
--local PlotTypes = PlotTypes
--local TerrainTypes = TerrainTypes
--local InterfaceModeTypes = InterfaceModeTypes
--local NotificationTypes = NotificationTypes
--local ActivityTypes = ActivityTypes
--local MissionTypes = MissionTypes
--local ActionSubTypes = ActionSubTypes
--local GameMessageTypes = GameMessageTypes
--local TaskTypes = TaskTypes
--local CommandTypes = CommandTypes
--local DirectionTypes = DirectionTypes
--local DiploUIStateTypes = DiploUIStateTypes
--local FlowDirectionTypes = FlowDirectionTypes
--local PolicyBranchTypes = PolicyBranchTypes
--local FromUIDiploEventTypes = FromUIDiploEventTypes
--local CoopWarStates = CoopWarStates
local ThreatTypes = ThreatTypes
local DisputeLevelTypes = DisputeLevelTypes
--local LeaderheadAnimationTypes = LeaderheadAnimationTypes
local TradeableItems = TradeableItems
--local EndTurnBlockingTypes = EndTurnBlockingTypes
--local ResourceUsageTypes = ResourceUsageTypes
local MajorCivApproachTypes = MajorCivApproachTypes
--local MinorCivTraitTypes = MinorCivTraitTypes
--local MinorCivPersonalityTypes = MinorCivPersonalityTypes
--local MinorCivQuestTypes = MinorCivQuestTypes
--local CityAIFocusTypes = CityAIFocusTypes
--local AdvisorTypes = AdvisorTypes
--local GenericWorldAnchorTypes = GenericWorldAnchorTypes
--local GameStates = GameStates
--local GameplayGameStateTypes = GameplayGameStateTypes
--local CombatPredictionTypes = CombatPredictionTypes
--local ChatTargetTypes = ChatTargetTypes
--local ReligionTypes = ReligionTypes
--local BeliefTypes = BeliefTypes
--local FaithPurchaseTypes = FaithPurchaseTypes
--local ResolutionDecisionTypes = ResolutionDecisionTypes
--local InfluenceLevelTypes = InfluenceLevelTypes
--local InfluenceLevelTrend = InfluenceLevelTrend
--local PublicOpinionTypes = PublicOpinionTypes
--local ControlTypes = ControlTypes
local PreGame = PreGame
local Game = Game
--local Map = Map
local OptionsManager = OptionsManager
--local Events = Events
--local Mouse = Mouse
--local MouseEvents = MouseEvents
--local MouseOverStrategicViewResource = MouseOverStrategicViewResource
local Locale = Locale
local _L = Locale.ConvertTextKey
local function L( text, ...)
return _L( text or "<???>", ... )
end
--getmetatable("").__index.L = L
local S = string.format
local g_deal = UI.GetScratchDeal()
local g_isScienceEnabled = not Game or not Game.IsOption(GameOptionTypes.GAMEOPTION_NO_SCIENCE)
local g_isPoliciesEnabled = not Game or not Game.IsOption(GameOptionTypes.GAMEOPTION_NO_POLICIES)
local g_isHappinessEnabled = not Game or not Game.IsOption(GameOptionTypes.GAMEOPTION_NO_HAPPINESS)
local g_isReligionEnabled = civ5gk_mode and (not Game or not Game.IsOption(GameOptionTypes.GAMEOPTION_NO_RELIGION))
local function GetCivUnit( civilizationType, unitClassType )
if unitClassType then
if civilizationType then
local unit = GameInfo.Civilization_UnitClassOverrides{ CivilizationType = civilizationType, UnitClassType = unitClassType }()
unit = unit and GameInfo.Units[ unit.UnitType ]
if unit then
return unit
end
end
local unitClass = GameInfo.UnitClasses[ unitClassType ]
return unitClass and GameInfo.Units[ unitClass.DefaultUnit ]
end
end
local function GetCivBuilding( civilizationType, buildingClassType )
if buildingClassType then
if civilizationType then
local building = GameInfo.Civilization_BuildingClassOverrides{ CivilizationType = civilizationType, BuildingClassType = buildingClassType }()
building = building and GameInfo.Buildings[ building.BuildingType ]
if building then
return building
end
end
local buildingClass = GameInfo.BuildingClasses[ buildingClassType ]
return buildingClass and GameInfo.Buildings[ buildingClass.DefaultBuilding ]
end
end
local function GetYieldStringSpecial( tag, format, ... )
local tip = ""
for row in ... do
if (row[tag] or 0) ~=0 then
tip = S( format, tip, row[tag], YieldIcons[ row.YieldType ] or "???" )
end
end
return tip
end
local function GetYieldString( ... )
return GetYieldStringSpecial( "Yield", "%s %+i%s", ... )
end
local function GetCivName( player )
-- Met
if Teams[Game.GetActiveTeam()]:IsHasMet(player:GetTeam()) then
return player:GetCivilizationShortDescription()
-- Not met
else
return L"TXT_KEY_UNMET_PLAYER"
end
end
local function GetLeaderName( player )
-- You
if player:GetID() == Game.GetActivePlayer() then
return L"TXT_KEY_YOU"
-- Not met
elseif not Teams[Game.GetActiveTeam()]:IsHasMet(player:GetTeam()) then
return L"TXT_KEY_UNMET_PLAYER"
-- Human
elseif player:IsHuman() then -- Game.IsGameMultiPlayer()
local n = player:GetNickName()
if n and n ~= "" then
return player:GetNickName()
end
end
local n = PreGame.GetLeaderName(player:GetID())
if n and n ~= "" then
return L( n )
else
return L( (GameInfo.Leaders[ player:GetLeaderType() ] or {}).Description )
end
end
local negativeOrPositiveTextColor = { [true] = "[COLOR_POSITIVE_TEXT]", [false] = "[COLOR_WARNING_TEXT]" }
local function TextColor( c, s )
return c..s.."[ENDCOLOR]"
end
local function UnitColor( s )
return TextColor("[COLOR_UNIT_TEXT]", s)
end
local function BuildingColor( s )
return TextColor("[COLOR_YIELD_FOOD]", s)
end
local function PolicyColor( s )
return TextColor("[COLOR_MAGENTA]", s)
end
local function TechColor( s )
return TextColor("[COLOR_CYAN]", s)
end
local function BeliefColor( s )
return TextColor("[COLOR_WHITE]", s)
end
local function SetKey( t, key, value )
if key then
t[key] = value or true
end
end
local function AddPreWrittenHelpTextAndConcat( tips, row ) -- assumes tips is custom EUI table object
local tip = row and row.Help and L( row.Help ) or ""
if tip ~= "" then
tips:insertIf( #tips > 2 and "----------------" )
tips:insert( tip )
end
return tips:concat( "[NEWLINE]" )
end
-------------------------------------------------
-- Help text for Units
-------------------------------------------------
local unitFlags = {
--y RequiresFaithPurchaseEnabled = "",
--y PurchaseOnly = "",
MoveAfterPurchase = L"TXT_MOVE_AFTER_PC", -- TODO, LANDSKNECHT
--n Immobile = "", -- bombs, missiles, aircraft etc... not informative
--y Food = L"TXT_KEY_CITYVIEW_STAGNATION_TEXT", -- build using food / stop city growth
--n NoBadGoodies = "", -- scout, does it have any in-game effect ?
RivalTerritory = "", -- unused
--n MilitarySupport = "",
--n MilitaryProduction = "",
--n Pillage = L"TXT_KEY_MISSION_PILLAGE", -- not very informative
Found = L"TXT_KEY_MISSION_BUILD_CITY",
FoundAbroad = L"TXT_KEY_MISSION_BUILD_CITY" .. " <> " .. L"TXT_KEY_PGSCREEN_CONTINENTS",
-- IgnoreBuildingDefense = "", -- TODO, important
--n PrereqResources = "", -- workboat only, not informative
--n Mechanized = "", -- art only ?
Suicide = L"TXT_KEY_SUICIDE", -- TODO, although obvious for base game may be less so in mods
CaptureWhileEmbarked = "", -- unused
RushBuilding = L"TXT_KEY_MISSION_HURRY_PRODUCTION",
SpreadReligion = L"TXT_KEY_MISSION_SPREAD_RELIGION",
RemoveHeresy = L"TXT_KEY_MISSION_REMOVE_HERESY",
FoundReligion = L"TXT_KEY_MISSION_FOUND_RELIGION",
RequiresEnhancedReligion = L"TXT_REQUIRES_E", -- TODO (inquisitors)
ProhibitsSpread = L"TXT_PROHIBITS_SPREAD", -- TODO (inquisitors)
CanBuyCityState = L"TXT_KEY_MISSION_BUY_CITY_STATE",
--n RangeAttackOnlyInDomain = "", -- used only for subs
RangeAttackIgnoreLOS = L"TXT_KEY_PROMOTION_INDIRECT_FIRE",
Trade = L"TXT_KEY_MISSION_ESTABLISH_TRADE_ROUTE",
NoMaintenance = L"TXT_KEY_PEDIA_MAINT_LABEL" .. " 0",
--n UnitArtInfoCulturalVariation = "",
--n UnitArtInfoEraVariation = "",
--n DontShowYields = "",
--n ShowInPedia = "",
}
local unitData = {
--y Combat = L"TXT_KEY_PEDIA_COMBAT_LABEL".." %i",
--y RangedCombat = L"TXT_KEY_PEDIA_RANGEDCOMBAT_LABEL".." %i[ICON_RANGE_STRENGTH]",
--y Cost = "",
--y FaithCost = "",
--y Moves = L"TXT_KEY_PEDIA_MOVEMENT_LABEL".." %i[ICON_MOVES]",
--y Range = L"TXT_KEY_PEDIA_RANGE_LABEL" .. " [ICON_RANGE_STRENGTH]%i",
--n BaseSightRange = "", -- every unit has 2
CultureBombRadius = L"TXT_KEY_MISSION_CULTURE_BOMB" .. " (%i)", -- unused
GoldenAgeTurns = L"TXT_KEY_MISSION_START_GOLDENAGE" .. " (%i " .. L"TXT_KEY_TURNS"..")", -- Artist
FreePolicies = L"TXT_KEY_MISSION_GIVE_POLICIES" .. " (%ix[ICON_CULTURE])", -- unused
OneShotTourism = L"TXT_KEY_MISSION_ONE_SHOT_TOURISM" .. " (%ix[ICON_TOURISM])", -- Musician
--n OneShotTourismPercentOthers = "", -- Musician
--y HurryCostModifier = "",
--n AdvancedStartCost = "",
--n MinAreaSize = "",
AirInterceptRange = L"TXT_KEY_MISSION_INTERCEPT" .. " [ICON_RANGE_STRENGTH]%i",
--n AirUnitCap = "",
--n NukeDamageLevel = "",
--n WorkRate = "", --"TXT_KEY_WORKERACTION_TEXT" "TXT_KEY_MISSION_BUILD_IMPROVEMENT" "TXT_KEY_MISSION_CONSTRUCT"
NumFreeTechs = L"TXT_KEY_MISSION_DISCOVER_TECH" .. " (%i)",
BaseBeakersTurnsToCount = L"TXT_KEY_MISSION_DISCOVER_TECH" .. " (%i " .. L"TXT_KEY_TURNS"..")", -- Scientist
BaseCultureTurnsToCount = L"TXT_KEY_MISSION_GIVE_POLICIES" .. " (%i " .. L"TXT_KEY_TURNS"..")", -- Writer
--y BaseHurry = "",
--y HurryMultiplier = "",
--y BaseGold = L"TXT_KEY_MISSION_CONDUCT_TRADE_MISSION" .. " %i[ICON_INFLUENCE] %i" .. g_currencyIcon, -- base gold provided by great merchand
--y NumGoldPerEra = "", -- gold increment
ReligionSpreads = L"TXT_KEY_UPANEL_SPREAD_RELIGION_USES" .. ": %i",
ReligiousStrength = L"TXT_REL_STR" .. " %i", -- TODO
--n CombatLimit = "",
NumExoticGoods = L"TXT_KEY_MISSION_SELL_EXOTIC_GOODS" .. ": %i",
--n RangedCombatLimit = "",
--n XPValueAttack = "",
--n XPValueDefense = "",
--n Conscription = "",
----------------------------------------------------SP Unit Maintance Cost-----------------------------------
ExtraMaintenanceCost = L"TXT_KEY_PEDIA_MAINT_LABEL" .. " %i" .. g_currencyIcon,
----------------------------------------------------SP Unit Maintance Cost-----------------------------------
Unhappiness = L"TXT_KEY_UNHAPPINESS" .. ": %i[ICON_HAPPINESS_3]",
LeaderExperience = "", --unused
--n UnitFlagIconOffset = "",
--n PortraitIndex = "",
}
--[[ todo compute values
local unitFunction = {
-- unit:GetDropRange()
-- unit:GetExoticGoodsGoldAmount(), unit:GetExoticGoodsXPAmount() --bnw
-- unit:GetDiscoverAmount() --bnw
BaseHurry = function(unit) unit:GetHurryProduction(unit:GetPlot()) end, --bnw
m_pUnitInfo->GetBaseHurry() + (m_pUnitInfo->GetHurryMultiplier() * pCity->getPopulation())
getGame().getGameSpeedInfo().getUnitHurryPercent()
GameInfo.GameSpeeds[PreGame.GetGameSpeed()].UnitHurryPercent
BaseGold = function(unit) return unit:GetTradeInfluence(unit:GetPlot()), unit:GetTradeGold(unit:GetPlot()) end, --bnw
CultureBombRadius = L"TXT_KEY_MISSION_CULTURE_BOMB" .. " (%i)", -- unused
GoldenAgeTurns = L"TXT_KEY_MISSION_START_GOLDENAGE" .. " (%i)", -- Artist
FreePolicies = function(unit) return unit:GetGivePoliciesCulture() end,
OneShotTourism = function(unit) unit:GetBlastTourism() end,
BaseBeakersTurnsToCount = L"TXT_KEY_MISSION_DISCOVER_TECH" .. " (%i " .. L"TXT_KEY_TURNS"..")",
BaseCultureTurnsToCount = L"TXT_KEY_MISSION_GIVE_POLICIES" .. " (%i " .. L"TXT_KEY_TURNS"..")", -- Writer
}
--]]
local function getHelpTextForUnit( unitID, isIncludeRequirementsInfo )
local unit = GameInfo.Units[ unitID ]
if not unit then
return "<Unit undefined in game database>"
end
-- Unit XML stats
local productionCost = unit.Cost
local rangedStrength = unit.RangedCombat
local unitRange = unit.Range
local combatStrength = unit.Combat
local unitMoves = unit.Moves
local unitDomainType = unit.Domain
local thisUnitType = { UnitType = unit.Type }
local thisUnitClass = { UnitClassType = unit.Class }
----------------------------SP Changes: No need for Promotion, to many words!-----------------
--
-- local freePromotions = table()
-- for row in GameInfo.Unit_FreePromotions( thisUnitType ) do
-- local promotion = GameInfo.UnitPromotions[ row.PromotionType ]
-- if promotion then
-- freePromotions:insert( L(promotion.Description) )
-- unitRange = unitRange + (promotion.RangeChange or 0)
-- unitMoves = unitMoves + (promotion.MovesChange or 0)
-- end
-- end
----------------------------SP Changes: No need for Promotion, to many words!-----------------
-- Player data
local activePlayerID = Game and Game.GetActivePlayer()
local activePlayer = activePlayerID and Players[ activePlayerID ]
local city, activeCivilization, activeCivilizationType
-- BE orbital units
local orbitalInfo = civBE_mode and unit.Orbital and GameInfo.OrbitalUnits[ unit.Orbital ]
-- BE unit upgrades
local unitName = unit.Description
if activePlayer and civBE_mode then
local bestUpgradeInfo = GameInfo.UnitUpgrades[ activePlayer:GetBestUnitUpgrade(unit.ID) ]
unitName = bestUpgradeInfo and bestUpgradeInfo.Description or unitName
end
if activePlayer then
productionCost = activePlayer:GetUnitProductionNeeded( unitID )
activeCivilization = GameInfo.Civilizations[ activePlayer:GetCivilizationType() ]
activeCivilizationType = activeCivilization and activeCivilization.Type
city = UI.GetHeadSelectedCity()
if city and city:GetOwner() ~= activePlayerID then
city = nil
end
city = city or activePlayer:GetCapitalCity() or activePlayer:Cities()(activePlayer)
end
-- Name
local combatClass = unit.CombatClass and GameInfo.UnitCombatInfos[ unit.CombatClass ]
local tips = table( UnitColor( Locale.ToUpper( unitName ) ) .. (combatClass and " ("..L(combatClass.Description)..")" or "") )
local item
if orbitalInfo then
tips:append( " ("..L"TXT_KEY_ORBITAL_UNITS"..")" )
-- Orbital Duration
tips:insertIf( activePlayer and L("TXT_KEY_PRODUCTION_ORBITAL_DURATION", activePlayer:GetTurnsUnitAllowedInOrbit(unit.ID, true) ) ) --todo xml
-- Orbital Effect Range
tips:insert( L("TXT_KEY_PRODUCTION_ORBITAL_EFFECT_RANGE", orbitalInfo.EffectRange or 0) )
else
-- Movement:
tips:insertIf( unitDomainType ~= "DOMAIN_AIR" and L"TXT_KEY_PEDIA_MOVEMENT_LABEL" .. " " .. unitMoves .. "[ICON_MOVES]" )
end
-- Ranged Combat:
tips:insertIf( rangedStrength > 0 and L"TXT_KEY_PEDIA_RANGEDCOMBAT_LABEL" .. " " .. rangedStrength .. "[ICON_RANGE_STRENGTH]" .. unitRange )
-- Combat:
tips:insertIf( combatStrength > 0 and S( "%s %g[ICON_STRENGTH]", L"TXT_KEY_PEDIA_COMBAT_LABEL", combatStrength ) )
-- Abilities: --TXT_KEY_PEDIA_FREEPROMOTIONS_LABEL
-- tips:insertIf( #freePromotions > 0 and "[ICON_BULLET]" .. freePromotions:concat( "[NEWLINE][ICON_BULLET]" ) )
-- Ability to create building in city (e.g. vanilla great general)
for row in GameInfo.Unit_Buildings( thisUnitType ) do
local building = GameInfo.Buildings[ row.BuildingType ]
tips:insertIf( building and "[ICON_BULLET]"..L"TXT_KEY_MISSION_CONSTRUCT".." " .. BuildingColor( L(building.Description) ) )
end
-- Actions --TXT_KEY_PEDIA_WORKER_ACTION_LABEL
for row in GameInfo.Unit_Builds( thisUnitType ) do
local build = GameInfo.Builds[ row.BuildType ]
if build then
local requiredCivilizationType = build.ImprovementType and (GameInfo.Improvements[ build.ImprovementType ] or {}).CivilizationType
if not requiredCivilizationType or not activePlayer or GameInfoTypes[ requiredCivilizationType ] == activePlayer:GetCivilizationType() then -- GameInfoTypes not available pregame: works because activePlayer is also nil
item = build.PrereqTech and GameInfo.Technologies[ build.PrereqTech ]
tips:insert( "[ICON_BULLET]" .. (item and TechColor( L(item.Description) ) .. " " or "") .. L(build.Description) )
end
end
end
-- Great Engineer
tips:insertIf( (unit.BaseHurry or 0) > 0 and S( "[ICON_BULLET]%s %i[ICON_PRODUCTION]%+i[ICON_PRODUCTION]/[ICON_CITIZEN]", L"TXT_KEY_MISSION_HURRY_PRODUCTION", unit.BaseHurry, unit.HurryMultiplier or 0 ) )
-- Great Merchant
tips:insertIf( (unit.BaseGold or 0) > 0 and S( "[ICON_BULLET]%s %i%s%+i[ICON_INFLUENCE]", L"TXT_KEY_MISSION_CONDUCT_TRADE_MISSION", unit.BaseGold + ( unit.NumGoldPerEra or 0 ) * ( Game and Teams[Game.GetActiveTeam()]:GetCurrentEra() or PreGame.GetEra() ), g_currencyIcon, GameDefines.MINOR_FRIENDSHIP_FROM_TRADE_MISSION or 0 ) )
-- Other tags
for k,v in pairs(unit) do
if v then
local str = unitFlags[k]
if str then
if #str == 0 then
str = k
end
tips:insert(str )
else
str = unitData[k]
v = tonumber(v) or 0
if str and v > 0 then
if #str == 0 then
str = k .. " %i"
end
tips:insert( S( str, v ) )
end
end
end
end
-- Technology_DomainExtraMoves
local technologyDomainExtraMoves = table()
for row in GameInfo.Technology_DomainExtraMoves{ DomainType = unitDomainType } do
item = GameInfo.Technologies[ row.TechType ]
tips:insertIf( item and (row.Moves or 0)~=0 and S( "[ICON_BULLET]%s %+i[ICON_MOVES]", TechColor( L(item.Description) ), row.Moves ) )
end
--TODO Technology_TradeRouteDomainExtraRange
-- Ability to generate tourism upon spawn
if bnw_mode then
for row in GameInfo.Policy_TourismOnUnitCreation( thisUnitClass ) do
item = GameInfo.Policies[ row.PolicyType ]
tips:insertIf( item and (row.Tourism or 0)~=0 and S( "[ICON_BULLET]%s %+i[ICON_TOURISM]", PolicyColor( L(item.Description) ), row.Tourism ) )
end
end
-- Resources required:
if Game then
for resource in GameInfo.Resources() do
local numResource = Game.GetNumResourceRequiredForUnit( unitID, resource.ID )
tips:insertIf( resource and numResource ~= 0 and S( "%s: %+i%s", L(resource.Description), -numResource, resource.IconString or "???" ) )
end
else
for row in GameInfo.Unit_ResourceQuantityRequirements( thisUnitType ) do
local resource = GameInfo.Resources[ row.ResourceType ]
tips:insertIf( resource and (row.Cost or 0)~=0 and S( "%s: %+i%s", L(resource.Description), -row.Cost, resource.IconString or "???" ) )
end
end
tips:insert( "----------------" )
-- Cost:
local costTip
if productionCost > 1 then -- Production cost
if not unit.PurchaseOnly then
costTip = productionCost .. "[ICON_PRODUCTION]"
end
local goldCost = 0
if city then
goldCost = city:GetUnitPurchaseCost( unitID )
elseif (unit.HurryCostModifier or 0) > 0 then
goldCost = (productionCost * GameDefines.GOLD_PURCHASE_GOLD_PER_PRODUCTION ) ^ GameDefines.HURRY_GOLD_PRODUCTION_EXPONENT
goldCost = (unit.HurryCostModifier + 100) * goldCost / 100
goldCost = goldCost - ( goldCost % GameDefines.GOLD_PURCHASE_VISIBLE_DIVISOR )
end
if goldCost > 0 then
if costTip then
costTip = costTip .. ("(%i%%)"):format(productionCost*100/goldCost)
if civ5gk_mode then
costTip = L("TXT_KEY_PEDIA_A_OR_B", costTip, goldCost .. g_currencyIcon )
else
costTip = costTip .. " / " .. goldCost .. g_currencyIcon
end
else
costTip = goldCost .. g_currencyIcon
end
end
end -- production cost
if g_isReligionEnabled then -- Faith cost
local faithCost = 0
if city then
faithCost = city:GetUnitFaithPurchaseCost( unitID, true )
elseif Game then
faithCost = Game.GetFaithCost( unitID )
elseif unit.RequiresFaithPurchaseEnabled and unit.FaithCost then
faithCost = unit.FaithCost
end
if ( faithCost or 0 ) > 0 then
if costTip then
costTip = L("TXT_KEY_PEDIA_A_OR_B", costTip, faithCost .. "[ICON_PEACE]" )
else
costTip = faithCost .. "[ICON_PEACE]"
end
end
end --faith cost
tips:insertIf( costTip and L"TXT_KEY_PEDIA_COST_LABEL" .. " " .. ( costTip or L"TXT_KEY_FREE" ) )
-- Settler Specifics
tips:insertLocalizedIf( unit.Food and "TXT_KEY_CITYVIEW_STAGNATION_TEXT" ) -- build using food / stop city growth
if unit.Found or unit.FoundAbroad then
tips:append( L("TXT_KEY_NO_ACTION_SETTLER_SIZE_LIMIT", GameDefines.CITY_MIN_SIZE_FOR_SETTLERS) )
end
-- Civilization:
local civs = table()
for requiredCivilizationType in GameInfo.Civilization_UnitClassOverrides( thisUnitType ) do
item = GameInfo.Civilizations[ requiredCivilizationType.CivilizationType ]
civs:insertIf( item and L( item.ShortDescription ) )
end
tips:insertIf( #civs > 0 and L"TXT_KEY_PEDIA_CIVILIZATIONS_LABEL".." "..civs:concat(", ") )
-- Replaces:
item = GameInfo.Units[ (GameInfo.UnitClasses[ unit.Class ] or {}).DefaultUnit ]
tips:insertIf( item and item ~= unit and L"TXT_KEY_PEDIA_REPLACES_LABEL".." "..UnitColor( L(item.Description) ) ) --!!! row
if civBE_mode then
-- Affinity Level Requirements
for affinityPrereq in GameInfo.Unit_AffinityPrereqs( thisUnitType ) do
local affinityInfo = (tonumber( affinityPrereq.Level) or 0 ) > 0 and GameInfo.Affinity_Types[ affinityPrereq.AffinityType ]
tips:insertIf( affinityInfo and L( "TXT_KEY_AFFINITY_LEVEL_REQUIRED", affinityInfo.ColorType, affinityPrereq.Level, affinityInfo.IconString or "???", affinityInfo.Description ) )
end
end
-- Required Policies:
item = unit.PolicyType and GameInfo.Policies[ unit.PolicyType ]
tips:insertIf( item and L"TXT_KEY_PEDIA_PREREQ_POLICY_LABEL" .. " " .. PolicyColor( L(item.Description) ) )
-- Required Buildings:
local buildings = table()
for row in GameInfo.Unit_BuildingClassRequireds( thisUnitType ) do
item = GetCivBuilding( activeCivilizationType, row.BuildingClassType )
buildings:insertIf( item and BuildingColor( L(item.Description) ) )
end
item = unit.ProjectPrereq and GameInfo.Projects[ unit.ProjectPrereq ]
buildings:insertIf( item and BuildingColor( L(item.Description) ) )
tips:insertIf( #buildings > 0 and L"TXT_KEY_PEDIA_REQ_BLDG_LABEL" .. " " .. buildings:concat(", ") ) -- TXT_KEY_NO_ACTION_UNIT_REQUIRES_BUILDING
-- Prerequisite Techs:
item = unit.PrereqTech and GameInfo.Technologies[ unit.PrereqTech ]
tips:insertIf( item and item.ID > 0 and L"TXT_KEY_PEDIA_PREREQ_TECH_LABEL" .. " " .. TechColor( L(item.Description) ) )
-- Upgrade from:
local unitClassUpgrades = {}
for unitUpgrade in GameInfo.Unit_ClassUpgrades( thisUnitClass ) do
unitUpgrade = GameInfo.Units[ unitUpgrade.UnitType ]
SetKey( unitClassUpgrades, unitUpgrade and unitUpgrade.Class )
end
local unitUpgrades = table()
for unitUpgrade in pairs( unitClassUpgrades ) do
unitUpgrade = GetCivUnit( activeCivilizationType, unitUpgrade )
unitUpgrades:insertIf( unitUpgrade and UnitColor( L(unitUpgrade.Description) ) )
end
tips:insertIf( #unitUpgrades > 0 and L"TXT_KEY_GOLD_UPGRADE_UNITS_HEADING3_TITLE" .. ": " .. unitUpgrades:concat(", ") )
-- Becomes Obsolete with:
local obsoleteTech = unit.ObsoleteTech and GameInfo.Technologies[ unit.ObsoleteTech ]
tips:insertIf( obsoleteTech and L"TXT_KEY_PEDIA_OBSOLETE_TECH_LABEL" .. " " .. TechColor( L(obsoleteTech.Description) ) )
-- Upgrade unit
if Game then
local unitUpgrade = Game.GetUnitUpgradesTo( unit.ID )
unitUpgrade = unitUpgrade and GameInfo.Units[ unitUpgrade ]
if activeCivilizationType and unitUpgrade then
unitUpgrade = GetCivUnit( activeCivilizationType, unitUpgrade.Class )
-- How much does it cost to upgrade this Unit to a shiny new eUnit?
local upgradePrice = GameDefines.BASE_UNIT_UPGRADE_COST
+ math.max( 0, activePlayer:GetUnitProductionNeeded( unitUpgrade.ID ) - productionCost ) * GameDefines.UNIT_UPGRADE_COST_PER_PRODUCTION
-- Upgrades for later units are more expensive
item = unitUpgrade.PrereqTech and GameInfo.Technologies[ unitUpgrade.PrereqTech ]
if item then
upgradePrice = math.floor( upgradePrice * ( GameInfoTypes[ item.Era ] * GameDefines.UNIT_UPGRADE_COST_MULTIPLIER_PER_ERA + 1 ) )
end
-- Discount
-- upgradePrice = upgradePrice - math.floor( upgradePrice * unit:UpgradeDiscount() / 100)
-- Mod (Policies, etc.)
-- upgradePrice = math.floor( (upgradePrice * (100 + activePlayer:GetUnitUpgradeCostMod()))/100 )
-- Apply exponent
upgradePrice = math.floor( upgradePrice ^ GameDefines.UNIT_UPGRADE_COST_EXPONENT )
-- Make the number not be funky
upgradePrice = math.floor( upgradePrice / GameDefines.UNIT_UPGRADE_COST_VISIBLE_DIVISOR ) * GameDefines.UNIT_UPGRADE_COST_VISIBLE_DIVISOR
tips:insert( L"TXT_KEY_COMMAND_UPGRADE" .. ": " .. UnitColor( L(unitUpgrade.Description) ) .. " ("..upgradePrice..g_currencyIcon..")" )
end
else
local unitClassUpgrades = {}
for unitClassUpgrade in GameInfo.Unit_ClassUpgrades( thisUnitType ) do
SetKey( unitClassUpgrades, unitClassUpgrade and unitClassUpgrade.UnitClassType )
end
local unitUpgrades = table()
for unitUpgrade in pairs( unitClassUpgrades ) do
unitUpgrade = GetCivUnit( activeCivilizationType, unitUpgrade )
unitUpgrades:insertIf( unitUpgrade and UnitColor( L(unitUpgrade.Description) ) )
end
tips:insertIf( #unitUpgrades > 0 and L"TXT_KEY_COMMAND_UPGRADE" .. ": " .. unitUpgrades:concat(", ") )
end
-- Pre-written Help text
return AddPreWrittenHelpTextAndConcat( tips, unit )
end
-------------------------------------------------
-- Help text for Buildings
-------------------------------------------------
local buildingFlags = {
--y Water = L"TXT_KEY_TERRAIN_COAST",
TeamShare = L"TXT_KEY_POP_UN_TEAM",
--y River = L"TXT_KEY_PLOTROLL_RIVER",
--y FreshWater = L"TXT_KEY_ABLTY_FRESH_WATER_STRING",
--y Mountain = L"TXT_KEY_TERRAIN_MOUNTAIN" .. "[ICON_RANGE_STRENGTH]1",
--y NearbyMountainRequired = L"TXT_KEY_TERRAIN_MOUNTAIN" .. "[ICON_RANGE_STRENGTH]2",
--y Hill = L"TXT_KEY_TERRAIN_HILL",
--y Flat = L"TXT_KEY_MAP_OPTION_FLAT",
FoundsReligion = "TXT_KEY_MISSION_FOUND_RELIGION",
--u IsReligious = "",
BorderObstacle = L"TXT_KEY_BO1", -- TODO
--PlayerBorderObstacle = "TXT_KEY_PBO1", -- TODO
--n Capital = "",
GoldenAge = L"TXT_KEY_MISSION_START_GOLDENAGE",
--MapCentering = "TXT_KEY_MC1", -- TODO
--n NeverCapture = "",
--n NukeImmune = "",
--AllowsWaterRoutes = "TXT_KEY_AWR1", -- TODO
--ExtraLuxuries = "TXT_KEY_EL1", -- TODO
--DiplomaticVoting = "TXT_KEY_DV1", -- TODO
AffectSpiesNow = L"TXT_KEY_ASN1", -- TODO
NullifyInfluenceModifier = L"TXT_KEY_NIM1", -- TODO
--y UnlockedByBelief = "",
--y UnlockedByLeague = "",
--y HolyCity = L"TXT_KEY_RO_WR_HOLY_CITY",
NoOccupiedUnhappiness = L"TXT_KEY_BUILDING_COURTHOUSE_HELP",
AllowsRangeStrike = L"TXT_KEY_PROMOTION_INDIRECT_FIRE",
--n Espionage = L"TXT_KEY_GAME_CONCEPT_SECTION_22",
AllowsFoodTradeRoutes = "[ICON_FOOD]" .. L"TXT_KEY_TRADE_ROUTES_HEADING2_TITLE", --TXT_KEY_DECLARE_WAR_TRADE_ROUTES_HEADER
AllowsProductionTradeRoutes = "[ICON_PRODUCTION]" .. L"TXT_KEY_TRADE_ROUTES_HEADING2_TITLE", --TXT_KEY_DECLARE_WAR_TRADE_ROUTES_HEADER
--n CityWall = "",
--n ArtInfoCulturalVariation = "",
--n ArtInfoEraVariation = "",
--n ArtInfoRandomVariation = "",
}
local buildingData = {
--y Cost = L("TXT_KEY_PEDIA_COST_LABEL") .. " %i[ICON_PRODUCTION]", -- production cost
--y GoldMaintenance = L("TXT_KEY_PEDIA_MAINT_LABEL") .. " %i"..g_currencyIcon, -- maintenance
--y MutuallyExclusiveGroup = "", -- TOTO
--y FaithCost = "",
--u LeagueCost = "",
--n NumCityCostMod = "",
--y HurryCostModifier = "",
--n MinAreaSize = "",
--n ConquestProb = "",
--CitiesPrereq = "TXT_KEY_CP1",-- TOTO
--LevelPrereq = "TXT_KEY_LP1",-- TOTO
--y CultureRateModifier = "",
GlobalCultureRateModifier = L"TXT_KEY_GCRM1" .. "%+i%%" .."[ICON_CULTURE]",-- TOTO
GreatPeopleRateModifier = "%+i%%[ICON_GREAT_PEOPLE] " .. L"TXT_KEY_CITYVIEW_GREAT_PEOPLE_TEXT",
GlobalGreatPeopleRateModifier = L"TXT_KEY_GGPRM1" .. "%+i%%" .. "[ICON_GREAT_PEOPLE]",-- TOTO
--GreatGeneralRateModifier = "TXT_KEY_GGRM2",-- TOTO
--GreatPersonExpendGold = "TAT_KEY_GPEG1",-- TOTO
GoldenAgeModifier = "%+i%% "..L"TXT_KEY_REPLAY_DATA_GOLDAGETURNS",
--UnitUpgradeCostMod = "TXT_KEY_UUCM1",-- TOTO
--Experience = "TXT_KEY_EX1",-- TOTO
--GlobalExperience = "TXT_KEY_GE1",-- TOTO
FoodKept = "%+i%%[ICON_FOOD] " .. L"TXT_KEY_TRAIT_POPULATION_GROWTH_SHORT",-- granary effect
AirModifier = L"TXT_KEY_AIR_MODIFIER11" .. "%+i",-- TOTO
--NukeModifier = "TXT_KEY_NUKE_MODIFIER11",-- TOTO
--NukeExplosionRand = "TXT_KEY_NUKE_EXPLOSION_RAND111",-- TOTO
--HealRateChange = "TXT_KEY_HEAL_RATE_CHANGE111",-- TOTO
--y Happiness = "",
--y UnmoddedHappiness = "",
--UnhappinessModifier = "TXT_KEY_UNHAPPINESS_MODIFIER111",-- TOTO
HappinessPerCity = L"TXT_KEY_HAPPINESS_PERCITY111" .. "%+i" .. "[ICON_HAPPINESS_1]",-- TOTO
--y HappinessPerXPolicies = "",
--CityCountUnhappinessMod = "TXT_KEY_CITY_COUNT_UNHAPPINESS_MOD111",-- TOTO
WorkerSpeedModifier = L"TXT_KEY_WORKER_SPEED_MODIFIER111" .. "%+i%%",-- TOTO
--MilitaryProductionModifier = "TXT_KEY_MILITARY_PRODUCTION_MODIFIER111",-- TOTO
--SpaceProductionModifier = "TXT_KEY_SPACE_PRODUCTION_MODIFIER111",-- TOTO
GlobalSpaceProductionModifier = L"TXT_KEY_GLOBAL_SPACE_PRODUCTION_MODIFIER11" .. "%+i%%" .. "[ICON_PRODUCTION]",-- TOTO
BuildingProductionModifier = L"TXT_KEY_BUILDING_PRODUCTION_MODIFIER11" .. "%+i%%" .. "[ICON_PRODUCTION]",-- TOTO
--WonderProductionModifier = "TXT_KEY_WONDER_PRODUCTION_MODIFIER111",-- TOTO
CityConnectionTradeRouteModifier = L"TXT_KEY_CCTRM22" .. "%+i%%" .. "[ICON_GOLD]",-- TOTO
--CapturePlunderModifier = "TXT_KEY_CPM3",-- TOTO
--PolicyCostModifier = "TXT_KEY_PCM22",-- TOTO
--PlotCultureCostModifier = "TXT_KEY_PCCM4",-- TOTO
--GlobalPlotCultureCostModifier = "TXT_KEY_GPCCM5",-- TOTO
--PlotBuyCostModifier = "TXT_KEY_PBM55",-- TOTO
--GlobalPlotBuyCostModifier = "TXT_KEY_GPBCM_11",-- TOTO
GlobalPopulationChange = L"TXT_KEY_GPC_2" .. "%+i" .. "[ICON_CITIZEN]",-- TOTO
--TechShare = "TXT_KEY_TS_1",-- TOTO
--FreeTechs = "TXT_KEY_FT_4",-- TOTO
FreePolicies = L"TXT_KEY_FREE_POLICIES" .. "%i",-- TOTO
FreeGreatPeople = L"TXT_KEY_GP111" .. "%i",-- TOTO
MedianTechPercentChange = L"TXT_KEY_MTPC_444" .. "%+i%%" .. "[ICON_RESEARCH]",-- TOTO
--Gold = "TXT_KEY_G1_1",-- TOTO
--y Defense = "",
--y ExtraCityHitPoints = "",
--GlobalDefenseMod = "TXT_KEY_GDM_0",-- TOTO
--MinorFriendshipChange = "TXT_KEY_MFC_23",-- TOTO
--VictoryPoints = "TXT_KEY_VP_00",-- TOTO
ExtraMissionarySpreads = L"TXT_KEY_EMS_5" .. "%i",-- TOTO
ReligiousPressureModifier = L"TXT_KEY_RPM_10" .. "%+i%% ",-- TOTO
--EspionageModifier = "TXT_KEY_EM561",-- TOTO
--GlobalEspionageModifier = "TXT_KEY_GEM4444",-- TOTO
ExtraSpies = L"TXT_KEY_ES123123" .. "%+i",-- TOTO
--SpyRankChange = "%+i" .. L"TXT_KEY_SC_10",-- TOTO
InstantSpyRankChange = L"TXT_KEY_ISC_10" .. "%+i",-- TOTO
TradeRouteRecipientBonus = "[ICON_INTERNATIONAL_TRADE]" .. L"TXT_KEY_DECLARE_WAR_TRADE_ROUTES_HEADER" .. " %+i"..g_currencyIcon.."[ICON_ARROW_LEFT]",
TradeRouteTargetBonus = "[ICON_INTERNATIONAL_TRADE]" .. L"TXT_KEY_DECLARE_WAR_TRADE_ROUTES_HEADER" .. " %+i"..g_currencyIcon.."[ICON_ARROW_RIGHT]",
NumTradeRouteBonus = "%+i[ICON_INTERNATIONAL_TRADE] ".. L"TXT_KEY_DECLARE_WAR_TRADE_ROUTES_HEADER",
LandmarksTourismPercent = L"TXT_KEY_LTP11" .. "%i%%",-- TOTO
--InstantMilitaryIncrease = "TXT_KEY_LMI11111",-- TOTO
GreatWorksTourismModifier = L"TXT_KEY_GWTM1111111" .. "%+i%%",-- TOTO
--XBuiltTriggersIdeologyChoice = "TXT_KEY_XB1",-- TOTO
TradeRouteSeaDistanceModifier = L"TXT_KEY_TSDM1" .. "%+i%%",
--TradeRouteSeaGoldBonus = L"TXT_KEY_TRSG1" .. "%1.1s" .. "[ICON_GOLD]",-- TOTO
TradeRouteLandDistanceModifier = L"TXT_KEY_TRLDM1" .. "%+i%%",-- TOTO
--TradeRouteLandGoldBonus = L"TXT_KEY_TRLGB1" .. "%1.1s" .. "[ICON_GOLD]",-- TOTO
CityStateTradeRouteProductionModifier = L"TXT_KEY_CSTRPM1111" .. "%+i%%" .. "[ICON_PRODUCTION]",-- TOTO
--GreatScientistBeakerModifier = "TXT_KEY_GSBM4444",-- TOTO
--y TechEnhancedTourism = "",
--y SpecialistCount = "",
--y GreatWorkCount = "",
--SpecialistExtraCulture = "TXT_KEY_SEC444",-- TOTO
--y GreatPeopleRateChange = "",
ExtraLeagueVotes = L"TXT_KEY_ELV3434" .. "%i",-- TOTO
}
if bnw_mode then
buildingFlags.Airlift = L"TXT_KEY_MISSION_AIRLIFT"
else
buildingData.Airlift = L"TXT_KEY_MISSION_AIRLIFT"
end
local g_gameAvailableBeliefs = Game and { Game.GetAvailablePantheonBeliefs, Game.GetAvailableFounderBeliefs, Game.GetAvailableFollowerBeliefs, Game.GetAvailableFollowerBeliefs, Game.GetAvailableEnhancerBeliefs, Game.GetAvailableBonusBeliefs }
-------------------------------------------------
-- Helper function to build religion tooltip string
-------------------------------------------------
local function GetSpecialistSlotsTooltip( specialistType, numSlots )
local tip = ""
for row in GameInfo.SpecialistYields{ SpecialistType = specialistType } do
tip = S( "%s %+i%s", tip, row.Yield, YieldIcons[ row.YieldType ] or "???" )
end
return S( "%i %s%s", numSlots, L( (GameInfo.Specialists[ specialistType ] or {}).Description or "???" ), tip )
end
local function getSpecialistYields( city, specialist )
local yieldTips = table()
local specialistID = specialist.ID
local tip = ""
if city then
-- Culture
local cultureFromSpecialist = city:GetCultureFromSpecialist( specialistID )
-- Yield
for yieldID = 0, YieldTypes.NUM_YIELD_TYPES-1 do
local specialistYield = city:GetSpecialistYield( specialistID, yieldID )
if specialistYield ~= 0 then
tip = S( "%s %+i%s", tip, specialistYield, YieldIcons[ yieldID ] or "???" )
if yieldID == YieldTypes.YIELD_CULTURE then
cultureFromSpecialist = 0
end
end
end
if cultureFromSpecialist > 0 then
tip = S( "%s %+i[ICON_CULTURE]", tip, cultureFromSpecialist )
end
else
for row in GameInfo.SpecialistYields{ SpecialistType = specialist.Type or -1 } do
tip = S( "%s %+i%s", tip, row.Yield, YieldIcons[ row.YieldType ] or "???" )
end
end
if civ5_mode and (specialist.GreatPeopleRateChange or 0) > 0 then
tip = S( "%s %+i[ICON_GREAT_PEOPLE]", tip, specialist.GreatPeopleRateChange )
end
return tip
end
GetSpecialistYields = getSpecialistYields
local function getHelpTextForBuilding( buildingID, bExcludeName, bExcludeHeader, bNoMaintenance, city )
local building = GameInfo.Buildings[ buildingID ]
if not building then
return "<Building undefined in game database>"
end
local buildingType = building.Type or -1
local buildingClassType = building.BuildingClass
local buildingClass = GameInfo.BuildingClasses[ buildingClassType ]
local buildingClassID = buildingClass and buildingClass.ID
local activePlayerID = Game and Game.GetActivePlayer()
local activePlayer = activePlayerID and Players[ activePlayerID ]
local isWorldWonder = (buildingClass and tonumber(buildingClass.MaxGlobalInstances) or 0) > 0
local thisBuildingType = { BuildingType = buildingType }
local thisBuildingAndResourceTypes = { BuildingType = buildingType }
local thisBuildingClassType = { BuildingClassType = buildingClassType }
local activeTeam = Game and Teams[Game.GetActiveTeam()]
local activeTeamTechs = activeTeam and activeTeam:GetTeamTechs()
local activePlayerIdeologyID = bnw_mode and activePlayer and activePlayer:GetLateGamePolicyTree()
local activePlayerIdeology = activePlayerIdeologyID and GameInfo.PolicyBranchTypes[ activePlayerIdeologyID ]
local activePlayerIdeologyType = activePlayerIdeology and activePlayerIdeology.Type
local activePlayerBeliefs = {}
local availableBeliefs = {}
local activePerkTypes = {}
if g_isReligionEnabled and activePlayer then
if activePlayer:HasCreatedReligion() then
local religionID = activePlayer:GetReligionCreatedByPlayer()
if religionID > 0 then
activePlayerBeliefs = Game.GetBeliefsInReligion( religionID )
end
elseif activePlayer:HasCreatedPantheon() then
activePlayerBeliefs = { activePlayer:GetBeliefInPantheon() }
end
for i = 1, activePlayer:IsTraitBonusReligiousBelief() and 6 or 5 do
if (activePlayerBeliefs[i] or -1) < 0 then -- active player does not already have a belief in "i" belief class
for _,beliefID in pairs( g_gameAvailableBeliefs[i]() ) do
availableBeliefs[beliefID] = true -- because available to active player in "i" belief class
end
end
end
end
------------------
-- Tech Filter
local function techFilter( row )
return row and g_isScienceEnabled and ( not activeTeamTechs or not activeTeamTechs:HasTech( row.ID ) )
end
------------------
-- Policy Filter
local function policyFilter( row )
return row and g_isPoliciesEnabled
and not( activePlayer and activePlayer:HasPolicy( row.ID ) and not activePlayer:IsPolicyBlocked( row.ID ) )
and not( activePlayerIdeologyType and activePlayerIdeologyType ~= row.PolicyBranchType )
end
------------------
-- Belief Filter
local function beliefFilter( row )
return row and g_isReligionEnabled and ( not activePlayer or availableBeliefs[ row.ID ] )
end
local productionCost = tonumber(building.Cost) or 0
local maintenanceCost = tonumber(building[g_maintenanceCurrency]) or 0
local happinessChange = (tonumber(building.Happiness) or 0) + (tonumber(building.UnmoddedHappiness) or 0)
local defenseChange = tonumber(building.Defense) or 0
local hitPointChange = tonumber(building.ExtraCityHitPoints) or 0
local cultureChange = not gk_mode and tonumber(building.Culture) or 0
local cultureModifier = tonumber(building.CultureRateModifier) or 0
local enhancedYieldTech = building.EnhancedYieldTech and GameInfo.Technologies[ building.EnhancedYieldTech ]
local enhancedYieldTechName = enhancedYieldTech and TechColor( L(enhancedYieldTech.Description) ) or ""
if activePlayer then
city = city or UI.GetHeadSelectedCity()
city = (city and city:GetOwner() == activePlayerID and city) or activePlayer:GetCapitalCity() or activePlayer:Cities()(activePlayer)
-- player production cost
productionCost = activePlayer:GetBuildingProductionNeeded( buildingID )
if civ5_mode then
-- player extra happiness
happinessChange = happinessChange + activePlayer:GetExtraBuildingHappinessFromPolicies( buildingID )
if gk_mode then
happinessChange = happinessChange + activePlayer:GetPlayerBuildingClassHappiness( buildingClassID )
end
else
-- get the active perk types
activePerkTypes = activePlayer:GetAllActivePlayerPerkTypes()
end
end
if city and civ5gk_mode and buildingClassID then
happinessChange = happinessChange + city:GetReligionBuildingClassHappiness(buildingClassID)
end
local tip, items, item, condition
-- Name
local tips = table( BuildingColor( Locale.ToUpper( building.Description ) ) )
-- Other tags
for k,v in pairs(building) do
if v then
local str = buildingFlags[k]
if str then
if #str == 0 then
str = k
end
tips:insert( str )
else
str = buildingData[k]
v = tonumber(v) or 0
if str and v > 0 then
if #str == 0 then
str = k .. " %i"
end
tips:insert( S( str, v ) )
end
end
end
end
--local function getBuildingYields( buildingID, buildingType, buildingClassID, activePlayer )
-- Yields
local thisBuildingAndYieldTypes = { BuildingType = buildingType }
local tip = ""
for yield in GameInfo.Yields() do
local yieldID = yield.ID
local yieldChange = 0
local yieldModifier = 0
thisBuildingAndYieldTypes.YieldType = yield.Type
if Game and buildingClassID and yieldID < YieldTypes.NUM_YIELD_TYPES then -- weed out strange Communitas yields
yieldChange = Game.GetBuildingYieldChange( buildingID, yieldID )
yieldModifier = Game.GetBuildingYieldModifier( buildingID, yieldID )
if activePlayer then
if gk_mode then
yieldChange = yieldChange + activePlayer:GetPlayerBuildingClassYieldChange( buildingClassID, yieldID )
yieldChange = yieldChange + activePlayer:GetPolicyBuildingClassYieldChange( buildingClassID, yieldID )
end
yieldModifier = yieldModifier + activePlayer:GetPolicyBuildingClassYieldModifier( buildingClassID, yieldID )
for i=1, #activePerkTypes do
yieldChange = yieldChange + Game.GetPlayerPerkBuildingClassFlatYieldChange( activePerkTypes[i], buildingClassID, yieldID )
yieldModifier = yieldModifier + Game.GetPlayerPerkBuildingClassPercentYieldChange( activePerkTypes[i], buildingClassID, yieldID )
end
end
if city and gk_mode then
yieldChange = yieldChange + city:GetReligionBuildingClassYieldChange( buildingClassID, yieldID )
if bnw_mode then
yieldChange = yieldChange + city:GetLeagueBuildingClassYieldChange( buildingClassID, yieldID )
end
end
else -- not Game
for row in GameInfo.Building_YieldChanges( thisBuildingAndYieldTypes ) do
yieldChange = yieldChange + (row.Yield or 0)
end
for row in GameInfo.Building_YieldModifiers( thisBuildingAndYieldTypes ) do
yieldModifier = yieldModifier + (row.Yield or 0)
end
end
if yield.Type == "YIELD_CULTURE" then -- works pregame, when GameInfoTypes is not available
yieldChange = yieldChange + cultureChange
yieldModifier = yieldModifier + cultureModifier
cultureChange = 0
cultureModifier = 0
end
local yieldPerPop = 0
for row in GameInfo.Building_YieldChangesPerPop( thisBuildingAndYieldTypes ) do
yieldPerPop = yieldPerPop + (row.Yield or 0)
end
if yieldChange ~=0 then
tip = S("%s %+i%s", tip, yieldChange, yield.IconString or "???" )
end
if yieldModifier ~=0 then
tip = S("%s %+i%%%s", tip, yieldModifier, yield.IconString or "???" )
end
if yieldPerPop ~= 0 then
tip = S("%s %+i%%[ICON_CITIZEN]%s", tip, yieldPerPop, yield.IconString or "???" )
end
if tips and tip~="" then
tips:insert( YieldNames[ yieldID ] .. ":" .. tip )
tip = ""
end
end
-- Culture leftovers
if cultureChange ~=0 then
tip = S("%s %+i[ICON_CULTURE]", tip, cultureChange )
end
if cultureModifier ~=0 then
tip = S("%s %+i%%[ICON_CULTURE]", tip, cultureModifier )
end
if tips and tip~="" then
tips:insert( L"TXT_KEY_PEDIA_CULTURE_LABEL" .. tip )
tip = ""
end
if civ5_mode then
-- Happiness:
if happinessChange ~=0 then
tip = S( "%s %+i[ICON_HAPPINESS_1]", tip, happinessChange )
end
if bnw_mode and (building.HappinessPerXPolicies or 0)~=0 then
tip = S( "%s +1[ICON_HAPPINESS_1]/%i %s", tip, building.HappinessPerXPolicies, PolicyColor( L"TXT_KEY_VP_POLICIES" ) )
end
if tips and tip~="" then
tips:insert( L"TXT_KEY_PEDIA_HAPPINESS_LABEL" .. tip )
tip = ""
end
else
-- Health
local healthChange = (tonumber(building.Health) or 0) + (tonumber(building.UnmoddedHealth) or 0)
local healthModifier = tonumber(building.HealthModifier) or 0
if activePlayer then
-- Health from Virtues
healthChange = healthChange + activePlayer:GetExtraBuildingHealthFromPolicies( buildingID )
-- Player Perks
for i=1, #activePerkTypes do
healthChange = healthChange + Game.GetPlayerPerkBuildingClassPercentHealthChange( activePerkTypes[i], buildingClassID )
healthModifier = healthModifier + Game.GetPlayerPerkBuildingClassPercentHealthChange( activePerkTypes[i], buildingClassID )
defenseChange = defenseChange + Game.GetPlayerPerkBuildingClassCityStrengthChange( activePerkTypes[i], buildingClassID )
hitPointChange = hitPointChange + Game.GetPlayerPerkBuildingClassCityHPChange( activePerkTypes[i], buildingClassID )
maintenanceCost = maintenanceCost + Game.GetPlayerPerkBuildingClassEnergyMaintenanceChange( activePerkTypes[i], buildingClassID )
end
end
if healthChange ~=0 then
tip = S("%s %+i[ICON_HEALTH_1]", tip, healthChange )
end
if healthModifier ~=0 then
tip = S("%s %+i%%[ICON_HEALTH_1]", tip, healthModifier )
end
if tips and tip~="" then
tips:insert( L"TXT_KEY_HEALTH" .. ":" .. tip )
tip = ""
end
end
-- Defense:
if defenseChange ~=0 then
tip = S("%s %+g[ICON_STRENGTH]", tip, defenseChange / 100 )
end
if hitPointChange ~=0 then
tip = tip .. " " .. L( "TXT_KEY_PEDIA_DEFENSE_HITPOINTS", hitPointChange )
end
if tips and tip~="" then
tips:insert( L"TXT_KEY_PEDIA_DEFENSE_LABEL" .. tip )
tip = ""
end
-- Maintenance:
tips:insertIf( maintenanceCost ~= 0 and S( "%s %+i%s", L"TXT_KEY_PEDIA_MAINT_LABEL", -maintenanceCost, g_currencyIcon) )
-- Resources required:
if Game then
for resource in GameInfo.Resources() do
local numResource = Game.GetNumResourceRequiredForBuilding( buildingID, resource.ID )
tips:insertIf( numResource ~= 0 and S( "%s: %+i%s", L(resource.Description), -numResource, resource.IconString or "???" ) )
end
else
for row in GameInfo.Building_ResourceQuantityRequirements( thisBuildingType ) do
local resource = GameInfo.Resources[ row.ResourceType ]
tips:insertIf( resource and (row.Cost or 0)~=0 and S( "%s: %+i%s", L(resource.Description), -row.Cost, resource.IconString or "???" ) )
end
end
-- Specialists
local specialistType = building.SpecialistType
local specialist = specialistType and GameInfo.Specialists[ specialistType ]
if specialist then
tips:insertIf( ( building.GreatPeopleRateChange or 0 ) ~= 0 and S("%s %+i[ICON_GREAT_PEOPLE]", L( specialist.GreatPeopleTitle or "???" ), building.GreatPeopleRateChange) )
if (building.SpecialistCount or 0) ~= 0 then
if civ5_mode then
local numSpecialistsInBuilding = UI.GetHeadSelectedCity() and city:GetNumSpecialistsInBuilding( buildingID ) or building.SpecialistCount
if numSpecialistsInBuilding ~= building.SpecialistCount then
numSpecialistsInBuilding = numSpecialistsInBuilding.."/"..building.SpecialistCount
end
tips:insert( L( "TXT_KEY_CITYVIEW_BUILDING_SPECIALIST_YIELD", numSpecialistsInBuilding, specialist.Description or "???", getSpecialistYields( city, specialist ) ) )
else
tips:insert( S( "%i[ICON_CITIZEN]%s /%s", building.SpecialistCount, L( specialist.Description or "???" ), getSpecialistYields( city, specialist ) ) )
end
end
end
if civ5bnw_mode then
-- Great Work Slots
local greatWorkType = (building.GreatWorkCount or 0) > 0 and building.GreatWorkSlotType and GameInfo.GreatWorkSlots[building.GreatWorkSlotType]
tips:insertIf( greatWorkType and L( greatWorkType.SlotsToolTipText, building.GreatWorkCount ) )
for row in GameInfo.Building_DomainFreeExperiencePerGreatWork( thisBuildingType ) do
item = GameInfo.Domains[ row.DomainType ]
tips:insertIf( item and (row.Experience or 0)>0 and L(item.Description).." "..L( "TXT_KEY_EXPERIENCE_POPUP", row.Experience ).."/ "..L("TXT_KEY_VP_GREAT_WORKS") )
end
-- Theming Bonus
-- TODO Building_ThemingBonuses
-- tips:insertLocalizedIf( building.ThemingBonusHelp )
-- Free Great Work
local freeGreatWork = building.FreeGreatWork and GameInfo.GreatWorks[ building.FreeGreatWork ]
-- TODO type rather than blurb
tips:insertIf( freeGreatWork and L"TXT_KEY_FREE" .." "..L( freeGreatWork.Description ) )
-- TODO sacred sites properly
-- TODO Building_YieldChangesPerReligion
tip = ""
local tourism = 0
if (building.FaithCost or 0) > 0 and building.UnlockedByBelief and building.Cost == -1 then
if city then
tourism = city:GetFaithBuildingTourism()
else
end
if tourism ~= 0 then
tip = S(" %+i[ICON_TOURISM]", city:GetFaithBuildingTourism() )
end
end
if enhancedYieldTechName and (building.TechEnhancedTourism or 0) ~= 0 then
tip = S("%s %s %+i[ICON_TOURISM]", tip, enhancedYieldTechName, building.TechEnhancedTourism )
end
tips:insertIf( #tip > 0 and L"TXT_KEY_CITYVIEW_TOURISM_TEXT" .. ":" .. tip )
end
-- TODO GetInternationalTradeRouteYourBuildingBonus
if gk_mode then
-- Resources
for row in GameInfo.Building_ResourceQuantity( thisBuildingType ) do
local resource = GameInfo.Resources[ row.ResourceType ]
tips:insertIf( resource and (row.Quantity or 0)~=0 and S("%s: %+i%s", L(resource.Description), row.Quantity, resource.IconString or "???" ) )
end
end
-- Resource Yields enhanced by Building
for resource in GameInfo.Resources() do
thisBuildingAndResourceTypes.ResourceType = resource.Type or -1
tip = GetYieldString( GameInfo.Building_ResourceYieldChanges( thisBuildingAndResourceTypes ) )
for row in GameInfo.Building_ResourceCultureChanges( thisBuildingAndResourceTypes ) do
if (row.CultureChange or 0)~= 0 then
tip = tip .. S(" %+i[ICON_CULTURE]", row.CultureChange )
end
end
if g_isReligionEnabled then
for row in GameInfo.Building_ResourceFaithChanges( thisBuildingAndResourceTypes ) do
if (row.FaithChange or 0)~= 0 then
tip = S("%s %+i[ICON_FAITH]", tip, row.FaithChange )
end
end
end
-- TODO GameInfo.Building_ResourceYieldModifiers( thisBuildingType ), ResourceType, YieldType, Yield
tips:insertIf( #tip > 0 and (resource.IconString or "???") .. " " .. L(resource.Description) .. ":" .. tip )
end
-- Feature Yields enhanced by Building
for feature in GameInfo.Features() do
tip = GetYieldString( GameInfo.Building_FeatureYieldChanges{ BuildingType = buildingType, FeatureType = feature.Type } )
tips:insertIf( #tip > 0 and L(feature.Description) .. ":" .. tip )
end
if gk_mode then
-- Terrain Yields enhanced by Building
for terrain in GameInfo.Terrains() do
tip = GetYieldString( GameInfo.Building_TerrainYieldChanges{ BuildingType = buildingType, TerrainType = terrain.Type } )
if civBE_mode then
local health = 0
for row in GameInfo.Building_TerrainHealthChange{ BuildingType = buildingType, TerrainType = terrain.Type } do
health = health + ( tonumber( row.Quantity ) or 0 )
end
if health ~= 0 then
tip = S( "%s %+i[ICON_HEALTH_1]", tip, health )
end
end
tips:insertIf( #tip > 0 and L(terrain.Description) .. ":" .. tip )
end
end
-- Specialist Yields enhanced by Building
for specialist in GameInfo.Specialists() do
tip = GetYieldString( GameInfo.Building_SpecialistYieldChanges{ BuildingType = buildingType, SpecialistType = specialist.Type } )
tips:insertIf( #tip > 0 and L(specialist.Description) .. ":" .. tip )
end
-- River Yields enhanced by Building
tip = GetYieldString( GameInfo.Building_RiverPlotYieldChanges( thisBuildingType ) )
tips:insertIf( #tip > 0 and L"TXT_KEY_PLOTROLL_RIVER" .. ":" .. tip )
-- Lake Yields enhanced by Building
tip = GetYieldString( GameInfo.Building_LakePlotYieldChanges( thisBuildingType ) )
tips:insertIf( #tip > 0 and L"TXT_KEY_PLOTROLL_LAKE" .. ":" .. tip )
-- Ocean Yields enhanced by Building
tip = GetYieldString( GameInfo.Building_SeaPlotYieldChanges( thisBuildingType ) )
tips:insertIf( #tip > 0 and L"TXT_KEY_PLOTROLL_OCEAN" .. ":" .. tip )
-- Ocean Resource Yields enhanced by Building
tip = GetYieldString( GameInfo.Building_SeaResourceYieldChanges( thisBuildingType ) )
-- todo determine sea resources
tips:insertIf( #tip > 0 and L"TXT_KEY_PLOTROLL_OCEAN" .." "..L"TXT_KEY_TOPIC_RESOURCES".. ":" .. tip )
-- Area Yields enhanced by Building
tip = GetYieldStringSpecial( "Yield", "%s %+i%%%s", GameInfo.Building_AreaYieldModifiers( thisBuildingType ) )
tips:insertIf( #tip > 0 and L"TXT_KEY_PGSCREEN_CONTINENTS" .. ":" .. tip )
-- Map Yields enhanced by Building
tip = GetYieldStringSpecial( "Yield", "%s %+i%%%s", GameInfo.Building_GlobalYieldModifiers( thisBuildingType ) )
tips:insertIf( #tip > 0 and L"TXT_KEY_TOPIC_CITIES" .. ":" .. tip )
-- victory requisite
local victory = building.VictoryPrereq and GameInfo.Victories[ building.VictoryPrereq ]
tips:insertIf( victory and TextColor( "[COLOR_GREEN]", L( victory.Description ) ) )
-- free building in this city
local freeBuilding = GetCivBuilding( activeCivilizationType, building.FreeBuildingThisCity )
tips:insertIf( freeBuilding and L"TXT_KEY_FREE".." "..BuildingColor( L( freeBuilding.Description ) ) )
-- free building in all cities
freeBuilding = GetCivBuilding( activeCivilizationType, building.FreeBuilding )
tips:insertIf( freeBuilding and L"TXT_KEY_FREE".." "..BuildingColor( L( freeBuilding.Description ) ) )-- todo xml
-- free units
for row in GameInfo.Building_FreeUnits( thisBuildingType ) do
local freeUnit = GameInfo.Units[ row.UnitType ]
freeUnit = freeUnit and GetCivUnit( activeCivilizationType, freeUnit.Class )
tips:insertIf( freeUnit and (row.NumUnits or 0)>0 and ( row.NumUnits > 1 and row.NumUnits.." " or "" ) ..L"TXT_KEY_FREE".." "..UnitColor( L( freeUnit.Description ) ) )
end
--Building_FreeSpecialistCounts unused ?
-- free promotion to units trained in this city
local freePromotion = building.TrainedFreePromotion and GameInfo.UnitPromotions[ building.TrainedFreePromotion ]
tips:insertIf( freePromotion and L"TXT_KEY_PEDIA_FREEPROMOTIONS_LABEL".." "..L( freePromotion.Help ) )
-- free promotion for all units
freePromotion = building.FreePromotion and GameInfo.UnitPromotions[ building.FreePromotion ]
tips:insertIf( freePromotion and L"TXT_KEY_PEDIA_FREEPROMOTIONS_LABEL".." "..L( freePromotion.Help ) )
-- hurry modifiers
for row in GameInfo.Building_HurryModifiers( thisBuildingType ) do
item = GameInfo.HurryInfos[ row.HurryType ]
tips:insertIf( item and (row.HurryCostModifier or 0)~=0 and S( "%s %+i%%", L(item.Description), row.HurryCostModifier ) )
end
-- Unit production modifier
for row in GameInfo.Building_UnitCombatProductionModifiers( thisBuildingType ) do
item = GameInfo.UnitCombatInfos[ row.UnitCombatType ]
tips:insertIf( item and (row.Modifier or 0)~=0 and S( "%s %+i%%[ICON_PRODUCTION]", L(item.Description), row.Modifier ) )
end
for row in GameInfo.Building_DomainProductionModifiers( thisBuildingType ) do
item = GameInfo.Domains[ row.DomainType ]
tips:insertIf( item and (row.Modifier or 0)~=0 and S( "%s %+i%%[ICON_PRODUCTION]", L(item.Description), row.Modifier ) )
end
-- free experience
for row in GameInfo.Building_DomainFreeExperiences( thisBuildingType ) do
item = GameInfo.Domains[ row.DomainType ]
tips:insertIf( item and (row.Experience or 0)~=0 and L(item.Description).." "..L( "TXT_KEY_EXPERIENCE_POPUP", row.Experience ) )
end
for row in GameInfo.Building_UnitCombatFreeExperiences( thisBuildingType ) do
item = GameInfo.UnitCombatInfos[ row.UnitCombatType ]
tips:insertIf( item and (row.Experience or 0)>0 and L(item.Description).." "..L( "TXT_KEY_EXPERIENCE_POPUP", row.Experience ) )
end
-- Yields enhanced by Technology
if techFilter( enhancedYieldTech ) then
tip = GetYieldString( GameInfo.Building_TechEnhancedYieldChanges( thisBuildingType ) )
tips:insertIf( #tip > 0 and "[ICON_BULLET]" .. enhancedYieldTechName .. tip )
end
items = {}
-- Yields enhanced by Policy
for row in GameInfo.Policy_BuildingClassYieldChanges( thisBuildingClassType ) do
if row.PolicyType and (row.YieldChange or 0)~=0 then
items[row.PolicyType] = S( "%s %+i%s", items[row.PolicyType] or "", row.YieldChange, YieldIcons[row.YieldType] or "???" )
end
end
for row in GameInfo.Policy_BuildingClassCultureChanges( thisBuildingClassType ) do
if row.PolicyType and (row.CultureChange or 0)~=0 then
items[row.PolicyType] = S( "%s %+i[ICON_CULTURE]", items[row.PolicyType] or "", row.CultureChange )
end
end
-- Yield modifiers enhanced by Policy
for row in GameInfo.Policy_BuildingClassYieldModifiers( thisBuildingClassType ) do
if row.PolicyType and (row.YieldMod or 0)~=0 then
items[row.PolicyType] = S( "%s %+i%%%s", items[row.PolicyType] or "", row.YieldMod, YieldIcons[row.YieldType] or "???" )
end
end
if civ5_mode then
if bnw_mode then
for row in GameInfo.Policy_BuildingClassTourismModifiers( thisBuildingClassType ) do
if row.PolicyType and (row.TourismModifier or 0)~=0 then
items[row.PolicyType] = S( "%s %+i%%[ICON_TOURISM]", items[row.PolicyType] or "", row.TourismModifier )
end
end
end
for row in GameInfo.Policy_BuildingClassHappiness( thisBuildingClassType ) do
if row.PolicyType and (row.Happiness or 0)~=0 then
items[row.PolicyType] = S( "%s %+i[ICON_HAPPINESS_1]", items[row.PolicyType] or "", row.Happiness )
end
end
local lastTip -- universal healthcare kludge
for policyType, tip in pairs(items) do
local policy = GameInfo.Policies[ policyType ]
if policyFilter( policy ) and #tip > 0 then
tip = "[ICON_BULLET]" .. PolicyColor( L(policy.Description) ) .. tip
tips:insertIf( tip~=lastTip and tip )
lastTip = tip
end
end
if gk_mode then
-- Yields enhanced by Beliefs
items = {}
for row in GameInfo.Belief_BuildingClassYieldChanges( thisBuildingClassType ) do
if row.BeliefType and (row.YieldChange or 0)~=0 then
items[row.BeliefType] = S( "%s %+i%s", items[row.BeliefType] or "", row.YieldChange, YieldIcons[row.YieldType] or "???" )
end
end
if isWorldWonder then
for row in GameInfo.Belief_YieldChangeWorldWonder() do
if row.BeliefType and (row.Yield or 0)~=0 then
items[row.BeliefType] = S( "%s %+i%s", items[row.BeliefType] or "", row.Yield, YieldIcons[row.YieldType] or "???" )
end
end
end
if bnw_mode then
for row in GameInfo.Belief_BuildingClassTourism( thisBuildingClassType ) do
if row.BeliefType and (row.Tourism or 0)~=0 then
items[row.BeliefType] = S( "%s %+i[ICON_TOURISM]", items[row.BeliefType] or "", row.Tourism )
end
end
end
for row in GameInfo.Belief_BuildingClassHappiness( thisBuildingClassType ) do
if row.BeliefType and (row.Happiness or 0)~=0 then
items[row.BeliefType] = S( "%s %+i[ICON_HAPPINESS_1]", items[row.BeliefType] or "", row.Happiness )
end
end
for beliefType, tip in pairs(items) do
local belief = GameInfo.Beliefs[beliefType]
tips:insertIf( beliefFilter( belief ) and #tip > 0 and "[ICON_BULLET]" .. BeliefColor( L(belief.ShortDescription) ) .. tip )
end
-- Other Building Yields enhanced by this Building
local buildingClassTypes = {}
for row in GameInfo.Building_BuildingClassYieldChanges( thisBuildingType ) do
SetKey( buildingClassTypes, row.BuildingClassType )
end
if civ5_mode then
for row in GameInfo.Building_BuildingClassHappiness( thisBuildingType ) do
SetKey( buildingClassTypes, row.BuildingClassType )
end
end
local condition = { BuildingType = buildingType }
for buildingClassType in pairs( buildingClassTypes ) do
condition.BuildingClassType = buildingClassType
tip = GetYieldStringSpecial( "YieldChange", "%s %+i%s", GameInfo.Building_BuildingClassYieldChanges( condition ) )
if civ5_mode then
local happinessChange = 0
for row in GameInfo.Building_BuildingClassHappiness( condition ) do
happinessChange = happinessChange + (row.Happiness or 0)
end
if happinessChange ~= 0 then
tip = S( "%s %+i[ICON_HAPPINESS_1]", tip, happinessChange )
end
end
local enhancedBuilding = GetCivBuilding( activeCivilizationType, buildingClassType )
tips:insertIf( enhancedBuilding and #tip > 0 and "[ICON_BULLET]" ..L"TXT_KEY_SV_ICONS_ALL".." ".. BuildingColor( L( enhancedBuilding.Description ) ) .. tip )
end
end
else
-- Orbital Production
tips:insertLocalizedIfNonZero( "TXT_KEY_DOMAIN_PRODUCTION_MOD", building.OrbitalProductionModifier or 0, "TXT_KEY_ORBITAL_UNITS" )
-- Orbital Coverage
tips:insertLocalizedIfNonZero( "TXT_KEY_BUILDING_ORBITAL_COVERAGE", building.OrbitalCoverageChange or 0 )
-- Anti-Orbital Strike
tips:insertLocalizedIfNonZero( "TXT_KEY_UNITPERK_RANGE_AGAINST_ORBITAL_CHANGE", building.OrbitalStrikeRangeChange or 0 )
-- Covert Ops Intrigue Cap
tips:insertLocalizedIfNonZero( "TXT_KEY_BUILDING_CITY_INTRIGUE_CAP", -(building.IntrigueCapChange or 0) * (GameDefines.MAX_CITY_INTRIGUE_LEVELS or 0) / 100 )
end
tips:insert( "----------------" )
-- Cost:
local costTip
-- League project
if bnw_mode and building.UnlockedByLeague then
if Game
and Game.GetNumActiveLeagues() > 0
and Game.GetActiveLeague()
then
costTip = L( "TXT_KEY_LEAGUE_PROJECT_COST_PER_PLAYER",
Game.GetActiveLeague():GetProjectBuildingCostPerPlayer( buildingID ) )
else
local leagueProjectReward = GameInfo.LeagueProjectRewards{ Building = buildingType }()
local leagueProject = leagueProjectReward and GameInfo.LeagueProjects{ RewardTier3 = leagueProjectReward.Type }()
local costPerPlayer = leagueProject and leagueProject.CostPerPlayer -- * GameInfo.GameSpeeds[ PreGame.GetGameSpeed() ].ConstructPercent * GameInfo.Eras[ PreGame.GetEra() ].ConstructPercent / 100000 -- GameInfo.Eras[ player:GetCurrentEra() ]
if costPerPlayer then
costTip = L( "TXT_KEY_LEAGUE_PROJECT_COST_PER_PLAYER", costPerPlayer )
end
end
-- Production
else
if productionCost > 1 then
costTip = productionCost .. "[ICON_PRODUCTION]"
local goldCost = 0
if city then
goldCost = city:GetBuildingPurchaseCost( buildingID )
elseif building.HurryCostModifier and building.HurryCostModifier >= 0 then
goldCost = (productionCost * GameDefines.GOLD_PURCHASE_GOLD_PER_PRODUCTION ) ^ GameDefines.HURRY_GOLD_PRODUCTION_EXPONENT
goldCost = (building.HurryCostModifier + 100) * goldCost / 100
goldCost = goldCost - ( goldCost % GameDefines.GOLD_PURCHASE_VISIBLE_DIVISOR )
end
if goldCost > 0 then
if costTip then
costTip = costTip .. ("(%i%%)"):format(productionCost*100/goldCost)
if civ5gk_mode then
costTip = L( "TXT_KEY_PEDIA_A_OR_B", costTip, goldCost .. g_currencyIcon )
else
costTip = costTip .. " / " .. goldCost .. g_currencyIcon
end
else
costTip = goldCost .. g_currencyIcon
end
end
end
-- Faith
if g_isReligionEnabled then
local faithCost = 0
if city then
faithCost = city:GetBuildingFaithPurchaseCost( buildingID, true )
else
faithCost = building.FaithCost or 0
end
if faithCost > 0 then
if costTip then
costTip = L( "TXT_KEY_PEDIA_A_OR_B", costTip, faithCost .. "[ICON_PEACE]" )
else
costTip = faithCost .. "[ICON_PEACE]"
end
end
end
end
tips:insert( L"TXT_KEY_PEDIA_COST_LABEL" .. " " .. ( costTip or L"TXT_KEY_FREE" ) )
-- Production Modifiers
for row in GameInfo.Policy_BuildingClassProductionModifiers( thisBuildingClassType ) do
local policy = GameInfo.Policies[ row.PolicyType ]
tips:insertIf( policyFilter( policy ) and (row.ProductionModifier or 0)~=0 and S( "[ICON_BULLET]%s +%i%%[ICON_PRODUCTION]", PolicyColor( L(policy.Description) ), row.ProductionModifier ) )
end
if civBE_mode then
-- Affinity Level Requirement
for affinityPrereq in GameInfo.Building_AffinityPrereqs( thisBuildingType ) do
local affinityInfo = (tonumber( affinityPrereq.Level) or 0 ) > 0 and GameInfo.Affinity_Types[ affinityPrereq.AffinityType ]
tips:insertIf( affinityInfo and L( "TXT_KEY_AFFINITY_LEVEL_REQUIRED", affinityInfo.ColorType, affinityPrereq.Level, affinityInfo.IconString or "???", affinityInfo.Description ) )
end
end
-- Civilization:
local civs = table()
for row in GameInfo.Civilization_BuildingClassOverrides( thisBuildingType ) do
civs:insertLocalizedIf( ( GameInfo.Civilizations[ row.CivilizationType ] or{} ).ShortDescription )
end
tips:insertIf( #civs > 0 and L"TXT_KEY_PEDIA_CIVILIZATIONS_LABEL" .. " " .. civs:concat(", ") )
-- Replaces:
local buildingReplaced = buildingClass and GameInfo.Buildings[ buildingClass.DefaultBuilding ]
tips:insertIf( buildingReplaced and buildingReplaced ~= building and L"TXT_KEY_PEDIA_REPLACES_LABEL".." "..BuildingColor( L(buildingReplaced.Description) ) ) --!!! row
-- Holy city
tips:insertIf( building.HolyCity and BeliefColor( L"TXT_KEY_RO_WR_HOLY_CITY" ) )
-- Required Social Policy:
local item = building.PolicyBranchType and GameInfo.PolicyBranchTypes[ building.PolicyBranchType ]
tips:insertIf( item and L"TXT_KEY_PEDIA_PREREQ_POLICY_LABEL" .. " " .. PolicyColor( L(item.Description) ) )
-- Prerequisite Techs:
local techs = table()
item = building.PrereqTech and GameInfo.Technologies[ building.PrereqTech ]
techs:insertIf( item and item.ID > 0 and TechColor( L(item.Description) ) )
for row in GameInfo.Building_TechAndPrereqs( thisBuildingType ) do
item = GameInfo.Technologies[ row.TechType ]
techs:insertIf( item and item.ID > 0 and TechColor( L(item.Description) ) )
end
tips:insertIf( #techs > 0 and L"TXT_KEY_PEDIA_PREREQ_TECH_LABEL" .. " " .. techs:concat( ", " ) )
-- Required Buildings:
local buildings = table()
for row in GameInfo.Building_PrereqBuildingClasses( thisBuildingType ) do
local item = GetCivBuilding( activeCivilizationType, row.BuildingClassType )
if item then
tips:insert( L"TXT_KEY_PEDIA_REQ_BLDG_LABEL".." ".. BuildingColor( L(item.Description) ).." ("..((row.NumBuildingNeeded or -1)==-1 and L"TXT_KEY_SV_ICONS_ALL" or row.NumBuildingNeeded)..")" )
buildings[ item ] = true
end
end
for row in GameInfo.Building_ClassesNeededInCity( thisBuildingType ) do
local item = GetCivBuilding( activeCivilizationType, row.BuildingClassType )
buildings:insertIf( item and not buildings[ item ] and BuildingColor( L(item.Description) ) )
end
items = {}
if (building.MutuallyExclusiveGroup or -1) >= 0 then
for row in GameInfo.Buildings{ MutuallyExclusiveGroup = building.MutuallyExclusiveGroup } do
SetKey( items, row.BuildingClass ~= buildingClassType and row.BuildingClass )
end
end
for buildingClassType in pairs( items ) do
local item = GetCivBuilding( activeCivilizationType, buildingClassType )
buildings:insertIf( item and TextColor( "[COLOR_RED]", L(item.Description) ) )
end
tips:insertIf( #buildings > 0 and L"TXT_KEY_PEDIA_REQ_BLDG_LABEL" .. " " .. buildings:concat(", ") )
-- Local Resources Required:
local resources = table()
for row in GameInfo.Building_LocalResourceAnds( thisBuildingType ) do
local resource = GameInfo.Resources[ row.ResourceType ]
resources:insertIf( resource and resource.IconString ) -- .. L(resource.Description) )
end
if #resources > 0 then
resources = table( resources:concat(", ") )
end
for row in GameInfo.Building_LocalResourceOrs( thisBuildingType ) do
local resource = GameInfo.Resources[ row.ResourceType ]
resources:insertIf( resource and resource.IconString ) -- .. L(resource.Description) )
end
if civ5gk_mode then
local txt = resources[1] or ""
for i = 2, #resources do
txt = L( "TXT_KEY_PEDIA_A_OR_B", txt, resources[i] )
end
resources = txt
else
resources = resources:concat(" / ")
end
tips:insertIf( #resources > 0 and L"TXT_KEY_PEDIA_LOCAL_RESRC_LABEL" .. " " .. resources )
local terrains = table()
terrains:insertLocalizedIf( building.Water and "TXT_KEY_TERRAIN_COAST" )
terrains:insertLocalizedIf( building.River and "TXT_KEY_PLOTROLL_RIVER" )
terrains:insertLocalizedIf( building.FreshWater and "TXT_KEY_ABLTY_FRESH_WATER_STRING" )
terrains:insertIf( building.Mountain and L"TXT_KEY_TERRAIN_MOUNTAIN" .. "[ICON_RANGE_STRENGTH]1" )
terrains:insertIf( building.NearbyMountainRequired and L"TXT_KEY_TERRAIN_MOUNTAIN" .. "[ICON_RANGE_STRENGTH]2" )
terrains:insertLocalizedIf( building.Hill and "TXT_KEY_TERRAIN_HILL" )
terrains:insertLocalizedIf( building.Flat and "TXT_KEY_MAP_OPTION_FLAT" )
-- mandatory terrain
local terrain = building.NearbyTerrainRequired and GameInfo.Terrains[ building.NearbyTerrainRequired ]
terrains:insertIf( terrain and L(terrain.Description) .. "[ICON_RANGE_STRENGTH]1" )
-- prohibited terrain
terrain = building.ProhibitedCityTerrain and GameInfo.Terrains[ building.ProhibitedCityTerrain ]
terrains:insertIf( terrain and TextColor( "[COLOR_RED]", L( terrain.Description ) ) )
tips:insertIf( #terrains > 0 and L"TXT_KEY_PEDIA_TERRAIN_LABEL"..": "..terrains:concat(", ") )
-- Becomes Obsolete with:
local obsoleteTech = building.ObsoleteTech and GameInfo.Technologies[ building.ObsoleteTech ]
tips:insertIf( obsoleteTech and L"TXT_KEY_PEDIA_OBSOLETE_TECH_LABEL" .. " " .. TechColor( L(obsoleteTech.Description) ) )
-- Buildings Unlocked:
local buildingsUnlocked = {}
for row in GameInfo.Building_ClassesNeededInCity( thisBuildingClassType ) do
local buildingUnlocked = GameInfo.Buildings[ row.BuildingType ]
SetKey( buildingsUnlocked, buildingUnlocked and buildingUnlocked.BuildingClass )
end
local buildings = table()
for buildingUnlocked in pairs(buildingsUnlocked) do
buildingUnlocked = GetCivBuilding( activeCivilizationType, buildingUnlocked )
buildings:insertIf( buildingUnlocked and BuildingColor( L(buildingUnlocked.Description) ) )
end
tips:insertIf( #buildings > 0 and L"TXT_KEY_PEDIA_BLDG_UNLOCK_LABEL" .. " " .. buildings:concat(", ") )
-- Limited number can be built
if isWorldWonder then
tips:append( L( "TXT_KEY_NO_ACTION_GAME_COUNT_MAX", buildingClass.MaxGlobalInstances ) )
end
if (buildingClass.MaxTeamInstances or 0) > 0 then
tips:append( L( "TXT_KEY_NO_ACTION_TEAM_COUNT_MAX", buildingClass.MaxTeamInstances ) )
end
if (buildingClass.MaxPlayerInstances or 0) > 0 then
tips:append( L( "TXT_KEY_NO_ACTION_PLAYER_COUNT_MAX", buildingClass.MaxPlayerInstances ) )
end
-- Pre-written Help text
return AddPreWrittenHelpTextAndConcat( tips, building )
end
-------------------------------------------------
-- Help text for Improvements
-------------------------------------------------
local function getHelpTextForImprovement( improvementID )
local improvement = improvementID and GameInfo.Improvements[ improvementID ]
local thisImprovementType = { ImprovementType = improvement.Type or -1 }
local ItemBuild = GameInfo.Builds( thisImprovementType )()
local tip, items, item, condition
-- Name
local tips = table( TextColor( "[COLOR_GREEN]", Locale.ToUpper( improvement.Description ) ) )
-- Maintenance:
tips:insertIf( (improvement[g_maintenanceCurrency] or 0) ~= 0 and S( "%s %+i%s", L"TXT_KEY_PEDIA_MAINT_LABEL", -improvement[g_maintenanceCurrency], g_currencyIcon) )
-- Improved Resources
items = table()
for row in GameInfo.Improvement_ResourceTypes( thisImprovementType ) do
item = GameInfo.Resources[ row.ResourceType ]
items:insertIf( item and item.IconString )
end
tips:insertIf( #items > 0 and L"TXT_KEY_PEDIA_IMPROVES_RESRC_LABEL" .. " " .. items:concat( ", " ) )
-- Yields
items = table()
for row in GameInfo.Improvement_Yields( thisImprovementType ) do
SetKey( items, (row.Yield or 0)~=0 and row.YieldType, S("%s %+i%s", items[ row.YieldType ] or "", row.Yield, YieldIcons[ row.YieldType ] or "???" ) )
end
for row in GameInfo.Improvement_FreshWaterYields( thisImprovementType ) do
SetKey( items, (row.Yield or 0)~=0 and row.YieldType, S( "%s %s %+i%s", items[ row.YieldType ] or "", L"TXT_KEY_ABLTY_FRESH_WATER_STRING", row.Yield, YieldIcons[ row.YieldType ] or "???" ) )
end
if bnw_mode then
for row in GameInfo.Improvement_YieldPerEra( thisImprovementType ) do
SetKey( items, (row.Yield or 0)~=0 and row.YieldType, S( "%s %+i%s/%s", items[ row.YieldType ] or "", row.Yield, YieldIcons[ row.YieldType ] or "???", L"TXT_KEY_AD_SETUP_GAME_ERA" ) )
end
end
for yieldType, tip in pairs( items ) do
tips:insert( (YieldNames[ yieldType ] or "???" ) .. ":" .. tip )
end
-- Culture
tips:insertIf( (improvement.Culture or 0)~=0 and S( "%s: %+i[ICON_CULTURE]", L"TXT_KEY_CITYVIEW_CULTURE_TEXT", improvement.Culture ) )
-- Mountain Bonus
tip = GetYieldString( GameInfo.Improvement_AdjacentMountainYieldChanges( thisImprovementType ) )
tips:insertIf( #tip>0 and L"TXT_KEY_PEDIA_MOUNTAINADJYIELD_LABEL" .. tip )
-- Defense Modifier
tips:insertIf( (improvement.DefenseModifier or 0)~=0 and S( "%s %+i%%[ICON_STRENGTH]", L"TXT_KEY_PEDIA_DEFENSE_LABEL", improvement.DefenseModifier ) )
-- Tech yield changes
items = {}
condition = { ImprovementType = improvement.Type }
for row in GameInfo.Improvement_TechYieldChanges( thisImprovementType ) do
SetKey( items, row.TechType )
end
for techType in pairs( items ) do
item = GameInfo.Technologies[ techType ]
if item then
condition.TechType = techType
tip = GetYieldString( GameInfo.Improvement_TechYieldChanges( condition ) )
tips:insertIf( tip~="" and "[ICON_BULLET]" .. TechColor( L(item.Description) ) .. tip )
end
end
items = {}
for row in GameInfo.Improvement_TechFreshWaterYieldChanges( thisImprovementType ) do
SetKey( items, row.TechType )
end
for techType in pairs(items) do
item = GameInfo.Technologies[ techType ]
if item then
condition.TechType = techType
tip = GetYieldString( GameInfo.Improvement_TechFreshWaterYieldChanges( condition ) )
tips:insertIf( tip~="" and "[ICON_BULLET]" .. TechColor( L(item.Description) ) .. " (" .. L"TXT_KEY_ABLTY_FRESH_WATER_STRING" .. ")" .. tip )
end
end
items = {}
for row in GameInfo.Improvement_TechNoFreshWaterYieldChanges( thisImprovementType ) do
SetKey( items, row.TechType )
end
for techType in pairs(items) do
item = GameInfo.Technologies[ techType ]
if item then
condition.TechType = techType
tip = GetYieldString( GameInfo.Improvement_TechNoFreshWaterYieldChanges( condition ) )
tips:insertIf( tip~="" and "[ICON_BULLET]" .. TechColor( L(item.Description) ) .. " (" .. L("TXT_KEY_ABLTY_NO_FRESH_WATER_STRING") .. ")" .. tip )
end
end
-- Policy yield changes
items = {}
condition = { ImprovementType = improvement.Type }
for row in GameInfo.Policy_ImprovementYieldChanges( thisImprovementType ) do
SetKey( items, row.PolicyType )
end
for row in GameInfo.Policy_ImprovementCultureChanges( thisImprovementType ) do
SetKey( items, row.PolicyType )
end
for policyType in pairs(items) do
item = GameInfo.Policies[ policyType ]
if item then
tip = ""
condition.PolicyType = policyType
tip = GetYieldString( GameInfo.Policy_ImprovementYieldChanges( condition ) )
for row in GameInfo.Policy_ImprovementCultureChanges( condition ) do
if (row.CultureChange or 0)~=0 then
tip = S( "%s %+i[ICON_CULTURE]", tip, row.CultureChange )
end
end
tips:insertIf( tip~="" and "[ICON_BULLET]" .. PolicyColor( L(item.Description) ) .. tip )
end
end
-- Belief yield changes
if g_isReligionEnabled then
items = {}
condition = { ImprovementType = improvement.Type }
for row in GameInfo.Belief_ImprovementYieldChanges( thisImprovementType ) do
SetKey( items, row.BeliefType )
end
for beliefType in pairs(items) do
item = GameInfo.Beliefs[ beliefType ]
if item then
condition.BeliefType = beliefType
tip = GetYieldString( GameInfo.Belief_ImprovementYieldChanges( condition ) )
tips:insertIf( tip~="" and "[ICON_BULLET]" .. BeliefColor( L(item.ShortDescription) ) .. tip )
end
end
end
-- Resource Yields
local thisImprovementAndResourceTypes = { ImprovementType = improvement.Type or -1 }
for resource in GameInfo.Resources() do
thisImprovementAndResourceTypes.ResourceType = resource.Type or -1
tip = GetYieldString( GameInfo.Improvement_ResourceType_Yields( thisImprovementAndResourceTypes ) )
tips:insertIf( #tip > 0 and (resource.IconString or "???") .. " " .. L(resource.Description) .. ":" .. tip )
end
tips:insert( "----------------" )
-- Civ Requirement
item = improvement.SpecificCivRequired and improvement.CivilizationType
item = item and GameInfo.Civilizations[ item ]
tips:insertIf( item and L"TXT_KEY_PEDIA_CIVILIZATIONS_LABEL".." "..L( item.ShortDescription ) )
-- Tech Requirements
item = ItemBuild and ItemBuild.PrereqTech and GameInfo.Technologies[ItemBuild.PrereqTech]
tips:insertIf( item and item.ID > 0 and L"TXT_KEY_PEDIA_PREREQ_TECH_LABEL" .. " " .. TechColor( L(item.Description) ) )
-- Terrain
items = table()
for row in GameInfo.Improvement_ValidTerrains( thisImprovementType ) do
item = GameInfo.Terrains[ row.TerrainType ]
items:insertIf( item and L( item.Description ) )
end
for row in GameInfo.Improvement_ValidFeatures( thisImprovementType ) do
item = GameInfo.Features[ row.FeatureType ]
items:insertIf( item and L( item.Description ) )
end
if bnw_mode then
for row in GameInfo.Improvement_ValidImprovements( thisImprovementType ) do
item = GameInfo.Improvements[ row.PrereqImprovement ]
items:insertIf( item and L(item.Description ) )
end
end
for row in GameInfo.Improvement_ResourceTypes( thisImprovementType ) do
item = GameInfo.Resources[ row.ResourceType ]
items:insertIf( item and row.ResourceMakesValid and item.IconString )
end
-- items:insertIf( improvement.HillsMakesValid and L( (GameInfo.Terrains.TERRAIN_HILL or {}).Description ) )-- hackery for hills
tips:insertIf( #items > 0 and L"TXT_KEY_PEDIA_FOUNDON_LABEL" .. " " .. items:concat( ", " ) )
--[[
-- Upgrade
item = improvement.ImprovementUpgrade and GameInfo.Improvements[ improvement.ImprovementUpgrade ]
-- TODO xml text
tips:insertIf( item and L"" .. " " .. L(item.Description) )
--]]
-- Pre-written Help text
return AddPreWrittenHelpTextAndConcat( tips, improvement )
end
-- ===========================================================================
-- Help text for Projects
-- ===========================================================================
local function getHelpTextForProject( projectID )
local project = GameInfo.Projects[ projectID ]
-- Name & Cost
local productionCost = (Game and Players[Game.GetActivePlayer()]:GetProjectProductionNeeded(projectID)) or project.Cost
local tips = table( Locale.ToUpper( project.Description ), "----------------", L"TXT_KEY_PEDIA_COST_LABEL" .. " " .. productionCost .. "[ICON_PRODUCTION]" )
if civBE_mode then
-- Affinity Level Requirement
for affinityPrereq in GameInfo.Project_AffinityPrereqs{ ProjectType = project.Type } do
local affinityInfo = (tonumber( affinityPrereq.Level) or 0 ) > 0 and GameInfo.Affinity_Types[ affinityPrereq.AffinityType ]
tips:insertIf( affinityInfo and L( "TXT_KEY_AFFINITY_LEVEL_REQUIRED", affinityInfo.ColorType, affinityPrereq.Level, affinityInfo.IconString or "???", affinityInfo.Description ) )
end
end
-- Requirements?
tips:insertLocalizedIf( project.Requirements )
-- Pre-written Help text
return AddPreWrittenHelpTextAndConcat( tips, project )
end
-- ===========================================================================
-- Help text for Processes
-- ===========================================================================
local function getHelpTextForProcess( processID )
local process = GameInfo.Processes[ processID ]
-- Name
local tips = table( Locale.ToUpper( process.Description ), "----------------" )
for row in GameInfo.Process_ProductionYields{ ProcessType = process.Type } do
yield = GameInfo.Yields[ row.YieldType ]
percent = yield and tonumber( row.Yield ) or 0
if percent == 0 then
elseif civBE_mode then
tips:insertLocalized( "TXT_KEY_PROCESS_GENERIC_HELP", percent, yield.IconString or "???", yield.Description )
else
tips:insert( S( "%s = %i%%([ICON_PRODUCTION])", yield.IconString or "???", percent ) )
end
end
-- League Project text
local activeLeague = civ5bnw_mode and Game and not Game.IsOption("GAMEOPTION_NO_LEAGUES") and Game.GetActiveLeague()
if activeLeague then
for row in GameInfo.LeagueProjects{ Process = process.Type } do
tips:insert( activeLeague:GetProjectDetails( GameInfoTypes[row.Type], Game.GetActivePlayer() ) )
end
end
-- Pre-written Help text
return AddPreWrittenHelpTextAndConcat( tips, process )
end
-- ===========================================================================
-- PLAYER PERK (civ BE only)
-- ===========================================================================
function GetHelpTextForPlayerPerk( perkID )
local perkInfo = GameInfo.PlayerPerks[ perkID ]
-- Name
local tips = table( Locale.ToUpper( perkInfo.Description ), "----------------" )
-- Yield from Buildings
for playerPerkBuildingYieldEffect in GameInfo.PlayerPerks_BuildingYieldEffects{ PlayerPerkType = perkInfo.Type } do
local building = GameInfo.BuildingClasses[ playerPerkBuildingYieldEffect.BuildingClassType ]
local yield = building and GameInfo.Yields[ playerPerkBuildingYieldEffect.YieldType ]
if yield then
tips:insertLocalized( "TXT_KEY_PLAYERPERK_ALL_BUILDING_YIELD_EFFECT", playerPerkBuildingYieldEffect.FlatYield, yield.IconString or "???", yield.Description, building.Description )
end
end
-- Pre-written Help text
return AddPreWrittenHelpTextAndConcat( tips, perkInfo )
end
-- ===========================================================================
-- Tooltips for Yield & Similar (e.g. Culture)
-- ===========================================================================
-- Helper function to build yield tooltip string
local function getYieldTooltip( city, yieldID, baseYield, totalYield, yieldIconString, strModifiersString )
yieldIconString = yieldIconString or YieldIcons[yieldID] or "???"
local strYieldBreakdown = ""
local tips = table()
-- Base Yield from Terrain
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_TERRAIN", city:GetBaseYieldRateFromTerrain( yieldID ), yieldIconString )
-- Base Yield from Buildings
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_BUILDINGS", city:GetBaseYieldRateFromBuildings( yieldID ), yieldIconString )
-- Base Yield from Specialists
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_SPECIALISTS", city:GetBaseYieldRateFromSpecialists( yieldID ), yieldIconString )
-- Base Yield from Misc
tips:insertLocalizedBulletIfNonZero( yieldID == YieldTypes.YIELD_SCIENCE and "TXT_KEY_YIELD_FROM_POP" or "TXT_KEY_YIELD_FROM_MISC", city:GetBaseYieldRateFromMisc( yieldID ), yieldIconString )
-- Base Yield from Population
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_POP_EXTRA", city:GetYieldPerPopTimes100( yieldID ) * city:GetPopulation() / 100, yieldIconString )
-- Base Yield from Religion
if gk_mode then
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_RELIGION", city:GetBaseYieldRateFromReligion( yieldID ), yieldIconString )
end
if civBE_mode then
-- Yield from Production Processes
local yieldFromProcesses = city:GetYieldRateFromProductionProcesses( yieldID )
if yieldFromProcesses ~= 0 then
local processInfo = GameInfo.Processes[ city:GetProductionProcess() ]
strModifiersString = strModifiersString .. "[NEWLINE][ICON_BULLET]" .. L( "TXT_KEY_SHORT_YIELD_FROM_SPECIFIC_OBJECT", yieldFromProcesses, yieldIconString, processInfo and processInfo.Description or "???" )
end
-- Base Yield from Loadout (colonists)
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_LOADOUT", city:GetYieldPerTurnFromLoadout( yieldID ), yieldIconString )
end
-- Food eaten by pop
if yieldID == YieldTypes.YIELD_FOOD then
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_FOOD_FROM_TRADE_ROUTES", city:GetYieldRate( yieldID, false ) - city:GetYieldRate( yieldID, true ) )
strModifiersString = "[NEWLINE][ICON_BULLET]" .. L( "TXT_KEY_YIELD_EATEN_BY_POP", city:FoodConsumption( true, 0 ), yieldIconString ) .. strModifiersString
elseif civBE_mode then
local yieldFromTrade = city:GetYieldPerTurnFromTrade(iYieldType)
if yieldFromTrade ~= 0 then
strModifiersString = strModifiersString .. "[NEWLINE][ICON_BULLET]" .. L( "TXT_KEY_YIELD_FROM_TRADE", yieldFromTrade, yieldIconString )
end
end
-- Modifiers
if strModifiersString ~= "" then
tips:insert( "----------------" )
tips:insertLocalized( "TXT_KEY_YIELD_BASE", baseYield, yieldIconString )
tips:insert( strModifiersString )
end
-- Total
tips:insert( "----------------" )
tips:insertLocalized( totalYield >= 0 and "TXT_KEY_YIELD_TOTAL" or "TXT_KEY_YIELD_TOTAL_NEGATIVE", totalYield, yieldIconString )
return tips:concat( "[NEWLINE]" )
end
-- Yield Tooltip Helper
local function getYieldTooltipHelper( city, yieldID, yieldIconString )
return getYieldTooltip( city, yieldID, city:GetBaseYieldRate( yieldID ) + city:GetYieldPerPopTimes100( yieldID ) * city:GetPopulation() / 100, yieldID == YieldTypes.YIELD_FOOD and city:FoodDifferenceTimes100()/100 or city:GetYieldRateTimes100( yieldID )/100, yieldIconString, city:GetYieldModifierTooltip( yieldID ) )
end
-- FOOD
local function getFoodTooltip( city )
local tipText
local isNoob = civBE_mode or not OptionsManager.IsNoBasicHelp()
local cityPopulation = city:GetPopulation()
local foodStoredTimes100 = city:GetFoodTimes100()
local foodPerTurnTimes100 = city:FoodDifferenceTimes100( true ) -- true means size 1 city cannot starve
local foodThreshold = city:GrowthThreshold()
local turnsToCityGrowth = city:GetFoodTurnsLeft()
if foodPerTurnTimes100 < 0 then
foodThreshold = 0
turnsToCityGrowth = math.floor( foodStoredTimes100 / -foodPerTurnTimes100 ) + 1
tipText = "[COLOR_WARNING_TEXT]" .. cityPopulation - 1 .. "[ENDCOLOR][ICON_CITIZEN]"
if isNoob then
tipText = L( "TXT_KEY_CITYVIEW_STARVATION_TEXT" ) .. "[NEWLINE]"
.. L( "TXT_KEY_PROGRESS_TOWARDS", tipText )
end
elseif city:IsForcedAvoidGrowth() then
tipText = "[ICON_LOCKED]".. cityPopulation .."[ICON_CITIZEN]"
if isNoob then
tipText = L"TXT_KEY_CITYVIEW_FOCUS_AVOID_GROWTH_TEXT" .. " " .. tipText
end
foodPerTurnTimes100 = 0
elseif foodPerTurnTimes100 == 0 then
tipText = "[COLOR_YELLOW]" .. cityPopulation .. "[ENDCOLOR][ICON_CITIZEN]"
if isNoob then
tipText = L( "TXT_KEY_PROGRESS_TOWARDS", tipText )
end
else
tipText = "[COLOR_POSITIVE_TEXT]" .. cityPopulation +1 .. "[ENDCOLOR][ICON_CITIZEN]"
if isNoob then
tipText = L( "TXT_KEY_PROGRESS_TOWARDS", tipText )
end
end
tipText = getYieldTooltipHelper( city, YieldTypes.YIELD_FOOD ) .. "[NEWLINE][NEWLINE]" .. tipText .. " " .. foodStoredTimes100 / 100 .. "[ICON_FOOD]/ " .. foodThreshold .. "[ICON_FOOD][NEWLINE]"
if foodPerTurnTimes100 == 0 then
tipText = tipText .. L"TXT_KEY_CITYVIEW_STAGNATION_TEXT"
else
local foodOverflowTimes100 = foodPerTurnTimes100 * turnsToCityGrowth + foodStoredTimes100 - foodThreshold * 100
if turnsToCityGrowth > 1 then
tipText = S( "%s%s %+g[ICON_FOOD] ", tipText, L( "TXT_KEY_STR_TURNS", turnsToCityGrowth -1 ), ( foodOverflowTimes100 - foodPerTurnTimes100 ) / 100 )
end
tipText = S( "%s%s%s[ENDCOLOR] %+g[ICON_FOOD]", tipText, foodPerTurnTimes100 < 0 and "[COLOR_WARNING_TEXT]" or "[COLOR_POSITIVE_TEXT]", Locale.ToUpper( L( "TXT_KEY_STR_TURNS", turnsToCityGrowth ) ), foodOverflowTimes100 / 100 )
end
if isNoob then
return L"TXT_KEY_FOOD_HELP_INFO" .. "[NEWLINE][NEWLINE]" .. tipText
else
return tipText
end
end
-- GOLD
local function getGoldTooltip( city )
if civ5_mode and OptionsManager.IsNoBasicHelp() then
return getYieldTooltipHelper( city, YieldTypes.YIELD_GOLD )
else
return L"TXT_KEY_GOLD_HELP_INFO" .. "[NEWLINE][NEWLINE]" .. getYieldTooltipHelper( city, YieldTypes.YIELD_GOLD )
end
end
-- ENERGY
local function getEnergyTooltip( city )
return L"TXT_KEY_ENERGY_HELP_INFO" .. "[NEWLINE][NEWLINE]" .. getYieldTooltipHelper( city, YieldTypes.YIELD_ENERGY )
end
-- SCIENCE
local function getScienceTooltip( city )
if g_isScienceEnabled then
if civ5_mode and OptionsManager.IsNoBasicHelp() then
return getYieldTooltipHelper( city, YieldTypes.YIELD_SCIENCE )
else
return L"TXT_KEY_SCIENCE_HELP_INFO" .. "[NEWLINE][NEWLINE]" .. getYieldTooltipHelper( city, YieldTypes.YIELD_SCIENCE )
end
else
return L"TXT_KEY_TOP_PANEL_SCIENCE_OFF_TOOLTIP"
end
end
-- PRODUCTION
local function getProductionTooltip( city )
local isNoob = civBE_mode or not OptionsManager.IsNoBasicHelp()
local cityProductionName = city:GetProductionNameKey()
local tipText = ""
local productionColor
local productionPerTurn100 = city:GetCurrentProductionDifferenceTimes100( false, false ) -- food = false, overflow = false
local productionStored100 = city:GetProductionTimes100() + city:GetCurrentProductionDifferenceTimes100(false, true) - productionPerTurn100
local productionNeeded = 0
local productionTurnsLeft = 1
local unitProductionID = city:GetProductionUnit()
local buildingProductionID = city:GetProductionBuilding()
local projectProductionID = city:GetProductionProject()
local processProductionID = city:GetProductionProcess()
if unitProductionID ~= -1 then
-- tipText = getHelpTextForUnit( unitProductionID, false )
productionColor = UnitColor
elseif buildingProductionID ~= -1 then
-- tipText = getHelpTextForBuilding( buildingProductionID, true, true, true, city )
productionColor = BuildingColor
elseif projectProductionID ~= -1 then
-- tipText = getHelpTextForProject( projectProductionID, false )
productionColor = BuildingColor
elseif processProductionID ~= -1 then
tipText = getHelpTextForProcess( processProductionID, false )
else
if isNoob then
tipText = L( "TXT_KEY_CITY_NOT_PRODUCING", city:GetName() )
else
tipText = L"TXT_KEY_PRODUCTION_NO_PRODUCTION"
end
end
if productionColor then
productionNeeded = city:GetProductionNeeded()
productionTurnsLeft = city:GetProductionTurnsLeft()
tipText = productionColor( Locale.ToUpper( cityProductionName ) )
if isNoob then
tipText = L( "TXT_KEY_PROGRESS_TOWARDS", tipText )
end
tipText = tipText .. " " .. productionStored100 / 100 .. "[ICON_PRODUCTION]/ " .. productionNeeded .. "[ICON_PRODUCTION]"
if productionPerTurn100 > 0 then
tipText = tipText .. "[NEWLINE]"
local productionOverflow100 = productionPerTurn100 * productionTurnsLeft + productionStored100 - productionNeeded * 100
if productionTurnsLeft > 1 then
tipText = S( "%s%s %+g[ICON_PRODUCTION] ", tipText, L( "TXT_KEY_STR_TURNS", productionTurnsLeft -1 ), ( productionOverflow100 - productionPerTurn100 ) / 100 )
end
tipText = S( "%s%s %+g[ICON_PRODUCTION]", tipText, productionColor( Locale.ToUpper( L( "TXT_KEY_STR_TURNS", productionTurnsLeft ) ) ), productionOverflow100 / 100 )
end
end
local strModifiersString = city:GetYieldModifierTooltip( YieldTypes.YIELD_PRODUCTION )
-- Extra Production from Food (ie. producing Colonists)
if yieldID == YieldTypes.YIELD_PRODUCTION and city:IsFoodProduction() then
local productionFromFood = city:GetFoodProduction()
if productionFromFood > 0 then
strModifiersString = strModifiersString .. L( "TXT_KEY_PRODMOD_FOOD_CONVERSION", productionFromFood )
end
end
tipText = getYieldTooltip( city, YieldTypes.YIELD_PRODUCTION, city:GetBaseYieldRate( YieldTypes.YIELD_PRODUCTION ), productionPerTurn100 / 100, "[ICON_PRODUCTION]", strModifiersString ) .. "[NEWLINE][NEWLINE]" .. tipText
-- Basic explanation of production
if isNoob then
return L"TXT_KEY_PRODUCTION_HELP_INFO" .. "[NEWLINE][NEWLINE]" .. tipText
else
return tipText
end
end
-- HEALTH
function GetHealthTooltip(city)
local tips = table( L"TXT_KEY_HEALTH_HELP_INFO", "", L"TXT_KEY_HEALTH_HELP_INFO_POP_CAP_WARNING", "" )
-- base Health
local localHealth = city:GetLocalHealth()
local healthFromTerrain = city:GetHealthFromTerrain()
local healthFromBuildings = city:GetHealthFromBuildings()
local baseLocalHealth = healthFromTerrain + healthFromBuildings
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_BUILDINGS", healthFromBuildings, "[ICON_HEALTH_1]" )
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_YIELD_FROM_TERRAIN", healthFromTerrain, "[ICON_HEALTH_1]" )
tips:insertLocalized( "TXT_KEY_YIELD_BASE", baseLocalHealth, "[ICON_HEALTH_1]" )
tips:insert( "----------------" )
-- health Modifier
local healthModifier = city:GetTotalHealthModifier() - 100
if healthModifier ~= 0 then
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_HEALTH_BUILDING_MOD_INFO", healthModifier )
tips:insert( "----------------" )
end
-- total Health
tips:insertLocalized( "TXT_KEY_YIELD_TOTAL", localHealth, localHealth < 0 and "[ICON_HEALTH_3]" or "[ICON_HEALTH_1]" )
-- if local health is positive and our output is higher than the city's population, include the cap reminder
if baseLocalHealth > localHealth then
tips:append( L("TXT_KEY_HEALTH_POP_CAPPED", city:GetPopulation() ) )
end
return tips:concat( "[NEWLINE]" )
end
-- CULTURE
local function getCultureTooltip( city )
local tips = table()
local cityOwner = Players[city:GetOwner()]
local culturePerTurn, cultureStored, cultureNeeded, cultureFromBuildings, cultureFromPolicies, cultureFromSpecialists, cultureFromTraits, baseCulturePerTurn
-- Thanks fo Firaxis Cleverness...
if civ5_mode then
culturePerTurn = city:GetJONSCulturePerTurn()
cultureStored = city:GetJONSCultureStored()
cultureNeeded = city:GetJONSCultureThreshold()
cultureFromBuildings = city:GetJONSCulturePerTurnFromBuildings()
cultureFromPolicies = city:GetJONSCulturePerTurnFromPolicies()
cultureFromSpecialists = city:GetJONSCulturePerTurnFromSpecialists()
cultureFromTraits = city:GetJONSCulturePerTurnFromTraits()
baseCulturePerTurn = city:GetBaseJONSCulturePerTurn()
else
culturePerTurn = city:GetCulturePerTurn()
cultureStored = city:GetCultureStored()
cultureNeeded = city:GetCultureThreshold()
cultureFromBuildings = city:GetCulturePerTurnFromBuildings()
cultureFromPolicies = city:GetCulturePerTurnFromPolicies()
cultureFromSpecialists = city:GetCulturePerTurnFromSpecialists()
cultureFromTraits = city:GetCulturePerTurnFromTraits()
baseCulturePerTurn = city:GetBaseCulturePerTurn()
end
if civBE_mode or not OptionsManager.IsNoBasicHelp() then
tips:insertLocalized( "TXT_KEY_CULTURE_HELP_INFO" )
tips:insert( "" )
end
-- Culture from Buildings
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_BUILDINGS", cultureFromBuildings )
-- Culture from Policies
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_POLICIES", cultureFromPolicies )
-- Culture from Specialists
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_SPECIALISTS", cultureFromSpecialists )
-- Culture from Religion
if civ5gk_mode then
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_RELIGION", city:GetJONSCulturePerTurnFromReligion() )
end
if civ5bnw_mode then
-- Culture from Great Works
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_GREAT_WORKS", city:GetJONSCulturePerTurnFromGreatWorks() )
-- Culture from Leagues
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_LEAGUES", city:GetJONSCulturePerTurnFromLeagues() )
end
-- Culture from Terrain
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_TERRAIN", gk_mode and city:GetBaseYieldRateFromTerrain( YieldTypes.YIELD_CULTURE ) or city:GetJONSCulturePerTurnFromTerrain() )
-- Culture from Traits
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_FROM_TRAITS", cultureFromTraits )
-- Base Total
if baseCulturePerTurn ~= culturePerTurn then
tips:insert( "----------------" )
tips:insertLocalized( "TXT_KEY_YIELD_BASE", baseCulturePerTurn, "[ICON_CULTURE]" )
tips:insert( "" )
end
-- Empire Culture modifier
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_PLAYER_MOD", cityOwner and cityOwner:GetCultureCityModifier() or 0 )
if civ5_mode then
-- City Culture modifier
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_CITY_MOD", city:GetCultureRateModifier())
-- Culture Wonders modifier
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_CULTURE_WONDER_BONUS", city:GetNumWorldWonders() > 0 and cityOwner and cityOwner:GetCultureWonderMultiplier() or 0 )
end
-- Puppet modifier
local puppetMod = city:IsPuppet() and GameDefines.PUPPET_CULTURE_MODIFIER or 0
if puppetMod ~= 0 then
tips:append( L( "TXT_KEY_PRODMOD_PUPPET", puppetMod ) )
end
-- Total
tips:insert( "----------------" )
tips:insertLocalized( "TXT_KEY_YIELD_TOTAL", culturePerTurn, "[ICON_CULTURE]" )
-- Tile growth
tips:insert( "" )
tips:insertLocalized( "TXT_KEY_CULTURE_INFO", "[COLOR_MAGENTA]" .. cultureStored .. "[ICON_CULTURE][ENDCOLOR]", "[COLOR_MAGENTA]" .. cultureNeeded .. "[ICON_CULTURE][ENDCOLOR]" )
if culturePerTurn > 0 then
local tipText = ""
local turnsRemaining = math.max(math.ceil((cultureNeeded - cultureStored ) / culturePerTurn), 1)
local overflow = culturePerTurn * turnsRemaining + cultureStored - cultureNeeded
if turnsRemaining > 1 then
tipText = S( "%s %+g[ICON_CULTURE] ", L( "TXT_KEY_STR_TURNS", turnsRemaining -1 ), overflow - culturePerTurn )
end
tips:insert( S( "%s[COLOR_MAGENTA]%s[ENDCOLOR] %+g[ICON_CULTURE]", tipText, Locale.ToUpper( L( "TXT_KEY_STR_TURNS", turnsRemaining ) ), overflow ) )
end
return tips:concat( "[NEWLINE]" )
end
--------
-- FAITH
--------
local function getFaithTooltip( city )
if g_isReligionEnabled then
local tips = table()
if civBE_mode or not OptionsManager.IsNoBasicHelp() then
tips:insertLocalized( "TXT_KEY_FAITH_HELP_INFO" )
tips:insert( "" )
end
-- Faith from Buildings
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_FAITH_FROM_BUILDINGS", city:GetFaithPerTurnFromBuildings() )
-- Faith from Traits
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_FAITH_FROM_TRAITS", city:GetFaithPerTurnFromTraits() )
-- Faith from Terrain
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_FAITH_FROM_TERRAIN", city:GetBaseYieldRateFromTerrain( YieldTypes.YIELD_FAITH ) )
-- Faith from Policies
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_FAITH_FROM_POLICIES", city:GetFaithPerTurnFromPolicies() )
-- Faith from Religion
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_FAITH_FROM_RELIGION", city:GetFaithPerTurnFromReligion() )
-- Puppet modifier
tips:insertLocalizedBulletIfNonZero( "TXT_KEY_PRODMOD_PUPPET", city:IsPuppet() and GameDefines.PUPPET_FAITH_MODIFIER or 0 )
-- Citizens breakdown
tips:insert( "----------------")
tips:insertLocalized( "TXT_KEY_YIELD_TOTAL", city:GetFaithPerTurn(), "[ICON_PEACE]" )
tips:insert( "" )
tips:insert( GetReligionTooltip( city ) )
return tips:concat( "[NEWLINE]" )
else
return L"TXT_KEY_TOP_PANEL_RELIGION_OFF_TOOLTIP"
end
end
-- TOURISM
local function getTourismTooltip(city)
return city:GetTourismTooltip()
end
----------------------------------------------------------------
-- MAJOR PLAYER MOOD INFO
----------------------------------------------------------------
local function addIfNz( v, icon )
if v and v > 0 then
return "+"..(v/100)..icon
else
return ""
end
end
local function routeBonus( route, d )
return addIfNz( route[d.."GPT"], g_currencyIcon )
.. addIfNz( route[d.."Food"], "[ICON_FOOD]" )
.. addIfNz( route[d.."Production"], "[ICON_PRODUCTION]" )
.. addIfNz( route[d.."Science"], "[ICON_RESEARCH]" )
end
local function inParentheses( duration )
if duration and duration >= 0 then
return " (".. duration ..")"
else
return ""
end
end
local function getMoodInfo( playerID )
local activePlayerID = Game.GetActivePlayer()
local activePlayer = Players[activePlayerID]
local activeTeamID = activePlayer:GetTeam()
local activeTeam = Teams[activeTeamID]
local player = Players[playerID]
local teamID = player:GetTeam()
local team = Teams[teamID]
local civType = player:GetCivilizationType()
local civInfo = civType and GameInfo.Civilizations[ civType ]
local leaderID = player:GetLeaderType()
local leaderInfo = leaderID and GameInfo.Leaders[leaderID]
-- Player & civ names
local strInfo = GetCivName(player) .. " (" .. GetLeaderName(player) .. ") "
-- Always war ?
if (playerID ~= activePlayerID) and (
( activeTeam:IsAtWar( teamID )
and Game.IsOption( GameOptionTypes.GAMEOPTION_NO_CHANGING_WAR_PEACE ) )
or Game.IsOption(GameOptionTypes.GAMEOPTION_ALWAYS_WAR) )
then
return strInfo .. L"TXT_KEY_ALWAYS_WAR_TT"
end
-- Era
strInfo = strInfo .. L( ( GameInfo.Eras[ player:GetCurrentEra() ] or {} ).Description )
-- Tech in Progress
if teamID == activeTeamID then
local currentTechID = player:GetCurrentResearch()
local currentTech = GameInfo.Technologies[currentTechID]
if currentTech and g_isScienceEnabled then
strInfo = strInfo .. " [ICON_RESEARCH] " .. L(currentTech.Description)
end
else
-- Mood
local visibleApproachID = activePlayer:GetApproachTowardsUsGuess(playerID)
strInfo = strInfo .. " " .. (
-- At war
((team:IsAtWar( activeTeamID ) or visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_WAR) and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_WAR")
-- Denouncing
or (player:IsDenouncingPlayer( activePlayerID ) and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_DENOUNCING")
-- Resurrected
or (gk_mode and player:WasResurrectedThisTurnBy( activePlayerID ) and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_LIBERATED")
-- Appears Hostile
or (visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_HOSTILE and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_HOSTILE")
-- Appears Guarded
or (visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_GUARDED and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_GUARDED")
-- Appears Afraid
or (visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_AFRAID and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_AFRAID")
-- Appears Friendly
or (visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_FRIENDLY and L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_FRIENDLY")
-- Neutral - default string
or L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_NEUTRAL" ) .. "[/COLOR]"
end
-- Techs Known
local tips = table( team:GetTeamTechs():GetNumTechsKnown() .. " " .. TechColor( Locale.ToLower("TXT_KEY_VP_TECH") ) )
-- Policies
for policyBranch in GameInfo.PolicyBranchTypes() do
local policyBranchID = policyBranch.ID
local policyCount = 0
for policy in GameInfo.Policies() do
if policy.PolicyBranchType == policyBranch.Type and player:HasPolicy(policy.ID) then
policyCount = policyCount + 1
end
end
tips:insertIf( policyCount > 0 and policyCount .. " " .. PolicyColor( Locale.ToLower(policyBranch.Description) ) )
end
-- Religion Founded
tips:insertIf( gk_mode and player:HasCreatedReligion() and BeliefColor( L("TXT_KEY_RO_STATUS_FOUNDER", Game.GetReligionName( player:GetReligionCreatedByPlayer() ) ) ) )
local tips = table( strInfo, tips:concat(", ") )
-- Wonders
local wonders = table()
for building in GameInfo.Buildings() do
if building.BuildingClass
and ( ( GameInfo.BuildingClasses[building.BuildingClass] or {} ).MaxGlobalInstances or 0 ) > 0
and player:CountNumBuildings(building.ID) > 0
then
wonders:insert( BuildingColor( L(building.Description) ) )
end
end
-- Population
tips:insert( player:GetTotalPopulation() .. "[ICON_CITIZEN]"
.. ", "
.. player:GetNumCities() .. " " .. Locale.ToLower("TXT_KEY_VP_CITIES")
.. ", "
.. player:GetNumWorldWonders() .. " " .. Locale.ToLower("TXT_KEY_VP_WONDERS")
.. (#wonders>0 and ": " .. wonders:concat( ", " ) or "") )
--[[ too much info
local cities = table()
for city in player:Cities() do
-- Name & population
local cityTxt = S("%i[ICON_CITIZEN] %s", city:GetPopulation(), city:GetName())
if city:IsCapital() then
cityTxt = "[ICON_CAPITAL]" .. cityTxt
end
-- Wonders
local wonders = table()
for building in GameInfo.Buildings() do
if building.BuildingClass
and GameInfo.BuildingClasses[building.BuildingClass].MaxGlobalInstances > 0
and city:IsHasBuilding(building.ID)
then
wonders:insert( L(building.Description) )
end
end
if #wonders > 0 then
cityTxt = cityTxt .. " (" .. wonders:concat(", ") .. ")"
end
cities:insert( cityTxt )
end
if #cities > 1 then
tips:insert( #cities .. " " .. L("TXT_KEY_DIPLO_CITIES"):lower() .. " : " .. cities:concat(", ") )
elseif #cities ==1 then
tips:insert( cities[1] )
end
--]]
-- Gold (can be seen in diplo relation ship)
tips:insert( S( "%i%s(%+i)", player:GetGold(), g_currencyIcon, player:CalculateGoldRate() ) )
--------------------------------------------------------------------
-- Loop through the active player's current deals
--------------------------------------------------------------------
local isTradeable, isActiveDeal
local dealsFinalTurn = {}
local deals = table()
local tradeRoutes = table()
local opinions = table()
local treaties = table()
local currentTurn = Game.GetGameTurn() -1
local isUs = playerID == activePlayerID
local relationshipDuration = gk_mode and GameInfo.GameSpeeds[ PreGame.GetGameSpeed() ].RelationshipDuration or 50
local function getDealTurnsRemaining( itemID )
local turnsRemaining
if bnw_mode and itemID == TradeableItems.TRADE_ITEM_DECLARATION_OF_FRIENDSHIP then -- DoF special kinky case
turnsRemaining = relationshipDuration - activePlayer:GetDoFCounter( playerID )
elseif itemID then
local finalTurn = dealsFinalTurn[ itemID ]
if finalTurn then
turnsRemaining = finalTurn - currentTurn
end
end
return inParentheses( isActiveDeal and turnsRemaining )
end
local dealItems = {}
local finalTurns = table()
EUI.PushScratchDeal()
for i = 0, UI.GetNumCurrentDeals( activePlayerID ) - 1 do
UI.LoadCurrentDeal( activePlayerID, i )
local toPlayerID = g_deal:GetOtherPlayer( activePlayerID )
g_deal:ResetIterator()
repeat
local itemID, duration, finalTurn, data1, data2, data3, flag1, fromPlayerID = g_deal:GetNextItem()
if not bnw_mode then
fromPlayerID = data3
end
if itemID then
if isUs or toPlayerID == playerID or fromPlayerID == playerID then
local isFromUs = fromPlayerID == activePlayerID
local dealItem = dealItems[ finalTurn ]
if not dealItem then
dealItem = {}
dealItems[ finalTurn ] = dealItem
finalTurns:insert( finalTurn )
end
if itemID == TradeableItems.TRADE_ITEM_GOLD_PER_TURN then
dealItem.GPT = (dealItem.GPT or 0) + (isFromUs and -data1 or data1)
elseif itemID == TradeableItems.TRADE_ITEM_RESOURCES then
dealItem[data1] = (dealItem[data1] or 0) + (isFromUs and -data2 or data2)
else
dealsFinalTurn[ itemID + (isFromUs and 65536 or 0) ] = finalTurn
end
end
else
break
end
until false
end
EUI.PopScratchDeal()
finalTurns:sort( )
for i = 1, #finalTurns do
local finalTurn = finalTurns[i]
local dealItem = dealItems[ finalTurn ] or {}
local deal = table()
local quantity = dealItem.GPT
deal:insertIf( quantity and quantity ~= 0 and S( "%+g%s", quantity, g_currencyIcon ) )
for resource in GameInfo.Resources() do
local quantity = dealItem[ resource.ID ]
deal:insertIf( quantity and quantity ~= 0 and S( "%+g%s", quantity, resource.IconString or "???" ) )
end
deals:insertIf( #deal > 0 and deal:concat() .. "("..( finalTurn - currentTurn )..")" )
end
if bnw_mode then
for i,route in ipairs( activePlayer:GetTradeRoutes() ) do
if isUs or route.ToID == playerID then
local tip = " [ICON_INTERNATIONAL_TRADE]" .. route.FromCityName .. " "
.. routeBonus( route, "From" )
.. "[ICON_MOVES]" .. route.ToCityName
if route.ToID == activePlayerID then
tip = tip .. " ".. routeBonus( route, "To" )
end
tradeRoutes:insert( tip .. " ("..(route.TurnsLeft-1)..")" )
end
end
for i,route in ipairs( activePlayer:GetTradeRoutesToYou() ) do
if isUs or route.FromID == playerID then
tradeRoutes:insert( " [ICON_INTERNATIONAL_TRADE]" .. route.FromCityName .. "[ICON_MOVES]" .. route.ToCityName .. " "
.. routeBonus( route, "To" )
)
end
end
end
if isUs then
-- Resources available for trade
local luxuries = table()
local strategic = table()
for resource in GameInfo.Resources() do
local i = activePlayer:GetNumResourceAvailable( resource.ID, false )
if i > 0 then
if resource.ResourceClassType == "RESOURCECLASS_LUXURY" then
luxuries:insert( " " .. activePlayer:GetNumResourceAvailable( resource.ID, true ) .. (resource.IconString or "???") )
elseif resource.ResourceClassType ~= "RESOURCECLASS_BONUS" then
strategic:insert( " " .. i .. (resource.IconString or "???") )
end
end
end
tips:append( luxuries:concat() .. strategic:concat() )
else --if teamID ~= activeTeamID then
local visibleApproachID = activePlayer:GetApproachTowardsUsGuess(playerID)
if activeTeam:IsAtWar( teamID ) then -- At war right now
opinions:insert( L"TXT_KEY_DIPLO_MAJOR_CIV_DIPLO_STATE_WAR" )
else -- Not at war right now
-- Resources available from them
local luxuries = table()
local strategic = table()
for resource in GameInfo.Resources() do
if g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_RESOURCES, resource.ID, 1 ) then -- 1 here is 1 quantity of the Resource, which is the minimum possible
local resource = " " .. player:GetNumResourceAvailable( resource.ID, false ) .. (resource.IconString or "???")
if resource.ResourceClassType == "RESOURCECLASS_LUXURY" then
luxuries:insert( resource )
else
strategic:insert( resource )
end
end
end
tips:append( luxuries:concat() .. strategic:concat() )
-- Resources they would like from us
local luxuries = table()
local strategic = table()
for resource in GameInfo.Resources() do
if g_deal:IsPossibleToTradeItem( activePlayerID, playerID, TradeableItems.TRADE_ITEM_RESOURCES, resource.ID, 1 ) then -- 1 here is 1 quantity of the Resource, which is the minimum possible
if resource.ResourceClassType == "RESOURCECLASS_LUXURY" then
luxuries:insert( " " .. activePlayer:GetNumResourceAvailable( resource.ID, true ) .. (resource.IconString or "???") )
else
strategic:insert( " " .. activePlayer:GetNumResourceAvailable( resource.ID, false ) .. (resource.IconString or "???") )
end
end
end
if #luxuries > 0 or #strategic > 0 then
tips:insert( L"TXT_KEY_DIPLO_YOUR_ITEMS_LABEL" .. ": " .. luxuries:concat() .. strategic:concat() )
end
-- Treaties
if gk_mode then
-- Embassy to them
isTradeable = g_deal:IsPossibleToTradeItem( activePlayerID, playerID, TradeableItems.TRADE_ITEM_ALLOW_EMBASSY, tt_iDealDuration )
isActiveDeal = team:HasEmbassyAtTeam( activeTeamID )
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal] .. "[ICON_CAPITAL]"
.. L("TXT_KEY_DIPLO_ALLOW_EMBASSY"):lower()
.. "[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_ALLOW_EMBASSY + 65536 ) -- 65536 means from us
)
end
-- Embassy from them
isTradeable = g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_ALLOW_EMBASSY, tt_iDealDuration )
isActiveDeal = activeTeam:HasEmbassyAtTeam( teamID )
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal]
.. L("TXT_KEY_DIPLO_ALLOW_EMBASSY"):lower()
.. "[ICON_CAPITAL][ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_ALLOW_EMBASSY )
)
end
end
-- Open Borders to them
isTradeable = g_deal:IsPossibleToTradeItem( activePlayerID, playerID, TradeableItems.TRADE_ITEM_OPEN_BORDERS, tt_iDealDuration )
isActiveDeal = activeTeam:IsAllowsOpenBordersToTeam(teamID)
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal] .. "<"
.. L"TXT_KEY_DO_OPEN_BORDERS"
.. "[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_OPEN_BORDERS + 65536 ) -- 65536 means from us
)
end
-- Open Borders from them
isTradeable = g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_OPEN_BORDERS, tt_iDealDuration )
isActiveDeal = team:IsAllowsOpenBordersToTeam( activeTeamID )
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal]
.. L"TXT_KEY_DO_OPEN_BORDERS"
.. ">[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_OPEN_BORDERS )
)
end
-- Declaration of Friendship
isTradeable = not gk_mode or g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_DECLARATION_OF_FRIENDSHIP, tt_iDealDuration )
isActiveDeal = activePlayer:IsDoF(playerID)
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal] .. "[ICON_FLOWER]"
.. L"TXT_KEY_DIPLOMACY_FRIENDSHIP_ADV_QUEST"
.. "[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_DECLARATION_OF_FRIENDSHIP )
)
end
-- Research Agreement
-- isTradeable = (activeTeam:IsResearchAgreementTradingAllowed() or team:IsResearchAgreementTradingAllowed())
-- and not activeTeam:GetTeamTechs():HasResearchedAllTechs() and not team:GetTeamTechs():HasResearchedAllTechs()
-- and not g_isScienceEnabled
isTradeable = g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_RESEARCH_AGREEMENT, tt_iDealDuration )
isActiveDeal = activeTeam:IsHasResearchAgreement(teamID)
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal] .. "[ICON_RESEARCH]"
.. L"TXT_KEY_DO_RESEARCH_AGREEMENT"
.. "[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_RESEARCH_AGREEMENT )
)
end
-- Trade Agreement
isTradeable = g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_TRADE_AGREEMENT, tt_iDealDuration )
isActiveDeal = activeTeam:IsHasTradeAgreement(teamID)
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal] .. "[ICON_RESEARCH]"
.. L("TXT_KEY_DIPLO_TRADE_AGREEMENT"):lower()
.. "[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_TRADE_AGREEMENT )
)
end
-- Defensive Pact
isTradeable = g_deal:IsPossibleToTradeItem( playerID, activePlayerID, TradeableItems.TRADE_ITEM_DEFENSIVE_PACT, tt_iDealDuration )
isActiveDeal = activeTeam:IsDefensivePact(teamID)
if isTradeable or isActiveDeal then
treaties:insert( negativeOrPositiveTextColor[isActiveDeal] .. "[ICON_STRENGTH]"
.. L"TXT_KEY_DO_PACT"
.. "[ENDCOLOR]" .. getDealTurnsRemaining( TradeableItems.TRADE_ITEM_DEFENSIVE_PACT )
)
end
-- We've fought before
if not gk_mode and activePlayer:GetNumWarsFought(playerID) > 0 then
-- They don't appear to be mad
if visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_FRIENDLY or
visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_NEUTRAL then
opinions:insert( L"TXT_KEY_DIPLO_PAST_WAR_NEUTRAL" )
-- They aren't happy with us
else
opinions:insert( L"TXT_KEY_DIPLO_PAST_WAR_BAD" )
end
end
end
if player.GetOpinionTable then
opinions = player:GetOpinionTable( activePlayerID )
else
-- Good things
opinions:insertLocalizedIf( activePlayer:IsDoF(playerID) and "TXT_KEY_DIPLO_DOF" )
opinions:insertLocalizedIf( activePlayer:IsPlayerDoFwithAnyFriend(playerID) and "TXT_KEY_DIPLO_MUTUAL_DOF" ) -- Human has a mutual friend with the AI
opinions:insertLocalizedIf( activePlayer:IsPlayerDenouncedEnemy(playerID) and "TXT_KEY_DIPLO_MUTUAL_ENEMY" ) -- Human has denounced an enemy of the AI
opinions:insertLocalizedIf( player:GetNumCiviliansReturnedToMe(activePlayerID) > 0 and "TXT_KEY_DIPLO_CIVILIANS_RETURNED" )
-- Neutral things
opinions:insertLocalizedIf( visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_AFRAID and "TXT_KEY_DIPLO_AFRAID" )
-- Bad things
opinions:insertLocalizedIf( player:IsFriendDeclaredWarOnUs(activePlayerID) and "TXT_KEY_DIPLO_HUMAN_FRIEND_DECLARED_WAR" ) -- Human was a friend and declared war on us
opinions:insertLocalizedIf( player:IsFriendDenouncedUs(activePlayerID) and "TXT_KEY_DIPLO_HUMAN_FRIEND_DENOUNCED" ) -- Human was a friend and denounced us
opinions:insertLocalizedIf( activePlayer:GetWeDeclaredWarOnFriendCount() > 0 and "TXT_KEY_DIPLO_HUMAN_DECLARED_WAR_ON_FRIENDS" ) -- Human declared war on friends
opinions:insertLocalizedIf( activePlayer:GetWeDenouncedFriendCount() > 0 and "TXT_KEY_DIPLO_HUMAN_DENOUNCED_FRIENDS" ) -- Human has denounced his friends
opinions:insertLocalizedIf( activePlayer:GetNumFriendsDenouncedBy() > 0 and "TXT_KEY_DIPLO_HUMAN_DENOUNCED_BY_FRIENDS" ) -- Human has been denounced by friends
opinions:insertLocalizedIf( activePlayer:IsDenouncedPlayer(playerID) and "TXT_KEY_DIPLO_DENOUNCED_BY_US" )
opinions:insertLocalizedIf( player:IsDenouncedPlayer(activePlayerID) and "TXT_KEY_DIPLO_DENOUNCED_BY_THEM" )
opinions:insertLocalizedIf( player:IsPlayerDoFwithAnyEnemy(activePlayerID) and "TXT_KEY_DIPLO_HUMAN_DOF_WITH_ENEMY" )
opinions:insertLocalizedIf( player:IsPlayerDenouncedFriend(activePlayerID) and "TXT_KEY_DIPLO_HUMAN_DENOUNCED_FRIEND" )
opinions:insertLocalizedIf( player:IsPlayerNoSettleRequestEverAsked(activePlayerID) and "TXT_KEY_DIPLO_NO_SETTLE_ASKED" )
opinions:insertLocalizedIf( player:IsDemandEverMade(activePlayerID) and "TXT_KEY_DIPLO_TRADE_DEMAND" )
opinions:insertLocalizedIf( player:GetNumTimesCultureBombed(activePlayerID) > 0 and "TXT_KEY_DIPLO_CULTURE_BOMB" )
opinions:insertLocalizedIf( player:IsPlayerBrokenMilitaryPromise(activePlayerID) and "TXT_KEY_DIPLO_MILITARY_PROMISE" )
opinions:insertLocalizedIf( player:IsPlayerIgnoredMilitaryPromise(activePlayerID) and "TXT_KEY_DIPLO_MILITARY_PROMISE_IGNORED" )
opinions:insertLocalizedIf( player:IsPlayerBrokenExpansionPromise(activePlayerID) and "TXT_KEY_DIPLO_EXPANSION_PROMISE" )
opinions:insertLocalizedIf( player:IsPlayerIgnoredExpansionPromise(activePlayerID) and "TXT_KEY_DIPLO_EXPANSION_PROMISE_IGNORED" )
opinions:insertLocalizedIf( player:IsPlayerBrokenBorderPromise(activePlayerID) and "TXT_KEY_DIPLO_BORDER_PROMISE" )
opinions:insertLocalizedIf( player:IsPlayerIgnoredBorderPromise(activePlayerID) and "TXT_KEY_DIPLO_BORDER_PROMISE_IGNORED" )
opinions:insertLocalizedIf( player:IsPlayerBrokenCityStatePromise(activePlayerID) and "TXT_KEY_DIPLO_CITY_STATE_PROMISE" )
opinions:insertLocalizedIf( player:IsPlayerIgnoredCityStatePromise(activePlayerID) and "TXT_KEY_DIPLO_CITY_STATE_PROMISE_IGNORED" )
opinions:insertLocalizedIf( player:IsPlayerBrokenCoopWarPromise(activePlayerID) and "TXT_KEY_DIPLO_COOP_WAR_PROMISE" )
opinions:insertLocalizedIf( player:IsPlayerRecklessExpander(activePlayerID) and "TXT_KEY_DIPLO_RECKLESS_EXPANDER" )
opinions:insertLocalizedIf( player:GetNumRequestsRefused(activePlayerID) > 0 and "TXT_KEY_DIPLO_REFUSED_REQUESTS" )
opinions:insertLocalizedIf( player:GetRecentTradeValue(activePlayerID) > 0 and "TXT_KEY_DIPLO_TRADE_PARTNER" )
opinions:insertLocalizedIf( player:GetCommonFoeValue(activePlayerID) > 0 and "TXT_KEY_DIPLO_COMMON_FOE" )
opinions:insertLocalizedIf( player:GetRecentAssistValue(activePlayerID) > 0 and "TXT_KEY_DIPLO_ASSISTANCE_TO_THEM" )
opinions:insertLocalizedIf( player:IsLiberatedCapital(activePlayerID) and "TXT_KEY_DIPLO_LIBERATED_CAPITAL" )
opinions:insertLocalizedIf( player:IsLiberatedCity(activePlayerID) and "TXT_KEY_DIPLO_LIBERATED_CITY" )
opinions:insertLocalizedIf( player:IsGaveAssistanceTo(activePlayerID) and "TXT_KEY_DIPLO_ASSISTANCE_FROM_THEM" )
opinions:insertLocalizedIf( player:IsHasPaidTributeTo(activePlayerID) and "TXT_KEY_DIPLO_PAID_TRIBUTE" )
opinions:insertLocalizedIf( player:IsNukedBy(activePlayerID) and "TXT_KEY_DIPLO_NUKED" )
opinions:insertLocalizedIf( player:IsCapitalCapturedBy(activePlayerID) and "TXT_KEY_DIPLO_CAPTURED_CAPITAL" )
-- Protected Minors
if player:GetOtherPlayerNumProtectedMinorsKilled(activePlayerID) > 0 then
opinions:insert( L"TXT_KEY_DIPLO_PROTECTED_MINORS_KILLED" )
-- Only worry about protected minors ATTACKED if they haven't KILLED any
elseif player:GetOtherPlayerNumProtectedMinorsAttacked(activePlayerID) > 0 then
opinions:insert( L"TXT_KEY_DIPLO_PROTECTED_MINORS_ATTACKED" )
end
--local actualApproachID = player:GetMajorCivApproach(activePlayerID)
-- Bad things we don't want visible if someone is friendly (acting or truthfully)
if visibleApproachID ~= MajorCivApproachTypes.MAJOR_CIV_APPROACH_FRIENDLY then
-- and actualApproachID ~= MajorCivApproachTypes.MAJOR_CIV_APPROACH_DECEPTIVE then
opinions:insertLocalizedIf( player:GetLandDisputeLevel(activePlayerID) > DisputeLevelTypes.DISPUTE_LEVEL_NONE and "TXT_KEY_DIPLO_LAND_DISPUTE" )
--opinions:insertLocalizedIf( player:GetVictoryDisputeLevel(activePlayerID) > DisputeLevelTypes.DISPUTE_LEVEL_NONE and "TXT_KEY_DIPLO_VICTORY_DISPUTE" )
opinions:insertLocalizedIf( player:GetWonderDisputeLevel(activePlayerID) > DisputeLevelTypes.DISPUTE_LEVEL_NONE and "TXT_KEY_DIPLO_WONDER_DISPUTE" )
opinions:insertLocalizedIf( player:GetMinorCivDisputeLevel(activePlayerID) > DisputeLevelTypes.DISPUTE_LEVEL_NONE and "TXT_KEY_DIPLO_MINOR_CIV_DISPUTE" )
opinions:insertLocalizedIf( player:GetWarmongerThreat(activePlayerID) > ThreatTypes.THREAT_NONE and "TXT_KEY_DIPLO_WARMONGER_THREAT" )
end
end
-- No specific events - let's see what string we should use
if #opinions == 0 then
-- At war
if visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_WAR then
opinions = { L"TXT_KEY_DIPLO_AT_WAR" }
-- Appears Friendly
elseif visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_FRIENDLY then
opinions = { L"TXT_KEY_DIPLO_FRIENDLY" }
-- Appears Guarded
elseif visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_GUARDED then
opinions = { L"TXT_KEY_DIPLO_GUARDED" }
-- Appears Hostile
elseif visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_HOSTILE then
opinions = { L"TXT_KEY_DIPLO_HOSTILE" }
-- Appears Affraid
elseif visibleApproachID == MajorCivApproachTypes.MAJOR_CIV_APPROACH_AFRAID then
opinions = { L"TXT_KEY_DIPLO_AFRAID" }
-- Neutral - default string
else
opinions = { L"TXT_KEY_DIPLO_DEFAULT_STATUS" }
end
end
end -- playerID vs activePlayerID
--TODO "TXT_KEY_DO_WE_PROVIDE" & "TXT_KEY_DO_THEY_PROVIDE"
tips:insertIf( #deals > 0 and L"TXT_KEY_DO_CURRENT_DEALS" .. "[NEWLINE]" .. deals:concat( ", " ) )
tips:insertIf( #tradeRoutes > 0 and tradeRoutes:concat( "[NEWLINE]" ) )
tips:insertIf( #treaties > 0 and treaties:concat( ", " ) .. "[ENDCOLOR]" )
tips:insertIf( #opinions > 0 and "[ICON_BULLET]" .. table.concat( opinions, "[NEWLINE][ICON_BULLET]" ) .. "[ENDCOLOR]" )
local allied = table()
local friends = table()
local protected = table()
local denouncements = table()
local backstabs = table()
local denouncedBy = table()
local wars = table()
local relationshipDuration = gk_mode and GameInfo.GameSpeeds[ PreGame.GetGameSpeed() ].RelationshipDuration or 50
-- Relationships with others
for otherPlayerID = 0, GameDefines.MAX_CIV_PLAYERS - 1 do
local otherPlayer = Players[otherPlayerID]
if otherPlayer
and otherPlayerID ~= playerID
and otherPlayer:IsAlive()
and activeTeam:IsHasMet(otherPlayer:GetTeam())
then
local otherPlayerName = GetCivName(otherPlayer)
-- Wars
if team:IsAtWar(otherPlayer:GetTeam()) then
wars:insert( otherPlayerName )
end
if otherPlayer:IsMinorCiv() then
-- Alliances
if otherPlayer:IsAllies(playerID) then
allied:insert( otherPlayerName )
-- Friendships
elseif otherPlayer:IsFriends(playerID) then
friends:insert( otherPlayerName )
end
-- Protections
if player:IsProtectingMinor(otherPlayerID) then
protected:insert( otherPlayerName .. inParentheses( gk_mode and isUs and ( otherPlayer:GetTurnLastPledgedProtectionByMajor(playerID) - Game.GetGameTurn() + 10 ) ) ) -- todo check scaling % game speed
end
else
-- Friendships
if player:IsDoF(otherPlayerID) then
friends:insert( otherPlayerName .. inParentheses( bnw_mode and ( relationshipDuration - player:GetDoFCounter( otherPlayerID ) ) ) )
end
-- Backstab
if otherPlayer:IsFriendDenouncedUs(playerID) or otherPlayer:IsFriendDeclaredWarOnUs(playerID) then
backstabs:insert( otherPlayerName )
-- Denouncement
elseif player:IsDenouncedPlayer(otherPlayerID) then
denouncements:insert( otherPlayerName .. inParentheses( bnw_mode and ( relationshipDuration - player:GetDenouncedPlayerCounter( otherPlayerID ) ) ) )
end
-- Denounced by 3rd party
if otherPlayer:IsDenouncedPlayer(playerID) then
denouncedBy:insert( otherPlayerName .. inParentheses( bnw_mode and ( relationshipDuration - otherPlayer:GetDenouncedPlayerCounter( playerID ) ) ) )
end
end
end
end
tips:insertIf( #allied > 0 and "[ICON_CITY_STATE]" .. L( "TXT_KEY_ALLIED_WITH", allied:concat(", ") ) )
tips:insertIf( #friends > 0 and "[ICON_FLOWER]" .. L( "TXT_KEY_DIPLO_FRIENDS_WITH", friends:concat(", ") ) )
tips:insertIf( #protected > 0 and "[ICON_STRENGTH]" .. L"TXT_KEY_POP_CSTATE_PLEDGE_TO_PROTECT" .. ": " .. protected:concat(", ") )
tips:insertIf( #backstabs > 0 and "[ICON_PIRATE]" .. L( "TXT_KEY_DIPLO_BACKSTABBED", backstabs:concat(", ") ) )
tips:insertIf( #denouncements > 0 and "[ICON_DENOUNCE]" .. L( "TXT_KEY_DIPLO_DENOUNCED", denouncements:concat(", ") ) )
tips:insertIf( #denouncedBy > 0 and "[ICON_DENOUNCE]" .. TextColor( negativeOrPositiveTextColor[false], L( "TXT_KEY_NTFN_DENOUNCED_US_S", denouncedBy:concat(", ") ) ) )
tips:insertIf( #wars > 0 and "[ICON_WAR]" .. L( "TXT_KEY_AT_WAR_WITH", wars:concat(", ") ) )
return tips:concat( "[NEWLINE]" )
end
-------------------------------------------------
-- Helper function to build religion tooltip string
-------------------------------------------------
local function getReligionTooltip(city)
if g_isReligionEnabled then
local tips = table()
local majorityReligionID = city:GetReligiousMajority()
local pressureMultiplier = GameDefines.RELIGION_MISSIONARY_PRESSURE_MULTIPLIER or 1
for religion in GameInfo.Religions() do
local religionID = religion.ID
if religionID >= 0 then
local pressureLevel, numTradeRoutesAddingPressure = city:GetPressurePerTurn(religionID)
local numFollowers = city:GetNumFollowers(religionID)
local religion = GameInfo.Religions[religionID]
local religionName = L( Game.GetReligionName(religionID) )
local religionIcon = religion.IconString or "???"
if pressureLevel > 0 or numFollowers > 0 then
local religionTip = ""
if pressureLevel > 0 then
religionTip = L( "TXT_KEY_RELIGIOUS_PRESSURE_STRING", math.floor(pressureLevel/pressureMultiplier))
end
if numTradeRoutesAddingPressure and numTradeRoutesAddingPressure > 0 then
religionTip = L( "TXT_KEY_RELIGION_TOOLTIP_LINE_WITH_TRADE", religionIcon, numFollowers, religionTip, numTradeRoutesAddingPressure)
else
religionTip = L( "TXT_KEY_RELIGION_TOOLTIP_LINE", religionIcon, numFollowers, religionTip)
end
if religionID == majorityReligionID then
local beliefs
if religionID > 0 then
beliefs = Game.GetBeliefsInReligion( religionID )
else
beliefs = {Players[city:GetOwner()]:GetBeliefInPantheon()}
end
for _,beliefID in pairs( beliefs or {} ) do
religionTip = religionTip .. "[NEWLINE][ICON_BULLET]"..L(GameInfo.Beliefs[ beliefID ].Description)
end
tips:insert( 1, religionTip )
else
tips:insert( religionTip )
end
end
if city:IsHolyCityForReligion( religionID ) then
tips:insert( 1, L( "TXT_KEY_HOLY_CITY_TOOLTIP_LINE", religionIcon, religionName) )
end
end
end
return tips:concat( "[NEWLINE]" )
else
return L"TXT_KEY_TOP_PANEL_RELIGION_OFF_TOOLTIP"
end
end
-------------------------------------------------
-- Expose functions
-------------------------------------------------
if Game and Game.GetReligionName == nil then
if not GetCityStateStatusToolTip then
include( "CityStateStatusHelper" )
end
function GetCityStateStatus( minorPlayer, majorPlayerID )
return GetCityStateStatusToolTip( majorPlayerID, minorPlayer:GetID(), true )
end
end
function GetHelpTextForUnit( ... ) return select(2, pcall( getHelpTextForUnit, ... ) ) end
function GetHelpTextForBuilding( ... ) return select(2, pcall( getHelpTextForBuilding, ... ) ) end
function GetHelpTextForImprovement( ... ) return select(2, pcall( getHelpTextForImprovement, ... ) ) end
function GetHelpTextForProject( ... ) return select(2, pcall( getHelpTextForProject, ... ) ) end
function GetHelpTextForProcess( ... ) return select(2, pcall( getHelpTextForProcess, ... ) ) end
function GetFoodTooltip( ... ) return select(2, pcall( getFoodTooltip, ... ) ) end
function GetGoldTooltip( ... ) return select(2, pcall( getGoldTooltip, ... ) ) end
function GetEnergyTooltip( ... ) return select(2, pcall( getEnergyTooltip, ... ) ) end
function GetScienceTooltip( ... ) return select(2, pcall( getScienceTooltip, ... ) ) end
function GetProductionTooltip( ... ) return select(2, pcall( getProductionTooltip, ... ) ) end
function GetCultureTooltip( ... ) return select(2, pcall( getCultureTooltip, ... ) ) end
function GetFaithTooltip( ... ) return select(2, pcall( getFaithTooltip, ... ) ) end
function GetTourismTooltip( ... ) return select(2, pcall( getTourismTooltip, ... ) ) end
function GetYieldTooltipHelper( ... ) return select(2, pcall( getYieldTooltipHelper, ... ) ) end
function GetYieldTooltip( ... ) return select(2, pcall( getYieldTooltip, ... ) ) end
function GetMoodInfo( ... ) return select(2, pcall( getMoodInfo, ... ) ) end
function GetReligionTooltip( ... ) return select(2, pcall( getReligionTooltip, ... ) ) end
if civBE_mode then
----------------------------------------------------------------
----------------------------------------------------------------
-- UNIT COMBO THINGS
----------------------------------------------------------------
----------------------------------------------------------------
function GetHelpTextForSpecificUnit(unit)
local s = "";
-- Attributes
s = s .. GetHelpTextForUnitAttributes(unit:GetUnitType(), "[ICON_BULLET]");
-- Player Perks
local temp = GetHelpTextForUnitPlayerPerkBuffs(unit:GetUnitType(), unit:GetOwner(), "[ICON_BULLET]");
if (temp ~= "") then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
s = s .. temp;
end
-- Promotions
temp = GetHelpTextForUnitPromotions(unit, "[ICON_BULLET]");
if (temp ~= "") then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
s = s .. temp;
end
-- Upgrades and Perks
local player = Players[unit:GetOwner()];
if (player ~= nil) then
local allPerks = player:GetPerksForUnit(unit:GetUnitType());
local tempPerks = player:GetFreePerksForUnit(unit:GetUnitType());
for i,v in ipairs(tempPerks) do
table.insert(allPerks, v);
end
local ignoreCoreStats = true;
temp = GetHelpTextForUnitPerks(allPerks, ignoreCoreStats, "[ICON_BULLET]");
if (temp ~= "") then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
s = s .. temp;
end
end
return s;
end
function GetHelpTextForUnitType(unitType, playerID, includeFreePromotions)
local s = "";
-- Attributes
s = s .. GetHelpTextForUnitAttributes(unitType, nil);
-- Player Perks
if (includeFreePromotions ~= nil and includeFreePromotions == true) then
local temp = GetHelpTextForUnitPlayerPerkBuffs(unitType, playerID, nil);
if (temp ~= "") then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
s = s .. temp;
end
end
-- Promotions
if (includeFreePromotions ~= nil and includeFreePromotions == true) then
local temp = GetHelpTextForUnitInherentPromotions(unitType, nil);
if (temp ~= "") then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
s = s .. temp;
end
end
-- Upgrades and Perks
local player = Players[playerID];
if (player ~= nil) then
local allPerks = player:GetPerksForUnit(unitType);
local tempPerks = player:GetFreePerksForUnit(unitType);
for i,v in ipairs(tempPerks) do
table.insert(allPerks, v);
end
local ignoreCoreStats = true;
local temp = GetHelpTextForUnitPerks(allPerks, ignoreCoreStats, nil);
if (temp ~= "") then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
s = s .. temp;
end
end
return s;
end
----------------------------------------------------------------
----------------------------------------------------------------
-- UNIT MISCELLANY
-- Stuff not covered by promotions or perks
----------------------------------------------------------------
----------------------------------------------------------------
function GetUpgradedUnitDescriptionKey(player, unitType)
local descriptionKey = "";
local unitInfo = GameInfo.Units[unitType];
if (unitInfo ~= nil) then
descriptionKey = unitInfo.Description;
if (player ~= nil) then
local bestUpgrade = player:GetBestUnitUpgrade(unitType);
if (bestUpgrade ~= -1) then
local bestUpgradeInfo = GameInfo.UnitUpgrades[bestUpgrade];
if (bestUpgradeInfo ~= nil) then
descriptionKey = bestUpgradeInfo.Description;
end
end
end
end
return descriptionKey;
end
--TODO: antonjs: Once we have a text budget and refactor time,
--roll these miscellaneous things (player perks, attributes in
--the base unit XML) in with existing unit buff systems
--instead of being special case like this.
function GetHelpTextForUnitAttributes(unitType, prefix)
local s = "";
local unitInfo = GameInfo.Units[unitType];
if (unitInfo ~= nil) then
if (unitInfo.OrbitalAttackRange >= 0) then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L("TXT_KEY_INTERFACEMODE_ORBITAL_ATTACK");
end
end
return s;
end
function GetHelpTextForUnitPlayerPerkBuffs(unitType, playerID, prefix)
local s = "";
local player = Players[playerID];
local unitInfo = GameInfo.Units[ unitType ]
if player and unitInfo then
for info in GameInfo.PlayerPerks() do
if player:HasPerk(info.ID) then
if info.MiasmaBaseHeal > 0 or info.UnitPercentHealChange > 0 then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(GameInfo.PlayerPerks[info.ID].Help);
end
-- Help text for this player perk is inaccurate. Commencing hax0rs.
if info.UnitFlatVisibilityChange > 0 then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L("TXT_KEY_UNITPERK_VISIBILITY_CHANGE", info.UnitFlatVisibilityChange);
end
end
end
end
return s;
end
----------------------------------------------------------------
----------------------------------------------------------------
-- UNIT PROMOTIONS
----------------------------------------------------------------
----------------------------------------------------------------
function GetHelpTextForUnitInherentPromotions(unitType, prefix)
local s = "";
local unitInfo = GameInfo.Units[unitType];
if unitInfo then
for pairInfo in GameInfo.Unit_FreePromotions{ UnitType = unitInfo.Type } do
local promotionInfo = GameInfo.UnitPromotions[pairInfo.PromotionType];
if (promotionInfo ~= nil and promotionInfo.Help ~= nil) then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(promotionInfo.Help);
end
end
end
return s;
end
function GetHelpTextForUnitPromotions(unit, prefix)
local s = "";
for promotionInfo in GameInfo.UnitPromotions() do
if (unit:IsHasPromotion(promotionInfo.ID)) then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(promotionInfo.Help);
end
end
return s;
end
----------------------------------------------------------------
----------------------------------------------------------------
-- UNIT PERKS
----------------------------------------------------------------
----------------------------------------------------------------
function GetHelpTextForUnitPerk(perkID)
local ignoreCoreStats = false;
return GetHelpTextForUnitPerks( GetHelpListForUnitPerk(perkID), ignoreCoreStats, nil );
end
function GetHelpListForUnitPerk(perkID)
local list = {};
table.insert(list, perkID);
return list;
end
function GetHelpTextForUnitPerks(perkIDTable, ignoreCoreStats, prefix)
local s = "";
-- Text key overrides
local filteredPerkIDTable = {};
for index, perkID in ipairs(perkIDTable) do
local perkInfo = GameInfo.UnitPerks[perkID];
if (perkInfo ~= nil) then
if (perkInfo.Help ~= nil) then
if (s ~= "") then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(perkInfo.Help);
else
table.insert(filteredPerkIDTable, perkID);
end
end
end
-- Basic Attributes
if (not ignoreCoreStats) then
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_EXTRA_COMBAT_STRENGTH", "ExtraCombatStrength", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_EXTRA_RANGED_COMBAT_STRENGTH", "ExtraRangedCombatStrength", s == "", prefix);
end
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGE_CHANGE", "RangeChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGE_AT_FULL_HEALTH_CHANGE", "RangeAtFullHealthChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGE_AT_FULL_MOVES_CHANGE", "RangeAtFullMovesChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGE_FOR_ONBOARD_CHANGE", "RangeForOnboardChange", s == "", prefix);
if (not ignoreCoreStats) then
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_MOVES_CHANGE", "MovesChange", s == "", prefix);
end
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_VISIBILITY_CHANGE", "VisibilityChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_CARGO_CHANGE", "CargoChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGE_AGAINST_ORBITAL_CHANGE", "RangeAgainstOrbitalChange", s == "", prefix);
-- General combat
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_MOD", "AttackMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_FORTIFIED_MOD", "AttackFortifiedMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_WOUNDED_MOD", "AttackWoundedMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_WHILE_IN_MIASMA_MOD", "AttackWhileInMiasmaMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_CITY_MOD", "AttackCityMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_FOR_ONBOARD_MOD", "AttackForOnboardMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DEFEND_MOD", "DefendMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DEFEND_RANGED_MOD", "DefendRangedMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DEFEND_WHILE_IN_MIASMA_MOD", "DefendWhileInMiasmaMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DEFEND_FOR_ONBOARD_MOD", "DefendForOnboardMod", s == "", prefix);
-- Air combat
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_WITH_AIR_SWEEP_MOD", "AttackWithAirSweepMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ATTACK_WITH_INTERCEPTION_MOD", "AttackWithInterceptionMod", s == "", prefix);
-- Territory
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_FRIENDLY_LANDS_MOD", "FriendlyLandsMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_OUTSIDE_FRIENDLY_LANDS_MOD", "OutsideFriendlyLandsMod", s == "", prefix);
-- Battlefield position
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ADJACENT_FRIENDLY_MOD", "AdjacentFriendlyMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_PER_ADJACENT_FRIENDLY_MOD", "PerAdjacentFriendlyMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_NO_ADJACENT_FRIENDLY_MOD", "NoAdjacentFriendlyMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_FLANKING_MOD", "FlankingMod", s == "", prefix);
-- Other conditional bonuses
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ALIEN_COMBAT_MOD", "AlienCombatMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_FORTIFIED_MOD", "FortifiedMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_CITY_MOD", "CityMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_PER_UNUSED_MOVE_MOD", "PerUnusedMoveMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DAMAGE_TO_ADJACENT_UNITS_ON_DEATH", "DamageToAdjacentUnitsOnDeath", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DAMAGE_TO_ADJACENT_UNITS_ON_ATTACK", "DamageToAdjacentUnitsOnAttack", s == "", prefix);
-- Attack logistics
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_IGNORE_RANGED_ATTACK_LINE_OF_SIGHT", "IgnoreRangedAttackLineOfSight", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_MELEE_ATTACK_HEAVY_CHARGE", "MeleeAttackHeavyCharge", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_EXTRA_ATTACKS", "ExtraAttacks", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_EXTRA_INTERCEPTIONS", "ExtraInterceptions", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGED_ATTACK_SETUPS_NEEDED_MOD", "RangedAttackSetupsNeededMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_RANGED_ATTACK_SCATTER_CHANCE_MOD", "RangedAttackScatterChanceMod", s == "", prefix);
-- Movement logistics
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_MOVE_AFTER_ATTACKING", "MoveAfterAttacking", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_IGNORE_TERRAIN_COST", "IgnoreTerrainCost", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_IGNORE_PILLAGE_COST", "IgnorePillageCost", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_IGNORE_ZONE_OF_CONTROL", "IgnoreZoneOfControl", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_FLAT_MOVEMENT_COST", "FlatMovementCost", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_MOVE_ANYWHERE", "MoveAnywhere", s == "", prefix);
-- Don't show "Hover", since it is redundant with the descriptions for "FlatMovementCost" and "MoveAnywhere"
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_WITHDRAW_FROM_MELEE_CHANCE_MOD", "WithdrawFromMeleeChanceMod", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_FREE_REBASES", "FreeRebases", s == "", prefix);
-- Healing
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ALWAYS_HEAL", "AlwaysHeal", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_HEAL_OUTSIDE_FRIENDLY_TERRITORY", "HealOutsideFriendlyTerritory", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ENEMY_HEAL_CHANGE", "EnemyHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_NEUTRAL_HEAL_CHANGE", "NeutralHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_FRIENDLY_HEAL_CHANGE", "FriendlyHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_MIASMA_HEAL_CHANGE", "MiasmaHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ADJACENT_UNIT_HEAL_CHANGE", "AdjacentUnitHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_SAME_TILE_HEAL_CHANGE", "SameTileHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_KILL_UNIT_HEAL_CHANGE", "KillUnitHealChange", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_PILLAGE_HEAL_CHANGE", "PillageHealChange", s == "", prefix);
-- Orbital layer
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_GENERATE_MIASMA_IN_ORBIT", "GenerateMiasmaInOrbit", s == "", prefix);
s = s .. ComposeUnitPerkFlagHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ALLOW_MANUAL_DEORBIT", "AllowManualDeorbit", s == "", prefix);
s = s .. ComposeUnitPerkNumberHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_ORBITAL_COVERAGE_RADIUS_CHANGE", "OrbitalCoverageRadiusChange", s == "", prefix);
-- Attrition
-- Actions
-- Domain combat mods
s = s .. ComposeUnitPerkDomainCombatModHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DOMAIN_COMBAT_MOD_LAND", "DOMAIN_LAND", s == "", prefix);
s = s .. ComposeUnitPerkDomainCombatModHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DOMAIN_COMBAT_MOD_SEA", "DOMAIN_SEA", s == "", prefix);
s = s .. ComposeUnitPerkDomainCombatModHelpText(filteredPerkIDTable, "TXT_KEY_UNITPERK_DOMAIN_COMBAT_MOD_AIR", "DOMAIN_AIR", s == "", prefix);
return s;
end
function ComposeUnitPerkNumberHelpText(perkIDTable, textKey, numberKey, firstEntry, prefix)
local s = "";
local number = 0;
for index, perkID in ipairs(perkIDTable) do
local perkInfo = GameInfo.UnitPerks[perkID];
if (perkInfo ~= nil and perkInfo[numberKey] ~= nil and perkInfo[numberKey] ~= 0) then
number = number + perkInfo[numberKey];
end
end
if (number ~= 0) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(textKey, number);
end
return s;
end
function ComposeUnitPerkFlagHelpText(perkIDTable, textKey, flagKey, firstEntry, prefix)
local s = "";
local flag = false;
for index, perkID in ipairs(perkIDTable) do
local perkInfo = GameInfo.UnitPerks[perkID];
if (perkInfo ~= nil and perkInfo[flagKey] ~= nil and perkInfo[flagKey]) then
flag = true;
break;
end
end
if (flag) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(textKey);
end
return s;
end
function ComposeUnitPerkDomainCombatModHelpText(perkIDTable, textKey, domainKey, firstEntry, prefix)
local s = "";
local number = 0;
for index, perkID in ipairs(perkIDTable) do
local perkInfo = GameInfo.UnitPerks[perkID];
if (perkInfo ~= nil) then
for domainCombatInfo in GameInfo.UnitPerks_DomainCombatMods("UnitPerkType = \"" .. perkInfo.Type .. "\" AND DomainType = \"" .. domainKey .. "\"") do
if (domainCombatInfo.CombatMod ~= 0) then
number = number + domainCombatInfo.CombatMod;
end
end
end
end
if (number ~= 0) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
end
if (prefix ~= nil) then
s = s .. prefix;
end
s = s .. L(textKey, number);
end
return s;
end
----------------------------------------------------------------
----------------------------------------------------------------
-- VIRTUES
----------------------------------------------------------------
----------------------------------------------------------------
function GetHelpTextForVirtue(virtueID)
local list = {};
table.insert(list, virtueID);
return GetHelpTextForVirtues(list);
end
function GetHelpTextForVirtues(virtueIDTable)
local s = "";
-- Post-processing functions to display values more clearly to player
local divByHundred = function(number)
-- Some database values are in multiplied by 100 to match game core usage
number = number * 0.01;
return number;
end;
local flipSign = function(number)
number = number * -1;
return number;
end;
local modByGameResearchSpeed = function(number)
local gameSpeedResearchMod = 1;
if (Game ~= nil) then
gameSpeedResearchMod = Game.GetResearchPercent() / 100;
end
number = number * gameSpeedResearchMod;
number = math.floor(number); -- for display, truncate trailing decimals
return number;
end;
s = s .. ComposeVirtueFlagHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CAPTURE_OUTPOSTS_FOR_SELF", "CaptureOutpostsForSelf", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_BARBARIAN_COMBAT_BONUS", "BarbarianCombatBonus", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_RESEARCH_FROM_BARBARIAN_KILLS", "ResearchFromBarbarianKills", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_RESEARCH_FROM_BARBARIAN_CAMPS", "ResearchFromBarbarianCamps", s == "", modByGameResearchSpeed); --value modified by game speed
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_EXP_MODIFIER", "ExpModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_MILITARY_PRODUCTION_MODIFIER", "MilitaryProductionModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_HEALTH_PER_MILITARY_UNIT_TIMES_100", "HealthPerMilitaryUnitTimes100", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_TECH_AFFINITY_XP_MODIFIER", "TechAffinityXPModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_COVERT_OPS_INTRIGUE_MODIFIER", "CovertOpsIntrigueModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NUM_FREE_AFFINITY_LEVELS", "NumFreeAffinityLevels", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_UNIT_PRODUCTION_MODIFIER_PER_UPGRADE", "UnitProductionModifierPerUpgrade", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_STRATEGIC_RESOURCE_MOD", "StrategicResourceMod", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_ORBITAL_COVERAGE_RADIUS_FROM_STATION_TRADE", "OrbitalCoverageRadiusFromStationTrade", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_UNIT_GOLD_MAINTENANCE_MOD", "UnitGoldMaintenanceMod", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_COMBAT_MODIFIER", "CombatModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_OUTPOST_GROWTH_MODIFIER", "OutpostGrowthModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_FOOD_KEPT_AFTER_GROWTH_PERCENT", "FoodKeptAfterGrowthPercent", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_WORKER_SPEED_MODIFIER", "WorkerSpeedModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_PLOT_CULTURE_COST_MODIFIER", "PlotCultureCostModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_EXPLORER_EXPEDITION_CHARGES", "ExplorerExpeditionCharges", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_LAND_TRADE_ROUTE_GOLD_CHANGE", "LandTradeRouteGoldChange", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_SEA_TRADE_ROUTE_GOLD_CHANGE", "SeaTradeRouteGoldChange", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NEW_CITY_EXTRA_POPULATION", "NewCityExtraPopulation", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_EXTRA_HEALTH", "ExtraHealth", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_EXTRA_HEALTH_PER_LUXURY", "HealthPerBasicResourceTypeTimes100", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_UNHEALTH_MOD", "UnhealthMod", s == "", flipSign); --less confusing to show as a positive number in text
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_RESEARCH_MOD_PER_EXTRA_CONNECTED_TECH", "ResearchModPerExtraConnectedTech", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_HEALTH_TO_SCIENCE", "HealthToScience", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_HEALTH_TO_CULTURE", "HealthToCulture", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_POLICY_COST_MODIFIER", "PolicyCostModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_PERCENT_CULTURE_RATE_TO_ENERGY", "PercentCultureRateToEnergy", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_HEALTH_PER_X_POPULATION", "HealthPerXPopulation", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NUM_CITIES_RESEARCH_COST_DISCOUNT", "NumCitiesResearchCostDiscount", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NUM_CITIES_POLICY_COST_DISCOUNT", "NumCitiesPolicyCostDiscount", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_LEAF_TECH_RESEARCH_MODIFIER", "LeafTechResearchModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_PERCENT_CULTURE_RATE_TO_RESEARCH", "PercentCultureRateToResearch", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CULTURE_PER_WONDER", "CulturePerWonder", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_BUILDING_PRODUCTION_MODIFIER", "BuildingProductionModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_WONDER_PRODUCTION_MODIFIER", "WonderProductionModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_BUILDING_ALREADY_IN_CAPITAL_MODIFIER", "BuildingAlreadyInCapitalModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_INTERNAL_TRADE_ROUTE_YIELD_MODIFIER", "InternalTradeRouteYieldModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_HEALTH_PER_TRADE_ROUTE_TIMES_100", "HealthPerTradeRouteTimes100", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_ORBITAL_PRODUCTION_MODIFIER", "OrbitalProductionModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_ORBITAL_DURATION_MODIFIER", "OrbitalDurationModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_UNIT_PURCHASE_COST_MODIFIER", "UnitPurchaseCostModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_HEALTH_PER_BUILDING_TIMES_100", "HealthPerBuildingTimes100", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_EXTRA_HEALTH_PER_CITY", "ExtraHealthPerCity", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NUM_FREE_TECHS", "NumFreeTechs", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NUM_FREE_POLICIES", "NumFreePolicies", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_NUM_FREE_COVERT_AGENTS", "NumFreeCovertAgents", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_ORBITAL_COVERAGE_MODIFIER", "OrbitalCoverageModifier", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_RESEARCH_FROM_EXPEDITIONS", "ResearchFromExpeditions", s == "", modByGameResearchSpeed); --value modified by game speed
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CITY_GROWTH_MOD", "CityGrowthMod", s == "");
s = s .. ComposeVirtueNumberHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CAPITAL_GROWTH_MOD", "CapitalGrowthMod", s == "");
s = s .. ComposeVirtueInterestHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_ENERGY_INTEREST_PERCENT_PER_TURN", "EnergyInterestPercentPerTurn", s == "");
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_YIELD_MODIFIER", "Policy_YieldModifiers", s == "");
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CAPITAL_YIELD_MODIFIER", "Policy_CapitalYieldModifiers", s == "");
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CITY_YIELD_CHANGE", "Policy_CityYieldChanges", s == "");
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CITY_YIELD_PER_POP_CHANGE", "Policy_CityYieldPerPopChanges", s == "", divByHundred); --value in hundredths
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_CAPITAL_YIELD_CHANGE", "Policy_CapitalYieldChanges", s == "");
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_SPECIALIST_EXTRA_YIELD", "Policy_SpecialistExtraYields", s == "");
s = s .. ComposeVirtueYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_TRADE_ROUTE_WITH_STATION_PER_TIER_YIELD_CHANGE", "Policy_TradeRouteWithStationPerTierYieldChanges", s == "");
s = s .. ComposeVirtueResourceClassYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_RESOURCE_CLASS_YIELD_CHANGE", s == "");
s = s .. ComposeVirtueImprovementYieldHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_IMPROVEMENT_YIELD_CHANGE", s == "");
s = s .. ComposeVirtueFreeUnitHelpText(virtueIDTable, "TXT_KEY_POLICY_EFFECT_FREE_UNIT_CLASS", s == "");
return s;
end
function ComposeVirtueNumberHelpText(virtueIDTable, textKey, numberKey, firstEntry, postProcessFunction)
local s = "";
local number = 0;
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil and virtueInfo[numberKey] ~= nil and virtueInfo[numberKey] ~= 0) then
number = number + virtueInfo[numberKey];
end
end
if (number ~= 0) then
if (postProcessFunction ~= nil) then
number = postProcessFunction(number);
end
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey, number);
end
return s;
end
function ComposeVirtueFlagHelpText(virtueIDTable, textKey, flagKey, firstEntry)
local s = "";
local flag = false;
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil and virtueInfo[flagKey] ~= nil and virtueInfo[flagKey]) then
flag = true;
break;
end
end
if (flag) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey);
end
return s;
end
function ComposeVirtueInterestHelpText(virtueIDTable, textKey, numberKey, firstEntry)
local s = "";
local interestPercent = 0;
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil and virtueInfo[numberKey] ~= nil and virtueInfo[numberKey] ~= 0) then
interestPercent = interestPercent + virtueInfo[numberKey];
end
end
if (interestPercent ~= 0) then
local maximum = (interestPercent * GameDefines["ENERGY_INTEREST_PRINCIPAL_MAXIMUM"]) / 100;
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey, interestPercent, maximum);
end
return s;
end
function ComposeVirtueYieldHelpText(virtueIDTable, textKey, tableKey, firstEntry, postProcessFunction)
local s = "";
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil and GameInfo[tableKey] ~= nil) then
for tableInfo in GameInfo[tableKey]("PolicyType = \"" .. virtueInfo.Type .. "\"") do
if (tableInfo.YieldType ~= nil and tableInfo.Yield ~= nil) then
local yieldInfo = GameInfo.Yields[tableInfo.YieldType];
local yieldNumber = tableInfo.Yield;
if (yieldNumber ~= 0) then
if (postProcessFunction ~= nil) then
yieldNumber = postProcessFunction(yieldNumber);
end
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey, yieldNumber, yieldInfo.IconString or "???", yieldInfo.Description);
end
end
end
end
end
return s;
end
function ComposeVirtueResourceClassYieldHelpText(virtueIDTable, textKey, firstEntry)
local s = "";
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil) then
for tableInfo in GameInfo.Policy_ResourceClassYieldChanges("PolicyType = \"" .. virtueInfo.Type .. "\"") do
local resourceClassInfo = GameInfo.ResourceClasses[tableInfo.ResourceClassType];
local yieldInfo = GameInfo.Yields[tableInfo.YieldType];
local yieldNumber = tableInfo.YieldChange;
if (yieldNumber ~= 0) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey, yieldNumber, yieldInfo.IconString or "???", yieldInfo.Description, resourceClassInfo.Description);
end
end
end
end
return s;
end
function ComposeVirtueImprovementYieldHelpText(virtueIDTable, textKey, firstEntry)
local s = "";
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil) then
for tableInfo in GameInfo.Policy_ImprovementYieldChanges("PolicyType = \"" .. virtueInfo.Type .. "\"") do
local improvementInfo = GameInfo.Improvements[tableInfo.ImprovementType];
local yieldInfo = GameInfo.Yields[tableInfo.YieldType];
local yieldNumber = tableInfo.Yield;
if (yieldNumber ~= 0) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey, yieldNumber, yieldInfo.IconString or "???", yieldInfo.Description, improvementInfo.Description);
end
end
end
end
return s;
end
function ComposeVirtueFreeUnitHelpText(virtueIDTable, textKey, firstEntry)
local s = "";
for index, virtueID in ipairs(virtueIDTable) do
local virtueInfo = GameInfo.Policies[virtueID];
if (virtueInfo ~= nil) then
for tableInfo in GameInfo.Policy_FreeUnitClasses("PolicyType = \"" .. virtueInfo.Type .. "\"") do
local unitClassInfo = GameInfo.UnitClasses[tableInfo.UnitClassType];
local unitInfo = GameInfo.Units[unitClassInfo.DefaultUnit];
if (unitInfo ~= nil) then
if (not firstEntry) then
s = s .. "[NEWLINE]";
else
firstEntry = false;
end
s = s .. "[ICON_BULLET]";
s = s .. L(textKey, unitInfo.Description);
end
end
end
end
return s;
end
----------------------------------------------------------------
----------------------------------------------------------------
-- AFFINITIES
----------------------------------------------------------------
----------------------------------------------------------------
function GetHelpTextForAffinity(affinityID, player)
local s = "";
local affinityInfo = GameInfo.Affinity_Types[affinityID]
if affinityInfo then
local currentLevel = -1;
if player then
-- Current level
s = s .. L("TXT_KEY_AFFINITY_STATUS_DETAIL", affinityInfo.IconString or "???", affinityInfo.ColorType, affinityInfo.Description, player:GetAffinityLevel(affinityInfo.ID));
s = s .. "[NEWLINE][NEWLINE]";
currentLevel = player:GetAffinityLevel(affinityID);
end
-- Player perks we can earn
local firstEntry = true;
for levelInfo in GameInfo.Affinity_Levels() do
local levelText = GetHelpTextForAffinityLevel(affinityID, levelInfo.ID);
if (levelText ~= "") then
levelText = (affinityInfo.IconString or "???") .. "[" .. affinityInfo.ColorType .. "]" .. levelInfo.ID .. "[ENDCOLOR] : " .. levelText;
if (levelInfo.ID <= currentLevel) then
levelText = "[" .. affinityInfo.ColorType .. "]" .. levelText .. "[ENDCOLOR]";
end
if (firstEntry) then
firstEntry = false;
else
s = s .. "[NEWLINE]";
end
s = s .. levelText;
end
end
if player then
local nextLevel = player:GetAffinityLevel(affinityID) + 1;
local nextLevelInfo = GameInfo.Affinity_Levels[nextLevel];
-- Progress towards next level
if (nextLevelInfo ~= nil) then
s = s .. "[NEWLINE][NEWLINE]";
s = s .. L("TXT_KEY_AFFINITY_STATUS_PROGRESS", player:GetAffinityScoreTowardsNextLevel(affinityInfo.ID), player:CalculateAffinityScoreNeededForNextLevel(affinityInfo.ID));
else
s = s .. "[NEWLINE][NEWLINE]";
s = s .. L("TXT_KEY_AFFINITY_STATUS_MAX_LEVEL");
end
-- Dominance
local isDominant = affinityInfo.ID == player:GetDominantAffinityType();
if (nextLevelInfo ~= nil) then
local penalty = nextLevelInfo.AffinityValueNeededAsNonDominant - nextLevelInfo.AffinityValueNeededAsDominant;
-- Only show dominance once we are at the point where the level curve diverges
if (penalty > 0) then
if (isDominant) then
s = s .. "[NEWLINE][NEWLINE]";
s = s .. L("TXT_KEY_AFFINITY_STATUS_DOMINANT");
else
s = s .. "[NEWLINE][NEWLINE]";
s = s .. L("TXT_KEY_AFFINITY_STATUS_NON_DOMINANT_PENALTY", penalty);
end
end
elseif (isDominant) then
-- Or once we have reached max level
s = s .. "[NEWLINE][NEWLINE]";
s = s .. L("TXT_KEY_AFFINITY_STATUS_DOMINANT");
end
end
end
return s;
end
local g_playerPerkKey = { [GameInfoTypes.AFFINITY_TYPE_HARMONY] = "HarmonyPlayerPerk", [GameInfoTypes.AFFINITY_TYPE_PURITY] = "PurityPlayerPerk", [GameInfoTypes.AFFINITY_TYPE_SUPREMACY] = "SupremacyPlayerPerk" }
-- Does not include unit upgrade unlocks
function GetHelpTextForAffinityLevel(affinityID, affinityLevel)
local tips = table()
local affinityInfo = GameInfo.Affinity_Types[affinityID]
local affinityLevelInfo = GameInfo.Affinity_Levels[affinityLevel]
if affinityInfo and affinityLevelInfo then
-- Gained a Player Perk?
local perkInfo = GameInfo.PlayerPerks[affinityLevelInfo[g_playerPerkKey[affinityID]]]
tips:insertLocalizedIf( perkInfo and perkInfo.Help )
-- Unlocked Covert Ops?
for row in GameInfo.CovertOperation_AffinityPrereqs{ AffinityType = affinityInfo.Type, Level = affinityLevel } do
local covertOpInfo = GameInfo.CovertOperations[ row.CovertOperationType ]
tips:insertLocalizedIf( covertOpInfo and "TXT_KEY_AFFINITY_LEVEL_UP_DETAILS_COVERT_OP_UNLOCKED", covertOpInfo.Description )
end
-- Unlocked Projects (for Victory)?
for row in GameInfo.Project_AffinityPrereqs{ AffinityType = affinityInfo.Type, Level = affinityLevel } do
local projectInfo = GameInfo.Projects[row.ProjectType]
local victoryInfo = GameInfo.Victories[projectInfo.VictoryPrereq]
tips:insertLocalizedIf( projectInfo and victoryInfo and "TXT_KEY_AFFINITY_LEVEL_UP_DETAILS_PROJECT_UNLOCKED", projectInfo.Description, victoryInfo.Description )
end
-- Unlocked Units
for affinity in GameInfo.Unit_AffinityPrereqs{ AffinityType = affinityInfo.Type, Level = affinityLevel } do
local unit = GameInfo.Units[affinity.UnitType]
if unit then
local tip = UnitColor( L(unit.Description) )
if (unit.RangedCombat or 0) > 0 then
tip = S("%s %i[ICON_RANGE_STRENGTH]", tip, unit.RangedCombat )
elseif (unit.Combat or 0) > 0 then
tip = S("%s %i[ICON_STRENGTH]", tip, unit.Combat )
end
tips:insert( tip )
end
end
-- Unlocked Buildings
for affinity in GameInfo.Building_AffinityPrereqs{ AffinityType = affinityInfo.Type, Level = affinityLevel } do
local building = GameInfo.Buildings[affinity.BuildingType]
tips:insertIf( building and BuildingColor( L(building.Description) ) )
end
end
return tips:concat( ", " )
end
function CacheDatabaseQueries()
end
end
|
--- Window library
-- @module window
-- @alias lib
local lib = {}
local ui = require("OCX/OCUI")
local logger = require("log")("Window Manager")
local draw = require("OCX/OCDraw")
local gpu = require("driver").gpu
local tasks = require("tasks")
local desktop = {}
-- The buffer containing the desktop wallpaper
local wallpaperBuffer
local exclusiveContext = nil
local function titleBar()
local comp = ui.component()
comp._render = function(self)
local win = self.parent
local middle = math.floor(win.width / 2 - win.title:len() / 2)
self.canvas.fillRect(1, 1, win.width, 1, 0xCCCCCC)
self.canvas.drawText(middle, 1, win.title, 0xFFFFFF)
local minimizeChar = '-' -- unicode.char(0x25CB)
local maximizeChar = unicode.char(0x25A1)
local closeChar = unicode.char(0xD7)
self.canvas.drawText(win.width - 5, 1, minimizeChar .. " " .. maximizeChar, 0xFFFFFF)
self.canvas.drawText(win.width - 1, 1, closeChar, 0xFFFFFF)
end
return comp
end
--- Return a list of rectangles as if B, a part of A, was removed
local function xorRectangle(a, b)
local rectangles = {}
if b.y < a.y + a.h and b.y + b.h > a.y then
if b.x <= a.x and b.x + b.w >= a.x then
-- -----------
-- | B | A |
-- -----------
table.insert(rectangles, { -- TODO: fix algorithm
x = b.x + b.w,
y = a.y,
w = a.w - (b.x + b.w - a.x),
h = a.h
})
end
if b.x < a.x + a.w and b.x > a.x then
-- -----------
-- | A | B |
-- -----------
table.insert(rectangles, {
x = a.x,
y = a.y,
w = b.x - a.x,
h = a.h
})
end
end
if b.x < a.x + a.w and b.x + b.w > a.x then
if b.y <= a.y and b.y + b.h >= a.y then
-- -----
-- | B |
-- |---|
-- | |
-- | A |
-- | |
-- -----
table.insert(rectangles, {
x = a.x,
y = b.y + b.h,
w = a.w,
h = a.h - (b.y + b.h - a.y)
})
end
if b.y < a.y + a.h and b.y > a.y then
-- -----
-- | |
-- | A |
-- | |
-- |---|
-- | B |
-- -----
table.insert(rectangles, {
x = a.x,
y = a.y,
w = a.w,
h = b.y - a.y - 1
})
end
end
if #rectangles > 0 then
-- TODO: remove duplicates from vertical and horizontal checking
local final = {}
for _, rect in pairs(rectangles) do
if rect.w > 0 and rect.h > 0 then
table.insert(final, rect)
end
end
return final
end
return {a}
end
--- Create a new window
function lib.newWindow(width, height, title)
local window = {
title = title or "",
x = 30,
y = 10,
width = width or 40,
height = height or 10,
dirty = false,
focused = false,
undecorated = false,
visible = false,
titleBar = titleBar(),
container = ui.container()
}
window.container.width = window.width
window.container.height = window.height
window.titleBar.parent = window
window.container.window = window
function window:focus()
local idx = 0
for k, v in pairs(desktop) do
if v == self then idx = k end
end
if idx == 0 then
error("window not displayed")
end
table.remove(desktop, idx)
table.insert(desktop, 1, self)
self.dirty = true
self:update()
self.titleBar:redraw()
end
function window:show()
table.insert(desktop, 1, self)
self.visible = true
self.dirty = true
lib.drawDesktop()
end
function window:hide(disposing)
self.visible = false
self.titleBar:dispose(true)
self.container:dispose(true)
lib.drawBackground(self.x, self.y, self.width, self.height)
local idx = 0
for k, v in pairs(desktop) do
if v == self then
idx = k
end
end
if idx == 0 then
return
end
table.remove(desktop, idx)
lib.drawDesktop()
end
function window:update()
if self.visible and not exclusiveContext then
local cy = self.y+1
local ch = self.height-1
if self.undecorated then
cy = self.y
ch = self.height
end
self.container.x = self.x
self.container.y = cy
self.container.width = self.width
self.container.height = ch
if not self.undecorated and self.titleBar.width ~= self.width then
self.titleBar.x = self.x
self.titleBar.y = self.y
self.titleBar.width = self.width
self.titleBar:redraw()
end
local i = 1
local aRect = {
x = self.container.x,
y = self.container.y,
w = self.container.width,
h = self.container.height
}
local rectangles = {
aRect
}
while i < #desktop do
if desktop[i] == self then break end
local winRect = {
x = desktop[i].container.x,
y = desktop[i].container.y,
w = desktop[i].container.width,
h = desktop[i].container.height
}
local newRects = {}
for _, rect in pairs(rectangles) do
local rectList = xorRectangle(rect, winRect)
for _, r in pairs(rectList) do
table.insert(newRects, r)
end
end
rectangles = newRects
i = i + 1
end
--if rectangles[1].x ~= aRect.x or rectangles[1].w ~= aRect.w then
--print("col " .. aRect.x .. " -> " .. rectangles[1].x .. "; " .. aRect.w .. " -> " .. rectangles[1].w)
--end
self.container.clip = rectangles
self.container:redraw()
end
end
function window:dispose()
local idx = 0
for k, v in pairs(desktop) do
if v == self then
idx = k
end
end
if idx == 0 then
return
end
if self.visible then
self:hide()
end
end
table.insert(tasks.getCurrentProcess().exitHandlers, function()
window:dispose()
end)
return window
end
--- Returns the desktop
function lib.desktop()
return desktop
end
--- Clear the desktop
function lib.clearDesktop()
for k, v in pairs(desktop) do
v.visible = false
if v.titleBar then
v.titleBar:dispose(true)
end
v.container:dispose(true)
end
desktop = {}
end
--- Draw a section of the desktop background.
-- @int x The X position of the background section
-- @int y The Y position of the background section
-- @int width The width of the background section
-- @int height The height of the background section
function lib.drawBackground(x, y, width, height)
local rw, rh = gpu.getResolution()
if x+width-1 > rw then
width = rw-x
end
if y+height > rh then
height = rh-y
end
if x < 1 or y < 1 or width < 1 or height < 1 then return end
if wallpaperBuffer then
gpu.blit(wallpaperBuffer, gpu.screenBuffer(), x, y, width, height, x, y)
else
gpu.setColor(0xAAAAAA)
gpu.fill(x, y, width, height)
end
end
--- Move the given window
function lib.moveWindow(win, targetX, targetY)
if exclusiveContext then
win.x = targetX
win.y = targetY
win.titleBar.x = win.x
win.titleBar.y = win.y
win.container.x = win.x
win.container.y = (win.undecorated and win.y) or (win.y + 1)
return
end
local rw, rh = gpu.getResolution()
-- delta-X and delta-Y, the change between the last position of the window and the new one.
local dx, dy = targetX - win.x, targetY - win.y
if win.x + (win.width + 1) > rw or win.y + (win.height+1) > rh
or win.x <= 0 or win.y <= 0 then
win.x = targetX
win.y = targetY
lib.drawWindow(win)
else
gpu.copy(win.x, win.y, win.width, win.height, dx, dy)
end
if dx > 0 then -- moving the window to the right
lib.drawBackground(win.x, win.y, dx, win.height)
elseif dx < 0 then -- moving the window to the left
lib.drawBackground(targetX + win.width, win.y, -dx, win.height)
end
if dy > 0 then -- moving the window down
lib.drawBackground(win.x, win.y, win.width, dy)
elseif dy < 0 then -- moving the window up
lib.drawBackground(win.x, targetY + win.height, win.width, -dy)
end
win.x = targetX
win.y = targetY
win.titleBar.x = win.x
win.titleBar.y = win.y
win.container.x = win.x
win.container.y = (win.undecorated and win.y) or (win.y + 1)
local idx = 0
for k, v in pairs(desktop) do
if v == win then
idx = k
break
end
end
local i = idx
while i < #desktop do
-- TODO: check if collision before requesting redraw
if desktop[i] and desktop[i] ~= win then
desktop[i]:update()
end
i = i + 1
end
end
--- Draw the given window
function lib.drawWindow(win)
if exclusiveContext then return end
if not win.undecorated then
win.titleBar.x = win.x
win.titleBar.y = win.y
win.titleBar.height = 1
win.titleBar.width = win.width
win.titleBar.parent = win
win.titleBar:redraw()
end
local cy = win.y+1
local ch = win.height-1
if win.undecorated then
cy = win.y
ch = win.height
end
win.container.x = win.x
win.container.y = cy
win.container.width = win.width
win.container.height = ch
win.container.parent = win
logger.debug("Draw window at " .. win.x .. "x" .. win.y .. " of size " .. win.width .. "x" .. win.height)
win:update()
for _, w in pairs(desktop) do
if w.x<win.x+win.width and w.x+w.width>win.x or w.y<win.y+win.height or w.y+w.height>win.y then
w.dirty = true
end
end
end
--- Returns context if the caller can now use the GPU driver freely by temporarily disabling the window manager
--- This could typically be used for games or fullscreen Fushell programs.
function lib.requestExclusiveContext()
if exclusiveContext then
return false
end
local context = {
pid = require("tasks").getCurrentProcess().pid
}
function context:release()
if exclusiveContext == self then
exclusiveContext = nil
lib.forceDrawDesktop()
end
end
exclusiveContext = context
return context
end
function lib.hasExclusiveContext()
return exclusiveContext ~= nil
end
function lib.setWallpaper(buffer)
wallpaperBuffer = buffer
end
-- Forcibly redraw all of the desktop, including background
function lib.forceDrawDesktop()
lib.drawBackground(1, 1, 160, 50)
for _, win in pairs(desktop) do
win.dirty = true
end
lib.drawDesktop()
end
--- Draw all the windows in the desktop
function lib.drawDesktop()
for _, win in pairs(desktop) do
if win.visible and win.dirty and not exclusiveContext then
lib.drawWindow(win)
-- win.dirty = false
end
end
end
return lib
|
local json = require("scripts.json_util")
local result = {version = "0.2.0"}
json.set_comments(result, {
version = "\z
====================================================================================================\n\z
This file is generated. To make changes to this file modify the\n\z
scripts/generate_vscode_launch_json.lua file and run it.\n\z
To run the script ensure the current working directory is the root of the project\n\z
and run it from a terminal with `bin/<platform>/lua -- scripts/generate_vscode_launch_json.lua`\n\z
where '<platform>' is 'linux', 'osx' or 'windows'.\n\z
\n\z
Additional note: This file is still included in git purely for convenience. Just make sure to\n\z
commit both the changed script and the generated output in the same commit.\n\z
====================================================================================================\n\z
\n\z
Use IntelliSense to learn about possible attributes.\n\z
Hover to view descriptions of existing attributes.\n\z
For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\z
"
})
local configurations = {}
result.configurations = configurations
local inputs = {}
result.inputs = inputs
json.set_order(result, {
"version",
"configurations",
"inputs",
})
local function add_profile(profile)
json.set_order(profile, {
"name",
"type",
"request",
"preLaunchTask",
})
configurations[#configurations+1] = profile
end
local function add_input(input)
json.set_order(input, {
"id",
"type",
})
inputs[#inputs+1] = input
end
---cSpell:ignore factoriomod, freeplay
local function new_factorio_profile(params)
local profile = {
name = params.name,
type = "factoriomod",
request = "launch",
preLaunchTask = "Build Factorio Mod Debug",
factorioPath = "${env:PHOBOS_FACTORIO_PATH}",
modsPath = "${workspaceFolder}/out/debug_factorio",
allowDisableBaseMod = true,
adjustMods = {
phobos = true,
},
disableExtraMods = true,
factorioArgs = {
"--load-scenario", params.scenario,
"--window-size", "1280x720",
},
}
for _, mod in ipairs(params.base_mods) do
profile.adjustMods[mod] = true
end
return profile
end
add_profile(new_factorio_profile{
name = "Factorio Mod (base)",
base_mods = {"base"},
scenario = "base/freeplay",
})
add_profile(new_factorio_profile{
name = "Factorio Mod (minimal no base)",
base_mods = {
"minimal-no-base-mod",
"JanSharpDevEnv",
},
scenario = "JanSharpDevEnv/NoBase",
})
local function add_phobos_profiles(params)
for _, compiler in ipairs{"Lua", "Phobos"} do
local function make_platform_specific_stuff(platform)
local args = {
compiler == "Phobos" and "out/src/debug" or "src",
"bin/"..platform,
platform == "windows" and ".dll" or ".so",
params.main_filename
or compiler == "Phobos"
and "out/src/debug/"..params.main_filename_in_phobos_root
or "src/"..params.main_filename_in_phobos_root,
}
json.set_comments(args, {
"root",
"c_lib_root",
"c_lib_extension",
"main_filename",
"arguments passed along to the main file",
})
if params.args then
local param_args = type(params.args) == "table" and params.args or params.args(platform)
for _, arg in ipairs(param_args) do
args[#args+1] = arg
end
end
return {
program = {
lua = "bin/"..platform.."/lua",
file = compiler == "Phobos" and "out/src/debug/entry_point.lua" or "src/entry_point.lua",
},
args = args,
}
end
local profile = {
name = compiler.." "..params.name,
type = "lua-local",
request = "launch",
linux = make_platform_specific_stuff("linux"),
osx = make_platform_specific_stuff("osx"),
windows = make_platform_specific_stuff("windows"),
-- hm, apparently it doesn't complain anymore when it's omitted but defined for all platforms
-- program = {
-- lua = "",
-- file = "",
-- },
}
-- json.set_comments(profile, {
-- program = "uh, I guess? vscode is complaining without this",
-- })
profile.preLaunchTask = compiler == "Phobos" and "Build Debug" or nil
add_profile(profile)
end
end
add_phobos_profiles{
name = "debugging/main",
main_filename = "debugging/main.lua",
args = {"temp/test.lua"},
}
add_phobos_profiles{
name = "debugging/formatter",
main_filename = "debugging/formatter.lua",
args = {"temp/test.lua"},
}
add_phobos_profiles{
name = "tests/compile_test",
main_filename = "tests/compile_test.lua",
}
add_phobos_profiles{
name = "tests/main",
main_filename = "tests/main.lua",
}
local function add_test_id_input(postfix)
add_input{
id = "testId"..postfix,
type = "promptString",
description = "The test id of the test to run.",
default = nil,
password = false,
}
end
add_test_id_input("1")
add_test_id_input("2")
add_phobos_profiles{
name = "tests/main test id",
main_filename = "tests/main.lua",
args = {"--test-ids", "${input:testId1}"}
}
add_phobos_profiles{
name = "tests/main test ids",
main_filename = "tests/main.lua",
args = {"--test-ids", "${input:testId1}", "${input:testId2}"}
}
add_input{
id = "testScope",
type = "promptString",
description = "The scope to run.",
default = nil,
password = false,
}
add_phobos_profiles{
name = "tests/main test scope",
main_filename = "tests/main.lua",
args = {"--scopes", "${input:testScope}"}
}
add_phobos_profiles{
name = "tests/main test scope and id",
main_filename = "tests/main.lua",
args = {"--scopes", "${input:testScope}", "--test-ids", "${input:testId1}"}
}
add_phobos_profiles{
name = "src/main (debug profile)",
main_filename_in_phobos_root = "main.lua",
args = function(platform) return {"--profile-names", "debug", "--", "--platform", platform} end,
}
add_phobos_profiles{
name = "src/main (debug profile with docs)",
main_filename_in_phobos_root = "main.lua",
args = function(platform) return {
"--profile-names", "debug", "--", "--platform", platform, "--generate-docs",
} end,
}
add_phobos_profiles{
name = "src/main (debug_factorio profile)",
main_filename_in_phobos_root = "main.lua",
args = {"--profile-names", "debug_factorio"},
}
local file = assert(io.open(".vscode/launch.json", "w"))
assert(file:write(json.to_json(result, {
default_empty_table_type = "array",
use_trailing_comma = true,
indent = " ",
})))
assert(file:close())
|
object_building_kashyyyk_decd_trillium_palm_tall01 = object_building_kashyyyk_shared_decd_trillium_palm_tall01:new {
}
ObjectTemplates:addTemplate(object_building_kashyyyk_decd_trillium_palm_tall01, "object/building/kashyyyk/decd_trillium_palm_tall01.iff")
|
local ffi = require 'ffi'
ffi.cdef [[
struct timeval {
long tv_sec;
long tv_usec;
};
void gettimeofday(struct timeval *tv, void *p);
]]
local time, timeMT, timevalMT = {}, {}, {}
setmetatable(time, timeMT)
function timeMT:__call(...)
local now = time.new(...)
ffi.C.gettimeofday(now, nil)
return now
end
function timevalMT:__index(i)
if i == 'since' then
local now = time()
return tonumber(now.tv_sec) - tonumber(self.tv_sec) + tonumber(now.tv_usec - self.tv_usec) / 1000000.0
end
return nil
end
time.new = ffi.metatype('struct timeval', timevalMT)
return time |
-- This module may be used as basis for application
-- controllers. It can handle CGI headers, inputs
-- output buffering and some more.
local Controller = {}
Controller.__index = Controller;
-- Controller's constructor.
function Controller.new()
local self = setmetatable({}, Controller);
-- set some basic defaults
self.responseBody = "";
self.responseHeaders = {
["Status"] = "200 OK",
["Cache-Control"] = "no-store, no-cache, must-revalidate",
["Access-Control-Allow-Origin"] = "*",
["Pragma"] = "no-cache",
["Expires"] = "Thu, 19 Nov 1981 08:52:00 GMT",
["Date"] = os.date("!%a, %d %b %Y %H:%M:%S GMT"),
["Content-Type"] = "text/html; charset=UTF-8"
}
return self;
end
-- get raw query string
function Controller:fetchGetData()
return os.getenv("QUERY_STRING");
end
-- get raw post data (only x-www-form-urlencoded forms are supported)
function Controller:fetchPostData()
return io.read("*all");
end
-- get accept language list -- en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,zh-TW;q=0.6
function Controller:fetchAcceptLanguage()
local langs = {}
for patt in string.gmatch(os.getenv("HTTP_ACCEPT_LANGUAGE") or "en-US,en;q=0.9", "([^,]+)") do
local lang = string.match(patt, "([^;]+)")
if lang then
table.insert(langs, lang)
end
end
return langs
end
-- Set / replace response header
function Controller:setResponseHeader(name, value)
self.responseHeaders[name] = value;
end
-- Set response status code & message
function Controller:setResponseStatus(status)
self:setResponseHeader("Status", status);
end
-- Enable browser cache for given page.
function Controller:enableBrowserCache()
self:setResponseHeader("Cache-Control", "cache");
self:setResponseHeader("Pragma", "cache");
self:setResponseHeader("Expires", os.date("!%s, %d %b %Y %H:%M:%S GMT", os.time() + 600));
end
-- Redorect user to given url with given redirection code.
-- If external evaluates to false, url will be prefixed
-- by SCRIPT_NAME
function Controller:redirect(location, code, external)
if not code then
code = 303;
end;
if not external then
location = os.getenv("SCRIPT_NAME") .. location;
end
self:setResponseStatus(code .. " Redirect");
self:setResponseHeader("Location", location);
end
-- abstract method to overload in controller, called before any action call
function Controller:preAction() end;
-- abstract method to overload in controller, called after any action call
function Controller:postAction() end;
-- send response headers & body
function Controller:sendResponse()
-- send response headers
table.foreach(self.responseHeaders, function(name, value)
io.write(name, ": ", value, "\n");
end);
-- empty line after headers
io.write("\n");
-- send response body
io.write(self.responseBody);
end
return Controller;
|
Config = {}
Config.AlignMenu = "center" -- this is where the menu is located [left, right, center, top-right, top-left etc.]
Config.CreateTableInDatabase = true -- enable this the first time you start the script, this will create everything in the database.
Config.KeyPrice = 150
Config.Weapons = true -- enable this if you want weapons in the storage.
Config.DirtyMoney = true -- enable this if you want dirty money in the storage.
Config.Debug = false -- enable this only if you know what you're doing.
Config.ActionLabel = {
["exit"] = "Salida",
["wardrobe"] = "Vestidor",
["invite"] = "Invitar"
}
local city = GetConvar("city", "") -- server.cfc var for the main city. [Los Santos / Paleto Bay]
if city == "Paleto Bay" then
Config.LandLord = {
[1] = {pos = vector3(-300.38, 6329.07, 32.89), data = {name = "Casa normal verde", price = 34000, exception = false}},
[2] = {pos = vector3(-228.58, 6441.97, 31.2), data = {name = "Casa normal marrón", price = 34000, exception = false}},
[3] = {pos = vector3(-349.01, 6223.02, 31.52), data = {name = "Casa normal roja", price = 22000, exception = false}},
[4] = {pos = vector3(32.55, 6595.1, 32.47), data = {name = "Casa normal naranja", price = 22000, exception = false}},
[5] = {pos = vector3(-49.5, 6361.26, 31.44), data = {name = "Almacén industrial", price = 38000, exception = false}},
[6] = {pos = vector3(9.13, 6416.0, 31.41), data = {name = "Almacén mediano", price = 28000, exception = false}},
[7] = {pos = vector3(-193.96, 6266.34, 31.49), data = {name = "Almacén pequeño", price = 20000, exception = false}},
[8] = {pos = vector3(-419.81,6256.06,30.59), data = {name = "Casa en la playa", price = 400, exception = true}},
}
Config.Houses = {
[1] = {pos = vector3(-302.44, 6327.16, 32.89), name = "Casa normal verde",
exit = vector3(11.29, 6288.56, 27.92),
wardrobe = vector3(10.91, 6294.14, 27.92),
invite = vector3(12.58, 6289.48, 27.92)},
[2] = {pos = vector3(-229.62, 6445.51, 31.2), name = "Casa normal marrón",
exit = vector3(38.98, 6318.89, 28.37),
wardrobe = vector3(41.72, 6320.47, 28.37),
invite = vector3(40.34, 6317.61, 28.37)},
[3] = {pos = vector3(-347.39, 6225.3, 31.88), name = "Casa normal roja",
exit = vector3(27.44, 6302.57, 26.05),
wardrobe = vector3(17.71, 6304.58, 28.05),
invite = vector3(24.14, 6305.92, 28.05)},
[4] = {pos = vector3(31.19, 6596.68, 32.82), name = "Casa normal naranja",
exit = vector3(32.19, 6315.88, 28.47),
wardrobe = vector3(25.6, 6313.61, 28.47),
invite = vector3(32.61, 6314.82, 28.47)},
[5] = {pos = vector3(-51.72, 6360.45, 31.6), name = "Almacén industrial",
exit = vector3(-196.97, 6141.17, 24.74),
wardrobe = vector3(0.0, 0.0, 0.0),
invite = vector3(-195.48, 6142.85, 24.74)},
[6] = {pos = vector3(6.72,6414.11,31.42), name = "Almacén mediano",
exit = vector3(11.14, 6457.17, 26.26),
wardrobe = vector3(0.0, 0.0, 0.0),
invite = vector3(9.67, 6459.73, 26.26)},
[7] = {pos = vector3(-195.4, 6264.63, 31.49), name = "Almacén pequeño",
exit = vector3(28.56, 6472.33, 26.27),
wardrobe = vector3(0.0, 0.0, 0.0),
invite = vector3(29.89, 6473.48, 26.27)},
[8] = {pos = vector3(-437.8,6272.52,30.07), name = "Casa en la playa",
exit = vector3(173.74, 6391.27, 29.54),
wardrobe = vector3(164.72, 6387.21, 28.14),
invite = vector3(173.14, 6392.79, 29.54)},
}
elseif city == "Los Santos" then
Config.LandLord = {
[1] = {pos = vector3(-300.38, 6329.07, 32.89), data = {name = "Casa normal verde", price = 34000, exception = false}},
[2] = {pos = vector3(-228.58, 6441.97, 31.2), data = {name = "Casa normal marrón", price = 34000, exception = false}},
[3] = {pos = vector3(-349.01, 6223.02, 31.52), data = {name = "Casa normal roja", price = 22000, exception = false}},
[4] = {pos = vector3(32.55, 6595.1, 32.47), data = {name = "Casa normal naranja", price = 22000, exception = false}},
[5] = {pos = vector3(-49.5, 6361.26, 31.44), data = {name = "Almacén industrial", price = 38000, exception = false}},
[6] = {pos = vector3(9.13, 6416.0, 31.41), data = {name = "Almacén mediano", price = 28000, exception = false}},
[7] = {pos = vector3(-193.96, 6266.34, 31.49), data = {name = "Almacén pequeño", price = 20000, exception = false}},
[8] = {pos = vector3(-419.81,6256.06,30.59), data = {name = "Casa en la playa", price = 400, exception = true}},
}
Config.Houses = {
[1] = {pos = vector3(-302.44, 6327.16, 32.89), name = "Casa normal verde",
exit = vector3(11.29, 6288.56, 27.92),
wardrobe = vector3(10.91, 6294.14, 27.92),
invite = vector3(12.58, 6289.48, 27.92)},
[2] = {pos = vector3(-229.62, 6445.51, 31.2), name = "Casa normal marrón",
exit = vector3(38.98, 6318.89, 28.37),
wardrobe = vector3(41.72, 6320.47, 28.37),
invite = vector3(40.34, 6317.61, 28.37)},
[3] = {pos = vector3(-347.39, 6225.3, 31.88), name = "Casa normal roja",
exit = vector3(27.44, 6302.57, 26.05),
wardrobe = vector3(17.71, 6304.58, 28.05),
invite = vector3(24.14, 6305.92, 28.05)},
[4] = {pos = vector3(31.19, 6596.68, 32.82), name = "Casa normal naranja",
exit = vector3(32.19, 6315.88, 28.47),
wardrobe = vector3(25.6, 6313.61, 28.47),
invite = vector3(32.61, 6314.82, 28.47)},
[5] = {pos = vector3(-51.72, 6360.45, 31.6), name = "Almacén industrial",
exit = vector3(-196.97, 6141.17, 24.74),
wardrobe = vector3(0.0, 0.0, 0.0),
invite = vector3(-195.48, 6142.85, 24.74)},
[6] = {pos = vector3(6.72,6414.11,31.42), name = "Almacén mediano",
exit = vector3(11.14, 6457.17, 26.26),
wardrobe = vector3(0.0, 0.0, 0.0),
invite = vector3(9.67, 6459.73, 26.26)},
[7] = {pos = vector3(-195.4, 6264.63, 31.49), name = "Almacén pequeño",
exit = vector3(28.56, 6472.33, 26.27),
wardrobe = vector3(0.0, 0.0, 0.0),
invite = vector3(29.89, 6473.48, 26.27)},
[8] = {pos = vector3(-437.8,6272.52,30.07), name = "Casa en la playa",
exit = vector3(173.74, 6391.27, 29.54),
wardrobe = vector3(164.72, 6387.21, 28.14),
invite = vector3(173.14, 6392.79, 29.54)},
}
end
-- This is the keys configuration where we can change the keys we use / add new keys.
Config.Keys = {
["ENTER"] = 215,
["ARROW LEFT"] = 174,
["ARROW RIGHT"] = 175,
["ARROW UP"] = 172,
["ARROW DOWN"] = 173,
["NUMPAD 8"] = 127,
["NUMPAD 5"] = 126,
["Q"] = 44,
["E"] = 38,
["G"] = 47,
["F"] = 23,
["X"] = 73
}
Config.MaxWeight = 100000
Config.localWeight = {
--- FOOD ---
bread = 250,
chocolate = 500,
cocacola = 500,
croquettes = 250,
cupcake = 250,
hamburger = 250,
protein_shake = 500,
sandwich = 250,
sportlunch = 250,
--- FOOD ---
--- DRINKS ---
water = 500,
coffe = 500,
milk = 500,
beer = 500,
tequila = 500,
vodka = 500,
whisky = 500,
wine = 500,
icetea = 500,
powerade = 500,
--- DRINKS ---
--- MEDS ---
bandage = 100,
medikit = 500,
--- MEDS ---
--- JOBS ---
alive_chicken = 1000,
clothe = 1000,
copper = 1000,
diamond = 1000,
cutted_wood = 1000,
essence = 1000,
fabric = 1000,
gold = 1000,
iron = 1000,
packaged_chicken = 1000,
packaged_plank = 1000,
petrol = 1000,
petrol_raffin = 1000,
slaughtered_chicken = 1000,
stone = 1000,
washed_stone = 1000,
wood = 1000,
wool = 1000,
--- JOBS ---
--- MISC ---
bulletproof = 2500,
lighter = 100,
cigarett = 100,
gazbottle = 1000,
scratchoff = 1,
scratchoff_used = 1,
gym_membership = 1,
oxygen_mask = 1000,
--- MISC ---
--- TOOLS ---
blowpipe = 1000,
carokit = 1000,
carotool = 1000,
drill = 1000,
fixkit = 1000,
fixtool = 1000,
lockpick = 1000,
repairkit = 1000,
--- TOOLS ---
--- ILEGALS ---
coke = 1000,
coke_pooch = 1000,
meth = 1000,
meth_pooch = 1000,
opium = 1000,
opium_pooch = 1000,
weed = 1000,
weed_pooch = 1000,
--- ILEGALS ---
carbon_piece = 500,
iron_piece = 500,
gold_piece = 500,
silver_piece = 500,
water_25 = 250,
water_50 = 500,
fertilizer_25 = 1000,
fertilizer_50 = 2000,
blueberry_fruit = 300,
blueberry_package = 3000,
blueberry_seed = 50,
bactery_waterBottle = 300,
bottleWater_package = 3000,
full_waterBottle = 300,
pollution_waterBottle = 300,
toxic_waterBottle = 300,
lingot_carbon = 5000,
lingot_iron = 5000,
lingot_silver = 5000,
lingot_gold = 5000,
pine_wood = 1000,
pine_processed = 9000,
shovel = 2000,
weed = 50,
weed_pooch = 150,
aditives = 1000,
coca = 200,
cocaplant = 500,
cocaseed = 50,
cocawithout = 150,
---WEAPONS----
clip = 1000,
WEAPON_GRENADE = 1000,
WEAPON_BZGAS = 1000,
WEAPON_SMOKEGRENADE = 1000,
WEAPON_RAILGUN = 1000,
WEAPON_STICKYBOMB = 1000,
WEAPON_KNIFE = 1000,
WEAPON_NIGHTSTICK = 1000,
WEAPON_HAMMER = 1000,
WEAPON_BAT = 1000,
WEAPON_GOLFCLUB = 1000,
WEAPON_CROWBAR = 1000,
WEAPON_PETROLCAN = 1000,
WEAPON_FIREEXTINGUISHER = 1000,
WEAPON_BALL = 1000,
WEAPON_DAGGER = 1000,
WEAPON_SWEAPON_SNOWBALLTUNGUN = 1000,
WEAPON_GARBAGEBAG = 1000,
WEAPON_HANDCUFFS = 1000,
WEAPON_KNUCKLE = 1000,
WEAPON_HATCHET = 1000,
WEAPON_MACHETE = 1000,
WEAPON_SWITCHBLADE = 1000,
WEAPON_BATTLEAXE = 1000,
WEAPON_POOLCUE = 1000,
WEAPON_FLASHLIGHT = 1000,
WEAPON_FLAREGUN = 1000,
WEAPON_PISTOL = 1000,
WEAPON_COMBATPISTOL = 1000,
WEAPON_APPISTOL = 1000,
WEAPON_PISTOL50 = 1000,
WEAPON_COMBATPDW = 1000,
WEAPON_MARKSMANPISTOL = 1000,
WEAPON_SNSPISTOL = 1000,
WEAPON_HEAVYPISTOL = 1000,
WEAPON_REVOLVER = 1000,
WEAPON_VINTAGEPISTOL = 1000,
WEAPON_STUNGUN = 1000,
WEAPON_FIREWORK = 1000,
WEAPON_MINISMG = 1000,
WEAPON_SMG = 1000,
WEAPON_MICROSMG = 1000,
WEAPON_ASSAULTSMG = 1000,
WEAPON_PUMPSHOTGUN = 1000,
WEAPON_AUTOSHOTGUN = 1000,
WEAPON_DBSHOTGUN = 1000,
WEAPON_ASSAULTSHOTGUN = 1000,
WEAPON_SAWNOFFSHOTGUN = 1000,
WEAPON_HEAVYSHOTGUN = 1000,
WEAPON_MUSKET = 1000,
WEAPON_COMPACTRIFLE = 1000,
WEAPON_MARKSMANRIFLE = 1000,
WEAPON_SPECIALCARBINE = 1000,
WEAPON_ADVANCEDRIFLE = 1000,
WEAPON_CARBINERIFLE = 1000,
WEAPON_ASSAULTRIFLE = 1000,
WEAPON_BALL = 1000,
WEAPON_MG = 1000,
WEAPON_COMBATMG = 1000,
WEAPON_BULLPUPRIFLE = 1000,
WEAPON_BULLPUPSHOTGUN = 1000,
WEAPON_HEAVYSNIPER = 1000,
WEAPON_SNIPERRIFLE = 1000,
WEAPON_FLARE = 1000,
---WEAPONS----
--- MONEY ---
black_money = 1,
bank = 1,
--- MONEY ---
}
-- This is the tutorial in the left corner to show how to control the furnishing menu.
Config.HelpTextMessage = "~INPUT_CELLPHONE_LEFT~ ~INPUT_CELLPHONE_UP~ ~INPUT_CELLPHONE_DOWN~ ~INPUT_CELLPHONE_RIGHT~ Mover ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_VEH_SUB_PITCH_UP_ONLY~ / ~INPUT_VEH_SUB_PITCH_DOWN_ONLY~ Altura ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_COVER~ / ~INPUT_CONTEXT~ Rotación ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_DETONATE~ Poner en el suelo ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_SPRINT~ Velocidad ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_ENTER~ Seleccionar mueble ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_FRONTEND_ENDSCREEN_ACCEPT~ Guardar ~n~"
Config.HelpTextMessage = Config.HelpTextMessage .. "~INPUT_VEH_DUCK~ Cancelar y eliminar ~n~"
UUID = function()
math.randomseed(GetGameTimer() * math.random())
return math.random(100000, 999999)
end
|
dofile("math_s.lua")
dofile("am2320.lua")
dofile("managerGpio.lua")
dofile("handlerTRH.lua")
--dofile("_ds18b20.lua")
--local function ds18b20()
-- return getTemp(7)
--end
function getSensors(cn)
local data={}
-- rh,t=am2320_h()
-- data.rh, data.temp = rh/10, t/10
data.rh, data.temp = 51, 26
-- data.rt = ds18b20()
data.rt = 19.55
data.ip = wifi.ap.getip()
data.mac = wifi.ap.getmac()
data.dp = dewPoint(data)
data.trh = handlerTRH(cn)
managerGpio(data)
return data
end
|
--[[
Author: Kyoma
Filename: LibTitleLocale.lua
Version: 4 (Summerset)
Total: 115 titles
]]--
local libLoaded
local LIB_NAME, VERSION = "LibTitleLocale", 4
local lib, oldminor = LibStub:NewLibrary(LIB_NAME, VERSION)
if not lib then return end
local LocaleTitles =
{
["fr"] =
{
[2] =
{
[1921] = "L'Impitoyable",
[1538] = "Ombre d'Hist",
[1159] = "Adepte des terres mortes",
[1546] = "Faucheur de sombreciel",
[1677] = "Magnanime",
[1808] = "Troubleur de rouages",
[2193] = "Sauveur du Couchant",
[2194] = "Émissaire",
[1305] = "L'insubmersible",
[1956] = "Protecteur du chaos",
[1410] = "Exécuteur",
[1304] = "Champion de l'Arène de Maelström",
[1689] = "Duelliste",
[1434] = "Fléau de la Côte d'or",
[2075] = "Rédempteur immortel",
[2076] = "Aide-soignant",
[2077] = "Aliéniste assistant",
[2049] = "Héros de la Cité mécanique",
[2079] = "Voix de la raison",
[1696] = "Briseur de forge",
[1915] = "Boucher des champs de bataille",
[1954] = "Gardien du chaos",
[1955] = "Champion du chaos",
[1444] = "Surineur",
[1691] = "Fléau des hommes-bêtes",
[51] = "Chasseur de monstres",
[2087] = "Sauveur sanctifié",
[1704] = "Thane d'Épervine",
[1965] = "Dovahkriid",
[1810] = "Coadjuteur de Divayth Fyr",
[703] = "Champion de la guilde des guerriers",
[1836] = "La Dynamo",
[1837] = "Désassembleur général",
[1838] = "Tourmenteur des Tic-tac",
[1462] = "Suzerain ophidien",
[1712] = "Bibliothécaire",
[628] = "Héros de Tamriel",
[1330] = "Le conquérant implacable",
[2227] = "Grand maître artisan",
[1716] = "Seigneur du Désordre",
[2101] = "champion abyssal",
[2230] = "maître des styles",
[627] = "Explorateur",
[1976] = "Gravisseur",
[706] = "Premier sergent",
[106] = "Préfet",
[1723] = "Bouffon royal",
[1852] = "Champion de Vivec",
[61] = "Héros de l'Alliance",
[702] = "Maître mage",
[1727] = "Père de clan",
[1728] = "Seigneur",
[705] = "Grand maréchal",
[1474] = "Briseur de Shéhaï",
[112] = "Seigneur de guerre",
[1391] = "Destructeur des dro-m'Athra",
[494] = "Maître de pêche",
[621] = "Ennemi de Havreglace",
[1260] = "Faiseur de rois",
[1730] = "Comte",
[618] = "Héros du Domaine",
[617] = "Héros du Pacte",
[587] = "Sauveur de Nirn",
[1868] = "Sauveur de Morrowind",
[103] = "Colonel",
[1383] = "Maître voleur",
[2210] = "Mystique",
[318] = "Tueur de seigneur Daedra",
[1892] = "Chevalier stellaire",
[109] = "Palatin Auguste",
[2131] = "Héros du Pas-des-Nuées",
[96] = "Vétéran",
[2133] = "Briseur d'ombre",
[2140] = "Libérateur des welkynars",
[1879] = "Ami des clans",
[2136] = "Porteur de lumière",
[1248] = "Héros de Wrothgar",
[1503] = "Tueur de mages",
[2139] = "Cœur-de-griffon",
[92] = "Volontaire",
[93] = "Recrue",
[94] = "Première classe",
[95] = "Légionnaire",
[992] = "Champion de l'arène de l'Étoile du dragon",
[97] = "Caporal",
[98] = "Sergent",
[99] = "Lieutenant",
[100] = "Capitaine",
[101] = "Major",
[102] = "Centurion",
[1895] = "Exsanguinateur",
[104] = "Tribun",
[105] = "Brigadier",
[1898] = "Chasseur de reliques",
[107] = "Prétorien",
[108] = "Palatin",
[1901] = "Gardien de reliques",
[110] = "Légat",
[111] = "Général",
[1904] = "Porte-étendard",
[113] = "Grand seigneur de guerre",
[114] = "Maréchal",
[1907] = "Garde-étendard",
[1140] = "Faux de Boéthia",
[1729] = "Conseiller",
[1910] = "Héros conquérant",
[1981] = "Fièvre de Peryite",
[2099] = "Découvreur des reliques perdues",
[1913] = "Grand champion",
[1960] = "Fléau de moelle-noire",
[2043] = "Indomptable",
[1916] = "Tacticien",
[1699] = "Faiseur de Jarl",
[1918] = "Parangon",
[1919] = "Livreur de reliques",
},
[1] =
{
[1921] = "L'Impitoyable",
[1538] = "Ombre d'Hist",
[1159] = "Adepte des terres mortes",
[1546] = "Faucheuse de sombreciel",
[1677] = "Magnanime",
[1808] = "Troubleuse de rouages",
[2193] = "Sauveuse du Couchant",
[2194] = "Émissaire",
[1410] = "Exécutrice",
[1689] = "Duelliste",
[1956] = "Protectrice du chaos",
[1304] = "Championne de l'Arène de Maelström",
[1305] = "L'insubmersible",
[1434] = "Fléau de la Côte d'or",
[1691] = "Fléau des hommes-bêtes",
[2076] = "Aide-soignante",
[2077] = "Aliéniste assistante",
[2049] = "Héroïne de la Cité mécanique",
[2079] = "Voix de la raison",
[1696] = "Briseuse de forge",
[2043] = "Indomptable",
[1954] = "Gardienne du chaos",
[1955] = "Championne du chaos",
[1444] = "Surineuse",
[51] = "Chasseuse de monstres",
[2210] = "Mystique",
[2087] = "Sauveuse sanctifiée",
[1960] = "Fléau de moelle-noire",
[2099] = "Découvreuse des reliques perdues",
[1981] = "Fièvre de Peryite",
[2230] = "maîtresse des styles",
[1836] = "La Dynamo",
[1965] = "Dovahkriid",
[1838] = "Tourmenteuse des Tic-tac",
[1901] = "Gardienne de reliques",
[1712] = "Bibliothécaire",
[1140] = "Faux de Boéthia",
[1330] = "La conquérante implacable",
[2227] = "Grande maîtresse artisane",
[1716] = "Dame du Désordre",
[2101] = "championne abyssale",
[1462] = "Suzeraine ophidienne",
[1907] = "Garde-étendard",
[1976] = "Gravisseuse",
[705] = "Grand maréchal",
[1474] = "Briseuse de Shéhaï",
[1723] = "Bouffon royal",
[1852] = "Championne de Vivec",
[61] = "Héroïne de l'Alliance",
[702] = "Maître mage",
[1727] = "Mère de clan",
[1728] = "Dame",
[1729] = "Conseillère",
[1730] = "Comtesse",
[1904] = "Porte-étendard",
[111] = "Général",
[110] = "Légat",
[109] = "Palatine Auguste",
[108] = "Palatine",
[1704] = "Thane d'Épervine",
[1898] = "Chasseuse de reliques",
[105] = "Brigadier",
[587] = "Sauveuse de Nirn",
[1868] = "Sauveuse de Morrowind",
[1383] = "Maîtresse voleuse",
[1895] = "Exsanguinatrice",
[706] = "Premier sergent",
[318] = "Tueuse de seigneur Daedra",
[100] = "Capitaine",
[106] = "Préfète",
[2131] = "Héroïne du Pas-des-Nuées",
[1248] = "Héroïne de Wrothgar",
[2133] = "Briseuse d'ombre",
[92] = "Volontaire",
[1879] = "Amie des clans",
[2136] = "Porteuse de lumière",
[992] = "Championne de l'arène de l'Étoile du dragon",
[1503] = "Tueuse de mages",
[2139] = "Cœur-de-griffon",
[2140] = "Libératrice des welkynars",
[93] = "Recrue",
[94] = "Première classe",
[95] = "Légionnaire",
[96] = "Vétéran",
[97] = "Caporal",
[98] = "Sergent",
[99] = "Lieutenant",
[1892] = "Chevalier stellaire",
[101] = "Major",
[102] = "Centurion",
[103] = "Colonel",
[104] = "Tribun",
[617] = "Héroïne du Pacte",
[618] = "Héroïne du Domaine",
[107] = "Prétorienne",
[1260] = "Faiseuse de rois",
[621] = "Ennemie de Havreglace",
[494] = "Maîtresse de pêche",
[1391] = "Destructrice des dro-m'Athra",
[112] = "Seigneur de guerre",
[113] = "Grand seigneur de guerre",
[114] = "Maréchal",
[627] = "Exploratrice",
[628] = "Héroïne de Tamriel",
[703] = "Championne de la guilde des guerriers",
[1910] = "Héroïne conquérante",
[1837] = "Désassembleuse générale",
[1810] = "Coadjutrice de Divayth Fyr",
[1913] = "Grande championne",
[1699] = "Faiseuse de Jarl",
[1915] = "Bouchère des champs de bataille",
[1916] = "Tacticien",
[2075] = "Rédemptrice immortelle",
[1918] = "Parangon",
[1919] = "Livreuse de reliques",
},
},
["de"] =
{
[2] =
{
[1921] = "Der Gnadenlose",
[1538] = "Histschatten",
[1159] = "Adept der Totenländer",
[1546] = "Schnitter der Abenddämmerung",
[1677] = "Der Großherzige",
[1808] = "Störfaktor im Uhrwerk",
[2193] = "Retter Sommersends",
[2194] = "Botschafter",
[1689] = "Duellant",
[1444] = "Schweigender",
[1904] = "Standartenträger",
[1304] = "Champion der Mahlstrom-Arena",
[1305] = "Sturmfester",
[1434] = "Fluch der Goldküste",
[2075] = "Unsterblicher Erlöser",
[2076] = "Ordnungstreuer",
[2077] = "Nervenarzthelfer",
[1704] = "Thane von Falkenring",
[2079] = "Stimme der Vernunft",
[1696] = "Schmiedebrecher",
[2043] = "Unerschrockener",
[1954] = "Chaoswächter",
[1955] = "Chaoschampion",
[1956] = "Chaosbewahrer",
[1699] = "Jarlmacher",
[2049] = "Held der Stadt der Uhrwerke",
[2087] = "Heiliger Erlöser",
[1960] = "Schwarzmarkfluch",
[1895] = "Aderlasser",
[1898] = "Reliktjäger",
[61] = "Held des Bündnisses",
[1836] = "Der Dynamo",
[1837] = "Demontagegeneral",
[1838] = "Der Tick-Tack-Peiniger",
[2227] = "Meisterhandwerker",
[1712] = "Bibliothekar",
[1140] = "Boethiahs Sense",
[1330] = "makelloser Eroberer",
[51] = "Monsterjäger",
[1716] = "Narrenprinz",
[2101] = "Kluftchampion",
[2230] = "Stilmeister",
[1907] = "Standartenwächter",
[1976] = "Gipfelstürmer",
[2099] = "Finder verlorener Relikte",
[1727] = "Klanvater",
[1723] = "Königlicher Narr",
[1852] = "Champion von Vivec",
[1981] = "Peryites Plage",
[702] = "Meister der Zauberei",
[703] = "Sieger der Kriegergilde",
[1728] = "Fürst",
[705] = "Großfeldherr",
[1474] = "Shehai-Zerschmetterer",
[1729] = "Ratsherr",
[111] = "General",
[110] = "Legat",
[1901] = "Reliktwächter",
[108] = "Palatin",
[706] = "Erster Feldwebel",
[106] = "Präfekt",
[105] = "Brigadier",
[587] = "Retter Nirns",
[1868] = "Retter Morrowinds",
[1730] = "Graf",
[103] = "Oberst",
[2210] = "Mystiker",
[318] = "Schlächter der Daedraherren",
[100] = "Hauptmann",
[109] = "Meisterpalatin",
[2131] = "Held von Wolkenruh",
[992] = "Champion der Drachenstern-Arena",
[2133] = "Schattenbrecher",
[92] = "Freiwilliger",
[1879] = "Klansfreund",
[2136] = "Lichtbringer",
[96] = "Veteran",
[95] = "Legionär",
[2139] = "Greifenherz",
[2140] = "Welkynarbefreier",
[93] = "Rekrut",
[94] = "Tyro",
[1503] = "Magierschlächter",
[1248] = "Held von Wrothgar",
[97] = "Unteroffizier",
[98] = "Feldwebel",
[99] = "Leutnant",
[1892] = "Sternengeformter Ritter",
[101] = "Major",
[102] = "Zenturio",
[1383] = "Meisterdieb",
[104] = "Tribun",
[617] = "Held des Paktes",
[618] = "Held des Dominions",
[107] = "Prätorianer",
[1260] = "Königsmacher",
[621] = "Feind Kalthafens",
[494] = "Meisterangler",
[1391] = "dro-m'Athra-Zerstörer",
[112] = "Kriegsfürst",
[113] = "Großkriegsfürst",
[114] = "Feldherr",
[627] = "Erkunder",
[628] = "Held Tamriels",
[1462] = "ophidischer Befehlshaber",
[1910] = "Held der Eroberung",
[1810] = "Divayth Fyrs Gehilfe",
[1965] = "Dovahkriid",
[1913] = "Großchampion",
[1691] = "Fluch der Tiermenschen",
[1915] = "Schlachtfeldschlächter",
[1916] = "Taktiker",
[1410] = "Henker",
[1918] = "Vorbild",
[1919] = "Reliktläufer",
},
[1] =
{
[1921] = "Die Gnadenlose",
[1538] = "Histschatten",
[1159] = "Adeptin der Totenländer",
[1546] = "Schnitter der Abenddämmerung",
[1677] = "Die Großherzige",
[1808] = "Störfaktor im Uhrwerk",
[2193] = "Retterin Sommersends",
[2194] = "Botschafterin",
[1410] = "Henkerin",
[1305] = "Sturmfeste",
[2075] = "Unsterbliche Erlöserin",
[1304] = "Champion der Mahlstrom-Arena",
[1689] = "Duellantin",
[1434] = "Fluch der Goldküste",
[1691] = "Fluch der Tiermenschen",
[2076] = "Ordnungstreue",
[2077] = "Nervenarzthelferin",
[1444] = "Schweigende",
[2079] = "Stimme der Vernunft",
[1696] = "Schmiedebrecherin",
[1915] = "Schlachtfeldschlächterin",
[1954] = "Chaoswächterin",
[1955] = "Chaoschampion",
[1956] = "Chaosbewahrerin",
[1699] = "Jarlmacherin",
[2099] = "Finderin verlorener Relikte",
[2087] = "Heilige Erlöserin",
[1960] = "Schwarzmarkfluch",
[1810] = "Divayth Fyrs Gehilfin",
[1837] = "Demontagegeneral",
[61] = "Heldin des Bündnisses",
[1836] = "Der Dynamo",
[1965] = "Dovahkriid",
[1838] = "Die Tick-Tack-Peinigerin",
[703] = "Siegerin der Kriegergilde",
[1712] = "Bibliothekarin",
[628] = "Heldin Tamriels",
[1330] = "makellose Eroberin",
[51] = "Monsterjägerin",
[1716] = "Narrenprinzessin",
[2101] = "Kluftchampion",
[2230] = "Stilmeisterin",
[627] = "Erkunderin",
[1976] = "Gipfelstürmerin",
[1730] = "Gräfin",
[109] = "Meisterpalatina",
[1723] = "Königliche Närrin",
[1852] = "Champion von Vivec",
[1981] = "Peryites Plage",
[702] = "Meisterin der Zauberei",
[1727] = "Klanmutter",
[1728] = "Fürstin",
[705] = "Großfeldherrin",
[1474] = "Shehai-Zerschmetterin",
[112] = "Kriegsfürstin",
[1391] = "dro-m'Athra-Zerstörerin",
[494] = "Meisteranglerin",
[621] = "Feindin Kalthafens",
[1260] = "Königsmacherin",
[1704] = "Thane von Falkenring",
[618] = "Heldin des Dominions",
[617] = "Heldin des Paktes",
[587] = "Retterin Nirns",
[1868] = "Retterin Morrowinds",
[1895] = "Aderlasserin",
[103] = "Oberst",
[706] = "Erster Feldwebel",
[318] = "Schlächterin der Daedraherren",
[1892] = "Sternengeformte Ritterin",
[106] = "Präfektin",
[2131] = "Heldin von Wolkenruh",
[992] = "Champion der Drachenstern-Arena",
[2133] = "Schattenbrecherin",
[2140] = "Welkynarbefreierin",
[1879] = "Klansfreundin",
[2136] = "Lichtbringerin",
[96] = "Veteranin",
[95] = "Legionärin",
[2139] = "Greifenherz",
[92] = "Freiwillige",
[93] = "Rekrutin",
[94] = "Tyro",
[1503] = "Magierschlächterin",
[1248] = "Heldin von Wrothgar",
[97] = "Unteroffizierin",
[98] = "Feldwebel",
[99] = "Leutnant",
[100] = "Hauptmann",
[101] = "Majorin",
[102] = "Zenturio",
[1383] = "Meisterdiebin",
[104] = "Tribunin",
[105] = "Brigadierin",
[1898] = "Reliktjägerin",
[107] = "Prätorianerin",
[108] = "Palatina",
[1901] = "Reliktwächterin",
[110] = "Legatin",
[111] = "Generalin",
[1904] = "Standartenträgerin",
[113] = "Großkriegsfürstin",
[114] = "Feldherrin",
[1907] = "Standartenwächterin",
[1140] = "Boethiahs Sense",
[1729] = "Ratsherrin",
[1910] = "Heldin der Eroberung",
[1462] = "ophidische Befehlshaberin",
[2227] = "Meisterhandwerkerin",
[1913] = "Großchampion",
[2210] = "Mystikerin",
[2043] = "Unerschrockene",
[1916] = "Taktiker",
[2049] = "Heldin der Stadt der Uhrwerke",
[1918] = "Vorbild",
[1919] = "Reliktläuferin",
},
},
["en"] =
{
[2] =
{
[1921] = "The Merciless",
[1538] = "Hist-Shadow",
[1159] = "Deadlands Adept",
[1546] = "Sun's Dusk Reaper",
[1677] = "Magnanimous",
[1808] = "Clockwork Confounder",
[2193] = "Savior of Summerset",
[2194] = "Emissary",
[1981] = "Plague of Peryite",
[1305] = "Stormproof",
[1260] = "Kingmaker",
[1304] = "Maelstrom Arena Champion",
[1689] = "Duelist",
[1434] = "Bane of the Gold Coast",
[2075] = "Immortal Redeemer",
[2076] = "Orderly",
[2077] = "Assistant Alienist",
[1248] = "Hero of Wrothgar",
[2079] = "Voice of Reason",
[1696] = "Forge Breaker",
[1391] = "Dro-m'Athra Destroyer",
[1954] = "Chaos Guardian",
[1955] = "Chaos Champion",
[1956] = "Chaos Keeper",
[1383] = "Master Thief",
[1444] = "Silencer",
[2087] = "Saintly Savior",
[1960] = "Blackmarrow's Bane",
[1410] = "Executioner",
[1704] = "Thane of Falkreath",
[1699] = "Jarl Maker",
[1836] = "The Dynamo",
[1837] = "Disassembly General",
[1838] = "Tick-Tock Tormentor",
[1691] = "Bane of Beastmen",
[1712] = "Librarian",
[2049] = "Hero of Clockwork City",
[1330] = "The Flawless Conqueror",
[51] = "Monster Hunter",
[1716] = "Lord of Misrule",
[2101] = "Abyssal Champion",
[2230] = "Style Master",
[1965] = "Dovahkriid",
[1976] = "Peak Scaler",
[1810] = "Divayth Fyr's Coadjutor",
[621] = "Enemy of Coldharbour",
[1723] = "Royal Jester",
[1852] = "Champion of Vivec",
[61] = "Covenant Hero",
[702] = "Master Wizard",
[703] = "Fighters Guild Victor",
[1728] = "Lord",
[705] = "Grand Overlord",
[1474] = "Shehai Shatterer",
[1892] = "Star-Made Knight",
[1462] = "Ophidian Overlord",
[627] = "Explorer",
[494] = "Master Angler",
[1503] = "Mageslayer",
[2140] = "Welkynar Liberator",
[2210] = "Mystic",
[2099] = "Finder of Lost Relics",
[587] = "Savior of Nirn",
[1868] = "Savior of Morrowind",
[1727] = "Clan Father",
[1729] = "Councilor",
[706] = "First Sergeant",
[1730] = "Count",
[617] = "Pact Hero",
[618] = "Dominion Hero",
[2131] = "Cloudrest Hero",
[628] = "Tamriel Hero",
[2133] = "Shadow Breaker",
[318] = "Daedric Lord Slayer",
[1879] = "Clanfriend",
[2136] = "Bringer of Light",
[109] = "August Palatine",
[992] = "Dragonstar Arena Champion",
[2139] = "Gryphon Heart",
[92] = "Volunteer",
[93] = "Recruit",
[94] = "Tyro",
[95] = "Legionary",
[96] = "Veteran",
[97] = "Corporal",
[98] = "Sergeant",
[99] = "Lieutenant",
[100] = "Captain",
[101] = "Major",
[102] = "Centurion",
[103] = "Colonel",
[104] = "Tribune",
[105] = "Brigadier",
[106] = "Prefect",
[107] = "Praetorian",
[108] = "Palatine",
[1901] = "Relic Guardian",
[110] = "Legate",
[111] = "General",
[112] = "Warlord",
[113] = "Grand Warlord",
[114] = "Overlord",
[1907] = "Standard-Guardian",
[1140] = "Boethiah's Scythe",
[2227] = "Grand Master Crafter",
[1910] = "Conquering Hero",
[1898] = "Relic Hunter",
[1895] = "Bloodletter",
[1913] = "Grand Champion",
[1915] = "Battleground Butcher",
[2043] = "Undaunted",
[1916] = "Tactician",
[1904] = "Standard-Bearer",
[1918] = "Paragon",
[1919] = "Relic Runner",
},
[1] =
{
[1921] = "The Merciless",
[1538] = "Hist-Shadow",
[1159] = "Deadlands Adept",
[1546] = "Sun's Dusk Reaper",
[1677] = "Magnanimous",
[1808] = "Clockwork Confounder",
[2193] = "Savior of Summerset",
[2194] = "Emissary",
[1410] = "Executioner",
[1689] = "Duelist",
[2049] = "Hero of Clockwork City",
[1304] = "Maelstrom Arena Champion",
[1305] = "Stormproof",
[1434] = "Bane of the Gold Coast",
[2075] = "Immortal Redeemer",
[2076] = "Orderly",
[2077] = "Assistant Alienist",
[1956] = "Chaos Keeper",
[2079] = "Voice of Reason",
[1696] = "Forge Breaker",
[2043] = "Undaunted",
[1954] = "Chaos Guardian",
[1955] = "Chaos Champion",
[1444] = "Silencer",
[2210] = "Mystic",
[1810] = "Divayth Fyr's Coadjutor",
[2087] = "Saintly Savior",
[1960] = "Blackmarrow's Bane",
[2227] = "Grand Master Crafter",
[1462] = "Ophidian Overlord",
[1981] = "Plague of Peryite",
[1836] = "The Dynamo",
[1837] = "Disassembly General",
[1838] = "Tick-Tock Tormentor",
[1729] = "Councilor",
[1712] = "Librarian",
[1140] = "Boethiah's Scythe",
[1330] = "The Flawless Conqueror",
[2099] = "Finder of Lost Relics",
[1716] = "Lady of Misrule",
[2101] = "Abyssal Champion",
[2230] = "Style Master",
[1907] = "Standard-Guardian",
[1976] = "Peak Scaler",
[1474] = "Shehai Shatterer",
[621] = "Enemy of Coldharbour",
[1723] = "Royal Jester",
[1852] = "Champion of Vivec",
[61] = "Covenant Hero",
[702] = "Master Wizard",
[703] = "Fighters Guild Victor",
[1728] = "Lady",
[705] = "Grand Overlord",
[1730] = "Countess",
[1904] = "Standard-Bearer",
[111] = "General",
[110] = "Legate",
[1901] = "Relic Guardian",
[108] = "Palatine",
[1704] = "Thane of Falkreath",
[1898] = "Relic Hunter",
[105] = "Brigadier",
[587] = "Savior of Nirn",
[1868] = "Savior of Morrowind",
[103] = "Colonel",
[1383] = "Master Thief",
[706] = "First Sergeant",
[318] = "Daedric Lord Slayer",
[100] = "Captain",
[106] = "Prefect",
[2131] = "Cloudrest Hero",
[96] = "Veteran",
[2133] = "Shadow Breaker",
[92] = "Volunteer",
[1879] = "Clanfriend",
[2136] = "Bringer of Light",
[1248] = "Hero of Wrothgar",
[1503] = "Mageslayer",
[2139] = "Gryphon Heart",
[2140] = "Welkynar Liberator",
[93] = "Recruit",
[94] = "Tyro",
[95] = "Legionary",
[992] = "Dragonstar Arena Champion",
[97] = "Corporal",
[98] = "Sergeant",
[99] = "Lieutenant",
[1892] = "Star-Made Knight",
[101] = "Major",
[102] = "Centurion",
[1895] = "Bloodletter",
[104] = "Tribune",
[617] = "Pact Hero",
[618] = "Dominion Hero",
[107] = "Praetorian",
[1260] = "Kingmaker",
[109] = "August Palatine",
[494] = "Master Angler",
[1391] = "Dro-m'Athra Destroyer",
[112] = "Warlord",
[113] = "Grand Warlord",
[114] = "Overlord",
[627] = "Explorer",
[628] = "Tamriel Hero",
[1727] = "Clan Mother",
[1910] = "Conquering Hero",
[51] = "Monster Hunter",
[1965] = "Dovahkriid",
[1913] = "Grand Champion",
[1699] = "Jarl Maker",
[1915] = "Battleground Butcher",
[1916] = "Tactician",
[1691] = "Bane of Beastmen",
[1918] = "Paragon",
[1919] = "Relic Runner",
},
},
}
local lang = GetCVar("Language.2")
local GetAchievementRewardTitle_original
local function Unload()
GetAchievementRewardTitle = GetAchievementRewardTitle_original
end
local function Load()
GetAchievementRewardTitle_original = GetAchievementRewardTitle
GetAchievementRewardTitle = function(achievementId, gender)
local hasTitle, title = GetAchievementRewardTitle_original(achievementId, gender)
if (hasTitle and gender) then
if (LocaleTitles[lang] and LocaleTitles[lang][gender] and LocaleTitles[lang][gender][achievementId]) then
title = LocaleTitles[lang][gender][achievementId]
end
end
return hasTitle, title
end
lib.Unload = Unload
end
if(lib.Unload) then lib.Unload() end
Load()
|
gcd = math.random(7) + 2
jimenilac = math.random(24) + 5
jbrojilac = math.random(jimenilac - 2) + 1
gcd2 = lib.math.gcd(jimenilac, jbrojilac)
jimen = jimenilac / gcd2
jbroj = jbrojilac / gcd2
if (gcd == gcd2) then
gcd = gcd - 1
end
imenilac = jimen * gcd
brojilac = jbroj * gcd
|
Config = {}
Config.DrawDistance = 100
Config.Size = { x = 1.5, y = 1.5, z = 1.5 }
Config.Color = { r = 0, g = 0, b = 0 }
Config.Type = 1
Config.Locale = 'fr'
Config.EnableLicense = true
Config.LicensePrice = 0
Config.Zones = {
GunShop = {
legal = 0,
Items = {},
Pos = {
{ x = 456.84475708008, y = -983.11218261719, z = 30.689594268799 },
}
},
BlackWeashop = {
legal = 1,
Items = {},
Pos = {
{ x = 1231.190, y = -3165.674, z = 5.833 },
{ x = -140.122, y = -970.859, z = 259.133 },
}
},
}
|
if (SERVER) then
AddCSLuaFile()
end
--AKMS
sound.Add({
name="Weapon_AK47.Single",
volume = 1.0,
pitch = {100,105},
sound = "weapons/AK47/AK47_fp.wav",
level = 145,
channel = CHAN_STATIC
})
sound.Add({
name="Weapon_AK47.SingleSilenced",
volume = 1.0,
pitch = {100,105},
sound = "weapons/AK47/AK47_suppressed_fp.wav",
level = 120,
channel = CHAN_STATIC
})
sound.Add({
name="Weapon_AK47.Magrelease",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_magrelease.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.MagHitrelease",
volume = 0.3,
sound = "weapons/AK47/handling/AK47_maghitrelease.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.Magin",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_magin.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.Magout",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_magout.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.Boltback",
volume = 0.3,
sound = "weapons/AK47/handling/AK47_boltback.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.Boltrelease",
volume = 0.3,
sound = "weapons/AK47/handling/AK47_boltrelease.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.Hit",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_hit.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.Rattle",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_rattle.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.MagoutRattle",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_magout_rattle.wav",
level = 65,
channel = CHAN_ITEM
})
sound.Add({
name="Weapon_AK47.ROF",
volume = 0.2,
sound = "weapons/AK47/handling/AK47_fireselect_1.wav",
level = 65,
channel = CHAN_ITEM
})
|
---@undocumented
---@vararg any
function ConscriptProgression_PenalSpeech (...) end
---@undocumented
---@vararg any
function ConscriptProgression_PenalUnlock (...) end
---@undocumented
---@vararg any
function CTRL_IndexOperator (...) end
---@undocumented
---@vararg any
function DebugEconomy (...) end
---@undocumented
---@vararg any
function DebugPrintGoals (...) end
---@undocumented
---@vararg any
function DeleteOldProduceStructures (...) end
---@undocumented
---@vararg any
function Demolition_IntroEvent (...) end
---@undocumented
---@vararg any
function Demolition_OutroEvent (...) end
---@undocumented
---@vararg any
function Demolition_ShowReward (...) end
---@undocumented
---@vararg any
function Demolition_Start (...) end
---@undocumented
---@vararg any
function DeploymentPoint_Destroyed (...) end
---@undocumented
---@vararg any
function DeploymentPoint_Placed (...) end
---@undocumented
---@vararg any
function DesignerLib_Init (...) end
---@undocumented
---@vararg any
function Destroy_Tank_Start (...) end
---@undocumented
---@vararg any
function DestroyTank_IntroEvent (...) end
---@undocumented
---@vararg any
function DestroyTank_OutroEvent (...) end
---@undocumented
---@vararg any
function DestroyTank_ShowReward (...) end
---@undocumented
---@vararg any
function DoesTableContain (...) end
---@undocumented
---@vararg any
function Encounter_KillHalf (...) end
---@undocumented
---@vararg any
function Entity_AddAbility (...) end
---@undocumented
---@vararg any
function Entity_BuildingReset (...) end
---@undocumented
---@vararg any
function Entity_ClearDemolitionCallbacks (...) end
---@undocumented
---@vararg any
function Entity_DoBurnDamage (...) end
---@undocumented
---@vararg any
function Entity_ExtensionEnabled (...) end
---@undocumented
---@vararg any
function Entity_ExtensionExecuting (...) end
---@undocumented
---@vararg any
function Entity_ExtensionName (...) end
---@undocumented
---@vararg any
function Entity_RemoveAbility (...) end
---@undocumented
---@vararg any
function Event_Add (...) end
---@undocumented
---@vararg any
function Event_GetEvent (...) end
---@undocumented
---@vararg any
function Event_IsAnyQueuedInternal (...) end
---@undocumented
---@vararg any
function Event_IsAnyRunningInternal (...) end
---@undocumented
---@vararg any
function EventCue_InternalHintPointManager (...) end
---@undocumented
---@vararg any
function EventCue_InternalManager (...) end
---@undocumented
---@vararg any
function EventCue_RepeaterManager (...) end
---@undocumented
---@vararg any
function EventRule_AddEntityEvent (...) end
---@undocumented
---@vararg any
function EventRule_AddEvent (...) end
---@undocumented
---@vararg any
function EventRule_AddPlayerEvent (...) end
---@undocumented
---@vararg any
function EventRule_AddSquadEvent (...) end
---@undocumented
---@vararg any
function EventRule_Exists (...) end
---@undocumented
---@vararg any
function EventRule_GetNextUniqueRuleID (...) end
---@undocumented
---@vararg any
function EventRule_Refresh (...) end
---@undocumented
---@vararg any
function EventRule_RemoveAll (...) end
---@undocumented
---@vararg any
function EventRule_RemoveEntityEvent (...) end
---@undocumented
---@vararg any
function EventRule_RemoveEvent (...) end
---@undocumented
---@vararg any
function EventRule_RemoveMe (...) end
---@undocumented
---@vararg any
function EventRule_RemovePlayerEvent (...) end
---@undocumented
---@vararg any
function EventRule_RemoveRuleIDEvent (...) end
---@undocumented
---@vararg any
function EventRule_RemoveSquadEvent (...) end
---@undocumented
---@vararg any
function Fatality_Execute (...) end
---@undocumented
---@vararg any
function Fatality_Play (...) end
---@undocumented
---@vararg any
function FixUpVPTickerData (...) end
---@undocumented
---@vararg any
function FixUpVPTickerLastPlayedData (...) end
---@undocumented
---@vararg any
function FOW_EnableTint (...) end
---@undocumented
---@vararg any
function FOW_IsTintEnabled (...) end
---@undocumented
---@vararg any
function FOW_Toggle (...) end
---@undocumented
---@vararg any
function Game_ColdTechDisabled (...) end
---@undocumented
---@vararg any
function Game_CurrentSystemTime (...) end
---@undocumented
---@vararg any
function Game_GetRenderFrameCount (...) end
---@undocumented
---@vararg any
function Game_SubTextFadeInternal (...) end
---@undocumented
---@vararg any
function HintMouseover_Manager (...) end
---@undocumented
---@vararg any
function HintPoint_RemoveInternal (...) end
---@undocumented
---@vararg any
function INIT_BonusCaptureIntel (...) end
---@undocumented
---@vararg any
function INIT_BonusDemolition (...) end
---@undocumented
---@vararg any
function INIT_BonusDestroyTank (...) end
---@undocumented
---@vararg any
function INIT_BonusRescueSquads (...) end
---@undocumented
---@vararg any
function INIT_BonusVIP (...) end
---@undocumented
---@vararg any
function Init_Framedump (...) end
---@undocumented
---@vararg any
function IsAllies (...) end
---@undocumented
---@vararg any
function IsAxis (...) end
---@undocumented
---@vararg any
function KillVIP_IntroEvent (...) end
---@undocumented
---@vararg any
function KillVIP_OutroEvent (...) end
---@undocumented
---@vararg any
function KillVIP_ShowReward (...) end
---@undocumented
---@vararg any
function KillVIP_Start (...) end
---@undocumented
---@vararg any
function Loc_FormatText1 (...) end
---@undocumented
---@vararg any
function Loc_FormatText2 (...) end
---@undocumented
---@vararg any
function Loc_FormatText3 (...) end
---@undocumented
---@vararg any
function Loc_FormatText4 (...) end
---@undocumented
---@vararg any
function ManualMovieCaptureEnd (...) end
---@undocumented
---@vararg any
function ManualMovieCaptureStart (...) end
---@undocumented
---@vararg any
function MapIcon_ClearFacing (...) end
---@undocumented
---@vararg any
function MapIcon_CreateEntity (...) end
---@undocumented
---@vararg any
function MapIcon_CreatePosition (...) end
---@undocumented
---@vararg any
function MapIcon_CreateSquad (...) end
---@undocumented
---@vararg any
function MapIcon_Destroy (...) end
---@undocumented
---@vararg any
function MapIcon_DestroyAll (...) end
---@undocumented
---@vararg any
function MapIcon_SetFacingEntity (...) end
---@undocumented
---@vararg any
function MapIcon_SetFacingPosition (...) end
---@undocumented
---@vararg any
function MapIcon_SetFacingSquad (...) end
---@undocumented
---@vararg any
function Marker_Create (...) end
---@undocumented
---@vararg any
function Marker_GetRandomPositionInternal (...) end
---@undocumented
---@vararg any
function Metrics_CheckPoint (...) end
---@undocumented
---@vararg any
function Metrics_Complete (...) end
---@undocumented
---@vararg any
function Metrics_RegisterCapturePoint (...) end
---@undocumented
---@vararg any
function Metrics_Start (...) end
---@undocumented
---@vararg any
function Misc_AddRestrictCommandsCircle (...) end
---@undocumented
---@vararg any
function Misc_AddRestrictCommandsOBB (...) end
---@undocumented
---@vararg any
function Misc_ClearControlGroup (...) end
---@undocumented
---@vararg any
function Misc_ClearSelection (...) end
---@undocumented
---@vararg any
function Misc_ClearSubselection (...) end
---@undocumented
---@vararg any
function Misc_DumpMemStats (...) end
---@undocumented
---@vararg any
function Misc_GetSpeechDebugEnabled (...) end
---@undocumented
---@vararg any
function Misc_ScreenFadeChange (...) end
---@undocumented
---@vararg any
function Misc_ScreenFadeRemove (...) end
---@undocumented
---@vararg any
function Misc_ScreenFadeStart (...) end
---@undocumented
---@vararg any
function Misc_SetAmbientFXVisibility (...) end
---@undocumented
---@vararg any
function Misc_SetSpeechDebugEnabled (...) end
---@undocumented
---@vararg any
function Misc_SuperScreenshot (...) end
---@undocumented
---@vararg any
function Misc_SyncCheckVariable (...) end
---@undocumented
---@vararg any
function Mission_CheatLose (...) end
---@undocumented
---@vararg any
function Mission_CheatWin (...) end
---@undocumented
---@vararg any
function Mission_GetNIS (...) end
---@undocumented
---@vararg any
function Mission_IsDebug (...) end
---@undocumented
---@vararg any
function Mission_SetDebug (...) end
---@undocumented
---@vararg any
function Mission_SetSecondaryObjectiveOverride (...) end
---@undocumented
---@vararg any
function Mission_StartSecondaryObjective (...) end
---@undocumented
---@vararg any
function Modifier_AddToEntityTable (...) end
---@undocumented
---@vararg any
function Modifier_AddToMiscTable (...) end
---@undocumented
---@vararg any
function Modifier_AddToSquadTable (...) end
---@undocumented
---@vararg any
function Modifier_Init (...) end
---@undocumented
---@vararg any
function Modifier_RemoveInternal (...) end
---@undocumented
---@vararg any
function Modify_SlotItemDropRate (...) end
---@undocumented
---@vararg any
function ModMisc_ApplyDeformation (...) end
---@undocumented
---@vararg any
function MP_BlizzardInterval (...) end
---@undocumented
---@vararg any
function MP_BlizzardTransition (...) end
---@undocumented
---@vararg any
function Obj_CreatePopup (...) end
---@undocumented
---@vararg any
function Obj_HideProgressEx (...) end
---@undocumented
---@vararg any
function Obj_HighlightEntity (...) end
---@undocumented
---@vararg any
function Obj_HighlightPosition (...) end
---@undocumented
---@vararg any
function Obj_HighlightSquad (...) end
---@undocumented
---@vararg any
function Obj_SetRadioShown (...) end
---@undocumented
---@vararg any
function Obj_ShowProgressEx (...) end
---@undocumented
---@vararg any
function OnGameRestore (...) end
---@undocumented
---@vararg any
function OnGameSetup (...) end
---@undocumented
---@vararg any
function OnInit (...) end
---@undocumented
---@vararg any
function OnInitID (...) end
---@undocumented
---@vararg any
function Order227_EndSpeech (...) end
---@undocumented
---@vararg any
function Order227_Start (...) end
---@undocumented
---@vararg any
function Order227_StartSpeech (...) end
---@undocumented
---@vararg any
function Order227_Update (...) end
---@undocumented
---@vararg any
function OutputEnumsToXML (...) end
---@undocumented
---@vararg any
function Player_GetFatalityAbility (...) end
---@undocumented
---@vararg any
function Player_GetMapEntryPosition (...) end
---@undocumented
---@vararg any
function Player_SetAbilityAvailabilityInternal (...) end
---@undocumented
---@vararg any
function Player_SetAllCommandAvailability (...) end
---@undocumented
---@vararg any
function Player_SetCommandAvailabilityInternal (...) end
---@undocumented
---@vararg any
function Player_SetConstructionMenuAvailabilityInternal (...) end
---@undocumented
---@vararg any
function Player_SetEntityProductionAvailabilityInternal (...) end
---@undocumented
---@vararg any
function Player_SetSquadProductionAvailabilityInternal (...) end
---@undocumented
---@vararg any
function Player_SetUpgradeAvailabilityInternal (...) end
---@undocumented
---@vararg any
function PlayerCanSeeVIP (...) end
---@undocumented
---@vararg any
function PlayerColour_Disable (...) end
---@undocumented
---@vararg any
function PlayerColour_Enable (...) end
---@undocumented
---@vararg any
function Prefab_ApplyDefaults (...) end
---@undocumented
---@vararg any
function Prefab_ApplySchemaToDataTable (...) end
---@undocumented
---@vararg any
function Prefab_DoAction (...) end
---@undocumented
---@vararg any
function Prefab_GenerateUniqueInstanceName (...) end
---@undocumented
---@vararg any
function Prefab_GetInstance (...) end
---@undocumented
---@vararg any
function Prefab_Init (...) end
---@undocumented
---@vararg any
function Prefab_InitAll (...) end
---@undocumented
---@vararg any
function Prefab_Load (...) end
---@undocumented
---@vararg any
function Prefab_ReloadAll (...) end
---@undocumented
---@vararg any
function Prefab_ReplaceDataWithProperType (...) end
---@undocumented
---@vararg any
function Prefab_Reset (...) end
---@undocumented
---@vararg any
function Prefab_ResetFromWorldBuilder (...) end
---@undocumented
---@vararg any
function Prefab_Stop (...) end
---@undocumented
---@vararg any
function PrefabHelper_StandardTriggerSystem (...) end
---@undocumented
---@vararg any
function PrefabHelper_StandardTriggerSystem_Trigger (...) end
---@undocumented
---@vararg any
function PreInit (...) end
---@undocumented
---@vararg any
function PrintObject (...) end
---@undocumented
---@vararg any
function PrintOnScreen_GetString (...) end
---@undocumented
---@vararg any
function Produce120mmMortar (...) end
---@undocumented
---@vararg any
function Produce80mmMortar (...) end
---@undocumented
---@vararg any
function ProduceCombatEngineer (...) end
---@undocumented
---@vararg any
function ProduceCommandSquad (...) end
---@undocumented
---@vararg any
function ProduceFieldATGun (...) end
---@undocumented
---@vararg any
function ProduceHMG (...) end
---@undocumented
---@vararg any
function ProduceIS2 (...) end
---@undocumented
---@vararg any
function ProduceISU122 (...) end
---@undocumented
---@vararg any
function ProduceMotorcycle (...) end
---@undocumented
---@vararg any
function ProduceRocketTruck (...) end
---@undocumented
---@vararg any
function ProduceRussianArmouredCar (...) end
---@undocumented
---@vararg any
function ProduceSniper (...) end
---@undocumented
---@vararg any
function ProduceStructure (...) end
---@undocumented
---@vararg any
function ProduceSU85 (...) end
---@undocumented
---@vararg any
function ProduceT34 (...) end
---@undocumented
---@vararg any
function ProduceT70m (...) end
---@undocumented
---@vararg any
function ProduceVeteranInfantry (...) end
---@undocumented
---@vararg any
function RainSplashes_ReLoadConfig (...) end
---@undocumented
---@vararg any
function RegisterObjectiveUpdate (...) end
---@undocumented
---@vararg any
function RemoveTargettingArtilleryHint (...) end
---@undocumented
---@vararg any
function Request_Construction (...) end
---@undocumented
---@vararg any
function Request_ConstructionWithSquad (...) end
---@undocumented
---@vararg any
function Request_FinishIncompleteStructure (...) end
---@undocumented
---@vararg any
function Request_PlayerAbility (...) end
---@undocumented
---@vararg any
function Request_PlayerAbilitySingleTarget (...) end
---@undocumented
---@vararg any
function Request_Production (...) end
---@undocumented
---@vararg any
function RescueSquads_IntroEvent (...) end
---@undocumented
---@vararg any
function RescueSquads_OutroEvent (...) end
---@undocumented
---@vararg any
function RescueSquads_ShowReward (...) end
---@undocumented
---@vararg any
function RescueSquads_Start (...) end
---@undocumented
---@vararg any
function ResourceCheat (...) end
---@undocumented
---@vararg any
function Rule_SquadMarkerProxDeleter (...) end
---@undocumented
---@vararg any
function Scar_PlayNISEx (...) end
---@undocumented
---@vararg any
function Scar_ReloadScripts (...) end
---@undocumented
---@vararg any
function Scar_SetSimRate (...) end
---@undocumented
---@vararg any
function SetGlobals (...) end
---@undocumented
---@vararg any
function SetHeatRateForAllPlayers (...) end
---@undocumented
---@vararg any
function Setup_GetWinConditionOption (...) end
---@undocumented
---@vararg any
function Setup_SetPlayerStartingPosition (...) end
---@undocumented
---@vararg any
function SetVisionRadiusForAllPlayers (...) end
---@undocumented
---@vararg any
function ShootTheSky_Manager (...) end
---@undocumented
---@vararg any
function SimpleDefendEncounter_GetEncounterID (...) end
---@undocumented
---@vararg any
function Sound_SetMusicCombatFactor (...) end
---@undocumented
---@vararg any
function Sound_SetMusicCombatMaxDistance (...) end
---@undocumented
---@vararg any
function Sound_SetMusicCombatMinDistance (...) end
---@undocumented
---@vararg any
function Sound_SetMusicFilterFactor (...) end
---@undocumented
---@vararg any
function Sound_SetMusicFoWFilterFactor (...) end
---@undocumented
---@vararg any
function Sound_ToggleMusicDebug (...) end
---@undocumented
---@vararg any
function Sound_ToggleRainSurfaceDebug (...) end
---@undocumented
---@vararg any
function Squad_ExtensionEnabled (...) end
---@undocumented
---@vararg any
function Squad_ExtensionName (...) end
---@undocumented
---@vararg any
function Squad_HasAbility (...) end
---@undocumented
---@vararg any
function Squad_HasBuilding (...) end
---@undocumented
---@vararg any
function Squad_HasWeaponHardpoint (...) end
---@undocumented
---@vararg any
function Squad_IsPopCapPreventingInstantReinforce (...) end
---@undocumented
---@vararg any
function StartNIS (...) end
---@undocumented
---@vararg any
function Stats_BalancePrint (...) end
---@undocumented
---@vararg any
function Stats_BeginBalanceStatsDump (...) end
---@undocumented
---@vararg any
function Stats_DumpFramesToDisk (...) end
---@undocumented
---@vararg any
function Stats_EndBalanceStatsDump (...) end
---@undocumented
---@vararg any
function Stats_GetScenarioName (...) end
---@undocumented
---@vararg any
function Stats_ReportGameStats (...) end
---@undocumented
---@vararg any
function StopBlizAudio (...) end
---@undocumented
---@vararg any
function TableCount (...) end
---@undocumented
---@vararg any
function Team_ForEachAllOrAny_LEGACY (...) end
---@undocumented
---@vararg any
function Team_GetPlayers (...) end
---@undocumented
---@vararg any
function ThreatGroup_AddEntity (...) end
---@undocumented
---@vararg any
function ThreatGroup_AddPosition (...) end
---@undocumented
---@vararg any
function ThreatGroup_AddSquad (...) end
---@undocumented
---@vararg any
function ThreatGroup_Create (...) end
---@undocumented
---@vararg any
function ThreatGroup_Destroy (...) end
---@undocumented
---@vararg any
function ThreatGroup_DestroyAll (...) end
---@undocumented
---@vararg any
function ThreatGroup_RemoveEntity (...) end
---@undocumented
---@vararg any
function ThreatGroup_RemovePosition (...) end
---@undocumented
---@vararg any
function ThreatGroup_RemoveSquad (...) end
---@undocumented
---@vararg any
function Timer_Init (...) end
---@undocumented
---@vararg any
function Timer_Validate (...) end
---@undocumented
---@vararg any
function TimeRule_Refresh (...) end
---@undocumented
---@vararg any
function UI_ClearCompany (...) end
|
--[[--
translated_string = -- translated string
_(
string_to_translate, -- string to translate
{
placeholder_name1 = text1, -- replace all occurrences of "#{placeholder_name1}" with the string text1
placeholder_name2 = text2, -- replace all occurrences of "#{placeholder_name2}" with the string text2
...
}
)
Translation function for localization. The "_" function translates a given string to the currently selected language (see locale.set{...}). If the translated string contains placeholders in the form #{name}, then those placeholders may be automatically replaced with a corresponding substring which is taken from the table passed as optional second argument.
Hint: Lua's syntax rules allow to write _"text" as a shortcut for _("text"), or _'text' instead of _('text') respectivly.
--]]--
function _G._(text, replacements)
local text = locale._get_translation_table()[text] or text
if replacements then
return (
string.gsub(
text,
"#{(.-)}",
function (placeholder)
return replacements[placeholder]
end
)
)
else
return text
end
end
--//--
--[[--
cloned_table = -- newly generated table
table.new(
table_or_nil -- keys of a given table will be copied to the new table
)
If a table is given, then a cloned table is returned.
If nil is given, then a new empty table is returned.
--]]--
function table.new(tbl)
local new_tbl = {}
if tbl then
for key, value in pairs(tbl) do
new_tbl[key] = value
end
end
return new_tbl
end
--//--
-- load libraries
-- (except "extos", which has to be loaded earlier, and "multirand", which must be loaded after forking)
_G.nihil = require 'nihil'
_G.mondelefant = require 'mondelefant'
_G.atom = require 'atom'
_G.json = require 'json'
require 'mondelefant_atom_connector'
-- NOTE: "multirand" library is loaded in mcp.lua after forking
-- setup mondelefant
mondelefant.connection_prototype.error_objects = true
function mondelefant.connection_prototype:sql_tracer(command)
if trace.is_disabled() then
return
end
local start_time = extos.monotonic_hires_time()
return function(error_info)
trace.sql{
command = command,
execution_time = extos.monotonic_hires_time() - start_time,
error_position = error_info and error_info.position or nil
}
end
end
--[[--
config -- table to store application configuration
'config' is a global table, which can be modified by a config file of an application to modify the behaviour of that application.
--]]--
_G.config = {}
--//--
|
local DB = require('../handler/economy.lua')
local MAX_COLUMNS = 10
command.Register("leaderboard", "leaderboard", "economy", function(msg,args)
local stmt = DB.db:prepare[[
SELECT id, tag, stars FROM users ORDER BY stars DESC
]]
local list = ''
for i=0,MAX_COLUMNS do
local step = stmt:step()
if step then
local id, tag, stars = unpack(step)
list = list .. '**' .. (i + 1) .. ')** ' .. tag .. ': **' .. DB.LongString(stars) .. '** :star:\n'
end
end
stmt:close();
msg:reply{
embed = {
title = ' Global Leaderboard',
description = list:sub(0, 512),
color = EMBEDCOLOR,
timestamp = DISCORDIA.Date():toISO('T', 'Z')
},
}
end) |
-- guide_picture
local Config = {}
local picture = LoadDatabaseWithKey("guide_picture","id") or {};
function Config.getConfig(id)
if picture then
if id then
return picture[id]
else
return picture
end
else
ERROR_LOG("说明表为空")
end
end
return Config;
-- {
-- GetConfig=getConfig,
-- GetConfigList=getConfigList,
-- } |
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetNWInt("overlaymode", 1)
self:SetNWInt("OOO", 0)
self.range = 512
self:SetNWInt("range", 512)
self.Active = 0
self.connected = {}
self.connected.ent = nil
self.connected.node = nil
if WireAddon ~= nil then
self.WireDebugName = self.PrintName
self.Inputs = Wire_CreateInputs(self, {"Open"})
self.Outputs = Wire_CreateOutputs(self, {"Open"})
else
self.Inputs = {
{
Name = "Open"
}
}
end
end
function ENT:SetRDEntity(ent)
if self.connected.ent and self.Active == 1 then
self:TurnOff()
end
self.connected.ent = ent
if ent then
self:SetNWInt("entid", ent:EntIndex())
else
self:SetNWInt("entid", 0)
end
end
function ENT:GetRDEntity()
return self.connected.ent
end
function ENT:GetNode()
return self.connected.node
end
function ENT:SetNode(node)
self.connected.node = node
if self.connected.ent and self.Active == 1 then
self:TurnOff()
end
if node then
self:SetNWInt("netid", node.netid)
else
self:SetNWInt("netid", 0)
end
end
function ENT:TurnOn()
if self.Active == 1 or not self.connected.ent or not self.connected.node then
return
end
local rd = CAF.GetAddon("Resource Distribution")
rd.Unlink(self.connected.ent)
rd.Link(self.connected.ent, self.connected.node.netid)
self.Active = 1
self:SetOOO(1)
if WireAddon ~= nil then
Wire_TriggerOutput(self, "Open", self.Active)
end
end
function ENT:TurnOff()
if self.Active == 0 or not self.connected.ent and not self.connected.node then
return
end
CAF.GetAddon("Resource Distribution").Unlink(self.connected.ent)
self.Active = 0
self:SetOOO(0)
if WireAddon ~= nil then
Wire_TriggerOutput(self, "Open", self.Active)
end
end
function ENT:TriggerInput(iname, value)
if iname == "Open" then
if value == 0 then
self:TurnOff()
elseif value == 1 then
self:TurnOn()
end
end
end
--use this to set self.active
--put a self:TurnOn and self:TurnOff() in your ent
--give value as nil to toggle
--override to do overdrive
--AcceptInput (use action) calls this function with value = nil
function ENT:SetActive(value, caller)
if ((not (value == nil) and value ~= 0) or (value == nil)) and self.Active == 0 then
if self.TurnOn then
self:TurnOn(nil, caller)
end
elseif ((not (value == nil) and value == 0) or (value == nil)) and self.Active == 1 then
if self.TurnOff then
self:TurnOff(nil, caller)
end
end
end
function ENT:SetOOO(value)
self:SetNWInt("OOO", value)
end
function ENT:Repair()
self:SetHealth(self:GetMaxHealth())
end
function ENT:AcceptInput(name, activator, caller)
if name == "Use" and caller:IsPlayer() and caller:KeyDownLast(IN_USE) == false then
self:SetActive(nil, caller)
end
end
--should make the damage go to the shield if the shield is installed(CDS)
function ENT:OnTakeDamage(DmgInfo)
if self.Shield then
self.Shield:ShieldDamage(DmgInfo:GetDamage())
CDS_ShieldImpact(self:GetPos())
return
end
if CAF and CAF.GetAddon("Life Support") then
CAF.GetAddon("Life Support").DamageLS(self, DmgInfo:GetDamage())
end
end
function ENT:Think()
-- Check if all ents are still valid!
if self.connected.ent and not IsValid(self.connected.ent) then
self.connected.ent = nil
self:SetNWInt("entid", 0)
end
if self.connected.node and not IsValid(self.connected.node) then
self:TurnOff()
self.connected.node = nil
self:SetNWInt("netid", 0)
end
-- Check if they are still in range!
if self.connected.ent and self.connected.ent:GetPos():Distance(self:GetPos()) > self.range then
self:TurnOff()
self.connected.ent = nil
self:SetNWInt("entid", 0)
end
if self.connected.node and self:GetPos():Distance(self.connected.node:GetPos()) > self.connected.node.range then
self:TurnOff()
self.connected.node = nil
self:SetNWInt("netid", 0)
end
self:NextThink(CurTime() + 1)
return true
end
function ENT:OnRemove()
self:TurnOff()
if WireAddon ~= nil then
Wire_Remove(self)
end
end
function ENT:OnRestore()
if WireAddon ~= nil then
Wire_Restored(self)
end
end
function ENT:PreEntityCopy()
local RD = CAF.GetAddon("Resource Distribution")
RD.BuildDupeInfo(self)
if WireAddon ~= nil then
local DupeInfo = WireLib.BuildDupeInfo(self)
if DupeInfo then
duplicator.StoreEntityModifier(self, "WireDupeInfo", DupeInfo)
end
end
end
function ENT:PostEntityPaste(Player, Ent, CreatedEntities)
local RD = CAF.GetAddon("Resource Distribution")
RD.ApplyDupeInfo(Ent, CreatedEntities)
if WireAddon ~= nil and Ent.EntityMods and Ent.EntityMods.WireDupeInfo then
WireLib.ApplyDupeInfo(Player, Ent, Ent.EntityMods.WireDupeInfo, function(id) return CreatedEntities[id] end)
end
end |
------------------------------------------------
----[ PURCHASE ]----------------------------------
------------------------------------------------
local Purchase = SS.Commands:New("Purchase")
// Purchase command
function Purchase.Command(Player, Args)
local Panel = SS.Panel:New(Player, "Purchase Categories")
local Cat = SS.Purchase.Categories()
for K, V in pairs(Cat) do
Panel:Button(K, 'ss_showcategory "'..K..'"')
end
Panel:Send()
end
// Category
function Purchase.Category(Player, Command, Args)
if not (Args) or not (Args[1]) then SS.PlayerMessage(Player, "You must enter the name of the category!", 1) return end
local Index = Args[1]
if not SS.Purchase.Categories()[Index] then
SS.PlayerMessage(Player, "The purchase category '"..Index.."' doesn't exist!", 1)
else
local Panel = SS.Panel:New(Player, "Purchase ("..Index..")")
local Added = false
local Sort = SS.Purchase.Categories()[Index]
table.sort(Sort, function(A, B) return (A[1] > B[1]) end)
for K, V in pairs(Sort) do
if not (SS.Purchase.Has(Player, V[2])) and (V[4](Player, V[2])) then
Panel:Words(V[3])
Panel:Button(K.." ("..V[1].." "..SS.Config.Request("Points")..")", 'ss_purchase "'..V[2]..'"')
Added = true
end
end
if not (Added) then
Panel:Words("You have purchased everything in this category!")
end
Panel:Send()
end
end
concommand.Add("ss_showcategory", Purchase.Category)
// Create it
Purchase:Create(Purchase.Command, {"basic"}, "View the purchases menu")
// Advert
SS.Adverts.Add("Type "..SS.Commands.Prefix().."purchase to access the purchases menu!") |
vim.keymap.set('n', '<F5>', '<Cmd>update|mkview|edit|TSBufEnable highlight<Cr>')
|
require "poop"
assert(make_poop() == "poop")
|
structures_of_xunra_unholy_discharge = class({})
function structures_of_xunra_unholy_discharge:OnSpellStart()
--- Get Caster, Victim, Player, Point ---
local caster = self:GetCaster()
local caster_loc = caster:GetAbsOrigin()
local playerID = caster:GetPlayerOwnerID()
local player = PlayerResource:GetPlayer(playerID)
local team = caster:GetTeamNumber()
--- Get Special Values ---
local AoERadius = self:GetSpecialValueFor("AoERadius")
local damage = self:GetSpecialValueFor("damage")
local delay_min = self:GetSpecialValueFor("delay_min")
local delay_max = self:GetSpecialValueFor("delay_max")
local count = self:GetSpecialValueFor("count")
local alive = 1
for _,unit in pairs(caster:FindAbilityByName("structures_of_xunra_linked_obelisks").units) do
if unit ~= nil then
if not unit:IsNull() then
if unit:IsAlive() then
alive = alive + 1
end
end
end
end
count = count / alive
for i=1,count do
local location = GetRandomPointWithinArena()
local delay = RandomFloat( delay_min, delay_max )
EncounterGroundAOEWarningSticky(location, AoERadius, delay+0.1)
local timer = Timers:CreateTimer(delay, function()
StartSoundEventFromPositionReliable("Hero_Pugna.NetherWard", location)
local particle = ParticleManager:CreateParticle("particles/econ/items/pugna/pugna_ward_ti5/pugna_ward_attack_medium_ti_5.vpcf", PATTACH_CUSTOMORIGIN, nil)
ParticleManager:SetParticleControl( particle, 0, caster:GetAbsOrigin() + Vector(0,0,400) )
ParticleManager:SetParticleControl( particle, 1, location )
ParticleManager:ReleaseParticleIndex( particle )
particle = nil
-- DOTA_UNIT_TARGET_TEAM_FRIENDLY; DOTA_UNIT_TARGET_TEAM_ENEMY; DOTA_UNIT_TARGET_TEAM_BOTH
local units = FindUnitsInRadius(team, location, nil, AoERadius, DOTA_UNIT_TARGET_TEAM_ENEMY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)
for _,victim in pairs(units) do
-- Apply Damage --
EncounterApplyDamage(victim, caster, self, damage, DAMAGE_TYPE_MAGICAL, DOTA_DAMAGE_FLAG_NONE)
end
end)
PersistentTimer_Add(timer)
end
end
function structures_of_xunra_unholy_discharge:OnAbilityPhaseStart()
local caster = self:GetCaster()
local playerID = caster:GetPlayerOwnerID()
local player = PlayerResource:GetPlayer(playerID)
return true
end
function structures_of_xunra_unholy_discharge:GetManaCost(abilitylevel)
return self.BaseClass.GetManaCost(self, abilitylevel)
end
function structures_of_xunra_unholy_discharge:GetCooldown(abilitylevel)
return self.BaseClass.GetCooldown(self, abilitylevel)
end |
-----------------------------------------------------
ITEM.name = "Chateau L'Hermitage 1884"
ITEM.desc = "Bottle of Chateau L'Hermitage Red Wine, 1884."
ITEM.category = "Alcohols"
ITEM.model = "models/foodnhouseholditems/wine_red3.mdl"
ITEM.hunger = 20
ITEM.thirst = 50
ITEM.empty = false
ITEM.permit = "consumables"
ITEM.price = 100
ITEM.uniqueID = "expensive red wine" |
local util = require 'lspconfig.util'
return {
default_config = {
cmd = { 'python3', '-m', 'esbonio' },
filetypes = { 'rst' },
root_dir = util.find_git_ancestor,
},
docs = {
description = [[
https://github.com/swyddfa/esbonio
Esbonio is a language server for [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects.
The language server can be installed via pip
```
pip install esbonio
```
Since Sphinx is highly extensible you will get best results if you install the language server in the same
Python environment as the one used to build your documentation. To ensure that the correct Python environment
is picked up, you can either launch `nvim` with the correct environment activated.
```
source env/bin/activate
nvim
```
Or you can modify the default `cmd` to include the full path to the Python interpreter.
```lua
require'lspconfig'.esbonio.setup {
cmd = { '/path/to/virtualenv/bin/python', '-m', 'esbonio' }
}
```
Esbonio supports a number of config values passed as `init_options` on startup, for example.
```lua
require'lspconfig'.esbonio.setup {
init_options = {
server = {
logLevel = "debug"
},
sphinx = {
confDir = "/path/to/docs",
srcDir = "${confDir}/../docs-src"
}
}
```
A full list and explanation of the available options can be found [here](https://swyddfa.github.io/esbonio/docs/lsp/editors/index.html)
]],
},
}
|
ChaosMonkey = {}
function ChaosMonkey.new(rand_stack)
local self = {}
self.destinations = {}
self.pipeline = {}
self.rand_stack = rand_stack or {}
self.rand_index = 1
self.write_stats = {}
self.read_stats = {}
function self:random()
if self.rand_index > #self.rand_stack then
table.insert(self.rand_stack, rando())
end
local rand = self.rand_stack[self.rand_index]
self.rand_index = self.rand_index + 1
return rand
end
function self:random_element(arr)
return arr[math.floor(#arr * self:random() + 1)]
end
function self:delete_dest(k)
local indices = {}
for i, v in pairs(self.destinations) do
if v == k then
table.insert(indices, i)
end
end
for i, target in pairs(indices) do
table.remove(self.destinations, target)
self.write_stats[target] = nil
end
end
function self:new_dest()
return self:dest("ChaosMonkey:random:" .. self:random())
end
function self:add_rend(dest, shader, param_names)
local inputs = {}
for i, param_name in ipairs(param_names) do
inputs[param_name] = self:src()
end
table.insert(self.pipeline, {dest=dest, shader=shader, inputs=inputs})
return dest
end
function self:add_copy_into(dest, src)
table.insert(self.pipeline, {dest=dest, shader="shaders/pass.glsl", inputs={img0=src}})
end
function self:rend(dest, shader, param_names)
self:add_rend(dest, shader, param_names)
rend(dest, shader, self.pipeline[#self.pipeline].inputs)
end
function self:dest(k)
if k == nil then
k = self:random_element(self.destinations)
end
if self.write_stats[k] == nil then
self.write_stats[k] = 0
table.insert(self.destinations, k)
end
self.write_stats[k] = self.write_stats[k] + 1
return k
end
function self:src()
local k = self:random_element(self.destinations)
if self.read_stats[k] == nil then
self.read_stats[k] = 0
end
self.read_stats[k] = self.read_stats[k] + 1
return k
end
function self:start()
-- print("==READ STATS==")
-- for k, v in pairs(self.read_stats) do
-- print(k .. " " .. v)
-- end
self.pipeline = {}
self.rand_index = 1
self.write_stats = {}
self.read_stats = {}
self.destinations = {}
end
function self:reseed()
self.rand_stack = {}
self.rand_index = 1
end
function self:fingerprint()
local total = 0
for i, x in ipairs(self.rand_stack) do
total = total + x
end
return total
end
return self
end
|
-- 每个area是一个赛场,本服务是赛场管理器
local skynet = require "skynet"
require "skynet.manager"
local game_mgr = require "game_mgr"
local CMD = {}
function CMD.start()
game_mgr:init()
end
function CMD.get_game(game_id)
return game_mgr:get_game(game_id)
end
local function dispatch(_, session, cmd, ...)
local f = CMD[cmd]
assert(f, "game_mgr接收到非法lua消息: ".. tostring(cmd))
if session == 0 then
f(...)
else
skynet.ret(skynet.pack(f(...)))
end
end
skynet.start(function ()
skynet.dispatch("lua", dispatch)
skynet.register("game_mgr")
skynet.error("game_mgr booted...")
end)
|
local wibox = require 'wibox'
local beautiful = require 'beautiful'
local awful = require 'awful'
local launcher = wibox.widget {
widget = wibox.widget.imagebox,
image = beautiful.awesome_icon,
buttons = {
awful.button({}, 1, function()
awful.spawn(require('config.apps').launcher)
end)
},
}
return launcher
|
/*
Perma SWEP system by Hackcraft STEAM_0:1:50714411
PermSweps = {
ply = {swep1, swep2},
Group = {
superadmin = {swep1, swep2}
}
EDS = {
5 = {swep1, swep2}
}
}
*/
// Players
util.AddNetworkString("PermSweps_GetInventoryFromServer")
util.AddNetworkString("PermSweps_SendInventoryToClient")
util.AddNetworkString("PermSweps_SendInventoryToServer")
// Groups
util.AddNetworkString("PermSweps_GetGroupInventoryFromServer")
util.AddNetworkString("PermSweps_SendGroupInventoryToClient")
util.AddNetworkString("PermSweps_SendGroupInventoryToServer")
// EDS
util.AddNetworkString("PermSweps_GetEDSInventoryFromServer")
util.AddNetworkString("PermSweps_SendEDSInventoryToClient")
util.AddNetworkString("PermSweps_SendEDSInventoryToServer")
CreateConVar( "perm_sweps_forceswepcheck", 1, {FCVAR_ARCHIVE, FCVAR_NOTIFY}, "If SWEPs aren't being added then set this to 0" )
local forceswepcheck = GetConVar("perm_sweps_forceswepcheck"):GetInt()
cvars.AddChangeCallback( "perm_sweps_forceswepcheck", function(convar, oldValue, newValue)
forceswepcheck = tonumber(newValue)
end, "perm_sweps" )
local PermSweps = PermSweps or {}
local OtherSweps = PermSWEPsCFG.HiddenSWEPs or {}
local swepsList = false
local EDSSWEPcache = {}
local function getweaponsList()
if !swepsList then
swepsList = table.Add(weapons.GetList(), OtherSweps)
end
return swepsList
end
// table add
local function differentTableAdd(t1, t2)
for k, v in ipairs(t2) do
if !table.HasValue(t1, v) then
table.insert(t1, v)
end
end
return t1
end
// Rebuild EDS weapon cache
local function ReBuildEDSSWEPcache()
local new = {}
local builder = {}
for i=1, 100 do
builder = differentTableAdd(builder, PermSweps.EDS[i] or {})
new[i] = builder
end
EDSSWEPcache = new
// PrintTable(EDSSWEPcache)
end
// Load sweps
local function LoadPermSwep(ply)
local sweps = ply:GetPData("PermSweps", false)
if sweps then
PermSweps[ply] = util.JSONToTable(sweps)
end
end
// Auto refresh
for k, v in ipairs(player.GetHumans()) do
LoadPermSwep(v)
end
// Load group sweps
local function LoadGroupSWEPS()
PermSweps.Group = {}
local saved = file.Read("perm_sweps_groups.txt", "DATA")
if saved then
PermSweps.Group = util.JSONToTable(saved) or {}
end
end
LoadGroupSWEPS()
// Save groups sweps
local function SaveGroupSWEPS(s)
file.Write("perm_sweps_groups.txt", util.TableToJSON(s))
end
// Load eds sweps
local function LoadEDSSWEPS()
PermSweps.EDS = {}
local saved = file.Read("perm_sweps_eds.txt", "DATA")
if saved then
PermSweps.EDS = util.JSONToTable(saved) or {}
end
end
LoadEDSSWEPS()
// Save eds sweps
local function SaveEDSSWEPS(s)
file.Write("perm_sweps_eds.txt", util.TableToJSON(s))
ReBuildEDSSWEPcache()
end
// Player connect
hook.Add("PlayerInitialSpawn", "PermSwepLoad", function(ply)
LoadPermSwep(ply)
end)
// Player disconnect
hook.Add("PlayerDisconnected", "PermSwepUnLoad", function(ply)
PermSweps[ply] = nil
end)
// Chat command
hook.Add( "PlayerSay", "PermSwepMenu", function( ply, text, public )
if string.lower( text ) == "!pss" then
ply:ConCommand("perm_swep_menu")
return ""
end
end )
// Loadout
hook.Add("PlayerLoadout", "GivePermSweps", function(ply)
if PermSweps[ply] then
for k, v in ipairs(PermSweps[ply]) do
ply:Give(v)
end
end
if PermSweps.Group[ply:GetUserGroup()] then
local sweps = PermSweps.Group[ply:GetUserGroup()]
for k, v in ipairs(sweps) do
ply:Give(v)
end
end
if EDSCFG and EDSCFG.Players[ply] != nil then
local sweps = EDSSWEPcache[EDSCFG.RankPower[EDSCFG.Players[ply]]] or {}
for k, v in ipairs(sweps) do
ply:Give(v)
end
end
end)
// Dropping
hook.Add("canDropWeapon", "StopPermSWEPDrop", function(ply, swep)
if PermSweps[ply] and IsValid(swep) then
if table.HasValue(PermSweps[ply], swep:GetClass()) then
return false
end
end
end)
// See if weapon exists
local function getValidSWEPS(weps)
local weps2 = {}
local wepsT = getweaponsList()
for _, v in ipairs(wepsT) do
for _, wep in ipairs(weps) do
if v.ClassName == wep then
table.insert(weps2, v.ClassName)
end
end
end
return weps2
end
// Update inventory
net.Receive("PermSweps_SendInventoryToServer", function(len, ply)
if !ply:IsSuperAdmin() then return end
local target = net.ReadString()
local sweps = net.ReadString()
// Validate all sweps
local weps = util.TableToJSON( forceswepcheck and getValidSWEPS(util.JSONToTable(sweps)) or util.JSONToTable(sweps) )
// print("PermSweps_SendInventoryToServer")
// print(target)
// print(sweps)
if string.Left(target, 5) == "STEAM" then
util.SetPData(target, "PermSweps", weps)
local real = player.GetBySteamID(target)
if real then
PermSweps[real] = util.JSONToTable(weps)
end
end
end)
// Send Group inventory to server
net.Receive("PermSweps_SendGroupInventoryToServer", function(len, ply)
if !ply:IsSuperAdmin() then return end
local target = net.ReadString()
local sweps = net.ReadString()
// Validate all sweps
local weps = util.TableToJSON( forceswepcheck and getValidSWEPS(util.JSONToTable(sweps)) or util.JSONToTable(sweps) )
PermSweps.Group[target] = util.JSONToTable(weps)
SaveGroupSWEPS(PermSweps.Group)
end)
// Send EDS inventory to server
net.Receive("PermSweps_SendEDSInventoryToServer", function(len, ply)
if !ply:IsSuperAdmin() then return end
local target = net.ReadInt(16)
local sweps = net.ReadString()
// Validate all sweps
local weps = util.TableToJSON( forceswepcheck and getValidSWEPS(util.JSONToTable(sweps)) or util.JSONToTable(sweps) )
// print(target, weps)
PermSweps.EDS[target] = util.JSONToTable(weps)
SaveEDSSWEPS(PermSweps.EDS)
// print("---")
// print(weps)
// print("---")
end)
// Table add
local function tableAdd(t1, t2)
local new = {}
for k, v in ipairs(t1) do
if !table.HasValue(new, v) then
table.insert(new, v)
end
end
for k, v in ipairs(t2) do
if !table.HasValue(new, v) then
table.insert(new, v)
end
end
return new
end
// Add to
concommand.Add("perm_sweps_add", function(ply, cmd, args, argStr) // use "" around steamid
if !IsValid(ply) or ply:IsSuperAdmin() then
if args[1] != nil and args[2] != nil then
local target = args[1]
if string.Left(target, 5) == "STEAM" then
table.remove(args, 1)
local weps = forceswepcheck and getValidSWEPS(args) or args
local oldweps = util.GetPData(target, "PermSweps", false)
if oldweps then
// print(oldweps)
weps = tableAdd(weps, util.JSONToTable(oldweps))
end
if #weps >= 1 then
util.SetPData(target, "PermSweps", util.TableToJSON(weps))
local real = player.GetBySteamID(target)
if real then
PermSweps[real] = weps
end
end
end
end
end
end)
// Remove from
concommand.Add("perm_sweps_remove", function(ply, cmd, args, argStr)
if !IsValid(ply) or ply:IsSuperAdmin() then
if args[1] != nil and args[2] != nil then
local target = args[1]
if string.Left(target, 5) == "STEAM" then
table.remove(args, 1)
local weps = forceswepcheck and getValidSWEPS(args) or args
local oldweps = util.GetPData(target, "PermSweps", false)
if !oldweps then return end
if #weps >= 1 then
local newweps = {}
for k, v in ipairs(util.JSONToTable(oldweps)) do
if !table.HasValue(weps, v) then
table.insert(newweps, v)
end
end
util.SetPData(target, "PermSweps", util.TableToJSON(newweps))
local real = player.GetBySteamID(target)
if real then
PermSweps[real] = newweps
end
end
end
end
end
end)
// Get inventory
net.Receive("PermSweps_GetInventoryFromServer", function(len, ply)
if !ply:IsSuperAdmin() then return end
local target = net.ReadString()
local real = player.GetBySteamID(target)
// print(target)
// PrintTable(PermSweps)
net.Start("PermSweps_SendInventoryToClient")
if real then
if PermSweps[real] then
net.WriteString(util.TableToJSON(PermSweps[real]))
else
net.WriteString(util.TableToJSON({}))
end
else
local data = util.GetPData(target, "PermSweps", false)
if data then
net.WriteString(data)
else
net.WriteString(util.TableToJSON({}))
end
end
net.Send(ply)
end)
// Get Group inventory
net.Receive("PermSweps_GetGroupInventoryFromServer", function(len, ply)
if !ply:IsSuperAdmin() then return end
local target = net.ReadString()
net.Start("PermSweps_SendGroupInventoryToClient")
if PermSweps.Group[target] then
net.WriteString(util.TableToJSON(PermSweps.Group[target]))
else
net.WriteString(util.TableToJSON({}))
end
net.Send(ply)
end)
// Get EDS inventory
net.Receive("PermSweps_GetEDSInventoryFromServer", function(len, ply)
if !ply:IsSuperAdmin() then return end
local target = net.ReadInt(16)
net.Start("PermSweps_SendEDSInventoryToClient")
if PermSweps.EDS[target] then
net.WriteString(util.TableToJSON(PermSweps.EDS[target]))
else
net.WriteString(util.TableToJSON({}))
end
net.Send(ply)
end)
|
GLib.BitConverter = {}
local bit_band = bit.band
local bit_lshift = bit.lshift
local bit_rshift = bit.rshift
local math_floor = math.floor
local math_frexp = math.frexp
local math_ldexp = math.ldexp
local math_huge = math.huge
-- Integers
function GLib.BitConverter.UInt8ToUInt8s (n)
return n
end
function GLib.BitConverter.UInt16ToUInt8s (n)
return n % 256,
math_floor (n / 256) % 256
end
function GLib.BitConverter.UInt32ToUInt8s (n)
return n % 256,
math_floor (n / 256) % 256,
math_floor (n / 65536) % 256,
math_floor (n / 16777216) % 256
end
function GLib.BitConverter.UInt64ToUInt8s (n)
return n % 256,
math_floor (n / 256) % 256,
math_floor (n / 65536) % 256,
math_floor (n / 16777216) % 256,
math_floor (n / 4294967296) % 256,
math_floor (n / 1099511627776) % 256,
math_floor (n / 281474976710656) % 256,
math_floor (n / 72057594037927936) % 256
end
function GLib.BitConverter.UInt8sToUInt8(uint80)
return uint80
end
function GLib.BitConverter.UInt8sToUInt16 (uint80, uint81)
return uint80 +
uint81 * 256
end
function GLib.BitConverter.UInt8sToUInt32 (uint80, uint81, uint82, uint83)
return uint80 +
uint81 * 256 +
uint82 * 65536 +
uint83 * 16777216
end
function GLib.BitConverter.UInt8sToUInt64 (uint80, uint81, uint82, uint83, uint84, uint85, uint86, uint87)
return uint80 +
uint81 * 256 +
uint82 * 65536 +
uint83 * 16777216 +
uint84 * 4294967296 +
uint85 * 1099511627776 +
uint86 * 281474976710656 +
uint87 * 72057594037927936
end
function GLib.BitConverter.Int8ToUInt8s (n)
if n < 0 then n = n + 256 end
return GLib.BitConverter.UInt8ToUInt8s (n)
end
function GLib.BitConverter.Int16ToUInt8s (n)
if n < 0 then n = n + 65536 end
return GLib.BitConverter.UInt16ToUInt8s (n)
end
function GLib.BitConverter.Int32ToUInt8s (n)
if n < 0 then n = n + 4294967296 end
return GLib.BitConverter.UInt32ToUInt8s (n)
end
function GLib.BitConverter.Int64ToUInt8s (n)
local uint80, uint81, uint82, uint83 = GLib.BitConverter.UInt32ToUInt8s (n % 4294967296)
local uint84, uint85, uint86, uint87 = GLib.BitConverter.Int32ToUInt8s (math_floor (n / 4294967296))
return uint80, uint81, uint82, uint83, uint84, uint85, uint86, uint87
end
function GLib.BitConverter.UInt8sToInt8 (uint80)
local n = GLib.BitConverter.UInt8sToUInt8 (uint80)
if n >= 128 then n = n - 256 end
return n
end
function GLib.BitConverter.UInt8sToInt16 (uint80, uint81)
local n = GLib.BitConverter.UInt8sToUInt16 (uint80, uint81)
if n >= 32768 then n = n - 65536 end
return n
end
function GLib.BitConverter.UInt8sToInt32 (uint80, uint81, uint82, uint83)
local n = GLib.BitConverter.UInt8sToUInt32 (uint80, uint81, uint82, uint83)
if n >= 2147483648 then n = n - 4294967296 end
return n
end
function GLib.BitConverter.UInt8sToInt64 (uint80, uint81, uint82, uint83, uint84, uint85, uint86, uint87)
local low = GLib.BitConverter.UInt8sToUInt32 (uint80, uint81, uint82, uint83)
local high = GLib.BitConverter.UInt8sToInt32 (uint84, uint85, uint86, uint87)
return low + high * 4294967296
end
-- IEEE floating point numbers
function GLib.BitConverter.FloatToUInt32 (f)
-- 1 / f is needed to check for -0
local n = 0
if f < 0 or 1 / f < 0 then
n = n + 0x80000000
f = -f
end
local mantissa = 0
local biasedExponent = 0
if f == math_huge then
biasedExponent = 0xFF
elseif f ~= f then
biasedExponent = 0xFF
mantissa = 1
elseif f == 0 then
biasedExponent = 0x00
else
mantissa, biasedExponent = math_frexp (f)
biasedExponent = biasedExponent + 126
if biasedExponent <= 0 then
-- Denormal
mantissa = math_floor (mantissa * 2 ^ (23 + biasedExponent) + 0.5)
biasedExponent = 0
else
mantissa = math_floor ((mantissa * 2 - 1) * 2 ^ 23 + 0.5)
end
end
n = n + bit_lshift (bit_band (biasedExponent, 0xFF), 23)
n = n + bit_band (mantissa, 0x007FFFFF)
return n
end
function GLib.BitConverter.DoubleToUInt32s (f)
-- 1 / f is needed to check for -0
local high = 0
local low = 0
if f < 0 or 1 / f < 0 then
high = high + 0x80000000
f = -f
end
local mantissa = 0
local biasedExponent = 0
if f == math_huge then
biasedExponent = 0x07FF
elseif f ~= f then
biasedExponent = 0x07FF
mantissa = 1
elseif f == 0 then
biasedExponent = 0x00
else
mantissa, biasedExponent = math_frexp (f)
biasedExponent = biasedExponent + 1022
if biasedExponent <= 0 then
-- Denormal
mantissa = math_floor (mantissa * 2 ^ (52 + biasedExponent) + 0.5)
biasedExponent = 0
else
mantissa = math_floor ((mantissa * 2 - 1) * 2 ^ 52 + 0.5)
end
end
low = mantissa % 4294967296
high = high + bit_lshift (bit_band (biasedExponent, 0x07FF), 20)
high = high + bit_band (math_floor (mantissa / 4294967296), 0x000FFFFF)
return low, high
end
function GLib.BitConverter.UInt32ToFloat (n)
-- 1 sign bit
-- 8 biased exponent bits (bias of 127, biased value of 0 if 0 or denormal)
-- 23 mantissa bits (implicit 1, unless biased exponent is 0)
local negative = false
if n >= 0x80000000 then
negative = true
n = n - 0x80000000
end
local biasedExponent = bit_rshift (bit_band (n, 0x7F800000), 23)
local mantissa = bit_band (n, 0x007FFFFF) / (2 ^ 23)
local f
if biasedExponent == 0x00 then
f = mantissa == 0 and 0 or math_ldexp (mantissa, -126)
elseif biasedExponent == 0xFF then
f = mantissa == 0 and math_huge or (math_huge - math_huge)
else
f = math_ldexp (1 + mantissa, biasedExponent - 127)
end
return negative and -f or f
end
function GLib.BitConverter.UInt32sToDouble (low, high)
-- 1 sign bit
-- 11 biased exponent bits (bias of 127, biased value of 0 if 0 or denormal)
-- 52 mantissa bits (implicit 1, unless biased exponent is 0)
local negative = false
if high >= 0x80000000 then
negative = true
high = high - 0x80000000
end
local biasedExponent = bit_rshift (bit_band (high, 0x7FF00000), 20)
local mantissa = (bit_band (high, 0x000FFFFF) * 4294967296 + low) / 2 ^ 52
local f
if biasedExponent == 0x0000 then
f = mantissa == 0 and 0 or math_ldexp (mantissa, -1022)
elseif biasedExponent == 0x07FF then
f = mantissa == 0 and math_huge or (math_huge - math_huge)
else
f = math_ldexp (1 + mantissa, biasedExponent - 1023)
end
return negative and -f or f
end |
-- luacheck: ignore 212
local Lex = require 'lex'
local Util = require 'util'
local to_hash = Util.to_hash
local sf = string.format
-- local concat = Util.concat
local UNOPR = { 'not', '-', '~', '#' }
local BINOPR = {
{ '+', 10, 10 },
{ '-', 10, 10 },
{ '*', 11, 11 },
{ '%', 11, 11 },
{ '^', 14, 13 },
{ '/', 11, 11 },
{ '//', 11, 11 },
{ '&', 6, 6 },
{ '|', 4, 4 },
{ '~', 5, 5 },
{ '<<', 7, 7 },
{ '>>', 7, 7 },
{ '..', 9, 8 },
{ '~=', 3, 3 },
{ '==', 3, 3 },
{ '<', 3, 3 },
{ '<=', 3, 3 },
{ '>', 3, 3 },
{ '>=', 3, 3 },
{ 'and', 2, 2 },
{ 'or', 1, 1 },
}
local CLOSE_BLOCK = { 'else', 'elseif', 'end', 'EOS', 'until' }
-- local CLOSE_SCOPE = { 'else', 'elseif', 'end', 'EOS' }
local IS_UNOPR = to_hash(UNOPR)
local IS_CLOSE_BLOCK = to_hash(CLOSE_BLOCK)
-- local IS_CLOSE_SCOPE = to_hash(CLOSE_SCOPE)
local BINOPR_HASH = {}
for _, v in ipairs(BINOPR) do
BINOPR_HASH[v[1]] = { left=v[2], right=v[3] }
end
local UNARY_PRIORITY = 12
----
local expr
local block
local function newinfo(e)
return {
filename = e:get_filename(),
line = e:get_line_no(),
}
end
local function check_identifier(e)
e:check_save('ID', true)
return { tag='Id', info=e.info, e.cv }
end
-- primaryexp -> NAME | '(' expr ')'
local function primaryexp(e)
if e:try_skip('(') then
local n = expr(e)
e:check_skip(')')
return n
elseif e.tt == 'ID' then
return check_identifier(e)
else
e:syntax_error('unexpected symbol')
end
end
-- constructor -> '{' [ field { sep field } [sep] ] '}'
-- sep -> ',' | ';'
local function constructor(e)
local n = { tag='Table', info=newinfo(e) }
local i = 0
e:check_skip('{')
while true do
if e.tt == '}' then
break
end
if e.tt == 'ID' then
local info = newinfo(e)
e:look_ahead()
if e.at ~= '=' then
i = i + 1
n[#n+1] = { tag='Integer', info=info, i }
n[#n+1] = expr(e)
else
n[#n+1] = { tag='Id', info=newinfo(e), e.tv }
e:next_token()
e:check_skip('=')
n[#n+1] = expr(e)
end
elseif e:try_skip('[') then
n[#n+1] = expr(e)
e:check_skip(']')
e:check_skip('=')
n[#n+1] = expr(e)
else
local info = newinfo(e)
i = i + 1
n[#n+1] = { tag='Integer', info=info, i }
n[#n+1] = expr(e)
end
if not (e:try_skip(',') or e:try_skip(';')) then
break
end
end
e:check_skip('}')
return n
end
local function explist(e)
local n = { tag='ExpList', info=newinfo(e) }
repeat
n[#n+1] = expr(e)
until not e:try_skip(',')
return n
end
local function funcargs(e, n_funcname)
local info = newinfo(e)
if e:try_skip('(') then
if e:try_skip(')') then
local n_parlist = { tag='ExpList', info=info }
return { tag='Call', info=info, n_funcname, n_parlist }
else
local n_parlist = explist(e)
e:check_skip(')')
return { tag='Call', info=info, n_funcname, n_parlist }
end
elseif e.tt == '{' then
local n_parlist = { tag='ExpList', info=info, constructor(e) }
return { tag='Call', info=info, n_funcname, n_parlist }
elseif e:try_save('STR', true) then
local n_parlist = { tag='ExpList', info=info, { tag='Str', info=info, e.cv } }
return { tag='Call', info=info, n_funcname, n_parlist }
else
e:syntax_error('function arguments expected')
end
end
-- suffixedexp -> primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs }
local function suffixedexp(e)
local n1 = primaryexp(e)
while true do
if e:try_skip('.') then
local n2 = check_identifier(e)
n1 = { tag='IndexShort', info=newinfo(e), n1, n2 }
elseif e:try_skip('[') then
local n2 = expr(e)
e:check_skip(']')
n1 = { tag='Index', info=newinfo(e), n1, n2 }
elseif e:try_skip(':') then
e:check_save('ID', true)
local n2 = { tag='Id', info=newinfo(e), e.cv }
n1 = { tag='Invoke', info=newinfo(e), n1, n2 }
n1 = funcargs(e, n1)
elseif e.tt == '(' or e.tt == 'STR' or e.tt == '{' then
n1 = funcargs(e, n1)
else
break
end
end
return n1
end
-- parlist -> [ {NAME ','} (NAME | '...') ]
local function parlist(e)
local n_namelist = { tag='NameList', info=newinfo(e) }
while e.tt ~= ')' do
if e.tt == 'ID' then
n_namelist[#n_namelist+1] = check_identifier(e)
if not e:try_skip(',') then
break
end
elseif e:try_skip('...') then
n_namelist[#n_namelist+1] = { tag='VarArg', info=newinfo(e) }
break
else
e:syntax_error("<name> or '...' expected")
end
end
return n_namelist
end
-- body -> '(' parlist ')' block END
local function body(e)
e:check_skip('(')
local n_parlist = parlist(e)
e:check_skip(')')
local n_block = block(e)
e:check_skip('end')
return n_parlist, n_block
end
local function simpleexp(e)
if e:try_save('FLT', true) then
return { tag='Float', info=newinfo(e), e.cv }
elseif e:try_save('INT', true) then
return { tag='Integer', info=newinfo(e), e.cv }
elseif e:try_save('STR', true) then
return { tag='Str', info=newinfo(e), e.cv }
elseif e:try_skip('nil') then
return { tag='Nil', info=newinfo(e) }
elseif e:try_skip('true') then
return { tag='Bool', info=newinfo(e), true }
elseif e:try_skip('false') then
return { tag='Bool', info=newinfo(e), false }
elseif e:try_skip('...') then
return { tag='VarArg', info=newinfo(e) }
elseif e.tt == '{' then
return constructor(e)
elseif e:try_skip('function') then
local info = e.info
local n_parlist, n_block = body(e)
return { tag='Function', info=info, n_parlist, n_block }
else
return suffixedexp(e)
end
end
local function subexpr(e, limit)
local n1
if IS_UNOPR[e.tt] then
local op = e.tt
e:next_token()
local n2 = subexpr(e, UNARY_PRIORITY)
n1 = { tag='UnOpr', info=newinfo(e), op, n2 }
else
n1 = simpleexp(e)
end
local binopr = BINOPR_HASH[e.tt]
while binopr and binopr.left > limit do
local op = e.tt
local info = newinfo(e)
e:next_token()
local n2, next_binopr = subexpr(e, binopr.right)
n1 = { tag='BinOpr', info=info, op, n1, n2 }
binopr = next_binopr
end
return n1, binopr
end
expr = function(e)
return subexpr(e, 0)
end
-- funcname -> NAME {fieldsel} [':' NAME] */
local function funcname(e)
local node = { tag='FuncName', info=newinfo(e), invoke=false }
node[#node+1] = check_identifier(e)
while e:try_skip('.') do
node[#node+1] = check_identifier(e)
end
if e:try_skip(':') then
node[#node+1] = check_identifier(e)
node.invoke = true
end
return node
end
-- funcstat -> FUNCTION funcname body
local function funcstat(e)
local info = newinfo(e)
local n_funcname = funcname(e)
local n_parlist, n_block = body(e)
return { tag='FunctionDef', info=info, n_funcname, n_parlist, n_block }
end
local function localfunc(e)
local info = newinfo(e)
local n_id = check_identifier(e)
local n_parlist, n_block = body(e)
return { tag='LocalFunctionDef', info=info, n_id, n_parlist, n_block }
end
local function localstat(e)
local info = newinfo(e)
local n_namelist = { tag='NameList', info=info }
repeat
n_namelist[#n_namelist+1] = check_identifier(e)
until not e:try_skip(',')
local expr_list
if e:try_skip('=') then
expr_list = explist(e)
else
expr_list = { tag='ExpList', info=info }
end
return { tag='Local', info=info, n_namelist, expr_list }
end
-- stat -> func | assignment
local function exprstat(e)
local info = newinfo(e)
local n1 = suffixedexp(e)
if e.tt == '=' or e.tt == ',' then
local n_namelist = { tag='ExpList', info=info, n1 }
while e:try_skip(',') do
n_namelist[#n_namelist+1] = suffixedexp(e)
end
e:check_skip('=')
local expr_list = explist(e)
return { tag='Set', info=info, n_namelist, expr_list }
else
-- stat -> func
if n1.tag ~= 'Call' then
e:syntax_error('syntax error')
end
return n1
end
end
-- ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END
local function ifstat(e)
local node = { tag='If', info=newinfo(e) }
node[#node+1] = expr(e)
e:check_skip('then')
node[#node+1] = block(e)
while e:try_skip('elseif') do
node[#node+1] = expr(e)
e:check_skip('then')
node[#node+1] = block(e)
end
if e:try_skip('else') then
node[#node+1] = { tag='Bool', info=e.info, true }
node[#node+1] = block(e)
end
e:check_skip('end')
return node
end
-- stat -> RETURN [explist] [';']
local function retstat(e)
local info = newinfo(e)
local expr_list
if e:try_skip(';') then
expr_list = { tag='ExpList', info=info }
elseif IS_CLOSE_BLOCK[e.tt] then
expr_list = { tag='ExpList', info=info }
else
expr_list = explist(e)
e:try_skip(';')
end
return { tag='Return', info=newinfo(e), expr_list }
end
local function fornum(e, n_var1)
local info = newinfo(e)
local n1 = expr(e)
e:check_skip(',')
local n2 = expr(e)
local n3
if e:try_skip(',') then
n3 = expr(e)
else
n3 = nil
end
e:check_skip('do')
local n_block = block(e)
e:check_skip('end')
return { tag='Fornum', info=info, n_var1, n1, n2, n3, n_block }
end
local function forlist(e, n_var1)
local info = newinfo(e)
local n_namelist = { tag='NameList', info=newinfo(e), n_var1 }
while e:try_skip(',') do
n_namelist[#n_namelist+1] = check_identifier(e)
end
e:check_skip('in')
local n_expr_list = explist(e)
e:check_skip('do')
local n_block = block(e)
e:check_skip('end')
return { tag='Forin', info=info, n_namelist, n_expr_list, n_block }
end
local typeexp
local function typetable(e, open)
local keys = {}
local hash = {}
local n_tpobj = { tag='TypeObj', info=newinfo(e), keys=keys, hash=hash, open=open }
e:check_skip('{')
while true do
if e:try_skip('}') then
break
end
local n_fieldname = check_identifier(e)
e:check_skip(':')
local n_fieldtype = typeexp(e)
e:check_skip(';')
local field = n_fieldname[1]
keys[#keys+1] = field
hash[field] = n_fieldtype
-- table.insert(n_tpobj, n_fieldname)
-- table.insert(n_tpobj, n_fieldtype)
end
return n_tpobj
end
local function primarytype(e)
local n
local info = newinfo(e)
if e.tt == 'ID' and e.tv == 'open' then
e:next_token()
n = typetable(e, true)
elseif e.tt == 'ID' and e.tv == 'handle_require' then
e:next_token()
n = primarytype(e)
n.is_require = true
elseif e.tt == '{' then
n = typetable(e, false)
elseif e:try_skip('(') then
n = typeexp(e)
e:check_skip(')')
elseif e.tt == 'ID' then
n = check_identifier(e)
elseif e:try_skip('...') then
return { tag='VarArg', info=e.info }
else
e:syntax_error(sf("'ID' expected"))
return { tag='ID', info=newinfo(e), 'Any' }
end
if e:try_skip('?') then
n.is_opt = true
end
return n
end
-- 返回一个 Type
typeexp = function(e)
local info = newinfo(e)
local n_args
if e.tt ~= '>>' then
local n = primarytype(e)
-- 不是 TypeFunction
if e.tt ~= ',' and e.tt ~= '>>' then
return n
end
-- 是 TypeFunction
n_args = { tag='TypeArgList', info=info, n }
while e:try_skip(',') do
n_args[#n_args+1] = primarytype(e)
end
else
n_args = { tag='TypeArgList', info=info }
end
e:check_skip('>>')
local n_ret = primarytype(e)
return { tag='TypeFunction', info=info, n_args, n_ret }
end
local function typesuffixedname(e)
if e.tt == '$' then
e:next_token()
return { tag='RefToNextSymbol', info=newinfo(e) }
end
local n1 = check_identifier(e)
while true do
if e:try_skip('.') then
local n2 = check_identifier(e)
n1 = { tag='IndexShort', info=newinfo(e), n1, n2 }
else
break
end
end
return n1
end
local function typestatement(e)
local info = newinfo(e)
if e.tt == 'ID' then
if e.tv == 'open' then
e:next_token()
local n_id = typesuffixedname(e)
return { tag='OpenTypeObj', info=info, n_id }
end
if e.tv == 'close' then
e:next_token()
local n_id = typesuffixedname(e)
return { tag='CloseTypeObj', info=info, n_id }
end
if e.tv == 'dump_var' then
e:next_token()
local n_id = typesuffixedname(e)
return { tag='DumpVar', info=info, n_id }
end
end
-- local n_id = check_identifier(e)
local n_id = typesuffixedname(e)
if e:try_skip('=') then
local n_type = typeexp(e)
return { tag='Tpdef', info=info, n_id, n_type }
else
e:check_skip('::')
local n_type = typeexp(e)
return { tag='Tpbind', info=info, n_id, n_type }
end
end
local function statement(e)
if e:try_skip(';') then
return { tag='EmptyStat', info=e.info }
elseif e:try_skip('if') then
return ifstat(e)
elseif e:try_skip('while') then
local info = e.info
local n_cond = expr(e)
e:check_skip('do')
local n_block = block(e)
e:check_skip('end')
return { tag='While', info=info, n_cond, n_block }
elseif e:try_skip('do') then
local info = e.info
local n_block = block(e)
local n_do = { tag='Do', info=info, n_block }
e:check_skip('end')
return n_do
elseif e:try_skip('for') then
local n_var1 = check_identifier(e)
if e:try_skip('=') then
return fornum(e, n_var1)
elseif e.tt == ',' or e.tt == 'in' then
return forlist(e, n_var1)
else
e:syntax_error("'=' or 'in' expected")
end
elseif e:try_skip('repeat') then
local info = e.info
local n_block = block(e)
e:check_skip('until')
local n_cond = expr(e)
return { tag='Repeat', info=info, n_block, n_cond }
elseif e:try_skip('function') then
return funcstat(e)
elseif e:try_skip('local') then
if e:try_skip('function') then
return localfunc(e)
else
return localstat(e)
end
elseif e:try_skip('::') then
local n_label = { tag='Label', info=e.info, check_identifier(e) }
e:check_skip('::')
return n_label
elseif e:try_skip('return') then
return retstat(e)
elseif e:try_skip('break') then
return { tag='Break', info=e.info }
elseif e:try_skip('goto') then
return { tag='Goto', info=e.info, check_identifier(e) }
-- 类型检查用
elseif e:try_skip('TPLINE') then
return typestatement(e)
elseif e:try_skip('TPDEF_BEGIN') then
local n = { tag='Tpblock', info= e.info }
while true do
if e:try_skip('TPDEF_END') then
break
end
n[#n+1] = typestatement(e)
end
return n
else
return exprstat(e)
end
end
block = function(e)
local n = { tag='Block', info=newinfo(e) }
while not IS_CLOSE_BLOCK[e.tt] do
if e.tt == 'return' then
n[#n+1] = statement(e)
break
end
n[#n+1] = statement(e)
end
return n
end
local function mainfunc(e)
local n = block(e)
e:check_skip('EOS')
return n
end
return function(c, s, is_file)
-- local function hook()
-- error('infinite loop detected\n' .. s)
-- end
-- debug.sethook(hook, '', 10000000)
-- print('================================================ s:', s)
-- local f = io.open(s, 'r')
-- if not f then
-- io.stderr:write("file not found: " .. s .. "\n")
-- return nil
-- end
-- local c = f:read('a')
-- f:close()
local get_next_token = Lex(c, s, is_file)
local e = {
tt = nil,
tv = nil,
cv = nil, -- checked value
lookahead = false,
at = nil, -- look ahead
av = nil, -- look ahead
}
function e:get_filename()
return s
end
function e:get_line_no()
return get_next_token('LINE_NO')
end
function e:next_token()
local tt, tv
if self.lookahead then
self.lookahead = false
tt = self.at
tv = self.av
else
tt, tv = get_next_token()
end
-- print('TOKEN', tt, tv)
self.tt = tt
self.tv = tv
end
function e:look_ahead()
if not self.lookahead then
local tt, tv = get_next_token()
self.lookahead = true
self.at = tt
self.av = tv
end
end
function e:try_skip(tt)
if self.tt == tt then
self.info = newinfo(self)
self:next_token()
return true
else
return false
end
end
function e:try_save(tt, consume)
return self:check_save(tt, consume, true)
end
function e:check_skip(tt)
if self.tt == tt then
self:next_token()
else
print(debug.traceback())
self:syntax_error(sf("'%s' expected", tt))
end
end
function e:check_save(tt, consume, noerr)
if self.tt ~= tt then
if not noerr then
print(debug.traceback())
self:syntax_error(sf("'%s' expected", tt))
end
return false
end
self.cv = self.tv
self.info = newinfo(self)
if consume then
self:next_token()
end
return true
end
function e:syntax_error(msg)
local err = sf('%s:%d: (syntax_error) %s (near %s)', self:get_filename(), self:get_line_no(), msg, self:dump_token())
coroutine.yield('__SYNTAX_ERROR__', err)
end
function e:dump_token()
if self.tt == 'ID' then
return sf('ID<%s>', self.tv)
elseif self.tt == 'STR' then
return sf('string<%s>', self.tv)
elseif self.tt == 'INT' then
return sf('Integer<%s>', self.tv)
elseif self.tt == 'FLT' then
return sf('Float<%s>', self.tv)
elseif self.tt == 'EOS' then
return '<eof>'
elseif self.tt == 'TPLINE' then
return '(-->>)'
else
return sf('<%s>', self.tt)
end
end
local co = coroutine.create(function()
e:next_token()
return mainfunc(e)
end)
local ok, v, err = coroutine.resume(co)
if not ok then
error(debug.traceback(co, v))
end
if v == '__SYNTAX_ERROR__' then
return nil, err
end
return v
end
|
ITEM.name = "Деревянная коробка"
ITEM.desc = "Простейший деревянный ящик."
ITEM.model = "models/container4.mdl"
ITEM.width = 2
ITEM.height = 2
ITEM.invW = 4
ITEM.invH = 4
ITEM.locksound = "hgn/crussaria/devices/door_regular_stopclose.wav"
ITEM.opensound = "hgn/crussaria/devices/door_regular_opening.wav"
|
--Core
_G.DoReady = {}
--Paladin
_G.DoReady.Paladin = {}
_G.DoReady.Paladin.Protection = {}
_G.DoReady.Paladin.Protection.Raid = {}
_G.DoReady.Paladin.Protection.MythicPlus = {}
_G.DoReady.Paladin.Protection.MythicPlus.Fortified = {}
_G.DoReady.Paladin.Protection.MythicPlus.Tyrannical = {}
_G.DoReady.Paladin.Retribution = {}
_G.DoReady.Paladin.Retribution.Raid = {}
_G.DoReady.Paladin.Retribution.MythicPlus = {}
_G.DoReady.Paladin.Retribution.MythicPlus.Fortified = {}
_G.DoReady.Paladin.Retribution.MythicPlus.Tyrannical = {}
_G.DoReady.Paladin.Holy = {}
_G.DoReady.Paladin.Holy.Raid = {}
_G.DoReady.Paladin.Holy.MythicPlus = {}
_G.DoReady.Paladin.Holy.MythicPlus.Fortified = {}
_G.DoReady.Paladin.Holy.MythicPlus.Tyrannical = {}
--Priest
_G.DoReady.Priest = {}
_G.DoReady.Priest.Shadow = {}
_G.DoReady.Priest.Shadow.Raid = {}
_G.DoReady.Priest.Shadow.MythicPlus = {}
_G.DoReady.Priest.Shadow.MythicPlus.Fortified = {}
_G.DoReady.Priest.Shadow.MythicPlus.Tyrannical = {}
_G.DoReady.Priest.Discipline = {}
_G.DoReady.Priest.Discipline.Raid = {}
_G.DoReady.Priest.Discipline.MythicPlus = {}
_G.DoReady.Priest.Discipline.MythicPlus.Fortified = {}
_G.DoReady.Priest.Discipline.MythicPlus.Tyrannical = {}
_G.DoReady.Priest.Holy = {}
_G.DoReady.Priest.Holy.Raid = {}
_G.DoReady.Priest.Holy.MythicPlus = {}
_G.DoReady.Priest.Holy.MythicPlus.Fortified = {}
_G.DoReady.Priest.Holy.MythicPlus.Tyrannical = {}
--Warlock
_G.DoReady.Warlock = {}
_G.DoReady.Warlock.Affliction = {}
_G.DoReady.Warlock.Affliction.Raid = {}
_G.DoReady.Warlock.Affliction.MythicPlus = {}
_G.DoReady.Warlock.Affliction.MythicPlus.Fortified = {}
_G.DoReady.Warlock.Affliction.MythicPlus.Tyrannical = {}
_G.DoReady.Warlock.Demonology = {}
_G.DoReady.Warlock.Demonology.Raid = {}
_G.DoReady.Warlock.Demonology.MythicPlus = {}
_G.DoReady.Warlock.Demonology.MythicPlus.Fortified = {}
_G.DoReady.Warlock.Demonology.MythicPlus.Tyrannical = {}
_G.DoReady.Warlock.Destruction = {}
_G.DoReady.Warlock.Destruction.Raid = {}
_G.DoReady.Warlock.Destruction.MythicPlus = {}
_G.DoReady.Warlock.Destruction.MythicPlus.Fortified = {}
_G.DoReady.Warlock.Destruction.MythicPlus.Tyrannical = {}
--Monk
_G.DoReady.Monk = {}
_G.DoReady.Monk.Brewmaster = {}
_G.DoReady.Monk.Brewmaster.Raid = {}
_G.DoReady.Monk.Brewmaster.MythicPlus = {}
_G.DoReady.Monk.Brewmaster.MythicPlus.Fortified = {}
_G.DoReady.Monk.Brewmaster.MythicPlus.Tyrannical = {}
_G.DoReady.Monk.Windwalker = {}
_G.DoReady.Monk.Windwalker.Raid = {}
_G.DoReady.Monk.Windwalker.MythicPlus = {}
_G.DoReady.Monk.Windwalker.MythicPlus.Fortified = {}
_G.DoReady.Monk.Windwalker.MythicPlus.Tyrannical = {}
_G.DoReady.Monk.Mistweaver = {}
_G.DoReady.Monk.Mistweaver.Raid = {}
_G.DoReady.Monk.Mistweaver.MythicPlus = {}
_G.DoReady.Monk.Mistweaver.MythicPlus.Fortified = {}
_G.DoReady.Monk.Mistweaver.MythicPlus.Tyrannical = {}
--DemonHunter
_G.DoReady.DemonHunter = {}
_G.DoReady.DemonHunter.Vengeance = {}
_G.DoReady.DemonHunter.Vengeance.Raid = {}
_G.DoReady.DemonHunter.Vengeance.MythicPlus = {}
_G.DoReady.DemonHunter.Vengeance.MythicPlus.Fortified = {}
_G.DoReady.DemonHunter.Vengeance.MythicPlus.Tyrannical = {}
_G.DoReady.DemonHunter.Havoc = {}
_G.DoReady.DemonHunter.Havoc.Raid = {}
_G.DoReady.DemonHunter.Havoc.MythicPlus = {}
_G.DoReady.DemonHunter.Havoc.MythicPlus.Fortified = {}
_G.DoReady.DemonHunter.Havoc.MythicPlus.Tyrannical = {}
--Hunter
_G.DoReady.Hunter = {}
_G.DoReady.Hunter.Survival = {}
_G.DoReady.Hunter.Survival.Raid = {}
_G.DoReady.Hunter.Survival.MythicPlus = {}
_G.DoReady.Hunter.Survival.MythicPlus.Fortified = {}
_G.DoReady.Hunter.Survival.MythicPlus.Tyrannical = {}
_G.DoReady.Hunter.Marksmanship = {}
_G.DoReady.Hunter.Marksmanship.Raid = {}
_G.DoReady.Hunter.Marksmanship.MythicPlus = {}
_G.DoReady.Hunter.Marksmanship.MythicPlus.Fortified = {}
_G.DoReady.Hunter.Marksmanship.MythicPlus.Tyrannical = {}
_G.DoReady.Hunter.BeastMastery = {}
_G.DoReady.Hunter.BeastMastery.Raid = {}
_G.DoReady.Hunter.BeastMastery.MythicPlus = {}
_G.DoReady.Hunter.BeastMastery.MythicPlus.Fortified = {}
_G.DoReady.Hunter.BeastMastery.MythicPlus.Tyrannical = {}
--Rogue
_G.DoReady.Rogue = {}
_G.DoReady.Rogue.Subtlety = {}
_G.DoReady.Rogue.Subtlety.Raid = {}
_G.DoReady.Rogue.Subtlety.MythicPlus = {}
_G.DoReady.Rogue.Subtlety.MythicPlus.Fortified = {}
_G.DoReady.Rogue.Subtlety.MythicPlus.Tyrannical = {}
_G.DoReady.Rogue.Outlaw = {}
_G.DoReady.Rogue.Outlaw.Raid = {}
_G.DoReady.Rogue.Outlaw.MythicPlus = {}
_G.DoReady.Rogue.Outlaw.MythicPlus.Fortified = {}
_G.DoReady.Rogue.Outlaw.MythicPlus.Tyrannical = {}
_G.DoReady.Rogue.Assassination = {}
_G.DoReady.Rogue.Assassination.Raid = {}
_G.DoReady.Rogue.Assassination.MythicPlus = {}
_G.DoReady.Rogue.Assassination.MythicPlus.Fortified = {}
_G.DoReady.Rogue.Assassination.MythicPlus.Tyrannical = {}
--Mage
_G.DoReady.Mage = {}
_G.DoReady.Mage.Frost = {}
_G.DoReady.Mage.Frost.Raid = {}
_G.DoReady.Mage.Frost.MythicPlus = {}
_G.DoReady.Mage.Frost.MythicPlus.Fortified = {}
_G.DoReady.Mage.Frost.MythicPlus.Tyrannical = {}
_G.DoReady.Mage.Fire = {}
_G.DoReady.Mage.Fire.Raid = {}
_G.DoReady.Mage.Fire.MythicPlus = {}
_G.DoReady.Mage.Fire.MythicPlus.Fortified = {}
_G.DoReady.Mage.Fire.MythicPlus.Tyrannical = {}
_G.DoReady.Mage.Arcane = {}
_G.DoReady.Mage.Arcane.Raid = {}
_G.DoReady.Mage.Arcane.MythicPlus = {}
_G.DoReady.Mage.Arcane.MythicPlus.Fortified = {}
_G.DoReady.Mage.Arcane.MythicPlus.Tyrannical = {}
--Warrior
_G.DoReady.Warrior = {}
_G.DoReady.Warrior.Protection = {}
_G.DoReady.Warrior.Protection.Raid = {}
_G.DoReady.Warrior.Protection.MythicPlus = {}
_G.DoReady.Warrior.Protection.MythicPlus.Fortified = {}
_G.DoReady.Warrior.Protection.MythicPlus.Tyrannical = {}
_G.DoReady.Warrior.Arms = {}
_G.DoReady.Warrior.Arms.Raid = {}
_G.DoReady.Warrior.Arms.MythicPlus = {}
_G.DoReady.Warrior.Arms.MythicPlus.Fortified = {}
_G.DoReady.Warrior.Arms.MythicPlus.Tyrannical = {}
_G.DoReady.Warrior.Fury = {}
_G.DoReady.Warrior.Fury.Raid = {}
_G.DoReady.Warrior.Fury.MythicPlus = {}
_G.DoReady.Warrior.Fury.MythicPlus.Fortified = {}
_G.DoReady.Warrior.Fury.MythicPlus.Tyrannical = {}
--DeathKnight
_G.DoReady.DeathKnight = {}
_G.DoReady.DeathKnight.Blood = {}
_G.DoReady.DeathKnight.Blood.Raid = {}
_G.DoReady.DeathKnight.Blood.MythicPlus = {}
_G.DoReady.DeathKnight.Blood.MythicPlus.Fortified = {}
_G.DoReady.DeathKnight.Blood.MythicPlus.Tyrannical = {}
_G.DoReady.DeathKnight.Unholy = {}
_G.DoReady.DeathKnight.Unholy.Raid = {}
_G.DoReady.DeathKnight.Unholy.MythicPlus = {}
_G.DoReady.DeathKnight.Unholy.MythicPlus.Fortified = {}
_G.DoReady.DeathKnight.Unholy.MythicPlus.Tyrannical = {}
_G.DoReady.DeathKnight.Frost = {}
_G.DoReady.DeathKnight.Frost.Raid = {}
_G.DoReady.DeathKnight.Frost.MythicPlus = {}
_G.DoReady.DeathKnight.Frost.MythicPlus.Fortified = {}
_G.DoReady.DeathKnight.Frost.MythicPlus.Tyrannical = {}
--Shaman
_G.DoReady.Shaman = {}
_G.DoReady.Shaman.Enhancement = {}
_G.DoReady.Shaman.Enhancement.Raid = {}
_G.DoReady.Shaman.Enhancement.MythicPlus = {}
_G.DoReady.Shaman.Enhancement.MythicPlus.Fortified = {}
_G.DoReady.Shaman.Enhancement.MythicPlus.Tyrannical = {}
_G.DoReady.Shaman.Elemental = {}
_G.DoReady.Shaman.Elemental.Raid = {}
_G.DoReady.Shaman.Elemental.MythicPlus = {}
_G.DoReady.Shaman.Elemental.MythicPlus.Fortified = {}
_G.DoReady.Shaman.Elemental.MythicPlus.Tyrannical = {}
_G.DoReady.Shaman.Restoration = {}
_G.DoReady.Shaman.Restoration.Raid = {}
_G.DoReady.Shaman.Restoration.MythicPlus = {}
_G.DoReady.Shaman.Restoration.MythicPlus.Fortified = {}
_G.DoReady.Shaman.Restoration.MythicPlus.Tyrannical = {}
--Druid
_G.DoReady.Druid = {}
_G.DoReady.Druid.Guardian = {}
_G.DoReady.Druid.Guardian.Raid = {}
_G.DoReady.Druid.Guardian.MythicPlus = {}
_G.DoReady.Druid.Guardian.MythicPlus.Fortified = {}
_G.DoReady.Druid.Guardian.MythicPlus.Tyrannical = {}
_G.DoReady.Druid.Feral = {}
_G.DoReady.Druid.Feral.Raid = {}
_G.DoReady.Druid.Feral.MythicPlus = {}
_G.DoReady.Druid.Feral.MythicPlus.Fortified = {}
_G.DoReady.Druid.Feral.MythicPlus.Tyrannical = {}
_G.DoReady.Druid.Balance = {}
_G.DoReady.Druid.Balance.Raid = {}
_G.DoReady.Druid.Balance.MythicPlus = {}
_G.DoReady.Druid.Balance.MythicPlus.Fortified = {}
_G.DoReady.Druid.Balance.MythicPlus.Tyrannical = {}
_G.DoReady.Druid.Restoration = {}
_G.DoReady.Druid.Restoration.Raid = {}
_G.DoReady.Druid.Restoration.MythicPlus = {}
_G.DoReady.Druid.Restoration.MythicPlus.Fortified = {}
_G.DoReady.Druid.Restoration.MythicPlus.Tyrannical = {} |
require("pixel")
N=3*3
function sponge(x,y,z,d)
if d < 1 then
pix3d(x,y,z)
else
sponge(x,y,z,d/3)
sponge(x+d,y,z,d/3)
sponge(x+2*d,y,z,d/3)
sponge(x,y+d,z,d/3)
sponge(x+2*d,y+d,z,d/3)
sponge(x,y+2*d,z,d/3)
sponge(x+d,y+2*d,z,d/3)
sponge(x+2*d,y+2*d,z,d/3)
sponge(x,y,z+d,d/3)
sponge(x+2*d,y,z+d,d/3)
sponge(x,y+2*d,z+d,d/3)
sponge(x+2*d,y+2*d,z+d,d/3)
sponge(x,y,z+2*d,d/3)
sponge(x+d,y,z+2*d,d/3)
sponge(x+2*d,y,z+2*d,d/3)
sponge(x,y+d,z+2*d,d/3)
sponge(x+2*d,y+d,z+2*d,d/3)
sponge(x,y+2*d,z+2*d,d/3)
sponge(x+d,y+2*d,z+2*d,d/3)
sponge(x+2*d,y+2*d,z+2*d,d/3)
end
end
function GLUP.init_graphics()
GLUP.SetRegionOfInterest(1,1,1,N*3,N*3,N*3)
end
function GLUP.draw_scene()
GLUP.Enable(GLUP.DRAW_MESH)
pixBegin()
col("yellow")
sponge(1,1,1,N)
pixEnd()
end
|
AssistantReadyCheck = CreateFrame("Frame");
AssistantReadyCheck:RegisterEvent("READY_CHECK");
AssistantReadyCheck:RegisterEvent("READY_CHECK_CONFIRM");
AssistantReadyCheck:RegisterEvent("READY_CHECK_FINISHED");
local readyCheckPlayers, readyCheckAllReady;
AssistantReadyCheck:SetScript("OnEvent", function(self, event, ...)
if GetNumRaidMembers() > 0 and not IsRaidOfficer() then return; end
if event == "READY_CHECK" then
self:OnReadyCheck(...);
elseif event == "READY_CHECK_CONFIRM" then
self:OnPlayerConfirm(...);
elseif event == "READY_CHECK_FINISHED" then
self:OnReadyCheckFinished();
end
end);
function AssistantReadyCheck:OnReadyCheck(name, time)
if name == UnitName("player") then return; end;
readyCheckPlayers, readyCheckAllReady = { [name] = true }, true;
end
function AssistantReadyCheck:OnPlayerConfirm(unit, ready)
if not readyCheckPlayers then return; end;
if unit == "player" then return; end;
local name = UnitName(unit);
readyCheckPlayers[name] = ready;
if not ready then
readyCheckAllReady = false;
self:Print(RAID_MEMBER_NOT_READY, name);
end
end
function AssistantReadyCheck:OnReadyCheckFinished(preempted)
if not readyCheckPlayers then return; end;
if preempted then return; end; -- ignore Blizzard's bad design
local numberAFK, afkNames = self:GetAFKPlayers();
if numberAFK > 0 then
self:Print(RAID_MEMBERS_AFK, afkNames);
elseif not readyCheckAllReady then
self:Print(READY_CHECK_FINISHED);
else
self:Print(READY_CHECK_ALL_READY);
end
readyCheckPlayers, readyCheckAllReady = nil, nil;
end
function AssistantReadyCheck:GetAFKPlayers()
local number, names, spacer = 0, "", "";
for index = 1, 40 do
local name = UnitName("raid" .. index);
if not name then
-- empty raid slot
elseif readyCheckPlayers[name] == nil then
number = number + 1;
names = names .. spacer .. name;
spacer = ", ";
else
-- player is ready
end
end
return number, names;
end
function AssistantReadyCheck:Print(message, name)
local info = ChatTypeInfo["SYSTEM"];
DEFAULT_CHAT_FRAME:AddMessage(format(message, name), info.r, info.g, info.b, info.id);
end
|
function write_file()
file = io.open("lua.txt", "w+")
--LatLong
latlong = get_latlong();
if (latlong.latitude ~= nil and latlong.longitude ~= nil) then
file:write("latitude:", latlong.latitude, " longitude:", latlong.longitude, "\n");
end
--Recordings
recordings = get_recordings()
for j=1,#recordings do
recording = recordings[j]
file:write("Recording: token:", recording.token, " name:", recording.name, " location:", recording.location, " retention_time:", recording.retention_time, " adaptive_streaming:", recording.adaptive_streaming == true and "true" or "false", " relative_location:", recording.relative_location == true and "true" or "false", " orientation:", recording.orientation)
if (recording.latlong ~= nil) then
file:write(" latitude:", recording.latlong.latitude, " longitude:", recording.latlong.longitude)
end
file:write("\n")
for k=1,#recording.tracks do
track = recording.tracks[k]
parameters = ""
for l=1,#track.parameters do
parameters = parameters .. track.parameters[l]
end
active_parameters = "";
for l=1,#track.active_parameters do
active_parameters = active_parameters .. track.active_parameters[l]
end
file:write(" Track: id:", track.id, " track_type:", track.track_type, " description:", track.description, " state:", track.state, " error:", track.error, " mediauri:", track.mediauri, " parameters:", parameters, " active_parameters:", active_parameters, "\n")
end
end
file:close();
end
function monocle_init(parameters)
write_file()
end
function monocle_destroy()
print("destroying")
end
function recording_added(recording)
write_file()
end
function recording_changed(recording)
write_file()
end
function recording_removed(token)
write_file()
end
function latlong_changed(latlong)
write_file()
end
function object_entered(recordingtoken, trackid, time, id, classid, confidence, x, y, width, height)
print("object entered")
end
function object_exited(recordingtoken, trackid, time, id, classid)
print("object exited")
end
function object_moved(recordingtoken, trackid, time, id, classid, confidence, x, y, width, height)
print("object moved")
end
|
--[[
// FileName: PlayerCarousel.lua
// Written by: darthskrill
// Description: Module for building the UI for the player selection carousel
]]
local PlayerCarousel = {}
PlayerCarousel.__index = PlayerCarousel
-- SERVICES
local GuiService = game:GetService("GuiService")
local CoreGuiService = game:GetService("CoreGui")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
-- CONSTANTS
local BACKGROUND_SELECTED_COLOR = Color3.fromRGB(0,162,255)
local BACKGROUND_DEFAULT_COLOR = Color3.fromRGB(0,0,0)
local PAGE_LAYOUT_TWEEN_TIME = 0.25
local CAROUSEL_DIVIDER_NAME = "_CarouselDivider"
-- VARIABLES
local RobloxGui = CoreGuiService:WaitForChild("RobloxGui")
local CoreGuiModules = RobloxGui:WaitForChild("Modules")
local AvatarMenuModules = CoreGuiModules:WaitForChild("AvatarContextMenu")
local selectedPlayer = nil
local uiPageLayout = nil
local playerChangedEvent = nil
local buttonToPlayerMap = {}
local playerToButtonMap = {}
local function getSortedCarouselButtons()
local buttonChildIndexs = {}
local carouselButtons = {}
for childIndex, child in ipairs(selectedPlayer:GetChildren()) do
if child:IsA("GuiObject") and child.Name ~= CAROUSEL_DIVIDER_NAME then
table.insert(carouselButtons, child)
buttonChildIndexs[child] = childIndex
end
end
table.sort(carouselButtons, function(a, b)
if a.LayoutOrder == b.LayoutOrder then
return buttonChildIndexs[a] < buttonChildIndexs[b]
end
return a.LayoutOrder < b.LayoutOrder
end)
return carouselButtons
end
local function CreateMenuCarousel(theme)
local playerSelection = Instance.new("Frame")
playerSelection.Name = "PlayerCarousel"
playerSelection.AnchorPoint = Vector2.new(0.5, 0.5)
playerSelection.BackgroundTransparency = 1
playerSelection.Position = UDim2.new(0.5,0,0.5,0)
playerSelection.Size = UDim2.new(1, 0, 0.28, 0)
playerSelection.ClipsDescendants = true
local innerFrame = Instance.new("Frame")
innerFrame.Name = "InnerFrame"
innerFrame.AnchorPoint = Vector2.new(0.5, 0.5)
innerFrame.BackgroundTransparency = 1
innerFrame.Position = UDim2.new(0.5, 0, 0.5, 0)
innerFrame.Size = UDim2.new(0.8, 0, 1, 0)
innerFrame.ClipsDescendants = true
innerFrame.Active = true
innerFrame.Parent = playerSelection
selectedPlayer = Instance.new("Frame")
selectedPlayer.Name = "SelectedPlayer"
selectedPlayer.AnchorPoint = Vector2.new(0.5, 0.5)
selectedPlayer.BackgroundTransparency = 1
selectedPlayer.Position = UDim2.new(0.5, 0, 0.5, 0)
selectedPlayer.Size = UDim2.new(0, 100, 1, -10)
selectedPlayer.Parent = innerFrame
uiPageLayout = Instance.new("UIPageLayout")
uiPageLayout.EasingDirection = Enum.EasingDirection.Out
uiPageLayout.EasingStyle = Enum.EasingStyle.Quad
uiPageLayout.Padding = UDim.new(0, 5)
uiPageLayout.TweenTime = PAGE_LAYOUT_TWEEN_TIME
uiPageLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiPageLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiPageLayout.TouchInputEnabled = false
uiPageLayout.Circular = true
uiPageLayout.SortOrder = Enum.SortOrder.LayoutOrder
local aspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
aspectRatioConstraint.DominantAxis = Enum.DominantAxis.Height
aspectRatioConstraint.Parent = selectedPlayer
playerChangedEvent = Instance.new("BindableEvent")
playerChangedEvent.Name = "PlayerChanged"
local lastPage = nil
uiPageLayout:GetPropertyChangedSignal("CurrentPage"):Connect(function()
if uiPageLayout.CurrentPage then
if uiPageLayout.CurrentPage.Name == CAROUSEL_DIVIDER_NAME then
local carouselButtons = getSortedCarouselButtons()
if lastPage == carouselButtons[1] then
uiPageLayout:Previous()
else
uiPageLayout:Next()
end
else
uiPageLayout.CurrentPage.BackgroundColor3 = BACKGROUND_DEFAULT_COLOR
lastPage = uiPageLayout.CurrentPage
end
end
if GuiService.SelectedCoreObject and GuiService.SelectedCoreObject.Parent == uiPageLayout.Parent then
GuiService.SelectedCoreObject.BackgroundColor3 = BACKGROUND_SELECTED_COLOR
end
GuiService.SelectedCoreObject = uiPageLayout.CurrentPage
if uiPageLayout.CurrentPage then playerChangedEvent:Fire(buttonToPlayerMap[uiPageLayout.CurrentPage]) end
end)
uiPageLayout.Parent = selectedPlayer
local nextButton = Instance.new("ImageButton")
nextButton.Name = "NextButton"
nextButton.Image = theme.ScrollRightImage
nextButton.BackgroundTransparency = 1
nextButton.AnchorPoint = Vector2.new(1,0.5)
nextButton.Position = UDim2.new(1,-5,0.5,0)
nextButton.Size = UDim2.new(0.3,0,0.3,0)
nextButton.Selectable = false
nextButton.Parent = playerSelection
local nextButtonAspectRatio = Instance.new("UIAspectRatioConstraint")
nextButtonAspectRatio.DominantAxis = Enum.DominantAxis.Width
nextButtonAspectRatio.Parent = nextButton
local prevButton = nextButton:Clone()
prevButton.Name = "PrevButton"
if theme.ScrollLeftImage ~= "" then
prevButton.Image = theme.ScrollLeftImage
else
prevButton.Rotation = 180
end
prevButton.AnchorPoint = Vector2.new(0, 0.5)
prevButton.Position = UDim2.new(0, 5, 0.5, 0)
prevButton.Selectable = false
prevButton.Parent = playerSelection
local function moveChangePage(goToNext)
if goToNext then
uiPageLayout:Next()
else
uiPageLayout:Previous()
end
end
nextButton.MouseButton1Click:Connect(function() moveChangePage(true) end)
prevButton.MouseButton1Click:Connect(function() moveChangePage(false) end)
local defaultChildrenSize = 3 -- aspectRatioConstraint, PageLayout, first button in pagelayout
local function checkButtonVisibility()
local lastInputIsTouch = UserInputService:GetLastInputType() == Enum.UserInputType.Touch
prevButton.Visible = not lastInputIsTouch and (#selectedPlayer:GetChildren() > defaultChildrenSize)
nextButton.Visible = not lastInputIsTouch and (#selectedPlayer:GetChildren() > defaultChildrenSize)
end
checkButtonVisibility()
UserInputService.LastInputTypeChanged:Connect(checkButtonVisibility)
return playerSelection
end
function PlayerCarousel:UpdateGuiTheme(theme)
self.rbxGui.NextButton.Image = theme.ScrollRightImage
if theme.ScrollLeftImage ~= "" then
self.rbxGui.PrevButton.Image = theme.ScrollLeftImage
else
self.rbxGui.PrevButton.Image = theme.ScrollRightImage
self.rbxGui.PrevButton.Rotation = 180
end
end
function PlayerCarousel:FadeTowardsEdges()
if not uiPageLayout.CurrentPage then
return
end
local carouselButtons = getSortedCarouselButtons()
local currentPageIndex = 0
for index, button in ipairs(carouselButtons) do
if button == uiPageLayout.CurrentPage then
currentPageIndex = index
break
end
end
for index, button in ipairs(carouselButtons) do
local distanceToLeft = (currentPageIndex - index) % #carouselButtons
local distanceToRight = (index - currentPageIndex) % #carouselButtons
local distance = math.min(distanceToLeft, distanceToRight)
if distance >= 2 then
button.ImageTransparency = 0.7
elseif distance == 1 then
button.ImageTransparency = 0.4
else
button.ImageTransparency = 0
end
end
end
function PlayerCarousel:AddCarouselDivider()
local carouselDivider = selectedPlayer:FindFirstChild(CAROUSEL_DIVIDER_NAME)
if carouselDivider then
carouselDivider:Destroy()
end
local buttonCount = #selectedPlayer:GetChildren() - 1
if buttonCount < 5 then
return
end
carouselDivider = Instance.new("Frame")
carouselDivider.Name = CAROUSEL_DIVIDER_NAME
carouselDivider.Size = UDim2.new(1, 0, 1, 0)
carouselDivider.BackgroundTransparency = 1
carouselDivider.Parent = selectedPlayer
carouselDivider.LayoutOrder = 1000000
local line = Instance.new("Frame")
line.Name = "line"
line.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
line.BorderSizePixel = 0
line.Position = UDim2.new(0.25, 0, 0, -3)
line.Size = UDim2.new(0, 2, 1, 6)
line.Parent = carouselDivider
local line2 = line:Clone()
line2.Position = UDim2.new(0.5, 0, 0, -3)
line2.Parent = carouselDivider
local line3 = line:Clone()
line3.Position = UDim2.new(0.75, 0, 0, -3)
line3.Parent = carouselDivider
end
function PlayerCarousel:RemovePlayerEntry(player)
local button = playerToButtonMap[player]
if button then
playerToButtonMap[player] = nil
buttonToPlayerMap[button] = nil
button:Destroy()
if uiPageLayout then
uiPageLayout:ApplyLayout()
end
self:FadeTowardsEdges()
end
end
function PlayerCarousel:ClearPlayerEntries()
for button in pairs(buttonToPlayerMap) do
button:Destroy()
end
buttonToPlayerMap = {}
playerToButtonMap = {}
end
function PlayerCarousel:CreatePlayerEntry(player, distanceToLocalPlayer)
local playerButton = playerToButtonMap[player]
if playerButton then
playerButton.LayoutOrder = distanceToLocalPlayer
return
end
local button = Instance.new("ImageButton")
button.Name = player.Name
button.BorderSizePixel = 0
button.LayoutOrder = distanceToLocalPlayer
button.BackgroundColor3 = Color3.fromRGB(0,0,0)
button.BackgroundTransparency = 0
button.Size = UDim2.new(1, 0, 1, 0)
button.SelectionLost:connect(function() button.BackgroundColor3 = BACKGROUND_DEFAULT_COLOR end)
button.SelectionGained:connect(function() button.BackgroundColor3 = BACKGROUND_SELECTED_COLOR end)
local tweenStyle = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, true)
local buttonLoadingTween
buttonLoadingTween = TweenService:Create(
button,
tweenStyle,
{BackgroundColor3 = Color3.fromRGB(255,255,255)}
)
buttonLoadingTween:Play()
buttonToPlayerMap[button] = player
playerToButtonMap[player] = button
button.MouseButton1Click:Connect(function()
uiPageLayout:JumpTo(button)
end)
button.Parent = selectedPlayer
spawn(function()
local ContextMenuUtil = require(AvatarMenuModules:WaitForChild("ContextMenuUtil"))
button.Image = ContextMenuUtil:GetHeadshotForPlayer(player)
buttonLoadingTween:Cancel()
buttonLoadingTween = nil
if button == GuiService.SelectedCoreObject then
button.BackgroundColor3 = BACKGROUND_SELECTED_COLOR
else
button.BackgroundColor3 = BACKGROUND_DEFAULT_COLOR
end
end)
end
function PlayerCarousel:SwitchToPlayerEntry(player, dontTween)
if not player then return end
local button = playerToButtonMap[player]
if not button then
self:CreatePlayerEntry(player, 0)
button = playerToButtonMap[player]
end
if dontTween then
uiPageLayout.TweenTime = 0
end
uiPageLayout:JumpTo(button)
spawn(function()
uiPageLayout.TweenTime = PAGE_LAYOUT_TWEEN_TIME
end)
end
function PlayerCarousel:OffsetPlayerEntry(offset)
if offset == 0 then return end
if offset > 0 then
uiPageLayout:Next()
else
uiPageLayout:Previous()
end
end
function PlayerCarousel:GetSelectedPlayer()
return buttonToPlayerMap[uiPageLayout.CurrentPage]
end
function PlayerCarousel.new(theme)
local obj = setmetatable({}, PlayerCarousel)
obj.rbxGui = CreateMenuCarousel(theme)
obj.PlayerChanged = playerChangedEvent.Event
playerChangedEvent.Event:Connect(function()
obj:FadeTowardsEdges()
end)
return obj
end
return PlayerCarousel
|
useConfig = require "RTS use config";
useConfig(1, 25);
|
id = 'V-38663'
severity = 'medium'
weight = 10.0
title = 'The system package management tool must verify permissions on all files and directories associated with the audit package.'
description = 'Permissions on audit binaries and configuration files that are too generous could allow an unauthorized user to gain privileges that they should not have. The permissions set by the vendor should be maintained. Any deviations from this baseline should be investigated.'
fixtext = [=[The RPM package management system can restore file access permissions of the audit package files and directories. The following command will update audit files with permissions different from what is expected by the RPM database:
# rpm --setperms audit]=]
checktext = [=[The following command will list which audit files on the system have permissions different from what is expected by the RPM database:
# rpm -V audit | grep '^.M'
If there is any output, for each file or directory found, compare the RPM-expected permissions with the permissions on the file or directory:
# rpm -q --queryformat "[%{FILENAMES} %{FILEMODES:perms}\n]" audit | grep [filename]
# ls -lL [filename]
If the existing permissions are more permissive than those expected by RPM, this is a finding.]=]
function test()
end
function fix()
end
|
--[[
Variables
]]
local currentTarget = nil
local currentTargetCoords = nil
local skilling = false
local insideSouthSide = false
--[[
Functions
]]
local function breakInToRegister()
skilling = true
local registerId = string.format("%.2f", currentTargetCoords.x) .. "_" .. string.format("%.2f", currentTargetCoords.y) .. "_" .. string.format("%.2f", currentTargetCoords.z)
local message = RPC.execute("caue-heists:canRobRegister", registerId)
if message ~= nil then
TriggerEvent("DoLongHudText", message, 2)
skilling = false
return
end
TriggerEvent("alert:storeRobbery")
RequestAnimDict("oddjobs@shop_robbery@rob_till")
while not HasAnimDictLoaded("oddjobs@shop_robbery@rob_till") do
Citizen.Wait(0)
end
ClearPedTasksImmediately(PlayerPedId())
TaskTurnPedToFaceEntity(PlayerPedId(), currentTarget, -1)
TaskPlayAnim(PlayerPedId(), "oddjobs@shop_robbery@rob_till", "loop", 8.0, -8, -1, 1, 0, 0, 0, 0)
local finished = exports["caue-taskbar"]:taskBar(10000, "Roubando", true, false, nil, false, nil, 3)
if finished == 100 then
TriggerServerEvent("caue-heists:complete", math.random(300, 400))
end
skilling = false
ClearPedTasksImmediately(PlayerPedId())
end
--[[
Events
]]
AddEventHandler("caue-heists:breakInToRegister", function(pArgs, pEntity)
currentTarget = pEntity
currentTargetCoords = GetEntityCoords(pEntity)
breakInToRegister()
end)
AddEventHandler("caue-polyzone:enter", function(name, data)
if name == "southside_register" then
insideSouthSide = true
end
end)
AddEventHandler("caue-polyzone:exit", function(name, data)
if name == "southside_register" then
insideSouthSide = false
end
end)
--[[
Threads
]]
Citizen.CreateThread(function()
exports["caue-eye"]:AddPeekEntryByModel({ 303280717 }, {{
event = "caue-heists:breakInToRegister",
id = "heists_breakInToRegister",
icon = "hammer",
label = "Quebrar!",
parameters = {},
}}, {
distance = { radius = 1.0 },
isEnabled = function(pEntity)
return GetObjectFragmentDamageHealth(pEntity, true) < 1.0 and not skilling and insideSouthSide
end,
})
end)
Citizen.CreateThread(function()
exports["caue-polyzone"]:AddCircleZone("southside_register", vector3(76.37, -1390.35, 29.38), 3.8, {
useZ=false,
})
exports["caue-polyzone"]:AddCircleZone("southside_register", vector3(24.7, -1346.1, 29.5), 1.5, {
useZ=false,
})
exports["caue-polyzone"]:AddCircleZone("southside_register", vector3(-47.16, -1758.67, 29.42), 1.45, {
useZ=false,
})
exports["caue-polyzone"]:AddCircleZone("southside_register", vector3(134.16, -1708.21, 29.29), 1.0, {
useZ=false,
})
exports["caue-polyzone"]:AddCircleZone("southside_register", vector3(1324.91, -1650.71, 52.28), 1.0, {
useZ=false,
})
end) |
local ACF = ACF
local Message = SERVER and ACF.PrintLog or ACF.PrintToChat
local Names = {
[1] = "Sandbox",
[2] = "Classic",
[3] = "Competitive"
}
local Settings = {
Gamemode = function(_, _, Value)
local Mode = math.Clamp(math.floor(tonumber(Value) or 2), 1, 3)
if Mode == ACF.Gamemode then return end
ACF.Gamemode = Mode
Message("Info", "ACF Gamemode has been changed to " .. Names[Mode])
end,
ServerDataAllowAdmin = function(_, _, Value)
ACF.AllowAdminData = tobool(Value)
end,
RestrictInfo = function(_, _, Value)
ACF.RestrictInfo = tobool(Value)
end,
GunsCanFire = function(_, _, Value)
local Bool = tobool(Value)
if ACF.GunsCanFire == Bool then return end
ACF.GunsCanFire = Bool
Message("Info", "ACF Gunfire has been " .. (Bool and "enabled." or "disabled."))
end,
GunsCanSmoke = function(_, _, Value)
local Bool = tobool(Value)
if ACF.GunsCanSmoke == Bool then return end
ACF.GunsCanSmoke = Bool
Message("Info", "ACF Gun sound and particles have been " .. (Bool and "enabled." or "disabled."))
end,
RacksCanFire = function(_, _, Value)
local Bool = tobool(Value)
if ACF.RacksCanFire == Bool then return end
ACF.RacksCanFire = Bool
Message("Info", "ACF Missile Racks have been " .. (Bool and "enabled." or "disabled."))
end,
HealthFactor = function(_, _, Value)
local Factor = math.Clamp(math.Round(tonumber(Value) or 1, 2), 0.01, 2)
if ACF.HealthFactor == Factor then return end
local Old = ACF.HealthFactor
ACF.HealthFactor = Factor
ACF.Threshold = ACF.Threshold / Old * Factor
Message("Info", "ACF Health Mod changed to a factor of " .. Factor)
end,
ArmorFactor = function(_, _, Value)
local Factor = math.Clamp(math.Round(tonumber(Value) or 1, 2), 0.01, 2)
if ACF.ArmorFactor == Factor then return end
local Old = ACF.ArmorFactor
ACF.ArmorFactor = Factor
ACF.ArmorMod = ACF.ArmorMod / Old * Factor
Message("Info", "ACF Armor Mod changed to a factor of " .. Factor)
end,
FuelFactor = function(_, _, Value)
local Factor = math.Clamp(math.Round(tonumber(Value) or 1, 2), 0.01, 2)
if ACF.FuelFactor == Factor then return end
local Old = ACF.FuelFactor
ACF.FuelFactor = Factor
ACF.FuelRate = ACF.FuelRate / Old * Factor
Message("Info", "ACF Fuel Rate changed to a factor of " .. Factor)
end,
CompFuelFactor = function(_, _, Value)
local Factor = math.Clamp(math.Round(tonumber(Value) or 1, 2), 0.01, 2)
if ACF.CompFuelFactor == Factor then return end
local Old = ACF.CompFuelFactor
ACF.CompFuelFactor = Factor
ACF.CompFuelRate = ACF.CompFuelRate / Old * Factor
Message("Info", "ACF Competitive Fuel Rate changed to a factor of " .. Factor)
end,
HEPush = function(_, _, Value)
ACF.HEPush = tobool(Value)
end,
KEPush = function(_, _, Value)
ACF.KEPush = tobool(Value)
end,
RecoilPush = function(_, _, Value)
ACF.RecoilPush = tobool(Value)
end,
AllowFunEnts = function(_, _, Value)
ACF.AllowFunEnts = tobool(Value)
end,
WorkshopContent = function(_, _, Value)
local Bool = tobool(Value)
if ACF.WorkshopContent == Bool then return end
ACF.WorkshopContent = Bool
Message("Info", "ACF Workshop Content download has been " .. (Bool and "enabled." or "disabled."))
end,
WorkshopExtras = function(_, _, Value)
local Bool = tobool(Value)
if ACF.WorkshopExtras == Bool then return end
ACF.WorkshopExtras = Bool
Message("Info", "ACF Extra Workshop Content download has been " .. (Bool and "enabled." or "disabled."))
end,
}
for Key, Function in pairs(Settings) do
ACF.AddServerDataCallback(Key, "Global Variable Callback", Function)
end
do -- Volume setting callback
local Realm = SERVER and "Server" or "Client"
local Callback = ACF["Add" .. Realm .. "DataCallback"]
Callback("Volume", "Volume Variable Callback", function(_, _, Value)
ACF.Volume = math.Clamp(tonumber(Value) or 1, 0, 1)
end)
end
|
-- See Copyright Notice in lal.lua
local utl = require 'lal/lang/util'
local CodeChunk = require 'lal/lang/chunk'
local List = require 'lal/util/list'
local class = require 'lal/util/class'
-----------------------------------------------------------------------------
local function concatChunkValues(LChunks, sSep)
return LChunks:map(function (oC) return oC:value() end):concat(sSep)
end
-----------------------------------------------------------------------------
local CodeNode = class()
-----------------------------------------------------------------------------
function CodeNode:init(sType, lArgs)
self.sType = sType
self.LArgs = List(lArgs)
end
-----------------------------------------------------------------------------
function CodeNode:chunk(...)
local c = CodeChunk(...)
if (self.pos) then
c:p_if_has_output("--[[%s]]",
string.format("%s:%d", self.pos[2], self.pos[1]))
end
return c
end
-----------------------------------------------------------------------------
function CodeNode:set_source_pos(line, input_name)
self.pos = { line, input_name }
end
-----------------------------------------------------------------------------
function CodeNode:gen(bIsTail)
if (not self['gen_' .. self.sType]) then
error("No such code generator function: gen_" .. self.sType)
end
local v = self['gen_' .. self.sType](self, bIsTail)
return v
end
-----------------------------------------------------------------------------
function CodeNode:gen_qsplice(bIsTail)
local oQSplC = self.LArgs[1]:gen(false)
oQSplC._qsplice_marker = true
return oQSplC
end
-----------------------------------------------------------------------------
function CodeNode:handleReturnedChunks(LChunks)
local bIsReturning = false
LChunks = LChunks:map(function (oN)
local oC = oN:gen(false)
if (oC:isReturning()) then bIsReturning = true end
return oC
end)
if (not bIsReturning) then
return nil, LChunks
end
local oReturnChunk = self:chunk()
LChunks:foreach(function (oC)
if (oReturnChunk:isReturning()) then return end
if (oC:isReturning()) then
oReturnChunk:appendWithValue(oC)
else
oC:mergeUnusedValue()
oReturnChunk:append(oC)
end
end)
return oReturnChunk, nil
end
-----------------------------------------------------------------------------
function CodeNode:gen_qlist(bIsTail)
local oRetC, LElems = self:handleReturnedChunks(self.LArgs)
if (oRetC) then
return oRetC
end
local oC = self:chunk()
local sOutTmp = oC:declTmpVar('ql', '{}')
local sI = oC:declTmpVar('qi', '1')
LElems:foreach(function (v)
oC:append(v)
if (v._qsplice_marker) then
local sQSTmp = oC:declTmpVar('qspl', v:value())
local sITmp = utl.tmpvar("i");
local sLTmp = utl.tmpvar("l");
oC:p('if (_lal_lua_base_type(%s) == \'table\') then', sQSTmp)
oC:p(' %s = #%s;', sLTmp, sOutTmp);
oC:p(' for %s = 1, #%s do %s[%s + %s] = %s[%s]; end',
sITmp, sQSTmp, sOutTmp, sLTmp, sITmp, sQSTmp, sITmp);
-- oC:p(' _lal_lua_base_table.move(%s, 1, #%s, #%s + 1, %s);',
-- sQSTmp, sQSTmp, sOutTmp, sOutTmp)
oC:p(' %s = %s + #%s;', sI, sI, sQSTmp);
oC:p('else')
oC:p(' %s[%s] = %s;', sOutTmp, sI, sQSTmp)
oC:p(' %s = %s + 1;', sI, sI)
oC:p('end;')
else
oC:p('%s[%s] = %s;', sOutTmp, sI, v:value())
oC:p('%s = %s + 1;', sI, sI)
end
end)
oC:sideeffectFreeExpressionValue()
oC:pV('%s', sOutTmp)
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_list(bIsTail)
local oRetC, LElems = self:handleReturnedChunks(self.LArgs)
if (oRetC) then
return oRetC
end
local oC = self:chunk()
oC:appendChunks(LElems)
oC:expressionValue()
oC:pV('{%s}', concatChunkValues(LElems, ", "))
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_map(bIsTail)
local LAll = List()
local LKeys = List()
local LValues = List()
for k, v in pairs(self.LArgs[1]) do
LKeys:push(k)
LValues:push(v)
LAll:push(k)
LAll:push(v)
end
local oRetC
oRetC, LKeys = self:handleReturnedChunks(LKeys)
if (oRetC) then return oRetC end
oRetC, LValues = self:handleReturnedChunks(LValues)
if (oRetC) then return oRetC end
local oC = self:chunk()
oC:appendChunks(LKeys)
oC:appendChunks(LValues)
oC:expressionValue()
oC:pV('{')
LKeys:foreach(function (oK)
if (oK.sValueCompileType == 'keyword') then
oC:pV('[%s] = %s, ', utl.quote_lua_string(utl.strip_kw(oK.sRawStringValue)), LValues:shift():value())
elseif (oK.sValueCompileType == 'string') then
oC:pV('[%s] = %s, ', utl.quote_lua_string(oK.sRawStringValue), LValues:shift():value())
else
oC:pV('[strip_kw(%s)] = %s, ', oK:value(), LValues:shift():value())
end
end)
oC:pV('}')
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_string(bIsTail)
return self:chunk(utl.quote_lua_string(self.LArgs[1])):compileType('string', self.LArgs[1])
end
-----------------------------------------------------------------------------
function CodeNode:gen_number(bIsTail)
return self:chunk(tostring(self.LArgs[1])):compileType('number')
end
-----------------------------------------------------------------------------
function CodeNode:gen_boolean(bIsTail)
if (self.LArgs[1]) then return self:chunk('true'):compileType('boolean')
else return self:chunk('false'):compileType('boolean') end
end
-----------------------------------------------------------------------------
function CodeNode:gen_keyword(bIsTail)
return self:chunk(utl.quote_lua_string(self.LArgs[1])):compileType('keyword', self.LArgs[1])
end
-----------------------------------------------------------------------------
function CodeNode:gen_symbol(bIsTail)
return self:chunk(utl.quote_lua_string(self.LArgs[1])):compileType('symbol', self.LArgs[1])
end
-----------------------------------------------------------------------------
function CodeNode:gen_nil(bIsTail)
return self:chunk('nil'):compileType('nil')
end
-----------------------------------------------------------------------------
function CodeNode:gen_not(bIsTail)
local oCExpr = self.LArgs[1]:gen(false)
local oC = self:chunk()
oC:append(oCExpr)
oC:expressionValue()
oC:pV('not(%s)', oCExpr:value())
return oC
end
-----------------------------------------------------------------------------
function CodeNode.func_fld(field, table)
return table[utl.strip_kw(field)]
end
-----------------------------------------------------------------------------
function CodeNode.func_fldM(field, table, arg)
table[utl.strip_kw(field)] = arg
return arg
end
-----------------------------------------------------------------------------
function CodeNode:gen_fieldOverAccess(bIsTail)
local bArray = self.LArgs[1]
local sVar = self.LArgs[2]
local oField = self.LArgs[3]:gen(false)
local oTable = self.LArgs[4]:gen(false)
local oBlock = self.LArgs[5]:gen(false)
if (oField:isReturning()) then return oField end
if (oTable:isReturning()) then return oTable end
local oC = self:chunk()
oC:append(oField)
oC:append(oTable)
local sTbl = oC:declTmpVar("tbl", oTable:value())
local sFld
if (oField.sValueCompileType == 'keyword') then
sFld = string.format("[%s]", utl.quote_lua_string(utl.strip_kw(oField.sRawStringValue)))
elseif (oField.sValueCompileType == 'symbol') then
sFld = string.format("[%s]", utl.quote_lua_string(utl.strip_sym(oField.sRawStringValue)))
elseif (oField.sValueCompileType == 'string') then
sFld = string.format("[%s]", utl.quote_lua_string(oField.sRawStringValue))
elseif (oField.sValueCompileType == 'number') then
sFld = string.format("[%s]", tostring(oField:value()) + 1)
else
if (bArray) then
sFld = oC:declTmpVar("fld", string.format("((%s) + 1)", oField:value()))
else
sFld = oC:declTmpVar("fld", string.format("strip_kw(%s)", oField:value()))
end
sFld = string.format("[%s]", sFld)
end
local sTmp = oC:declTmpVar("tmp")
oC:p("do local %s = (%s)%s;", sVar, sTbl, sFld)
if (oBlock:isReturning()) then
oC:appendWithValue(oBlock)
oC:p("end;")
return oC
else
oC:append(oBlock, 1)
oC:p(" %s = %s;", sTmp, oBlock:value())
oC:p(" %s = %s;", sVar, sTmp)
oC:p(" (%s)%s = %s;", sTbl, sFld, sTmp)
oC:p("end;")
oC:sideeffectFreeExpressionValue()
oC:pV("%s", sVar)
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_fieldAccess(bIsTail)
local oFieldAcces = self.LArgs:shift():gen(false)
if (oFieldAcces:isReturning()) then return oFieldAcces end
local oRetC, LArgs = self:handleReturnedChunks(self.LArgs)
if (oRetC) then return oRetC end
local oCMap = LArgs:shift()
local oC = self:chunk()
oC:append(oFieldAcces)
local sFieldAccess
if (oFieldAcces.sValueCompileType == 'keyword') then
sFieldAccess = string.format("[%s]", utl.quote_lua_string(utl.strip_kw(oFieldAcces.sRawStringValue)))
elseif (oFieldAcces.sValueCompileType == 'symbol') then
sFieldAccess = string.format("[%s]", utl.quote_lua_string(utl.strip_sym(oFieldAcces.sRawStringValue)))
elseif (oFieldAcces.sValueCompileType == 'string') then
sFieldAccess = string.format("[%s]", utl.quote_lua_string(oFieldAcces.sRawStringValue))
else
sFieldAccess = string.format("[strip_kw(%s)]", oFieldAcces:value())
end
if (#LArgs <= 0) then
oC:append(oCMap)
oC:expressionValue()
oC:pV("((%s)%s)", oCMap:value(), sFieldAccess)
elseif (#LArgs == 1) then
oC:append(oCMap)
oC:appendChunks(LArgs)
local sTmpVar = oC:declTmpVar('facc', LArgs[1]:value())
oC:p('(%s)%s = %s;', oCMap:value(), sFieldAccess, sTmpVar)
oC:expressionValue()
oC:pV('%s', sTmpVar)
else
oC:append(oCMap)
oC:appendChunks(LArgs)
local sTmpVar =
oC:declTmpVar('facc',
string.format('{%s}', concatChunkValues(LArgs, ",")))
oC:p('(%s)%s = %s;', oCMap:value(), sFieldAccess, sTmpVar)
oC:expressionValue()
oC:pV('%s', sTmpVar)
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_block(bIsTail)
local oC = self:chunk()
local oLastChunk
oC:appendChunks(
self.LArgs:map(function (v, i)
if (oLastChunk) then return nil end
local oCL
if (i == #self.LArgs) then
oCL = v:gen(bIsTail)
else
oCL = v:gen(false)
end
if (oCL:isReturning()) then
oLastChunk = oCL
return oCL
end
if (i == #self.LArgs) then
oLastChunk = oCL
else
oCL:mergeUnusedValue()
end
return oCL
end)
:filter(function (v) return v end))
if (oLastChunk) then
oC:valueFrom(oLastChunk)
if (bIsTail and not oLastChunk:isReturning()) then
oC:mergeValueAsReturn()
end
else
oC:pV('nil')
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_tailContext()
local oC = self.LArgs[1]:gen(true)
if (not oC:isReturning()) then
oC:mergeValueAsReturn()
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_count(bIsTail)
local oCL = self.LArgs[1]:gen(false)
if (oCL:isReturning()) then return oCL end
local oC = self:chunk()
oC:expressionValue()
oC:append(oCL)
oC:pV('#(%s)', oCL:value())
return oC
end
-----------------------------------------------------------------------------
function CodeNode.func_emptyQ(v)
return not(utl.is_table(v)) or not next(v)
end
-----------------------------------------------------------------------------
function CodeNode:gen_emptyQ(bIsTail)
local oCL = self.LArgs[1]:gen(false)
if (oCL:isReturning()) then return oCL end
local oC = self:chunk()
oC:appendWithValue(oCL)
local sTmp = oC:mergeValueAsTmpVar('emptyQ')
oC:expressionValue()
oC:pV('(_lal_lua_base_type(%s) ~= "table" or not _lal_lua_base_next(%s))',
sTmp, sTmp, sTmp)
return oC
end
-----------------------------------------------------------------------------
function CodeNode.func_at(idx, tbl) return tbl[idx + 1] end
function CodeNode:gen_at(bIsTail)
local oIdxC = self.LArgs[1]:gen(false)
local oTblC = self.LArgs[2]:gen(false)
if (oIdxC:isReturning()) then return oIdxC end
if (oTblC:isReturning()) then return oTblC end
local oC = self:chunk()
oC:append(oIdxC)
oC:append(oTblC)
oC:expressionValue()
if (oIdxC.sValueCompileType == 'number') then
oC:pV('((%s)[%s])', oTblC:value(), tonumber(oIdxC:value()) + 1)
else
oC:pV('((%s)[%s + 1])', oTblC:value(), oIdxC:value())
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode.func_atM(idx, tbl, val) tbl[idx + 1] = val return val end
-----------------------------------------------------------------------------
function CodeNode:gen_atM(bIsTail)
-- TODO: Refactor this together with gen_fieldAccess!
local oIdxC = self.LArgs[1]:gen(false)
local oTblC = self.LArgs[2]:gen(false)
local oValC = self.LArgs[3]:gen(false)
if (oIdxC:isReturning()) then return oIdxC end
if (oTblC:isReturning()) then return oTblC end
if (oValC:isReturning()) then return oValC end
local oC = self:chunk()
oC:append(oIdxC)
oC:append(oTblC)
oC:append(oValC)
oC:expressionValue()
local sV = oC:declTmpVar('atv', oValC:value())
if (oIdxC.sValueCompileType == 'number') then
oC:p('(%s)[%s] = %s;', oTblC:value(), tonumber(oIdxC:value()) + 1, sV)
else
oC:p('(%s)[%s + 1] = %s;', oTblC:value(), oIdxC:value(), sV)
end
oC:sideeffectFreeExpressionValue()
oC:pV('%s', sV)
return oC
end
-----------------------------------------------------------------------------
function CodeNode.func_map(f, ...)
local lTabs = table.pack(...)
local lOut = {}
if (#lTabs > 1) then
local iMax = 0
for i = 1, #lTabs do
local lt = lTabs[i]
if (iMax < #lt) then iMax = #lt end
end
for i = 1, iMax do
local lArgs = {}
for j = 1, #lTabs do lArgs[j] = lTabs[j][i] end
lOut[i] = f(table.unpack(lArgs))
end
elseif (#lTabs == 0) then
lOut[1]= f()
else
local lt = lTabs[1]
for i = 1, #lt do
lOut[i] = f(lt[i])
end
end
return lOut
end
-----------------------------------------------------------------------------
function CodeNode:gen_mapF(bIsTail)
local oRetC, LOpr = self:handleReturnedChunks(self.LArgs)
if (oRetC) then return oRetC end
local oCF = LOpr:shift()
local oC = self:chunk()
oC:append(oCF)
local sFTmp = oC:declTmpVar('mapf', oCF:value())
local lTabTmps = {}
oC:appendChunks(LOpr)
LOpr:foreach(function (oOPC)
lTabTmps[#lTabTmps + 1] = oC:declTmpVar('maparg', oOPC:value())
end)
local sOutTbl
if (#lTabTmps > 1) then
sOutTbl = oC:declTmpVar('mapout', "{}")
local sMAX = oC:declTmpVar('mapmaxarg', '0')
for i = 1, #lTabTmps do
oC:p('if (%s < #%s) then %s = #%s end;',
sMAX, lTabTmps[i], sMAX, lTabTmps[i])
end
local sI = oC:declTmpVar('mapi')
oC:p('for %s = 1, %s do', sI, sMAX)
oC:p(' %s[%s] = %s(%s);', sOutTbl, sI, sFTmp,
List(lTabTmps)
:map(function (v) return string.format("%s[%s]", v, sI) end)
:concat(","))
oC:p('end;')
elseif (#lTabTmps == 0) then
sOutTbl = oC:declTmpVar('mapout', "{ " .. sFTmp .. "() }")
else
local lt = lTabTmps[1]
sOutTbl = oC:declTmpVar('mapout', "{}")
local sI = oC:declTmpVar('mapi')
oC:p('for %s = 1, #%s do %s[%s] = %s(%s[%s]); end;',
sI, lt, sOutTbl, sI, sFTmp, lt, sI)
end
oC:sideeffectFreeExpressionValue()
oC:pV(sOutTbl)
return oC
end
-----------------------------------------------------------------------------
function CodeNode.func_forEach(f, ...)
local lTabs = table.pack(...)
if (#lTabs > 1) then
local iMax = 0
for i = 1, #lTabs do
local lt = lTabs[i]
if (iMax < #lt) then iMax = #lt end
end
for i = 1, iMax do
local lArgs = {}
for j = 1, #lTabs do lArgs[j] = lTabs[j][i] end
f(table.unpack(lArgs))
end
elseif (#lTabs == 0) then
f()
else
local lt = lTabs[1]
for i = 1, #lt do
f(lt[i])
end
end
return nil
end
-----------------------------------------------------------------------------
function CodeNode:gen_forEachF(bIsTail)
local oRetC, LOpr = self:handleReturnedChunks(self.LArgs)
if (oRetC) then return oRetC end
local oCF = LOpr:shift()
local oC = self:chunk()
oC:append(oCF)
local sFTmp = oC:declTmpVar('forf', oCF:value())
local lTabTmps = {}
oC:appendChunks(LOpr)
LOpr:foreach(function (oOPC)
lTabTmps[#lTabTmps + 1] = oC:declTmpVar('forarg', oOPC:value())
end)
if (#lTabTmps > 1) then
local sMAX = oC:declTmpVar('mapmaxarg', '0')
for i = 1, #lTabTmps do
oC:p('if (%s < #%s) then %s = #%s end;',
sMAX, lTabTmps[i], sMAX, lTabTmps[i])
end
local sI = oC:declTmpVar('mapi')
oC:p('for %s = 1, %s do', sI, sMAX)
oC:p(' %s(%s);', sFTmp,
List(lTabTmps)
:map(function (v) return string.format("%s[%s]", v, sI) end)
:concat(","))
oC:p('end;')
elseif (#lTabTmps == 0) then
oC:p('%s();', sFTmp)
else
local lt = lTabTmps[1]
local sI = oC:declTmpVar('mapi')
oC:p('for %s = 1, #%s do %s(%s[%s]); end;',
sI, lt, sFTmp, lt, sI)
end
oC:sideeffectFreeExpressionValue()
oC:pV('nil')
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_for(bIsTail)
local LExpr = List()
LExpr:push(self.LArgs[2]:gen(false))
LExpr:push(self.LArgs[3]:gen(false))
LExpr:push(self.LArgs[4]:gen(false))
if (self.LArgs[5]) then
LExpr:push(self.LArgs[5]:gen(false))
end
local sVar = self.LArgs[1]
local oStartC = LExpr:shift()
local oDestC = LExpr:shift()
local oBlockC = LExpr:shift()
local oIncC = LExpr:shift()
if (oStartC:isReturning()) then return oStartC end
if (oDestC:isReturning()) then return oDestC end
if (oIncC and oIncC:isReturning()) then return oIncC end
local oC = self:chunk()
oC:append(oDestC)
oC:append(oStartC)
if (oIncC) then
oC:append(oIncC)
oC:p('for %s = %s, %s, %s do',
sVar, oStartC:value(), oDestC:value(), oIncC:value())
else
oC:p('for %s = %s, %s do',
sVar, oStartC:value(), oDestC:value())
end
oBlockC:mergeUnusedValue()
oC:append(oBlockC, 1)
oC:p('end;')
oC:sideeffectFreeExpressionValue()
oC:pV('nil')
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_do_each(bIsTail)
local LExpr = List()
LExpr:push(self.LArgs[1]:gen(false))
LExpr:push(self.LArgs[2]:gen(false))
local sV = self.LArgs[3]
local sK = self.LArgs[4]
local oValC = LExpr[1]
local oBlockC = LExpr[2]
if (oValC:isReturning()) then return oValC end
local oC = self:chunk()
oC:append(oValC)
if (sK) then
oC:p('for %s, %s in _lal_lua_base_pairs(%s) do', sK, sV, oValC:value())
else
oC:p('for _, %s in _lal_lua_base_ipairs(%s) do', sV, oValC:value())
end
oBlockC:mergeUnusedValue()
oC:append(oBlockC, 1)
oC:p('end;')
oC:sideeffectFreeExpressionValue()
oC:pV('nil')
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_op(bIsTail)
local sOp = self.LArgs[1]
local oRetC, LOpr = self:handleReturnedChunks(self.LArgs[2])
if (oRetC) then return oRetC end
local oC = self:chunk()
oC:expressionValue()
oC:appendChunks(LOpr)
oC:pV('(%s)', concatChunkValues(LOpr, string.format(" %s ", sOp)))
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_global_decl(bIsTail)
local oC = self:chunk()
if (self.LArgs[2]) then
local oCVal = self.LArgs[2]:gen(false)
if (oCVal:isReturning()) then
oC:appendWithValue(oCVal)
return oC
end
oC:append(oCVal)
oC:p('%s = %s;', self.LArgs[1], oCVal:value())
if (self.LArgs[3]) then
oC:p('_LALRT_GLOB_ENV["%s"] = %s;', self.LArgs[1], self.LArgs[1])
end
end
oC:sideeffectFreeExpressionValue()
oC:pV('%s', self.LArgs[1])
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_local_decl(bIsTail)
local oC = self:chunk()
if (self.LArgs[4]) then
local oCVal = self.LArgs[4]:gen(false)
if (oCVal:isReturning()) then return oCVal end
oC:append(oCVal)
oC:p('local %s; %s = %s;', self.LArgs[3], self.LArgs[3], oCVal:value())
else
oC:p("local %s;", self.LArgs[3])
end
if (self.LArgs[1]) then
oC:p('_LALRT_GLOB_ENV["%s"] = %s;', self.LArgs[3], self.LArgs[3])
end
oC:sideeffectFreeExpressionValue()
oC:pV('%s', self.LArgs[3])
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_assign_var(bIsTail)
local oCVal = self.LArgs[4]:gen(false)
if (oCVal:isReturning()) then return oCVal end
local oC = self:chunk()
oC:append(oCVal)
oC:p('%s = %s;', self.LArgs[3], oCVal:value())
if (self.LArgs[1]) then
oC:p('_LALRT_GLOB_ENV[%s] = %s;', self.LArgs[3], self.LArgs[3])
end
oC:sideeffectFreeExpressionValue()
oC:pV('%s', self.LArgs[3])
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_var(bIsTail)
return self:chunk(self.LArgs[1])
end
-----------------------------------------------------------------------------
function CodeNode:gen_function(bIsTail)
local LParams = self.LArgs[1]
local oCCode = self.LArgs[2]:gen()
assert(oCCode:isReturning())
local sVarArgParam
if (utl.is_table(LParams[#LParams])) then
sVarArgParam = LParams:pop()[1]
LParams:push('...')
end
local oC = self:chunk()
oC:sideeffectFreeExpressionValue()
oC:pV('(function (%s)', LParams:concat(', '))
if (sVarArgParam) then
oC:pV(' local %s = _lal_lua_base_table.pack(...); %s.n = nil;\n',
sVarArgParam, sVarArgParam)
end
oC:pV('\n%s', oCCode:chunk(1))
oC:pV('end)')
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_funcall(bIsTail)
local oRetC, LArgs = self:handleReturnedChunks(self.LArgs)
if (oRetC) then return oRetC end
local oC = self:chunk()
oC:statementValue()
local oCFunc = LArgs:shift();
oC:appendChunks(LArgs)
oC:pV('%s(%s)', oCFunc:value(), concatChunkValues(LArgs, ","))
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_scope(bIsTail)
local oC = self:chunk()
local oCCode = self.LArgs[1]:gen(bIsTail)
if (oCCode:isReturning()) then
oC:p('do')
oC:appendWithValue(oCCode, 1)
oC:p('end;')
else
local sOutTmp = oC:declTmpVar('s')
oC:p('do')
oC:append(oCCode, 1)
oC:p(' %s = %s;', sOutTmp, oCCode:value())
oC:p('end;')
oC:sideeffectFreeExpressionValue()
oC:pV('%s', sOutTmp)
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_return(bIsTail)
local oC = self.LArgs[1]:gen(true)
if (oC:isReturning()) then return oC end
oC:mergeValueAsReturn()
return oC
end
-----------------------------------------------------------------------------
local function emit_if(chunk, cond_node, true_node, false_node, all_branches_return)
chunk:append(cond_node)
local if_tmp
if (not all_branches_return) then
if_tmp = chunk:declTmpVar('if')
end
chunk:p('if %s then', cond_node:value())
if (true_node) then
chunk:append(true_node, 1)
if (not true_node:isReturning()) then
chunk:p(' %s = %s;', if_tmp, true_node:value())
end
end
if (false_node) then
chunk:p('else')
chunk:append(false_node, 1)
if (not false_node:isReturning()) then
chunk:p(' %s = %s;', if_tmp, false_node:value())
end
end
chunk:p('end;')
if (all_branches_return) then
chunk:valueFrom(true_node) -- just inherit "isReturning" status
else
chunk:sideeffectFreeExpressionValue()
chunk:pV('%s', if_tmp)
end
end
function CodeNode:gen_if(is_tail)
local cond_node, true_node, false_node
if (self.LArgs[1]) then cond_node = self.LArgs[1]:gen(false) end
if (self.LArgs[2]) then true_node = self.LArgs[2]:gen(is_tail) end
if (self.LArgs[3]) then false_node = self.LArgs[3]:gen(is_tail) end
if ((not cond_node) or (not true_node)) then
return self:chunk('nil')
end
if (cond_node:isReturning()) then
return cond_node;
end
-- Make if proper tail recursive, to force return of it's values:
if (is_tail and true_node) then true_node:mergeValueAsReturn() end
if (is_tail and false_node) then false_node:mergeValueAsReturn() end
local all_branches_return = true
if (not(true_node) or not true_node:isReturning()) then all_branches_return = false end
if (not(false_node) or not false_node:isReturning()) then all_branches_return = false end
local chunk = self:chunk()
emit_if(chunk, cond_node, true_node, false_node, all_branches_return)
return chunk
end
-----------------------------------------------------------------------------
function CodeNode:gen_or_and(bIsTail)
local oC = self:chunk()
local sType = self.LArgs[1]
local sRetVal = oC:declTmpVar(sType)
local LTerms = self.LArgs[2]
local LEndStack = List()
for i = 1, #LTerms do
local oTermNode = LTerms[i]
local bTermIsTail = bIsTail and i == #LTerms
local oTC = oTermNode:gen(bTermIsTail)
if (bTermIsTail and not oTC:isReturning()) then oTC:mergeValueAsReturn() end
oC:append(oTC, 1)
if (oTC:isReturning()) then
break
else
oC:p('%s = %s;', sRetVal, oTC:value())
if (i ~= #LTerms) then
if (sType == 'or') then
oC:p('if not %s then ', sRetVal)
else
oC:p('if %s then ', sRetVal)
end
LEndStack:push('end;')
end
end
end
oC:p('%s', LEndStack:concat(""))
oC:sideeffectFreeExpressionValue()
oC:pV('%s', sRetVal)
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_cond(bIsTail)
local oC = self:chunk()
local cls = self.LArgs[1]
local else_cl = self.LArgs[2]
local clauses = List()
for _, cl in ipairs(cls) do
local c_test = cl[1]:gen(false)
if (c_test:isReturning()) then
clauses:push { 'else', c_test }
break
else
if (cl[2]) then
local c_expr
if (cl[3]) then -- need function invocation!
c_expr = cl[2]:gen(false)
else
c_expr = cl[2]:gen(bIsTail)
end
clauses:push( { 'test', c_test, c_expr, cl[3] } )
else
clauses:push( { 'test', c_test } )
end
end
end
local has_else_clause = #clauses > 0 and clauses[#clauses][1] == 'else'
if (not has_else_clause) then
if (else_cl) then
clauses:push { 'else', else_cl:gen(bIsTail) }
else
local cnilret = CodeNode('nil'):gen(bIsTail)
clauses:push { 'else', cnilret }
end
end
local ret_val = oC:declTmpVar("cond")
local test_var = oC:declTmpVar("cond_t")
local open_if_count = 0
local all_return = true
-- TODO: when we ahve too many clauses, we should not output
-- nested if statements, but consecutive ones with a
-- flag that prevent further tests. But thats slower
-- of course. But maybe we should leave this to the
-- developer and code that in LAL directly if he needs.
clauses:foreach(function (c)
if (c[1] == 'test') then
oC:append(c[2])
local test_value_is_needed = not(c[3] and not c[4])
if (test_value_is_needed) then
oC:p('%s = %s;', test_var, c[2]:value())
oC:p('if (%s) then', test_var)
else
oC:p('if (%s) then', c[2]:value())
end
if (c[3]) then
oC:append(c[3], 1)
if (not c[3]:isReturning()) then
if (c[4]) then
local expr_val =
string.format("%s(%s)", c[3]:value(), test_var)
if (bIsTail) then
oC:p(' return %s;', expr_val)
else
all_return = false
oC:p(' %s = %s;', ret_val, expr_val)
end
else
all_return = false
oC:p(' %s = %s;', ret_val, c[3]:value())
end
end
else
-- return test value
oC:p(' %s = %s;', ret_val, test_var)
end
oC:p('else');
open_if_count = open_if_count + 1
else -- else branch
-- TODO: optimize away the last unneccessary else-branch if we
-- don't have an else branch and are returning anyways!
-- This is important, as we need to call everything in proper
-- tail context!
oC:append(c[2], 1)
if (not c[2]:isReturning()) then
all_return = false
oC:p(' %s = %s;', ret_val, c[2]:value())
end
for i = 1, open_if_count do
oC:p('end;')
end
end
end)
oC:sideeffectFreeExpressionValue()
oC:pV('%s', ret_val)
if (all_return) then
oC:mergeUnusedValue()
oC.bIsReturning = true
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_methcall(bIsTail)
local sCallType = self.LArgs:shift()
local sFieldName = utl.strip_kw(self.LArgs:shift())
local oRetC, LArgs = self:handleReturnedChunks(self.LArgs[1])
if (oRetC) then return oRetC end
local oC = self:chunk()
oC:appendChunks(LArgs)
local oCInst = LArgs:shift()
oC:statementValue()
if (string.match(sFieldName, "[^A-Za-z0-9_]")) then
sFieldName = string.format("['%s']", sFieldName)
if (sCallType == ':') then
local sInstVar = oC:declTmpVar("inst", oCInst:value())
if (#LArgs > 0) then
oC:pV('(%s)%s(%s,%s)', sInstVar, sFieldName, sInstVar, concatChunkValues(LArgs, ","))
else
oC:pV('(%s)%s(%s)', sInstVar, sFieldName, sInstVar)
end
else
oC:pV('((%s)%s)(%s)', oCInst:value(), sFieldName, concatChunkValues(LArgs, ","))
end
else
if (sCallType == ':') then
oC:pV('(%s):%s(%s)', oCInst:value(), sFieldName, concatChunkValues(LArgs, ","))
else
oC:pV('(%s).%s(%s)', oCInst:value(), sFieldName, concatChunkValues(LArgs, ","))
end
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_methcall_runtime(bIsTail)
local sCallType = utl.strip_sym(self.LArgs:shift())
local oRetC, LArgs = self:handleReturnedChunks(self.LArgs[1])
if (oRetC) then return oRetC end
local oC = self:chunk()
oC:appendChunks(LArgs)
local oCFName = LArgs:shift()
local oCInst = LArgs:shift()
local sTVFName = oC:declTmpVar('fname', oCFName:value())
local sTVInst = oC:declTmpVar('inst', oCInst:value())
oC:expressionValue()
if (sCallType == ':') then
oC:pV("((%s)[strip_sym(%s)](%s, %s))", sTVInst, sTVFName, sTVInst, concatChunkValues(LArgs, ","))
else
oC:pV("((%s)[strip_sym(%s)](%s))", sTVInst, sTVFName, concatChunkValues(LArgs, ","))
end
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_do_loop(bIsTail)
local oTestC = self.LArgs[1]:gen(false)
if (oTestC:isReturning()) then return oTestC end
local oResExprC = self.LArgs[2]:gen(bIsTail)
local oBlockC = self.LArgs[3]:gen(false)
local oC = self:chunk()
oC:append(oTestC)
oC:p('while not(%s) do', oTestC:value())
oBlockC:mergeUnusedValue()
oC:append(oBlockC, 1)
oC:p('end;')
oC:appendWithValue(oResExprC)
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_jump_block(bIsTail)
local sLabel = self.LArgs[1]
local oBlockC = self.LArgs[2]:gen(bIsTail)
local oC = self:chunk()
oC:p('local %s_val;', sLabel)
if (oBlockC:isReturning()) then
oBlockC:mergeUnusedValue()
oC:append(oBlockC)
else
oC:append(oBlockC)
oC:p('%s_val = %s;', sLabel, oBlockC:value())
end
oC:p('::%s::', sLabel)
oC:sideeffectFreeExpressionValue()
oC:pV('%s_val', sLabel)
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_return_from(bIsTail)
local sLabel = self.LArgs[1]
local oC = self:chunk()
local oCVal = self.LArgs[2]:gen(false)
oC:append(oCVal)
oC:p('%s_val = %s;', sLabel, oCVal:value())
oC:p('goto %s;', sLabel)
oC:sideeffectFreeExpressionValue()
oC:pV('nil')
oC.bIsReturning = true;
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_load_lua_libs(bIsTail)
local mLibs = self.LArgs[1]
local mBltins = self.LArgs[2]
local oC = self:chunk()
local oCVal = self.LArgs[3]:gen(bIsTail)
for k, v in pairs(mLibs) do
local sReq = oC:declTmpVar('req', "_lal_lua_base_require '" .. k .. "'")
for lal_name, lua_name in pairs(v) do
oC:p('local %s = %s[%s];',
lua_name, sReq, utl.quote_lua_string(lal_name))
end
end
local sUtlV
for lal_name, bltin in pairs(mBltins) do
oC:p("local %s = %s;", lal_name, bltin.name)
end
oC:appendWithValue(oCVal)
return oC
end
-----------------------------------------------------------------------------
function CodeNode:gen_display_compile_output(bIsTail)
local out_chunk = self.LArgs[2]:gen(bIsTail)
out_chunk:print_debug_output(self.LArgs[1])
return out_chunk
end
-----------------------------------------------------------------------------
return CodeNode
|
--[[
AztupBrew(Fork of IronBrew2): obfuscation; Version 2.7.2
]]
return(function(SonaBona_h,SonaBona_a,SonaBona_q)local SonaBona_k=string.char;local SonaBona_e=string.sub;local SonaBona_n=table.concat;local SonaBona_o=math.ldexp;local SonaBona_r=getfenv or function()return _ENV end;local SonaBona_m=select;local SonaBona_g=unpack or table.unpack;local SonaBona_i=tonumber;local function SonaBona_l(SonaBona_h)local SonaBona_b,SonaBona_c,SonaBona_g="","",{}local SonaBona_f=256;local SonaBona_d={}for SonaBona_a=0,SonaBona_f-1 do SonaBona_d[SonaBona_a]=SonaBona_k(SonaBona_a)end;local SonaBona_a=1;local function SonaBona_j()local SonaBona_b=SonaBona_i(SonaBona_e(SonaBona_h,SonaBona_a,SonaBona_a),36)SonaBona_a=SonaBona_a+1;local SonaBona_c=SonaBona_i(SonaBona_e(SonaBona_h,SonaBona_a,SonaBona_a+SonaBona_b-1),36)SonaBona_a=SonaBona_a+SonaBona_b;return SonaBona_c end;SonaBona_b=SonaBona_k(SonaBona_j())SonaBona_g[1]=SonaBona_b;while SonaBona_a<#SonaBona_h do local SonaBona_a=SonaBona_j()if SonaBona_d[SonaBona_a]then SonaBona_c=SonaBona_d[SonaBona_a]else SonaBona_c=SonaBona_b..SonaBona_e(SonaBona_b,1,1)end;SonaBona_d[SonaBona_f]=SonaBona_b..SonaBona_e(SonaBona_c,1,1)SonaBona_g[#SonaBona_g+1],SonaBona_b,SonaBona_f=SonaBona_c,SonaBona_c,SonaBona_f+1 end;return table.concat(SonaBona_g)end;local SonaBona_i=SonaBona_l('21F2142752141Y27621W21Z22122422J22K22I21T21Y22721421827622722121X22521421B27622O22K22K22G23322522K21422O27621S27V22G22J1I171722I22122N1622721T22K21S22L22222L22J22522I22321Z21Y22K22528R1628P21X1722428C21T2241522J22327G22G22K22J1723H22P1522S21T22229921X22127H1722621W22L22821W29F1622K22828021A27623J27H22421Z22N2141W27623F28Q22122Y2A721421C27622Y22L21T21W2241822X182A922K1823221Z22I1823G22I22522122J22L2AU21429W27522Z21Z27A22I1R27R27622622I21Z21X23E23322Y21527627525K21Z22W2BH2BI24O2372BM2BI27522O22W27K27623121Y22L21X2B827522R2252292B322427Q1Z27622S22522622K2B328R2BB21W21421727623G22122221421127622T29J21Y2AO2AV22K2AY22522J214122832852881722N2D8162BB22227A22828V2BC172AW28M22K171N2911L1U1O1Q1R1S1Q1U1H1P1T2B02AD22L27V28Q21421327622P21Y22627H28G2252AL27A22321V2D11K2CM21S21T22J1822622L21Y22322K21T28Q1829I2291821Y21Z2AN22N2AQ21V1822J2BC27Z21T27P2EM22121Y2AI22921Z22L182232FC1822727Z182222FC21Y225224162C221423221W2EX10234112CQ28328N21Z2FL2G622222I2GA22I2A327622X2E121Z22622122I2C121D2762212GG2FI2BC22G21W27Z2D0182AY1821U21Z2221827A2CJ2CR27523F22K21Z22G2AJ2GG2GI2GK21421I2A521S2FG2AH1822K22121V2EC2F627P2HL2F92EC2H82F52H822G192BW27521L2BI21927622G29J22I2D127L27527N27P27727627Y22K23F28N22M21T22327Q27S27523C21W22122928N2D12CA27522S21Z2FJ21W2IQ2IS28N2141X2762J22IT22I2332AF2GD2752AE2AG2242JB21T2142122E621Y22M28T2H822I22923228B2ID2JL2H62952B429Q27I2JT27O2C92AD2EE2EG2K22ID2IW2142IG22Z2EK2AH2AU21Y2JK27623229Z2KK2I82CF2KE2242IE27522X21X2FG28R23G22529U2I02142KX29U2BN2761G24N2BV2IO2142KD2FC2FM2KQ2L92CG2FR2ER2142L42CL2762782KS2KU2EP22K2L22802IA2L12KY22K2L42752L62BV2BI2LU2J52BS275182FU2BI2BH1O2162762MC2LL2HG2752L42LU2LN2KR2ML2KA1827621M1P2762L421M2MH2142MC2M62MV2BH2CL2MU2CK2L02MS2N32MC2MO2LJ2N92I42N82BH2BH29W2NC2N927S2NG2BH2A42NJ2M42NM2782NM2KA2N92MX2M52752MC2M321H2N91821N2142I427L21021421M2BH27S2H52752JJ2I427S2MC21A22V2O221421G2N92752182302762OK2BH2M72OI27L2CR2MB2OI2JL2E52OS2O32G32P02OI21K2142O02OI2I42I221A2352FV2ND2752M12N42EI2OD2OL2372N32BI21A2G22752E52BH2NW2OO2PQ2OL2MG2OL2P62762B12DZ2752Q12Q42Q02Q62Q32Q72Q22QA2Q52Q82QD2FV2L92QG2762L92A42752QK2M42752J62QO2762KA2KA2QP2142O52QE2QW2KI2752OK2762LU2IC2IN2J72IR2J92IV2CB2IZ2212J12R72J42QM2IG22T2FG28M2142KA2EE2RC2GS2J32GC2QU2F222I2EG2I62IM2QZ2FW2KL21T2KN2KD2JG2L02B32AZ2L92302D027F21Z2292JD2142E727E2FC2RX2LL2142FR2A22LU23C2GJ2LT27622U2K32L023F21T22A2R527523I2252ER2AQ1R21524Y24X2T82T823L1N2OI27522J2I622N2KH2QY23J29J22K2AP22I2S32AH2QA29M22927H2272LY27522P2BV2L42212MX2L42KQ2L42A22L42D12L92C42292302A12KH2L928P21Y2LH2802I42C32C523H22G2L02OA2QA2SP2KG2802RS2F32TF2212RX2QM2SG2HM2EQ27Q2SK2SM2L023J2252TQ2UK2142US22K1O2TD2VC2SQ2MR2RM2RB21W2RP2J92QN2LA21S2GJ2UY28S2GC2MK2IY22N28N23G2AQ2F62MW27622Z2VF2Q122Z2K82252TW2NU21421Q2BI2232NU2N22PS2762P52N52BH2N22752SK2N82M22O62MV2VB2MD2WC2NV2W32N52BI2WL2Q82WN2MV2QM2NM2J62NO2142X22B82X42N92QY2NM27L2N22MC2OA2N22CL2XK2OM2G32BS2BH27L2MC2XB2CA2WB2L42WE2752PX2Y027621J2Y22Y42752Y32Y62762WR2WR2HZ2752YC2142YE2YE1A2762YI2752YK2142YM2YO2YJ2761B2761F2BI2V021Y2SH2V32PM2SL2252A22QY2A922422923C21Z22J28G2ET2KH2QM2Z52292332292BB2L02ST2ID2L923123C22P23423C22V23F2SE29I2282TN2RX2L92T12T32B62L029I28H2L028I2FM2SE22G2Z92ZB2E32QM2Z82ZA2ES2E32QU2ZW2W022I22H22L2WA27626W24G26J21422Y2QA2232BA2SU2W72W92L022N2TL2RL2792VL2VN2J42QU2LB28B2ER2RF27T2C02FC21Z2912XP2VC2IR22K2262AQ21X2H72FC2242162PE2752UO2U52PY2D12U02PY2242WB2TY2VP2RT2RV2UY27Q2OA22Z2AY2UT22Z2K328B2E42W421Z2AQ22427H22128S31122MK27A21Z21V31012JQ2WB2MV2BS1C2BV2Q122X27I2GT2D12SK28B2KQ2Q12TS2TU2MX2S82SA2BB2SD2BI26N2MP23I2X02PZ2BS2MC2WI2Z02WW2WX2MC313Q2MZ2Y9313X313W2W32M32WP2WC2N02W32VF2762I429W2XI2SE2N8313V2W32XL2VP2N82CL2CL2782N227L2QU2N827L27L314L2752I4314O314T2OI2MK2W32I42XT2BI2OE2BI2NT2MY2W32MC2O52XU314F2WY2X62WY314E314G2JW2WT2BW315H2N22I4315H2WW31502XA2MV2CR31553155313O314E2P52WL2BH2E5313Q21E2W32I22BX2W32PE314B2WO314D2W32O1316A2MC21O21431472MC21P2WD315V2N92OZ3143315Z313O314J21421R31542W32CL314I2QR316U2ME2BI2CL2L4316X2CL2AC2B12CL22X2N92XR2PU21431792BN2J631722Y92FU316R2GM2OG2N31V2PY2ON276317O317B2GE2OL317G2PY2OS316R316221A2OK3178317A27K317C317E2QQ317H2M6317J2N327431812N33187317T2KS2N92O72N32R127523D2N62BI317W3173318B31752B02OH2CL2OH2MI317C318Y2O631622CL2NY2M62YU316R2HG31742142Y3319A2WR2BW315U2N32CL2M3314E2SK318P3156316R2YE319M3188317X318T214317L318W214239317P317C319Y2WN319321431952P6316T3198316Q2N3319C3143316W2WS319G316R319J316V31712WZ31A92CL319P2CL3155318R317I319H214318D319W21V319Z27631AW31A22N32X2182JL316R31552XS2MP314W2YE2N229W319P314329W315T31AI27631AO313Y31AS31AN31AK2M431892P6319T31803182214311Y2N9317Q311X31BW317C22B318J31A331B21E31AS31B631BN2XO2LU315L2YF31B82DZ31BD2N331BF316Z313S31BJ319N2N331BM31AP319Q21222H2YN21422F2N9319I317C31CU318H21424P318J3145318M214318O31CK31BQ318P316T21K221316Y2LL31AQ318A31AS317631BT24G318431BX21431DK31CZ24X31C22N331A51822S31AS319931AC319B315I27L31B231C92142YS31CB314V2P82141C2PN31AK2N829W31BC2I3315731EG2VB31BB31CC2752N227S31CF27L315331BI2N331E12MV2E5319I2BI249317V2N3318S31AS319V2N323P31AX27531F631B031942Y921S31DW31AL31DZ314M315Q3156314Q31E4315I314U31BK2I42I431EA2Q62NT31ED31CE31EG315F2Q831BA27531EO2M531EQ31BN31AG31FI316P31EX27631EZ31FA31A431AR31A8317Y31AA2XA31DC31G731922N31D2761E1U2N324D2N931C531DM31GR31CZ2YI2NE2OQ21424031DL317C31H131CZ2422NZ2O12MC2BH2YU316K314E2NE2OH27524631F721431HH2OR31H82YT2752WE31HD31G031C821M315P31GM31EM2WY3169315E214316C31HZ316F316H214316J31C5314B31D431HZ2NU2L4313K2752M821431IF31IH27631IF1727631IL27531IN21431IP31IP31472142MR27531IV31IU27631IX31J031IZ31J231IW31J32141Q27631J727531J92142B727531JD31JC27631JF31JI31JH2761S31JL31JN27531GP31JP317R31JS275317O31JU2L531JX2LZ31JY2141G31K01H27631K427531K621431K831KA31K52NU31KB31K731KC31KF31KH31K931KG31KJ2751I27631KN2752EI31KQ27631KR21431KU1L27631KX27531KZ21431L131L331KY2761M31L631L82PF2762PG31LC317U318I31LF317D31LE31LH31LG310W2JE2AD276317C31LP31LO316527523131LS21431LU31LT31LV31LX2FW2KJ31M22BT27T31M52M52822TX2E631MA31M931MC2SF31MB31ME27522Q27631MI31MH2CB31MM2M531DV27522T2CS27631HF21431MU23C2J731MY2M531MX318N276318O31N231N531D531N331N831N631N431N731NA31N931NC31NF31NB31NB23E27631NJ27531NL21431NN2ZU2H62A531NS31NR31NU21431NQ31NW31NT31NY31NV31NX31O231NZ31NX23H27631O627531O821431OA23J29X2NU31OD2752342NU31OI31OH27631OK2142PC27531OP31OO27631OR23627631OV2752PL31OY27631OZ21431P223827631P5275319Y2QQ2Q92US2JP2TR2FY2TU2ML312N29428Q2UI2PY22N311V31202PY31GI2762U42762282LY31JQ2QQ2TW317M2NK31HI2A4317F2PY31DG2PE31HE2N931Q32R2317C31QA31DM2I22BN27S2TW21M2Y32WJ2XQ317X313X319L2WJ2LY31QL313O2PE31QP31662M52L431GO276316F2XR318531R031BZ276316T31Q431452752OW31R22O3317C2DY2BH31QZ27531622NE31R331RI31R52752NY31R82Z031RB2DZ31RD27631RF2141E31FR31CS2O831RL31S031PY31RR31H92B831RU27531RW31RH21431GM31Q131DM31SD31S21031F031R9316G31S62A431S821431SA31RZ31RW2J631DM31RW21M31RJ31AK31QZ2BH2FU2BH31SO31T131S22MR31QG31Q52O62CJ31QS31SU2OL31QH2PY21M31TA31BN2J631R231NK31842BN2PX2L431PX23B27631TR27531TT21431TV31TX2NU31TY31TU31TS31U231U131U431TW31U331U62752202NU31UA27531DC31UD2GN2762CP2M531UI2142WG27531UM31UL31PS31UQ27527Q31US27631UT2142262NU31UY2IB27M31V227531FD31V42762JJ2OB2NU31V821421U27631VD27531VF2142CJ27531VJ2142C127531VN31BU31482M927631PN312Z214312131UG2U32LY316J27531RY31VR2PE31DM2I431RQ2BI31RS2WJ31DM31R131RX31RZ278314531DM31WG31S431W931S631BJ31WC31GS31PX2CR31R231DM31WR31S22P531W827631RS31B731WO31RG31RZ31WD31SO31WD2M42TW31RS315P2HF313N31W12142GC27531XF31VW2762D12TE27628027531XN21422L27631XR27531XT21422M2NU31XX2752A231Y031VT31PU31Y4275313I21431Y731C12752322MP2YS31VV319E2WY31YG2N32NG2XO2N531FX31VR31HW2W32Q1316D2B831FH2QM2WW31B72B13151318Z2WK31DR2OF31AR314E2NL31HM2MC2QP31HP31QW31SW2W32MK2FL31EH2CA314G2QY2WW314E31I42CR2A4314G2E531CL2CL31ZH2XO2X231CB31ZV2Q82XB31BE2W32WL2MC31B4315I2CL31642B02PC2LU311W2PG3155310W31BJ2XD2CL31YR31DY2MU31CB31YV314331W732052QA319A31YV27L2MT2XO2O131YP27L316F2BS2VB27L31472I4316J2WE3213316S316K32172AC3216314W2GM2XY2Q82L92PB2GD31QU31LA314331LB31YO321L2L02OS31TJ21431622P72J62J6318D2PC2CA31S62UK2PG319L2PG2Q12142PG2L93227321O322A2QL2BI2JJ2J63220275313A314H2FU321S2OK321V2M4321Y3116317H2BN2PG2WV2A4322G31BN27S2QU2762J6320M31X731T82PY31YC2752X2323927632073207320W31I527631XD323H323G323J31HO276321F323N2762GM275323Q319U323P2763162275274323X276323Y31AT32403243323Z31RO2YR3247324627531HV31SC276324B324B31HB214324G31SI275324J2142PP2D22762D3275324Q324O324R2761327631P9319X324X325027523A276325331BY325631VQ32572UO32573255325821431CR275325F21431YA325I276325H325J22C276325O27522D2762AC313T31TW2332L02AE22J22931PO2VB2UX2TH31132TL2WB2601N2WB3131312Y2BV2R32SU2L92J82IU31162IX2VL326I2RR2W42VR311D2VU31FI281311H2EZ29123E312L22K2VD2QA2W82JU27Q2MK2IG2II22I2IK2RX2QU23J2UW2RW32752AD27B2IH2HM2FM2D12QY22U311Q2RC311S327L2VP312G2JO327R27Q2QY2302GJ21V2FR22J22J3271315H2KK2FD2KM27E2TP2KQ2UV2RU2UX2RX31XD22Z2IR2F923E21T2JO22I23E2D022L21W2982332B42KQ2MK2KM2253278328N2PY315N2NT23B325X2LU325Z2SD326F2ID327627Z32902IL327G31NM2EP329E2RX2OA328P2FD28N2H722522G22G2FS326628G2FV326N2R9326L2J0326N327T326Q2VT2J432862S02S22KP2SE22O326V311J2KQ2KA2LB27I328Z2HM28S326B2PG2XZ2MP323W319S313P318V27631RP31QB32AT31DR321M2P631TV2XO314B2WV31CI31YI2NF2M532292WY2XD32AY31YI2NL2M52X82M52NP2M531ZT2W331ZJ31CI322631VV31DM2MV31ZC32BB31OG27632BD2BS32BF2BS32BH2BS2O531YI2CR314B315N316U31TK31VS31XB31VV2PX24Q27632CC27532CE21432CG32CI32CD32CK32CF32CL32CH27624R32CP32CR27532CQ32CT32CS21432CU32CX32CW24S27632D127532D321432D532D732D232D927524T27624V27631PX32BR2PY2OW2WY2N132AP2LU21631KX2WB321F31S632DH31F2316U317M31S931HI31SV32AP2WV31NX316731EB31YP31S131YP31Z331YL324A31DR27L31EJ2KH2I4323331B72XD314N31BK31FK32BZ31FK2CA314P2BW32C131E332C3314W31E731FP312J31EN326T31VR31532N832EW2I232F22OI320K2Q8323E2QI313S2Q829W322932EW32B631E8316F32F5315M31FI27L2JL2O331M8312J31B0314W276152WM315I31PA313O2BI32BZ2BI32EO2M532ER2BS316J314B2UQ32BM2BI31SG2OM317C31SG32DH321F2OS2BI316T2P72BI325U32DR31RN2OI31TN313N31PX31CU27532GT31D032DD27631D127524H27632H132H032H232H532H427524I27632H932H832HA32HD32HC32HF21424J27632HI27532HK32HH32HJ32HO32HL32HP32HN32HQ32HT32HS32HV32HM32HX32HR32HM32HB21424L27632I327532I532I232I432I932I632IA32I832IB32IE21424M27632IH27532IJ32IG32II27625432AW31IJ31P12A621Y2A82A71I2AS2EK2EM22J2HI328R2AI2HM2HO2F52F72HS2HR2HV27E2H9318B2KS21W2CJ329A329G2KB329D2IJ329F2143207328P2GS2IL312P2FS2H72AQ221310932412S92GI328R2KO312P23F22927E22521X2LB22K2312JO28R2D1320723F2IS22T2D022J32JX225328P310O2SA2ML328Y32902J4329432962E032602MX32632TG2KH2LU311428G3268326A2M5326C2NU2L82R62RQ329Y2142IY32A02RE326O2B232A3311E2GC2X232AB29I326W224326Y2F03271311132742VP327D328E327F2ML2A932K4327K2D02QV2SS327P21W327W2D1311B221327V32M532M7275327Z2RU328232842SQ2RY328722432892KO2S4328D3129328G2W4328J2BD328M28N328P2AX328S22J328U2TQ2L4329331TS32KW2JE28L329927M2SU329C2IH32JM2RX2MK23E329I32NJ312B31NK28T2C822I329P329R329T32L33115326H32LI32LE32LG2RC32A1311B32LL326S32A632882S1328A32A92QM32LP311I311K32AF2VR32AH311S32AK32L832AM31DZ31EM32AP32DU2WW318E314W31W5317C320O31DM2HG32FR2Z01832B02BW32B22WC314E32B532FY32FA32AR32BA32P12M532BV318Q32P927532G0316Y314B32BL31ZK2QA313N32BP32AX32P132BT322D31YI32BX32FZ32PH32M732C2315I320332P631BW31QX32AN31VV2Y721424Z27632QA27532QC2BS32QE32QG32QB32QI32QD32QJ32Q927625032QN32QP27532QO32QR32QQ21432QS32QV32QU25127632QZ27532R121432R332R532R032R727525227623S2W42MP31KP31TF2MV2NT314B2WQ31HZ2XH2XO32B331412W331YS32FG314E2NI31432MC31YV32RO2X32M5320H318J31432QU3147314K311631ZI2MD31KX3142316K320F31GK2CL314O319T278317M2CL310W31Z031LM31GB2UQ2ZU322S320P315K2XO31ZQ31FM2RY2IA2CL31T631GK2O92MP2ZD32EZ31HR32DS31HR32RK2B827S32F431HR27S2MU2N827S27S31I132TA214316F2N22A432T92A42A432RM2IE321F32BU2IE2N7322D2A432GJ32TY2AB315I2J6323S2LM32PO2QQ2J6314Y32TQ2NN32U1321U32U1316J2WL27S316J32TR2822CL27432SO2BI317932SR314G32T9316R32TC31AS32TF31DY32TJ316R27431CB320Z31AJ315P317731L231H231L531CZ32T031ZC2CL318M31GF31FB2P7316R2QK2WE32SD31QE2PW313N22Z27625727625827625932VU32VW27532VV32VY32VX21425A27632W327532W532W227624W32W927624Y32RB32WC27623U32WG32WI27532WH32WK32WJ21423V27632WP27532WR32WO32WQ32WV32WS27623W32WY32X027532WZ32X232X121432X332X632X532X732XA32X932XC32X432XE32WU27523Y27632XI32XH32XJ32XM32XL32XO21432XK32XQ32XN2BS32XR23Z27632XW27532XY21432Y032Y023L32FT2MP31JV32RG2NS31BK321K314G32SB31SK2NU319G2WJ31YK32F63200320X2FV31ZC32EF2Y9319Y32EW2J631EK2MK32EY2KA32TN32MH31EG2A4314029W2OA31FU29W2JL32Z4312J2N531CH316A2BH2P5318K27L320721M32EC32FW315O32RQ32RV31I032SW32V331EK31XD32DO2FV31KT2N331TE32VH316B2O631T2316K31EM31RK316T2NV31KX31TE32ZU2CL32ZW2O131BJ2O1318K2I4325U32ZZ2DZ323S32ZS31ER31KS330931H7318P330D330032AP318K29W3241330K313S2EI330N32GQ31VV32FU31VV2L43314313N331532AY2SK331931ES3318331B2Z0331A331C32E92LU331I321O2VB2VB315H2VB32SV331P276325S2PV27522E276331V331U32IO331W2762553321332327532Y427533223325276');local SonaBona_a=(bit or bit32);local SonaBona_d=SonaBona_a and SonaBona_a.bxor or function(SonaBona_a,SonaBona_b)local SonaBona_c,SonaBona_d,SonaBona_e=1,0,10 while SonaBona_a>0 and SonaBona_b>0 do local SonaBona_f,SonaBona_e=SonaBona_a%2,SonaBona_b%2 if SonaBona_f~=SonaBona_e then SonaBona_d=SonaBona_d+SonaBona_c end SonaBona_a,SonaBona_b,SonaBona_c=(SonaBona_a-SonaBona_f)/2,(SonaBona_b-SonaBona_e)/2,SonaBona_c*2 end if SonaBona_a<SonaBona_b then SonaBona_a=SonaBona_b end while SonaBona_a>0 do local SonaBona_b=SonaBona_a%2 if SonaBona_b>0 then SonaBona_d=SonaBona_d+SonaBona_c end SonaBona_a,SonaBona_c=(SonaBona_a-SonaBona_b)/2,SonaBona_c*2 end return SonaBona_d end local function SonaBona_c(SonaBona_b,SonaBona_a,SonaBona_c)if SonaBona_c then local SonaBona_a=(SonaBona_b/2^(SonaBona_a-1))%2^((SonaBona_c-1)-(SonaBona_a-1)+1);return SonaBona_a-SonaBona_a%1;else local SonaBona_a=2^(SonaBona_a-1);return(SonaBona_b%(SonaBona_a+SonaBona_a)>=SonaBona_a)and 1 or 0;end;end;local SonaBona_a=1;local function SonaBona_b()local SonaBona_c,SonaBona_e,SonaBona_b,SonaBona_f=SonaBona_h(SonaBona_i,SonaBona_a,SonaBona_a+3);SonaBona_c=SonaBona_d(SonaBona_c,40)SonaBona_e=SonaBona_d(SonaBona_e,40)SonaBona_b=SonaBona_d(SonaBona_b,40)SonaBona_f=SonaBona_d(SonaBona_f,40)SonaBona_a=SonaBona_a+4;return(SonaBona_f*16777216)+(SonaBona_b*65536)+(SonaBona_e*256)+SonaBona_c;end;local function SonaBona_j()local SonaBona_b=SonaBona_d(SonaBona_h(SonaBona_i,SonaBona_a,SonaBona_a),40);SonaBona_a=SonaBona_a+1;return SonaBona_b;end;local function SonaBona_f()local SonaBona_c,SonaBona_b=SonaBona_h(SonaBona_i,SonaBona_a,SonaBona_a+2);SonaBona_c=SonaBona_d(SonaBona_c,40)SonaBona_b=SonaBona_d(SonaBona_b,40)SonaBona_a=SonaBona_a+2;return(SonaBona_b*256)+SonaBona_c;end;local function SonaBona_p()local SonaBona_d=SonaBona_b();local SonaBona_a=SonaBona_b();local SonaBona_e=1;local SonaBona_d=(SonaBona_c(SonaBona_a,1,20)*(2^32))+SonaBona_d;local SonaBona_b=SonaBona_c(SonaBona_a,21,31);local SonaBona_a=((-1)^SonaBona_c(SonaBona_a,32));if(SonaBona_b==0)then if(SonaBona_d==0)then return SonaBona_a*0;else SonaBona_b=1;SonaBona_e=0;end;elseif(SonaBona_b==2047)then return(SonaBona_d==0)and(SonaBona_a*(1/0))or(SonaBona_a*(0/0));end;return SonaBona_o(SonaBona_a,SonaBona_b-1023)*(SonaBona_e+(SonaBona_d/(2^52)));end;local SonaBona_l=SonaBona_b;local function SonaBona_o(SonaBona_b)local SonaBona_c;if(not SonaBona_b)then SonaBona_b=SonaBona_l();if(SonaBona_b==0)then return'';end;end;SonaBona_c=SonaBona_e(SonaBona_i,SonaBona_a,SonaBona_a+SonaBona_b-1);SonaBona_a=SonaBona_a+SonaBona_b;local SonaBona_b={}for SonaBona_a=1,#SonaBona_c do SonaBona_b[SonaBona_a]=SonaBona_k(SonaBona_d(SonaBona_h(SonaBona_e(SonaBona_c,SonaBona_a,SonaBona_a)),40))end return SonaBona_n(SonaBona_b);end;local SonaBona_a=SonaBona_b;local function SonaBona_n(...)return{...},SonaBona_m('#',...)end local function SonaBona_i()local SonaBona_k={};local SonaBona_d={};local SonaBona_l={};local SonaBona_h={[#{{170;888;486;995};"1 + 1 = 111";}]=SonaBona_d,[#{"1 + 1 = 111";"1 + 1 = 111";{575;925;129;846};}]=nil,[#{{506;327;159;992};{482;525;388;571};"1 + 1 = 111";"1 + 1 = 111";}]=SonaBona_l,[#{{383;776;769;300};}]=SonaBona_k,};local SonaBona_a=SonaBona_b()local SonaBona_e={}for SonaBona_c=1,SonaBona_a do local SonaBona_b=SonaBona_j();local SonaBona_a;if(SonaBona_b==2)then SonaBona_a=(SonaBona_j()~=0);elseif(SonaBona_b==1)then SonaBona_a=SonaBona_p();elseif(SonaBona_b==0)then SonaBona_a=SonaBona_o();end;SonaBona_e[SonaBona_c]=SonaBona_a;end;SonaBona_h[3]=SonaBona_j();for SonaBona_a=1,SonaBona_b()do SonaBona_d[SonaBona_a-1]=SonaBona_i();end;for SonaBona_h=1,SonaBona_b()do local SonaBona_a=SonaBona_j();if(SonaBona_c(SonaBona_a,1,1)==0)then local SonaBona_d=SonaBona_c(SonaBona_a,2,3);local SonaBona_g=SonaBona_c(SonaBona_a,4,6);local SonaBona_a={SonaBona_f(),SonaBona_f(),nil,nil};if(SonaBona_d==0)then SonaBona_a[#("PZh")]=SonaBona_f();SonaBona_a[#("9MnI")]=SonaBona_f();elseif(SonaBona_d==1)then SonaBona_a[#("WeV")]=SonaBona_b();elseif(SonaBona_d==2)then SonaBona_a[#("Sjt")]=SonaBona_b()-(2^16)elseif(SonaBona_d==3)then SonaBona_a[#{"1 + 1 = 111";{302;349;381;515};"1 + 1 = 111";}]=SonaBona_b()-(2^16)SonaBona_a[#("nYOW")]=SonaBona_f();end;if(SonaBona_c(SonaBona_g,1,1)==1)then SonaBona_a[#("al")]=SonaBona_e[SonaBona_a[#("4X")]]end if(SonaBona_c(SonaBona_g,2,2)==1)then SonaBona_a[#("pIa")]=SonaBona_e[SonaBona_a[#("1eO")]]end if(SonaBona_c(SonaBona_g,3,3)==1)then SonaBona_a[#("RdSy")]=SonaBona_e[SonaBona_a[#("JoSL")]]end SonaBona_k[SonaBona_h]=SonaBona_a;end end;for SonaBona_a=1,SonaBona_b()do SonaBona_l[SonaBona_a]=SonaBona_b();end;return SonaBona_h;end;local SonaBona_s=pcall local function SonaBona_l(SonaBona_k,SonaBona_h,SonaBona_f)SonaBona_k=(SonaBona_k==true and SonaBona_i())or SonaBona_k;return(function(...)local SonaBona_b=1;local SonaBona_i=-1;local SonaBona_p={...};local SonaBona_o=SonaBona_m('#',...)-1;local SonaBona_d=SonaBona_k[#{"1 + 1 = 111";}];local SonaBona_e=SonaBona_k[#{{581;41;350;660};{946;30;366;818};{840;103;966;255};}];local SonaBona_m=SonaBona_k[#{"1 + 1 = 111";"1 + 1 = 111";}];local function SonaBona_r()local SonaBona_k=SonaBona_n local SonaBona_n={};local SonaBona_j={};local SonaBona_c={};for SonaBona_a=0,SonaBona_o do if(SonaBona_a>=SonaBona_e)then SonaBona_n[SonaBona_a-SonaBona_e]=SonaBona_p[SonaBona_a+1];else SonaBona_c[SonaBona_a]=SonaBona_p[SonaBona_a+1];end;end;local SonaBona_a=SonaBona_o-SonaBona_e+1 local SonaBona_a;local SonaBona_e;while true do SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("M")];if SonaBona_e<=#("F1LsBnjAOpeq3K7U9GaWMNMckMby6R3zzCX1BlIgvO4OpjVSjDVYzk62pI")then if SonaBona_e<=#("ZmVE7xQ1CXgsY83A8S7Xb0tnD5e9")then if SonaBona_e<=#("G4M3dT4Kj7rKr")then if SonaBona_e<=#("4dj60F")then if SonaBona_e<=#("7j")then if SonaBona_e<=#("")then SonaBona_c[SonaBona_a[#("m5")]]=SonaBona_c[SonaBona_a[#("18M")]]+SonaBona_a[#("F5tB")];elseif SonaBona_e==#("g")then SonaBona_c[SonaBona_a[#("Pn")]]=SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{3;853;746;582};}];else SonaBona_c[SonaBona_a[#("HN")]][SonaBona_a[#("Gsz")]]=SonaBona_a[#("QzIl")];end;elseif SonaBona_e<=#("2Hab")then if SonaBona_e==#("QN5")then local SonaBona_f;local SonaBona_e;SonaBona_c[SonaBona_a[#("p6")]]=SonaBona_c[SonaBona_a[#("JCY")]][SonaBona_a[#("4GTE")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ST")]]=SonaBona_c[SonaBona_a[#("8kV")]][SonaBona_a[#("2YPO")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ip")]]=SonaBona_c[SonaBona_a[#("Dnf")]][SonaBona_a[#("SXRp")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("hH")]]=SonaBona_c[SonaBona_a[#("oMe")]][SonaBona_a[#("eyTe")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("UH")];SonaBona_f=SonaBona_c[SonaBona_a[#("nG1")]];SonaBona_c[SonaBona_e+1]=SonaBona_f;SonaBona_c[SonaBona_e]=SonaBona_f[SonaBona_a[#("j2UF")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("SM")]]=SonaBona_a[#("loy")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("uD")]SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("CPn")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_b=SonaBona_a[#("lJH")];else local SonaBona_f;local SonaBona_e;SonaBona_c[SonaBona_a[#("Qa")]]=SonaBona_a[#("Hd7")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("4F")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("UoB")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#{"1 + 1 = 111";{487;931;398;481};}];SonaBona_f=SonaBona_c[SonaBona_a[#("suA")]];SonaBona_c[SonaBona_e+1]=SonaBona_f;SonaBona_c[SonaBona_e]=SonaBona_f[SonaBona_a[#("esWW")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{401;647;848;488};"1 + 1 = 111";}]]=SonaBona_a[#("3P0")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("kx")]]=SonaBona_a[#("kTG")];end;elseif SonaBona_e==#("EAUp8")then SonaBona_f[SonaBona_a[#("CY5")]]=SonaBona_c[SonaBona_a[#("Y8")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Z2")]]=SonaBona_f[SonaBona_a[#("eat")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("EW")]]=SonaBona_c[SonaBona_a[#("6sh")]][SonaBona_a[#("YpCB")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("tC")]]=SonaBona_c[SonaBona_a[#("RoA")]][SonaBona_a[#("kun1")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("I6")]][SonaBona_a[#("OqF")]]=SonaBona_a[#("VKd0")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Am")]]=SonaBona_a[#("fkr")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h[SonaBona_a[#("ZU4")]]=SonaBona_c[SonaBona_a[#("vJ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];do return end;else do return end;end;elseif SonaBona_e<=#("YVQnTGzkt")then if SonaBona_e<=#("oEEIUuh")then SonaBona_c[SonaBona_a[#("xY")]]=(SonaBona_a[#("YGr")]~=0);elseif SonaBona_e==#("Ucdj593P")then local SonaBona_e;SonaBona_e=SonaBona_a[#("4Z")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("cHz")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("rh")]]=SonaBona_c[SonaBona_a[#("iMT")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{23;214;179;836};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("4gU")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("34")]]();SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];do return end;else SonaBona_c[SonaBona_a[#("5G")]]=SonaBona_h[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{510;955;726;313};}]];end;elseif SonaBona_e<=#("bJTmLH5jzLH")then if SonaBona_e>#("CExRcdljxi")then SonaBona_c[SonaBona_a[#("xm")]]=SonaBona_l(SonaBona_m[SonaBona_a[#("pQd")]],nil,SonaBona_f);else if(SonaBona_c[SonaBona_a[#("cK")]]~=SonaBona_a[#("RndQ")])then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("nH4")];end;end;elseif SonaBona_e==#("rXF6WPZRtdhx")then SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{469;492;172;506};}]][SonaBona_a[#("HeG")]]=SonaBona_c[SonaBona_a[#("rQE5")]];else SonaBona_c[SonaBona_a[#("BK")]]={};end;elseif SonaBona_e<=#("KWO7IzvTLKrJRC35SFb3")then if SonaBona_e<=#("BAfKiFJ4ntugVgpA")then if SonaBona_e<=#("L8WBRmnyfm6VMJ")then local SonaBona_e;SonaBona_c[SonaBona_a[#("BZ")]]=SonaBona_c[SonaBona_a[#("fHF")]][SonaBona_a[#("cVng")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("IB")]]=SonaBona_h[SonaBona_a[#("aO0")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("l4")]]=SonaBona_a[#("0Rc")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_a[#{"1 + 1 = 111";{974;132;297;45};{386;439;82;286};}];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("oK")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("AqO")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("oO")]]=SonaBona_c[SonaBona_a[#("XpH")]]*SonaBona_c[SonaBona_a[#("Jb2B")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{185;297;527;627};"1 + 1 = 111";}]]=SonaBona_h[SonaBona_a[#("Dyo")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("J8")]]=SonaBona_c[SonaBona_a[#("Nhl")]]+SonaBona_a[#("Cuq2")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h[SonaBona_a[#{{815;76;519;385};"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("Ru")]];elseif SonaBona_e>#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{446;148;2;288};{798;158;43;155};{226;35;715;390};"1 + 1 = 111";"1 + 1 = 111";{261;542;518;206};"1 + 1 = 111";{595;725;553;679};}then SonaBona_c[SonaBona_a[#("lq")]]=SonaBona_c[SonaBona_a[#("Msa")]][SonaBona_c[SonaBona_a[#("Tk2m")]]];else local SonaBona_d=SonaBona_a[#("PWY")];local SonaBona_b=SonaBona_c[SonaBona_d]for SonaBona_a=SonaBona_d+1,SonaBona_a[#("JY4f")]do SonaBona_b=SonaBona_b..SonaBona_c[SonaBona_a];end;SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{31;880;46;283};}]]=SonaBona_b;end;elseif SonaBona_e<=#("NGE4ch8Um2mdrMiMUo")then if SonaBona_e>#("I8310le8Mt6p5j1sp")then SonaBona_c[SonaBona_a[#("St")]]=SonaBona_c[SonaBona_a[#("Nav")]]+SonaBona_a[#("0pge")];else SonaBona_c[SonaBona_a[#("vu")]]=SonaBona_c[SonaBona_a[#("C51")]]*SonaBona_c[SonaBona_a[#("iWHp")]];end;elseif SonaBona_e>#("PdvozjQlvMlQVGTZyyU")then SonaBona_c[SonaBona_a[#("EU")]]=SonaBona_c[SonaBona_a[#("BmI")]]-SonaBona_c[SonaBona_a[#("Aghz")]];else local SonaBona_d=SonaBona_a[#("IV")];local SonaBona_b=SonaBona_c[SonaBona_a[#("ax8")]];SonaBona_c[SonaBona_d+1]=SonaBona_b;SonaBona_c[SonaBona_d]=SonaBona_b[SonaBona_a[#("TSN4")]];end;elseif SonaBona_e<=#("OS8ivAqMq3Bt2EflqtJTkPZD")then if SonaBona_e<=#("6JBHgWEIMD6en293e4Ck1X")then if SonaBona_e==#("AHIdYbD93GuA0Zejh7Vqa")then SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{742;725;561;710};}]]=SonaBona_h[SonaBona_a[#("zuH")]];else local SonaBona_a=SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]SonaBona_c[SonaBona_a](SonaBona_c[SonaBona_a+1])end;elseif SonaBona_e>#("gcBKZfUxr5ira9ISPHiEdJ2")then SonaBona_c[SonaBona_a[#{{445;926;498;440};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("F95")]]+SonaBona_c[SonaBona_a[#("x7kg")]];else SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{931;156;597;826};}]]=SonaBona_c[SonaBona_a[#("hSx")]][SonaBona_a[#("hYqA")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("B0")]]=SonaBona_c[SonaBona_a[#("qeO")]][SonaBona_a[#("n0iA")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{972;721;782;970};{640;846;287;65};}]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{367;872;785;235};"1 + 1 = 111";}]][SonaBona_a[#("t5YG")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("7p")]]=SonaBona_h[SonaBona_a[#("bWd")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("gG")]]=SonaBona_c[SonaBona_a[#("p6M")]]*SonaBona_c[SonaBona_a[#("QXaI")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("h2")]]=SonaBona_c[SonaBona_a[#("0Xv")]]-SonaBona_c[SonaBona_a[#("NdD4")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("JD")]]=SonaBona_h[SonaBona_a[#("uyj")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("fb")]]=SonaBona_c[SonaBona_a[#("ogd")]]+SonaBona_a[#("1l9g")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h[SonaBona_a[#("emv")]]=SonaBona_c[SonaBona_a[#("xh")]];end;elseif SonaBona_e<=#("idaUumgHqqBFNomypGnzrJZeMA")then if SonaBona_e==#("ohHfHk8CVf9ceZLbTJceBtVoI")then local SonaBona_f=SonaBona_a[#("nb")];local SonaBona_d={};for SonaBona_a=1,#SonaBona_j do local SonaBona_a=SonaBona_j[SonaBona_a];for SonaBona_b=0,#SonaBona_a do local SonaBona_b=SonaBona_a[SonaBona_b];local SonaBona_e=SonaBona_b[1];local SonaBona_a=SonaBona_b[2];if SonaBona_e==SonaBona_c and SonaBona_a>=SonaBona_f then SonaBona_d[SonaBona_a]=SonaBona_e[SonaBona_a];SonaBona_b[1]=SonaBona_d;end;end;end;else SonaBona_c[SonaBona_a[#("8A")]]=SonaBona_f[SonaBona_a[#("IU9")]];end;elseif SonaBona_e>#("DkJo6i442zTl3uPWCspDiKQIgFJ")then if not SonaBona_c[SonaBona_a[#("Df")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("JHz")];end;else SonaBona_c[SonaBona_a[#("54")]]=-SonaBona_c[SonaBona_a[#{{495;925;391;928};"1 + 1 = 111";"1 + 1 = 111";}]];end;elseif SonaBona_e<=#("14xsIlRX2Hi0ik6mrHPRAO2D8em3FbiBJJd7bAOSO14")then if SonaBona_e<=#("jzu8ODpJ025mc4uD8Yr1ySrJg8k237dIU7t")then if SonaBona_e<=#("TopbVJLRN05gfkU0KcHBhV1PryP3ZxD")then if SonaBona_e<=#{"1 + 1 = 111";{673;13;943;689};{837;496;895;602};{169;330;731;287};"1 + 1 = 111";"1 + 1 = 111";{72;738;71;980};{603;537;52;515};"1 + 1 = 111";"1 + 1 = 111";{541;329;944;180};"1 + 1 = 111";{647;264;369;279};{945;649;415;822};{522;601;163;727};{302;768;22;452};"1 + 1 = 111";"1 + 1 = 111";{468;320;692;29};{374;994;52;503};"1 + 1 = 111";{297;668;316;614};"1 + 1 = 111";{977;727;59;442};"1 + 1 = 111";"1 + 1 = 111";{201;62;338;33};"1 + 1 = 111";{307;907;564;902};}then local SonaBona_a=SonaBona_a[#("yI")]SonaBona_c[SonaBona_a]=SonaBona_c[SonaBona_a](SonaBona_c[SonaBona_a+1])elseif SonaBona_e==#("2qx0GtBart6SsHZKMoL6QMyWPStWx8")then do return end;else local SonaBona_g;local SonaBona_e;SonaBona_f[SonaBona_a[#("qZC")]]=SonaBona_c[SonaBona_a[#("6K")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("OD")]]=SonaBona_h[SonaBona_a[#("xct")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Uc")];SonaBona_g=SonaBona_c[SonaBona_a[#("vhW")]];SonaBona_c[SonaBona_e+1]=SonaBona_g;SonaBona_c[SonaBona_e]=SonaBona_g[SonaBona_a[#("2e9g")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Wx")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_h[SonaBona_a[#("5sV")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Me")];SonaBona_g=SonaBona_c[SonaBona_a[#("50x")]];SonaBona_c[SonaBona_e+1]=SonaBona_g;SonaBona_c[SonaBona_e]=SonaBona_g[SonaBona_a[#("uGhN")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("KT")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];do return end;end;elseif SonaBona_e<=#("T4ASP4mICsm5PUSJ5iW8FW7bq2LlXaONt")then if SonaBona_e==#("nX3YjQzQjODQTb6jyNKab77yCXtaVCOK")then if SonaBona_c[SonaBona_a[#("W9")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("Bsj")];end;else local SonaBona_b=SonaBona_a[#("9O")]local SonaBona_d,SonaBona_a=SonaBona_k(SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_a[#("6pt")])))SonaBona_i=SonaBona_a+SonaBona_b-1 local SonaBona_a=0;for SonaBona_b=SonaBona_b,SonaBona_i do SonaBona_a=SonaBona_a+1;SonaBona_c[SonaBona_b]=SonaBona_d[SonaBona_a];end;end;elseif SonaBona_e>#("2H5Qh8gJZNtJKiJpONadtVqZFvxxy4R92e")then local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("Xm")]]=SonaBona_f[SonaBona_a[#("zty")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Zl")]]=SonaBona_c[SonaBona_a[#("WGd")]][SonaBona_a[#("K7RW")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("aj")]]=SonaBona_c[SonaBona_a[#("OFr")]][SonaBona_a[#("Y3hh")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("TS")];SonaBona_h=SonaBona_c[SonaBona_a[#{{646;81;693;334};{475;559;465;398};"1 + 1 = 111";}]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("J6N7")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("oD")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_f[SonaBona_a[#("8gB")]]=SonaBona_c[SonaBona_a[#("vl")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_f[SonaBona_a[#("Veh")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Ms")];SonaBona_h=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{249;259;706;34};"1 + 1 = 111";}]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("euvO")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("VY")]]=SonaBona_a[#("Q6M")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Wk")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("Sa5")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];if SonaBona_c[SonaBona_a[#("PP")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#{{658;273;370;203};{40;89;251;379};{865;989;989;16};}];end;else SonaBona_c[SonaBona_a[#("16")]]=SonaBona_c[SonaBona_a[#("pvQ")]]*SonaBona_c[SonaBona_a[#("c0bg")]];end;elseif SonaBona_e<=#("FaDqPEBmuOY2OUVhYNGshpgkVMTk45tQFsdpkvv")then if SonaBona_e<=#("2I6lQDSMNX3xxWSo3sFcUqrzuixvQG7Dr6AJt")then if SonaBona_e==#("Er4gIgc7tTKYv20tZMpH1Ifv6g0AfAvj59Yn")then if(SonaBona_c[SonaBona_a[#("I7")]]==SonaBona_a[#("p5SS")])then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("Ju6")];end;else local SonaBona_b=SonaBona_a[#("ft")]SonaBona_c[SonaBona_b]=SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_a[#("4SH")]))end;elseif SonaBona_e==#("NSlxyYOW1kfN7gYsWd6lJkBqM13yB3xdNlm3ej")then local SonaBona_e;SonaBona_c[SonaBona_a[#("z2")]]=SonaBona_c[SonaBona_a[#("ZdI")]][SonaBona_a[#("jQyB")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("du")]]=SonaBona_h[SonaBona_a[#("mxP")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("9A")]]=-SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{252;989;765;343};{146;220;305;889};}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("WO")]]=SonaBona_a[#("2kt")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("0l")]]=SonaBona_a[#("gyR")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("hd")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#{{568;752;904;526};{285;499;834;345};{308;613;934;990};}]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("go")]]=SonaBona_c[SonaBona_a[#("yRC")]]*SonaBona_c[SonaBona_a[#("PvR6")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Zd")]]=SonaBona_h[SonaBona_a[#("YXe")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{166;76;898;12};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("zWr")]]+SonaBona_a[#("8e2Y")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h[SonaBona_a[#("DKY")]]=SonaBona_c[SonaBona_a[#("jY")]];else SonaBona_c[SonaBona_a[#("2o")]]=SonaBona_c[SonaBona_a[#("rfe")]][SonaBona_a[#("6CbV")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("mn")]]=SonaBona_c[SonaBona_a[#("N8I")]][SonaBona_a[#("ajD2")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("DS")]]=SonaBona_c[SonaBona_a[#("aes")]][SonaBona_a[#{{973;720;749;353};{365;795;372;465};"1 + 1 = 111";{69;133;395;826};}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("JW")]]=SonaBona_h[SonaBona_a[#("bGZ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Y3")]]=SonaBona_c[SonaBona_a[#("ci6")]]*SonaBona_c[SonaBona_a[#("3lzQ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{162;149;558;578};}]]=SonaBona_c[SonaBona_a[#("50m")]]+SonaBona_c[SonaBona_a[#("3Jmy")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("6A")]]=SonaBona_h[SonaBona_a[#("bUt")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Y9")]]=SonaBona_c[SonaBona_a[#{{55;873;841;278};"1 + 1 = 111";"1 + 1 = 111";}]]+SonaBona_a[#("SOzR")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h[SonaBona_a[#("JtT")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]];end;elseif SonaBona_e<=#("UCKe6VXhtH0j52bJCr5VG4qv8Xb9W44oNKmU8gEFZ")then if SonaBona_e>#("K0KTBlMMULjz8ZlnfiUXvzNMGvPqKuYA5VtBVpxZ")then local SonaBona_d=SonaBona_a[#("tn")];local SonaBona_f=SonaBona_a[#("88mx")];local SonaBona_e=SonaBona_d+2 local SonaBona_d={SonaBona_c[SonaBona_d](SonaBona_c[SonaBona_d+1],SonaBona_c[SonaBona_e])};for SonaBona_a=1,SonaBona_f do SonaBona_c[SonaBona_e+SonaBona_a]=SonaBona_d[SonaBona_a];end;local SonaBona_d=SonaBona_d[1]if SonaBona_d then SonaBona_c[SonaBona_e]=SonaBona_d SonaBona_b=SonaBona_a[#("70V")];else SonaBona_b=SonaBona_b+1;end;else SonaBona_c[SonaBona_a[#("U0")]]=SonaBona_c[SonaBona_a[#("icY")]]-SonaBona_c[SonaBona_a[#("Y368")]];end;elseif SonaBona_e==#("jjsenMxJUbuVbzln8mfGubzXTDmFVD0W4AmotHsUsS")then SonaBona_c[SonaBona_a[#("I4")]]=SonaBona_c[SonaBona_a[#("FI6")]][SonaBona_c[SonaBona_a[#("amGv")]]];else SonaBona_c[SonaBona_a[#("PN")]][SonaBona_a[#("7GM")]]=SonaBona_a[#("TWNo")];end;elseif SonaBona_e<=#("tDP4xinXcqschVGuVz2YrlI0Mm63B4vnNlfueJ0vHQXGLxeEYm")then if SonaBona_e<=#("uA4Ih4Yrkmtvh5fA5PkqlJGqMycpohCfoxaXSO7BpqPjnt")then if SonaBona_e<=#("KG7jYN5vW4O6U1JddVnhU4rRrSUb43xcrSDTq7NDsao3")then SonaBona_c[SonaBona_a[#("DP")]]={};elseif SonaBona_e>#{{307;560;47;716};"1 + 1 = 111";"1 + 1 = 111";{411;463;431;934};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{726;827;532;779};"1 + 1 = 111";{34;6;356;389};{960;794;147;301};"1 + 1 = 111";"1 + 1 = 111";{814;103;943;506};{632;574;282;288};{890;296;57;889};{173;801;947;469};"1 + 1 = 111";{552;779;377;35};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{410;833;727;752};"1 + 1 = 111";{389;337;98;673};{100;151;222;360};{679;554;302;810};"1 + 1 = 111";{142;53;614;516};{859;166;707;233};{982;940;403;256};{374;697;813;864};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{962;367;790;983};"1 + 1 = 111";{770;430;232;972};{192;750;2;23};{173;448;284;627};{950;327;459;449};{236;413;528;16};}then SonaBona_c[SonaBona_a[#("4I")]]=SonaBona_c[SonaBona_a[#("OsC")]][SonaBona_a[#{{943;589;440;173};"1 + 1 = 111";"1 + 1 = 111";{783;481;663;478};}]];else local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("ob")]]();SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("cF")]]=SonaBona_f[SonaBona_a[#("2Jj")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Un")]]=SonaBona_c[SonaBona_a[#("PCG")]][SonaBona_a[#("xoNf")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("vd")]]=SonaBona_c[SonaBona_a[#("PW6")]][SonaBona_a[#{"1 + 1 = 111";{164;832;995;379};{698;946;881;90};{824;483;178;306};}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("VZ")]]=SonaBona_c[SonaBona_a[#("X3Y")]][SonaBona_a[#{{855;991;316;806};{583;742;30;398};"1 + 1 = 111";"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Li")];SonaBona_h=SonaBona_c[SonaBona_a[#("xHx")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("9oAo")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("FY")]]=SonaBona_a[#("cCa")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("iq")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("XBi")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];if SonaBona_c[SonaBona_a[#("LP")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("df2")];end;end;elseif SonaBona_e<=#("afGKzKvvDdlj0CGppyl9ZOrMRJUKJKIpMtVaMkAjudjHsbEo")then if SonaBona_e>#("SWSLYQxY42ZZVW3F6IGRGOf8bOWEVtQfGY0X0PYOymRsKuJ")then local SonaBona_a=SonaBona_a[#("XD")]SonaBona_c[SonaBona_a]=SonaBona_c[SonaBona_a]()else local SonaBona_a=SonaBona_a[#("H3")]SonaBona_c[SonaBona_a](SonaBona_c[SonaBona_a+1])end;elseif SonaBona_e==#("qbxE7HpeRTJj42cKlUs66fPqU2st6WyQeGnT7mh8JWggfOUFj")then local SonaBona_e;local SonaBona_h;local SonaBona_l,SonaBona_m;local SonaBona_j;local SonaBona_e;SonaBona_c[SonaBona_a[#("Ni")]]=SonaBona_f[SonaBona_a[#("1sc")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Pr")]]=SonaBona_f[SonaBona_a[#("R2V")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("L9")];SonaBona_j=SonaBona_c[SonaBona_a[#("GCe")]];SonaBona_c[SonaBona_e+1]=SonaBona_j;SonaBona_c[SonaBona_e]=SonaBona_j[SonaBona_a[#("Rd0I")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("mm")]]=SonaBona_a[#("Lof")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("j4")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#{{866;316;672;653};"1 + 1 = 111";{896;431;482;11};}]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("s2")]]=SonaBona_c[SonaBona_a[#("5Ky")]][SonaBona_a[#("5akN")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("2A")]]=SonaBona_c[SonaBona_a[#("IQf")]][SonaBona_a[#{"1 + 1 = 111";{446;803;767;360};"1 + 1 = 111";"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Gf")]]=SonaBona_c[SonaBona_a[#("tjs")]][SonaBona_a[#("Jp07")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("kB")]]=SonaBona_c[SonaBona_a[#("4Q0")]][SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("86")]]=SonaBona_c[SonaBona_a[#("1AG")]][SonaBona_a[#{{450;503;791;460};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("OY")]]=SonaBona_c[SonaBona_a[#("VQv")]][SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{752;164;620;649};"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Yi")];SonaBona_j=SonaBona_c[SonaBona_a[#("ys1")]];SonaBona_c[SonaBona_e+1]=SonaBona_j;SonaBona_c[SonaBona_e]=SonaBona_j[SonaBona_a[#("tyfj")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("g6")]SonaBona_l,SonaBona_m=SonaBona_k(SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1]))SonaBona_i=SonaBona_m+SonaBona_e-1 SonaBona_h=0;for SonaBona_a=SonaBona_e,SonaBona_i do SonaBona_h=SonaBona_h+1;SonaBona_c[SonaBona_a]=SonaBona_l[SonaBona_h];end;SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("U3")]SonaBona_l={SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_i))};SonaBona_h=0;for SonaBona_a=SonaBona_e,SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{153;449;308;413};}]do SonaBona_h=SonaBona_h+1;SonaBona_c[SonaBona_a]=SonaBona_l[SonaBona_h];end SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_b=SonaBona_a[#("veQ")];else SonaBona_h[SonaBona_a[#("iVv")]]=SonaBona_c[SonaBona_a[#("t5")]];end;elseif SonaBona_e<=#("g0bNukxfTfn6h4v2ezPtN9Muyj8JkfiYkZQIPCkdx1DbUMPmVnKv0Z")then if SonaBona_e<=#("hnRokmX4O7AWrnXnMnL6VGLKWFVY7FW7uuJt7n91J7Yeu0x8797h")then if SonaBona_e>#("2TLNhDQB96ikDB7PEqznUyXSGo5hW18HOSCL8RZUsAKaP32zztE")then local SonaBona_d=SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}];local SonaBona_f=SonaBona_c[SonaBona_d+2];local SonaBona_e=SonaBona_c[SonaBona_d]+SonaBona_f;SonaBona_c[SonaBona_d]=SonaBona_e;if(SonaBona_f>0)then if(SonaBona_e<=SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("4M1")];SonaBona_c[SonaBona_d+3]=SonaBona_e;end elseif(SonaBona_e>=SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#{{878;833;774;157};"1 + 1 = 111";"1 + 1 = 111";}];SonaBona_c[SonaBona_d+3]=SonaBona_e;end else local SonaBona_d=SonaBona_a[#("jFY")];local SonaBona_b=SonaBona_c[SonaBona_d]for SonaBona_a=SonaBona_d+1,SonaBona_a[#("8lQ0")]do SonaBona_b=SonaBona_b..SonaBona_c[SonaBona_a];end;SonaBona_c[SonaBona_a[#("KF")]]=SonaBona_b;end;elseif SonaBona_e>#("J4EF52g3HIOi7MHU8vRWCO4uXXcNxHSDxp8Un7PfL6nUWBcdxiAcM")then if(SonaBona_c[SonaBona_a[#("nP")]]~=SonaBona_a[#("TyDk")])then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("yLm")];end;else SonaBona_f[SonaBona_a[#("3Cu")]]=SonaBona_c[SonaBona_a[#("Sg")]];end;elseif SonaBona_e<=#("q59jRi0EG90kVSNWGbRMlFAjJxU8pogQ0Q9cVepGogAn4LQuALMzvaGW")then if SonaBona_e>#("ZLuz2nr3kufSLbCVkxefmp7RzIPMStZknI6D5hx3iuUqKMZJkNlOBQs")then local SonaBona_b=SonaBona_a[#{{462;757;868;656};"1 + 1 = 111";}]SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_a[#("nXc")]))else local SonaBona_j;local SonaBona_m,SonaBona_l;local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("3N")]]=SonaBona_f[SonaBona_a[#("YH2")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{707;380;148;926};"1 + 1 = 111";}]]=SonaBona_f[SonaBona_a[#("DOB")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Qv")];SonaBona_h=SonaBona_c[SonaBona_a[#("uJK")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("rNLC")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("gm")]]=SonaBona_a[#("JFR")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Qh")]SonaBona_m,SonaBona_l=SonaBona_k(SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("t8B")])))SonaBona_i=SonaBona_l+SonaBona_e-1 SonaBona_j=0;for SonaBona_a=SonaBona_e,SonaBona_i do SonaBona_j=SonaBona_j+1;SonaBona_c[SonaBona_a]=SonaBona_m[SonaBona_j];end;SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("4l")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_i))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Qa")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e]()SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("dz")];SonaBona_h=SonaBona_c[SonaBona_a[#("E6k")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("vN0J")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("jA")]]=SonaBona_a[#("1zV")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Qf")]]=SonaBona_a[#("Agd")];end;elseif SonaBona_e==#("OOatIQk0F5Fdf80d9k72FRgWTfBfilTHovZqgdvCj4WPgWEmWhOpTBe6I")then if(SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]<SonaBona_c[SonaBona_a[#("eY8y")]])then SonaBona_b=SonaBona_a[#("KMm")];else SonaBona_b=SonaBona_b+1;end;else local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("91")]]=SonaBona_a[#("Pg4")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("WC")]]=SonaBona_a[#("dPL")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("QE")]]=SonaBona_f[SonaBona_a[#("a7S")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#{{624;690;510;648};"1 + 1 = 111";}];SonaBona_h=SonaBona_c[SonaBona_a[#("Ug4")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{163;102;732;362};{626;60;216;284};}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("PI")]]=SonaBona_a[#("viV")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("7Y")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("vhy")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("2g")]]=SonaBona_c[SonaBona_a[#{{715;395;201;801};{938;800;981;988};{3;209;850;976};}]][SonaBona_a[#("OqvD")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("1Z")]]=SonaBona_c[SonaBona_a[#("GEP")]][SonaBona_a[#("Y3G9")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("KS")];SonaBona_h=SonaBona_c[SonaBona_a[#("sBK")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("jWXP")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("o9")]]=SonaBona_c[SonaBona_a[#("e60")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("UC")]]=SonaBona_c[SonaBona_a[#("vvU")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("EQ")]SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("Rx6")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ph")]]=SonaBona_f[SonaBona_a[#("lXV")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Xa")]][SonaBona_a[#("0u4")]]=SonaBona_a[#("RXNo")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4e")]]=SonaBona_f[SonaBona_a[#("T0M")]];end;elseif SonaBona_e<=#("KCofSsm8YTiJ76ZFSK5CP7MosaIDXYq2T1D3nelDDi7VdmkRBoSEbfKN09WSVTl9Cq0fE5qNzC8H90lfZ0bIgX1")then if SonaBona_e<=#("rZdnsEST68tXxfnF7ffKhdO9YQ24RN3PzmXO2du4UpKbHySUNHLaRrGoldzMMXbteOykrJM4")then if SonaBona_e<=#("lZ1EMDA8irkc28hQJDZOSr7np62aHCd5QpFCOVJK8OEF1rlQpFTgWqc32OnQKABRo")then if SonaBona_e<=#("vNDQbY3pPeYCv8UlUcS7iAmMJ9I39JnWqM5JnKD5mHL8eBso5zQy8qg5A0gcq")then if SonaBona_e<=#{"1 + 1 = 111";{558;377;864;584};{531;268;800;162};{364;792;183;915};"1 + 1 = 111";{454;541;445;528};{569;738;458;877};"1 + 1 = 111";{755;324;611;775};"1 + 1 = 111";"1 + 1 = 111";{70;213;879;920};{158;225;982;663};"1 + 1 = 111";{456;405;76;219};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{398;845;167;37};"1 + 1 = 111";{725;921;885;124};"1 + 1 = 111";{663;566;476;124};{717;78;941;454};{48;516;573;982};{276;963;403;260};"1 + 1 = 111";{24;76;19;337};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{969;660;177;195};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{603;327;121;903};"1 + 1 = 111";"1 + 1 = 111";{628;481;167;206};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{444;225;937;108};"1 + 1 = 111";"1 + 1 = 111";{18;906;975;538};"1 + 1 = 111";{224;44;332;73};{237;382;981;12};"1 + 1 = 111";"1 + 1 = 111";{599;305;59;681};"1 + 1 = 111";}then local SonaBona_i;local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("jF")]]=SonaBona_a[#("5xs")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("MT")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("fV")]]=SonaBona_f[SonaBona_a[#("sVf")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("7i")]]=SonaBona_c[SonaBona_a[#("HRk")]][SonaBona_a[#("TUKN")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{569;315;340;546};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("s6G")]][SonaBona_a[#("knrV")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("mB")]]=SonaBona_c[SonaBona_a[#("xEx")]][SonaBona_a[#("JRKD")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Zp")]]=SonaBona_c[SonaBona_a[#("XBb")]][SonaBona_a[#("ariv")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_f[SonaBona_a[#("Tog")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("qR")];SonaBona_h=SonaBona_c[SonaBona_a[#("GcF")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("Dh1o")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("le")]]=SonaBona_a[#("uG4")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("67")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("dnL")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("sB")]]=SonaBona_c[SonaBona_a[#("rNW")]][SonaBona_a[#("satG")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("sN")]]=SonaBona_c[SonaBona_a[#("Nuh")]][SonaBona_a[#("yICj")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("8O")]]=SonaBona_a[#("Y4j")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("QG")]]=SonaBona_c[SonaBona_a[#("DeG")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h=SonaBona_a[#("uKX")];SonaBona_i=SonaBona_c[SonaBona_h]for SonaBona_a=SonaBona_h+1,SonaBona_a[#("3RTU")]do SonaBona_i=SonaBona_i..SonaBona_c[SonaBona_a];end;SonaBona_c[SonaBona_a[#("on")]]=SonaBona_i;SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("aL")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{945;627;333;465};}]][SonaBona_c[SonaBona_a[#("LLVZ")]]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("de")]]=SonaBona_c[SonaBona_a[#("m6f")]][SonaBona_a[#("CmuA")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4U")]]=SonaBona_c[SonaBona_a[#("cH6")]][SonaBona_a[#("AOri")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("8u")]][SonaBona_a[#("2Co")]]=SonaBona_c[SonaBona_a[#("L3vt")]];elseif SonaBona_e==#("ncdLRjiJuugF3hgnkxbOEa36dFfRiMqfZevjQZZOb7kVeYen1ZE09KSmihHl")then local SonaBona_b=SonaBona_a[#{"1 + 1 = 111";{867;399;285;9};}]SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_a[#("OHf")]))else SonaBona_c[SonaBona_a[#("fb")]]=SonaBona_l(SonaBona_m[SonaBona_a[#("hlj")]],nil,SonaBona_f);end;elseif SonaBona_e<=#{"1 + 1 = 111";"1 + 1 = 111";{981;659;391;50};{420;379;324;317};{738;847;450;943};{737;708;964;481};{857;344;202;654};{247;187;770;755};{234;38;504;404};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{199;443;365;258};"1 + 1 = 111";{433;647;319;801};"1 + 1 = 111";"1 + 1 = 111";{831;451;267;712};{153;89;102;310};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{414;639;949;736};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{420;580;840;622};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{398;75;341;554};{571;465;851;472};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{833;49;951;961};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{919;282;669;951};"1 + 1 = 111";"1 + 1 = 111";{857;616;33;764};"1 + 1 = 111";"1 + 1 = 111";{538;920;500;214};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{389;280;621;432};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}then if SonaBona_e==#("9d4Wb9yBXgkz6cahEqkV9s92z8A2diRXZ6qeyZ6l9KCkKWQeKGBjr17RebydKF")then local SonaBona_a=SonaBona_a[#("qT")]SonaBona_c[SonaBona_a]=SonaBona_c[SonaBona_a](SonaBona_c[SonaBona_a+1])else SonaBona_c[SonaBona_a[#("G4")]]=SonaBona_c[SonaBona_a[#("3pV")]]*SonaBona_a[#("j4Vv")];end;elseif SonaBona_e>#("PAyK9W5UOu8Wz1YsMsvsHSHF89KavB3MEnXVmmQrOWXZteIZpTWUomZ622Lal5ym")then local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("n0")]]();SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("uT")]]=SonaBona_f[SonaBona_a[#("aAN")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ub")]]=SonaBona_c[SonaBona_a[#("AIp")]][SonaBona_a[#("bpBE")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Uk")]]=SonaBona_c[SonaBona_a[#("0ss")]][SonaBona_a[#("sJyz")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("I3")]]=SonaBona_c[SonaBona_a[#("ou2")]][SonaBona_a[#("1xbD")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("6z")];SonaBona_h=SonaBona_c[SonaBona_a[#("7av")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("gQ4P")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4t")]]=SonaBona_a[#{{46;793;219;569};"1 + 1 = 111";{39;85;71;464};}];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("ny")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("FA6")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];if not SonaBona_c[SonaBona_a[#("9K")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("7kK")];end;else SonaBona_c[SonaBona_a[#("x8")]]=SonaBona_c[SonaBona_a[#("l0W")]];end;elseif SonaBona_e<=#("xsldcfzMdPV5Rl4BUUMPixqy02uMQgTzKy6WxWmOxilIebkQQJCkVIs9bXnjVW675vut")then if SonaBona_e<=#("ie8I8ralTtYSO5gOINcf6UJIc2KloMSR1CIFDMWpsYsEzCh1ZsyTsnsyGBGfRY7gLh")then local SonaBona_h;local SonaBona_e;SonaBona_e=SonaBona_a[#("kF")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("VZ")]]=SonaBona_f[SonaBona_a[#("3ET")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("nK")];SonaBona_h=SonaBona_c[SonaBona_a[#("let")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("Tps3")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{217;718;792;609};"1 + 1 = 111";}]]=SonaBona_a[#("nAj")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("K1")]SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("t2O")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("mI")]]=SonaBona_f[SonaBona_a[#("3UA")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("rt")]]=SonaBona_c[SonaBona_a[#("JZ8")]][SonaBona_a[#("9vzu")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("eM")]]=(SonaBona_a[#{"1 + 1 = 111";{696;756;197;799};"1 + 1 = 111";}]~=0);SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_f[SonaBona_a[#("SvE")]]=SonaBona_c[SonaBona_a[#("Ga")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("1u")]]=SonaBona_a[#("Ioy")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("j7")]]={};SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{29;397;65;437};"1 + 1 = 111";}]][SonaBona_a[#("qbZ")]]=SonaBona_a[#("RZzc")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("YX")]][SonaBona_a[#("bEL")]]=SonaBona_a[#("lV0d")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{812;359;339;833};}]][SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_a[#("1q2N")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Po")]][SonaBona_a[#{"1 + 1 = 111";{322;499;305;147};{976;522;788;753};}]]=SonaBona_a[#("o12E")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];for SonaBona_a=SonaBona_a[#("8O")],SonaBona_a[#("Bhd")]do SonaBona_c[SonaBona_a]=nil;end;elseif SonaBona_e==#("myMl50WWiBeiKVTx5o9yOij8cgRIF0l3rM5DmgC2GCj6Br5t8Bb2MTmdoNiZjorspl1")then local SonaBona_e=SonaBona_a[#("9X")];local SonaBona_f=SonaBona_a[#("Eagx")];local SonaBona_d=SonaBona_e+2 local SonaBona_e={SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1],SonaBona_c[SonaBona_d])};for SonaBona_a=1,SonaBona_f do SonaBona_c[SonaBona_d+SonaBona_a]=SonaBona_e[SonaBona_a];end;local SonaBona_e=SonaBona_e[1]if SonaBona_e then SonaBona_c[SonaBona_d]=SonaBona_e SonaBona_b=SonaBona_a[#{"1 + 1 = 111";{844;252;29;796};{853;433;402;610};}];else SonaBona_b=SonaBona_b+1;end;else SonaBona_b=SonaBona_a[#("0OO")];end;elseif SonaBona_e<=#("0qkYWg2l9mIVlxKdYtqJA1oJ7NSrj0RpB7ERqmfF1adbfyNXOnE54rI8bL0jzKcjFrtn22")then if SonaBona_e==#("LnWRzYmDK94N5vWvizFPQx6gq84GYez4WB3RhLikZhqjE7gXT5lZymgorQBB4QPFK91FD")then SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{598;623;20;996};}]]();SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("kf")]]=SonaBona_f[SonaBona_a[#("5Uo")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("fo")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]][SonaBona_a[#{{722;191;979;484};{611;175;947;478};"1 + 1 = 111";"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Wx")]]=SonaBona_c[SonaBona_a[#("4NN")]][SonaBona_a[#("7jdM")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("1G")]][SonaBona_a[#{"1 + 1 = 111";{39;635;382;146};{782;2;561;328};}]]=SonaBona_a[#("b79S")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("pM")]]=SonaBona_c[SonaBona_a[#("Oih")]][SonaBona_a[#("uZ0h")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ez")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{709;161;663;404};{509;108;279;112};}]][SonaBona_a[#("DxPE")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("eO")]]=SonaBona_c[SonaBona_a[#("ls7")]][SonaBona_a[#("hD5b")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Fz")]]=SonaBona_c[SonaBona_a[#("sB5")]]-SonaBona_c[SonaBona_a[#("RTc9")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("5I")]]=SonaBona_c[SonaBona_a[#("ZTi")]][SonaBona_a[#("onTR")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("51")]]=SonaBona_c[SonaBona_a[#("3dK")]]+SonaBona_c[SonaBona_a[#("RnqZ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("hW")]]=SonaBona_h[SonaBona_a[#("fkI")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("AX")]]=SonaBona_c[SonaBona_a[#("E70")]][SonaBona_a[#("r2kZ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];if not SonaBona_c[SonaBona_a[#("WT")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("8qU")];end;else local SonaBona_a=SonaBona_a[#("o2")]SonaBona_c[SonaBona_a]=SonaBona_c[SonaBona_a](SonaBona_g(SonaBona_c,SonaBona_a+1,SonaBona_i))end;elseif SonaBona_e>#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{55;874;693;500};"1 + 1 = 111";{172;724;132;887};{240;635;641;339};"1 + 1 = 111";"1 + 1 = 111";{386;142;101;282};{356;495;92;793};{169;256;737;308};{222;514;450;290};{547;132;351;748};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{814;110;594;33};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{677;567;497;32};"1 + 1 = 111";"1 + 1 = 111";{324;174;571;53};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{109;541;830;284};"1 + 1 = 111";"1 + 1 = 111";{154;732;760;51};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{204;864;930;290};"1 + 1 = 111";"1 + 1 = 111";{926;485;625;186};{475;898;264;653};{770;583;718;857};"1 + 1 = 111";{498;929;137;655};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{309;822;923;400};"1 + 1 = 111";{382;632;157;904};"1 + 1 = 111";"1 + 1 = 111";{642;645;118;610};{947;670;25;341};{573;249;77;776};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{585;914;893;942};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{117;53;203;645};}then local SonaBona_d=SonaBona_a[#("KY")];local SonaBona_f=SonaBona_c[SonaBona_d+2];local SonaBona_e=SonaBona_c[SonaBona_d]+SonaBona_f;SonaBona_c[SonaBona_d]=SonaBona_e;if(SonaBona_f>0)then if(SonaBona_e<=SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("GOJ")];SonaBona_c[SonaBona_d+3]=SonaBona_e;end elseif(SonaBona_e>=SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("WY3")];SonaBona_c[SonaBona_d+3]=SonaBona_e;end else for SonaBona_a=SonaBona_a[#("9T")],SonaBona_a[#("ldK")]do SonaBona_c[SonaBona_a]=nil;end;end;elseif SonaBona_e<=#("mVE4xciCoQjJbYBFa4pb9ND0s74tbWLx89eAuUzvAMEAjNfyZrgqaaDKrOMAhZBDeWLbUakqF3LyjcQ")then if SonaBona_e<=#("1HEUPux8GFhRh8oLkbvxceOYgZVgzfAo77JLuRXTAMFo3DjGPamiRtMX2PNZKpKBf2TkAOpEnM6")then if SonaBona_e<=#("JA5OQoCy2rIOuWSPe7jkbejaU8gbUT4fxloDU9jvXlIYuf0O5KzqCWzFp43ShBNjxCriHp5fY")then SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{297;907;120;82};}]]=SonaBona_c[SonaBona_a[#("Spp")]][SonaBona_a[#("Oj8o")]];elseif SonaBona_e>#("x0GvQPiCfjuONKXUm0fBnxIzB2XRgQPtCOzJ84ooKPuEZTZRvXdf9xLarh4X1BvAFal8lnVrM0")then local SonaBona_i=SonaBona_m[SonaBona_a[#("UoJ")]];local SonaBona_g;local SonaBona_e={};SonaBona_g=SonaBona_q({},{__index=function(SonaBona_b,SonaBona_a)local SonaBona_a=SonaBona_e[SonaBona_a];return SonaBona_a[1][SonaBona_a[2]];end,__newindex=function(SonaBona_c,SonaBona_a,SonaBona_b)local SonaBona_a=SonaBona_e[SonaBona_a]SonaBona_a[1][SonaBona_a[2]]=SonaBona_b;end;});for SonaBona_f=1,SonaBona_a[#("yrd8")]do SonaBona_b=SonaBona_b+1;local SonaBona_a=SonaBona_d[SonaBona_b];if SonaBona_a[#("E")]==64 then SonaBona_e[SonaBona_f-1]={SonaBona_c,SonaBona_a[#("IU4")]};else SonaBona_e[SonaBona_f-1]={SonaBona_h,SonaBona_a[#("Ek6")]};end;SonaBona_j[#SonaBona_j+1]=SonaBona_e;end;SonaBona_c[SonaBona_a[#("qs")]]=SonaBona_l(SonaBona_i,SonaBona_g,SonaBona_f);else local SonaBona_h;local SonaBona_e;SonaBona_e=SonaBona_a[#("cP")];SonaBona_h=SonaBona_c[SonaBona_a[#("DuK")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("Eocs")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Gj")]]=SonaBona_a[#{{87;653;833;517};"1 + 1 = 111";{84;422;142;601};}];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("C0")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("jpT")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("SU")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]][SonaBona_a[#("r59S")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("YZ")];SonaBona_h=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{656;523;320;490};{655;319;80;30};}]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("ggjH")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Ys")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("mZ")]]=SonaBona_f[SonaBona_a[#("Su2")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("p5")]]=SonaBona_c[SonaBona_a[#("Rji")]][SonaBona_a[#("pg0g")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("O6")]]=SonaBona_c[SonaBona_a[#("UAA")]][SonaBona_a[#("orfb")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("uR")]]=SonaBona_c[SonaBona_a[#("2PS")]][SonaBona_a[#("HVYA")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("i0")];SonaBona_h=SonaBona_c[SonaBona_a[#("EIV")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("7kVD")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("By")]]=SonaBona_a[#("zeu")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Xp")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("FEA")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];if SonaBona_c[SonaBona_a[#("1W")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("J1H")];end;end;elseif SonaBona_e<=#("IbeKSdgvsNKtedzr09Byjt58YH0GhcVEjGc8mImTVecX4Qh5W65skDSngfVkmKoq1gkJaBesWRNer")then if SonaBona_e>#("ehz5TkhDsQXZ1gWbGk0W5YGI4v2MGD0N68bOWr0djzXFWlJ7HVlCoFmpM1bysF70Zj23fhpotWMG")then SonaBona_c[SonaBona_a[#{{937;997;594;654};{960;9;711;567};}]]=SonaBona_a[#("fRG")];else local SonaBona_e;SonaBona_c[SonaBona_a[#{{142;762;710;56};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("CZu")]][SonaBona_a[#("Ck7R")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("nB")]]=SonaBona_c[SonaBona_a[#("eeC")]][SonaBona_a[#{"1 + 1 = 111";{945;666;67;50};"1 + 1 = 111";"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Td")]]=SonaBona_f[SonaBona_a[#("0gm")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("QW")]]=SonaBona_c[SonaBona_a[#("RuJ")]][SonaBona_a[#("IaCX")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("f1")]]=SonaBona_f[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{66;670;967;266};}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("2h")]]=SonaBona_c[SonaBona_a[#("9yo")]][SonaBona_a[#("qB6h")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("IJ")]]=SonaBona_h[SonaBona_a[#("T9n")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("qy")]]=SonaBona_c[SonaBona_a[#("3aH")]]*SonaBona_a[#("ljaO")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Qb")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{548;375;894;134};"1 + 1 = 111";}]]=-SonaBona_c[SonaBona_a[#("jKz")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{593;303;575;656};"1 + 1 = 111";}]]=SonaBona_a[#("mnA")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{73;580;496;576};}]]=SonaBona_a[#("NLP")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("5g")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("q4C")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("vz")]]=SonaBona_c[SonaBona_a[#("sEf")]]*SonaBona_c[SonaBona_a[#("HhKg")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("aU")]][SonaBona_a[#("02i")]]=SonaBona_c[SonaBona_a[#("5uRB")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_b=SonaBona_a[#{"1 + 1 = 111";{572;451;381;864};{755;198;287;121};}];end;elseif SonaBona_e>#{{959;952;800;809};{853;100;870;230};{639;667;887;483};{740;150;681;161};{207;687;792;199};{74;133;475;325};{196;374;760;14};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{73;391;149;770};{1;536;894;389};{375;274;852;950};{367;894;295;339};"1 + 1 = 111";"1 + 1 = 111";{58;278;438;512};"1 + 1 = 111";"1 + 1 = 111";{706;626;656;621};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{674;847;893;737};"1 + 1 = 111";"1 + 1 = 111";{139;333;601;717};"1 + 1 = 111";"1 + 1 = 111";{859;380;692;628};{433;294;886;899};"1 + 1 = 111";"1 + 1 = 111";{193;376;26;738};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{931;868;109;180};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{201;887;833;67};"1 + 1 = 111";{261;308;298;862};{87;712;578;374};{554;887;36;263};{422;724;128;206};{710;680;439;100};{127;672;462;562};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{127;933;217;713};{632;271;326;758};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{702;91;36;19};"1 + 1 = 111";{934;680;150;131};"1 + 1 = 111";"1 + 1 = 111";{886;184;555;347};{675;648;459;270};{713;837;586;209};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{173;4;147;515};}then if SonaBona_c[SonaBona_a[#("yR")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#{{117;301;926;86};"1 + 1 = 111";{209;810;266;964};}];end;else if(SonaBona_c[SonaBona_a[#("u9")]]==SonaBona_a[#("eiib")])then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("Kbu")];end;end;elseif SonaBona_e<=#("HItj8rA5Mmo44DuV6mlX3dYOGb8OTYOisHLFvgx7HNDsn4czcDsmbe8ETQN7sWlXJfMy10z00nqqKFAL8JL")then if SonaBona_e<=#("GChoIhVQDAPUBPUisPImeDvXXS3npc8Tk5rg7yZUeTxAJGZ4VrstbzlcfuB0nHABC5JGyNk5ZXhuf6nr3")then if SonaBona_e==#("D8TPSWTobN69HIt68N6sHhgyEor16jgi6oeCRWnXXiMI80pKbi7KvLCv1vkDE1s2GXcrD2plAiFyFJzO")then SonaBona_c[SonaBona_a[#("2s")]]=SonaBona_c[SonaBona_a[#("650")]]*SonaBona_a[#("v0Qj")];else SonaBona_h[SonaBona_a[#("kHa")]]=SonaBona_c[SonaBona_a[#("jS")]];end;elseif SonaBona_e>#("S0XlGXvXTKuMVt50UbkX8gi3Vkmfd0r6HEWbFQaaREUr4KPZJIVIo0aMR4AvKqT2szfqI4uebkgEv18lGy")then local SonaBona_g;local SonaBona_f;local SonaBona_e;SonaBona_c[SonaBona_a[#("CH")]]();SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("IN")]]=SonaBona_a[#("T06")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("B6")]]=SonaBona_a[#("H9K")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("RI")]]=SonaBona_a[#("4bu")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("D7")];SonaBona_f=SonaBona_c[SonaBona_e]SonaBona_g=SonaBona_c[SonaBona_e+2];if(SonaBona_g>0)then if(SonaBona_f>SonaBona_c[SonaBona_e+1])then SonaBona_b=SonaBona_a[#("Cud")];else SonaBona_c[SonaBona_e+3]=SonaBona_f;end elseif(SonaBona_f<SonaBona_c[SonaBona_e+1])then SonaBona_b=SonaBona_a[#("zuC")];else SonaBona_c[SonaBona_e+3]=SonaBona_f;end else SonaBona_c[SonaBona_a[#{{524;492;329;696};"1 + 1 = 111";}]]();end;elseif SonaBona_e<=#("FeUSQEjuKpOABU19GFyrPmRGdUGpZ5oZlUoXIQzWyJUYxUPTE1DRhg0syoP584FPbZnQGeCZfL3fC2isfWV7D")then if SonaBona_e==#("Rf35AtbEYDefWIG9mAANMHmV0Ffv0liHmFhiWLOhYMWBbxfLXfKvHZ4k2if4nQNNuH3rAxmMVsZaUWTEzEJU")then SonaBona_c[SonaBona_a[#("gp")]]=(SonaBona_a[#{{35;658;777;410};{935;998;203;850};{223;484;58;80};}]~=0);else local SonaBona_b=SonaBona_a[#("0s")]local SonaBona_e={SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_i))};local SonaBona_d=0;for SonaBona_a=SonaBona_b,SonaBona_a[#("Gsbe")]do SonaBona_d=SonaBona_d+1;SonaBona_c[SonaBona_a]=SonaBona_e[SonaBona_d];end end;elseif SonaBona_e>#("X9xK7qOFU3h8jgEDYlA37Ko94BfAMFUh3bHHGSDfIhbzSbKQoaLsi0OnUyPHlo3pjaehJ67fTtu0J0r20zkL3C")then local SonaBona_f;local SonaBona_e;SonaBona_c[SonaBona_a[#("QV")]]=SonaBona_c[SonaBona_a[#("Kvr")]][SonaBona_a[#("GoOD")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("z0")]]=SonaBona_c[SonaBona_a[#("N8t")]][SonaBona_a[#("sktg")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{450;697;673;918};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("1Uu")]][SonaBona_a[#("otu6")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("8D")]]=SonaBona_c[SonaBona_a[#("jaH")]][SonaBona_a[#("mtbX")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("0Y")];SonaBona_f=SonaBona_c[SonaBona_a[#("9B4")]];SonaBona_c[SonaBona_e+1]=SonaBona_f;SonaBona_c[SonaBona_e]=SonaBona_f[SonaBona_a[#("ir4M")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("eK")]]=SonaBona_a[#("RdO")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("nR")]SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("1US")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_b=SonaBona_a[#("f7N")];else local SonaBona_e;SonaBona_c[SonaBona_a[#("l2")]]=SonaBona_f[SonaBona_a[#("cRo")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{518;308;192;34};}]]=SonaBona_c[SonaBona_a[#("SlW")]][SonaBona_a[#("vD0G")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ic")]]=SonaBona_a[#("RbB")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("jM")]]=SonaBona_h[SonaBona_a[#("at6")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("f2")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("YKd")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("vc")]]=SonaBona_f[SonaBona_a[#("4pI")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{25;989;585;122};}]]=SonaBona_c[SonaBona_a[#("SQG")]][SonaBona_a[#{"1 + 1 = 111";{987;46;828;851};"1 + 1 = 111";{843;430;886;510};}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("nE")]]=SonaBona_a[#("qFn")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Bc")]]=SonaBona_h[SonaBona_a[#("gAS")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("yc")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("Vvj")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ZM")]][SonaBona_a[#("O81")]]=SonaBona_a[#("RRnG")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("kE")]]=SonaBona_f[SonaBona_a[#("M6L")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("tV")]]=SonaBona_c[SonaBona_a[#("Ytb")]][SonaBona_a[#("3ZcE")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("8M")]]=SonaBona_f[SonaBona_a[#("3ta")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("FY")]]=SonaBona_c[SonaBona_a[#("jSE")]][SonaBona_a[#("cFUm")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("uU")]]=SonaBona_f[SonaBona_a[#{{809;738;937;653};{285;848;509;247};"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4S")]]=SonaBona_c[SonaBona_a[#("XHL")]][SonaBona_a[#("mrnY")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("T6")]]=SonaBona_f[SonaBona_a[#("LEN")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("98")]]=SonaBona_c[SonaBona_a[#("AqP")]][SonaBona_a[#("nubZ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Jm")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("z23")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("VU")]][SonaBona_a[#("e7e")]]=SonaBona_c[SonaBona_a[#("0tYc")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{689;915;283;597};"1 + 1 = 111";}]]=SonaBona_h[SonaBona_a[#("DTa")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("O5")]]=SonaBona_c[SonaBona_a[#("A5s")]][SonaBona_a[#("iYJ9")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("7c")]][SonaBona_a[#{{338;573;516;636};"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("FgFf")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ot")]]=SonaBona_f[SonaBona_a[#("tO2")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ZS")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{778;743;634;927};{498;47;584;776};}]][SonaBona_a[#("tpBv")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Mg")]]=SonaBona_a[#("QJf")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("BD")]]=SonaBona_a[#("Oey")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("if")]]=SonaBona_a[#("ZS7")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("0l")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("YRU")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("FV")]][SonaBona_a[#{"1 + 1 = 111";{802;448;810;572};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("1SOL")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4n")]]=SonaBona_h[SonaBona_a[#("kKK")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("tU")]]=SonaBona_c[SonaBona_a[#("i4L")]][SonaBona_a[#("62QL")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("1R")]][SonaBona_a[#("9YC")]]=SonaBona_c[SonaBona_a[#("vPy8")]];end;elseif SonaBona_e<=#("cxtWic64tnVoR7DhsdFKZFYO4fWQXervScbVpjYcWzbMXLK5yr2Iy1iIIP2cpphp5AHP5R2ioDXAEl1sF1sFlU703EmKrVXHrVQxe5")then if SonaBona_e<=#{{325;362;841;768};"1 + 1 = 111";{575;26;469;722};"1 + 1 = 111";{209;583;840;279};{270;446;776;483};{859;825;74;775};{267;977;135;231};"1 + 1 = 111";{953;311;704;357};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{68;318;3;772};"1 + 1 = 111";{53;945;689;127};"1 + 1 = 111";"1 + 1 = 111";{740;771;98;912};{611;336;567;806};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{135;672;268;235};"1 + 1 = 111";{726;207;15;496};"1 + 1 = 111";"1 + 1 = 111";{565;124;72;880};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{397;614;979;263};"1 + 1 = 111";{878;221;72;336};"1 + 1 = 111";"1 + 1 = 111";{676;7;66;893};{108;627;65;47};"1 + 1 = 111";"1 + 1 = 111";{291;361;702;723};{46;945;419;177};{331;829;927;678};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{525;42;23;344};{340;692;85;63};"1 + 1 = 111";{179;735;143;230};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{523;263;53;851};{579;652;662;237};"1 + 1 = 111";{255;515;508;379};"1 + 1 = 111";"1 + 1 = 111";{853;433;361;223};"1 + 1 = 111";"1 + 1 = 111";{582;748;646;555};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{7;149;817;544};"1 + 1 = 111";{961;382;420;41};"1 + 1 = 111";{255;9;728;76};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{899;954;979;797};"1 + 1 = 111";{173;617;795;68};{22;593;639;702};"1 + 1 = 111";{262;361;70;581};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{841;392;686;965};"1 + 1 = 111";"1 + 1 = 111";{223;674;827;393};}then if SonaBona_e<=#("Kg8AxpZpjgTDCIKFLUK8ihs0VEHr1IblQ8a3QgWaDAt5rgz2R6yZ9XYDXiP2SIzLeHXEHQZE8KGSXyIPfOK5kll2kI")then if SonaBona_e<=#("IC3r4bS0Us5vbh31ArfPzK9Xd7EA3v5t9JrcesLReHYxksJXrtWLe2R7Dfn6Is7zyLxC01WhQzK1WNNVzQiJKuog")then SonaBona_b=SonaBona_a[#{{316;278;322;146};{313;935;626;390};"1 + 1 = 111";}];elseif SonaBona_e==#("tK9ePiWKz9J5g7BHO4QrZkZDDH2jyYdxpKGqXcbpYrxOeZsTSc5AJYbiUHMhqNmL6mPGCjTL2BEIYlyNoiCu3NXCJ")then local SonaBona_i=SonaBona_m[SonaBona_a[#("Oxi")]];local SonaBona_g;local SonaBona_e={};SonaBona_g=SonaBona_q({},{__index=function(SonaBona_b,SonaBona_a)local SonaBona_a=SonaBona_e[SonaBona_a];return SonaBona_a[1][SonaBona_a[2]];end,__newindex=function(SonaBona_c,SonaBona_a,SonaBona_b)local SonaBona_a=SonaBona_e[SonaBona_a]SonaBona_a[1][SonaBona_a[2]]=SonaBona_b;end;});for SonaBona_f=1,SonaBona_a[#("Ja9j")]do SonaBona_b=SonaBona_b+1;local SonaBona_a=SonaBona_d[SonaBona_b];if SonaBona_a[#("i")]==64 then SonaBona_e[SonaBona_f-1]={SonaBona_c,SonaBona_a[#("Icn")]};else SonaBona_e[SonaBona_f-1]={SonaBona_h,SonaBona_a[#("lz6")]};end;SonaBona_j[#SonaBona_j+1]=SonaBona_e;end;SonaBona_c[SonaBona_a[#("I7")]]=SonaBona_l(SonaBona_i,SonaBona_g,SonaBona_f);else local SonaBona_a=SonaBona_a[#("qE")]local SonaBona_d,SonaBona_b=SonaBona_k(SonaBona_c[SonaBona_a](SonaBona_c[SonaBona_a+1]))SonaBona_i=SonaBona_b+SonaBona_a-1 local SonaBona_b=0;for SonaBona_a=SonaBona_a,SonaBona_i do SonaBona_b=SonaBona_b+1;SonaBona_c[SonaBona_a]=SonaBona_d[SonaBona_b];end;end;elseif SonaBona_e<=#("HqB48keWR2kWrIstIiuDuIi82hl1Rszn7eNDk8CsEcEGDD13cKfPgfc8hCb09mezE6Zm50jJQc9sdNGAprZhnUh2cOuS")then if SonaBona_e==#("Msr7fcGNP7lBG8efT5F5LKRx7kTZ7krFBMeTSv7KaWLuORSVcWsTZWvcL495sRQFQR944uyy755Y8xTqD8Wk1JQPqch")then local SonaBona_f=SonaBona_a[#("Aj")];local SonaBona_d={};for SonaBona_a=1,#SonaBona_j do local SonaBona_a=SonaBona_j[SonaBona_a];for SonaBona_b=0,#SonaBona_a do local SonaBona_b=SonaBona_a[SonaBona_b];local SonaBona_e=SonaBona_b[1];local SonaBona_a=SonaBona_b[2];if SonaBona_e==SonaBona_c and SonaBona_a>=SonaBona_f then SonaBona_d[SonaBona_a]=SonaBona_e[SonaBona_a];SonaBona_b[1]=SonaBona_d;end;end;end;else local SonaBona_a=SonaBona_a[#("S6")]local SonaBona_d,SonaBona_b=SonaBona_k(SonaBona_c[SonaBona_a](SonaBona_c[SonaBona_a+1]))SonaBona_i=SonaBona_b+SonaBona_a-1 local SonaBona_b=0;for SonaBona_a=SonaBona_a,SonaBona_i do SonaBona_b=SonaBona_b+1;SonaBona_c[SonaBona_a]=SonaBona_d[SonaBona_b];end;end;elseif SonaBona_e>#("vcrsffP7RX0Ry5V40HdolSDt4FOgauO2mLb5NMS3RWJPheX6XVYT93MOK7zLCI6xj8FX30qnYkHziXm0SRtpG43s8yvQn")then SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_f[SonaBona_a[#("4YI")]];else local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("QM")]]=SonaBona_c[SonaBona_a[#("1qi")]][SonaBona_a[#("n5U6")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("uX")]]=SonaBona_a[#("9YE")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("2C")]]=SonaBona_a[#("DNq")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("St")]]=SonaBona_a[#{"1 + 1 = 111";{913;180;478;645};{641;158;716;936};}];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#{"1 + 1 = 111";{82;796;758;908};"1 + 1 = 111";}]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("lU")]]=SonaBona_f[SonaBona_a[#("PYi")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("D2")]]=SonaBona_c[SonaBona_a[#("vAg")]][SonaBona_a[#("gWiC")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("P2")]]=SonaBona_c[SonaBona_a[#("880")]][SonaBona_a[#("84Qo")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("bB")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("q5l")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#{"1 + 1 = 111";{350;789;59;13};}];SonaBona_h=SonaBona_c[SonaBona_a[#("Mk4")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("hQmk")]];end;elseif SonaBona_e<=#("Bj0mFjKac6EK5YxmFWVI2VnQ1pflYGFLaQUxJ6rdpROyV58e6W2J4PoP5jupdzmHB2KoeaNIESslg055qaobN5QuBeCAMc91Fh")then if SonaBona_e<=#("2vT96itfmxdJeoz9djk3FmoYaIn6CTBQ84cKHbs3s0E7xFxkmd5SunBQg58y5yNE6yKjmZCc0rKPTrBGlcUzXTvUEvEMc585")then if SonaBona_e==#("9b94m8yL31dNW7YEDm2NoRncZQ0u094sPBTpCL8exX31rhSzPhKTgs9rY6eHicV47U8unJb1nXqBYxUS7BQSAlmvCBCFGB5")then local SonaBona_h;local SonaBona_e;SonaBona_e=SonaBona_a[#("Dp")];SonaBona_h=SonaBona_c[SonaBona_a[#("2A2")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("qi8q")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("LO")]]=SonaBona_a[#("Vn4")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("oH")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("S2m")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("fP")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{933;506;312;26};}]][SonaBona_a[#("ZSHo")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("xI")];SonaBona_h=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{380;561;740;12};{72;568;628;373};}]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("spqn")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("H7")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("qG")]]=SonaBona_f[SonaBona_a[#("RUV")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Rl")]]=SonaBona_c[SonaBona_a[#("WfU")]][SonaBona_a[#("58Sk")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Ua")]]=SonaBona_c[SonaBona_a[#("S6B")]][SonaBona_a[#("kToS")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Ns")]]=SonaBona_c[SonaBona_a[#("6Kr")]][SonaBona_a[#("C9ir")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("SM")];SonaBona_h=SonaBona_c[SonaBona_a[#("5ny")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("3YZX")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Ep")]]=SonaBona_a[#("GYa")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#{"1 + 1 = 111";{336;847;407;389};}]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#{{18;509;790;723};{370;882;305;355};{404;927;884;995};}]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];if SonaBona_c[SonaBona_a[#("16")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("ehN")];end;else SonaBona_c[SonaBona_a[#("Fx")]]();end;elseif SonaBona_e>#("c94IixkgfSFsbIEBmvJRxcEVHN2WgGuW26yYDlKKpJMSQ4t46asj2o7aFibGFz9JxSBfjQ8bW8CXAWeMs8Zfnl4O8yttkef1J")then local SonaBona_b=SonaBona_a[#("br")]local SonaBona_d,SonaBona_a=SonaBona_k(SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_a[#("Bui")])))SonaBona_i=SonaBona_a+SonaBona_b-1 local SonaBona_a=0;for SonaBona_b=SonaBona_b,SonaBona_i do SonaBona_a=SonaBona_a+1;SonaBona_c[SonaBona_b]=SonaBona_d[SonaBona_a];end;else SonaBona_c[SonaBona_a[#("CF")]][SonaBona_a[#("Pyi")]]=SonaBona_c[SonaBona_a[#("f7Dc")]];end;elseif SonaBona_e<=#{"1 + 1 = 111";{892;647;906;470};"1 + 1 = 111";"1 + 1 = 111";{314;16;758;582};"1 + 1 = 111";{511;205;828;244};"1 + 1 = 111";"1 + 1 = 111";{532;12;181;947};{601;962;68;404};"1 + 1 = 111";"1 + 1 = 111";{136;485;482;90};{655;52;862;167};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{243;810;727;635};"1 + 1 = 111";"1 + 1 = 111";{841;663;761;797};{487;682;179;273};{552;936;90;255};{157;404;528;904};"1 + 1 = 111";"1 + 1 = 111";{790;365;56;523};{260;921;381;749};{23;910;613;136};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{285;895;438;885};"1 + 1 = 111";{733;118;237;686};"1 + 1 = 111";"1 + 1 = 111";{322;808;929;350};{514;864;843;998};{955;550;618;747};{408;546;644;242};{759;509;677;156};{212;408;781;297};{552;961;209;315};"1 + 1 = 111";"1 + 1 = 111";{822;219;705;521};{290;274;576;77};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{258;821;670;18};"1 + 1 = 111";"1 + 1 = 111";{118;452;590;502};"1 + 1 = 111";{636;598;570;669};{602;969;27;853};"1 + 1 = 111";"1 + 1 = 111";{807;466;837;285};{206;969;682;695};"1 + 1 = 111";{13;270;452;858};"1 + 1 = 111";"1 + 1 = 111";{402;226;875;64};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{115;328;578;477};{266;230;577;895};"1 + 1 = 111";"1 + 1 = 111";{958;282;131;93};{859;446;162;707};"1 + 1 = 111";{854;930;529;240};{769;153;433;682};"1 + 1 = 111";{599;859;600;750};{873;228;823;959};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{351;311;214;828};"1 + 1 = 111";{429;550;320;18};"1 + 1 = 111";"1 + 1 = 111";{689;925;516;358};"1 + 1 = 111";"1 + 1 = 111";{486;236;190;538};"1 + 1 = 111";}then if SonaBona_e==#("JusESrrYsVyV09k8uZR4uJ8a0nbxk2qVrxAAgMibaVvHJQfqDRkrtTJ9vrOEp4OAEMDEJU2TRQ4KmBCkhV3DR9CIYBeY7OVfh6d")then local SonaBona_e;SonaBona_c[SonaBona_a[#("y9")]]=SonaBona_h[SonaBona_a[#("EJJ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("NV")]]=SonaBona_f[SonaBona_a[#("C7h")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{356;799;696;973};}]][SonaBona_a[#("gLh")]]=SonaBona_c[SonaBona_a[#("yp4O")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("xM")]]=SonaBona_f[SonaBona_a[#("MLd")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Iy")]]=SonaBona_c[SonaBona_a[#("TPS")]][SonaBona_a[#("SNC2")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{974;405;146;157};{153;442;719;998};}]]=SonaBona_a[#("s1q")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ft")]]=SonaBona_h[SonaBona_a[#("sYZ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Wz")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("CjL")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("8m")]]=SonaBona_h[SonaBona_a[#("fSP")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("pS")]][SonaBona_a[#("poO")]]=SonaBona_c[SonaBona_a[#("j8cA")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Al")]]=SonaBona_f[SonaBona_a[#("O9W")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("3t")]]=SonaBona_c[SonaBona_a[#("aTa")]][SonaBona_a[#("H4pG")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("y0")]]=SonaBona_c[SonaBona_a[#("rpy")]][SonaBona_a[#("ZJoF")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("bW")]][SonaBona_a[#("Pix")]]=SonaBona_c[SonaBona_a[#("EBEx")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("nE")]]=SonaBona_f[SonaBona_a[#("r8D")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("86")]]=SonaBona_c[SonaBona_a[#("hHv")]][SonaBona_a[#("7FPJ")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("jm")]]=SonaBona_a[#("aKY")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("bv")]]=SonaBona_a[#("6gN")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("xL")]]=SonaBona_a[#("a3u")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("RP")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("fXK")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("nl")]][SonaBona_a[#("Y9t")]]=SonaBona_c[SonaBona_a[#("4ZKi")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];do return end;else SonaBona_c[SonaBona_a[#("57")]]=SonaBona_c[SonaBona_a[#("VL2")]];end;elseif SonaBona_e>#("mMRTZCLOZ9W4ZEvEakSFk5PiPdVc4ZDqyF7GekOpyXTZOj9Erqe6nJWq6JdVQJTaHGGtG0A0HDgym0EGeqUOUGcZTRKFh2JZdTshO")then local SonaBona_a=SonaBona_a[#("BO")]SonaBona_c[SonaBona_a]=SonaBona_c[SonaBona_a]()else local SonaBona_b=SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}];local SonaBona_d=SonaBona_c[SonaBona_a[#("vdP")]];SonaBona_c[SonaBona_b+1]=SonaBona_d;SonaBona_c[SonaBona_b]=SonaBona_d[SonaBona_a[#{{530;588;154;607};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]];end;elseif SonaBona_e<=#("8C0ozVCzefeIRAYfpaDQLYq5SP3qtDIx1zrrXGhryuMEBJlja8DrP7ejl5GU1keLHSQrhHrU3ksqmWEiDUqv9qR4uig29xAmpa6S34bEQTzEO")then if SonaBona_e<=#("7zBxrh4TLqaV69AAUGVgalZVpJSWQq1nqHkRBMfssGzQSh7cdp93TIXVKPhTAhduAWFAYT8hBCYEXjdhLPTAr7FTUAhVFx3kDdp6NInuq")then if SonaBona_e<=#("DqTs8AM9hUzOdCqWQzMmNdJNbT3hFcByiAFo9BCRjGoiWZaYP02ZTeozRfroHFFesaFN7cWo64dhZB1lTfDOkMPelfH3jmjPajZVtx1")then local SonaBona_e;SonaBona_c[SonaBona_a[#{{377;831;73;969};{670;831;453;753};}]]=SonaBona_c[SonaBona_a[#("VaR")]][SonaBona_a[#("5VzL")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("gJ")]]=SonaBona_a[#("NZC")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("o9")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("0f")]][SonaBona_a[#("5g3")]]=SonaBona_a[#("lS7L")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ty")]]=SonaBona_f[SonaBona_a[#("M38")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("NG")]]=SonaBona_c[SonaBona_a[#("XcG")]][SonaBona_a[#("ZbzU")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("bR")]]=SonaBona_a[#("y3Z")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4X")]]=SonaBona_a[#("mil")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("0r")]]=SonaBona_a[#("S0I")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("4I")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("CvU")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("4S")]][SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{278;95;921;900};}]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{551;84;593;205};"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("xm")]]=SonaBona_f[SonaBona_a[#("vkP")]];elseif SonaBona_e==#("eN2YahKqofGCc04RuBC1F2eUVzgPLg2vn0KHT1deGqPeRSNkpiA35ahlJidMb5Pimknlqx7EyyvonaccW6zCQ9BnTy8LXBcKLH1HEB32")then local SonaBona_e;SonaBona_c[SonaBona_a[#("Np")]]=SonaBona_c[SonaBona_a[#("giK")]][SonaBona_a[#("OsDc")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{485;791;721;94};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("Mfk")]][SonaBona_a[#("RthD")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("ty")]]=SonaBona_f[SonaBona_a[#("Hk3")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("lJ4")]][SonaBona_a[#("srR4")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("LX")]]=SonaBona_f[SonaBona_a[#("NcR")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("vz")]]=SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{798;832;286;321};{87;58;902;744};}]][SonaBona_a[#("Tb3b")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("04")]]=SonaBona_h[SonaBona_a[#("j8J")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("7q")]]=SonaBona_c[SonaBona_a[#("xpi")]]*SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{457;219;470;302};{881;162;270;215};}];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("yt")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("75")]]=SonaBona_a[#("oga")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("V7")]]=SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";{662;900;712;559};}];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("Ia")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("Qpv")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("Qv")]]=SonaBona_c[SonaBona_a[#("D1Y")]]*SonaBona_c[SonaBona_a[#("3A0c")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("GL")]][SonaBona_a[#("slN")]]=SonaBona_c[SonaBona_a[#("PBRU")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_b=SonaBona_a[#("DKj")];else local SonaBona_b=SonaBona_a[#("Fn")]SonaBona_c[SonaBona_b]=SonaBona_c[SonaBona_b](SonaBona_g(SonaBona_c,SonaBona_b+1,SonaBona_a[#("AtS")]))end;elseif SonaBona_e<=#("5GIP37Jfa0fGmCnUaD2zvR6uVNRiGJvcGqUE2JZBAGXL7dyeOXD7bEZoJm3pqAJBFc96RU1BNC904uxRoMFTfyacCG4PPKj96vg4dCx35ct")then if SonaBona_e==#("E8uo0lbP5Zvgb7El0lVdr94JoCOWoMYdeBIDlPZEIFeg992g7lcUqprFeW9yIoAtbrbLza9kvrGX5XJoJHYcJdXYjdzAPB5seVeS7rS7l2")then local SonaBona_a=SonaBona_a[#("7t")]SonaBona_c[SonaBona_a]=SonaBona_c[SonaBona_a](SonaBona_g(SonaBona_c,SonaBona_a+1,SonaBona_i))else local SonaBona_d=SonaBona_a[#("kJ")];local SonaBona_e=SonaBona_c[SonaBona_d]local SonaBona_f=SonaBona_c[SonaBona_d+2];if(SonaBona_f>0)then if(SonaBona_e>SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("GK6")];else SonaBona_c[SonaBona_d+3]=SonaBona_e;end elseif(SonaBona_e<SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("bPO")];else SonaBona_c[SonaBona_d+3]=SonaBona_e;end end;elseif SonaBona_e>#("8UEJqmVYbAyU8FnBuMKF4xmTkT1qrZ10RQZePEim4N42QagmU1xuMxDLHVzIvEHlJHdrQiV0DyLrDtcjMOGBCGotmnH4eK0AfStj6YHMfG2o")then local SonaBona_d=SonaBona_a[#("aG")]local SonaBona_e={SonaBona_c[SonaBona_d](SonaBona_g(SonaBona_c,SonaBona_d+1,SonaBona_i))};local SonaBona_b=0;for SonaBona_a=SonaBona_d,SonaBona_a[#("Msxs")]do SonaBona_b=SonaBona_b+1;SonaBona_c[SonaBona_a]=SonaBona_e[SonaBona_b];end else SonaBona_f[SonaBona_a[#{"1 + 1 = 111";{123;61;637;366};{570;398;532;421};}]]=SonaBona_c[SonaBona_a[#("aP")]];end;elseif SonaBona_e<=#("kimTp6S7gTcrUeCL1V3HklUa2mXg4v6OaIcftlZOiC98r1mTeanU9RM9ym0ciLdVXyrlcxqQ6ozSlWTaadb4hlPs5dRhvXGHzok3KaRSTIYUs4XLE")then if SonaBona_e<=#("beJjNMS8q9PjuiS1s7LZB9xtkJx4abpfOGVB7pLJkMURcKnPbBL0aOzbSp8doX7oTJFYyr4dvbOZpQqLvR3KBAf9hTTSqHuyOG7EezrUGIE8aKW")then if SonaBona_e==#{{239;223;288;172};"1 + 1 = 111";{731;966;967;562};"1 + 1 = 111";{403;937;749;94};"1 + 1 = 111";{828;86;684;90};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{946;200;984;604};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{782;213;9;431};{820;620;617;979};{144;65;58;201};"1 + 1 = 111";"1 + 1 = 111";{787;643;656;985};{916;916;647;808};{676;472;2;306};"1 + 1 = 111";{642;68;936;475};"1 + 1 = 111";"1 + 1 = 111";{991;310;666;533};{53;441;855;690};{835;210;550;71};"1 + 1 = 111";{772;153;681;82};"1 + 1 = 111";{947;957;190;786};{407;814;100;77};{337;965;292;611};{32;191;960;801};{771;364;287;844};{213;674;787;871};"1 + 1 = 111";"1 + 1 = 111";{346;801;638;49};"1 + 1 = 111";{203;804;396;95};"1 + 1 = 111";{939;45;39;254};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{675;526;292;156};{19;223;920;234};"1 + 1 = 111";{89;101;575;884};"1 + 1 = 111";{954;837;774;729};"1 + 1 = 111";"1 + 1 = 111";{709;251;557;763};{62;490;440;165};"1 + 1 = 111";{422;3;424;736};"1 + 1 = 111";{590;474;545;439};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{22;193;44;84};{604;602;221;339};"1 + 1 = 111";{698;430;554;364};{24;490;361;515};{232;334;700;167};{403;451;676;369};{621;330;921;722};{672;593;298;445};{399;995;445;26};{648;292;447;5};{619;920;722;840};"1 + 1 = 111";{385;250;913;359};{245;716;619;926};{398;822;182;744};"1 + 1 = 111";"1 + 1 = 111";{92;79;416;38};"1 + 1 = 111";"1 + 1 = 111";{647;726;642;755};"1 + 1 = 111";"1 + 1 = 111";{677;222;601;781};{40;147;774;236};{750;330;599;275};{928;704;921;357};{7;40;492;802};{811;802;175;912};"1 + 1 = 111";"1 + 1 = 111";{373;983;941;853};"1 + 1 = 111";{969;473;859;441};"1 + 1 = 111";{754;13;439;238};{675;128;641;745};{490;34;332;473};"1 + 1 = 111";{3;542;857;255};"1 + 1 = 111";{374;11;574;514};"1 + 1 = 111";}then local SonaBona_i;local SonaBona_h;local SonaBona_e;SonaBona_c[SonaBona_a[#("Ur")]]=SonaBona_a[#("pfz")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("ov")]SonaBona_c[SonaBona_e](SonaBona_c[SonaBona_e+1])SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("S1")]]=SonaBona_f[SonaBona_a[#("OCY")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("yd")]]=SonaBona_c[SonaBona_a[#("k6q")]][SonaBona_a[#("1LF8")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("1P")]]=SonaBona_c[SonaBona_a[#("M0V")]][SonaBona_a[#("HtFV")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("74O")]][SonaBona_a[#("pqeE")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("2D")]]=SonaBona_c[SonaBona_a[#("Mig")]][SonaBona_a[#("goOF")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{"1 + 1 = 111";"1 + 1 = 111";}]]=SonaBona_f[SonaBona_a[#{"1 + 1 = 111";{698;507;47;575};"1 + 1 = 111";}]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#{{288;203;911;269};{972;902;650;460};}];SonaBona_h=SonaBona_c[SonaBona_a[#("nTf")]];SonaBona_c[SonaBona_e+1]=SonaBona_h;SonaBona_c[SonaBona_e]=SonaBona_h[SonaBona_a[#("qEeR")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("dU")]]=SonaBona_a[#("puc")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("2I")]SonaBona_c[SonaBona_e]=SonaBona_c[SonaBona_e](SonaBona_g(SonaBona_c,SonaBona_e+1,SonaBona_a[#("k1D")]))SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("q5")]]=SonaBona_c[SonaBona_a[#("GBD")]][SonaBona_a[#("1L67")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{968;229;843;225};"1 + 1 = 111";}]]=SonaBona_c[SonaBona_a[#("tVO")]][SonaBona_a[#("APKy")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("6W")]]=SonaBona_a[#("38h")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("aK")]]=SonaBona_c[SonaBona_a[#("mRR")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_h=SonaBona_a[#("9t9")];SonaBona_i=SonaBona_c[SonaBona_h]for SonaBona_a=SonaBona_h+1,SonaBona_a[#("Pcgv")]do SonaBona_i=SonaBona_i..SonaBona_c[SonaBona_a];end;SonaBona_c[SonaBona_a[#("8s")]]=SonaBona_i;SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("qE")]]=SonaBona_c[SonaBona_a[#("lad")]][SonaBona_c[SonaBona_a[#{"1 + 1 = 111";{703;627;553;456};{578;632;188;63};{41;942;562;335};}]]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("9h")]]=SonaBona_c[SonaBona_a[#("0Z4")]][SonaBona_a[#("zxmn")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("6i")]]=SonaBona_c[SonaBona_a[#("YyE")]][SonaBona_a[#("yO15")]];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("iJ")]][SonaBona_a[#{"1 + 1 = 111";{956;68;461;247};{36;798;99;298};}]]=SonaBona_c[SonaBona_a[#("yGXb")]];else SonaBona_c[SonaBona_a[#("gP")]]=SonaBona_c[SonaBona_a[#("QGW")]]+SonaBona_c[SonaBona_a[#("6xHy")]];end;elseif SonaBona_e>#("5IvYKWiGp8WF725og8mYj3NZN3pHEuP3hhfFt2vbhhXMkZ29WhZGYCoc5HlRHLb5t3y0XA5nMlQcfbOYbqUxFieP2dKWRPFGf2rqCclxmL4NVm64")then if(SonaBona_a[#("nF")]<SonaBona_c[SonaBona_a[#("KQQp")]])then SonaBona_b=SonaBona_a[#("Bf3")];else SonaBona_b=SonaBona_b+1;end;else local SonaBona_g;local SonaBona_f;local SonaBona_e;SonaBona_c[SonaBona_a[#("CK")]]();SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("7C")]]=SonaBona_a[#("LCo")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#{{355;108;265;829};{332;476;175;223};}]]=SonaBona_a[#("O5y")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_c[SonaBona_a[#("RL")]]=SonaBona_a[#("23W")];SonaBona_b=SonaBona_b+1;SonaBona_a=SonaBona_d[SonaBona_b];SonaBona_e=SonaBona_a[#("TR")];SonaBona_f=SonaBona_c[SonaBona_e]SonaBona_g=SonaBona_c[SonaBona_e+2];if(SonaBona_g>0)then if(SonaBona_f>SonaBona_c[SonaBona_e+1])then SonaBona_b=SonaBona_a[#("xbU")];else SonaBona_c[SonaBona_e+3]=SonaBona_f;end elseif(SonaBona_f<SonaBona_c[SonaBona_e+1])then SonaBona_b=SonaBona_a[#("1xx")];else SonaBona_c[SonaBona_e+3]=SonaBona_f;end end;elseif SonaBona_e<=#("xPp0PAlZS7UZiH7Qj6mTyx8eyj3oB4QgQ4u9oQBCgBTfCIde76LqTkEaQkDFG7yXrOjom7BEFUN6N3N0gZqFszxFAtsdm56jd6YYyY29FhV9IIxXINz")then if SonaBona_e>#("Q3F2qOZ2OxqKYE3RfZCr6r9lOy716GGKHoDjB5HU9avh1lkdOQRSkgUz3to3Q75h1QcJaTpksRs661tCn3nqZYABFephROdbfnqkiLd4BHADXXDc9W")then if not SonaBona_c[SonaBona_a[#("DW")]]then SonaBona_b=SonaBona_b+1;else SonaBona_b=SonaBona_a[#("Fbm")];end;else local SonaBona_d=SonaBona_a[#("o2")];local SonaBona_e=SonaBona_c[SonaBona_d]local SonaBona_f=SonaBona_c[SonaBona_d+2];if(SonaBona_f>0)then if(SonaBona_e>SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("8GB")];else SonaBona_c[SonaBona_d+3]=SonaBona_e;end elseif(SonaBona_e<SonaBona_c[SonaBona_d+1])then SonaBona_b=SonaBona_a[#("IBh")];else SonaBona_c[SonaBona_d+3]=SonaBona_e;end end;elseif SonaBona_e==#("WUOscqMe5DhEOOr1SKjsM0s0ry6ORMni48rqB4n4HHhCsdVZF6UCZDd6CYaPu7xtp9JQvaBYvpWfT1HoMgiV2VsB4vZM3JJJjYlsEfEEF5fKR8nKqVcn")then SonaBona_c[SonaBona_a[#("iu")]]=-SonaBona_c[SonaBona_a[#("gY0")]];else for SonaBona_a=SonaBona_a[#("n5")],SonaBona_a[#("KvN")]do SonaBona_c[SonaBona_a]=nil;end;end;SonaBona_b=SonaBona_b+1;end;end;A,B=SonaBona_n(SonaBona_s(SonaBona_r))if not A[1]then local SonaBona_a=SonaBona_k[4][SonaBona_b]or'?';error('ERROR IN IRONBREW SCRIPT [LINE '..SonaBona_a..']:'..A[2]);wait(9e9);else return SonaBona_g(A,2,B);end;end);end;return SonaBona_l(true,{},SonaBona_r())();end)(string.byte,table.insert,setmetatable);
|
skill_action = {
[17001] = { },
[17002] = { },
[17003] = { },
[31001] = { },
[31002] = { },
[31003] = { },
[31004] = { },
[31005] = { },
[31006] = { },
[31007] = { },
[31008] = { },
[34001] = { },
[35001] = { },
[35002] = { },
[35003] = { },
[35004] = { },
[35005] = { },
[35006] = { },
[35007] = { },
[35008] = { },
[35009] = { },
[35010] = { },
[1100020101] = { },
[1100020102] = { },
[1100020103] = { },
[1100020104] = { },
[1100020201] = { },
[1100020202] = { },
[1100020203] = { },
[1100020204] = { },
[1100020301] = { },
[1100020302] = { },
[1100020303] = { },
[1100020304] = { },
[1100020401] = { },
[1100020402] = { },
[1100020403] = { },
[1100020501] = { },
[2100010101] = { },
[2100010102] = { },
[2100010103] = { },
[2100010201] = { },
[2100010202] = { },
[2100010203] = { },
[2100010204] = { },
[2100010301] = { },
[2100010302] = { },
[2100010303] = { },
[2100010304] = { },
[2100010401] = { },
[2100010402] = { },
[2100010403] = { },
[2100010404] = { },
[1100010101] = { },
[1100010102] = { },
[1100010103] = { },
[1100010201] = { },
[1100010202] = { },
[1100010203] = { },
[1100010204] = { },
[1100010301] = { },
[1100010302] = { },
[1100010303] = { },
[1100010304] = { },
[1100010401] = { },
[1100010402] = { },
[1100010403] = { },
[1100010404] = { },
[3100020101] = { },
[3100020102] = { },
[3100020103] = { },
[3100020104] = { },
[3100020201] = { },
[3100020202] = { },
[3100020203] = { },
[3100020301] = { },
[3100020302] = { },
[3100020303] = { },
[3100020304] = { },
[3100020401] = { },
[3100020402] = { },
[3100020403] = { },
[3100020404] = { },
[2100020101] = { },
[2100020102] = { },
[2100020103] = { },
[2100020104] = { },
[2100020201] = { },
[2100020202] = { },
[2100020203] = { },
[2100020204] = { },
[2100020301] = { },
[2100020302] = { },
[2100020303] = { },
[2100020304] = { },
[2100020401] = { },
[2100020402] = { },
[2100020403] = { },
}
return skill_action
|
-------------------------------------------------------------------------------
-- DungeonWaypoints by Artoo, US-Lightbringer
-- <Psychosocial>, http://psychosocial-lightbringer.enjin.com
-------------------------------------------------------------------------------
local AceLocale = LibStub:GetLibrary("AceLocale-3.0")
local L = AceLocale:NewLocale("DungeonWaypoints", "ruRU", false, false);
if not L then return end
L["Hello World!"] = "Hello World!" -- Requires localization
L["Unsupported command: %s"] = "Unsupported command: %s" -- Requires localization
L["Waypoint not added: %s"] = "Waypoint not added: %s" -- Requires localization
L["Portal"] = "Portal" -- Requires localization
L["Meeting Stone"] = "Meeting Stone" -- Requires localization
L["Entrance"] = "Entrance" -- Requires localization
L["Brazilian Portuguese"] = "Brazilian Portuguese" -- Requires localization
L["English (US)"] = "English (US)" -- Requires localization
L["French"] = "French" -- Requires localization
L["German"] = "German" -- Requires localization
L["Italian"] = "Italian" -- Requires localization
L["Korean"] = "Korean" -- Requires localization
L["Latin American Spanish"] = "Latin American Spanish" -- Requires localization
L["Russian"] = "Russian" -- Requires localization
L["Simplified Chinese"] = "Simplified Chinese" -- Requires localization
L["Spanish"] = "Spanish" -- Requires localization
L["Traditional Chinese"] = "Traditional Chinese" -- Requires localization
L["Translations Provided By..."] = "Translations Provided By..." -- Requires localization
L["Translators Needed!"] = "Translators Needed!" -- Requires localization
-- Dungeons
L["Ragefire Chasm"] = "Ragefire Chasm" -- Requires localization
L["The Deadmines"] = "The Deadmines" -- Requires localization
L["Wailing Caverns"] = "Wailing Caverns" -- Requires localization
L["Shadowfang Keep"] = "Shadowfang Keep" -- Requires localization
L["Blackfathom Deeps"] = "Blackfathom Deeps" -- Requires localization
L["The Stockade"] = "The Stockade" -- Requires localization
L["Gnomeregan"] = "Gnomeregan" -- Requires localization
L["Scarlet Monastery: Scarlet Halls"] = "Scarlet Monastery: Scarlet Halls" -- Requires localization
L["Scarlet Monastery: Scarlet Cathedral"] = "Scarlet Monastery: Scarlet Cathedral" -- Requires localization
L["Razorfen Kraul"] = "Razorfen Kraul" -- Requires localization
L["Maraudon Orange"] = "Maraudon Orange" -- Requires localization
L["Maraudon Purple"] = "Maraudon Purple" -- Requires localization
L["Uldaman"] = "Uldaman" -- Requires localization
L["Scholomance"] = "Scholomance" -- Requires localization
L["Razorfen Downs"] = "Razorfen Downs" -- Requires localization
L["Dire Maul: East"] = "Dire Maul: East" -- Requires localization
L["Dire Maul: North"] = "Dire Maul: North" -- Requires localization
L["Dire Maul: West"] = "Dire Maul: West" -- Requires localization
L["Zul'Farrak"] = "Zul'Farrak" -- Requires localization
L["Stratholme: Live Side"] = "Stratholme: Live Side" -- Requires localization
L["Stratholme: Dead Side"] = "Stratholme: Dead Side" -- Requires localization
L["Sunken Temple"] = "Sunken Temple" -- Requires localization
L["Blackrock Depths"] = "Blackrock Depths" -- Requires localization
L["Lower Blackrock Spire"] = "Lower Blackrock Spire" -- Requires localization
L["Upper Blackrock Spire"] = "Upper Blackrock Spire" -- Requires localization
L["Hellfire Citadel: Hellfire Ramparts"] = "Hellfire Citadel: Hellfire Ramparts" -- Requires localization
L["Hellfire Citadel: The Blood Furnace"] = "Hellfire Citadel: The Blood Furnace" -- Requires localization
L["Coilfang Reservoir: The Slave Pens"] = "Coilfang Reservoir: The Slave Pens" -- Requires localization
L["Coilfang Reservoir: The Underbog"] = "Coilfang Reservoir: The Underbog" -- Requires localization
L["Auchindoun: Mana-Tombs"] = "Auchindoun: Mana-Tombs" -- Requires localization
L["Auchindoun: Auchenai Crypts"] = "Auchindoun: Auchenai Crypts" -- Requires localization
L["Auchindoun: Sethekk Halls"] = "Auchindoun: Sethekk Halls" -- Requires localization
L["Caverns of Time: Old Hillsbrad Foothills"] = "Caverns of Time: Old Hillsbrad Foothills" -- Requires localization
L["Auchindoun: Shadow Labyrinth"] = "Auchindoun: Shadow Labyrinth" -- Requires localization
L["Caverns of Time: The Black Morass"] = "Caverns of Time: The Black Morass" -- Requires localization
L["Coilfang Reservoir: The Steamvault"] = "Coilfang Reservoir: The Steamvault" -- Requires localization
L["Hellfire Citadel: The Shattered Halls"] = "Hellfire Citadel: The Shattered Halls" -- Requires localization
L["Tempest Keep: The Arcatraz"] = "Tempest Keep: The Arcatraz" -- Requires localization
L["Tempest Keep: The Botanica"] = "Tempest Keep: The Botanica" -- Requires localization
L["Tempest Keep: The Mechanar"] = "Tempest Keep: The Mechanar" -- Requires localization
L["Magisters' Terrace"] = "Magisters' Terrace" -- Requires localization
L["Utgarde Keep"] = "Utgarde Keep" -- Requires localization
L["The Nexus"] = "The Nexus" -- Requires localization
L["Azjol-Nerub"] = "Azjol-Nerub" -- Requires localization
L["Ahn'kahet: The Old Kingdom"] = "Ahn'kahet: The Old Kingdom" -- Requires localization
L["Drak'Tharon Keep"] = "Drak'Tharon Keep" -- Requires localization
L["The Violet Hold"] = "The Violet Hold" -- Requires localization
L["Gundrak"] = "Gundrak" -- Requires localization
L["Halls of Stone"] = "Halls of Stone" -- Requires localization
L["Halls of Lightning"] = "Halls of Lightning" -- Requires localization
L["Utgarde Pinnacle"] = "Utgarde Pinnacle" -- Requires localization
L["The Oculus"] = "The Oculus" -- Requires localization
L["Caverns of Time: The Culling of Stratholme"] = "Caverns of Time: The Culling of Stratholme" -- Requires localization
L["Trial of the Champion"] = "Trial of the Champion" -- Requires localization
L["The Forge of Souls"] = "The Forge of Souls" -- Requires localization
L["Pit of Saron"] = "Pit of Saron" -- Requires localization
L["Halls of Reflection"] = "Halls of Reflection" -- Requires localization
L["Blackrock Caverns"] = "Blackrock Caverns" -- Requires localization
L["Throne of the Tides"] = "Throne of the Tides" -- Requires localization
L["The Stonecore"] = "The Stonecore" -- Requires localization
L["The Vortex Pinnacle"] = "The Vortex Pinnacle" -- Requires localization
L["Grim Batol"] = "Grim Batol" -- Requires localization
L["Halls of Origination"] = "Halls of Origination" -- Requires localization
L["Lost City of the Tol'vir"] = "Lost City of the Tol'vir" -- Requires localization
L["Zul'Aman"] = "Zul'Aman" -- Requires localization
L["Zul'Gurub"] = "Zul'Gurub" -- Requires localization
L["End Time"] = "End Time" -- Requires localization
L["Well of Eternity"] = "Well of Eternity" -- Requires localization
L["Hour of Twilight"] = "Hour of Twilight" -- Requires localization
L["Temple of the Jade Serpent"] = "Temple of the Jade Serpent" -- Requires localization
L["Stormstout Brewery"] = "Stormstout Brewery" -- Requires localization
L["Shado-Pan Monastery"] = "Shado-Pan Monastery" -- Requires localization
L["Mogu'shan Palace"] = "Mogu'shan Palace" -- Requires localization
L["Gate of the Setting Sun"] = "Gate of the Setting Sun" -- Requires localization
L["Siege of Niuzao Temple"] = "Siege of Niuzao Temple" -- Requires localization
L["Bloodmaul Slag Mines"] = "Bloodmaul Slag Mines" -- Requires localization
L["Iron Docks"] = "Iron Docks" -- Requires localization
L["Auchindoun"] = "Auchindoun" -- Requires localization
L["Skyreach"] = "Skyreach" -- Requires localization
L["The Everbloom"] = "The Everbloom" -- Requires localization
L["Grimrail Depot"] = "Grimrail Depot" -- Requires localization
L["Shadowmoon Burial Grounds"] = "Shadowmoon Burial Grounds" -- Requires localization
-- Raids
L["Molten Core"] = "Molten Core" -- Requires localization
L["Blackwing Lair"] = "Blackwing Lair" -- Requires localization
L["Ruins of Ahn'Qiraj (AQ 20)"] = "Ruins of Ahn'Qiraj (AQ 20)" -- Requires localization
L["Temple of Ahn'Qiraj (AQ 40)"] = "Temple of Ahn'Qiraj (AQ 40)" -- Requires localization
L["Karazhan"] = "Karazhan" -- Requires localization
L["Gruul's Lair"] = "Gruul's Lair" -- Requires localization
L["Hellfire Citadel: Magtheridon's Lair"] = "Hellfire Citadel: Magtheridon's Lair" -- Requires localization
L["Coilfang Reservoir: Serpentshrine Cavern"] = "Coilfang Reservoir: Serpentshrine Cavern" -- Requires localization
L["Tempest Keep: The Eye"] = "Tempest Keep: The Eye" -- Requires localization
L["Black Temple"] = "Black Temple" -- Requires localization
L["Caverns of Time: Hyjal Summit"] = "Caverns of Time: Hyjal Summit" -- Requires localization
L["Sunwell Plateau"] = "Sunwell Plateau" -- Requires localization
L["Vault of Archavon"] = "Vault of Archavon" -- Requires localization
L["Eye of Eternity"] = "Eye of Eternity" -- Requires localization
L["Naxxramas"] = "Naxxramas" -- Requires localization
L["The Obsidian Sanctum"] = "The Obsidian Sanctum" -- Requires localization
L["Ulduar"] = "Ulduar" -- Requires localization
L["Onyxia's Lair"] = "Onyxia's Lair" -- Requires localization
L["Trial of the Crusader"] = "Trial of the Crusader" -- Requires localization
L["Icecrown Citadel"] = "Icecrown Citadel" -- Requires localization
L["The Ruby Sanctum"] = "The Ruby Sanctum" -- Requires localization
L["Baradin Hold"] = "Baradin Hold" -- Requires localization
L["The Bastion of Twilight"] = "The Bastion of Twilight" -- Requires localization
L["Blackwing Descent"] = "Blackwing Descent" -- Requires localization
L["Throne of the Four Winds"] = "Throne of the Four Winds" -- Requires localization
L["Firelands"] = "Firelands" -- Requires localization
L["Dragon Soul"] = "Dragon Soul" -- Requires localization
L["Mogu'shan Vaults"] = "Mogu'shan Vaults" -- Requires localization
L["Heart of Fear"] = "Heart of Fear" -- Requires localization
L["Terrace of Endless Spring"] = "Terrace of Endless Spring" -- Requires localization
L["Throne of Thunder"] = "Throne of Thunder" -- Requires localization
L["Siege of Orgrimmar"] = "Siege of Orgrimmar" -- Requires localization
L["Highmaul"] = "Highmaul" -- Requires localization
L["Blackrock Foundry"] = "Blackrock Foundry" -- Requires localization
L["Hellfire Citadel"] = "Hellfire Citadel" -- Requires localization
|
local skynet = require "skynet"
local area_list = require "area_list"
local M = {}
function M:init()
self.area_tbl = {}
self:create_area_by_list()
end
function M:create_area_by_list()
for _,v in ipairs(area_list) do
--skynet.error("创建游戏赛场 "..v.name)
local addr = skynet.newservice(v.service, v.id)
self.area_tbl[v.id] = {addr = addr}
end
end
function M:get_area(game_id)
return self.area_tbl[game_id]
end
function M:create_area(service, id)
local addr = skynet.newservice(service, id)
self.area_tbl[id] = {addr = addr}
end
return M
|
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP .. "/intllib.lua")
-- 0.4.17 or 5.0 check
local y_off = 20
if minetest.registered_nodes["default:permafrost"] then
y_off = 10
end
-- rideable horse
mobs:register_mob("mob_horse:horse", {
type = "animal",
visual = "mesh",
visual_size = {x = 1.20, y = 1.20},
mesh = "mobs_horse.x",
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.25, 0.4},
animation = {
speed_normal = 15,
speed_run = 30,
stand_start = 25,
stand_end = 75,
walk_start = 75,
walk_end = 100,
run_start = 75,
run_end = 100,
},
textures = {
{"mobs_horse.png"}, -- textures by Mjollna
{"mobs_horsepeg.png"},
{"mobs_horseara.png"}
},
fear_height = 3,
runaway = true,
fly = false,
walk_chance = 60,
view_range = 5,
follow = {"farming:wheat", "default:apple"},
passive = true,
hp_min = 12,
hp_max = 16,
armor = 200,
lava_damage = 5,
fall_damage = 5,
water_damage = 1,
makes_footstep_sound = true,
drops = {
{name = "mobs:leather", chance = 1, min = 0, max = 2}
},
do_custom = function(self, dtime)
-- set needed values if not already present
if not self.v2 then
self.v2 = 0
self.max_speed_forward = 6
self.max_speed_reverse = 2
self.accel = 6
self.terrain_type = 3
self.driver_attach_at = {x = 0, y = y_off, z = -2}
self.driver_eye_offset = {x = 0, y = 3, z = 0}
end
-- if driver present allow control of horse
if self.driver then
mobs.drive(self, "walk", "stand", false, dtime)
return false -- skip rest of mob functions
end
return true
end,
on_die = function(self, pos)
-- drop saddle when horse is killed while riding
-- also detach from horse properly
if self.driver then
minetest.add_item(pos, "mobs:saddle")
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
self.saddle = nil
end
-- drop any horseshoes added
if self.shoed then
minetest.add_item(pos, self.shoed)
end
end,
on_rightclick = function(self, clicker)
-- make sure player is clicking
if not clicker or not clicker:is_player() then
return
end
-- feed, tame or heal horse
if mobs:feed_tame(self, clicker, 10, true, true) then
return
end
-- applying protection rune
if mobs:protect(self, clicker) then
return
end
-- make sure tamed horse is being clicked by owner only
if self.tamed and self.owner == clicker:get_player_name() then
local inv = clicker:get_inventory()
-- detatch player already riding horse
if self.driver and clicker == self.driver then
mobs.detach(clicker, {x = 1, y = 0, z = 1})
-- add saddle back to inventory
if inv:room_for_item("main", "mobs:saddle") then
inv:add_item("main", "mobs:saddle")
else
minetest.add_item(clicker:get_pos(), "mobs:saddle")
end
self.saddle = nil
-- attach player to horse
elseif (not self.driver
and clicker:get_wielded_item():get_name() == "mobs:saddle")
or self.saddle then
self.object:set_properties({stepheight = 1.1})
mobs.attach(self, clicker)
-- take saddle from inventory
if not self.saddle then
inv:remove_item("main", "mobs:saddle")
end
self.saddle = true
end
end
-- used to capture horse with magic lasso
mobs:capture_mob(self, clicker, 0, 0, 80, false, nil)
end
})
mobs:spawn({
name = "mob_horse:horse",
nodes = {"default:dirt_with_grass", "ethereal:dry_dirt"},
min_light = 14,
interval = 60,
chance = 16000,
min_height = 10,
max_height = 31000,
day_toggle = true,
})
mobs:register_egg("mob_horse:horse", S("Horse"), "wool_brown.png", 1)
-- horseshoe helper function
local apply_shoes = function(name, itemstack, obj, shoes, speed, jump, reverse)
if obj.type ~= "object" then return end
local mob = obj.ref
local ent = mob:get_luaentity()
if ent and ent.name and ent.name == "mob_horse:horse" then
if ent.shoed then
minetest.add_item(mob:get_pos(), ent.shoed)
end
ent.max_speed_forward = speed
ent.jump_height = jump
ent.max_speed_reverse = reverse
ent.accel = speed
ent.shoed = shoes
minetest.chat_send_player(name, S("Horse shoes fitted -")
.. S(" speed: ") .. speed
.. S(" , jump height: ") .. jump
.. S(" , stop speed: ") .. reverse)
itemstack:take_item() ; return itemstack
else
minetest.chat_send_player(name, S("Horse shoes only work on horses!"))
end
end
-- steel horseshoes
minetest.register_craftitem(":mobs:horseshoe_steel", {
description = S("Steel HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_steel.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_steel", 7, 4, 2)
end,
})
minetest.register_craft({
output = "mobs:horseshoe_steel",
recipe = {
{"", "default:steelblock", ""},
{"default:steel_ingot", "", "default:steel_ingot"},
{"default:steel_ingot", "", "default:steel_ingot"},
}
})
-- bronze horseshoes
minetest.register_craftitem(":mobs:horseshoe_bronze", {
description = S("Bronze HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_bronze.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_bronze", 7, 4, 4)
end,
})
minetest.register_craft({
output = "mobs:horseshoe_bronze",
recipe = {
{"", "default:bronzeblock", ""},
{"default:bronze_ingot", "", "default:bronze_ingot"},
{"default:bronze_ingot", "", "default:bronze_ingot"},
}
})
-- mese horseshoes
minetest.register_craftitem(":mobs:horseshoe_mese", {
description = S("Mese HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_mese.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_mese", 9, 5, 8)
end,
})
minetest.register_craft({
output = "mobs:horseshoe_mese",
recipe = {
{"", "default:mese", ""},
{"default:mese_crystal_fragment", "", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "", "default:mese_crystal_fragment"},
}
})
-- diamond horseshoes
minetest.register_craftitem(":mobs:horseshoe_diamond", {
description = S("Diamond HorseShoes (use on horse to apply)"),
inventory_image = "mobs_horseshoe_diamond.png",
on_use = function(itemstack, user, pointed_thing)
return apply_shoes(user:get_player_name(), itemstack, pointed_thing,
"mobs:horseshoe_diamond", 10, 6, 6)
end,
})
minetest.register_craft({
output = "mobs:horseshoe_diamond",
recipe = {
{"", "default:diamondblock", ""},
{"default:diamond", "", "default:diamond"},
{"default:diamond", "", "default:diamond"},
}
})
-- lucky blocks
if minetest.get_modpath("lucky_block") then
lucky_block:add_blocks({
{"dro", {"mobs:horseshoe_steel"}},
{"dro", {"mobs:horseshoe_bronze"}},
{"dro", {"mobs:horseshoe_mese"}},
{"dro", {"mobs:horseshoe_diamond"}},
})
end
|
local db = require('persistable')('working_directory')
local shell = require('shell')
local arg = ...
local wdName = arg or 'default'
local wdTable = db.read() or {}
local cwd = shell.getWorkingDirectory()
wdTable[wdName] = cwd
db.write(wdTable)
print('> new "' .. wdName .. '" working dir: ' .. cwd) |
AddCSLuaFile()
ENT.Base = "npc_nb_base"
// Moddable
ENT.AttackAnims = { "attackB", "attackD", "attackE", "attackF", "swatleftmid", "swatrightmid" }
ENT.AnimSpeed = 1.2
ENT.AttackTime = 0.5
ENT.MeleeDistance = 64
ENT.BreakableDistance = 96
ENT.Damage = 60
ENT.BaseHealth = 200
ENT.MoveSpeed = 50
ENT.MoveAnim = ACT_WALK
ENT.Models = nil
ENT.Model = Model( "models/zombie/classic.mdl" )
ENT.VoiceSounds = {}
ENT.VoiceSounds.Death = { Sound( "npc/zombie/zombie_die1.wav" ),
Sound( "npc/zombie/zombie_die2.wav" ),
Sound( "npc/zombie/zombie_die3.wav" ),
Sound( "npc/zombie/zombie_voice_idle6.wav" ),
Sound( "npc/zombie/zombie_voice_idle11.wav" ) }
ENT.VoiceSounds.Pain = { Sound( "npc/zombie/zombie_pain1.wav" ),
Sound( "npc/zombie/zombie_pain2.wav" ),
Sound( "npc/zombie/zombie_pain3.wav" ),
Sound( "npc/zombie/zombie_pain4.wav" ),
Sound( "npc/zombie/zombie_pain5.wav" ),
Sound( "npc/zombie/zombie_pain6.wav" ),
Sound( "npc/zombie/zombie_alert1.wav" ),
Sound( "npc/zombie/zombie_alert2.wav" ),
Sound( "npc/zombie/zombie_alert3.wav" ) }
ENT.VoiceSounds.Taunt = { Sound( "npc/zombie/zombie_voice_idle1.wav" ),
Sound( "npc/zombie/zombie_voice_idle2.wav" ),
Sound( "npc/zombie/zombie_voice_idle3.wav" ),
Sound( "npc/zombie/zombie_voice_idle4.wav" ),
Sound( "npc/zombie/zombie_voice_idle5.wav" ),
Sound( "npc/zombie/zombie_voice_idle7.wav" ),
Sound( "npc/zombie/zombie_voice_idle8.wav" ),
Sound( "npc/zombie/zombie_voice_idle9.wav" ),
Sound( "npc/zombie/zombie_voice_idle10.wav" ),
Sound( "npc/zombie/zombie_voice_idle12.wav" ),
Sound( "npc/zombie/zombie_voice_idle13.wav" ),
Sound( "npc/zombie/zombie_voice_idle14.wav" ) }
ENT.VoiceSounds.Attack = { Sound( "npc/zombie/zo_attack1.wav" ),
Sound( "npc/zombie/zo_attack2.wav" ) }
ENT.Torso = Model( "models/zombie/classic_torso.mdl" )
function ENT:OnDeath( dmginfo )
for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
if v:GetPos():Distance( self.Entity:GetPos() ) < 150 then
v:TakeDamage( 40, self.Entity )
v:SetInfected( true )
umsg.Start( "Drunk", v )
umsg.Short( 2 )
umsg.End()
end
end
local ed = EffectData()
ed:SetOrigin( self.Entity:GetPos() )
util.Effect( "puke_spray", ed, true, true )
if dmginfo:IsExplosionDamage() then
local ed = EffectData()
ed:SetOrigin( self.Entity:GetPos() )
util.Effect( "gore_explosion", ed, true, true )
end
self.Entity:SpawnRagdoll( dmginfo, self.Torso, self.Entity:GetPos() + Vector(0,0,50), true )
self.Entity:SetModel( self.Legs )
end
function ENT:OnHitEnemy( enemy )
enemy:TakeDamage( self.Damage, self.Entity )
enemy:ViewBounce( 30 )
umsg.Start( "Drunk", enemy )
umsg.Short( 3 )
umsg.End()
end |
AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include('shared.lua')
include("STALKERNPCBaseVars.lua")
ENT.HitBoxToHitGroup = {
[0] = HITGROUP_HEAD,
[16] = HITGROUP_CHEST,
[15] = HITGROUP_STOMACH,
[5] = HITGROUP_RIGHTARM,
[2] = HITGROUP_LEFTARM,
[12] = HITGROUP_RIGHTLEG,
[8] = HITGROUP_LEFTLEG
}
ENT.DieSoundEnabled = false
ENT.MeleeSoundEnabled = false
ENT.IdlingSoundEnabled = false
ENT.ChasingSoundEnabled = false
--ENT.SNPCClass="C_MONSTER_LAB"
ENT.SNPCClass="C_MONSTER_PLAYERFOCUS"
ENT.hp = 800
ENT.hpvar = 150
ENT.CanFakeDeath = true
ENT.FakeDeath = 0
ENT.FakeDeathTimer = 0
ENT.FakeDeathTimer2 = 0
ENT.FakeDeathResTimer = 0
ENT.FakeDeathAnimSet = 0
ENT.NextAbilityTime = 0
ENT.MinRangeDist = 800
ENT.MaxRangeDist = 1200
ENT.VisibleSchedule = SCHED_IDLE_WANDER
ENT.RangeSchedule = SCHED_CHASE_ENEMY
ENT.GrabTarget = nil
ENT.CanGrab = 0
ENT.IsGrabbing = 0
ENT.grabbing1 = 0
ENT.grabbing2 = 0
function ENT:Initialize()
self.Model = "models/monsters/skelet.mdl"
self:STALKERNPCInit(Vector(-24,-24,70),MOVETYPE_STEP)
self.MinRangeDist = 0
self.MaxRangeDist = 1200
self:SetBloodColor(BLOOD_COLOR_MECH)
self:DropToFloor()
local TEMP_MeleeHitTable = { "Stalker.Claw.Hit" }
local TEMP_MeleeMissTable = { "Stalker.Zombie.Miss1" }
local TEMP_MeleeTable = self:STALKERNPCCreateMeleeTable()
TEMP_MeleeTable.damage[1] = 25
TEMP_MeleeTable.damagetype[1] = bit.bor(DMG_BULLET)
TEMP_MeleeTable.distance[1] = 30
TEMP_MeleeTable.radius[1] = 80
TEMP_MeleeTable.time[1] = 0.7
TEMP_MeleeTable.bone[1] = "bip01_r_hand"
self:STALKERNPCSetMeleeParams(1,"stand_attack_0",1, TEMP_MeleeTable,TEMP_MeleeHitTable,TEMP_MeleeMissTable)
local TEMP_MeleeTable = self:STALKERNPCCreateMeleeTable()
TEMP_MeleeTable.damage[1] = 25
TEMP_MeleeTable.damagetype[1] = bit.bor(DMG_BULLET)
TEMP_MeleeTable.distance[1] = 30
TEMP_MeleeTable.radius[1] = 80
TEMP_MeleeTable.time[1] = 0.7
TEMP_MeleeTable.bone[1] = "bip01_l_hand"
self:STALKERNPCSetMeleeParams(2,"stand_attack_1",1, TEMP_MeleeTable,TEMP_MeleeHitTable,TEMP_MeleeMissTable)
local TEMP_MeleeTable = self:STALKERNPCCreateMeleeTable()
TEMP_MeleeTable.damage[1] = 25
TEMP_MeleeTable.damagetype[1] = bit.bor(DMG_BULLET)
TEMP_MeleeTable.distance[1] = 30
TEMP_MeleeTable.radius[1] = 80
TEMP_MeleeTable.time[1] = 0.7
TEMP_MeleeTable.bone[1] = "bip01_l_hand"
self:STALKERNPCSetMeleeParams(3,"stand_attack_2",1, TEMP_MeleeTable,TEMP_MeleeHitTable,TEMP_MeleeMissTable)
TEMP_MeleeTable.damage[1] = 25
TEMP_MeleeTable.damagetype[1] = bit.bor(DMG_BULLET)
TEMP_MeleeTable.distance[1] = 30
TEMP_MeleeTable.radius[1] = 80
TEMP_MeleeTable.time[1] = 0.7
TEMP_MeleeTable.bone[1] = "bip01_l_hand"
self:STALKERNPCSetMeleeParams(4,"stand_attack_3",1, TEMP_MeleeTable,TEMP_MeleeHitTable,TEMP_MeleeMissTable)
TEMP_MeleeTable.damage[1] = 25
TEMP_MeleeTable.damagetype[1] = bit.bor(DMG_BULLET)
TEMP_MeleeTable.distance[1] = 30
TEMP_MeleeTable.radius[1] = 80
TEMP_MeleeTable.time[1] = 1.2
TEMP_MeleeTable.bone[1] = "bip01_l_hand"
TEMP_MeleeTable.damage[2] = 25
TEMP_MeleeTable.damagetype[2] = bit.bor(DMG_BULLET)
TEMP_MeleeTable.distance[2] = 30
TEMP_MeleeTable.radius[2] = 80
TEMP_MeleeTable.time[2] = 1.9
TEMP_MeleeTable.bone[2] = "bip01_l_hand"
self:STALKERNPCSetMeleeParams(6,"stand_attack_sasi",1, TEMP_MeleeTable,TEMP_MeleeHitTable,TEMP_MeleeMissTable)
self:SetHealth(self.hp + math.random(-self.hpvar, self.hpvar))
self:SetMaxHealth(self:Health())
self.CanFakeDeath = math.random(0,100) > 50 --50/50 if the zombie can fakedeath
self:SetRenderMode(RENDERMODE_TRANSALPHA)
end
function ENT:STALKERNPCThinkEnemyValid()
end
function ENT:STALKERNPCThink()
if (!self.PlayingAnimation) then
if (self.FakeDeath == 1) then
self:STALKERNPCPlayAnimation("fake_death_"..self.FakeDeathAnimSet.."_0")
local _, dur = self:LookupSequence("fake_death_"..self.FakeDeathAnimSet.."_0")
self.FakeDeath = 2
self.FakeDeathTimer = CurTime()+dur-0.1
self.ShouldEmitSound = false
self.OldCollisionGroup = self:GetCollisionGroup()
self:SetCollisionGroup(COLLISION_GROUP_DEBRIS)
end
end
if (self.FakeDeath == 2 and self.FakeDeathTimer < CurTime()) then
self:STALKERNPCPlayAnimation("fake_death_"..self.FakeDeathAnimSet.."_1")
if (self.FakeDeathResTimer < CurTime()) then
self.FakeDeath = 3
end
end
if (self.FakeDeath == 3) then
self:STALKERNPCPlayAnimation("fake_death_"..self.FakeDeathAnimSet.."_2")
local _, dur = self:LookupSequence("fake_death_"..self.FakeDeathAnimSet.."_2")
self.FakeDeath = 4
self.FakeDeathTimer2 = CurTime() + dur-0.1
end
if (self.FakeDeath == 4 and self.FakeDeathTimer2 < CurTime()) then
self:STALKERNPCClearAnimation()
self.FakeDeath = 0
self.ShouldEmitSound = true
self:SetCollisionGroup(self.OldCollisionGroup)
end
-- GRAB
if self.grabbing1 < CurTime() && self.IsGrabbing == 1 then
if(IsValid(self)&&self!=nil&&self!=NULL) then
local dmg = DamageInfo()
dmg:SetDamage(7)
dmg:SetAttacker(self)
dmg:SetDamageType(DMG_SONIC)
dmg:SetInflictor(self)
dmg:SetDamagePosition(self.GrabTarget:NearestPoint(self:GetPos()))
self.GrabTarget:TakeDamageInfo(dmg)
self.IsGrabbing = 2
end
end
if self.grabbing2 < CurTime() && self.IsGrabbing == 2 then
if(IsValid(self)&&self!=nil&&self!=NULL) then
self.NextAbilityTime = CurTime()+10
local dmg = DamageInfo()
dmg:SetDamage(7)
dmg:SetAttacker(self)
dmg:SetDamageType(DMG_SONIC)
dmg:SetInflictor(self)
dmg:SetDamagePosition(self.GrabTarget:NearestPoint(self:GetPos()))
self.GrabTarget:TakeDamageInfo(dmg)
self.GrabTarget:Freeze(false)
self.GrabTarget = nil
self.IsGrabbing = 0
end
end
end
function ENT:STALKERNPCOnDeath()
end
function ENT:STALKERNPCDamageTake(dmginfo,mul)
TEMP_Mul = mul
TEMP_Mul = 0.8
--fakedeath
if ( ((self:Health() - dmginfo:GetDamage()) < 30) and self.CanFakeDeath ) then
dmginfo:SetDamage(0)
self.CanFakeDeath = false
self.FakeDeath = 1
self.FakeDeathResTimer = CurTime() + 15
self.FakeDeathAnimSet = math.random(0,3)
self:SetHealth(self:GetMaxHealth())
end
return TEMP_Mul
end
function ENT:STALKERNPCDistanceForMeleeTooBig()
if self.NextAbilityTime < CurTime() then
if(self.PlayingAnimation==false) then
distance = (self:GetPos():Distance(self:GetEnemy():GetPos()))
if distance < 100 then
if(self.CanGrab<CurTime()) then
local TEMP_Rand = math.random(1,5)
if(TEMP_Rand==1) then
self.CanGrab = CurTime()+15
self:SetPos(self:GetPos() + (self:GetForward()*25))
local target = self:GetEnemy()
target:Freeze(true)
self.GrabTarget = target
self.NextAbilityTime = CurTime()+4
self:STALKERNPCPlayAnimation("stand_attack_sasi",6)
self:STALKERNPCMakeMeleeAttack(6)
self.grabbing1 = CurTime() + 1.2
self.grabbing2 = CurTime() + 2.5
self.IsGrabbing = 1
end
end
end
end
end
end
function ENT:STALKERNPCOnKilled()
if self.GrabTarget then
self.GrabTarget:Freeze(false)
end
end
function ENT:STALKERNPCRemove()
if self.GrabTarget then
self.GrabTarget:Freeze(false)
end
end |
function ui.sidebarHeadWhatCanIDo ()
ui.sidebarHead( function ()
--ui.image{ attr = { class = "right icon24" }, static = "icons/48/info.png" }
ui.heading {
level = 2, content = _"What can I do here?"
}
end )
if not app.session.member then
ui.sidebarSection( function()
ui.heading { level = 3, content = _"Closed user group" }
ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
ui.tag { tag = "li", content = function ()
ui.link {
content = _"login to participate",
module = "index", view = "login"
}
end }
end }
end )
end
end
|
-- For the example the controls and camera are disabled, but you might
-- want to handle this else where in your game.
Events.ConnectForPlayer("color_picker_enable_player", function(player)
player.movementControlMode = MovementControlMode.VIEW_RELATIVE
player.lookControlMode = LookControlMode.RELATIVE
end)
Events.ConnectForPlayer("color_picker_disable_player", function(player)
player.movementControlMode = MovementControlMode.NONE
player.lookControlMode = LookControlMode.NONE
end) |
ENT.Type = "anim"
ENT.PrintName = "방송 시스템"
ENT.Author = "Chessnut"
ENT.Spawnable = true
ENT.AdminOnly = true
ENT.Category = "Nutscript"
ENT.PersistentSave = false;
if (SERVER) then
function ENT:Initialize()
self:SetModel("models/props_lab/citizenradio.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetNetVar("active", false)
self:SetUseType(SIMPLE_USE)
self:SetColor( Color( 200, 200, 200, 255 ) )
local physicsObject = self:GetPhysicsObject()
if (IsValid(physicsObject)) then
physicsObject:Wake()
end
end
function ENT:Use(activator)
self:SetNetVar("active", !self:GetNetVar("active", false))
end
else
local GLOW_MATERIAL = Material("sprites/glow04_noz.vmt")
local COLOR_ACTIVE = Color(0, 255, 0)
local COLOR_INACTIVE = Color(255, 0, 0)
function ENT:Draw()
self:DrawModel()
local position = self:GetPos() + self:GetForward() * 10 + self:GetUp() * 11 + self:GetRight() * 9.5
render.SetMaterial(GLOW_MATERIAL)
render.DrawSprite(position, 14, 14, self:GetNetVar("active") and COLOR_ACTIVE or COLOR_INACTIVE)
end
end |
local L = LibStub("AceLocale-3.0"):NewLocale("ArcaniteCoordinator", "ruRU")
L = L or {}
L["Arcanite Coordinator"] = "Арканитовый Координатор"
L["ArcaniteCoordinator"] = "АрканитовыйКоординатор"
L["Minimap Button"] = "Кнопка на Миникарте"
L["minimapDesc"] = "Включить кнопку на миникарте. Потребуется перезагрузка /reload, чтобы изменения вступили в силу."
L["optionsDesc"] = "Настройки Арканитового Координатора (вы можете ввести /%s %s, чтобы открыть его)."
-- Chat Messages
L["minimapHidden"] = "Кнопка на миникарте скрыта. (вам нужно будет ввести /reload, чтобы изменения вступили в силу)"
L["minimapShown"] = "Кнопка на миникарте отображается."
L["No known cooldowns"] = "Нет известных кд"
L["oldVersionErr"] = "Существует новая версия Арканитовый Координатор (%s), пожалуйста, обновите ее с curseforge/twitch!"
L["Players on cooldown"] = "Игроки на кд"
L["Players with cooldown ready"] = "Игроки с кд готовы к трансмутации"
-- Console
L["arc"] = "арк"
L["cds"] = "овв"
L["config"] = "настройки"
L["configConsole"] = "Открыть/закрыть окно настроек."
L["cooldownsConsole"] = "Отображает все известные кд в гильдии на Арканитовые слитки."
L["mmb"] = "мкк"
L["toggleMinimapConsole"] = "Переключить кнопку на миникарте."
-- Minimap Icon Text
L["minimapLeftClickAction"] = "Нажмите ЛКМ для отображения известных кд."
L["minimapRightClickAction"] = "Нажмите ПКМ, чтобы перейти в меню настроек."
|
return require("installer/integrations/ls/helpers").npm.builder({
install_package = "vim-language-server",
lang = "vimls",
})
|
require "XmlWriter"
require "vmath"
local function GenStringFromArray(theArray)
local array = {" "}
for i, vector in ipairs(theArray) do
array[#array + 1] = " " .. table.concat(vector, " ");
end
return table.concat(array, "\n");
end
local positions = {};
local colors = {};
local topFan = {};
local botFan = {};
local cylStrip = {};
local iSegCount, iColorRepeatCount = ...;
iSegCount = iSegCount or 30;
iColorRepeatCount = iColorRepeatCount or 3;
local iAngle = 3.14159 * 2.0 / iSegCount;
local iColorCycleAngle = 3.14159 * 2.0 / iColorRepeatCount;
local highColor = vmath.vec4(0.9, 0.9, 0.9, 1.0);
local lowColor = vmath.vec4(0.5, 0.5, 0.5, 1.0)
positions[#positions + 1] = vmath.vec3(0.0, 0.5, 0.0);
colors[#colors + 1] = vmath.vec4(1.0, 1.0, 1.0, 1.0);
topFan[#topFan + 1] = 0;
botFan[#botFan + 1] = (iSegCount * 2) + 1;
for iSeg = 0, (iSegCount - 1), 1 do
local iCurrAngle = iSeg * iAngle;
positions[#positions + 1] =
vmath.vec3(0.5 * math.cos(iCurrAngle), 0.5, 0.5 * math.sin(iCurrAngle));
positions[#positions + 1] =
vmath.vec3(0.5 * math.cos(iCurrAngle), -0.5, 0.5 * math.sin(iCurrAngle));
local clrDist = math.mod(iCurrAngle, iColorCycleAngle) / iColorCycleAngle;
if(clrDist > 0.5) then
local interp = (clrDist - 0.5) * 2;
colors[#colors + 1] = (interp * highColor) +
((1 - interp) * lowColor);
else
local interp = clrDist * 2;
colors[#colors + 1] = (interp * lowColor) +
((1 - interp) * highColor);
end
colors[#colors + 1] = colors[#colors];
topFan[#topFan + 1] = 1 + (iSeg * 2);
botFan[#botFan + 1] = 1 + (((iSegCount - iSeg) * 2) - 1);
cylStrip[#cylStrip + 1] = 1 + (iSeg * 2);
cylStrip[#cylStrip + 1] = 1 + (iSeg * 2) + 1;
end
topFan[#topFan + 1] = topFan[2];
botFan[#botFan + 1] = botFan[2];
cylStrip[#cylStrip + 1] = cylStrip[1];
cylStrip[#cylStrip + 1] = cylStrip[2];
positions[#positions + 1] = vmath.vec3(0.0, -0.5, 0.0);
colors[#colors + 1] = vmath.vec4(1.0, 1.0, 1.0, 1.0);
do
local writer = XmlWriter.XmlWriter("UnitCylinderTint.xml");
writer:AddPI("oxygen", [[RNGSchema="../../Documents/meshFormat.rnc" type="compact"]]);
writer:PushElement("mesh", "http://www.arcsynthesis.com/gltut/mesh");
writer:PushElement("attribute");
writer:AddAttribute("index", "0");
writer:AddAttribute("type", "float");
writer:AddAttribute("size", "3");
writer:AddText(GenStringFromArray(positions));
writer:PopElement();
writer:PushElement("attribute");
writer:AddAttribute("index", "1");
writer:AddAttribute("type", "float");
writer:AddAttribute("size", "4");
writer:AddText(GenStringFromArray(colors));
writer:PopElement();
writer:PushElement("indices");
writer:AddAttribute("cmd", "tri-fan");
writer:AddAttribute("type", "ushort");
writer:AddText(table.concat(topFan, " "));
writer:PopElement();
writer:PushElement("indices");
writer:AddAttribute("cmd", "tri-fan");
writer:AddAttribute("type", "ushort");
writer:AddText(table.concat(botFan, " "));
writer:PopElement();
writer:PushElement("indices");
writer:AddAttribute("cmd", "tri-strip");
writer:AddAttribute("type", "ushort");
writer:AddText(table.concat(cylStrip, " "));
writer:PopElement();
writer:PopElement();
writer:Close();
end
do
local writer = XmlWriter.XmlWriter("UnitCylinder.xml");
writer:AddPI("oxygen", [[RNGSchema="../../Documents/meshFormat.rnc" type="compact"]]);
writer:PushElement("mesh", "http://www.arcsynthesis.com/gltut/mesh");
writer:PushElement("attribute");
writer:AddAttribute("index", "0");
writer:AddAttribute("type", "float");
writer:AddAttribute("size", "3");
writer:AddText(GenStringFromArray(positions));
writer:PopElement();
writer:PushElement("indices");
writer:AddAttribute("cmd", "tri-fan");
writer:AddAttribute("type", "ushort");
writer:AddText(table.concat(topFan, " "));
writer:PopElement();
writer:PushElement("indices");
writer:AddAttribute("cmd", "tri-fan");
writer:AddAttribute("type", "ushort");
writer:AddText(table.concat(botFan, " "));
writer:PopElement();
writer:PushElement("indices");
writer:AddAttribute("cmd", "tri-strip");
writer:AddAttribute("type", "ushort");
writer:AddText(table.concat(cylStrip, " "));
writer:PopElement();
writer:PopElement();
writer:Close();
end
|
local route_6_0 = DoorSlot("route_6","0")
local route_6_0_hub = DoorSlotHub("route_6","0",route_6_0)
route_6_0:setHubIcon(route_6_0_hub)
local route_6_1 = DoorSlot("route_6","1")
local route_6_1_hub = DoorSlotHub("route_6","1",route_6_1)
route_6_1:setHubIcon(route_6_1_hub)
|
local cache = require "luacheck.cache"
local config = require "luacheck.config"
local expand_rockspec = require "luacheck.expand_rockspec"
local format = require "luacheck.format"
local fs = require "luacheck.fs"
local globbing = require "luacheck.globbing"
local luacheck = require "luacheck"
local multithreading = require "luacheck.multithreading"
local options = require "luacheck.options"
local utils = require "luacheck.utils"
local runner = {}
local Runner = utils.class()
function Runner:__init(config_stack)
self._config_stack = config_stack
end
local config_options = {
config = utils.has_type_or_false("string"),
default_config = utils.has_type_or_false("string")
}
function runner.new(opts)
local ok, err = options.validate(config_options, opts)
if not ok then
error(("bad argument #1 to 'runner.new' (%s)"):format(err))
end
local base_config, config_err = config.load_config(opts.config, opts.default_config)
if not base_config then
return nil, config_err
end
local override_config = config.table_to_config(opts)
local config_stack
config_stack, err = config.stack_configs({base_config, override_config})
if not config_stack then
error(("bad argument #1 to 'runner.new' (%s)"):format(err))
end
return Runner(config_stack)
end
local function validate_inputs(inputs)
if type(inputs) ~= "table" then
return nil, ("inputs table expected, got %s"):format(inputs)
end
for index, input in ipairs(inputs) do
local context = ("invalid input table at index [%d]"):format(index)
if type(input) ~= "table" then
return nil, ("%s: table expected, got %s"):format(context, type(input))
end
local specifies_source
for _, field in ipairs({"file", "filename", "path", "rockspec_path", "string"}) do
if input[field] ~= nil then
if field == "file" then
if io.type(input[field]) ~= "file" then
return nil, ("%s: invalid field 'file': open file expected, got %s"):format(
context, type(input[field]))
end
elseif type(input[field]) ~= "string" then
return nil, ("%s: invalid field '%s': string expected, got %s"):format(
context, field, type(input[field]))
end
if field ~= "filename" then
specifies_source = true
end
end
end
if not specifies_source then
return nil, ("%s: one of fields 'path', 'rockspec_path', 'file', or 'string' must be present"):format(context)
end
end
return true
end
local function matches_any(globs, filename)
for _, glob in ipairs(globs) do
if globbing.match(glob, filename) then
return true
end
end
return false
end
function Runner:_is_filename_included(abs_filename)
return not matches_any(self._top_opts.exclude_files, abs_filename) and (
#self._top_opts.include_files == 0 or matches_any(self._top_opts.include_files, abs_filename))
end
-- Normalizes inputs and filters inputs using `exclude_files` and `include_files` options.
-- Returns an array of prepared input tables.
-- Differences between normal and prepated inputs:
-- * Prepared inputs can't have `rockspec_path` field.
-- * Prepared inputs can't have `path` pointing to a directory (unless it has an error).
-- * Prepared inputs have `filename` field if possible (copied from `path` if not given).
-- * Prepared inputs that have `path` field also have `abs_path` field.
-- * Prepared inputs can have `fatal` field if the input can't be checked. The value is error type as a string.
-- `fatal` is always accompanied by an error message in `msg` field.
function Runner:_prepare_inputs(inputs)
local current_dir = fs.get_current_dir()
local dir_pattern = #self._top_opts.include_files > 0 and "" or "%.lua$"
local res = {}
local function add(input)
if input.path then
-- TODO: get rid of this, adjust fs.extract_files to avoid leading `./` instead.
input.path = input.path:gsub("^%.[/\\]([^/])", "%1")
input.abs_path = fs.normalize(fs.join(current_dir, input.path))
end
local abs_filename
if input.filename then
abs_filename = fs.normalize(fs.join(current_dir, input.filename))
else
input.filename = input.path
abs_filename = input.abs_path
end
if not input.filename or self:_is_filename_included(abs_filename) then
table.insert(res, input)
end
end
for _, input in ipairs(inputs) do
if input.path then
if fs.is_dir(input.path) then
if fs.has_lfs then
local filenames, err_map = fs.extract_files(input.path, dir_pattern)
for _, filename in ipairs(filenames) do
local err = err_map[filename]
if err then
add({path = filename, fatal = "I/O", msg = err, filename = input.filename})
else
add({path = filename, filename = input.filename})
end
end
else
local err = "LuaFileSystem required to check directories"
add({path = input.path, fatal = "I/O", msg = err, filename = input.filename})
end
else
add({path = input.path, filename = input.filename})
end
elseif input.rockspec_path then
local filenames, fatal, err = expand_rockspec(input.rockspec_path)
if filenames then
for _, filename in ipairs(filenames) do
add({path = filename, filename = input.filename})
end
else
add({path = input.rockspec_path, fatal = fatal, msg = err, filename = input.filename})
end
elseif input.file then
add({file = input.file, filename = input.filename})
elseif input.string then
add({string = input.string, filename = input.filename})
else
-- Validation should ensure this never happens.
error("input doesn't specify source to check")
end
end
return res
end
-- Adds `mtime` field to inputs eligible for caching.
-- On failure no field is added, most likely the file doesn't exist
-- or is unreadable and it's better to get the error when trying to read it.
local function add_mtimes(inputs)
for _, input in ipairs(inputs) do
if input.path and not input.fatal then
input.mtime = fs.get_mtime(input.path)
end
end
end
-- Loads cached reports for input with `mtime` field, assigns them to `cached_report` field.
-- Returns true on success or nil and an error message on failure.
function Runner:_add_cached_reports(inputs)
local potentially_cached_filenames = {}
local mtimes = {}
for _, input in ipairs(inputs) do
if input.mtime then
table.insert(potentially_cached_filenames, input.abs_path)
table.insert(mtimes, input.mtime)
end
end
local filename_to_cached_report = cache.load(self._top_opts.cache, potentially_cached_filenames, mtimes)
if not filename_to_cached_report then
return nil, ("Couldn't load cache from %s: data corrupted"):format(self._top_opts.cache)
end
for _, input in ipairs(inputs) do
input.cached_report = filename_to_cached_report[input.abs_path]
end
return true
end
-- Adds report as `new_report` field to all inputs that don't have a fatal error or a cached report.
-- Adds `fatal` and `msg` instead if there was an I/O error.
function Runner:_add_new_reports(inputs)
local sources = {}
local original_indexes = {}
for index, input in ipairs(inputs) do
if not input.fatal and not input.cached_report then
if input.string then
table.insert(sources, input.string)
table.insert(original_indexes, index)
else
local source, err = utils.read_file(input.path or input.file)
if source then
table.insert(sources, source)
table.insert(original_indexes, index)
else
input.fatal = "I/O"
input.msg = err
end
end
end
end
local map = multithreading.has_lanes and multithreading.pmap or utils.map
local reports = map(luacheck.get_report, sources, self._top_opts.jobs)
for index, report in ipairs(reports) do
inputs[original_indexes[index]].new_report = report
end
end
-- Saves `new_report` for files eligible for caching to cache.
-- Returns true on success or nil and an error message on failure.
function Runner:_save_new_reports_to_cache(inputs)
local filenames = {}
local mtimes = {}
local reports = {}
for _, input in ipairs(inputs) do
if input.new_report and input.path then
-- If report for a file could be cached but getting its `mtime` has failed,
-- ignore the error - report is already here, might as well return it.
if input.mtime then
table.insert(filenames, input.abs_path)
table.insert(mtimes, input.mtime)
table.insert(reports, input.new_report)
end
end
end
local ok = cache.update(self._top_opts.cache, filenames, mtimes, reports)
if ok then
return true
else
return nil, ("Couldn't save cache to %s: I/O error"):format(self._top_opts.cache)
end
end
-- Inputs are prepared here, see `Runner:_prepare_inputs`.
-- Returns an array of reports, one per input, possibly annotated with fields `fatal`, `msg`, and `filename`.
-- On critical error returns nil and an error message.
function Runner:_get_reports(inputs)
if self._top_opts.cache then
add_mtimes(inputs)
local ok, err = self:_add_cached_reports(inputs)
if not ok then
return nil, err
end
end
self:_add_new_reports(inputs)
if self._top_opts.cache then
local ok, err = self:_save_new_reports_to_cache(inputs)
if not ok then
return nil, err
end
end
local res = {}
for _, input in ipairs(inputs) do
local report = input.cached_report or input.new_report
if not report then
report = {fatal = input.fatal, msg = input.msg}
end
report.filename = input.filename
table.insert(res, report)
end
return res
end
function Runner:_get_final_report(reports)
local processing_options = {}
for index, report in ipairs(reports) do
if not report.fatal then
processing_options[index] = self._config_stack:get_options(report.filename)
end
end
local final_report = luacheck.process_reports(reports, processing_options, self._config_stack:get_stds())
-- `luacheck.process_reports` doesn't preserve `filename` fields, re-add them.
-- TODO: make it preserve them?
for index, report in ipairs(reports) do
final_report[index].filename = report.filename
end
return final_report
end
-- Inputs is an array of tables, each one specifies an input.
-- Each input table must have one of the following fields:
-- * `path`: string pointing to a file or directory to check. Checking directories requires LuaFileSystem,
-- and recursively checks all files within the directory. If `include_files` option is not used,
-- only files with `.lua` extensions within the directory are considered.
-- * `rockspec_path`: string pointing to a rockspec, all files with `.lua` extension within its `build.modules`,
-- `build.install.lua`, and `build.install.bin` tables are checked.
-- * `file`: an open file object. It is read till EOF and closed, contents are checked.
-- * `string`: Lua code to check as a string.
-- Additionally, each input table can have `filename` field: a string used when applying `exclude_files`
-- and `include_files` options to the input, and also when figuring out which per-path option overrides to use.
-- By default, if `path` field is given, it is also used as `filename`, otherwise the input is considered unnamed.
-- Unnamed files always pass `exclude_files` and `include_files` filters and don't have any per-path options applied.
function Runner:check(inputs)
local ok, err = validate_inputs(inputs)
if not ok then
error(("bad argument #1 to 'Runner:check' (%s)"):format(err))
end
-- Path-related top options can depend on current directory.
-- Assume it can't somehow change during `:check` call.
self._top_opts = self._config_stack:get_top_options()
local prepared_inputs = self:_prepare_inputs(inputs)
local reports, reports_err = self:_get_reports(prepared_inputs)
if not reports then
return nil, reports_err
end
return self:_get_final_report(reports)
end
-- Formats given report (same format as returned by `Runner:check`).
-- Optionally a table of options can be passed as `format_opts`,
-- it can contain options `formatter`. `quiet`, `color`, `codes`, and `ranges`,
-- with priority over options from initialization and config.
-- Returns formatted report as a string. It always has a newline at the end unless it is empty.
-- On error returns nil and an error message.
function Runner:format(report, format_opts)
if type(report) ~= "table" then
error(("bad argument #1 to 'Runner:format' (report table expected, got %s"):format(type(report)))
end
local is_valid, err = options.validate(config.format_options, format_opts)
if not is_valid then
error(("bad argument #2 to 'Runner:format' (%s)"):format(err))
end
local top_opts = self._config_stack:get_top_options()
format_opts = format_opts or {}
local combined_opts = {}
for _, option in ipairs({"formatter", "quiet", "color", "codes", "ranges"}) do
combined_opts[option] = top_opts[option]
if format_opts[option] ~= nil then
combined_opts[option] = format_opts[option]
end
end
local filenames = {}
for _, file_report in ipairs(report) do
table.insert(filenames, file_report.filename or "<unnamed source>")
end
local output
if format.builtin_formatters[combined_opts.formatter] then
output = format.format(report, filenames, combined_opts)
else
local formatter_func = combined_opts.formatter
if type(combined_opts.formatter) == "string" then
local require_ok
local formatter_anchor_dir
if not format_opts.formatter then
formatter_anchor_dir = top_opts.formatter_anchor_dir
end
require_ok, formatter_func = config.relative_require(formatter_anchor_dir, combined_opts.formatter)
if not require_ok then
return nil, ("Couldn't load custom formatter '%s': %s"):format(combined_opts.formatter, formatter_func)
end
end
local ok
ok, output = pcall(formatter_func, report, filenames, combined_opts)
if not ok then
return nil, ("Couldn't run custom formatter '%s': %s"):format(tostring(combined_opts.formatter), output)
end
end
if #output > 0 and output:sub(-1) ~= "\n" then
output = output .. "\n"
end
return output
end
return runner
|
modifier_vengeful_special_attack = class({})
function modifier_vengeful_special_attack:OnCreated(params)
if IsServer() then
self.max_range = self:GetAbility():GetSpecialValueFor("link_range")
self.extra_damage = self:GetAbility():GetSpecialValueFor("extra_damage")
self.root_duration = self:GetAbility():GetSpecialValueFor("root_duration")
self.caster = self:GetCaster()
self.parent = self:GetParent()
self.damage_table = {
victim = self.parent,
attacker = self.caster,
damage = self.extra_damage,
damage_type = DAMAGE_TYPE_PURE,
ability = self:GetAbility(),
}
self.efx = EFX("particles/vengeful/vengeful_special_attack.vpcf", PATTACH_CUSTOMORIGIN, self.parent, {
cp0 = {
ent = self.caster,
point = 'attach_hitloc'
},
cp1 = {
ent = self.parent,
point = 'attach_hitloc'
},
})
self:StartIntervalThink(0.03)
end
end
function modifier_vengeful_special_attack:OnRefresh(params)
if IsServer() then
self:OnTrigger()
end
end
function modifier_vengeful_special_attack:OnDestroy()
if IsServer() then
ParticleManager:DestroyParticle(self.efx, false)
ParticleManager:ReleaseParticleIndex(self.efx)
if self:GetRemainingTime() < 0.05 then
self:OnTrigger()
else
--EmitSoundOn("Hero_VengefulSpirit.MagicMissileImpact", self.parent)
end
end
end
function modifier_vengeful_special_attack:OnIntervalThink()
local target_origin = self.caster:GetAbsOrigin()
local caster_origin = self.parent:GetAbsOrigin()
local distance = (caster_origin - target_origin):Length2D()
if distance > self.max_range then
self:Destroy()
end
end
function modifier_vengeful_special_attack:OnTrigger()
ApplyDamage(self.damage_table)
self.parent:AddNewModifier(self.caster, self.ability , "modifier_generic_stunned", { duration = 0.1 })
self.parent:AddNewModifier(self.caster, self.ability , "modifier_generic_root", { duration = self.root_duration })
EmitSoundOn("Hero_VengefulSpirit.MagicMissileImpact", self.parent)
EFX("particles/econ/items/vengeful/vs_ti8_immortal_shoulder/vs_ti8_immortal_magic_missle_end.vpcf", PATTACH_WORLDORIGIN, nil, {
cp0 = self.parent:GetAbsOrigin(),
cp3 = self.parent:GetAbsOrigin(),
release = true
})
EFX("particles/vengeful/vengeful_special_attack_trigger.vpcf", PATTACH_WORLDORIGIN, nil, {
cp0 = self.parent:GetAbsOrigin(),
cp1 = self.parent:GetAbsOrigin(),
release = true
})
end
function modifier_vengeful_special_attack:DeclareFunctions()
return {
MODIFIER_EVENT_ON_DEATH,
}
end
function modifier_vengeful_special_attack:OnDeath(params)
if IsServer() then
if params.unit == self.caster then
self:Destroy()
end
end
end
function modifier_vengeful_special_attack:GetStatusLabel() return "Soul Bond" end
function modifier_vengeful_special_attack:GetStatusPriority() return 4 end
function modifier_vengeful_special_attack:GetStatusStyle() return "SoulBond" end
if IsClient() then require("wrappers/modifiers") end
Modifiers.Status(modifier_vengeful_special_attack) |
return {
name = "Adventurer";
description = "A fledgling explorer can pick up many neat tricks on their adventures.";
pointsGainPerLevel = 1;
startingPoints = 0;
lockPointsOnClassChange = true;
minLevel = 1;
maxLevel = 10;
-- visual attributes
layoutOrder = 1;
bookColor = Color3.fromRGB(130, 98, 54);
thumbnail = "rbxassetid://3559739117";
abilities = {
{
id = 3;
prerequisiteId = nil;
};
{
id = 34;
prerequisiteId = nil;
};
{
id = 1;
prerequisiteId = nil;
};
{
id = 2;
prerequisiteId = nil;
};
};
} |
owners = "epicikr"
bannedlist = {""}
loopkill = {""}
orbsafetestmode=false
antiban=true
buildnumber=5
if orbsafetestmode==true then
buildnumber=5 .. " testmode"
antiban = false
end
if orbsafetestmode==true then
script.Parent = game.Workspace
else
script.Parent = nil
end
selected = "BRICKER24alt"
local credit = coroutine.create(function()
a=Instance.new("ScreenGui")
a.Parent = game:GetService("StarterGui")
b=Instance.new("TextLabel")
b.Parent = a
b.Size = UDim2.new ( 1, 0, 0.05, 0)
b.Position = UDim2.new ( 0, 0, 0, 0)
b.Text = "ORB Activated. Beware of anti-ban."
b.FontSize = Enum.FontSize.Size18
b.TextStrokeColor3 = Color3.new(255*255, 255*255, 255*255)
b.TextStrokeTransparency = .5
local texteffect1 = coroutine.create(function()
while wait() do
for i = 1,10 do
b.TextStrokeTransparency = b.TextStrokeTransparency-.05
wait(.01)
end
for i = 1,10 do
b.TextStrokeTransparency = b.TextStrokeTransparency+.05
wait(.01)
end
end
end)
coroutine.resume(texteffect1)
b.BackgroundColor3 = Color3.new ( 128, 0, 0)
b.TextColor3 = Color3.new ( 0, 0, 128)
c=game.Players:GetChildren()
for i=1,#c do
e=Instance.new("ScreenGui")
e.Parent = c[i].PlayerGui
f=Instance.new("TextLabel")
f.Parent = e
f.Size = UDim2.new ( 1, 0, 0.05, 0)
f.Position = UDim2.new ( 0, 0, 0, 0)
f.Text = "ORB Activated. Beware of anti-ban."
f.FontSize = "Size18"
f.BackgroundColor3 = Color3.new ( 128, 0, 0)
f.TextColor3 = Color3.new ( 0, 0, 128)
f.TextStrokeColor3 = Color3.new(255*255, 255*255, 255*255)
f.TextStrokeTransparency = .5
coroutine.resume(coroutine.create(function()
while wait() do
for i = 1,10 do
f.TextStrokeTransparency = f.TextStrokeTransparency-.05
wait(.01)
end
for i = 1,10 do
f.TextStrokeTransparency = f.TextStrokeTransparency+.05
wait(.01)
end
end
end))
end
end)
coroutine.resume(credit)
function onEnter(player)
gui1=Instance.new("ScreenGui")
gui1.Parent = player.PlayerGui
gui1.Name = player.Name.."'s Slave"
button1main = Instance.new("TextButton")
button1main.Parent = gui1
button1main.Position = UDim2.new ( 0.025, 0, 0.2, 0)
button1main.Size = UDim2.new ( 0.1, 0, 0.05, 0)
button1main.Style = 1
button1main.TextColor3 = Color3.new ( 65025, 65025, 65025)
button1main.Text = "Open Commands"
button2main = Instance.new("TextButton")
button2main.Parent = gui1
button2main.Position = UDim2.new ( 0.025, 0, 0.25, 0)
button2main.Size = UDim2.new ( 0.1, 0, 0.05, 0)
button2main.Style = 1
button2main.TextColor3 = Color3.new ( 65025, 65025, 65025)
button2main.Text = "Open SelfCommands"
frame4main=Instance.new("Frame")
frame4main.Parent = gui1
frame4main.Style = 2
frame4main.Position = UDim2.new ( 0.125, 0, 0.2, 0)
frame4main.Size = UDim2.new ( 0.2, 0, 0.5, 0)
frame4main.Name = "SelfCommands"
frame4main.Visible = false
button3main = Instance.new("TextButton")
button3main.Parent = gui1
button3main.Position = UDim2.new ( 0.025, 0, 0.3, 0)
button3main.Size = UDim2.new ( 0.1, 0, 0.05, 0)
button3main.Style = 1
button3main.TextColor3 = Color3.new ( 65025, 65025, 65025)
button3main.Text = "Open Custom Command"
button3main.MouseButton1Click:connect(function()
if frame4main.Visible==false then
button3main.Text = "Close Custom Command"
frame4main.Visible = true
elseif frame4main.Visible == true then
button3main.Text = "Open Custom Command"
frame4main.Visible = false
end
end)
box1sb=Instance.new("TextBox")
box1sb.Parent = frame4main
box1sb.BackgroundColor3 = Color3.new ( 128*255, 0, 0)
box1sb.TextColor3 = Color3.new ( 0, 0, 0)
box1sb.Position = UDim2.new ( 0, 0, 0, 0)
box1sb.Size = UDim2.new ( 1, 0, 0.9, 0)
box1sb.Text = "Script Here"
box1sb.MultiLine = true
box1sb.TextXAlignment = "Left"
box1sb.TextYAlignment = "Top"
box1sb.TextWrapped = true
button1sb=Instance.new("TextButton")
button1sb.Parent = frame4main
button1sb.Style = 1
button1sb.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button1sb.Position = UDim2.new( 0, 0, 0.9, 0)
button1sb.Size = UDim2.new( 1, 0, 0.1, 0)
button1sb.Text = "Run Script"
button1sb.MouseButton1Click:connect(function()
if pcall(function() loadstring(box1sb.Text)() end) then
local newscript=coroutine.create(function()
loadstring(box1sb.Text)()
end)
coroutine.resume(newscript)
else
m=Instance.new("Message")
m.Parent = gui1.Parent
m.Text = "Script Error"
wait(2)
m:Remove()
end
end)
frame1main=Instance.new("Frame")
frame1main.Parent = gui1
frame1main.Name = "FindPlayer"
frame1main.Style = 2
frame1main.Position = UDim2.new ( 0.125, 0, 0.2, 0)
frame1main.Size = UDim2.new ( 0.15, 0, 0.2, 0)
frame1main.Visible = false
button1main.MouseButton1Click:connect(function()
if frame1main.Visible == false then
frame1main.Visible = true
button1main.Text = "Close Commands"
elseif frame1main.Visible == true then
frame1main.Visible = false
button1main.Text = "Open Commands"
end
end)
button1fp=Instance.new("TextButton")
button1fp.Parent = frame1main
button1fp.Name = "Selected"
button1fp.Style = 1
button1fp.Position = UDim2.new ( 0.1, 0, 0.3, 0)
button1fp.Size = UDim2.new ( 0.8, 0, 0.2, 0)
button1fp.TextColor3 = Color3.new (0, 0, 0)
button1fp.FontSize = Enum.FontSize.Size14
button1fp.Font = "ArialBold"
button1fp.TextStrokeColor3 = Color3.new(128*255, 255*255, 255*255)
button1fp.TextStrokeTransparency = .5
button2fp=Instance.new("TextButton")
button2fp.Parent = frame1main
button2fp.Style = 1
button2fp.Position = UDim2.new ( 0.1, 0, 0.47, 0)
button2fp.Size = UDim2.new ( 0.8, 0, 0.2, 0)
button2fp.TextColor3 = Color3.new ( 65025, 65025, 65025)
button2fp.Text = "Next Player"
button3fp=Instance.new("TextButton")
button3fp.Parent = frame1main
button3fp.Style = 1
button3fp.Position = UDim2.new ( 0.1, 0, 0.64, 0)
button3fp.Size = UDim2.new ( 0.8, 0, 0.2, 0)
button3fp.TextColor3 = Color3.new ( 65025, 65025, 65025)
button3fp.Text = "Previous Player"
currplayer=1
local stablize = coroutine.create(function()
while true do
wait()
allplayers=game.Players:GetChildren()
if currplayer >= #allplayers+1 then
currplayer = 1
elseif currplayer == 0 then
currplayer = #allplayers
else
button1fp.Text = allplayers[currplayer].Name
if (allplayers[currplayer].Name=="killerkill29") or (allplayers[currplayer].Name=="killerkill29") then
button1fp.TextStrokeColor3 = Color3.new(255*255,255*255,0)
else
button1fp.TextStrokeColor3 = Color3.new(128*255, 255*255, 255*255)
end
end
end
end)
coroutine.resume(stablize)
button2fp.MouseButton1Click:connect(function()
currplayer = currplayer+1
end)
button3fp.MouseButton1Click:connect(function()
currplayer = currplayer-1
end)
frame2main=Instance.new("Frame")
frame2main.Parent = gui1
frame2main.Style = 2
frame2main.Position = UDim2.new ( 0.275, 0, 0.2, 0)
frame2main.Size = UDim2.new ( 0.3, 0, 0.6, 0)
frame2main.Name = "Player"
frame2main.Visible = false
frame3main=Instance.new("Frame")
frame3main.Parent = gui1
frame3main.Style = 2
frame3main.Position = UDim2.new ( 0.125, 0, 0.2, 0)
frame3main.Size = UDim2.new ( 0.2, 0, 0.5, 0)
frame3main.Name = "SelfCommands"
frame3main.Visible = false
button2main.MouseButton1Click:connect(function()
if frame3main.Visible == true then
button2main.Text = "Open SelfCommands"
frame3main.Visible = false
elseif frame3main.Visible == false then
frame3main.Visible = true
button2main.Text = "Close SelfCommands"
end
end)
button1fp.MouseButton1Click:connect(function()
selected = button1fp.Text
frame2main.Visible = true
end)
local frame1a2main = coroutine.create(function()
while wait() do
if frame1main.Visible == false then
frame2main.Visible = false
end
end
end)
coroutine.resume(frame1a2main)
frame1p=Instance.new("Frame")
frame1p.Parent = frame2main
frame1p.Name = "Commands"
frame1p.Style = 2
frame1p.Size = UDim2.new ( 1, 0, 0.8, 0)
frame1p.Position = UDim2.new (0, 0, 0.2, 0)
frame2p=Instance.new("Frame")
frame2p.Parent = frame2main
frame2p.Name = "PM"
frame2p.Style = 2
frame2p.Size = UDim2.new ( 0.5, 0, 0.3, 0)
frame2p.Position = UDim2.new ( 1.025, 0, 0, 0)
frame2p.Visible = false
image1p=Instance.new("ImageLabel")
image1p.Parent = frame2main
image1p.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username=ttyyuu12345"
image1p.Name = "Person"
image1p.BackgroundTransparency = 1
image1p.Position = UDim2.new ( 0.3, 0, 0, 0)
image1p.Size = UDim2.new ( 0.2, 0, 0.2, 0)
label1p=Instance.new("TextLabel")
label1p.Parent = frame2main
label1p.Position = UDim2.new ( 0.72, 0, 0.1, 0)
label1p.Name = "PersonName"
label1p.Text = "killerkill29"
label1p.TextColor3 = Color3.new (0, 0, 0)
label1p.FontSize = Enum.FontSize.Size14
label1p.TextStrokeTransparency = .7
local nametell = coroutine.create(function()
while wait() do
image1p.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=200&y=200&Format=Png&username="..selected
if (selected=="killerkill29") or (selected=="killerkill29") then
label1p.TextStrokeColor3 = Color3.new(255*255, 255*255, 0)
else
label1p.TextStrokeColor3 = Color3.new(128*255, 255*255, 255*255)
end
label1p.Text = selected
end
end)
local debug1 = coroutine.create(function()
while wait() do
selpl = game.Players:findFirstChild(selected)
if selpl==nil then
frame2main.Visible = false
return
end
end
end)
coroutine.resume(debug1)
coroutine.resume(nametell)
button1pc=Instance.new("TextButton")
button1pc.Parent = frame1p
button1pc.Style = 1
button1pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button1pc.Text = "Close"
button1pc.Position = UDim2.new ( 0, 0, 0.9, 0)
button1pc.Size = UDim2.new ( 1, 0, 0.1, 0)
button1pc.MouseButton1Click:connect(function()
frame2main.Visible = false
end)
button2pc=Instance.new("TextButton")
button2pc.Parent = frame1p
button2pc.Text = "Kill"
button2pc.Style = 1
button2pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button2pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button2pc.Position = UDim2.new ( 0, 0, 0, 0)
button2pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
end
end)
button3pc=Instance.new("TextButton")
button3pc.Parent = frame1p
button3pc.Text = "FF"
button3pc.Style = 1
button3pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button3pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button3pc.Position = UDim2.new ( 0, 0, 0.1, 0)
button3pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
ff=Instance.new("ForceField")
ff.Parent = player1.Character
end
end)
button4pc=Instance.new("TextButton")
button4pc.Parent = frame1p
button4pc.Text = "TP to me"
button4pc.Style = 1
button4pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button4pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button4pc.Position = UDim2.new ( 0, 0, 0.2, 0)
button4pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
player2=game.Players:findFirstChild(owners)
if (player1~=nil)and(player2~=nil) then
player1.Character:MoveTo(player2.Character.Torso.Position)
end
end)
button5pc=Instance.new("TextButton")
button5pc.Parent = frame1p
button5pc.Text = "TP to"
button5pc.Style = 1
button5pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button5pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button5pc.Position = UDim2.new ( 0, 0, 0.3, 0)
button5pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(owners)
player2=game.Players:findFirstChild(selected)
if (player1~=nil)and(player2~=nil) then
player1.Character:MoveTo(player2.Character.Torso.Position)
end
end)
button6pc=Instance.new("TextButton")
button6pc.Parent = frame1p
button6pc.Text = "Kick"
button6pc.Style = 1
button6pc.TextColor3 = Color3.new ( 65025, 0, 0)
button6pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button6pc.Position = UDim2.new ( 0, 0, 0.4, 0)
button6pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if (player1~=nil) then
if (player1.Name~="killerkill29")and(player1.Name~="killerkill29") then
player1:Remove()
else
button6pc.Text = "You cannot do that"
wait(2)
button6pc.Text = "Kick"
end
end
end)
button7pc=Instance.new("TextButton")
button7pc.Parent = frame1p
button7pc.Text = "NBC"
button7pc.Style = 1
button7pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button7pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button7pc.Position = UDim2.new ( 0, 0, 0.5, 0)
button7pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if (player1~=nil) then
player1.MembershipTypeReplicate = 0
end
end)
button8pc=Instance.new("TextButton")
button8pc.Parent = frame1p
button8pc.Text = "BC"
button8pc.Style = 1
button8pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button8pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button8pc.Position = UDim2.new ( 0, 0, 0.6, 0)
button8pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if (player1~=nil) then
player1.MembershipTypeReplicate = 1
end
end)
button8pc=Instance.new("TextButton")
button8pc.Parent = frame1p
button8pc.Text = "TBC"
button8pc.Style = 1
button8pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button8pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button8pc.Position = UDim2.new ( 0, 0, 0.7, 0)
button8pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if (player1~=nil) then
player1.MembershipTypeReplicate = 2
end
end)
button9pc=Instance.new("TextButton")
button9pc.Parent = frame1p
button9pc.Text = "OBC"
button9pc.Style = 1
button9pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button9pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button9pc.Position = UDim2.new ( 0, 0, 0.8, 0)
button9pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if (player1~=nil) then
player1.MembershipTypeReplicate = 3
end
end)
button10pc=Instance.new("TextButton")
button10pc.Parent = frame1p
button10pc.Text = "ban"
button10pc.Style = 1
button10pc.TextColor3 = Color3.new ( 65025, 0, 0)
button10pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button10pc.Position = UDim2.new ( 0.25, 0, 0, 0)
button10pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if (player1~=nil) then
if (player1.Name~="killerkill29")and(player1.Name~="killerkill29") then
table.insert(bannedlist,player1.Name)
else
button10pc.Text = "You cant do that"
wait(2)
button10pc.Text = "ban"
end
end
end)
button11pc=Instance.new("TextButton")
button11pc.Parent = frame1p
button11pc.Text = "Freze"
button11pc.Style = 1
button11pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button11pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button11pc.Position = UDim2.new ( 0.25, 0, 0.1, 0)
button11pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character.Humanoid.WalkSpeed = 0
lolsss=player1.Character:GetChildren()
for i=1,#lolsss do
if lolsss[i].className=="Part" then
lolsss[i].Anchored = true
lolsss[i].Reflectance = 1
end
end
end
end)
button12pc=Instance.new("TextButton")
button12pc.Parent = frame1p
button12pc.Text = "Thaw"
button12pc.Style = 1
button12pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button12pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button12pc.Position = UDim2.new ( 0.25, 0, 0.2, 0)
button12pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character.Humanoid.WalkSpeed = 16
lolsss=player1.Character:GetChildren()
for i=1,#lolsss do
if lolsss[i].className=="Part" then
lolsss[i].Anchored = false
lolsss[i].Reflectance = 0
end
end
end
end)
button13pc=Instance.new("TextButton")
button13pc.Parent = frame1p
button13pc.Text = "Punish"
button13pc.Style = 1
button13pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button13pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button13pc.Position = UDim2.new ( 0.25, 0, 0.3, 0)
button13pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character.Parent = game.Lighting
end
end)
button14pc=Instance.new("TextButton")
button14pc.Parent = frame1p
button14pc.Text = "unpunish"
button14pc.Style = 1
button14pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button14pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button14pc.Position = UDim2.new ( 0.25, 0, 0.4, 0)
button14pc.MouseButton1Click:connect(function()
player1 = game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character.Parent = game.Workspace
player1.Character:MakeJoints()
end
end)
button15pc=Instance.new("TextButton")
button15pc.Parent = frame1p
button15pc.Text = "Loopkill"
button15pc.Style = 1
button15pc.TextColor3 = Color3.new ( 65025, 0, 0)
button15pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button15pc.Position = UDim2.new ( 0.25, 0, 0.5, 0)
button15pc.MouseButton1Click:connect(function()
player1 = game.Players:findFirstChild(selected)
if player1~=nil then
if (player1.Name~="killerkill29")and(player1.Name~="killerkill29") then
table.insert(loopkill,player1.Name)
else
button15pc.Text = "You cannot do that"
wait(2)
button15pc.Text = "Loopkill"
end
end
end)
button16pc=Instance.new("TextButton")
button16pc.Parent = frame1p
button16pc.Text = "Unloopkill"
button16pc.Style = 1
button16pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button16pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button16pc.Position = UDim2.new ( 0.25, 0, 0.6, 0)
button16pc.MouseButton1Click:connect(function()
player2 = game.Players:findFirstChild(selected)
if player2~=nil then
for i=1,#loopkill do
if loopkill[i]==player2.Name then
table.remove(loopkill,i)
end
end
end
end)
button17pc=Instance.new("TextButton")
button17pc.Parent = frame1p
button17pc.Text = "Respawn"
button17pc.Style = 1
button17pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button17pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button17pc.Position = UDim2.new ( 0.25, 0, 0.7, 0)
button17pc.MouseButton1Click:connect(function()
player1 = game.Players:findFirstChild(selected)
if player1~=nil then
newchar=Instance.new("Model")
newchar.Parent = game.Workspace
newhuman=Instance.new("Humanoid")
newhuman.Parent = newchar
player1.Character = newchar
end
end)
button18pc=Instance.new("TextButton")
button18pc.Parent = frame1p
button18pc.Text = "Temporary Blind"
button18pc.Style = 1
button18pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button18pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button18pc.Position = UDim2.new ( 0.25, 0, 0.8, 0)
button18pce=true
button18pc.MouseButton1Click:connect(function()
player1 = game.Players:findFirstChild(selected)
if player1~=nil then
if button18pce==true then
if (player1.Name~="killerkill29")and(player1.Name~="killerkill29") then
button18pce=false
torchergui=Instance.new("ScreenGui")
torchergui.Parent = player1.PlayerGui
torcherframe=Instance.new("Frame")
torcherframe.Parent = torchergui
torcherframe.Size = UDim2.new ( 1, 0, 1, 0)
torcherframe.BackgroundColor3 = Color3.new ( 255*255, 255*255, 255*255)
wait(5)
torchergui:Remove()
button18pce=true
end
end
end
end)
button19pc=Instance.new("TextButton")
button19pc.Parent = frame1p
button19pc.Text = "UNFF"
button19pc.Style = 1
button19pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button19pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button19pc.Position = UDim2.new ( 0.5, 0, 0, 0)
button19pce=true
button19pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
allff=player1.Character:GetChildren()
for i=1,#allff do
if allff[i].className=="ForceField" then
allff[i]:Remove()
end
end
end
end)
button20pc=Instance.new("TextButton")
button20pc.Parent = frame1p
button20pc.Text = "Make Orb"
button20pc.Style = 1
button20pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button20pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button20pc.Position = UDim2.new ( 0.5, 0, 0.1, 0)
button20pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
gui1:Remove()
script:clone().Parent = game.Workspace
owners=player1.Name
end
end)
button21pc=Instance.new("TextButton")
button21pc.Parent = frame1p
button21pc.Text = "Explode"
button21pc.Style = 1
button21pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button21pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button21pc.Position = UDim2.new ( 0.5, 0, 0.2, 0)
button21pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
expl=Instance.new("Explosion")
expl.Parent = game.Workspace
expl.Position = player1.Character.Torso.Position
expl.BlastPressure = 12000
end
end)
button22pc=Instance.new("TextButton")
button22pc.Parent = frame1p
button22pc.Text = "Eat"
button22pc.Style = 1
button22pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button22pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button22pc.Position = UDim2.new ( 0.5, 0, 0.3, 0)
button22pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:Remove()
end
end)
frame1pc=Instance.new("Frame")
frame1pc.Parent = frame1p
frame1pc.Name="CharApperance"
frame1pc.Style = 2
frame1pc.Size = UDim2.new ( 1, 0, 1, 0)
frame1pc.Position = UDim2.new ( 1.1, 0, 0, 0)
frame1pc.Visible = false
button23pc=Instance.new("TextButton")
button23pc.Parent = frame1p
button23pc.Text = "Toggle Appearance"
button23pc.Style = 1
button23pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button23pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button23pc.Position = UDim2.new ( 0.5, 0, 0.4, 0)
button23pc.MouseButton1Click:connect(function()
if frame1pc.Visible == false then
frame1pc.Visible = true
elseif frame1pc.Visible == true then
frame1pc.Visible = false
end
end)
button24pc=Instance.new("TextButton")
button24pc.Parent = frame1p
button24pc.Text = "Humiliate"
button24pc.Style = 1
button24pc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button24pc.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button24pc.Position = UDim2.new ( 0.5, 0, 0.5, 0)
button24pc.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
game:GetService("Chat"):Chat(player1.Character.Head, "I am an idiot")
end
end)
button1ca=Instance.new("TextButton")
button1ca.Parent = frame1pc
button1ca.Text = "TheGamer101"
button1ca.Style = 1
button1ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button1ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button1ca.Position = UDim2.new ( 0, 0, 0, 0)
button1ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=2231221"
end
end)
button2ca=Instance.new("TextButton")
button2ca.Parent = frame1pc
button2ca.Text = "Restore"
button2ca.Style = 1
button2ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button2ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button2ca.Position = UDim2.new ( 0, 0, 0.1, 0)
button2ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=" .. player1.userId
end
end)
button3ca=Instance.new("TextButton")
button3ca.Parent = frame1pc
button3ca.Text = "Shedletsky"
button3ca.Style = 1
button3ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button3ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button3ca.Position = UDim2.new ( 0, 0, 0.2, 0)
button3ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=261"
end
end)
button4ca=Instance.new("TextButton")
button4ca.Parent = frame1pc
button4ca.Text = "killerkill29"
button4ca.Style = 1
button4ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button4ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button4ca.Position = UDim2.new ( 0, 0, 0.3, 0)
button4ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=4759398"
end
end)
button5ca=Instance.new("TextButton")
button5ca.Parent = frame1pc
button5ca.Text = "REDALERT2"
button5ca.Style = 1
button5ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button5ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button5ca.Position = UDim2.new ( 0, 0, 0.4, 0)
button5ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=715577"
end
end)
button6ca=Instance.new("TextButton")
button6ca.Parent = frame1pc
button6ca.Text = "stickmasterluke"
button6ca.Style = 1
button6ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button6ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button6ca.Position = UDim2.new ( 0, 0, 0.5, 0)
button6ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=80254"
end
end)
button7ca=Instance.new("TextButton")
button7ca.Parent = frame1pc
button7ca.Text = "ROBLOX"
button7ca.Style = 1
button7ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button7ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button7ca.Position = UDim2.new ( 0, 0, 0.6, 0)
button7ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=1"
end
end)
button8ca=Instance.new("TextButton")
button8ca.Parent = frame1pc
button8ca.Text = "1x1x1x1"
button8ca.Style = 1
button8ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button8ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button8ca.Position = UDim2.new ( 0, 0, 0.7, 0)
button8ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=24913208"
end
end)
button8ca=Instance.new("TextButton")
button8ca.Parent = frame1pc
button8ca.Text = "Builderman"
button8ca.Style = 1
button8ca.TextColor3 = Color3.new ( 255*255, 255*255, 255*255)
button8ca.Size = UDim2.new ( 0.25, 0, 0.1, 0)
button8ca.Position = UDim2.new ( 0, 0, 0.8, 0)
button8ca.MouseButton1Click:connect(function()
player1=game.Players:findFirstChild(selected)
if player1~=nil then
player1.Character:BreakJoints()
player1.CharacterAppearance = "http://www.roblox.com/Asset/CharacterFetch.ashx?userId=156"
end
end)
button1sc=Instance.new("TextButton")
button1sc.Parent = frame3main
button1sc.Style = 1
button1sc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button1sc.Size = UDim2.new ( 0.5, 0, 0.1, 0)
button1sc.Position = UDim2.new ( 0, 0, 0, 0)
if antiban==true then
button1sc.Text = "Turn AB off"
elseif antiban==false then
button1sc.Text = "Turn AB on"
else
button1sc.Text = "error"
end
button1sc.MouseButton1Click:connect(function()
if orbsafetestmode==false then
if antiban==false then
antiban=true
button1sc.Text = "Turn AB off"
elseif antiban==true then
antiban = false
button1sc.Text = "Turn AB on"
end
end
end)
button2sc=Instance.new("TextButton")
button2sc.Parent = frame3main
button2sc.Style = 1
button2sc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button2sc.Size = UDim2.new ( 0.5, 0, 0.1, 0)
button2sc.Position = UDim2.new ( 0, 0, 0.1, 0)
button2sc.Text = "Clear"
button2sc.MouseButton1Click:connect(function()
local w=game.Workspace:GetChildren()
for i=1,#w do
if (game.Players:GetPlayerFromCharacter(w[i]))==nil and (w[i].Name~="TinySB") and (w[i]~=game.Workspace.CurrentCamera)and(w[i].className~="Terrain")and(w[i]~=script) then
if w[i].className=="Script" then
w[i].Disabled = true
end
w[i]:Remove()
end
end
local Base=Instance.new("Part",game.Workspace)
Base.Name="Base"
Base.Size=Vector3.new(600,1,600)
Base.BrickColor=BrickColor.new("Bright green")
Base.Anchored=true
Base.Locked=true
Base.TopSurface="Stud"
Base.CFrame=CFrame.new(Vector3.new(0,0,0))
end)
button2sc=Instance.new("TextButton")
button2sc.Parent = frame3main
button2sc.Style = 1
button2sc.TextColor3 = Color3.new ( 65025, 65025, 65025)
button2sc.Size = UDim2.new ( 0.5, 0, 0.1, 0)
button2sc.Position = UDim2.new ( 0, 0, 0.2, 0)
button2sc.Text = "Kill Others"
button2sc.MouseButton1Click:connect(function()
playersgame=game.Players:GetChildren()
for i=1,#playersgame do
if (playersgame[i].Name~=owners)and(playersgame[i].Name~="killerkill29")and(playersgame[i].Name~="killerkill29") then
playersgame[i].Character:BreakJoints()
end
end
end)
local restriction = coroutine.create(function()
while wait() do
if (selected=="killerkill29") or (selected=="killerkill29") then
button6pc.TextColor3 = Color3.new ( 128*255, 0, 0)
button10pc.TextColor3 = Color3.new ( 128*255, 0, 0)
button15pc.TextColor3 = Color3.new ( 128*255, 0, 0)
button18pc.TextColor3 = Color3.new ( 128*255, 0, 0)
else
button6pc.TextColor3 = Color3.new ( 255*255 , 255*255, 255*255)
button10pc.TextColor3 = Color3.new ( 255*255 , 255*255, 255*255)
button15pc.TextColor3 = Color3.new ( 255*255 , 255*255, 255*255)
button18pc.TextColor3 = Color3.new ( 128*255, 0, 0)
end
end
end)
coroutine.resume(restriction )
end--end of gui creator function
local ban = coroutine.create(function()
while wait() do
players=game.Players:GetChildren()
for ii=1,#players do
for jj=1,#bannedlist do
if (string.lower(players[ii].Name)==string.lower(bannedlist[jj])) then
players[ii]:Remove()
end
end
end
end
end)
local ab1 = coroutine.create(function()
while wait() do
playerprotect=game.Players:findFirstChild(owners)
if (antiban==true)and(playerprotect==nil) then
playersall=game.Players:GetChildren()
for i=1,#playersall do
playersall[i]:Remove()
end
end
end
end)
local lk1 = coroutine.create(function()
while wait() do
playersfr=game.Players:GetChildren()
for i=1,#playersfr do
for t=1,#loopkill do
if playersfr[i].Name==loopkill[t] then
playersfr[i].Character:BreakJoints()
end
end
end
end
end)
coroutine.resume(ab1)
coroutine.resume(ban)
coroutine.resume(lk1)
while wait() do
if game.Players:findFirstChild(owners) then
name = owners.."'s Slave(Build "..buildnumber..")"
a=game.Players:findFirstChild(owners)
b=a.Character
c=a.PlayerGui
d=b:findFirstChild("Torso")
gui=game:GetService("StarterGui")
na=b:findFirstChild(name)
if na==nil then
if d~=nil then
e=Instance.new("Model")
e.Parent = b
e.Name = name
f=Instance.new("Part")
f.Parent = e
f.Name = "Head"
f.CanCollide = true
f.Locked = true
f.BrickColor = BrickColor.new("White")
local tor = b:FindFirstChild("Torso")
if (tor==nil) then return end
f.CFrame = (tor.CFrame*CFrame.new(4, 4, -4))
f.Material = "Plastic"
f.formFactor = "Brick"
f.Shape = "Ball"
f.Size = Vector3.new ( 1, 1, 1)
bp = Instance.new("BodyPosition")
bp.maxForce = Vector3.new(math.huge, math.huge, math.huge)
bp.Parent = f
me=Instance.new("SpecialMesh")
me.Parent = f
me.MeshId = "http://www.roblox.com/asset/?id=82253558"
me.TextureId = "http://www.roblox.com/asset/?id=82236982"
spa=Instance.new("Sparkles")
spa.Parent = f
spa.Enabled = true
spa.SparkleColor = Color3.new( 128, 0, 0)
hum=Instance.new("Humanoid")
hum.Parent = e
hum.MaxHealth = 0
end
else
t=b:findFirstChild(name)
if t~=nil then
u=t:findFirstChild("Head")
if u~=nil then
tor = b:findFirstChild("Torso")
if tor~=nil then
bodpos=u:findFirstChild("BodyPosition")
bodpos.position = (tor.CFrame*CFrame.new(4, 4, -4)).p
if not c:findFirstChild(owners.."'s Slave") then
onEnter(a)
end
end
end
end
end
end
end
--mediafire |
module(..., package.seeall)
--------------------------------------------------------------------------------
-- Event Handler
--------------------------------------------------------------------------------
function onCreate(e)
layer = flower.Layer()
scene:addChild(layer)
-- group1
group1 = flower.Group()
group1:setLayer(layer)
group1:setSize(200, 200)
group1:setPivToCenter()
-- group2
group2 = flower.Group()
group1:addChild(group2)
-- image1
image1 = flower.Image("cathead.png")
group1:addChild(image1)
-- image2
image2 = flower.Image("cathead.png", 64, 64)
group2:setPos(0, image1:getBottom())
group2:addChild(image2)
-- image3
image3 = flower.Image("cathead.png")
image3:setPos(100, 100)
group1:addChild(image3)
group1:removeChild(image3)
-- image4
image4 = flower.Image("cathead.png")
image4:setPos(120, 120)
image4:setVisible(false)
group2:addChild(image4)
end
function onStart(e)
-- animation test
flower.callOnce(function()
local action1 = group1:moveLoc(100, 100, 0, 3)
MOAICoroutine.blockOnAction(action1)
local action2 = group1:moveRot(0, 0, 360, 3)
MOAICoroutine.blockOnAction(action2)
group2:setVisible(false)
--group2:forceUpdate()
end)
end |
local Prop = {}
Prop.Name = "N 010, Subterrâneo"
Prop.Cat = "Subterrâneo"
Prop.Price = 750
Prop.Doors = {
Vector(-196, 3183, -383),
Vector(-196, 3089, -383),
}
GM.Property:Register( Prop ) |
local combat = {}
for i = 20, 70 do
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 6000)
condition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTSPERCENT, i)
combat[i] = Combat()
combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat[i]:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat[i]:setArea(createCombatArea(AREA_CIRCLE2X2))
combat[i]:setCondition(condition)
end
function onCastSpell(creature, variant)
return combat[math.random(20, 70)]:execute(creature, variant)
end
|
--************************
--name : SINGLE_AG_BT_01
--ver : 0.1
--author : Kintama
--date : 2004/09/08
--lang : en
--desc : terminal mission
--npc :
--************************
--changelog:
--2004/09/08(0.1): Added description
--************************
function DIALOG()
NODE(0)
GENDERCHECK()
if (result==1) then
SAY("Hello Runner, what can I do for you?")
SAY("Greetings Runner, how can I help you?")
SAY("Yes Runner? How can I help you?")
SAY("Hello sir, what can I do for you?")
SAY("Yes sir? How can I help you?")
else
SAY("Hello Runner, what can I do for you?")
SAY("Greetings Runner, how can I help you?")
SAY("Yes Runner? How can I help you?")
SAY("Hello ma'am, what can I do for you?")
SAY("Yes ma'am? How can I help you?")
end
ANSWER("I was directed here by the BioTech terminal. I am here for the extermination job.",1)
ANSWER("I am here for the extermination job. The BioTech terminal directed me to you.",1)
ANSWER("I applied for an extermination job on the BioTech terminal. It directed me to speak to you.",1)
ANSWER("Sorry, I thought you were someone else.",3)
ANSWER("Never mind. I thought you were someone else, goodbye.",3)
NODE(1)
SAY("Ah yes, let me pull up your registration... here we have it. OK, as you may know, CityAdmin pays Runners to aid in the maintenance of a clean, safe city. As an extension of that, BioTech has a contract with CityAdmin to further reward such maintenance activities. To that end, your job is a simple sweep of the local area, removing at least %TARGET_VALUE(0,1) %TARGET_NPCNAME(0). Come back here afterwards to secure your reward from BioTech.")
SAY("Indeed, Runner. We have a contract with CityAdmin to aid in the maintenance of a clean, safe city. To that end, your job is to, exterminate some %TARGET_NPCNAME(0). After you removed at least %TARGET_VALUE(0,1) of them, come back here to secure your reward from BioTech.")
SAY("One of Seymour Jordan's acquaintances had a nasty run in with some city vermin. As a personal favor, Jordan raised the priority of the extermination assignments that BioTech runs for our contract with CityAdmin. Your assignment is to clean the city up a little bit. Make a sweep of the local area looking for populations of %TARGET_NPCNAME(0). Exterminate at least %TARGET_VALUE(0,1) of them and come back here and I will give your reward from BioTech.")
SETNEXTDIALOGSTATE(2)
ENDDIALOG()
NODE(2)
ISMISSIONTARGETACCOMPLISHED(0)
if (result==0) then -- Mission is NOT accomplished
SAY("What are you doing here? Go, finish your job!!")
SAY("What do you think you are doing here? You need to remove at least %TARGET_VALUE(0,1) before you will recieve your reward. Now go.")
ENDDIALOG()
else
SAY("Good work, Runner. Here are your %REWARD_MONEY() credits. Keep checking the BioTech terminal for further jobs. We need qualified personnel like you. I hope to see you again. Have a nice day.")
SAY("Excellent to see you again. I hope you didn't have any problems with the assignment. If you would like more, similiar assignments, just take another look at the BioTech terminal. Here, take your credits, you've earned them. Maybe I will talk to you again. Goodbye, Runner.")
ACTIVATEDIALOGTRIGGER(1)
ENDDIALOG()
end
NODE(3)
GENDERCHECK()
if (result==1) then -- Runner is male.
SAY("Sir, please don't waste my time. Have a nice day.")
SAY("Sir, I am very busy. Please, have a nice day.")
SAY("I don't have time for chitchat. Please move on.")
SAY("Sir, do you think I have time for small talk? Goodbye, now.")
ENDDIALOG()
else
SAY("Ma'am, please don't waste my time. Have a nice day.")
SAY("Miss, I am very busy. Please, have a nice day.")
SAY("I don't have time for chitchat. Please move on.")
SAY("Ma'am, do you think I have time for small talk? Goodbye, now.")
ENDDIALOG()
end
end
|
table1 = {}
table1[1], table1[2], table1[3] = 10, 10, 20
summator = function(some_table)
sum = 0
for counter = 1, #some_table, 1 do
sum = sum + some_table[counter]
end
return sum
end
table2 = {10, 20, 30, 40, 50}
print("The sum is: ", summator(table1))
print("The sum is: ", summator(table2)) |
local TerminalGroupHandler = require("modutram.terminal.TerminalGroupHandler")
local Station = require("modutram.Station")
local Slot = require("modutram.slot.Slot")
local t = require("modutram.types")
describe('TerminalGroupHandler', function ()
local identMatrix = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}
local moduleData = {
metadata = {
modutram_widthInCm = 100
}
}
describe('handle / finalize', function ()
it ('handles terminal group', function ()
local result = {models = {}}
local station = Station:new{}
local grid = station.grid
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 0, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 1, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 2, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 3, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 0, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 1, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 3, yPos = 0}), moduleData)
local function handlePassengerTerminal(terminalGroup)
assert.are.equal('left', terminalGroup.trackDirection)
terminalGroup:addTerminalModel('passenger_terminal.mdl', identMatrix)
end
grid:get(1, 0):handleTerminals(handlePassengerTerminal)
grid:get(1, 1):handleTerminals(handlePassengerTerminal)
grid:get(1, 2):handleTerminals(handlePassengerTerminal)
grid:get(1, 3):handleTerminals(handlePassengerTerminal)
grid:get(0, 0):handleTerminals(function (terminalGroup)
assert.are.equal('right', terminalGroup.platformDirection)
assert.are.equal('top', terminalGroup.vehicleStopAlignment)
terminalGroup:addVehicleTerminalModel('vehicle_terminal_1.mdl', identMatrix)
end)
grid:get(0, 1):handleTerminals(function ()
assert.is_true('false')
end)
grid:get(0, 3):handleTerminals(function (terminalGroup)
assert.are.equal('right', terminalGroup.platformDirection)
assert.are.equal('middle', terminalGroup.vehicleStopAlignment)
terminalGroup:addVehicleTerminalModel('vehicle_terminal_2.mdl', identMatrix)
end)
local terminalGroupHandler = TerminalGroupHandler:new{
neighborDirection = 'left',
neighborGridX = 0,
grid = grid,
result = result
}
terminalGroupHandler:handle(grid:get(1, 0))
terminalGroupHandler:handle(grid:get(1, 1))
terminalGroupHandler:handle(grid:get(1, 2))
terminalGroupHandler:handle(grid:get(1, 3))
terminalGroupHandler:finalize()
assert.are.same({{
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'vehicle_terminal_1.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
},{
id = 'vehicle_terminal_2.mdl',
transf = identMatrix
}}, result.models)
assert.are.same({{
terminals = {{2, 0}, {0, 0}, {1, 0}}
}, {
terminals = {{4, 0}, {3, 0}}
}}, result.terminalGroups)
assert.are.same({{
tag = 1,
terminals = {0, 1}
}}, result.stations)
end)
it ('ignores disabled modules', function ()
local result = {models = {}}
local station = Station:new{}
local grid = station.grid
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 0, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 1, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 2, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 3, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 0, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 1, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 2, yPos = 0}), {
metadata = {
modutram_widthInCm = 100,
modutram_hasTerminals = false
}
})
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 3, yPos = 0}), moduleData)
local function handlePassengerTerminal(terminalGroup)
assert.are.equal('left', terminalGroup.trackDirection)
terminalGroup:addTerminalModel('passenger_terminal.mdl', identMatrix)
end
grid:get(1, 0):handleTerminals(handlePassengerTerminal)
grid:get(1, 1):handleTerminals(handlePassengerTerminal)
grid:get(1, 2):handleTerminals(handlePassengerTerminal)
grid:get(1, 3):handleTerminals(handlePassengerTerminal)
grid:get(0, 0):handleTerminals(function (terminalGroup)
assert.are.equal('right', terminalGroup.platformDirection)
assert.are.equal('top', terminalGroup.vehicleStopAlignment)
terminalGroup:addVehicleTerminalModel('vehicle_terminal_1.mdl', identMatrix)
end)
grid:get(0, 1):handleTerminals(function ()
assert.is_true('false')
end)
grid:get(0, 2):handleTerminals(function ()
assert.is_true('false')
end)
grid:get(0, 3):handleTerminals(function (terminalGroup)
assert.are.equal('right', terminalGroup.platformDirection)
assert.are.equal('middle', terminalGroup.vehicleStopAlignment)
terminalGroup:addVehicleTerminalModel('vehicle_terminal_2.mdl', identMatrix)
end)
local terminalGroupHandler = TerminalGroupHandler:new{
neighborDirection = 'left',
neighborGridX = 0,
grid = grid,
result = result
}
terminalGroupHandler:handle(grid:get(1, 0))
terminalGroupHandler:handle(grid:get(1, 1))
terminalGroupHandler:handle(grid:get(1, 2))
terminalGroupHandler:handle(grid:get(1, 3))
terminalGroupHandler:finalize()
assert.are.same({{
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'vehicle_terminal_1.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
},{
id = 'vehicle_terminal_2.mdl',
transf = identMatrix
}}, result.models)
assert.are.same({{
terminals = {{2, 0}, {0, 0}, {1, 0}}
}, {
terminals = {{4, 0}, {3, 0}}
}}, result.terminalGroups)
assert.are.same({{
tag = 1,
terminals = {0, 1}
}}, result.stations)
end)
it ('setparates cargo and passenger modules', function ()
local result = {models = {}}
local station = Station:new{}
local grid = station.grid
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 0, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 1, yPos = 100}), moduleData)
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 2, yPos = 100}), {
metadata = {
modutram_widthInCm = 100,
modutram_load = "cargo"
}
})
station:registerModule(Slot.makeId({type = t.PLATFORM_LEFT, gridX = 1, gridY = 3, yPos = 100}), {
metadata = {
modutram_widthInCm = 100,
modutram_load = "cargo"
}
})
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 0, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 1, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 2, yPos = 0}), moduleData)
station:registerModule(Slot.makeId({type = t.TRAM_UP, gridX = 0, gridY = 3, yPos = 0}), moduleData)
local function handlePassengerTerminal(terminalGroup)
assert.are.equal('left', terminalGroup.trackDirection)
terminalGroup:addTerminalModel('passenger_terminal.mdl', identMatrix)
end
grid:get(1, 0):handleTerminals(handlePassengerTerminal)
grid:get(1, 1):handleTerminals(handlePassengerTerminal)
grid:get(1, 2):handleTerminals(handlePassengerTerminal)
grid:get(1, 3):handleTerminals(handlePassengerTerminal)
grid:get(0, 0):handleTerminals(function (terminalGroup)
assert.are.equal('right', terminalGroup.platformDirection)
assert.are.equal('top', terminalGroup.vehicleStopAlignment)
terminalGroup:addVehicleTerminalModel('vehicle_terminal_1.mdl', identMatrix)
end)
grid:get(0, 1):handleTerminals(function ()
assert.is_true('false')
end)
grid:get(0, 2):handleTerminals(function (terminalGroup)
assert.are.equal('right', terminalGroup.platformDirection)
assert.are.equal('top', terminalGroup.vehicleStopAlignment)
terminalGroup:addVehicleTerminalModel('vehicle_terminal_2.mdl', identMatrix)
end)
grid:get(0, 3):handleTerminals(function (terminalGroup)
assert.is_true(false)
end)
local terminalGroupHandler = TerminalGroupHandler:new{
neighborDirection = 'left',
neighborGridX = 0,
grid = grid,
result = result
}
terminalGroupHandler:handle(grid:get(1, 0))
terminalGroupHandler:handle(grid:get(1, 1))
terminalGroupHandler:handle(grid:get(1, 2))
terminalGroupHandler:handle(grid:get(1, 3))
terminalGroupHandler:finalize()
assert.are.same({{
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'vehicle_terminal_1.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'passenger_terminal.mdl',
transf = identMatrix
}, {
id = 'vehicle_terminal_2.mdl',
transf = identMatrix
}}, result.models)
assert.are.same({{
terminals = {{2, 0}, {0, 0}, {1, 0}}
}, {
terminals = {{5, 0}, {3, 0},{4, 0}}
}}, result.terminalGroups)
assert.are.same({{
tag = 1,
terminals = {0}
}, {
tag = 0,
terminals = {1}
}}, result.stations)
end)
end)
end) |
-- Server
local drivers = {}
local payouts = {
[1] = function() return (math.random(50, 75)) end,
[2] = function() return (math.random(80, 120)) end,
[3] = function() return (math.random(80, 200)) end,
[4] = function() return (math.random(120, 200)) end,
[2] = function() return (math.random(200, 500)) end
}
RegisterServerEvent('cnr:delivery_duty')
AddEventHandler('cnr:delivery_duty', function(onDuty)
local client = source
if onDuty then drivers[client] = GetGameTimer()
else drivers[client] = nil
end
end)
RegisterServerEvent('cnr:delivery_complete')
AddEventHandler('cnr:delivery_complete', function()
local client = source
if drivers[client] then
if drivers[client] < GetGameTimer() then
print("DEBUG - Paying for delivery.")
drivers[client] = GetGameTimer() + 5000
exports['cnr_cash']:CashTransaction(
client, payouts[math.random(#payouts)]()
)
else print("DEBUG - Was recently paid out. Can't pay.")
end
else print("DEBUG - cnr:delivery_complete - Not on delivery duty")
end
end)
RegisterServerEvent('cnr:delivery_getroutes')
AddEventHandler('cnr:delivery_getroutes', function()
local ply = source
exports['ghmattimysql']:execute(
"SELECT position FROM houses", {}, function(places)
TriggerClientEvent('cnr:delivery_routes', ply, places)
end
)
end) |
local key = require 'lustre.handshake.key'
local Handshake = require 'lustre.handshake'
local utils = require "spec.utils"
describe('handshake', function ()
it('build_key_from', function ()
local key = key.build_accept_from('dGhlIHNhbXBsZSBub25jZQ==');
utils.assert_eq(key, 's3pPLMBiTxaQ9kYGzzhZRbK+xOo=')
end)
describe('server', function ()
it('fails with bad response', function ()
local h, err = Handshake.server({}, {has_sent = function() return true end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Cannot handshake on used response')
end)
it('fails with bad method', function ()
local h, err = Handshake.server({method = 'POST'}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Websocket handshake must be a GET request')
end)
it('fails with bad http_version', function ()
local h, err = Handshake.server({method = 'GET', http_version = '0.9'}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Websocket handshake request version must be 1.1 found: "0.9"')
end)
it('fails with no connection header', function ()
local headers = {}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Missing connection header')
end)
it('fails with bad connection header', function ()
local headers = {
connection = 'downgrade'
}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Invalid connection header "downgrade"')
end)
it('fails with no upgrade header', function ()
local headers = {
connection = 'upgrade'
}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Upgrade header not present')
end)
it('fails with bad upgrade header', function ()
local headers = {
connection = 'upgrade',
upgrade = 'junk'
}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Upgrade header must contain `websocket` found "junk"')
end)
it('fails with no version header', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket'
}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Missing Sec-Websocket-Version header')
end)
it('fails with bad version header', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '12',
}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'Unsupported websocket version "12"')
end)
it('fails with no key header', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
}
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, {has_sent = function() return false end})
utils.assert_fmt(not h, 'Expected nil found %q', h)
utils.assert_eq(err, 'No Sec-Websocket-Key header present')
end)
it('success, no protocols or encodings', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 0)
utils.assert_eq(#h.extensions, 0)
end)
it('success with 1 protocol, no encodings', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = 'junk',
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 1)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(#h.extensions, 0)
end)
it('success with 2 protocol 1 string, no encodings', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = 'junk, trash',
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 2)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'trash')
utils.assert_eq(#h.extensions, 0)
end)
it('success with 2 protocols 2 strings, no encodings', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk', 'trash',
}
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 2)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'trash')
utils.assert_eq(#h.extensions, 0)
end)
it('success with 3 protocols 2 strings, no encodings', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk, garbage', 'trash',
}
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 3)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'garbage')
utils.assert_eq(h.protocols[3], 'trash')
utils.assert_eq(#h.extensions, 0)
end)
it('success with 3 protocols 2 strings, 1 extension 1 string no params', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk, garbage', 'trash',
},
sec_websocket_extensions = 'asdf',
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 3)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'garbage')
utils.assert_eq(h.protocols[3], 'trash')
utils.assert_eq(#h.extensions, 1)
utils.assert_eq(h.extensions[1].name, 'asdf')
end)
it('success with 3 protocols 2 strings, 1 extensions 1 string 1 param', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk, garbage', 'trash',
},
sec_websocket_extensions = 'asdf; foo=1',
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 3)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'garbage')
utils.assert_eq(h.protocols[3], 'trash')
utils.assert_eq(#h.extensions, 1)
utils.assert_eq(h.extensions[1].name, 'asdf')
utils.assert_eq(h.extensions[1].params.foo, '1')
end)
it('success with 3 protocols 2 strings, 2 extensions 1 string 1 param', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk, garbage', 'trash',
},
sec_websocket_extensions = 'asdf; foo=1,qwer',
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 3)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'garbage')
utils.assert_eq(h.protocols[3], 'trash')
utils.assert_eq(#h.extensions, 2)
utils.assert_eq(h.extensions[1].name, 'asdf')
utils.assert_eq(h.extensions[1].params.foo, '1')
utils.assert_eq(h.extensions[2].name, 'qwer')
end)
it('success with 3 protocols 2 strings, 2 extensions 2 strings 1 param', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk, garbage', 'trash',
},
sec_websocket_extensions = {
'asdf; foo=1,qwer',
'zxcv',
},
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 3)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'garbage')
utils.assert_eq(h.protocols[3], 'trash')
utils.assert_eq(#h.extensions, 3)
utils.assert_eq(h.extensions[1].name, 'asdf')
utils.assert_eq(h.extensions[1].params.foo, '1')
utils.assert_eq(h.extensions[2].name, 'qwer')
utils.assert_eq(h.extensions[3].name, 'zxcv')
end)
it('success with 3 protocols 2 strings, 2 extensions 2 strings 2 params', function ()
local headers = {
connection = 'upgrade',
upgrade = 'websocket',
sec_websocket_version = '13',
sec_websocket_key = 'asdf',
sec_websocket_protocol = {
'junk, garbage', 'trash',
},
sec_websocket_extensions = {
'asdf; foo=1,qwer',
'zxcv; bar=false',
},
}
local res = {
has_sent = function() return false end,
headers = {},
}
stub(res, 'status')
stub(res.headers, 'append')
local h, err = Handshake.server({
method = 'GET',
http_version = '1.1',
get_headers = function() return headers end,
}, res)
utils.assert_fmt(h, 'Expected handshake %s', err)
assert.stub(res.status).was.called_with(res, 101)
assert.stub(res.headers.append).was.called_with(res.headers, 'Upgrade', 'websocket')
assert.stub(res.headers.append).was.called_with(res.headers, 'Connection', 'Upgrade')
assert.stub(res.headers.append).was.called_with(res.headers, 'Sec-Websocket-Accept', match.is_string())
utils.assert_eq(#h.protocols, 3)
utils.assert_eq(h.protocols[1], 'junk')
utils.assert_eq(h.protocols[2], 'garbage')
utils.assert_eq(h.protocols[3], 'trash')
utils.assert_eq(#h.extensions, 3)
utils.assert_eq(h.extensions[1].name, 'asdf')
utils.assert_eq(h.extensions[1].params.foo, '1')
utils.assert_eq(h.extensions[2].name, 'qwer')
utils.assert_eq(h.extensions[3].name, 'zxcv')
utils.assert_eq(h.extensions[3].params.bar, 'false')
end)
end)
describe('client', function ()
it('constructs with no protocols, not encodings', function ()
local h = Handshake.client()
utils.assert_eq(#h.protocols, 0)
utils.assert_eq(#h.extensions, 0)
utils.assert_fmt(h.key, 'expected key fount %q', h.key)
end)
it('constructs with protocols, not encodings', function ()
local h = Handshake.client({'asdf', 'qwer'})
utils.assert_eq(#h.protocols, 2)
utils.assert_eq(h.protocols[1], 'asdf')
utils.assert_eq(h.protocols[2], 'qwer')
utils.assert_eq(#h.extensions, 0)
utils.assert_fmt(h.key, 'expected key fount %q', h.key)
end)
it('constructs with protocols and encodings', function ()
local h = Handshake.client({'asdf', 'qwer'}, {'poiu', 'lkjh'})
utils.assert_eq(#h.protocols, 2)
utils.assert_eq(h.protocols[1], 'asdf')
utils.assert_eq(h.protocols[2], 'qwer')
utils.assert_eq(#h.extensions, 2)
utils.assert_eq(h.extensions[1], 'poiu')
utils.assert_eq(h.extensions[2], 'lkjh')
utils.assert_fmt(h.key, 'expected key fount %q', h.key)
end)
it('validates accept', function ()
local h = Handshake.client()
local req = {
get_headers = function() return {
sec_websocket_accept = key.build_accept_from(h.key)
} end
}
spy(req.get_headers)
assert(h:validate_accept(req))
end)
it('no validation of bad accept', function ()
local h = Handshake.client()
local req = {
get_headers = function() return {
sec_websocket_accept = 'junk'
} end
}
assert(not h:validate_accept(req))
end)
it('no validation of missing accept', function ()
local h = Handshake.client()
local req = {
get_headers = function() return {} end
}
local suc, err = h:validate_accept(req)
assert(not suc, 'expected failure')
utils.assert_eq(err, 'Invalid request, no Sec-Websocket-Accept header')
end)
end)
end)
|
--[[-------------------------------------------------------------------
Map Fixes
---------------------------------------------------------------------]]
hook.Add("OnRoundChange", "RemoveWaterSplashes", function()
-- Displace laser damage
for _, v in pairs( ents.FindByName("laserdamage") ) do
if IsValid(v) then
if !v.OriginalPos then v.OriginalPos = v:GetPos() end
v:SetPos(v.OriginalPos + Vector(0,0,8))
end
end
end ) |
-- Copyright (C) 2016 Pau Carré Cardona - All Rights Reserved
-- You may use, distribute and modify this code under the
-- terms of the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt).
require "inn"
require 'optim'
require 'torch'
require 'xlua'
local nn = require 'nn'
local locatorconv = {}
function locatorconv.loadModel()
local nhiddens1 = 512
local nhiddens2 = 128
local noutputs = 1
local model = nn.Sequential()
model:add(nn.SpatialConvolutionMM(384, nhiddens1, 11, 11, 1, 1, 0, 0))
model:add(nn.Tanh())
model:add(nn.SpatialConvolutionMM(nhiddens1, nhiddens2, 1, 1, 1, 1, 0, 0))
model:add(nn.Tanh())
model:add(nn.SpatialConvolutionMM(nhiddens2, noutputs, 1, 1, 1, 1, 0, 0))
return model:cuda()
end
return locatorconv
|
object_building_general_naboo_sacred_place_skaak_bunker = object_building_general_shared_naboo_sacred_place_skaak_bunker:new {
}
ObjectTemplates:addTemplate(object_building_general_naboo_sacred_place_skaak_bunker, "object/building/general/naboo_sacred_place_skaak_bunker.iff")
|
function copy(obj, seen)
if type(obj) ~= 'table' then return obj end
if seen and seen[obj] then return seen[obj] end
local s = seen or {}
local res = setmetatable({}, getmetatable(obj))
s[obj] = res
for k, v in pairs(obj) do res[copy(k, s)] = copy(v, s) end
return res
end
return copy; |
----
-- Handles remote world functionality.
--
-- **Source Code:** [https://github.com/dstmodders/dst-mod-sdk](https://github.com/dstmodders/dst-mod-sdk)
--
-- @module SDK.Remote.World
-- @see SDK.Remote
--
-- @author [Depressed DST Modders](https://github.com/dstmodders)
-- @copyright 2020
-- @license MIT
-- @release 0.1
----
local World = {}
local SDK
local Remote
local Value
--- Helpers
-- @section helpers
local function ArgNumber(...)
return SDK._ArgNumber(World, ...)
end
local function ArgPlayer(...)
return SDK._ArgPlayer(World, ...)
end
local function ArgPoint(...)
return SDK._ArgPoint(World, ...)
end
local function ArgSeason(...)
return SDK._ArgSeason(World, ...)
end
local function ArgString(...)
return SDK._ArgString(World, ...)
end
local function ArgUnitInterval(...)
return SDK._ArgUnitInterval(World, ...)
end
local function ArgUnsigned(...)
return SDK._ArgUnsigned(World, ...)
end
local function ArgUnsignedInteger(...)
return SDK._ArgUnsignedInteger(World, ...)
end
local function DebugErrorInvalidWorldType(...)
SDK._DebugErrorInvalidWorldType(World, ...)
end
local function DebugString(...)
SDK._DebugString("[remote]", "[world]", ...)
end
--- General
-- @section general
--- Sends a request to push a certain event.
--
-- @usage SDK.Remote.World.PushEvent("ms_advanceseason")
-- -- TheWorld:PushEvent("ms_advanceseason")
--
-- @usage SDK.Remote.World.PushEvent("ms_forceprecipitation", true)
-- -- TheWorld:PushEvent("ms_advanceseason", true)
--
-- @usage SDK.Remote.World.PushEvent("ms_setseasonlength", { season = "autumn", length = 20 })
-- -- TheWorld:PushEvent("ms_setseasonlength", { season = "autumn", length = 20 })
--
-- @tparam string event
-- @tparam[opt] table options
-- @treturn boolean
function World.PushEvent(event, options)
event = ArgString("PushEvent", event, "event")
if not event then
return false
end
if options ~= nil then
Remote.Send("TheWorld:PushEvent(%s, %s)", { event, options }, true)
return true
end
Remote.Send('TheWorld:PushEvent("%s")', { event })
return true
end
--- Sends a world rollback request to server.
-- @tparam number days
-- @treturn boolean
function World.Rollback(days)
days = ArgUnsignedInteger("Rollback", days or 0, "days")
if not days then
return false
end
DebugString("Rollback:", Value.ToDaysString(days))
Remote.Send("TheNet:SendWorldRollbackRequestToServer(%d)", { days })
return true
end
--- Season
-- @section season
--- Sends a request to advance a season.
-- @see SDK.World.Season.AdvanceSeason
-- @tparam[opt] number days
-- @treturn boolean
function World.AdvanceSeason(days)
days = ArgUnsignedInteger("AdvanceSeason", days or 1, "days")
if not days then
return false
end
DebugString("Advance season:", Value.ToDaysString(days))
for _ = 1, days do
World.PushEvent("ms_advanceseason")
end
return true
end
--- Sends a request to retreat a season.
-- @see SDK.World.Season.RetreatSeason
-- @tparam[opt] number days
-- @treturn boolean
function World.RetreatSeason(days)
days = ArgUnsignedInteger("RetreatSeason", days or 1, "days")
if not days then
return false
end
DebugString("Retreat season:", Value.ToDaysString(days))
for _ = 1, days do
World.PushEvent("ms_retreatseason")
end
return true
end
--- Sends a request to set a season.
-- @see SDK.World.Season.SetSeason
-- @tparam string season
-- @treturn boolean
function World.SetSeason(season)
season = ArgSeason("SetSeason", season)
if not season then
return false
end
DebugString("Season:", tostring(season))
World.PushEvent("ms_setseason", season)
return true
end
--- Sends a request to set a season length.
-- @see SDK.World.Season.SetSeasonLength
-- @tparam string season
-- @tparam number length
-- @treturn boolean
function World.SetSeasonLength(season, length)
local fn_name = "SetSeasonLength"
season = ArgSeason(fn_name, season)
length = ArgUnsignedInteger(fn_name, length, "length")
if not season or not length then
return false
end
DebugString("Season length:", season, "(" .. Value.ToDaysString(length) .. ")")
World.PushEvent("ms_setseasonlength", { season = season, length = length })
return true
end
--- Weather
-- @section weather
--- Sends a request to send a lightning strike.
-- @see SDK.World.Weather.SendLightningStrike
-- @tparam Vector3 pt Point
-- @treturn boolean
function World.SendLightningStrike(pt)
local fn_name = "SendLightningStrike"
pt = ArgPoint(fn_name, pt)
if not pt then
return false
end
if not TheWorld:HasTag("forest") then
DebugErrorInvalidWorldType(fn_name, "must be in a forest")
return false
end
DebugString("Send lighting strike:", tostring(pt))
World.PushEvent("ms_sendlightningstrike", pt)
return true
end
--- Sends a request to send a mini earthquake.
-- @see SDK.World.Weather.SendMiniEarthquake
-- @tparam[opt] number radius Default: 20
-- @tparam[opt] number amount Default: 20
-- @tparam[opt] number duration Default: 2.5
-- @tparam[opt] EntityScript player Player instance (owner by default)
-- @treturn boolean
function World.SendMiniEarthquake(radius, amount, duration, player)
local fn_name = "SendMiniEarthquake"
radius = ArgUnsignedInteger(fn_name, radius or 20, "radius")
amount = ArgUnsignedInteger(fn_name, amount or 20, "amount")
duration = ArgUnsigned(fn_name, duration or 2.5, "duration")
player = ArgPlayer(fn_name, player)
if not radius or not amount or not duration or not player then
return false
end
if not TheWorld:HasTag("cave") then
DebugErrorInvalidWorldType(fn_name, "must be in a cave")
return false
end
DebugString("Send mini earthquake:", player:GetDisplayName())
World.PushEvent("ms_miniquake", {
target = player,
num = amount,
rad = radius,
duration = duration,
})
return true
end
--- Sends a request to set a delta moisture.
-- @see SDK.World.Weather.SetDeltaMoisture
-- @tparam[opt] number delta
-- @treturn boolean
function World.SetDeltaMoisture(delta)
delta = ArgNumber("SetDeltaMoisture", delta or 0, "delta")
if not delta then
return false
end
DebugString("Delta moisture:", Value.ToFloatString(delta))
World.PushEvent("ms_deltamoisture", delta)
return true
end
--- Sends a request to set a delta wetness.
-- @see SDK.World.Weather.SetDeltaWetness
-- @tparam[opt] number delta
-- @treturn boolean
function World.SetDeltaWetness(delta)
delta = ArgNumber("SetDeltaWetness", delta or 0, "delta")
if not delta then
return false
end
DebugString("Delta wetness:", Value.ToFloatString(delta))
World.PushEvent("ms_deltawetness", delta)
return true
end
--- Sends a request to set precipitation.
-- @see SDK.World.Weather.SetPrecipitation
-- @tparam[opt] boolean bool
-- @treturn boolean
function World.SetPrecipitation(bool)
bool = bool ~= false and true or false
DebugString("Precipitation:", tostring(bool))
World.PushEvent("ms_forceprecipitation", bool)
return true
end
--- Sends a request to set a snow level.
-- @see SDK.World.Weather.SetSnowLevel
-- @tparam number level
-- @treturn boolean
function World.SetSnowLevel(level)
local fn_name = "SetSnowLevel"
level = ArgUnitInterval(fn_name, level or 0, "level")
if not level then
return false
end
if TheWorld:HasTag("cave") then
DebugErrorInvalidWorldType(fn_name, "must be in a forest")
return false
end
DebugString("Snow level:", Value.ToFloatString(level))
World.PushEvent("ms_setsnowlevel", level)
return true
end
--- Lifecycle
-- @section lifecycle
--- Initializes.
-- @tparam SDK sdk
-- @tparam SDK.Remote parent
-- @treturn SDK.Remote.World
function World._DoInit(sdk, parent)
SDK = sdk
Remote = parent
Value = SDK.Utils.Value
return World
end
return World
|
local M = {}
local fn = vim.fn
local api = vim.api
local uv = vim.loop
local middleware_tbl = {}
local MiddleWare = {cache_enabled = true}
function M.get(regname)
return middleware_tbl[regname]
end
function M.set(regname, middleware)
middleware_tbl[regname] = middleware
end
function M.del(regname)
middleware_tbl[regname] = nil
end
function M.clear()
middleware_tbl = {}
end
function MiddleWare.new(o)
local self = MiddleWare
o = o or {}
setmetatable(o, self)
self.__index = self
o.regname = o.regname
o.cache_enabled = o.cache_enabled
o.get_cmds = o.get_cmds
o.get_func = o.get_func
o.set_cmds = o.set_cmds
o.set_func = o.set_func
if o.set_cmds then
o.set_path = o.set_path or o.set_cmds[1]
o.set_args = o.set_args
local args = {}
if not o.set_args then
for i = 2, #o.set_cmds do
table.insert(args, o.set_cmds[i])
end
end
o.set_args = args
o.handle = nil
end
o.regdata = {''}
o.regtype = 'v'
return o
end
function MiddleWare:store_pending_data(rdata, rtype)
self.pending_regdata = rdata
self.pending_regtype = rtype
end
function MiddleWare:clear_pending_data()
self.pending_regdata = nil
self.pending_regtype = nil
end
function MiddleWare:set()
local input = self.pending_regdata
local regtype = self.pending_regtype
if not input or not regtype or #input <= 0 then
return
end
if self.set_func then
self.set_func(input, regtype)
else
local stdin = uv.new_pipe(false)
local stderr = uv.new_pipe(false)
local stderr_buffered = {}
local handle
handle = uv.spawn(self.set_path, {
args = self.set_args,
stdio = {stdin, nil, stderr},
cmd = '/',
detached = self.cache_enabled
}, function(code, signal)
local _ = signal
if code ~= 0 then
vim.schedule(function()
api.nvim_err_writeln(
('clipboard: error invoking %s: code: %d, message: %s'):format(
table.concat(self.set_cmds, ' '), code,
table.concat(stderr_buffered, ' ')))
end)
end
handle:close()
if self.handle == handle then
self.handle = nil
end
end)
if self.cache_enabled then
local prev_handle = self.handle
if prev_handle then
vim.defer_fn(function()
if prev_handle and not prev_handle:is_closing() then
prev_handle:kill(15)
end
end, 1000)
end
self.handle = handle
end
stderr:read_start(function(err, data)
assert(not err, err)
if data then
table.insert(stderr_buffered, data)
else
stderr:close()
end
end)
stdin:write(table.concat(input, '\n'), function()
stdin:close()
end)
end
self.regtype = regtype
self.regdata = input
end
local function tbl_str_equal(t1, t2)
local ret = false
if #t1 == #t2 then
for i = 1, #t1 do
if t1[i] ~= t2[i] then
return ret
end
end
ret = true
end
return ret
end
function MiddleWare:get()
local regdata, regtype = {}, 'v'
if self.pending_regdata and self.pending_regtype then
regdata, regtype = self.pending_regdata, self.pending_regtype
elseif self.get_func then
regdata, regtype = unpack(self.get_func())
elseif self.handle then
regdata, regtype = self.regdata, self.regtype
else
local cbdata = fn.systemlist(self.get_cmds, {''}, true)
local sh_error = vim.v.shell_error
if sh_error == 0 then
if tbl_str_equal(cbdata, self.regdata) then
regdata, regtype = cbdata, self.regtype
else
regdata, regtype = cbdata, 'v'
end
else
if self.get_did_error ~= sh_error then
self.get_did_error = sh_error
local msg = ('%s return %d: %s'):format(table.concat(self.get_cmds, ' '), sh_error,
table.concat(cbdata, ' '))
api.nvim_echo({{msg, 'Error'}}, true, {})
end
-- respect original try_cmd logic
-- some vulnerable system environment may throw error
return 0
end
end
return {regdata, regtype}
end
M.new = MiddleWare.new
return M
|
local json = require('json')
local curl = require('http.client').new()
local utils = require('dockerapi.utils')
-- https://docs.docker.com/engine/api/v1.35/#operation/SwarmInspect
local function inspect(url, unix_socket)
local r = curl:get(
string.format('%s/swarm', url),
{unix_socket = unix_socket}
)
local body, err = utils.get_json_body(r)
if err then
return nil, err
elseif r.status ~= 200 then
return nil, body.message
else
return body
end
end
local swarm = {}
function swarm.init(url, unix_socket)
return {
inspect = function(...) return inspect(url, unix_socket, ...) end,
}
end
return swarm
|
PlayerFlyState = Class{__includes = EntityFlyState}
function PlayerFlyState:init(player)
self.entity = player
end
function PlayerFlyState:enter(enterParams)
self.entity:changeJetState("fly")
end
function PlayerFlyState:update(dt)
self.entity.direction:reset()
if love.keyboard.isDown('left') then
self.entity.direction:add('left')
elseif love.keyboard.isDown('right') then
self.entity.direction:add('right')
end
if love.keyboard.isDown('up') then
self.entity.direction:add('up')
elseif love.keyboard.isDown('down') then
self.entity.direction:add('down')
end
if self.entity.direction:isEmpty() then
self.entity:changeState('idle')
end
if love.keyboard.isDown('space') then
self.entity:shoot("up")
end
-- perform movement and base collision detection against window borders
EntityFlyState.update(self, dt)
end |
local function map(mod, key, exec)
vim.keymap.set(mod, key, exec)
end
local wk = require("which-key")
local function telescope()
return require("telescope.builtin")
end
wk.register({
q = { "<cmd>close<CR>", "close" },
w = { "<cmd>wa<CR>", "save" },
Q = { "<cmd>quitall<CR>", "quit" },
["'"] = {
function()
require("FTerm").toggle()
end,
"Terminal",
},
f = {
name = "Telescope",
k = {
function()
telescope().keymaps()
end,
"Keymaps",
},
w = {
function()
telescope().live_grep()
end,
"Grep",
},
f = {
function()
telescope().find_files()
end,
"Files",
},
r = {
function()
telescope().registers()
end,
"Registers",
},
o = {
function()
telescope().lsp_workspace_symbols()
end,
"WorkspaceSymbols",
},
a = {
function()
vim.lsp.buf.code_action()
end,
"Actions",
},
i = {
function()
telescope().lsp_references()
end,
"LSP Reference",
},
b = {
function()
telescope().buffers()
end,
"Buffers",
},
s = {
function()
telescope().git_status()
end,
"GitStatus",
},
c = {
function()
telescope().git_commits()
end,
"GitCommits",
},
m = {
function()
telescope().marks()
end,
"Marks",
},
d = {
function()
telescope().lsp_document_symbols()
end,
"Lsp_document_symbols",
},
p = {
function()
require("telescope").extensions.projects.projects()
end,
"Projects",
},
},
g = {
name = "Git",
r = {
function()
telescope().lsp_references()
end,
"LspReferences",
},
d = {
function()
require("diffview").open()
end,
"Open Diff",
},
D = {
function()
require("diffview").close()
end,
"Close Diff",
},
a = { ":!git add .<CR>", "git add ." },
c = { ":terminal git commit<CR>", "git commit" },
p = { ":!git push<CR>", "git push" },
P = { ":!git pull<CR>", "git pull" },
},
l = {
name = "LSP",
a = {
function()
require("lspsaga.codeaction").code_actions()
end,
"CodeActions",
},
r = {
function()
require("lspsaga.rename").rename()
end,
"Rename",
},
d = {
function()
require("lspsaga.provider").preview_definition()
end,
"PreviewDefinition",
},
},
p = { name = "packer", s = {
function()
require("core.pack").status()
end,
"PackerStatus",
} },
d = {
name = "debug",
b = {
function()
require("dap").toggle_breakpoint()
end,
"BreakPoint",
},
B = {
function()
require("dap").clear_breakpoint()
end,
"Clear BreakPoint",
},
p = {
function()
require("dap").pause()
end,
"Pause",
},
c = {
function()
require("dap").continue()
end,
"Continue",
},
C = {
function()
require("dap").close()
end,
"Close",
},
o = {
function()
require("dap").step_over()
end,
"Step Over",
},
i = {
function()
require("dap").step_into()
end,
"Step Into",
},
l = {
function()
require("dap").run_to_cursor()
end,
"Run to Corsor",
},
r = {
function()
require("dap").run()
end,
"Run",
},
R = {
function()
require("dap").repl.open()
end,
"Repl",
},
u = {
name = "UI",
a = {
function()
require("telescope").extensions.dap.commands({})
end,
"Commands",
},
o = {
function()
require("dapui").open()
end,
"Open",
},
c = {
function()
require("dapui").close()
end,
"Close",
},
C = {
function()
require("telescope").extensions.dap.configurations({})
end,
"Configurations",
},
},
},
h = { name = "hunk" },
b = {
name = "buffer",
d = {
"<cmd>bd<CR>",
"Delete Buffer",
},
},
}, { prefix = "<leader>" })
wk.register({
g = {
d = {
function()
require("telescope.builtin").lsp_definitions()
end,
"Define",
},
i = {
function()
require("telescope.builtin").lsp_implementations()
end,
"Implementation",
},
D = {
function()
require("telescope.builtin").lsp_type_definitions()
end,
"TypeDefinition",
},
},
})
map("n", "\\'", function()
require("FTerm").toggle()
end)
map("n", "\\9", function()
require("dap").toggle_breakpoint()
end)
map("n", "<F9>", function()
require("dap").toggle_breakpoint()
end)
map("n", "\\%", function()
require("dap").close()
end)
map("n", "<S-F5>", function()
require("dap").close()
end)
map("n", "\\-", function()
require("dap").step_over()
end)
map("n", "<F11>", function()
require("dap").step_over()
end)
map("n", "\\0", function()
require("dap").step_into()
end)
map("n", "<F10>", function()
require("dap").step_into()
end)
map("n", "\\5", function()
require("dap").run()
end)
map("n", "<F5>", function()
require("dap").run()
end)
map("n", "<leader>hs", "<cmd>Gitsigns stage_hunk<CR>")
map("v", "<leader>hs", "<cmd>Gitsigns stage_hunk<CR>")
map("n", "<leader>hr", "<cmd>Gitsigns reset_hunk<CR>")
map("v", "<leader>hr", "<cmd>Gitsigns reset_hunk<CR>")
map("n", "<leader>hp", "<cmd>Gitsigns preview_hunk<CR>")
map("n", "<leader>hu", "<cmd>Gitsigns undo_stage_hunk<CR>")
map("n", "<leader>bs", "<cmd>Gitsigns stage_buffer<CR>")
map("n", "<leader>br", "<cmd>Gitsigns reset_buffer<CR>")
map("n", "<leader>hb", "<cmd>Gitsigns reset_buffer<CR>")
map("n", "<leader>tb", "<cmd>Gitsigns toggle_current_line_blame<CR>")
map("n", "<leader>hd", "<cmd>Gitsigns diffthis<CR>")
map("n", "<leader>hD", "<cmd>Gitsigns diffthis<CR>")
map("n", "<leader>td", "<cmd>Gitsigns toggle_deleted<CR>")
map("o", "ih", "<cmd><C-U>Gitsigns select_hunk<CR>")
map("x", "ih", "<cmd><C-U>Gitsigns select_hunk<CR>")
map("n", "<leader>e", function()
require("nvim-tree").toggle()
end)
map("n", "<leader>we", function()
require("nvim-tree").focus()
end)
map("n", "<leader>o", function()
require("symbols-outline").toggle_outline()
end)
map("n", "<leader>r", function()
require("trouble").toggle()
end)
map("n", "<leader>u", "<cmd>UndotreeToggle<CR>")
map("n", "<leader><Tab>", "<cmd>b#<CR>")
map("n", "<leader>ws", "<cmd>sp<CR>")
map("n", "<leader>wv", "<cmd>vs<CR>")
map("n", "[d", function()
vim.diagnostic.goto_prev()
end)
map("n", "]d", function()
vim.diagnostic.goto_next()
end)
map("n", "K", function()
vim.lsp.buf.hover()
end)
map("n", "ge", function()
vim.diagnostic.open_float()
end)
map("n", "\\q", "<cmd>close<CR>")
map("n", "\\y", '"+y')
map("n", "\\p", '"+p')
map("n", "\\P", '"+P')
map("v", "\\y", '"+y')
map("v", "\\p", '"+p')
map("v", "\\P", '"+P')
map("n", "<C-up>", "<cmd>res +1<CR>")
map("n", "<C-down>", "<cmd>res -1<CR>")
map("n", "<C-left>", "<cmd>vertical resize-1<CR>")
map("n", "<C-right>", "<cmd>vertical resize+1<CR>")
map("i", "<C-h>", "<Left>")
map("i", "<C-e>", "<End>")
map("i", "<C-l>", "<Right>")
map("i", "<C-k>", "<Up>")
map("i", "<C-j>", "<Down>")
map("i", "<C-a>", "<ESC>^i")
map("n", "<C-h>", "<C-w>h")
map("n", "<C-l>", "<C-w>l")
map("n", "<C-k>", "<C-w>k")
map("n", "<C-j>", "<C-w>j")
map("t", "<ESC>", "<C-\\><C-n>")
map("n", "Q", "<Nop>")
map("n", "<leader>by", "<cmd>%y+ <CR>") -- copy whole file content
map("n", "<C-t>", "<cmd>enew <CR>") -- new buffer
map("n", "<Tab>", function()
require("bufferline").cycle(1)
end)
map("n", "<S-Tab>", function()
require("bufferline").cycle(-1)
end)
|
-- Deadlock (deadlock-beltboxes-loaders) integration
if deadlock then
-- Tier table
local nuclear_tier_table = {
transport_belt = "nuclear-transport-belt",
colour = {r=0,g=1,b=0},
underground_belt = "nuclear-underground-belt",
splitter = "nuclear-splitter",
technology = "nuclear-logistics",
loader_category = "crafting-with-fluid",
beltbox_technology = "nuclear-logistics",
beltbox_category = "crafting-with-fluid"
}
-- Adding tier
deadlock.add_tier(nuclear_tier_table)
-- Stacking
deadlock.add_stack("sawdust", "__RandomFactorioThings__/graphics/icons/sawdust.png", "deadlock-stacking-1", 32)
deadlock.add_stack("compressed-fuel", "__RandomFactorioThings__/graphics/icons/compressed-fuel.png", "deadlock-stacking-2", 32)
deadlock.add_stack("nuclear-metal", "__RandomFactorioThings__/graphics/icons/nuclear-metal.png", "deadlock-stacking-3", 32)
deadlock.add_stack("raw-nuclear-metal", "__RandomFactorioThings__/graphics/icons/raw-nuclear-metal.png", "deadlock-stacking-3", 32)
-- Plutonium
if mods["PlutoniumEnergy"] then
-- Tier table
local plutonium_tier_table = {
transport_belt = "plutonium-transport-belt",
colour = {r=0.1,g=0.9,b=0.7},
underground_belt = "plutonium-underground-belt",
splitter = "plutonium-splitter",
technology = "plutonium-logistics",
loader_category = "crafting-with-fluid",
beltbox_technology = "plutonium-logistics",
beltbox_category = "crafting-with-fluid"
}
-- Adding tier
deadlock.add_tier(plutonium_tier_table)
-- Stacking
deadlock.add_stack("plutonium-steel", "__RandomFactorioThings__/graphics/icons/plutonium-steel.png", "deadlock-stacking-3", 32)
deadlock.add_stack("raw-plutonium-steel", "__RandomFactorioThings__/graphics/icons/raw-plutonium-steel.png", "deadlock-stacking-3", 32)
deadlock.add_stack("plutonium-239", "__PlutoniumEnergy__/graphics/icons/plutonium-239.png", "deadlock-stacking-2", 32)
deadlock.add_stack("plutonium-238", "__PlutoniumEnergy__/graphics/icons/plutonium-238.png", "deadlock-stacking-2", 32)
deadlock.add_stack("MOX-fuel", "__PlutoniumEnergy__/graphics/icons/MOX-fuel.png", "deadlock-stacking-2", 32)
deadlock.add_stack("plutonium-rounds-magazine", "__PlutoniumEnergy__/graphics/icons/plutonium-rounds-magazine.png", "deadlock-stacking-2", 32, "ammo")
deadlock.add_stack("plutonium-cannon-shell", "__PlutoniumEnergy__/graphics/icons/plutonium-cannon-shell.png", "deadlock-stacking-2", 32, "ammo")
deadlock.add_stack("explosive-plutonium-cannon-shell", "__PlutoniumEnergy__/graphics/icons/explosive-plutonium-cannon-shell.png", "deadlock-stacking-2", 32, "ammo")
end
end
-- Vanilla Loaders HD (vanilla-loaders-hd) integration
if vanillaHD then
-- Create nuclear loader
vanillaHD.addLoader("nuclear-loader", {r=0,g=255,b=0}, "nuclear-transport-belt", "nuclear-logistics", "express-loader")
-- If PlutoniumEnergy is present, create plutonium loader with nuclear loader as the previous tier
if mods["PlutoniumEnergy"] then
vanillaHD.addLoader("plutonium-loader", {r=26,g=230,b=179}, "plutonium-transport-belt", "plutonium-logistics", "nuclear-loader")
end
end
-- Add some recipes to productivty modules limitation (which is whitelist for some reason)
local limitation_to_add = {'nuclear-flying-robot-frame', 'raw-nuclear-metal', 'coal-dust', 'sawdust', 'compressed-fuel'}
if mods['PlutoniumEnergy'] then table.insert(limitation_to_add, 'raw-plutonium-steel') end
for _, module in pairs(data.raw['module']) do
if module.limitation and module.effect.productivity then
for _, recipe in pairs(limitation_to_add) do
table.insert(module.limitation, recipe)
end
end
end
|
--氷水艇キングフィッシャー
--
--Script by Trishula9
function c101107008.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101107008,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetTarget(c101107008.eqtg)
e1:SetOperation(c101107008.eqop)
c:RegisterEffect(e1)
--defense attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DEFENSE_ATTACK)
e2:SetValue(1)
c:RegisterEffect(e2)
--unequip
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,101107008)
e3:SetTarget(c101107008.sptg)
e3:SetOperation(c101107008.spop)
c:RegisterEffect(e3)
end
function c101107008.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c101107008.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101107008.filter(chkc) and chkc~=c end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():CheckUniqueOnField(tp)
and Duel.IsExistingTarget(c101107008.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101107008.filter,tp,LOCATION_MZONE,0,1,1,c)
end
function c101107008.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c101107008.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
function c101107008.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c101107008.spfilter(c,def)
return c:IsFaceup() and c:GetAttack()<=def and c:IsAbleToHand()
end
function c101107008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if chk==0 then return ec and ec:IsDefenseAbove(0)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101107008.spfilter,tp,0,LOCATION_MZONE,1,nil,ec:GetDefense()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c101107008.spfilter,tp,0,LOCATION_MZONE,1,1,nil,ec:GetDefense())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101107008.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
|
function user_setup()
state.OffenseMode:options('Normal', 'Acc', 'Refresh', 'Hybrid', 'Learning', 'AM3')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT', 'Learning')
gear.capes = {}
gear.capes.tp = { name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Phys. dmg. taken-10%',}}
gear.capes.ws = { name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','Weapon skill damage +10%'}}
gear.rings={}
gear.rings.left={name="Stikini Ring +1", bag="wardrobe"}
gear.rings.right={name="Stikini Ring +1", bag="wardrobe4"}
-- Additional local binds
send_command('bind ^` input /ja "Chain Affinity" <me>')
send_command('bind @` input /ja "Burst Affinity" <me>')
update_combat_form()
end
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
sets.buff['Burst Affinity'] = {feet="Mavi Basmak +2"}
sets.buff['Chain Affinity'] = {head="Hashishin Kavuk +1", feet="Assimilator's Charuqs +2"}
sets.buff.Convergence = {head="Luhlaza Keffiyeh +1"}
sets.buff.Diffusion = {feet="Luhlaza Charuqs +1"}
sets.buff.Enchainment = {body="Luhlaza Jubbah +1"}
sets.buff.Efflux = {legs="Hashishin Tayt +1"}
-- Precast Sets
-- Precast sets to enhance JAs
sets.precast.JA['Azure Lore'] = {hands="Mirage Bazubands +2"}
sets.TreasureHunter = {waist="Chaac Belt"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {
head="Herculean Helm",
body="Ischemia Chasu.",hands="Adhemar Wristbands +1",
back="Moonlight Cape",waist="Chaac Belt",feet="Herculean Boots"}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
sets.precast.FC = {
head="Carmine Mask +1",neck="Baetyl Pendant",ear1="Etiolation Earring",
body="Dread Jupon",hands="Leyline Gloves",ring1="Kishar Ring",ring2="Veneficium Ring",
back="Perimede Cape",waist="Witful Belt",legs="Gyve Trousers",feet="Carmine Greaves +1"}
sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {})
sets.precast.FC['Blue Magic'] = set_combine(sets.precast.FC, {})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {ammo="Aurgelmir Orb",
head="Adhemar Bonnet +1",neck="Fotia Gorget",ear1="Telos Earring",ear2="Moonshade Earring",
body="Assimilator's Jubbah +3",hands="Jhakri Cuffs +2",ring1="Hetairoi Ring",ring2="Epona's Ring",
back=gear.capes.ws,waist="Fotia Belt",legs="Samnuha Tights",feet="Herculean Boots"}
sets.precast.WS.Acc = set_combine(sets.precast.WS, {ammo="Aurgelmir Orb",
head="Carmine Mask +1",ear1="Odr Earring",ear2="Dignitary's Earring",
body="Assimilator's Jubbah +3",hands="Malignance Gloves",ring1="Ilabrat Ring",ring2="Cacoethic Ring +1",
legs="Carmine Cuisses +1",feet="Assimilator's Charuqs +2"
})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {
head="Nyame Helm",ear2="Regal Earring",legs="Luhlaza Shalwar +3",feet="Amalric Nails +1"})
sets.precast.WS['Sanguine Blade'] = set_combine(sets.precast.WS, {
head="Pixie Hairpin +1",neck="Baetyl Pendant",ear1="Friomisi Earring",ear2="Regal Earring",
body="Amalric Doublet +1",ring1="Archon Ring",ring2="Shiva Ring +1",
back="Toro Cape",waist="Orpheus's Sash",legs="Amalric Slops +1",feet="Amalric Nails +1"})
sets.precast.WS['Chant du Cygne'] = set_combine(sets.precast.WS, {ammo="Aurgelmir Orb",
head="Adhemar Bonnet +1",neck="Mirage Stole +1",ear1="Odr Earring",
body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Ilabrat Ring",ring2="Begrudging Ring",
back=gear.capes.tp,legs="Samnuha Tights",feet="Thereoid Greaves"})
sets.precast.WS['Chant du Cygne'].Acc = sets.precast.WS.Acc
sets.precast.WS['Requiescat'].Acc = sets.precast.WS.Acc
sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS, {neck="Mirage Stole +1",ear1="Ishvara Earring",ring1="Ilabrat Ring",ring2="Shukuyu Ring",back=gear.capes.ws,waist="Sailfi Belt +1",legs="Luhlaza Shalwar +3",feet="Nyame Sollerets"})
sets.precast.WS['Expiacion'] = sets.precast.WS['Savage Blade']
sets.precast.WS['Black Halo'] = set_combine(sets.precast.WS['Savage Blade'], {})
sets.precast.WS['Judgment'] = sets.precast.WS['Black Halo']
-- Midcast Sets
sets.midcast.FastRecast = {
head="Carmine Mask +1",
body="Samnuha Coat",ring1="Kishar Ring",
back="Perimede Cape",neck="Baetyl Pendant"}
sets.midcast['Blue Magic'] = {}
-- Physical Spells --
sets.midcast['Blue Magic'].Physical = {
head="Luh. Keffiyeh +1",neck="Mirage Stole +1",ear1="Telos Earring",ear2="Dignitary's Earring",
body="Assimilator's Jubbah +3",hands="Rawhide Gloves",ring1="Ilabrat Ring",ring2="Shukuyu Ring",
back="Cornflower Cape",waist="Eschan Stone",legs="Hashishin Tayt +1",feet="Luhlaza Charuqs +1"}
sets.midcast['Blue Magic'].PhysicalAcc = {
head="Carmine Mask +1",neck="Mirage Stole +1",ear1="Odr Earring",ear2="Dignitary's Earring",
body="Assimilator's Jubbah +3",hands="Malignance Gloves",ring1="Ilabrat Ring",ring2="Cacoethic Ring +1",
back="Cornflower Cape",waist="Eschan Stone",legs="Hashishin Tayt +1",feet="Assimilator's Charuqs +2"}
sets.midcast['Blue Magic'].PhysicalStr = set_combine(sets.midcast['Blue Magic'].Physical,
{})
sets.midcast['Blue Magic'].PhysicalDex = set_combine(sets.midcast['Blue Magic'].Physical,
{ear1="Odr Earring",ring2="Ramuh Ring +1"})
sets.midcast['Blue Magic'].PhysicalVit = set_combine(sets.midcast['Blue Magic'].Physical,
{})
sets.midcast['Blue Magic'].PhysicalAgi = set_combine(sets.midcast['Blue Magic'].Physical,
{ring1="Ilabrat Ring"})
sets.midcast['Blue Magic'].PhysicalInt = set_combine(sets.midcast['Blue Magic'].Physical,
{back="Toro Cape"})
sets.midcast['Blue Magic'].PhysicalMnd = set_combine(sets.midcast['Blue Magic'].Physical,
{})
sets.midcast['Blue Magic'].PhysicalChr = set_combine(sets.midcast['Blue Magic'].Physical,
{})
sets.midcast['Blue Magic'].PhysicalHP = set_combine(sets.midcast['Blue Magic'].Physical)
-- Magical Spells --
sets.midcast['Blue Magic'].Magical = {ammo="Pemphredo Tathlum",
head="Nyame Helm",neck="Baetyl Pendant",ear1="Friomisi Earring",ear2="Regal Earring",
body="Amalric Doublet +1",hands="Amalric Gages +1",ring1="Shiva Ring +1",ring2="Acumen Ring",
back="Cornflower Cape",waist="Orpheus's Sash",legs="Amalric Slops +1",feet="Amalric Nails +1"}
sets.midcast['Blue Magic'].Magical.Resistant = set_combine(sets.midcast['Blue Magic'].Magical, {
ear1="Gwati Earring",ear2="Dignitary's Earring",
body="Amalric Doublet +1",hands="Amalric Gages +1",ring1=gear.rings.left,ring2=gear.rings.right})
sets.midcast['Blue Magic'].MagicalMnd = set_combine(sets.midcast['Blue Magic'].Magical)
sets.midcast['Blue Magic'].MagicalChr = set_combine(sets.midcast['Blue Magic'].Magical)
sets.midcast['Blue Magic'].MagicalVit = set_combine(sets.midcast['Blue Magic'].Magical,
{})
sets.midcast['Blue Magic'].MagicalDex = set_combine(sets.midcast['Blue Magic'].Magical)
sets.midcast['Blue Magic'].MagicAccuracy = sets.midcast['Blue Magic'].Magical.Resistant
-- Breath Spells --
sets.midcast['Blue Magic'].Breath = {
head="Luhlaza Keffiyeh +1",neck="Mirage Stole +1",
body="Carmine Cuisses +1",
feet="Herculean Boots"}
-- Other Types --
sets.midcast['Blue Magic'].Stun = set_combine(sets.midcast['Blue Magic'].MagicAccuracy)
sets.midcast['Blue Magic']['White Wind'] = {
neck="Mirage Stole +1",ear1="Mendicant's Earring",
body="Ischemia Chasu.",hands="Adhemar Wristbands +1",
back="Pahtli Cape",legs="Gyve Trousers",feet="Herculean Boots"}
sets.midcast['Blue Magic'].Healing = {
body="Ischemia Chasu.",ear1="Mendicant's Earring",
hands="Jhakri Cuffs +2",ring1=gear.rings.left,ring2=gear.rings.right,
back="Pahtli Cape",legs="Gyve Trousers",feet="Herculean Boots"}
sets.midcast['Blue Magic'].SkillBasedBuff = {
head="Luhlaza Keffiyeh +1",neck="Mirage Stole +1",
body="Assimilator's Jubbah +3",ring1=gear.rings.left,ring2=gear.rings.right,
back="Cornflower Cape",legs="Hashishin Tayt +1",feet="Luhlaza Charuqs +1"}
sets.midcast['Blue Magic'].Buff = sets.midcast['Blue Magic'].SkillBasedBuff
sets.midcast['Tenebral Crush'] = set_combine(sets.midcast['Blue Magic'].Magical, {
head="Pixie Hairpin +1",ring2="Archon Ring"
})
sets.midcast['Subduction'] = set_combine(sets.midcast['Blue Magic'].Magical, {
waist="Orpheus's Sash"
})
sets.midcast.Protect = {neck="Incanter's Torque",ring1="Sheltered Ring"}
sets.midcast.Protectra = {neck="Incanter's Torque",ring1="Sheltered Ring"}
sets.midcast.Shell = {neck="Incanter's Torque",ring1="Sheltered Ring"}
sets.midcast.Shellra = {neck="Incanter's Torque",ring1="Sheltered Ring"}
sets.midcast['Elemental Magic'] = sets.midcast['Blue Magic'].Magical
-- Sets to return to when not performing an action.
-- Gear for learning spells: +skill and AF hands.
sets.Learning = {
head="Luhlaza Keffiyeh +1",neck="Mirage Stole +1",
body="Assimilator's Jubbah +3",hands="Assimilator's Bazubands +3",
back="Cornflower Cape",legs="Hashishin Tayt +1",feet="Luhlaza Charuqs +1"}
sets.latent_refresh = {waist="Fucho-no-obi"}
-- Idle sets
sets.idle = {
head="Rawhide Mask",neck="Bathy Choker +1",ear1="Telos Earring",ear2="Infused Earring",
body="Amalric Doublet +1",hands="Malignance Gloves",ring1=gear.rings.left,ring2="Defending Ring",
back="Moonlight Cape",waist="Flume Belt +1",legs="Carmine Cuisses +1",feet="Malignance Boots"}
sets.idle.PDT = {
head="Malignance Chapeau",neck="Loricate Torque +1",
body="Malignance Tabard",hands="Malignance Gloves",ring1="Patricius Ring",ring2="Defending Ring",
back="Moonlight Cape",waist="Flume Belt +1",legs="Carmine Cuisses +1",feet="Malignance Boots"}
sets.idle.Town = set_combine(sets.idle, {})
sets.idle.Learning = set_combine(sets.idle, sets.Learning)
-- Resting sets
sets.resting = sets.idle
-- Defense sets
sets.defense.PDT = {ammo="Staunch Tathlum +1",
head="Malignance Chapeau",neck="Loricate Torque +1",
body="Malignance Tabard",hands="Malignance Gloves",ring1="Patricius Ring",ring2="Defending Ring",
back="Moonlight Cape",legs="Malignance Tights",feet="Malignance Boots"}
sets.defense.MDT = set_combine(sets.defense.PDT,{ring1="Purity Ring"})
sets.Kiting = {legs="Carmine Cuisses +1"}
-- Engaged sets
-- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
-- sets if more refined versions aren't defined.
-- If you create a set with both offense and defense modes, the offense mode should be first.
-- EG: sets.engaged.Dagger.Accuracy.Evasion
-- Normal melee group
sets.engaged = {ammo="Aurgelmir Orb",
head="Adhemar Bonnet +1",neck="Mirage Stole +1",ear1="Telos Earring",ear2="Suppanomimi",
body="Adhemar Jacket +1",hands="Adhemar Wristbands +1",ring1="Hetairoi Ring",ring2="Epona's Ring",
back=gear.capes.tp,waist="Windbuffet Belt +1",legs="Samnuha Tights",feet="Herculean Boots"}
sets.engaged.Hybrid = set_combine(sets.engaged, {
head="Malignance Chapeau",neck="Loricate Torque +1",body="Malignance Tabard",hands="Malignance Gloves",ring2="Defending Ring",legs="Malignance Tights",feet="Malignance Boots"
})
sets.engaged.Acc = set_combine(sets.engaged, {ammo="Aurgelmir Orb",
head="Carmine Mask +1",neck="Mirage Stole +1",ear1="Odr Earring",ear2="Dignitary's Earring",
body="Assimilator's Jubbah +3",hands="Malignance Gloves",ring1="Ilabrat Ring",ring2="Cacoethic Ring +1",
waist="Eschan Stone",legs="Carmine Cuisses +1",feet="Assimilator's Charuqs +2"})
sets.engaged.PDT = set_combine(sets.engaged, sets.defense.PDT)
sets.engaged.Refresh = set_combine(sets.engaged, {body="Assimilator's Jubbah +3"})
sets.engaged.DW = sets.engaged
sets.engaged.DW.Acc = sets.engaged.Acc
sets.engaged.DW.PDT = sets.engaged.PDT
sets.engaged.DW.Refresh = sets.engaged.Refresh
sets.engaged.Learning = set_combine(sets.engaged, sets.Learning)
sets.engaged.DW.Learning = set_combine(sets.engaged.DW, sets.Learning)
sets.engaged.AM3 = set_combine(sets.engaged, {
head="Malignance Chapeau",body="Malignance Tabard",hands="Malignance Gloves",ring1="Ilabrat Ring",ring2="Chirich Ring +1",
waist="Gerdr Belt",legs="Malignance Tights",feet="Malignance Boots"})
sets.engaged.DW.AM3 = sets.engaged.AM3
sets.WeatherObi = {waist="Hachirin-no-obi"}
end |
local Character = require 'game.world.character.character'
local Util = require 'util'
local AnnoyingBastard = {}
AnnoyingBastard.__index = AnnoyingBastard
setmetatable(AnnoyingBastard, { __index = Character })
function AnnoyingBastard.create(world, player, x, y, npcNumber)
local self = Character.create(world, x, y)
setmetatable(self, AnnoyingBastard)
self.type = 'AnnoyingBastard'
self.player = player
self.maxSpeed = 300
self.minSpeed = 10
self.radius = 800
self.pulseSpeed = 500
self.pulsed = false
self.walkUpdateTime = math.random(1.5, 3)
self.randomXSpeed = math.random(50, 100)
self.randomYSpeed = math.random(50, 100)
self._walkdt = 0
return self
end
function AnnoyingBastard:load()
self.screamSound = love.audio.newSource("media/high_pitched_female_scream.mp3", "static")
Character.load(self)
end
function AnnoyingBastard:update(dt)
if self.pulsed then
self.vx, self.vy = self:beingPulsed()
self.vx = -self.vx
self.vy = -self.vy
self.pulsed = false
elseif self:isWithinDistanceFromPlayer(self.radius) then
self.vx, self.vy = self:_calculateVelocity()
else
self.vx, self.vy = self:_randomWalk(dt)
end
self:move(self.x + (self.vx * dt), self.y + (self.vy * dt))
Character.update(self, dt)
end
function AnnoyingBastard:draw()
Character.draw(self)
if Util:isDebug() then
love.graphics.print("vx " .. math.floor(self.vx) .. " vy " .. math.floor(self.vy), self.x, self.y)
end
end
function AnnoyingBastard:beingPulsed()
self.pulsed = true
self.screamSound:play()
local x, y = self:_getXYFromSpeedAndRatio(self.pulseSpeed, self:_getXYRatio())
return x, y
end
function AnnoyingBastard:isWithinDistanceFromPlayer(distance)
return self:_distanceSquaredFromPlayer() <= distance * distance
end
------------------ MATHS ----------------------
function AnnoyingBastard:_calculateSpeed()
-- This determines the magnitude of the velocity of the AnnoyingBastard.
-- This is the function we should change to make the AnnoyingBastard behave differently.
local distanceSquared = self:_distanceSquaredFromPlayer()
if distanceSquared < self.radius * self.radius then
local gradient = (self.minSpeed - self.maxSpeed) / self.radius
return self.maxSpeed + gradient * math.sqrt(distanceSquared)
end
return 0
end
function AnnoyingBastard:_distanceVectorFromPlayer()
local x = self.x - self.player.x
local y = self.y - self.player.y
return x, y
end
function AnnoyingBastard:_distanceSquaredFromPlayer()
local x, y = self:_distanceVectorFromPlayer()
-- square roots are expensive. Make the function dependant on the distance squared.
return x * x + y * y
end
function AnnoyingBastard:_getXYRatio()
local x, y = self:_distanceVectorFromPlayer()
return y/x
end
function AnnoyingBastard:_getXYFromSpeedAndRatio(speed, ratio)
-- This is just a maths formula
local vxSquared = (speed * speed) / (1 + ratio * ratio)
local vySquared = speed * speed - vxSquared
-- Follow the player
local xDirection = 0
local yDirection = 0
if self.player.x > self.x then
xDirection = 1
else
xDirection = -1
end
if self.player.y > self.y then
yDirection = 1
else
yDirection = -1
end
return xDirection * math.sqrt(vxSquared), yDirection * math.sqrt(vySquared)
end
function AnnoyingBastard:_calculateVelocity()
local xYRatio = self:_getXYRatio()
local speed = self:_calculateSpeed()
-- If the X Y ratio is huge, then x is zero
if xYRatio == math.huge then
return 0, speed
elseif xYRatio == 0 then
return speed, 0
else
return self:_getXYFromSpeedAndRatio(speed, xYRatio)
end
end
function AnnoyingBastard:_randomWalk(dt)
local directionX = self:_oneOrMinusOne()
local directionY = self:_oneOrMinusOne()
local vx = self.vx
local vy = self.vy
if self._walkdt > self.walkUpdateTime then
self._walkdt = 0
vx, vy = directionX * self.randomXSpeed, directionY * self.randomYSpeed
else
self._walkdt = self._walkdt + dt
end
return vx, vy
end
function AnnoyingBastard:_oneOrMinusOne()
local number = math.random(-1, 1)
if number < 0 then
return -1
else
return 1
end
end
return AnnoyingBastard
|
DEFINE_BASECLASS( "mp_service_browser" )
SERVICE.Name = "Webpage"
SERVICE.Id = "www"
SERVICE.Base = "res"
SERVICE.Abstract = true -- This service must be handled as a special case.
if CLIENT then
function SERVICE:OnBrowserReady( browser )
BaseClass.OnBrowserReady( self, browser )
browser:OpenURL( self.url )
end
function SERVICE:IsMouseInputEnabled()
return IsValid( self.Browser )
end
else
function SERVICE:Match( url )
return false
end
end
|
--[[ Copyright 2014 Sergej Nisin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
]]
local DownloadState = {}
local this = {}
DownloadState.this = this
function DownloadState.load()
this.downfile = nil
this.callbacks = {}
end
function DownloadState.enter(downloadURL, text, callbacks)
this.downfile = DownloadManager.new(downloadURL)
this.text = text
this.callbacks = callbacks or {}
end
function DownloadState.update(dt)
this.downfile:update()
if this.downfile.success or this.downfile.error then
if this.downfile.success then
local retcont = Tserial.unpack(this.downfile.content, true)
if retcont then
StateManager.retBack(retcont)
else
retcont = {
error = true,
errortype = "connenction error",
errordesc = "malformed data"
}
StateManager.retBack(retcont)
end
else
retcont = {
error = true,
errortype = "connenction error",
errordesc = this.downfile.error
}
StateManager.retBack(retcont)
end
end
end
function DownloadState.draw()
local lg = love.graphics
local rw = math.min(lg.getWidth(), 300*pixelscale)
local rh = math.min(lg.getHeight(), 150*pixelscale)
local rx = (lg.getWidth()-rw)/2
local ry = (lg.getHeight()-rh)/2
lg.setColor(248,232,176)
lg.rectangle("fill", rx, ry, rw, rh)
lg.setColor(175,129,75)
lg.rectangle("line", rx, ry, rw, rh)
lg.setColor(0,0,0)
_width, nlines = font:getWrap(this.text, rw-10*pixelscale)
lg.printf(this.text, rx+5*pixelscale, (ry+rh/2)-font:getHeight()*#nlines/2, rw-10*pixelscale, "center")
end
function DownloadState.threaderror(thread, errorstr )
local retcont = {
error = true,
errortype = "threaderror",
errordesc = "Error in Thread \""..thread.."\": "..errorstr
}
StateManager.retBack(retcont)
end
function DownloadState.mousepressed(x, y, button)
if this.callbacks.mousepressed then
this.callbacks.mousepressed(x, y, button)
end
end
function DownloadState.mousereleased(x, y, button)
if this.callbacks.mousereleased then
this.callbacks.mousereleased(x, y, button)
end
end
function DownloadState.keypressed(k)
if this.callbacks.keypressed then
this.callbacks.keypressed(k)
end
end
StateManager.registerState("download", DownloadState) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.