content
stringlengths 5
1.05M
|
---|
--------------------------------
-- @module ZipFile
-- @parent_module cc
--------------------------------
-- Check does a file exists or not in zip file<br>
-- param fileName File to be checked on existance<br>
-- return true whenever file exists, false otherwise<br>
-- since v2.0.5
-- @function [parent=#ZipFile] fileExists
-- @param self
-- @param #string fileName
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#ZipFile] getFirstFilename
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
--
-- @function [parent=#ZipFile] writeFileData
-- @param self
-- @param #string fileName
-- @param #string dir
-- @return int#int ret (return value: int)
--------------------------------
--
-- @function [parent=#ZipFile] getNextFilename
-- @param self
-- @return string#string ret (return value: string)
--------------------------------
--
-- @function [parent=#ZipFile] update
-- @param self
-- @param #float dt
-- @return ZipFile#ZipFile self (return value: cc.ZipFile)
--------------------------------
--
-- @function [parent=#ZipFile] destroy
-- @param self
-- @return ZipFile#ZipFile self (return value: cc.ZipFile)
--------------------------------
-- Regenerate accessible file list based on a new filter string.<br>
-- param filter New filter string (first part of files names)<br>
-- return true whenever zip file is open successfully and it is possible to locate<br>
-- at least the first file, false otherwise<br>
-- since v2.0.5
-- @function [parent=#ZipFile] setFilter
-- @param self
-- @param #string filter
-- @return bool#bool ret (return value: bool)
--------------------------------
-- @overload self, string, string
-- @overload self, string
-- @function [parent=#ZipFile] create
-- @param self
-- @param #string zipFile
-- @param #string filter
-- @return ZipFile#ZipFile ret (return value: cc.ZipFile)
return nil
|
local mysql = exports.mysql
-- towing impound lot
local towSphere = createColPolygon(2789.131835, -1468.5177, 2789.131835, -1468.5177, 2789.133544, -1425.358398, 2820.9104, -1425.353027, 2820.912597, -1467.778808)
-- pd impound lot
local towSphere2 = createColPolygon(1540.209594, -1602.937377, 1540.209594, -1602.937377, 1590.368408, -1602.958251, 1583.952514, -1617.322265625, 1540.34082, -1617.087524)
local currentReleasePos = 0
function getReleasePosition()
currentReleasePos = currentReleasePos + 1
if currentReleasePos > 5 then
currentReleasePos = 1
end
local x = 2742.7216796875
local y = -1474.1484375
local z = 32
if (currentReleasePos == 1) then
y = -1474.1484375
elseif (currentReleasePos == 2) then
y = -1463.5712890625
elseif (currentReleasePos == 3) then
y = -1454.5625
elseif (currentReleasePos == 4) then
y = -1444.880859375
else
y = -1433.2705078125
end
return x, y, z
end
function cannotVehpos(thePlayer)
return isElementWithinColShape(thePlayer, towSphere) and getElementData(thePlayer,"faction") ~= 30
end
-- generic function to check if a guy is in the col polygon and the right team
function CanTowTruckDriverVehPos(thePlayer, commandName)
local ret = 0
if (isElementWithinColShape(thePlayer, towSphere) or isElementWithinColShape(thePlayer,towSphere2)) then
if (getElementData(thePlayer,"faction") == 30) then
ret = 2
else
ret = 1
end
end
return ret
end
--Auto Pay for PD
function CanTowTruckDriverGetPaid(thePlayer, commandName)
if (isElementWithinColShape(thePlayer,towSphere2)) then
if (getElementData(thePlayer,"faction") == 30) then
return true
end
end
return false
end
function UnlockVehicle(element, matchingdimension)
if (getElementType(element) == "vehicle" and getVehicleOccupant(element) and getElementData(getVehicleOccupant(element),"faction") == 30 and getElementModel(element) == 525 and getVehicleTowedByVehicle(element)) then
local temp = element
while (getVehicleTowedByVehicle(temp)) do
temp = getVehicleTowedByVehicle(temp)
local owner = getElementData(temp, "owner")
local faction = getElementData(temp, "faction")
local dbid = getElementData(temp, "dbid")
local impounded = getElementData(temp, "Impounded")
if (owner > 0) then
if (faction > 3 or faction < 0) then
if (source == towSphere2) then
--PD make sure its not marked as impounded so it cannot be recovered and unlock/undp it
setVehicleLocked(temp, false)
setElementData(temp, "Impounded", 0)
setElementData(temp, "enginebroke", 0, false)
setVehicleDamageProof(temp, false)
setVehicleEngineState(temp, false)
outputChatBox("((Please remember to /park and /handbrake your vehicle in our car park.))", getVehicleOccupant(element), 255, 194, 14)
else
if (getElementData(temp, "faction") ~= 30) then
if (impounded == 0) then
--unlock it and impound it
setElementData(temp, "Impounded", getRealTime().yearday)
setVehicleLocked(temp, false)
setElementData(temp, "enginebroke", 1, false)
setVehicleEngineState(temp, false)
outputChatBox("((Please remember to /park and /handbrake your vehicle in our car park.))", getVehicleOccupant(element), 255, 194, 14)
end
end
end
else
outputChatBox("This Faction's vehicle cannot be impounded.", getVehicleOccupant(element), 255, 194, 14)
end
end
end
end
end
-- Command to impound Bikes:
function setbikeimpound(player, matchingDimension)
local leader = tonumber( getElementData(player, "factionleader") )
local veh = getPedOccupiedVehicle(player)
if (getElementData(player,"faction")) == 30 then
if (isPedInVehicle(player)) then
if (getVehicleType(veh) == "Bike") or (getVehicleType(veh) == "BMX") then
local owner = getElementData(veh, "owner")
local faction = getElementData(veh, "faction")
local dbid = getElementData(veh, "dbid")
local impounded = getElementData(veh, "Impounded")
if (owner > 0) then
if (faction > 3 or faction < 0) then
if (source == towSphere2) then
--PD make sure its not marked as impounded so it cannot be recovered and unlock/undp it
setVehicleLocked(veh, false)
setElementData(veh, "Impounded", 0)
setElementData(veh, "enginebroke", 0, false)
setVehicleDamageProof(veh, false)
setVehicleEngineState(veh, false)
outputChatBox("((Please remember to /park and /handbrake your vehicle in our car park.))", player, 255, 194, 14)
else
if (tonumber(leader)==1) then
if (getElementData(veh, "faction") ~= 30) then
if (impounded == 0) then
setElementData(veh, "Impounded", getRealTime().yearday)
setVehicleLocked(veh, false)
setElementData(veh, "enginebroke", 1, false)
setVehicleEngineState(veh, false)
outputChatBox("((Please remember to /park and /handbrake your vehicle in our car park.))", player, 255, 194, 14)
isin = false
end
end
else
outputChatBox("Command only usable by BTR Leader.", player, 255, 194, 14)
end
end
else
outputChatBox("This Faction's vehicle cannot be impounded.", player, 255, 194, 14)
end
end
else
outputChatBox("You can only use this command to impound MoterBikes and BMX.", player, 255, 194, 14)
end
else
outputChatBox("You are not in a vehicle.", player, 255, 0, 0)
end
end
end
addCommandHandler("impoundbike", setbikeimpound)
addEventHandler("onColShapeHit", towSphere, UnlockVehicle)
addEventHandler("onColShapeHit", towSphere2, UnlockVehicle)
function payRelease(vehID)
if exports.global:takeMoney(source, 95) then
exports.global:giveMoney(getTeamFromName("Best's Towing and Recovery"), 95)
setVehicleFrozen(vehID, false)
setElementPosition(vehID, getReleasePosition())
setVehicleRotation(vehID, 0, 0, 0) -- facing north
setVehicleLocked(vehID, true)
setElementData(vehID, "enginebroke", 0, false)
setVehicleDamageProof(vehID, false)
setVehicleEngineState(vehID, false)
setElementData(vehID, "handbrake", 0, false)
setElementData(vehID, "Impounded", 0)
updateVehPos(vehID)
triggerEvent("parkVehicle", source, vehID)
outputChatBox("Your vehicle has been released. (( Please remember to /park your vehicle so it does not respawn in front of our carpark. ))", source, 255, 194, 14)
else
outputChatBox("Insufficient Funds.", source, 255, 0, 0)
end
end
addEvent("releaseCar", true)
addEventHandler("releaseCar", getRootElement(), payRelease)
function disableEntryToTowedVehicles(thePlayer, seat, jacked, door)
if (getVehicleTowingVehicle(source)) then
outputChatBox("You cannot enter a vehicle being towed!", thePlayer, 255, 0, 0)
cancelEvent()
end
end
addEventHandler("onVehicleStartEnter", getRootElement(), disableEntryToTowedVehicles)
local releaseColShape = createColSphere(223.42578125, 114.265625, 1010.21875, 1)
setElementDimension(releaseColShape, 9001)
function triggerShowImpound(element, match)
if match then
local vehElements = {}
local count = 1
for key, value in ipairs(getElementsByType("vehicle")) do
local dbid = getElementData(value, "dbid")
if (getElementData(value, "Impounded") and getElementData(value, "Impounded") > 0 and ((dbid > 0 and exports.global:hasItem(element, 3, dbid) or (getElementData(value, "faction") == getElementData(element, "faction") and getElementData(value, "owner") == getElementData(element, "dbid"))))) then
vehElements[count] = value
count = count + 1
end
end
triggerClientEvent( element, "ShowImpound", element, vehElements)
end
end
addEventHandler("onColShapeHit", releaseColShape, triggerShowImpound)
function updateVehPos(veh)
local x, y, z = getElementPosition(veh)
local rx, ry, rz = getVehicleRotation(veh)
local interior = getElementInterior(veh)
local dimension = getElementDimension(veh)
local dbid = getElementData(veh, "dbid")
mysql:query_free("UPDATE vehicles SET x='" .. x .. "', y='" .. y .."', z='" .. z .. "', rotx='" .. rx .. "', roty='" .. ry .. "', rotz='" .. rz .. "', currx='" .. x .. "', curry='" .. y .. "', currz='" .. z .. "', currrx='" .. rx .. "', currry='" .. ry .. "', currrz='" .. rz .. "', interior='" .. interior .. "', currinterior='" .. interior .. "', dimension='" .. dimension .. "', currdimension='" .. dimension .. "' WHERE id='" .. dbid .. "'")
setVehicleRespawnPosition(veh, x, y, z, rx, ry, rz)
setElementData(veh, "respawnposition", {x, y, z, rx, ry, rz}, false)
end
function updateTowingVehicle(theTruck)
local thePlayer = getVehicleOccupant(theTruck)
if (thePlayer) then
if (getElementData(thePlayer,"faction") == 30) then
local owner = getElementData(source, "owner")
local faction = getElementData(source, "faction")
local carName = getVehicleName(source)
if owner < 0 and faction == -1 then
outputChatBox("(( This " .. carName .. " is a civilian vehicle. ))", thePlayer, 255, 195, 14)
elseif (faction==-1) and (owner>0) then
local ownerName = exports["vehicle-system"]:getCharacterName(owner)
outputChatBox("(( This " .. carName .. " belongs to " .. ownerName .. ". ))", thePlayer, 255, 195, 14)
else
local row = mysql:query_fetch_assoc("SELECT name FROM factions WHERE id='" .. faction .. "' LIMIT 1")
if not (row == false) then
local ownerName = row.name
outputChatBox("(( This " .. carName .. " belongs to the " .. ownerName .. " faction. ))", thePlayer, 255, 195, 14)
end
end
if (getElementData(source, "Impounded") > 0) then
local output = getRealTime().yearday-getElementData(source, "Impounded")
outputChatBox("(( This " .. carName .. " has been Impounded for: " .. output .. (output == 1 and " Day." or " Days.") .. " ))", thePlayer, 255, 195, 14)
end
-- fix for handbraked vehicles
local handbrake = getElementData(source, "handbrake")
if (handbrake == 1) then
setElementData(source, "handbrake",0,false)
setVehicleFrozen(source, false)
end
end
if thePlayer then
exports.logs:logMessage("[TOW] " .. getPlayerName( thePlayer ) .. " started towing vehicle #" .. getElementData(source, "dbid") .. ", owned by " .. tostring(exports['vehicle-system']:getCharacterName(getElementData(source,"owner"))) .. ", from " .. table.concat({exports.global:getElementZoneName(source)}, ", ") .. " (pos = " .. table.concat({getElementPosition(source)}, ", ") .. ", rot = ".. table.concat({getVehicleRotation(source)}, ", ") .. ", health = " .. getElementHealth(source) .. ")", 14)
end
end
end
addEventHandler("onTrailerAttach", getRootElement(), updateTowingVehicle)
function updateCivilianVehicles(theTruck)
if (isElementWithinColShape(theTruck, towSphere)) then
local owner = getElementData(source, "owner")
local faction = getElementData(source, "faction")
local dbid = getElementData(source, "dbid")
if (dbid >= 0 and faction == -1 and owner < 0) then
exports.global:giveMoney(getTeamFromName("Best's Towing and Recovery"), 95)
outputChatBox("The state has un-impounded the vehicle you where towing.", getVehicleOccupant(theTruck), 255, 194, 14)
respawnVehicle(source)
end
end
if getVehicleOccupant(theTruck) then
exports.logs:logMessage("[TOW STOP] " .. getPlayerName( getVehicleOccupant(theTruck) ) .. " stopped towing vehicle #" .. getElementData(source, "dbid") .. ", owned by " .. tostring(exports['vehicle-system']:getCharacterName(getElementData(source,"owner"))) .. ", in " .. table.concat({exports.global:getElementZoneName(source)}, ", ") .. " (pos = " .. table.concat({getElementPosition(source)}, ", ") .. ", rot = ".. table.concat({getVehicleRotation(source)}, ", ") .. ", health = " .. getElementHealth(source) .. ")", 14)
end
end
addEventHandler("onTrailerDetach", getRootElement(), updateCivilianVehicles)
|
function KD(key, mouse)
if key ~= nil then
key:lower()
--
if key == "f" then
c = Instance.new("Part")
c.Parent = workspace
c.Transparency = 1
c.Name = "AreaKillFire"
c.Anchored = false
c.CFrame = CFrame.new(mouse.Hit.x,mouse.Hit.y + 2,mouse.Hit.z)
c.Size = Vector3.new(1, 1, 1)
f = Instance.new("Fire")
f.Parent = c
f.Size = 19
f.Heat = 6.5
f.Color = Color3.new(0.8,0,0)
f.SecondaryColor = Color3.new(0.1,1,0.2)
mods = workspace:GetChildren()
for e = 1, #mods do
if mods[e].className == "Model" then
if mods[e].Name == bin.Parent.Parent.Name then
wait()
else
if mods[e]:findFirstChild("Torso") ~= nil then
if (mods[e].Torso.Position - c.Position).magnitude < 10 then
mods[e]:BreakJoints()
wait(3)
c:Remove()
end
end
end
end
end
--
end
end
end
bin.Selected:connect(function(mouse)
mouse.KeyDown:connect(function(key) KD(key, mouse) end)
end)
|
-- two library
solution "two"
configurations {
"Debug",
"Release",
}
platforms {
"x32",
"x64"
}
language "C++"
PROJECT_DIR = path.getabsolute("..")
BUILD_DIR = path.join(path.getabsolute(".."), "build")
dofile "toolchain.lua"
dofile "two.lua"
two_libs();
dofile "two_example.lua" |
measure = {"m", "dm", "cm"}
ind = math.random(3)
min_range = 2
max_range = 15
edge_b = min_range + math.random(max_range - min_range)
fct = 1 + math.random(3)
edge_c = fct * edge_b
edge_a = fct * edge_c
|
--====================================================================--
-- Test: Style Manager
--====================================================================--
module(..., package.seeall)
-- Semantic Versioning Specification: http://semver.org/
local VERSION = "0.1.0"
--====================================================================--
--== Imports
local dUI = require 'lib.dmc_ui'
local TestUtils = require 'tests.test_utils'
local Utils = require 'dmc_utils'
--====================================================================--
--== Setup, Constants
local W, H = display.contentWidth, display.contentHeight
local H_CENTER, V_CENTER = W*0.5, H*0.5
local StyleMgr = dUI.Style.Manager
--====================================================================--
--== Support Functions
local hasProperty = TestUtils.hasProperty
local hasPropertyValue = TestUtils.hasPropertyValue
local hasValidStyleProperties = TestUtils.hasValidStyleProperties
local hasInvalidStyleProperties = TestUtils.hasInvalidStyleProperties
local styleInheritsFrom = TestUtils.styleInheritsFrom
local styleIsa = TestUtils.styleIsa
local styleRawPropertyValueIs = TestUtils.styleRawPropertyValueIs
local stylePropertyValueIs = TestUtils.stylePropertyValueIs
local styleHasProperty = TestUtils.styleHasProperty
local styleInheritsProperty = TestUtils.styleInheritsProperty
local styleHasPropertyValue = TestUtils.styleHasPropertyValue
local styleInheritsPropertyValue = TestUtils.styleInheritsPropertyValue
local styleInheritsPropertyValueFrom = TestUtils.styleInheritsPropertyValueFrom
local marker = TestUtils.outputMarker
--====================================================================--
--== Module Testing
--====================================================================--
function suite_setup()
end
function setup()
StyleMgr.purgeStyles()
end
--====================================================================--
--== Test Class Methods
--== Add Style
function test_errorAddStyle_badStyles()
-- print( "test_errorAddStyle_badStyles" )
assert_error( function() StyleMgr.addStyle( nil ) end, "style can't be nil" )
assert_error( function() StyleMgr.addStyle( {} ) end, "style can't be nil" )
assert_error( function() StyleMgr.addStyle( 4 ) end, "style can't be nil" )
assert_error( function() StyleMgr.addStyle( "bad style" ) end, "style can't be nil" )
end
function test_errorAddStyle_noName()
-- print( "test_errorAddStyle_noName" )
local s1 = dUI.newRoundedBackgroundStyle()
assert_equal( StyleMgr.addStyle( s1 ), nil, "style should be added" )
end
function test_errorAddStyle_duplicateName()
-- print( "test_errorAddStyle_noName" )
local name = 'rounded-background-style'
local s1, s2
s1 = dUI.newRoundedBackgroundStyle()
s1.name = name
s2 = dUI.newRoundedBackgroundStyle()
s2.name = name
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), s1, "style should be added" )
end
function test_addStyleViaNameAdd()
-- print( "test_addStyleViaNameAdd" )
local s1, name
name = 'rounded-background-style'
s1 = dUI.newRoundedBackgroundStyle()
s1.name = name
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), s1, "style should be added" )
end
function test_changeStyleViaNameChange()
-- print( "test_changeStyleViaNameChange" )
local s1
local n1, n2
n1 = 'rounded-background-style'
n2 = 'rounded-background-style2'
s1 = dUI.newRoundedBackgroundStyle()
s1.name = n1
assert_equal( StyleMgr.getStyle( s1.TYPE, n1 ), s1, "style should be added" )
s1.name = n2
assert_equal( StyleMgr.getStyle( s1.TYPE, n2 ), s1, "style should be renamed")
end
--== Get Style
function test_errorGetStyle_badNames()
-- print( "test_errorGetStyle_badNames" )
assert_error( function() StyleMgr.getStyle( '', nil ) end, "name can't be nil" )
assert_error( function() StyleMgr.getStyle( nil, {} ) end, "name can't be nil" )
assert_error( function() StyleMgr.getStyle( 'hello', 4 ) end, "name can't be nil" )
end
function test_getStyle_stringName()
-- print( "test_getStyle_stringName" )
local s1, name
name = 'rounded-background-style'
s1 = dUI.newRoundedBackgroundStyle()
s1.name = name
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), s1, "style should be added" )
end
--== Remove Style
function test_errorRemoveStyle_badNames()
-- print( "test_errorRemoveStyle_badNames" )
assert_error( function() StyleMgr.removeStyle( nil, nil ) end, "style can't be nil" )
assert_error( function() StyleMgr.removeStyle( '', {} ) end, "style can't be nil" )
assert_error( function() StyleMgr.removeStyle( nil, 4 ) end, "style can't be nil" )
end
function test_removeStyleViaNameChange()
-- print( "test_removeStyleViaNameChange" )
local s1, name
name = 'rounded-background-style'
s1 = dUI.newRoundedBackgroundStyle()
s1.name = name
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), s1, "style should be added" )
s1.name = nil
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), nil, "style should be removed")
end
function test_removeStyleViaNameChange()
-- print( "test_removeStyleViaNameChange" )
local s1, name
name = 'rounded-background-style'
s1 = dUI.newRoundedBackgroundStyle()
s1.name = name
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), s1, "style should be added" )
s1.name = nil
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), nil, "style should be removed")
end
--== Inherit
function test_inheritStyleByName()
-- print( "test_inheritStyleByName" )
local s1, s2
local name
name = 'rounded-background-style'
s1 = dUI.newRoundedBackgroundStyle()
s1.name = name
assert_equal( StyleMgr.getStyle( s1.TYPE, name ), s1, "style could be added" )
s2 = dUI.newRoundedBackgroundStyle()
s2.inherit = name
styleInheritsFrom( s2, s1 )
end
--[[
this test needs to be run by itself
since we're using timer.performWithDelay()
--]]
--[[
--]]
function test_addStyleTodUIByName()
-- print( "test_addStyleTodUIByName" )
local s1, s2
local w1
local n1, n2
n1 = 'rounded-background-style'
n2 = 'rounded-background-style2'
s1 = dUI.newRoundedBackgroundStyle{
width=200,
height=100,
}
s1.name = n1
s2 = dUI.newRoundedBackgroundStyle{
width=100,
height=50,
view={
fillColor={1,0,1,0.5}
}
}
s2.name = n2
assert_equal( StyleMgr.getStyle( s1.TYPE, n1 ), s1, "style could be added" )
assert_equal( StyleMgr.getStyle( s2.TYPE, n2 ), s2, "style could be added" )
w1 = dUI.newRoundedBackground()
w1.x, w1.y = H_CENTER, V_CENTER
w1.style = n1
timer.performWithDelay( 1000, function()
w1.style = n2
end)
timer.performWithDelay( 2000, function()
w1.style = n1
end)
end
--[[
add a style to a theme, create theme first
--]]
function test_addStyleToTheme()
-- print( "test_addStyleToTheme" )
local s1, n1
local t1, tId
tId = 'red-theme'
t1 = dUI.createTheme( tId, {
name='Red Theme',
})
n1 = 'home-background-style'
s1 = dUI.newRoundedBackgroundStyle{
width=100,
height=50,
view={
fillColor={1,0,1,0.5}
}
}
t1.addStyle( n1, s1 )
end
|
--[[
French humor site: http://lelombrik.net
$Id$
Copyright © 2007 the VideoLAN team
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
--]]
-- Probe function.
function probe()
local path = vlc.path:gsub("^www%.", "")
return vlc.access == "http"
and string.match( path, "^lelombrik%.net/videos" )
end
-- Parse function.
function parse()
while true do
line = vlc.readline()
if not line then
vlc.msg.err("Couldn't extract the video URL from lelombrik")
return { }
end
if string.match( line, "id=\"nom_fichier\">" ) then
title = string.gsub( line, ".*\"nom_fichier\">([^<]*).*", "%1" )
if title then
title = vlc.strings.from_charset( "ISO_8859-1", title )
end
elseif string.match( line, "'file'" ) then
_,_,path = string.find( line, "'file', *'([^']*)")
elseif string.match( line, "flashvars=" ) then
path = string.gsub( line, "flashvars=.*&file=([^&]*).*", "%1" )
arturl = string.gsub( line, "flashvars=.*&image=([^&]*).*", "%1" )
elseif string.match( line, "'image'" ) then
_,_,arturl = string.find( line, "'image', *'([^']*)")
end
if path and arturl and title then
return { { path = path; arturl = arturl; title = title } }
end
end
end
|
local TreeSitter = require("refactoring.treesitter.treesitter")
local Version = require("refactoring.version")
local Nodes = require("refactoring.treesitter.nodes")
local FieldNode = Nodes.FieldNode
local StringNode = Nodes.StringNode
local TakeFirstNode = Nodes.TakeFirstNode
local QueryNode = Nodes.QueryNode
local InlineNode = Nodes.InlineNode
local Java = {}
function Java.new(bufnr, ft)
return TreeSitter:new({
version = Version:new(
TreeSitter.version_flags.Scopes,
TreeSitter.version_flags.Indents,
TreeSitter.version_flags.Locals
),
filetype = ft,
bufnr = bufnr,
scope_names = {
program = "program",
method_declaration = "function",
class_declaration = "class",
},
block_scope = {
method_declaration = true,
block = true,
},
variable_scope = {
local_variable_declaration = true,
},
local_var_names = {
InlineNode("(variable_declarator name: (_) @tmp_capture)"),
},
function_args = {
InlineNode(
" (formal_parameters (formal_parameter name: (_) @tmp_capture))"
),
},
local_var_values = {
InlineNode("(variable_declarator value: (_) @tmp_capture)"),
},
local_declarations = {
InlineNode("(local_variable_declaration) @tmp_capture"),
},
indent_scopes = {
method_declaration = true,
class_declaration = true,
if_statement = true,
for_statement = true,
enhanced_for_statement = true,
while_statement = true,
do_statement = true,
},
debug_paths = {
class_declaration = FieldNode("name"),
method_declaration = TakeFirstNode(
QueryNode("(method_declaration (identifier) @tmp_capture)"),
StringNode("function")
),
if_statement = StringNode("if"),
for_statement = StringNode("for"),
enhanced_for_statement = StringNode("enhanced_for"),
while_statement = StringNode("while"),
do_statement = StringNode("do"),
},
statements = {
InlineNode("(expression_statement) @tmp_capture"),
InlineNode("(return_statement) @tmp_capture"),
InlineNode("(if_statement) @tmp_capture"),
InlineNode("(for_statement) @tmp_capture"),
InlineNode("(enhanced_for_statement) @tmp_capture"),
InlineNode("(do_statement) @tmp_capture"),
InlineNode("(while_statement) @tmp_capture"),
InlineNode("(local_variable_declaration) @tmp_capture"),
},
require_class_name = true,
require_class_type = true,
require_param_types = true,
}, bufnr)
end
return Java
|
local ffi = require("ffi")
local engine = engine
local PtrToNum = PtrToNum
local table = table
local type = type
local print = print
local error = error
local unpack = unpack
local pairs = pairs
local string = string
local pcall = pcall
ffi.cdef[[
typedef bool (*tProcessEventHook) (struct UObject*, struct UFunction*, char*, void*);
void LUAFUNC_AddStaticEngineHook(struct UFunction* pFunction, tProcessEventHook funcHook);
void LUAFUNC_RemoveStaticEngineHook(struct UFunction* pFunction);
]]
local RegisteredHooks = {}
local engineHook = {}
local function GetArg(arg, pParms)
return ffi.cast(arg.castTo, pParms + arg.offset)[0]
end
function engineHook.ProcessHooks(pObject, pFunction, pParms, pResult)
local ptrNum = PtrToNum(pFunction)
local hookTable = RegisteredHooks[ptrNum]
if hookTable == nil then
print(string.format("[Lua] Warning: engineHook.ProcessHooks called for %s (0x%X) with no hook table",
pFunction:GetName(),
ptrNum))
return true
end
-- TODO: This section is always run even if there are no hooks (which shouldn't happpen) or
-- even if all the hooks are raw hooks and don't get given argData anyway.
local fields = engine._FuncsInternal[ptrNum].fields
local argData = {}
for i=1,#fields do
if not fields[i].isRet then
argData[fields[i].name] = GetArg(fields[i], pParms)
end
end
for _,v in pairs(hookTable) do
local hookFunc = v[1]
local isRaw = v[2]
local status, ret
if not isRaw then
status, ret = pcall(hookFunc, pObject, argData)
else
status, ret = pcall(hookFunc, pObject, pFunction, pParms, pResult)
end
if not status then
print("Error in EngineHook: " .. ret)
end
end
return true
end
local function SafeProcessHooks(pObject, pFunction, pParms, pResult)
local status, ret = pcall(ProcessHooks, pObject, pFunction, pParms, pResult)
print(status, ret)
return true
end
local EngineCallback = ffi.cast("tProcessEventHook", engineHook.ProcessHooks)
local function AddInternal(className, funcName, hookName, hookFunc, rawHook)
if engine.Classes[className] == nil then error("Class " .. className .. " not found") end
local funcData = engine.Classes[className].funcs[funcName]
if funcData == nil then error("Function " .. funcName .. " not found") end
if not funcData.ptr or funcData.ptr == nil then error("Function has no pointer") end
if type(hookName) ~= "string" then error("Hook name must be a string") end
if type(hookFunc) ~= "function" then error("Hook function must be a function") end
local ptrNum = PtrToNum(funcData.ptr)
if RegisteredHooks[ptrNum] == nil then
RegisteredHooks[ptrNum] = {}
ffi.C.LUAFUNC_AddStaticEngineHook(funcData.ptr, EngineCallback)
end
RegisteredHooks[ptrNum][hookName] = { hookFunc, rawHook }
print(string.format("[Lua] Engine Hook added for function %q", funcData.ptr:GetFullName()))
end
function engineHook.Add(className, funcName, hookName, hookFunc)
return AddInternal(className, funcName, hookName, hookFunc, false)
end
function engineHook.AddRaw(className, funcName, hookName, hookFunc)
return AddInternal(className, funcName, hookName, hookFunc, true)
end
function engineHook.RemoveAll()
-- Foreach function
for ptrNum,_ in pairs(RegisteredHooks) do
-- Remove the hook inside the engine
local ptr = ffi.cast("struct UFunction*", ptrNum)
ffi.C.LUAFUNC_RemoveStaticEngineHook(ptr)
-- nil it
RegisteredHooks[ptrNum] = nil
end
end
function engineHook.Remove(className, funcName, hookName)
if engine.Classes[className] == nil then error("Class " .. className .. " not found") end
local funcData = engine.Classes[className].funcs[funcName]
if funcData == nil then error("Function " .. funcName .. " not found") end
if not funcData.ptr then error("Function has no pointer") end
if type(hookName) ~= "string" then error("Hook name must be a string") end
local ptrNum = PtrToNum(funcData.ptr)
if RegisteredHooks[ptrNum] == nil then print("Hook table for function does not exist") return end
RegisteredHooks[ptrNum][hookName] = nil
if table.count(RegisteredHooks[ptrNum]) == 0 then
ffi.C.LUAFUNC_RemoveStaticEngineHook(funcData.ptr)
RegisteredHooks[ptrNum] = nil
end
print(string.format("[Lua] Engine Hook removed for function %q", funcData.ptr:GetFullName()))
end
return engineHook
|
return {'foraminifeer','foraminiferen','forceps','forceren','forehand','forel','forellenvangst','forelschimmel','forens','forensde','forensen','forensenbelasting','forensengemeente','forensentrein','forensenverkeer','forensisch','forensisme','forenzen','forenzenbelasting','forfait','forfaitair','forfaitcijfers','forfaitscore','forint','form','forma','formaat','formaatconversie','formaatzegel','formaldehyde','formaline','formaliseren','formalisering','formalisme','formalist','formalistisch','formaliteit','formant','format','formateur','formatie','formatieberaad','formatiebudgetsysteem','formatief','formatieopdracht','formatieperiode','formatieplaats','formatieplaatsenplan','formatieplan','formatiepoging','formatieproces','formatieronde','formatievliegen','formatrice','formatteeropdracht','formatteren','formattering','formeel','formeerder','formeren','formering','formica','formidabel','formol','formularium','formule','formuleerkunst','formulefilm','formulemanipulatie','formuleren','formulering','formuleringsfase','formulevak','formulevorm','formulewagen','formulier','formuliergebed','formuliersoort','formulierveld','fornuis','fors','forsgebouwd','forsheid','forsig','forsythia','fort','forte','forteiland','fortengordel','fortenlinie','fortepianist','fortepiano','fortificatie','fortissimo','fortnight','forto','fortuin','fortuinlijk','fortuintje','fortuinzoeker','fortuinzoekster','fortuynisme','fortuynist','forum','forumavond','forumbijeenkomst','forumdiscussie','forumlid','forumpresentatie','forums','formuleerbaar','formicatafel','forechecking','forellenvijver','formatiecrisis','formulebalk','formulekaart','formulierenbrigade','fortgracht','forumbezoeker','forumdebat','forumkeuze','forumnaam','forumonderdeel','forumsite','formatieruimte','formatieteam','forumbaas','forumbeheer','forumgeneratie','formatiespringen','fora','ford','formosa','fortuyn','fortuna','fortes','fortgens','forster','former','forrer','fortuijn','fords','fora','forceer','forceerde','forceerden','forceert','forehands','forellen','forelletje','forelletjes','foren','forensden','forensische','forenst','forfaitaire','formaatzegels','formaliseer','formaliseerde','formaliseerden','formaliseert','formalismen','formalisten','formalistische','formalistischer','formaliteiten','formaten','formateurs','formatiebesprekingen','formatiegesprekken','formaties','formatteer','formatteerde','formatteerden','formatteert','formeelst','formeer','formeerde','formeerden','formeerders','formeert','formele','formelen','formeler','formidabele','formidabeler','formidabelst','formidabelste','formuleer','formuleeradviezen','formuleerde','formuleerden','formuleerfouten','formuleert','formuleertechnieken','formuleringen','formules','formuletje','formuletjes','formulieren','formuliersoorten','formuliertje','formuliertjes','fornuizen','forse','forser','forsgebouwde','forsige','forsythias','forten','fortengordels','fortenlinies','fortificaties','fortificatien','fortuinen','fortuinlijke','fortuinlijker','fortuinlijkere','fortuinlijkst','fortuinlijkste','fortuintjes','fortuinzoekers','forumbijeenkomsten','forumleden','forst','forensengemeenten','forensentreinen','forfaits','forfaitscores','forinten','formanten','formatieplaatsen','formatiepogingen','formats','formelere','formeringen','formulerende','formulewagens','formuliergebeden','forsere','fortepianisten','fortuynisten','forumdiscussies','forumpje','fortissimi','forfaitje','formuleerbare','formicatafels','formaliseringen','formicatafeltje','fortepianos','forti','fortissimos','fortnights','fortos','fortuyns','forumbezoekers','formuliervelden','formulefilms','forellenvijvers','forumbazen','forumsites','formatieplannen','forumonderdelen','forumnamen','formatieteams','formatieplaatsenplannen','formulekaarten','forumbaasjes','formatieve'} |
return {
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 50
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 60
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 70
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 80
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 95
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 110
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 125
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 145
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 170
}
}
}
},
{
effect_list = {
{
type = "BattleBuffAddAttrRatio",
trigger = {
"onAttach",
"onStack"
},
arg_list = {
attr = "cannonPower",
number = 200
}
}
}
},
time = 0,
name = "塔什干",
init_effect = "jinengchufared",
color = "red",
picture = "",
desc = "",
stack = 5,
id = 12983,
icon = 12980,
last_effect = "",
blink = {
1,
0,
0,
0.3,
0.3
},
effect_list = {}
}
|
local AddonName, AddonTable = ...
-- Throne of Thunder
AddonTable.tot = {
87208, -- sigil-of-power
87209, -- sigil-of-wisdom
94574, -- pygmy-direhorn
94593, -- secrets-of-the-empire
94594, -- titan-runestone
95060, -- abandoned-spaulders-of-arrowflight
95061, -- lost-shoulders-of-fire
95062, -- forgotten-mantle-of-the-sun
95063, -- reconstructed-furious-shoulderplates
95064, -- abandoned-spaulders-of-renewal
95065, -- forgotten-mantle-of-the-moon
95066, -- lost-shoulders-of-healing
95067, -- lost-shoulders-of-fluidity
95068, -- reconstructed-bloody-shoulderplates
95069, -- reconstructed-holy-shoulderplates
95343, -- treasures-of-the-thunder-king
95498, -- bo-ris-horror-in-the-night
95499, -- invocation-of-the-dawn
95500, -- jerthud-graceful-hand-of-the-savior
95501, -- fyns-flickering-dagger
95502, -- do-tharak-the-swordbreaker
95503, -- miracoran-the-vehement-chord
95504, -- zeegs-ancient-kegsmasher
95505, -- greatsword-of-frozen-hells
95506, -- nadagasts-exsanguinator
95507, -- darkwood-spiritstaff
95516, -- visage-of-the-doomed
95858, -- invocation-of-the-dawn
95859, -- miracoran-the-vehement-chord
95860, -- fyns-flickering-dagger
95861, -- zeegs-ancient-kegsmasher
95862, -- darkwood-spiritstaff
95863, -- lost-shoulders-of-fire
95864, -- lost-shoulders-of-healing
95865, -- lost-shoulders-of-fluidity
95866, -- nadagasts-exsanguinator
95867, -- jerthud-graceful-hand-of-the-savior
95868, -- forgotten-mantle-of-the-moon
95869, -- forgotten-mantle-of-the-sun
95870, -- abandoned-spaulders-of-arrowflight
95871, -- abandoned-spaulders-of-renewal
95872, -- reconstructed-holy-shoulderplates
95873, -- reconstructed-furious-shoulderplates
95874, -- reconstructed-bloody-shoulderplates
95875, -- greatsword-of-frozen-hells
95876, -- do-tharak-the-swordbreaker
95877, -- bo-ris-horror-in-the-night
95878, -- visage-of-the-doomed
96127, -- hydra-scale-bloodcloak
96230, -- invocation-of-the-dawn
96231, -- miracoran-the-vehement-chord
96232, -- fyns-flickering-dagger
96233, -- zeegs-ancient-kegsmasher
96234, -- darkwood-spiritstaff
96235, -- lost-shoulders-of-fire
96236, -- lost-shoulders-of-healing
96237, -- lost-shoulders-of-fluidity
96238, -- nadagasts-exsanguinator
96239, -- jerthud-graceful-hand-of-the-savior
96240, -- forgotten-mantle-of-the-moon
96241, -- forgotten-mantle-of-the-sun
96242, -- abandoned-spaulders-of-arrowflight
96243, -- abandoned-spaulders-of-renewal
96244, -- reconstructed-holy-shoulderplates
96245, -- reconstructed-furious-shoulderplates
96246, -- reconstructed-bloody-shoulderplates
96247, -- greatsword-of-frozen-hells
96248, -- do-tharak-the-swordbreaker
96249, -- bo-ris-horror-in-the-night
96250, -- visage-of-the-doomed
96380, -- fissure-split-shoulderwraps
96381, -- robes-of-static-bursts
96382, -- jinrokhs-dreamshard
96383, -- drape-of-booming-nights
96384, -- soulblade-of-the-breaking-storm
96386, -- infinitely-conducting-bracers
96387, -- ghostbinder-greatboots
96388, -- ionized-yojamban-carapace
96602, -- invocation-of-the-dawn
96603, -- miracoran-the-vehement-chord
96604, -- fyns-flickering-dagger
96605, -- zeegs-ancient-kegsmasher
96606, -- darkwood-spiritstaff
96607, -- lost-shoulders-of-fire
96608, -- lost-shoulders-of-healing
96609, -- lost-shoulders-of-fluidity
96610, -- nadagasts-exsanguinator
96611, -- jerthud-graceful-hand-of-the-savior
96612, -- forgotten-mantle-of-the-moon
96613, -- forgotten-mantle-of-the-sun
96614, -- abandoned-spaulders-of-arrowflight
96615, -- abandoned-spaulders-of-renewal
96616, -- reconstructed-holy-shoulderplates
96617, -- reconstructed-furious-shoulderplates
96618, -- reconstructed-bloody-shoulderplates
96619, -- greatsword-of-frozen-hells
96620, -- do-tharak-the-swordbreaker
96621, -- bo-ris-horror-in-the-night
96622, -- visage-of-the-doomed
96815, -- Quadra-Head Brooch
96907, -- Wu-Lai, Bladed Fan of the Consorts
96974, -- invocation-of-the-dawn
96975, -- miracoran-the-vehement-chord
96976, -- fyns-flickering-dagger
96977, -- zeegs-ancient-kegsmasher
96978, -- darkwood-spiritstaff
96979, -- lost-shoulders-of-fire
96980, -- lost-shoulders-of-healing
96981, -- lost-shoulders-of-fluidity
96982, -- nadagasts-exsanguinator
96983, -- jerthud-graceful-hand-of-the-savior
96984, -- forgotten-mantle-of-the-moon
96985, -- forgotten-mantle-of-the-sun
96986, -- abandoned-spaulders-of-arrowflight
96987, -- abandoned-spaulders-of-renewal
96988, -- reconstructed-holy-shoulderplates
96989, -- reconstructed-furious-shoulderplates
96990, -- reconstructed-bloody-shoulderplates
96991, -- greatsword-of-frozen-hells
96992, -- do-tharak-the-swordbreaker
96993, -- bo-ris-horror-in-the-night
96994, -- visage-of-the-doomed
97126, -- tia-tia-the-scything-star
97127, -- tia-tia-the-scything-star
97128, -- tia-tia-the-scything-star
97129, -- tia-tia-the-scything-star
97130, -- tia-tia-the-scything-star
-- Jin'rokh the Breaker
94512, -- renatakis-soul-charm
94722, -- worldbreakers-stormscythe
94723, -- chestplate-of-violent-detonation
94724, -- lightning-eye-hood
94725, -- static-shot-shoulderguards
94726, -- cloudbreaker-greatbelt
94727, -- bracers-of-constant-implosion
94728, -- spearmans-jingling-leggings
94729, -- jinrokhs-soulcrystal
94730, -- soulblade-of-the-breaking-storm
94731, -- robes-of-static-bursts
94732, -- infinitely-conducting-bracers
94733, -- fissure-split-shoulderwraps
94734, -- ionized-yojamban-carapace
94735, -- drape-of-booming-nights
94736, -- ghostbinder-greatboots
94737, -- lightningweaver-gauntlets
94738, -- jinrokhs-dreamshard
94739, -- alsets-tormented-leggings
95510, -- sign-of-the-bloodied-god
95624, -- sign-of-the-bloodied-god
95625, -- renatakis-soul-charm
95626, -- lightning-eye-hood
95627, -- spearmans-jingling-leggings
95628, -- static-shot-shoulderguards
95629, -- cloudbreaker-greatbelt
95630, -- chestplate-of-violent-detonation
95631, -- bracers-of-constant-implosion
95632, -- worldbreakers-stormscythe
95633, -- jinrokhs-soulcrystal
95634, -- lightningweaver-gauntlets
95635, -- alsets-tormented-leggings
95636, -- fissure-split-shoulderwraps
95637, -- robes-of-static-bursts
95638, -- jinrokhs-dreamshard
95639, -- drape-of-booming-nights
95640, -- soulblade-of-the-breaking-storm
95642, -- infinitely-conducting-bracers
95643, -- ghostbinder-greatboots
95644, -- ionized-yojamban-carapace
95996, -- sign-of-the-bloodied-god
95997, -- renatakis-soul-charm
95998, -- lightning-eye-hood
95999, -- spearmans-jingling-leggings
96000, -- static-shot-shoulderguards
96001, -- cloudbreaker-greatbelt
96002, -- chestplate-of-violent-detonation
96003, -- bracers-of-constant-implosion
96004, -- worldbreakers-stormscythe
96005, -- jinrokhs-soulcrystal
96006, -- lightningweaver-gauntlets
96007, -- alsets-tormented-leggings
96008, -- fissure-split-shoulderwraps
96009, -- robes-of-static-bursts
96010, -- jinrokhs-dreamshard
96011, -- drape-of-booming-nights
96012, -- soulblade-of-the-breaking-storm
96014, -- infinitely-conducting-bracers
96015, -- ghostbinder-greatboots
96016, -- ionized-yojamban-carapace
96368, -- sign-of-the-bloodied-god
96369, -- renatakis-soul-charm
96370, -- lightning-eye-hood
96371, -- spearmans-jingling-leggings
96372, -- static-shot-shoulderguards
96373, -- cloudbreaker-greatbelt
96374, -- chestplate-of-violent-detonation
96375, -- bracers-of-constant-implosion
96376, -- worldbreakers-stormscythe
96377, -- jinrokhs-soulcrystal
96378, -- lightningweaver-gauntlets
96379, -- alsets-tormented-leggings
96740, -- sign-of-the-bloodied-god
96741, -- renatakis-soul-charm
96742, -- lightning-eye-hood
96743, -- spearmans-jingling-leggings
96744, -- static-shot-shoulderguards
96745, -- cloudbreaker-greatbelt
96746, -- chestplate-of-violent-detonation
96747, -- bracers-of-constant-implosion
96748, -- worldbreakers-stormscythe
96749, -- jinrokhs-soulcrystal
96750, -- lightningweaver-gauntlets
96751, -- alsets-tormented-leggings
96752, -- fissure-split-shoulderwraps
96753, -- robes-of-static-bursts
96754, -- jinrokhs-dreamshard
96755, -- drape-of-booming-nights
96756, -- soulblade-of-the-breaking-storm
96758, -- infinitely-conducting-bracers
96759, -- ghostbinder-greatboots
96760, -- ionized-yojamban-carapace
-- Horridon
93666, -- spawn-of-horridon
94514, -- horridons-last-gasp
94526, -- spark-of-zandalar
94740, -- jalaks-maelstrom-staff
94741, -- sullithuz-sandmail
94742, -- frozen-warlords-bracers
94743, -- bindings-of-multiplicative-strikes
94744, -- puncture-proof-greathelm
94745, -- horn-rimmed-doomcloak
94746, -- talisman-of-living-poison
94747, -- bloodlords-bloodsoaked-legplates
94748, -- wastewalkers-sandblasted-drape
94749, -- dinomancers-spiritbinding-spire
94750, -- vaccinators-armwraps
94751, -- armplates-of-the-vanquished-abomination
94752, -- flamecasters-burning-crown
94753, -- spaulders-of-dinomancy
94754, -- horridons-tusk-fragment
94755, -- venomlords-totemic-wand
94756, -- roots-of-rampaging-earth
94975, -- legguards-of-scintillating-scales
95514, -- petrified-eye-of-the-basilisk
95641, -- horridons-last-gasp
95645, -- wastewalkers-sandblasted-drape
95646, -- talisman-of-living-poison
95647, -- jalaks-maelstrom-staff
95648, -- bindings-of-multiplicative-strikes
95649, -- sullithuz-sandmail
95650, -- frozen-warlords-bracers
95651, -- bloodlords-bloodsoaked-legplates
95652, -- puncture-proof-greathelm
95653, -- horn-rimmed-doomcloak
95654, -- spark-of-zandalar
95655, -- flamecasters-burning-crown
95656, -- vaccinators-armwraps
95657, -- dinomancers-spiritbinding-spire
95658, -- horridons-tusk-fragment
95659, -- petrified-eye-of-the-basilisk
95660, -- venomlords-totemic-wand
95661, -- roots-of-rampaging-earth
95662, -- spaulders-of-dinomancy
95663, -- legguards-of-scintillating-scales
95664, -- armplates-of-the-vanquished-abomination
96013, -- horridons-last-gasp
96017, -- wastewalkers-sandblasted-drape
96018, -- talisman-of-living-poison
96019, -- jalaks-maelstrom-staff
96020, -- bindings-of-multiplicative-strikes
96021, -- sullithuz-sandmail
96022, -- frozen-warlords-bracers
96023, -- bloodlords-bloodsoaked-legplates
96024, -- puncture-proof-greathelm
96025, -- horn-rimmed-doomcloak
96026, -- spark-of-zandalar
96027, -- flamecasters-burning-crown
96028, -- vaccinators-armwraps
96029, -- dinomancers-spiritbinding-spire
96030, -- horridons-tusk-fragment
96031, -- petrified-eye-of-the-basilisk
96032, -- venomlords-totemic-wand
96033, -- roots-of-rampaging-earth
96034, -- spaulders-of-dinomancy
96035, -- legguards-of-scintillating-scales
96036, -- armplates-of-the-vanquished-abomination
96385, -- horridons-last-gasp
96389, -- wastewalkers-sandblasted-drape
96390, -- talisman-of-living-poison
96391, -- jalaks-maelstrom-staff
96392, -- bindings-of-multiplicative-strikes
96393, -- sullithuz-sandmail
96394, -- frozen-warlords-bracers
96395, -- bloodlords-bloodsoaked-legplates
96396, -- puncture-proof-greathelm
96397, -- horn-rimmed-doomcloak
96398, -- spark-of-zandalar
96399, -- flamecasters-burning-crown
96400, -- vaccinators-armwraps
96401, -- dinomancers-spiritbinding-spire
96402, -- horridons-tusk-fragment
96403, -- petrified-eye-of-the-basilisk
96404, -- venomlords-totemic-wand
96405, -- roots-of-rampaging-earth
96406, -- spaulders-of-dinomancy
96407, -- legguards-of-scintillating-scales
96408, -- armplates-of-the-vanquished-abomination
96757, -- horridons-last-gasp
96761, -- wastewalkers-sandblasted-drape
96762, -- talisman-of-living-poison
96763, -- jalaks-maelstrom-staff
96764, -- bindings-of-multiplicative-strikes
96765, -- sullithuz-sandmail
96766, -- frozen-warlords-bracers
96767, -- bloodlords-bloodsoaked-legplates
96768, -- puncture-proof-greathelm
96769, -- horn-rimmed-doomcloak
96770, -- spark-of-zandalar
96771, -- flamecasters-burning-crown
96772, -- vaccinators-armwraps
96773, -- dinomancers-spiritbinding-spire
96774, -- horridons-tusk-fragment
96775, -- petrified-eye-of-the-basilisk
96776, -- venomlords-totemic-wand
96777, -- roots-of-rampaging-earth
96778, -- spaulders-of-dinomancy
96779, -- legguards-of-scintillating-scales
96780, -- armplates-of-the-vanquished-abomination
-- Council of Elders
94513, -- wushoolays-final-choice
94516, -- fortitude-of-the-zandalari
94523, -- bad-juju
94758, -- zerat-malakks-soulburning-greatsword
94759, -- kura-kura-kazrajins-skullcleaver
94760, -- amun-thoth-suls-spiritrending-talons
94761, -- zandalari-robes-of-the-final-rite
94762, -- marlis-bloodstained-sandals
94763, -- gaze-of-garajal
94764, -- overloaded-bladebreaker-cuirass
94765, -- robes-of-treacherous-ground
94766, -- talisman-of-angry-spirits
94767, -- loa-ridden-bracers
95570, -- gauntlets-of-the-crackling-vanquisher
95575, -- gauntlets-of-the-crackling-conqueror
95580, -- gauntlets-of-the-crackling-protector
95665, -- bad-juju
95666, -- kura-kura-kazrajins-skullcleaver
95667, -- marlis-bloodstained-sandals
95668, -- zandalari-robes-of-the-final-rite
95669, -- wushoolays-final-choice
95670, -- amun-thoth-suls-spiritrending-talons
95671, -- robes-of-treacherous-ground
95672, -- gaze-of-garajal
95673, -- loa-ridden-bracers
95674, -- overloaded-bladebreaker-cuirass
95675, -- zerat-malakks-soulburning-greatsword
95676, -- talisman-of-angry-spirits
95677, -- fortitude-of-the-zandalari
95855, -- gauntlets-of-the-crackling-vanquisher
95856, -- gauntlets-of-the-crackling-conqueror
95857, -- gauntlets-of-the-crackling-protector
96409, -- bad-juju
96410, -- kura-kura-kazrajins-skullcleaver
96411, -- marlis-bloodstained-sandals
96412, -- zandalari-robes-of-the-final-rite
96413, -- wushoolays-final-choice
96414, -- amun-thoth-suls-spiritrending-talons
96415, -- robes-of-treacherous-ground
96416, -- gaze-of-garajal
96417, -- loa-ridden-bracers
96418, -- overloaded-bladebreaker-cuirass
96419, -- zerat-malakks-soulburning-greatsword
96420, -- talisman-of-angry-spirits
96421, -- fortitude-of-the-zandalari
96599, -- gauntlets-of-the-crackling-vanquisher
96600, -- gauntlets-of-the-crackling-conqueror
96601, -- gauntlets-of-the-crackling-protector
96793, -- Fortitude of the Zandalari
-- Tortos
94768, -- shellsplitter-greataxe
94769, -- shattered-tortoiseshell-longbow
94770, -- rockfall-ribwraps
94771, -- shell-coated-wristplates
94772, -- quakestompers
94773, -- shoulderguards-of-centripetal-destruction
94774, -- beakbreaker-greatcloak
94775, -- beady-eye-bracers
94776, -- amulet-of-the-primal-turtle
94777, -- grips-of-vampiric-cruelty
94778, -- tortos-discarded-shell
94779, -- robes-of-concussive-shocks
94780, -- crystal-claw-gloves
94781, -- azure-shell-bracers
94782, -- stonegaze-hood
94783, -- spaulders-of-quaking-fear
94784, -- refreshing-abalone-girdle
94785, -- shimmershell-cape
94786, -- vampire-bat-hide-bracers
94787, -- tortos-shellseizers
95678, -- shattered-tortoiseshell-longbow
95679, -- rockfall-ribwraps
95680, -- grips-of-vampiric-cruelty
95681, -- beady-eye-bracers
95682, -- quakestompers
95683, -- shoulderguards-of-centripetal-destruction
95684, -- shell-coated-wristplates
95685, -- amulet-of-the-primal-turtle
95686, -- shellsplitter-greataxe
95687, -- beakbreaker-greatcloak
95688, -- azure-shell-bracers
95689, -- stonegaze-hood
95690, -- crystal-claw-gloves
95691, -- shimmershell-cape
95692, -- tortos-discarded-shell
95693, -- vampire-bat-hide-bracers
95694, -- robes-of-concussive-shocks
95695, -- spaulders-of-quaking-fear
95696, -- refreshing-abalone-girdle
95697, -- tortos-shellseizers
96050, -- shattered-tortoiseshell-longbow
96051, -- rockfall-ribwraps
96052, -- grips-of-vampiric-cruelty
96053, -- beady-eye-bracers
96054, -- quakestompers
96055, -- shoulderguards-of-centripetal-destruction
96056, -- shell-coated-wristplates
96057, -- amulet-of-the-primal-turtle
96058, -- shellsplitter-greataxe
96059, -- beakbreaker-greatcloak
96060, -- azure-shell-bracers
96061, -- stonegaze-hood
96062, -- crystal-claw-gloves
96063, -- shimmershell-cape
96064, -- tortos-discarded-shell
96065, -- vampire-bat-hide-bracers
96066, -- robes-of-concussive-shocks
96067, -- spaulders-of-quaking-fear
96068, -- refreshing-abalone-girdle
96069, -- tortos-shellseizers
96422, -- shattered-tortoiseshell-longbow
96423, -- rockfall-ribwraps
96424, -- grips-of-vampiric-cruelty
96425, -- beady-eye-bracers
96426, -- quakestompers
96427, -- shoulderguards-of-centripetal-destruction
96428, -- shell-coated-wristplates
96429, -- amulet-of-the-primal-turtle
96430, -- shellsplitter-greataxe
96431, -- beakbreaker-greatcloak
96432, -- azure-shell-bracers
96433, -- stonegaze-hood
96434, -- crystal-claw-gloves
96435, -- shimmershell-cape
96436, -- tortos-discarded-shell
96437, -- vampire-bat-hide-bracers
96438, -- robes-of-concussive-shocks
96439, -- spaulders-of-quaking-fear
96440, -- refreshing-abalone-girdle
96441, -- tortos-shellseizers
96794, -- shattered-tortoiseshell-longbow
96795, -- rockfall-ribwraps
96796, -- grips-of-vampiric-cruelty
96797, -- beady-eye-bracers
96798, -- quakestompers
96799, -- shoulderguards-of-centripetal-destruction
96800, -- shell-coated-wristplates
96801, -- amulet-of-the-primal-turtle
96802, -- shellsplitter-greataxe
96803, -- beakbreaker-greatcloak
96804, -- azure-shell-bracers
96805, -- stonegaze-hood
96806, -- crystal-claw-gloves
96807, -- shimmershell-cape
96808, -- tortos-discarded-shell
96809, -- vampire-bat-hide-bracers
96810, -- robes-of-concussive-shocks
96811, -- spaulders-of-quaking-fear
96812, -- refreshing-abalone-girdle
96813, -- tortos-shellseizers
-- Magaera
94520, -- inscribed-bag-of-hydra-spawn
94521, -- breath-of-the-hydra
94788, -- megaeras-poisoned-fang
94789, -- rot-proof-greatplate
94790, -- grips-of-cinderflesh
94791, -- poisonblood-bladeshoulders
94792, -- plated-toothbreaker-girdle
94793, -- hydraskull-choker
94794, -- quadra-head-brooch
94795, -- spinescale-seal
94796, -- fetish-of-the-hydra
94797, -- chain-of-consuming-magic
94798, -- ice-scored-treads
94799, -- sandals-of-arcane-fury
94800, -- hood-of-smoldering-flesh
94801, -- gleaming-eye-shoulderpads
94802, -- links-of-the-bifurcated-tongue
94803, -- megaeras-shining-eye
94804, -- frostborn-wristwraps
95698, -- megaeras-poisoned-fang
95699, -- quadra-head-brooch
95700, -- poisonblood-bladeshoulders
95701, -- grips-of-cinderflesh
95702, -- plated-toothbreaker-girdle
95703, -- rot-proof-greatplate
95704, -- spinescale-seal
95705, -- hydraskull-choker
95706, -- sandals-of-arcane-fury
95707, -- gleaming-eye-shoulderpads
95708, -- frostborn-wristwraps
95709, -- megaeras-shining-eye
95710, -- fetish-of-the-hydra
95711, -- breath-of-the-hydra
95712, -- inscribed-bag-of-hydra-spawn
95713, -- hood-of-smoldering-flesh
95714, -- links-of-the-bifurcated-tongue
95715, -- chain-of-consuming-magic
95716, -- ice-scored-treads
96442, -- megaeras-poisoned-fang
96443, -- quadra-head-brooch
96444, -- poisonblood-bladeshoulders
96445, -- grips-of-cinderflesh
96446, -- plated-toothbreaker-girdle
96447, -- rot-proof-greatplate
96448, -- spinescale-seal
96449, -- hydraskull-choker
96450, -- sandals-of-arcane-fury
96451, -- gleaming-eye-shoulderpads
96452, -- frostborn-wristwraps
96453, -- megaeras-shining-eye
96454, -- fetish-of-the-hydra
96455, -- breath-of-the-hydra
96456, -- inscribed-bag-of-hydra-spawn
96457, -- hood-of-smoldering-flesh
96458, -- links-of-the-bifurcated-tongue
96459, -- chain-of-consuming-magic
96460, -- ice-scored-treads
-- Ji-Kun
94515, -- fabled-feather-of-ji-kun
94527, -- ji-kuns-rising-winds
94805, -- giorgios-caduceus-of-pure-moods
94806, -- robe-of-midnight-down
94807, -- egg-shard-grips
94808, -- grasp-of-the-ruthless-mother
94809, -- crown-of-potentiated-birth
94810, -- talonrender-chestplate
94811, -- featherflight-belt
94812, -- pinionfeather-greatcloak
94813, -- cord-of-cacophonous-cawing
94835, -- ji-kun-hatchling
95059, -- clutch-of-ji-kun
95572, -- leggings-of-the-crackling-vanquisher
95576, -- leggings-of-the-crackling-conqueror
95581, -- leggings-of-the-crackling-protector
95717, -- pinionfeather-greatcloak
95718, -- cord-of-cacophonous-cawing
95719, -- robe-of-midnight-down
95720, -- giorgios-caduceus-of-pure-moods
95721, -- featherflight-belt
95722, -- grasp-of-the-ruthless-mother
95723, -- crown-of-potentiated-birth
95724, -- talonrender-chestplate
95725, -- egg-shard-grips
95726, -- fabled-feather-of-ji-kun
95727, -- ji-kuns-rising-winds
95887, -- leggings-of-the-crackling-vanquisher
95888, -- leggings-of-the-crackling-conqueror
95889, -- leggings-of-the-crackling-protector
96089, -- pinionfeather-greatcloak
96090, -- cord-of-cacophonous-cawing
96091, -- robe-of-midnight-down
96092, -- giorgios-caduceus-of-pure-moods
96093, -- featherflight-belt
96094, -- grasp-of-the-ruthless-mother
96095, -- crown-of-potentiated-birth
96096, -- talonrender-chestplate
96097, -- egg-shard-grips
96098, -- fabled-feather-of-ji-kun
96099, -- ji-kuns-rising-winds
96461, -- pinionfeather-greatcloak
96462, -- cord-of-cacophonous-cawing
96463, -- robe-of-midnight-down
96464, -- giorgios-caduceus-of-pure-moods
96465, -- featherflight-belt
96466, -- grasp-of-the-ruthless-mother
96467, -- crown-of-potentiated-birth
96468, -- talonrender-chestplate
96469, -- egg-shard-grips
96470, -- fabled-feather-of-ji-kun
96471, -- ji-kuns-rising-winds
96631, -- leggings-of-the-crackling-vanquisher
96632, -- leggings-of-the-crackling-conqueror
96633, -- leggings-of-the-crackling-protector
96833, -- pinionfeather-greatcloak
96834, -- cord-of-cacophonous-cawing
96835, -- robe-of-midnight-down
96836, -- giorgios-caduceus-of-pure-moods
96837, -- featherflight-belt
96838, -- grasp-of-the-ruthless-mother
96839, -- crown-of-potentiated-birth
96840, -- talonrender-chestplate
96841, -- egg-shard-grips
96842, -- fabled-feather-of-ji-kun
96843, -- ji-kuns-rising-winds
-- Durumu the Forgotten
94814, -- durumus-baleful-gaze
94815, -- legplates-of-the-dark-parasite
94816, -- crimson-bloom-legguards
94817, -- treads-of-the-blind-eye
94818, -- aberrant-chestguard-of-torment
94819, -- links-of-the-disintegrator
94820, -- caustic-spike-bracers
94821, -- artery-rippers
94822, -- reinforced-mirror-sheen-cloak
94922, -- ritual-dagger-of-the-minds-eye
94923, -- leggings-of-pulsing-blood
94924, -- iceshatter-gauntlets
94925, -- lifedrainers-sordid-grip
94926, -- vein-cover-bracers
94927, -- sandals-of-the-starving-eye
94928, -- chilblain-spaulders
94929, -- deadly-glare-cape
94930, -- legplates-of-re-emergence
94931, -- durumus-captive-eyeball
95511, -- durumus-severed-tentacle
95728, -- durumus-baleful-gaze
95729, -- crimson-bloom-legguards
95730, -- links-of-the-disintegrator
95731, -- aberrant-chestguard-of-torment
95732, -- caustic-spike-bracers
95733, -- legplates-of-the-dark-parasite
95734, -- treads-of-the-blind-eye
95735, -- artery-rippers
95736, -- reinforced-mirror-sheen-cloak
95737, -- durumus-severed-tentacle
95738, -- lifedrainers-sordid-grip
95739, -- leggings-of-pulsing-blood
95740, -- chilblain-spaulders
95741, -- deadly-glare-cape
95742, -- durumus-captive-eyeball
95743, -- ritual-dagger-of-the-minds-eye
95744, -- sandals-of-the-starving-eye
95745, -- vein-cover-bracers
95746, -- iceshatter-gauntlets
95747, -- legplates-of-re-emergence
96100, -- durumus-baleful-gaze
96101, -- crimson-bloom-legguards
96102, -- links-of-the-disintegrator
96103, -- aberrant-chestguard-of-torment
96104, -- caustic-spike-bracers
96105, -- legplates-of-the-dark-parasite
96106, -- treads-of-the-blind-eye
96107, -- artery-rippers
96108, -- reinforced-mirror-sheen-cloak
96109, -- durumus-severed-tentacle
96110, -- lifedrainers-sordid-grip
96111, -- leggings-of-pulsing-blood
96112, -- chilblain-spaulders
96113, -- deadly-glare-cape
96114, -- durumus-captive-eyeball
96115, -- ritual-dagger-of-the-minds-eye
96116, -- sandals-of-the-starving-eye
96117, -- vein-cover-bracers
96118, -- iceshatter-gauntlets
96119, -- legplates-of-re-emergence
96472, -- durumus-baleful-gaze
96473, -- crimson-bloom-legguards
96474, -- links-of-the-disintegrator
96475, -- aberrant-chestguard-of-torment
96476, -- caustic-spike-bracers
96477, -- legplates-of-the-dark-parasite
96478, -- treads-of-the-blind-eye
96479, -- artery-rippers
96480, -- reinforced-mirror-sheen-cloak
96481, -- durumus-severed-tentacle
96482, -- lifedrainers-sordid-grip
96483, -- leggings-of-pulsing-blood
96484, -- chilblain-spaulders
96485, -- deadly-glare-cape
96486, -- durumus-captive-eyeball
96487, -- ritual-dagger-of-the-minds-eye
96488, -- sandals-of-the-starving-eye
96489, -- vein-cover-bracers
96490, -- iceshatter-gauntlets
96491, -- legplates-of-re-emergence
96844, -- durumus-baleful-gaze
96845, -- crimson-bloom-legguards
96846, -- links-of-the-disintegrator
96847, -- aberrant-chestguard-of-torment
96848, -- caustic-spike-bracers
96849, -- legplates-of-the-dark-parasite
96850, -- treads-of-the-blind-eye
96851, -- artery-rippers
96852, -- reinforced-mirror-sheen-cloak
96853, -- durumus-severed-tentacle
96854, -- lifedrainers-sordid-grip
96855, -- leggings-of-pulsing-blood
96856, -- chilblain-spaulders
96857, -- deadly-glare-cape
96858, -- durumus-captive-eyeball
96859, -- ritual-dagger-of-the-minds-eye
96860, -- sandals-of-the-starving-eye
96861, -- vein-cover-bracers
96862, -- iceshatter-gauntlets
96863, -- legplates-of-re-emergence
-- Primordius
94519, -- primordius-talisman-of-rage
94522, -- talisman-of-bloodlust
94525, -- stolen-relic-of-zuldazar
94937, -- acid-spine-bonemace
94938, -- pathogenic-gauntlets
94939, -- gloves-of-cushioned-air
94940, -- bracers-of-mutagenic-fervor
94941, -- metabolically-boosted-shoulderplates
94942, -- hydra-scale-bloodcloak
94943, -- synapse-string-handguards
94944, -- black-blood-legplates
94945, -- greatshield-of-the-gloaming
94946, -- leggings-of-the-malformed-sapling
94947, -- helix-breaker-gloves
94948, -- bracers-of-fragile-bone
94949, -- clear-mind-helm
94950, -- spaulders-of-primordial-growth
94951, -- robes-of-mutagenic-blood
94952, -- bonemender-bracers
94953, -- leggings-of-ebon-veins
95513, -- band-of-the-scaled-tyrant
95748, -- talisman-of-bloodlust
95749, -- gloves-of-cushioned-air
95750, -- bracers-of-mutagenic-fervor
95751, -- synapse-string-handguards
95752, -- pathogenic-gauntlets
95753, -- black-blood-legplates
95754, -- metabolically-boosted-shoulderplates
95755, -- hydra-scale-bloodcloak
95756, -- band-of-the-scaled-tyrant
95757, -- primordius-talisman-of-rage
95758, -- acid-spine-bonemace
95759, -- robes-of-mutagenic-blood
95760, -- helix-breaker-gloves
95761, -- leggings-of-ebon-veins
95762, -- bracers-of-fragile-bone
95763, -- stolen-relic-of-zuldazar
95764, -- leggings-of-the-malformed-sapling
95765, -- clear-mind-helm
95766, -- bonemender-bracers
95767, -- spaulders-of-primordial-growth
95768, -- greatshield-of-the-gloaming
96120, -- talisman-of-bloodlust
96121, -- gloves-of-cushioned-air
96122, -- bracers-of-mutagenic-fervor
96123, -- synapse-string-handguards
96124, -- pathogenic-gauntlets
96125, -- black-blood-legplates
96126, -- metabolically-boosted-shoulderplates
96128, -- band-of-the-scaled-tyrant
96129, -- primordius-talisman-of-rage
96130, -- acid-spine-bonemace
96131, -- robes-of-mutagenic-blood
96132, -- helix-breaker-gloves
96133, -- leggings-of-ebon-veins
96134, -- bracers-of-fragile-bone
96135, -- stolen-relic-of-zuldazar
96136, -- leggings-of-the-malformed-sapling
96137, -- clear-mind-helm
96138, -- bonemender-bracers
96139, -- spaulders-of-primordial-growth
96140, -- greatshield-of-the-gloaming
96492, -- talisman-of-bloodlust
96493, -- gloves-of-cushioned-air
96494, -- bracers-of-mutagenic-fervor
96495, -- synapse-string-handguards
96496, -- pathogenic-gauntlets
96497, -- black-blood-legplates
96498, -- metabolically-boosted-shoulderplates
96499, -- hydra-scale-bloodcloak
96500, -- band-of-the-scaled-tyrant
96501, -- primordius-talisman-of-rage
96502, -- acid-spine-bonemace
96503, -- robes-of-mutagenic-blood
96504, -- helix-breaker-gloves
96505, -- leggings-of-ebon-veins
96506, -- bracers-of-fragile-bone
96507, -- stolen-relic-of-zuldazar
96508, -- leggings-of-the-malformed-sapling
96509, -- clear-mind-helm
96510, -- bonemender-bracers
96511, -- spaulders-of-primordial-growth
96512, -- greatshield-of-the-gloaming
96864, -- talisman-of-bloodlust
96865, -- gloves-of-cushioned-air
96866, -- bracers-of-mutagenic-fervor
96867, -- synapse-string-handguards
96868, -- pathogenic-gauntlets
96869, -- black-blood-legplates
96870, -- metabolically-boosted-shoulderplates
96871, -- hydra-scale-bloodcloak
96872, -- band-of-the-scaled-tyrant
96873, -- primordius-talisman-of-rage
96874, -- acid-spine-bonemace
96875, -- robes-of-mutagenic-blood
96876, -- helix-breaker-gloves
96877, -- leggings-of-ebon-veins
96878, -- bracers-of-fragile-bone
96879, -- stolen-relic-of-zuldazar
96880, -- leggings-of-the-malformed-sapling
96881, -- clear-mind-helm
96882, -- bonemender-bracers
96883, -- spaulders-of-primordial-growth
96884, -- greatshield-of-the-gloaming
97959, -- quivering-blob
97960, -- dark-quivering-blob
-- Dark Animus
94152, -- son-of-animus
94518, -- delicate-vial-of-the-sanguinaire
94531, -- cha-yes-essence-of-brilliance
94954, -- hand-of-the-dark-animus
94955, -- athame-of-the-sanguine-ritual
94956, -- matter-swapped-legplates
94957, -- anima-ringed-fingers
94958, -- crown-of-the-golden-golem
94959, -- hood-of-the-crimson-wake
94960, -- constantly-accelerating-cloak
94961, -- gore-soaked-gear
94962, -- worldbinder-leggings
95569, -- chest-of-the-crackling-vanquisher
95574, -- chest-of-the-crackling-conqueror
95579, -- chest-of-the-crackling-protector
95769, -- gore-soaked-gear
95770, -- hand-of-the-dark-animus
95771, -- hood-of-the-crimson-wake
95772, -- cha-yes-essence-of-brilliance
95773, -- constantly-accelerating-cloak
95774, -- athame-of-the-sanguine-ritual
95775, -- worldbinder-leggings
95776, -- anima-ringed-fingers
95777, -- matter-swapped-legplates
95778, -- crown-of-the-golden-golem
95779, -- delicate-vial-of-the-sanguinaire
95822, -- chest-of-the-crackling-vanquisher
95823, -- chest-of-the-crackling-conqueror
95824, -- chest-of-the-crackling-protector
96141, -- gore-soaked-gear
96142, -- hand-of-the-dark-animus
96143, -- hood-of-the-crimson-wake
96144, -- cha-yes-essence-of-brilliance
96145, -- constantly-accelerating-cloak
96146, -- athame-of-the-sanguine-ritual
96147, -- worldbinder-leggings
96148, -- anima-ringed-fingers
96149, -- matter-swapped-legplates
96150, -- crown-of-the-golden-golem
96151, -- delicate-vial-of-the-sanguinaire
96513, -- gore-soaked-gear
96514, -- hand-of-the-dark-animus
96515, -- hood-of-the-crimson-wake
96516, -- cha-yes-essence-of-brilliance
96517, -- constantly-accelerating-cloak
96518, -- athame-of-the-sanguine-ritual
96519, -- worldbinder-leggings
96520, -- anima-ringed-fingers
96521, -- matter-swapped-legplates
96522, -- crown-of-the-golden-golem
96523, -- delicate-vial-of-the-sanguinaire
96566, -- chest-of-the-crackling-vanquisher
96567, -- chest-of-the-crackling-conqueror
96568, -- chest-of-the-crackling-protector
96885, -- gore-soaked-gear
96886, -- hand-of-the-dark-animus
96887, -- hood-of-the-crimson-wake
96888, -- cha-yes-essence-of-brilliance
96889, -- constantly-accelerating-cloak
96890, -- athame-of-the-sanguine-ritual
96891, -- worldbinder-leggings
96892, -- anima-ringed-fingers
96893, -- matter-swapped-legplates
96894, -- crown-of-the-golden-golem
96895, -- delicate-vial-of-the-sanguinaire
-- Iron Qon
94963, -- voice-of-the-quilen
94964, -- qons-flaming-scimitar
94965, -- orb-of-arcing-lightning
94966, -- saddle-scarred-leggings
94967, -- spurs-of-the-storm-cavalry
94968, -- damrens-frozen-footguards
94969, -- roshaks-molten-chain
94970, -- quetzals-crackling-cord
94971, -- iron-qons-boot-knife
94972, -- rein-binders-fists
95512, -- roshaks-remembrance
95573, -- shoulders-of-the-crackling-vanquisher
95578, -- shoulders-of-the-crackling-conqueror
95583, -- shoulders-of-the-crackling-protector
95780, -- iron-qons-boot-knife
95781, -- voice-of-the-quilen
95782, -- quetzals-crackling-cord
95783, -- saddle-scarred-leggings
95784, -- damrens-frozen-footguards
95785, -- roshaks-remembrance
95786, -- orb-of-arcing-lightning
95787, -- spurs-of-the-storm-cavalry
95788, -- roshaks-molten-chain
95789, -- rein-binders-fists
95790, -- qons-flaming-scimitar
95955, -- shoulders-of-the-crackling-vanquisher
95956, -- shoulders-of-the-crackling-conqueror
95957, -- shoulders-of-the-crackling-protector
96152, -- iron-qons-boot-knife
96153, -- voice-of-the-quilen
96154, -- quetzals-crackling-cord
96155, -- saddle-scarred-leggings
96156, -- damrens-frozen-footguards
96157, -- roshaks-remembrance
96158, -- orb-of-arcing-lightning
96159, -- spurs-of-the-storm-cavalry
96160, -- roshaks-molten-chain
96161, -- rein-binders-fists
96162, -- qons-flaming-scimitar
96524, -- iron-qons-boot-knife
96525, -- voice-of-the-quilen
96526, -- quetzals-crackling-cord
96527, -- saddle-scarred-leggings
96528, -- damrens-frozen-footguards
96529, -- roshaks-remembrance
96530, -- orb-of-arcing-lightning
96531, -- spurs-of-the-storm-cavalry
96532, -- roshaks-molten-chain
96533, -- rein-binders-fists
96534, -- qons-flaming-scimitar
96699, -- shoulders-of-the-crackling-vanquisher
96700, -- shoulders-of-the-crackling-conqueror
96701, -- shoulders-of-the-crackling-protector
96896, -- iron-qons-boot-knife
96897, -- voice-of-the-quilen
96898, -- quetzals-crackling-cord
96899, -- saddle-scarred-leggings
96900, -- damrens-frozen-footguards
96901, -- roshaks-remembrance
96902, -- orb-of-arcing-lightning
96903, -- spurs-of-the-storm-cavalry
96904, -- roshaks-molten-chain
96905, -- rein-binders-fists
96906, -- qons-flaming-scimitar
-- Twin Consorts
94529, -- gaze-of-the-twins
94757, -- fingers-of-the-night
94973, -- wu-lai-bladed-fan-of-the-consorts
94974, -- suen-wo-spire-of-the-falling-sun
94976, -- tidal-force-treads
94977, -- robes-of-the-moon-lotus
94978, -- girdle-of-night-and-day
94979, -- bracers-of-the-midnight-comet
94980, -- passionfire-choker
94981, -- moonjade-necklace
95515, -- shield-of-twinned-despair
95571, -- helm-of-the-crackling-vanquisher
95577, -- helm-of-the-crackling-conqueror
95582, -- helm-of-the-crackling-protector
95791, -- wu-lai-bladed-fan-of-the-consorts
95792, -- robes-of-the-moon-lotus
95793, -- passionfire-choker
95794, -- shield-of-twinned-despair
95795, -- suen-wo-spire-of-the-falling-sun
95796, -- bracers-of-the-midnight-comet
95797, -- girdle-of-night-and-day
95798, -- tidal-force-treads
95799, -- gaze-of-the-twins
95800, -- moonjade-necklace
95801, -- fingers-of-the-night
95879, -- helm-of-the-crackling-vanquisher
95880, -- helm-of-the-crackling-conqueror
95881, -- helm-of-the-crackling-protector
96535, -- wu-lai-bladed-fan-of-the-consorts
96536, -- robes-of-the-moon-lotus
96537, -- passionfire-choker
96538, -- shield-of-twinned-despair
96539, -- suen-wo-spire-of-the-falling-sun
96540, -- bracers-of-the-midnight-comet
96541, -- girdle-of-night-and-day
96542, -- tidal-force-treads
96543, -- gaze-of-the-twins
96544, -- moonjade-necklace
96545, -- fingers-of-the-night
96623, -- helm-of-the-crackling-vanquisher
96624, -- helm-of-the-crackling-conqueror
96625, -- helm-of-the-crackling-protector
-- Lei Shen
94524, -- unerring-vision-of-lei-shen
94528, -- soul-barrier
94530, -- lightning-imbued-chalice
94532, -- rune-of-re-origination
94982, -- uroe-harbinger-of-terror
94983, -- shan-dun-breaker-of-hope
94984, -- doomed-crown-of-lei-shen
94985, -- legplates-of-whipping-ionization
94986, -- conduit-breaker-chain-leggings
94987, -- fusion-slasher-chestguard
94988, -- torall-rod-of-the-shattered-throne
94989, -- lei-shens-grounded-carapace
94990, -- legwraps-of-cardinality
94991, -- grips-of-slicing-electricity
94992, -- leggings-of-the-violent-gale
94993, -- gloves-of-the-maimed-vizier
94994, -- soul-prism-of-lei-shen
95472, -- ultimate-protection-of-the-emperor
95473, -- lei-shens-orb-of-command
95535, -- legplates-of-the-lightning-throne
95802, -- rune-of-re-origination
95803, -- shan-dun-breaker-of-hope
95804, -- fusion-slasher-chestguard
95805, -- conduit-breaker-chain-leggings
95806, -- doomed-crown-of-lei-shen
95807, -- legplates-of-the-lightning-throne
95808, -- legplates-of-whipping-ionization
95809, -- uroe-harbinger-of-terror
95810, -- ultimate-protection-of-the-emperor
95811, -- soul-barrier
95812, -- legwraps-of-cardinality
95813, -- gloves-of-the-maimed-vizier
95814, -- unerring-vision-of-lei-shen
95815, -- torall-rod-of-the-shattered-throne
95816, -- soul-prism-of-lei-shen
95817, -- lightning-imbued-chalice
95818, -- lei-shens-orb-of-command
95819, -- grips-of-slicing-electricity
95820, -- leggings-of-the-violent-gale
95821, -- lei-shens-grounded-carapace
96174, -- rune-of-re-origination
96175, -- shan-dun-breaker-of-hope
96176, -- fusion-slasher-chestguard
96177, -- conduit-breaker-chain-leggings
96178, -- doomed-crown-of-lei-shen
96179, -- legplates-of-the-lightning-throne
96180, -- legplates-of-whipping-ionization
96181, -- uroe-harbinger-of-terror
96182, -- ultimate-protection-of-the-emperor
96183, -- soul-barrier
96184, -- legwraps-of-cardinality
96185, -- gloves-of-the-maimed-vizier
96186, -- unerring-vision-of-lei-shen
96187, -- torall-rod-of-the-shattered-throne
96188, -- soul-prism-of-lei-shen
96189, -- lightning-imbued-chalice
96190, -- lei-shens-orb-of-command
96191, -- grips-of-slicing-electricity
96192, -- leggings-of-the-violent-gale
96193, -- lei-shens-grounded-carapace
96546, -- rune-of-re-origination
96547, -- shan-dun-breaker-of-hope
96548, -- fusion-slasher-chestguard
96549, -- conduit-breaker-chain-leggings
96550, -- doomed-crown-of-lei-shen
96551, -- legplates-of-the-lightning-throne
96552, -- legplates-of-whipping-ionization
96553, -- uroe-harbinger-of-terror
96554, -- ultimate-protection-of-the-emperor
96555, -- soul-barrier
96556, -- legwraps-of-cardinality
96557, -- gloves-of-the-maimed-vizier
96558, -- unerring-vision-of-lei-shen
96559, -- torall-rod-of-the-shattered-throne
96560, -- soul-prism-of-lei-shen
96561, -- lightning-imbued-chalice
96562, -- lei-shens-orb-of-command
96563, -- grips-of-slicing-electricity
96564, -- leggings-of-the-violent-gale
96565, -- lei-shens-grounded-carapace
96918, -- rune-of-re-origination
96919, -- shan-dun-breaker-of-hope
96920, -- fusion-slasher-chestguard
96921, -- conduit-breaker-chain-leggings
96922, -- doomed-crown-of-lei-shen
96923, -- legplates-of-the-lightning-throne
96924, -- legplates-of-whipping-ionization
96925, -- uroe-harbinger-of-terror
96926, -- ultimate-protection-of-the-emperor
96927, -- soul-barrier
96928, -- legwraps-of-cardinality
96929, -- gloves-of-the-maimed-vizier
96930, -- unerring-vision-of-lei-shen
96931, -- torall-rod-of-the-shattered-throne
96932, -- soul-prism-of-lei-shen
96933, -- lightning-imbued-chalice
96934, -- lei-shens-orb-of-command
96935, -- grips-of-slicing-electricity
96936, -- leggings-of-the-violent-gale
96937, -- lei-shens-grounded-carapace
-- Ra-den
94995, -- detonation-cord
94996, -- vita-binder-wrap
94997, -- worldbender-waistband
94998, -- strap-of-murderous-strikes
94999, -- longdraw-chain-belt
95000, -- jingling-fetishgirdle
95001, -- bubbling-anima-belt
95002, -- cracklesnap-clasp
95003, -- flare-forged-greatbelt
95004, -- starwalker-sandals
95005, -- treads-of-delicate-fascia
95006, -- roots-of-pain
95007, -- twist-toe-tabi
95008, -- world-mote-sabatons
95009, -- treads-of-the-sanguine-volley
95010, -- hypersensitive-sollerets
95011, -- lightning-walker-clawfeet
95012, -- sabatons-of-the-superior-being
95013, -- black-night-thundercloak
95014, -- red-sky-cloudcloak
95015, -- grey-wind-mistcloak
95016, -- white-snow-skycloak
95017, -- yellow-dawn-lightningcloak
95018, -- ra-dens-evolving-signet
95019, -- ra-dens-summoning-band
95020, -- ra-dens-contemplative-loop
95021, -- ra-dens-swift-seal
95022, -- ra-dens-ruinous-ring
95023, -- legplates-of-lightning-blood
95024, -- time-lost-greaves
95025, -- archaic-protectors-legguards
95026, -- sparkstring-chain-leggings
95027, -- legguards-of-awaked-repair
95028, -- cosmicfire-legwraps
95029, -- kilt-of-perpetual-genuflection
95030, -- leggings-of-the-discarded-warning
95031, -- legguards-of-surreal-visions
95032, -- robes-of-contagious-time
95033, -- chestguard-of-coruscating-blades
95034, -- scales-of-shaped-flesh
95035, -- chains-of-counted-souls
95036, -- nova-binder-breastplate
95037, -- planet-birthed-cuirass
95038, -- carapace-of-the-core
95039, -- starburner-robes
95040, -- robes-of-nova
}
|
ITEM.name = "Standard Imperial Uniform Repair Kit"
ITEM.description = "A single Standard Imperial Uniform Repair Kit."
ITEM.category = "Medical"
ITEM.model = "models/Items/car_battery01.mdl"
ITEM.class = "item_battery"
ITEM.width = 1
ITEM.height = 1
|
--
-- Copyright (c) 2016-2017, Fangchang Ma.
-- Copyright (c) 2016, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree. An additional grant
-- of patent rights can be found in the PATENTS file in the same directory.
--
require 'torch'
require 'paths'
require 'optim'
require 'nn'
local DataLoader = require 'dataloader'
local models = require 'models/init'
local Trainer = require 'train'
local opts = require 'opts'
local checkpoints = require 'checkpoints'
torch.setdefaulttensortype('torch.FloatTensor')
torch.setnumthreads(1)
local opt = opts.parse(arg)
torch.manualSeed(opt.manualSeed)
cutorch.manualSeedAll(opt.manualSeed)
math.randomseed(opt.manualSeed)
-- Data loading
local trainLoader, valLoader = DataLoader.create(opt)
if opt.dataset == 'nyudepthv2' then
-- NYU Depth V2 has a small test set. Use batchsize=1 for more accurate evaluation
print('=> NYU Depth V2: set batchSize=1 at test for accurate evaluation.')
valLoader.batchSize = 1
print('=> NYU Depth V2: disabled random permute for testing')
valLoader.permute = false
elseif opt.dataset == 'kitti' and valLoader.__size > 3200 then
-- KITTI has a large test set. Use a small subset for speed
print('=> KITTI: set testSize=3200 for speed.')
valLoader.__size = 3200
end
-- Load previous checkpoint, if it exists
local checkpoint, optimState = checkpoints.latest(opt)
-- Test only
if opt.testOnly then
require 'modules/ChannelDropout'
require 'modules/Unpool'
-- Load trained model
model = torch.load(opt.bestmodelPath):type(opt.tensorType)
-- Set batchsize to be 1
print('=> Test-only: set batchSize=1.')
valLoader.batchSize = 1
-- Use the test function in trainer
local trainer = Trainer(model, nil, opt, optimState)
local timer = torch.Timer()
local testLoss = trainer:test(1, valLoader)
local testTime = timer:time().real
-- print(string.format(' * Finished RMSE: %3.3f', testLoss.RMSE))
-- print(string.format(' * Runtime per image: %3.3fms', 1000*testTime/valLoader.__size))
print(('MSE=%1.3f\nRMSE=%1.3f\nMAE=%1.3f\nDELTA1=%1.3f\nDELTA2=%1.3f\nDELTA3=%1.3f\nREL=%1.3f\nLG10=%1.3f\nruntime(per image)=%1.3fms')
:format(
testLoss.MSE, testLoss.RMSE, testLoss.MAE,
testLoss.DELTA1, testLoss.DELTA2, testLoss.DELTA3,
testLoss.ABS_REL, testLoss.LG10, 1000*testTime/valLoader.__size
))
return
end
-- Create model
local model, criterion = models.setup(opt, checkpoint)
-- The trainer handles the training loop and evaluation on validation set
local trainer = Trainer(model, criterion, opt, optimState)
-- Logger
local trainLogFile = paths.concat(opt.saveDir, 'trainlog.txt')
local testLogFile = paths.concat(opt.saveDir, 'testlog.txt')
if opt.resume == 'none' then
os.execute('mkdir -p ' .. opt.saveDir)
trainFD = io.open(trainLogFile, 'w')
trainFD:write('epoch, bestModel, MSE, RMSE, MAE, DELTA1, DELTA2, DELTA3, ABS_REL, LG10, Time', "\n")
trainFD:close()
testFD = io.open(testLogFile, 'w')
testFD:write('epoch, bestModel, MSE, RMSE, MAE, DELTA1, DELTA2, DELTA3, ABS_REL, LG10, Time', "\n")
testFD:close()
end
local startEpoch = checkpoint and checkpoint.epoch + 1 or opt.epochNumber
local bestRMSE = math.huge
local bestModelEpoch = 1
local function updateBestModel(testLoss, epoch)
if testLoss.RMSE < bestRMSE then
bestRMSE = testLoss.RMSE
bestModelEpoch = epoch
print(' * Best model is ' .. bestModelEpoch .. ' with RMSE ' .. bestRMSE)
return true
end
return false
end
-- Training
local totalTime = 0
for epoch = startEpoch, opt.nEpochs do
local timer = torch.Timer()
-- Train for a single epoch
local trainLoss = trainer:train(epoch, trainLoader)
local trainTime = timer:time().real
totalTime = totalTime + trainTime
timer:reset()
-- Run model on validation set
local testLoss = trainer:test(epoch, valLoader)
local testTime = timer:time().real
totalTime = totalTime + testTime
print(('=> Epoch Time = %g (%g)'):format( trainTime+testTime, totalTime / (epoch - startEpoch + 1) ))
local bestModel = updateBestModel(testLoss, epoch)
checkpoints.save(epoch, model, trainer.optimState, bestModel)
print('=> Writing log data to ' .. trainLogFile)
if paths.filep(trainLogFile) then
trainFD = io.open(trainLogFile, 'a')
trainFD:write(('%3i, %3i,'
.. ' %2.4f, %2.4f, %2.4f,'
.. ' %2.4f, %2.4f, %2.4f'
.. ' %2.4f, %2.4f, %2.4f\n')
:format(
epoch, bestModelEpoch,
trainLoss.MSE, trainLoss.RMSE, trainLoss.MAE,
trainLoss.DELTA1, trainLoss.DELTA2, trainLoss.DELTA3,
trainLoss.ABS_REL, trainLoss.LG10, trainTime / trainLoader.__size
))
trainFD:close()
else
error('trainLogFile does not exist.')
end
if paths.filep(testLogFile) then
print('=> Writing log data to ' .. testLogFile)
testFD = io.open(testLogFile, 'a')
testFD:write(('%3i, %3i,'
.. ' %2.4f, %2.4f, %2.4f,'
.. ' %2.4f, %2.4f, %2.4f,'
.. ' %2.4f, %2.4f, %2.4f\n')
:format(
epoch, bestModelEpoch,
testLoss.MSE, testLoss.RMSE, testLoss.MAE,
testLoss.DELTA1, testLoss.DELTA2, testLoss.DELTA3,
testLoss.ABS_REL, testLoss.LG10, testTime / valLoader.__size))
testFD:close()
else
error('testLogFile does not exist.')
end
end
if opt.recomputeBatchNorm then
error('TODO: implement recomputeBatchNorm() for depth prediction')
trainer:recomputeBatchNorm(trainLoader)
local epoch = opt.nEpochs + 1
local testTop1, testTop5, testLoss = trainer:test(epoch, valLoader)
local bestModel = updateBestModel(testLoss)
checkpoints.save(epoch, model, trainer.optimState, bestModel)
end
print(string.format(' * Finished RMSE: %3.3f', bestRMSE))
|
--[[ Fugitive: ]]
--
Nvim_exec([[ let g:fugitive_git_executable = 'hub' ]], true)
Nnoremap('<Leader>ga', [[:Git add %:p]]) -- Git Add
Nnoremap('<Leader>gc', [[:Git commit -v<CR>]]) -- Git Commit
Nnoremap('<Leader>gs', [[:Git<CR>]]) -- Git Status
Nnoremap('<Leader>ge', [[:Gedit<CR>]]) -- Git Edit
Nnoremap('<Leader>gr', [[:Gread<CR>]])
Nnoremap('<Leader>gb', [[:Git blame<CR>]])
Nnoremap('<Leader>gp', [[:Git push<CR>]])
--[[ Fugitive-gitlab: ]]
--
Nvim_exec([==[ let g:fugitive_gitlab_domains = ['https://my.gitlab.com']]==], true)
TrySource 'plugins.git.gitlab_access_token'
--[[ Git Messenger: ]]
--
-- Nnoremap('<leader>gm', [[<Plug>(git-messenger)]]) -- Default mapping
--[[ GV: ]]
--
-- A 'git log --graph' wrapper
Nnoremap('<Leader>gl', [[:GV<CR>]])
|
local name, _GatherLite = ...;
local GFrame = LibStub("GatherLiteFrame");
local HBD = LibStub("HereBeDragons-2.0");
local worldmapOpen = false;
local worldmapID = nil;
local timeDiff = 0
local checkDiff = 0
GatherLiteTracker = {};
function GatherLiteTracker:OnLoad()
GatherLite:On("worldmap:update", function()
GatherLiteTracker:Worldmap();
end);
end
GatherLiteTracker.WorldmapFilter = function(node)
if not GatherLite.db.char.worldmap.enabled then
return false
end
-- check if were tracking the type of node
if not GatherLite.db.char.tracking[node.type] then
return false
end
-- check if were using the predefined database
if node.predefined and not GatherLite.db.global.usePredefined then
return false
end
-- check if the node type is should be ignored.
if GatherLite:IsIgnored(node.object) then
return false
end
return true;
end
GatherLiteTracker.MinimapFilter = function(node)
if not GatherLite.db.char.minimap.enabled then
return false
end
-- check if were tracking the type of node
if not GatherLite.db.char.tracking[node.type] then
return false
end
-- check if were using the predefined database
if node.predefined and not GatherLite.db.global.usePredefined then
return false
end
-- check if the node type is should be ignored.
if GatherLite:IsIgnored(node.object) then
return false
end
return true;
end
function GatherLiteTracker:ClosestNodes(posX, posY, instanceID, maxDist, filter)
return table.filter(_GatherLite.db, function(node)
local x, y, _ = HBD:GetWorldCoordinatesFromZone(node.posX, node.posY, node.mapID);
local _, distance = HBD:GetWorldVector(instanceID, posX, posY, x, y)
return distance and distance < maxDist and filter(node);
end);
end
function GatherLiteTracker:WorldmapNodes(mapID, filter)
return table.filter(_GatherLite.db, function(node)
return node.mapID == mapID and filter(node);
end);
end
table.filter = function(t, filterIter)
local out = {}
for k, v in pairs(t) do
if filterIter(v, k, t) then
out[k] = v;
end
end
return out
end
function GatherLiteTracker:Minimap(timeDelta, force)
local updateIcons = false
local updateNodes = false
if (force) then
updateIcons = true
updateNodes = true
else
checkDiff = checkDiff + timeDelta
timeDiff = timeDiff + timeDelta
if (checkDiff > 5) then
updateNodes = true
checkDiff = 0
updateIcons = true
timeDiff = 0
elseif (timeDiff > 0.5) then
updateIcons = true
timeDiff = 0
end
end
if (updateNodes) then
local x, y, instanceID = HBD:GetPlayerWorldPosition()
for key, node in pairs(GatherLiteTracker:ClosestNodes(x, y, instanceID, GatherLite.db.char.minimap.range, GatherLiteTracker.MinimapFilter)) do
if not _GatherLite.db[key].loaded then
GatherLite:createMinimapNode(_GatherLite.db[key])
_GatherLite.db[key].loaded = true;
end
end
end
if (updateIcons or updateNodes) then
local x, y, instanceID = HBD:GetPlayerWorldPosition()
GatherLite:forEach(GFrame.usedFrames, function(frame)
if frame.type == "minimap" and frame.node.loaded then
if IsInInstance() then
frame.node.loaded = false;
frame:Unload();
return
end
local x2, y2, _ = HBD:GetWorldCoordinatesFromZone(frame.node.posX, frame.node.posY, frame.node.mapID);
local _, distance = HBD:GetWorldVector(instanceID, x, y, x2, y2)
if not distance then
frame.node.loaded = false;
frame:Unload();
return
end
if distance >= GatherLite.db.char.minimap.range then
frame.node.loaded = false;
frame:Unload();
return
end
if not GatherLiteTracker.MinimapFilter(frame.node) then
frame.node.loaded = false;
frame:Unload();
return
end
if frame.node.type ~= "containers" and frame.node.type ~= "fishing" then
if distance < GatherLite.db.char.minimap.distance and frame:IsVisible() then
frame:FakeHide();
elseif distance >= GatherLite.db.char.minimap.distance and not frame:IsVisible() then
frame:FakeShow();
end
end
elseif frame.type == "minimap" and not frame.node.loaded then
frame.node.loaded = false;
frame:Unload();
end
end);
GatherLite:debug(_GatherLite.DEBUG_FRAME, GatherLite:tablelength(GFrame.usedFrames), "used,", GatherLite:tablelength(GFrame.unusedFrames), "unused")
end
end
function GatherLiteTracker:Worldmap()
GatherLite:forEach(GFrame.usedFrames, function(frame)
if frame.type == "worldmap" and frame.node.loadedWorldmap then
frame.node.loadedWorldmap = false;
frame:Unload()
end
end);
if worldmapOpen and worldmapID then
for key, node in pairs(GatherLiteTracker:WorldmapNodes(worldmapID, GatherLiteTracker.WorldmapFilter)) do
_GatherLite.db[key].loadedWorldmap = true
GatherLite:createWorldmapNode(_GatherLite.db[key])
end
end
end
function GatherLiteTracker:OnUpdate(timeDelta)
if _GatherLite.WorldmapOpen and not worldmapOpen then
worldmapOpen = true;
elseif not _GatherLite.WorldmapOpen and worldmapOpen then
worldmapOpen = false;
worldmapID = nil;
GatherLite:Trigger("worldmap:update")
end
if worldmapOpen then
if worldmapID ~= WorldMapFrame.mapID then
worldmapID = WorldMapFrame.mapID;
GatherLite:Trigger("worldmap:update")
end
end
GatherLiteTracker:Minimap(timeDelta)
end |
-----------------------------------
-- Area: Quicksand Caves
-- Mob: Antican Triarius
-- Note: PH for Triarius X-XV and Hastatus XI-XII
-----------------------------------
local ID = require("scripts/zones/Quicksand_Caves/IDs")
require("scripts/globals/regimes")
require("scripts/globals/mobs")
-----------------------------------
function onMobDeath(mob, player, isKiller)
tpz.regime.checkRegime(player, mob, 812, 2, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 813, 2, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 814, 2, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 815, 1, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 816, 2, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 817, 2, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 818, 2, tpz.regime.type.GROUNDS)
tpz.regime.checkRegime(player, mob, 819, 2, tpz.regime.type.GROUNDS)
end
function onMobDespawn(mob)
tpz.mob.phOnDespawn(mob, ID.mob.TRIARIUS_X_XV_PH, 10, 7200) -- 2 hours
tpz.mob.phOnDespawn(mob, ID.mob.HASTATUS_XI_XII_PH, 10, 3600) -- 1 hour
end
|
function onEvent(name, value1, value2)
if name == 'Show-Dad-Notes' then
noteTweenAlpha('show1', 0, 1, 0.001, 'linear');
noteTweenAlpha('show2', 1, 1, 0.001, 'linear');
noteTweenAlpha('show3', 2, 1, 0.001, 'linear');
noteTweenAlpha('show4', 3, 1, 0.001, 'linear');
end
end
|
local _M = {}
_M.name = "config"
_M._VERSION = "0.1"
-- 响应数据的默认缓存时间
_M.resp_cache_seconds = 3600*24
-- redis配置信息,
-- models/redis.lua 默认使用该配置.
_M.redis_conf = {
host = "127.0.0.1",
port = 6379,
--db_index = 0, -- default is 0.
--auth = "", -- if your redis has password, write here.
--timeout = 1000, -- default is 1 second.
--keepalive = "on", -- default on.
--keepalive_max_idle_timeout = 10000, -- default is 10 seconds;
-- nil if keepalive="off".
--keepalive_pool_size = 100, -- default count is 100;
-- nil if keepalive="off".
}
-- mysql配置信息,
-- models/mysql.lua 默认使用该配置.
_M.mysql_conf = {
host = "127.0.0.1", -- default is 127.0.0.1.
port = 3306, -- default is 3306.
db = "test1", -- no default value, must be set.
--user = "root", -- default is root.
--password = "", -- default is "".
--max_packet_size = 1024*1024, -- default is 1024*1024.
--charset = "utf8", -- default is utf8.
--timeout = 1000, -- default is 1000, i.e. 1 second.
--max_idle_timeout = 10000, -- default is 10 seconds.
--pool_size = 50, -- default count is 50.
}
-- influxdb配置信息
_M.influxdb_conf = {
host = "127.0.0.1", -- default is 127.0.0.1.
port = 8086, -- default is 8086.
db = "cdn_bandwidth", -- no default value, must be set.
--user = "", -- default is "".
--password = "", -- default is "".
--timeout = 2000, -- default is 2000, 2 seconds.
--keepalive_timeout = 10000, -- default is 10 seconds.
--keepalive_pool = 50, -- default count is 50.
}
-- orientdb配置信息
_M.orientdb_conf = {
host = "127.0.0.1", -- default is 127.0.0.1.
port = 2480, -- default is 2480.
db = "graphdb", -- no default value, must be set.
user = "reader", -- default is "".
password = "123456", -- default is "".
--timeout = 2000, -- default is 2000, 2 seconds.
--keepalive_timeout = 10000, -- default is 10 seconds.
--keepalive_pool = 50, -- default is 50.
}
-- IP白名单, 全部注释将取消白名单策略
_M.ip_whitelist = {
--"127.0.0.1",
--"10.29.24.170", -- kong
}
-- 鉴权
_M.authenticate = {
auth_key = "56911a203de023998dbb8a3b718c6"
}
-- 用户请求并发限制
_M.request_limit = {
limit = true, -- 值为false, 将不启用限制
limit_number_per_second = 1000,
burst_number = 100,
}
return _M
|
data.raw.recipe["5d-mk5-transport-belt"].ingredients = {
{"iron-plate", 10},
{"steel-plate", 10},
{"processing-unit", 2},
{"5d-mk4-transport-belt", 2},
};
data.raw.recipe["5d-mk4-transport-belt"].ingredients = {
{"iron-plate", 10},
{"steel-plate", 10},
{"advanced-circuit", 2},
{"express-transport-belt", 2},
};
data.raw.recipe["5d-storage-tank"].ingredients = {
{"storage-tank", 1},
{"tin-plate", 15},
{"lead-plate", 7},
{"stone", 5},
};
data.raw.recipe["5d-mk5-splitter"].ingredients = {
{"5d-mk4-splitter", 5},
{"processing-unit", 5},
{"iron-plate", 5},
{"transport-belt", 4},
};
data.raw.recipe["5d-mk4-splitter"].ingredients = {
{"express-splitter", 1},
{"advanced-circuit", 15},
{"iron-plate", 5},
{"express-transport-belt", 4},
};
data.raw.recipe["5d-pipe-to-ground-mk3-50"].ingredients = {
{"5d-pipe-mk3", 50},
{"steel-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk3-30"].ingredients = {
{"5d-pipe-mk3", 30},
{"steel-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk3"].ingredients = {
{"5d-pipe-mk3", 10},
{"steel-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk2-50"].ingredients = {
{"5d-pipe-mk2", 50},
{"copper-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk2-30"].ingredients = {
{"5d-pipe-mk2", 30},
{"copper-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk2"].ingredients = {
{"5d-pipe-mk2", 10},
{"copper-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk1-50"].ingredients = {
{"pipe", 50},
{"iron-plate", 5},
};
data.raw.recipe["5d-pipe-to-ground-mk1-30"].ingredients = {
{"pipe", 30},
{"iron-plate", 5},
};
data.raw.recipe["5d-iron-chest-mk2-3"].ingredients = {
{"iron-chest", 5},
{"iron-plate", 80},
{"lead-plate", 60},
{"steel-plate", 40},
};
data.raw.recipe["5d-iron-chest-mk2-2"].ingredients = {
{"iron-chest", 1},
{"iron-plate", 20},
};
data.raw.recipe["5d-iron-chest-mk3"].ingredients = {
{"iron-chest", 4},
{"iron-plate", 20},
};
data.raw.recipe["5d-iron-chest-mk2"].ingredients = {
{"iron-chest", 1},
{"iron-plate", 20},
};
data.raw.recipe["5d-mk5-transport-belt-to-ground-50"].ingredients = {
{"iron-plate", 10},
{"5d-mk5-transport-belt", 50}
};
data.raw.recipe["5d-mk5-transport-belt-to-ground-30"].ingredients = {
{"iron-plate", 10},
{"5d-mk5-transport-belt", 30}
};
data.raw.recipe["5d-mk5-transport-belt-to-ground"].ingredients = {
{"iron-plate", 10},
{"5d-mk5-transport-belt", 5}
};
data.raw.recipe["5d-mk4-transport-belt-to-ground-50"].ingredients = {
{"iron-plate", 10},
{"5d-mk4-transport-belt", 50}
};
data.raw.recipe["5d-mk4-transport-belt-to-ground-30"].ingredients = {
{"iron-plate", 10},
{"5d-mk4-transport-belt", 30}
};
data.raw.recipe["5d-mk4-transport-belt-to-ground"].ingredients = {
{"iron-plate", 10},
{"5d-mk4-transport-belt", 5}
};
data.raw.recipe["5d-mk3-transport-belt-to-ground-50"].ingredients = {
{"iron-plate", 10},
{"express-transport-belt", 50}
};
data.raw.recipe["5d-mk3-transport-belt-to-ground-30"].ingredients = {
{"iron-plate", 10},
{"express-transport-belt", 30}
};
data.raw.recipe["5d-mk2-transport-belt-to-ground-50"].ingredients = {
{"iron-plate", 10},
{"fast-transport-belt", 50}
};
data.raw.recipe["5d-mk2-transport-belt-to-ground-30"].ingredients = {
{"iron-plate", 10},
{"fast-transport-belt", 30}
};
data.raw.recipe["5d-mk1-transport-belt-to-ground-50"].ingredients = {
{"iron-plate", 10},
{"transport-belt", 50}
};
data.raw.recipe["5d-mk1-transport-belt-to-ground-30"].ingredients = {
{"iron-plate", 10},
{"transport-belt", 30}
}; |
local T = {};
local MODIF1 = 173;
local tostring = tostring;
local sub = string.sub;
local byte = string.byte;
local char = string.char;
local meta_index = {};
T._meta = { __index = meta_index; };
T.Error = {
OK = 0;
NOT_FULL = 1;
HANDLER = 2;
BAD_MF1 = 3;
BAD_MF2 = 4;
MALFORMED = 5;
};
T.New = function(self, handler)
local rpc = setmetatable({}, self._meta);
if handler then
rpc:SetHandler(handler);
end
return rpc;
end
meta_index.SetHandler = function(self, handler)
if type(hanlder) == "function" then
self._rpc_handler = handler;
elseif type(handler) == "table" then
self._rpc_table = handler;
else
self._rpc_table = nil;
self._rpc_handler = nil;
end
end
local err = T.Error;
local to8 = byte;
local str8 = char;
local to16le = function(str, pos)
local a1, a2 = byte(str, pos, pos + 1);
return a1 + a2*0x100;
end
local str16le = function(num)
local a1 = num % 0x100;
return char(a1, (num - a1) / 0x100);
end
local function parse(str, index, limit)
if index >= limit then
return;
end
local off = index + 2 + to16le(str, index);
return sub(str, index + 2, off - 1), parse(str, off, limit);
end
meta_index.Call = function(self, str, ignore_modif)
str = tostring(str);
if (not str or #str < 4) then
return err.MALFORMED;
end
if not ignore_modif then
if to8(str, 1) ~= MODIF1 then
return err.BAD_MF1;
end
if to8(str, 4) ~= 0 then
return err.BAD_MF2;
end
end
local pkg_size = to16le(str, 2);
if (#str - 4 < pkg_size) then
return err.NOT_FULL, pkg_size + 4;
end
local res, ok = self:_rpc_handler(parse(str, 5, pkg_size + 4));
if not ok then
return err.HANDLER, res;
end
return self:_pack_result(res);
end
meta_index._rpc_table = {};
meta_index._rpc_handler = function(self, func, ...)
local rpc_t = self._rpc_table;
if not rpc_t[func] then
return nil, false;
end
return rpc_t[func](...), true;
end
-- precalc static
local CONTENT_LENGTH = "CONTENT_LENGTH";
local modif1_b = char(MODIF1);
local modif2_64b = char(5);
local modif2_b = char(0);
local pack64_initial_size = #CONTENT_LENGTH + 4;
local pack64_tail = modif2_64b .. str16le(#CONTENT_LENGTH) .. CONTENT_LENGTH;
meta_index._pack_result = function(self, str)
str = tostring(str) or "";
if (#str > 0xffff) then
local len = tostring(#str);
return err.OK, (modif1_b .. str16le(#len + pack64_initial_size) .. pack64_tail .. str16le(#len) .. len), str;
end
return err.OK, (modif1_b .. str16le(#str) .. modif2_b), str;
end
return T;
|
-- TODO: check this
local fire_blend_mode = "additive"
local fire_flags = nil
local fire_tint = {r=1,g=1,b=1,a=1}
local fire_animation_speed = 0.5
local fire_scale = 1
local smallspitterscale = 0.5
local smallspittertint = {r = 1, g = 0, b = 1, a = 1}
local smallbiterscale = 0.5
local medium_worm_scale = 0.83
local big_worm_scale = 1.0
local capsule_smoke = {{
name = "smoke-fast",
deviation = {0.15, 0.15},
frequency = 1,
position = {0, 0},
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed_deviation = 5
}}
data.raw["electric-turret"]["laser-turret"].energy_source = {
type = "electric",
buffer_capacity = "100000kJ",
input_flow_limit = "9600kW",
drain = "1kW",
usage_priority = "primary-input"
}
--#region local functions
local function biterrunanimation(scale, tint1, tint2)
return {
layers = {
{
width = 169,
height = 114,
frame_count = 16,
direction_count = 16,
shift = {scale * 0.714844, scale * -0.246094},
scale = scale,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-run-1.png",
width_in_frames = 8,
height_in_frames = 16
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-run-2.png",
width_in_frames = 8,
height_in_frames = 16
}
}
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-run-mask1.png",
flags = {"mask"},
width = 105,
height = 81,
frame_count = 16,
direction_count = 16,
shift = {scale * 0.117188, scale * -0.867188},
scale = scale,
tint = tint1
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-run-mask2.png",
flags = {"mask"},
line_length = 16,
width = 95,
height = 81,
frame_count = 16,
direction_count = 16,
shift = {scale * 0.117188, scale * -0.855469},
scale = scale,
tint = tint2
}
}
}
end
local function make_worm_dying_sounds(volume)
return {
{filename = "__base__/sound/creatures/worm-death-1.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-death-2.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-death-3.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-death-4.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-death-5.ogg", volume = volume}
}
end
local function make_worm_roars(volume)
return {
{filename = "__base__/sound/creatures/worm-roar-1.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-roar-2.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-roar-3.ogg", volume = volume},
{filename = "__base__/sound/creatures/worm-roar-4.ogg", volume = volume}
}
end
local function make_spitter_dying_sounds(volume)
return {
{filename = "__base__/sound/creatures/spitter-death-1.ogg", volume = volume},
{filename = "__base__/sound/creatures/spitter-death-2.ogg", volume = volume},
{filename = "__base__/sound/creatures/spitter-death-3.ogg", volume = volume},
{filename = "__base__/sound/creatures/spitter-death-4.ogg", volume = volume},
{filename = "__base__/sound/creatures/spitter-death-5.ogg", volume = volume}
}
end
local function make_spitter_roars(volume)
return {
layers = {
[0] = {
{filename = "__base__/sound/creatures/Spiters_1_1.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_2_1.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_3_1.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_4_1.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_5_1.ogg", volume = volume}
},
[1] = {
{filename = "__base__/sound/creatures/Spiters_1_2.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_2_2.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_3_2.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_4_2.ogg", volume = volume},
{filename = "__base__/sound/creatures/Spiters_5_2.ogg", volume = volume}
}
}
}
end
local function make_biter_calls(volume)
return {
{filename = "__base__/sound/creatures/biter-call-1.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-call-2.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-call-3.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-call-4.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-call-5.ogg", volume = volume}
}
end
local function make_biter_dying_sounds(volume)
return {
{filename = "__base__/sound/creatures/biter-death-1.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-death-2.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-death-3.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-death-4.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-death-5.ogg", volume = volume}
}
end
local function make_biter_roars(volume)
return {
{filename = "__base__/sound/creatures/biter-roar-1.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-roar-2.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-roar-3.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-roar-4.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-roar-5.ogg", volume = volume},
{filename = "__base__/sound/creatures/biter-roar-6.ogg", volume = volume}
}
end
local function spawner_idle_animation(variation, tint)
return {
layers = {
{
filename = "__0_16_graphics_revived__/graphics/entity/spawner/spawner-idle.png",
line_length = 8,
width = 243,
height = 181,
frame_count = 8,
animation_speed = 0.18,
direction_count = 1,
run_mode = "forward-then-backward",
shift = {0.140625 - 0.65, -0.234375},
y = variation * 181
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spawner/spawner-idle-mask.png",
flags = {"mask"},
width = 166,
height = 148,
frame_count = 8,
animation_speed = 0.18,
run_mode = "forward-then-backward",
shift = {-0.34375 - 0.65, -0.375},
line_length = 8,
tint = tint,
y = variation * 148
}
}
}
end
local function worm_attack_animation(scale, tint, run_mode)
return {
layers = {
{
width = 248,
height = 196,
frame_count = 8,
direction_count = 16,
shift = {scale * 0.953125, scale * -0.671875},
scale = scale,
run_mode = run_mode,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-attack-01.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-attack-02.png",
width_in_frames = 8,
height_in_frames = 8
}
}
}, {
flags = {"mask"},
width = 168,
height = 153,
frame_count = 8,
direction_count = 16,
shift = {scale * 0.078125, scale * -1.125},
scale = scale,
tint = tint,
run_mode = run_mode,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-attack-mask-01.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity//worm/worm-attack-mask-02.png",
width_in_frames = 8,
height_in_frames = 8
}
}
}
}
}
end
local function worm_prepared_animation(scale, tint)
return {
layers = {
{
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-prepared.png",
run_mode = "forward-then-backward",
line_length = 10,
width = 190,
height = 156,
frame_count = 10,
scale = scale,
direction_count = 1,
shift = {scale * 0.828125, scale * -0.890625}
}, {
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-prepared-mask.png",
flags = {"mask"},
run_mode = "forward-then-backward",
line_length = 10,
width = 80,
height = 129,
frame_count = 10,
shift = {scale * 0.078125, scale * -1.28125},
scale = scale,
direction_count = 1,
tint = tint
}
}
}
end
local function worm_preparing_animation(scale, tint, run_mode)
return {
layers = {
{
width = 208,
height = 148,
line_length = 13,
frame_count = 26,
shift = {scale * 1.10938, scale * -0.734375},
run_mode = run_mode,
scale = scale,
direction_count = 1,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-preparing-01.png",
width_in_frames = 7,
height_in_frames = 2
}, {
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-preparing-02.png",
width_in_frames = 6,
height_in_frames = 2
}
}
}, {
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-preparing-mask.png",
flags = {"mask"},
line_length = 13,
width = 98,
height = 121,
frame_count = 26,
shift = {scale * 0.171875, scale * -1.15625},
run_mode = run_mode,
scale = scale,
direction_count = 1,
tint = tint
}
}
}
end
local function worm_folded_animation(scale, tint)
return {
layers = {
{
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-folded.png",
run_mode = "forward-then-backward",
line_length = 5,
width = 143,
height = 104,
frame_count = 5,
shift = {scale * 0.09375, scale * -0.046875},
direction_count = 1,
scale = scale
}, {
filename = "__0_16_graphics_revived__/graphics/entity/worm/worm-folded-mask.png",
flags = {"mask"},
run_mode = "forward-then-backward",
line_length = 5,
width = 60,
height = 51,
frame_count = 5,
shift = {scale * 0.078125, scale * -0.09375},
scale = scale,
direction_count = 1,
tint = tint
}
}
}
end
local function spitterrunanimation(scale, tint)
return {
layers = {
{
width = 193,
height = 164,
priority = "very-low",
frame_count = 24,
direction_count = 16,
shift = {scale * 1.01562, 0},
scale = scale,
still_frame = 4,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-1.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-2.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-3.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-4.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-5.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-6.png",
width_in_frames = 8,
height_in_frames = 8
}
}
}, {
width = 81,
height = 90,
frame_count = 24,
direction_count = 16,
shift = {scale * 0.015625, scale * -0.6875},
scale = scale,
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-run-mask.png",
flags = {"mask"},
tint = tint
}
}
}
end
local function biterattackanimation(scale, tint1, tint2)
return {
layers = {
{
width = 279,
height = 184,
frame_count = 11,
direction_count = 16,
shift = {scale * 1.74609, scale * -0.644531},
animation_speed = 0.3,
scale = scale,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-attack-1.png",
width_in_frames = 6,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-attack-2.png",
width_in_frames = 5,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-attack-3.png",
width_in_frames = 6,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-attack-4.png",
width_in_frames = 5,
height_in_frames = 8
}
}
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-attack-mask1.png",
flags = {"mask"},
width = 125,
height = 108,
frame_count = 11,
direction_count = 16,
shift = {scale * 0.117188, scale * -1.11328},
scale = scale,
tint = tint1
}, {
filename = "__0_16_graphics_revived__/graphics/entity/biter/biter-attack-mask2.png",
flags = {"mask"},
width = 114,
height = 100,
frame_count = 11,
direction_count = 16,
shift = {scale * 0.117188, scale * -1.06641},
scale = scale,
tint = tint2
}
}
}
end
local function spitterattackanimation(scale, tint)
return {
layers = {
{
width = 199,
height = 164,
frame_count = 22,
direction_count = 16,
scale = scale,
shift = {scale * 0.765625, scale * 0.0625},
animation_speed = 0.4,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-1.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-2.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-3.png",
width_in_frames = 6,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-4.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-5.png",
width_in_frames = 8,
height_in_frames = 8
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-6.png",
width_in_frames = 6,
height_in_frames = 8
}
}
}, {
flags = {"mask"},
width = 108,
height = 90,
frame_count = 22,
direction_count = 16,
shift = {scale * 0, scale * -0.625},
scale = scale,
tint = tint,
animation_speed = 0.4,
stripes = {
{
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-mask-1.png",
width_in_frames = 11,
height_in_frames = 16
}, {
filename = "__0_16_graphics_revived__/graphics/entity/spitter/spitter-attack-mask-2.png",
width_in_frames = 11,
height_in_frames = 16
}
}
}
}
}
end
--#endregion
data:extend({
{
type = "unit",
name = "spitter-test",
icon = "__base__/graphics/icons/small-spitter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"},
max_health = 1000,
resistances = {{type = "damage-player", percent = 100}},
order = "b",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, -0.3}, {0.3, 0.3}},
selection_box = {{-0.4, -0.4}, {0.4, 0.4}},
sticker_box = {{-0.3, -0.5}, {0.3, 0.1}},
distraction_cooldown = 300,
attack_parameters = {
type = "projectile",
range = 15,
cooldown = 600000,
projectile_creation_distance = 1.9,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
action_delivery = {
type = "instant",
source_effects = {{type = "create-explosion", entity_name = "explosion-gunshot"}}
}
}, {
type = "direct"
-- repeat_count = 1,
}
}
},
sound = make_spitter_roars(0),
animation = spitterattackanimation(smallspitterscale, smallspittertint)
},
vision_distance = 50,
movement_speed = 0.185,
distance_per_frame = 0.04,
-- in pu
pollution_to_join_attack = 0,
corpse = "small-spitter-corpse",
dying_explosion = "blood-explosion-small",
working_sound = make_biter_calls(0),
dying_sound = make_spitter_dying_sounds(0),
run_animation = spitterrunanimation(smallspitterscale, smallspittertint)
}
})
-- ep
for i = 10, 200, 10 do
local scale = 1 - ((50 - i) / 100)
data:extend({
{
type = "projectile",
name = "ep-" .. i,
flags = {"not-on-map", "placeable-off-grid"},
collision_box = {{-0.2 * scale, -0.2 * scale}, {0.2 * scale, 0.2 * scale}},
acceleration = 0,
direction_only = true,
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
{type = "damage", damage = {amount = i, type = "damage-enemy"}},
{type = "create-entity", entity_name = "target-fire-1"}
}
}
},
animation = {
filename = "__roguef-core__/graphics/explosion/ep-1.png",
frame_count = 1,
width = 17,
height = 17,
priority = "high",
-- blend_mode = "additive",
-- animation_speed = 15/60,
scale = scale
}
}
})
end
-- stage 1
data:extend({
{
type = "unit",
name = "biter-normal-1",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 20,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, 0}, {0.3, 0.6}},
selection_box = {{-0.4, -0.7}, {0.7, 0.4}},
sticker_box = {{-0.2, -0.2}, {0.2, 0.2}},
attack_parameters = {
type = "projectile",
range = 0.5,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 50, type = "damage-enemy"}}
}
}
},
sound = make_biter_roars(0.5),
animation = biterattackanimation(smallbiterscale, {r = 0, g = 1, b = 0, a = 1}, {r = 0, g = 1, b = 0, a = 1})
},
vision_distance = 50,
movement_speed = 0.2,
distance_per_frame = 0.1,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "small-biter-corpse",
dying_explosion = "blood-explosion-small",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = biterrunanimation(smallbiterscale, {r = 0, g = 1, b = 0, a = 1}, {r = 0, g = 1, b = 0, a = 1})
}, {
type = "unit",
name = "biter-mini-1",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 20,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
-- collision_box = {{-0.3, 0}, {0.3, 0.6}},
selection_box = {{-0.4, -0.7}, {0.7, 0.4}},
sticker_box = {{-0.2, -0.2}, {0.2, 0.2}},
attack_parameters = {
type = "projectile",
range = 0.5,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 30, type = "damage-enemy"}}
}
}
},
sound = make_biter_roars(0.5),
animation = biterattackanimation(smallbiterscale * 1 / 2, {r = 0, g = 1, b = 0, a = 1}, {r = 0, g = 1, b = 0, a = 1})
},
vision_distance = 50,
movement_speed = 0.2,
distance_per_frame = 0.1,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "small-biter-corpse",
dying_explosion = "blood-explosion-small",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = biterrunanimation(smallbiterscale * 1 / 2, {r = 0, g = 1, b = 0, a = 1}, {r = 0, g = 1, b = 0, a = 1})
}, {
type = "unit",
name = "spitter-normal-1",
icon = "__base__/graphics/icons/small-spitter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"},
max_health = 20,
resistances = {{type = "damage-enemy", percent = 100}},
order = "b",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, 0}, {0.3, 0.6}},
selection_box = {{-0.4, -0.4}, {0.4, 0.4}},
sticker_box = {{-0.3, -0.5}, {0.3, 0.1}},
distraction_cooldown = 300,
attack_parameters = {
type = "projectile",
range = 15,
cooldown = 60,
projectile_creation_distance = 1.9,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
action_delivery = {
type = "instant",
source_effects = {{type = "create-explosion", entity_name = "explosion-gunshot"}}
}
}, {
type = "direct",
-- repeat_count = 1,
action_delivery = {
type = "projectile",
projectile = "ep-50",
starting_speed = 0.3,
-- direction_deviation = 0.3,
-- range_deviation = 0.3,
max_range = 30
}
}
}
},
sound = make_spitter_roars(0.7),
animation = spitterattackanimation(smallspitterscale, {r = 0, g = 0, b = 1, a = 1})
},
vision_distance = 50,
movement_speed = 0.185,
distance_per_frame = 0.04,
-- in pu
pollution_to_join_attack = 0,
corpse = "small-spitter-corpse",
dying_explosion = "blood-explosion-small",
working_sound = make_biter_calls(0.65),
dying_sound = make_spitter_dying_sounds(1.0),
run_animation = spitterrunanimation(smallspitterscale, {r = 0, g = 0, b = 1, a = 1})
}, {
type = "unit-spawner",
name = "spawner-biter-normal-1",
icon = "__base__/graphics/icons/biter-spawner.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "not-repairable"},
max_health = 200,
resistances = {{type = "damage-enemy", percent = 100}},
order = "c",
subgroup = "rf_enemy",
working_sound = {sound = {{filename = "__base__/sound/creatures/spawner.ogg", volume = 1.0}}, apparent_volume = 2},
dying_sound = {
{filename = "__base__/sound/creatures/spawner-death-1.ogg", volume = 1.0},
{filename = "__base__/sound/creatures/spawner-death-2.ogg", volume = 1.0}
},
healing_per_tick = 0,
collision_box = {{-3.2, -2.2}, {2.2, 2.2}},
selection_box = {{-3.5, -2.5}, {2.5, 2.5}},
-- in ticks per 1 pu
pollution_absorption_absolute = 0,
pollution_absorption_proportional = 0,
pollution_to_enhance_spawning = 0,
corpse = "biter-spawner-corpse",
dying_explosion = "blood-explosion-huge",
max_count_of_owned_units = 7,
max_friends_around_to_spawn = 5,
animations = {
spawner_idle_animation(0, {r = 0, g = 1, b = 0, a = 1}), spawner_idle_animation(1, {r = 0, g = 1, b = 0, a = 1}),
spawner_idle_animation(2, {r = 0, g = 1, b = 0, a = 1}), spawner_idle_animation(3, {r = 0, g = 1, b = 0, a = 1})
},
result_units = (function()
local res = {}
res[1] = {"biter-normal-1", {{0.0, 0.3}, {0.6, 0.0}}}
if not data.is_demo then
res[2] = {"biter-normal-1", {{0.3, 0.0}, {0.6, 0.3}, {0.7, 0.1}}}
res[3] = {"biter-normal-1", {{0.5, 0.0}, {1.0, 0.4}}}
res[4] = {"biter-normal-1", {{0.9, 0.0}, {1.0, 0.3}}}
end
return res
end)(),
spawning_cooldown = {180, 180},
spawning_radius = 10,
spawning_spacing = 3,
max_spawn_shift = 0,
max_richness_for_spawn_shift = 100,
call_for_help_radius = 50
}, {
type = "unit-spawner",
name = "spawner-spitter-normal-1",
icon = "__base__/graphics/icons/biter-spawner.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "not-repairable"},
max_health = 200,
resistances = {{type = "damage-enemy", percent = 100}},
order = "c",
subgroup = "rf_enemy",
working_sound = {sound = {{filename = "__base__/sound/creatures/spawner.ogg", volume = 1.0}}, apparent_volume = 2},
dying_sound = {
{filename = "__base__/sound/creatures/spawner-death-1.ogg", volume = 1.0},
{filename = "__base__/sound/creatures/spawner-death-2.ogg", volume = 1.0}
},
healing_per_tick = 0,
collision_box = {{-3.2, -2.2}, {2.2, 2.2}},
selection_box = {{-3.5, -2.5}, {2.5, 2.5}},
pollution_absorption_absolute = 0,
pollution_absorption_proportional = 0,
pollution_to_enhance_spawning = 0,
corpse = "biter-spawner-corpse",
dying_explosion = "blood-explosion-huge",
max_count_of_owned_units = 7,
max_friends_around_to_spawn = 5,
animations = {
spawner_idle_animation(0, {r = 0, g = 0, b = 1, a = 1}), spawner_idle_animation(1, {r = 0, g = 0, b = 1, a = 1}),
spawner_idle_animation(2, {r = 0, g = 0, b = 1, a = 1}), spawner_idle_animation(3, {r = 0, g = 0, b = 1, a = 1})
},
result_units = (function()
local res = {}
res[1] = {"spitter-normal-1", {{0.0, 0.3}, {0.6, 0.0}}}
if not data.is_demo then
res[2] = {"spitter-normal-1", {{0.3, 0.0}, {0.6, 0.3}, {0.7, 0.1}}}
res[3] = {"spitter-normal-1", {{0.5, 0.0}, {1.0, 0.4}}}
res[4] = {"spitter-normal-1", {{0.9, 0.0}, {1.0, 0.3}}}
end
return res
end)(),
spawning_cooldown = {180, 180},
spawning_radius = 10,
spawning_spacing = 3,
max_spawn_shift = 0,
max_richness_for_spawn_shift = 100,
call_for_help_radius = 50
}, {
type = "unit",
name = "biter-boss-1",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 4000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "d",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, 0}, {0.3, 0.6}},
selection_box = {{-0.4 * 4, -0.7 * 4}, {0.7 * 4, 0.4 * 4}},
sticker_box = {{-0.1 * 4, -0.2 * 4}, {0.1 * 4, 0.1 * 4}},
attack_parameters = {
type = "projectile",
range = 0.5 * 4,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 50 * 2, type = "damage-enemy"}}
}
}
},
sound = make_biter_roars(0.5),
animation = biterattackanimation(smallbiterscale * 4, {r = 0, g = 1, b = 0, a = 1}, {r = 0, g = 1, b = 0, a = 1})
},
vision_distance = 50,
movement_speed = 0.1,
distance_per_frame = 0.1,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "behemoth-biter-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = biterrunanimation(smallbiterscale * 4, {r = 0, g = 1, b = 0, a = 1}, {r = 0, g = 1, b = 0, a = 1})
}
})
-- stage 2
data:extend({
{
type = "unit",
name = "spitter-boss-2",
icon = "__base__/graphics/icons/small-spitter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"},
max_health = 5000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "d",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3 * 4, -0.3 * 4}, {0.3 * 4, 0.6 * 4}},
selection_box = {{-0.4 * 4, -0.4 * 4}, {0.4 * 4, 0.4 * 4}},
sticker_box = {{-0.3 * 4, -0.5 * 4}, {0.3 * 4, 0.1 * 4}},
distraction_cooldown = 300,
attack_parameters = {
type = "projectile",
range = 100,
cooldown = 12,
projectile_creation_distance = 1.9,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
action_delivery = {
type = "instant",
source_effects = {{type = "create-explosion", entity_name = "explosion-gunshot"}}
}
}, {
type = "direct",
repeat_count = 1,
action_delivery = {
type = "projectile",
projectile = "ep-50",
starting_speed = 0.2,
direction_deviation = 0.5,
range_deviation = 0.5,
max_range = 30
}
}
}
},
sound = make_spitter_roars(0.7),
animation = spitterattackanimation(smallspitterscale * 4, {r = 1, g = 0, b = 0, a = 1})
},
vision_distance = 50,
movement_speed = 1,
distance_per_frame = 0.04,
-- in pu
pollution_to_join_attack = 0,
corpse = "behemoth-spitter-corpse",
dying_explosion = "blood-explosion-huge",
working_sound = make_biter_calls(0.65),
dying_sound = make_spitter_dying_sounds(1.0),
run_animation = spitterrunanimation(smallspitterscale * 4, {r = 1, g = 0, b = 0, a = 1})
}
})
-- stage 3
-- it seems wrong
data.raw["rocket-silo"]["rocket-silo"].flags = {
"placeable-player", "placeable-enemy", "not-repairable", "placeable-off-grid"
}
data.raw["rocket-silo"]["rocket-silo"].max_health = 6000
local rock_medium_copy = util.table.deepcopy(data.raw["optimized-decorative"]["rock-medium"])
data:extend({
{
type = "simple-entity",
name = "rf_stone",
flags = {"placeable-player", "placeable-enemy", "not-repairable", "placeable-off-grid"},
icon = "__base__/graphics/icons/stone.png", -- TODO: check this!
icon_size = 64,
subgroup = "rf_enemy",
order = "e",
collision_box = {{-1.1, -1.1}, {1.1, 1.1}},
selection_box = {{-1.3, -1.3}, {1.3, 1.3}},
dying_explosion = "explosion",
render_layer = "object",
max_health = 500,
pictures = rock_medium_copy.pictures
}, {
type = "projectile",
name = "rf_rocket-3",
flags = {"not-on-map"},
collision_box = {{-0.2, -0.2}, {0.2, 0.2}},
acceleration = 0,
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
{type = "create-entity", entity_name = "explosion"},
{type = "damage", damage = {amount = 100, type = "damage-enemy"}},
{type = "create-entity", entity_name = "small-scorchmark", check_buildability = true}
}
}
},
light = {intensity = 0.5, size = 4},
animation = {
filename = "__base__/graphics/entity/rocket/rocket.png",
frame_count = 8,
line_length = 8,
width = 9,
height = 35,
shift = {0, 0},
priority = "high"
},
shadow = {
filename = "__base__/graphics/entity/rocket/rocket-shadow.png",
frame_count = 1,
width = 7,
height = 24,
priority = "high",
shift = {0, 0}
},
smoke = {
{
name = "smoke-fast",
deviation = {0.15, 0.15},
frequency = 1,
position = {0, -1},
slow_down_factor = 1,
starting_frame = 3,
starting_frame_deviation = 5,
starting_frame_speed = 0,
starting_frame_speed_deviation = 5
}
}
}, {
type = "projectile",
name = "rf_poison-3",
flags = {"not-on-map"},
acceleration = 0,
action = {
type = "direct",
action_delivery = {type = "instant", target_effects = {type = "create-entity", entity_name = "poison-cloud-3"}}
},
light = {intensity = 0.5, size = 4},
animation = {
filename = "__base__/graphics/entity/poison-capsule/poison-capsule.png",
frame_count = 1,
width = 32,
height = 32,
priority = "high"
},
shadow = {
filename = "__base__/graphics/entity/poison-capsule/poison-capsule-shadow.png",
frame_count = 1,
width = 32,
height = 32,
priority = "high"
},
smoke = capsule_smoke
}, {
type = "smoke-with-trigger",
name = "poison-cloud-3",
flags = {"not-on-map"},
show_when_smoke_off = true,
animation = {
filename = "__base__/graphics/entity/cloud/cloud-45-frames.png",
flags = {"compressed"},
priority = "low",
width = 256,
height = 256,
frame_count = 45,
animation_speed = 0.5,
line_length = 7,
scale = 3 / 3,
shift = {0, 1}
},
slow_down_factor = 0,
affected_by_wind = false,
cyclic = true,
duration = 60 * 10,
fade_away_duration = 2 * 60,
spread_duration = 10,
color = {r = 0.2, g = 0.9, b = 0.2},
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type = "nested-result",
action = {
type = "area",
radius = 3,
entity_flags = {"breaths-air"},
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 10, type = "damage-enemy"}}
}
}
}
}
},
action_frequency = 10
}, {
type = "stream",
name = "rf_flame-3",
flags = {"not-on-map"},
stream_light = {intensity = 1, size = 4},
ground_light = {intensity = 0.8, size = 4},
particle_buffer_size = 90,
particle_spawn_interval = 2,
particle_spawn_timeout = 8,
particle_vertical_acceleration = 0.005 * 0.60,
particle_horizontal_speed = 0.2 * 0.75 * 1.5,
particle_horizontal_speed_deviation = 0.005 * 0.70,
particle_start_alpha = 0.5,
particle_end_alpha = 1,
particle_start_scale = 0.2,
particle_loop_frame_count = 3,
particle_fade_out_threshold = 0.9,
particle_loop_exit_threshold = 0.25,
action = {
{
type = "direct",
action_delivery = {type = "instant", target_effects = {{type = "create-fire", entity_name = "blaze-3"}}}
}, {
type = "area",
radius = 2.5,
action_delivery = {
type = "instant",
target_effects = {{type = "damage", damage = {amount = 100, type = "damage-enemy"}}}
}
}
},
spine_animation = {
filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-fire-stream-spine.png",
blend_mode = "additive",
-- tint = {r=1, g=1, b=1, a=0.5},
line_length = 4,
width = 32,
height = 18,
frame_count = 32,
axially_symmetrical = false,
direction_count = 1,
animation_speed = 2,
shift = {0, 0}
},
shadow = {
filename = "__0_16_graphics_revived__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
shift = {-0.09, 0.395}
},
particle = {
filename = "__base__/graphics/entity/flamethrower-fire-stream/flamethrower-explosion.png",
priority = "extra-high",
width = 64,
height = 64,
frame_count = 32,
line_length = 8
}
}, {
type = "fire",
name = "blaze-3",
flags = {"placeable-off-grid", "not-on-map"},
duration = 600,
fade_away_duration = 600,
spread_duration = 600,
start_scale = 1,
end_scale = 0.01,
color = {r = 1, g = 0.9, b = 0, a = 0.5},
damage_per_tick = {amount = 2, type = "damage-enemy"},
spread_delay = 300,
spread_delay_deviation = 180,
maximum_spread_count = 100,
initial_lifetime = 600,
flame_alpha = 0.35,
flame_alpha_deviation = 0.05,
emissions_per_tick = 0.005,
add_fuel_cooldown = 10,
increase_duration_cooldown = 10,
increase_duration_by = 20,
fade_in_duration = 30,
fade_out_duration = 30,
lifetime_increase_by = 20,
lifetime_increase_cooldown = 10,
delay_between_initial_flames = 10,
burnt_patch_lifetime = 0,
pictures = {
{
filename = "__roguef-core__/graphics/explosion/blaze.png",
line_length = 8,
width = 30,
height = 59,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = {-0.0390625 / 2, -0.90625 / 2}
}
},
light = {intensity = 1, size = 20},
working_sound = {sound = {filename = "__base__/sound/furnace.ogg"}, max_sounds_per_type = 3}
}
})
-- stage 4
data:extend({
{
type = "turret",
name = "worm-boss-4",
icon = "__base__/graphics/icons/big-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air", "placeable-off-grid"},
max_health = 12000,
order = "b-b-f",
subgroup = "enemies",
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.4, -1.2}, {1.4, 1.2}},
selection_box = {{-1.4, -1.2}, {1.4, 1.2}},
shooting_cursor_size = 4,
rotation_speed = 1,
corpse = "big-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(1.0),
inventory_size = 2,
folded_speed = 0.01,
folded_animation = worm_folded_animation(big_worm_scale, {r = 1, g = 0, b = 0, a = 1}),
-- prepare_range = 25,
preparing_speed = 0.025,
preparing_animation = worm_preparing_animation(big_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "forward"),
prepared_speed = 0.015,
prepared_animation = worm_prepared_animation(big_worm_scale, {r = 1, g = 0, b = 0, a = 1}),
starting_attack_speed = 0.03,
starting_attack_animation = worm_attack_animation(big_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.95),
ending_attack_speed = 0.03,
ending_attack_animation = worm_attack_animation(big_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "backward"),
folding_speed = 0.015,
folding_animation = worm_preparing_animation(big_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "backward"),
prepare_range = 30,
attack_parameters = {
type = "stream",
range = 50,
cooldown = 300,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "position",
action = {
{
type = "direct",
action_delivery = {type = "instant", source_effects = {{type = "create-explosion", entity_name = "explosion"}}}
}, {type = "direct", repeat_count = 1, action_delivery = {type = "stream", stream = "ep-4-1", max_range = 50}}
}
}
},
build_base_evolution_requirement = 0.5,
call_for_help_radius = 40
}, {
type = "stream",
name = "ep-4-1",
flags = {"not-on-map"},
working_sound_disabled = {{filename = "__base__/sound/fight/electric-beam.ogg", volume = 0.7}},
particle_buffer_size = 65,
particle_spawn_interval = 2,
particle_spawn_timeout = 2,
particle_vertical_acceleration = 0.003,
particle_horizontal_speed = 0.1,
particle_horizontal_speed_deviation = 0.001,
particle_start_alpha = 0.5,
particle_end_alpha = 1,
particle_start_scale = 0.2,
particle_loop_frame_count = 1,
particle_fade_out_threshold = 0.9,
particle_loop_exit_threshold = 0.25,
action = {
{
type = "direct",
action_delivery = {type = "instant", target_effects = {{type = "create-entity", entity_name = "explosion"}}}
}, {
type = "area",
radius = 2,
action_delivery = {
type = "instant",
target_effects = {{type = "damage", damage = {amount = 50, type = "damage-enemy"}}}
}
}, {
type = "cluster",
cluster_count = 30,
distance = 5,
distance_deviation = 4,
action_delivery = {
type = "projectile",
projectile = "ep-50",
direction_deviation = 0.6,
starting_speed = 0.1,
starting_speed_deviation = 0.09,
max_range = 20
}
}
},
spine_animation = {
filename = "__roguef-core__/graphics/explosion/ep-4-1.png",
frame_count = 32,
line_length = 8,
width = 64,
height = 64,
priority = "high",
blend_mode = "additive",
animation_speed = 64 / 60
},
shadow = {
filename = "__0_16_graphics_revived__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
scale = 1.5,
shift = {-0.09 * 1.5, 0.395 * 1.5}
}
}, {
type = "beam",
name = "beam-4",
flags = {"not-on-map"},
width = 0.1,
damage_interval = 1,
working_sound = {{filename = "__base__/sound/fight/electric-beam.ogg", volume = 1}},
action = {
type = "line",
range = 30,
width = 0.1,
action_delivery = {
type = "instant",
target_effects = {
{type = "damage", damage = {amount = 25, type = "damage-enemy"}},
{type = "create-entity", entity_name = "target-elec-1"}
}
}
},
head = {
filename = "__m-roguef__/graphics/entity/beam/beam-head.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
animation_speed = 0.5,
blend_mode = "additive-soft"
},
tail = {
filename = "__m-roguef__/graphics/entity/beam/beam-tail.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
},
body = {
{
filename = "__m-roguef__/graphics/entity/beam/beam-body-1.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
}, {
filename = "__m-roguef__/graphics/entity/beam/beam-body-2.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
}, {
filename = "__m-roguef__/graphics/entity/beam/beam-body-3.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
}, {
filename = "__m-roguef__/graphics/entity/beam/beam-body-4.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
}, {
filename = "__m-roguef__/graphics/entity/beam/beam-body-5.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
}, {
filename = "__m-roguef__/graphics/entity/beam/beam-body-6.png",
line_length = 16,
width = 45,
height = 39,
frame_count = 16,
blend_mode = "additive-soft"
}
}
}
})
-- stage 5
-- data.raw["locomotive"]["locomotive"].braking_force = 1000
-- data.raw["locomotive"]["locomotive"].friction_force = 0
-- data.raw["locomotive"]["locomotive"].air_resistance = 0
-- data.raw["locomotive"]["locomotive"].weight = 1000
-- data.raw["locomotive"]["locomotive"].max_speed = 0.75
-- stage 6
data:extend({
{
type = "turret",
name = "worm-normal-6-1",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1500,
resistances = {{type = "damage-player", percent = 90}, {type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 0.01,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}),
-- prepare_range = 25,
preparing_speed = 0.025,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "forward"),
prepared_speed = 0.015,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}),
starting_attack_speed = 0.03,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.8),
ending_attack_speed = 0.03,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "backward"),
folding_speed = 0.015,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 120,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
repeat_count = 20,
action_delivery = {
type = "projectile",
projectile = "ep-50",
starting_speed = 0.3,
starting_speed_deviation = 0.2,
direction_deviation = 0.6,
range_deviation = 0.6,
max_range = 40
}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "turret",
name = "worm-normal-6-2",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1000,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 0.01,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}),
-- prepare_range = 25,
preparing_speed = 0.025,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "forward"),
prepared_speed = 0.015,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}),
starting_attack_speed = 0.03,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.8),
ending_attack_speed = 0.03,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "backward"),
folding_speed = 0.015,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "stream",
range = 50,
cooldown = 180,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "position",
action = {
{type = "direct", repeat_count = 1, action_delivery = {type = "stream", stream = "ep-6-1", max_range = 50}}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "stream",
name = "ep-6-1",
flags = {"not-on-map"},
working_sound_disabled = {{filename = "__base__/sound/fight/electric-beam.ogg", volume = 0.7}},
particle_buffer_size = 65,
particle_spawn_interval = 2,
particle_spawn_timeout = 2,
particle_vertical_acceleration = 0.003,
particle_horizontal_speed = 0.2,
particle_horizontal_speed_deviation = 0.001,
particle_start_alpha = 0.5,
particle_end_alpha = 1,
particle_start_scale = 0.2,
particle_loop_frame_count = 1,
particle_fade_out_threshold = 0.9,
particle_loop_exit_threshold = 0.25,
action = {
{
type = "direct",
action_delivery = {type = "instant", target_effects = {{type = "create-entity", entity_name = "explosion-192"}}}
}, {
type = "area",
radius = 3,
action_delivery = {
type = "instant",
target_effects = {{type = "damage", damage = {amount = 100, type = "explosion"}}}
}
}
},
spine_animation = {
filename = "__roguef-core__/graphics/explosion/ep-6-1.png",
frame_count = 32,
line_length = 8,
width = 64,
height = 64,
priority = "high",
blend_mode = "additive",
animation_speed = 64 / 60
},
shadow = {
filename = "__0_16_graphics_revived__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
scale = 1.5,
shift = {-0.09 * 1.5, 0.395 * 1.5}
}
}, {
type = "turret",
name = "worm-normal-6-3",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 500,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 1,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}),
-- prepare_range = 25,
preparing_speed = 1,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "forward"),
prepared_speed = 1,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}),
starting_attack_speed = 1,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.1),
ending_attack_speed = 0.1,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "backward"),
folding_speed = 1,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 6,
projectile_creation_distance = 2,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
-- repeat_count = 20,
action_delivery = {type = "projectile", projectile = "ep-30", starting_speed = 0.2, max_range = 40}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "unit",
name = "biter-normal-6",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 1000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, 0}, {0.3, 0.6}},
selection_box = {{-0.4, -0.7}, {0.7, 0.4}},
sticker_box = {{-0.2, -0.2}, {0.2, 0.2}},
attack_parameters = {
type = "projectile",
range = 0.5,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 50, type = "damage-enemy"}}
}
}
},
sound = make_biter_roars(0.5),
animation = biterattackanimation(smallbiterscale * 2, {r = 1, g = 0, b = 0, a = 1}, {r = 1, g = 0, b = 0, a = 1})
},
vision_distance = 50,
movement_speed = 0.1,
distance_per_frame = 0.1,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "big-biter-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_biter_dying_sounds(1.0),
working_sound = make_biter_calls(0.7),
run_animation = biterrunanimation(smallbiterscale * 2, {r = 1, g = 0, b = 0, a = 1}, {r = 1, g = 0, b = 0, a = 1})
}, {
type = "unit",
name = "spitter-normal-6",
icon = "__base__/graphics/icons/small-spitter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air", "not-repairable"},
max_health = 500,
resistances = {{type = "damage-enemy", percent = 100}},
order = "b",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, 0}, {0.3, 0.6}},
selection_box = {{-0.4, -0.4}, {0.4, 0.4}},
sticker_box = {{-0.3, -0.5}, {0.3, 0.1}},
distraction_cooldown = 300,
attack_parameters = {
type = "projectile",
range = 30,
cooldown = 2,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
{
type = "direct",
action_delivery = {type = "instant", source_effects = {{type = "create-explosion", entity_name = "slow-aura"}}}
}, {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 0, type = "damage-enemy"}}
}
}
}
},
-- sound = make_spitter_roars(0.7),
animation = spitterattackanimation(smallspitterscale, {r = 1, g = 1, b = 0, a = 1})
},
vision_distance = 50,
movement_speed = 0.185,
distance_per_frame = 0.04,
-- in pu
pollution_to_join_attack = 0,
corpse = "small-spitter-corpse",
dying_explosion = "blood-explosion-small",
working_sound = make_biter_calls(0.65),
dying_sound = make_spitter_dying_sounds(1.0),
run_animation = spitterrunanimation(smallspitterscale, {r = 1, g = 1, b = 0, a = 1})
}, {
type = "explosion",
name = "slow-aura",
flags = {"not-on-map", "placeable-off-grid"},
animations = {
{
filename = "__roguef-core__/graphics/explosion/slow-aura.png",
priority = "low",
width = 182,
height = 160,
frame_count = 2,
animation_speed = 1,
shift = {0, 1},
blend_mode = "additive"
}
},
rotate = true
}, {
type = "turret",
name = "worm-normal-6-4",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1000,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 1,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}),
-- prepare_range = 25,
preparing_speed = 1,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "forward"),
prepared_speed = 1,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}),
starting_attack_speed = 1,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.1),
ending_attack_speed = 0.1,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "backward"),
folding_speed = 1,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 120,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "position",
action = {
{
type = "direct",
action_delivery = {type = "instant", source_effects = {{type = "create-entity", entity_name = "ep-6-2"}}}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "projectile",
name = "ep-6-2",
flags = {"not-on-map", "placeable-off-grid"},
collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
acceleration = 0,
direction_only = true,
action = {
{
type = "cluster",
cluster_count = 30,
distance = 4,
distance_deviation = 3,
action_delivery = {
type = "projectile",
projectile = "ep-6-3",
direction_deviation = 0.6,
starting_speed = 0.2,
starting_speed_deviation = 0.1,
max_range = 50
}
}
},
animation = {
filename = "__roguef-core__/graphics/explosion/p-7.png",
frame_count = 1,
width = 19,
height = 18,
priority = "high",
blend_mode = "additive"
-- animation_speed = 30/60
}
}, {
type = "projectile",
name = "ep-6-3",
flags = {"not-on-map", "placeable-off-grid"},
collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
acceleration = 0,
direction_only = true,
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
{type = "damage", damage = {amount = -20, type = "damage-enemy"}},
{type = "damage", damage = {amount = 20, type = "damage-enemy"}},
{type = "create-entity", entity_name = "firstaid"}
}
}
},
animation = {
filename = "__roguef-core__/graphics/explosion/ep-6-3.png",
frame_count = 1,
width = 17,
height = 17,
priority = "high"
}
}
})
-- stage 7
data:extend({
{
type = "unit",
name = "boss-7",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 10000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
sticker_box = {{-0.5, -0.5}, {0.5, 0.5}},
attack_parameters = {
type = "projectile",
range = 1,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 200, type = "damage-enemy"}}
}
}
},
sound = {
{filename = "__m-roguef__/sound/andariel/attack1.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/andariel/attack2.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/andariel/attack3.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/andariel/attack4.ogg", volume = 0.5}
},
animation = {
width = 247,
height = 248,
frame_count = 16,
direction_count = 8,
stripes = {
{filename = "__m-roguef__/graphics/entity/anda/attack-1.png", width_in_frames = 8, height_in_frames = 8},
{filename = "__m-roguef__/graphics/entity/anda/attack-2.png", width_in_frames = 8, height_in_frames = 8}
},
shift = {0, -2}
-- scale = scale,
}
},
vision_distance = 50,
movement_speed = 0.15,
distance_per_frame = 0.3,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "boss-7-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = {{filename = "__m-roguef__/sound/andariel/death.ogg", volume = 1}},
working_sound = {{filename = "__m-roguef__/sound/andariel/neutral1.ogg", volume = 1}},
run_animation = {
width = 148,
height = 184,
frame_count = 12,
direction_count = 8,
filename = "__m-roguef__/graphics/entity/anda/run-1.png",
shift = {0, -2}
-- scale = scale,
}
}, {
type = "corpse",
name = "boss-7-corpse",
icon = "__base__/graphics/icons/small-biter-corpse.png",
icon_size = 64,
selection_box = {{-0.8, -0.8}, {0.8, 0.8}},
selectable_in_game = false,
subgroup = "corpses",
order = "c[corpse]-a[biter]-a[small]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"},
dying_speed = 0.01,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse"
-- TODO: FIX THIS ANIMATION
-- animation =
-- {
-- width = 203,
-- height = 232,
-- frame_count = 23,
-- direction_count = 8,
-- stripes =
-- {
-- {
-- filename = "__m-roguef__/graphics/entity/anda/die-1.png",
-- width_in_frames = 8,
-- height_in_frames = 8,
-- },
-- {
-- filename = "__m-roguef__/graphics/entity/anda/die-2.png",
-- width_in_frames = 7,
-- height_in_frames = 8,
-- },
-- {
-- filename = "__m-roguef__/graphics/entity/anda/die-3.png",
-- width_in_frames = 8,
-- height_in_frames = 8,
-- }
-- },
-- shift = {0,-2},
-- scale = scale,
-- },
}, {
type = "smoke-with-trigger",
name = "poison-cloud-7",
flags = {"not-on-map"},
show_when_smoke_off = true,
animation = {
filename = "__base__/graphics/entity/cloud/cloud-45-frames.png",
flags = {"compressed"},
priority = "low",
width = 256,
height = 256,
frame_count = 45,
animation_speed = 0.5,
line_length = 7,
scale = 3 / 3,
shift = {0, 1}
},
slow_down_factor = 0,
affected_by_wind = true,
cyclic = true,
duration = 60 * 10,
fade_away_duration = 1 * 60,
spread_duration = 10,
color = {r = 0.8, g = 0.2, b = 0.8},
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
type = "nested-result",
action = {
type = "area",
radius = 3,
entity_flags = {"breaths-air"},
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 10, type = "damage-enemy"}}
}
}
}
}
},
action_frequency = 10
}, {
type = "unit",
name = "larva-7",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 200,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3, -0.3}, {0.3, 0.3}},
selection_box = {{-0.3, -0.3}, {0.3, 0.3}},
sticker_box = {{-0.3, -0.3}, {0.3, 0.3}},
attack_parameters = {
type = "projectile",
range = 0.1,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 100, type = "damage-enemy"}}
}
}
},
sound = {
{filename = "__m-roguef__/sound/larva/attack-1.ogg", volume = 1},
{filename = "__m-roguef__/sound/larva/attack-2.ogg", volume = 1},
{filename = "__m-roguef__/sound/larva/attack-3.ogg", volume = 1}
},
animation = {
width = 32,
height = 28,
frame_count = 5,
direction_count = 16,
filename = "__m-roguef__/graphics/entity/larva/move.png",
shift = {0, 0}
-- scale = scale,
}
},
dying_sound = {{filename = "__m-roguef__/sound/larva/die.ogg", volume = 1}},
working_sound = {{filename = "__m-roguef__/sound/larva/working.ogg", volume = 0.5}},
vision_distance = 50,
movement_speed = 0.15,
distance_per_frame = 0.3,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "larva-7-corpse",
-- dying_explosion = "blood-explosion-small",
run_animation = {
width = 32,
height = 28,
frame_count = 5,
direction_count = 16,
filename = "__m-roguef__/graphics/entity/larva/move.png",
shift = {0, 0}
-- scale = scale,
}
}, {
type = "unit",
name = "larva-7-big",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 3000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.3 * 2, -0.3 * 2}, {0.3 * 2, 0.3 * 2}},
selection_box = {{-0.3 * 2, -0.3 * 2}, {0.3 * 2, 0.3 * 2}},
sticker_box = {{-0.3, -0.3}, {0.3, 0.3}},
attack_parameters = {
type = "projectile",
range = 0.1,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 200, type = "damage-enemy"}}
}
}
},
sound = {
{filename = "__m-roguef__/sound/larva/attack-1.ogg", volume = 1},
{filename = "__m-roguef__/sound/larva/attack-2.ogg", volume = 1},
{filename = "__m-roguef__/sound/larva/attack-3.ogg", volume = 1}
},
animation = {
width = 32,
height = 28,
frame_count = 5,
direction_count = 16,
filename = "__m-roguef__/graphics/entity/larva/move.png",
shift = {0, 0},
scale = 2
}
},
dying_sound = {{filename = "__m-roguef__/sound/larva/die.ogg", volume = 1}},
working_sound = {{filename = "__m-roguef__/sound/larva/working.ogg", volume = 0.5}},
vision_distance = 50,
movement_speed = 0.1,
distance_per_frame = 0.3,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "larva-7-corpse",
-- dying_explosion = "blood-explosion-small",
run_animation = {
width = 32,
height = 28,
frame_count = 5,
direction_count = 16,
filename = "__m-roguef__/graphics/entity/larva/move.png",
shift = {0, 0},
scale = 2
}
}, {
type = "corpse",
name = "larva-7-corpse",
icon = "__base__/graphics/icons/small-biter-corpse.png",
icon_size = 64,
selection_box = {{-0.8, -0.8}, {0.8, 0.8}},
selectable_in_game = false,
subgroup = "corpses",
order = "c[corpse]-a[biter]-a[small]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"},
dying_speed = 0.03,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = {
width = 47,
height = 24,
frame_count = 9,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/larva/die.png",
shift = {0, 0}
-- scale = scale,
}
}, {
type = "explosion",
name = "egg-pre",
flags = {"not-on-map", "placeable-off-grid"},
animations = {
{
filename = "__m-roguef__/graphics/entity/egg/pre.png",
frame_count = 4,
width = 36,
height = 41,
priority = "extra-high",
animation_speed = 4 / 30,
shift = {0, 1}
}
}
}, {
type = "explosion",
name = "egg-pre-big",
flags = {"not-on-map", "placeable-off-grid"},
animations = {
{
filename = "__m-roguef__/graphics/entity/egg/pre.png",
frame_count = 4,
width = 36,
height = 41,
priority = "extra-high",
animation_speed = 4 / 30,
shift = {0, 1},
scale = 2
}
}
}, {
type = "unit",
name = "egg-7",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 500,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 1,
collision_box = {{-0.3, -0.3}, {0.3, 0.3}},
selection_box = {{-0.3, -0.3}, {0.3, 0.3}},
sticker_box = {{-0.3, -0.3}, {0.3, 0.3}},
attack_parameters = {
type = "projectile",
range = 100,
cooldown = 30,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 0, type = "damage-enemy"}}
}
}
},
animation = {
width = 36,
height = 41,
frame_count = 12,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/egg/idle.png",
shift = {0, 0}
-- scale = scale,
}
},
dying_sound = {{filename = "__m-roguef__/sound/larva/die.ogg", volume = 1}},
vision_distance = 50,
movement_speed = 0,
distance_per_frame = 0,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "egg-7-corpse",
-- dying_explosion = "blood-explosion-small",
run_animation = {
width = 36,
height = 41,
frame_count = 12,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/egg/idle.png",
shift = {0, 0}
-- scale = scale,
}
}, {
type = "unit",
name = "egg-7-big",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 60 * 60,
resistances = {{type = "damage-enemy", percent = 100}, {type = "damage-player", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 1,
collision_box = {{-0.3 * 2, -0.3 * 2}, {0.3 * 2, 0.3 * 2}},
selection_box = {{-0.3 * 2, -0.3 * 2}, {0.3 * 2, 0.3 * 2}},
sticker_box = {{-0.3, -0.3}, {0.3, 0.3}},
attack_parameters = {
type = "projectile",
range = 100,
cooldown = 30,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 0, type = "damage-enemy"}}
}
}
},
animation = {
width = 36,
height = 41,
frame_count = 12,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/egg/idle.png",
shift = {0, 0},
scale = 2
}
},
dying_sound = {{filename = "__m-roguef__/sound/larva/die.ogg", volume = 1}},
vision_distance = 50,
movement_speed = 0,
distance_per_frame = 0,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "egg-7-corpse",
-- dying_explosion = "blood-explosion-small",
run_animation = {
width = 36,
height = 41,
frame_count = 12,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/egg/idle.png",
shift = {0, 0},
scale = 2
}
}, {
type = "corpse",
name = "egg-7-corpse",
icon = "__base__/graphics/icons/small-biter-corpse.png",
icon_size = 64,
selection_box = {{-0.8, -0.8}, {0.8, 0.8}},
selectable_in_game = false,
subgroup = "corpses",
order = "c[corpse]-a[biter]-a[small]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"},
dying_speed = 0.03,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = {
width = 70,
height = 60,
frame_count = 12,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/egg/die.png",
shift = {0, 0}
-- scale = scale,
}
}, {
type = "explosion",
name = "ep-7-1",
flags = {"not-on-map", "placeable-off-grid"},
animations = {
{
filename = "__roguef-core__/graphics/explosion/ep-7-1.png",
priority = "extra-high",
width = 29,
height = 38,
frame_count = 11,
shift = {0, 0.3},
animation_speed = 9 / 20,
scale = 2
}
},
created_effect = {
type = "area",
radius = 0.5,
action_delivery = {
type = "instant",
target_effects = {{type = "damage", damage = {amount = 200, type = "damage-enemy"}}}
}
},
sound = {
aggregation = {max_count = 1, remove = false},
variations = {{filename = "__roguef-core__/sound/shot-9.ogg", volume = 0.5}}
}
}, {
type = "smoke-with-trigger",
name = "gas-7",
flags = {"not-on-map"},
show_when_smoke_off = true,
animation = {
filename = "__roguef-core__/graphics/empty.png",
flags = {"compressed"},
priority = "low",
width = 1,
height = 1,
frame_count = 1
},
slow_down_factor = 0,
affected_by_wind = true,
cyclic = true,
duration = 60 * 60 * 60,
fade_away_duration = 1 * 60,
spread_duration = 10
}
})
-- stage 8
data:extend({
{
type = "unit",
name = "boss-8-1",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 12000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.7, -0.5}, {0.7, 0.5}},
selection_box = {{-0.7, -0.5}, {0.7, 0.5}},
sticker_box = {{-0.5, -0.5}, {0.5, 0.5}},
attack_parameters = {
type = "projectile",
range = 1,
cooldown = 60,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {type = "damage", damage = {amount = 200, type = "damage-enemy"}}
}
}
},
sound = {
{filename = "__m-roguef__/sound/diablo/attack1.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/diablo/attack2.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/diablo/attack3.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/diablo/attack4.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/diablo/attack5.ogg", volume = 0.5},
{filename = "__m-roguef__/sound/diablo/attack6.ogg", volume = 0.5}
},
animation = {
width = 288,
height = 237,
frame_count = 16,
direction_count = 8,
stripes = {
{filename = "__m-roguef__/graphics/entity/diablo/attack-1.png", width_in_frames = 6, height_in_frames = 8},
{filename = "__m-roguef__/graphics/entity/diablo/attack-2.png", width_in_frames = 4, height_in_frames = 8},
{filename = "__m-roguef__/graphics/entity/diablo/attack-3.png", width_in_frames = 6, height_in_frames = 8}
},
shift = {0, -2}
-- scale = scale,
}
},
vision_distance = 50,
movement_speed = 0.15,
distance_per_frame = 0.3,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "boss-8-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = {{filename = "__m-roguef__/sound/diablo/death.ogg", volume = 1}},
working_sound = {{filename = "__m-roguef__/sound/diablo/yell.ogg", volume = 1}},
run_animation = {
width = 293,
height = 188,
frame_count = 12,
direction_count = 8,
stripes = {
{filename = "__m-roguef__/graphics/entity/diablo/walk-1.png", width_in_frames = 6, height_in_frames = 8},
{filename = "__m-roguef__/graphics/entity/diablo/walk-2.png", width_in_frames = 6, height_in_frames = 8}
},
shift = {0, -2}
-- scale = scale,
}
}, {
type = "corpse",
name = "boss-8-corpse",
icon = "__base__/graphics/icons/small-biter-corpse.png",
icon_size = 64,
selection_box = {{-0.8, -0.8}, {0.8, 0.8}},
selectable_in_game = false,
subgroup = "corpses",
order = "c[corpse]-a[biter]-a[small]",
flags = {"placeable-neutral", "placeable-off-grid", "building-direction-8-way", "not-repairable", "not-on-map"},
dying_speed = 0.01,
time_before_removed = 15 * 60 * 60,
final_render_layer = "corpse",
animation = {
width = 169,
height = 160,
frame_count = 1,
direction_count = 1,
filename = "__m-roguef__/graphics/entity/diablo/die.png",
shift = {0, -1}
-- scale = scale,
}
}, {
type = "unit",
name = "boss-8-2",
icon = "__base__/graphics/icons/small-biter.png",
icon_size = 64,
flags = {"placeable-player", "placeable-enemy", "placeable-off-grid", "breaths-air"},
max_health = 12000,
resistances = {{type = "damage-enemy", percent = 100}},
order = "a",
subgroup = "rf_enemy",
healing_per_tick = 0,
collision_box = {{-0.7, -0.5}, {0.7, 0.5}},
selection_box = {{-0.7, -0.5}, {0.7, 0.5}},
sticker_box = {{-0.5, -0.5}, {0.5, 0.5}},
attack_parameters = {
type = "projectile",
range = 100,
cooldown = 3,
projectile_creation_distance = 2,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "entity",
action = {
{
type = "direct",
-- repeat_count = 20,
action_delivery = {type = "projectile", projectile = "ep-8-2", starting_speed = 0.7, max_range = 50}
}
}
},
animation = {
width = 266,
height = 256,
frame_count = 1,
direction_count = 8,
stripes = {{filename = "__m-roguef__/graphics/entity/diablo/cast-3.png", width_in_frames = 1, height_in_frames = 8}},
shift = {0, -2}
-- scale = scale,
}
},
vision_distance = 50,
movement_speed = 0.15,
distance_per_frame = 0.3,
pollution_to_join_attack = 0,
distraction_cooldown = 0,
corpse = "boss-8-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = {{filename = "__m-roguef__/sound/diablo/death.ogg", volume = 1}},
working_sound = {{filename = "__m-roguef__/sound/diablo/yell.ogg", volume = 1}},
run_animation = {
width = 293,
height = 188,
frame_count = 12,
direction_count = 8,
stripes = {
{filename = "__m-roguef__/graphics/entity/diablo/walk-1.png", width_in_frames = 6, height_in_frames = 8},
{filename = "__m-roguef__/graphics/entity/diablo/walk-2.png", width_in_frames = 6, height_in_frames = 8}
},
shift = {0, -2}
-- scale = scale,
}
}, {
type = "fire",
name = "blaze-8",
flags = {"placeable-off-grid", "not-on-map"},
duration = 60000,
fade_away_duration = 60000,
spread_duration = 60000,
start_scale = 1,
end_scale = 0.01,
color = {r = 1, g = 0.9, b = 0, a = 0.5},
damage_per_tick = {amount = 2, type = "damage-enemy"},
spread_delay = 300,
spread_delay_deviation = 180,
maximum_spread_count = 100,
initial_lifetime = 60000,
flame_alpha = 0.35,
flame_alpha_deviation = 0.05,
emissions_per_tick = 0.005,
add_fuel_cooldown = 10,
increase_duration_cooldown = 10,
increase_duration_by = 20,
fade_in_duration = 30,
fade_out_duration = 30,
lifetime_increase_by = 20,
lifetime_increase_cooldown = 10,
delay_between_initial_flames = 10,
burnt_patch_lifetime = 0,
pictures = {
{
filename = "__roguef-core__/graphics/explosion/blaze.png",
line_length = 8,
width = 30,
height = 59,
frame_count = 25,
axially_symmetrical = false,
direction_count = 1,
blend_mode = fire_blend_mode,
animation_speed = fire_animation_speed,
scale = fire_scale,
tint = fire_tint,
flags = fire_flags,
shift = {-0.0390625 / 2, -0.90625 / 2}
}
},
light = {intensity = 1, size = 20},
working_sound = {sound = {filename = "__base__/sound/furnace.ogg"}, max_sounds_per_type = 3}
}, {
type = "turret",
name = "worm-normal-8-1",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1500,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 0.01,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}),
-- prepare_range = 25,
preparing_speed = 0.025,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "forward"),
prepared_speed = 0.015,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}),
starting_attack_speed = 0.03,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.8),
ending_attack_speed = 0.03,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "backward"),
folding_speed = 0.015,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 1, b = 1, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 60,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
repeat_count = 20,
action_delivery = {
type = "projectile",
projectile = "ep-50",
starting_speed = 0.3,
starting_speed_deviation = 0.2,
direction_deviation = 0.6,
range_deviation = 0.6,
max_range = 50
}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "turret",
name = "worm-normal-8-2",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1500,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 0.01,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}),
-- prepare_range = 25,
preparing_speed = 0.025,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "forward"),
prepared_speed = 0.015,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}),
starting_attack_speed = 0.03,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.8),
ending_attack_speed = 0.03,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "backward"),
folding_speed = 0.015,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 0, b = 1, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "stream",
range = 50,
cooldown = 60,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "position",
action = {
{type = "direct", repeat_count = 1, action_delivery = {type = "stream", stream = "ep-8-3", max_range = 50}}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "stream",
name = "ep-8-3",
flags = {"not-on-map"},
working_sound_disabled = {{filename = "__base__/sound/fight/electric-beam.ogg", volume = 0.7}},
particle_buffer_size = 65,
particle_spawn_interval = 2,
particle_spawn_timeout = 2,
particle_vertical_acceleration = 0.003,
particle_horizontal_speed = 0.3,
particle_horizontal_speed_deviation = 0.001,
particle_start_alpha = 0.5,
particle_end_alpha = 1,
particle_start_scale = 0.2,
particle_loop_frame_count = 1,
particle_fade_out_threshold = 0.9,
particle_loop_exit_threshold = 0.25,
action = {
{
type = "direct",
action_delivery = {type = "instant", target_effects = {{type = "create-entity", entity_name = "explosion-128"}}}
}, {
type = "area",
radius = 2,
action_delivery = {
type = "instant",
target_effects = {{type = "damage", damage = {amount = 100, type = "damage-enemy"}}}
}
}
},
spine_animation = {
filename = "__roguef-core__/graphics/explosion/ep-6-1.png",
frame_count = 32,
line_length = 8,
width = 64,
height = 64,
priority = "high",
blend_mode = "additive",
animation_speed = 64 / 60
},
shadow = {
filename = "__0_16_graphics_revived__/graphics/entity/acid-projectile-purple/acid-projectile-purple-shadow.png",
line_length = 5,
width = 28,
height = 16,
frame_count = 33,
priority = "high",
scale = 1.5,
shift = {-0.09 * 1.5, 0.395 * 1.5}
}
}, {
type = "turret",
name = "worm-normal-8-3",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1500,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 1,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}),
-- prepare_range = 25,
preparing_speed = 1,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "forward"),
prepared_speed = 1,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}),
starting_attack_speed = 1,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.1),
ending_attack_speed = 0.1,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "backward"),
folding_speed = 1,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 1, g = 0, b = 0, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 12,
projectile_creation_distance = 2,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "direction",
action = {
{
type = "direct",
-- repeat_count = 20,
action_delivery = {type = "projectile", projectile = "ep-50", starting_speed = 0.2, max_range = 50}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "turret",
name = "worm-normal-8-4",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1500,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 1,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 0, g = 0, b = 0, a = 1}),
-- prepare_range = 25,
preparing_speed = 1,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 0, b = 0, a = 1}, "forward"),
prepared_speed = 1,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 0, g = 0, b = 0, a = 1}),
starting_attack_speed = 1,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 0, b = 0, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.1),
ending_attack_speed = 0.1,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 0, b = 0, a = 1}, "backward"),
folding_speed = 1,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 0, b = 0, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 120,
projectile_creation_distance = 0,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "position",
action = {
{
type = "direct",
action_delivery = {type = "instant", source_effects = {{type = "create-entity", entity_name = "ep-8-1"}}}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "projectile",
name = "ep-8-1",
flags = {"not-on-map", "placeable-off-grid"},
collision_box = {{-0.5, -0.5}, {0.5, 0.5}},
acceleration = 0,
direction_only = true,
action = {
{
type = "cluster",
cluster_count = 40,
distance = 4,
distance_deviation = 3,
action_delivery = {
type = "projectile",
projectile = "ep-50",
direction_deviation = 0.6,
starting_speed = 0.05,
starting_speed_deviation = 0.04,
max_range = 50
}
}
},
animation = {
filename = "__roguef-core__/graphics/explosion/p-7.png",
frame_count = 1,
width = 19,
height = 18,
priority = "high",
blend_mode = "additive"
-- animation_speed = 30/60
}
}, {
type = "turret",
name = "worm-normal-8-5",
icon = "__base__/graphics/icons/medium-worm.png",
icon_size = 32,
flags = {"placeable-player", "placeable-enemy", "not-repairable", "breaths-air"},
order = "b-b-e",
subgroup = "enemies",
max_health = 1500,
resistances = {{type = "damage-enemy", percent = 100}},
healing_per_tick = 0,
collision_box = {{-1.1, -1.0}, {1.1, 1.0}},
selection_box = {{-1.1, -1.0}, {1.1, 1.0}},
shooting_cursor_size = 3.5,
rotation_speed = 1,
corpse = "medium-worm-corpse",
dying_explosion = "blood-explosion-big",
dying_sound = make_worm_dying_sounds(0.9),
folded_speed = 1,
folded_animation = worm_folded_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}),
-- prepare_range = 25,
preparing_speed = 1,
preparing_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "forward"),
prepared_speed = 1,
prepared_animation = worm_prepared_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}),
starting_attack_speed = 1,
starting_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "forward"),
starting_attack_sound = make_worm_roars(0.1),
ending_attack_speed = 0.1,
ending_attack_animation = worm_attack_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "backward"),
folding_speed = 1,
folding_animation = worm_preparing_animation(medium_worm_scale, {r = 0, g = 1, b = 0, a = 1}, "backward"),
prepare_range = 50,
attack_parameters = {
type = "projectile",
range = 50,
cooldown = 60,
projectile_creation_distance = 3,
ammo_category = "ammo-enemy",
ammo_type = {
category = "ammo-enemy",
target_type = "position",
action = {
{
type = "direct",
action_delivery = {type = "instant", source_effects = {{type = "create-entity", entity_name = "biter-mini-1"}}}
}
}
}
},
build_base_evolution_requirement = 0.3,
call_for_help_radius = 40
}, {
type = "projectile",
name = "ep-8-2",
flags = {"not-on-map"},
collision_box = {{-0.3, -0.3}, {0.3, 0.3}},
acceleration = 0,
action = {
type = "direct",
action_delivery = {
type = "instant",
target_effects = {
{type = "create-entity", entity_name = "target-elec"},
{type = "damage", damage = {amount = 30, type = "damage-enemy"}}
}
}
},
animation = {
filename = "__roguef-core__/graphics/explosion/ep-8-2.png",
frame_count = 1,
width = 128,
height = 117,
priority = "high",
blend_mode = "additive"
}
}, {
type = "explosion",
name = "explosion-8",
flags = {"not-on-map", "placeable-off-grid"},
animations = {
{
filename = "__roguef-core__/graphics/explosion/ep-7-1.png", -- fast-fix \/
priority = "extra-high",
width = 29,
height = 38,
frame_count = 11,
shift = {0, 0.3},
animation_speed = 9 / 20,
scale = 2
}
-- {
-- filename = "__roguef-core__/graphics/explosion/explosion.png", -- TODO: FIX THIS
-- priority = "extra-high",
-- width = 40,
-- height = 40,
-- shift={0,1},
-- frame_count = 12,
-- animation_speed = 24/60,
-- scale=4
-- }
},
sound = {
aggregation = {max_count = 1, remove = true},
variations = {
{
filename = "__base__/sound/fight/medium-explosion-1.ogg", -- TODO: change this
volume = 0.5
}, {
filename = "__base__/sound/fight/medium-explosion-2.ogg", -- TODO: change this
volume = 0.5
}
}
},
created_effect = {
type = "area",
radius = 2,
action_delivery = {
type = "instant",
target_effects = {{type = "damage", damage = {amount = 100, type = "damage-enemy"}}}
}
}
}
})
-- stage 9
data:extend({
{
type = "simple-entity",
name = "tomas",
flags = {"placeable-neutral", "not-on-map", "placeable-off-grid"},
icon = "__m-roguef__/graphics/entity/tomas.png",
icon_size = 32,
subgroup = "rf_raw",
order = "b",
max_health = 10000,
resistances = {{type = "damage-enemy", percent = 100}},
dying_explosion = "massive-explosion",
render_layer = "object",
collision_box = {{-4.5 / 2, -6.23 / 2}, {4.5 / 2, 6.23 / 2}},
selection_box = {{-4.5 / 2, -6.23 / 2}, {4.5 / 2, 6.23 / 2}},
selectable_in_game = true,
pictures = {
{
filename = "__m-roguef__/graphics/entity/tomas.png",
priority = "extra-high",
width = 287,
height = 399,
scale = 1 / 2
}
}
}
})
|
local a,b,c;local d,e,f,g,h,i,j;local k,l,m,n,o,p,q,r,s;local t,u,v,w,x,y,z,A,B;local C,D;if game then local E=script.Parent;q=require(E.lulpeg.lulpeg)else q=require("lpeg")end;do do local F;local G={AddChild=function(self,H)H:SetIndent(tostring(self._indent).." ")return table.insert(self._children,H)end,SetIndent=function(self,I)self._indent=I;local J=self._children;for K=1,#J do local H=J[K]H:SetIndent(tostring(self._indent).." ")end end,BeforeRender=function(self)end,AfterRender=function(self)end,Render=function(self)local L=""L=L..self:BeforeRender()L=L.."\n"local J=self._children;for K=1,#J do local H=J[K]L=L..H:Render()if H.__class.__name~="SpaceBlock"or H.__class.__name=="SpaceBlock"and#H._children>0 then L=L.."\n"end end;return L..self:AfterRender()end}G.__index=G;F=setmetatable({__init=function(self)self._indent=""self._children={}end,__base=G,__name="Block"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;a=F end end;do do local F;local O=a;local G={SetIndent=function(self,I)self._indent=I;self._topBlock:SetIndent(tostring(I).." ")return self._bottomBlock:SetIndent(tostring(I).." ")end,AddChild=function(self,P,H)if P==self.__class.TOP then return self._topBlock:AddChild(H)elseif P==self.__class.BOTTOM then return self._bottomBlock:AddChild(H)end end,MiddleRender=function(self)end,Render=function(self)local L=""L=L..self:BeforeRender()L=L.."\n"L=L..self._topBlock:Render()L=L.."\n"L=L..self:MiddleRender()L=L.."\n"L=L..self._bottomBlock:Render()L=L.."\n"return L..self:AfterRender()end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self)F.__parent.__init(self)self._topBlock=w()self._bottomBlock=w()table.insert(self._children,self._topBlock)return table.insert(self._children,self._bottomBlock)end,__base=G,__name="DoubleBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;local self=F;self.TOP="top"self.BOTTOM="bottom"if O.__inherited then O.__inherited(O,F)end;b=F end end;do local T=1;do local F;local G={SetParent=function(self,S)self._parent=S;if S then self._robloxObject.Parent=S:GetRobloxObject()end end,GetRobloxObject=function(self)return self._robloxObject end,ObjectName=function(self)return self._robloxObject.ClassName end,Refresh=function(self)for Q,U in pairs(self._properties)do local V=self._propertyFilters[Q]if V then V(U,self._robloxObject)else self._robloxObject[Q]=U end end end,StyleObject=function(self,W)for Q,U in pairs(W)do local V=self._propertyFilters[Q]if V then V(U,self._robloxObject)else self._robloxObject[Q]=U end end end,AddChild=function(self,H)if self:AllowsChildren()then H:SetParent(self)self._children[H:GetId()]=H;return H else return error("RomlObject '"..tostring(self.__class.__name).."' does not allow children objects.")end end,SetProperties=function(self,W)for Q,X in pairs(W)do self._properties[Q]=X end end,SetClasses=function(self,Y)self._classes=Y end,RemoveAllChildren=function(self)for Z,H in self._children:pairs()do self._romlDoc:RemoveChild(H)H:RemoveAllChildren()H._robloxObject:Destroy()end;self._children={}end,GetId=function(self)return self._id end,GetObjectId=function(self)return self._objectId end,GetClasses=function(self)return self._classes end,RemoveChild=function(self,H)H:SetParent(nil)self._children[H:GetId()]=nil end,HasClass=function(self,_)local J=self._classes;for K=1,#J do local Q=J[K]if Q==_ then return true end end;return false end,MatchesSelector=function(self,a0)local a1=a0:Pop()local a2=false;if a1.object~=nil then a2=a1.object==self:ObjectName()if a1.class~=nil then a2=a2 and self:HasClass(a1.class)elseif a1.id~=nil then a2=a2 and a1.id==self._objectId end else if a1.class~=nil then a2=self:HasClass(a1.class)else a2=a1.id==self._objectId end end;if a2 then if not a0:IsEmpty()then return self._parent:MatchesSelector(a0)else return true end else return false end end,AllowsChildren=function(self)return true end,Find=function(self,a1)end}G.__index=G;F=setmetatable({__init=function(self,a3,a4,a5,Y)if Y==nil then Y={}end;self._romlDoc=a3;self._id=T;T=T+1;self._properties={}self._propertyFilters={}self._objectId=a5;if type(a4)=="string"then a4=Instance.new(a4)end;self._robloxObject=a4;self._classes=Y;self._children=k({})end,__base=G,__name="RomlObject"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;c=F end end;do do local F;local O=a;local G={Render=function(self)local L=""L=L..self:BeforeRender()L=L.."\n"for a6,H in ipairs(self._children)do L=L..H:Render()if not(a6==#self._children)then L=L..","end;L=L.."\n"end;return L..self:AfterRender()end,BeforeRender=function(self)return tostring(self._indent).."{"end,AfterRender=function(self)return tostring(self._indent).."}"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self)return F.__parent.__init(self)end,__base=G,__name="AnonymousTableBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;d=F end end;do local a7;a7=function(a8,a9)return a8<=a9 end;local aa;aa=function(a8,a9)return a8>=a9 end;local ab;ab=function(ac,ad)for a6=2,#ac do local ae=ac[a6]local af=a6;while af>1 and not ad(ac[af-1],ae)do ac[af]=ac[af-1]af=af-1 end;ac[af]=ae end;return ac end;local ag;ag=function(a8,a9,ad)local ah={}while#a8~=0 and#a9~=0 do if ad(a8[1],a9[1])then table.insert(ah,a8[1])table.remove(a8,1)else table.insert(ah,a9[1])table.remove(a9,1)end end;while#a8~=0 do table.insert(ah,a8[1])table.remove(a8,1)end;while#a9~=0 do table.insert(ah,a9[1])table.remove(a9,1)end;return ah end;local ai={Ascending=0,Descending=1}local aj;aj=function(ac,ad)if ad==nil then ad=ai.Ascending end;if ad==ai.Ascending then ad=a7 elseif ad==ai.Descending then ad=aa end;if#ac<=32 then return ab(ac,ad)else local a8={}local a9={}for a6,ak in ipairs(ac)do if a6%2==0 then table.insert(a9,ak)else table.insert(a8,ak)end end;a8=aj(a8,ad)a9=aj(a9,ad)return ag(a8,a9,ad)end end;local al;al=function(ac)for a6=1,math.floor(#ac/2)do local am=ac[a6]ac[a6]=ac[#ac-(a6-1)]ac[#ac-(a6-1)]=am end end;e={ComparisonOrder=ai,Reverse=al,StableSort=aj}end;do local an,ao,ap,aq;an,ao,ap,aq=q.C,q.Ct,q.P,q.R;local ar=aq("09")local as=ap(" ")^0;local at=as*(ap("-")^-1*ar^0*"."*ar^1+ap("-")^-1*ar^1)/tonumber*as;local au=at*","*at;local av=au*","*at;local aw=av*","*at;local ax=ao(aw+au)*-1;local ay=ao(av+at)*-1;local az=ao(au)*-1;local aA=an(aq("AZ")*(aq("AZ")+aq("az")+" "+".")^1)*-1;local aB=an(aq("AZ")*(aq("AZ")+aq("az")+aq("09"))^1)*-1;local aC;aC=function(_)return _=="Frame"or _=="ImageButton"or _=="TextButton"or _=="ImageLabel"or _=="TextLabel"or _=="Scale9Frame"or _=="ScrollingFrame"or _=="TextBox"end;local aD;aD=function(X)do local aE=ax:match(X)if aE then if#aE==2 then return p("UDim2.new(0, "..tostring(aE[1])..", 0, "..tostring(aE[2])..")")elseif#aE==4 then return p("UDim2.new("..tostring(aE[1])..", "..tostring(aE[2])..", "..tostring(aE[3])..", "..tostring(aE[4])..")")end else return p(X)end end end;local aF;aF=function(X)do local aE=az:match(X)if aE then return p("Vector2.new("..tostring(aE[1])..", "..tostring(aE[2])..")")else return p(X)end end end;local aG;aG=function(X)do local aE=ay:match(X)if aE then if#aE==1 then return p("Vector3.new("..tostring(aE[1])..", "..tostring(aE[1])..", "..tostring(aE[1])..")")elseif#aE==3 then return p("Vector3.new("..tostring(aE[1])..", "..tostring(aE[2])..", "..tostring(aE[3])..")")end else return p(X)end end end;local aH;aH=function(_,X)if aC(_)then return aD(X)else return aG(X)end end;local aI;aI=function(_,X)do local aE=ay:match(X)if aE then if#aE==1 then return p("BrickColor.new("..tostring(aE[1])..")")elseif#aE==3 then return p("BrickColor.new("..tostring(aE[1]/255)..", "..tostring(aE[2]/255)..", "..tostring(aE[3]/255)..")")end else do aE=aA:match(X)if aE then return p("BrickColor.new(\""..tostring(X).."\")")else return p(X)end end end end end;local aJ;aJ=function(_,X)do local aE=ay:match(X)if aE then if#aE==1 then return p("BrickColor.new("..tostring(aE[1])..").Color")elseif#aE==3 then return p("Color3.new("..tostring(aE[1]/255)..", "..tostring(aE[2]/255)..", "..tostring(aE[3]/255)..")")end else do aE=aA:match(X)if aE then return p("BrickColor.new(\""..tostring(X).."\").Color")else return p(X)end end end end end;local aK;aK=function(aL)return function(_,X)do local aE=aB:match(X)if aE then return p("Enum."..tostring(aL).."."..tostring(X))else return p(X)end end end end;local aM;aM=function(_,X)local aN=_;if"ImageButton"==aN or"TextButton"==aN then return aK("ButtonStyle")(_,X)elseif"Frame"==aN then return aK("FrameStyle")(_,X)elseif"Handles"==aN then return aK("HandlesStyle")(_,X)elseif"TrussPart"==aN then return aK("Style")(_,X)else return p(X)end end;local aO={AnimationPriority=aK("AnimationPriority"),BackgroundColor3=aJ,BackSurface=aK("SurfaceType"),BackSurfaceInput=aK("InputType"),BinType=aK("BinType"),BodyPart=aK("BodyPart"),BorderColor3=aJ,BottomSurface=aK("SurfaceType"),BottomSurfaceInput=aK("InputType"),BrickColor=aI,CameraMode=aK("CameraMode"),CameraType=aK("CameraType"),Color=aJ,DisplayDistanceType=aK("HumanoidDisplayDistanceType"),ExplosionType=aK("ExplosionType"),Face=aK("NormalId"),FaceId=aK("NormalId"),Font=aK("Font"),FontSize=aK("FontSize"),FormFactor=aK("FormFactor"),FrontSurface=aK("SurfaceType"),FrontSurfaceInput=aK("InputType"),InOut=aK("InOut"),LeftRight=aK("LeftRight"),LeftSurface=aK("SurfaceType"),LeftSurfaceInput=aK("InputType"),Material=aK("Material"),MeshType=aK("MeshType"),NameOcclusion=aK("NameOcclusion"),Position=aH,Purpose=aK("DialogPurpose"),RightSurface=aK("SurfaceType"),RightSurfaceInput=aK("InputType"),SecondaryColor=aJ,Shape=aK("PartType"),Size=aH,SizeConstraint=aK("SizeConstraint"),SparkleColor=aJ,Style=aM,TextXAlignment=aK("TextXAlignment"),TextYAlignment=aK("TextYAlignment"),Tone=aK("DialogTone"),TargetSurface=aK("NormalId"),TextColor3=aJ,TextStrokeColor3=aJ,TopBottom=aK("TopBottom"),TopSurface=aK("SurfaceType"),TopSurfaceInput=aK("InputType")}local aP;aP=function(_,aQ,aR)do local V=aO[aQ]if V then return V(_,aR)else return p(aR)end end end;f={BrickColorFilter=aI,Color3Filter=aJ,EnumFilter=aK,FilterProperty=aP,PositionAndSizeFilter=aH,StyleEnumFilter=aM,UDim2Filter=aD,Vector2Filter=aF,Vector3Filter=aG}end;do do local F;local O=c;local G={ObjectName=function(self)return self.__class.__name end,Create=function(self)end,CreateProperties=function(self)return{}end,PropertyUpdateOrder=function(self)return{}end,UpdateProperty=function(self,aS,Q,X)end,Refresh=function(self)local aT=self:PropertyUpdateOrder()if#aT>0 then for K=1,#aT do local Q=aT[K]if self._properties[Q]~=nil then self:UpdateProperty(self._robloxObject,Q,self._properties[Q])end end else for Q,U in pairs(self._properties)do self:UpdateProperty(self._robloxObject,Q,U)end end end,StyleObject=function(self,W)local aT=self:PropertyUpdateOrder()if#aT>0 then for K=1,#aT do local Q=aT[K]if W[Q]~=nil then self:UpdateProperty(self._robloxObject,Q,W[Q])end end else for Q,U in pairs(W)do self:UpdateProperty(self._robloxObject,Q,U)end end end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,a3,a5,Y)F.__parent.__init(self,a3,self:Create(),a5,Y)return self:SetProperties(self:CreateProperties())end,__base=G,__name="CustomObject",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;g=F end end;do local aU;do local F;local G={Build=function(self,Q,aV)local aW={}aW.FilterProperty=aV.FilterProperty or function(Q,X,p,f)return p(X)end;do local aX;local O=g;local aY={Create=aV.Create,UpdateProperty=aV.UpdateProperty}aY.__index=aY;setmetatable(aY,O.__base)aX=setmetatable({__init=function(self,a3,a5,Y)self.__class.__name=Q;if aV.CreateProperties then self.CreateProperties=aV.CreateProperties end;if aV.AllowsChildren then self.AllowsChildren=aV.AllowsChildren end;if aV.PropertyUpdateOrder then self.PropertyUpdateOrder=aV.PropertyUpdateOrder end;return aX.__parent.__init(self,a3,a5,Y)end,__base=aY,__name="customObject",__parent=O},{__index=function(M,Q)local R=rawget(aY,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},aY)M.__init(N,...)return N end})aY.__class=aX;if O.__inherited then O.__inherited(O,aX)end;aW.customObject=aX end;self._customObjects[Q]=aW end,HasObject=function(self,Q)return self._customObjects[Q]~=nil end,GetObject=function(self,Q)return self._customObjects[Q].customObject end,FilterProperty=function(self,aZ,aQ,X,p,f)return self._customObjects[aZ].FilterProperty(aQ,X,p,f)end}G.__index=G;F=setmetatable({__init=function(self)self._customObjects={}self:Build("SpriteSheet",x)if game then local J=game:GetService("ServerScriptService").com.blacksheepherd.customobject.user:GetChildren()for K=1,#J do local a_=J[K]self:Build(a_.name,require(a_))end end end,__base=G,__name="CustomObjectBuilderSingleton"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;local self=F;self.Instance=function()if not self.__class._instance then self.__class._instance=aU()end;return self.__class._instance end;aU=F end;local b0;b0=function(Q)return aU.Instance():HasObject(Q)end;local b1;b1=function(Q,a3,a5,Y)return aU.Instance():GetObject(Q)(a3,a5,Y)end;local aP;aP=function(aZ,aQ,X,p,f)return aU.Instance():FilterProperty(aZ,aQ,X,p,f)end;h={CreateObject=b1,FilterProperty=aP,IsACustomObject=b0}end;do do local F;local O=a;local G={BeforeRender=function(self)return tostring(self._indent).."do"end,AfterRender=function(self)return tostring(self._indent).."end"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,...)return F.__parent.__init(self,...)end,__base=G,__name="DoBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;i=F end end;do do local F;local O=a;local G={BeforeRender=function(self)return tostring(self._indent)..tostring(self._name).." = function("..tostring(self._parameters)..")"end,AfterRender=function(self)return tostring(self._indent).."end"end,AddLineIfNotAdded=function(self,b2)if not self._addedLines[b2]then self._addedLines[b2]=true;return self:AddChild(o(b2))end end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,Q,b3)F.__parent.__init(self)self._name=Q;self._parameters=b3;self._addedLines={}end,__base=G,__name="FunctionBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;j=F end end;do do local F;local G={pairs=function(self)return pairs(self._t)end,Length=function(self)return self:__len()end,__newindex=function(self,b4,X)if self._t[b4]==nil then self._length=self._length+1 elseif X==nil then self._length=self._length-1 end;self._t[b4]=X end,__len=function(self)return self._length end}G.__index=G;F=setmetatable({__init=function(self,aV)rawset(self,"_t",{})rawset(self,"_length",0)for b4,X in pairs(aV)do self[b4]=X end;local b5=getmetatable(self)local b6=b5.__index;b5.__index=function(self,b4)do local X=rawget(rawget(self,"_t"),b4)if X then return X else if type(b6)=="function"then return b6(self,b4)else return b6[b4]end end end end end,__base=G,__name="HashMap"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;k=F end end;do do local F;local O=a;local G={BeforeRender=function(self)return tostring(self._indent).."if "..tostring(self._condition).." then"end,AfterRender=function(self)return tostring(self._indent).."end"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,b7)F.__parent.__init(self)self._condition=b7 end,__base=G,__name="IfBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;l=F end end;do do local F;local O=b;local G={BeforeRender=function(self)return tostring(self._indent).."if "..tostring(self._condition).." then"end,MiddleRender=function(self)return tostring(self._indent).."else"end,AfterRender=function(self)return tostring(self._indent).."end"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,b7)F.__parent.__init(self)self._condition=b7 end,__base=G,__name="IfElseBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;m=F end end;do do local F;local O=a;local G={AddChild=function(self,H)H:SetIndent(self._indent)return table.insert(self._children,H)end,SetIndent=function(self,I)F.__parent.__base.SetIndent(self,I)local J=self._children;for K=1,#J do local H=J[K]H:SetIndent(I)end end,Render=function(self)local L=""for a6,H in ipairs(self._children)do L=L..H:Render()if not(a6==#self._children)then L=L..",\n"end end;return L end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,...)return F.__parent.__init(self,...)end,__base=G,__name="InnerMetatableBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;n=F end end;do do local F;local G={SetIndent=function(self,I)self._indent=I end,Render=function(self)return tostring(self._indent)..tostring(self._text)end}G.__index=G;F=setmetatable({__init=function(self,b8)self._indent=""self._text=b8 end,__base=G,__name="Line"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;o=F end end;do do local F;local G={__tostring=function(self)return self._string end}G.__index=G;F=setmetatable({__init=function(self,b9)self._string=b9 end,__base=G,__name="LiteralString"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;p=F end end;do do local F;local G={AddObjectSelector=function(self,b4,ba)if self._objects[b4]==nil then self._objects[b4]=C("objects",b4)self._objectsBlock:AddChild(self._objects[b4])end;return self._objects[b4]:AddChild(ba)end,AddClassSelector=function(self,b4,bb)if self._classes[b4]==nil then self._classes[b4]=C("classes",b4)self._classesBlock:AddChild(self._classes[b4])end;return self._classes[b4]:AddChild(bb)end,AddIdSelector=function(self,b4,bc)if self._ids[b4]==nil then self._ids[b4]=C("ids",b4)self._idsBlock:AddChild(self._ids[b4])end;return self._ids[b4]:AddChild(bc)end,Render=function(self)local L=""local J=self._children;for K=1,#J do local H=J[K]L=L..H:Render()if H.__class.__name~="SpaceBlock"or H.__class.__name=="SpaceBlock"and#H._children>0 then L=L.."\n"end end;return L end}G.__index=G;F=setmetatable({__init=function(self,Q)self._children={}self._objects={}self._classes={}self._ids={}table.insert(self._children,t("com.blacksheepherd.ross","RossDoc"))table.insert(self._children,t("com.blacksheepherd.datastructure","Stack"))table.insert(self._children,o("local "..tostring(Q)))local bd=i()bd:AddChild(o("local _parent_0 = RossDoc"))local be=D("_base_0")local bf=j("_setupObjects","self")bf:AddChild(o("local objects = {}"))self._objectsBlock=w()bf:AddChild(self._objectsBlock)bf:AddChild(o("return objects"))be:AddChild(bf)local bg=j("_setupClasses","self")bg:AddChild(o("local classes = {}"))self._classesBlock=w()bg:AddChild(self._classesBlock)bg:AddChild(o("return classes"))be:AddChild(bg)local bh=j("_setupIds","self")bh:AddChild(o("local ids = {}"))self._idsBlock=w()bh:AddChild(self._idsBlock)bh:AddChild(o("return ids"))be:AddChild(bh)bd:AddChild(be)bd:AddChild(o("_base_0.__index = _base_0"))bd:AddChild(o("setmetatable(_base_0, _parent_0.__base)"))local bi=s("_class_0")local bj=j("__init","self")bj:AddChild(o("return _parent_0.__init(self)"))bi:AddChild(b.TOP,bj)bi:AddChild(b.TOP,o("__base = _base_0"))bi:AddChild(b.TOP,o("__name = \""..tostring(Q).."\""))bi:AddChild(b.TOP,o("__parent = _parent_0"))local bk=j("__index","cls, name")bk:AddChild(o("local val = rawget(_base_0, name)"))local bl=m("val == nil")bl:AddChild(b.TOP,o("return _parent_0[name]"))bl:AddChild(b.BOTTOM,o("return val"))bk:AddChild(bl)bi:AddChild(b.BOTTOM,bk)local bm=j("__call","cls, ...")bm:AddChild(o("local _self_0 = setmetatable({}, _base_0)"))bm:AddChild(o("cls.__init(_self_0, ...)"))bm:AddChild(o("return _self_0"))bi:AddChild(b.BOTTOM,bm)bd:AddChild(bi)bd:AddChild(o("_base_0.__class = _class_0"))bd:AddChild(o("local self = _class_0"))local bn=j("self.new","")bn:AddChild(o("return "..tostring(Q).."()"))bd:AddChild(bn)local bo=l("_parent_0.__inherited")bo:AddChild(o("_parent_0.__inherited(_parent_0, _class_0)"))bd:AddChild(bo)bd:AddChild(o(tostring(Q).." = _class_0"))table.insert(self._children,bd)return table.insert(self._children,o("return "..tostring(Q)))end,__base=G,__name="MainRossBlock"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;r=F end end;do do local F;local O=b;local G={BeforeRender=function(self)return tostring(self._indent).."local "..tostring(self._name).." = setmetatable({"end,MiddleRender=function(self)return tostring(self._indent).."}, {"end,AfterRender=function(self)return tostring(self._indent).."})"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,Q)F.__parent.__init(self)self._name=Q;self._topBlock=n()self._bottomBlock=n()end,__base=G,__name="MetatableBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;s=F end end;do do local F;local O=o;local G={}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,bp,Q)return F.__parent.__init(self,"local "..tostring(Q).." = require(game:GetService(\"ServerScriptService\")."..tostring(bp).."."..tostring(Q)..")")end,__base=G,__name="RequireLine",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;t=F end end;do local bq;local br;br=function(P)local bs=0;local bt=0;local bu=0;local J=P.selectorStack;for K=1,#J do local a1=J[K]if not(a1["object"]==nil)then bs=bs+1 end;if a1["class"]~=nil then bt=bt+1 elseif a1["id"]~=nil then bu=bu+1 end end;P.specificity=bu*2^16+bt*2^8+bs end;local bv;bv=function(P)local bw=d()local bx=z("selector")local by=P.selectorStack[#P.selectorStack]local J=P.selectorStack;for K=1,#J do local a1=J[K]local bz=d()if a1.object~=nil then bz:AddChild(o("object = \""..tostring(a1.object).."\""))end;if a1.class~=nil then bz:AddChild(o("class = \""..tostring(a1.class).."\""))elseif a1.id~=nil then bz:AddChild(o("id = \""..tostring(a1.id).."\""))end;bx:AddChild(bz)end;local bA=""local _=""if by.object~=nil then bA=by.object;_=by.object end;bw:AddChild(bx)if P.properties then for Q,X in P.properties:pairs()do if h.IsACustomObject(_)then P.properties[Q]=h.FilterProperty(_,Q,X,p,f)else P.properties[Q]=f.FilterProperty(_,Q,X)end end;bw:AddChild(o("properties = "..tostring(B.HashMapToSingleLineString(P.properties))))else bw:AddChild(o("properties = {}"))end;if by.class~=nil then bA=bA.."."..tostring(by.class)return bq:AddClassSelector(bA,bw)elseif by.id~=nil then bA=bA.."#"..tostring(by.id)return bq:AddIdSelector(bA,bw)else return bq:AddObjectSelector(bA,bw)end end;local bB;bB=function(bC)if bC then bC=e.StableSort(bC,function(a8,a9)if a8.specificity==nil then br(a8)end;if a9.specificity==nil then br(a9)end;return a8.specificity>=a9.specificity end)for K=1,#bC do local bD=bC[K]bv(bD)end end end;local bE;bE=function(Q,bF)bq=r(Q)bB(bF)return bq:Render()end;u={Compile=bE}end;do local an,bG,bH,bI,ao,bJ,ap,aq,bK,bL;an,bG,bH,bI,ao,bJ,ap,aq,bK,bL=q.C,q.Cc,q.Cf,q.Cs,q.Ct,q.Cmt,q.P,q.R,q.S,q.V;local bM;if game then bM=q.L end;local bN;local bO=ap("\r")^-1*ap("\n")local bP=aq("AZ")local bQ=aq("az")local bR=aq("09")local bS=bK("\t ")^0;local bT=bK("\r\n\t ")^0;local bU=bS*(bO^1+-1)local bV=ap("_")+bP+bQ;local bW=(bV+bR)^0;local bX=bV*bW;local bY;bY=function(bZ)local b_=0;for c0 in bZ:gmatch(".")do b_=b_+(function()if c0=="\t"then return 4 else return 1 end end)()end;return b_ end;local c1;c1=function()return true,k({})end;local c2;c2=function(W,c3)local b4,X=unpack(c3)W[b4]=X;return W end;local c4;c4=function(c5)return c5/function(aZ,c6,c7)local aV={}aV["object"]=aZ;if c6 then aV[c6]=c7 end;return aV end end;local c8;c8=function(c5)return c5/function(a0,W)if W.__class==nil then W=nil end;return{selectorStack=a0,properties=W}end end;c2=function(W,c3)local b4,X=unpack(c3)W[b4]=X;return W end;local c9;c9=function(ca,cb,bZ)local b_=bY(bZ)local cc=bN:Peek()if b_>cc then bN:Push(b_)return true end end;local cd;cd=function(ca,cb,bZ)local b_=bY(bZ)local cc=bN:Peek()return b_==cc end;local ce;ce=function(ca,cb,bZ)bN:Pop()return true end;local cf={"RoSS",Indent=#bJ(bS,c9),CheckIndent=bJ(bS,cd),Dedent=bJ("",ce),SingleString=ap('"')*(ap("\\\"")+1-ap('"'))^0*ap('"'),DoubleString=ap("'")*(ap("\\'")+1-ap("'"))^0*ap("'"),String=an(bL("SingleString")+bL("DoubleString")),Id=ap("#")*an(bX),Class=ap(".")*an(bX),PropertyKey=an(bP*(bP+bQ+bR)^0),PropertyValue=bL("String")+an((bK("\t ")^0*(1-bK(":\r\n\t ")))^0),RossPropertyPair=ao(bS*bL("PropertyKey")*bS*ap(":")*bS*bL("PropertyValue")*bS),PropertyLine=bL("CheckIndent")*bL("RossPropertyPair")*bU,PropertyLines=bH(bJ("",c1)*bL("PropertyLine")^1,c2),ObjectName=an(bP*(bP+bQ)^0),ObjectOnlySelector=bL("ObjectName")*bG(nil),ClassOrIdSelector=bG("id")*bL("Id")+bG("class")*bL("Class"),NoObjectSelector=bG(nil)*bL("ClassOrIdSelector"),FullSelector=bL("ObjectName")*bL("ClassOrIdSelector"),Selector=c4((bL("FullSelector")+bL("ObjectOnlySelector")+bL("NoObjectSelector"))*bS),RoSSHeader=bL("CheckIndent")*ao(bL("Selector")^1)*bU,RoSSBody=bL("Indent")*(bL("PropertyLines")+bG(nil))*bL("Dedent")+bG({}),RoSSBlock=c8(bL("RoSSHeader")*bL("RoSSBody")),RossDocBlock=bL("RoSSBlock"),RoSS=ao(bL("RoSSBlock")^0)}if game then cf.Indent=bM(bJ(bS,c9))end;local cg=ap(cf)local ch;ch=function(ci)bN=nil;bN=y()bN:Push(0)return cg:match(ci)end;v={Parse=ch}end;do do local F;local O=a;local G={AddChild=function(self,H)H:SetIndent(self._indent)return table.insert(self._children,H)end,SetIndent=function(self,I)F.__parent.__base.SetIndent(self,I)local J=self._children;for K=1,#J do local H=J[K]H:SetIndent(I)end end,Render=function(self)local L=""for a6,H in ipairs(self._children)do L=L..H:Render()if a6<#self._children and(H.__class.__name~="SpaceBlock"or H.__class.__name=="SpaceBlock"and#H._children>0)then L=L.."\n"end end;return L end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,...)return F.__parent.__init(self,...)end,__base=G,__name="SpaceBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;w=F end end;do x={Create=function(self)local cj=Instance.new("Frame")cj.ClipsDescendants=true;cj.Name="SpriteSheetFrame"cj.BackgroundTransparency=1;cj.BorderSizePixel=0;local ck=Instance.new("ImageLabel",cj)ck.Name="SpriteSheet"ck.Size=UDim2.new(0,256,0,256)ck.BackgroundTransparency=1;ck.BorderSizePixel=0;return cj end,CreateProperties=function(self)return{}end,PropertyUpdateOrder=function(self)return{"Name","Position","SpriteSheet","Size","Index"}end,FilterProperty=function(Q,X,p,f)local aN=Q;if"Position"==aN then return f.UDim2Filter(X)elseif"Size"==aN then return f.Vector2Filter(X)else return p(X)end end,UpdateProperty=function(self,cj,Q,X)local aN=Q;if"Name"==aN then cj.Name=X elseif"Position"==aN then cj.Position=X elseif"SpriteSheet"==aN then cj:FindFirstChild("SpriteSheet").Image=X elseif"Size"==aN then cj.Size=UDim2.new(0,X.x,0,X.y)elseif"Index"==aN then local cl=math.floor(256/cj.Size.X.Offset)local ae=X%cl;local cm=math.floor(X/cl)cj:FindFirstChild("SpriteSheet").Position=UDim2.new(0,-ae*cj.Size.X.Offset,0,-cm*cj.Size.Y.Offset)end end,AllowsChildren=function(self)return false end}end;do do local F;local G={Push=function(self,ak)return table.insert(self,ak)end,Pop=function(self)return table.remove(self)end,Peek=function(self)return self[#self]end,IsEmpty=function(self)return#self==0 end,Clone=function(self)return y(self)end}G.__index=G;F=setmetatable({__init=function(self,cn)if cn==nil then cn={}end;for K=1,#cn do local ak=cn[K]table.insert(self,1,ak)end end,__base=G,__name="Stack"},{__index=G,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;y=F end end;do do local F;local O=a;local G={Render=function(self)local L=""L=L..self:BeforeRender()L=L.."\n"for a6,H in ipairs(self._children)do L=L..H:Render()if not(a6==#self._children)then L=L..","end;L=L.."\n"end;return L..self:AfterRender()end,BeforeRender=function(self)return tostring(self._indent)..tostring(self._name).." = Stack({"end,AfterRender=function(self)return tostring(self._indent).."})"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,Q)F.__parent.__init(self)self._name=Q end,__base=G,__name="StackBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;z=F end end;do local co;co=function(b9,cp)local L=""for a6=1,cp do L=L..b9 end;return L end;A={StringNTimes=co}end;do local cq;cq=function(ac)if not(ac==nil)then local L="{"for a6,ak in ipairs(ac)do if type(ak)=="table"and not getmetatable(ak)then L=L..cq(ak)elseif type(ak)=="string"then L=L.."\""..tostring(ak).."\""else L=L..tostring(ak)end;if not(a6==#ac)then L=L..", "end end;return L.."}"else return"nil"end end;local cr;cr=function(cs)if not(cs==nil)then local L="{"local a6=0;for b4,ak in cs:pairs()do a6=a6+1;L=L..tostring(b4).." = "if type(ak)=="table"and not getmetatable(ak)then L=L..cr(k(ak))elseif type(ak)=="string"then L=L.."\""..tostring(ak).."\""else L=L..tostring(ak)end;if not(a6==cs:Length())then L=L..", "end end;return L.."}"else return"nil"end end;local ct;ct=function(cs,cu)if cu==nil then cu=0 end;if not(cs==nil)then local L="{\n"local a6=0;for b4,ak in cs:pairs()do a6=a6+1;L=L..A.StringNTimes("\t",cu+1)L=L..tostring(b4).." = "if type(ak)=="table"and not getmetatable(ak)then L=L..ct(k(ak),cu+1)elseif type(ak)=="table"and getmetatable(ak)and ak.__class.__name=="HashMap"then L=L..ct(ak,cu+1)elseif type(ak)=="string"then L=L.."\""..tostring(ak).."\""else L=L..tostring(ak)end;if not(a6==cs:Length())then L=L..","end;L=L.."\n"end;return L..A.StringNTimes("\t",cu).."}"else return"nil"end end;local cv;cv=function(cw,cx)if type(cw)~="table"or type(cx)~="table"then return false end;local cy=true;for b4,X in pairs(cw)do if type(X)~="table"then cy=X==cx[b4]else cy=cv(X,cx[b4])end;if not cy then return false end end;for b4,X in pairs(cx)do if type(X)~="table"then cy=cw[b4]==X else cy=cv(cw[b4],X)end;if not cy then return false end end;return true end;local cz;cz=function(aV,cA,cB)local am=aV[cA]aV[cA]=aV[cB]aV[cB]=am end;B={ArrayToSingleLineString=cq,HashMapToSingleLineString=cr,HashMapToMultiLineString=ct,TablesAreEqual=cv,Swap=cz}end;do do local F;local O=a;local G={Render=function(self)local L=""L=L..self:BeforeRender()L=L.."\n"for a6,H in ipairs(self._children)do L=L..H:Render()if not(a6==#self._children)then L=L..","end;L=L.."\n"end;return L..self:AfterRender()end,BeforeRender=function(self)return tostring(self._indent)..tostring(self._name).."[\""..tostring(self._key).."\"] = {"end,AfterRender=function(self)return tostring(self._indent).."}"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,Q,b4)F.__parent.__init(self)self._name=Q;self._key=b4 end,__base=G,__name="TableAssignmentBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;C=F end end;do do local F;local O=a;local G={Render=function(self)local L=""L=L..self:BeforeRender()L=L.."\n"for a6,H in ipairs(self._children)do L=L..H:Render()if not(a6==#self._children)then L=L..","end;L=L.."\n"end;return L..self:AfterRender()end,BeforeRender=function(self)return tostring(self._indent).."local "..tostring(self._name).." = {"end,AfterRender=function(self)return tostring(self._indent).."}"end}G.__index=G;setmetatable(G,O.__base)F=setmetatable({__init=function(self,Q)F.__parent.__init(self)self._name=Q end,__base=G,__name="TableBlock",__parent=O},{__index=function(M,Q)local R=rawget(G,Q)if R==nil then local S=rawget(M,"__parent")if S then return S[Q]end else return R end end,__call=function(M,...)local N=setmetatable({},G)M.__init(N,...)return N end})G.__class=F;if O.__inherited then O.__inherited(O,F)end;D=F end end;local cC;cC=function(_,cD)local bC=v.Parse(cD)if bC==nil then return''end;return u.Compile(_,bC)end;return{Transpile=cC} |
Hooks:PostHook(PlayerManager, "init", "SF_PlayerManager_init", function(self)
self._cooldowns = {}
end)
function PlayerManager:get_ability_on_cooldown(ability_id)
return self._cooldowns[ability_id] or 0
end
function PlayerManager:set_ability_on_cooldown(ability_id, cooldown_duration)
self._cooldowns[ability_id] = Application:time() + cooldown_duration
end
function PlayerManager:is_ability_cooldown_ended(ability_id)
return self:get_ability_on_cooldown(ability_id) < Application:time()
end
function PlayerManager:get_ability_remaining_cooldown(ability_id)
return self:get_ability_on_cooldown(ability_id) - Application:time()
end
Hooks:RegisterHook("SF_Cooldowns_update")
Hooks:PostHook(PlayerManager, "update", "SF_PlayerManager_update", function(self, t, dt)
Hooks:Call("SF_Cooldowns_update", self, t, dt)
end)
Hooks:RegisterHook("PlayerManager_upgrade_value_overrides")
local old_PlayerManager_upgrade_value = PlayerManager.upgrade_value
function PlayerManager:upgrade_value(category, upgrade, default)
local result = old_PlayerManager_upgrade_value(self, category, upgrade, default)
local overridden_result = Hooks:ReturnCall("PlayerManager_upgrade_value_overrides", self, category, upgrade, default, result )
return overridden_result or result
end |
AddCSLuaFile()
DEFINE_BASECLASS( "weapon_csbasegun" )
CSParseWeaponInfo( SWEP , [[WeaponData
{
"MaxPlayerSpeed" "250"
"WeaponType" "Pistol"
"FullAuto" 0
"WeaponPrice" "400"
"WeaponArmorRatio" "1.05"
"CrosshairMinDistance" "8"
"CrosshairDeltaDistance" "3"
"Team" "ANY"
"BuiltRightHanded" "0"
"PlayerAnimationExtension" "pistol"
"MuzzleFlashScale" "1.0"
"CanEquipWithShield" "1"
// Weapon characteristics:
"Penetration" "1"
"Damage" "25"
"Range" "4096"
"RangeModifier" "0.75"
"Bullets" "1"
"CycleTime" "0.15"
// New accuracy model parameters
"Spread" 0.00400
"InaccuracyCrouch" 0.00750
"InaccuracyStand" 0.01000
"InaccuracyJump" 0.27750
"InaccuracyLand" 0.05550
"InaccuracyLadder" 0.01850
"InaccuracyFire" 0.03167
"InaccuracyMove" 0.01665
"SpreadAlt" 0.00400
"InaccuracyCrouchAlt" 0.00750
"InaccuracyStandAlt" 0.01000
"InaccuracyJumpAlt" 0.27750
"InaccuracyLandAlt" 0.05550
"InaccuracyLadderAlt" 0.01850
"InaccuracyFireAlt" 0.02217
"InaccuracyMoveAlt" 0.01665
"RecoveryTimeCrouch" 0.21875
"RecoveryTimeStand" 0.26249
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "#Cstrike_WPNHUD_Glock18"
"viewmodel" "models/weapons/v_pist_glock18.mdl"
"playermodel" "models/weapons/w_pist_glock18.mdl"
"shieldviewmodel" "models/weapons/v_shield_glock18_r.mdl"
"anim_prefix" "anim"
"bucket" "1"
"bucket_position" "1"
"clip_size" "20"
"primary_ammo" "BULLET_PLAYER_9MM"
"secondary_ammo" "None"
"weight" "5"
"item_flags" "0"
// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{
//"reload" "Default.Reload"
//"empty" "Default.ClipEmpty_Rifle"
"single_shot" "Weapon_Glock.Single"
}
// Weapon Sprite data is loaded by the Client DLL.
TextureData
{
"weapon"
{
"font" "CSweaponsSmall"
"character" "C"
}
"weapon_s"
{
"font" "CSweapons"
"character" "C"
}
"ammo"
{
"font" "CSTypeDeath"
"character" "R"
}
"crosshair"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
}
}
ModelBounds
{
Viewmodel
{
Mins "-8 -4 -14"
Maxs "17 9 -1"
}
World
{
Mins "-1 -3 -3"
Maxs "11 4 4"
}
}
}]] )
SWEP.Spawnable = true
SWEP.Slot = 1
SWEP.SlotPos = 0
function SWEP:Initialize()
BaseClass.Initialize( self )
self:SetHoldType( "pistol" )
self:SetBurstFireEnabled( false )
self:SetMaxBurstFires( 3 )
self:SetBurstFireDelay( 0.1 )
self:SetWeaponID( CS_WEAPON_GLOCK )
end
function SWEP:Deploy()
self:SetAccuracy( 0.9 )
return BaseClass.Deploy( self )
end
function SWEP:PrimaryAttack()
if self:GetNextPrimaryAttack() > CurTime() then return end
self:GunFire(self:BuildSpread(), self:GetBurstFireEnabled())
end
function SWEP:TranslateViewModelActivity( act )
if self:GetBurstFireEnabled() and act == ACT_VM_PRIMARYATTACK then
return ACT_VM_SECONDARYATTACK
else
return BaseClass.TranslateViewModelActivity( self , act )
end
end
function SWEP:GunFire( spread , mode )
self:SetAccuracy( self:GetAccuracy() - 0.275 * ( 0.325 - CurTime() - self:GetLastFire() ) )
if self:GetAccuracy() > 0.9 then
self:SetAccuracy( 0.9 )
elseif self:GetAccuracy() < 0.6 then
self:SetAccuracy( 0.6 )
end
self:BaseGunFire( spread, self:GetWeaponInfo().CycleTime, mode )
end
function SWEP:SecondaryAttack()
if self:GetNextSecondaryAttack() > CurTime() then return end
self:ToggleBurstFire()
self:SetNextSecondaryAttack( CurTime() + 0.3 )
end
|
local M = {}
local utils = require "utils"
M.highlight = true
function M.toggle()
M.highlight = not M.highlight
if M.highlight then
utils.info("Enabled document highlight", "Document Highlight")
else
utils.warn("Disabled document highlight", "Document Highlight")
end
end
function M.highlight(client)
if M.highlight then
if client.resolved_capabilities.document_highlight then
local present, illuminate = pcall(require, "illuminate")
if present then
illuminate.on_attach(client)
else
vim.api.nvim_exec(
[[
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]],
false
)
end
end
end
end
function M.setup(client)
M.highlight(client)
end
return M
|
local http = require 'kong.plugins.influxdb.http'
local buffer = {}
local options = {}
local bufferedMessages = {}
local function buildMsg(msg)
local tags = ""
if msg.tag then
for k, v in pairs(msg.tag) do
tags = tags .. "," .. k .. "=" .. v
end
end
local fields = ""
for k, v in pairs(msg.field) do
fields = fields .. k .. "=" .. v .. ","
end
fields = fields:sub(1, -2) --Remove the last ,
return msg.measurement .. tags .. " " .. fields .. " " .. msg.timestamp
end
function buffer.init(opts)
options = opts
return true
end
function buffer.buffer(msg)
table.insert(bufferedMessages, msg)
end
function buffer.flush()
local finalMsg = ""
for i, msg in ipairs(bufferedMessages) do
finalMsg = finalMsg .. buildMsg(msg) .. "\n"
end
finalMsg = finalMsg:sub(1, -2) --Remove the last \n
bufferedMessages = {}
if finalMsg ~= '' then
http.post(finalMsg, options)
end
end
return buffer |
--
-- Autogenerated by Thrift
--
-- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-- @generated
--
require 'thrift.Thrift'
require 'evernote.limits.constants'
|
require 'gap/multigap'
require 'gap/constants'
-- Run fill in gaps on gerenated test to produce test result
-- test_set: test set generated by generateTestSet
-- Return: test result (include no of trueCount and falseCount)
function runSingleTest (test_set, model, naive, opt, lookforward_length)
if (opt == nil) then
opt = {}
opt.threshold = THRESHOLD
opt.cutoffprobs = CUT_OFF_PROBS
end
-- print ('in runSingleTest')
-- print (opt)
local string_with_gap = test_set.string_with_gap
local solution = test_set.answer
-- get the test result
local result
if naive then
result = naive_fill_multi_gaps(string_with_gap, test_set.gap_char, model)
-- print (result)
else
result = model:fillMultiGap(string_with_gap, test_set.gap_char, opt, lookforward_length)
end
local answer = result[1]
local trueCount = 0
local wrongCount = 0
for count = 1, #answer do
if (COUNT_PER_SYMBOLS) then
for symbols_i=1,#answer[count] do
if (answer[count]:sub(symbols_i,symbols_i) == solution[count]:sub(symbols_i,symbols_i)) then
trueCount = trueCount + 1
else
wrongCount = wrongCount + 1
end
end
else
if (answer[count] == solution[count]) then
do
trueCount = trueCount + 1
end
else
wrongCount = wrongCount + 1
end
end
end
local test_result = {}
test_result.wrongCount = wrongCount
test_result.trueCount = trueCount
return test_result
end
-- Run fill in gap and generate detail report
-- test_set: test set generated by generateTestSet
-- model: model to test
-- output: pdf file exported to path_to_file (include file name)
-- structure of report file:
-- string_with_gap
-- filled in string (red for wrong, green for correct)
-- accuracy
function generateSingleDetailReport(test_set, path_to_report, model)
local string_with_gap = test_set.string_with_gap
local solution = test_set.answer
-- get the test result
--local result = fill_multi_gaps2(string_with_gap, test_set.gap_char, model)
local result = model:fillMultiGap(string_with_gap, test_set.gap_char)
local answer = result[1]
local trueCount = 0
local wrongCount = 0
-- writing to txt file
local report = io.open(path_to_report, "w")
report:write('Passage with missing characters: \n')
report:write(test_set.numbered_string_with_gap )
report:write('\n\nOriginal passage: \n')
report:write(test_set.original_string )
report:write('\n')
for count = 1, #answer do
report:write('\nGap no. ' .. count)
report:write('\nAnswer by model: ' .. answer[count])
report:write('\nCorrect answer: ' .. solution[count])
if (answer[count] == solution[count]) then
do
trueCount = trueCount + 1
-- print ('Matched!')
end
else
wrongCount = wrongCount + 1
-- print ('Not matched!')
end
end
-- compute accuracy
local accuracy = trueCount/(#answer)*100
-- print ('Accuracy: ')
report:write('\n\nAccuracy: ' .. accuracy)
report:close()
local result = {}
result.trueCount = trueCount
result.total = #answer
return result
end
--
-- CHECKPOINT_PATH = 'models/cv/checkpoint_17000.t7'
--
-- -- model for sampling
-- local model = get_model_by_path(CHECKPOINT_PATH)
--
-- local gap_char = find_char_to_represent_gap(model)
--
-- -- print (gap_char)
--
-- local testCase = generateTestSet('accuracy/rawTestFiles/testsetgroup1/prof.txt', 'testset', gap_char)
--
-- generateReport(testCase, 'accuracy/reports/prof.txt', model)
-- function generateSingleDetailReport3(test_set, path_to_report, model)
--
-- local string_with_gap = test_set.string_with_gap
-- local solution = test_set.answer
--
-- -- get the test result
-- local result = fill_multi_gaps3(string_with_gap, test_set.gap_char, model)
-- local answer = result[1]
--
-- local trueCount = 0
-- local wrongCount = 0
--
-- -- writing to txt file
-- local report = io.open(path_to_report, "w")
--
-- report:write('Passage with missing characters: \n')
-- report:write(test_set.numbered_string_with_gap )
--
-- report:write('\n\nOriginal passage: \n')
-- report:write(test_set.original_string )
--
-- report:write('\n')
-- for count = 1, #answer do
-- report:write('\nGap no. ' .. count)
-- report:write('\nAnswer by model: ' .. answer[count])
-- report:write('\nCorrect answer: ' .. solution[count])
-- if (answer[count] == solution[count]) then
-- do
-- trueCount = trueCount + 1
-- -- print ('Matched!')
-- end
-- else
-- wrongCount = wrongCount + 1
-- -- print ('Not matched!')
-- end
-- end
--
-- -- compute accuracy
-- local accuracy = trueCount/(#answer)*100
--
-- -- print ('Accuracy: ')
-- report:write('\n\nAccuracy: ' .. accuracy)
-- report:close()
--
-- local result = {}
-- result.trueCount = trueCount
-- result.total = #answer
-- return result
-- end
|
--[[
file:zjh_struct.lua
desc:炸金花
auth:Caorl Luo
]]
---@alias zjh_score number
---积分
---@alias zjh_double number
---倍数
---@alias zjh_type senum
---牌型
---@alias zjh_index number
---下标
---@alias zjh_enum senum
---枚举
---@alias zjh_seat number
---位置
---@alias zjh_card number
---牌值
---@alias zjh_value number
---牌值
---@alias zjh_color number
---花色
---@class zjh_seat_cards @玩家手牌
---@field seatID zjh_seat @玩家
---@field hand zjh_card[] @手牌
---@class zjh_deal_ntc @发牌通知
---@field seatID zjh_seat @玩家
---@field count zjh_count @张数
---@class zjh_see_ntc @看牌通知
---@field seatID zjh_seat @玩家
---@field hand zjh_card[] @手牌
---@class zjh_giveup_ntc @放弃通知
---@field seatID zjh_seat @玩家
---@field hand zjh_card[] @手牌
---@class zjh_bet_refuel_ntc @加注通知
---@field seatID zjh_seat @玩家
---@field score zjh_score @下注
---@field blance zjh_score @余额
---@class zjh_bet_with_ntc @跟注通知
---@field seatID zjh_seat @玩家
---@field score zjh_score @下注
---@field blance zjh_score @余额
---@class zjh_bet_all_ntc @梭哈通知
---@field seatID zjh_seat @玩家
---@field score zjh_score @下注
---@field blance zjh_score @余额
---@class zjh_cmp_card_ntc @比牌通知
---@field originID zjh_seat @发起玩家
---@field targetID zjh_seat @目标玩家
---@field winnerID zjh_seat @胜利玩家
---@field originSP zjh_card[] @发起手牌
---@field targetSP zjh_card[] @目标手牌
---@field originPX zjhType @发起牌型
---@field targetPX zjhType @目标牌型
---@field comparCB zjh_score @比牌成本
---@field blanceLY zjh_score @剩余分数
---@class zjh_game_result_ntc @结果通知
---@field winnerID zjh_seat @胜利玩家
---@field reaScore zjh_score @实际得分
---@field ducScore zjh_score @应得分数
---@field blanceLJ zjh_score @剩余分数
---@field openseat zjh_seat[] @开牌状态
---@field giveseat zjh_seat[] @放弃状态
---@field loseseat zjh_seat[] @淘汰状态
---@field cardseat zjh_seat_cards[][] @玩家手牌
---@class zjh_game_start_ntc:game_start_ntc @开始通知 |
-- lua test by ysoftman
-- dofile 테스트
function bbb()
print("This bbb() function")
end
|
AddEventHandler('onClientResourceStart', function()
--print("Unser erstes Script wurde soeben clientseitig gestartet")
end)
local NumberCharset = {}
local Charset = {}
for i = 48, 57 do table.insert(NumberCharset, string.char(i)) end
for i = 65, 90 do table.insert(Charset, string.char(i)) end
for i = 97, 122 do table.insert(Charset, string.char(i)) end
function GeneratePlate()
local generatedPlate
local doBreak = false
while true do
Citizen.Wait(2)
math.randomseed(GetGameTimer())
generatedPlate = string.upper(GetRandomLetter(3) .. ' ' .. GetRandomNumber(3))
ESX.TriggerServerCallback('simpleadmin:isPlateTaken', function (isPlateTaken)
if not isPlateTaken then
doBreak = true
end
end, generatedPlate)
if doBreak then
break
end
end
return generatedPlate
end
-- mixing async with sync tasks
function IsPlateTaken(plate)
local callback = 'waiting'
ESX.TriggerServerCallback('simpleadmin:isPlateTaken', function(isPlateTaken)
callback = isPlateTaken
end, plate)
while type(callback) == 'string' do
Citizen.Wait(0)
end
return callback
end
function GetRandomNumber(length)
Citizen.Wait(1)
math.randomseed(GetGameTimer())
if length > 0 then
return GetRandomNumber(length - 1) .. NumberCharset[math.random(1, #NumberCharset)]
else
return ''
end
end
function GetRandomLetter(length)
Citizen.Wait(1)
math.randomseed(GetGameTimer())
if length > 0 then
return GetRandomLetter(length - 1) .. Charset[math.random(1, #Charset)]
else
return ''
end
end
--test
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
RegisterNetEvent('simpleadmin:register')
AddEventHandler('simpleadmin:register', function(model,youId)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
ESX.Game.SpawnVehicle(model, coords, 90.0, function(vehicle)
TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
print(playerPed)
local newPlate = GeneratePlate()
local vehicleProps = ESX.Game.GetVehicleProperties(vehicle)
vehicleProps.plate = newPlate
TriggerServerEvent('simpleadmin:sql', vehicleProps,youId)
ESX.Game.DeleteVehicle(vehicle)
end)
end) |
object_mobile_bomarr_monk_spider_droid_greeter = object_mobile_shared_bomarr_monk_spider_droid_greeter:new {
}
ObjectTemplates:addTemplate(object_mobile_bomarr_monk_spider_droid_greeter, "object/mobile/bomarr_monk_spider_droid_greeter.iff")
|
local Turret_Material_Projectile = 51
function Physic_Turret_Shoot(Player_Number, Map_ID, X, Y, Z, Rot, Look)
local M_X, M_Y, M_Z = math.cos(math.rad(Rot-90))*math.cos(math.rad(Look)), math.sin(math.rad(Rot-90))*math.cos(math.rad(Look)), -math.sin(math.rad(Look))
local i = 2
if Map_Block_Get_Type(Map_ID, X+M_X*1, Y+M_Y*1, Z+M_Z*1) == 0 then
--Physic_Directional_Rocket_Add(Player_Number, Map_ID, X+M_X*i, Y+M_Y*i, Z+M_Z*i, Rot, Look)
Physic_Directional_Projectile_Add(Player_Number, Map_ID, X+M_X*i, Y+M_Y*i, Z+M_Z*i, Rot, Look)
end
end
function Physic_Turret(Map_ID, X, Y, Z)
local Player_Number = Map_Block_Get_Player_Last(Map_ID, X, Y, Z)
--Physic_Directional_Rocket_Explode(Player_Number, Map_ID, X, Y, Z, 4)
--System_Message_Network_Send_2_All(Map_ID, "&c"..Player_Get_Name(Player_Number).." is CHEATING (NO TURRETS)!!!!")
-- ############# Find the entity standing near the Turret
local Max_Distance = 130
local Choosed_Entity_ID = -1
local Entity_Table, Entitys = Entity_Get_Table()
for i = 1, Entitys do
local Entity_ID = Entity_Table[i]
local Entity_Map_ID, Entity_X, Entity_Y, Entity_Z = Entity_Get_Map_ID(Entity_ID),Entity_Get_X(Entity_ID),Entity_Get_Y(Entity_ID),Entity_Get_Z(Entity_ID)
local Distance = math.sqrt((Entity_X-X)^2+(Entity_Y-Y)^2+(Entity_Z-Z)^2)
if Entity_Map_ID == Map_ID and Distance < Max_Distance then--and Entity_Get_Player(Entity_ID) ~= Player_Number then
Max_Distance = Distance
Choosed_Entity_ID = Entity_ID
end
end
if Choosed_Entity_ID ~= -1 then
local Entity_Map_ID, Entity_X, Entity_Y, Entity_Z = Entity_Get_Map_ID(Choosed_Entity_ID),Entity_Get_X(Choosed_Entity_ID),Entity_Get_Y(Choosed_Entity_ID),Entity_Get_Z(Choosed_Entity_ID)
local Distance = math.sqrt((Entity_X-X)^2+(Entity_Y-Y)^2)
local Rot, Look = math.deg(math.atan2((Entity_Y-Y), (Entity_X-X)))+90, -math.deg(math.atan2(Entity_Z-Z, Distance))
Physic_Turret_Shoot(Player_Number, Map_ID, X, Y, Z, Rot, Look)
end
end |
local cf = vgui.Create"DPanel"
cf:SetVisible(true)
cf:SetSize(ScrW()/5,ScrH()/20)
cf:SetPos(
ScrW()/2-cf:GetWide()/2,
ScrH()-cf:GetTall()
)
function cf:Paint()
local x,y
x,y = self:ScreenToLocal(0, 0)
surface.SetMaterial(Material"pp/blurx")
surface.SetDrawColor(Color(255, 255, 255, 5))
surface.DrawTexturedRect(x, y, ScrW(), ScrH())
x,y = self:GetPos()
x,y = self:ScreenToLocal(x, y)
draw.RoundedBox(6, x, y, self:GetWide(), self:GetTall(), Color(0,0,0,200))
return true
end
timer.Simple(10, cf.Remove, cf)
|
local M = {}
vim.w.cursorword_match = false
function M.matchdelete()
if vim.w.cursorword_match then
vim.call("matchdelete", vim.w.cursorword_id)
end
vim.w.cursorword_match = false
end
function M.matchadd()
if vim.bo.buftype ~= "" and vim.bo.buftype ~= "acwrite" then
return
end
local column = vim.api.nvim_win_get_cursor(0)[2]
local line = vim.api.nvim_get_current_line()
local cursorword = vim.fn.matchstr(line:sub(1, column + 1), [[\k*$]])
.. vim.fn.matchstr(line:sub(column + 1), [[^\k*]]):sub(2)
if cursorword == vim.w.cursorword then
return
end
M.matchdelete()
vim.w.cursorword = cursorword
if cursorword == "" or #cursorword > 100 or string.find(cursorword, "[\192-\255]+") ~= nil then
return
end
local pattern = [[\<]] .. cursorword .. [[\>]]
vim.w.cursorword_id = vim.fn.matchadd("CursorWord", pattern, -1)
vim.w.cursorword_match = true
end
function M.setup()
vim.api.nvim_command "highlight CursorWord gui=underline"
vim.api.nvim_command "autocmd CursorMoved,InsertLeave * lua require'utilities.cursor_word'.matchadd()"
vim.api.nvim_command "autocmd InsertEnter * lua require'utilities.cursor_word'.matchdelete()"
end
return M
|
--
-- This file is part of SmithSNMP
-- Copyright (C) 2014, Credo Semiconductor Inc.
-- Copyright (C) 2015, Leo Ma <[email protected]>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License along
-- with this program; if not, write to the Free Software Foundation, Inc.,
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--
local mib = require "smithsnmp"
local udpInDatagrams = 1
local udpNoPorts = 2
local udpInErrors = 3
local udpOutDatagrams = 4
local udpTable = 5
local udp_entry_cache = {}
local udp_scalar_cache = {}
--[[
["0.0.0.0.67"] = {},
["0.0.0.0.68"] = {},
["0.0.0.0.161"] = {},
["0.0.0.0.5353"] = {},
["0.0.0.0.44681"] = {},
["0.0.0.0.51586"] = {},
["127.0.0.1.53"] = {},
["192.168.122.1.53"] = {},
]]
local hextab = {
['0'] = 0,
['1'] = 1,
['2'] = 2,
['3'] = 3,
['4'] = 4,
['5'] = 5,
['6'] = 6,
['7'] = 7,
['8'] = 8,
['9'] = 9,
['A'] = 10,
['a'] = 10,
['B'] = 11,
['b'] = 11,
['C'] = 12,
['c'] = 12,
['D'] = 13,
['d'] = 13,
['E'] = 14,
['e'] = 14,
['F'] = 15,
['f'] = 15,
}
local ip_hex2num = function(hex)
assert(type(hex) == 'string' and #hex == 8)
local num = {}
for i = 8, 2, -2 do
local msb = string.char(string.byte(hex, i - 1))
local lsb = string.char(string.byte(hex, i))
table.insert(num, hextab[msb] * 16 + hextab[lsb])
end
return table.concat(num, ".")
end
local port_hex2num = function(hex)
assert(type(hex) == 'string' and #hex == 4)
local num = 0
for i = 1, 4 do
num = num * 16 + hextab[string.char(string.byte(hex, i))]
end
return tostring(num)
end
local __load_config = function()
udp_scalar_cache = {}
udp_entry_cache = {}
for line in io.lines("/proc/net/snmp") do
if string.match(line, "%w+") == 'Udp' then
for w in string.gmatch(line, "%d+") do
table.insert(udp_scalar_cache, tonumber(w))
end
end
end
for line in io.lines("/proc/net/udp") do
local ipaddr = string.match(line, ".-:%s+(.-):")
local port = string.match(line, ".-:%s+.-:(.-)%s+")
if ipaddr ~= nil and port ~= nil then
ipaddr = ip_hex2num(ipaddr)
port = port_hex2num(port)
udp_entry_cache[ipaddr .. '.' .. port] = true
end
end
end
local last_load_time = os.time()
local load_config = function()
if os.difftime(os.time(), last_load_time) > 3 then
last_load_time = os.time()
__load_config()
end
end
__load_config()
mib.module_methods.or_table_reg("1.3.6.1.2.1.7", "The MIB module for managing UDP inplementations")
local udpGroup = {
io_f = load_config,
[udpInDatagrams] = mib.ConstCount(function () return udp_scalar_cache[1] end),
[udpNoPorts] = mib.ConstCount(function () return udp_scalar_cache[2] end),
[udpInErrors] = mib.ConstCount(function () return udp_scalar_cache[3] end),
[udpOutDatagrams] = mib.ConstCount(function () return udp_scalar_cache[4] end),
[udpTable] = {
[1] = {
indexes = udp_entry_cache,
[1] = mib.ConstIpaddr(function (sub_oid)
local ipaddr
if type(sub_oid) == 'table' and udp_entry_cache[table.concat(sub_oid, ".")] ~= nil then
ipaddr = {}
for i = 1, 4 do
table.insert(ipaddr, sub_oid[i])
end
end
return ipaddr
end),
[2] = mib.ConstInt(function (sub_oid)
local port
if type(sub_oid) == 'table' and udp_entry_cache[table.concat(sub_oid, ".")] ~= nil then
port = sub_oid[5]
end
return port
end),
}
}
}
return udpGroup
|
--[[
Runs a function asynchronously in its own thread.
This is similar to spawn(), but executes immediately instead of waiting an
arbitrary amount of time before executing the wrapped code.
Usage:
async(function()
print("do something")
end)
]]
local t = require(script.Parent.Parent.lib.t)
local asyncCheck = t.callback
local function async(callback)
assert(asyncCheck(callback))
local bindable = Instance.new("BindableEvent")
bindable.Event:Connect(function()
callback()
end)
bindable:Fire()
bindable:Destroy()
end
return async
|
-- from the lua manual:
-- "print is not intended for formatted output, but only as a quick way to show a value, typically for debugging."
-- and the minetest documentation:
-- use minetest.log() for serious output, not minetest.debug() (onto which print() is redirected)
--local collected_problems = {}
local wrapped_print = print
print = function(...)
-- local info = debug.getinfo(2, "Sl")
-- local location = string.format("%s:%d", tostring(info.source), info.currentline)
-- local problem = collected_problems[location] or { count = 0 }
-- problem.count = problem.count + 1
wrapped_print(string.format("%s> %s", core.get_current_modname() or "?", table.concat({...})))
end
|
local config = require('diffmt/config')
local diff = require('diffmt/diff')
local M = {}
function M.diff()
diff.diff(function () end)
end
---@param user_config DiffmtConfig
function M.setup(user_config)
config.set(user_config)
end
return M
|
-- started 2010-07-18 by Shmuel Zeigerman
local Title = "Delete Trees"
local RegPath = "LuaFAR\\DelTrees\\"
local far2_dialog = require "far2.dialog"
local F = far.Flags
local function UserDialog (aData, aHelpTopic)
local HIST_DIRPAT = RegPath .. "DirPattern"
------------------------------------------------------------------------------
local D = far2_dialog.NewDialog()
D._ = {"DI_DOUBLEBOX",3, 1,72,6, 0, 0, 0, 0, Title}
D.lab = {"DI_TEXT", 5, 2, 0,0, 0, 0, 0, 0, "Directory pattern:"}
D.edtDirPat = {"DI_EDIT", 5, 3,70,6, 0, HIST_DIRPAT, {DIF_HISTORY=1,DIF_USELASTHISTORY=1}, 0, ""}
D.sep = {"DI_TEXT", 5, 4, 0,0, 0, 0, {DIF_BOXCOLOR=1,DIF_SEPARATOR=1}, 0, ""}
D.btnOk = {"DI_BUTTON", 0, 5, 0,0, 0, 0, "DIF_CENTERGROUP", 1, "Ok"}
D.btnCancel = {"DI_BUTTON", 0, 5, 0,0, 0, 0, "DIF_CENTERGROUP", 0, "Cancel"}
------------------------------------------------------------------------------
local function DlgProc (hDlg, msg, param1, param2)
if msg == F.DN_INITDIALOG then
elseif msg == F.DN_CLOSE then
if param1 == D.btnOk.id then
local pat = D.edtDirPat:GetText(hDlg)
local ok, regex = pcall(regex.new, pat, "i")
if ok then
aData.regex = regex
else
far.Message(regex, "Error", ";Ok", "w")
return 0
end
end
end
end
local ret = far.Dialog (-1, -1, 76, 8, aHelpTopic, D, 0, DlgProc)
return (ret == D.btnOk.id)
end
local function GetUserChoice(f)
local r = far.Message("Do you wish to delete\n"..f, "Delete",
"&Delete;&All;&Skip;&Cancel", "w")
return r==1 and "yes" or r==2 and "all" or r==3 and "no" or "cancel"
end
local function DeleteTrees (aDirRegex)
require "sysutils"
local RecurseFunc = require "sysutils.recurse"
local panelInfo = panel.GetPanelInfo (nil, 1)
local nFiles, nDirs, nFailed = 0, 0, 0
local choice = "no"
local depth = 0
for i=1, panelInfo.SelectedItemsNumber do
local item = panel.GetSelectedPanelItem (nil, 1, i)
if item.FileAttributes:find("d") then
for path,file,stage,control in RecurseFunc(item.FileName.."\\*", "bfE") do
if stage == "b" then
if depth > 0 or aDirRegex:find(path) then depth = depth + 1
else control("skipf")
end
elseif stage == "f" then
local f = path.."\\"..file.name
if choice ~= "all" then choice = GetUserChoice(f) end
if choice == "all" or choice == "yes" then
sysutils.FileSetAttr(f,"")
if sysutils.DeleteFile(f) then nFiles = nFiles+1
else nFailed = nFailed+1
end
elseif choice == "cancel" then
break
end
elseif stage == "E" then
if depth > 0 then
depth = depth - 1
if choice ~= "all" then choice = GetUserChoice(path) end
if choice == "all" or choice == "yes" then
sysutils.FileSetAttr(path,"d")
if sysutils.RemoveDir(path) then nDirs = nDirs+1
else nFailed = nFailed+1
end
elseif choice == "cancel" then
break
end
end
end
end -- subitems loop
if choice == "cancel" then break end
end -- if selected item is directory
end -- selected items loop
far.Message(("Deleted files: %d\n" ..
"Deleted directories: %d\n" ..
"Failed deletions: %d"):format(nFiles, nDirs, nFailed),
Title, ";OK", "l")
end
do
local arg = ...
local helpTopic = arg and arg[1]
local data = {}
if UserDialog(data, helpTopic) then
DeleteTrees(data.regex)
end
end
|
NMS_MOD_DEFINITION_CONTAINER =
{
["MOD_FILENAME"] = ".pak",
["MOD_AUTHOR"] = " converted and modified by Mjjstral",
["NMS_VERSION"] = "1.77",
["MODIFICATIONS"] =
{
{
["PAK_FILE_SOURCE"] = "NMSARC.59B126E2.pak",
["MBIN_CHANGE_TABLE"] =
{
{
["MBIN_FILE_SOURCE"] = "GCSPACESHIPGLOBALS.GLOBAL.MBIN",
["EXML_CHANGE_TABLE"] =
{
{
["PRECEDING_KEY_WORDS"] = "",
["VALUE_CHANGE_TABLE"] =
{
}
},
{
["PRECEDING_KEY_WORDS"] = { "Control", "SpaceEngine" },
["VALUE_CHANGE_TABLE"] =
{
}
},
{
["PRECEDING_KEY_WORDS"] = { "Control", "PlanetEngine" },
["VALUE_CHANGE_TABLE"] =
{
}
},
{
["PRECEDING_KEY_WORDS"] = { "ControlLight", "SpaceEngine" },
["VALUE_CHANGE_TABLE"] =
{
}
},
{
["PRECEDING_KEY_WORDS"] = { "ControlLight", "PlanetEngine" },
["VALUE_CHANGE_TABLE"] =
{
}
},
{
["PRECEDING_KEY_WORDS"] = { "ControlHeavy", "SpaceEngine" },
["VALUE_CHANGE_TABLE"] =
{
}
},
{
["PRECEDING_KEY_WORDS"] = { "ControlHeavy", "PlanetEngine" },
["VALUE_CHANGE_TABLE"] =
{
}
}
}
}
}
}
}
}
--NOTE: ANYTHING NOT in table NMS_MOD_DEFINITION_CONTAINER IS IGNORED AFTER THE SCRIPT IS LOADED
--IT IS BETTER TO ADD THINGS AT THE TOP IF YOU NEED TO
--DON'T ADD ANYTHING PASS THIS POINT HERE |
require("channelKicker/settings")
require("channelKicker/lang")
require("channelKicker/vars")
require("channelKicker/functions")
function onClientChannelGroupChangedEvent(serverConnectionHandlerID, channelGroupID, channelID, clientID, invokerClientID, invokerName, invokerUniqueIdentity)
local clientUID = ts3.getClientVariableAsString(serverConnectionHandlerID,clientID,ts3defs.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
if ts3_triggered_antiflood == true then
debugPrint(antifloodMSG)
return
elseif whitelistUIDs[clientUID] then
return
else
CK_checkServer(serverConnectionHandlerID)
if channelKicker.setting.active == true then
clientIDown = ts3.getClientID(serverConnectionHandlerID)
channelIDown = ts3.getChannelOfClient(serverConnectionHandlerID, clientIDown)
channelGroupIDown = ts3.getClientVariableAsInt(serverConnectionHandlerID,clientIDown,33)
channelGroupID = ts3.getClientVariableAsInt(serverConnectionHandlerID,clientID,33)
-- ts3.printMessageToCurrentTab(clientID.." "..channelIDown.." "..channelGroupIDown.." "..channelGroupID.." ")
if channelIDown == channelID then
if channelKicker.func.kick_on_not_welcome.enabled == true then
if channelGroupID == group_notwelcome then
if channelGroupIDown == group_ca or channelGroupIDown == group_op then
channelName = ts3.getChannelVariableAsString(serverConnectionHandlerID, channelID, ts3defs.ChannelProperties.CHANNEL_NAME)
if channelKicker.setting.channelkick_active == true and channelKicker.func.kick_on_not_welcome.channelkick_active == true then
-- invokerINIT = string.sub(invokerName,0,2)
-- invokerINIT = string.upper( invokerINIT )
if invokerClientID == clientIDown then
kickMSG = "Du wurdest permanent vom Channel gebannt!"
else
kickMSG = invokerName .. " hat dich permanent vom Channel gebannt!"
end
-- ID: <".. invokerINIT ..( IDArray[ math.random( #IDArray ) ] )..( IDArray[ math.random( #IDArray ) ] )..( IDArray[ math.random( #IDArray ) ] )..( IDArray[ math.random( #IDArray ) ] )..( IDArray[ math.random( #IDArray ) ] )..( IDArray[ math.random( #IDArray ) ] )
ts3.requestClientKickFromChannel(serverConnectionHandlerID,clientID,kickMSG)
end
if channelKicker.setting.log_not_welcome_kicks == true then
nickName = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, 1)
nickNameEncoded = urlencode(nickName)
invokerNameEncoded = urlencode(invokerName)
-- dataBaseID = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, 32)
uniqueID = ts3.getClientVariableAsString(serverConnectionHandlerID,clientID,ts3defs.ClientProperties.CLIENT_UNIQUE_IDENTIFIER)
clientTYPE = ts3.getClientVariableAsUInt64(serverConnectionHandlerID,clientID,ts3defs.ClientProperties.CLIENT_TYPE)
-- if clientTYPE == "0"
-- clientTYPE = "CLIENT"
-- elseif clientTYPE == "1"
-- clientTYPE = "QUERY"
-- else
-- clientTYPE = "UNKNOWN"
-- end
dateNow = os.date("%d.%m.%Y")
timeNow = os.date("%H:%M:%S")
datei = io.open("xKickedUser.csv", "r")
dateia = io.open("xKickedUser.csv", "a")
-- for line in datei:lines() do
-- stringgSub = string.gsub(line,nickName,"X")
-- stringgSub1 = string.gsub(line,uniqueID,"X")
-- stringgSub2 = string.gsub(line,clientTYPE,"X")
-- stringgSub3 = string.gsub(line,dataBaseID,"X")
-- if stringgSub ~= line or stringgSub1 ~= line or stringgSub2 ~= line then
-- ts3.printMessageToCurrentTab(nickName .." | ".. line)
-- end
-- end
if channelKicker.setting.msg_instead_of_log == true then
if invokerClientID == clientIDown then
ts3.requestSendChannelTextMsg(serverConnectionHandlerID, "[color=red]hat [URL=client://" .. clientID .. "/" .. uniqueID .. "~" .. nickNameEncoded .. "]\"" .. nickName .. "\"[/url] permanent aus dem [URL=channelid://" .. channelID .. "]Channel[/url] gebannt![/color]", channelIDown)
else
ts3.requestSendChannelTextMsg(serverConnectionHandlerID, "[color=red][URL=client://" .. clientID .. "/" .. uniqueID .. "~" .. nickNameEncoded .. "]\"" .. nickName .. "\"[/url] wurde von [URL=client://" .. invokerClientID .. "/" .. invokerUniqueIdentity .. "~" .. invokerNameEncoded .. "]\"" .. invokerName .. "\"[/url] permanent aus dem [URL=channelid://" .. channelID .. "]Channel[/url] gebannt![/color]", channelIDown)
end
else
CK_ScriptLog("[URL=client://" .. clientID .. "/" .. uniqueID .. "~" .. nickNameEncoded .. "]" .. nickName .. "[/url] wurde von [URL=client://" .. invokerClientID .. "/" .. invokerUniqueIdentity .. "~" .. invokerNameEncoded .. "]" .. invokerName .. "[/url] permanent aus dem Channel [URL=channelid://" .. channelID .. "]" .. channelName .. "[/url] gebannt!")
end
dateia:write(dateNow .. ";" .. timeNow .. ";" .. clientTYPE .. ";" .. nickName .. ";" .. uniqueID .. "\n")--;" .. dataBaseID .. "
dateia:close()
datei:close()
end
end
end
end
if channelKicker.setting.ck_send_infotext == true then
if clientID == clientIDown then
if channelGroupID == group_op then
-- ts3.printMessageToCurrentTab("onClientChannelGroupChangedEvent: #" .. invokerClientID .. " \"" .. invokerName .. "\"")
if invokerClientID ~= 0 and invokerName ~= "Server" then
if txt_oldChannelID ~= channelIDown then
-- if textSended == false then
ts3.requestSendChannelTextMsg(serverConnectionHandlerID, channelMSG, channelIDown)
ts3.requestSendChannelTextMsg(serverConnectionHandlerID, channelMSG_e, channelIDown)
-- textSended = true
txt_oldChannelID = channelIDown
return
end
end
end
end
end
if channelKicker.func.auto_channel_commander == true then
if clientID == clientIDown then
if channelID == channelIDown then
if channelGroupIDown == group_ca then
ts3.setClientSelfVariableAsInt(serverConnectionHandlerID, ts3defs.ClientProperties.CLIENT_IS_CHANNEL_COMMANDER, 1)
ts3.flushClientSelfUpdates(serverConnectionHandlerID)
end
end
end
end
end
end
end
end
-- channelKicker_events = {
-- onClientChannelGroupChangedEvent = onClientChannelGroupChangedEvent
-- }
channelKicker.info.MODULEFOLDER = "channelKicker/events"
channelKicker.info.MODULEFILE = "onClientChannelGroupChanged"
ts3.printMessageToCurrentTab("Loaded "..channelKicker.info.MODULE.." v"..channelKicker.info.MODULEVERSION.." by "..channelKicker.info.MODULEAUTHOR.." from "..ts3.getPluginPath().."lua_plugin/"..channelKicker.info.MODULEFOLDER.."/"..channelKicker.info.MODULEFILE.."."..channelKicker.info.MODULEEXT) |
local api = trinium.api
local machines = trinium.machines
local S = machines.S
local recipes = trinium.recipes
local def, destruct, r_input, r_output, r_data = machines.parse_multiblock{
controller = "trinium_machines:controller_distillation_tower",
casing = "trinium_machines:casing_chemical",
size = {front = 0, back = 2, up = 1, down = 0, sides = 1},
min_casings = 13,
addon_map = {
{x = 0, z = 1, y = 1, name = "hatch:output.item"},
{x = 0, z = 1, y = 0, name = "trinium_machines:casing_distillation"},
},
color = 179,
hatches = {"input.item"},
fake_hatches = {"output.item"},
}
recipes.add_method("distillation_tower", {
input_amount = 1,
output_amount = 12,
get_input_coords = recipes.coord_getter(1, -1, 1),
get_output_coords = recipes.coord_getter(4, 1.5, 0),
formspec_width = 7,
formspec_height = 4.5,
formspec_name = S"Distillation",
implementing_objects = {"trinium_machines:controller_distillation_tower"},
formspec_begin = function(data)
return ("textarea[0.25,3;6.75,1.5;;;%s\n%s]"):format(S("Pressure: @1-@2 kPa",
(data.pressure - data.pressure_tolerance) * 100, (data.pressure + data.pressure_tolerance) * 100),
S("Maximum recovery: @1", data.recovery))
end,
process = function(a, outputs, data)
data.output_tooltips = {}
for i = 1, #outputs do
if data.temperatures[i] ~= -1 then
data.output_tooltips[i] = api.get_description(outputs[i]) .. "\n" ..
minetest.colorize("#808080", S("Temperature: @1-@2 K",
data.temperatures[i] - 5, data.temperatures[i] + 5))
else
data.output_tooltips[i] = api.get_description(outputs[i]) .. "\n" ..
minetest.colorize("#808080", S("Extracted from upper Output Bus"))
end
end
return a, outputs, data
end,
})
local distillation_random = PcgRandom(math.random() * 10 ^ 8)
local distillation_time = 8
minetest.register_node("trinium_machines:controller_distillation_tower", {
description = S"Distillation Tower Controller",
groups = {cracky = 1},
sounds = trinium.sounds.default_metal,
tiles = {{name = "trinium_machines.casing.png", color = "#5575ff"}},
overlay_tiles = {"", "", "", "", "", "trinium_machines.distillation_tower_overlay.png"},
palette = "trinium_api.palette8.png",
paramtype2 = "colorfacedir",
color = "white",
on_destruct = function(pos)
local node
repeat
destruct(pos)
minetest.get_meta(pos):from_table()
pos = vector.add(pos, {x = 0, y = -1, z = 0})
node = minetest.get_node(pos).name
until node ~= "trinium_machines:controller_distillation_layer"
end,
on_timer = function(pos)
local meta, timer = minetest.get_meta(pos), minetest.get_node_timer(pos)
local hatches = meta:get_string"hatches":data()
if not hatches or not hatches["input.item"][1] then return end
local output = meta:get_string"output"
if output ~= "" then
meta:set_string("output", "")
local output_inv = minetest.get_meta(hatches["output.item"][1]):get_inventory()
if output_inv:room_for_item("output", output) then
output_inv:add_item("output", output)
else
api.recolor_facedir(pos, 3)
return
end
end
local input = minetest.get_meta(hatches["input.item"][1]):get_inventory()
local input_map = api.inv_to_itemmap(input:get_list"input")
local dt_recipes = recipes.recipes_by_method.distillation_tower
local vars, func = api.exposed_var()
table.iwalk(dt_recipes, function(v)
local rec = recipes.recipe_registry[v]
if not input_map[rec.inputs[1]] then return end
if (input_map["trinium_materials:cell_empty"] or 0) < rec.data.recovery - 1 then return end
local metas, timers = {}, {}
for i = 2, #rec.outputs do
local pos2 = vector.add(pos, vector.multiply({x = 0, y = -1, z = 0}, i - 1))
local node = minetest.get_node(pos2).name
if node ~= "trinium_machines:controller_distillation_layer" then
api.recolor_facedir(pos, 3)
return
end
metas[i - 1] = minetest.get_meta(pos2)
timers[i - 1] = minetest.get_node_timer(pos2)
local hatches2 = metas[i - 1]:get_string"hatches":data()
if not hatches2 then
api.recolor_facedir(pos2, 3)
return
end
local h = hatches2["input.heat"][1]
if not h then
api.recolor_facedir(pos2, 3)
return
end
h = minetest.get_meta(h):get_int"temperature"
if rec.data.temperatures[i] - 5 > h or rec.data.temperatures[i] + 5 < h then
api.recolor_facedir(pos2, 3)
return
end
api.recolor_facedir(pos2, 6)
end
timer:stop()
timer:start(distillation_time)
input:remove_item("input", rec.inputs[1])
input:remove_item("input", "trinium_materials:cell_empty " .. (rec.data.recovery - 1))
local cache = {}
local j = 0
repeat
local k = distillation_random:next(1, #rec.outputs)
if not cache[k] then
cache[k] = 1
j = j + 1
if k == 1 then
meta:set_string("output", rec.outputs[1])
else
timers[k - 1]:stop()
timers[k - 1]:start(distillation_time - 0.5)
metas[k - 1]:set_string("output", rec.outputs[k])
end
end
until j == rec.data.recovery
api.recolor_facedir(pos, 2)
vars.good = false
end, func)
if vars.good then api.recolor_facedir(pos, 7) end
end,
})
api.add_multiblock("distillation tower", def)
recipes.add("greggy_multiblock", r_input, r_output, r_data)
api.multiblock_rich_info"trinium_machines:controller_distillation_tower"
|
return {
metadata = {
{scaling_used = {"deLeva1996_segmentedTrunk"},
subject_age = {65.0},
subject_height = {1.58},
subject_weight = {53.00},
subject_gender = {"female"},
subject_pelvisWidth = {0.2450},
subject_hipCenterWidth = {0.1860},
subject_shoulderCenterWidth = {0.3180},
subject_heelAnkleXOffset = {0.0810},
subject_heelAnkleZOffset = {0.0750},
subject_shoulderNeckZOffset = {0.0520},
subject_footWidth = {0.1130},
},
},
gravity = { 0, 0, -9.81,},
configuration = {
axis_front = { 1, 0, 0,},
axis_right = { 0, -1, 0,},
axis_up = { 0, 0, 1,},
},
points = {
{name = "Pelvis_L", body = "Pelvis", point = {0.000000, 0.165808, 0.116066,},},
{name = "Pelvis_R", body = "Pelvis", point = {0.000000, -0.165808, 0.116066,},},
{name = "Pelvis_Back", body = "Pelvis", point = {-0.124356, 0.000000, 0.116066,},},
{name = "Pelvis_Front", body = "Pelvis", point = {0.124356, 0.000000, 0.116066,},},
{name = "Thigh_R", body = "Thigh_R", point = {0.067328, -0.000000, -0.252481,},},
{name = "Heel_Medial_R", body = "Foot_R", point = {-0.081000, 0.056500, -0.075000,},},
{name = "Heel_Lateral_R", body = "Foot_R", point = {-0.081000, -0.056500, -0.075000,},},
{name = "Toe_R", body = "Foot_R", point = {0.075422, 0.000000, -0.075000,},},
{name = "Thigh_L", body = "Thigh_L", point = {0.067328, 0.000000, -0.252481,},},
{name = "Heel_Medial_L", body = "Foot_L", point = {-0.081000, -0.056500, -0.075000,},},
{name = "Heel_Lateral_L", body = "Foot_L", point = {-0.081000, 0.056500, -0.075000,},},
{name = "Toe_L", body = "Foot_L", point = {0.075422, 0.000000, -0.075000,},},
{name = "UpperTrunk_Front", body = "UpperTrunk", point = {0.083315, 0.000000, 0.062486,},},
{name = "UpperTrunk_Back", body = "UpperTrunk", point = {-0.093730, 0.000000, 0.083315,},},
{name = "ProximalMetacarpal_Medial_R", body = "Hand_R", point = {-0.031079, 0.023309, -0.031079,},},
{name = "ProximalMetacarpal_Lateral_R", body = "Hand_R", point = {0.031079, 0.023309, -0.031079,},},
{name = "DistalMetacarpal_Medial_R", body = "Hand_R", point = {-0.031079, 0.023309, -0.093236,},},
{name = "DistalMetacarpal_Lateral_R", body = "Hand_R", point = {0.031079, 0.023309, -0.093236,},},
{name = "ProximalMetacarpal_Medial_L", body = "Hand_L", point = {-0.031079, -0.023309, -0.031079,},},
{name = "ProximalMetacarpal_Lateral_L", body = "Hand_L", point = {0.031079, -0.023309, -0.031079,},},
{name = "DistalMetacarpal_Medial_L", body = "Hand_L", point = {-0.031079, -0.023309, -0.093236,},},
{name = "DistalMetacarpal_Lateral_L", body = "Hand_L", point = {0.031079, -0.023309, -0.093236,},},
},
constraint_sets = {
},
frames = {
{name = "Pelvis",
parent = "ROOT",
joint_frame = {
r = { 0.000000, 0.000000, 0.000000,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 6.609100,
com = { 0.000000, 0.000000, 0.084231,},
inertia =
{{ 0.034067, 0.000000, 0.000000,},
{ 0.000000, 0.029363, 0.000000,},
{ 0.000000, 0.000000, 0.035820,},},
},
joint =
{{ 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000,},
{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_IAS = { 0.124356, 0.082904, 0.099485,},
R_IAS = { 0.124356, -0.082904, 0.099485,},
L_IPS = { -0.116066, 0.116066, 0.116066,},
R_IPS = { -0.116066, -0.116066, 0.116066,},},
visuals = {{
src = "pelvis.obj",
dimensions = { 0.245000, 0.306250, 0.248713,},
mesh_center = { 0.000000, 0.000000, 0.041452,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Thigh_R",
parent = "Pelvis",
joint_frame = {
r = { 0.000000, -0.093000, 0.000000,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 7.833400,
com = { 0.000000, 0.000000, -0.121595,},
inertia =
{{ 0.120875, 0.000000, 0.000000,},
{ 0.000000, 0.117622, 0.000000,},
{ 0.000000, 0.000000, 0.023298,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
R_FTC = { 0.000000, -0.067328, -0.111092,},
R_FLE = { 0.000000, -0.050496, -0.336641,},
R_FME = { 0.000000, 0.050496, -0.336641,},},
visuals = {{
src = "thighR.obj",
dimensions = { 0.168321, 0.134656, 0.403969,},
mesh_center = { 0.000000, 0.000000, -0.168321,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Shank_R",
parent = "Thigh_R",
joint_frame = {
r = { 0.000000, 0.000000, -0.336641,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 2.549300,
com = { 0.000000, 0.000000, -0.174376,},
inertia =
{{ 0.029177, 0.000000, 0.000000,},
{ 0.000000, 0.028309, 0.000000,},
{ 0.000000, 0.000000, 0.003464,},},
},
joint =
{ { 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
R_FAX = { 0.000000, -0.080136, -0.020034,},
R_TTC = { 0.020034, 0.000000, -0.060102,},
R_FAL = { 0.000000, -0.060102, -0.400681,},
R_TAM = { 0.000000, 0.060102, -0.400681,},},
visuals = {{
src = "shankR.obj",
dimensions = { 0.120204, 0.120204, 0.480817,},
mesh_center = { 0.000000, 0.000000, -0.200340,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Foot_R",
parent = "Shank_R",
joint_frame = {
r = { 0.000000, 0.000000, -0.400681,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 0.683700,
com = { 0.002717, 0.000000, -0.037500,},
inertia =
{{ 0.002659, 0.000000, 0.000000,},
{ 0.000000, 0.002315, 0.000000,},
{ 0.000000, 0.000000, 0.000575,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
R_FM1 = { 0.145994, 0.020856, -0.031284,},
R_FM2 = { 0.145994, 0.000000, -0.031284,},
R_FM5 = { 0.145994, -0.020856, -0.031284,},
R_FCC = { -0.062569, 0.000000, -0.031284,},},
visuals = {{
src = "footR.obj",
dimensions = { 0.208562, 0.113000, 0.075000,},
mesh_center = { 0.023281, 0.000000, -0.037500,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Thigh_L",
parent = "Pelvis",
joint_frame = {
r = { 0.000000, 0.093000, 0.000000,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 7.833400,
com = { 0.000000, 0.000000, -0.121595,},
inertia =
{{ 0.120875, 0.000000, 0.000000,},
{ 0.000000, 0.117622, 0.000000,},
{ 0.000000, 0.000000, 0.023298,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_FTC = { 0.000000, 0.067328, -0.111092,},
L_FLE = { 0.000000, 0.050496, -0.336641,},
L_FME = { 0.000000, -0.050496, -0.336641,},},
visuals = {{
src = "thighL.obj",
dimensions = { 0.168321, 0.134656, 0.403969,},
mesh_center = { 0.000000, 0.000000, -0.168321,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Shank_L",
parent = "Thigh_L",
joint_frame = {
r = { 0.000000, 0.000000, -0.336641,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 2.549300,
com = { 0.000000, 0.000000, -0.174376,},
inertia =
{{ 0.029177, 0.000000, 0.000000,},
{ 0.000000, 0.028309, 0.000000,},
{ 0.000000, 0.000000, 0.003464,},},
},
joint =
{ { 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_FAX = { 0.000000, 0.080136, -0.020034,},
L_TTC = { 0.020034, 0.000000, -0.060102,},
L_FAL = { 0.000000, 0.060102, -0.400681,},
L_TAM = { 0.000000, -0.060102, -0.400681,},},
visuals = {{
src = "shankL.obj",
dimensions = { 0.120204, 0.120204, 0.480817,},
mesh_center = { 0.000000, 0.000000, -0.200340,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Foot_L",
parent = "Shank_L",
joint_frame = {
r = { 0.000000, 0.000000, -0.400681,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 0.683700,
com = { 0.002717, 0.000000, -0.037500,},
inertia =
{{ 0.002659, 0.000000, 0.000000,},
{ 0.000000, 0.002315, 0.000000,},
{ 0.000000, 0.000000, 0.000575,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_FM1 = { 0.145994, -0.020856, -0.031284,},
L_FM2 = { 0.145994, 0.000000, -0.031284,},
L_FM5 = { 0.145994, 0.020856, -0.031284,},
L_FCC = { -0.062569, 0.000000, -0.031284,},},
visuals = {{
src = "footL.obj",
dimensions = { 0.208562, 0.113000, 0.075000,},
mesh_center = { 0.023281, 0.000000, -0.037500,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "MiddleTrunk",
parent = "Pelvis",
joint_frame = {
r = { 0.000000, 0.000000, 0.165808,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 7.764500,
com = { 0.000000, 0.000000, 0.102928,},
inertia =
{{ 0.051207, 0.000000, 0.000000,},
{ 0.000000, 0.034226, 0.000000,},
{ 0.000000, 0.000000, 0.047038,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
SXS = { 0.093775, 0.000000, 0.093775,},
MAI = { -0.093775, 0.000000, 0.093775,},
LV1 = { -0.093775, 0.000000, 0.000000,},
LV3 = { -0.093775, 0.000000, -0.046888,},},
visuals = {{
src = "middleTrunk.obj",
dimensions = { 0.220500, 0.269500, 0.281326,},
mesh_center = { 0.000000, 0.000000, 0.046888,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "UpperTrunk",
parent = "MiddleTrunk",
joint_frame = {
r = { 0.000000, 0.000000, 0.187551,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 8.188500,
com = { 0.000000, 0.000000, 0.103103,},
inertia =
{{ 0.077145, 0.000000, 0.000000,},
{ 0.000000, 0.035026, 0.000000,},
{ 0.000000, 0.000000, 0.071619,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
CV7 = { -0.083315, 0.000000, 0.166631,},
SJN = { 0.087481, 0.000000, 0.124973,},
TV2 = { -0.083315, 0.000000, 0.124973,},},
visuals = {{
src = "upperTrunk.obj",
dimensions = { 0.166950, 0.318000, 0.218703,},
mesh_center = { 0.000000, 0.000000, 0.083315,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Head",
parent = "UpperTrunk",
joint_frame = {
r = { 0.000000, 0.000000, 0.208288,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 3.540400,
com = { 0.000000, 0.000000, 0.114855,},
inertia =
{{ 0.012887, 0.000000, 0.000000,},
{ 0.000000, 0.015271, 0.000000,},
{ 0.000000, 0.000000, 0.011954,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_HEAD = { 0.000000, 0.066789, 0.133579,},
R_HEAD = { 0.000000, -0.066789, 0.133579,},
SGL = { 0.066789, 0.000000, 0.133579,},},
visuals = {{
src = "head.obj",
dimensions = { 0.178105, 0.178105, 0.233762,},
mesh_center = { 0.000000, 0.000000, 0.089052,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "UpperArm_R",
parent = "UpperTrunk",
joint_frame = {
r = { 0.000000, -0.159000, 0.156288,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 1.351500,
com = { 0.000000, 0.000000, -0.144607,},
inertia =
{{ 0.006597, 0.000000, 0.000000,},
{ 0.000000, 0.005770, 0.000000,},
{ 0.000000, 0.000000, 0.001870,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
R_SAE = { 0.000000, 0.000000, 0.025132,},
R_HUM = { 0.000000, -0.037697, -0.168382,},
R_HLE = { 0.000000, -0.037697, -0.251316,},},
visuals = {{
src = "upperArmR.obj",
dimensions = { 0.125658, 0.100526, 0.276448,},
mesh_center = { 0.000000, 0.000000, -0.125658,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "LowerArm_R",
parent = "UpperArm_R",
joint_frame = {
r = { 0.000000, 0.000000, -0.251316,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 0.731400,
com = { 0.000000, 0.000000, -0.110077,},
inertia =
{{ 0.002905, 0.000000, 0.000000,},
{ 0.000000, 0.002816, 0.000000,},
{ 0.000000, 0.000000, 0.000377,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
R_USP = { 0.048290, 0.000000, -0.241450,},
R_RSP = { -0.048290, 0.000000, -0.241450,},},
visuals = {{
src = "lowerArmR.obj",
dimensions = { 0.096580, 0.072435, 0.265595,},
mesh_center = { 0.000000, 0.000000, -0.120725,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Hand_R",
parent = "LowerArm_R",
joint_frame = {
r = { 0.000000, 0.000000, -0.241450,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 0.296800,
com = { 0.000000, 0.000000, -0.053254,},
inertia =
{{ 0.000427, 0.000000, 0.000000,},
{ 0.000000, 0.000310, 0.000000,},
{ 0.000000, 0.000000, 0.000170,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
R_HM2 = { 0.000000, 0.000000, -0.124315,},},
visuals = {{
src = "handR.obj",
dimensions = { 0.108776, 0.046618, 0.155394,},
mesh_center = { 0.000000, 0.000000, -0.077697,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "UpperArm_L",
parent = "UpperTrunk",
joint_frame = {
r = { 0.000000, 0.159000, 0.156288,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 1.351500,
com = { 0.000000, 0.000000, -0.144607,},
inertia =
{{ 0.006597, 0.000000, 0.000000,},
{ 0.000000, 0.005770, 0.000000,},
{ 0.000000, 0.000000, 0.001870,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_SAE = { 0.000000, 0.000000, 0.025132,},
L_HUM = { 0.000000, 0.037697, -0.125658,},
L_HLE = { 0.000000, 0.037697, -0.251316,},},
visuals = {{
src = "upperArmL.obj",
dimensions = { 0.125658, 0.100526, 0.276448,},
mesh_center = { 0.000000, -0.000000, -0.125658,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "LowerArm_L",
parent = "UpperArm_L",
joint_frame = {
r = { 0.000000, 0.000000, -0.251316,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 0.731400,
com = { 0.000000, 0.000000, -0.110077,},
inertia =
{{ 0.002905, 0.000000, 0.000000,},
{ 0.000000, 0.002816, 0.000000,},
{ 0.000000, 0.000000, 0.000377,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_USP = { -0.048290, 0.000000, -0.241450,},
L_RSP = { 0.048290, 0.000000, -0.241450,},},
visuals = {{
src = "lowerArmL.obj",
dimensions = { 0.096580, 0.072435, 0.265595,},
mesh_center = { 0.000000, 0.000000, -0.120725,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
{name = "Hand_L",
parent = "LowerArm_L",
joint_frame = {
r = { 0.000000, 0.000000, -0.241450,},
E =
{{ 1.000000, 0.000000, 0.000000,},
{ 0.000000, 1.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000,},},
},
body = {
mass = 0.296800,
com = { 0.000000, 0.000000, -0.053254,},
inertia =
{{ 0.000427, 0.000000, 0.000000,},
{ 0.000000, 0.000310, 0.000000,},
{ 0.000000, 0.000000, 0.000170,},},
},
joint =
{{ 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000,},
{ 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000,},},
markers = {
L_HM2 = { 0.000000, 0.000000, -0.124315,},},
visuals = {{
src = "handL.obj",
dimensions = { 0.108776, 0.046618, 0.155394,},
mesh_center = { 0.000000, 0.000000, -0.077697,},
color = { 0.200000, 0.700000, 0.300000,},
},},
},
},
} |
--[[
_____ _ _ __ __ _____ _____ _____ ______ _______ ______ _____ ______ __ ____ _ _ _____ ____ _ _ ________ ________ _____ _ _ _______ ____ _____
| __ \| | | | \/ | __ \ / ____| __ \| ____| /\|__ __| ____| __ \ | _ \ \ / / / __ \| \ | |_ _/ __ \| \ | | | ____\ \ / / ____/ ____| | | |__ __/ __ \| __ \
| | | | | | | \ / | |__) | | | | |__) | |__ / \ | | | |__ | | | | | |_) \ \_/ / | | | | \| | | || | | | \| | | |__ \ V /| |__ | | | | | | | | | | | | |__) |
| | | | | | | |\/| | ___/ | | | _ /| __| / /\ \ | | | __| | | | | | _ < \ / | | | | . ` | | || | | | . ` | | __| > < | __|| | | | | | | | | | | | _ /
| |__| | |__| | | | | | | |____| | \ \| |____ / ____ \| | | |____| |__| | | |_) | | | | |__| | |\ |_| || |__| | |\ | | |____ / . \| |___| |____| |__| | | | | |__| | | \ \
|_____/ \____/|_| |_|_| \_____|_| \_\______/_/ \_\_| |______|_____/ |____/ |_| \____/|_| \_|_____\____/|_| \_| |______/_/ \_\______\_____|\____/ |_| \____/|_| \_\
]]
Locales ['pl'] = {
['valid_purchase'] = 'Potwierdzić zakup?',
['yes'] = 'Tak',
['no'] = 'Nie',
['helmet'] = 'Hełm / Czapka',
['ears'] = 'Akcesoria na uszy',
['mask'] = 'Maska',
['glasses'] = 'Okulary',
['set_unset'] = 'Załóż / Zdejmij',
['not_enough_money'] = 'Nie masz wystarczającej ilości pieniędzy',
['press_access'] = 'Naciśnij ~INPUT_CONTEXT~ aby przejrzeć ofertę',
['accessories_blip'] = 'Akcesoria',
['no_helmet'] = 'Nie posiadasz hełmu / czapki',
['no_ears'] = 'Nie posiadasz akcesorium na uszy',
['no_mask'] = 'Nie posiadasz maski',
['no_glasses'] = 'Nie posiadasz okularów',
['you_paid'] = 'Zapłacono '
} |
reptilian_life_stealer = Creature:new {
objectName = "@mob/creature_names:reptilian_life_stealer",
socialGroup = "reptilian_flier",
faction = "",
level = 65,
chanceHit = 3.25,
damageMin = 945,
damageMax = 1600,
baseXp = 11859,
baseHAM = 34000,
baseHAMmax = 42000,
armor = 2,
resists = {0,125,105,200,200,-1,0,0,-1},
meatType = "meat_avian",
meatAmount = 135,
hideType = "hide_leathery",
hideAmount = 90,
boneType = "bone_avian",
boneAmount = 85,
milk = 0,
tamingChance = 0.25,
ferocity = 0,
pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY,
creatureBitmask = PACK + KILLER,
optionsBitmask = AIENABLED,
diet = CARNIVORE,
templates = {"object/mobile/reptilian_flier_hue.iff"},
hues = { 24, 25, 26, 27, 28, 29, 30, 31 },
scale = 1.5,
lootGroups = {},
weapons = {},
conversationTemplate = "",
attacks = {
{"strongpoison",""},
{"blindattack",""}
}
}
CreatureTemplates:addCreatureTemplate(reptilian_life_stealer, "reptilian_life_stealer")
|
require("firecast.lua");
local __o_rrpgObjs = require("rrpgObjs.lua");
require("rrpgGUI.lua");
require("rrpgDialogs.lua");
require("rrpgLFM.lua");
require("ndb.lua");
require("locale.lua");
local __o_Utils = require("utils.lua");
local function constructNew_frmGerTablesDock()
local obj = GUI.fromHandle(_obj_newObject("popupForm"));
local self = obj;
local sheet = nil;
rawset(obj, "_oldSetNodeObjectFunction", rawget(obj, "setNodeObject"));
function obj:setNodeObject(nodeObject)
sheet = nodeObject;
self.sheet = nodeObject;
self:_oldSetNodeObjectFunction(nodeObject);
end;
function obj:setNodeDatabase(nodeObject)
self:setNodeObject(nodeObject);
end;
_gui_assignInitialParentForForm(obj.handle);
obj:beginUpdate();
obj:setName("frmGerTablesDock");
obj:setTitle("Gerenciar Janelas Acopláveis");
obj:setWidth(300);
obj:setHeight(300);
obj:setResizable(true);
require("utils.lua");
local plugins = require("plugins.lua");
local inicializado = false;
local listenerPInstall;
local listenerPUninstall;
local listenerUserClosed;
local function inicializar()
self:setNodeObject(NDB.newMemNodeDatabase());
inicializado = true;
end;
local function carregarTablesDock()
if not inicializado then
inicializar();
end;
local tds = Firecast.Plugins.getInstalledTablesDock();
table.sort(tds,
function(l, r)
return Utils.compareStringPtBr(l.title, r.title) < 0;
end);
for i = 1, #tds, 1 do
local td = tds[i];
td.ativo = plugins.getIsTablesDockActive(self.mesa, td.moduleId, td.name);
end;
sheet.tablesDock = tds;
end;
obj.label1 = GUI.fromHandle(_obj_newObject("label"));
obj.label1:setParent(obj);
obj.label1:setText("Janelas Acopláveis");
obj.label1:setName("label1");
obj.label1:setFontSize(15);
obj.label1:setFontColor("#FFCC66");
obj.label1:setMargins({left=4, right=4, top=3, bottom=3});
obj.label1:setHorzTextAlign("leading");
obj.label1:setAlign("top");
obj.label1:setAutoSize(true);
obj.layout1 = GUI.fromHandle(_obj_newObject("layout"));
obj.layout1:setParent(obj);
obj.layout1:setName("layout1");
obj.layout1:setAlign("client");
obj.layout1:setMargins({left=12, right=12, top=1, bottom=5});
obj.rclTablesDock = GUI.fromHandle(_obj_newObject("recordList"));
obj.rclTablesDock:setParent(obj.layout1);
obj.rclTablesDock:setName("rclTablesDock");
obj.rclTablesDock:setAlign("client");
obj.rclTablesDock:setField("tablesDock");
obj.rclTablesDock:setTemplateForm("frmTableDockItem");
inicializar();
obj._e_event0 = obj:addEventListener("onNodeReady",
function (_)
carregarTablesDock();
listenerPInstall = Firecast.Messaging.listen("PluginInstalled", carregarTablesDock);
listenerPUninstall = Firecast.Messaging.listen("PluginUninstalled", carregarTablesDock);
listenerUserClosed = Firecast.Messaging.listen("TablesDockClosedByUser", carregarTablesDock);
end, obj);
obj._e_event1 = obj:addEventListener("onHide",
function (_)
Firecast.Messaging.unlisten(listenerUserClosed);
Firecast.Messaging.unlisten(listenerPInstall);
Firecast.Messaging.unlisten(listenerPUninstall);
end, obj);
obj._e_event2 = obj.rclTablesDock:addEventListener("onItemAdded",
function (_, node, form)
form.mesa = self.mesa;
form.loadTDFunction = self.loadTDFunction;
form.unloadTDFunction = self.unloadTDFunction;
end, obj);
obj._e_event3 = obj.rclTablesDock:addEventListener("onItemRemoved",
function (_, node, form)
form.unloadTDFunction = nil;
form.loadTDFunction = nil;
form.mesa = nil;
end, obj);
function obj:_releaseEvents()
__o_rrpgObjs.removeEventListenerById(self._e_event3);
__o_rrpgObjs.removeEventListenerById(self._e_event2);
__o_rrpgObjs.removeEventListenerById(self._e_event1);
__o_rrpgObjs.removeEventListenerById(self._e_event0);
end;
obj._oldLFMDestroy = obj.destroy;
function obj:destroy()
self:_releaseEvents();
if (self.handle ~= 0) and (self.setNodeDatabase ~= nil) then
self:setNodeDatabase(nil);
end;
if self.layout1 ~= nil then self.layout1:destroy(); self.layout1 = nil; end;
if self.rclTablesDock ~= nil then self.rclTablesDock:destroy(); self.rclTablesDock = nil; end;
if self.label1 ~= nil then self.label1:destroy(); self.label1 = nil; end;
self:_oldLFMDestroy();
end;
obj:endUpdate();
return obj;
end;
function newfrmGerTablesDock()
local retObj = nil;
__o_rrpgObjs.beginObjectsLoading();
__o_Utils.tryFinally(
function()
retObj = constructNew_frmGerTablesDock();
end,
function()
__o_rrpgObjs.endObjectsLoading();
end);
assert(retObj ~= nil);
return retObj;
end;
local _frmGerTablesDock = {
newEditor = newfrmGerTablesDock,
new = newfrmGerTablesDock,
name = "frmGerTablesDock",
dataType = "",
formType = "undefined",
formComponentName = "popupForm",
title = "Gerenciar Janelas Acopláveis",
description=""};
frmGerTablesDock = _frmGerTablesDock;
Firecast.registrarForm(_frmGerTablesDock);
return _frmGerTablesDock;
|
-- area {
-- x, y, width, height
-- parent_id
-- parent_cid
-- parent_x_shares
-- parent_y_shares
-- habitable
-- hole (unique)
-- }
--
-- split {
-- method
-- x_shares
-- y_shares
-- children
-- }
--
-- share {weight, adjustment, dynamic, minimum}
local in_module = ...
-- Split a length by `measures`, such that each split respect the
-- weight [1], adjustment (user [2] + engine [3]) without breaking the minimum size [4].
--
-- The split algorithm has a worst case of O(n^2) where n = #shares,
-- which should be fine for practical usage of screen partitions.
-- Using geometric algorithm this can be optimized to O(n log n), but
-- I don't think it is worth.
-- Returns two values:
-- 1. the (accumulative) result if it is possible to give every share its minimum size, otherwise nil.
-- 2. any spare space to adjust without capping any share.
local function fair_split(length, shares)
local ret = {}
local normalized_adj = nil
local sum_weight
local sum_adj
local remaining = #shares
local spare = nil
local need_recompute = false
repeat
sum_weight = 0
sum_adj = 0
for i = 1, #shares do
if ret[i] == nil then
sum_weight = sum_weight + shares[i][1]
if normalized_adj then
sum_adj = sum_adj + normalized_adj[i]
end
end
end
if normalized_adj == nil then
normalized_adj = {}
for i = 1, #shares do
if sum_weight > shares[i][1] then
normalized_adj[i] = ((shares[i][2] or 0) + (shares[i][3] or 0)) * sum_weight / (sum_weight - shares[i][1])
else
normalized_adj[i] = 0
end
sum_adj = sum_adj + normalized_adj[i]
end
for i = 1, #shares do
local required = (shares[i][4] - normalized_adj[i]) * sum_weight / shares[i][1] + sum_adj
if spare == nil or spare > length - required then
spare = length - required
end
end
end
local capped_length = 0
for i = 1, #shares do
if ret[i] == nil then
local split = (length - sum_adj) * shares[i][1] / sum_weight + normalized_adj[i]
if split < shares[i][4] then
ret[i] = shares[i][4]
capped_length = capped_length + shares[i][4]
need_recompute = true
end
end
end
length = length - capped_length
until not need_recompute
if #shares == 1 or spare < 0 then
spare = 0
end
if remaining == 0 then
return nil, spare
end
local acc_weight = 0
local acc_adj = 0
local acc_ret = 0
for i = 1, #shares do
if ret[i] == nil then
acc_weight = acc_weight + shares[i][1]
acc_adj = acc_adj + normalized_adj[i]
ret[i] = remaining == 1 and length - acc_ret or math.floor((length - sum_adj) / sum_weight * acc_weight + acc_adj - acc_ret + 0.5)
acc_ret = acc_ret + ret[i]
remaining = remaining - 1
end
end
ret[0] = 0
for i = 1, #shares do
ret[i] = ret[i - 1] + ret[i]
end
return ret, spare
end
-- Static data
-- Command character info
-- 3 for taking the arg string and an open area
-- 2 for taking an open area
-- 1 for taking nothing
-- 0 for args
local ch_info = {
["h"] = 3, ["H"] = 3,
["v"] = 3, ["V"] = 3,
["w"] = 3, ["W"] = 3,
["d"] = 3, ["D"] = 3,
["s"] = 3,
["t"] = 3,
["c"] = 3,
["x"] = 3,
["-"] = 2,
["/"] = 2,
["."] = 1,
[";"] = 1,
["0"] = 0, ["1"] = 0, ["2"] = 0, ["3"] = 0, ["4"] = 0,
["5"] = 0, ["6"] = 0, ["7"] = 0, ["8"] = 0, ["9"] = 0,
["_"] = 0, [","] = 0,
}
local function parse_arg_str(arg_str, default)
local ret = {}
local current = {}
if #arg_str == 0 then return ret end
local index = 1
local split_mode = arg_str:find("[,_]") ~= nil
local p = index
while index <= #arg_str do
local ch = arg_str:sub(index, index)
if split_mode then
if ch == "_" then
local r = tonumber(arg_str:sub(p, index - 1))
if r == nil then
current[#current + 1] = default
else
current[#current + 1] = r
end
p = index + 1
elseif ch == "," then
local r = tonumber(arg_str:sub(p, index - 1))
if r == nil then
current[#current + 1] = default
else
current[#current + 1] = r
end
ret[#ret + 1] = current
current = {}
p = index + 1
end
else
local r = tonumber(ch)
if r == nil then
ret[#ret + 1] = {default}
else
ret[#ret + 1] = {r}
end
end
index = index + 1
end
if split_mode then
local r = tonumber(arg_str:sub(p, index - 1))
if r == nil then
current[#current + 1] = default
else
current[#current + 1] = r
end
ret[#ret + 1] = current
end
return ret
end
if not in_module then
print("Testing parse_arg_str")
local x = parse_arg_str("1234", 0)
assert(#x == 4)
assert(#x[1] == 1 and x[1][1] == 1)
assert(#x[2] == 1 and x[2][1] == 2)
assert(#x[3] == 1 and x[3][1] == 3)
assert(#x[4] == 1 and x[4][1] == 4)
local x = parse_arg_str("12_34_,", -1)
assert(#x == 2)
assert(#x[1] == 3 and x[1][1] == 12 and x[1][2] == 34 and x[1][3] == -1)
assert(#x[2] == 1 and x[2][1] == -1)
local x = parse_arg_str("12_34,56_,78_90_", -1)
assert(#x == 3)
assert(#x[1] == 2 and x[1][1] == 12 and x[1][2] == 34)
assert(#x[2] == 2 and x[2][1] == 56 and x[2][2] == -1)
assert(#x[3] == 3 and x[3][1] == 78 and x[3][2] == 90 and x[3][3] == -1)
print("Passed.")
end
local max_split = 1000
local max_areas = 10000
local default_expansion = 2
-- Execute a (partial) command, returns:
-- 1. Closed areas: areas that will not be further partitioned by further input.
-- 2. Open areas: areas that can be further partitioned.
-- 3. Pending: if the command can take more argument into the last command.
local function areas_from_command(command, workarea, minimum)
local pending_op = nil
local arg_str = ""
local closed_areas = {}
local open_areas
local root = {
expansion = default_expansion,
x = workarea.x,
y = workarea.y,
width = workarea.width,
height = workarea.height,
bl = true,
br = true,
bu = true,
bd = true,
}
local function close_area()
local a = open_areas[#open_areas]
table.remove(open_areas, #open_areas)
local i = #closed_areas + 1
closed_areas[i] = a
a.id = i
a.habitable = true
return a, i
end
local function push_open_areas(areas)
for i = #areas, 1, -1 do
open_areas[#open_areas + 1] = areas[i]
end
end
local function handle_op(method)
local l = method:lower()
local alt = method ~= l
method = l
if method == "h" or method == "v" then
local args = parse_arg_str(arg_str, 0)
if #args == 0 then
args = {{1}, {1}}
elseif #args == 1 then
args[2] = {1}
end
local total = 0
local shares = { }
for i = 1, #args do
local arg
if not alt then
arg = args[i]
else
arg = args[#args - i + 1]
end
if arg[2] == 0 and arg[3] then arg[2], arg[3] = -arg[3], nil end
shares[i] = arg
end
if #shares > max_split then
return nil
end
local a, area_index = close_area()
a.habitable = false
a.split = {
method = method,
x_shares = method == "h" and shares or {{1}},
y_shares = method == "v" and shares or {{1}},
children = {}
}
local children = a.split.children
if method == "h" then
for i = 1, #a.split.x_shares do
local child = {
parent_id = area_index,
parent_cid = #children + 1,
parent_x_shares = #children + 1,
parent_y_shares = 1,
expansion = a.expansion - 1,
bl = i == 1 and a.bl or false,
br = i == #a.split.x_shares and a.br or false,
bu = a.bu,
bd = a.bd,
}
children[#children + 1] = child
end
else
for i = 1, #a.split.y_shares do
local child = {
parent_id = area_index,
parent_cid = #children + 1,
parent_x_shares = 1,
parent_y_shares = #children + 1,
expansion = a.expansion - 1,
bl = a.bl,
br = a.br,
bu = i == 1 and a.bu or false,
bd = i == #a.split.y_shares and a.bd or false,
}
children[#children + 1] = child
end
end
push_open_areas(children)
elseif method == "w" or method == "d" then
local args = parse_arg_str(arg_str, 0)
local x_shares = {}
local y_shares = {}
local m_start = #args + 1
if method == "w" then
if #args == 0 then
args = {{1}, {1}}
elseif #args == 1 then
args[2] = {1}
end
local x_shares_count, y_shares_count
if alt then
x_shares_count = args[2][1]
y_shares_count = args[1][1]
else
x_shares_count = args[1][1]
y_shares_count = args[2][1]
end
if x_shares_count < 1 then x_shares_count = 1 end
if y_shares_count < 1 then y_shares_count = 1 end
if x_shares_count * y_shares_count > max_split then
return nil
end
for i = 1, x_shares_count do x_shares[i] = {1} end
for i = 1, y_shares_count do y_shares[i] = {1} end
m_start = 3
else
local current = x_shares
for i = 1, #args do
if not alt then
arg = args[i]
else
arg = args[#args - i + 1]
end
if arg[1] == 0 then
if current == x_shares then current = y_shares else
m_start = i + 1
break
end
else
if arg[2] == 0 and arg[3] then arg[2], arg[3] = -arg[3], nil end
current[#current + 1] = arg
end
end
if #x_shares == 0 then
x_shares = {{1}}
end
if #y_shares == 0 then
y_shares = {{1}}
end
if #x_shares * #y_shares > max_split then
return nil
end
end
local a, area_index = close_area()
a.habitable = false
a.split = {
method = method,
x_shares = x_shares,
y_shares = y_shares,
children = {},
}
local children = {}
for y_index = 1, #a.split.y_shares do
for x_index = 1, #a.split.x_shares do
local r = {
parent_id = area_index,
-- parent_cid will be filled later.
parent_x_shares = x_index,
parent_y_shares = y_index,
expansion = a.expansion - 1
}
if x_index == 1 then r.bl = a.bl else r.bl = false end
if x_index == #a.split.x_shares then r.br = a.br else r.br = false end
if y_index == 1 then r.bu = a.bu else r.bu = false end
if y_index == #a.split.y_shares then r.bd = a.bd else r.bd = false end
children[#children + 1] = r
end
end
local merged_children = {}
local start_index = 1
for i = m_start, #args - 1, 2 do
-- find the first index that is not merged
while start_index <= #children and children[start_index] == false do
start_index = start_index + 1
end
if start_index > #children or children[start_index] == false then
break
end
local x = (start_index - 1) % #x_shares
local y = math.floor((start_index - 1) / #x_shares)
local w = args[i][1]
local h = args[i + 1][1]
if w < 1 then w = 1 end
if h == nil or h < 1 then h = 1 end
if alt then
local tmp = w
w = h
h = tmp
end
if x + w > #x_shares then w = #x_shares - x end
if y + h > #y_shares then h = #y_shares - y end
local end_index = start_index
for ty = y, y + h - 1 do
local succ = true
for tx = x, x + w - 1 do
if children[ty * #x_shares + tx + 1] == false then
succ = false
break
elseif ty == y then
end_index = ty * #x_shares + tx + 1
end
end
if not succ then
break
elseif ty > y then
end_index = ty * #x_shares + x + w
end
end
local function generate_range(s, e)
local r = {} for i = s, e do r[#r+1] = i end return r
end
local r = {
bu = children[start_index].bu, bl = children[start_index].bl,
bd = children[end_index].bd, br = children[end_index].br,
parent_id = area_index,
-- parent_cid will be filled later.
parent_x_shares = generate_range(children[start_index].parent_x_shares, children[end_index].parent_x_shares),
parent_y_shares = generate_range(children[start_index].parent_y_shares, children[end_index].parent_y_shares),
expansion = a.expansion - 1
}
merged_children[#merged_children + 1] = r
for ty = y, y + h - 1 do
local succ = true
for tx = x, x + w - 1 do
local index = ty * #x_shares + tx + 1
if index <= end_index then
children[index] = false
else
break
end
end
end
end
for i = 1, #merged_children do
a.split.children[#a.split.children + 1] = merged_children[i]
a.split.children[#a.split.children].parent_cid = #a.split.children
end
-- clean up children, remove all `false'
for i = 1, #children do
if children[i] ~= false then
a.split.children[#a.split.children + 1] = children[i]
a.split.children[#a.split.children].parent_cid = #a.split.children
end
end
push_open_areas(a.split.children)
elseif method == "s" then
if #open_areas > 0 then
local times = arg_str == "" and 1 or tonumber(arg_str)
local t = {}
local c = #open_areas
local p = open_areas[c].parent_id
while c > 0 and open_areas[c].parent_id == p do
t[#t + 1] = open_areas[c]
open_areas[c] = nil
c = c - 1
end
for i = #t, 1, -1 do
open_areas[c + 1] = t[(i + times - 1) % #t + 1]
c = c + 1
end
end
elseif method == "t" then
if #open_areas > 0 then
open_areas[#open_areas].expansion = tonumber(arg_str) or default_expansion
end
elseif method == "x" then
local a = close_area()
a.layout = arg_str
elseif method == "-" then
close_area()
elseif method == "." then
while #open_areas > 0 do
close_area()
end
elseif method == "c" then
local limit = tonumber(arg_str)
if limit == nil or limit > #open_areas then
limit = #open_areas
end
local p = open_areas[#open_areas].parent_id
while limit > 0 and open_areas[#open_areas].parent_id == p do
close_area()
limit = limit - 1
end
elseif method == "/" then
close_area().habitable = false
elseif method == ";" then
-- nothing
end
if #open_areas + #closed_areas > max_areas then
return nil
end
while #open_areas > 0 and open_areas[#open_areas].expansion <= 0 do
close_area()
end
arg_str = ""
return true
end
open_areas = {root}
for i = 1, #command do
local ch = command:sub(i, i)
local t = ch_info[ch]
local r = true
if t == nil then
return nil
elseif t == 3 then
if pending_op ~= nil then
r = handle_op(pending_op)
pending_op = nil
end
if #open_areas == 0 then return nil end
if arg_str == "" then
pending_op = ch
else
r = handle_op(ch)
end
elseif t == 2 or t == 1 then
if pending_op ~= nil then
handle_op(pending_op)
pending_op = nil
end
if #open_areas == 0 and t == 2 then return nil end
r = handle_op(ch)
elseif t == 0 then
arg_str = arg_str..ch
end
if not r then return nil end
end
if pending_op ~= nil then
if not handle_op(pending_op) then
return nil
end
end
if #closed_areas == 0 then
return closed_areas, open_areas, pending_op ~= nil
end
local old_closed_areas = closed_areas
closed_areas = {}
local function reorder_and_fill_adj_min(old_id)
local a = old_closed_areas[old_id]
closed_areas[#closed_areas + 1] = a
a.id = #closed_areas
if a.split then
for i = 1, #a.split.x_shares do
a.split.x_shares[i][3] = 0
a.split.x_shares[i][4] = minimum
end
for i = 1, #a.split.y_shares do
a.split.y_shares[i][3] = 0
a.split.y_shares[i][4] = minimum
end
for _, c in ipairs(a.split.children) do
if c.id then
reorder_and_fill_adj_min(c.id)
end
local x_minimum, y_minimum
if c.split then
x_minimum, y_minimum = c.x_minimum, c.y_minimum
else
x_minimum, y_minimum =
minimum, minimum
end
if type(c.parent_x_shares) == "table" then
local x_minimum_split = math.ceil(x_minimum / #c.parent_x_shares)
for i = 1, #c.parent_x_shares do
if a.split.x_shares[c.parent_x_shares[i]][4] < x_minimum_split then
a.split.x_shares[c.parent_x_shares[i]][4] = x_minimum_split
end
end
else
if a.split.x_shares[c.parent_x_shares][4] < x_minimum then
a.split.x_shares[c.parent_x_shares][4] = x_minimum
end
end
if type(c.parent_y_shares) == "table" then
local y_minimum_split = math.ceil(y_minimum / #c.parent_y_shares)
for i = 1, #c.parent_y_shares do
if a.split.y_shares[c.parent_y_shares[i]][4] < y_minimum_split then
a.split.y_shares[c.parent_y_shares[i]][4] = y_minimum_split
end
end
else
if a.split.y_shares[c.parent_y_shares][4] < y_minimum then
a.split.y_shares[c.parent_y_shares][4] = y_minimum
end
end
end
a.x_minimum = 0
a.x_total_weight = 0
for i = 1, #a.split.x_shares do
a.x_minimum = a.x_minimum + a.split.x_shares[i][4]
a.x_total_weight = a.x_total_weight + (a.split.x_shares[i][2] or 0)
end
a.y_minimum = 0
a.y_total_weight = 0
for i = 1, #a.split.y_shares do
a.y_minimum = a.y_minimum + a.split.y_shares[i][4]
a.y_total_weight = a.y_total_weight + (a.split.y_shares[i][2] or 0)
end
end
end
reorder_and_fill_adj_min(1)
-- For debugging
-- for i = 1, #closed_areas do
-- print(i, closed_areas[i].parent_id, closed_areas[i].parent_x_shares, closed_areas[i].parent_y_shares)
-- if closed_areas[i].split then
-- print("/", closed_areas[i].split.method, #closed_areas[i].split.x_shares, #closed_areas[i].split.y_shares)
-- for j = 1, #closed_areas[i].split.children do
-- print("->", closed_areas[i].split.children[j].id)
-- end
-- end
-- end
local orig_width = root.width
if root.x_minimum and root.width < root.x_minimum then
root.width = root.x_minimum
end
local orig_height = root.height
if root.y_minimum and root.height < root.y_minimum then
root.height = root.y_minimum
end
function split(id)
local a = closed_areas[id]
if a.split then
local x_shares, y_shares
x_shares, a.split.x_spare = fair_split(a.width, a.split.x_shares)
y_shares, a.split.y_spare = fair_split(a.height, a.split.y_shares)
for _, c in ipairs(a.split.children) do
if type(c.parent_x_shares) == "table" then
c.x = a.x + x_shares[c.parent_x_shares[1] - 1]
c.width = 0
for i = 1, #c.parent_x_shares do
c.width = c.width + x_shares[c.parent_x_shares[i]] - x_shares[c.parent_x_shares[i] - 1]
end
else
c.x = a.x + x_shares[c.parent_x_shares - 1]
c.width = x_shares[c.parent_x_shares] - x_shares[c.parent_x_shares - 1]
end
if type(c.parent_y_shares) == "table" then
c.y = a.y + y_shares[c.parent_y_shares[1] - 1]
c.height = 0
for i = 1, #c.parent_y_shares do
c.height = c.height + y_shares[c.parent_y_shares[i]] - y_shares[c.parent_y_shares[i] - 1]
end
else
c.y = a.y + y_shares[c.parent_y_shares - 1]
c.height = y_shares[c.parent_y_shares] - y_shares[c.parent_y_shares - 1]
end
if c.id then
split(c.id)
end
end
end
end
split(1)
for i = 1, #closed_areas do
if closed_areas[i].x + closed_areas[i].width > root.x + orig_width or
closed_areas[i].y + closed_areas[i].height > root.y + orig_height
then
closed_areas[i].habitable = false
end
end
for i = 1, #open_areas do
if open_areas[i].x + open_areas[i].width > root.x + orig_width or
open_areas[i].y + open_areas[i].height > root.y + orig_height
then
open_areas[i].habitable = false
end
end
return closed_areas, open_areas, pending_op ~= nil
end
local function areas_to_command(areas, to_embed, root_area)
root_area = root_area or 1
if #areas < root_area then return nil end
local function shares_to_arg_str(shares)
local arg_str = ""
for _, share in ipairs(shares) do
if #arg_str > 0 then arg_str = arg_str.."," end
arg_str = arg_str..tostring(share[1])
if not share[2] or share[2] == 0 then
-- nothing
elseif share[2] > 0 then
arg_str = arg_str.."_"..tostring(share[2])
else
arg_str = arg_str.."__"..tostring(-share[2])
end
end
return arg_str
end
local function get_command(area_id)
local r
local handled_options = {}
local a = areas[area_id]
if a.hole then
return "|"
end
if a.split then
for i = 1, #a.split.children do
if a.split.children[i].hole then
a.expansion = default_expansion + 1
break
end
end
local method = a.split.method
if method == "h" then
r = shares_to_arg_str(a.split.x_shares)
r = "h"..r
elseif method == "v" then
r = shares_to_arg_str(a.split.y_shares)
r = "v"..r
elseif method == "d" or method == "w" then
local simple = true
for _, s in ipairs(a.split.x_shares) do
if s[1] ~= 1 or s[2] then simple = false break end
end
if simple then
for _, s in ipairs(a.split.y_shares) do
if s[1] ~= 1 or s[2] then simple = false break end
end
end
if method == "w" and simple then
r = tostring(#a.split.x_shares)..","..tostring(#a.split.y_shares)
else
r = shares_to_arg_str(a.split.x_shares)..",,"..shares_to_arg_str(a.split.y_shares)
method = "d"
end
local m = ""
for _, c in ipairs(a.split.children) do
if type(c.parent_x_shares) == "table" then
if #m > 0 then m = m.."," end
m = m..tostring(c.parent_x_shares[#c.parent_x_shares] - c.parent_x_shares[1] + 1)..","..
tostring(c.parent_y_shares[#c.parent_y_shares] - c.parent_y_shares[1] + 1)
end
end
if method == "d" and r == "1,,1" then
r = ""
end
r = method..r..(#m == 0 and m or (method == "w" and "," or ",,"))..m
end
local acc_dashes = 0
if a.expansion > 1 then
for _, c in ipairs(a.split.children) do
local cr = get_command(c.id)
if cr == "-" then
acc_dashes = acc_dashes + 1
else
if acc_dashes == 0 then
elseif acc_dashes == 1 then
r = r.."-"
else
r = r.."c"..tonumber(acc_dashes)
end
acc_dashes = 0
r = r..cr
end
end
if acc_dashes > 0 then
r = r.."c"
end
end
if area_id ~= root_area then
if a.expansion ~= areas[a.parent_id].expansion - 1 then
r = "t"..tostring(a.expansion)..r
end
else
if a.expansion ~= default_expansion then
r = "t"..tostring(a.expansion)..r
end
end
elseif a.disabled then
r = "/"
elseif a.layout then
r = "x"..a.layout
else
r = "-"
end
return r
end
local r = get_command(root_area)
if not to_embed then
if r == "-" then
r = "."
else
-- The last . may be redundant, but it makes sure no pending op.
r = r:gsub("[\\c]+$", "").."."
end
end
return r
end
if not in_module then
print("Testing areas/command processing")
local function check_transcoded_command(command, expectation)
local areas, open_areas = areas_from_command(command, {x = 0, y = 0, width = 100, height = 100}, 0)
if #open_areas > 0 then
print("Found open areas after command "..command)
assert(false)
end
local transcoded = areas_to_command(areas)
if transcoded ~= expectation then
print("Mismatched transcoding for "..command..": got "..transcoded..", expected "..expectation)
assert(false)
end
end
check_transcoded_command(".", ".")
check_transcoded_command("3t.", ".")
check_transcoded_command("121h.", "h1,2,1.")
check_transcoded_command("1_10,2,1h1s131v.", "h1_10,2,1-v1,3,1.")
check_transcoded_command("332111w.", "w3,3,2,1,1,1.")
check_transcoded_command("1310111d.", ";d1,3,1,,1,1,1.")
check_transcoded_command("dw66.", "dw6,6.")
check_transcoded_command(";dw66.", ";dw6,6.")
check_transcoded_command("101dw66.", ";dw6,6.")
check_transcoded_command("3tdw66.", "t3;dw6,6.")
print("Passed.")
end
return {
areas_from_command = areas_from_command,
areas_to_command = areas_to_command,
}
|
local BugBase = class("BugBase")
BugBase.BUG_TYPE_ANT = "ANT"
BugBase.BUG_TYPE_SPIDER = "SPIDER"
function BugBase:ctor()
self.position_ = cc.p(0, 0)
self.rotation_ = 0
self.type_ = nil
self.dist_ = 0
self.destination_ = cc.p(0, 0)
self.speed_ = 1
self.touchRange_ = 0
end
function BugBase:getType()
return self.type_
end
function BugBase:getPosition()
return self.position_
end
function BugBase:getRotation()
return self.rotation_
end
function BugBase:getDist()
return self.dist_
end
function BugBase:setDestination(destination)
self.destination_ = clone(destination)
self.dist_ = math.random(display.width / 2 + 100, display.width / 2 + 200)
local rotation = math.random(0, 360)
self.position_ = self:calcPosition(rotation, self.dist_, destination)
self.rotation_ = rotation - 180
return self
end
local fixedDeltaTime = 1.0 / 60.0
function BugBase:step(dt)
self.dist_ = self.dist_ - self.speed_ * (dt / fixedDeltaTime)
self.position_ = self:calcPosition(self.rotation_ + 180, self.dist_, self.destination_)
return self
end
function BugBase:calcPosition(rotation, dist, destination)
local radians = rotation * math.pi / 180
return cc.p(destination.x + math.cos(radians) * dist,
destination.y - math.sin(radians) * dist)
end
function BugBase:checkTouch(x, y)
local dx, dy = x - self.position_.x, y - self.position_.y
local offset = math.sqrt(dx * dx + dy * dy)
return offset <= self.touchRange_
end
return BugBase
|
----------------------------------------------------------
------- Twill's Applied Energistics 2 Auto-Supplier ------
----------------------------------------------------------
local comp = require("component")
local gpu = comp.gpu
local ae2 = comp.me_controller
-- the items array tracks the list of items you want to display/keep in stock
-- each item needs to have a filter that will be used to pull it's stock level
-------- and crafting recipe via the AE2 api
items = {
{filter={name="minecraft:stick"},
nicename="Stick", stock_value=0, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=17},
nicename="Engineering Circuit", stock_value=64, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=24},
nicename="Engineering Processor", stock_value=0, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=18},
nicename="Logic Circuit", stock_value=0, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=22},
nicename="Logic Processor", stock_value=0, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=10},
nicename="Pure Certus Quartz", stock_value=0, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=16},
nicename="Calc Circuit", stock_value=0, crafter=nil, craftStatus=nil},
{filter={name="appliedenergistics2:material",damage=23},
nicename="Calc Processor", stock_value=0, crafter=nil, craftStatus=nil},
}
-- how long to wait between the end of one check cycle and the beginning of the next
cycle_wait = 60 --seconds
--------------------------
---- Helper Functions ----
--------------------------
---------------------------
---- Drawing Functions ----
---------------------------
function frameDraw()
gpu.setViewport(128, 40)
gpu.set(1,1, "╔" .. string.rep("═",40) .. "╤" .. string.rep("═",40) .. "╤" .. string.rep("═",40) .. "╗")
gpu.set(1,2, string.rep("║",38), true)
gpu.set(42,2, string.rep("┃",38), true)
gpu.set(83,2, string.rep("┃",38), true)
gpu.set(124,2, string.rep("║",38), true)
gpu.set(1,40, "╚" .. string.rep("═",40) .. "╧" .. string.rep("═",40) .. "╧" .. string.rep("═",40) .. "╝")
end
function itemDraw(index, item, stock, crafting)
local maxLength = 40 -- configuration here
local adjusted_index = index
local col_index = 2
while adjusted_index > 38 do
adjusted_index = adjusted_index - 38
col_index = col_index + 41
end
local output = item.nicename .. " x" .. stock
if crafting == true then
output = "[c]" .. output
else
output = "[x]" .. output
end
if string.len(output) > 40 then
output = output .. string.rep(" ", 40-string.len(output))
end
gpu.set(col_index, adjusted_index+1, output)
end
-------------------
---- Main Loop ----
-------------------
frameDraw()
while true do
for key, item in pairs(items) do
local i_info = ae2.getItemsInNetwork(item.filter)[1]
if i_info.size == nil then
if item.stock_value ~= 0 and item.craftStatus == nil then
if item.crafter == nil then
item.crafter = ae2.getCraftables(item.filter)[1]
end
item.craftStatus = item.crafter.request(item.stock_value)
end
if item.craftStatus.isDone() then
item.craftStatus = nil
end
if item.craftStatus == nil then
itemDraw(key, item, 0, false)
else
itemDraw(key, item, 0, true)
end
else
if item.stock_value ~= 0 and item.craftStatus == nil then
if item.crafter == nil then
item.crafter = ae2.getCraftables(item.filter)[1]
end
item.craftStatus = item.crafter.request(item.stock_value - i_info.size)
end
if item.craftStatus.isDone() then
item.craftStatus = nil
end
if item.craftStatus == nil then
itemDraw(key, item, i_info.size, false)
else
itemDraw(key, item, i_info.size, true)
end
end
end
os.sleep(cycle_wait)
end |
local dat = {}
local info, ver
local datread = require("data/load_dat")
do
local buttonchar
local function convert(str)
if not buttonchar then buttonchar = require("data/button_char") end
return buttonchar(str)
end
datread, ver = datread.open("command.dat", "#[^V]*Ver[^.:]*[.:]", convert)
end
function dat.check(set, softlist)
if softlist or not datread then
return nil
end
local status
status, info = pcall(datread, "cmd", "info", set)
if not status or not info then
return nil
end
return _p("plugin-data", "Command")
end
function dat.get()
return info
end
function dat.ver()
return ver
end
return dat
|
warn([[
Please stop telling me that your free exploit can't run this script. I've stopped working on it.
ACE is in development.
Avexus#1234
]])
local UIS = game:GetService('UserInputService')
local RS = game:GetService('RunService')
local Players = game:GetService('Players')
local StarterGui = game:GetService('StarterGui')
local Player = Players.LocalPlayer
local Studio = RS:IsStudio()
local PlayerGui = RS:IsStudio() and Player:WaitForChild('PlayerGui') or game.CoreGui
local Mouse = Player:GetMouse()
local old_icon = Mouse.Icon
local Camera = workspace.CurrentCamera
targetpart = 'Head' -- Don't change this.
-- It can be changed with the targetpart_change hotkey ingame.
local target
local target_old
local alert = false
local lockedon = false
local settingkey = false
local upvals = nil
local val = 1
local windows = {}
local function hb() RS.Heartbeat:wait() end
local version = 1.25
local Spawn = nil or game.PlaceId == 292439477 and workspace:WaitForChild('Lobby',2):WaitForChild('Spawn1',2)
local spawned = false
script.Name = 'GameSense!'
Mouse.TargetFilter = Camera
-- hotkey
toggle_aim = Enum.UserInputType.MouseButton2
toggle_aimbot = Enum.KeyCode.LeftAlt
toggle_trigger = Enum.KeyCode.RightAlt
toggle_esp = Enum.KeyCode.End
toggle_gui = Enum.KeyCode.F6
toggle_bottompos = Enum.KeyCode.F7
toggle_performance = Enum.KeyCode.F8
toggle_bones = Enum.KeyCode.Delete
toggle_chams = Enum.KeyCode.F3
toggle_tracers = Enum.KeyCode.F2
toggle_boxes = Enum.KeyCode.F4
toggle_font = Enum.KeyCode.F1
ffatoggle = Enum.KeyCode.Home
targetpart_change = Enum.KeyCode.BackSlash
priority_toggle = Enum.KeyCode.Insert
sethotkey = Enum.KeyCode.RightControl
-- aim fov
fov_increase = Enum.KeyCode.KeypadPlus
fov_decrease = Enum.KeyCode.KeypadMinus
-- aim sens (how smooth your crosshair will move)
sens_increase = Enum.KeyCode.RightBracket
sens_decrease = Enum.KeyCode.LeftBracket
-- parts
parts = {
'Head';
'Torso'
}
fonts = {
Enum.Font.SourceSansBold,
Enum.Font.Cartoon,
Enum.Font.Arcade,
Enum.Font.SciFi,
Enum.Font.Fantasy,
Enum.Font.Code,
Enum.Font.Highway,
Enum.Font.Bodoni
}
textSet = false
currentfont = 1
ffa = false
hidden = false
performancemode = false
-- aim
fov = 5
sens = .25
drop = .45
aim_toggled = false
bottompos = true
aim_priority = 2
-- [2] FOV or [1] Distance
aimingcolor = Color3.fromRGB(0,165,255)
aimbot_toggled = true
aim_line = true
locksoundid = 538769304
mouseiconid = 18671553
-- trigger
trigger_toggled = false
trigger_delay = 1/20
-- esp
esp_toggled = true
esp_bones = false
esp_chams = true
esp_tracers = true
-- item_esp (coming soon)
linesize = 1
showdists = true
textsize = 14
textoffset = 20
visiblecolor = Color3.fromRGB(38,255,99)
hiddencolor = Color3.fromRGB(255,37,40)
headboxsize = 4
headboxaimsize = 6
headboxshape = 'diamond'
-- rectangle or diamond
-- box esp
bounding_box = true
-- box_pointsize = 0 [UNUSED]
box_line_size = 1
-- box_line_size_visible = 2 [UNUSED]
local GUI = Instance.new('ScreenGui',PlayerGui)
GUI.Name = 'GameSense '..version
GUI.ResetOnSpawn = false
ESP = Instance.new('Folder',GUI)
ESP.Name = 'ESP'
local Bottom = Instance.new('Frame',ESP)
Bottom.Name = 'Bottom'
Bottom.BackgroundTransparency = 1
Bottom.Size = UDim2.new(0,1,0,1)
Bottom.Position = UDim2.new(.5,0,1,1)
local Status = Instance.new('TextLabel',GUI)
Status.Name = 'Status'
Status.BackgroundTransparency = 1
Status.Size = UDim2.new(0,500,0,50)
Status.Position = UDim2.new(.5,-250,.85,0)
Status.TextSize = 24
Status.Font = Enum.Font.SourceSansBold
Status.TextColor3 = Color3.new(1,1,1)
Status.TextStrokeColor3 = Color3.new(0,0,0)
Status.TextStrokeTransparency = .6
Status.Text = 'On Standby'
Status.ZIndex = 50
local Credits = Status:Clone()
Credits.Name = 'Credits'
Credits.Parent = GUI
Credits.Position = UDim2.new(.5,-250,.85,-20)
Credits.TextSize = 16
Credits.Text = 'GameSense '..version..' by Avexus!'
local FovGui = Instance.new('ImageLabel',GUI)
FovGui.Name = 'FovGui'
FovGui.Image = 'rbxassetid://324848180'
FovGui.Size = UDim2.new(0,(Camera.ViewportSize.X/(90/fov))*2,0,(Camera.ViewportSize.X/(90/fov))*2)
FovGui.Position = UDim2.new(0.5,-FovGui.AbsoluteSize.X/2,0.5,-FovGui.AbsoluteSize.Y/2)
FovGui.BackgroundTransparency = 1
FovGui.ImageTransparency = .9
FovGui.ImageColor3 = Color3.new(1,0,0)
local Indicator = Instance.new('TextLabel',GUI)
Indicator.Name = 'Indicator'
Indicator.Font = Enum.Font.SourceSans
Indicator.TextSize = 14
Indicator.TextXAlignment = Enum.TextXAlignment.Center
Indicator.TextYAlignment = Enum.TextYAlignment.Center
Indicator.TextStrokeTransparency = .75
Indicator.Text = aim_priority>1 and 'FOV: '..fov or 'Distance'
local SensAdjust = Instance.new('TextBox',GUI)
SensAdjust.Name = 'SensAdjust'
SensAdjust.Font = Enum.Font.SourceSans
SensAdjust.BackgroundTransparency = .75
SensAdjust.BackgroundColor3 = Color3.new(0,0,0)
SensAdjust.BorderColor3 = Color3.new(1,1,1)
SensAdjust.Size = UDim2.new(0,50,0,20)
SensAdjust.TextStrokeTransparency = .6
SensAdjust.TextColor3 = Color3.new(1,1,1)
SensAdjust.TextSize = 14
SensAdjust.PlaceholderText = 'Sens'
SensAdjust.Text = tonumber(sens)
SensAdjust.Position = Credits.Position + UDim2.new(0,250,0,75)
local SensLabel = Instance.new('TextLabel',SensAdjust)
SensLabel.Name = 'SensLabel'
SensLabel.Font = Enum.Font.SourceSans
SensLabel.Size = UDim2.new(1,0,1,0)
SensLabel.BackgroundTransparency = 1
SensLabel.TextSize = 14
SensLabel.TextColor3 = Color3.new(1,1,1)
SensLabel.TextStrokeColor3 = Color3.new(0,0,0)
SensLabel.TextStrokeTransparency = .6
SensLabel.Text = 'Sens:'
SensLabel.Position = UDim2.new(-1,0,0,0)
SensLabel.TextXAlignment = Enum.TextXAlignment.Left
local FovAdjust = SensAdjust:Clone()
FovAdjust.Parent = GUI
FovAdjust.PlaceholderText = 'FOV'
FovAdjust.Name = 'FovAdjust'
FovAdjust.Text = tonumber(fov)
FovAdjust.Position = SensAdjust.Position + UDim2.new(0,0,0,20)
FovAdjust.SensLabel.Name = 'FovLabel'
FovAdjust.FovLabel.Text = 'Fov:'
local DropAdjust = SensAdjust:Clone()
DropAdjust.Parent = GUI
DropAdjust.PlaceholderText = 'Drop'
DropAdjust.Name = 'DropAdjust'
DropAdjust.Text = tonumber(drop)
DropAdjust.Position = SensAdjust.Position + UDim2.new(0,0,0,40)
DropAdjust.SensLabel.Name = 'DropLabel'
DropAdjust.DropLabel.Text = 'Drop:'
local KeysList = Instance.new('TextLabel',GUI)
KeysList.Name = 'KeysList'
KeysList.Font = Enum.Font.SourceSans
KeysList.TextStrokeTransparency = .6
KeysList.TextSize = 14
KeysList.TextColor3 = Color3.new(1,1,1)
KeysList.Size = UDim2.new(0,0,1,0)
KeysList.Position = UDim2.new(0,5,0,-280)
KeysList.BackgroundTransparency = 1
KeysList.Active = false
KeysList.TextXAlignment = Enum.TextXAlignment.Left
KeysList.TextYAlignment = Enum.TextYAlignment.Bottom
KeysList.Text = 'AimBot Toggle: '..toggle_aimbot.Name..'\nAim Toggle: '..toggle_aim.Name..'\nAim Part Toggle: '..targetpart_change.Name..'\nPriority Toggle: '..priority_toggle.Name
..'\nESP Toggle: '..toggle_esp.Name..'\nBones Toggle: '..toggle_bones.Name..'\nChams Toggle: '..toggle_chams.Name..'\nBoxes Toggle: '..toggle_boxes.Name..'\nFOV Increase: '..fov_increase.Name..'\nFOV Decrease: '..fov_decrease.Name..'\nSens Increase: '
..sens_increase.Name..'\nSens Decrease: '..sens_decrease.Name..'\nTrigger Toggle: '..toggle_trigger.Name..'\nFFA Toggle: '..ffatoggle.Name..'\nHide Cheats: '..toggle_gui.Name
..'\nChange ESP Origin: '..toggle_bottompos.Name..'\nPerformance Mode: '..toggle_performance.Name..'\nChange Font: '..toggle_font.Name
local n = 0
spawn(function()
while Status do
Indicator.TextColor3 = Color3.fromHSV(n,.5,1)
FovGui.ImageColor3 = Indicator.TextColor3
if not textSet then
if aim_toggled and target then
Status.TextColor3 = aimingcolor
Status.Text = ('Aiming at '..target.Name)
else
Status.TextColor3 = Color3.fromHSV(n,.5,1)
Status.Text = 'On Standby'
end
end
n = (n+.005)%1
hb()
end
end)
SensAdjust.InputEnded:Connect(function() if SensAdjust.Text~='' then sens = tonumber(SensAdjust.Text)>0 and tonumber(SensAdjust.Text) or sens end end)
FovAdjust.InputEnded:Connect(function() if FovAdjust.Text~='' then fov = tonumber(FovAdjust.Text)>0 and tonumber(FovAdjust.Text) or fov
FovGui:TweenSize(UDim2.new(0,(Camera.ViewportSize.X/(90/fov))*2,0,(Camera.ViewportSize.X/(90/fov))*2),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,.1,true) end end)
DropAdjust.InputEnded:Connect(function() if DropAdjust.Text~='' then drop = tonumber(DropAdjust.Text)>=0 and tonumber(DropAdjust.Text) or drop end end)
local function distfromspawn(x)
if Spawn then
return x:DistanceFromCharacter(Spawn.Position)
else
return 201
end
end
local function setText(text)
spawn(function()
textSet = true
Status.Text = text
Status.TextColor3 = Color3.new(1,1,1)
wait(#text/4)
textSet = false
end)
end
local function playsound(id)
local sound = Instance.new('Sound',Camera)
sound.SoundId = 'rbxassetid://'..id
sound.Volume = 3
sound:Play()
game:GetService('Debris'):AddItem(sound,5)
end
playsound(1168009121)
Mouse.Icon = 'rbxassetid://'..mouseiconid
local function Notification(...)
playsound(140910211)
StarterGui:SetCore('SendNotification',...)
end
local function DrawLine(Folder,P1,P2,Thickness,Color,LineTransparency,BorderThickness,BorderColor)
-- Declare variables
local Point1,Point2 = P1.Position,P2.Position
if Point1 and Point2 then
local X,Y = Camera.ViewportSize.X, Camera.ViewportSize.Y
local X1,X2 = (X * Point1.X.Scale + Point1.X.Offset + P1.Size.X.Offset/2), (X * Point2.X.Scale + Point2.X.Offset + P2.Size.X.Offset/2)
local Y1,Y2 = (Y * Point1.Y.Scale + Point1.Y.Offset + P1.Size.Y.Offset/2), (Y * Point2.Y.Scale + Point2.Y.Offset + P2.Size.Y.Offset/2)
local MidX,MidY = (X1+X2)/2, (Y1+Y2)/2
-- Set defaults to prevent errors
Thickness = Thickness or 1
Color = Color or Color3.new(1,1,1)
LineTransparency = LineTransparency or 0
BorderThickness = BorderThickness or 0
BorderColor = BorderColor or Color3.new(0,0,0)
-- Draw the line
local Line = Folder:FindFirstChild(P1.Name..'-'..P2.Name) or Instance.new('Frame',Folder)
Line.Visible = false
Line.BackgroundTransparency = LineTransparency
Line.BorderSizePixel = BorderThickness
Line.BorderColor3 = BorderColor
Line.Size = UDim2.new(0,(Vector2.new(X1,Y1) - Vector2.new(X2,Y2)).magnitude-1,0,Thickness)
Line.Position = UDim2.new(0,MidX-Line.AbsoluteSize.X/2,0,MidY-Line.AbsoluteSize.Y)
Line.BackgroundColor3 = Color
Line.Rotation = math.deg(math.atan2((Y2-Y1),(X2-X1)))
Line.Name = P1.Name..'-'..P2.Name
Line.Visible = true
return Line
else
return nil
end
end
local function GetNearest(Mode)
local lowest,nearest,gui = math.huge,nil,nil
if Mode==1 then
for _,plr in next,Players:GetPlayers() do
if plr.Name~=Player.Name and plr.Character~=nil and plr.Character:FindFirstChild(targetpart) then
local dist = Player:DistanceFromCharacter(plr.Character[targetpart].Position)
local ray = Ray.new(Player.Character.Head.Position,(plr.Character[targetpart].Position-Player.Character.Head.Position).unit*5000)
local part,point = workspace:FindPartOnRayWithIgnoreList(ray,{Camera,Player.Character,unpack(windows)})
local Z = Camera:WorldToScreenPoint(plr.Character[targetpart].Position).Z
if part and part:IsDescendantOf(plr.Character) and Z>0 and dist < lowest and (ffa or plr.TeamColor~=Player.TeamColor) then lowest = dist nearest = plr.Character end
end
end
elseif Mode==2 then
for _,plr in next,Players:GetPlayers() do
if plr.Name~=Player.Name and plr.Character~=nil and plr.Character:FindFirstChild(targetpart) then
local pos = Camera:WorldToScreenPoint(plr.Character[targetpart].Position)
local ray = Ray.new(Player.Character[targetpart].Position,(plr.Character[targetpart].Position-Player.Character[targetpart].Position).unit*2048)
local part,point = workspace:FindPartOnRayWithIgnoreList(ray,{Camera,Player.Character,unpack(windows)})
local dist = (Vector2.new(Mouse.X,Mouse.Y)-Vector2.new(pos.X,pos.Y)).magnitude
if part and part:IsDescendantOf(plr.Character) and pos.Z>0 and dist <= Camera.ViewportSize.X/(90/fov) and dist < lowest and (ffa or plr.TeamColor~=Player.TeamColor) then lowest = dist nearest = plr.Character end
end
end
end
return nearest
end
Mouse.Move:Connect(function()
cursor = ESP:FindFirstChild('Cursor') or Instance.new('Frame',ESP)
cursor.Name = 'Cursor'
cursor.BackgroundTransparency = 1
cursor.Size = UDim2.new(0,1,0,1)
cursor.Position = UDim2.new(0,Mouse.X,0,Mouse.Y)
end)
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == toggle_aim or Input.UserInputType == toggle_aim then
aim_toggled = true
warn('GS: aim toggled',aim_toggled and 'on' or 'off')
alert = true
while aim_toggled and aimbot_toggled do
target = GetNearest(aim_priority)
if target then
local dist = Player:DistanceFromCharacter(target[targetpart].Position)
local headpos = Camera:WorldToScreenPoint(target[targetpart].Position+Vector3.new(0,dist/(100/drop),0))
local moveto = Vector2.new((headpos.X-Mouse.X)*sens,(headpos.Y-Mouse.Y)*sens)
aimpos = GUI:FindFirstChild('AimPos') or Instance.new('Frame',GUI)
if not GUI:FindFirstChild('AimPos') then
aimpos.Name = 'AimPos'
aimpos.BorderSizePixel = 1
aimpos.BorderColor3 = Color3.new(0,0,0)
aimpos.BackgroundTransparency = 0
aimpos.BackgroundColor3 = Color3.new(1,1,1)
aimpos.Rotation = 45
aimpos.ZIndex = 4
aimpos.Size = UDim2.new(0,3,0,3)
end
aimpos.Position = UDim2.new(0,headpos.X-aimpos.AbsoluteSize.X/2,0,headpos.Y-aimpos.AbsoluteSize.Y/2)
aimpos.Visible = true
mousemoverel(moveto.X,moveto.Y)
if alert or target~=target_old then
playsound(locksoundid)
print('GS: locked onto',target.Name)
lockedon = true
alert = false
end
end
RS.Heartbeat:wait()
target_old = target
if aimpos then
aimpos.Visible = false
end
end
lockedon = false
elseif Input.KeyCode == toggle_trigger then
trigger_toggled = not trigger_toggled
setText('Toggled TriggerBot '..(trigger_toggled and 'On' or 'Off'))
Notification({Title='TriggerBot';Text='TriggerBot was toggled '..(trigger_toggled and 'On' or 'Off');Duration=2;})
warn('trigger toggled',trigger_toggled and 'on' or 'off')
local Box = Instance.new('SelectionBox',PlayerGui)
Box.Color3 = Color3.new(1,0,0)
Box.LineThickness = .05
Box.Adornee = nil
if trigger_delay>0 then wait(trigger_delay) end
while trigger_toggled do
local Target = Mouse.Target
local plr = Players:FindFirstChild(Target.Parent.Name)
if Target and Target.Parent and plr~=nil and plr~=Player and ffa or plr~=nil and plr.TeamColor~=Player.TeamColor then
Box.Adornee = Mouse.Target
mouse1press()
wait()
mouse1release()
end
RS.Heartbeat:wait()
end
Box:Destroy()
elseif Input.KeyCode == toggle_esp then
esp_toggled = not esp_toggled
Notification({Title='ESP';Text='ESP was toggled '..(esp_toggled and 'On' or 'Off');Duration=2;})
setText('Toggled ESP '..(esp_toggled and 'On' or 'Off'))
elseif Input.KeyCode == toggle_aimbot then
aimbot_toggled = not aimbot_toggled
Notification({Title='AimBot';Text='AimBot was toggled '..(aimbot_toggled and 'On' or 'Off');Duration=2;})
setText('Toggled AimBot '..(aimbot_toggled and 'On' or 'Off'))
elseif Input.KeyCode == fov_increase then
fov = fov + .5
FovAdjust.Text = tonumber(fov)
if FovGui.Visible then
FovGui:TweenSize(UDim2.new(0,(Camera.ViewportSize.X/(90/fov))*2,0,(Camera.ViewportSize.X/(90/fov))*2),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,.1,true)
end
setText('Aim FOV: '..fov)
elseif Input.KeyCode == fov_decrease and fov>0 then
fov = fov - .5
FovAdjust.Text = tonumber(fov)
if FovGui.Visible then
FovGui:TweenSize(UDim2.new(0,(Camera.ViewportSize.X/(90/fov))*2,0,(Camera.ViewportSize.X/(90/fov))*2),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,.1,true)
end
setText('Aim FOV: '..fov)
elseif Input.KeyCode == sens_increase then
sens = sens + .05
SensAdjust.Text = tonumber(sens)
setText('Sens: '..sens)
elseif Input.KeyCode == sens_decrease then
sens = sens - .05
SensAdjust.Text = tonumber(sens)
setText('Sens: '..sens)
elseif Input.KeyCode == targetpart_change then
val = val+1
targetpart = val<=#parts and parts[val] or parts[1]
if parts[1]==targetpart then val = 1 end
Notification({Title='Target Part';Text='Target part set to '..targetpart;Duration=2;})
setText('Target Part: '..targetpart)
elseif Input.KeyCode == ffatoggle then
ffa = not ffa
Notification({Title='FFA Mode';Text='FFA Mode is '..(ffa and 'Enabled' or 'Disabled');Duration=2;})
setText('FFA Mode: '..(ffa and 'Enabled' or 'Disabled'))
elseif Input.KeyCode == priority_toggle then
aim_priority = aim_priority+1>2 and 0 or 1
aim_priority = aim_priority+1
FovGui.Visible = aim_priority>1
Notification({Title='Aim Priority';Text='Aim Priority: '..(aim_priority==1 and 'Distance' or 'FOV');Duration=2;})
setText('Aim Priority: '..(aim_priority==1 and 'Distance' or 'FOV'))
elseif Input.KeyCode == toggle_bones then
esp_bones = not esp_bones
if not esp_bones then
for _,v in next,ESP:GetDescendants() do
if v:IsA('Frame') and v.Name:match('-') then
v:Destroy()
end
end
end
Notification({Title='ESP';Text='ESP Bones: '..(esp_bones and 'Enabled' or 'Disabled');Duration=2;})
setText('Toggled ESP Bones '..(esp_bones and 'Enabled' or 'Disabled'))
elseif Input.KeyCode == toggle_gui then
hidden = not hidden
for _,gui in next,GUI:GetDescendants() do
if gui:IsA('GuiObject') and not hidden and not gui.Visible then
gui.Visible = true
Mouse.Icon = 'rbxassetid://'..mouseiconid
elseif gui:IsA('GuiObject') and gui.Visible then
gui.Visible = false
esp_toggled = false
Mouse.Icon = old_icon
end
end
elseif Input.KeyCode == toggle_bottompos then
bottompos = not bottompos
if bottompos then
Bottom.Position = UDim2.new(.5,0,1,1)
end
elseif Input.KeyCode == toggle_performance then
performancemode = not performancemode
setText('Performance Mode '..(performancemode and 'Enabled' or 'Disabled'))
elseif Input.KeyCode == toggle_chams then
esp_chams = not esp_chams
setText('Chams '..(esp_chams and 'Enabled' or 'Disabled'))
Notification({Title='ESP';Text='Chams: '..(esp_chams and 'Enabled' or 'Disabled');Duration=2;})
elseif Input.KeyCode == toggle_tracers then
esp_tracers = not esp_tracers
setText('Tracers '..(esp_chams and 'Enabled' or 'Disabled'))
Notification({Title='ESP';Text='Tracers: '..(esp_tracers and 'Enabled' or 'Disabled');Duration=2;})
elseif Input.KeyCode == toggle_boxes then
bounding_box = not bounding_box
setText('Bounding Boxes '..(bounding_box and 'Enabled' or 'Disabled'))
Notification({Title='ESP';Text='Bounding Boxes: '..(bounding_box and 'Enabled' or 'Disabled');Duration=2;})
elseif Input.KeyCode == toggle_font then
currentfont = (currentfont+1)>#fonts and 1 or currentfont+1
for _,v in next,GUI:GetDescendants() do
if v.Name~='KeysList' then
if v:IsA('TextLabel') or v:IsA('TextButton') then
v.Font = fonts[currentfont]
end
end
end
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == toggle_aim or Input.UserInputType == toggle_aim then
aim_toggled = false
end
end)
local function checkifspawned(x)
spawned = false
while not spawned and game.PlaceId==292439477 do
spawned = distfromspawn(x)>200 and true or false
wait(1/5)
end
spawned = true
end
checkifspawned(Player)
Player.CharacterAdded:Connect(function(c)
checkifspawned(Player)
for _,v in next,ESP:GetDescendants() do
if v:IsA('Frame') and v.Name:match('-') then
v:Destroy()
end
end
end)
Notification({Title='GameSense '..version;Text='Cheat loaded successfully.';Icon='rbxassetid://2572157833';Duration=10;})
wait(.5)
Notification({Title='Main Coder';Text='AvexusDev';Duration=4;Icon='https://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username=AvexusDev'})
wait(.5)
Notification({Title='Thank you!';Text='If you like this script, please leave a vouch on my thread!';Duration=4;})
RS.RenderStepped:Connect(function()
if cursor then
FovGui.Position = cursor.Position-UDim2.new(0,FovGui.AbsoluteSize.X/2,0,FovGui.AbsoluteSize.Y/2)
Indicator.Position = cursor.Position+UDim2.new(0,0,0,40)
end
end)
Mouse.Button1Down:Connect(function()
spawn(function()
if FovGui.Visible then
FovGui:TweenSize(UDim2.new(0,Camera.ViewportSize.X/(90/fov)*2.35,0,Camera.ViewportSize.X/(90/fov)*2.35),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,.1,true)
wait(.1)
FovGui:TweenSize(UDim2.new(0,Camera.ViewportSize.X/(90/fov)*2,0,Camera.ViewportSize.X/(90/fov)*2),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,.1,true)
end
end)
end)
while true do
Indicator.Text = (aim_priority>1 and 'FOV: '..fov or 'Distance') ..'\nSens: '..sens..(aim_toggled and '\nAiming' or '')
if not bottompos then Bottom.Position = cursor.Position end
if esp_toggled then
for _,v in next,ESP:children() do
if v~=Bottom and not Players:FindFirstChild(v.Name) then
v:Destroy()
end
end
for _,v in next,Players:GetPlayers() do
local Char = v.Character
if Char and spawned and v~=Player and Char:FindFirstChild(targetpart) and distfromspawn(v)>100 then
if ffa or v.TeamColor~=Player.TeamColor then
local X = Camera:GetPartsObscuringTarget({Camera.CFrame.p,Char[targetpart].CFrame.p},{v.Character,Char,Camera,unpack(windows)})
local Dist = Player:DistanceFromCharacter(Char:FindFirstChild(targetpart).Position)
local Color = hiddencolor
local Folder = ESP:FindFirstChild(v.Name) or Instance.new('Folder',ESP)
Folder.Name = v.Name
-- ESP
local Head = Folder:FindFirstChild('Head') or Instance.new('Frame',Folder)
if not Folder:FindFirstChild('Head') then
Head.Name = 'Head'
Head.BorderSizePixel = 1
Head.BorderColor3 = Color3.new(0,0,0)
Head.BackgroundTransparency = 0
end
Head.BackgroundColor3 = #X>0 and hiddencolor or #X==0 and visiblecolor
Head.Rotation = headboxshape=='diamond' and 45 or 0
Head.ZIndex = 3
local HP = Folder:FindFirstChild('HP') or Instance.new('TextLabel',Folder)
if not Folder:FindFirstChild('HP') then
HP.Name = 'HP'
HP.TextTransparency = Head.BackgroundTransparency-.4
HP.Font = fonts[currentfont]
HP.TextStrokeTransparency = .6
HP.BackgroundTransparency = 1
HP.TextSize = 14
end
HP.Text = showdists and Char.Name..'\n'..math.floor(Dist+.5) or Char.Name
if aim_toggled and target==Char then
Head.Size = UDim2.new(0,headboxaimsize,0,headboxaimsize)
Head.BackgroundColor3 = aimingcolor
HP.Text = showdists and '['..Char.Name..']'..'\n'..math.floor(Dist+.5) or '['..Char.Name..']'
HP.TextSize = 16
else
Head.Size = UDim2.new(0,headboxsize,0,headboxsize)
end
HP.TextColor3 = Head.BackgroundColor3
local toScreen = Camera:WorldToScreenPoint(Char[targetpart].CFrame.p)
if #X==0 then Color = visiblecolor end
Head.Position = UDim2.new(0,toScreen.X-Head.Size.X.Offset/2,0,toScreen.Y-Head.Size.Y.Offset/2)
HP.Position = Head.Position-UDim2.new(0,0,0,textoffset)
if esp_tracers then
local Line = DrawLine(Folder,ESP.Bottom,Head,linesize,Head.BackgroundColor3,.75,1,Color3.new(0,0,0))
Line.Visible = Head.Visible
else
local imtired = Folder:FindFirstChild(ESP.Bottom.Name..'-'..Head.Name)
if imtired then
imtired:Destroy()
end
end
if toScreen.Z<=0 then Head.Visible = false else Head.Visible = true end
HP.Visible = Head.Visible
if Char:FindFirstChild('Humanoid') and Char.Humanoid.RigType==Enum.HumanoidRigType.R6 then
local Neck = Folder:FindFirstChild('Neck') or Instance.new('Frame',Folder)
Neck.Name = 'Neck'
Neck.ZIndex = 2
if Char['Torso']~=nil then
local Pos = (Char.Torso.CFrame*CFrame.new(0,.8,0)).p
local X,Y,Z = Camera:WorldToScreenPoint(Pos).X,Camera:WorldToScreenPoint(Pos).Y,Camera:WorldToScreenPoint(Pos).Z
Neck.Position = UDim2.new(0,X,0,Y)
Neck.BorderSizePixel = 0
if Z<=0 then Neck.Visible = false else Neck.Visible = true end
else
Neck.Visible = false
end
--
local Pelvis = Folder:FindFirstChild('Pelvis') or Instance.new('Frame',Folder)
Pelvis.Name = 'Pelvis'
Pelvis.ZIndex = 2
Pelvis.BorderSizePixel = 0
if Char['Torso']~=nil then
local Pos = (Char.Torso.CFrame*CFrame.new(0,-1,0)).p
local X,Y,Z = Camera:WorldToScreenPoint(Pos).X,Camera:WorldToScreenPoint(Pos).Y,Camera:WorldToScreenPoint(Pos).Z
Pelvis.Position = UDim2.new(0,X,0,Y)
if Z<=0 then Pelvis.Visible = false else Pelvis.Visible = true end
else
Pelvis.Visible = false
end
--
local RightFoot = Folder:FindFirstChild('Right Foot') or Instance.new('Frame',Folder)
RightFoot.Name = 'Right Foot'
RightFoot.ZIndex = 2
RightFoot.BorderSizePixel = 0
if Char['Right Leg']~=nil then
local Pos = (Char['Right Leg'].CFrame*CFrame.new(0,-1,0)).p
local X,Y,Z = Camera:WorldToScreenPoint(Pos).X,Camera:WorldToScreenPoint(Pos).Y,Camera:WorldToScreenPoint(Pos).Z
RightFoot.Position = UDim2.new(0,X,0,Y)
if Z<=0 then RightFoot.Visible = false else RightFoot.Visible = true end
else
RightFoot.Visible = false
end
--
local LeftFoot = Folder:FindFirstChild('Left Foot') or Instance.new('Frame',Folder)
LeftFoot.Name = 'Left Foot'
if Char['Left Leg']~=nil then
local Pos = (Char['Left Leg'].CFrame*CFrame.new(0,-1,0)).p
local X,Y,Z = Camera:WorldToScreenPoint(Pos).X,Camera:WorldToScreenPoint(Pos).Y,Camera:WorldToScreenPoint(Pos).Z
LeftFoot.Position = UDim2.new(0,X,0,Y)
LeftFoot.BorderSizePixel = 0
if Z<=0 then LeftFoot.Visible = false else LeftFoot.Visible = true end
else
LeftFoot.Visible = false
end
--
local RightHand = Folder:FindFirstChild('Right Hand') or Instance.new('Frame',Folder)
RightHand.Name = 'Right Hand'
RightHand.ZIndex = 2
RightHand.BorderSizePixel = 0
if Char['Right Arm']~=nil then
local Pos = (Char['Right Arm'].CFrame*CFrame.new(0,-1,0)).p
local X,Y,Z = Camera:WorldToScreenPoint(Pos).X,Camera:WorldToScreenPoint(Pos).Y,Camera:WorldToScreenPoint(Pos).Z
RightHand.Position = UDim2.new(0,X,0,Y)
if Z<=0 then RightHand.Visible = false else RightHand.Visible = true end
else
RightHand.Visible = false
end
--
local LeftHand = Folder:FindFirstChild('Left Hand') or Instance.new('Frame',Folder)
LeftHand.Name = 'Left Hand'
LeftHand.ZIndex = 2
LeftHand.BorderSizePixel = 0
if Char['Left Arm']~=nil then
local Pos = (Char['Left Arm'].CFrame*CFrame.new(0,-1,0)).p
local X,Y,Z = Camera:WorldToScreenPoint(Pos).X,Camera:WorldToScreenPoint(Pos).Y,Camera:WorldToScreenPoint(Pos).Z
LeftHand.Position = UDim2.new(0,X,0,Y)
if Z<=0 then LeftHand.Visible = false else LeftHand.Visible = true end
else
LeftHand.Visible = false
end
-- draw joints
if esp_bones then
if Head.Visible then DrawLine(Folder,Head,Neck,1,Color3.new(1,1,1),Head.BackgroundTransparency) end
if Neck.Visible then DrawLine(Folder,Neck,Pelvis,1,Color3.new(1,1,1),Head.BackgroundTransparency) end
if Neck.Visible then DrawLine(Folder,Neck,RightHand,1,Color3.new(1,1,1),Head.BackgroundTransparency) end
if Neck.Visible then DrawLine(Folder,Neck,LeftHand,1,Color3.new(1,1,1),Head.BackgroundTransparency) end
if Pelvis.Visible then DrawLine(Folder,Pelvis,RightFoot,1,Color3.new(1,1,1),Head.BackgroundTransparency) end
if Pelvis.Visible then DrawLine(Folder,Pelvis,LeftFoot,1,Color3.new(1,1,1),Head.BackgroundTransparency) end
end
end
if esp_chams then
for _,Part in next,Char:children() do
if Part:IsA('BasePart') and Part.Name~='HumanoidRootPart' then
local Adornment = Folder:FindFirstChild(Part.Name..'_Cham') or Instance.new('BoxHandleAdornment',Folder)
if not Folder:FindFirstChild(Part.Name..'_Cham') then
Adornment.Name = Part.Name..'_Cham'
Adornment.Adornee = Part
Adornment.AlwaysOnTop = true
Adornment.Size = Part.Name=='Head' and Vector3.new(1,1,1) or Part.Size
Adornment.ZIndex = 1
end
Adornment.Color3 = Head.BackgroundColor3
end
end
else
for _,v in next,Folder:GetDescendants() do
if v.Name:match('Cham') then
v:Destroy()
end
end
end
if bounding_box and Char:FindFirstChild('HumanoidRootPart') then
local Box = Char:FindFirstChild('Box') or Instance.new('BillboardGui',Char)
if not Char:FindFirstChild('Box') then
Box.Name = 'Box'
Box.Adornee = Char:FindFirstChild('HumanoidRootPart')
Box.AlwaysOnTop = true
Box.LightInfluence = 0
Box.StudsOffset = Vector3.new(0,-Box.Adornee.Size.Y/4,0)
Box.Size = UDim2.new(4,1,5,1)
local Top = Instance.new('Frame',Box)
Top.Size = UDim2.new(1,0,0,box_line_size)
Top.BorderSizePixel = 0
local Bot = Top:Clone()
Bot.Position = UDim2.new(0,0,1,-box_line_size)
Bot.Parent = Box
local Left = Top:Clone()
Left.Size = UDim2.new(0,1,1,0)
Left.Parent = Box
local Right = Left:Clone()
Right.Position = UDim2.new(1,-box_line_size,0,0)
Right.Parent = Box
end
for _,v in next,Box:children() do
if v:IsA('Frame') then
v.BackgroundColor3 = Head.BackgroundColor3
end
end
else
local Box = Char:FindFirstChild('Box')
if Box then
Box:Destroy()
end
end
if lockedon and target and aim_line and ESP:FindFirstChild(target.Name) then
DrawLine(ESP,cursor,ESP:FindFirstChild(target.Name).Head,1,Head.BackgroundColor3,.5)
end
else
if ESP:FindFirstChild(v.Name) then
ESP:FindFirstChild(v.Name):Destroy()
end
end
else
if ESP:FindFirstChild(v.Name) then
ESP:FindFirstChild(v.Name):Destroy()
end
end
end
else
for _,v in next,ESP:children() do
if v:IsA('Folder') then
v:Destroy()
end
end
end
if performancemode then
wait(1/(workspace:GetRealPhysicsFPS()*.75))
else
RS.Stepped:wait()
end
end
--[[ broken
spawn(function()
while script and game.PlaceId == 292439477 and workspace:FindFirstChild('Map') do
windows = {}
for _,v in next,workspace.Map:GetChildren() do
if v.Name=='Window' then
table.insert(windows,v)
end
end
wait(2)
end
end)
--]] |
-- simple replacements demo
function span_text(class, str)
return string.format("<div class='%s'>%s</div>", class, str)
end
function wobble_text(str)
return span_text("wobble", str)
end
function explode_text(str)
return span_text("explode", str)
end
function flashy_text(str)
return string.format("<span class='flashy'>%s</span>", str)
end
function psy_text(str)
return string.format("<span class='psy'>%s</span>", str)
end
function red_text(str)
return string.format("<span class='redtext'>%s</span>", str)
end
function spoilers(str)
return string.format("<span class='spoiler'>%s</span>", str)
end
function pre_text(str)
str = str:gsub("%(", "(")
str = str:gsub("%)", ")")
str = str:gsub("%[", "[")
str = str:gsub("\\", "\")
str = str:gsub("//", "//")
str = str:gsub("%]", "]")
str = str:gsub("==", "==")
str = str:gsub("@", "@")
return span_text("code", str:gsub("%|", "|"))
end
-- generate extra markup
function memeposting(body, prefix)
body = string.gsub(body, "`(.-)`", pre_text)
body = string.gsub(body, "%(%(%((.-)%)%)%)", function(str) return string.format("<div class='nazi' style='background-image: url(%sstatic/nazi.png);'>%s</div>", prefix, str) end)
body = string.gsub(body, "|(.-)|", wobble_text)
body = string.gsub(body, "%[%[%[(.-)%]%]%]", flashy_text)
body = string.gsub(body, "==(.-)==", red_text)
body = string.gsub(body, "@@(.-)@@", psy_text)
body = string.gsub(body, "//(.-)\\\\", explode_text)
body = string.gsub(body, "/@(.-)@\\", psy_text)
body = string.gsub(body, "%*%*(.-)%*%*", spoilers)
return body
end
|
vim.g.base16colorspace = 256
local status_ok, _ = pcall(vim.cmd, 'source $HOME/.vimrc_background')
if status_ok then
return
end
status_ok, _ = pcall(vim.cmd, 'colorscheme base16-default-dark')
if not status_ok then
vim.notify('Failed to load base16 colorscheme.')
end
|
-- Dumpster nodes
-- by Mossmanikin
-- License: WTFPL
--Custom Sounds
function default.node_sound_metal_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.4}
table.dig = table.dig or
{name="metal_bang", gain=0.6}
table.dug = table.dug or
{name="default_dug_node", gain=1.0}
default.node_sound_defaults(table)
return table
end
--Nodeboxes(some are unused)
local cube = {-0.5 , -0.5 , -0.5 , 0.5 , 0.5 , 0.5 }
local selectah = {-0.4375, -0.5 , -0.9375, 1.4375, 0.75 , 0.4375}
local container = {
{-0.4375, -0.5 , -0.9375, 1.4375, 0.75 , 0.4375},
{-0.5 , 0.75 , -1.0 , 1.5 , 0.875 , 0.5 },
}
local container2 = { -- the one on Container.png
{-0.4375, -0.4375, -0.9375, -0.375 , 0.625 , 0.4375},
{ 1.375 , -0.4375, -0.9375, 1.4375, 0.625 , 0.4375},
{-0.4375, -0.4375, -0.9375, 1.4375, 0.625 , -0.875 },
{-0.4375, -0.4375, 0.375 , 1.4375, 0.625 , 0.4375},
{-0.375 , -0.5 , -0.875 , 1.375 , -0.4375, 0.375 },
{-0.5 , 0.625 , -1.0 , -0.375 , 0.75 , 0.5 },
{ 1.375 , 0.625 , -1.0 , 1.5 , 0.75 , 0.5 },
{-0.5 , 0.625 , -1.0 , 1.5 , 0.75 , -0.875 },
{-0.5 , 0.625 , 0.375 , 1.5 , 0.75 , 0.5 },
}
local container3 = {
-- Top
{-0.4375, 1.125 , 0.1875, 1.4375, 1.1875, 0.4375},
{-0.4375, 1.0625, 0.0 , 1.4375, 1.125 , 0.4375},
{-0.4375, 1.0 , -0.1875, 1.4375, 1.0625, 0.4375},
{-0.4375, 0.9375, -0.375 , 1.4375, 1.0 , 0.4375},
{-0.4375, 0.875 , -0.5625, 1.4375, 0.9375, 0.4375},
{-0.4375, 0.8125, -0.75 , 1.4375, 0.875 , 0.4375},
{-0.4375, 0.75 , -0.9375, 1.4375, 0.8125, 0.4375},
-- Border
{-0.5 , 0.625 , -1.0 , 1.5 , 0.75 , 0.5 },
-- Main Body
{-0.4375, -0.4375, -0.9375, 1.4375, 0.625 , 0.4375},
-- Grip
{-0.5 , 0.0 , -1.0 , -0.25 , 0.25 , 0.5 },
{ 1.25 , 0.0 , -1.0 , 1.5 , 0.25 , 0.5 },
-- Feet
{-0.4375, -0.5 , -0.9375, -0.1875, -0.4375, -0.6875},
{ 1.1875, -0.5 , -0.9375, 1.4375, -0.4375, -0.6875},
{-0.4375, -0.5 , 0.1875, -0.1875, -0.4375, 0.4375},
{ 1.1875, -0.5 , 0.1875, 1.4375, -0.4375, 0.4375},
}
local container4 = { -- the one on Dumpster.png
-- Top
{-0.4375, 0.75 , -0.9375, 1.4375, 0.875 , 0.4375},
-- Border
{-0.5 , 0.625 , -1.0 , 1.5 , 0.75 , 0.5 },
-- Main Body
{-0.4375, -0.4375, -0.9375, 1.4375, 0.625 , 0.4375},
-- Feet
{-0.4375, -0.5 , -0.9375, -0.1875, -0.4375, -0.6875},
{ 1.1875, -0.5 , -0.9375, 1.4375, -0.4375, -0.6875},
{-0.4375, -0.5 , 0.1875, -0.1875, -0.4375, 0.4375},
{ 1.1875, -0.5 , 0.1875, 1.4375, -0.4375, 0.4375},
}
--Node Registration
minetest.register_node("trash_can:dumpster", {
description = "Dumpster",
paramtype = "light",
paramtype2 = "facedir",
inventory_image = "dumpster_wield.png",
tiles = {
"dumpster_top.png",
"dumpster_bottom.png",
"dumpster_side.png",
"dumpster_side.png",
"dumpster_side.png",
"dumpster_side.png"
},
drawtype = "nodebox",
selection_box = {
type = "fixed",
fixed = selectah,
},
node_box = {
type = "fixed",
fixed = container4,
},
groups = {
cracky = 3,
oddly_breakable_by_hand = 1,
},
sounds = default.node_sound_metal_defaults(),
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"button[0,0;2,1;empty;Empty Trash]"..
"list[current_name;main;1,1;6,3;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Dumpster")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in dumpster at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to dumpster at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from dumpster at "..minetest.pos_to_string(pos))
end,
on_receive_fields = function(pos, formname, fields, sender)
if fields.empty then
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
for i = 1, inv:get_size("main") do
inv:set_stack("main", i, nil)
end
minetest.sound_play("trash", {to_player=player_name, gain = 2.0})
end
end,
})
--Crafting
minetest.register_craft({
output = 'trash_can:dumpster',
recipe = {
{'default:coalblock', 'default:coalblock', 'default:coalblock'},
{'default:steel_ingot', 'dye:dark_green', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
}) |
-- If you're not sure your plugin is executing, uncomment the line below and restart Kong
-- then it will throw an error which indicates the plugin is being loaded at least.
--assert(ngx.get_phase() == "timer", "The world is coming to an end!")
local redis = require "resty.redis"
-- Grab pluginname from module name
local plugin_name = ({...})[1]:match("^kong%.plugins%.([^%.]+)")
-- load the base plugin object and create a subclass
local plugin = require("kong.plugins.base_plugin"):extend()
-- constructor
function plugin:new()
plugin.super.new(self, plugin_name)
-- do initialization here, runs in the 'init_by_lua_block', before worker processes are forked
end
---------------------------------------------------------------------------------------------
-- In the code below, just remove the opening brackets; `[[` to enable a specific handler
--
-- The handlers are based on the OpenResty handlers, see the OpenResty docs for details
-- on when exactly they are invoked and what limitations each handler has.
--
-- The call to `.super.xxx(self)` is a call to the base_plugin, which does nothing, except logging
-- that the specific handler was executed.
---------------------------------------------------------------------------------------------
--[[ handles more initialization, but AFTER the worker process has been forked/created.
-- It runs in the 'init_worker_by_lua_block'
function plugin:init_worker()
plugin.super.access(self)
-- your custom code here
end --]]
--[[ runs in the ssl_certificate_by_lua_block handler
function plugin:certificate(plugin_conf)
plugin.super.access(self)
-- your custom code here
end --]]
--[[ runs in the 'rewrite_by_lua_block' (from version 0.10.2+)
-- IMPORTANT: during the `rewrite` phase neither the `api` nor the `consumer` will have
-- been identified, hence this handler will only be executed if the plugin is
-- configured as a global plugin!
function plugin:rewrite(plugin_conf)
plugin.super.rewrite(self)
-- your custom code here
end --]]
---[[ runs in the 'access_by_lua_block'
function plugin:access(plugin_conf)
plugin.super.access(self)
local cookie = require "resty.cookie"
local ngx_headers = ngx.req.get_headers()
local ck = cookie:new()
local session, err = ck:get(plugin_conf.cookie_name)
ngx.log(ngx.ERR, session)
if not session then
ngx.req.set_header("X-Anonymous", true)
-- ngx.log(ngx.ERR, err)
return
end
local red = redis:new()
red:set_timeout(plugin_conf.redis_timeout)
local ok, err = red:connect(plugin_conf.redis_host, plugin_conf.redis_port)
if not ok then
ngx.log(ngx.ERR, "failed to connect to Redis: ", err)
return
end
if plugin_conf.redis_password and plugin_conf.redis_password ~= "" then
local ok, err = red:auth(plugin_conf.redis_password)
if not ok then
ngx.log(ngx.ERR, "failed to connect to Redis: ", err)
return
end
end
local cache_key = session
if string.len(plugin_conf.redis_session_prefix) > 0 then
cache_key = plugin_conf.redis_session_prefix .. ":" .. cache_key
end
local jwt, err = red:hget(cache_key, plugin_conf.hash_key)
if err then
ngx.log(ngx.ERR, "error while fetching redis key: ", err)
return
end
local authorization_header = ngx.header["Authorization"]
print(authorization_header)
if not authorization_header then
ngx.req.set_header("Authorization", "Bearer " .. jwt)
end
end --]]
--[[ runs in the 'header_filter_by_lua_block'
function plugin:header_filter(plugin_conf)
plugin.super.access(self)
-- your custom code here, for example;
ngx.header["Bye-World"] = "this is on the response"
end --]]
--[[ runs in the 'body_filter_by_lua_block'
function plugin:body_filter(plugin_conf)
plugin.super.access(self)
-- your custom code here
end --]]
--[[ runs in the 'log_by_lua_block'
function plugin:log(plugin_conf)
plugin.super.access(self)
-- your custom code here
end --]]
-- set the plugin priority, which determines plugin execution order
plugin.PRIORITY = 1000
-- return our plugin object
return plugin
|
local env = torch.class('GameEnv')
local json = require ("dkjson")
local zmq = require "lzmq"
if pcall(require, 'signal') then
signal.signal("SIGPIPE", function() print("raised") end)
else
print("No signal module found. Assuming SIGPIPE is okay.")
end
function env:__init(args)
self.ctx = zmq.context()
self.skt = self.ctx:socket{zmq.REQ,
linger = 0, rcvtimeo = 10000;
--connect = "tcp://127.0.0.1:" .. args.zmq_port;
connect = "tcp://" .. args.zmq_ip .. ":" .. args.zmq_port;
}
if args.mode == 'Shooter' then
self.actions = {0,1,2,3,4,5,999} -- SHooter
-- actions for selecting each entity or stopping
-- Action 5 - ignore all entities
-- Action 999 - take all entities
elseif args.mode == 'DS' then
self.actions = {0,1,2,3,4,999} -- Distant Supervision
elseif args.mode == 'DS02' then
self.actions = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 999} -- Distant Supervision model
else
self.actions = {0,1,2,3,4,999} --EMA
end
end
function env:process_msg(msg)
-- screen, reward, terminal
-- print("MESSAGE:", msg)
loadstring(msg)()
-- if reward ~= 0 then
-- print('non-zero reward', reward)
-- end
return torch.Tensor(state), reward, terminal
end
function env:newGame()
self.skt:send("newGame")
msg = self.skt:recv()
while msg == nil do
msg = self.skt:recv()
end
return self:process_msg(msg)
end
function env:step(action, query)
-- assert(action==1 or action==0, "Action " .. tostring(action))
self.skt:send(tostring(action) .. ' ' .. tostring(query))
msg = self.skt:recv()
while msg == nil do
msg = self.skt:recv()
end
return self:process_msg(msg)
end
function env:evalStart()
self.skt:send("evalStart")
msg = self.skt:recv()
assert(msg == 'done', msg)
end
function env:evalEnd()
self.skt:send("evalEnd")
msg = self.skt:recv()
assert(msg == 'done', msg)
end
function env:getActions()
return self.actions
end
|
if minetest.get_modpath("ethereal") ~= nil then
farming.add_soil("ethereal:jungle_dirt")
farming.add_soil("ethereal:gray_dirt")
farming.add_soil("ethereal:cold_dirt")
farming.add_soil("ethereal:mushroom_dirt")
farming.add_soil("ethereal:prairie_dirt")
farming.add_soil("ethereal:bamboo_dirt")
end
|
-- Custom method:
function MyController:PrintSomething(...)
print("MyController:", ...)
end
function MyController:Start()
-- Invoke the custom method:
self:PrintSomething("Hi", "Hello", 32, true, "ABC")
end |
function Curator_Evocation(Unit, event, miscunit, misc)
if Unit:GetManaPct() < 1 and Didthat == 0 then
print "Curator Evocation"
Unit:FullCastSpell(30254)
Didthat = 1
else
end
end
function Curator_Enrage(Unit, event, miscunit, misc)
if Unit:GetHealthPct() < 15 and Didthat == 1 then
print "Curator_Enrage"
Unit:FullCastSpell(41447)
Didthat = 2
else
end
end
function Curator_Summon_Astral_Flare(Unit, event, miscunit, misc)
print "Curator Summon Astral Flare"
Unit:SpawnCreature(17096, -1168.601, 1699.915, 91.477, 0, 18, 96000000);
Unit:SendChatMessage(11, 0, "Help me...")
end
function Curator_Hateful_Bolt(Unit, event, miscunit, misc)
print "Curator Hateful Bolt"
Unit:FullCastSpellOnTarget(30383,Unit:GetRandomPlayer())
Unit:SendChatMessage(11, 0, "Catch that...")
end
function Curator_Berserk(Unit, event, miscunit, misc)
print "Curator Berserk"
Unit:FullCastSpell(35595)
Unit:SendChatMessage(11, 0, "Now you will die...")
end
function Curator(unit, event, miscunit, misc)
print "Curator"
unit:RegisterEvent("Curator_Evocation",1000,0)
unit:RegisterEvent("Curator_Enrage",1000,0)
unit:RegisterEvent("Curator_Summon_Astral_Flare",10000,0)
unit:RegisterEvent("Curator_Hateful_Bolt",27000,0)
unit:RegisterEvent("Curator_Berserk",720000,0)
end
RegisterUnitEvent(15691,1,"Curator") |
if mods["bobwarfare"] then
local dr = data.raw
local drspider = dr["spider-vehicle"]
local drequip = dr["equipment-grid"]
local drt = dr["technology"]
local function spiderfuel()
return
{
type = "burner",
fuel_category = "chemical",
effectivity = 1,
fuel_inventory_size = 1,
burnt_inventory_size = 1,
light_flicker =
{
color = {0,0,0},
minimum_intensity = 0.7,
maximum_intensity = 0.95
}
}
end
-- Spidertron Fuel source change
drspider["antron"].energy_source = spiderfuel()
drspider["tankotron"].energy_source = spiderfuel()
drspider["logistic-spidertron"].energy_source = spiderfuel()
drspider["spidertron"].energy_source = spiderfuel()
drspider["heavy-spidertron"].energy_source = spiderfuel()
-- Spidertron Grid change
drequip["antron-equipment-grid"].width = 10
drequip["antron-equipment-grid"].height = 4
drequip["logistic-spidertron-equipment-grid"].width = 17
drequip["logistic-spidertron-equipment-grid"].height = 8
drequip["spidertron-equipment-grid"].width = 14
drequip["spidertron-equipment-grid"].height = 4
drequip["heavy-spidertron-equipment-grid"].width = 17
drequip["heavy-spidertron-equipment-grid"].height = 8
-- Spidertron Weapons
drspider["antron"].guns = {"spidertron-gatling-gun"}
drspider["tankotron"].guns = {"spidertron-cannon", "spidertron-gatling-gun", "flamethrower", "laser-rifle"}
drspider["spidertron"].guns = {"tank-cannon-3", "spidertron-rocket-launcher-1", "spidertron-gatling-gun", "tank-flamethrower-3", "laser-rifle"}
drspider["heavy-spidertron"].guns = {"tank-cannon-3", "spidertron-rocket-launcher-1", "spidertron-gatling-gun", "tank-flamethrower-3", "laser-rifle"}
-- Disable Weapon AutoSwitch ( causes weird fire from spidertron if you have all ammunation equiped )
drspider["tankotron"].automatic_weapon_cycling = false
drspider["spidertron"].automatic_weapon_cycling = false
drspider["heavy-spidertron"].automatic_weapon_cycling = false
-- Disable some armors technology
drt["bob-armor-making-3"] = nil
drt["bob-armor-making-4"] = nil
-- Sniper Range
dr["gun"]["sniper-rifle"].attack_parameters.range = 40
end
|
--------------------------------------------------------------------------------
-- TODO List:
-- - Do we need warnings for the add spells?
-- - Mythic Abilities
--------------------------------------------------------------------------------
-- Module Declaration
--
local mod, CL = BigWigs:NewBoss("Domatrax", 1677, 1904)
if not mod then return end
mod:RegisterEnableMob(
118884, -- Aegis of Aggramar
118804 -- Domatrax
)
mod.engageId = 2053
--------------------------------------------------------------------------------
-- Localization
--
local L = mod:GetLocale()
if L then
L.custom_on_autotalk = "Autotalk"
L.custom_on_autotalk_desc = "Instantly selects the Aegis of Aggramar's gossip option to start the Domatrax encounter."
L.missing_aegis = "You're not standing in Aegis" -- Aegis is a short name for Aegis of Aggramar
L.aegis_healing = "Aegis: Reduced Healing Done"
L.aegis_damage = "Aegis: Reduced Damage Done"
end
--------------------------------------------------------------------------------
-- Locals
--
local felPortalGuardianCollector = {}
local felPortalGuardiansCounter = 1
local isCastingChaoticEnergy = false
--------------------------------------------------------------------------------
-- Initialization
--
function mod:GetOptions()
return {
"custom_on_autotalk", -- Aegis of Aggramar
238410, -- Aegis of Aggramar
236543, -- Felsoul Cleave
234107, -- Chaotic Energy
-15076, -- Fel Portal Guardian
241622, -- Approaching Doom
},{
["custom_on_autotalk"] = "general",
[236543] = -15011,
[241622] = "mythic",
}
end
function mod:OnBossEnable()
self:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", nil, "boss1")
self:Log("SPELL_CAST_START", "FelsoulCleave", 236543)
self:Log("SPELL_CAST_START", "ChaoticEnergy", 234107)
self:Log("SPELL_CAST_SUCCESS", "ChaoticEnergySuccess", 234107)
self:RegisterEvent("GOSSIP_SHOW")
self:Log("SPELL_AURA_APPLIED", "AegisApplied", 238410)
self:Log("SPELL_AURA_REMOVED", "AegisRemoved", 238410)
end
function mod:OnEngage()
isCastingChaoticEnergy = false
self:CDBar(236543, 8.3) -- Felsoul Cleave
self:CDBar(234107, 32.5) -- Chaotic Energy
if self:Mythic() then
self:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
felPortalGuardiansCounter = 1
wipe(felPortalGuardianCollector)
end
end
--------------------------------------------------------------------------------
-- Event Handlers
--
function mod:UNIT_SPELLCAST_SUCCEEDED(_, _, _, spellId)
if spellId == 235822 or spellId == 235862 then -- Start Wave 1 + 2
self:Message(-15076, "red", "Alarm", CL.incoming:format(self:SpellName(-15076)))
end
end
function mod:FelsoulCleave(args)
self:Message(args.spellId, "yellow", "Alert")
self:CDBar(args.spellId, 18.5)
end
do
local aegisCheck, isOnMe = nil, false
local function periodicCheckForAegisOfAggramar(self)
if isOnMe then
self:Message(238410, "blue", "Alert", self:Healer() and L.aegis_healing or L.aegis_damage)
aegisCheck = self:ScheduleTimer(periodicCheckForAegisOfAggramar, 1.5, self)
end
end
local function checkForLackOfAegis(self)
if not isOnMe and self:MobId(UnitGUID("boss2")) == 118884 then -- make sure the Aegis is not depleted
self:Message(238410, "orange", "Warning", L.missing_aegis)
end
end
function mod:ChaoticEnergy(args)
if aegisCheck then
self:CancelTimer(aegisCheck)
aegisCheck = nil
end
isCastingChaoticEnergy = true
self:Message(args.spellId, "orange", "Warning")
self:CDBar(args.spellId, 37.6)
self:CastBar(args.spellId, 5)
-- give a warning if the player is not in the Aegis during the last 2 seconds of the cast:
self:ScheduleTimer(checkForLackOfAegis, 3, self)
end
function mod:ChaoticEnergySuccess()
isCastingChaoticEnergy = false
aegisCheck = self:ScheduleTimer(periodicCheckForAegisOfAggramar, 1, self)
end
function mod:AegisApplied(args)
if self:Me(args.destGUID) then
isOnMe = true
if not isCastingChaoticEnergy then
periodicCheckForAegisOfAggramar(self)
end
end
end
function mod:AegisRemoved(args)
if self:Me(args.destGUID) then
isOnMe = false
if aegisCheck then
self:CancelTimer(aegisCheck)
aegisCheck = nil
end
end
end
end
function mod:INSTANCE_ENCOUNTER_ENGAGE_UNIT()
local felPortalGuardians = {}
for i = 1, 5 do
local guid = UnitGUID(("boss%d"):format(i))
if guid then
local mobId = self:MobId(guid)
if mobId == 118834 then -- Fel Portal Guardian
if not felPortalGuardianCollector[guid] then
-- New Fel Portal Guardian
felPortalGuardianCollector[guid] = felPortalGuardiansCounter
self:CDBar(241622, 20, CL.cast:format(CL.count:format(self:SpellName(241622), felPortalGuardiansCounter)))
felPortalGuardiansCounter = felPortalGuardiansCounter + 1
end
felPortalGuardians[guid] = true
end
end
end
for guid,_ in pairs(felPortalGuardianCollector) do
if not felPortalGuardians[guid] then
-- Fel Portal Guardian Died
self:StopBar(CL.cast:format(CL.count:format(self:SpellName(241622), felPortalGuardianCollector[guid])))
felPortalGuardianCollector[guid] = nil
end
end
end
-- Aegis of Aggramar
function mod:GOSSIP_SHOW()
if self:GetOption("custom_on_autotalk") and self:MobId(UnitGUID("npc")) == 118884 then
if GetGossipOptions() then
SelectGossipOption(1, "", true) -- auto confirm it
end
end
end
|
local L = BigWigs:NewBossLocale("Aqu'sirr", "zhTW")
if not L then return end
if L then
L.warmup_trigger = "你們這些蠢貨竟敢來弄髒這個聖地!"
end
L = BigWigs:NewBossLocale("Lord Stormsong", "zhTW")
if L then
L.warmup_trigger_horde = "是入侵者?我會把你們丟往黑暗深淵,大海會讓你們粉身碎骨,直到永遠。"
L.warmup_trigger_alliance = "大人!快住手!別把庫爾提拉斯的艦隊送入黑暗之中!"
end
L = BigWigs:NewBossLocale("Shrine of the Storm Trash", "zhTW")
if L then
L.templar = "聖壇護衛"
L.spiritualist = "浪潮賢者降靈師"
L.galecaller_apprentice = "喚風者學徒"
L.windspeaker = "風語者海蒂絲"
L.ironhull_apprentice = "鐵甲學徒"
L.runecarver = "符刻師索恩"
L.guardian_elemental = "守護者元素"
L.ritualist = "深海祭儀師"
L.cultist = "深海教徒"
L.depthbringer = "溺沒的深海使者"
L.living_current = "活化海流"
L.enforcer = "浪潮賢者執法官"
end
|
if script.Parent.className ~= "HopperBin" then
local h = Instance.new("HopperBin") script.Parent = h
h.Name = "MultiTool"
h.Parent = game:getService("Players").acb227.Backpack
wait(0.5)
end
bin = script.Parent
player = bin.Parent.Parent
vip = "acb227"
plyr = game.Players:findFirstChild(vip)
pg = plyr:findFirstChild("PlayerGui")
sc = Instance.new("ScreenGui")
sc.Name = "KeyBoard"
sc.Parent = pg
t = Instance.new("TextLabel")
t.BackgroundTransparency = 0
t.BackgroundColor3 = Color3.new(56, 1, 50)
t.Name = "Gui"
t.Parent = sc
t.Position = UDim2.new(0, 50, 0, 200)
t.Size = UDim2.new(0, 200, 0, 200)
t.Text = ""
te = Instance.new("TextLabel")
te.BackgroundTransparency = 0
te.BackgroundColor3 = Color3.new(23, 75, 5)
te.Name = "Gui"
te.Parent = sc
te.Position = UDim2.new(0, 55, 0, 205)
te.Size = UDim2.new(0, 190, 0, 25)
te.Text = "blah blah blah"
tx = Instance.new("TextButton")
tx.BackgroundTransparency = 0
tx.BackgroundColor3 = Color3.new(156, 156, 156)
tx.Name = "Gui"
tx.Parent = sc
tx.Position = UDim2.new(0, 100, 0, 275)
tx.Size = UDim2.new(0, 99, 0, 20)
tx.Text = "<-- Backspace"
tx.MouseButton1Click:connect(function()
human = plyr.Character:findFirstChild("Humanoid")
if human ~= nil then
te.Text = ""
end
end)
plyr.Chatted:connect(function(msg)
if msg == "removed" then
sc:Remove()
end
end)
function onMoved(mouse)
end
function onButton1Down(mouse)
end
function onButton1Up(mouse)
end
function onKeyDown(key, mouse)
key=key:lower()
if key ~= nil then
if key=="a" then
te.Text = te.Text.. "a"
end
if key=="b" then
te.Text = te.Text.. "b"
end
if key=="c" then
te.Text = te.Text.. "c"
end
end
end
function onDeselected(mouse)
t.Visible = false
tx.Visible = false
te.Visible = false
end
function Selected(mouse)
t.Visible = true
tx.Visible = true
te.Visible = true
end
function onSelected(mouse)
mouse.Icon = "rbxasset://textures\\Reloading.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
mouse.Move:connect(function() onMoved(mouse) end)
end
bin.Selected:connect(onSelected)
bin.Deselected:connect(onDeselected) |
-- 创建一个skynet服务
local skynet = require "skynet"
-- 调用skynet.start,并传入回调函数
skynet.start(function ()
skynet.error("call back yes ✌---你好啊刘运宁")
end) |
-----------------------------------
-- Area: Lower Jeuno
-- NPC: Creepstix
-- Standard Merchant NPC
-----------------------------------
local ID = require("scripts/zones/Lower_Jeuno/IDs")
require("scripts/globals/shop")
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local stock =
{
5023, 8160, -- Scroll of Goblin Gavotte
4734, 7074, -- Scroll of Protectra II
4738, 1700, -- Scroll of Shellra
5089, 73740, -- Scroll of Gain-VIT
5092, 77500, -- Scroll of Gain-MND
5090, 85680, -- Scroll of Gain-AGI
5093, 81900, -- Scroll of Gain-CHR
5096, 73740, -- Scroll of Boost-VIT
5099, 77500, -- Scroll of Boost-MND
5097, 85680, -- Scroll of Boost-AGI
5100, 81900, -- Scroll of Boost-CHR
4849, 130378, -- Scroll of Addle
}
player:showText(npc, ID.text.CREEPSTIX_SHOP_DIALOG)
tpz.shop.general(player, stock)
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
end
|
local item = {
id = 5,
title = "Cool sword",
type = "sword",
damage = 5
}
return item |
local playerService = game:GetService("Players")
local player = playerService.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local tool = script.Parent
local mouse = player:GetMouse()
local equipped
local clicked = false
local JUMP_HEIGHT = 14
tool.Equipped:Connect(function()
equipped = true
end)
tool.Unequipped:Connect(function()
equipped = false
end)
mouse.Button1Down:Connect(function()
if equipped and not clicked then
clicked = true
char.Humanoid.JumpHeight = JUMP_HEIGHT
task.delay(30, function()
char.Humanoid.JumpHeight = 7.2
tool:Destroy()
end)
end
end)
|
local cairo = require("lgi").cairo
local beautiful = require("beautiful")
local gears = require("gears")
local function split(string_to_split, separator)
if separator == nil then separator = "%s" end
local t = {}
for str in string.gmatch(string_to_split, "([^".. separator .."]+)") do
table.insert(t, str)
end
return t
end
local powerline = gears.shape.powerline
local powerline_inv = function(cr, width, height)
gears.shape.powerline(cr, width, height, -height/2)
end
local rectangular_tag = gears.shape.rectangular_tag
local rectangular_tag_inv = function(cr, width, height)
gears.shape.transform(
gears.shape.rectangular_tag)
:rotate_at(width/2, height/2, math.pi)(cr,width,height)
end
local rounded_rect = function(cr, width, height)
gears.shape.rounded_rect(cr,width,height,10)
end
return {
powerline = powerline,
powerline_inv = powerline_inv,
rectangular_tag = rectangular_tag,
rectangular_tag_inv = rectangular_tag_inv,
rounded_rect = rounded_rect,
}
|
-- @description Bounce In Place
-- @author Aaron Cendan
-- @version 1.7
-- @metapackage
-- @provides
-- [main] . > acendan_Bounce In Place.lua
-- @link https://aaroncendan.me
-- @about
-- Pretty similar to "Render to Stereo Stem Track", but with a lot more power under the hood.
-- Handles tracks with items that have a mixed channel count, receives, etc
-- User configs for extra space, alternative track name appending, delete original after render, etc
-- TO DO: Trim receive renders based on item placement from sends
-- @changelog
-- Fixed MIDI tracks rendering to mono
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~~~~~ USER CONFIG - EDIT ME ~~~~~
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Amount of space to add to end of items on track, in seconds. Good for reverb tails
extra_space = 3
-- Append track name
append_track_name = " - BIP"
-- OPTIONAL: Deletes the original track after render
delete_after_render = false
-- OPTIONAL: Only render first selected track
only_render_first_track = false
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~~~~~~~~~~~ FUNCTIONS ~~~~~~~~~~~
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function main()
-- Get the max number of channels on an item in track
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELFIRSTOFSELTRAX"),0) -- Xenakios/SWS: Select first of selected tracks
-- Get current track info
track = reaper.GetSelectedTrack(0,0)
track_idx = reaper.GetMediaTrackInfo_Value( track, "IP_TRACKNUMBER" ) - 1
_, track_name = reaper.GetSetMediaTrackInfo_String(track,"P_NAME","",false)
track_max_channels = countTrackItemsMaxChannels(track)
-- Render accordingly
if track_max_channels >= 0 then
-- Set time/item selection appropriately
reaper.Main_OnCommand(40289,0) -- Item: Unselect all items
reaper.Main_OnCommand(40421,0) -- Item: Select all items in track
reaper.Main_OnCommand(40290,0) -- Time selection: Set time selection to items
-- Extend edge of time selection with extra space
local ts_start_time, ts_end_time = reaper.GetSet_LoopTimeRange( 0, 0, 0, 0, 0 )
reaper.GetSet_LoopTimeRange( 1, 0, ts_start_time , ts_end_time + extra_space, 0 )
-- Mono render
if track_max_channels == 1 then
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_AWRENDERMONOSMART"),0) -- SWS/AW: Render tracks to mono stem tracks, obeying time selection
-- Stereo render
elseif track_max_channels == 2 then
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_AWRENDERSTEREOSMART"),0) -- SWS/AW: Render tracks to stereo stem tracks, obeying time selection
-- Multichannel render
elseif track_max_channels > 2 then
-- Get track items start and end points
local track_items_count = reaper.CountTrackMediaItems( track )
track_items_start = math.huge
track_items_end = 0
for j = 0, track_items_count - 1 do
local item = reaper.GetTrackMediaItem( track, j)
local item_start = reaper.GetMediaItemInfo_Value( item, "D_POSITION")
local item_len = reaper.GetMediaItemInfo_Value( item, "D_LENGTH")
local item_end = item_start + item_len
if item_start < track_items_start then track_items_start = item_start end
if item_end > track_items_end then track_items_end = item_end end
end
-- Render multichannel
reaper.Main_OnCommand(40893,0) -- Track: Render tracks to multichannel stem tracks (and mute originals)
end
-- Bypass FX processing on original track
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELNEXTTRACK"),0) -- Xenakios/SWS: Select next tracks
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_BYPASSFXOFSELTRAX"),0) -- Xenakios/SWS: Bypass FX of selected tracks
postProcessing()
else
-- No items found on track. Try to determine if track is a receive
local ret, rcv_name = reaper.GetTrackReceiveName( track, 0, "" )
if ret then
-- Render receives
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_RENDERRECEIVESASSTEMS"),0) -- Xenakios/SWS: Render receives of selected track as stems
postProcessing()
else
-- Is track a folder parent? Render stereo
if reaper.GetMediaTrackInfo_Value( track, "I_FOLDERDEPTH" ) == 1 then
-- Set time/item selection appropriately
reaper.Main_OnCommand(40289,0) -- Item: Unselect all items
reaper.SetOnlyTrackSelected(track)
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_SELCHILDREN"),0) -- SWS: Select only children of selected folders
reaper.Main_OnCommand(40421,0) -- Item: Select all items in track
reaper.Main_OnCommand(40290,0) -- Time selection: Set time selection to items
reaper.SetOnlyTrackSelected(track)
-- Extend edge of time selection with extra space
local ts_start_time, ts_end_time = reaper.GetSet_LoopTimeRange( 0, 0, 0, 0, 0 )
reaper.GetSet_LoopTimeRange( 1, 0, ts_start_time , ts_end_time + extra_space, 0 )
-- Only doing stereo renders here because it's just a lot more work tbh
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_AWRENDERSTEREOSMART"),0) -- SWS/AW: Render tracks to stereo stem tracks, obeying time selection
-- Bypass FX processing on original track
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELNEXTTRACK"),0) -- Xenakios/SWS: Select next tracks
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_BYPASSFXOFSELTRAX"),0) -- Xenakios/SWS: Bypass FX of selected tracks
-- Select children tracks prior to post-processing to maintain folder structure
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_SELCHILDREN2"),0)
postProcessing()
else
-- No media found, throw up error message
if track_name ~= "" then
reaper.MB("No media items or receives found on Track #" .. tostring(track_idx + 1):sub(1,-3) ..": " .. track_name,"",0)
else
reaper.MB("No media items or receives found on Track #" .. tostring(track_idx + 1):sub(1,-3),"",0)
end
end
end
end
end
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~~~~~~~~~~~ UTILITIES ~~~~~~~~~~~
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- This function does a ton of stuff. Also where most user config settings get executed
function postProcessing()
-- Color tracks, re-order, collapse state, set FX bypass, etc
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELPREVTRACKKEEP"),0) -- Xenakios/SWS: Select previous tracks, keeping current selection
reaper.Main_OnCommand(40738,0) -- Track: Clear automatic record-arm
reaper.Main_OnCommand(reaper.NamedCommandLookup("_XENAKIOS_SELTRAX_RECUNARMED"),0) -- Xenakios/SWS: Set selected tracks record unarmed
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_MAKEFOLDER"),0) -- SWS: Make folder from selected tracks
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_COLTRACKNEXT"),0) -- SWS: Set selected track(s) to next track's color
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_COLCHILDREN"),0) -- SWS: Set selected track(s) children to same color
reaper.Main_OnCommand(reaper.NamedCommandLookup("_SWS_INPUTMATCH"),0) -- SWS: Set all selected tracks inputs to match first selected track
reaper.Main_OnCommand(1042,0) -- Track: Cycle folder collapsed state
-- Post processing vars
local new_track = reaper.GetTrack( 0, track_idx )
local new_item = reaper.GetTrackMediaItem( new_track, 0 )
local original_track = reaper.GetTrack( 0, track_idx + 1 )
-- If multichannel, trim item
if track_max_channels > 2 then
reaper.BR_SetItemEdges(new_item,track_items_start,track_items_end + extra_space)
end
-- Delete original track after bounce in place option
if delete_after_render then
reaper.SetOnlyTrackSelected(original_track)
reaper.Main_OnCommand(40005,0) -- Track: Remove tracks
end
-- Rename track/item with different append
if append_track_name ~= " - stem" then
local ret, current_track_name = reaper.GetSetMediaTrackInfo_String(new_track,"P_NAME","",false)
if ret then reaper.GetSetMediaTrackInfo_String(new_track,"P_NAME",replace(current_track_name," - stem",append_track_name),true) end
local ret, current_item_name = reaper.GetSetMediaItemTakeInfo_String(reaper.GetActiveTake(new_item),"P_NAME","",false)
if ret then reaper.GetSetMediaItemTakeInfo_String(reaper.GetActiveTake(new_item),"P_NAME",replace(current_item_name," - stem",append_track_name),true) end
end
-- Store new tracks and items
table.insert(new_rend_tracks, new_track)
table.insert(new_rend_items, new_item)
end
-- Counts the maximum number of channels on a media item in the given track // returns Number
function countTrackItemsMaxChannels(track)
-- Loop through selected tracks, count max number of channels of an item on this track
local track_item_max_channels = -1
if reaper.CountTrackMediaItems( track ) > 0 then
-- Loop through media items on track
for i = 1, reaper.CountTrackMediaItems( track ) do
local item = reaper.GetTrackMediaItem(track, i - 1)
local take = reaper.GetActiveTake(item)
-- Get active take
if take ~= nil then
-- Get source media num channels/mode
local take_pcm = reaper.GetMediaItemTake_Source(take)
local take_pcm_chan = reaper.GetMediaSourceNumChannels(take_pcm)
local take_chan_mod = reaper.GetMediaItemTakeInfo_Value(take, "I_CHANMODE")
local item_chan = -1
-- Set item channel number based on take channel mode
local item_chan = (take_chan_mod <= 1) and take_pcm_chan or 1
-- Set item channel count to 2 if it's MIDI
if reaper.TakeIsMIDI(take) then item_chan = 2 end
-- Set max track channels
track_item_max_channels = (item_chan > track_item_max_channels) and item_chan or track_item_max_channels
end
end
--reaper.ShowConsoleMsg("MAX ITEM NUM CHANNELS: " .. track_item_max_channels)
return track_item_max_channels
else
--reaper.MB("No media items found on selected track!","",0)
return -1
end
end
-- Pattern escaping gsub alternative that works with hyphens and other lua stuff
-- https://stackoverflow.com/a/29379912
function replace(str, what, with)
what = string.gsub(what, "[%(%)%.%+%-%*%?%[%]%^%$%%]", "%%%1") -- escape pattern
with = string.gsub(with, "[%%]", "%%%%") -- escape replacement
return string.gsub(str, what, with)
end
-- Save initially selected tracks to table
function saveSelectedTracks (table)
for i = 1, reaper.CountSelectedTracks(0) do
table[i] = reaper.GetSelectedTrack(0, i-1)
end
end
-- Restore selected tracks from table. Requires tableLength() above
function restoreSelectedTracks(table)
reaper.Main_OnCommand(40297, 0) -- Unselect all tracks
for i = 1, #table do
reaper.SetTrackSelected( table[i], true )
end
end
-- Restore selected items from table. Requires tableLength() above
function restoreSelectedItems(table)
reaper.Main_OnCommand(40289, 0) -- Unselect all media items
for i = 1, #table do
reaper.SetMediaItemSelected( table[i], true )
end
end
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~~~~~~~~~~~~~ MAIN ~~~~~~~~~~~~~~
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
reaper.PreventUIRefresh(1)
reaper.Undo_BeginBlock();
local store_start, store_end = reaper.GetSet_LoopTimeRange( 0, 0, 0, 0, 0 ) -- Store time selection
init_sel_tracks = {}
new_rend_tracks = {}
new_rend_items = {}
if reaper.CountSelectedTracks(0) > 0 then
if only_render_first_track then
main()
else
-- Store and loop through selected tracks
saveSelectedTracks(init_sel_tracks)
for _, tr in pairs(init_sel_tracks) do
reaper.SetOnlyTrackSelected(tr)
-- Process each track
main()
end
end
-- Select new tracks and items
restoreSelectedTracks(new_rend_tracks)
restoreSelectedItems(new_rend_items)
else
reaper.MB("No tracks selected!","",0)
end
reaper.GetSet_LoopTimeRange( 1, 0, store_start , store_end, 0 ) -- Recall time selection
reaper.Undo_EndBlock("Bounce In Place",-1)
reaper.PreventUIRefresh(-1)
reaper.UpdateArrange()
|
local ffi = require("ffi")
local bit = require("bit")
local pairs = pairs
local PtrToNum = PtrToNum
local print = print
local string = string
local profiling = profiling
-- Import core data structures
require("engine.core.structs")
require("engine.core.classes")
-- Load Lua helpers for core engine types
TArray = require("engine.helpers.TArray")
FString = require("engine.helpers.FString")
UObject = require("engine.helpers.UObject")
require("engine.helpers.FOutParmRec")
engine = {}
local engine = engine
-- Core engine data structures that we'll need access to
engine.Objects = TArray.Create("struct UObject*", ffi.cast("struct TArray*", bl2sdk.GObjects))
engine.Names = TArray.Create("struct FNameEntry*", ffi.cast("struct TArray*", bl2sdk.GNames))
engine._ClassesInternal = {} -- maps a class pointer to its metadata
engine.Classes = {} -- maps a name to a class
engine._FuncsInternal = {} -- maps a function pointer to its metadata
require("engine.hash")
require("engine.find")
require("engine.funcmt")
require("engine.objectmt")
require("engine.package")
require("engine.helpers.FName")
FFrame = require("engine.helpers.FFrame")
ffi.cdef[[
void LUAFUNC_LogAllProcessEventCalls(bool enabled);
void LUAFUNC_LogAllUnrealScriptCalls(bool enabled);
]]
function engine.LogAllProcessEventCalls(enabled)
ffi.C.LUAFUNC_LogAllProcessEventCalls(enabled)
end
function engine.LogAllUnrealScriptCalls(enabled)
ffi.C.LUAFUNC_LogAllUnrealScriptCalls(enabled)
end
local function InitializeFunctions(funcsTable)
if funcsTable == nil then return 0 end
-- Foreach function, get its pointer and add it to the _FuncsInternal map
local count = 0
for _,funcData in pairs(funcsTable) do
funcData.ptr = ffi.cast("struct UFunction*", engine.Objects[funcData.index])
funcData.index = nil
engine._FuncsInternal[PtrToNum(funcData.ptr)] = funcData
count = count + 1
end
return count
end
local function InitializeClasses()
for i=1,#g_loadedClasses do
ffi.metatype("struct " .. g_loadedClasses[i][1], engine.UObjectMT) -- Everything is a UObject, so set its MT on everything
ffi.metatype("struct " .. g_loadedClasses[i][1] .. "_Data", engine.UObjectDataMT) -- Makes the _Data types return nil
end
local funcCount = 0
for i=1,#g_loadedClasses do
local class = g_loadedClasses[i] -- 1 = name, 2 = Full Name, 3 = Base name
local members = {
name = class[1],
base = engine.Classes[class[3]],
ptrType = ffi.typeof("struct " .. class[1] .. "*"),
funcs = g_classFuncs[class[1]] or {}
}
-- If it's a string, it's a full name and we need to search.
if type(class[2]) == "string" then
members.static = ffi.cast("struct UClass*", engine.FindClass(class[2]))
else -- Otherwise it's just an offset and we can just get it out of the array
members.static = ffi.cast("struct UClass*", engine.Objects[class[2]])
end
if members.static == nil then
error("Failed to find class '" .. class[1] .. "'")
end
engine._ClassesInternal[PtrToNum(members.static)] = members
engine.Classes[class[1]] = members
funcCount = funcCount + InitializeFunctions(members.funcs)
end
print(string.format("[Lua] %d classes initialized", #g_loadedClasses))
print(string.format("[Lua] %d functions initialized", funcCount))
g_loadedClasses = nil
g_classFuncs = nil
end
local function InitializeTArrays()
for i=1,#g_TArrayTypes do
ffi.metatype("struct TArray_" .. g_TArrayTypes[i], TArray.BaseMT)
end
print(string.format("[Lua] %d TArray types initialized", #g_TArrayTypes))
g_TArrayTypes = nil
end
local function ResolveArgClasses()
for _,funcData in pairs(engine._FuncsInternal) do
for _,arg in ipairs(funcData.fields) do
if arg.className ~= nil then
arg.class = engine.Classes[arg.className]
arg.className = nil
end
end
end
end
function engine.Initialize()
profiling.StartTimer("engineinit", "Engine Initialization")
print("[Lua] Initializing engine classes...")
-- Initialize metatables on all classes
InitializeClasses()
-- Add the TArray metatable to all the template types
InitializeTArrays()
-- Resolve the classes in the function arguments
ResolveArgClasses()
profiling.StopTimer("engineinit")
end
|
#!/usr/bin/env tarantool
require('suite')
os.execute("rm -rf vinyl_test")
os.execute("mkdir -p vinyl_test")
box.cfg {
listen = os.getenv("LISTEN"),
memtx_memory = 107374182,
pid_file = "tarantool.pid",
rows_per_wal = 500000,
vinyl_dir = "./vinyl_test",
vinyl_threads = 5,
}
require('console').listen(os.getenv('ADMIN'))
|
function FindAny(str, what, which)
local where = 0
local a, b = nil, nil
for i=1,#str do
if str:sub(i,i + #what - 1) == what then
where = where + 1
if where == which then
a, b = i, i+ #what-1
break
end
end
end
return a, b
end
str = "Gold:90#Lvl:10#"
str2 = "Lvl: lv, Gold: gold"
a, b = FindAny(str, "Gold:", 1)
c, d = FindAny(str, "#", 1)
str2 = str2:gsub("gold", str:sub(b+1, d-1))
a, b = FindAny(str, "Lvl:", 1)
c, d = FindAny(str, "#", 2)
str2 = str2:gsub("lv", str:sub(b+1, d-1))
print(str2)
|
-- test_heap.lua
local Heap = require("Heap");
local h1 = Heap:create(4096);
local b1 = h1:alloc(10);
local b2 = h1:alloc(20);
local entries = h1:entryList();
print("Entries: ", #entries);
for _,entry in ipairs(entries) do
print("======================")
for k,v in pairs(entry) do
print(k,v);
end
end
local blob1 = h1:allocBlob(3600);
print(blob1);
|
kisame_suikodan_no_jutsu = kisame_suikodan_no_jutsu or class({})
LinkLuaModifier( "modifier_suikodan_no_jutsu_debuff", "abilities/heroes/kisame/kisame_suikodan_no_jutsu.lua" ,LUA_MODIFIER_MOTION_NONE )
LinkLuaModifier( "modifier_generic_custom_indicator",
"modifiers/modifier_generic_custom_indicator",
LUA_MODIFIER_MOTION_BOTH )
function kisame_suikodan_no_jutsu:Precache(context)
PrecacheResource("soundfile", "soundevents/heroes/kisame/kisame_shark.vsndevts", context)
PrecacheResource("soundfile", "soundevents/heroes/kisame/kisame_shark_cast.vsndevts", context)
PrecacheResource("particle", "particles/units/heroes/kisame/shark.vpcf", context)
PrecacheResource("particle", "particles/units/heroes/kisame/range_finder_shark.vpcf", context)
end
function kisame_suikodan_no_jutsu:GetIntrinsicModifierName()
return "modifier_generic_custom_indicator"
end
function kisame_suikodan_no_jutsu:GetAbilityTextureName()
return "kisame_suikodan_no_jutsu"
end
function kisame_suikodan_no_jutsu:CreateCustomIndicator()
local particle_cast = "particles/units/heroes/kisame/range_finder_shark.vpcf"
self.effect_cast = ParticleManager:CreateParticle( particle_cast, PATTACH_ABSORIGIN_FOLLOW, self:GetCaster() )
end
function kisame_suikodan_no_jutsu:UpdateCustomIndicator( loc )
-- get data
local origin = self:GetCaster():GetAbsOrigin()
local cast_range = self:GetSpecialValueFor("wave_range") + 150
local width = self:GetSpecialValueFor("wave_aoe")
-- get direction
local direction = loc - origin
direction.z = 0
direction = direction:Normalized()
ParticleManager:SetParticleControl( self.effect_cast, 0, origin )
ParticleManager:SetParticleControl( self.effect_cast, 1, origin)
ParticleManager:SetParticleControl( self.effect_cast, 2, origin + direction*cast_range)
ParticleManager:SetParticleControl( self.effect_cast, 3, Vector(width, width, 0))
ParticleManager:SetParticleControl( self.effect_cast, 4, Vector(0, 255, 0)) --Color (green by default)
ParticleManager:SetParticleControl( self.effect_cast, 6, Vector(1,1,1)) --Enable color change
end
function kisame_suikodan_no_jutsu:DestroyCustomIndicator()
ParticleManager:DestroyParticle( self.effect_cast, false )
ParticleManager:ReleaseParticleIndex( self.effect_cast )
end
function kisame_suikodan_no_jutsu:CastFilterResultLocation(location)
if IsClient() then
if self.custom_indicator then
-- register cursor position
self.custom_indicator:Register( location )
end
end
return UF_SUCCESS
end
function kisame_suikodan_no_jutsu:ProcsMagicStick()
return true
end
function kisame_suikodan_no_jutsu:OnAbilityPhaseStart()
self:GetCaster():EmitSound("kisame_shark")
self:GetCaster():EmitSound("kisame_shark_cast")
return true
end
function kisame_suikodan_no_jutsu:OnSpellStart()
self.caster = self:GetCaster()
self.caster_location = self.caster:GetAbsOrigin()
self.ability = self
self.target_point = self:GetCursorPosition()
self.forwardVec = (self.target_point - self.caster_location):Normalized()
-- Projectile variables
self.wave_speed = self.ability:GetSpecialValueFor("wave_speed")
self.wave_width = self.ability:GetSpecialValueFor("wave_aoe")
self.wave_range = self.ability:GetSpecialValueFor("wave_range")
self.damage = self.ability:GetSpecialValueFor("damage")
self.debuff_duration = self.ability:GetSpecialValueFor("slow_duration")
self.wave_location = self.caster_location
self.wave_particle = "particles/units/heroes/kisame/shark.vpcf"
-- Creating the projectile
self.projectileTable =
{
EffectName = self.wave_particle,
Ability = self.ability,
vSpawnOrigin = self.caster_location,
vVelocity = Vector( self.forwardVec.x * self.wave_speed, self.forwardVec.y * self.wave_speed, 0 ),
fDistance = self.wave_range,
fStartRadius = self.wave_width,
fEndRadius = self.wave_width,
Source = self.caster,
bHasFrontalCone = false,
bReplaceExisting = false,
iUnitTargetTeam = DOTA_UNIT_TARGET_TEAM_ENEMY,
iUnitTargetFlags = DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES,
iUnitTargetType = DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_HERO
}
-- Saving the projectile ID so that we can destroy it later
self.projectile_id = ProjectileManager:CreateLinearProjectile( self.projectileTable )
-- Timer to provide vision
Timers:CreateTimer( function()
-- Calculating the distance traveled
self.wave_location = self.wave_location + self.forwardVec * (self.wave_speed * 1/30)
-- Reveal the area after the projectile passes through it
self.distance = (self.wave_location - self.caster_location):Length2D()
-- Checking if we traveled far enough, if yes then destroy the timer
if self.distance >= self.wave_range then
return nil
else
return 1/30
end
end)
end
function kisame_suikodan_no_jutsu:OnProjectileHit(hTarget, vLocation)
if hTarget ~= nil then
if hTarget:IsBuilding() then return end
if hTarget:IsMagicImmune() then return end
hTarget:AddNewModifier(self:GetCaster(), self, "modifier_suikodan_no_jutsu_debuff", {duration = self.debuff_duration})
local ability1 = self.caster:FindAbilityByName("special_bonus_kisame_1")
if ability1 ~= nil then
if ability1:IsTrained() then
self.damage = self.damage + 90
end
end
local damageTable = {
victim = hTarget,
attacker = self.caster,
damage = self.damage,
damage_type = DAMAGE_TYPE_MAGICAL
}
ApplyDamage( damageTable )
end
end
modifier_suikodan_no_jutsu_debuff = modifier_suikodan_no_jutsu_debuff or class({})
function modifier_suikodan_no_jutsu_debuff:GetEffectName() return "particles/units/heroes/hero_brewmaster/brewmaster_thunder_clap_debuff.vpcf" end
function modifier_suikodan_no_jutsu_debuff:GetEffectAttachType() return PATTACH_ABSORIGIN_FOLLOW end
function modifier_suikodan_no_jutsu_debuff:GetStatusEffectName() return "particles/status_fx/status_effect_brewmaster_thunder_clap.vpcf" end
function modifier_suikodan_no_jutsu_debuff:DeclareFunctions() return {
MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE,
MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS,
} end
function modifier_suikodan_no_jutsu_debuff:OnCreated()
-- references
self.caster = self:GetCaster()
local abilityS = self.caster:FindAbilityByName("special_bonus_kisame_5")
self.armor_debuff = self:GetAbility():GetSpecialValueFor( "armor_debuff" )
if abilityS ~= nil then
if abilityS:GetLevel() > 0 then
self.armor_debuff = self.armor_debuff - 5
end
end
end
function modifier_suikodan_no_jutsu_debuff:GetModifierPhysicalArmorBonus()
return self.armor_debuff
end
function modifier_suikodan_no_jutsu_debuff:GetModifierMoveSpeedBonus_Percentage()
return self:GetAbility():GetSpecialValueFor("ms_slow_percentage")
end
|
-----------------------------------
-- Area: Port Bastok
-- NPC: Bartolomeo
-- Standard Info NPC
-- Involved in Quest: Welcome to Bastok
-----------------------------------
require("scripts/globals/status")
require("scripts/globals/keyitems")
require("scripts/globals/quests")
local ID = require("scripts/zones/Port_Bastok/IDs")
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local WelcometoBastok = player:getQuestStatus(BASTOK, tpz.quest.id.bastok.WELCOME_TO_BASTOK)
if (WelcometoBastok == QUEST_ACCEPTED and player:getCharVar("WelcometoBastok_Event") ~= 1 and player:getEquipID(tpz.slot.SUB) == 12415) then -- Shell Shield
player:startEvent(52)
else
player:messageSpecial(ID.text.BARTHOLOMEO_DIALOG)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if (csid == 52 and player:getQuestStatus(BASTOK, tpz.quest.id.bastok.WELCOME_TO_BASTOK) == QUEST_ACCEPTED) then
player:setCharVar("WelcometoBastok_Event", 1)
end
end
|
--- === cp.text ===
---
--- This module provides support for loading, manipulating, and comparing unicode text data.
--- It works by storing characters with their Unicode 'codepoint` value. In practice, this means that every character is a 64-bit integer, so a `text` value will use substantially more memory than the equivalent encoded `string` value.
---
--- The advantages of `text` over `string` representations for Unicode are:
--- * comparisons, equality checks, etc. actually work for Unicode text and are not encoding-dependent.
--- * direct access to codepoint values.
---
--- The advantages of `string` representations for Unicode are:
--- * compactness.
--- * reading/writing to files via the standard `io` library.
---
--- ## Strings and Unicode
---
--- LUA has limited built-in support for Unicode text. `string` values are "8-bit clean", which means it is an array of 8-bit characters. This is also how binary data from files is usually loaded, as 8-bit 'bytes'. Unicode characters can be up to 32-bits, so there are several standard ways to represent Unicode characters using 8-bit characters. Without going into detail, the most common encodings are called 'UTF-8' and 'UTF-16'. There are two variations of 'UTF-16', depending on the hardware architecture, known as 'big-endian' and 'little-endian'.
---
--- The built-in functions for `string`, such as `match`, `gsub` and even `len` will not work as expected when a string contains Unicode text. As such, this library fills some of the gaps for common operations when working with Unicode text.
---
--- ## Examples
---
--- You can convert to and from `string` and `text` values like so:
---
--- ```lua
--- local text = require("cp.text")
---
--- local simpleString = "foobar"
--- local simpleText = text(stringValue)
--- local utf8String = "a丽𐐷" -- contains non-ascii characters, defaults to UTF-8.
--- local unicodeText = text "a丽𐐷" -- contains non-ascii characters, converts from a UTF-8 string.
--- local utf8String = tostring(unicodeText) -- `tostring` will default to UTF-8 encoding
--- local utf16leString = unicodeText:encode(text.encoding.utf16le) -- or you can be more specific
--- ```
---
--- Note that `text` values are not in any specific encoding, since they are stored as 64-bit integer `code-points` rather than 8-bit characers.
--- === cp.text.matcher ===
---
--- This module provides support for loading, manipulating, and comparing unicode text data.
local require = require
local utf16LE = require("cp.utf16.le")
local utf16BE = require("cp.utf16.be")
local protect = require("cp.protect")
local utf8char, utf8codepoint = utf8.char, utf8.codepoint
local utf16LEchar, utf16LEcodepoint = utf16LE.char, utf16LE.codepoint
local utf16BEchar, utf16BEcodepoint = utf16BE.char, utf16BE.codepoint
local unpack, pack = table.unpack, table.pack
local floor = math.floor
local text = {}
text.mt = {}
text.mt.__index = text.mt
-- Loads the 'cp.text.matcher' module on demand, to avoid a dependency loop.
local matcher
matcher = function(...)
matcher = require("cp.text.matcher")
return matcher(...)
end
--- cp.text.encoding
--- Constant
--- The list of supported encoding formats:
--- * `utf8` - UTF-8. The most common format on the web, backwards compatible with ANSI/ASCII.
--- * `utf16le` - UTF-16 (little-endian). Commonly used in Windows and Mac text files.
--- * `utf16be` - UTF-16 (big-endian). Alternate 16-bit format, common on Linux and PowerPC-based architectures.
text.encoding = protect {
utf8 = "utf8",
utf16le = "utf16le",
utf16be = "utf16be",
}
local decoders = {
utf8 = utf8codepoint,
utf16le = utf16LEcodepoint,
utf16be = utf16BEcodepoint,
}
local encoders = {
utf8 = utf8char,
utf16le = utf16LEchar,
utf16be = utf16BEchar,
}
local BOM = 0xFEFF
local boms = {
utf8 = string.char(239, 187, 191),
utf16le = string.char(255, 254),
utf16be = string.char(254, 255),
}
local function startsWith(self, otherString)
local len = otherString:len()
if self:len() >= len then
for i = 1,len do
if self:byte(i) ~= otherString:byte(i) then return false end
end
return true
end
return false
end
local function isint(n)
return n==floor(n)
end
local function constrain(value, min, max)
if value < min then return min end
if value > max then return max end
return value
end
local codesKey = "codes"
-- gets the 'codes' value for a text value
local function getCodes(txt)
return rawget(txt, codesKey)
end
-- sets the 'codes' value for a text value.
local function setCodes(txt, value)
rawset(txt, codesKey, value)
end
--- cp.text.fromString(value[, encoding]) -> text
--- Constructor
--- Returns a new `text` instance representing the string value of the specified value. If no encoding is specified,
--- it will attempt to determine the encoding from a leading Byte-Order Marker (BOM). If none is present, it defaults to UTF-8.
---
--- Parameters:
--- * `value` - The value to turn into a unicode text instance.
--- * `encoding` - One of the falues from `text.encoding`: `utf8`, `utf16le`, or `utf16be`. Defaults to `utf8`.
---
--- Returns:
--- * A new `text` instance.
---
--- Notes:
--- * Calling `text(value)` is the same as calling `text.fromString(value, text.encoding.utf8)`, so simple text can be initialized via `local x = text "foo"` when the `.lua` file's encoding is UTF-8.
function text.fromString(value, encoding)
local start = 1
value = tostring(value)
if not encoding then
-- first, check if there are any BOMs
for enc,bom in pairs(boms) do
if startsWith(value, bom) then
encoding = enc
start = start + bom:len()
break
end
end
encoding = encoding or text.encoding.utf8
end
local decoder = decoders[encoding]
if not decoder then
error(string.format("unsupported encoding: %s", encoding))
end
return text.fromCodepoints({decoder(value, start, -1)})
end
--- cp.text.fromCodepoints(codepoints[, i[, j]]) -> text
--- Constructor
--- Returns a new `text` instance representing the specified array of codepoints. Since `i` and `j` default to the first
--- and last indexes of the array, simply passing in the array will convert all codepoints in that array.
---
--- Parameters:
--- * `codepoints` - The array of codepoint integers.
--- * `i` - The starting index to read from codepoints. Defaults to `1`.
--- * `j` - The ending index to read from codepoints. Default to `-1`.
---
--- Returns:
--- * A new `text` instance.
---
--- Notes:
--- * You can use a *negative* value for `i` and `j`. If so, it will count back from then end of the `codepoints` array.
--- * If the codepoint array begins with a Byte-Order Marker (BOM), the BOM is skipped in the resulting text.
function text.fromCodepoints(codepoints, i, j)
local result = {}
local len = #codepoints
if len > 0 then
i = i or 1
j = j or -1
if type(i) ~= "number" then
error("bad argument #2 (integer expected, got "..type(i)..")")
end
if type(j) ~= "number" then
error("bad argument #3 (integer expected, got "..type(i)..")")
end
if not isint(i) then
error(string.format("bad argument #2 (number has no integer representation: %s)", i))
end
if not isint(j) then
error(string.format("bad argument #3 (number has no integer representation: %s)", j))
end
if i < 0 then i = len + 1 + i end
if j < 0 then j = len + 1 + j end
i = constrain(i, 1, len+1)
j = constrain(j, 0, len)
if codepoints[i] == BOM then
i = i+1
end
for x = i,j do
local cp = codepoints[x]
if type(cp) ~= "number" then
error("bad argument #1 for 'fromCodepoints (integer expected, got "..type(cp).." for codepoint #"..x..")")
end
result[x-i+1] = cp
end
end
local o = {}
setmetatable(o, text.mt)
setCodes(o, result)
return o
end
--- cp.text.fromFile(path[, encoding]) -> text
--- Constructor
--- Returns a new `text` instance representing the text loaded from the specified path. If no encoding is specified,
--- it will attempt to determine the encoding from a leading Byte-Order Marker (BOM). If none is present, it defaults to UTF-8.
---
--- Parameters:
--- * `value` - The value to turn into a unicode text instance.
--- * `encoding` - One of the falues from `text.encoding`: `utf8`, `utf16le`, or `utf16be`. Defaults to `utf8`.
---
--- Returns:
--- * A new `text` instance.
function text.fromFile(path, encoding)
local file = io.open(path, "r") -- r read mode
if not file then
error(string.format("Unable to open '%s'", path))
end
local content = file:read "*a" -- *a or *all reads the whole file
file:close()
return text.fromString(content, encoding)
end
--- cp.text.char(...) -> text
--- Constructor
--- Returns the list of one or more codepoint items into a text value, concatenating the results.
---
--- Parameters:
--- * `...` - The list of codepoint integers.
---
--- Returns:
--- * The `cp.text` value for the list of codepoint values.
function text.char(...)
return text.fromCodepoints(pack(...))
end
--- cp.text.is(value) -> boolean
--- Function
--- Checks if the provided value is a `text` instance.
---
--- Parameters:
--- * `value` - The value to check
---
--- Returns:
--- * `true` if the value is a `text` instance.
function text.is(value)
return value and getmetatable(value) == text.mt
end
--- cp.text:sub(i [, j]) -> cp.text
--- Method
--- Returns the substring of this text that starts at `i` and continues until `j`; `i` and `j` can be negative.
--- If `j` is absent, then it is assumed to be equal to `-1` (which is the same as the string length).
--- In particular, the call `cp.text:sub(1,j)` returns a prefix of `s` with length `j`, and `cp.text:sub(-i)` (for a positive `i`) returns a suffix of s with length i.
---
--- Parameters:
--- * i - See above
--- * j - See above
---
--- Returns:
--- * None
function text.mt:sub(i, j)
j = j or -1
return text.fromCodepoints(getCodes(self), i, j)
end
--- cp.text:find(pattern [, init [, plain]])
--- Method
--- Looks for the first match of pattern in the string `value`. If it finds a match, then find returns the indices of `value` where this occurrence starts and ends; otherwise, it returns `nil`. A third, optional numerical argument `init` specifies where to start the search; its default value is `1` and can be negative. A value of `true` as a fourth, optional argument plain turns off the pattern matching facilities, so the function does a plain "find substring" operation, with no characters in pattern being considered "magic". Note that if plain is given, then `init` must be given as well.
---
--- If the pattern has captures, then in a successful match the captured values are also returned, after the two indices.
---
--- Parameters:
--- * `pattern` - The pattern to find.
--- * `init` - The index to start matching from. Defaults to `1`.
--- * `plain` - If `true`, the pattern is treated as plain text.
---
--- Returns:
--- * the start index, the end index, followed by any captures
function text.mt:find(pattern, init, plain)
return matcher(pattern):find(self, init, plain)
end
--- cp.text:match(pattern[, start]) -> ...
--- Method
--- Looks for the first match of the `pattern` in the text value. If it finds one, then match returns the captures from the pattern; otherwise it returns `nil`. If pattern specifies no captures, then the whole match is returned. A third, optional numerical argument `init` specifies where to start the search; its default value is `1` and can be negative.
---
--- Parameters:
--- * `pattern` - The text pattern to process.
--- * `start` - If specified, indicates the starting position to process from. Defaults to `1`.
---
--- Returns:
--- * The capture results, the whole match, or `nil`.
function text.mt:match(pattern, start)
return matcher(pattern):match(self, start)
end
--- cp.text.matcher:gmatch(pattern[, start]) -> function
--- Method
--- Returns an iterator function that, each time it is called, returns the next captures from pattern over string s. If pattern specifies no captures, then the whole match is produced in each call.
---
--- Parameters:
--- * `pattern` - The `cp.text` value to process.
---
--- Returns:
--- * The iterator function.
function text.mt:gmatch(pattern, all)
return matcher(pattern):gmatch(self, all)
end
--- cp.text.matcher:gsub(value, repl, limit) -> text, number
--- Method
--- Returns a copy of `value` in which all (or the first `n`, if given) occurrences of the pattern have been replaced by a replacement string specified by `repl`, which can be text, a string, a table, or a function. gsub also returns, as its second value, the total number of matches that occurred.
---
--- Parameters:
--- * `value` - The text or string value to process.
--- * `repl` - The replacement text/string/table/function
--- * `limit` - The maximum number of times to do the replacement. Defaults to unlimited.
---
--- Returns:
--- * `text` - The text value with replacements.
--- * `number` - The number of matches that occurred.
---
--- Notes:
--- * If repl is text or a string, then its value is used for replacement. The character `%` works as an escape character: any sequence in repl of the form `%n`, with `n` between `1` and `9`, stands for the value of the `n`-th captured substring (see below). The sequence `%0` stands for the whole match. The sequence `%%` stands for a single `%`.
--- * If `repl` is a table, then the table is queried for every match, using the first capture as the key; if the pattern specifies no captures, then the whole match is used as the key.
--- * If `repl` is a function, then this function is called every time a match occurs, with all captured substrings passed as arguments, in order; if the pattern specifies no captures, then the whole match is passed as a sole argument.
--- * If the value returned by the table query or by the function call is a string or a number, then it is used as the replacement string; otherwise, if it is `false` or `nil`, then there is no replacement (that is, the original match is kept in the string).
function text.mt:gsub(pattern, repl, limit)
return matcher(pattern):gsub(self, repl, limit)
end
-- provides access to the internal codes array
function text.mt:__index(key)
if type(key) == "number" then
local codes = getCodes(self)
return codes[key]
elseif key ~= codesKey then
return rawget(text.mt, key)
end
return nil
end
-- prevents codes getting updated directly.
function text.mt.__newindex(_, _)
error("read-only text value", 2)
end
function text.mt:__len()
local codes = getCodes(self)
return #codes
end
--- cp.text:len() -> number
--- Method
--- Returns the number of codepoints in the text.
---
--- Parameters:
--- * None
---
--- Returns:
--- * The number of codepoints.
text.mt.len = text.mt.__len
-- concatenates the left and right values into a single text value.
function text.mt.__concat(left, right)
return text.fromString(tostring(left) .. tostring(right), text.encoding.utf8)
end
--- cp.text:encode([encoding]) -> string
--- Method
--- Returns the text as an encoded `string` value.
---
--- Parameters:
--- * `encoding` - The encoding to use when converting. Defaults to `cp.text.encoding.utf8`.
--
-- Returns:
-- * The `string` version of the `cp.text` value with the specified encoding..
function text.mt:encode(encoding)
encoding = encoding or text.encoding.utf8
local encoder = encoders[encoding]
if not encoder then
error(string.format("Unsupported encoding: %s", encoding))
end
return encoder(unpack(self))
end
-- cp.text:__tostring() -> string
-- Method
-- Returns the text as an `string` value encoded as UTF-8.
--
-- Parameters:
-- * None
--
-- Returns:
-- * The `string` version of the `cp.text` value.
function text.mt:__tostring()
return self:encode(text.encoding.utf8)
end
-- cp.text:__eq(other) -> boolean
-- Method
-- Checks if `other` is a `cp.text` instance, and if so, all codepoints are present in the same order.
--
-- Parameters:
-- * `other` - The other value to compare to.
--
-- Returns:
-- * `true` if `other` is a `cp.text` and all codepoints are present in the same order.
function text.mt:__eq(other)
if text.is(other) then
local localCodes, otherCodes = getCodes(self), getCodes(other)
local len = #localCodes
if len == #otherCodes then
for i = 1,len do
if localCodes[i] ~= otherCodes[i] then
return false
end
end
return true
end
end
return false
end
function text.__call(_, ...)
return text.fromString(..., text.encoding.utf8)
end
return setmetatable(text, text)
|
--[[
GD50
Legend of Zelda
Author: Colton Ogden
[email protected]
]]
PlayerIdleState = Class{__includes = EntityIdleState}
function PlayerIdleState:enter(params)
-- render offset for spaced character sprite (negated in render function of state)
self.entity.offsetY = 5
self.entity.offsetX = 0
end
function PlayerIdleState:getPotAhead()
-- keep track of current location
local prevX = self.entity.x
local prevY = self.entity.y
-- move entity in direction
if self.entity.direction == 'left' then
self.entity.x = self.entity.x - 5
elseif self.entity.direction == 'right' then
self.entity.x = self.entity.x + 5
elseif self.entity.direction == 'up' then
self.entity.y = self.entity.y - 5
elseif self.entity.direction == 'down' then
self.entity.y = self.entity.y + 5
end
-- check if colliding with pot
local potAhead = nil
if self.dungeon ~= nil then
for k, object in pairs(self.dungeon.currentRoom.objects) do
if object.type == 'pot' and self.entity:collides(object) then
potAhead = object
end
end
end
-- reset location
self.entity.x = prevX
self.entity.y = prevY
return potAhead
end
function PlayerIdleState:isPotAhead()
return self:getPotAhead() ~= nil
end
function PlayerIdleState:update(dt)
if love.keyboard.isDown('left') or love.keyboard.isDown('right') or
love.keyboard.isDown('up') or love.keyboard.isDown('down') then
self.entity:changeState('walk')
end
if love.keyboard.wasPressed('space') then
self.entity:changeState('swing-sword')
end
if love.keyboard.wasPressed('return') then
print('Enter pressed')
if self:isPotAhead() then
self.entity.pot = self:getPotAhead()
self.entity:changeState('pot-lift')
end
end
end |
module(..., package.seeall)
local ffi = require("ffi")
local C = ffi.C
local lpm4_trie = require("lib.lpm.lpm4_trie").LPM4_trie
local bit = require("bit")
ffi.cdef([[
uint16_t lpm4_248_search(uint32_t ip, int16_t *big, int16_t *little);
uint32_t lpm4_248_search32(uint32_t ip, int32_t *big, int32_t *little);
]])
LPM4_248 = setmetatable({ alloc_storable = { "lpm4_248_bigarry", "lpm4_248_lilarry" } }, { __index = lpm4_trie })
function LPM4_248:search16 (ip)
return C.lpm4_248_search(ip, self.lpm4_248_bigarry, self.lpm4_248_lilarry)
end
function LPM4_248:search32 (ip)
return C.lpm4_248_search32(ip, self.lpm4_248_bigarry, self.lpm4_248_lilarry)
end
function LPM4_248:new (cfg)
-- call the superclass constructor while allowing lpm4_248 to be subclassed
self = lpm4_trie.new(self)
local cfg = cfg or {}
self.keybits = cfg.keybits or 15
local arrytype
if self.keybits == 15 then
arrytype = "uint16_t"
self.search = LPM4_248.search16
elseif self.keybits == 31 then
arrytype = "uint32_t"
self.search = LPM4_248.search32
else
error("LPM4_248 supports 15 or 31 keybits")
end
self:alloc("lpm4_248_bigarry", ffi.typeof(arrytype), 2^24)
self:alloc("lpm4_248_lilarry", ffi.typeof(arrytype), 1024*256)
self.flag = ffi.new(arrytype, 2^self.keybits)
self.mask = self.flag - 1
return self
end
function LPM4_248:build ()
local taboff = 1
local function add(ip, len, key)
local base = bit.rshift(ip, 8)
if len < 25 then
local count = 2^(24-len)
for i = 0, count - 1 do
self.lpm4_248_bigarry[base + i] = key
end
end
if len > 24 then
local e = self.lpm4_248_bigarry[base]
local bottom = bit.band(ip, 0xff)
if bit.band(self.flag, e) ~= self.flag then
if e ~= 0 then
for i = 0,255 do
self.lpm4_248_lilarry[256*taboff + i] = e
end
end
self.lpm4_248_bigarry[base] = taboff + self.flag
taboff = taboff + 1
-- each tab is '8bits' of ip long, so multiply by 256, 512 is double 256
if 256 * taboff == self:lpm4_248_lilarry_length() then
self:lpm4_248_lilarry_grow()
end
end
local tab = self.lpm4_248_lilarry + 256*bit.band(self.lpm4_248_bigarry[base], self.mask)
for i = tonumber(bottom), tonumber(bottom) + 2^(32-len) - 1 do
tab[i] = key
end
end
end
for e in self:entries() do
add(e.ip, e.length, e.key)
end
print("Build 24_8 with " .. taboff-1 .. " tables")
return self
end
function selftest ()
print("LPM4_248 15bit keys")
LPM4_248:selftest()
print("LPM4_248 31bit keys")
LPM4_248:selftest({ keybits = 31 })
end
|
DotaQuizDB = {}
DotaQuizDB.Version = 1
DotaQuizDB.Questions = {}
DotaQuizDB.Questions["english"] = {}
DotaQuizDB.Questions["russian"] = {}
DotaQuizDB.Questions["chinese"] = {}
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "When does the first night start?",
["a"] = {
[1] = "At minute 4:00",
[2] = "At minute 5:00",
[3] = "At minute 6:00",
[4] = "At minute 10:00"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "How many melee and ranged creeps spawn in the first wave, for only one lane?\r\nNot counting the enemy creeps in that lane!",
["a"] = {
[1] = "4 melee creeps, 1 ranged creep",
[2] = "3 melee creeps, 1 ranged creep",
[3] = "4 melee creeps, 2 ranged creep",
[4] = "3 melee creeps, 2 ranged creep"
},
["r"] = 2
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "How many neutral camps are in the Radiant jungle, not counting the Ancients?",
["a"] = {
[1] = "1 small camp, 2 medium camps and 2 large camps",
[2] = "2 small camps, 2 medium camps and 1 large camp",
[3] = "2 small camps, 2 medium camps and 2 large camp",
[4] = "1 small camps, 3 medium camps and 2 large camp"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "Pick one set of the neutral creeps that can't spawn in the medium camp",
["a"] = {
[1] = "Centaur camp",
[2] = "Mud Golems",
[3] = "Hellbear camp",
[4] = "Wolf camp"
},
["r"] = 3
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "At the start of the game, only Bounty runes can spawn.",
["a"] = {
[1] = "True",
[2] = "False"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "Once placed, Observer Ward will last for how long?",
["a"] = {
[1] = "8 minutes",
[2] = "6 minutes",
[3] = "7 minutes",
[4] = "5 minutes"
},
["r"] = 3
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "You can reveal the Wards (Observer and Sentry Wards) with Dust.",
["a"] = {
[1] = "True",
[2] = "False"
},
["r"] = 2
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "When can you upgrade the Courier?",
["a"] = {
[1] = "At minute 2:00",
[2] = "At minute 3:00",
[3] = "At minute 4:00",
[4] = "At the start of the game"
},
["r"] = 2
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "If you deny your lane creep, the enemy Hero in the range gets less experience from it",
["a"] = {
[1] = "True",
[2] = "False"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "What is the correct amount of experience a Hero has to gain to advance from Level 1 to Level 2?",
["a"] = {
[1] = "200",
[2] = "400",
[3] = "600",
[4] = "800"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "Destroying a Tier 1 Tower refreshes the Glyph of Fortification.",
["a"] = {
[1] = "True",
[2] = "False"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "First Roshan spawns with how much HP?",
["a"] = {
[1] = "2500",
[2] = "5000",
[3] = "7500",
[4] = "10000"
},
["r"] = 3
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "Double Damage rune only increases your base damage.",
["a"] = {
[1] = "True",
[2] = "False"
},
["r"] = 1
})
table.insert(DotaQuizDB.Questions["english"], {
["q"] = "Once you activate a Haste rune, your movement speed is set to - ?",
["a"] = {
[1] = "550",
[2] = "522",
[3] = "322",
[4] = "650"
},
["r"] = 2
})
function DotaQuizDB.LoadDB()
return DotaQuizDB.Questions
end
return DotaQuizDB |
--- font-awesome-docx.lua – Sets the font of Font Awesome Icons in DOCX
---
--- Author: Nandakumaar Chandrasekhar
--- Copyright: © 2021–2022 Contributors
--- License: MIT – see LICENSE for details
-- Please create the FontAwesomeRegular, FontAwesomeSolid and
-- FontAwesomeBrands styles in the reference docx before using this filter
-- as stated in the README
-- Makes sure users know if their pandoc version is too old for this
-- filter.
PANDOC_VERSION:must_be_at_least '2.17'
-- This function is called for every span element in the document.
-- If the span element has one of the custom styles of 'fa-regular',
-- 'fa-solid' or 'fa-brands' the style of 'FontAwesomeRegular',
-- 'FontAwesomeSolid' or 'FontAwesomeBrands' defined in the reference doc
-- is added as an attribute to the span.
function Span(span)
if span.classes:includes "fa-regular" then
span.attributes['custom-style'] = "FontAwesomeRegular"
return span
elseif span.classes:includes "fa-solid" then
span.attributes['custom-style'] = "FontAwesomeSolid"
return span
elseif span.classes:includes "fa-brands" then
span.attributes['custom-style'] = "FontAwesomeBrands"
return span
end
return nil
end
|
local function includeFile(filePath)
assert(type(filePath) == "string", "bad argument #1 to 'IncludeLua' (string expected, got " .. type(filePath) .. ")")
local isShared = string.find(filePath, "sh_")
local isClient = string.find(filePath, "cl_")
local isServer = string.find(filePath, "sv_")
if (isShared or isClient) then
AddCSLuaFile(filePath)
end
if (isServer and CLIENT) then return end
if (isClient and SERVER) then return end
print("Including lua file: " .. filePath)
include(filePath)
end
local function includeDir(folder)
assert(type(folder) == "string", "bad argument #1 to 'IncludeFolder' (string expected, got " .. type(folder) .. ")")
if (string.sub(folder, -1) != "/") then
folder = folder .. "/"
end
local pattern = folder .. "*.lua"
local files, directories = file.Find(pattern, "LUA")
for _, name in pairs(files) do
includeFile(folder .. name)
end
end
amapvote = {
NetString = "amapvote",
ShowWinnerString = "amapvote_result",
}
includeDir("amapvote")
includeDir("amapvote/ui") |
------------------------------------------------------------------------------
-- FILE: Pangaea.lua
-- AUTHOR:
-- PURPOSE: Base game script - Simulates a Pan-Earth Supercontinent.
------------------------------------------------------------------------------
-- Copyright (c) 2014 Firaxis Games, Inc. All rights reserved.
------------------------------------------------------------------------------
include "MapEnums"
include "MapUtilities"
include "MountainsCliffs"
include "RiversLakes"
include "FeatureGenerator"
include "TerrainGenerator"
include "NaturalWonderGenerator"
include "ResourceGenerator"
include "AssignStartingPlots"
local g_iW, g_iH;
local g_iFlags = {};
local g_continentsFrac = nil;
local g_iNumTotalLandTiles = 0;
-------------------------------------------------------------------------------
function GenerateMap()
print("Generating Pangea Map");
local pPlot;
-- Set globals
g_iW, g_iH = Map.GetGridSize();
g_iFlags = TerrainBuilder.GetFractalFlags();
local temperature = MapConfiguration.GetValue("temperature"); -- Default setting is Temperate.
if temperature == 4 then
temperature = 1 + TerrainBuilder.GetRandomNumber(3, "Random Temperature- Lua");
end
--bShift = -0.2;
local allcomplete = false;
while allcomplete == false do
plotTypes = GeneratePlotTypes();
--check to make sure map has not failed
local iNumLandTilesInUse = 0;
local iW, iH = Map.GetGridSize();
local iPercent = (iW * iH) * 0.30;
for y = 0, iH - 1 do
for x = 0, iW - 1 do
local i = iW * y + x;
--print("PlotType", plotTypes[i])
if plotTypes[i] ~= g_PLOT_TYPE_OCEAN then
iNumLandTilesInUse = iNumLandTilesInUse + 1;
end
end
end
print("######### Map Failure Check #########");
print("30% Of Map Area: ", iPercent);
print("Map Land Tiles: ", iNumLandTilesInUse);
if iNumLandTilesInUse >= iPercent then
allcomplete = true;
print("######### Map Pass #########");
else
print("######### Map Failure #########");
end
end
terrainTypes = GenerateTerrainTypes(plotTypes, g_iW, g_iH, g_iFlags, true, temperature, bShift);
for i = 0, (g_iW * g_iH) - 1, 1 do
pPlot = Map.GetPlotByIndex(i);
if (plotTypes[i] == g_PLOT_TYPE_HILLS) then
terrainTypes[i] = terrainTypes[i] + 1;
end
TerrainBuilder.SetTerrainType(pPlot, terrainTypes[i]);
end
-- Temp
AreaBuilder.Recalculate();
local biggest_area = Areas.FindBiggestArea(false);
print("After Adding Hills: ", biggest_area:GetPlotCount());
-- River generation is affected by plot types, originating from highlands and preferring to traverse lowlands.
AddRivers();
-- Lakes would interfere with rivers, causing them to stop and not reach the ocean, if placed any sooner.
local numLargeLakes = math.ceil(GameInfo.Maps[Map.GetMapSize()].Continents * 1.5);
AddLakes(numLargeLakes);
AddFeatures();
print("Adding cliffs");
AddCliffs(plotTypes, terrainTypes);
local args = {
numberToPlace = GameInfo.Maps[Map.GetMapSize()].NumNaturalWonders,
};
local nwGen = NaturalWonderGenerator.Create(args);
AreaBuilder.Recalculate();
TerrainBuilder.AnalyzeChokepoints();
TerrainBuilder.StampContinents();
resourcesConfig = MapConfiguration.GetValue("resources");
local args = {
resources = resourcesConfig,
bLandBias = true,
}
local resGen = ResourceGenerator.Create(args);
-- for i = 0, (g_iW * g_iH) - 1, 1 do
-- pPlot = Map.GetPlotByIndex(i);
-- print ("i: plotType, terrainType, featureType: " .. tostring(i) .. ": " .. tostring(plotTypes[i]) .. ", " .. tostring(terrainTypes[i]) .. ", " .. tostring(pPlot:GetFeatureType(i)));
-- end
print("Creating start plot database.");
-- START_MIN_Y and START_MAX_Y is the percent of the map ignored for major civs' starting positions.
local startConfig = MapConfiguration.GetValue("start"); -- Get the start config
local args = {
MIN_MAJOR_CIV_FERTILITY = 400,
MIN_MINOR_CIV_FERTILITY = 50,
MIN_BARBARIAN_FERTILITY = 1,
START_MIN_Y = 20,
START_MAX_Y = 20,
START_CONFIG = startConfig,
LAND = true,
};
local start_plot_database = AssignStartingPlots.Create(args)
local GoodyGen = AddGoodies(g_iW, g_iH);
end
-------------------------------------------------------------------------------
function GeneratePlotTypes()
print("Generating Plot Types");
local plotTypes = {};
local sea_level_low = 48;
local sea_level_normal = 53;
local sea_level_high = 58;
local world_age_old = 2;
local world_age_normal = 3;
local world_age_new = 5;
local grain_amount = 3;
local adjust_plates = 1.3;
local shift_plot_types = true;
local tectonic_islands = true;
local hills_ridge_flags = g_iFlags;
local peaks_ridge_flags = g_iFlags;
local has_center_rift = false;
-- local world_age
local world_age = MapConfiguration.GetValue("world_age");
if (world_age == 1) then
world_age = world_age_new;
elseif (world_age == 2) then
world_age = world_age_normal;
elseif (world_age == 3) then
world_age = world_age_old;
else
world_age = 2 + TerrainBuilder.GetRandomNumber(4, "Random World Age - Lua");
end
-- local sea_level
local sea_level = MapConfiguration.GetValue("sea_level");
local water_percent;
if sea_level == 1 then -- Low Sea Level
water_percent = sea_level_low
elseif sea_level == 2 then -- Normal Sea Level
water_percent = sea_level_normal
elseif sea_level == 3 then -- High Sea Level
water_percent = sea_level_high
else
sea_level = TerrainBuilder.GetRandomNumber(2, "Random Sea Level - Lua") + 1;
print("SEA LEVEL: " .. sea_level);
water_percent = TerrainBuilder.GetRandomNumber(sea_level_high - sea_level_low, "Random Sea Level - Lua") + sea_level_low + 1;
end
-- Generate continental fractal layer and examine the largest landmass. Reject
-- the result until the largest landmass occupies 100% or more of the total land.
local done = false;
local iAttempts = 0;
local iWaterThreshold, biggest_area, iNumBiggestAreaTiles, iBiggestID;
local bMapOK = false;
while bMapOK == false do
while done == false do
local grain_dice = TerrainBuilder.GetRandomNumber(2, "Continental Grain roll - LUA Pangea");
if grain_dice < 4 then
grain_dice = 1;
else
grain_dice = 2;
end
local rift_dice = TerrainBuilder.GetRandomNumber(3, "Rift Grain roll - LUA Pangea");
if rift_dice < 1 then
rift_dice = -1;
end
rift_dice = 2;
grain_dice = 1;
print("Grain: ", grain_dice);
print("Rift: ", rift_dice);
g_continentsFrac = nil;
InitFractal { continent_grain = grain_dice, rift_grain = rift_dice };
iWaterThreshold = g_continentsFrac:GetHeight(water_percent);
g_iNumTotalLandTiles = 0;
for x = 0, g_iW - 1 do
for y = 0, g_iH - 1 do
local i = y * g_iW + x;
local val = g_continentsFrac:GetHeight(x, y);
local pPlot = Map.GetPlotByIndex(i);
if (val <= iWaterThreshold) then
plotTypes[i] = g_PLOT_TYPE_OCEAN;
TerrainBuilder.SetTerrainType(pPlot, g_TERRAIN_TYPE_OCEAN); -- temporary setting so can calculate areas
else
plotTypes[i] = g_PLOT_TYPE_LAND;
TerrainBuilder.SetTerrainType(pPlot, g_TERRAIN_TYPE_DESERT); -- temporary setting so can calculate areas
g_iNumTotalLandTiles = g_iNumTotalLandTiles + 1;
end
end
end
AreaBuilder.Recalculate();
local biggest_area = Areas.FindBiggestArea(false);
iNumBiggestAreaTiles = biggest_area:GetPlotCount();
-- Now test the biggest landmass to see if it is large enough.
if iNumBiggestAreaTiles >= g_iNumTotalLandTiles * 1 then
print("-------------------- Map 100% ------------------------------");
done = true;
iBiggestID = biggest_area:GetID();
end
iAttempts = iAttempts + 1;
-- Printout for debug use only
-- print("-"); print("--- Pangea landmass generation, Attempt#", iAttempts, "---");
-- print("- This attempt successful: ", done);
-- print("- Total Land Plots in world:", g_iNumTotalLandTiles);
-- print("- Land Plots belonging to biggest landmass:", iNumBiggestAreaTiles);
-- print("- Percentage of land belonging to Pangaea: ", 100 * iNumBiggestAreaTiles / g_iNumTotalLandTiles);
-- print("- Continent Grain for this attempt: ", grain_dice);
-- print("- Rift Grain for this attempt: ", rift_dice);
-- print("- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
-- print(".");
end
--add water to top & bottom of map
for y = 0, 5 do
for x = 0, g_iW - 1 do
local i = y * g_iW + x;
local pPlot = Map.GetPlotByIndex(i);
local mWater = TerrainBuilder.GetRandomNumber(100, "Should This Tile Be Water");
if y > 3 then
if mWater > 49 then
plotTypes[i] = g_PLOT_TYPE_OCEAN;
TerrainBuilder.SetTerrainType(pPlot, g_TERRAIN_TYPE_OCEAN);
end
else
plotTypes[i] = g_PLOT_TYPE_OCEAN;
TerrainBuilder.SetTerrainType(pPlot, g_TERRAIN_TYPE_OCEAN);
end
end
end
for y = g_iH - 1, g_iH - 6, -1 do
for x = 0, g_iW - 1 do
local i = y * g_iW + x;
local pPlot = Map.GetPlotByIndex(i);
local mWater = TerrainBuilder.GetRandomNumber(100, "Should This Tile Be Water");
if y < g_iH - 4 then
if mWater > 49 then
plotTypes[i] = g_PLOT_TYPE_OCEAN;
TerrainBuilder.SetTerrainType(pPlot, g_TERRAIN_TYPE_OCEAN);
end
else
plotTypes[i] = g_PLOT_TYPE_OCEAN;
TerrainBuilder.SetTerrainType(pPlot, g_TERRAIN_TYPE_OCEAN);
end
end
end
-- See if we can add some variance in the edges of the landmass
local iW, iH = Map.GetGridSize();
local centerX = iW / 2;
local centerY = iH / 2;
local fracFlags = { FRAC_POLAR = true };
local baysFrac = Fractal.Create(iW, iH, 3, fracFlags, -1, -1);
local iBaysThreshold = baysFrac:GetHeight(98); --lakes lavel size
local axis_list = { 0.87, 0.81, 0.75 };
local axis_multiplier = axis_list[sea_level];
local cohesion_list = { 0.37, 0.1, 0.31 };
local cohesion_multiplier = cohesion_list[sea_level];
majorAxis = centerX * cohesion_multiplier;
minorAxis = centerY * cohesion_multiplier;
majorAxisSquared = majorAxis * majorAxis;
minorAxisSquared = minorAxis * minorAxis;
for y = 0, iH - 1 do
for x = 0, iW - 1 do
local deltaX = x - centerX;
local deltaY = y - centerY;
local deltaXSquared = deltaX * deltaX;
local deltaYSquared = deltaY * deltaY;
local d = deltaXSquared / majorAxisSquared + deltaYSquared / minorAxisSquared;
if d > 1 then
local i = y * iW + x + 1;
local baysVal = baysFrac:GetHeight(x, y);
if baysVal >= iBaysThreshold then
plotTypes[i] = g_PLOT_TYPE_OCEAN;
print("Setting To Ocean");
end
end
end
end
-- Bays end
--BEGING CHECK OF LANDMASS CHOKES
local iW, iH = Map.GetGridSize();
local bfland = false;
local startcol = 0;
local cont = 0;
local bprev = false;
local biggest = 0;
local mainstart = 0;
local mainend = 0;
--local cencol = 0;
--local colshift = 0;
local landincol = 0;
local chkstart = 0;
local chkend = 0;
local chokepoint = 10;
local bXChkFail = false;
local bYChkFail = false;
local bLastLand = false;
local contlandincol = 0;
--local xcen = 0;
--local ycen = 0;
--check y choke points
print("-----------------------------------");
print("Checking Y Chokes");
print("-----------------------------------");
for x = 1, iW do
bfland = false;
landincol = 0;
for y = 2, iH - 2 do
local i = iW * y + x;
--print("Plot Location = ", i);
if plotTypes[i] ~= g_PLOT_TYPE_OCEAN then
landincol = landincol + 1;
bfland = true;
end
end
if bfland == false then
--print("No Land Found in Col: ", x);
bprev = false;
if cont > biggest then
biggest = cont;
mainstart = startcol;
mainend = x - 1;
end
cont = 0;
startcol = 0;
else
--print("Land Found In Col: ", x, "Qty: ", landincol);
if startcol == 0 then
startcol = x;
end
bprev = true;
cont = cont + 1;
end
end
xstart = mainstart;
xend = mainend;
chkstart = mainstart + 5;
chkend = mainend - 5;
for x = chkstart, chkend do
landincol = 0;
contlandincol = 0;
for y = 2, iH - 2 do
local i = iW * y + x;
--print("Plot Location = ", i);
if plotTypes[i] ~= g_PLOT_TYPE_OCEAN then
if bLastLand == true then
landincol = landincol + 1;
bLastLand = true;
else
landincol = 1;
bLastLand = true;
end
else
if contlandincol < landincol then
contlandincol = landincol;
end
bLastLand = false;
landincol = 0;
end
end
--print("Checking Col:", x, "Continuous Land In Col: ", contlandincol);
if contlandincol < chokepoint then
--print("Choke Point in Col: ", x);
bXChkFail = true;
end
end
--check x choke points
print("-----------------------------------");
print("Checking X Chokes");
print("-----------------------------------");
startcol = 0;
cont = 0;
biggest = 0;
for y = 2, iH - 2 do
bfland = false;
landincol = 0;
for x = 1, iW do
local i = iW * y + x;
--print("Plot Location = ", i);
if plotTypes[i] ~= g_PLOT_TYPE_OCEAN then
landincol = landincol + 1;
bfland = true;
end
end
if bfland == false then
--print("No Land Found in Row: ", y);
bprev = false;
if cont > biggest then
biggest = cont;
mainstart = startcol;
mainend = y - 1;
end
cont = 0;
startcol = 0;
else
--print("Land Found In Row: ", y, "Qty: ", landincol);
if startcol == 0 then
startcol = y;
end
bprev = true;
cont = cont + 1;
end
end
ystart = mainstart;
yend = mainend;
chkstart = mainstart + 5;
chkend = mainend - 5;
--print("-----");
--print("Mainland Start Row: ", chkstart);
--print("Mainland End Row: ", chkend);
--print("-----");
for y = chkstart, chkend do
landincol = 0;
contlandincol = 0;
for x = 1, iW do
local i = iW * y + x;
--print("Plot Location = ", i);
if plotTypes[i] ~= g_PLOT_TYPE_OCEAN then
if bLastLand == true then
landincol = landincol + 1;
bLastLand = true;
else
landincol = 1;
bLastLand = true;
end
else
if contlandincol < landincol then
contlandincol = landincol;
end
bLastLand = false;
landincol = 0;
end
end
--print("Checking Col:", y, "Continuous Land In Col: ", contlandincol);
if contlandincol < chokepoint then
--print("Choke Point in Row: ", y);
bYChkFail = true;
end
end
if bXChkFail == true then
print("X Check: False");
else
print("X Check: True");
end
if bYChkFail == true then
print("Y Check: False");
else
print("Y Check: True");
end
if (bXChkFail == true or bYChkFail == true) then
print("##############################################");
print("Map No Good");
print("##############################################");
bMapOK = false;
done = false;
else
print("##############################################");
print("Map Passes");
print("##############################################");
bMapOK = true;
--[[ cencol = xstart + ((xend - xstart) / 2);
colshift = (iW/2)-cencol;
print("Pangaea X Starts At Col: ", xstart, " And Edns At Col: ", xend);
print("Center X of Lanmass is at Col: ", cencol, "Shift Need: ", colshift);
xshiftamt = math.ceil(colshift);
print("Actual Integer Shift Applied: ", xshiftamt);
if xshiftamt > 0 then
xshift = 1;
elseif xshiftamt < 0 then
xshift = 2;
else
xshift = 0;
end
print("##############################################");
cencol = ystart + ((yend - ystart) / 2);
colshift = (iH/2)-cencol;
print("Pangaea Y Starts At Col: ", ystart, " And Edns At Col: ", yend);
print("Center Y of Lanmass is at Col: ", cencol, "Shift Need: ", colshift);
yshiftamt = math.ceil(colshift);
print("Actual Integer Shift Applied: ", yshiftamt);
print("##############################################");
if yshiftamt > 0 then
yshift = 1;
elseif yshiftamt < 0 then
yshift = 2;
else
yshift = 0;
end--]]
end
end
--####################################################
--clear area around pangaea
local iW, iH = Map.GetGridSize();
for x = 0, xstart - 1 do --clear west side of map
for y = 0, iH do
destPlotIndex = iW * y + x;
plotTypes[destPlotIndex] = g_PLOT_TYPE_OCEAN;
end
end
for x = xend + 1, iW do --clear east side of map
for y = 0, iH do
destPlotIndex = iW * y + x;
plotTypes[destPlotIndex] = g_PLOT_TYPE_OCEAN;
end
end
for y = 0, ystart - 1 do --clear south side of map
for x = 0, iW do
destPlotIndex = iW * y + x;
plotTypes[destPlotIndex] = g_PLOT_TYPE_OCEAN;
end
end
for y = yend + 1, iH do --clear north side of map
for x = 0, iW do
destPlotIndex = iW * y + x;
plotTypes[destPlotIndex] = g_PLOT_TYPE_OCEAN;
end
end
--END CHECK OF LANDMASS CHOKES
local args = {};
args.world_age = world_age;
args.iW = g_iW;
args.iH = g_iH
args.iFlags = g_iFlags;
args.blendRidge = 10;
args.blendFract = 1;
args.extra_mountains = 4;
plotTypes = ApplyTectonics(args, plotTypes);
local mRatioVal = MapConfiguration.GetValue("MountDensity");
mRatio = 15;
if (mRatioVal == 1) then
mRatio = 20;
elseif (mRatioVal == 3) then
mRatio = 10;
end
print("Mount Ratio: ", mRatio)
plotTypes = AddLonelyMountains(plotTypes, mRatio);
-- Now shift everything toward one of the poles, to reduce how much jungles tend to dominate this script.
local shift_dice = TerrainBuilder.GetRandomNumber(2, "Shift direction - LUA Pangaea");
local iStartRow, iNumRowsToShift;
local bFoundPangaea, bDoShift = false, false;
if shift_dice == 1 then
-- Shift North
for y = g_iH - 2, 1, -1 do
for x = 0, g_iW - 1 do
local i = y * g_iW + x;
if plotTypes[i] == g_PLOT_TYPE_HILLS or plotTypes[i] == g_PLOT_TYPE_LAND then
local plot = Map.GetPlot(x, y);
local iAreaID = plot:GetArea();
if iAreaID == iBiggestID then
bFoundPangaea = true;
iStartRow = y + 1;
if iStartRow < iNumPlotsY - 4 then -- Enough rows of water space to do a shift.
bDoShift = true;
end
break
end
end
end
-- Check to see if we've found the Pangaea.
if bFoundPangaea == true then
break
end
end
else
-- Shift South
for y = 1, g_iH - 2 do
for x = 0, g_iW - 1 do
local i = y * g_iW + x;
if plotTypes[i] == g_PLOT_TYPE_HILLS or plotTypes[i] == g_PLOT_TYPE_LAND then
local plot = Map.GetPlot(x, y);
local iAreaID = plot:GetArea();
if iAreaID == iBiggestID then
bFoundPangaea = true;
iStartRow = y - 1;
if iStartRow > 3 then -- Enough rows of water space to do a shift.
bDoShift = true;
end
break
end
end
end
-- Check to see if we've found the Pangaea.
if bFoundPangaea == true then
break
end
end
end
if bDoShift == true then
if shift_dice == 1 then -- Shift North
local iRowsDifference = g_iH - iStartRow - 2;
local iRowsInPlay = math.floor(iRowsDifference * 0.7);
local iRowsBase = math.ceil(iRowsDifference * 0.3);
local rows_dice = TerrainBuilder.GetRandomNumber(iRowsInPlay, "Number of Rows to Shift - LUA Pangaea");
local iNumRows = math.min(iRowsDifference - 1, iRowsBase + rows_dice);
local iNumEvenRows = 2 * math.floor(iNumRows / 2); -- MUST be an even number or we risk breaking a 1-tile isthmus and splitting the Pangaea.
local iNumRowsToShift = math.max(2, iNumEvenRows);
--print("-"); print("Shifting lands northward by this many plots: ", iNumRowsToShift); print("-");
-- Process from top down.
for y = (g_iH - 1) - iNumRowsToShift, 0, -1 do
for x = 0, g_iW - 1 do
local sourcePlotIndex = y * g_iW + x + 1;
local destPlotIndex = (y + iNumRowsToShift) * g_iW + x + 1;
plotTypes[destPlotIndex] = plotTypes[sourcePlotIndex]
end
end
for y = 0, iNumRowsToShift - 1 do
for x = 0, g_iW - 1 do
local i = y * g_iW + x + 1;
plotTypes[i] = g_PLOT_TYPE_OCEAN;
end
end
else -- Shift South
local iRowsDifference = iStartRow - 1;
local iRowsInPlay = math.floor(iRowsDifference * 0.7);
local iRowsBase = math.ceil(iRowsDifference * 0.3);
local rows_dice = TerrainBuilder.GetRandomNumber(iRowsInPlay, "Number of Rows to Shift - LUA Pangaea");
local iNumRows = math.min(iRowsDifference - 1, iRowsBase + rows_dice);
local iNumEvenRows = 2 * math.floor(iNumRows / 2); -- MUST be an even number or we risk breaking a 1-tile isthmus and splitting the Pangaea.
local iNumRowsToShift = math.max(2, iNumEvenRows);
--print("-"); print("Shifting lands southward by this many plots: ", iNumRowsToShift); print("-");
-- Process from bottom up.
for y = 0, (g_iH - 1) - iNumRowsToShift do
for x = 0, g_iW - 1 do
local sourcePlotIndex = (y + iNumRowsToShift) * g_iW + x + 1;
local destPlotIndex = y * g_iW + x + 1;
plotTypes[destPlotIndex] = plotTypes[sourcePlotIndex]
end
end
for y = g_iH - iNumRowsToShift, g_iH - 1 do
for x = 0, g_iW - 1 do
local i = y * g_iW + x + 1;
plotTypes[i] = g_PLOT_TYPE_OCEAN;
end
end
end
end
return plotTypes;
end
function InitFractal(args)
if (args == nil) then args = {}; end
local continent_grain = args.continent_grain or 2;
local rift_grain = args.rift_grain or -1; -- Default no rifts. Set grain to between 1 and 3 to add rifts. - Bob
local invert_heights = args.invert_heights or false;
local polar = args.polar or true;
local ridge_flags = args.ridge_flags or g_iFlags;
local fracFlags = {};
if (invert_heights) then
fracFlags.FRAC_INVERT_HEIGHTS = true;
end
if (polar) then
fracFlags.FRAC_POLAR = true;
end
if (rift_grain > 0 and rift_grain < 4) then
local riftsFrac = Fractal.Create(g_iW, g_iH, rift_grain, {}, 6, 5);
g_continentsFrac = Fractal.CreateRifts(g_iW, g_iH, continent_grain, fracFlags, riftsFrac, 6, 5);
else
g_continentsFrac = Fractal.Create(g_iW, g_iH, continent_grain, fracFlags, 6, 5);
end
-- Use Brian's tectonics method to weave ridgelines in to the continental fractal.
-- Without fractal variation, the tectonics come out too regular.
--
--[[ "The principle of the RidgeBuilder code is a modified Voronoi diagram. I
added some minor randomness and the slope might be a little tricky. It was
intended as a 'whole world' modifier to the fractal class. You can modify
the number of plates, but that is about it." ]] -- Brian Wade - May 23, 2009
--
local MapSizeTypes = {};
for row in GameInfo.Maps() do
MapSizeTypes[row.MapSizeType] = row.PlateValue;
end
local sizekey = Map.GetMapSize();
local numPlates = MapSizeTypes[sizekey] or 4
-- Blend a bit of ridge into the fractal.
-- This will do things like roughen the coastlines and build inland seas. - Brian
g_continentsFrac:BuildRidges(numPlates, {}, 1, 2);
end
function AddFeatures()
print("Adding Features");
-- Get Rainfall setting input by user.
local rainfall = MapConfiguration.GetValue("rainfall");
if rainfall == 4 then
rainfall = 1 + TerrainBuilder.GetRandomNumber(3, "Random Rainfall - Lua");
end
local args = { rainfall = rainfall }
local featuregen = FeatureGenerator.Create(args);
featuregen:AddFeatures();
end
|
if minetest.get_modpath("lucky_block") then
lucky_block:add_blocks({
{"spw", "mobs:dungeon_master", 1, nil, nil, 3, "Billy"},
{"spw", "mobs:sand_monster", 3},
{"spw", "mobs:stone_monster", 3, nil, nil, 3, "Bob"},
{"spw", "mobs:dirt_monster", 3},
{"spw", "mobs:tree_monster", 3},
{"spw", "mobs:oerkki", 3},
{"exp"},
{"spw", "mobs:spider", 5},
{"spw", "mobs:mese_monster", 2},
{"spw", "mobs:lava_flan", 3},
{"nod", "default:chest", 0, {
{name = "mobs:lava_orb", max = 1}}},
})
end
|
local GearBase = require("Gears.GearBase")
local GearDisplay = class('GearDisplay', GearBase)
function GearDisplay:ctor(owner)
GearDisplay.super.ctor(self, owner)
self._displayLockToken = 1
self._visible = 0
end
function GearDisplay:init()
self.pages = nil
end
function GearDisplay:apply()
self._displayLockToken = self._displayLockToken+1
if self._displayLockToken == 0 then
self._displayLockToken = 1;
end
if self.pages == nil or #self.pages == 0 then
self._visible = 1;
else
local cnt = #self.pages
for i=1,cnt do
if self.pages[i]==self.controller.selectedPageId then
self._visible = 1
return
end
end
self._visible = 0;
end
end
function GearDisplay:addLock()
self._visible = self._visible+1
return self._displayLockToken;
end
function GearDisplay:releaseLock(token)
if token == self._displayLockToken then
self._visible = self._visible-1
end
end
function GearDisplay:isConnected()
return self.controller == nil or self._visible > 0
end
return GearDisplay |
include "dependencies.lua"
workspace "ByteCat"
architecture "x86_64"
startproject "Sandbox"
configurations
{
"Debug",
"Release",
"Dist"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
-- Dependencies
include "ByteCat/vendor/GLFW"
include "ByteCat/vendor/imgui"
include "ByteCat/vendor/Glad"
include "ByteCat/vendor/lua"
-- ByteCat projects
include "ByteCat"
include "Sandbox"
|
data:extend(
{
{
type = "ambient-sound",
name = "after-the-crash",
track_type = "early-game",
sound =
{
filename = "__base__/sound/ambient/after-the-crash.ogg"
}
},
{
type = "ambient-sound",
name = "automation",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/automation.ogg"
}
},
{
type = "ambient-sound",
name = "resource-deficiency",
track_type = "early-game",
sound =
{
filename = "__base__/sound/ambient/resource-deficiency.ogg"
}
},
{
type = "ambient-sound",
name = "are-we-alone",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/are-we-alone.ogg"
}
},
{
type = "ambient-sound",
name = "beyond-factory-outskirts",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/beyond-factory-outskirts.ogg"
}
},
{
type = "ambient-sound",
name = "censeqs-discrepancy",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/censeqs-discrepancy.ogg"
}
},
{
type = "ambient-sound",
name = "efficiency-program",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/efficiency-program.ogg"
}
},
{
type = "ambient-sound",
name = "expansion",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/expansion.ogg"
}
},
{
type = "ambient-sound",
name = "the-search-for-iron",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/the-search-for-iron.ogg"
}
},
{
type = "ambient-sound",
name = "gathering-horizon",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/gathering-horizon.ogg"
}
},
{
type = "ambient-sound",
name = "research-and-minerals",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/research-and-minerals.ogg"
}
},
{
type = "ambient-sound",
name = "solar-intervention",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/solar-intervention.ogg"
}
},
{
type = "ambient-sound",
name = "the-oil-industry",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/the-oil-industry.ogg"
}
},
{
type = "ambient-sound",
name = "the-right-tools",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/the-right-tools.ogg"
}
},
{
type = "ambient-sound",
name = "pollution",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/pollution.ogg"
}
},
{
type = "ambient-sound",
name = "turbine-dynamics",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/turbine-dynamics.ogg"
}
},
{
type = "ambient-sound",
name = "sentient",
track_type = "main-track",
sound =
{
filename = "__base__/sound/ambient/sentient.ogg"
}
},
{
type = "ambient-sound",
name = "anomaly",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/anomaly.ogg"
}
},
{
type = "ambient-sound",
name = "first-light",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/first-light.ogg"
}
},
{
type = "ambient-sound",
name = "transmit",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/transmit.ogg"
}
},
{
type = "ambient-sound",
name = "swell-pad",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/swell-pad.ogg"
}
},
--world-ambience-1 and 2 taken out because they have the wind mixed in which fades in and out...
{
type = "ambient-sound",
name = "world-ambience-3",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/world-ambience-3.ogg",
volume = 1.0
}
},
{
type = "ambient-sound",
name = "world-ambience-4",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/world-ambience-4.ogg",
volume = 1.0
}
},
{
type = "ambient-sound",
name = "world-ambience-5",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/world-ambience-5.ogg",
volume = 1.0
}
},
{
type = "ambient-sound",
name = "world-ambience-6",
track_type = "interlude",
sound =
{
filename = "__base__/sound/ambient/world-ambience-6.ogg",
volume = 1.0
}
},
{
type = "wind-sound",
name = "wind-1",
sound =
{
filename = "__base__/sound/wind/wind.ogg",
volume = 0.8
}
}
})
|
-- Client Kenji Types
type servicesType = {
RegisterService: (servicesType, string, any) -> (),
GetServiceAsync: (servicesType, string, string?) -> any
}
type networkingType = {
FireClient: (networkingType, Player, string, string, ...any) -> (),
FireAllClients: (networkingType, string, string, ...any) -> (),
Export: (networkingType, string, (Player, ...any) -> (boolean, ...any)) -> ()
}
export type ScriptingAPI = {
Services: servicesType,
Networking: networkingType,
}
export type Container = {
Name: string,
Context: string
}
return nil |
-- Set - provides services for sets of elements.
--
-- author: Dr. Thomas Tensi, 2019-08
-- ====================
-- IMPORTS
-- ====================
require("List")
-- ====================
-- --------------------
-- CLASS DECLARATION
-- --------------------
Set = Class:make("Set")
-- ==========
-- module Set
-- ==========
-- This module provides services for sets of elements.
-- --------------------
-- EXPORTED FEATURES
-- --------------------
function Set.make (cls)
-- Constructs an empty set
local result = cls:makeInstance()
result._data = {}
result._count = 0
return result
end
-- --------------------
function Set:clone ()
-- Returns shallow clone of set
local result = Set:make()
local elementList = self:elementList()
for i = 1, elementList:count() do
result:include(elementList:at(i))
end
return result
end
-- --------------------
function Set:contains (element)
-- Tells whether <element> is in set
-- return iif(self._data[element], true, false)
return self._data[element]
end
-- --------------------
function Set:count ()
-- Returns number of elements in set
return self._count
end
-- --------------------
function Set:elementList ()
-- Returns all elements of set as a list
local result = List:make()
for element, _ in pairs(self._data) do
result:append(element)
end
return result
end
-- --------------------
function Set:exclude (element)
-- Removes <element> from set (if available)
if self:contains(element) then
self._data[element] = nil
self._count = self._count - 1
end
end
-- --------------------
function Set:include (element)
-- Adds <element> to set
if not self:contains(element) then
self._data[element] = true
self._count = self._count + 1
end
end
-- --------------------
function Set:get ()
-- Returns some element from set; fails for empty set
local result = nil
if not self:isEmpty() then
_, result = pairs(self._data)[1]
end
return result
end
-- --------------------
function Set:isEmpty ()
-- Tells whether set is empty
return self:count() == 0
end
-- --------------------
function Set:__tostring ()
-- Returns string representation of set
local st = "Set("
local elementList = self:elementList()
for i = 1, elementList:count() do
st = (st .. iif(i == 1, "", ", ")
.. tostring(elementList:at(i)))
end
st = st .. ")"
return st
end
-- ==========
-- end Set
-- ==========
|
require "scripts.core.ability"
require "scripts.core.projectile"
require "gamemode.Spark.modifiers.modifier_hooked";
require "gamemode.Spark.modifiers.modifier_hooking";
-- hook ability
PhantomGrip = class(Ability)
local Z_OFFSET = 3
function PhantomGrip:OnCreated ()
self:RegisterVariable("max_range", self:GetSpecialValue("range"))
self:RegisterVariable("cast_time", 0.0)
self:RegisterVariable("cast_point", 0.25)
self:SetCastingBehavior(CastingBehavior(CastingBehavior.POINT_TARGET));
self.OnTick = self.OnTick
end
function PhantomGrip:OnSpellStart ()
AudioRequestBus.Broadcast.PlaySound("Play_sfx_hook_throw");
self.finished = false
local target = self:GetCursorPosition()
local caster = self:GetCaster()
local origin = self:GetCaster():GetPosition()
self.isReturning = false
local direction = (target - origin)
direction.z = 0
origin.z = origin.z + Z_OFFSET
direction = direction:GetNormalized()
local destination = origin + (direction * self:GetSpecialValue("range"))
self.projectile = Projectile({
startingPosition = origin,
targetPosition = destination,
speed = self:GetSpecialValue("speed"),
particle = "hookwars.fire_ball",
triggerRadius = 3
});
self.hookingModifier = caster:AddNewModifier(caster, self, "modifier_hooking", {})
self.unlisten = self.projectile:OnEntityEnter(function (entityId)
if entityId == self:GetCaster():GetId() then
return
end
self.attachedUnit = Unit({ entityId = entityId})
AudioRequestBus.Broadcast.PlaySound("Play_sfx_hook_hit")
if UnitRequestBus.Event.GetTeamId(entityId) ~= UnitRequestBus.Event.GetTeamId(caster:GetId()) then
local damage = Damage();
damage.type = Damage.DAMAGE_TYPE_PHYSICAL;
damage.damage = self:GetSpecialValue("damage");
self.attachedUnit:ApplyDamage(damage)
end
if self.attachedUnit:FindModifierByTypeId("modifier_hooked") then
self.attachedUnit:Kill()
self.attachedUnit = nil
elseif not self.attachedUnit:IsAlive() then
self.attachedUnit = nil
else
self.hookedModifier = self.attachedUnit:AddNewModifier(caster, self, "modifier_hooked", {})
end
if not self.tickHandler then
self.tickHandler = TickBus.Connect(self)
end
self:Return()
end)
self.projectile:OnProjectileHit(function ()
-- hit the end position without hitting any heroes
self:Return()
end)
self.projectile:Fire()
end
function PhantomGrip:OnTick ()
if self.finished or not self.attachedUnit or not self.attachedUnit:IsAlive() then
self.tickHandler:Disconnect()
self.tickHandler = nil
self.attachedUnit = nil
self.hookedModifier = nil
return
end
local origin = self.projectile:GetPosition()
origin.z = origin.z - Z_OFFSET
self.attachedUnit:SetPosition(origin)
end
function PhantomGrip:Return ()
self.unlisten()
if self.hookingModifier then
self.hookingModifier:Destroy()
self.hookingModifier = nil
end
local origin = self:GetCaster():GetPosition()
local currentLocation = self.projectile:GetPosition()
local direction = currentLocation - origin
direction.z = 0
direction = direction:GetNormalized()
origin = origin + direction
origin.z = origin.z + Z_OFFSET
if not self.isReturning then
self.isReturning = true
self.projectile:Fire({
targetPosition = origin,
})
else
self.finished = true
self.projectile:Release()
self.projectile = nil
self.attachedUnit = nil
if self.hookedModifier then
self.hookedModifier:Destroy()
self.hookedModifier = nil
end
if self.tickHandler then
self.tickHandler:Disconnect()
self.tickHandler = nil
end
end
end
return PhantomGrip
|
--[[ Copyright (c) 2017 Optera ]]
local get_energy_value = require('__flib__.data-util').get_energy_value
local expand_charging_spots=
{
["roboport"] = true,
["roboport_nosignal"] = true,
["bob-roboport-2"] = true,
["bob-roboport-3"] = true,
["bob-roboport-4"] = true,
}
for _, roboport in pairs(data.raw["roboport"]) do
if expand_charging_spots[roboport.name] then
-- add 8 charging positions
roboport.charging_offsets =
{
{-1.2, -0.8}, {-1.8, -0.2},
{1.8, -0.2}, {1.2, -0.8},
{1.8, 1.2}, {1.2, 1.8},
{-1.2, 1.8}, {-1.8, 1.2},
}
-- increase energy flow to accommodate 8 bots at 1MW each
local value, unit = get_energy_value(roboport.energy_source.input_flow_limit)
if value then
roboport.energy_source.input_flow_limit = (value * 2)..unit
end
end
end |
--[[
Copyright (c) 2012 Matthias Richter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Except as contained in this notice, the name(s) of the above copyright holders
shall not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
]]--
local BASE = (...):match("(.-)[^%.]+$")
local core = require(BASE .. 'core')
local group = require(BASE .. 'group')
local mouse = require(BASE .. 'mouse')
local keyboard = require(BASE .. 'keyboard')
-- {checked = status, text = "", algin = "left", pos = {x, y}, size={w, h}, widgetHit=widgetHit, draw=draw}
return function(w)
assert(type(w) == "table")
w.text = w.text or ""
local tight = w.size and (w.size[1] == 'tight' or w.size[2] == 'tight')
if tight then
local f = assert(love.graphics.getFont())
if w.size[1] == 'tight' then
w.size[1] = f:getWidth(w.text)
end
if w.size[2] == 'tight' then
w.size[2] = f:getHeight(w.text)
end
-- account for the checkbox
local bw = math.min(w.size[1] or group.size[1], w.size[2] or group.size[2])
w.size[1] = w.size[1] + bw + 4
end
local id = w.id or core.generateID()
local pos, size = group.getRect(w.pos, w.size)
mouse.updateWidget(id, pos, size, w.widgetHit)
keyboard.makeCyclable(id)
local checked = w.checked
local key = keyboard.key
if mouse.releasedOn(id) or ((key == 'return' or key == ' ') and keyboard.hasFocus(id)) then
w.checked = not w.checked
end
core.registerDraw(id, w.draw or core.style.Checkbox,
w.checked, w.text, w.align or 'left', pos[1], pos[2], size[1], size[2])
return w.checked ~= checked
end
|
-- Natural Selection 2 Competitive Mod
-- Source located at - https://github.com/xToken/CompMod
-- lua\CompMod\Structures\Alien\Shade\server.lua
-- - Dragon
local originalShadeOnUpdate
originalShadeOnUpdate = Class_ReplaceMethod("Shade", "OnUpdate",
function(self, deltaTime)
originalShadeOnUpdate(self, deltaTime)
if not self:GetIsAlive() then
local destructionAllowedTable = { allowed = true }
if self.GetDestructionAllowed then
self:GetDestructionAllowed(destructionAllowedTable)
end
if destructionAllowedTable.allowed then
DestroyEntity(self)
end
end
if self.moving ~= self.lastmoving then
-- This isnt good coding, but these is all over the place in vanilla
if self.moving then
-- We are moving, trigger recede
self:SetDesiredInfestationRadius(0)
else
-- We are not moving, trigger clear, then infest start.
self:CleanupInfestation()
end
self.lastmoving = self.moving
end
end
)
function Shade:OnTeleport()
self:SetDesiredInfestationRadius(0)
end
function Shade:OnTeleportFailed()
self:SetDesiredInfestationRadius(self:GetInfestationMaxRadius())
end
local originalShadeOnTeleportEnd
originalShadeOnTeleportEnd = Class_ReplaceMethod("Shade", "OnTeleportEnd",
function(self, destinationEntity)
originalShadeOnTeleportEnd(self, destinationEntity)
self:CleanupInfestation()
end
)
function Shade:UpdateCloaking()
for _, cloakable in ipairs( GetEntitiesWithMixinForTeamWithinRange("Cloakable", self:GetTeamNumber(), self:GetOrigin(), Shade.kCloakRadius) ) do
cloakable:TriggerCloak()
end
return self:GetIsAlive()
end
function Shade:GetDestroyOnKill()
return false
end
function Shade:OnKill(attacker, doer, point, direction)
self:SetModel(nil)
local team = self:GetTeam()
if team then
team:OnTeamEntityDestroyed(self)
end
end
function Shade:GetPassiveBuild()
return self:GetGameEffectMask(kGameEffect.OnInfestation)
end |
local utils = require "kong.tools.utils"
local dns_client
--- Load and setup the DNS client according to the provided configuration.
-- @param conf (table) Kong configuration
-- @return the initialized `resty.dns.client` module, or an error
local setup_client = function(conf)
if not dns_client then
dns_client = require "resty.dns.client"
end
conf = conf or {}
local servers = {}
-- servers must be reformatted as name/port sub-arrays
if conf.dns_resolver then
for i, server in ipairs(conf.dns_resolver) do
local s = utils.normalize_ip(server)
servers[i] = { s.host, s.port or 53 } -- inserting port if omitted
end
end
local opts = {
hosts = conf.dns_hostsfile,
resolvConf = nil, -- defaults to system resolv.conf
nameservers = servers, -- provided list or taken from resolv.conf
enable_ipv6 = true, -- allow for ipv6 nameserver addresses
retrans = nil, -- taken from system resolv.conf; attempts
timeout = nil, -- taken from system resolv.conf; timeout
validTtl = conf.dns_valid_ttl, -- ttl in seconds overriding ttl of valid records
badTtl = conf.dns_error_ttl, -- ttl in seconds for dns error responses (except 3 - name error)
emptyTtl = conf.dns_not_found_ttl, -- ttl in seconds for empty and "(3) name error" dns responses
staleTtl = conf.dns_stale_ttl, -- ttl in seconds for records once they become stale
order = conf.dns_order, -- order of trying record types
noSynchronisation = conf.dns_no_sync,
}
assert(dns_client.init(opts))
return dns_client
end
return setup_client
|
--[[
TheNexusAvenger
Implementation of a command.
--]]
local BaseCommand = require(script.Parent.Parent:WaitForChild("BaseCommand"))
local CommonState = require(script.Parent.Parent:WaitForChild("CommonState"))
local Command = BaseCommand:Extend()
--[[
Creates the command.
--]]
function Command:__new()
self:InitializeSuper("jail","UsefulFunCommands","Creates a jail around a set of players. Each player can only have one jail.")
self.Arguments = {
{
Type = "nexusAdminPlayers",
Name = "Players",
Description = "Players to jail.",
},
}
end
--[[
Runs the command.
--]]
function Command:Run(CommandContext,Players)
self.super:Run(CommandContext)
--Create the jails.
for _,Player in pairs(Players) do
local Character = Player.Character
if not CommonState.PlayerJails[Player] and Character then
local HumanoidRootPart = Character:FindFirstChild("HumanoidRootPart")
if HumanoidRootPart then
--Create the jail.
local Center = HumanoidRootPart.CFrame
local Jail = Instance.new("Model")
Jail.Name = "Jail_"..Player.Name
Jail.Parent = self.API.AdminItemContainer
local Bottom = Instance.new("Part")
Bottom.FormFactor = "Custom"
Bottom.Size = Vector3.new(5.2,1,5.2)
Bottom.Anchored = true
Bottom.TopSurface = "Smooth"
Bottom.TopSurface = "Smooth"
Bottom.Material = "SmoothPlastic"
Bottom.BrickColor = BrickColor.new("Black")
Bottom.CFrame = Center * CFrame.new(0,-3.4,0)
Bottom.Parent = Jail
local Top = Instance.new("Part")
Top.FormFactor = "Custom"
Top.Size = Vector3.new(5.2,1,5.2)
Top.Anchored = true
Top.TopSurface = "Smooth"
Top.TopSurface = "Smooth"
Top.Material = "SmoothPlastic"
Top.BrickColor = BrickColor.new("Black")
Top.CFrame = Center * CFrame.new(0,3.6,0)
Top.Parent = Jail
local Front = Instance.new("Part")
Front.FormFactor = "Custom"
Front.Size = Vector3.new(5.2,6,0.6)
Front.Anchored = true
Front.TopSurface = "Smooth"
Front.TopSurface = "Smooth"
Front.Material = "SmoothPlastic"
Front.BrickColor = BrickColor.new("White")
Front.CFrame = Center * CFrame.new(0,0.1,2.3)
Front.Transparency = 1
Front.Parent = Jail
local Back = Instance.new("Part")
Back.FormFactor = "Custom"
Back.Size = Vector3.new(5.2,6,0.6)
Back.Anchored = true
Back.TopSurface = "Smooth"
Back.TopSurface = "Smooth"
Back.Material = "SmoothPlastic"
Back.BrickColor = BrickColor.new("White")
Back.CFrame = Center * CFrame.new(0,0.1,-2.3)
Back.Transparency = 1
Back.Parent = Jail
local Left = Instance.new("Part")
Left.FormFactor = "Custom"
Left.Size = Vector3.new(0.6,6,4)
Left.Anchored = true
Left.TopSurface = "Smooth"
Left.TopSurface = "Smooth"
Left.Material = "SmoothPlastic"
Left.BrickColor = BrickColor.new("White")
Left.CFrame = Center * CFrame.new(2.3,0.1,0)
Left.Transparency = 1
Left.Parent = Jail
local Right = Instance.new("Part")
Right.FormFactor = "Custom"
Right.Size = Vector3.new(0.6,6,4)
Right.Anchored = true
Right.TopSurface = "Smooth"
Right.TopSurface = "Smooth"
Right.Material = "SmoothPlastic"
Right.BrickColor = BrickColor.new("White")
Right.CFrame = Center * CFrame.new(-2.3,0.1,0)
Right.Transparency = 1
Right.Parent = Jail
local OuterGlass = Instance.new("Part")
OuterGlass.FormFactor = "Custom"
OuterGlass.Size = Vector3.new(2,2,2)
OuterGlass.Anchored = true
OuterGlass.CanCollide = false
OuterGlass.TopSurface = "Smooth"
OuterGlass.TopSurface = "Smooth"
OuterGlass.Material = "SmoothPlastic"
OuterGlass.BrickColor = BrickColor.new("White")
OuterGlass.CFrame = Center * CFrame.new(0,0.1,0)
OuterGlass.Transparency = 0.5
OuterGlass.Parent = Jail
local Mesh = Instance.new("SpecialMesh")
Mesh.MeshType = "FileMesh"
Mesh.MeshId = "http://www.roblox.com/Asset/?id=9856898"
Mesh.Scale = Vector3.new(10.4,12,10.4)
Mesh.Parent = OuterGlass
local InnerGlass = Instance.new("Part")
InnerGlass.FormFactor = "Custom"
InnerGlass.Size = Vector3.new(2,2,2)
InnerGlass.Anchored = true
InnerGlass.CanCollide = false
InnerGlass.TopSurface = "Smooth"
InnerGlass.TopSurface = "Smooth"
InnerGlass.Material = "SmoothPlastic"
InnerGlass.BrickColor = BrickColor.new("White")
InnerGlass.CFrame = Center * CFrame.new(0,0.1,0)
InnerGlass.Transparency = 0.5
InnerGlass.Parent = Jail
local Mesh = Instance.new("SpecialMesh")
Mesh.MeshType = "FileMesh"
Mesh.MeshId = "http://www.roblox.com/Asset/?id=9856898"
Mesh.Scale = Vector3.new(-8,-13,1-8)
Mesh.Parent = InnerGlass
--Connect the event.
local CharacterAddedEvent = Player.CharacterAdded:Connect(function(Character)
if Jail.Parent then
local Root = Character:WaitForChild("HumanoidRootPart")
wait()
Root.CFrame = Center
end
end)
--Add the psuedo-object.
local JailObject = {}
JailObject.Jail = Jail
JailObject.CharacterAddedEvent = CharacterAddedEvent
function JailObject:Destroy()
self.Jail:Destroy()
self.CharacterAddedEvent:Disconnect()
CommonState.PlayerJails[Player] = nil
end
CommonState.PlayerJails[Player] = JailObject
end
end
end
end
return Command |
spawnpoint 'a_m_y_hipster_01' {x = -267.03408813477,y = -958.31439208984, z = 31.22313117981}
spawnpoint 'a_m_y_hipster_02' {x = -267.03408813477,y = -958.31439208984, z = 31.22313117981}
spawnpoint 'a_m_y_skater_01' {x = -267.03408813477,y = -958.31439208984, z = 31.22313117981}
spawnpoint 'a_m_y_skater_02' {x = -267.03408813477,y = -958.31439208984, z = 31.22313117981} |
--[[
Story Progress
This module helps track the progress of the player through the story.
It provides an API that we can use throughout the game to poll the
player’s progress and to mark achievements. It also lets us keep
running tabs on various statistics, such as if we need to track how
many times the player has died or how often they have used certain
items and abilities. In this regard the module is a cornerstone for
future implementations of anything like an achievements system.
It is *not* necessary to use this module to track progress through
individual scenes. If we need to know whether or not a player has
been through the scene named “Intro” then we can write:
if LNVL.VisitedScenes["Intro"] == true then ... end
Likewise, if we want to see the history of scene progress then we can
write a loop like this:
for _,scene in ipairs(LNVL.SceneHistory) do ... end
That would give us access to each LNVL.Scene object in the order in
which the player encountered them.
--]]
-- Create the Progress class.
local Progress = {}
Progress.__index = Progress
-- Our constructor, which takes no arguments.
function Progress:new()
-- This table contains all of the progress information. The keys
-- are strings; we always convert these to lower-case before any
-- lookup so that code outside this module does not have to worry
-- about bugs caused by simple case discrepancies.
--
-- The values may be a variety of value types.
--
-- We use booleans for story flags which are a binary on-or-off,
-- e.g. has the player do some arbitrary action? This is a
-- yes-or-no progress question for which we use a boolean.
--
-- The value may be a string. In that case we **do not** convert
-- it to lower-case because the case may matter to other parts of
-- the game.
--
-- The value may be a number. If it is a floating-point number
-- then we assume it represents a percentage. E.g. a value of
-- 0.37 represent thirty-seven percent.
--
-- Finally, the value may be a table. This can be useful to
-- provide a link to other objects in code that better represent
-- data relevant for this piece of progress. The table has weak
-- values since we use tables; if the sole reference to a table is
-- in the Progress module then we can garbage-collect it.
self.dataFor = setmetatable({}, { __mode = "v" })
end
-- The methods below can accept a string or table of strings for a
-- name. This utility takes those parameters and normalizes them into
-- a single string, which it returns.
--
-- Example:
-- normalizeName({"Lobby", "Jones"}) => "lobby/jones"
--
-- It is an error to give the function anything else.
local function normalizeName(name)
if type(name) == "table" then
return string.lower(table.concat(name, "/"))
else
return string.lower(name)
end
end
-- This method takes a name describing the progress and sets it to the
-- given value. The name should be as descriptive as possible. The
-- 'name' parameter may be a single string. Or it may be a table of
-- strings where each element represents a 'group' containing the
-- strings that following. This makes it easier to group progress
-- values for such things as missions, e.g.
--
-- setDataFor({"Mission One", "Met the Witch"}, true)
-- setDataFor({"Mission One", "Completion"}, 100.0)
--
-- See the documentation on the constructor for details about what the
-- values can mean based on their data type.
--
-- This method returns nothing.
function Progress:setDataFor(name, value)
self.dataFor[normalizeName(name)] = value
end
-- This method returns the data for a given name. If there is no data
-- associated with that name then it returns nil so that code can rely
-- on this in order to set default values elsewhere, e.g.
--
-- beatFoo = Progress:getDataFor("Defeated Boss Foo") or false
--
-- This method may return anything acceptable as a value for the
-- 'dataFor' property of the Progress class.
function Progress:getDataFor(name)
return self.dataFor[normalizeName(name)]
end
return Progress
|
local Test = require('tests.factorio_luaunit')
local math = require('__flib__.math')
math.randomseed(os.clock())
--- @diagnostic disable: undefined-field
function Test_radians()
for i = 1, 90 do Test.assertAlmostEquals(i * math.radians, math.rad(i), .1) end
end
function Test_degrees()
for i = 1, 90 do Test.assertAlmostEquals(i * math.degrees, math.deg(i), .1) end
end
function Test_round()
Test.assertEquals(math.round(3.51), 4)
Test.assertEquals(math.round(3.51, .1), 3.5)
end
function Test_ceiled()
Test.assertEquals(math.ceiled(3.7), 4)
Test.assertEquals(math.ceiled(3.7), math.ceil(3.7))
Test.assertEquals(math.ceiled(-3.7), -3)
Test.assertEquals(math.ceiled(-3.7), math.ceil(-3.7))
Test.assertAlmostEquals(math.ceiled(-3.75, .1), -3.8, .1)
end
function Test_floored()
Test.assertEquals(math.floored(3.7), 3)
Test.assertEquals(math.floored(3.7), math.floor(3.7))
Test.assertEquals(math.floored(-3.7), -4)
Test.assertEquals(math.floored(-3.7), math.floor(-3.7))
Test.assertAlmostEquals(math.floored(-3.75, .1), -3.8, .1)
end
function Test_clamp()
Test.assertEquals(math.clamp(0, 1, 2), 1)
Test.assertEquals(math.clamp(0, 0, 2), 0)
Test.assertEquals(math.clamp(0, 0, 0), 0)
Test.assertEquals(math.clamp(0, -10, 10), 0)
Test.assertEquals(math.clamp(-100, -10, 10), -10)
Test.assertEquals(math.clamp(100, -10, 10), 10)
Test.assertEquals(math.clamp(-2), 0)
Test.assertEquals(math.clamp(.5), .5)
Test.assertEquals(math.clamp(3), 1)
--- Max is smaller than min
Test.assertEquals(math.clamp(0, 1, 0), 1)
Test.assertEquals(math.clamp(2, 1, 0), 0)
Test.assertEquals(math.clamp(1, 1, 0), 0)
end
local values1 = { 25, 25, 25, 25 }
local values2 = { 10, 25, 40, 45, 50 }
local values3 = { 10, 25, 40, -50, -45 }
local values4 = {-23, -12, -50, -10, -33}
function Test_maximum()
Test.assertEquals(math.maximum(values1), 25)
Test.assertEquals(math.maximum(values2), 50)
Test.assertEquals(math.maximum(values3), 40)
Test.assertEquals(math.maximum(values4), -10)
for _ = 1, 5 do
local rando = {}
while #rando < 11 do rando[#rando + 1] = math.random(-50, 50) end
Test.assertEquals(math.maximum(rando), math.max(table.unpack(rando)))
end
end
function Test_minimum()
Test.assertEquals(math.minimum(values1), 25)
Test.assertEquals(math.minimum(values2), 10)
Test.assertEquals(math.minimum(values3), -50)
Test.assertEquals(math.minimum(values4), -50)
for _ = 1, 5 do
local rando = {}
while #rando < 11 do rando[#rando + 1] = math.random(-50, 50) end
Test.assertEquals(math.minimum(rando), math.min(table.unpack(rando)))
end
end
function Test_sum()
Test.assertEquals(math.sum(values1), 100)
Test.assertEquals(math.sum(values2), 185)
Test.assertEquals(math.sum(values3), -5)
Test.assertEquals(math.sum(values4), -117)
end
function Test_mean()
Test.assertEquals(math.mean(values1), 25)
Test.assertEquals(math.mean(values2), 37)
Test.assertEquals(math.mean(values3), -1)
Test.assertEquals(math.mean(values4), -23.4)
end
function Test_midrange()
Test.assertEquals(math.midrange(values1), 25)
Test.assertEquals(math.midrange(values2), 30)
Test.assertEquals(math.midrange(values3), -5)
Test.assertEquals(math.midrange(values4), -30)
end
function Test_range()
Test.assertEquals(math.range(values1), 0)
Test.assertEquals(math.range(values2), 40)
Test.assertEquals(math.range(values3), 90)
Test.assertEquals(math.range(values4), 40)
end
function Test_sign()
Test.assertEquals(math.sign(0), 1)
Test.assertEquals(math.sign(1), 1)
Test.assertEquals(math.sign(-1), -1)
end
function Test_lerp()
Test.assertEquals(math.lerp(1, 2, .5), 1.5)
Test.assertEquals(math.lerp(0, 10, .25), 2.5)
end
Test.Run()
|
--oo/controls/listview: standard listview control
--Written by Cosmin Apreutesei. Public Domain.
setfenv(1, require'winapi')
require'winapi.controlclass'
require'winapi.listview'
require'winapi.itemlist'
require'winapi.headercontrol'
LVColumnList = class(ItemList)
function LVColumnList:add(i, col)
if not col then i,col = self.count+1,i end
if type(col) == 'string' then col = {text = col} end
return ListView_InsertColumn(self.hwnd, i, col)
end
function LVColumnList:get(i)
return ListView_GetColumn(self.hwnd, i)
end
function LVColumnList:set(i, col)
ListView_SetColumn(self.hwnd, i, col)
end
function LVColumnList:remove(i)
ListView_DeleteColumn(self.hwnd, i)
end
function LVColumnList:get_count()
local header = ListView_GetHeader(self.hwnd)
return Header_GetItemCount(header)
end
function LVColumnList:get_width(i)
return ListView_GetColumnWidth(self.hwnd, i)
end
local col_widths = {
autosize = LVSCW_AUTOSIZE,
autosize_header = LVSCW_AUTOSIZE_USEHEADER,
}
function LVColumnList:set_width(i,w)
return ListView_SetColumnWidth(self.hwnd, i, col_widths[w] or w)
end
function LVColumnList:move(i, toi)
local ai = ListView_GetColumnOrderArray(self.hwnd)
ListView_SetColumnOrderArray(self.hwnd, t)
end
function LVColumnList:set_selected(i)
return ListView_SetSelectedColumn(self.hwnd, i)
end
function LVColumnList:get_selected()
return ListView_GetSelectedColumn(self.hwnd)
end
LVItemList = class(ItemList)
function LVItemList:add(i, item)
if not item then i,item = self.count+1,i end
if type(item) == 'string' then item = {text = item} end
local subitems = item.subitems
item = LVITEM(item)
item.i = i
item.subitem = 0
ListView_InsertItem(self.hwnd, item)
if subitems then
for si, item in ipairs(subitems) do
self:set_subitem(i, si, item)
end
end
end
function LVItemList:remove(i)
ListView_DeleteItem(self.hwnd, i)
end
function LVItemList:set_subitem(i, subitem, item)
if type(item) == 'string' then item = {text = item} end
item = LVITEM(item)
item.i = i
item.subitem = subitem
ListView_SetItem(self.hwnd, item)
end
function LVItemList:get_subitem(i, subitem)
local item = LVITEM:setmask()
item.i = i
item.subitem = subitem
ListView_GetItem(self.hwnd, item)
return LVITEM:collect(item)
end
function LVItemList:set(i, item)
self:set_subitem(i, 0, item)
end
function LVItemList:get(i)
return self:get_subitem(i, 0)
end
function LVItemList:get_count()
return ListView_GetItemCount(self.hwnd)
end
function LVItemList:clear()
ListView_DeleteAllItems(self.hwnd)
end
local LVIRs = {
bounds = LVIR_BOUNDS, --default
icon = LVIR_ICON,
label = LVIR_LABEL,
select_bounds = LVIR_SELECTBOUNDS,
}
function LVItemList:get_rect(i, j, what)
local LVIR = LVIRs[what or LVIR_BOUNDS]
if not j or j == 0 then
return ListView_GetItemRect(self.hwnd, i, LVIR)
else
return ListView_GetSubItemRect(self.hwnd, i, j, LVIR)
end
end
--BIG TODO: separate styles for icon view, report view etc.
ListView = {
__style_bitmask = bitmask{
mode = {
icon = LVS_ICON,
small_icon = LVS_SMALLICON,
list = LVS_LIST,
},
single_selection = LVS_SINGLESEL, --TODO: make it the negation: multiple_selection
always_show_selection = LVS_SHOWSELALWAYS,
sort = {
none = 0,
ascending = LVS_SORTASCENDING,
descending = LVS_SORTDESCENDING,
},
nowrap = LVS_NOLABELWRAP, --TODO: make it the negation: wrap
auto_arrange = LVS_AUTOARRANGE,
editable = LVS_EDITLABELS,
noscroll = LVS_NOSCROLL, --TODO: make it the negation: show_scroll; not for LVS_LIST or LVS_REPORT
align = {
top = LVS_ALIGNTOP,
left = LVS_ALIGNLEFT,
},
noheader = LVS_NOCOLUMNHEADER, --TODO: make it the negation: show_header
nosort = LVS_NOSORTHEADER, --TODO: make it the negation: header_sort
},
__style_ex_bitmask = bitmask{
client_edge = WS_EX_CLIENTEDGE,
--lv specific
checkboxes = LVS_EX_CHECKBOXES,
track_select = LVS_EX_TRACKSELECT,
activation = {
one_click = LVS_EX_ONECLICKACTIVATE,
two_click = LVS_EX_TWOCLICKACTIVATE,
},
flat_scroll_bars = LVS_EX_FLATSB,
tooltips = LVS_EX_INFOTIP,
auto_activation_underline = {
hot = LVS_EX_UNDERLINEHOT,
cold = LVS_EX_UNDERLINECOLD,
},
multiple_work_areas = LVS_EX_MULTIWORKAREAS,
label_tooltips = LVS_EX_LABELTIP,
border_select = LVS_EX_BORDERSELECT,
hide_labels = LVS_EX_HIDELABELS,
snap_to_grid = LVS_EX_SNAPTOGRID,
simple_select = LVS_EX_SIMPLESELECT,
},
__defaults = {
client_edge = true,
text = '',
w = 200, h = 100,
},
__init_properties = {'hoover_time'},
__wm_notify_handler_names = {
on_item_changing = LVN_ITEMCHANGING,
on_item_change = LVN_ITEMCHANGED,
on_insert_item = LVN_INSERTITEM,
on_delete_item = LVN_DELETEITEM,
on_delete_all_items = LVN_DELETEALLITEMS,
on_begin_labeled_item = LVN_BEGINLABELEDITW,
on_end_labeled_item = LVN_ENDLABELEDITW,
on_column_click = LVN_COLUMNCLICK,
on_begin_drag = LVN_BEGINDRAG,
on_begin_rdrag = LVN_BEGINRDRAG,
on_odcachehint = LVN_ODCACHEHINT,
on_find_item = LVN_ODFINDITEMW,
on_item_activate = LVN_ITEMACTIVATE,
--on_state_change = LVN_ODSTATECHANGED,
on_hot_track = LVN_HOTTRACK,
on_get_dispinfo = LVN_GETDISPINFOW,
on_set_dispinfo = LVN_SETDISPINFOW,
on_key_down = LVN_KEYDOWN,
on_marquee_begin = LVN_MARQUEEBEGIN,
on_get_info_tip = LVN_GETINFOTIPW,
on_incremental_search = LVN_INCREMENTALSEARCHW,
on_column_dropdown = LVN_COLUMNDROPDOWN,
on_column_overflow_click = LVN_COLUMNOVERFLOWCLICK,
on_begin_scroll = LVN_BEGINSCROLL,
on_end_scroll = LVN_ENDSCROLL,
on_link_click = LVN_LINKCLICK,
on_get_empty_markup = LVN_GETEMPTYMARKUP,
},
}
function ListView:__set_style_ex_bit(k,v)
local mask = self.__style_ex_bitmask:compute_mask(k)
local v = self.__style_ex_bitmask:setbit(0,k,v)
ListView_SetExtendedListViewStyle(self.hwnd, mask, v)
SetWindowPos(self.hwnd, nil, 0, 0, 0, 0, SWP_FRAMECHANGED_ONLY)
end
subclass(ListView, Control)
function ListView:__before_create(info, args)
ListView.__index.__before_create(self, info, args)
args.class = WC_LISTVIEW
args.style = bit.bor(args.style, LVS_SHAREIMAGELISTS)
args.style_ex = bit.bor(args.style_ex, LVS_EX_DOUBLEBUFFER) --less flicker
end
function ListView:__after_create(info, args)
ListView.__index.__after_create(self, info, args)
ListView_SetExtendedListViewStyle(self.hwnd, self.__style_ex_bitmask:compute_mask(), args.style_ex)
end
function ListView:__init(info)
ListView.__index.__init(self, info)
self.columns = LVColumnList(self)
self.items = LVItemList(self)
self.columns:add_items(info.columns)
self.items:add_items(info.items)
end
function ListView:set_hoover_time(time)
ListView_SetHooverTime(self.hwmd, time)
end
function ListView:LVN_ITEMCHANGING(i, subitem, newstate, oldstate)
if getbit(newstate, LVIS_SELECTED) ~= getbit(oldstate, LVIS_SELECTED) then
if self.on_selection_changing then
self:on_selection_changing(i, subitem, getbit(newstate, LVIS_SELECTED))
end
end
end
function ListView:LVN_ITEMCHANGED(i, subitem, newstate, oldstate)
if getbit(newstate, LVIS_SELECTED) ~= getbit(oldstate, LVIS_SELECTED) then
if self.on_selection_change then
self:on_selection_change(i, subitem, getbit(newstate, LVIS_SELECTED))
end
end
end
ReportListView = subclass({
__style_ex_bitmask = bitmask{
grid_lines = LVS_EX_GRIDLINES,
subitem_images = LVS_EX_SUBITEMIMAGES,
column_reordering = LVS_EX_HEADERDRAGDROP,
full_row_select = LVS_EX_FULLROWSELECT,
},
}, ListView)
function ReportListView:__before_create(info, args)
ReportListView.__index.__before_create(self, info, args)
args.style = bit.bor(args.style, LVS_REPORT)
end
--showcase
if not ... then
require'winapi.showcase'
local window = ShowcaseWindow{w=300, h=200}
local lv = ReportListView{parent = window, x = 10, y = 10, w = 200, h = 100}
lv.columns:add'name'
lv.columns:add'address'
lv.items:add'you won\'t see me'
lv.items:clear()
lv.items:add'Louis Armstrong'
lv.items:add'Django Reinhardt'
lv.items:set_subitem(lv.items.count,1,'Beyond The Sea')
lv.items:set_subitem(1,1,'Basin Street')
--lv.items:add(3, {text = LPSTR_TEXTCALLBACKW})
--lv.items:add(4, {text = LPSTR_TEXTCALLBACKW})
--function lv:get_item_data(item) item.text = 'n/a'end
lv.items:remove(3)
MessageLoop()
end
|