content stringlengths 5 1.05M |
|---|
dofile(minetest.get_modpath("my_future_doors").."/framed.lua")
dofile(minetest.get_modpath("my_future_doors").."/sliding.lua")
|
--------------------------------------------------------------------------------
-- Handler.......... : onWorkshopDownloadComplete
-- Author........... :
-- Description...... : Called when a workshop download has completed or failed
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function Steam.onWorkshopDownloadComplete ( bSuccess )
--------------------------------------------------------------------------------
--
-- If the download queue is not empty then download the next item in line
--
log.message ( "Download completed: ", bSuccess )
this.bDownloading ( false )
if table.getSize ( this.tDownloadQueue ( ) ) > 0 then
local sID = table.getFirst ( this.tDownloadQueue ( ) )
table.removeFirst ( this.tDownloadQueue ( ) )
this.downloadWorkshopItem ( sID )
end
--------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------
|
insert_warps = {
cast = function(player, question)
local path = "../mornamaps/warps2.txt"
-- local path = "/root/Morna/mornamaps/warps.txt"
-- local path = "/root/Morna/mornamaps/end_warps.txt"
local file = io.open(path, "a+")
local m = player.m
local x = player.x
local y = player.y
local txt
if string.match(string.lower(player.question), "f") ~= nil or tonumber(player.question) == 1 then
file:write(m .. ", " .. x .. ", " .. y .. "\n")
file:flush()
player:sendAnimationXY(228, x, y, 30)
player:playSound(6)
player:msg(
0,
"From -> " .. player.mapTitle .. "(" .. player.m .. "), X: " .. player.x .. ", Y: " .. player.y .. " >> " .. path,
player.ID
)
elseif string.match(string.lower(player.question), "t") ~= nil or tonumber(player.question) == 2 then
file:write(", " .. m .. ", " .. x .. ", " .. y .. "\n")
file:flush()
player:sendAnimationXY(235, x, y, 30)
player:playSound(6)
player:msg(
0,
"To -> " .. player.mapTitle .. "(" .. player.m .. "), X: " .. player.x .. ", Y: " .. player.y .. " >> " .. path,
player.ID
)
elseif string.match(string.lower(player.question), "n") ~= nil or tonumber(player.question) == 3 then
file:write("/n")
file:flush()
player:msg(0, "/n >> " .. path, player.ID)
elseif string.match(string.lower(player.question, ":(.+)")) ~= nil then
txt = string.match(string.lower(player.question, ":(.+)"))
file:write(txt)
file:flush()
player:msg(0, ": " .. txt .. " >> " .. path, player.ID)
else
anim(player)
player:msg(0, "============== Command ==============", player.ID)
player:msg(0, "'f' or '1' : insert 'From' coordinate", player.ID)
player:msg(0, "'t' or '2' : insert 'To' coordinate", player.ID)
player:msg(0, "'n' or '3' : insert a 'New line'", player.ID)
player:msg(0, "': text' : insert a text", player.ID)
end
end,
confirm = async(function(player, fm, fx, fy, tm, tx, ty)
local path = "../mornamaps/warps2.txt"
local file = io.open(path, "a+")
local name = "<b>[Warps Tool]\n\n"
local opts = {"Confirm", "Cancel"}
player.dialogType = 0
--player:sendAnimationXY(228, tx, ty, 1)
menu = player:menuSeq(
name .. "" .. fm .. ", " .. fx .. ", " .. fy .. ", " .. tm .. ", " .. tx .. ", " .. ty .. "\n\nInsert this warps to file?",
opts,
{}
)
if menu == 1 then
file:write(fm .. ", " .. fx .. ", " .. fy .. ", " .. tm .. ", " .. tx .. ", " .. ty .. "\n")
file:flush()
player:sendAnimationXY(237, fx, fy, 1)
player:playSound(6)
player:msg(
0,
"Added to warps file -> (" .. fm .. ", " .. fx .. ", " .. fy .. ", " .. tm .. ", " .. tx .. ", " .. ty .. ")",
player.ID
)
end
end),
startline = async(function(player)
local path = "../mornamaps/warps2.txt"
local file = io.open(path, "a+")
local name = "<b>[Warps Tool]\n\n"
local opts = {"Start New Warp Entry", "Exit"}
player.dialogType = 0
--player:sendAnimationXY(228, tx, ty, 1)
menu = player:menuSeq(
name .. "" .. player.mapTitle .. "\n\nInsert this map title to the warps file?",
opts,
{}
)
if menu == 1 then
file:write("// // " .. player.mapTitle .. "\n")
file:flush()
player:playSound(6)
player:msg(
0,
"Added to warps file -> // // " .. player.mapTitle,
player.ID
)
end
end),
endline = async(function(player)
local path = "../mornamaps/warps2.txt"
local file = io.open(path, "a+")
local name = "<b>[Warps Tool]\n\n"
local opts = {"Start New Warp Entry", "Exit"}
player.dialogType = 0
--player:sendAnimationXY(228, tx, ty, 1)
menu = player:menuSeq(
name .. "" .. player.mapTitle .. "\n\nInsert a blank line to the warps file?",
opts,
{}
)
if menu == 1 then
file:write("\n")
file:flush()
player:playSound(6)
player:msg(0, "Added to warps file -> new line", player.ID)
end
end)
}
|
local PANEL = {}
AccessorFunc( PANEL, "m_bDirty", "Dirty", FORCE_BOOL )
AccessorFunc( PANEL, "m_bSortable", "Sortable", FORCE_BOOL )
AccessorFunc( PANEL, "m_iHeaderHeight", "HeaderHeight" )
AccessorFunc( PANEL, "m_iDataHeight", "DataHeight" )
AccessorFunc( PANEL, "m_bMultiSelect", "MultiSelect" )
AccessorFunc( PANEL, "m_bHideHeaders", "HideHeaders" )
Derma_Hook( PANEL, "Paint", "Paint", "ListView" )
function PANEL:Init()
self:SetSortable( true )
self:SetMouseInputEnabled( true )
self:SetMultiSelect( true )
self:SetHideHeaders( false )
self:SetPaintBackground( true )
self:SetHeaderHeight( 16 )
self:SetDataHeight( 17 )
self.Columns = {}
self.Lines = {}
self.Sorted = {}
self:SetDirty( true )
self.pnlCanvas = vgui.Create( "Panel", self )
self.VBar = vgui.Create( "DVScrollBar", self )
self.VBar:SetZPos( 20 )
end
function PANEL:DisableScrollbar()
if ( IsValid( self.VBar ) ) then
self.VBar:Remove()
end
self.VBar = nil
end
function PANEL:GetLines()
return self.Lines
end
function PANEL:GetInnerTall()
return self:GetCanvas():GetTall()
end
function PANEL:GetCanvas()
return self.pnlCanvas
end
function PANEL:AddColumn( strName, iPosition )
local pColumn = nil
if ( self.m_bSortable ) then
pColumn = vgui.Create( "DListView_Column", self )
else
pColumn = vgui.Create( "DListView_ColumnPlain", self )
end
pColumn:SetName( strName )
pColumn:SetZPos( 10 )
if ( iPosition ) then
table.insert( self.Columns, iPosition, pColumn )
for i = 1, #self.Columns do
self.Columns[ i ]:SetColumnID( i )
end
else
local ID = table.insert( self.Columns, pColumn )
pColumn:SetColumnID( ID )
end
self:InvalidateLayout()
return pColumn
end
function PANEL:RemoveLine( LineID )
local Line = self:GetLine( LineID )
local SelectedID = self:GetSortedID( LineID )
self.Lines[ LineID ] = nil
table.remove( self.Sorted, SelectedID )
self:SetDirty( true )
self:InvalidateLayout()
Line:Remove()
end
function PANEL:ColumnWidth( i )
local ctrl = self.Columns[ i ]
if ( !ctrl ) then return 0 end
return ctrl:GetWide()
end
function PANEL:FixColumnsLayout()
local NumColumns = #self.Columns
if ( NumColumns == 0 ) then return end
local AllWidth = 0
for k, Column in pairs( self.Columns ) do
AllWidth = AllWidth + Column:GetWide()
end
local ChangeRequired = self.pnlCanvas:GetWide() - AllWidth
local ChangePerColumn = math.floor( ChangeRequired / NumColumns )
local Remainder = ChangeRequired - ( ChangePerColumn * NumColumns )
for k, Column in pairs( self.Columns ) do
local TargetWidth = Column:GetWide() + ChangePerColumn
Remainder = Remainder + ( TargetWidth - Column:SetWidth( TargetWidth ) )
end
-- If there's a remainder, try to palm it off on the other panels, equally
while ( Remainder != 0 ) do
local PerPanel = math.floor( Remainder / NumColumns )
for k, Column in pairs( self.Columns ) do
Remainder = math.Approach( Remainder, 0, PerPanel )
local TargetWidth = Column:GetWide() + PerPanel
Remainder = Remainder + ( TargetWidth - Column:SetWidth( TargetWidth ) )
if ( Remainder == 0 ) then break end
end
Remainder = math.Approach( Remainder, 0, 1 )
end
-- Set the positions of the resized columns
local x = 0
for k, Column in pairs( self.Columns ) do
Column.x = x
x = x + Column:GetWide()
Column:SetTall( self:GetHeaderHeight() )
Column:SetVisible( !self:GetHideHeaders() )
end
end
function PANEL:PerformLayout()
-- Do Scrollbar
local Wide = self:GetWide()
local YPos = 0
if ( IsValid( self.VBar ) ) then
self.VBar:SetPos( self:GetWide() - 16, 0 )
self.VBar:SetSize( 16, self:GetTall() )
self.VBar:SetUp( self.VBar:GetTall() - self:GetHeaderHeight(), self.pnlCanvas:GetTall() )
YPos = self.VBar:GetOffset()
if ( self.VBar.Enabled ) then Wide = Wide - 16 end
end
if ( self.m_bHideHeaders ) then
self.pnlCanvas:SetPos( 0, YPos )
else
self.pnlCanvas:SetPos( 0, YPos + self:GetHeaderHeight() )
end
self.pnlCanvas:SetSize( Wide, self.pnlCanvas:GetTall() )
self:FixColumnsLayout()
--
-- If the data is dirty, re-layout
--
if ( self:GetDirty( true ) ) then
self:SetDirty( false )
local y = self:DataLayout()
self.pnlCanvas:SetTall( y )
-- Layout again, since stuff has changed..
self:InvalidateLayout( true )
end
end
function PANEL:OnScrollbarAppear()
self:SetDirty( true )
self:InvalidateLayout()
end
function PANEL:OnRequestResize( SizingColumn, iSize )
-- Find the column to the right of this one
local Passed = false
local RightColumn = nil
for k, Column in ipairs( self.Columns ) do
if ( Passed ) then
RightColumn = Column
break
end
if ( SizingColumn == Column ) then Passed = true end
end
-- Alter the size of the column on the right too, slightly
if ( RightColumn ) then
local SizeChange = SizingColumn:GetWide() - iSize
RightColumn:SetWide( RightColumn:GetWide() + SizeChange )
end
SizingColumn:SetWide( iSize )
self:SetDirty( true )
-- Invalidating will munge all the columns about and make it right
self:InvalidateLayout()
end
function PANEL:DataLayout()
local y = 0
local h = self.m_iDataHeight
for k, Line in ipairs( self.Sorted ) do
Line:SetPos( 1, y )
Line:SetSize( self:GetWide() - 2, h )
Line:DataLayout( self )
Line:SetAltLine( k % 2 == 1 )
y = y + Line:GetTall()
end
return y
end
function PANEL:AddLine( ... )
self:SetDirty( true )
self:InvalidateLayout()
local Line = vgui.Create( "DListView_Line", self.pnlCanvas )
local ID = table.insert( self.Lines, Line )
Line:SetListView( self )
Line:SetID( ID )
-- This assures that there will be an entry for every column
for k, v in pairs( self.Columns ) do
Line:SetColumnText( k, "" )
end
for k, v in pairs( {...} ) do
Line:SetColumnText( k, v )
end
-- Make appear at the bottom of the sorted list
local SortID = table.insert( self.Sorted, Line )
if ( SortID % 2 == 1 ) then
Line:SetAltLine( true )
end
return Line
end
function PANEL:OnMouseWheeled( dlta )
if ( !IsValid( self.VBar ) ) then return end
return self.VBar:OnMouseWheeled( dlta )
end
function PANEL:ClearSelection( dlta )
for k, Line in pairs( self.Lines ) do
Line:SetSelected( false )
end
end
function PANEL:GetSelectedLine()
for k, Line in pairs( self.Lines ) do
if ( Line:IsSelected() ) then return k end
end
end
function PANEL:GetLine( id )
return self.Lines[ id ]
end
function PANEL:GetSortedID( line )
for k, v in pairs( self.Sorted ) do
if ( v:GetID() == line ) then return k end
end
end
function PANEL:OnClickLine( Line, bClear )
local bMultiSelect = self:GetMultiSelect()
if ( !bMultiSelect && !bClear ) then return end
--
-- Control, multi select
--
if ( bMultiSelect && input.IsKeyDown( KEY_LCONTROL ) ) then
bClear = false
end
--
-- Shift block select
--
if ( bMultiSelect && input.IsKeyDown( KEY_LSHIFT ) ) then
local Selected = self:GetSortedID( self:GetSelectedLine() )
if ( Selected ) then
local LineID = self:GetSortedID( Line:GetID() )
local First = math.min( Selected, LineID )
local Last = math.max( Selected, LineID )
-- Fire off OnRowSelected for each non selected row
for id = First, Last do
local line = self.Sorted[ id ]
if ( !line:IsLineSelected() ) then self:OnRowSelected( line:GetID(), line ) end
line:SetSelected( true )
end
-- Clear the selection and select only the required rows
if ( bClear ) then self:ClearSelection() end
for id = First, Last do
local line = self.Sorted[ id ]
line:SetSelected( true )
end
return
end
end
--
-- Check for double click
--
if ( Line:IsSelected() && Line.m_fClickTime && ( !bMultiSelect || bClear ) ) then
local fTimeDistance = SysTime() - Line.m_fClickTime
if ( fTimeDistance < 0.3 ) then
self:DoDoubleClick( Line:GetID(), Line )
return
end
end
--
-- If it's a new mouse click, or this isn't
-- multiselect we clear the selection
--
if ( !bMultiSelect || bClear ) then
self:ClearSelection()
end
if ( Line:IsSelected() ) then return end
Line:SetSelected( true )
Line.m_fClickTime = SysTime()
self:OnRowSelected( Line:GetID(), Line )
end
function PANEL:SortByColumns( c1, d1, c2, d2, c3, d3, c4, d4 )
table.Copy( self.Sorted, self.Lines )
table.sort( self.Sorted, function( a, b )
if ( !IsValid( a ) ) then return true end
if ( !IsValid( b ) ) then return false end
if ( c1 && a:GetColumnText( c1 ) != b:GetColumnText( c1 ) ) then
if ( d1 ) then a, b = b, a end
return a:GetColumnText( c1 ) < b:GetColumnText( c1 )
end
if ( c2 && a:GetColumnText( c2 ) != b:GetColumnText( c2 ) ) then
if ( d2 ) then a, b = b, a end
return a:GetColumnText( c2 ) < b:GetColumnText( c2 )
end
if ( c3 && a:GetColumnText( c3 ) != b:GetColumnText( c3 ) ) then
if ( d3 ) then a, b = b, a end
return a:GetColumnText( c3 ) < b:GetColumnText( c3 )
end
if ( c4 && a:GetColumnText( c4 ) != b:GetColumnText( c4 ) ) then
if ( d4 ) then a, b = b, a end
return a:GetColumnText( c4 ) < b:GetColumnText( c4 )
end
return true
end )
self:SetDirty( true )
self:InvalidateLayout()
end
function PANEL:SortByColumn( ColumnID, Desc )
table.Copy( self.Sorted, self.Lines )
table.sort( self.Sorted, function( a, b )
if ( Desc ) then
a, b = b, a
end
local aval = a:GetSortValue( ColumnID ) || a:GetColumnText( ColumnID )
local bval = b:GetSortValue( ColumnID ) || b:GetColumnText( ColumnID )
return aval < bval
end )
self:SetDirty( true )
self:InvalidateLayout()
end
function PANEL:SelectItem( Item )
if ( !Item ) then return end
Item:SetSelected( true )
self:OnRowSelected( Item:GetID(), Item )
end
function PANEL:SelectFirstItem()
self:ClearSelection()
self:SelectItem( self.Sorted[ 1 ] )
end
function PANEL:DoDoubleClick( LineID, Line )
-- For Override
end
function PANEL:OnRowSelected( LineID, Line )
-- For Override
end
function PANEL:OnRowRightClick( LineID, Line )
-- For Override
end
function PANEL:Clear()
for k, v in pairs( self.Lines ) do
v:Remove()
end
self.Lines = {}
self.Sorted = {}
self:SetDirty( true )
end
function PANEL:GetSelected()
local ret = {}
for k, v in pairs( self.Lines ) do
if ( v:IsLineSelected() ) then
table.insert( ret, v )
end
end
return ret
end
function PANEL:SizeToContents()
self:SetHeight( self.pnlCanvas:GetTall() + self:GetHeaderHeight() )
end
function PANEL:GenerateExample( ClassName, PropertySheet, Width, Height )
local ctrl = vgui.Create( ClassName )
local Col1 = ctrl:AddColumn( "Address" )
local Col2 = ctrl:AddColumn( "Port" )
Col2:SetMinWidth( 30 )
Col2:SetMaxWidth( 30 )
for i = 1, 128 do
ctrl:AddLine( "192.168.0." .. i, "80" )
end
ctrl:SetSize( 300, 200 )
PropertySheet:AddSheet( ClassName, ctrl, nil, true, true )
end
derma.DefineControl( "DListView", "Data View", PANEL, "DPanel" )
|
--[[--
CREATECHAR STATE
----
Create the player character.
--]]--
local st = RunState.new()
local mt = {__tostring = function() return 'RunState.createchar' end}
setmetatable(st, mt)
local InputCommandEvent = getClass 'wyx.event.InputCommandEvent'
local CreateCharUI = getClass 'wyx.ui.CreateCharUI'
function st:init() end
function st:enter(prevState)
self._prevState = self._prevState or prevState
InputEvents:register(self, InputCommandEvent)
if Console then Console:hide() end
self._ui = CreateCharUI(UI.CreateChar)
end
function st:leave()
InputEvents:unregisterAll(self)
if self._ui then
self._ui:destroy()
self._ui = nil
end
end
function st:destroy()
self._prevState = nil
end
function st:update(dt) end
function st:draw() end
function st:InputCommandEvent(e)
local cmd = e:getCommand()
--local args = e:getCommandArgs()
switch(cmd) {
-- run state
EXIT_MENU = function()
RunState.switch(State.destroy)
end,
CREATE_CHAR = function()
if self._ui then
local char = self._ui:getChar()
if char then
World:createHero(char)
RunState.switch(State.construct)
end
end
end,
default = function()
if self._prevState and self._prevState.InputCommandEvent then
self._prevState:InputCommandEvent(e)
end
end,
}
end
return st
|
--------------------------------------------------------
-- Brainfuck interpreter written in Lua
-- Author: Michael Scholtz <michael.scholtz@outlook.com>
-- Licence: MIT
--------------------------------------------------------
return function(code)
-- Brainfuck language consists of 8 instructions "><+-.,[]", everything else can be removed
local brainfuck = "[^><%+%-%.,%[%]]+"
-- Data tape consists of "infinite" amount of cells
local data = setmetatable({}, {__index = function() return 0 end})
-- Data pointer begins at position 1
local dataPointer = 1
-- Instruction pointer begins at position 1
local instructionPointer = 1
-- Remove everything from the code except for the 8 instructions defined above
code = code:gsub(brainfuck, "")
-- Implementation of the 8 instructions starts below
while instructionPointer <= #code do
local instruction = code:sub(instructionPointer,instructionPointer)
if instruction == ">" then
dataPointer = dataPointer + 1
elseif instruction == "<" then
dataPointer = dataPointer - 1
elseif instruction == "+" then
data[dataPointer] = data[dataPointer] + 1
elseif instruction == "-" then
data[dataPointer] = data[dataPointer] - 1
elseif instruction == "." then
io.write(string.char(data[dataPointer]))
elseif instruction == "," then
local character = io.read(1)
if character ~= nil then data[dataPointer] = character:byte() end
elseif instruction == "[" then
if data[dataPointer] == 0 then
local i = 1
while i ~= 0 do
instructionPointer = instructionPointer + 1
local _instruction = code:sub(instructionPointer, instructionPointer)
if _instruction == "[" then i = i + 1 elseif _instruction == "]" then i = i - 1 end
end
end
elseif instruction == "]" then
if data[dataPointer] ~= 0 then
local i = 1
while i ~= 0 do
instructionPointer = instructionPointer - 1
local _instruction = code:sub(instructionPointer, instructionPointer)
if _instruction == "]" then i = i + 1 elseif _instruction == "[" then i = i - 1 end
end
end
end
instructionPointer = instructionPointer + 1
end
end
|
-- SCT localization information
-- French Locale
-- Initial translation by Juki <Unskilled>
-- Translation by Sasmira
-- Date 04/03/2006
if GetLocale() ~= "frFR" then return end
-- Static Messages
SCT.LOCALS.LowHP= "Vie Faible !"; -- Message to be displayed when HP is low
SCT.LOCALS.LowMana= "Mana Faible !"; -- Message to be displayed when Mana is Low
SCT.LOCALS.SelfFlag = "*"; -- Icon to show self hits
SCT.LOCALS.Crushchar = "^";
SCT.LOCALS.Glancechar = "~";
SCT.LOCALS.Combat = "+ Combat"; -- Message to be displayed when entering combat
SCT.LOCALS.NoCombat = "- Combat"; -- Message to be displayed when leaving combat
SCT.LOCALS.ComboPoint = "Points de Combo "; -- Message to be displayed when gaining a combo point
SCT.LOCALS.FiveCPMessage = " ... A Mooort !!!"; -- Message to be displayed when you have 5 combo points
SCT.LOCALS.ExtraAttack = "Extra Attack!"; -- Message to be displayed when time to execute
SCT.LOCALS.KillingBlow = "Coup de gr\195\162ce !"; -- Message to be displayed when you kill something
SCT.LOCALS.Interrupted = "Interrompu !"; -- Message to be displayed when you are interrupted
SCT.LOCALS.Rampage = "Saccager"; -- Message to be displayed when rampage is needed
--startup messages
SCT.LOCALS.STARTUP = "Scrolling Combat Text "..SCT.Version.." charg\195\169. Tapez /sctmenu pour les options.";
SCT.LOCALS.Option_Crit_Tip = "Mettre cet \195\169v\195\168nement toujours apparent lors d\'un CRITIQUE.";
SCT.LOCALS.Option_Msg_Tip = "Mettre cet \195\169v\195\168nement toujours apparent lors d\'un MESSAGE. Surpasse les Critiques.";
SCT.LOCALS.Frame1_Tip = "Afficher cet \195\169v\195\170nement avec le style d\'animation 1.";
SCT.LOCALS.Frame2_Tip = "Afficher cet \195\169v\195\170nement avec le style d\'animation 2";
--Warnings
SCT.LOCALS.Version_Warning= "|cff00ff00SCT AVERTISSANT|r\n\n vos variables sauv\195\169 es sont d\'une version p\195\169rim\195\169e de SCT. Si vous rencontrez des erreurs ou le comportement \195\169trange, REMETTEZ \195\160 Z\195\169ro svp vos options \195\160 l\'aide du bouton de remise ou par /sctreset de dactylographie";
SCT.LOCALS.Load_Error = "|cff00ff00Erreur en chargeant SCT Options. Il est peut-\195\170tre d\195\169sactiv\195\169.|r";
--nouns
SCT.LOCALS.TARGET = "La cible";
SCT.LOCALS.PROFILE = "SCT Profil charg\195\169: |cff00ff00";
SCT.LOCALS.PROFILE_DELETE = "SCT Profil supprim\195\169: |cff00ff00";
SCT.LOCALS.PROFILE_NEW = "SCT Nouveau Profil Cr\195\169e: |cff00ff00";
SCT.LOCALS.WARRIOR = "Guerrier";
SCT.LOCALS.ROGUE = "Voleur";
SCT.LOCALS.HUNTER = "Chasseur";
SCT.LOCALS.MAGE = "Mage";
SCT.LOCALS.WARLOCK = "D\195\169moniste";
SCT.LOCALS.SHAMAN = "Chaman";
SCT.LOCALS.PALADIN = "Paladin";
SCT.LOCALS.DRUID = "Druide";
SCT.LOCALS.PRIEST = "Pr\195\170tre";
--Useage
SCT.LOCALS.DISPLAY_USEAGE = "Utilisation : \n";
SCT.LOCALS.DISPLAY_USEAGE = SCT.LOCALS.DISPLAY_USEAGE .. "/sctdisplay 'message' (pour du texte blanc)\n";
SCT.LOCALS.DISPLAY_USEAGE = SCT.LOCALS.DISPLAY_USEAGE .. "/sctdisplay 'message' rouge(0-10) vert(0-10) bleu(0-10)\n";
SCT.LOCALS.DISPLAY_USEAGE = SCT.LOCALS.DISPLAY_USEAGE .. "Exemple : /sctdisplay 'Soignez Moi' 10 0 0\nCela affichera 'Soignez Moi' en rouge vif\n";
SCT.LOCALS.DISPLAY_USEAGE = SCT.LOCALS.DISPLAY_USEAGE .. "Quelques Couleurs : rouge = 10 0 0, vert = 0 10 0, bleu = 0 0 10,\njaune = 10 10 0, violet = 10 0 10, cyan = 0 10 10";
--Fonts
SCT.LOCALS.FONTS = {
[1] = { name="Friz Quadrata TT", path="Fonts\\FRIZQT__.TTF"},
[2] = { name="SCT TwCenMT", path="Interface\\Addons\\sct\\fonts\\Tw_Cen_MT_Bold.TTF"},
[3] = { name="SCT Adventure", path="Interface\\Addons\\sct\\fonts\\Adventure.ttf"},
[4] = { name="SCT Enigma", path="Interface\\Addons\\sct\\fonts\\Enigma__2.TTF"},
[5] = { name="SCT Emblem", path="Interface\\Addons\\sct\\fonts\\Emblem.ttf"},
[6] = { name="SCT Diablo", path="Interface\\Addons\\sct\\fonts\\Avqest.ttf"},
}
-- Cosmos button
SCT.LOCALS.CB_NAME = "Scrolling Combat Text".." "..SCT.Version;
SCT.LOCALS.CB_SHORT_DESC = "Par Grayhoof";
SCT.LOCALS.CB_LONG_DESC = "Affiche les messages de combat au dessus du personnage";
SCT.LOCALS.CB_ICON = "Interface\\Icons\\Spell_Shadow_EvilEye"; -- "Interface\\Icons\\Spell_Shadow_FarSight"
|
test_run = require('test_run').new()
engine = test_run:get_cfg('engine')
box.sql.execute('pragma sql_default_engine=\''..engine..'\'')
-- Forbid multistatement queries.
box.sql.execute('select 1;')
box.sql.execute('select 1; select 2;')
box.sql.execute('create table t1 (id primary key); select 100;')
box.space.t1 == nil
box.sql.execute(';')
box.sql.execute('')
box.sql.execute(' ;')
box.sql.execute('\n\n\n\t\t\t ')
|
local brandner = RegisterMod("Brandner", 1);
local costume_Brandner_Body = Isaac.GetCostumeIdByPath("gfx/characters/BrandnerBody.anm2")
local costume_Brandner_Head = Isaac.GetCostumeIdByPath("gfx/characters/BrandnerHead.anm2")
local costume_Brandner_HeadBone = Isaac.GetCostumeIdByPath("gfx/characters/BrandnerHeadBone.anm2")
local playerType_Brandner = Isaac.GetPlayerTypeByName("Brandner")
local BSAD_DCount = 0
function brandner:Update(player)
local game = Game()
local level = game:GetLevel()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
if room:GetFrameCount() == 1 and player:GetPlayerType() == playerType_Brandner and not player:IsDead() then
if player:HasCollectible(CollectibleType.COLLECTIBLE_GUILLOTINE) or player:HasCollectible(CollectibleType.COLLECTIBLE_TRANSCENDENCE) then
player:AddNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_HeadBone)
else
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
if player:GetPlayerType() == playerType_Brandner then
if room:GetBackdropType() ~= 58 and room:GetBackdropType() ~= 59 then
if not player:HasCollectible(544) then
player:AddCollectible(544, 0, true)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
if player:GetPlayerType() == playerType_Brandner then
-- Hearts <= 2, Slipped Rib Num == 4
if player:GetHearts() <= 2 then
if player:GetCollectibleNum(542) ~= 4 then
if player:GetCollectibleNum(542) < 4 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
if player:GetCollectibleNum(542) > 4 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
else
--Do nothing
end
-- Hearts <= 6, Slipped Rib Num == 3
if player:GetHearts() <= 6 and player:GetHearts() > 2 then
if player:GetCollectibleNum(542) ~= 3 then
if player:GetCollectibleNum(542) < 3 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
if player:GetCollectibleNum(542) > 3 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
else
--Do nothing
end
-- Hearts <= 12, Slipped Rib Num == 2
if player:GetHearts() <= 12 and player:GetHearts() > 6 then
if player:GetCollectibleNum(542) ~= 2 then
if player:GetCollectibleNum(542) < 2 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
if player:GetCollectibleNum(542) > 2 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
else
--Do nothing
end
-- Hearts <= 18, Slipped Rib Num == 1
if player:GetHearts() <= 18 and player:GetHearts() > 12 then
if player:GetCollectibleNum(542) ~= 1 then
if player:GetCollectibleNum(542) < 1 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
if player:GetCollectibleNum(542) > 1 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
else
--Do nothing
end
-- Hearts <= 24, Slipped Rib Num == 0
if player:GetHearts() <= 24 and player:GetHearts() > 18 then
if player:GetCollectibleNum(542) ~= 0 then
if player:GetCollectibleNum(542) < 0 then
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
if player:GetCollectibleNum(542) > 0 then
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
else
-- Do nothing
end
end
end
end
brandner:AddCallback( ModCallbacks.MC_POST_UPDATE, brandner.Update)
function brandner:PostPlayerInit(player)
if player:GetPlayerType() == playerType_Brandner then
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
costumeEquipped = true
else
player:TryRemoveNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
costumeEquipped = false
end
end
brandner:AddCallback( ModCallbacks.MC_POST_PLAYER_INIT, brandner.PostPlayerInit)
function brandner:EvaluateCache(player, cacheFlag)
if player:GetPlayerType() == playerType_Brandner then
if cacheFlag == CacheFlag.CACHE_SPEED then
player.MoveSpeed = player.MoveSpeed + 0.3
elseif cacheFlag == CacheFlag.CACHE_DAMAGE then
player.Damage = player.Damage + 0.5
elseif cacheFlag == CacheFlag.CACHE_FIREDELAY then
player.MaxFireDelay = player.MaxFireDelay + 8
elseif cacheFlag == CacheFlag.CACHE_TEARFLAG then
player.TearFlags = player.TearFlags | 1 << 51 | 1 << 22 | 1
elseif cacheFlag == CacheFlag.CACHE_SHOTSPEED then
player.ShotSpeed = player.ShotSpeed + 0.3
elseif cacheFlag == CacheFlag.CACHE_LUCK then
player.Luck = player.Luck + 2
elseif cacheFlag == CacheFlag.CACHE_FLYING then
if player:HasCollectible(CollectibleType.COLLECTIBLE_TRANSCENDENCE) then
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
player.CanFly = true
elseif cacheFlag == CacheFlag.CACHE_FAMILIARS then
local maybeFamiliars = Isaac.GetRoomEntities()
for m = 1, #maybeFamiliars do
local variant = maybeFamiliars[m].Variant
if variant == (FamiliarVariant.GUILLOTINE) or variant == (FamiliarVariant.ISAACS_BODY) or variant == (FamiliarVariant.SCISSORS) then
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
else
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
player:TryRemoveNullCostume(costume_Brandner_Head)
player:AddNullCostume(costume_Brandner_Head)
player:TryRemoveNullCostume(costume_Brandner_HeadBone)
player:AddNullCostume(costume_Brandner_HeadBone)
end
end
end
end
end
brandner:AddCallback( ModCallbacks.MC_EVALUATE_CACHE, brandner.EvaluateCache)
local BSAD_D_Type = Isaac.GetEntityTypeByName("BrandnerAnmDeath")
local BSAD_D_Variant = Isaac.GetEntityVariantByName("BrandnerAnmDeath")
local HasBSAD_D = false
local function BSAD_D_Update(_, BSAD_D)
local game = Game()
local level = game:GetLevel()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
if player:GetPlayerType() == playerType_Brandner and player:IsDead() then
player.Visible = false
SFXManager():Stop(55)
if HasBSAD_D == false then
Isaac.Spawn(EntityType.ENTITY_FAMILIAR, BSAD_D_Variant, 0, player.Position, Vector(0,0), player)
BSAD_D:GetSprite():Play("BrandnerDeath", false)
HasBSAD_D = true
end
if BSAD_D:GetSprite():IsEventTriggered("Stat") then
--Wel, Do nothing.
end
if BSAD_D:GetSprite():IsEventTriggered("BloodExplosion") then
SFXManager():Play(28, 3, 0, false, 1 )
end
if BSAD_D:GetSprite():IsEventTriggered("FirePutout") then
SFXManager():Play(43, 3, 0, false, 1 )
end
if BSAD_D:GetSprite():IsEventTriggered("End") then
HasBSAD_D = false
BSAD_D:Remove()
end
end
end
brandner:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE,BSAD_D_Update, BSAD_D)
local BSAD_H_Type = Isaac.GetEntityTypeByName("BrandnerAnmHematemesis")
local BSAD_H_Variant = Isaac.GetEntityVariantByName("BrandnerAnmHematemesis")
local BrandnerUsePills = false
local function BSAD_H_Update(_, BSAD_H)
local game = Game()
local level = game:GetLevel()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
if player:GetPlayerType() == playerType_Brandner and BrandnerUsePills == true then
BSAD_H:GetSprite():Play("BrandnerHematemesis", false)
if BSAD_H:GetSprite():IsEventTriggered("Stat") then
--Wel, Do nothing.
end
if BSAD_H:GetSprite():IsEventTriggered("End") then
player.Visible = true
player.ControlsEnabled = true
BrandnerUsePills = false
BSAD_H:Remove()
end
end
end
brandner:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE,BSAD_H_Update, BSAD_H)
function brandner:UsePills()
local player = Isaac.GetPlayer(0)
if player:GetPlayerType() == playerType_Brandner then
BrandnerUsePills = true
Isaac.Spawn(EntityType.ENTITY_FAMILIAR, BSAD_H_Variant, 0, player.Position, Vector(0,0), player)
player.Visible = false
player.ControlsEnabled = false
player:TakeDamage(2, DamageFlag.DAMAGE_IV_BAG | DamageFlag.DAMAGE_INVINCIBLE , EntityRef(player), 0)
local pos = Isaac.GetFreeNearPosition(player.Position, 1)
Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_HEART, 8, pos, Vector(0, 0), nil)
player:BloodExplode()
SFXManager():Play(30, 3, 0, false, 1 )
SFXManager():Stop(55)
if player:IsDead() then
print "Brandner:If I die... It's all the pills' fault.."
end
end
end
brandner:AddCallback( ModCallbacks.MC_USE_PILL, brandner.UsePills)
function brandner:PostNewGame()
HasBSAD_D = false
BrandnerUsePills = false
end
brandner:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, brandner.PostNewGame)
--== Tainted Brandner==--
local costume_TaintedBrandner_FireHead = Isaac.GetCostumeIdByPath("gfx/characters/TaintedBrandnerFireHead.anm2")
local costume_TaintedBrandner_Head = Isaac.GetCostumeIdByPath("gfx/characters/TaintedBrandnerHead.anm2")
local costume_TaintedBrandner_HeadBone = Isaac.GetCostumeIdByPath("gfx/characters/TaintedBrandnerHeadBone.anm2")
local playerType_TaintedBrandner = Isaac.GetPlayerTypeByName("Tainted Brandner", true)
function brandner:TaintedUpdate()
local game = Game()
local level = game:GetLevel()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
if room:GetFrameCount() == 1 and player:GetPlayerType() == playerType_TaintedBrandner and not player:IsDead() then
if player:HasCollectible(CollectibleType.COLLECTIBLE_GUILLOTINE) or player:HasCollectible(CollectibleType.COLLECTIBLE_TRANSCENDENCE) then
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_Brandner_Body)
else
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
if player:GetPlayerType() == playerType_TaintedBrandner then
if room:GetBackdropType() ~= 58 and room:GetBackdropType() ~= 59 then
if not player:HasCollectible(544) then
player:AddCollectible(544, 0, true)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
if player:GetPlayerType() == playerType_TaintedBrandner then
-- Hearts <= 2, Slipped Rib Num == 4
if player:GetHearts() <= 2 then
if player:GetCollectibleNum(542) ~= 4 then
if player:GetCollectibleNum(542) < 4 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
if player:GetCollectibleNum(542) > 4 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
else
--Do nothing
end
-- Hearts <= 6, Slipped Rib Num == 3
if player:GetHearts() <= 6 and player:GetHearts() > 2 then
if player:GetCollectibleNum(542) ~= 3 then
if player:GetCollectibleNum(542) < 3 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
if player:GetCollectibleNum(542) > 3 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
else
--Do nothing
end
-- Hearts <= 12, Slipped Rib Num == 2
if player:GetHearts() <= 12 and player:GetHearts() > 6 then
if player:GetCollectibleNum(542) ~= 2 then
if player:GetCollectibleNum(542) < 2 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
if player:GetCollectibleNum(542) > 2 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
else
--Do nothing
end
-- Hearts <= 18, Slipped Rib Num == 1
if player:GetHearts() <= 18 and player:GetHearts() > 12 then
if player:GetCollectibleNum(542) ~= 1 then
if player:GetCollectibleNum(542) < 1 then
SFXManager():Play(461, 3, 0, false, 1 )
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
if player:GetCollectibleNum(542) > 1 then
SFXManager():Play(461, 3, 0, false, 1 )
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
else
--Do nothing
end
-- Hearts <= 24, Slipped Rib Num == 0
if player:GetHearts() <= 24 and player:GetHearts() > 18 then
if player:GetCollectibleNum(542) ~= 0 then
if player:GetCollectibleNum(542) < 0 then
player:AddCollectible(542, 0, true)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
if player:GetCollectibleNum(542) > 0 then
player:RemoveCollectible(542)
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
else
-- Do nothing
end
end
end
end
brandner:AddCallback( ModCallbacks.MC_POST_UPDATE, brandner.TaintedUpdate)
function brandner:TaintedPostPlayerInit(player)
if player:GetPlayerType() == playerType_TaintedBrandnerBrandner then
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
costumeEquipped = true
else
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
costumeEquipped = false
end
end
brandner:AddCallback( ModCallbacks.MC_POST_PLAYER_INIT, brandner.TaintedPostPlayerInit)
function brandner:EvaluateCache(player, cacheFlag)
if player:GetPlayerType() == playerType_TaintedBrandner then
if cacheFlag == CacheFlag.CACHE_SPEED then
player.MoveSpeed = player.MoveSpeed - 0.2
elseif cacheFlag == CacheFlag.CACHE_DAMAGE then
player.Damage = player.Damage + 1.5
elseif cacheFlag == CacheFlag.CACHE_FIREDELAY then
player.MaxFireDelay = player.MaxFireDelay + 12
elseif cacheFlag == CacheFlag.CACHE_TEARFLAG then
player.TearFlags = player.TearFlags | 1 << 51 | 1 << 22 | 1
elseif cacheFlag == CacheFlag.CACHE_SHOTSPEED then
player.ShotSpeed = player.ShotSpeed + 0.3
elseif cacheFlag == CacheFlag.CACHE_LUCK then
player.Luck = player.Luck + 4
elseif cacheFlag == CacheFlag.CACHE_FLYING then
if player:HasCollectible(CollectibleType.COLLECTIBLE_TRANSCENDENCE) then
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
player.CanFly = true
elseif cacheFlag == CacheFlag.CACHE_FAMILIARS then
local maybeFamiliars = Isaac.GetRoomEntities()
for m = 1, #maybeFamiliars do
local variant = maybeFamiliars[m].Variant
if variant == (FamiliarVariant.GUILLOTINE) or variant == (FamiliarVariant.ISAACS_BODY) or variant == (FamiliarVariant.SCISSORS) then
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
else
player:TryRemoveNullCostume(costume_TaintedBrandner_FireHead)
player:AddNullCostume(costume_TaintedBrandner_FireHead)
player:TryRemoveNullCostume(costume_TaintedBrandner_Head)
player:AddNullCostume(costume_TaintedBrandner_Head)
player:TryRemoveNullCostume(costume_TaintedBrandner_HeadBone)
player:AddNullCostume(costume_TaintedBrandner_HeadBone)
player:TryRemoveNullCostume(costume_Brandner_Body)
player:AddNullCostume(costume_Brandner_Body)
end
end
end
end
end
brandner:AddCallback( ModCallbacks.MC_EVALUATE_CACHE, brandner.EvaluateCache)
local Fireworks = {}
function brandner:TaintedPostUpdate()
local player = Isaac.GetPlayer(0)
local roomEntities = Isaac.GetRoomEntities()
if player:GetPlayerType() == playerType_TaintedBrandner then
for i, entity in ipairs(Fireworks) do
if entity ~= nil then
entity:Remove()
end
end
Fireworks = {}
for i,entity in ipairs(roomEntities) do
--==NPC==--
local NPC = entity:ToNPC()
if NPC ~= nil then
local FireworksEntityNPC = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.FIREWORKS, 5, NPC.Position, NPC.Velocity, NPC)
FireworksEntityNPC.Visible = false
FireworksEntityNPC:SetColor(Color(0.5, 0.75, 1, 1, 0, 0, 0), 0, 999, false, false)
table.insert(
Fireworks,
FireworksEntityNPC
)
end
--==Tear==--
--[[local tear = entity:ToTear()
if tear ~= nil then
if tear.Parent.Type == EntityType.ENTITY_PLAYER then
local FireworksEntityTear = Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.FIREWORKS, 5, tear.Position, tear.Velocity, tear)
FireworksEntityTear.Visible = false
FireworksEntityTear:SetColor(Color(0.5, 0.75, 1, 1, 0, 0, 0), 0, 999, false, false)
table.insert(
Fireworks,
FireworksEntityTear
)
end
end]]--
-- NO, THANKS >:(
end
end
end
brandner:AddCallback( ModCallbacks.MC_POST_UPDATE, brandner.TaintedPostUpdate)
function brandner:TaintedPostNewLevel()
local game = Game()
local level = game:GetLevel()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
if player:GetPlayerType() == playerType_TaintedBrandner then
if level:GetCurses() ~= (LevelCurse.CURSE_OF_DARKNESS) then
level:AddCurse(1, false)
end
end
end
brandner:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, brandner.TaintedPostNewLevel)
function brandner:TaintedUsePills()
local player = Isaac.GetPlayer(0)
local roomEntities = Isaac.GetRoomEntities()
if player:GetPlayerType() == playerType_TaintedBrandner then
BrandnerUsePills = true
player:TakeDamage(2, DamageFlag.DAMAGE_IV_BAG | DamageFlag.DAMAGE_INVINCIBLE , EntityRef(player), 0)
local pos = Isaac.GetFreeNearPosition(player.Position, 1)
Isaac.Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_HEART, 8, pos, Vector(0, 0), nil)
player:BloodExplode()
SFXManager():Play(30, 3, 0, false, 1 )
SFXManager():Stop(55)
Isaac.Spawn(EntityType.ENTITY_EFFECT, EffectVariant.PLAYER_CREEP_RED, 0, player.Position, Vector(0,0), player)
end
end
brandner:AddCallback( ModCallbacks.MC_USE_PILL, brandner.TaintedUsePills)
--==Universal==--
function brandner:UniversalUpdate()
local game = Game()
local level = game:GetLevel()
local player = Isaac.GetPlayer(0)
local room = game:GetRoom()
if player:GetPlayerType() == playerType_Brandner or player:GetPlayerType() == playerType_TaintedBrandner then
while player:GetMaxHearts() > 0 do
if player:GetMaxHearts() >= 2 then
player:AddMaxHearts(-1, true)
else
player:AddMaxHearts(-1, true)
player:AddBoneHearts(1)
player:AddHearts(2)
end
end
end
end
brandner:AddCallback( ModCallbacks.MC_POST_UPDATE, brandner.UniversalUpdate)
function brandner:UniversalPostUpdate()
local player = Isaac.GetPlayer(0)
local roomEntities = Isaac.GetRoomEntities()
if player:GetPlayerType() == playerType_Brandner or player:GetPlayerType() == playerType_TaintedBrandner then
for i,entity in ipairs(roomEntities) do
local tear = entity:ToTear()
if tear ~= nil then
if tear.Parent.Type == EntityType.ENTITY_PLAYER and tear.Variant ~= TearVariant.DARK_MATTER then
local tearSprite = tear:GetSprite()
tear:ChangeVariant(TearVariant.DARK_MATTER)
tearSprite:ReplaceSpritesheet(0,"gfx/Brandner_tears.png")
tearSprite:LoadGraphics("gfx/Brandner_tears.png")
tearSprite.Rotation = entity.Velocity:GetAngleDegrees()
end
end
local effect = entity:ToEffect()
if effect ~= nil then
if effect.Variant == EffectVariant.HOT_BOMB_FIRE then
local fireSprite = effect:GetSprite()
fireSprite:ReplaceSpritesheet(0,"gfx/effects/effect_Brandnerbluefire.png")
fireSprite:LoadGraphics("gfx/effects/effect_Brandnerbluefire.png")
end
end
end
end
end
brandner:AddCallback( ModCallbacks.MC_POST_UPDATE, brandner.UniversalPostUpdate )
--== Some funny things ==--
function brandner:CharacterInteraction(cmd, params)
local player = Isaac.GetPlayer(0)
if player:GetPlayerType() == playerType_Brandner then
--==Hello==--
if cmd == "HelloBrandner" or cmd == "helloBrandner" or cmd == "hellobrandner" then
local RandomNum = math.random(5)
if RandomNum == 1 then
print "Brandner:Hello!"
elseif RandomNum == 2 then
print "Brandner:Hi!"
elseif RandomNum == 3 then
print "Brandner:Hello, player!"
elseif RandomNum == 4 then
print "Brandner:What's up?"
elseif RandomNum == 5 then
print "Brandner:UuU!"
end
end
--==How're you?==--
if cmd == "HowreYouBrandner" or cmd == "howreyouBrandner" or cmd == "howreyoubrandner" then
if player:HasFullHearts() then
local RandomNum = math.random(3)
if RandomNum == 1 then
print "Brandner:Very fine! Thanks for your asking!"
elseif RandomNum == 2 then
print "Brandner:Verrrry fine!!!!"
elseif RandomNum == 3 then
print "Brandner:Gruuuuuuuu! Fine!"
end
end
if not player:HasFullHearts() and player:GetHearts() >= 1then
local RandomNum = math.random(3)
if RandomNum == 1 then
print "Brandner:Fine, thank you!"
elseif RandomNum == 2 then
print "Brandner:I'm fine, thanks OuO"
elseif RandomNum == 3 then
print "Brandner:not bad-! UuU"
end
end
if player:GetHearts() <= 0 and player:GetSoulHearts() ~= 0 then
local RandomNum = math.random(3)
if RandomNum == 1 then
print "Brandner:I feel a little weak ;.;"
elseif RandomNum == 2 then
print "Brandner:I don't feel like I have enough Hearts, am I ok? ;.;"
elseif RandomNum == 3 then
print "Brandner:I don't know how to describe my feelings ;.;"
end
end
if player:GetHearts() <= 0 and player:GetSoulHearts() <= 0 then
local RandomNum = math.random(3)
if RandomNum == 1 then
print "Brandner:No.. Help XAX"
elseif RandomNum == 2 then
print "Brandner:I feel terrible.. Help me! XAX"
elseif RandomNum == 3 then
print "Brandner:I'm.. I'm scared.. QAQ"
end
end
end
end
end
brandner:AddCallback(ModCallbacks.MC_EXECUTE_CMD, brandner.CharacterInteraction ) |
function nmap(shortcut, command, options)
vim.api.nvim_set_keymap("n", shortcut, command, options)
end
function vmap(shortcut, command, options)
vim.api.nvim_set_keymap("v", shortcut, command, options)
end
function tmap(shortcut, command, optinos)
vim.api.nvim_set_keymap("t", shortcut, command, options)
end
vim.g.coq_settings = {
['keymap.jump_to_mark'] = '',
}
-- panes
nmap("<C-h>", ":winc h<CR>", { silent = true, noremap = true })
nmap("<C-j>", ":winc j<CR>", { silent = true, noremap = true })
nmap("<C-k>", ":winc k<CR>", { silent = true, noremap = true })
nmap("<C-l>", ":winc l<CR>", { silent = true, noremap = true })
-- save
nmap("<C-s>", ":w <CR>", { silent = true })
-- show next matched string at the center of screen
nmap("n", "nzz", { noremap = true })
nmap("N", "Nzz", { noremap = true })
-- telescope stuff
nmap("<C-p>", ":Telescope find_files <CR>", { silent = true })
nmap("<C-f>", ":Telescope live_grep <CR>", { silent = true })
nmap("<C-d>", ":Telescope lsp_implementations <CR>", {})
nmap("<C-u>", ":Telescope commands <CR>", { silent = true })
vim.g.fzf_action = {
["ctrl-s"] = "split",
["ctrl-v"] = "vsplit",
}
-- code actions
nmap("<C-a>", ":CodeActionMenu <CR>", { silent = true })
-- comment in normal and visual mode
nmap("<C-_>", "<leader>c<space>", {})
vmap("<C-_>", "<leader>c<space>", {})
|
local Sidequest = require("mod.elona_sys.sidequest.api.Sidequest")
local Chara = require("api.Chara")
local common = require("mod.elona.data.dialog.common")
local Item = require("api.Item")
local Gui = require("api.Gui")
data:add {
_type = "elona_sys.dialog",
_id = "erystia",
nodes = {
__start = function()
local flag = Sidequest.progress("elona.main_quest")
if flag >= 200 then
return "late"
elseif flag == 120 then
return "all_stones"
elseif flag == 105 then
return "stones"
elseif flag >= 60 then
return "investigation"
elseif flag == 50 then
return "introduction"
end
return "elona_sys.ignores_you:__start"
end,
late = {
text = {
"talk.unique.erystia.late._0",
"talk.unique.erystia.late._1",
{"talk.unique.erystia.late._2", args = function() return {Chara.player():calc("title"), Chara.player():calc("name")} end},
},
choices = {
{"__END__", "ui.more"},
}
},
all_stones = {
text = {
{"talk.unique.erystia.all_stones.dialog._0", args = common.args_name},
"talk.unique.erystia.all_stones.dialog._1",
"talk.unique.erystia.all_stones.dialog._2",
{"talk.unique.erystia.all_stones.dialog._3", args = common.args_name},
},
on_finish = function()
Gui.play_sound("base.write1")
Gui.mes_c("talk.unique.erystia.all_stones.you_receive", "Green")
local player = Chara.player()
local map = player:current_map()
Item.create("elona.palmia_pride", player.x, player.y, {}, map)
Gui.mes("common.something_is_put_on_the_ground")
Sidequest.set_progress("elona.main_quest", 125)
end
},
stones = {
text = {
{"talk.unique.erystia.stones.dialog._0", args = common.args_name},
function() Gui.fade_out() end,
"talk.unique.erystia.stones.dialog._1",
"talk.unique.erystia.stones.dialog._2",
"talk.unique.erystia.stones.dialog._3",
"talk.unique.erystia.stones.dialog._4",
},
on_finish = function()
Gui.play_sound("base.write1")
Gui.mes_c("talk.unique.erystia.stones.you_receive", "Green")
Sidequest.set_progress("elona.main_quest", 110)
end
},
investigation = {
text = {
{"talk.unique.erystia.investigation.dialog", args = common.args_name},
},
choices = function()
local choices = {
{"lesmias", "talk.unique.erystia.investigation.choices.lesimas"},
{"mission", "talk.unique.erystia.investigation.choices.mission"},
}
local flag = Sidequest.progress("elona.main_quest")
if flag >= 100 and flag <= 120 then
table.insert(choices, {"stones_castle", "talk.unique.erystia.investigation.choices.stones.castle"})
table.insert(choices, {"stones_inferno", "talk.unique.erystia.investigation.choices.stones.inferno"})
table.insert(choices, {"stones_crypt", "talk.unique.erystia.investigation.choices.stones.crypt"})
end
table.insert(choices, {"__END__", "ui.bye"})
return choices
end
},
lesmias = {
text = {
"talk.unique.erystia.investigation.lesmias._0",
"talk.unique.erystia.investigation.lesmias._1",
"talk.unique.erystia.investigation.lesmias._2",
"talk.unique.erystia.investigation.lesmias._3",
"talk.unique.erystia.investigation.lesmias._4",
},
choices = {
{"__start", "ui.more"},
}
},
mission = function()
local flag = Sidequest.progress("elona.main_quest")
if flag >= 125 then
return "mission_excavation"
elseif flag >= 110 then
return "mission_stones_0"
else
return "mission_stones_1"
end
end,
mission_excavation = {
text = {
"talk.unique.erystia.investigation.mission.excavation._0",
"talk.unique.erystia.investigation.mission.excavation._1",
},
choices = {
{"__start", "ui.more"},
}
},
mission_stones_0 = {
text = "talk.unique.erystia.investigation.mission.stones._0",
choices = {
{"__start", "ui.more"},
}
},
mission_stones_1 = {
text = {
{"talk.unique.erystia.investigation.mission.stones._1", args = common.args_name},
},
choices = {
{"__start", "ui.more"},
}
},
stones_castle = {
text = {
"talk.unique.erystia.investigation.castle._0",
"talk.unique.erystia.investigation.castle._1",
"talk.unique.erystia.investigation.castle._2",
},
choices = {
{"__start", "ui.more"},
}
},
stones_inferno = {
text = {
"talk.unique.erystia.investigation.inferno._0",
"talk.unique.erystia.investigation.inferno._1",
"talk.unique.erystia.investigation.inferno._2",
},
choices = {
{"__start", "ui.more"},
}
},
stones_crypt = {
text = {
"talk.unique.erystia.investigation.crypt._0",
"talk.unique.erystia.investigation.crypt._1",
"talk.unique.erystia.investigation.crypt._2",
},
choices = {
{"__start", "ui.more"},
}
},
introduction = {
text = {
{"talk.unique.erystia.introduction.dialog", args = common.args_name},
},
choices = {
{"pledge_strength", "talk.unique.erystia.introduction.choices.pledge_strength"},
{"not_interested", "talk.unique.erystia.introduction.choices.not_interested"},
},
default_choice = "not_interested"
},
not_interested = {
text = "talk.unique.erystia.introduction.not_interested",
},
pledge_strength = {
text = {
"talk.unique.erystia.introduction.pledge_strength.dialog._0",
"talk.unique.erystia.introduction.pledge_strength.dialog._1",
"talk.unique.erystia.introduction.pledge_strength.dialog._2",
{"talk.unique.erystia.introduction.pledge_strength.dialog._3", args = common.args_name},
},
on_finish = function()
-- >>>>>>>> shade2/chat.hsp:859 snd seSave:txtEf coGreen:txt lang("レシマス4階の鍵を受け取っ ...
Gui.play_sound("base.write1")
Gui.mes_c("talk.unique.erystia.introduction.pledge_strength.you_receive", "Green")
Sidequest.set_progress("elona.main_quest", 60)
-- <<<<<<<< shade2/chat.hsp:860 flagMain=60 ..
end
}
}
}
|
c/val = Instance.new("IntValue")
val.Parent = workspace.acb227
val.Value = 0
va = Instance.new("IntValue")
va.Parent = workspace.acb227
va.Value = 0
he = Instance.new("Hint")
he.Parent = workspace.acb227
hel = Instance.new("Message")
hel.Parent = workspace.acb227
script.Parent = workspace.acb227
while true do
val.Value = val.Value + 10
wait()
he.Text = val.Value
hel.Text = va.Value
if val.Value == 1000 then
val.Value = 0
va.Value = va.Value + 1
end
end --lego |
--劫火の翼竜 ゴースト・ワイバーン
--
--Script by REIKAI
function c100286011.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100286011,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100286011)
e1:SetTarget(c100286011.thtg)
e1:SetOperation(c100286011.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_REMOVE)
e3:SetOperation(c100286011.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100286011,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_REMOVED)
e4:SetCountLimit(1,100286111)
e4:SetCondition(c100286011.sumcon)
e4:SetTarget(c100286011.sumtg)
e4:SetOperation(c100286011.sumop)
c:RegisterEffect(e4)
end
function c100286011.thfilter(c)
return c:IsCode(100286012) and c:IsAbleToHand()
end
function c100286011.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100286011.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100286011.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100286011.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100286011.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(100286011,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c100286011.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100286011)>0
end
function c100286011.thcheck(c)
return c:IsLevelBelow(2) and c:IsRace(RACE_ZOMBIE) and c:IsType(TYPE_TUNER) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function c100286011.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100286011.thcheck,tp,LOCATION_DECK,0,1,nil) end
end
function c100286011.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c100286011.thcheck,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
|
--- Wrappers around a XCB connection.
-- This is the main thing.
local ffi = require("ffi")
local xcbr = require("xcb.raw")
local xcbe = require("xcb.enums")
local cv = require("xcb.wrappers.create_values")
local c_window = require("xcb.wrappers.window")
local c_event = require("xcb.wrappers.event")
local c_gc = require("xcb.wrappers.gc")
local fns_conn = {
--- Disconnects the XCB connection.
disconnect = function(self)
if self then
self:flush(true)
xcbr.xcb_disconnect(ffi.gc(self, nil))
end
end,
--- Flushes stuff.
-- @param sync Forces syncronous flush instead of async one.
flush = function(self, sync)
if sync then
return xcbr.xcb_aux_sync(self)
end
return xcbr.xcb_flush(self)
end,
--- Checks if the connection has an error.
has_error = function(self)
return xcbr.xcb_connection_has_error(self) ~= 0
end,
--- Generate an ID.
generate_id = function(self)
return xcbr.xcb_generate_id(self)
end,
--- Get the FD of the connection.
get_file_descriptor = function(self)
return xcbr.xcb_get_file_descriptor(self)
end,
--- Get the setup.
get_setup = function(self)
return xcbr.xcb_get_setup(self)
end,
--- Get the input focus.
get_input_focus = function(self)
return xcbr.xcb_get_input_focus(self):reply(self)
end,
get_input_focus_unchecked = function(self)
return xcbr.xcb_get_input_focus_unchecked(self):reply(self)
end,
--- Set input focus.
-- @param win The window to focus.
-- @param revert_to A xcb.enums.input_focus value.
set_input_focus = function(self, win, revert_to)
return xcbr.xcb_set_input_focus(self, revert_to or xcbe.input_focus.NONE, win.id, xcbe.time.CURRENT_TIME)
end,
--- Get pointer information
-- @param win Window to use as reference instead of the first screen.
query_pointer = function(self, win)
local root = win and win.id or self:get_setup():setup_roots()().root
return xcbr.xcb_query_pointer(self, root):reply(self)
end,
query_pointer_unchecked = function(self, win)
local root = win and win.id or self:get_setup():setup_roots()().root
return xcbr.xcb_query_pointer_unchecked(self, root):reply(self)
end,
--- Warp the pointer.
-- @param x X coordinate
-- @param y Y coordinate
-- @param relative Optionally specify whether the position is relative instead of absolute. First screen is used as reference if multiple are present.
-- @param win Optionally use a window as reference instead of the root window. Must be relative for it to have any effect.
warp_pointer = function(self, x, y, relative, win)
if relative then
return xcbr.xcb_warp_pointer(self, xcbe.none, xcbe.none, 0,0, 0,0, x,y)
end
local dst = win and win.id
if not dst then
local scr = self:get_setup():setup_roots()()
dst = scr.root
end
return xcbr.xcb_warp_pointer(self, xcbe.none, dst, 0,0, 0,0, x,y)
end,
--- Wait for an event.
wait_for_event = function(self)
local event = xcbr.xcb_wait_for_event(self)
if event ~= nil then
ffi.gc(event, ffi.C.free)
return c_event(event)
end
return
end,
poll_for_event = function(self)
local event = xcbr.xcb_poll_for_event(self)
if event ~= nil then
ffi.gc(event, ffi.C.free)
return c_event(event)
end
return
end,
--- Grab keyboard key(s).
-- @param win Window.
-- @param owner_events Whether the win will still get pointer events.
-- @param mods Array of Modifiers.
-- @param key Keycode of the key to grab.
-- @param pointer_mode_async State that the pointer processing continues normally instead of freezing all pointer events until the grab is released.
-- @param keyboard_mode_async State that the keyboard processing continues normally instead of freezing all keyboard events until the grab is released.
grab_key = function(self, win, owner_events, mods, key, pointer_mode_async, keyboard_mode_async)
local mod_mask = cv.mod_masks(mods)
key = key or 0
key = ffi.cast('unsigned char', key)
local pma = pointer_mode_async and xcbe.grab_mode.ASYNC or xcbe.grab_mode.SYNC
local kma = keyboard_mode_async and xcbe.grab_mode.ASYNC or xcbe.grab_mode.SYNC
return xcbr.xcb_grab_key(self, owner_events and 1 or 0, win and win.id or xcbe.none, mod_mask, key, pma, kma)
end,
--- Grab button(s).
-- @param win Window.
-- @param owner_events Whether the win will still get pointer events.
-- @param events Array of events.
-- @param pointer_mode_async State that the pointer processing continues normally instead of freezing all pointer events until the grab is released.
-- @param keyboard_mode_async State that the keyboard processing continues normally instead of freezing all keyboard events until the grab is released.
-- @param confine_to window to confine grabbing to.
-- @param cursor cursor to select or nil to keep current.
-- @param button Keycode of the button to grab.
-- @param mods Array of Modifiers.
grab_button = function(self, win, owner_events, events, pointer_mode_async, keyboard_mode_async, confine_to, cursor, button, mods)
local event_mask = cv.event_masks(events)
local mod_mask = cv.mod_masks(mods)
local pma = pointer_mode_async and xcbe.grab_mode.ASYNC or xcbe.grab_mode.SYNC
local kma = keyboard_mode_async and xcbe.grab_mode.ASYNC or xcbe.grab_mode.SYNC
return xcbr.xcb_grab_button(self, owner_events and 1 or 0, win and win.id or xcbe.none, event_mask, pma, kma, confine_to and confine_to.id or xcbe_none, cursor or xcbe.none, button or xcbe.button_index.ANY, mod_mask)
end,
--- Grab pointer.
-- @param win Window.
-- @param owner_events Whether the win will still get pointer events.
-- @param events Array of events.
-- @param pointer_mode_async State that the pointer processing continues normally instead of freezing all pointer events until the grab is released.
-- @param keyboard_mode_async State that the keyboard processing continues normally instead of freezing all keyboard events until the grab is released.
-- @param confine_to Optional window to confine grabbing to.
-- @param cursor Optional cursor select.
-- @param timestamp Optional Timestamp.
grab_pointer = function(self, win, owner_events, events, pointer_mode_async, keyboard_mode_async, confine_to, cursor, timestamp)
local event_mask = cv.event_masks(events)
local pma = pointer_mode_async and xcbe.grab_mode.ASYNC or xcbe.grab_mode.SYNC
local kma = keyboard_mode_async and xcbe.grab_mode.ASYNC or xcbe.grab_mode.SYNC
return xcbr.xcb_grab_pointer(self, owner_events and 1 or 0, win and win.id or xcbe.none, event_mask, pma, kma, confine_to and confine_to.id or xcbe_none, cursor or xcbe.none, timestamp or xcbe.time.CURRENT_TIME)
end,
--- Ungrab key.
-- @param win Window.
-- @param key Keycode of the combination or falsey to release all.
-- @param mods Array of modifiers or falsey to match all.
ungrab_key = function(self, win, key, mods)
local mod_mask = mods and cv.mod_masks(mods) or xcbe.mod_mask.ANY
return xcbr.xcb_ungrab_key(self, key or xcbe.grab.ANY, win and win.id, mod_mask)
end,
--- Ungrab pointer.
-- @param timestamp Optional Timestamp.
ungrab_pointer = function(self, timestamp)
return xcbr.xcb_ungrab_pointer(self, timestamp or xcbe.time.CURRENT_TIME)
end,
--- Window object constructor for current connection.
window = function(self, wid)
return c_window(self, wid)
end,
--- GC object constructor for current connection.
gc = function(self, gid)
return c_gc(self, gid)
end,
}
ffi.metatype("xcb_connection_t", {__index=fns_conn})
|
local scale = 1.5
local stamp_width = 128
local rpg = require("rpg")
-- Temporary (as if)
local margin_stamp = 32
local initial_stamp_offset = 180
local y_offset_stamp = 52
local next_form = 0.5
local running = true
local time_finish_allowed = 0
local form_speed = 400
local form_height = 60 * scale
local beltSpeed = 0.5
local beltValue = 0
local colorEnum = {
BLUE = 0,
RED = 1,
GREEN = 2,
ORANGE = 3
}
local stats = {
missed = 0,
success = 0
}
local sfxEnum = {
STAMP = 0
}
local gfx = {}
gfx.paper = {}
gfx.stamps = {}
gfx.beltQuads = {}
sfx = {}
local grid = {
[0] = {x = initial_stamp_offset, y = y_offset_stamp, forms = {}, accepted_forms = {}},
[1] = {x = initial_stamp_offset + (1 * stamp_width) + (1 * margin_stamp), y = y_offset_stamp, forms = {}},
[2] = {x = initial_stamp_offset + (2 * stamp_width) + (2 * margin_stamp), y = y_offset_stamp, forms = {}},
[3] = {x = initial_stamp_offset + (3 * stamp_width) + (3 * margin_stamp), y = y_offset_stamp, forms = {}},
}
function load()
gfx.paper[colorEnum.BLUE] = love.graphics.newImage("gpx/paper_blue.png")
gfx.paper[colorEnum.RED] = love.graphics.newImage("gpx/paper_red.png")
gfx.paper[colorEnum.GREEN] = love.graphics.newImage("gpx/paper_green.png")
gfx.paper[colorEnum.ORANGE] = love.graphics.newImage("gpx/paper_orange.png")
gfx.stamps[colorEnum.BLUE] = love.graphics.newImage("gpx/stamp_blue.png")
gfx.stamps[colorEnum.RED] = love.graphics.newImage("gpx/stamp_red.png")
gfx.stamps[colorEnum.GREEN] = love.graphics.newImage("gpx/stamp_green.png")
gfx.stamps[colorEnum.ORANGE] = love.graphics.newImage("gpx/stamp_orange.png")
gfx.belt = love.graphics.newImage("gpx/belt.png");
for i = 0, 8 do
gfx.beltQuads[i] = love.graphics.newQuad(i * 60, 0, 60, 16, 480, 16)
end
sfx[sfxEnum.STAMP] = love.sound.newSoundData("sfx/stamp.wav")
end
local key_cooldowns = {
q = 0,
w = 0,
e = 0,
r = 0
}
function isGameOver()
return stats.missed > 0 or stats.success >= 5
end
function drawStampsAndForms()
love.graphics.setColor(191 / 255, 111 / 255, 74 / 255, 1)
love.graphics.rectangle("fill", 0, 0, 960, 540)
love.graphics.setColor(1, 1, 1, 1)
for i = 0, #grid do
local row = grid[i]
for k = 1, 24 do
love.graphics.draw(gfx.belt, gfx.beltQuads[(i + math.floor(beltValue)) % #gfx.beltQuads], row.x - 16, 24 * k - 24, 0, 1.5, 1.5)
if not isGameOver() then
beltValue = beltValue + love.timer.getDelta() * beltSpeed
end
end
local paper = gfx.paper[i]
for j = 1, #row.forms do
local form = row.forms[j]
love.graphics.draw(paper, row.x - 8, form.y, 0, scale, scale)
if form.accepted ~= -1 then
love.graphics.setColor(0, 1, 0, 1)
love.graphics.rectangle("fill", row.x + 2, form.y + form.accepted, 50, 8)
love.graphics.setColor(1, 1, 1, 1)
end
end
local key = ""
if colorEnum.BLUE == i then
key = "q"
elseif colorEnum.RED == i then
key = "w"
elseif colorEnum.GREEN == i then
key = "e"
elseif colorEnum.ORANGE == i then
key = "r"
end
love.graphics.print(key, row.x + 22, row.y - 30)
love.graphics.draw(gfx.stamps[i], row.x, lerp(row.y, row.y + 80, math.max(key_cooldowns[key], 0)), 0, scale, scale)
end
love.graphics.print(stats.success .. "/" .. 5, 5, 10)
if isGameOver() then
if (resultText ~= "") then
local text
if getWinCondition() then
text = love.graphics.newText(font, "Application approved.\nPress SPACE to continue")
else
text = love.graphics.newText(font, "Application rejected.\nPress SPACE to continue")
end
love.graphics.setColor(255, 255, 255)
love.graphics.draw(
text,
(love.graphics.getWidth() - text:getWidth()) / 2,
(love.graphics.getHeight() - text:getHeight()) / 2
)
end
end
end
function draw()
drawStampsAndForms()
end
function isKeyPressed(key, cooldowns)
return love.keyboard.isDown(key) and cooldowns[key] <= 0
end
function updateKeyCooldowns(keys, delta)
keys["q"] = keys["q"] - delta;
keys["w"] = keys["w"] - delta;
keys["e"] = keys["e"] - delta;
keys["r"] = keys["r"] - delta;
end
function setKeyCooldown(key, cooldowns, cooldown_time)
cooldowns[key] = cooldown_time
end
function updateFormsOnCollision(stamp)
for i = #stamp.forms, 1, -1 do
if isColliding(stamp.y, stamp.forms[i].y) and stamp.forms[i].accepted == -1 then
stats.success = stats.success + 1
stamp.forms[i].accepted = stamp.y + 20
end
end
end
function isColliding(stamp_y, form_y)
return stamp_y + 80 > form_y and stamp_y < form_y + form_height
end
function update(delta)
updateKeyCooldowns(key_cooldowns, delta)
if isGameOver() then
if time_finish_allowed == 0 then
time_finish_allowed = love.timer.getTime() + 0.2
end
if love.keyboard.isDown("space") and love.timer.getTime() > time_finish_allowed then
running = false
end
return
end
if paused then return end
if isKeyPressed("q", key_cooldowns) then
-- BLUE
updateFormsOnCollision(grid[colorEnum.BLUE])
love.audio.newSource(sfx[sfxEnum.STAMP]):play()
setKeyCooldown("q", key_cooldowns, 0.2)
end
if isKeyPressed("w", key_cooldowns) then
-- RED
updateFormsOnCollision(grid[colorEnum.RED])
love.audio.newSource(sfx[sfxEnum.STAMP]):play()
setKeyCooldown("w", key_cooldowns, 0.2)
end
if isKeyPressed("e", key_cooldowns) then
-- GREEN
updateFormsOnCollision(grid[colorEnum.GREEN])
love.audio.newSource(sfx[sfxEnum.STAMP]):play()
setKeyCooldown("e", key_cooldowns, 0.2)
end
if isKeyPressed("r", key_cooldowns) then
-- ORANGE
updateFormsOnCollision(grid[colorEnum.ORANGE])
love.audio.newSource(sfx[sfxEnum.STAMP]):play()
setKeyCooldown("r", key_cooldowns, 0.2)
end
for i = 0, #grid do
for j = 1, #grid[i].forms do
grid[i].forms[j].y = grid[i].forms[j].y - form_speed * delta * ((rpg.difficulty() + 1) / 2)
end
end
next_form = next_form - love.timer.getDelta()
if next_form <= 0 then
local row = math.random(0, 3)
next_form = 0.2 + math.random()
table.insert(grid[row].forms, { y = 545, accepted = -1 })
end
for i = 0, #grid do
local stamp = grid[i]
for j = #stamp.forms, 1, -1 do
if stamp.forms[j].y + form_height < 0 then
if (stamp.forms[j].accepted == -1) then
stats.missed = stats.missed + 1
end
table.remove(stamp.forms, j)
end
end
end
end
function getWinCondition()
return stats.missed == 0 and stats.success == 5
end
function isRunning()
return running
end
function reset()
stats.success = 0
stats.missed = 0
running = true
beltValue = 0
grid[colorEnum.BLUE].forms = {}
grid[colorEnum.RED].forms = {}
grid[colorEnum.GREEN].forms = {}
grid[colorEnum.ORANGE].forms = {}
end
return {
draw = draw,
update = update,
load = load,
isRunning = isRunning,
reset = reset,
getWinCondition = getWinCondition
} |
return [[
{
"Lang": "fin",
"Name": "Suomi",
"Entities.gmod_subway_ezh3.Buttons.Stopkran.EmergencyBrakeValveToggle": "Hätäjarru",
"Entities.gmod_subway_ezh3.Buttons.Back.BackDoor": "Taka-ovi",
"Entities.gmod_subway_ezh3.Buttons.DriverValveBLTLDisconnect.DriverValveBLDisconnectToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_ezh3.Buttons.DriverValveBLTLDisconnect.DriverValveTLDisconnectToggle": "Junajohdon irroitusventtiili",
"Entities.gmod_subway_ezh3.Buttons.Battery.VBToggle": "VB: Akusto päälle/pois (matala voltti)",
"Entities.gmod_subway_ezh3.Buttons.FrontPneumatic.FrontBrakeLineIsolationToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_ezh3.Buttons.FrontPneumatic.FrontTrainLineIsolationToggle": "Junajarrun irroitusventtiili",
"Entities.gmod_subway_ezh3.Buttons.ASNP.R_ASNPMenuSet": "Kuuluttaja: Menu",
"Entities.gmod_subway_ezh3.Buttons.ASNP.R_ASNPUpSet": "Kuuluttaja: Ylös",
"Entities.gmod_subway_ezh3.Buttons.ASNP.R_ASNPDownSet": "Kuuluttaja: Alas",
"Entities.gmod_subway_ezh3.Buttons.ASNP.R_ASNPOnToggle": "Kuuluttaja: Käynnistä",
"Entities.gmod_subway_ezh3.Buttons.PassengerDoor1.PassengerDoor": "Matkustamon ovi",
"Entities.gmod_subway_ezh3.Buttons.PassengerDoor.PassengerDoor": "Matkustamon ovi",
"Entities.gmod_subway_ezh3.Buttons.CabinDoor.CabinDoor": "Ohjaamon ovi",
"Entities.gmod_subway_ezh3.Buttons.Front.FrontDoor": "Etu ovi",
"Entities.gmod_subway_ezh3.Buttons.GV.GVToggle": "HV kytkin",
"Entities.gmod_subway_ezh3.Buttons.RearPneumatic.RearTrainLineIsolationToggle": "Junajohdon irroitusventtiili",
"Entities.gmod_subway_ezh3.Buttons.RearPneumatic.RearBrakeLineIsolationToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_ezh3.Buttons.Panel.!OCH": "NCh: No ARS taajuutta",
"Entities.gmod_subway_ezh3.Buttons.Panel.!0": "0: ARS pysähtymis singaali",
"Entities.gmod_subway_ezh3.Buttons.Panel.!40": "Nopeusrajoitus 40 kph",
"Entities.gmod_subway_ezh3.Buttons.Panel.!60": "Nopeusrajoitus 60 kph",
"Entities.gmod_subway_ezh3.Buttons.Panel.!70": "Nopeusrajoitus 80 kph",
"Entities.gmod_subway_ezh3.Buttons.Panel.!80": "Nopuesrajoitus 60 kph",
"Entities.gmod_subway_ezh3.Buttons.Panel.!Speedometer": "Nopeusmittari (km/h)",
"Entities.gmod_subway_ezh3.Buttons.Panel.!TotalAmpermeter": "Moottoreiden totaalinen amppeerimäärä (A)",
"Entities.gmod_subway_ezh3.Buttons.Panel.!TotalVoltmeter": "Totaalinen volttimäärä (kV)",
"Entities.gmod_subway_ezh3.Buttons.Panel.!BatteryVoltage": "Akuston volttimäärä junan ohjauksessa(V)",
"Entities.gmod_subway_ezh3.Buttons.Panel.!BrakeCylinder": "Jarrusylintereiden paine",
"Entities.gmod_subway_ezh3.Buttons.Panel.!LinesPressure": "Paine paineilmajohdoissa (punainen: jarrujohto, musta: junajohto)",
"Entities.gmod_subway_ezh3.Buttons.Main.KU1Toggle": "Käynnistä moottorikompressori",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMM1Set": "SAMM: Sammuta ajomodi",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMM2Set": "SAMM: Käynnistys",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMM3Set": "SAMM: Resetointi",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMSignal1": "Lamppu: Veto-Jarrutus",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMSignal2": "Lamppu: Työ status SAMM",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMSignal3": "Lamppu: SAMMM toteutusyksikkö käytössä",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMOnToggle": "SAMM: Automaattiajo päälle",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMBlokToggle": "SAMM: Suoritusyksikkö",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMCommand3Set": "SAMM: X-2",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMCommand2Set": "SAMM: Saavuttaa",
"Entities.gmod_subway_ezh3.Buttons.Main.SAMMCommand1Set": "SAMM: Lupa",
"Entities.gmod_subway_ezh3.Buttons.Main.KSNSet": "KSN: Vian osoituspainike",
"Entities.gmod_subway_ezh3.Buttons.Main.R_Program1Set": "Ohjelma 1",
"Entities.gmod_subway_ezh3.Buttons.Main.R_Program2Set": "Ohjelma 2",
"Entities.gmod_subway_ezh3.Buttons.Main.VUSToggle": "Kytkin: Lähivalot(alhaalla)/Pitkätvalot(ylhäällä)",
"Entities.gmod_subway_ezh3.Buttons.Main.L_3Toggle": "Kytkin: Mittarien valaistus",
"Entities.gmod_subway_ezh3.Buttons.Main.VAHToggle": "Kytkin: Hätäkytkin",
"Entities.gmod_subway_ezh3.Buttons.Main.DIPonSet": "Osv. Vkl.: Valaistus päälle",
"Entities.gmod_subway_ezh3.Buttons.Main.DIPoffSet": "Osv. Vykl.: Valaistus pois päältä",
"Entities.gmod_subway_ezh3.Buttons.Main.KSDSet": "KSD: Ovien tarkastus",
"Entities.gmod_subway_ezh3.Buttons.Main.KVTSet": "KVT: jarrun havainnointipainike",
"Entities.gmod_subway_ezh3.Buttons.Main.KBSet": "KB:Huomio-painike",
"Entities.gmod_subway_ezh3.Buttons.Main.KBLamp": "Lamppu: RK kehruu",
"Entities.gmod_subway_ezh3.Buttons.Main.ARSToggle": "ARS: Nopeuden kulunvalvonta",
"Entities.gmod_subway_ezh3.Buttons.Main.R_UNchToggle": "UNCh: Alhainen taajuusvahvistin",
"Entities.gmod_subway_ezh3.Buttons.Main.VUD1Toggle": "VUD:Ovilukko (sulje ovet)",
"Entities.gmod_subway_ezh3.Buttons.Main.R_RadioToggle": "Radioinformator: Kuuluttaja (sisäänrakennettu)",
"Entities.gmod_subway_ezh3.Buttons.Main.ALSToggle": "ALS: Kulunvalvonta",
"Entities.gmod_subway_ezh3.Buttons.Main.VozvratRPSet": "KVRP: Ylikuormittuksen resetointi",
"Entities.gmod_subway_ezh3.Buttons.Main.RingSet": "Kello",
"Entities.gmod_subway_ezh3.Buttons.Main.L_2Toggle": "Kytkin: Ohjaamo valo",
"Entities.gmod_subway_ezh3.Buttons.Main.KRZDSet": "KRZD: Ovien hätäsulku",
"Entities.gmod_subway_ezh3.Buttons.Main.KDPSet": "KDP: Avaa oikeanpuoleiset ovet",
"Entities.gmod_subway_ezh3.Buttons.Main.KDLSet": "KDL: Vasemmanpuoleiset ovet auki",
"Entities.gmod_subway_ezh3.Buttons.Main.KAHSet": "KAH: Ajamisen hätäpainnike",
"Entities.gmod_subway_ezh3.Buttons.Main.RezMKSet": "Moottorikompressorin hätäkäynnistys",
"Entities.gmod_subway_ezh3.Buttons.Main.KRPSet": "KRP: Hätkäynnistyksen painike",
"Entities.gmod_subway_ezh3.Buttons.Main.RSTToggle": "VPR: Radioaseman aktivointi",
"Entities.gmod_subway_ezh3.Buttons.Main.R_GToggle": "Loudspeaker: Äänet ohjaamossa päälle",
"Entities.gmod_subway_ezh3.Buttons.Main.R_ZSToggle": "ZS: Äänet vaunuissa päälle",
"Entities.gmod_subway_ezh3.Buttons.Main.Custom2Set": "Käyttämätön kytkin",
"Entities.gmod_subway_ezh3.Buttons.Main.Custom3Set": "Käyttämätön kytkin",
"Entities.gmod_subway_ezh3.Buttons.Main.ASNPPlay": "Ilmoittajan työn ilmaisin",
"Entities.gmod_subway_ezh3.Buttons.AV1.VU3Toggle": "VU3: Ohjaamon valo",
"Entities.gmod_subway_ezh3.Buttons.AV1.VU2Toggle": "VU2: Hätävalaistus (45V)",
"Entities.gmod_subway_ezh3.Buttons.AV1.VU1Toggle": "VU1: Ohjaamon lämmitys (3kWt)",
"Entities.gmod_subway_ezh3.Buttons.AVMain.AV8BToggle": "AV-8B: Automaattinen kytkin(korkeajännite)",
"Entities.gmod_subway_ezh3.Buttons.RC1.RC1Toggle": "RC-ARS: ARS-katkaisija",
"Entities.gmod_subway_ezh3.Buttons.UAVAPanel.UAVAToggle": "UAVA: Automaattisen hätäjarrun disablointi (disablointi)",
"Entities.gmod_subway_ezh3.Buttons.UAVAPanel.UAVAContactSet": "UAVA: Automaattisen hätäjarrun disablointi(resetointi)",
"Entities.gmod_subway_ezh3.Buttons.VUHelper.VUToggle": "VU: Junaohjaus päälle",
"Entities.gmod_subway_ezh3.Buttons.HelperPanel.VDLSet": "KDL: Vasemmanpuoleiset ovet auki",
"Entities.gmod_subway_ezh3.Buttons.HelperPanel.VUD2Toggle": "VUD2: Ovilukon kytkin (ovet kiinni)",
"Entities.gmod_subway_ezh3.Buttons.EPKDisconnect.EPKToggle": "EPK irroita venttiili",
"Entities.gmod_subway_ezh3.Buttons.VU.VUToggle": "VU: Junaohjaus päälle",
"Entities.gmod_subway_ezh3.Buttons.ParkingBrake.ParkingBrakeLeft": "Käsijarrun pyörä",
"Entities.gmod_subway_ezh3.Buttons.ParkingBrake.ParkingBrakeRight": "Käsijarrun pyörä",
"Entities.gmod_subway_ezh3.Buttons.AirDistributor.AirDistributorDisconnectToggle": "Disabloi ilmansyöttö",
"Entities.gmod_subway_em508t.Buttons.Stopkran.EmergencyBrakeValveToggle": "Hätäjarru",
"Entities.gmod_subway_em508t.Buttons.Battery.VBToggle": "VB: Akusto päälle/pois (matala jännite)",
"Entities.gmod_subway_em508t.Buttons.FrontPneumatic.FrontBrakeLineIsolationToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_em508t.Buttons.FrontPneumatic.FrontTrainLineIsolationToggle": "Junajohdon irroitusventtiili",
"Entities.gmod_subway_em508t.Buttons.GV.GVToggle": "HV kytkin",
"Entities.gmod_subway_em508t.Buttons.RearPneumatic.RearTrainLineIsolationToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_em508t.Buttons.RearPneumatic.RearBrakeLineIsolationToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_em508t.Buttons.RearDoor.RearDoor": "Matkustamon ovi",
"Entities.gmod_subway_em508t.Buttons.Back2.!HVFuse": "HV sulakkeet estävät",
"Entities.gmod_subway_em508t.Buttons.Back2.!Relays": "Laatikko, jossa on akuston lataus ja ovien paineanturit",
"Entities.gmod_subway_em508t.Buttons.Back2.!Heater": "Lämmitys",
"Entities.gmod_subway_em508t.Buttons.Front.FrontDoor": "Etu-ovi",
"Entities.gmod_subway_em508t.Buttons.AV1.VU3Toggle": "VU3: Ohjaamon valo",
"Entities.gmod_subway_em508t.Buttons.AV1.VU2Toggle": "VU2: Hätävalaistus (45V)",
"Entities.gmod_subway_em508t.Buttons.AV1.VU1Toggle": "VU1: Ohjaamon lämmitys (3kWt)",
"Entities.gmod_subway_em508t.Buttons.ParkingBrake.ParkingBrakeLeft": "Käsijarrun pyörä",
"Entities.gmod_subway_em508t.Buttons.ParkingBrake.ParkingBrakeRight": "Käsijarrun pyörä",
"Entities.gmod_subway_em508t.Buttons.CabinDoor.CabinDoor1": "Ohjaamon ovi",
"Entities.gmod_subway_em508t.Buttons.PassengerDoor.PassengerDoor": "Matkustamon ovi",
"Entities.gmod_subway_em508t.Buttons.PassengerDoor1.PassengerDoor": "Matkustamon ovi",
"Entities.gmod_subway_em508t.Buttons.Main.!RedRP": "RP: Punainen ylikuormituksen relevalo (virtapiirit eivät onnistuneet kasaantumaan)",
"Entities.gmod_subway_em508t.Buttons.Main.!GreenRP": "RP: Vihreä ylikuormituksen valo (estää moottoreiden ylivirtauksen)",
"Entities.gmod_subway_em508t.Buttons.Main.!SD": "Sininen ovien tila valo (ovet ovat kiinni)",
"Entities.gmod_subway_em508t.Buttons.Main.KDLSet": "Kytkin: Avaa vasemmanpuoleiset ovet",
"Entities.gmod_subway_em508t.Buttons.Main.KSDSet": "Kytkin: Singaalisaatio (Ovien hallinan testaaminen)",
"Entities.gmod_subway_em508t.Buttons.Main.VozvratRPSet": "Kytkin: Ylikuormittumisen resetointi",
"Entities.gmod_subway_em508t.Buttons.Main.KSNSet": "Kytkin: Rikkinäisen vaunun havaitseminen",
"Entities.gmod_subway_em508t.Buttons.Main.VUD1Toggle": "Kytkin: Ovien hallinta (sulje ovet)",
"Entities.gmod_subway_em508t.Buttons.Main.KU1Toggle": "Kytkin: Kompressori päälle",
"Entities.gmod_subway_em508t.Buttons.Main.DIPonSet": "KU4: Matkustamovalot päälle",
"Entities.gmod_subway_em508t.Buttons.Main.DIPoffSet": "KU5: Matkustamovalot pois",
"Entities.gmod_subway_em508t.Buttons.Main.RezMKSet": "Kytkin: Moottorikompressorin hätäkäynnistäminen",
"Entities.gmod_subway_em508t.Buttons.Main.KDPSet": "KDP: Avaa oikeanpuoleiset ovet",
"Entities.gmod_subway_em508t.Buttons.Main.KRZDSet": "KU10: Ovien hätäsulku",
"Entities.gmod_subway_em508t.Buttons.AVMain.AV8BToggle": "AV-8B: Automaattikytkin (Korkeajännite)",
"Entities.gmod_subway_em508t.Buttons.VU.VUToggle": "VU: Aktivoi junaohjaus",
"Entities.gmod_subway_em508t.Buttons.VU.!Voltage": "Ohjauspiirien jännite",
"Entities.gmod_subway_em508t.Buttons.HelperPanel.VUD2Toggle": "VUD2: Ovilukko (sulje ovet)",
"Entities.gmod_subway_em508t.Buttons.HelperPanel.VDLSet": "VDL: Avaa vasemmanpuoleiset ovet",
"Entities.gmod_subway_em508t.Buttons.DriverValveBLTLDisconnect.DriverValveBLDisconnectToggle": "Jarrujohdon irroitusventtiili",
"Entities.gmod_subway_em508t.Buttons.DriverValveBLTLDisconnect.DriverValveTLDisconnectToggle": "Junajohdon irroitusventtiili",
"Entities.gmod_subway_em508t.Buttons.AirDistributor.AirDistributorDisconnectToggle": "Disabloi ilmansyöttö"
}
]]
|
local emmyFunction = require 'core.hover.emmy_function'
local function buildValueArgs(func, object, select)
if not func then
return '', nil
end
local names = {}
local values = {}
local options = {}
if func.argValues then
for i, value in ipairs(func.argValues) do
values[i] = value:getType()
end
end
if func.args then
for i, arg in ipairs(func.args) do
names[#names+1] = arg:getName()
local param = func:findEmmyParamByName(arg:getName())
if param then
values[i] = param:getType()
options[i] = param:getOption()
end
end
end
local strs = {}
local start = 1
if object then
start = 2
end
local max
if func:getSource() then
max = #names
else
max = math.max(#names, #values)
end
local args = {}
for i = start, max do
local name = names[i]
local value = values[i] or 'any'
local option = options[i]
if option and option.optional then
if i > start then
strs[#strs+1] = ' ['
else
strs[#strs+1] = '['
end
end
if i > start then
strs[#strs+1] = ', '
end
if i == select then
strs[#strs+1] = '@ARG'
end
if name then
strs[#strs+1] = name .. ': ' .. value
else
strs[#strs+1] = value
end
args[#args+1] = strs[#strs]
if i == select then
strs[#strs+1] = '@ARG'
end
if option and option.optional == 'self' then
strs[#strs+1] = ']'
end
end
if func:hasDots() then
if max > 0 then
strs[#strs+1] = ', '
end
strs[#strs+1] = '...'
end
if options then
for _, option in pairs(options) do
if option.optional == 'after' then
strs[#strs+1] = ']'
end
end
end
local text = table.concat(strs)
local argLabel = {}
for i = 1, 2 do
local pos = text:find('@ARG', 1, true)
if pos then
if i == 1 then
argLabel[i] = pos
else
argLabel[i] = pos - 1
end
text = text:sub(1, pos-1) .. text:sub(pos+4)
end
end
if #argLabel == 0 then
argLabel = nil
end
return text, argLabel, args
end
local function buildValueReturns(func)
if not func then
return '\n -> any'
end
if not func:get 'hasReturn' then
return ''
end
local strs = {}
local emmys = {}
local n = 0
func:eachEmmyReturn(function (emmy)
n = n + 1
emmys[n] = emmy
end)
if func.returns then
for i, rtn in ipairs(func.returns) do
local emmy = emmys[i]
local option = emmy and emmy.option
if option and option.optional then
if i > 1 then
strs[#strs+1] = ' ['
else
strs[#strs+1] = '['
end
end
if i > 1 then
strs[#strs+1] = ('\n% 3d. '):format(i)
end
if emmy and emmy.name then
strs[#strs+1] = ('%s: '):format(emmy.name)
elseif option and option.name then
strs[#strs+1] = ('%s: '):format(option.name)
end
strs[#strs+1] = rtn:getType()
if option and option.optional == 'self' then
strs[#strs+1] = ']'
end
end
for i = 1, #func.returns do
local emmy = emmys[i]
if emmy and emmy.option and emmy.option.optional == 'after' then
strs[#strs+1] = ']'
end
end
end
if #strs == 0 then
strs[1] = 'any'
end
return '\n -> ' .. table.concat(strs)
end
---@param func emmyFunction
local function buildEnum(func)
if not func then
return nil
end
local params = func:getEmmyParams()
if not params then
return nil
end
local strs = {}
local raw = {}
for _, param in ipairs(params) do
local first = true
local name = param:getName()
raw[name] = {}
param:eachEnum(function (enum)
if first then
first = false
strs[#strs+1] = ('\n%s: %s'):format(param:getName(), param:getType())
end
if enum.default then
strs[#strs+1] = ('\n |>%s'):format(enum[1])
else
strs[#strs+1] = ('\n | %s'):format(enum[1])
end
if enum.comment then
strs[#strs+1] = ' -- ' .. enum.comment
end
raw[name][#raw[name]+1] = enum[1]
end)
end
if #strs == 0 then
return nil
end
return table.concat(strs), raw
end
local function getComment(func)
if not func then
return nil
end
local comments = {}
local params = func:getEmmyParams()
if params then
for _, param in ipairs(params) do
local option = param:getOption()
if option and option.comment then
comments[#comments+1] = ('+ `%s`*(%s)*: %s'):format(param:getName(), param:getType(), option.comment)
end
end
end
comments[#comments+1] = func:getComment()
if #comments == 0 then
return nil
end
return table.concat(comments, '\n\n')
end
local function getOverLoads(name, func, object, select)
local overloads = func and func:getEmmyOverLoads()
if not overloads then
return nil
end
local list = {}
for _, ol in ipairs(overloads) do
local hover = emmyFunction(name, ol, object, select)
list[#list+1] = hover.label
end
return table.concat(list, '\n')
end
return function (name, func, object, select)
local argStr, argLabel, args = buildValueArgs(func, object, select)
local returns = buildValueReturns(func)
local enum, rawEnum = buildEnum(func)
local comment = getComment(func)
local overloads = getOverLoads(name, func, object, select)
return {
label = ('function %s(%s)%s'):format(name, argStr, returns),
name = name,
argStr = argStr,
returns = returns,
description = comment,
enum = enum,
rawEnum = rawEnum,
argLabel = argLabel,
overloads = overloads,
args = args,
}
end
|
Shape = {area = 0}--定义变量
function Shape:new(side)
local o ={}--定义私有表
setmetatable(o, self)--定义元表
self.__index = self--持有元表
side = side or 0--判断变量是否为0
self.area = side * side--赋值
return o
end
function Shape:printArea()
print("面积为", self.area)
end
-- 创建对象
local myshape=Shape:new(20)
myshape:printArea()
Square=Shape:new()
-- 派生类方法 new
function Square:new(side)
local o=Shape:new(side)
setmetatable(o,self)
self.__index=self
return o
end
-- 派生类方法 printArea
function Square:printArea()
print("正方形面积为",self.area)
end
-- 创建对象
local mysquare=Square:new(30)
mysquare:printArea()
Rectangle=Shape:new()
-- 派生类方法 new
function Rectangle:new(high,width)
local o=Shape:new(high)
setmetatable(o,self)
self.__index=self
high=high or 0
width=width or 0
self.area=high*width
return o
end
-- 派生类方法 printArea
function Rectangle:printArea()
print("长方形面积为",self.area)
end
-- 创建对象
local myRect=Rectangle:new(30,40)
myRect:printArea()
|
local M = {}
function M.cloneTableByValue(obj, seen)
if type(obj) ~= 'table' then
return obj
end
if seen and seen[obj] then
return seen[obj]
end
local localSeen = seen or {}
local resultingTable = setmetatable({}, getmetatable(obj))
localSeen[obj] = resultingTable
for key, value in pairs(obj) do
resultingTable[M.cloneTableByValue(key, localSeen)] = M.cloneTableByValue(value, localSeen)
end
return resultingTable
end
function M.mergeTables(table1, table2)
local resultingTable = M.cloneTableByValue(table1)
for key, value in pairs(table2) do
if (type(value) == 'table') and (type(resultingTable[key] or false) == 'table') then
M.mergeTables(resultingTable[key], table2[key])
else
resultingTable[key] = value
end
end
return resultingTable
end
return M
|
local mod = get_mod("ExecLua")
local mod_data = {
name = "Execute Lua Ingame",
description = mod:localize("mod_description"),
is_togglable = true,
allow_rehooking = true,
}
mod_data.options = {}
return mod_data
|
data:extend({
{
type = "font",
name = "upgrade-planner2-small-font",
from = "default",
size = 14
}
})
data.raw["gui-style"].default["upgrade-planner2-small-button"] = {
type = "button_style",
parent = "button",
font = "upgrade-planner2-small-font"
}
data.raw["gui-style"].default["upgrade-planner2-menu-button"] = {
type = "button_style",
parent = "button",
font = "upgrade-planner2-small-font"
}
|
-- << Services >> --
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local CAS = game:GetService("ContextActionService")
-- << Constants >> --
local CLIENT = script.Parent.Parent
local MODULES = CLIENT.Parent:WaitForChild("Modules")
local PLAYER = Players.LocalPlayer
local GUI = PLAYER:WaitForChild("PlayerGui")
-- << Modules >> --
local PlatformButtons = require(MODULES.PlatformButtons)
local DataValues = require(CLIENT.DataValues)
local FS = require(ReplicatedStorage.Scripts.Modules.FastSpawn)
return function(Buttons, TxtMessage, Timer)
FS.spawn(function()
local TempLabel;
if Buttons then
if DataValues.ControllerType == "Keyboard" then
TempLabel = PlatformButtons:GetImageLabel(Buttons.Keyboard, "Light", "PC")
elseif DataValues.ControllerType == "Controller" then
TempLabel = PlatformButtons:GetImageLabel(Buttons.Controller, "Light", "XboxOne")
elseif DataValues.ControllerType == "Touch" and Buttons.Touch then
local button = CAS:GetButton(Buttons.Touch)
if button then
TempLabel = button:Clone()
end
end
if TempLabel then
TempLabel.Active = false
TempLabel.Visible = true
TempLabel.Position = UDim2.new(0,0,0,0)
TempLabel.Size = UDim2.new(1,0,1,0)
TempLabel.Name = "ImageLabel"
TempLabel.ImageTransparency = 1
TempLabel.Parent = GUI.Notification.TutorialFrame.IconFrame
TweenService:Create(TempLabel, TweenInfo.new(.5), {ImageTransparency = 0}):Play()
end
end
GUI.Notification.TutorialFrame.TextLabel.Text = TxtMessage
TweenService:Create(GUI.Notification.TutorialFrame.TextLabel, TweenInfo.new(.5), {TextTransparency = 0, TextStrokeTransparency = 0}):Play()
wait(Timer and Timer or 10)
if Buttons and TempLabel then
TweenService:Create(TempLabel, TweenInfo.new(.5), {ImageTransparency = 1}):Play()
end
TweenService:Create(GUI.Notification.TutorialFrame.TextLabel, TweenInfo.new(.5), {TextTransparency = 1, TextStrokeTransparency = 1}):Play()
wait(.5)
GUI.Notification.TutorialFrame.IconFrame:ClearAllChildren()
end)
end
|
local M = {}
_NgConfigValues = {
debug = false, -- log output not implemented
width = 0.6, -- valeu of cols TODO allow float e.g. 0.6
preview_height = 0.35,
height = 0.35,
default_mapping = true,
keymaps = {}, -- e.g keymaps={{key = "GR", func = "references()"}, } this replace gr default mapping
combined_attach = "both", -- both: use both customized attach and navigator default attach, mine: only use my attach defined in vimrc
on_attach = nil,
-- function(client, bufnr)
-- -- your on_attach will be called at end of navigator on_attach
-- end,
code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true},
treesitter_analysis = true, -- treesitter variable context
lsp = {
format_on_save = true, -- set to false to disasble lsp code format on save (if you are using prettier/efm/formater etc)
tsserver = {
-- filetypes = {'typescript'} -- disable javascript etc,
-- set to {} to disable the lspclient for all filetype
},
sumneko_lua = {
-- sumneko_root_path = sumneko_root_path,
-- sumneko_binary = sumneko_binary,
-- cmd = {'lua-language-server'}
}
},
icons = {
-- Code action
code_action_icon = " ",
-- Diagnostics
diagnostic_head = '🐛',
diagnostic_head_severity_1 = "🈲",
diagnostic_head_severity_2 = "☣️",
diagnostic_head_severity_3 = "👎",
diagnostic_head_description = "📛",
diagnostic_virtual_text = "🦊",
diagnostic_file = "🚑",
-- Values
value_changed = "📝",
value_definition = "🦕",
-- Treesitter
match_kinds = {
var = " ", -- "👹", -- Vampaire
method = "ƒ ", -- "🍔", -- mac
["function"] = " ", -- "🤣", -- Fun
parameter = " ", -- Pi
associated = "🤝",
namespace = "🚀",
type = " ",
field = "🏈"
},
treesitter_defult = "🌲"
}
}
vim.cmd("command! -nargs=0 LspLog lua require'navigator.lspclient.config'.open_lsp_log()")
vim.cmd("command! -nargs=0 LspRestart lua require'navigator.lspclient.config'.reload_lsp()")
vim.cmd(
"command! -nargs=0 LspToggleFmt lua require'navigator.lspclient.mapping'.toggle_lspformat()<CR>")
local extend_config = function(opts)
opts = opts or {}
if next(opts) == nil then
return
end
for key, value in pairs(opts) do
-- if _NgConfigValues[key] == nil then
-- error(string.format("[] Key %s not valid", key))
-- return
-- end
if type(_NgConfigValues[key]) == "table" then
for k, v in pairs(value) do
_NgConfigValues[key][k] = v
end
else
_NgConfigValues[key] = value
end
end
if _NgConfigValues.sumneko_root_path or _NgConfigValues.sumneko_binary then
vim.notify("Please put sumneko setup in lsp['sumneko_lua']", vim.log.levels.WARN)
end
end
M.config_values = function()
return _NgConfigValues
end
M.setup = function(cfg)
extend_config(cfg)
-- local log = require"navigator.util".log
-- log(debug.traceback())
-- log(cfg, _NgConfigValues)
-- print("loading navigator")
require('navigator.lspclient.clients').setup(_NgConfigValues)
require("navigator.lspclient.mapping").setup(_NgConfigValues)
require("navigator.reference")
require("navigator.definition")
require("navigator.hierarchy")
require("navigator.implementation")
-- log("navigator loader")
if _NgConfigValues.code_action_prompt.enable then
vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'navigator.codeAction'.code_action_prompt()]]
end
-- vim.cmd("autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4")
if not _NgConfigValues.loaded then
vim.cmd([[autocmd FileType * lua require'navigator.lspclient.clients'.setup()]]) -- BufWinEnter BufNewFile,BufRead ?
_NgConfigValues.loaded = true
end
end
return M
|
local uv = require('luv')
local server = uv.new_tcp()
server:bind("127.0.0.1", 1337)
server:listen(128, function (err)
assert(not err, err)
local client = uv.new_tcp()
server:accept(client)
client:read_start(function (err, chunk)
assert(not err, err)
if chunk then
client:write(chunk)
else
client:shutdown()
client:close()
end
end)
end)
uv.run('default')
|
return
{
["#t1 需要达到#cff0000%d#cffffff级再来。"] = "G公用反馈配置表.反馈正文",
["#t2%d次之后必出紫色佣兵"] = "G公用反馈配置表.反馈正文",
["#t2%d次之后必出紫色碎片"] = "G公用反馈配置表.反馈正文",
["VIP%d可继续刷新"] = "G公用反馈配置表.反馈正文",
["VIP等级不足"] = "G公用反馈配置表.反馈正文",
["一闪"] = "C产品表.名称",
["一闪·血怒"] = "C产品表.名称",
["一阶血技书"] = "C产品表.名称",
["不可使用"] = "G公用反馈配置表.反馈正文",
["不可升级,请先突破"] = "G公用反馈配置表.反馈正文",
["不可卸下"] = "G公用反馈配置表.反馈正文",
["不可突破,请先升级"] = "G公用反馈配置表.反馈正文",
["不可装备"] = "G公用反馈配置表.反馈正文",
["不可重生"] = "G公用反馈配置表.反馈正文",
["不满足使用条件"] = "G公用反馈配置表.反馈正文",
["不能获取已有相同的物品"] = "G公用反馈配置表.反馈正文",
["事件触发器"] = "C触发器配置表.名称",
["二阶血技书"] = "C产品表.名称",
["任务不可接受"] = "G公用反馈配置表.反馈正文",
["任务不可提交"] = "G公用反馈配置表.反馈正文",
["任务不存在"] = "G公用反馈配置表.反馈正文",
["任务未完成或奖励已领取"] = "G公用反馈配置表.反馈正文",
["位移"] = "C触发器配置表.名称",
["体力药剂"] = "C产品表.名称",
["你今天参与了%d场战斗"] = "G公用反馈配置表.反馈正文",
["你本周赢了%d场战斗"] = "G公用反馈配置表.反馈正文",
["佣兵不存在"] = "G公用反馈配置表.反馈正文",
["佣兵不需要复活"] = "G公用反馈配置表.反馈正文",
["佣兵升星已达上限"] = "G公用反馈配置表.反馈正文",
["佣兵达到%d级时即可开启"] = "G公用反馈配置表.反馈正文",
["关卡不存在"] = "G公用反馈配置表.反馈正文",
["关卡不开放"] = "G公用反馈配置表.反馈正文",
["关卡当日次数已达到上限"] = "G公用反馈配置表.反馈正文",
["关联天赋未满级"] = "G公用反馈配置表.反馈正文",
["出售失败"] = "G公用反馈配置表.反馈正文",
["出售成功"] = "G公用反馈配置表.反馈正文",
["出售数量错误"] = "G公用反馈配置表.反馈正文",
["刃·风车"] = "C产品表.名称",
["创建多个触发器"] = "C触发器配置表.名称",
["刷新次数不足"] = "G公用反馈配置表.反馈正文",
["前置原力未激活"] = "G公用反馈配置表.反馈正文",
["剑舞·噬灵"] = "C产品表.名称",
["剧情触发器"] = "C触发器配置表.名称",
["力·斩空"] = "C产品表.名称",
["加Buff触发器"] = "C触发器配置表.名称",
["劣质子弹匣"] = "C产品表.名称",
["劣质子弹匣(专)"] = "C产品表.名称",
["劣质子弹匣(冲锋)"] = "C产品表.名称",
["劣质子弹匣(重炮)"] = "C产品表.名称",
["劫·剑舞"] = "C产品表.名称",
["升星精炼石不足"] = "G公用反馈配置表.反馈正文",
["原石碎片不足"] = "G公用反馈配置表.反馈正文",
["只有将武器进化为魂系列,才可解锁此槽"] = "G公用反馈配置表.反馈正文",
["同名装备不足"] = "G公用反馈配置表.反馈正文",
["同名装备碎片不足"] = "G公用反馈配置表.反馈正文",
["品质不符合"] = "G公用反馈配置表.反馈正文",
["唤灵钥匙"] = "C产品表.名称",
["商店未开启"] = "G公用反馈配置表.反馈正文",
["喂养零件状态错误"] = "G公用反馈配置表.反馈正文",
["喂养零件类型错误"] = "G公用反馈配置表.反馈正文",
["嗜·剑舞"] = "C产品表.名称",
["嗜血·狼牙"] = "C产品表.名称",
["回复生命1000点"] = "C产品表.描述",
["场景跳转触发器"] = "C触发器配置表.名称",
["大晶体"] = "C产品表.名称",
["大石块"] = "C产品表.名称",
["大量金币"] = "C产品表.描述",
["天命石不足"] = "G公用反馈配置表.反馈正文",
["天赋不存在"] = "G公用反馈配置表.反馈正文",
["天赋已满级"] = "G公用反馈配置表.反馈正文",
["失去物品%s X%s"] = "G公用反馈配置表.反馈正文",
["失败"] = "G公用反馈配置表.反馈正文",
["完成次数已达上限"] = "G公用反馈配置表.反馈正文",
["定时放行阻挡"] = "C触发器配置表.名称",
["宝石个数不足"] = "G公用反馈配置表.反馈正文",
["宝石未卸载"] = "G公用反馈配置表.反馈正文",
["宝石槽未解锁"] = "G公用反馈配置表.反馈正文",
["宝石状态错误"] = "G公用反馈配置表.反馈正文",
["宝石类型不符合"] = "G公用反馈配置表.反馈正文",
["宝石类型错误"] = "G公用反馈配置表.反馈正文",
["宝箱购买次数达到上限"] = "G公用反馈配置表.反馈正文",
["寒·斩月"] = "C产品表.名称",
["封印孔未解锁,需要神机#c33ff33#b达到%s阶#n才可解除该封印孔"] = "G公用反馈配置表.反馈正文",
["小晶体"] = "C产品表.名称",
["小石块"] = "C产品表.名称",
["巢穴不存在"] = "G公用反馈配置表.反馈正文",
["巢穴体力不足"] = "G公用反馈配置表.反馈正文",
["已经使用"] = "G公用反馈配置表.反馈正文",
["已经精炼到最高级"] = "G公用反馈配置表.反馈正文",
["已经领取奖励"] = "G公用反馈配置表.反馈正文",
["已达到当前等级上限,请先提升武器等级"] = "G公用反馈配置表.反馈正文",
["已达到当前等级强化上限,请先提升角色等级哦!"] = "G公用反馈配置表.反馈正文",
["已达到等级上限"] = "G公用反馈配置表.反馈正文",
["延时播放背景音乐"] = "C触发器配置表.名称",
["延时播放音效"] = "C触发器配置表.名称",
["延时放狗"] = "C触发器配置表.名称",
["弑空·断水"] = "C产品表.名称",
["强·升龙"] = "C产品表.名称",
["强·狼牙"] = "C产品表.名称",
["强·瞬斩"] = "C产品表.名称",
["强·胧月"] = "C产品表.名称",
["强·落雁"] = "C产品表.名称",
["强化已达到最高级"] = "G公用反馈配置表.反馈正文",
["强化风火轮"] = "C产品表.名称",
["当前强化到最高级"] = "G公用反馈配置表.反馈正文",
["当前星级已到最大级"] = "G公用反馈配置表.反馈正文",
["微微发光,能卖较多金币。"] = "C产品表.描述",
["怪物巢穴出现"] = "G公用反馈配置表.反馈正文",
["怪物巢穴未开放"] = "G公用反馈配置表.反馈正文",
["怪物晕倒播放剧情"] = "C触发器配置表.名称",
["怪物死亡停止背景音乐"] = "C触发器配置表.名称",
["怪物死亡停止音效"] = "C触发器配置表.名称",
["怪物死亡创建触发器"] = "C触发器配置表.名称",
["怪物死亡播放背景音乐"] = "C触发器配置表.名称",
["怪物死亡放狗"] = "C触发器配置表.名称",
["怪物组死亡瞬移"] = "C触发器配置表.名称",
["怪物血量为0播放剧情"] = "C触发器配置表.名称",
["怪物血量为0放行阻挡"] = "C触发器配置表.名称",
["怪物身边创建多触发器"] = "C触发器配置表.名称",
["怪物进入触发器"] = "C触发器配置表.名称",
["恒·胧月"] = "C产品表.名称",
["悬赏任务开启"] = "G公用反馈配置表.反馈正文",
["成功"] = "G公用反馈配置表.反馈正文",
["所需物品不足"] = "G公用反馈配置表.反馈正文",
["所需货币不足"] = "G公用反馈配置表.反馈正文",
["打开关卡主界面"] = "C触发器配置表.名称",
["打开必定获得适用于自身的劣质子弹,较低概率获得普通品质的子弹。"] = "C产品表.描述",
["打开必定获得适用于自身的普通品质子弹,较低概率获得稀有品质的子弹。"] = "C产品表.描述",
["打开必定获得适用于自身的极品品质子弹,较低概率获得两颗极品。"] = "C产品表.描述",
["打开必定获得适用于自身的稀有品质子弹,较低概率获得极品品质的子弹。"] = "C产品表.描述",
["打开获得4件战甲"] = "C产品表.描述",
["打开获得劣质的冲锋枪子弹,较低概率获得普通品质的冲锋枪子弹。"] = "C产品表.描述",
["打开获得劣质的子弹,低概率获得普通品质的子弹。"] = "C产品表.描述",
["打开获得劣质的重炮子弹,较低概率获得普通品质的重炮子弹。"] = "C产品表.描述",
["打开获得普通品质的冲锋枪子弹,较低概率获得稀有品质的冲锋枪子弹。"] = "C产品表.描述",
["打开获得普通品质的子弹,较低概率获得稀有品质的子弹。"] = "C产品表.描述",
["打开获得普通品质的重炮子弹,较低概率获得稀有品质的重炮子弹。"] = "C产品表.描述",
["打开获得稀有品质的冲锋枪子弹,极低概率获得极品品质的冲锋枪子弹。"] = "C产品表.描述",
["打开获得稀有品质的重炮子弹,极低概率获得极品品质的重炮子弹。"] = "C产品表.描述",
["打开转盘"] = "C触发器配置表.名称",
["打开随机获得1个橙色振幅晶体。"] = "C产品表.描述",
["打开随机获得1个紫色振幅晶体。"] = "C产品表.描述",
["打开随机获得1个绿品振幅晶体。"] = "C产品表.描述",
["打开随机获得1个绿色振幅晶体。"] = "C产品表.描述",
["打开随机获得1个蓝色振幅晶体。"] = "C产品表.描述",
["扣除体力%s"] = "G公用反馈配置表.反馈正文",
["扣除装备抽积分%s"] = "G公用反馈配置表.反馈正文",
["扣除金币%s"] = "G公用反馈配置表.反馈正文",
["扣除钻石%s"] = "G公用反馈配置表.反馈正文",
["技能不存在"] = "G公用反馈配置表.反馈正文",
["技能升级条件不满足"] = "G公用反馈配置表.反馈正文",
["技能已提升到最高级"] = "G公用反馈配置表.反馈正文",
["技能未解锁"] = "G公用反馈配置表.反馈正文",
["技能点不足"] = "G公用反馈配置表.反馈正文",
["技能点已达上限"] = "G公用反馈配置表.反馈正文",
["拔刀·破空"] = "C产品表.名称",
["挂机玩法结束处理"] = "C触发器配置表.名称",
["振幅晶体(橙)"] = "C产品表.名称",
["振幅晶体(紫)"] = "C产品表.名称",
["振幅晶体(绿)"] = "C产品表.名称",
["振幅晶体(蓝)"] = "C产品表.名称",
["攻击BUFF触发器"] = "C触发器配置表.名称",
["放狗触发器"] = "C触发器配置表.名称",
["放狗触发器-流沙"] = "C触发器配置表.名称",
["数量不足"] = "G公用反馈配置表.反馈正文",
["斩月·逆乱"] = "C产品表.名称",
["斩空·炎爆"] = "C产品表.名称",
["无效请求"] = "G公用反馈配置表.反馈正文",
["无法重复购买"] = "G公用反馈配置表.反馈正文",
["无法重复领取该任务"] = "G公用反馈配置表.反馈正文",
["星数不足"] = "G公用反馈配置表.反馈正文",
["普通子弹匣"] = "C产品表.名称",
["普通子弹匣(专)"] = "C产品表.名称",
["普通子弹匣(冲锋枪)"] = "C产品表.名称",
["普通子弹匣(重炮)"] = "C产品表.名称",
["普通振幅晶体包"] = "C产品表.名称",
["晶钻"] = "C产品表.名称",
["暴·弑空"] = "C产品表.名称",
["服用可恢复体力60点"] = "C产品表.描述",
["本日刷新次数已达上限"] = "G公用反馈配置表.反馈正文",
["材料不足"] = "G公用反馈配置表.反馈正文",
["条件不满足"] = "G公用反馈配置表.反馈正文",
["条件不足"] = "G公用反馈配置表.反馈正文",
["极·胧月"] = "C产品表.名称",
["极品子弹匣"] = "C产品表.名称",
["极品子弹匣(专)"] = "C产品表.名称",
["极品振幅晶体包"] = "C产品表.名称",
["极高概率获得极品的子弹,低概率获得两颗稀有子弹,极低概率获得三颗稀有子弹"] = "C产品表.描述",
["次数不足"] = "G公用反馈配置表.反馈正文",
["武器已经是最高阶"] = "G公用反馈配置表.反馈正文",
["武器技已经是最大等级"] = "G公用反馈配置表.反馈正文",
["武器技等级超过当前阶数"] = "G公用反馈配置表.反馈正文",
["武器进阶到%s阶即可解锁该晶体槽"] = "G公用反馈配置表.反馈正文",
["没有相关的配置"] = "G公用反馈配置表.反馈正文",
["没有该商品"] = "G公用反馈配置表.反馈正文",
["没有该礼包"] = "G公用反馈配置表.反馈正文",
["洗练后的#c33ff33新属性#n评分比#cff3333旧属性#n高,是否确定不保存?"] = "G公用反馈配置表.反馈正文",
["洗练后的#cff3333新属性#n比#c33ff33旧属性#n评分更低,是否确认要保存新属性?"] = "G公用反馈配置表.反馈正文",
["洗练附加属性未处理,是否#cff3333确定退出?#n退出后将保存#c33ff33原属性!#n"] = "G公用反馈配置表.反馈正文",
["激光镌刻笔"] = "C产品表.名称",
["激光镌刻笔,可在基因上镌刻出你想说的一句话。"] = "C产品表.描述",
["激活黑血技·强化风火轮的必需品"] = "C产品表.描述",
["激活黑血技·轮舞·尾斩的必需品"] = "C产品表.描述",
["炎·风车"] = "C产品表.名称",
["点击右上角的返回按钮,完成前置任务!"] = "G公用反馈配置表.反馈正文",
["爆·斩月"] = "C产品表.名称",
["物品不存在"] = "G公用反馈配置表.反馈正文",
["物品使用失败"] = "G公用反馈配置表.反馈正文",
["物品使用成功"] = "G公用反馈配置表.反馈正文",
["物品删除失败"] = "G公用反馈配置表.反馈正文",
["物品删除成功"] = "G公用反馈配置表.反馈正文",
["物品已损坏"] = "G公用反馈配置表.反馈正文",
["物品扣除失败"] = "G公用反馈配置表.反馈正文",
["物品管理器不存在"] = "G公用反馈配置表.反馈正文",
["物品类型不符合"] = "G公用反馈配置表.反馈正文",
["狂怒·升龙"] = "C产品表.名称",
["狼牙·旭日"] = "C产品表.名称",
["玩家等级达到%d级,才可继续升级此招式。"] = "G公用反馈配置表.反馈正文",
["生命BUFF触发器"] = "C触发器配置表.名称",
["生命之泉"] = "C产品表.名称",
["用星辰之力激活宝箱,唤醒隐藏的稀有道具。免费获取一次装备宝箱的购买机会。"] = "C产品表.描述",
["用来激活一阶血技"] = "C产品表.描述",
["用来激活三阶血技一闪"] = "C产品表.描述",
["用来激活三阶血技力·斩空"] = "C产品表.描述",
["用来激活三阶血技劫·剑舞"] = "C产品表.描述",
["用来激活三阶血技强·升龙"] = "C产品表.描述",
["用来激活三阶血技强·狼牙"] = "C产品表.描述",
["用来激活三阶血技强·胧月"] = "C产品表.描述",
["用来激活三阶血技强·落雁"] = "C产品表.描述",
["用来激活三阶血技疾·剑舞"] = "C产品表.描述",
["用来激活三阶血技真·斩月"] = "C产品表.描述",
["用来激活三阶血技瞬斩"] = "C产品表.描述",
["用来激活三阶血技破·胧月"] = "C产品表.描述",
["用来激活三阶血技精·弑空"] = "C产品表.描述",
["用来激活三阶血技蓄力斩"] = "C产品表.描述",
["用来激活三阶血技追·尾斩"] = "C产品表.描述",
["用来激活三阶血技霸·突刺"] = "C产品表.描述",
["用来激活二阶血技"] = "C产品表.描述",
["用来激活四阶血技嗜·剑舞"] = "C产品表.描述",
["用来激活四阶血技嗜血·狼牙"] = "C产品表.描述",
["用来激活四阶血技寒·斩月"] = "C产品表.描述",
["用来激活四阶血技强·瞬斩"] = "C产品表.描述",
["用来激活四阶血技恒·胧月"] = "C产品表.描述",
["用来激活四阶血技暴·弑空"] = "C产品表.描述",
["用来激活四阶血技极·胧月"] = "C产品表.描述",
["用来激活四阶血技炎·风车"] = "C产品表.描述",
["用来激活四阶血技爆·斩月"] = "C产品表.描述",
["用来激活四阶血技狂怒·升龙"] = "C产品表.描述",
["用来激活四阶血技疾·突刺"] = "C产品表.描述",
["用来激活四阶血技破·落雁"] = "C产品表.描述",
["用来激活四阶血技破军·升龙"] = "C产品表.描述",
["用来激活四阶血技群·蓄力斩"] = "C产品表.描述",
["用来激活四阶血技裂·一闪"] = "C产品表.描述",
["用来激活四阶血技追命·斩空"] = "C产品表.描述",
["用来激活四阶血技逸风·剑舞"] = "C产品表.描述",
["用来激活四阶血技闪·蓄力斩"] = "C产品表.描述",
["用来激活四阶血技雷·翻斩"] = "C产品表.描述",
["用来激活四阶血技飞狐·尾斩"] = "C产品表.描述",
["用来激活黑血技一闪·血怒"] = "C产品表.描述",
["用来激活黑血技剑舞·噬灵"] = "C产品表.描述",
["用来激活黑血技弑空·断水"] = "C产品表.描述",
["用来激活黑血技拔刀·破空"] = "C产品表.描述",
["用来激活黑血技斩月·逆乱"] = "C产品表.描述",
["用来激活黑血技斩空·炎爆"] = "C产品表.描述",
["用来激活黑血技狼牙·旭日"] = "C产品表.描述",
["用来激活黑血技突刺·无影"] = "C产品表.描述",
["用来激活黑血技翻斩·奔雷"] = "C产品表.描述",
["用来激活黑血技胧月·吸虹"] = "C产品表.描述",
["用来激活黑血技落雁·火山"] = "C产品表.描述",
["疾·剑舞"] = "C产品表.名称",
["疾·突刺"] = "C产品表.名称",
["目标物品锁定中"] = "G公用反馈配置表.反馈正文",
["相同宝石不能替换"] = "G公用反馈配置表.反馈正文",
["真·斩月"] = "C产品表.名称",
["瞬斩"] = "C产品表.名称",
["破·胧月"] = "C产品表.名称",
["破·落雁"] = "C产品表.名称",
["破军·升龙"] = "C产品表.名称",
["碎片不足"] = "G公用反馈配置表.反馈正文",
["神机个数不足"] = "G公用反馈配置表.反馈正文",
["神机无法合成"] = "G公用反馈配置表.反馈正文",
["神机配件的类型不同,无法一起合成"] = "G公用反馈配置表.反馈正文",
["积分不足"] = "G公用反馈配置表.反馈正文",
["稀有子弹匣"] = "C产品表.名称",
["稀有子弹匣(专)"] = "C产品表.名称",
["稀有子弹匣(冲锋枪)"] = "C产品表.名称",
["稀有子弹匣(重炮)"] = "C产品表.名称",
["稀有振幅晶体包"] = "C产品表.名称",
["穿戴四件战甲即可激活"] = "G公用反馈配置表.反馈正文",
["穿戴四件蓝色品质以上的战甲即可激活"] = "G公用反馈配置表.反馈正文",
["穿戴的圣物需要紫色品质或以上才可开启"] = "G公用反馈配置表.反馈正文",
["穿齐两件圣物即可激活"] = "G公用反馈配置表.反馈正文",
["突刺·无影"] = "C产品表.名称",
["等级不足"] = "G公用反馈配置表.反馈正文",
["等级不足,%s阶的神机需要角色达到%s级才可进阶"] = "G公用反馈配置表.反馈正文",
["类型不匹配"] = "G公用反馈配置表.反馈正文",
["精·弑空"] = "C产品表.名称",
["精炼失败"] = "G公用反馈配置表.反馈正文",
["精炼成功"] = "G公用反馈配置表.反馈正文",
["精炼石不足"] = "G公用反馈配置表.反馈正文",
["精致战甲匣"] = "C产品表.名称",
["系统繁忙"] = "G公用反馈配置表.反馈正文",
["经验道具不可操作"] = "G公用反馈配置表.反馈正文",
["罕见晶钻,能获得人生一桶金。"] = "C产品表.描述",
["群·蓄力斩"] = "C产品表.名称",
["翻斩·奔雷"] = "C产品表.名称",
["职业不符合"] = "G公用反馈配置表.反馈正文",
["联动AOI触发器"] = "C触发器配置表.名称",
["背包空间不足"] = "G公用反馈配置表.反馈正文",
["胧月·吸虹"] = "C产品表.名称",
["能卖一些金币。"] = "C产品表.描述",
["能卖一点金币。"] = "C产品表.描述",
["能量不足"] = "G公用反馈配置表.反馈正文",
["荒神觉醒解锁"] = "G公用反馈配置表.反馈正文",
["获得代币%s"] = "G公用反馈配置表.反馈正文",
["获得体力%s"] = "G公用反馈配置表.反馈正文",
["获得功勋%s"] = "G公用反馈配置表.反馈正文",
["获得将魂%s"] = "G公用反馈配置表.反馈正文",
["获得技能点%s"] = "G公用反馈配置表.反馈正文",
["获得物品%s X %s"] = "G公用反馈配置表.反馈正文",
["获得竞技币%s"] = "G公用反馈配置表.反馈正文",
["获得经验%s"] = "G公用反馈配置表.反馈正文",
["获得装备抽积分%s"] = "G公用反馈配置表.反馈正文",
["获得远征币%s"] = "G公用反馈配置表.反馈正文",
["获得金币%s"] = "G公用反馈配置表.反馈正文",
["获得钻石%s"] = "G公用反馈配置表.反馈正文",
["获得零能%s"] = "G公用反馈配置表.反馈正文",
["落雁·火山"] = "C产品表.名称",
["蓄力斩"] = "C产品表.名称",
["血技未激活"] = "G公用反馈配置表.反馈正文",
["血技装配槽未开启"] = "G公用反馈配置表.反馈正文",
["被动阻挡触发器"] = "C触发器配置表.名称",
["裂·一闪"] = "C产品表.名称",
["装备使用中"] = "G公用反馈配置表.反馈正文",
["装备抽积分不足"] = "G公用反馈配置表.反馈正文",
["角色等级到达%d后可接"] = "G公用反馈配置表.反馈正文",
["角色达到%d级时即可开启"] = "G公用反馈配置表.反馈正文",
["触碰加OP"] = "C触发器配置表.名称",
["触碰加血"] = "C触发器配置表.名称",
["该商品已售罄"] = "G公用反馈配置表.反馈正文",
["该商店不存在"] = "G公用反馈配置表.反馈正文",
["该宝石孔需要战甲强化至%d级即可开放"] = "G公用反馈配置表.反馈正文",
["该悬赏任务不存在"] = "G公用反馈配置表.反馈正文",
["该槽没有宝石"] = "G公用反馈配置表.反馈正文",
["该槽没有零件"] = "G公用反馈配置表.反馈正文",
["该物品不可卖出"] = "G公用反馈配置表.反馈正文",
["该物品不在背包"] = "G公用反馈配置表.反馈正文",
["该物品不属于你"] = "G公用反馈配置表.反馈正文",
["该神机配件与插槽的类型不符,不可镶嵌"] = "G公用反馈配置表.反馈正文",
["该神机配件已到达等级上限"] = "G公用反馈配置表.反馈正文",
["该防具不可合成"] = "G公用反馈配置表.反馈正文",
["请选择要洗练的属性"] = "G公用反馈配置表.反馈正文",
["请领取奖励再刷新"] = "G公用反馈配置表.反馈正文",
["购买佣兵道具送佣兵"] = "G公用反馈配置表.反馈正文",
["购买材料送碎片"] = "G公用反馈配置表.反馈正文",
["购买材料送装备"] = "G公用反馈配置表.反馈正文",
["购买次数已达上限"] = "G公用反馈配置表.反馈正文",
["超过有效期"] = "G公用反馈配置表.反馈正文",
["超过有效等级"] = "G公用反馈配置表.反馈正文",
["距第%d赛季开始还有%s"] = "G公用反馈配置表.反馈正文",
["距第%d赛季结束还有%s"] = "G公用反馈配置表.反馈正文",
["轮舞·尾斩"] = "C产品表.名称",
["远征关卡不存在Buff"] = "G公用反馈配置表.反馈正文",
["远征关卡不存在宝箱"] = "G公用反馈配置表.反馈正文",
["追·尾斩"] = "C产品表.名称",
["追命·斩空"] = "C产品表.名称",
["通关触发器"] = "C触发器配置表.名称",
["逸风·剑舞"] = "C产品表.名称",
["金币"] = "C产品表.描述",
["金币不足"] = "G公用反馈配置表.反馈正文",
["金币包"] = "C产品表.名称",
["金币大包"] = "C产品表.名称",
["钻石不足"] = "G公用反馈配置表.反馈正文",
["锁定中不可出售"] = "G公用反馈配置表.反馈正文",
["锋·翻斩"] = "C产品表.名称",
["镜头触发器"] = "C触发器配置表.名称",
["闪·蓄力斩"] = "C产品表.名称",
["闪闪发光,能卖大量金币。"] = "C产品表.描述",
["防具合成材料不足"] = "G公用反馈配置表.反馈正文",
["防御BUFF触发器"] = "C触发器配置表.名称",
["阶数不足"] = "G公用反馈配置表.反馈正文",
["零件个数不足"] = "G公用反馈配置表.反馈正文",
["零件槽未解锁"] = "G公用反馈配置表.反馈正文",
["零件类型不符合"] = "G公用反馈配置表.反馈正文",
["零能不足"] = "G公用反馈配置表.反馈正文",
["雷·翻斩"] = "C产品表.名称",
["需要达到%d级以上"] = "G公用反馈配置表.反馈正文",
["霸·突刺"] = "C产品表.名称",
["飞狐·尾斩"] = "C产品表.名称",
["高端防具不可使用精炼石升星"] = "G公用反馈配置表.反馈正文",
} |
local runService = game:GetService("RunService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local modules = require(replicatedStorage.modules)
local network = modules.load("network")
local module = {}
-- returns the total exp needed to reach this level
function module.getBaseEXPForLevel(level)
return ((0.08/level)*level^6)/1.15
-- return 0.0444+(1/level)*level^5
-- return (10.5 * (level) ^ (3.24))
end
function module.getEXPForLevel(level)
return 70 + 100*(level-1)^1.3 + module.getBaseEXPForLevel(level) - module.getBaseEXPForLevel(level - 1)
end
local function getStatForLevel(level)
return 0.008*level^2 + 13*level^(1/2.1) + level
end
function module.getMonsterHealthForLevel(level)
return math.floor(70 + (60 * (level - 1)^1.07))
end
function module.getMonsterDefenseForLevel(level)
return getStatForLevel(level^1.02)
end
function module.getMonsterDamageForLevel(level)
return getStatForLevel(level^1.02) - 7
end
-- bounty data
module.bountyPageInfo = {
["1"] = {
{kills = 10;};
{kills = 30;};
{kills = 80;};
};
["2"] = {
{kills = 20;};
{kills = 70;};
{kills = 150;};
};
["3"] = {
{kills = 30;};
{kills = 100;};
{kills = 250;};
};
["99"] = {
{kills = 1;};
{kills = 3;};
{kills = 10;};
};
}
function module.getBountyGoldReward(bountyInfo, monster)
return bountyInfo.kills * (module.goldMulti or 1) * module.getQuestGoldFromLevel(monster.level or 1)/25
end
-- returns the exp granted from a quest at a specific level
function module.getQuestGoldFromLevel(questLevel)
return 100 + math.floor(questLevel ^ 1.18 * 300)
end
-- returns the exp needed to gain the level above the given
function module.getEXPToNextLevel(currentLevel)
return module.getEXPForLevel(currentLevel + 1)
end
-- returns the exp granted from a quest at a specific level
function module.getQuestEXPFromLevel(questLevel)
return 10 + (module.getEXPToNextLevel(questLevel) * (1/1.5) * questLevel^(-1/6))
end
-- let andrew decide whatever
function module.getBaseStatInfoForMonster(monsterLevel)
monsterLevel = 0--monsterLevel or 1
return {
str = monsterLevel * 1;
int = monsterLevel * 1;
dex = monsterLevel * 1;
vit = monsterLevel * 1;
}
end
-- returns main stat and cost of equipment based on the itemBaseData
function module.getEquipmentInfo(itemBaseData)
if itemBaseData then
local level = itemBaseData.level or itemBaseData.minLevel
if level then
local stat = getStatForLevel(level)
-- local stat = 0.009*level^2 + 3*level + 12
local cost = 1.35 * module.getQuestGoldFromLevel(level) * level^(1/3)
local modifierData
if itemBaseData.equipmentSlot then
if itemBaseData.equipmentSlot == 1 then
-- weapons
local damage = stat
cost = cost * 0.7
return {damage = math.ceil(damage); cost = math.floor(cost); }
elseif itemBaseData.equipmentSlot == 11 then
return {cost = math.floor(cost * 0.6)}
else
local upgradeStat
-- armor
local defense
if itemBaseData.equipmentSlot == 8 then
-- body
defense = stat
cost = cost * 1
if itemBaseData.noDefense == true then
defense = 0
end
elseif itemBaseData.equipmentSlot == 9 then
-- lower
defense = 0
cost = cost * 0.35
elseif itemBaseData.equipmentSlot == 2 then
-- hat
defense = 0
cost = cost * 0.5
local value = stat/5
local distribution = itemBaseData.statDistribution
if itemBaseData.minimumClass == "hunter" then
distribution = distribution or {
str = 0;
dex = 1;
int = 0;
vit = 0;
}
upgradeStat = {
str = 0;
dex = 1;
int = 0;
vit = 0;
}
elseif itemBaseData.minimumClass == "warrior" then
distribution = distribution or {
str = 1;
dex = 0;
int = 0;
vit = 0;
}
upgradeStat = {
str = 1;
dex = 0;
int = 0;
vit = 0;
}
elseif itemBaseData.minimumClass == "mage" then
distribution = distribution or {
str = 0;
dex = 0;
int = 1;
vit = 0;
}
upgradeStat = {
str = 0;
dex = 0;
int = 1;
vit = 0;
}
end
if distribution then
modifierData = {}
for stat, coefficient in pairs(distribution) do
modifierData[stat] = math.floor(value * coefficient)
end
end
-- modifierData = {int = math.floor(value)}
end
if defense then
return {defense = math.ceil(defense); cost = math.floor(cost); modifierData = modifierData; upgradeStat = upgradeStat}
end
return false
end
end
end
end
return false
end
function module.getPlayerTickHealing(player)
if player and player.Character and player:FindFirstChild("level") and player.Character.PrimaryPart then
local level = player.level.Value
local vit = player.vit.Value
return (0.24 * level) + (0.1 * vit)
end
return 0
end
-- warning: this is just base crit chance. Doesn't include bonus crit chance from equipment
function module.calculateCritChance(dex, playerLevel)
return 0 --math.clamp(0.4 * (dex / (3 * playerLevel)), 0, 1)
end
function module.getPlayerCritChance(player)
if runService:IsServer() then
local playerData = network:invoke("getPlayerData", player)
if playerData then
return module.calculateCritChance(
playerData.nonSerializeData.statistics_final.dex,
playerData.level
) + (playerData.nonSerializeData.statistics_final.criticalStrikeChance or 0)
end
else
warn("attempt to call getPlayerCritChance on client")
end
return 0
end
function module.getAttackSpeed(dex)
return dex * 0.5 / 2
end
function module.getMonsterGoldForLevel(level)
return 10 + (3 * (level - 1))
end
function module.getStatPointsForLevel(level)
return 3 * (level-1)
end
-- returns the level associated with the exp
function module.getLevelForEXP(exp)
return math.floor((5 * exp / 10) ^ (1 / 3))
end
-- returns how much exp you are past the exp required to earn your current level
function module.getEXPPastCurrentLevel(currentEXP)
return currentEXP
--return currentEXP - module.getEXPForLevel(math.floor(module.getLevelForEXP(currentEXP)))
end
-- returns fraction of how close you are until next level
function module.getFractionForNextLevel(currentEXP)
return module.getEXPPastCurrentLevel(currentEXP) / module.getEXPToNextLevel(math.floor(module.getLevelForEXP(currentEXP)))
end
-- calculates the exp gained for a monster kill
function module.getEXPGainedFromMonsterKill(baseMonsterEXP, monsterLevel, playerCurrentLevel)
-- general formula for this seems to be (baseMultiFactor * levelDifferenceFactor + minimumEXP) * totalMultiFactor
-- we should always at least grant the player 1 EXP
-- the formula below is just pulled from Pokemon, we'll customize it later
-- return ((baseMonsterEXP * monsterLevel ^ 0.9) / 8) * ((2 * monsterLevel + 10) ^ 2.5 / (monsterLevel + playerCurrentLevel + 10) ^ 2.5) + 1
local levelDifference = playerCurrentLevel - monsterLevel
local levelMulti = math.clamp(1 - levelDifference / 7, 0.25, 1.5)
return baseMonsterEXP * levelMulti
end
return module |
settings = NewSettings()
if family == "windows" then
if arch == "amd64" or arch == "ia64" then
lib_sdl_path = "SDL2-2.0.4/lib/x64"
lib_sdl_image_path = "SDL2_image-2.0.1/lib/x64"
else
lib_sdl_path = "SDL2-2.0.4/lib/x86"
lib_sdl_image_path = "SDL2_image-2.0.1/lib/x86"
end
settings.cc.includes:Add("SDL2-2.0.4/include")
settings.cc.includes:Add("SDL2-2.0.4/include/SDL2")
settings.cc.includes:Add("SDL2_image-2.0.1/include")
settings.cc.includes:Add("SDL2_image-2.0.1/include/SDL2")
settings.debug = 0
settings.cc.flags:Add("/MD")
settings.link.flags:Add("/SUBSYSTEM:CONSOLE")
settings.link.libs:Add("SDL2main")
settings.link.libpath:Add(lib_sdl_path)
settings.link.libpath:Add(lib_sdl_image_path)
else
settings.cc.flags:Add("-Wall");
end
settings.link.libs:Add("SDL2");
settings.link.libs:Add("SDL2_image");
source = Collect("*.c");
objects = Compile(settings, source)
exe = Link(settings, "openslay", objects)
if family == "windows" then
dll_copy = CopyToDirectory(".", Collect(lib_sdl_path .. "/*.dll",
lib_sdl_image_path .. "/*.dll"))
PseudoTarget("all", exe, dll_copy)
DefaultTarget("all")
else
DefaultTarget(exe)
end
|
local CorePackages = game:GetService("CorePackages")
local RetrievalStatus = require(CorePackages.AppTempCommon.LuaApp.Enum.RetrievalStatus)
local InspectAndBuyFolder = script.Parent.Parent
local IsDetailsItemPartOfBundle = require(InspectAndBuyFolder.Selectors.IsDetailsItemPartOfBundle)
local UtilityFunctions = require(InspectAndBuyFolder.UtilityFunctions)
local ASSET_KEY = "inspectAndBuy.getFavoriteForAsset."
local BUNDLE_KEY = "inspectAndBuy.getFavoriteForBundle."
--[[
Gets the current favorite status of the asset/bundle being viewed.
]]
return function(state)
local assetId = state.detailsInformation.assetId
if not assetId then
return false
end
local isBundle = IsDetailsItemPartOfBundle(state)
if isBundle == nil then
return false
end
local assetInfo = state.assets[assetId]
if not assetInfo then
return false
end
if isBundle then
local bundleId = UtilityFunctions.getBundleId(assetInfo)
return state.FetchingStatus[BUNDLE_KEY ..tostring(bundleId)] == RetrievalStatus.Fetching
or state.FetchingStatus[BUNDLE_KEY ..tostring(bundleId)] == RetrievalStatus.Done
else
return state.FetchingStatus[ASSET_KEY ..tostring(assetId)] == RetrievalStatus.Fetching
or state.FetchingStatus[ASSET_KEY ..tostring(assetId)] == RetrievalStatus.Done
end
end |
local actions = require('telescope.actions')
local fb_actions = require('telescope').extensions.file_browser.actions
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-j>'] = actions.move_selection_next,
['<C-k>'] = actions.move_selection_previous,
-- ['<CR>'] = actions.select_default,
},
},
},
extensions = {
file_browser = {
mappings = {
i = {
-- ['<CR>'] = fb_actions.open,
},
},
},
},
}
require('telescope').load_extension('fzf')
require('telescope').load_extension('file_browser')
local M = {}
M.search_dotfiles = function()
require('telescope.builtin').find_files({
prompt_title = 'Configuration files',
cwd = vim.fn['stdpath']('config'),
file_ignore_patterns = { '.png' },
})
end
M.search_workspace = function()
require('telescope.builtin').find_files({
prompt_title = 'Workspace files',
cwd = vim.env.WORKSPACE,
file_ignore_patterns = {
-- TeX temporary files
'%.aux',
'%.fdb_latexmk',
'%.fls',
'%.log',
'%.pdf_tex',
'%.synctex.gz',
'%.ttf',
'%.xdv',
-- C++ temporary files
'%.o',
'%.out',
-- Git related files and directories
'description',
'packed%-refs',
'HEAD',
'hooks/',
'objects/',
'refs/',
'info/',
'logs/',
'worktrees/',
},
})
end
M.search_folders = function()
require('telescope').extensions.file_browser.file_browser({
cwd = vim.env.WORKSPACE,
depth = false,
files = false,
})
end
return M
|
function Para (_)
return pandoc.Para{pandoc.Str(PANDOC_SCRIPT_FILE)}
end
|
local config = {}
config.ltnh_item_slot_count = 27
config.ltnh_ltn_slot_count = 13
config.ltnh_misc_slot_count = 14
config.ltn_signals = {
-- signal_name = {default_value, slot, bounds = {min, max}}
["ltn-network-id"] = {default = -1, slot = 1, bounds = {min = -2^31, max = 2^31 - 1}},
["ltn-requester-threshold"] = {default = 1000, slot = 5, bounds = {min = -2000000000, max = 2000000000}},
["ltn-requester-stack-threshold"] = {default = 0, slot = 6, bounds = {min = -2000000000, max = 2000000000}},
["ltn-requester-priority"] = {default = 0, slot = 7, bounds = {min = -2000000000, max = 2000000000}},
["ltn-provider-threshold"] = {default = 1000, slot = 9, bounds = {min = 0, max = 2000000000}},
["ltn-provider-stack-threshold"] = {default = 0, slot = 10, bounds = {min = 0, max = 2000000000}},
["ltn-provider-priority"] = {default = 0, slot = 11, bounds = {min = -2000000000, max = 2000000000}},
["ltn-min-train-length"] = {default = 0, slot = 2, bounds = {min = 0, max = 1000}},
["ltn-max-train-length"] = {default = 0, slot = 3, bounds = {min = 0, max = 1000}},
["ltn-max-trains"] = {default = 0, slot = 4, bounds = {min = 0, max = 1000}},
["ltn-disable-warnings"] = {default = 0, slot = 8, bounds = {min = 0, max = 1}},
["ltn-locked-slots"] = {default = 0, slot = 12, bounds = {min = 0, max = 40}},
["ltn-depot"] = {default = 0, slot = 13, bounds = {min = 0, max = 1}}
}
config.LTN_STOP_NONE = 0
config.LTN_STOP_DEPOT = 1
config.LTN_STOP_REQUESTER = 2
config.LTN_STOP_PROVIDER = 4
config.LTN_STOP_DEFAULT = config.LTN_STOP_PROVIDER
config.high_threshold_count = 50000000
-- todo make network id hidden, in settings lua too
config.default_visibility = {
["ltn-network-id"] = true,
["ltn-requester-threshold"] = true,
["ltn-requester-stack-threshold"] = false,
["ltn-requester-priority"] = true,
["ltn-provider-threshold"] = true,
["ltn-provider-stack-threshold"] = false,
["ltn-provider-priority"] = true,
["ltn-min-train-length"] = true,
["ltn-max-train-length"] = true,
["ltn-max-trains"] = false,
["ltn-locked-slots"] = false,
["ltn-disable-warnings"] = true,
["ltn-depot"] = false,
}
return config |
--------------------------------------
-- LOOT GUI
--------------------------------------
-- GUI used for loot decisions
--------------------------------------
-- HELPER FUNCTIONS
--------------------------------------
local function OnClick_PASS(self,button)
if self:IsEnabled() then
SKC:CancelLootTimer()
SKC.db.char.LM:SendLootDecision(SKC.LOOT_DECISION.PASS);
SKC:HideLootDecisionGUI();
end
return;
end
local function OnClick_SK(self,button)
if self:IsEnabled() then
SKC:CancelLootTimer()
SKC.db.char.LM:SendLootDecision(SKC.LOOT_DECISION.SK);
SKC:HideLootDecisionGUI();
end
return;
end
local function OnClick_ROLL(self,button)
if self:IsEnabled() then
SKC:CancelLootTimer()
SKC.db.char.LM:SendLootDecision(SKC.LOOT_DECISION.ROLL);
SKC:HideLootDecisionGUI();
end
return;
end
local function OnMouseDown_ShowItemTooltip(self, button)
-- shows tooltip when loot GUI clicked
local lootLink = SKC.db.char.LM:GetCurrentLootLink();
local itemString = string.match(lootLink,"item[%-?%d:]+");
local itemLabel = string.match(lootLink,"|h.+|h");
SetItemRef(itemString, itemLabel, button, self.LootGUI);
return;
end
--------------------------------------
-- GUI
--------------------------------------
function SKC:CreateLootGUI()
-- Creates the GUI object for making a loot decision
-- if already created, return
if self:CheckLootGUICreated() then return end
-- Create Frame
self.LootGUI = CreateFrame("Frame",nil,UIParent,"TranslucentFrameTemplate");
self.LootGUI:SetSize(self.UI_DIMS.DECISION_WIDTH,self.UI_DIMS.DECISION_HEIGHT);
self.LootGUI:SetPoint("TOP",UIParent,"CENTER",0,-130);
self.LootGUI:SetAlpha(0.8);
self.LootGUI:SetFrameLevel(6);
-- Make it movable
self.LootGUI:SetMovable(true);
self.LootGUI:EnableMouse(true);
self.LootGUI:RegisterForDrag("LeftButton");
self.LootGUI:SetScript("OnDragStart", self.LootGUI.StartMoving);
self.LootGUI:SetScript("OnDragStop", self.LootGUI.StopMovingOrSizing);
-- Create Title
self.LootGUI.Title = CreateFrame("Frame",title_key,self.LootGUI,"TranslucentFrameTemplate");
self.LootGUI.Title:SetSize(self.UI_DIMS.LOOT_GUI_TITLE_CARD_WIDTH,self.UI_DIMS.LOOT_GUI_TITLE_CARD_HEIGHT);
self.LootGUI.Title:SetPoint("BOTTOM",self.LootGUI,"TOP",0,-20);
self.LootGUI.Title.Text = self.LootGUI.Title:CreateFontString(nil,"ARTWORK");
self.LootGUI.Title.Text:SetFontObject("GameFontNormal");
self.LootGUI.Title.Text:SetPoint("CENTER",0,0);
self.LootGUI.Title:SetHyperlinksEnabled(true)
self.LootGUI.Title:SetScript("OnHyperlinkClick", ChatFrame_OnHyperlinkShow)
-- set texture / hidden frame for button click
local item_texture_y_offst = -23;
self.LootGUI.ItemTexture = self.LootGUI:CreateTexture(nil, "ARTWORK");
self.LootGUI.ItemTexture:SetSize(self.UI_DIMS.ITEM_WIDTH,self.UI_DIMS.ITEM_HEIGHT);
self.LootGUI.ItemTexture:SetPoint("TOP",self.LootGUI,"TOP",0,item_texture_y_offst)
self.LootGUI.ItemClickBox = CreateFrame("Frame", nil, self.MainGUI);
self.LootGUI.ItemClickBox:SetFrameLevel(7)
self.LootGUI.ItemClickBox:SetSize(self.UI_DIMS.ITEM_WIDTH,self.UI_DIMS.ITEM_HEIGHT);
self.LootGUI.ItemClickBox:SetPoint("CENTER",self.LootGUI.ItemTexture,"CENTER");
-- set decision buttons
-- SK
local loot_btn_x_offst = 40;
local loot_btn_y_offst = -7;
self.LootGUI.loot_decision_sk_btn = CreateFrame("Button", nil, self.LootGUI, "GameMenuButtonTemplate");
self.LootGUI.loot_decision_sk_btn:SetPoint("TOPRIGHT",self.LootGUI.ItemTexture,"BOTTOM",-loot_btn_x_offst,loot_btn_y_offst);
self.LootGUI.loot_decision_sk_btn:SetSize(self.UI_DIMS.LOOT_BTN_WIDTH, self.UI_DIMS.LOOT_BTN_HEIGHT);
self.LootGUI.loot_decision_sk_btn:SetText("SK");
self.LootGUI.loot_decision_sk_btn:SetNormalFontObject("GameFontNormal");
self.LootGUI.loot_decision_sk_btn:SetHighlightFontObject("GameFontHighlight");
self.LootGUI.loot_decision_sk_btn:SetScript("OnMouseDown",OnClick_SK);
self.LootGUI.loot_decision_sk_btn:Disable();
-- Roll
self.LootGUI.loot_decision_roll_btn = CreateFrame("Button", nil, self.LootGUI, "GameMenuButtonTemplate");
self.LootGUI.loot_decision_roll_btn:SetPoint("TOP",self.LootGUI.ItemTexture,"BOTTOM",0,loot_btn_y_offst);
self.LootGUI.loot_decision_roll_btn:SetSize(self.UI_DIMS.LOOT_BTN_WIDTH, self.UI_DIMS.LOOT_BTN_HEIGHT);
self.LootGUI.loot_decision_roll_btn:SetText("Roll");
self.LootGUI.loot_decision_roll_btn:SetNormalFontObject("GameFontNormal");
self.LootGUI.loot_decision_roll_btn:SetHighlightFontObject("GameFontHighlight");
self.LootGUI.loot_decision_roll_btn:SetScript("OnMouseDown",OnClick_ROLL);
self.LootGUI.loot_decision_roll_btn:Disable();
-- Pass
self.LootGUI.loot_decision_pass_btn = CreateFrame("Button", nil, self.LootGUI, "GameMenuButtonTemplate");
self.LootGUI.loot_decision_pass_btn:SetPoint("TOPLEFT",self.LootGUI.ItemTexture,"BOTTOM",loot_btn_x_offst,loot_btn_y_offst);
self.LootGUI.loot_decision_pass_btn:SetSize(self.UI_DIMS.LOOT_BTN_WIDTH, self.UI_DIMS.LOOT_BTN_HEIGHT);
self.LootGUI.loot_decision_pass_btn:SetText("Pass");
self.LootGUI.loot_decision_pass_btn:SetNormalFontObject("GameFontNormal");
self.LootGUI.loot_decision_pass_btn:SetHighlightFontObject("GameFontHighlight");
self.LootGUI.loot_decision_pass_btn:SetScript("OnMouseDown",OnClick_PASS);
self.LootGUI.loot_decision_pass_btn:Disable();
-- timer bar
local timer_bar_y_offst = -3;
self.LootGUI.TimerBorder = CreateFrame("Frame",nil,self.LootGUI,"TranslucentFrameTemplate");
self.LootGUI.TimerBorder:SetSize(self.UI_DIMS.STATUS_BAR_BRDR_WIDTH,self.UI_DIMS.STATUS_BAR_BRDR_HEIGHT);
self.LootGUI.TimerBorder:SetPoint("TOP",self.LootGUI.loot_decision_roll_btn,"BOTTOM",0,timer_bar_y_offst);
self.LootGUI.TimerBorder.Bg:SetAlpha(1.0);
-- status bar
self.LootGUI.TimerBar = CreateFrame("StatusBar",nil,self.LootGUI);
self.LootGUI.TimerBar:SetSize(self.UI_DIMS.STATUS_BAR_BRDR_WIDTH - self.UI_DIMS.STATUS_BAR_WIDTH_OFFST,self.UI_DIMS.STATUS_BAR_BRDR_HEIGHT - self.UI_DIMS.STATUS_BAR_HEIGHT_OFFST);
self.LootGUI.TimerBar:SetPoint("CENTER",self.LootGUI.TimerBorder,"CENTER",0,-1);
-- background texture
self.LootGUI.TimerBar.bg = self.LootGUI.TimerBar:CreateTexture(nil,"BACKGROUND",nil,-7);
self.LootGUI.TimerBar.bg:SetAllPoints(self.LootGUI.TimerBar);
self.LootGUI.TimerBar.bg:SetColorTexture(unpack(self.THEME.STATUS_BAR_COLOR));
self.LootGUI.TimerBar.bg:SetAlpha(0.8);
-- bar texture
self.LootGUI.TimerBar.Bar = self.LootGUI.TimerBar:CreateTexture(nil,"BACKGROUND",nil,-6);
self.LootGUI.TimerBar.Bar:SetColorTexture(0,0,0);
self.LootGUI.TimerBar.Bar:SetAlpha(1.0);
-- set status texture
self.LootGUI.TimerBar:SetStatusBarTexture(self.LootGUI.TimerBar.Bar);
-- add text
self.LootGUI.TimerBar.Text = self.LootGUI.TimerBar:CreateFontString(nil,"ARTWORK",nil,7)
self.LootGUI.TimerBar.Text:SetFontObject("GameFontHighlightSmall")
self.LootGUI.TimerBar.Text:SetPoint("CENTER",self.LootGUI.TimerBar,"CENTER")
local max_decision_time = self.db.char.GLP:GetLootDecisionTime();
-- Make frame closable with esc
table.insert(UISpecialFrames, "self.LootGUI");
-- hide
self:HideLootDecisionGUI();
return;
end
function SKC:HideLootDecisionGUI()
-- hide loot decision gui
self.LootGUI.ItemClickBox:SetScript("OnMouseDown",nil);
self.LootGUI.ItemClickBox:EnableMouse(false);
self.LootGUI:Hide();
return;
end
function SKC:ForceCloseLootDecisionGUI()
-- force close loot decision gui
SKC:CancelLootTimer();
self:HideLootDecisionGUI();
return;
end
function SKC:DisplayLootDecisionGUI(open_roll,sk_list)
-- ensure LootGUI is created
self:CreateLootGUI();
-- Enable correct buttons
self.LootGUI.loot_decision_pass_btn:Enable(); -- OnClick_PASS
if sk_list == "MSK" or sk_list == "TSK" then
self.LootGUI.loot_decision_sk_btn:Enable(); -- OnClick_SK
self.LootGUI.loot_decision_sk_btn:SetText(sk_list);
else
self.LootGUI.loot_decision_sk_btn:Disable();
self.LootGUI.loot_decision_sk_btn:SetText("SK");
end
if open_roll then
self.LootGUI.loot_decision_roll_btn:Enable(); -- OnClick_ROLL
else
self.LootGUI.loot_decision_roll_btn:Disable();
end
-- Set item (in GUI)
self:SetSKItem();
-- Initiate timer
self:StartLootTimer();
-- enable mouse
self.LootGUI.ItemClickBox:EnableMouse(true);
-- set link
self.LootGUI.ItemClickBox:SetScript("OnMouseDown",OnMouseDown_ShowItemTooltip);
-- show
self.LootGUI:Show();
return;
end
function SKC:SetSKItem()
-- https://wow.gamepedia.com/ItemMixin
-- local itemID = 19395; -- Rejuv
local lootLink = self.db.char.LM:GetCurrentLootLink();
local item = Item:CreateFromItemLink(lootLink)
item:ContinueOnItemLoad(function()
-- item:GetlootLink();
local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo(lootLink);
-- Set texture icon and link
self.LootGUI.ItemTexture:SetTexture(texture);
self.LootGUI.Title.Text:SetText(lootLink);
self.LootGUI.Title:SetWidth(self.LootGUI.Title.Text:GetStringWidth()+35);
end)
end
local function UpdateLootTimer()
-- Handles tick / elapsed time and updates GUI
SKC.Timers.Loot.Ticks = SKC.Timers.Loot.Ticks + 1;
SKC.Timers.Loot.ElapsedTime = SKC.Timers.Loot.ElapsedTime + 1.0;
SKC:UpdateLootTimerGUI();
if SKC.Timers.Loot.ElapsedTime >= SKC.db.char.GLP:GetLootDecisionTime() then
-- out of time
SKC:CancelLootTimer();
-- send loot response
SKC:Warn("Time expired. You PASS on "..SKC.db.char.LM:GetCurrentLootLink());
SKC.db.char.LM:SendLootDecision(SKC.LOOT_DECISION.PASS);
SKC:HideLootDecisionGUI();
end
return;
end
function SKC:StartLootTimer()
-- start loot timer and update GUI
-- cancel current loot timer
self:CancelLootTimer();
-- reset ticks / display time
self.Timers.Loot.Ticks = 0;
self.Timers.Loot.ElapsedTime = 0;
-- update min/max
self.LootGUI.TimerBar:SetMinMaxValues(0,self.db.char.GLP:GetLootDecisionTime());
-- update GUI
self:UpdateLootTimerGUI();
-- start new ticker
self.Timers.Loot.Ticker = C_Timer.NewTicker(1.0,UpdateLootTimer,self.db.char.GLP:GetLootDecisionTime());
return;
end
function SKC:UpdateLootTimerGUI()
-- updates loot timer GUI
self.LootGUI.TimerBar:SetValue(self.Timers.Loot.ElapsedTime);
self.LootGUI.TimerBar.Text:SetText(self.db.char.GLP:GetLootDecisionTime() - self.Timers.Loot.ElapsedTime);
return;
end
function SKC:CancelLootTimer()
-- cancels current loot timer (if it exists / isnt already cancelled)
if self.Timers.Loot.Ticker == nil or self.Timers.Loot.Ticker:IsCancelled() then return end
self.Timers.Loot.Ticker:Cancel();
return;
end |
-- okarosa
local usernameCache = {}
local searched = {}
local refreshCacheRate = 10 --Minutes
function getUsername( clue )
if not clue or string.len(clue) < 1 then
return false
end
for i, username in pairs(usernameCache) do
if username and string.lower(username) == string.lower(clue) then
return username
end
end
for i, player in pairs(getElementsByType("player")) do
local username = getElementData(player, "account:username")
if username and string.lower(username) == string.lower(clue) then
table.insert(usernameCache, username)
return username
end
end
if not searched[clue] or getTickCount() - searched[clue] > refreshCacheRate*1000*60 then
searched[clue] = getTickCount()
triggerServerEvent("requestUsernameCacheFromServer", resourceRoot, clue)
else
end
return false
end
function checkUsernameExistance(clue)
if not clue or string.len(clue) < 1 then
return false, "Please enter account name."
end
local found = getUsername( clue )
if found then
return true, "Account name '"..found.."' is existed and valid!", found
else
return false, "Account name '"..clue.."' does not exist."
end
end
function retrieveUsernameCacheFromServer(clue)
if clue then
table.insert(usernameCache, clue)
end
end
addEvent("retrieveUsernameCacheFromServer", true)
addEventHandler("retrieveUsernameCacheFromServer", root, retrieveUsernameCacheFromServer) |
local lpeg = require('lpeg')
local C, Cg, Ct, P, R, S = lpeg.C, lpeg.Cg, lpeg.Ct, lpeg.P, lpeg.R, lpeg.S
local coltype = P('int') + P('string') + P('float') + P('locstring')
local sym = R('az', 'AZ') * R('az', 'AZ', '09', '__')^0
local fkey = P('<') * sym * P('::') * sym * P('>')
local skiptoeol = (1 - S('\n'))^0
local commenteol = (P(' // ') * skiptoeol)^-1 * P('\n')
local column = Ct(
Cg(C(coltype), 'type') *
fkey^-1 *
P(' ') *
Cg(sym, 'name') *
P('?')^-1 *
commenteol)
local num = R('09')^1 / tonumber
local onebuild = Ct(num * P('.') * num * P('.') * num * P('.') * num)
local build = Ct(onebuild * (P('-') * onebuild)^-1)
local buildline = P('BUILD ') * build * (P(', ') * build)^0 * P('\n')
local anno = P('id') + P('relation') + P('noninline')
local const = function(x) return function() return x end end
local buildcol = Ct(
Cg(P('$') * Ct(C(anno) * (P(',') * C(anno))^0) * P('$'), 'annotations')^-1 *
Cg(sym, 'name') *
(P('<') * Cg(P('u') / const(true), 'unsigned')^-1 * Cg(num, 'size') * P('>'))^-1 *
(P('[') * Cg(num, 'length') * P(']'))^-1 *
commenteol)
local hash = R('09', 'AF')^8
local version = Ct(
P('\n') *
Cg(P('LAYOUT ') * Ct(C(hash) * (P(', ') * C(hash))^0) * P('\n'), 'layout')^-1 *
Cg(Ct(buildline^0), 'builds') *
(P('COMMENT ') * skiptoeol * P('\n'))^-1 *
Cg(Ct(buildcol^0), 'columns'))
local dbd = Ct(
P('COLUMNS\n') *
Cg(Ct(column^0), 'columns') *
Cg(Ct(version^0), 'versions') *
-P(1))
local function wrap(matcher)
return function(...)
return matcher:match(...)
end
end
return {
dbd = wrap(dbd),
onebuild = wrap(onebuild),
}
|
inertia = {
{1.1, 0.1, 0.2},
{0.3, 1.2, 0.4},
{0.5, 0.6, 1.3},
}
pelvis = { mass = 9.3, com = { 1.1, 1.2, 1.3}, inertia = inertia }
thigh = { mass = 4.2, com = { 1.1, 1.2, 1.3}, inertia = inertia }
shank = { mass = 4.1, com = { 1.1, 1.2, 1.3}, inertia = inertia }
foot = { mass = 1.1, com = { 1.1, 1.2, 1.3}, inertia = inertia }
bodies = {
pelvis = pelvis,
thigh_right = thigh,
shank_right = shank,
foot_right = foot,
thigh_left = thigh,
shank_left = shank,
foot_left = foot,
}
eye33 = {{1.0,0.0,0.,},
{0.0,1.0,0.,},
{0.0,0.0,1.,},}
return {
--Named body fixed points. The names of the fields have been set for
--historical reasons. It would make more sense if this was named instead
-- local_points, with a field of 'r' rather than 'point'.
points = {
{name = "Heel_Medial_L", body = "foot_right", point = {-0.080000, -0.042000, -0.091000,},},
{name = "Heel_Lateral_L", body = "foot_right", point = {-0.080000, 0.042000, -0.091000,},},
{name = "ForeFoot_Medial_L", body = "foot_right", point = {0.181788, -0.054000, -0.091000,},},
{name = "ForeFoot_Lateral_L", body = "foot_right", point = {0.181788, 0.054000, -0.091000,},},
},
--Named local frames
local_frames = {
{name = "Heel_Right", body="foot_right", r={-0.1, 0.0, -0.15}, E=eye33, },
{name = "ForeFoot_Right", body="foot_right", r={ 0.3, 0.0, -0.15}, E=eye33, },
{name = "GroundFrame", body="ROOT", r={0.,0.,0.}, E=eye33,},
},
--subject data
human_meta_data = {
{age_group = "Young18To25",
age = 35.0,
height = 1.73,
weight = 81.68,
gender = "male"},
},
--torque muscle models
--The name must contain a name of one of the MTGs listed in JointTorqueSet : line 60 of addons/muscle/Millard2016TorqueMuscle.cc
millard2016_torque_muscles = {
{ name = "HipExtension_R", angle_sign = -1, torque_sign = 1, body ="thigh_right", joint_index=1, act_time = 0.05, deact_time = 0.05, passive_element_torque_scale = 0.0,},
{ name = "HipFlexion_R", angle_sign = -1, torque_sign = -1, body ="thigh_right", joint_index=1, act_time = 0.05, deact_time = 0.05, passive_element_torque_scale = 0.0,},
{ name = "KneeExtension_R", angle_sign = 1, torque_sign = -1, body ="shank_right", act_time = 0.05, deact_time = 0.05, passive_element_torque_scale = 0.0,},
{ name = "KneeFlexion_R", angle_sign = 1, torque_sign = 1, body ="shank_right", act_time = 0.05, deact_time = 0.05, passive_element_torque_scale = 0.0,},
{ name = "AnkleExtension_R", angle_sign = -1, torque_sign = 1, body ="foot_right" , act_time = 0.05, deact_time = 0.05, passive_element_torque_scale = 0.0,},
{ name = "AnkleFlexion_R", angle_sign = -1, torque_sign = -1, body ="foot_right" , act_time = 0.05, deact_time = 0.05, passive_element_torque_scale = 0.0,},
},
constraint_set_phases = {
"left_foot",
"right_foot",
"right_foot",
"left_foot",
},
constraint_sets = {
left_foot = {
{ constraint_type = 'contact', name = 'leftHeelMedialXYZ', id = 1,
point_name = 'Heel_Medial_L', normal_sets = { {1.,0.,0.,},
{0.,1.,0.,},
{0.,0.,1.,} },
},
{ constraint_type = 'contact', name = 'leftForeMedialYZ', id = 1,
point_name = 'ForeFoot_Medial_L', normal_sets = {{1.,0.,0.,},{0.,0.,1.}},
},
{ constraint_type = 'contact', name = 'leftForeLateralZ', id = 1,
point_name = 'ForeFoot_Lateral_L', normal = {0.,0.,1.},
},
},
right_foot = {
{ constraint_type = 'loop', name = 'loopRightHeel', id = 2,
predecessor_local_frame = 'Heel_Right',
successor_local_frame = 'GroundFrame',
axis_sets = {{1., 0., 0., 0., 0., 0.},
{0., 1., 0., 0., 0., 0.},
{0., 0., 1., 0., 0., 0.},
{0., 0., 0., 1., 0., 0.},
{0., 0., 0., 0., 1., 0.},
{0., 0., 0., 0., 0., 1.},},
stabilization_coefficient = 0.1,
enable_stabilization = true,
},
},
},
frames = {
{
name = "pelvis",
parent = "ROOT",
body = bodies.pelvis,
joint = {"JointTypeFloatingBase"},
markers = {
LASI = { 0.047794, 0.200000, 0.070908,},
RASI = { 0.047794, -0.200000, 0.070908,},
LPSI = { -0.106106, 0.200000, 0.070908,},
RPSI = { -0.106106, -0.200000, 0.070908,},},
},
{
name = "thigh_right",
parent = "pelvis",
body = bodies.thigh_right,
joint_frame = {
r = { 0.000000, -0.100000, 0.000000,},
E = eye33,
},
joint = {"JointTypeEulerYXZ"},
markers = {
RTHI = { -0.007376, -0.000000, -0.243721,},
RKNE = { -0.011611, -0.000000, -0.454494,},},
},
{
name = "shank_right",
parent = "thigh_right",
body = bodies.thigh_right,
joint_frame = {
r = { 0.000000, 0.00000, -0.500000,},
E = eye33,
},
joint = {{0.,1.,0.,0.,0.,0.},},
},
{
name = "foot_right",
parent = "shank_right",
body = bodies.foot_right,
joint_frame = {
r = { 0.000000, 0.00000, -0.500000,},
E = eye33,
},
joint = {{0.,1.,0.,0.,0.,0.},
{1.,0.,0.,0.,0.,0.},},
},
{
name = "thigh_left",
parent = "pelvis",
body = bodies.thigh_left,
joint_frame = {
r = { 0.000000, 0.10000, 0.000000,},
E = eye33,
},
joint = {"JointTypeEulerYXZ"},
},
{
name = "shank_left",
parent = "thigh_left",
body = bodies.shank_left,
joint_frame = {
r = { 0.000000, 0.00000, -0.500000,},
E = eye33,
},
joint = {{0.,1.,0.,0.,0.,0.},},
},
{
name = "foot_left",
parent = "shank_left",
body = bodies.foot_left,
joint_frame = {
r = { 0.000000, 0.00000, -0.500000,},
E = eye33,
},
joint = {{0.,1.,0.,0.,0.,0.},
{1.,0.,0.,0.,0.,0.},},
},
},
} |
local helper = require('.helper')
local _M = {}
-- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
-- load on startup
function _M.run()
-- redirect stderror to stdout, then capture the result
command = 'new_attr bool my_not_first_autostart'
local handle = io.popen('herbstclient ' .. command .. ' 2>&1')
local result = handle:read('*a')
local exitcode = handle:close()
if ((result == nil or result == '')) then
-- non windowed app
os.execute('compton &')
os.execute('dunst &')
os.execute('parcellite &')
os.execute('nitrogen --restore &')
os.execute('mpd &')
-- windowed app
os.execute('xfce4-terminal &')
os.execute('sleep 1 && firefox &')
os.execute('sleep 2 && geany &')
os.execute('sleep 2 && thunar &')
end
end
-- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
-- return
return _M
|
--[[
My auto commands
--]]
vim.cmd([[
augroup Jpw_group
autocmd!
" Permanent sign column
autocmd BufRead,BufNewFile * setlocal signcolumn=yes
" Highlight on yank. See help:lua-highlight
autocmd TextYankPost * silent! lua vim.highlight.on_yank()
" Markdown
autocmd FileType markdown setlocal wrap
autocmd FileType markdown setlocal spell spelllang=en_gb
augroup END
]])
--Remap escape to leave terminal mode
vim.cmd([[
augroup Terminal
autocmd!
autocmd TermOpen * tnoremap <buffer> <Esc> <C-\><C-n>
autocmd TermOpen * set nonumber
augroup end
]])
|
--[=====[
## XP MultiBar ver. @@release-version@@
## XPMultiBar_Config.lua - module
Configuration and initialization for XPMultiBar addon
--]=====]
local addonName = ...
local Utils = LibStub("rmUtils-1.0")
local XPMultiBar = LibStub("AceAddon-3.0"):GetAddon(addonName)
local Config = XPMultiBar:NewModule("Config", "AceConsole-3.0")
local Event
local wowClassic = Utils.IsWoWClassic
local C = Config
local AceDB = LibStub("AceDB-3.0")
local ACRegistry = LibStub("AceConfigRegistry-3.0")
local ACDialog = LibStub("AceConfigDialog-3.0")
local ACCmd = LibStub("AceConfigCmd-3.0")
local ADBO = LibStub("AceDBOptions-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
local ALT_KEY = ALT_KEY
local CTRL_KEY = CTRL_KEY
local SHIFT_KEY = SHIFT_KEY
local BACKGROUND = BACKGROUND
local REPUTATION = REPUTATION
local ITEM_QUALITY_COLORS = ITEM_QUALITY_COLORS
local MAX_PLAYER_LEVEL = MAX_PLAYER_LEVEL
local OFF = OFF
local KEY_BUTTON1 = KEY_BUTTON1
local KEY_BUTTON2 = KEY_BUTTON2
local KEY_BUTTON3 = KEY_BUTTON3
local TRACKER_SORT_MANUAL = TRACKER_SORT_MANUAL
local _G = _G
local ipairs = ipairs
local next = next
local pairs = pairs
local print = print
local tconcat = table.concat
local tonumber = tonumber
local tostring = tostring
local type = type
local unpack = unpack
local GameLimitedMode_IsActive = GameLimitedMode_IsActive
local GetAddOnMetadata = GetAddOnMetadata
local GetRestrictedAccountData = GetRestrictedAccountData
local InterfaceOptionsFrame_OpenToCategory = InterfaceOptionsFrame_OpenToCategory
local IsXPUserDisabled = IsXPUserDisabled
local UnitLevel = UnitLevel
local ARTIFACT_QUALITY_TYPE = Enum.ItemQuality.Artifact;
local AceGUIWidgetLSMlists = AceGUIWidgetLSMlists
-- Remove all known globals after this point
-- luacheck: std none
local DB_VERSION_NUM = 823
local DB_VERSION = "V" .. tostring(DB_VERSION_NUM) .. (wowClassic and "C" or "")
--@debug@
L = Utils.DebugL(L)
--@end-debug@
local md = {
title = GetAddOnMetadata(addonName, "Title"),
notes = GetAddOnMetadata(addonName, "Notes"),
author = GetAddOnMetadata(addonName, "Author"),
version = GetAddOnMetadata(addonName, "Version"),
date = GetAddOnMetadata(addonName, "X-ReleaseDate"),
}
local xpLockedReasons = {
MAX_EXPANSION_LEVEL = 0,
MAX_TRIAL_LEVEL = 1,
LOCKED_XP = 2,
}
-- Event handlers
local configChangedEvent
local profileChangedEvent
-- Current settings
local db
-- Artifact item title color
local artColor
do
local color = ITEM_QUALITY_COLORS[ARTIFACT_QUALITY_TYPE]
artColor = {
r = color.r,
g = color.g,
b = color.b,
a = color.a
}
end
local FilterBorderTextures
do
local excludedBorders = {
["1 Pixel"] = true,
["Blizzard Chat Bubble"] = true,
["Blizzard Party"] = true,
["Details BarBorder 1"] = true,
["Details BarBorder 2"] = true,
["None"] = true,
["Square Full White"] = true,
}
FilterBorderTextures = function(textures)
local result = {}
for k, v in pairs(textures) do
if not excludedBorders[k] then
result[k] = v
end
end
return result
end
end
local frameAnchors = {
CENTER = "CENTER",
LEFT = "LEFT",
RIGHT = "RIGHT",
TOP = "TOP",
TOPLEFT = "TOPLEFT",
TOPRIGHT = "TOPRIGHT",
BOTTOM = "BOTTOM",
BOTTOMLEFT = "BOTTOMLEFT",
BOTTOMRIGHT = "BOTTOMRIGHT",
}
--[[
-- Localization
CENTER = L["ANCHOR.CENTER"],
LEFT = L["ANCHOR.LEFT"],
RIGHT = L["ANCHOR.RIGHT"],
TOP = L["ANCHOR.TOP"],
TOPLEFT = L["ANCHOR.TOPLEFT"],
TOPRIGHT = L["ANCHOR.TOPRIGHT"],
BOTTOM = L["ANCHOR.BOTTOM"],
BOTTOMLEFT = L["ANCHOR.BOTTOMLEFT"],
BOTTOMRIGHT = L["ANCHOR.BOTTOMRIGHT"],
]]
local slashCmd = "xpbar"
local empty = "-"
local appNames = {
main = { addonName, nil },
general = { addonName .. "-General", L["General"] },
bars = { addonName .. "-Bars", L["Bars"] },
reputation = { addonName .. "-Reputation", REPUTATION },
help = { addonName .. "-Help", L["Help"] },
profiles = { addonName .. "-Profiles", L["Profiles"] },
}
-- Bar codes
local X, A, R = 1, 2, 3
-- Mouse button codes
local LMB, RMB, MMB = "L", "R", "M"
local buttons = {
[LMB] = "LeftButton",
[RMB] = "RightButton",
[MMB] = "MiddleButton"
}
-- Default settings
local defaults = {
profile = {
-- General
general = {
advPosition = false,
locked = false,
clamptoscreen = true,
strata = "LOW",
anchor = frameAnchors.BOTTOM,
anchorRelative = empty,
posx = 0,
posy = 0,
width = 1028,
height = 20,
scale = 1,
font = nil,
fontsize = 14,
fontoutline = false,
texture = "Smooth",
horizTile = false,
border = false,
borderTexture = "Blizzard Dialog",
borderDynamicColor = true,
borderColor = { r = 0.5, g = 0.5, b = 0.5, a = 1 },
bubbles = false,
commify = true,
hidestatus = true,
},
bars = {
-- XP bar
xpstring = "Exp: [curXP]/[maxXP] ([restPC]) :: [curPC] through [pLVL] lvl :: [needXP] XP left :: [KTL] kills to lvl",
xpicons = true,
indicaterest = true,
showremaining = true,
-- Azerite bar
azerstr = "[name]: [curXP]/[maxXP] :: [curPC] through level [pLVL] :: [needXP] AP left",
azicons = true,
-- Reputation bar
repstring = "Rep: [faction] ([standing]) [curRep]/[maxRep] :: [repPC]",
repicons = true,
-- Bar colors
normal = { r = 0.8, g = 0, b = 1, a = 1 },
rested = { r = 0, g = 0.4, b = 1, a = 1 },
resting = { r = 1.0, g = 0.82, b = 0.25, a = 1 },
remaining = { r = 0.82, g = 0, b = 0, a = 1 },
background = { r = 0.5, g = 0.5, b = 0.5, a = 0.5 },
exalted = { r = 0, g = 0.77, b = 0.63, a = 1 },
azerite = artColor, -- azerite bar default color is a color of artifact item title
xptext = { r = 1, g = 1, b = 1, a = 1 },
reptext = { r = 1, g = 1, b = 1, a = 1 },
azertext = { r = 1, g = 1, b = 1, a = 1 },
-- Bar priority
priority = wowClassic
and {
X, R, 0,
0, 0, 0,
R, X, 0,
0, 0, 0,
}
or {
X, R, 0,
X, R, A,
A, R, X,
R, A, X,
R, X, 0
},
},
reputation = {
autowatchrep = false,
autotrackguild = false,
showRepMenu = true,
menuScale = 1,
menuAutoHideDelay = 2,
watchedFactionLineColor = { r = 0.3, g = 1, b = 1, a = 0.5 },
favoriteFactionLineColor = { r = 1, g = 0.3, b = 1, a = 0.5 },
showFavorites = false,
showFavInCombat = false,
showFavoritesModCtrl = false,
showFavoritesModAlt = false,
showFavoritesModShift = false,
favorites = {},
},
mouse = {
{
key = { shift = true, button = LMB },
action = "actions:linktext",
locked = true,
},
{
key = { shift = true, button = RMB },
action = "actions:settings",
locked = true,
},
{
key = { ctrl = true, button = RMB },
action = "actions:repmenu",
locked = true,
},
}
}
}
local GetOptions, GetHelp
do
local GROUPS = 5
local BARS_IN_GROUP = 3
local FLAG_NOTEXT = 4
local priorities
do
local N = FLAG_NOTEXT
priorities = wowClassic
and {
{ X, R, 0, 0, 0, 0, R, X, 0, 0, 0, 0, },
{},
{ R, X, 0, 0, 0, 0, R, X, 0, 0, 0, 0, },
-- No-Text presets
{ X+N, X, R, 0, 0, 0, R+N, R, X, 0, 0, 0, },
{},
{ R+N, R, X, 0, 0, 0, R+N, R, X, 0, 0, 0, },
}
or {
{ X, R, 0, X, R, A, A, R, X, R, A, X, R, X, 0, },
{ X, R, 0, A, R, X, A, R, X, R, A, X, R, X, 0, },
{ R, X, 0, R, X, A, R, A, X, R, A, X, R, X, 0, },
-- No-Text presets
{ X+N, X, R, X+N, X, R, A+N, A, R, R+N, R, X, R+N, R, X, },
{ X+N, X, R, A+N, A, R, A+N, A, R, R+N, R, A, R+N, R, X, },
{ R+N, R, X, R+N, R, X, R+N, R, A, R+N, R, 0, R+N, R, X, },
}
end
C.FLAG_NOTEXT = FLAG_NOTEXT
local MOUSE_ACTIONS = 16
local modNames = Utils.Map(
{ ctrl = CTRL_KEY, alt = ALT_KEY, shift = SHIFT_KEY },
function(v)
local first, rest = v:match("([A-Z])([A-Z]+)")
if not first or not rest then
first, rest = v:sub(1, 1), v:sub(2)
end
return first:upper() .. rest:lower()
end
)
local mouseButtonValues = {
[empty] = OFF,
[LMB] = KEY_BUTTON1,
[RMB] = KEY_BUTTON2,
[MMB] = KEY_BUTTON3,
}
local mouseButtonShortNames = {
[empty] = OFF,
[LMB] = L["Left Button"],
[RMB] = L["Right Button"],
[MMB] = L["Middle Button"],
}
local function MakeActionName(topic, ...)
return ("%s: %s"):format(topic, tconcat({...}, " > "))
end
local actionsTopic = L["Actions"]
local settingsTopic = L["Settings"]
local generalSub = L["General"]
local barsSub = L["Bars"]
local prioritySub = L["Priority"]
local reputationSub = L["Reputation"]
local actions = {
[empty] = MakeActionName(settingsTopic, TRACKER_SORT_MANUAL),
["actions:linktext"] = MakeActionName(actionsTopic, L["Copy bar text to the chat"]),
["actions:settings"] = MakeActionName(actionsTopic, L["Open addon settings"]),
["actions:repmenu"] = MakeActionName(actionsTopic, L["Open reputation menu"]),
["settings:general posGroup locked"]
= MakeActionName(settingsTopic, generalSub, L["Lock bar movement"]),
["settings:general posGroup clamptoscreen"]
= MakeActionName(settingsTopic, generalSub, L["Clamp bar with screen borders"]),
["settings:general visGroup bubbles"]
= MakeActionName(settingsTopic, generalSub, L["Show ticks on the bar"]),
["settings:general visGroup border"]
= MakeActionName(settingsTopic, generalSub, L["Show bar border"]),
["settings:bars prioGroup buttongroup setDefaultPrio"]
= MakeActionName(settingsTopic, barsSub, prioritySub, L["Set XP bar priority"]),
["settings:bars prioGroup buttongroup setReputationPrio"]
= MakeActionName(settingsTopic, barsSub, prioritySub, L["Set reputation bar priority"]),
["settings:reputation autowatchrep"] = MakeActionName(settingsTopic, reputationSub, L["Auto track reputation"]),
-- luacheck: ignore
["settings:reputation autotrackguild"] = MakeActionName(settingsTopic, reputationSub, L["Auto track guild reputation"]),
["settings:reputation showFavorites"] = MakeActionName(settingsTopic, reputationSub, L["Show favorite factions"]),
["settings:reputation showRepMenu"] = MakeActionName(settingsTopic, reputationSub, L["Show reputation menu"]),
}
if not wowClassic then
actions["settings:bars prioGroup buttongroup setAzeritePrio"]
= MakeActionName(settingsTopic, barsSub, prioritySub, L["Set Azerite power bar priority"])
end
local icons = {
exclamation = [[|Tinterface\gossipframe\availablelegendaryquesticon:0|t]],
locked = [[|Tinterface\petbattles\petbattle-lockicon:17:19:-4:0|t]]
}
local optionsTrace
local function FormatDate(dateMeta)
if tonumber(dateMeta) then
local year = tonumber(dateMeta:sub(1, 4))
local month = tonumber(dateMeta:sub(5, 6))
local day = tonumber(dateMeta:sub(7, 8))
return ("%02d.%02d.%04d"):format(day, month, year)
else
return dateMeta
end
end
local function FormatKeyColor(name)
return Utils.Text.GetKey(name)
end
local function GetIndex(key)
local s1, s2 = key:match("^pg_(%d)_[a-z]+_(%d)$")
local i1, i2 = tonumber(s1), tonumber(s2)
return (i1 - 1) * BARS_IN_GROUP + i2
end
local function PrintWrongIndex(index)
print("|cFFFFFF00[XPMultiBar]:|r", Utils.Text.GetError(L["Priority group index is wrong: %d"]:format(index)))
end
local function UpdateBars(prio)
configChangedEvent("priority", prio)
end
local function GetPriority(info)
local index = GetIndex(info[#info])
if index >= 1 and index <= BARS_IN_GROUP * GROUPS then
return db.bars.priority[index] % FLAG_NOTEXT
else
PrintWrongIndex(index)
return 0
end
end
local function SetPriority(info, value)
local index = GetIndex(info[#info])
if index >= 1 and index <= BARS_IN_GROUP * GROUPS then
local oldValue = db.bars.priority[index]
db.bars.priority[index] = value > 0
and value + (oldValue > FLAG_NOTEXT and FLAG_NOTEXT or 0)
or 0
UpdateBars(db.bars.priority)
else
PrintWrongIndex(index)
end
end
local function GetShowText(info)
local index = GetIndex(info[#info])
if index >= 1 and index <= BARS_IN_GROUP * GROUPS then
return db.bars.priority[index] < FLAG_NOTEXT
else
PrintWrongIndex(index)
return true
end
end
local function SetShowText(info, value)
local index = GetIndex(info[#info])
if index >= 1 and index <= BARS_IN_GROUP * GROUPS then
local raw = db.bars.priority[index] % FLAG_NOTEXT
db.bars.priority[index] = raw + (value and 0 or FLAG_NOTEXT)
UpdateBars(db.bars.priority)
else
PrintWrongIndex(index)
end
end
local function GetShowTextDisabled(info)
return GetPriority(info) == 0
end
--[[
L["PRIOGROUP_1.NAME"] -> Char. level below maximum, no artifact (HoA)
L["PRIOGROUP_1C.NAME"] -> Char. level below maximum
L["PRIOGROUP_2.NAME"] -> Char. level below maximum, has artifact (HoA)
L["PRIOGROUP_3.NAME"] -> Char. level maximum, artifact power below maximum
L["PRIOGROUP_3C.NAME"] -> Char. level maximum
L["PRIOGROUP_4.NAME"] -> Char. level maximum, artifact power maximum
L["PRIOGROUP_5.NAME"] -> Char. level maximum, no artifact (HoA)
]]
local function CreatePriorityGroups()
local barsNoAzerite = {
[0] = L["Off"],
[X] = L["Experience Bar"],
[R] = L["Reputation Bar"],
}
local bars = (not wowClassic) and Utils.Merge({ [A] = L["Azerite Bar"] }, barsNoAzerite) or barsNoAzerite
local result = {}
local textTitle = L["Show text"]
local textDesc = L["Show text on the bar"]
for i = 1, GROUPS do
result["prioritygroup" .. i] = (not wowClassic or i % 2 == 1) and {
type = "group",
order = (i + 1) * 100,
name = L["PRIOGROUP_" .. i .. (wowClassic and "C" or "") .. ".NAME"],
inline = true,
width = "full",
get = GetPriority,
set = SetPriority,
args = {
["pg_" .. i .. "_bar_1"] = {
order = 1000,
type = "select",
name = L["Normal"],
desc = L["Choose bar to be shown when mouse is not over the bar"],
values = (i == 1 or i == 5) and barsNoAzerite or bars,
},
["pg_" .. i .. "_bar_2"] = {
order = 2000,
type = "select",
name = L["Mouse over"],
desc = L["Choose bar to be shown when mouse is over the bar"],
values = (i == 1 or i == 5) and barsNoAzerite or bars,
},
["pg_" .. i .. "_bar_3"] = {
order = 3000,
type = "select",
name = L["Mouse over with %s"]:format(FormatKeyColor(modNames.alt)),
-- luacheck: ignore
desc = L["Choose bar to be shown when mouse is over the bar while %s key is pressed"]:format(FormatKeyColor(modNames.alt)),
values = (i == 1 or i == 5) and barsNoAzerite or bars,
},
["pg_" .. i .. "_text_1"] = {
order = 4000,
type = "toggle",
name = textTitle,
desc = textDesc,
get = GetShowText,
set = SetShowText,
disabled = GetShowTextDisabled,
},
["pg_" .. i .. "_text_2"] = {
order = 5000,
type = "toggle",
name = textTitle,
desc = textDesc,
get = GetShowText,
set = SetShowText,
disabled = GetShowTextDisabled,
},
["pg_" .. i .. "_text_3"] = {
order = 6000,
type = "toggle",
name = textTitle,
desc = textDesc,
get = GetShowText,
set = SetShowText,
disabled = GetShowTextDisabled,
},
},
} or nil
end
return result
end
local function SetPrioritiesFromIndex(index)
return function()
db.bars.priority = Utils.Clone(priorities[index] or priorities[1])
UpdateBars(db.bars.priority)
end
end
local function BooleanEqual(bool1, bool2)
bool1, bool2 = bool1 and true or false, bool2 and true or false
return bool1 == bool2
end
local function KeyEqual(key1, key2)
return (key1 and key2) and key1.button ~= empty
and key1.button == key2.button
and BooleanEqual(key1.ctrl, key2.ctrl)
and BooleanEqual(key1.alt, key2.alt)
and BooleanEqual(key1.shift, key2.shift)
end
local function GetMouseCommandName(index, config, configs)
local key = config.key or {}
local button = key.button or empty
local command = { mouseButtonShortNames[button] }
local prefix = "\32"
if button ~= empty then
if key.shift then
Utils.Unshift(command, modNames.shift)
end
if key.alt then
Utils.Unshift(command, modNames.alt)
end
if key.ctrl then
Utils.Unshift(command, modNames.ctrl)
end
end
-- Add exclamation icon to duplicate mouse shortcuts
for i, v in ipairs(configs) do
if i ~= index and KeyEqual(config.key, v.key) then
prefix = icons.exclamation
break
end
end
return ("%s%s"):format(
config.locked and icons.locked or ("%02d."):format(index),
prefix .. tconcat(command, "-")
)
end
local function GetMouseCommandLocked(config)
return function()
return config.locked
end
end
local function GetMouseCommandDisabled(config)
local locked = GetMouseCommandLocked(config)
return function()
return locked() or not config.key
or not config.key.button or (config.key.button == empty)
end
end
local function MakeMouseCommandGet(index)
local config = db.mouse[index] or {}
return function(info)
local key = info[#info]
if key == "mouseButton" then
return config.key and config.key.button or empty
elseif key == "keyCtrl" then
return config.key and config.key.ctrl and true or false
elseif key == "keyAlt" then
return config.key and config.key.alt and true or false
elseif key == "keyShift" then
return config.key and config.key.shift and true or false
elseif key == "actionChoose" then
return config.action or empty
elseif key == "actionEdit" then
return config.actionText or ""
end
end
end
local function MakeMouseCommandSet(index)
return function(info, value)
local key = info[#info]
local config = db.mouse[index]
if not config then
config = { key = { button = empty }, action = empty }
db.mouse[index] = config
end
if key == "mouseButton" then
config.key.button = value
elseif key == "keyCtrl" then
config.key.ctrl = value and true or nil
elseif key == "keyAlt" then
config.key.alt = value and true or nil
elseif key == "keyShift" then
config.key.shift = value and true or nil
elseif key == "actionChoose" then
if value ~= empty then
config.actionText = nil
end
config.action = value
elseif key == "actionEdit" then
config.actionText = value
end
-- If entry is empty (has no button and no action), we delete it
if config.key.button == empty and config.action == empty
and (not config.actionText or config.actionText == empty) then
db.mouse[index] = nil
end
end
end
local function CreateMouseGroupItem(index)
local config = db.mouse[index] or {}
return {
type = "group",
order = index * 10,
name = GetMouseCommandName(index, config, db.mouse),
width = "full",
get = MakeMouseCommandGet(index),
set = MakeMouseCommandSet(index),
args = {
clickGroup = {
type = "group",
order = 10,
name = L["Mouse Shortcut"],
inline = true,
width = "full",
args = {
mouseButton = {
order = 10,
type = "select",
width = 1,
name = L["Mouse Button"],
desc = L["Choose mouse button"],
disabled = GetMouseCommandLocked(config),
values = mouseButtonValues,
},
modGroup = {
type = "group",
order = 20,
name = "",
inline = true,
width = "full",
disabled = GetMouseCommandDisabled(config),
args = {
keyCtrl = {
type = "toggle",
order = 10,
width = 0.5,
name = modNames.ctrl,
desc = L["%s key"]:format(FormatKeyColor(modNames.ctrl)),
},
keyAlt = {
type = "toggle",
order = 20,
width = 0.5,
name = modNames.alt,
desc = L["%s key"]:format(FormatKeyColor(modNames.alt)),
},
keyShift = {
type = "toggle",
order = 30,
width = 0.5,
name = modNames.shift,
desc = L["%s key"]:format(FormatKeyColor(modNames.shift)),
},
},
},
},
},
actionGroup = {
type = "group",
order = 20,
name = L["Action"],
inline = true,
width = "full",
disabled = GetMouseCommandDisabled(config),
args = {
actionChoose = {
order = 10,
type = "select",
width = "full",
name = "",
desc = L["Choose click action"],
values = actions,
},
actionEdit = {
order = 20,
type = "input",
width = "full",
name = "",
desc = L["Enter settings action text"],
hidden = function() return config.action ~= empty end,
},
},
},
},
}
end
local function CreateGroupItems(description, items)
local result = {
text = {
name = description,
type = "description",
order = 10,
fontSize = "medium",
},
}
for i, v in ipairs(items) do
local k, vv = unpack(v)
local tag = "[" .. k .. "]"
result[k] = {
name = vv,
type = "group",
order = (i + 1) * 10,
width = "full",
inline = true,
args = {
text = {
type = "input",
name = "",
width = "full",
get = function() return tag end,
dialogControl = "InteractiveText",
},
}
}
end
return result
end
local function CreateGetSetColorFunctions(section, postFunc)
return function(info)
local col = db[section][info[#info]]
return col.r, col.g, col.b, col.a or 1
end,
function(info, r, g, b, a)
local key = info[#info]
local col = db[section][key]
col.r, col.g, col.b, col.a = r, g, b, a
if type(postFunc) == "function" then
postFunc(key, col)
end
end
end
function GetOptions(uiTypes, uiName, appName)
local function onConfigChanged(key, value)
configChangedEvent(key, value)
end
local function getCoord(info)
local key = info[#info]
return tostring(db.general[key])
end
local function setPosition(info, value)
local key = info[#info]
db.general[key] = value
onConfigChanged("position", db.general)
end
local getBorderColor, setBorderColor = CreateGetSetColorFunctions("general")
local function setBorder(info, r, g, b, a)
local key = info[#info]
if key == "borderColor" then
setBorderColor(info, r, g, b, a)
else
db.general[key] = r
end
onConfigChanged("border", db.general)
end
local getBarColor, setBarColor = CreateGetSetColorFunctions(
"bars",
function(key, color)
if key == "exalted" then
onConfigChanged("exaltedColor", color)
elseif key == "background" then
onConfigChanged("bgColor", color)
end
end
)
local getRepColor, setRepColor = CreateGetSetColorFunctions("reputation")
if appName == addonName then
return {
type = "group",
order = 0,
name = md.title,
args = {
descr = {
type = "description",
order = 0,
name = md.notes
},
releaseData = {
type = "group",
order = 10,
name = "",
inline = true,
width = "full",
args = {
author = {
type = "input",
order = 10,
name = L["Author"],
get = function() return md.author end,
dialogControl = "InteractiveText",
},
version = {
type = "input",
order = 20,
name = L["Version"],
get = function() return md.version end,
dialogControl = "InteractiveText",
},
date = {
type = "input",
order = 30,
name = L["Date"],
get = function() return FormatDate(md.date) end,
dialogControl = "InteractiveText",
},
},
},
},
}
end
if appName == (addonName .. "-General") then
local anchors = Utils.Clone(frameAnchors)
local anchorValues = Utils.Map(anchors, function(val)
return ("%s (%s)"):format(L["ANCHOR." .. val], val)
end)
local relAnchorValues = Utils.Merge({ [empty] = L["Same as Anchor"] }, anchorValues)
local isBorderOptionsDisabled = function() return not db.general.border end
local isBorderColorDisabled = function()
return not db.general.border or db.general.borderDynamicColor
end
local mouseArgs = {}
for i = 1, MOUSE_ACTIONS do
mouseArgs["mouseAction" .. i] = CreateMouseGroupItem(i)
end
local options = {
type = "group",
name = md.title,
childGroups = "tab",
get = function(info)
local key = info[#info]
return db.general[key]
end,
set = function(info, value)
local key = info[#info]
db.general[key] = value
onConfigChanged(key, value)
end,
args = {
-- Position
posGroup = {
type = "group",
order = 10,
name = L["Position"],
width = "full",
args = {
locked = {
type = "toggle",
order = 100,
width = 1.5,
name = L["Lock movement"],
desc = L["Lock bar movement"],
},
clamptoscreen = {
type = "toggle",
order = 200,
width = 1.5,
name = L["Screen clamp"],
desc = L["Clamp bar with screen borders"],
},
strata = {
type = "select",
order = 300,
width = 1.5,
name = L["Frame strata"],
desc = L["Set the frame strata (z-order position)"],
style = "dropdown",
values = {
HIGH = "High",
MEDIUM = "Medium",
LOW = "Low",
BACKGROUND = "Background",
},
},
advPosition = {
type = "toggle",
order = 400,
width = 1.5,
name = L["Advanced positioning"],
desc = L["Show advanced positioning options"],
},
advPosGroup = {
type = "group",
order = 500,
name = L["Advanced positioning"],
inline = true,
width = "full",
hidden = function() return not db.general.advPosition end,
set = setPosition,
args = {
anchor = {
order = 1000,
type = "select",
width = 1.5,
name = L["Anchor"],
desc = L["Change the current anchor point of the bar"],
values = anchorValues,
},
anchorRelative = {
order = 2000,
type = "select",
width = 1.5,
name = L["Relative anchor"],
desc = L["Change the relative anchor point on the screen"],
values = relAnchorValues,
},
posx = {
order = 3000,
type = "input",
width = 1.5,
name = L["X Offset"],
desc = L["Offset in X direction (horizontal) from the given anchor point"],
dialogControl = "NumberEditBox",
get = getCoord,
},
posy = {
order = 4000,
type = "input",
width = 1.5,
name = L["Y Offset"],
desc = L["Offset in Y direction (vertical) from the given anchor point"],
dialogControl = "NumberEditBox",
get = getCoord,
},
},
},
sizeGroup = {
type = "group",
order = 500,
name = L["Size"],
inline = true,
width = "full",
args = {
width = {
type = "range",
order = 1000,
width = 1.5,
name = L["Width"],
desc = L["Set the bar width"],
min = 100,
max = 5000,
step = 1,
bigStep = 50,
},
height = {
type = "range",
order = 2000,
width = 1.5,
name = L["Height"],
desc = L["Set the bar height"],
min = 10,
max = 100,
step = 1,
bigStep = 5,
},
scale = {
type = "range",
order = 3000,
width = 1.5,
name = L["Scale"],
desc = L["Set the bar scale"],
min = 0.5,
max = 2,
step = 0.1,
},
},
},
hidestatus = {
type = "toggle",
order = 600,
width = "full",
name = L["Hide WoW standard bars"],
desc = L["Hide WoW standard bars for XP, Artifact power and reputation"],
}
},
},
-- Visuals
visGroup = {
type = "group",
order = 20,
name = L["Visuals"],
width = "full",
args = {
-- Texture
texGroup = {
type = "group",
order = 100,
name = L["Texture"],
inline = true,
width = "full",
args = {
texture = {
type = "select",
order = 1000,
name = L["Choose texture"],
desc = L["Choose bar texture"],
style = "dropdown",
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
},
horizTile = {
type = "toggle",
order = 2000,
name = L["Texture tiling"],
desc = L["Tile texture instead of stretching"],
},
bubbles = {
type = "toggle",
order = 3000,
name = L["Bubbles"],
desc = L["Show ticks on the bar"],
},
},
},
borderGroup = {
type = "group",
order = 200,
name = L["Bar border"],
inline = true,
width = "full",
set = setBorder,
args = {
border = {
type = "toggle",
order = 1000,
width = 1.5,
name = L["Show border"],
desc = L["Show bar border"],
},
borderTexture = {
type = "select",
order = 2000,
width = 1.5,
disabled = isBorderOptionsDisabled,
name = L["Border style"],
desc = L["Set border style (texture)"],
dialogControl = "LSM30_Border",
values = FilterBorderTextures(AceGUIWidgetLSMlists.border),
},
borderDynamicColor = {
type = "toggle",
order = 3000,
width = 1.5,
disabled = isBorderOptionsDisabled,
name = L["Dynamic color"],
desc = L["Border color is set to bar color"],
},
borderColor = {
type = "color",
order = 4000,
width = 1.5,
disabled = isBorderColorDisabled,
name = L["Border color"],
desc = L["Set bar border color"],
hasAlpha = false,
get = getBorderColor,
},
},
},
},
},
-- Text
textGroup = {
type = "group",
order = 30,
name = L["Text"],
width = "full",
args = {
font = {
type = "select",
order = 100,
width = 1.5,
name = L["Font face"],
desc = L["Set the font face"],
style = "dropdown",
dialogControl = "LSM30_Font",
values = AceGUIWidgetLSMlists.font,
},
fontsize = {
type = "range",
order = 200,
width = 1.5,
name = L["Font size"],
desc = L["Set bar text font size"],
min = 5,
max = 30,
step = 1,
},
fontoutline = {
type = "toggle",
order = 300,
width = 1.5,
name = L["Font outline"],
desc = L["Show font outline"],
},
commify = {
type = "toggle",
order = 400,
width = 1.5,
name = L["Commify"],
desc = L["Insert thousands separators into long numbers"],
},
},
},
-- Mouse
mouseGroup = {
type = "group",
order = 40,
childGroups = "tree",
name = L["Mouse actions"],
width = "full",
args = mouseArgs,
},
},
}
return options
end
if appName == (addonName .. "-Bars") then
return {
type = "group",
name = L["Bars"],
childGroups = "tab",
get = function(info) return db.bars[info[#info]] end,
set = function(info, value)
local key = info[#info]
db.bars[key] = value
onConfigChanged(key, value)
end,
args = {
bardesc = {
type = "description",
order = 0,
name = wowClassic and L["Options for XP / reputation bars"]
or L["Options for XP / reputation / azerite power bars"],
},
xpgroup = {
type = "group",
order = 10,
name = L["Experience Bar"],
width = "full",
args = {
xpdesc = {
type = "description",
order = 0,
name = L["Experience bar related options"],
},
xpstring = {
type = "input",
order = 10,
name = L["Text format"],
desc = L["Set XP bar text format"],
width = "full",
},
xpicons = {
type = "toggle",
order = 35,
width = 1.5,
name = L["Display icons"],
desc = wowClassic and L["Display icon for max. player level"]
or L["Display icons for max. level, disabled XP gain and level cap due to limited account"],
},
indicaterest = {
type = "toggle",
order = 25,
width = 1.5,
name = L["Indicate resting"],
desc = L["Indicate character resting with XP bar color"],
},
showremaining = {
type = "toggle",
order = 30,
width = 1.5,
name = L["Show rested XP bonus"],
desc = L["Toggle the display of remaining rested XP"],
},
xpcolorgroup = {
type = "group",
order = 40,
name = "",
inline = true,
width = "full",
get = getBarColor,
set = setBarColor,
args = {
xptext = {
type = "color",
order = 10,
width = 1.5,
name = L["XP text"],
desc = L["Set XP text color"],
hasAlpha = true,
},
normal = {
type = "color",
order = 20,
width = 1.5,
name = L["Normal"],
desc = L["Set normal bar color"],
hasAlpha = true,
},
background = {
type = "color",
order = 30,
width = 1.5,
name = BACKGROUND,
desc = L["Set background bar color"],
hasAlpha = true,
},
rested = {
type = "color",
order = 40,
width = 1.5,
name = L["Rested bonus"],
desc = L["Set XP bar color when character has rested XP bonus"],
hasAlpha = true,
},
resting = {
type = "color",
order = 50,
width = 1.5,
name = L["Resting area"],
desc = L["Set XP bar color when character is resting"],
hasAlpha = true,
},
remaining = {
type = "color",
order = 60,
width = 1.5,
name = L["Remaining rest bonus"],
desc = L["Set remaining XP rest bonus bar color"],
hasAlpha = true,
},
},
},
},
},
azergroup = {
type = "group",
order = 20,
name = L["Azerite Bar"],
width = "full",
args = {
azerdesc = {
type = "description",
order = 0,
name = L["Azerite bar related options"],
},
azerstr = {
name = L["Text format"],
desc = L["Set Azerite bar text format"],
type = "input",
order = 10,
width = "full",
},
azicons = {
type = "toggle",
order = 20,
width = 1.5,
name = L["Display icons"],
desc = L["Display icons for maximum Heart level"]
},
azercolorgroup = {
type = "group",
order = 40,
name = "",
inline = true,
width = "full",
get = getBarColor,
set = setBarColor,
args = {
azertext = {
type = "color",
order = 10,
width = 1.5,
name = L["Azerite text"],
desc = L["Set Azerite text color"],
hasAlpha = true,
},
azerite = {
type = "color",
order = 20,
width = 1.5,
name = L["Azerite bar"],
desc = L["Set Azerite power bar color"],
hasAlpha = true,
},
},
},
},
},
repgroup = {
type = "group",
order = 30,
name = L["Reputation Bar"],
width = "full",
args = {
repdesc = {
type = "description",
order = 0,
name = L["Reputation bar related options"],
},
repstring = {
type = "input",
order = 10,
width = "full",
name = L["Text format"],
desc = L["Set reputation bar text format"],
},
repicons = {
type = "toggle",
order = 45,
width = 1.5,
name = L["Display icons"],
desc = wowClassic and L["Display icon you are at war with the faction"]
or L["Display icons for paragon reputation and reputation bonuses"],
},
repcolorgroup = {
type = "group",
order = 50,
name = "",
inline = true,
width = "full",
get = getBarColor,
set = setBarColor,
args = {
reptext = {
type = "color",
order = 10,
width = 1.5,
name = L["Reputation text"],
desc = L["Set reputation text color"],
hasAlpha = true,
},
exalted = {
type = "color",
order = 20,
width = 1.5,
name = _G.FACTION_STANDING_LABEL8,
desc = L["Set exalted reputation bar color"],
hasAlpha = true,
},
},
},
},
},
priogroup = {
type = "group",
order = 40,
name = L["Bar Priority"],
width = "full",
args = Utils.Merge( {
buttongroup = {
type = "group",
order = 900,
name = L["Activate preset"],
inline = true,
width = "full",
args = {
presetsWithTextDesc = {
type = "description",
order = 0,
name = L["Presets with text always visible"],
},
setDefaultPrio = {
type = "execute",
order = 1000,
width = wowClassic and 1.5 or 1,
name = L["XP bar priority"],
desc = L["Activate preset with priority for XP bar display"],
func = SetPrioritiesFromIndex(1)
},
setAzeritePrio = (not wowClassic) and {
type = "execute",
order = 2000,
name = L["Azerite bar priority"],
desc = L["Activate preset with priority for Azerite power bar display"],
func = SetPrioritiesFromIndex(2)
} or nil,
setReputationPrio = {
type = "execute",
order = 3000,
width = wowClassic and 1.5 or 1,
name = L["Reputation bar priority"],
desc = L["Activate preset with priority for Reputation bar display"],
func = SetPrioritiesFromIndex(3)
},
presetsWithoutTextDesc = {
type = "description",
order = 3500,
name = L["Presets with text show on mouseover"],
},
setDefaultPrioNoText = {
type = "execute",
order = 4000,
width = wowClassic and 1.5 or 1,
name = L["XP bar priority"],
desc = L["Activate preset with priority for XP bar display"],
func = SetPrioritiesFromIndex(4)
},
setAzeritePrioNoText = (not wowClassic) and {
type = "execute",
order = 5000,
name = L["Azerite bar priority"],
desc = L["Activate preset with priority for Azerite power bar display"],
func = SetPrioritiesFromIndex(5)
} or nil,
setReputationPrioNoText = {
type = "execute",
order = 6000,
width = wowClassic and 1.5 or 1,
name = L["Reputation bar priority"],
desc = L["Activate preset with priority for Reputation bar display"],
func = SetPrioritiesFromIndex(6)
},
},
},
},
CreatePriorityGroups()
),
}
},
}
end
if appName == (addonName .. "-Reputation") then
local t = Utils.Text
return {
type = "group",
name = REPUTATION,
childGroups = "tab",
get = function(info) return db.reputation[info[#info]] end,
set = function(info, value) db.reputation[info[#info]] = value end,
args = {
bardesc = {
type = "description",
order = 0,
name = L["Settings for reputation menu and favorite factions"],
},
trackinggroup = {
type = "group",
order = 10,
name = L["Tracking"],
inline = true,
width = "full",
args = {
autowatchrep = {
type = "toggle",
order = 100,
width = 1.5,
name = L["Auto track reputation"],
desc = L["Automatically switch watched faction to one you gain reputation with"],
},
autotrackguild = {
type = "toggle",
order = 200,
width = 1.5,
name = L["Auto track guild reputation"],
desc = L["Automatically track your guild reputation increases"],
},
},
},
repMenuGroup = {
type = "group",
order = 30,
name = L["Reputation Menu"],
inline = true,
width = "full",
args = {
showRepMenu = {
type = "toggle",
order = 100,
width = "full",
name = L["Show reputation menu"],
desc = L["Show reputation menu instead of standard Reputation window"],
},
menuScale = {
type = "range",
order = 200,
width = 1.5,
disabled = not db.reputation.showRepMenu,
name = L["Scale"],
desc = L["Set reputation menu scale"],
min = 0.5,
max = 2,
step = 0.1,
},
menuAutoHideDelay = {
type = "range",
order = 300,
width = 1.5,
disabled = not db.reputation.showRepMenu,
name = L["Autohide Delay"],
desc = L["Set reputation menu autohide delay time (in seconds)"],
min = 0,
max = 5,
},
watchedFactionLineColor = {
type = "color",
order = 400,
width = 1.5,
disabled = not db.reputation.showRepMenu,
name = L["Watched Faction Line Color"],
desc = L["Set the color of watched faction menu line"],
hasAlpha = true,
get = getRepColor,
set = setRepColor,
},
favoriteFactionLineColor = {
type = "color",
order = 500,
width = 1.5,
disabled = not (db.reputation.showRepMenu and db.reputation.showFavorites),
name = L["Favorite Faction Line Color"],
desc = L["Set the color of favorite faction menu lines"],
hasAlpha = true,
get = getRepColor,
set = setRepColor,
},
},
},
favRepGroup = {
type = "group",
order = 40,
name = L["Favorite Factions"],
inline = true,
width = "full",
args = {
showFavorites = {
type = "toggle",
order = 100,
width = 1.5,
name = L["Show favorite factions"],
desc = L["Show favorite faction popup when mouse is over the bar"],
},
showFavInCombat = {
type = "toggle",
order = 200,
width = 1.5,
disabled = not db.reputation.showFavorites,
name = L["Show in combat"],
desc = L["Show favorite faction popup when in combat"],
},
showFavoritesMods = {
type = "description",
order = 300,
fontSize = "medium",
disabled = not db.reputation.showFavorites,
name = L["Show favorite faction popup only when modifiers are pressed"],
},
showFavoritesModCtrl = {
type = "toggle",
order = 400,
disabled = not db.reputation.showFavorites,
name = modNames.ctrl,
desc = L["%s must be pressed"]:format(FormatKeyColor(modNames.ctrl)),
},
showFavoritesModAlt = {
type = "toggle",
order = 500,
disabled = not db.reputation.showFavorites,
name = modNames.alt,
desc = L["%s must be pressed"]:format(FormatKeyColor(modNames.alt)),
},
showFavoritesModShift = {
type = "toggle",
order = 600,
disabled = not db.reputation.showFavorites,
name = modNames.shift,
desc = L["%s must be pressed"]:format(FormatKeyColor(modNames.shift)),
},
noFavoriteFactionsDesc = {
type = "description",
order = 700,
fontSize = "medium",
hidden = not db.reputation.showFavorites
or next(db.reputation.favorites) ~= nil,
name = t.GetWarning(L["WARNING.NOFAVORITEFACTIONS"]),
},
favoriteFactionsDesc = {
type = "description",
order = 800,
fontSize = "medium",
name = t.GetInfo(L["HELP.FAVORITEFACTIONS"]),
},
},
},
}
}
end
end
local function TraceSettings(key, table)
local function Error(msg)
-- print("TraceSettings error:", msg)
end
local function Trace(tabkey, tab, parents, output)
if type(tabkey) ~= "string" then
return Error("illegal tab key under " .. tconcat(parents))
end
if tabkey == "main" or tabkey == "mouseGroup" or tabkey:sub(1, 3) == "pg_" then
return Error("skipped " .. tabkey .. " under " .. tconcat(parents))
end
if type(tab) ~= "table" or type(tab.type) ~= "string" then
return Error("malformed option table under " .. tconcat(parents))
end
if tab.type == "group" then
if type(tab.args) ~= "table" then
return Error("malformed group element under " .. tconcat(parents))
end
local newParents = Utils.Clone(parents)
if not (tab.inline or tab.guiInline) then
Utils.Push(newParents, tabkey)
end
for k, v in pairs(tab.args) do
Trace(k, v, newParents, output)
end
elseif tab.type == "description" or tab.type == "header" then
return
else
local vals
if tab.type == "execute" then
vals = ""
elseif tab.type == "input" then
vals = "<value>"
elseif tab.type == "toggle" then
vals = "<none>|on|off"
elseif tab.type == "range" then
vals = tostring(tab.min) .. ".." .. tostring(tab.max)
elseif tab.type == "select" then
local values = type(tab.values) == "function" and tab.values() or tab.values
vals = tconcat(Utils.Keys(values), "|")
elseif tab.type == "color" then
vals = "RRGGBBAA||r g b a"
else
vals = "???"
end
Utils.Push(output, { cmd = tconcat(parents, "\32") .. "\32" .. tabkey, desc = tab.desc, name = tab.name, vals = vals })
end
end
local out = {}
Trace(key, table, {}, out)
return out
end
local function GetOptionsTrace(appNames, getOptions)
local apps = {}
for k, v in pairs(appNames) do
apps[k] = TraceSettings(k, getOptions(nil, nil, v[1]))
end
return apps
end
local function GetTrace()
if not optionsTrace then
optionsTrace = GetOptionsTrace(appNames, GetOptions)
end
return optionsTrace
end
local function GetOptionHelpItem(index, item)
local vals, cmd
if item.vals:len() > 20 then
vals, cmd = item.vals, item.cmd .. "\32<value>"
else
vals, cmd = nil, item.cmd .. "\32" .. item.vals
end
return ("opthelp_%02d"):format(index), {
type = "group",
order = index * 10,
name = item.name,
width = "full",
inline = true,
args = {
cmdInput = {
type = "input",
dialogControl = "InteractiveText",
order = 10,
name = "",
width = "full",
get = function() return cmd end,
set = Utils.EmptyFn,
},
valInput = vals and {
type = "input",
dialogControl = "InteractiveText",
order = 20,
name = "",
width = "full",
get = function() return vals end,
set = Utils.EmptyFn,
} or nil,
},
}
end
local function GetOptionHelpTab(tabIndex, key, tabItem)
local tabArgs = {}
for i, v in ipairs(tabItem) do
local itemKey, item = GetOptionHelpItem(i, v)
tabArgs[itemKey] = item
end
return "optHelp_" .. key, {
type = "group",
order = tabIndex * 10,
name = appNames[key][2] or "!NONAME!",
width = "full",
args = tabArgs,
}
end
function GetHelp(uiTypes, uiName, appName)
local optArgs = {
optHeader = {
type = "header",
order = 0,
name = L["Commands for setting options values"],
},
}
local tabIndex = 1
for k, v in pairs(GetTrace()) do
if #k > 0 and v and #v > 0 then
local key, item = GetOptionHelpTab(tabIndex, k, v)
optArgs[key] = item
tabIndex = tabIndex + 1
end
end
if appName == (addonName .. "-Help") then
return {
type = "group",
name = L["Please select help section"],
childGroups = "select",
args = {
formatHelp = {
type = "group",
name = L["Help on format"],
childGroups = "tab",
order = 10,
args = {
bardesc = {
type = "header",
order = 0,
name = wowClassic and L["Format templates for XP and reputation bars"]
or L["Format templates for XP / reputation / azerite power bars"],
},
xpgroup = {
type = "group",
order = 10,
name = L["Experience Bar"],
width = "full",
args = CreateGroupItems(
L["HELP.XPBARTEMPLATE"],
{
{ "curXP", L["Current XP value on the level"] },
{ "maxXP", L["Maximum XP value for the current level"] },
{ "needXP", L["Remaining XP value till the next level"] },
{ "restXP", L["Rested XP bonus value"] },
{ "curPC", L["Current XP value in percents"] },
{ "needPC", L["Remaining XP value in percents"] },
{ "restPC", L["Rested XP bonus value in percents of maximum XP value"] },
{ "pLVL", L["Current level"] },
{ "nLVL", L["Next level"] },
{ "mLVL", L["Maximum character level (current level when XP gain is disabled"] },
{ "KTL", L["Remaining kill number till next level"] },
{ "BTL", L["Remaining bubble (scale tick) number till next level"] },
}
),
},
azergroup = {
type = "group",
order = 20,
name = L["Azerite Bar"],
width = "full",
args = CreateGroupItems(
L["HELP.AZBARTEMPLATE"],
{
{ "name", L["Name of artifact necklace: Heart of Azeroth"] },
{ "curXP", L["Current azerite power value on the level"] },
{ "maxXP", L["Maximum azerite power value for the current level"] },
{ "needXP", L["Remaining azerite power value till the next level"] },
{ "curPC", L["Current azerite power value in percents"] },
{ "needPC", L["Remaining azerite power value in percents"] },
{ "pLVL", L["Current azerite level"] },
{ "nLVL", L["Next azerite level"] },
}
),
},
repgroup = {
type = "group",
order = 30,
name = L["Reputation Bar"],
width = "full",
args = CreateGroupItems(
L["HELP.REPBARTEMPLATE"],
{
{ "faction", L["Watched faction / friend / guild name"] },
{ "standing", L["Faction reputation standing"] },
{ "curRep", L["Current reputation value for the current standing"] },
{ "maxRep", L["Maximum reputation value for the current standing"] },
{ "needRep", L["Remaining reputation value till the next standing"] },
{ "repPC", L["Current reputation value in percents"] },
{ "needPC", L["Remaining reputation value in percents"] },
}
),
},
},
},
optionsHelp = {
type = "group",
name = L["Help on options"],
order = 20,
childGroups = "tab",
args = optArgs,
},
},
}
end
end
end
local function OpenSettings()
--[[
First opening Bars subcategory should expand addon options,
but it does not work now. Although this is required
for addon root category to be selected in Options dialog.
UPD: It works when opening General after Bars.
]]
InterfaceOptionsFrame_OpenToCategory(L["Bars"])
InterfaceOptionsFrame_OpenToCategory(L["General"])
end
local function HandleSettingsCommand(input)
input = (input or ""):trim()
if input == "" then
OpenSettings()
else
local sub, command = input:match("^(%S+)%s+(.+)$")
local tabName = sub and appNames[sub][1] or nil
if tabName then
ACCmd.HandleCommand(C, slashCmd, tabName, command)
end
end
end
local function MigrateSettings(sv)
local function getDBVersion(svVer)
local ver = svVer or ""
local verText, c = ver:match("^V(%d+)(C?)$")
return tonumber(verText) or 0, c and #c > 0
end
local dbVer, dbClassic = getDBVersion(sv.VER)
if sv.profiles then
for name, data in pairs(sv.profiles) do
-- new positioning mode
if dbVer < 821 then
data.general.anchor = "TOPLEFT"
data.general.anchorRelative = "BOTTOMLEFT"
end
-- border texture picker
if dbVer < 822 then
local borderTexNames = {
"Blizzard Dialog", "Blizzard Toast",
"Blizzard Minimap Tooltip", "Blizzard Tooltip"
}
if not data.general.borderTexture then
local style = data.general.borderStyle or 1
local tex = borderTexNames[style]
data.general.borderTexture = tex
data.general.borderStyle = nil
end
end
if dbVer < 823 then
-- Bar priority
local bars = data.bars
if bars then
--[[ No migration ]]
bars.showmaxlevel = nil
bars.showmaxazerite = nil
bars.showrepbar = nil
-- AutoTracking settings
local rep = data.reputation
if rep then
rep.autowatchrep = bars.autowatchrep
rep.autotrackguild = bars.autotrackguild
bars.autowatchrep = nil
bars.autotrackguild = nil
end
end
end
end
end
sv.VER = DB_VERSION
end
C.Empty = empty
C.EVENT_CONFIG_CHANGED = "ConfigChanged"
C.EVENT_PROFILE_CHANGED = "ProfileChanged"
C.XPLockedReasons = xpLockedReasons
C.MAX_PLAYER_LEVEL = MAX_PLAYER_LEVEL
C.OpenSettings = OpenSettings
function C.GetDB()
return db
end
function C.GetPlayerMaxLevel()
if IsXPUserDisabled() then
return UnitLevel("player"), xpLockedReasons.LOCKED_XP
elseif GameLimitedMode_IsActive() then
local capLevel = GetRestrictedAccountData()
return capLevel, xpLockedReasons.MAX_TRIAL_LEVEL
else
return C.MAX_PLAYER_LEVEL, xpLockedReasons.MAX_EXPANSION_LEVEL
end
end
function C.GetActionOrProcessSettings(button, ctrl, alt, shift)
local btnCode, action, actionText
for k, v in pairs(buttons) do
if v == button then
btnCode = k
break
end
end
if not btnCode then
return nil
end
for _, v in ipairs(db.mouse) do
if v.key.button == btnCode and (not not v.key.ctrl) == ctrl
and (not not v.key.alt) == alt and (not not v.key.shift) == shift then
action = v.action
actionText = v.actionText
break
end
end
if not action then
return nil
end
if action ~= empty then
local topic, command = action:match("^([a-z]+):([a-z0-9.-_\32]+)$")
if topic == "actions" then
return command
elseif topic == "settings" then
actionText = command
end
end
if actionText then
HandleSettingsCommand(actionText)
return true
end
return false
end
function C.RegisterConfigChanged(...)
configChangedEvent:AddHandler(...)
end
function C.RegisterProfileChanged(...)
profileChangedEvent:AddHandler(...)
end
function C:OnInitialize()
Event = XPMultiBar:GetModule("Event")
self.db = AceDB:New(addonName .. "DB", defaults, true)
MigrateSettings(self.db.sv)
db = self.db.profile
local myName = md.title
ACRegistry:RegisterOptionsTable(appNames.main[1], GetOptions)
ACRegistry:RegisterOptionsTable(appNames.general[1], GetOptions)
ACRegistry:RegisterOptionsTable(appNames.bars[1], GetOptions)
ACRegistry:RegisterOptionsTable(appNames.reputation[1], GetOptions)
ACRegistry:RegisterOptionsTable(appNames.help[1], GetHelp)
local popts = ADBO:GetOptionsTable(self.db)
ACRegistry:RegisterOptionsTable(appNames.profiles[1], popts)
ACDialog:AddToBlizOptions(appNames.main[1], myName)
ACDialog:AddToBlizOptions(appNames.general[1], appNames.general[2], myName)
ACDialog:AddToBlizOptions(appNames.bars[1], appNames.bars[2], myName)
ACDialog:AddToBlizOptions(appNames.reputation[1], appNames.reputation[2], myName)
ACDialog:AddToBlizOptions(appNames.profiles[1], appNames.profiles[2], myName)
local helpApp = ACDialog:AddToBlizOptions(appNames.help[1], appNames.help[2], myName)
if helpApp then
local helpAppGroupObj = helpApp:GetChildren().obj
helpAppGroupObj:SetTitle(L["Help"])
helpAppGroupObj.SetTitle = Utils.EmptyFn
end
self:RegisterChatCommand(slashCmd, HandleSettingsCommand)
self.db.RegisterCallback(self, "OnProfileChanged", self.EVENT_PROFILE_CHANGED)
self.db.RegisterCallback(self, "OnProfileCopied", self.EVENT_PROFILE_CHANGED)
self.db.RegisterCallback(self, "OnProfileReset", self.EVENT_PROFILE_CHANGED)
configChangedEvent = Event:New(C.EVENT_CONFIG_CHANGED)
profileChangedEvent = Event:New(C.EVENT_PROFILE_CHANGED)
end
function C:ProfileChanged(event, database, newProfileKey)
db = database.profile
profileChangedEvent(db)
end
|
local a = true;
return a; |
return function()
local sortCounterClockwise = require(script.Parent.Parent.sortCounterClockwise)
local getConvexHull = require(script.Parent.Parent.getConvexHull)
local getPolygonArea = require(script.Parent.Parent.getPolygonArea)
local isSquare = require(script.Parent.isSquare)
it("should return false if given less than 4 points", function()
-- https://www.desmos.com/calculator/gay2ou3an9
local points = {
Vector2.new(0, 0),
Vector2.new(0, 5),
Vector2.new(5, 0),
}
local sorted = sortCounterClockwise(points)
local hull = getConvexHull(sorted)
local hullArea = getPolygonArea(hull)
expect(isSquare(hull, hullArea)).to.equal(false)
end)
it("should return true if given a square", function()
-- https://www.desmos.com/calculator/u0qqdblmrg
local points = {
Vector2.new(0, 0),
Vector2.new(0, 5),
Vector2.new(5, 5),
Vector2.new(5, 0),
}
local sorted = sortCounterClockwise(points)
local hull = getConvexHull(sorted)
local hullArea = getPolygonArea(hull)
expect(isSquare(hull, hullArea)).to.equal(true)
end)
it("should return true if given a shape that roughly resembles a square", function()
-- https://www.desmos.com/calculator/um3zmbazlq
local points = {
Vector2.new(0, 0),
Vector2.new(3, 0),
Vector2.new(8, 1),
Vector2.new(0, 3),
Vector2.new(0.5, 8),
Vector2.new(3, 8),
Vector2.new(8, 7),
}
local sorted = sortCounterClockwise(points)
local hull = getConvexHull(sorted)
local hullArea = getPolygonArea(hull)
expect(isSquare(hull, hullArea)).to.equal(true)
end)
it("should return false if given a square with an outlier", function()
local points = {
Vector2.new(0, 0),
Vector2.new(0, 5),
Vector2.new(5, 5),
Vector2.new(5, 0),
Vector2.new(100, 0),
}
local sorted = sortCounterClockwise(points)
local hull = getConvexHull(sorted)
local hullArea = getPolygonArea(hull)
expect(isSquare(hull, hullArea)).to.equal(false)
end)
it("should return false if given a rectangle", function()
local points = {
Vector2.new(0, 0),
Vector2.new(5, 0),
Vector2.new(5, 10),
Vector2.new(0, 10),
}
local sorted = sortCounterClockwise(points)
local hull = getConvexHull(sorted)
local hullArea = getPolygonArea(hull)
expect(isSquare(hull, hullArea)).to.equal(false)
end)
end
|
--
-- Created by IntelliJ IDEA.
-- User: seletz
-- Date: 28.02.18
-- Time: 20:54
-- To change this template use File | Settings | File Templates.
--
local game_state = {
current_room = nil,
flash_frames = nil,
slow_amount = 1,
attacks = {
['Neutral'] = {cooldown = 0.24, ammo = 0, abbreviation = 'N', color = colors.default_color},
['Double'] = {cooldown = 0.32, ammo = 2, abbreviation = '2', color = colors.ammo_color},
['Triple'] = {cooldown = 0.32, ammo = 3, abbreviation = '3', color = colors.boost_color},
['Rapid'] = {cooldown = 0.12, ammo = 1, abbreviation = 'R', color = colors.default_color },
['Spread'] = {cooldown = 0.16, ammo = 1, abbreviation = 'RS', color = colors.default_color},
['Back'] = {cooldown = 0.32, ammo = 2, abbreviation = 'Ba', color = colors.skill_point_color },
['Side'] = {cooldown = 0.32, ammo = 2, abbreviation = 'Si', color = colors.boost_color}
},
}
return game_state
|
local Packages = script.Parent.Parent.Parent.Parent
local Roact = require(Packages.Roact)
local t = require(Packages.t)
local UIBloxConfig = require(Packages.UIBlox.UIBloxConfig)
local RadioButton = require(script.Parent.RadioButton)
local ID_PROP_NAME = UIBloxConfig.renameKeyProp and "id" or "key"
local RadioButtonList = Roact.PureComponent:extend("RadioButtonList")
local validateButton = t.strictInterface({
label = t.string,
isDisabled = t.optional(t.boolean),
})
local validateProps = t.strictInterface({
radioButtons = t.array(t.union(t.string, validateButton)),
onActivated = t.callback,
elementSize = t.UDim2,
selectedValue = t.optional(t.number),
layoutOrder = t.optional(t.number)
})
function RadioButtonList:init()
self.state = {
currentValue = self.props.selectedValue or 0,
}
local disabledIndices = {}
for i, v in ipairs(self.props.radioButtons) do
disabledIndices[i] = type(v) == "table" and v.isDisabled or false
end
self.state.disabledIndices = disabledIndices
self.doLogic = function(key)
if self.state.disabledIndices[key] then return end
self:setState({
currentValue = key,
})
self.props.onActivated(key)
end
end
function RadioButtonList:render()
assert(validateProps(self.props))
local radioButtons = {}
radioButtons.layout = Roact.createElement("UIListLayout", {
SortOrder = Enum.SortOrder.LayoutOrder
})
for i, value in ipairs(self.props.radioButtons) do
radioButtons["RadioButton"..i] = Roact.createElement(RadioButton, {
text = type(value) == "table" and value.label or value,
isSelected = i == self.state.currentValue,
isDisabled = self.state.disabledIndices[i],
onActivated = self.doLogic,
size = self.props.elementSize,
layoutOrder = i,
[ID_PROP_NAME] = i,
})
end
return Roact.createElement("Frame", {
Size = UDim2.new(1, 0, 1, 0),
BackgroundTransparency = 1,
LayoutOrder = self.props.layoutOrder,
}, radioButtons)
end
return RadioButtonList |
local drpath = require("directories")
drpath.addPath("myprograms",
"ZeroBraineProjects",
"CorporateProjects",
-- When not located in general directory search in projects
"ZeroBraineProjects/dvdlualib",
"ZeroBraineProjects/ExtractWireWiki")
drpath.addBase("D:/LuaIDE").setBase(1)
local wikilib = require("dvdlualib/wikilib")
local bPreview = true
local sTubePat = "https://www%.youtube%.com/watch%?v="
local f = assert(io.open("ExtractWireWiki/in/you-links.txt"))
if(f) then
local sRow, iRow = f:read("*line"), 0
while(sRow) do iRow = iRow + 1
if(sRow:find("google") and wikilib.isEncodedURL(sRow)) then
sRow = wikilib.getDecodeURL(sRow)
local s, e = sRow:find(sTubePat)
sRow = sRow:sub(1,1)..sRow:sub(s, e + 11)
end
-----------------------------------------
sRow = sRow:gsub(sTubePat, "/")
tab = wikilib.common.stringExplode(sRow, "/")
if(tab[2]) then
if(bPreview) then
print("aaa", tab[1], tab[2].." ")
for iD = 1, 3 do print(wikilib.insYoutubeVideo(tab[2], iD)) end
else local sOut = wikilib.insYoutubeVideo(tab[2], tab[1])
print(((iRow % 3) == 0) and sOut.." " or sOut)
end
else
print(sRow)
end
-----------------------------------------
sRow = f:read("*line")
end
end
--[[
[](http://www.youtube.com/watch?v=1rsDHU79J50 "." ---
]]
|
local ffi = require "ffi"
local ffi_cdef = ffi.cdef
ffi_cdef[[
typedef struct sha256_ctx {
uint32_t state[8];
uint64_t count;
uint8_t block[64];
unsigned int index;
} SHA256_CTX;
typedef struct sha512_ctx {
uint64_t state[8];
uint64_t count_low, count_high;
uint8_t block[128];
unsigned int index;
} SHA512_CTX;
]] |
local L = Grid2Options.L
local function MakeOptions(self, status, options, optionParams)
self:MakeStatusColorOptions(status, options, optionParams)
options.update = {
type = "range",
order = 20,
name = L["Update rate"],
desc = L["Rate at which the status gets updated"],
min = 0,
max = 5,
step = 0.05,
bigStep = 0.1,
get = function () return status.dbx.updateRate or 0.2 end,
set = function (_, v) status:SetUpdateRate(v) end,
}
end
Grid2Options:RegisterStatusOptions("banzai", "combat", MakeOptions, {
title = L["hostile casts against raid members"],
titleIcon = "Interface\\Icons\\Spell_shadow_deathscream"
})
Grid2Options:RegisterStatusOptions("banzai-threat", "combat", MakeOptions, {
title = L["advanced threat detection"],
titleIcon = "Interface\\Icons\\Spell_shadow_deathscream"
})
|
function isPlayerAdmin(player)
if not isElement(player) or not player.account then
return false
end
if player.account.guest then
return false
end
local adminGroup = ACLGroup.get("Admin")
if not adminGroup then
return false
end
return not not adminGroup:doesContainObject("user." .. tostring(player.account.name))
end |
function onCreate()
makeLuaSprite('Overlay', 'week-ace/Overlay', -600, -300)
addLuaSprite('Overlay', false)
setObjectCamera('Overlay', 'hud')
makeLuaSprite('coldh', 'songlocks/cold-hearted', 0, 500)
scaleObject('coldh', 2.5, 2.5)
end
function onCreatePost()
setProperty('gf.alpha', 0)
end
function onStartCountdown()
addLuaSprite('coldh', true)
runTimer('hide', 1.5)
return Function_Continue;
end
function onTimerCompleted(tag, loops, loopsLeft)
if tag == 'hide' then
doTweenAlpha('hideh', 'coldh', 0, 0.5, 'quintOut')
end
end |
local NWNXEvents = require 'solstice.nwnx.events'
local Inst = require 'ta.instance'
function pl_inst_check()
local pc = Game.GetPCSpeaker()
local trig = pc:GetLocalObject("PL_CONV_WITH")
local node = NWNXEvents.GetCurrentNodeID()
return node <= trig:GetLocalInt("instance_level")
end
function pl_inst_do()
local pc = Game.GetPCSpeaker()
local trig = pc:GetLocalObject("PL_CONV_WITH")
local target = trig:GetTransitionTarget()
local tar_area = target:GetArea()
local tag = target:GetTag()
local level = NWNXEvents.GetSelectedNodeID()
--if level > 0 and tar_area:GetLocalBool("area_can_instance") then
-- Inst.CreateInstance(trig, target:GetArea(), level)
-- target = Inst.GetInstanceTarget(target, pc, level)
--end
pc:ActionJumpToObject(target)
end
|
--[[
Variables
]]
local Keys = {}
--[[
Events
]]
RegisterNetEvent("SpawnEventsServer")
AddEventHandler("SpawnEventsServer", function()
local src = source
local cid = exports["caue-base"]:getChar(src, "id")
if not cid then return end
if Keys[cid] then
TriggerClientEvent("keys:receive", src, Keys[cid])
end
end)
RegisterNetEvent("keys:update")
AddEventHandler("keys:update", function(type, value)
local src = source
local cid = exports["caue-base"]:getChar(src, "id")
if not cid then return end
if not Keys[cid] then
Keys[cid] = {}
end
if not Keys[cid][type] then
Keys[cid][type] = {}
end
table.insert(Keys[cid][type], value)
end)
RegisterNetEvent("caue-vehicles:sendKeys")
AddEventHandler("caue-vehicles:sendKeys", function(target, identifier, plate)
local src = source
TriggerClientEvent("keys:addNew", target, 0, identifier, plate)
TriggerClientEvent("DoLongHudText", src, "You gived the keys from vehicle")
TriggerClientEvent("DoLongHudText", target, "You received the keys from vehicle")
end) |
local json = require('json')
local enums = require('enums')
local class = require('class')
local Channel = require('containers/abstract/Channel')
local PermissionOverwrite = require('containers/PermissionOverwrite')
local Invite = require('containers/Invite')
local Cache = require('iterables/Cache')
local Resolver = require('client/Resolver')
local isInstance = class.isInstance
local classes = class.classes
local channelType = enums.channelType
local insert, sort = table.insert, table.sort
local min, max, floor = math.min, math.max, math.floor
local huge = math.huge
local GuildChannel, get = class('GuildChannel', Channel)
function GuildChannel:__init(data, parent)
Channel.__init(self, data, parent)
self.client._channel_map[self._id] = parent
self._permission_overwrites = Cache({}, PermissionOverwrite, self)
return self:_loadMore(data)
end
function GuildChannel:_load(data)
Channel._load(self, data)
return self:_loadMore(data)
end
function GuildChannel:_loadMore(data)
return self._permission_overwrites:_load(data.permission_overwrites, true)
end
function GuildChannel:setName(name)
return self:_modify({name = name or json.null})
end
function GuildChannel:setCategory(id)
id = Resolver.channelId(id)
return self:_modify({parent_id = id or json.null})
end
local function sorter(a, b)
if a.position == b.position then
return tonumber(a.id) < tonumber(b.id)
else
return a.position < b.position
end
end
local function getSortedChannels(self)
local channels
local t = self._type
if t == channelType.text then
channels = self._parent._text_channels
elseif t == channelType.voice then
channels = self._parent._voice_channels
elseif t == channelType.category then
channels = self._parent._categories
end
local ret = {}
for channel in channels:iter() do
insert(ret, {id = channel._id, position = channel._position})
end
sort(ret, sorter)
return ret
end
local function setSortedChannels(self, channels)
local data, err = self.client._api:modifyGuildChannelPositions(self._parent._id, channels)
if data then
return true
else
return false, err
end
end
function GuildChannel:moveUp(n)
n = tonumber(n) or 1
if n < 0 then
return self:moveDown(-n)
end
local channels = getSortedChannels(self)
local new = huge
for i = #channels - 1, 0, -1 do
local v = channels[i + 1]
if v.id == self._id then
new = max(0, i - floor(n))
v.position = new
elseif i >= new then
v.position = i + 1
else
v.position = i
end
end
return setSortedChannels(self, channels)
end
function GuildChannel:moveDown(n)
n = tonumber(n) or 1
if n < 0 then
return self:moveUp(-n)
end
local channels = getSortedChannels(self)
local new = -huge
for i = 0, #channels - 1 do
local v = channels[i + 1]
if v.id == self._id then
new = min(i + floor(n), #channels - 1)
v.position = new
elseif i <= new then
v.position = i - 1
else
v.position = i
end
end
return setSortedChannels(self, channels)
end
function GuildChannel:createInvite(payload)
local data, err = self.client._api:createChannelInvite(self._id, payload)
if data then
return Invite(data, self.client)
else
return nil, err
end
end
function GuildChannel:getInvites()
local data, err = self.client._api:getChannelInvites(self._id)
if data then
return Cache(data, Invite, self.client)
else
return nil, err
end
end
function GuildChannel:getPermissionOverwriteFor(obj)
local id, type
if isInstance(obj, classes.Role) and self._parent == obj._parent then
id, type = obj._id, 'role'
elseif isInstance(obj, classes.Member) and self._parent == obj._parent then
id, type = obj._user._id, 'member'
else
return nil, 'Invalid Role or Member: ' .. tostring(obj)
end
local overwrites = self._permission_overwrites
return overwrites:get(id) or overwrites:_insert(setmetatable({
id = id, type = type, allow = 0, deny = 0
}, {__jsontype = 'object'}))
end
function GuildChannel:delete()
return self:_delete()
end
function get.permissionOverwrites(self)
return self._permission_overwrites
end
function get.name(self)
return self._name
end
function get.position(self)
return self._position
end
function get.guild(self)
return self._parent
end
function get.category(self)
return self._parent._categories:get(self._parent_id)
end
return GuildChannel
|
-- create node Matrix3
require "moon.sg"
local node = moon.sg.new_node("sg_mat3")
if node then
node:set_pos(moon.mouse.get_position())
end |
local a = {}
assert(table.maxn(a) == 0)
a["key"] = 1
assert(table.maxn(a) == 0)
table.insert(a, 10)
table.insert(a, 3, 10)
assert(table.maxn(a) == 3)
local ok, msg = pcall(function()
table.insert(a)
end)
assert(not ok and string.find(msg, "wrong number of arguments"))
|
-----------------------------------
-- Area: Windurst Woods
-- NPC: Roberta
-- !pos 21 -4 -157 241
-----------------------------------
local ID = require("scripts/zones/Windurst_Woods/IDs")
require("scripts/globals/quests")
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
local BlueRibbonBlues = player:getQuestStatus(WINDURST, tpz.quest.id.windurst.BLUE_RIBBON_BLUES)
if BlueRibbonBlues == QUEST_ACCEPTED then
local blueRibbonProg = player:getCharVar("BlueRibbonBluesProg")
if blueRibbonProg >= 2 and player:hasItem(13569) then
player:startEvent(380)
elseif player:hasItem(13569) then
player:startEvent(379)
elseif not player:hasItem(13569) then
if blueRibbonProg == 1 or blueRibbonProg == 3 then
player:startEvent(377, 0, 13569) -- replaces ribbon if lost
elseif blueRibbonProg < 1 then
player:startEvent(376, 0, 13569) -- gives us ribbon
end
else
player:startEvent(436)
end
else
player:startEvent(436)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
if (csid == 376 or csid == 377) and option == 1 then
if player:getFreeSlotsCount() >= 1 then
local blueRibbonProg = player:getCharVar("BlueRibbonBluesProg")
if blueRibbonProg < 1 then
player:setCharVar("BlueRibbonBluesProg", 1)
elseif blueRibbonProg == 3 then
player:setCharVar("BlueRibbonBluesProg", 4)
end
player:addItem(13569)
player:messageSpecial(ID.text.ITEM_OBTAINED, 13569)
else
player:messageSpecial(ID.text.ITEM_CANNOT_BE_OBTAINED, 13569)
end
end
end
|
local typedefs = require "kong.db.schema.typedefs"
local schema = {
name = "path-test",
fields = {
{ config = {
type = "record",
fields = {
{ path = typedefs.path{ required = true } }
}
}
}
}
}
return schema |
local access = {}
local utils = require 'kong.tools.utils'
local params = require 'kong.lib.params'
local request = require 'kong.lib.request'
local resData = require 'kong.lib.response'
local exception = require 'kong.plugins.api-polymerization.exception'
local function check(config)
local names = config.request_config.names
local urls = config.request_config.urls
local types = config.request_config.types
if ngx.is_subrequest then
resData(exception.REQ_WAS_SUBREQUEST)
end
if #names ~= #urls or #names ~= #types then
resData(exception.CONFIG_DATA_FAIL)
end
end
local function init(config, args, body)
local resps = {}
local all_args = utils.table_merge(args, body)
for i, v in ipairs(config.request_config.names) do
local name = config.request_config.names[i]
local url = config.request_config.urls[i]
local method = config.request_config.methods[i]
local type = config.request_config.types[i]
local options = {}
options['method'] = method
if(type == 'json') then
options['headers'] = {
['Content-Type'] = 'application/json;charset=UTF-8'
}
end
if(type == 'form') then
options['headers'] = {
['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
}
end
if(method == 'GET') then
resps[name] = request(url .. '?' .. ngx.encode_args(all_args), options)
end
if(method == 'POST') then
options['body'] = ngx.encode_args(all_args)
resps[name] = request(url, options)
end
options = {}
end
resData({code = 1, data = resps, msg = ''})
end
function access.execute(config)
local params = params()
local args, body = params.args, params.body
check(config)
init(config, args, body)
end
return access |
_G.kWebSocketScriptHandlerOpen = cc.WEBSOCKET_OPEN
_G.kWebSocketScriptHandlerMessage = cc.WEBSOCKET_MESSAGE
_G.kWebSocketScriptHandlerClose = cc.WEBSOCKET_CLOSE
_G.kWebSocketScriptHandlerError = cc.WEBSOCKET_ERROR
_G.kStateConnecting = cc.WEBSOCKET_STATE_CONNECTING
_G.kStateOpen = cc.WEBSOCKET_STATE_OPEN
_G.kStateClosing = cc.WEBSOCKET_STATE_CLOSING
_G.kStateClosed = cc.WEBSOCKET_STATE_CLOSED
|
return function (Data)
local TableString, ErrMsg = Split(tostring(Data), "|")
if not TableString then
return nil, ErrMsg
end
return TableString
end |
huff_darklighter_2_outfit = {
{
{objectTemplate = "object/tangible/wearables/shirt/shirt_s07.iff", customizationVariables = {{"/private/index_color_1", 158}} },
{objectTemplate = "object/tangible/wearables/pants/pants_s12.iff", customizationVariables = {{"/private/index_color_1", 60}} },
{objectTemplate = "object/tangible/hair/human/hair_human_male_s32.iff", customizationVariables = {{"/private/index_color_1", 13}} },
{objectTemplate = "object/tangible/wearables/boots/boots_s05.iff", customizationVariables = {{"/private/index_color_2", 31}, {"/private/index_color_1", 27}} },
{objectTemplate = "object/tangible/wearables/belt/belt_s02.iff", customizationVariables = {{"/private/index_color_2", 55}, {"/private/index_color_1", 30}} },
{objectTemplate = "object/tangible/wearables/vest/vest_s04.iff", customizationVariables = {{"/private/index_color_1", 89}} },
}
}
addOutfitGroup("huff_darklighter_2_outfit", huff_darklighter_2_outfit) |
--[[
utils.lua
Some additional functions, they are not related explicitly related
to the main addon functionality
--]]
local ADDON, Addon = ...
Addon.debug = false
local string = string
local SendChatMessage = SendChatMessage
local DEFAULT_CHAT_FRAME = DEFAULT_CHAT_FRAME
function Addon:Print(msg)
DEFAULT_CHAT_FRAME:AddMessage("|c006969FFRaccoonPoints: " .. msg .. "|r")
end
function Addon:DebugMsg(msg)
if Addon.debug then
self:Print(msg)
end
end
function Addon:WriteGuild(msg)
SendChatMessage(msg, 'GUILD');
end
function Addon:CleanName(name)
if not name then return; end
local dash_position = string.find(name, '-');
if dash_position then
name = string.sub(name, 0, dash_position - 1);
end
return name;
end
|
function Client_PresentConfigureUI(rootParent)
if initialValue == nil then initialValue = 3; end
local vert = UI.CreateVerticalLayoutGroup(rootParent);
allowTransferingBox = UI.CreateCheckBox(vert).SetText('Allows that a commander can transfer').SetIsChecked(true);
allowAttackingBox = UI.CreateCheckBox(vert).SetText('Allows that a commander can attack/transfer').SetIsChecked(true);
local horz = UI.CreateHorizontalLayoutGroup(vert);
UI.CreateLabel(horz).SetText('Number of commanders each player gets on turn 1');
NumberOfCommandersSlider = UI.CreateNumberInputField(horz)
.SetSliderMinValue(1)
.SetSliderMaxValue(4)
.SetValue(initialValue);
end
|
-- phone call
local line = 1
local text = "Placeholder"
local timer = 0
local nexta = false
while true do
buttons.read()
rama:blit(0,0)
bgcall:blit(window[1],window[2])
textbox:blit(window[1],window[2] + 190)
screen.print(window[1] + 18,window[2] + 220,text,0.8)
screen.print(window[1] + 5,window[2] + 5,timer,0.5)
if timer < 100 then
timer = timer + 1
nexta = false
end
if timer >= 100 then
nexta = true
end
if buttons.cross and nexta == true then
line = line + 1
timer = 0
end
if buttons.square then
timer = timer + 100
end
-- text strings
if night == 1 then
if line == 1 then
text = "Ring... Ring..."
end
if line == 2 then
text = "Ring... Ring..."
end
if line == 3 then
text = "Hello, hello? Uh..."
end
if line == 4 then
text = "Welcome to Freddy\nFazbear's Pizza!"
end
if line == 5 then
text = "Where fantasy comes\nto life..."
end
if line == 6 then
text = "Blah blah blah..."
end
if line == 7 then
text = "The company is\nnot responsible for"
end
if line == 8 then
text = "damage to property\nor person..."
end
if line == 9 then
text = "Blah blah blah..."
end
if line == 10 then
text = "...missing person\nreport..."
end
if line == 11 then
text = "Blah blah blah..."
end
if line == 12 then
text = "Sorry, I'm obliged\nto read that."
end
if line == 13 then
text = "Uh, it's a legal\nthing, you know..."
end
if line == 14 then
text = "Um..."
end
if line == 15 then
text = "I know that may sound\nbad and all,"
end
if line == 16 then
text = "but there's nothing\nto worry about."
end
if line == 17 then
text = "I actually worked\nthere before you."
end
if line == 18 then
text = "I'm finishing up\nmy last week now."
end
if line == 19 then
text = "I know it can be over-\nwhelming, so"
end
if line == 20 then
text = "I wanted to record\nthis message"
end
if line == 21 then
text = "to guide you on\nyour first night."
end
if line == 22 then
text = "So, as i said, nothing\nto worry."
end
if line == 23 then
text = "You'll do just fine."
end
if line == 24 then
text = "Now, about the\nanimatronics..."
end
if line == 25 then
text = "They used to roam\nduring the day,"
end
if line == 26 then
text = "but then there was\nThe Bite of '87."
end
if line == 27 then
text = "..."
end
if line == 28 then
text = "It's impressive how\nhuman body can"
end
if line == 29 then
text = "survive without a\nfrontal lobe..."
end
if line == 30 then
text = "Forget that.\nThe point is:"
end
if line == 31 then
text = "Now they free roam\nduring the night."
end
if line == 32 then
text = "It prevents them\nfrom locking up."
end
if line == 33 then
text = "Because of that,\nthey may, uh..."
end
if line == 34 then
text = "...wander into your\noffice and..."
end
if line == 35 then
text = "...mistake you for\nanendoskeleton..."
end
if line == 36 then
text = "...try and stuff you\ninto a suit..."
end
if line == 37 then
text = "...that might cause\nyou some..."
end
if line == 38 then
text = "...discomfort..."
end
if line == 39 then
text = "...and death."
end
if line == 40 then
text = "..."
end
if line == 41 then
text = "To prevent that from\nhappening,"
end
if line == 42 then
text = "Press TRIANGLE to\nflip the monitor"
end
if line == 43 then
text = "to see where they\ncurrently are."
end
if line == 44 then
text = "Pressing it again\nwill flip the monitor"
end
if line == 45 then
text = "back."
end
if line == 46 then
text = "If you can't find any\nof them,"
end
if line == 47 then
text = "then it means they are\nby the door."
end
if line == 48 then
text = "Hold LEFT or\nRIGHT to select a door,"
end
if line == 49 then
text = "X to turn on the\nhall light,"
end
if line == 50 then
text = "and SQUARE to shut the\ndoor."
end
if line == 51 then
text = "That'll make them\nleave."
end
if line == 52 then
text = "For a while."
end
if line == 53 then
text = "Well, that's it for\nnow."
end
if line == 54 then
text = "Hope you are not\noverwhelmed."
end
if line == 55 then
text = "Oh, and check the\npower meter."
end
if line == 56 then
text = "Power is very limited\nhere."
end
if line == 57 then
text = "Alright, good night."
end
if line == 58 then
dofile("scripts/whatnight.lua")
end
end
if night == 2 then
if line == 1 then
text = "Ring... Ring..."
end
if line == 2 then
text = "Ring... Ring..."
end
if line == 3 then
text = "Hello, hello? Uh..."
end
if line == 4 then
text = "If you're hearing this,\nthen..."
end
if line == 5 then
text = "it means you made it\nto night two!"
end
if line == 6 then
text = "Uh, congrats!"
end
if line == 7 then
text = "I won't talk as much this time,"
end
if line == 8 then
text = "since they tent to become\nmore"
end
if line == 9 then
text = "aggresive as the week\n progresses."
end
if line == 10 then
text = "...missing person\nreport..."
end
if line == 11 then
text = "Blah blah blah..."
end
if line == 12 then
text = "Sorry, I'm obliged\nto read that."
end
if line == 13 then
text = "Uh, it's a legal\nthing, you know..."
end
if line == 14 then
text = "Um..."
end
if line == 15 then
text = "I know that may sound\nbad and all,"
end
if line == 16 then
text = "but there's nothing\nto worry about."
end
if line == 17 then
text = "I actually worked\nthere before you."
end
if line == 18 then
text = "I'm finishing up\nmy last week now."
end
if line == 19 then
text = "I know it can be over-\nwhelming, so"
end
if line == 20 then
text = "I wanted to record\nthis message"
end
if line == 21 then
text = "to guide you on\nyour first night."
end
if line == 22 then
text = "So, as i said, nothing\nto worry."
end
if line == 23 then
text = "You'll do just fine."
end
if line == 24 then
text = "Now, about the\nanimatronics..."
end
if line == 25 then
text = "They used to roam\nduring the day,"
end
if line == 26 then
text = "but then there was\nThe Bite of '87."
end
if line == 27 then
text = "..."
end
if line == 28 then
text = "It's impressive how\nhuman body can"
end
if line == 29 then
text = "survive without a\nfrontal lobe..."
end
if line == 30 then
text = "Forget that.\nThe point is:"
end
if line == 31 then
text = "Now they free roam\nduring the night."
end
if line == 32 then
text = "It prevents them\nfrom locking up."
end
if line == 33 then
text = "Because of that,\nthey may, uh..."
end
if line == 34 then
text = "...wander into your\noffice and..."
end
if line == 35 then
text = "...mistake you for\nanendoskeleton..."
end
if line == 36 then
text = "...try and stuff you\ninto a suit..."
end
if line == 37 then
text = "...that might cause\nyou some..."
end
if line == 38 then
text = "...discomfort..."
end
if line == 39 then
text = "...and death."
end
if line == 40 then
text = "..."
end
if line == 41 then
text = "To prevent that from\nhappening,"
end
if line == 42 then
text = "Press TRIANGLE to\nflip the monitor"
end
if line == 43 then
text = "to see where they\ncurrently are."
end
if line == 44 then
text = "Pressing it again\nwill flip the monitor"
end
if line == 45 then
text = "back."
end
if line == 46 then
text = "If you can't find any\nof them,"
end
if line == 47 then
text = "then it means they are\nby the door."
end
if line == 48 then
text = "Hold LEFT or\nRIGHT to select a door,"
end
if line == 49 then
text = "X to turn on the\nhall light,"
end
if line == 50 then
text = "and SQUARE to shut the\ndoor."
end
if line == 51 then
text = "That'll make them\nleave."
end
if line == 52 then
text = "For a while."
end
if line == 53 then
text = "Well, that's it for\nnow."
end
if line == 54 then
text = "Hope you are not\noverwhelmed."
end
if line == 55 then
text = "Oh, and check the\npower meter."
end
if line == 56 then
text = "Power is very limited\nhere."
end
if line == 57 then
text = "Alright, good night."
end
if line == 58 then
dofile("scripts/whatnight.lua")
end
end
screen.flip()
end |
------------------------
-- StateAnimatedSprite class.
-- Contains multiple @{Sprite|sprites} that are drawn based on the current state.
--
-- Derived from @{Object}.
-- @cl StateAnimatedSprite
local StateAnimatedSprite = class("StateAnimatedSprite")
--[[
void StateAnimatedSprite:setState( state )
void StateAnimatedSprite:setSpeed( speed )
void StateAnimatedSprite:resetAnimation()
void StateAnimatedSprite:update( dt )
void StateAnimatedSprite:draw(x, y, r, sx, sy)
Layout format example:
layout = {
[0] = {
state_name = "moveleft",
num_columns = 4,
num_frames = 8,
offset = Vector(0,0), -- relative offset. So on the image it's image_offset + this offset
fps = 2, -- frames per second
loops = false,
}
[1] = {
etc...
}
}
]]--
function StateAnimatedSprite:initialize( layout, image_file, img_offset, frame_size, frame_origin )
self._sprites = {}
self._state = ""
self._speed = 1
for k, v in pairs( layout ) do
local sData = SpriteData( image_file, img_offset + v.offset, frame_size, frame_origin, v.num_columns, v.num_frames, v.fps, v.loops )
self._sprites[v.state_name] = Sprite(sData)
end
end
function StateAnimatedSprite:setState( state, reapply )
if (self._sprites[state] and not (not reapply and state == self._state)) then
self._sprites[state]:reset()
self._sprites[state]:setSpeed( self._speed )
self._state = state
end
end
function StateAnimatedSprite:setSpeed( speed )
self._speed = speed
if (self._sprites[self._state]) then
self._sprites[self._state]:setSpeed( speed )
end
end
function StateAnimatedSprite:getSpeed()
if (self._sprites[self._state]) then
return self._sprites[self._state]:getSpeed()
end
return 0
end
function StateAnimatedSprite:getWidth()
return self._sprites[self._state]:getWidth()
end
function StateAnimatedSprite:getHeight()
return self._sprites[self._state]:getHeight()
end
function StateAnimatedSprite:resetAnimation()
if (self._sprites[self._state]) then
self._sprites[self._state]:reset()
end
end
function StateAnimatedSprite:update( dt )
if (self._sprites[self._state]) then
self._sprites[self._state]:update( dt )
end
end
function StateAnimatedSprite:draw(x, y, r, sx, sy)
if (self._sprites[self._state]) then
self._sprites[self._state]:draw( x, y, r, sx, sy )
end
end
return StateAnimatedSprite |
object_tangible_dungeon_mustafar_obiwan_finale_obiwan_finale_launch_object = object_tangible_dungeon_mustafar_obiwan_finale_shared_obiwan_finale_launch_object:new {
}
ObjectTemplates:addTemplate(object_tangible_dungeon_mustafar_obiwan_finale_obiwan_finale_launch_object, "object/tangible/dungeon/mustafar/obiwan_finale/obiwan_finale_launch_object.iff")
|
local class = require 'lib.middleclass'
local Gamestate = class('Gamestate')
function Gamestate:initialize(name)
self.name = name
end
-- Subclasses should replace these
function Gamestate:enter()
end
function Gamestate:exit()
end
function Gamestate:returnTo()
end
function Gamestate:draw()
end
function Gamestate:update(dt)
end
function Gamestate:mousepressed(x, y, button)
end
function Gamestate:mousemoved(x, y, dx, dy, istouch)
end
function Gamestate:mousereleased(x, y, button)
end
function Gamestate:wheelmoved(x, y)
end
return Gamestate
|
require("oh-my-hammerspoon")
omh_go({
"plugins.misc.hyperkey",
"plugins.apps.hammerspoon_toggle_console",
"plugins.apps.hammerspoon_install_cli",
"plugins.apps.hammerspoon_config_reload",
"plugins.windows.manipulation",
"plugins.windows.grid",
"plugins.apps.skype_mute",
"plugins.mouse.locator",
"plugins.misc.clipboard"
})
|
--[[
SAT - Satellite Imagery Script - Version: 1.01 - 16/1/2020 by Theodossis Papadopoulos
-- Requires MIST
]]
local maxSATTargets = 8 -- How much targets will SAT provide at maximum
local imageEvery = 600 -- How many seconds between each SAT Image update (if SAT station is still alive)
local SAT_NAMES_BLUE = {"SAT_1", "SAT_2"} -- Names of units/statics providing SAT Imagery for BLUE team
local SAT_NAMES_RED = {"SAT_RED"} -- Names of units/statics providing SAT Imagery for RED team
local mainbaseBlue = "Al Ain International Airport"
local mainbaseRed = "Khasab"
-- --------------------------CODE DO NOT TOUCH--------------------------
local DET_TARGETS_BLUE = {} -- UNIT_NAME, TYPE, POS (IN VEC3) which targets have blue SAT detected
local DET_TARGETS_RED = {} -- Which targets have red SAT detected
local function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
local function contains(tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
local function tableConcat(t1, t2)
for i=1, #t2 do
t1[#t1+1] = t2[i]
end
return t1
end
local function round(x, n)
n = math.pow(10, n or 0)
x = x * n
if x >= 0 then x = math.floor(x + 0.5) else x = math.ceil(x - 0.5) end
return x / n
end
local function tableStr(tab)
local finalStr = ""
for i=1, tablelength(tab) do
finalStr = finalStr .. tab[i] .. " "
end
return finalStr
end
local function updateTargets()
-- For Blue team (searching RED targets)
if tablelength(SAT_NAMES_BLUE) > 0 then
DET_TARGETS_BLUE = {}
local minDistUnits = {}
for k=1, maxSATTargets do
local minTemp = Group.getByName("MAX_DIST"):getUnit(1)
for i, gp in pairs(coalition.getGroups(coalition.side.RED)) do
if gp:getCategory() == Group.Category.GROUND then
for j, un in pairs(gp:getUnits()) do
if((un:getPosition().p.x - Airbase.getByName(mainbaseBlue):getPosition().p.x)^2 + (un:getPosition().p.z - Airbase.getByName(mainbaseBlue):getPosition().p.z)^2)^0.5 < ((minTemp:getPosition().p.x - Airbase.getByName(mainbaseBlue):getPosition().p.x)^2 + (minTemp:getPosition().p.z - Airbase.getByName(mainbaseBlue):getPosition().p.z)^2)^0.5 then -- FOUND CLOSER
if contains(minDistUnits, un) == false and un:isActive() == true then
minTemp = un
end
end
end
end
end
if contains(minDistUnits, minTemp) == false then
minDistUnits[tablelength(minDistUnits) + 1] = minTemp
end
end
for i=1, tablelength(minDistUnits) do
local un = minDistUnits[i]
if un:getName() ~= "MAX_DIST" then
DET_TARGETS_BLUE[tablelength(DET_TARGETS_BLUE) + 1] = {["UNIT_NAME"] = un:getName(), ["TYPE"] = un:getTypeName(), ["POS"] = un:getPosition().p}
end
end
trigger.action.outTextForCoalition(coalition.side.BLUE, "SAT targets have been updated", 20)
end
-- For Red team (searching BLUE targets)
if tablelength(SAT_NAMES_RED) > 0 then
DET_TARGETS_RED = {}
local minDistUnits = {}
for k=1, maxSATTargets do
local minTemp = Group.getByName("MAX_DIST"):getUnit(1)
for i, gp in pairs(coalition.getGroups(coalition.side.BLUE)) do
if gp:getCategory() == Group.Category.GROUND then
for j, un in pairs(gp:getUnits()) do
if((un:getPosition().p.x - Airbase.getByName(mainbaseRed):getPosition().p.x)^2 + (un:getPosition().p.z - Airbase.getByName(mainbaseRed):getPosition().p.z)^2)^0.5 < ((minTemp:getPosition().p.x - Airbase.getByName(mainbaseRed):getPosition().p.x)^2 + (minTemp:getPosition().p.z - Airbase.getByName(mainbaseRed):getPosition().p.z)^2)^0.5 then -- FOUND CLOSER
if contains(minDistUnits, un) == false and un:isActive() == true then
minTemp = un
end
end
end
end
end
if contains(minDistUnits, minTemp) == false then
minDistUnits[tablelength(minDistUnits) + 1] = minTemp
end
end
for i=1, tablelength(minDistUnits) do
local un = minDistUnits[i]
if un:getName() ~= "MAX_DIST" then
DET_TARGETS_RED[tablelength(DET_TARGETS_RED) + 1] = {["UNIT_NAME"] = un:getName(), ["TYPE"] = un:getTypeName(), ["POS"] = un:getPosition().p}
end
end
trigger.action.outTextForCoalition(coalition.side.RED, "SAT targets have been updated", 20)
end
end
local function showTargets(gpid)
local earlyBreak = false
local blueUnits = mist.utils.deepCopy(coalition.getPlayers(coalition.side.BLUE))
local redUnits = mist.utils.deepCopy(coalition.getPlayers(coalition.side.RED))
local allUnits = tableConcat(blueUnits, redUnits)
for j=1, tablelength(allUnits) do
local us = allUnits[j]
if us:getGroup():getID() == gpid then -- Found him/them for two seat
earlyBreak = true
local finalMsg = nil
if us:getCoalition() == coalition.side.BLUE then
if tablelength(SAT_NAMES_BLUE) > 0 then -- Do satellite comm towers work?
finalMsg = "Satellite report for enemy targets: (Fetching from " .. tableStr(SAT_NAMES_BLUE) .. ")"
for i=1, tablelength(DET_TARGETS_BLUE) do
local lati, longi, alt = coord.LOtoLL(DET_TARGETS_BLUE[i].POS)
finalMsg = finalMsg .. "\nTarget Type: " .. DET_TARGETS_BLUE[i].TYPE .. " at coordinates " .. mist.tostringLL(lati, longi, 4) .. " " .. round(alt*3.281, 0) .. "ft"
end
else
finalMsg = "Satellite communication towers have been destroyed! Your team no longer have Satellite Imagery"
end
elseif us:getCoalition() == coalition.side.RED then
if tablelength(SAT_NAMES_RED) > 0 then -- Do satellite comm towers work?
finalMsg = "Satellite report for enemy targets: (Fetching from " .. tableStr(SAT_NAMES_RED) .. ")"
for i=1, tablelength(DET_TARGETS_RED) do
local lati, longi, alt = coord.LOtoLL(DET_TARGETS_RED[i].POS)
finalMsg = finalMsg .. "\nTarget Type: " .. DET_TARGETS_RED[i].TYPE .. " at coordinates " .. mist.tostringLL(lati, longi, 4) .. " " .. round(alt*3.281, 0) .. "ft"
end
else
finalMsg = "Satellite communication towers have been destroyed! Your team no longer have Satellite Imagery"
end
end
trigger.action.outTextForGroup(gpid, finalMsg, 45)
end
if earlyBreak == true then
break
end
end
end
local EV_MANAGER = {}
function EV_MANAGER:onEvent(event)
if event.id == world.event.S_EVENT_BIRTH then
if event.initiator:getCategory() == Object.Category.UNIT then
if event.initiator:getGroup():getCategory() == Group.Category.AIRPLANE or event.initiator:getGroup():getCategory() == Group.Category.HELICOPTER then
local gpid = event.initiator:getGroup():getID()
missionCommands.removeItemForGroup(event.initiator:getGroup():getID(), {[1] = "Show SAT targets"})
missionCommands.addCommandForGroup(gpid, "Show SAT targets", nil, showTargets, gpid)
end
end
elseif event.id == world.event.S_EVENT_DEAD then -- SAT Death
if event.initiator:getCategory() == Object.Category.UNIT or event.initiator:getCategory() == Object.Category.STATIC then
-- Check for Blue team
if event.initiator:getCoalition() == coalition.side.BLUE then
for i=1, tablelength(SAT_NAMES_BLUE) do
if SAT_NAMES_BLUE[i] == event.initiator:getName() then -- FOUND IT
table.remove(SAT_NAMES_BLUE, i)
trigger.action.outTextForCoalition(coalition.side.BLUE, "Our satellite station: " .. event.initiator:getName() .. " has just been destroyed!", 30)
trigger.action.outTextForCoalition(coalition.side.RED, "We have successfully destroyed blue's team satellite station: " .. event.initiator:getName(), 30)
end
end
end
-- Check for Red team
if event.initiator:getCoalition() == coalition.side.RED then
for i=1, tablelength(SAT_NAMES_RED) do
if SAT_NAMES_RED[i] == event.initiator:getName() then -- FOUND IT
table.remove(SAT_NAMES_RED, i)
trigger.action.outTextForCoalition(coalition.side.RED, "Our satellite station: " .. event.initiator:getName() .. " has just been destroyed!", 30)
trigger.action.outTextForCoalition(coalition.side.BLUE, "We have successfully destroyed red's team satellite station: " .. event.initiator:getName(), 30)
end
end
end
end
end
-- Debug
--[[if event.id == world.event.S_EVENT_TAKEOFF then
if event.place ~= nil then
if event.place:getCategory() == Object.Category.BASE then
if event.place:getName() == "Al Ain International Airport" then
trigger.action.outText("true", 15)
end
end
end
end ]]
end
world.addEventHandler(EV_MANAGER)
mist.scheduleFunction(updateTargets, nil, timer.getTime(), imageEvery) |
local awful = require('awful')
require('awful.autofocus')
local beautiful = require('beautiful')
local terminal = "alacritty"
local hotkeys_popup = require('awful.hotkeys_popup').widget
require('module.brightness-osd')
local modkey = "Mod4"
local altKey = "Mod1"
function poweroff_command()
awful.spawn.with_shell('poweroff')
awful.keygrabber.stop(exit_screen_grabber)
end
-- Tag related keybindings
awful.keyboard.append_global_keybindings({
awful.key {
modifiers = { modkey },
keygroup = "numrow",
description = "only view tag",
group = "tag",
on_press = function (index)
local screen = awful.screen.focused()
local tag = screen.tags[index]
if tag then
tag:view_only()
end
end,
},
awful.key(
{altKey},
'space',
function()
screen.primary.left_panel:toggle(true)
end,
{description = 'show main menu', group = 'awesome'}
),
awful.key {
modifiers = { modkey, "Control" },
keygroup = "numrow",
description = "toggle tag",
group = "tag",
on_press = function (index)
local screen = awful.screen.focused()
local tag = screen.tags[index]
if tag then
awful.tag.viewtoggle(tag)
end
end,
},
awful.key {
modifiers = { modkey, "Shift" },
keygroup = "numrow",
description = "move focused client to tag",
group = "tag",
on_press = function (index)
if client.focus then
local tag = client.focus.screen.tags[index]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
},
awful.key {
modifiers = { modkey, "Control", "Shift" },
keygroup = "numrow",
description = "toggle focused client on tag",
group = "tag",
on_press = function (index)
if client.focus then
local tag = client.focus.screen.tags[index]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
},
})
-- Client related keybindings
client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings({
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "(un)maximize", group = "client"}),
awful.key({ modkey, "Control" }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end ,
{description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"}),
})
end)
-- Miscellaneous related keybindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"}),
})
-- Media/Power related keybindings
awful.keyboard.append_global_keybindings({
awful.key(
{},
'XF86MonBrightnessUp',
function()
awful.spawn('brightnessctl +10%', false)
awesome.emit_signal('widget::brightness')
awesome.emit_signal('module::brightness_osd:show', true)
end,
{description = 'increase brightness by 10%', group = 'hotkeys'}
),
awful.key(
{},
'XF86MonBrightnessDown',
function()
awful.spawn('brightnessctl 10%-', false)
awesome.emit_signal('widget::brightness')
awesome.emit_signal('module::bjrightness_osd:show', true)
end,
{description = 'decrease brightness by 10%', group = 'hotkeys'}
),
awful.key(
{},
'XF86AudioRaiseVolume',
function()
awful.spawn('amixer -D pulse sset Master 5%+', false)
awesome.emit_signal('widget::volume')
awesome.emit_signal('module::volume_osd:show', true)
end,
{description = 'increase volume up by 5%', group = 'hotkeys'}
),
awful.key(
{},
'XF86AudioMute',
function()
awful.spawn('amixer -D pulse set Master 1+ toggle', false)
end,
{description = 'toggle mute', group = 'hotkeys'}
),
awful.key(
{},
'XF86AudioNext',
function()
awful.spawn('mpc next', false)
end,
{description = 'next music', group = 'hotkeys'}
),
awful.key(
{},
'XF86AudioPrev',
function()
awful.spawn('mpc prev', false)
end,
{description = 'previous music', group = 'hotkeys'}
),
awful.key(
{},
'XF86AudioPlay',
function()
awful.spawn('mpc toggle', false)
end,
{description = 'play/pause music', group = 'hotkeys'}
),
awful.key(
{},
'XF86AudioMicMute',
function()
awful.spawn('amixer set Capture toggle', false)
end,
{description = 'mute microphone', group = 'hotkeys'}
),
awful.key(
{},
'XF86PowerDown',
function()
--
end,
{description = 'toggle mute', group = 'hotkeys'}
),
awful.key(
{},
'XF86PowerOff',
function()
exit_screen_show()
naughty.notify({text="your text" , replaces_id=1 } )
end,
{description = 'end session menu', group = 'hotkeys'}
),
})
-- Layout related keybindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
})
|
local util = require 'util'
local function gaussmf(x, params)
if x == 'name' then return 'gaussian' end
local sig, c = table.unpack(params, 1, 2)
return math.exp(-((x - c)^2) / 2 * sig^2)
end
local function trapmf(x, params)
if x == 'name' then return 'trapezoidal' end
local a, b, c, d = table.unpack(params, 1, 4)
return util.maximum(0, util.minimum((x - a)/(b - a), 1, (d - x)/(d - c)))
end
local function trimf(x, params)
if x == 'name' then return 'triangular' end
local a, b, c = table.unpack(params, 1, 3)
return util.maximum(0, util.minimum((x - a)/(b - a), (c - x)/(c - b)))
end
return {
trimf = trimf,
trapmf = trapmf,
gaussmf = gaussmf,
}
|
local wx = require "wx"
local ffi = require "ffi"
local gl = require "glewgl"
local glu = require "glutils"
local utils = require "utils"
local r3e = require "r3e"
local r3etrace = require "r3etrace"
local config = gCONFIG
local r3emap = gR3EMAP
local helpers = gHELPERS
local reportStatus = gAPP.reportStatus
local constants = gCONSTANTS
local fulldata = config.viewer.fulldata
---------------------------------------------
local sys = {}
gSYS = sys
---------------------------------------------
local events = {
time = {},
open = {},
append = {},
lap = {},
range = {},
property = {},
compare = {},
}
sys.events = events
---------------------------------------------
local active = {
filename = nil,
lap = 0,
time = 0,
state = ffi.new( constants.SHARED_TYPE ),
statePrev = ffi.new( constants.SHARED_TYPE ),
stateNext = ffi.new( constants.SHARED_TYPE ),
lapData = nil,
trace = nil,
gradient = 0,
traces = {},
}
sys.active = active
local function triggerEvent(tab, ...)
for i,v in ipairs(tab) do
v(...)
end
end
sys.triggerEvent = triggerEvent
local function traceSetTime( time )
active.time = time
local gradient = (active.gradient/100) * 0.5
active.trace:getInterpolatedFrame( active.state, time )
active.trace:getInterpolatedFrame( active.statePrev, time - gradient)
active.trace:getInterpolatedFrame( active.stateNext, time + gradient)
triggerEvent(events.time, active.trace, active.lap, time, active.state, active.gradient > 0, active.statePrev, active.stateNext)
reportStatus("time set")
end
sys.traceSetTime = traceSetTime
function sys.traceSetGradient( gradient)
active.gradient = gradient
traceSetTime(active.time)
reportStatus("gradient set")
end
function sys.traceSetLap(trace, lap)
active.trace = trace
active.lapData = trace.lapData[lap]
active.lap = lap
triggerEvent(events.lap, trace, lap, nil, nil)
traceSetTime(active.lapData.timeBegin)
reportStatus("lap selection")
end
function sys.traceSetProperty(selected, gradient)
triggerEvent(events.property, active.trace, active.lap, selected, gradient)
reportStatus("property selection")
end
function sys.traceSessionSaveCSV(filename)
helpers.saveSessionCSV(active.traces, filename)
end
function sys.traceSaveCSV(selected, gradient, filename)
helpers.saveCSV(active.trace, active.lap, selected, gradient, filename)
end
function sys.traceOpenFile(fileName)
if not fileName then return end
local trace = r3etrace.loadTrace(fileName)
if (trace and trace.fulldata ~= fulldata) then
return reportStatus("load failed, fulldata state in file must match viewer config")
end
if (trace) then
gAPP.app:SetTitle(constants.APP_NAME.." - "..fileName)
helpers.computeAllLapStats(trace)
triggerEvent(events.open, trace, nil, nil, nil)
sys.traceSetLap(trace, 1)
active.traces = {trace}
reportStatus("loaded "..fileName)
else
reportStatus("load failed")
end
end
function sys.traceAppendFile(fileName)
if not fileName then return end
local trace = r3etrace.loadTrace(fileName)
if (trace) then
helpers.computeAllLapStats(trace)
triggerEvent(events.append, trace, nil, nil, nil)
table.insert(active.traces, trace)
reportStatus("appended "..fileName)
else
reportStatus("append failed")
end
end
function sys.registerHandler(what,handler)
table.insert(what, handler)
end
local IDCounter = wx.wxID_HIGHEST
function sys.NewID()
IDCounter = IDCounter + 1
return IDCounter
end
return sys |
function Awake()
print("Awake:"..gameObject.name)
end
function OnEnable()
print("OnEnable:"..transform.name)
end
function Start()
print("Start")
end
function OnDisable()
print("OnDisable")
end
function OnDestroy()
print("OnDestroy")
end |
wrk.method = "POST"
wrk.body = "{}"
wrk.headers["Content-Type"] = "application/json"
|
-- WIP WIP WIP
PLUGIN:set_name('Documentation Generator')
PLUGIN:set_author('TeslaCloud Studios')
PLUGIN:set_description('Generates documentation for Flux and/or your schema.')
if !Flux.development then return end
if !Settings.experimental then return end
local green, orange, red = Color(0, 255, 0), Color(255, 150, 0), Color(255, 0, 0)
local openers = {
[TK_then] = true,
[TK_do] = true
}
local function extract_functions(code)
local tokens = LuaLexer:tokenize(code)
local func_data = {}
local opens = 0
local skip_next = false
local comments_stack = {}
local i = 0
while i < #tokens do
i = i + 1
local v = tokens[i]
-- Ignore anything outside the global level.
if openers[v.tk] then
opens = opens + 1
continue
elseif opens > 0 and v.tk == TK_end then
opens = opens - 1
continue
elseif opens > 0 then
continue
elseif v.tk == TK_comment then
table.insert(comments_stack, v)
continue
end
if v.tk == TK_local then
if tokens[i + 1].tk == TK_function then
opens = opens + 1
continue
end
end
if v.tk == TK_function then
if tokens[i + 1].tk != TK_name then
opens = opens + 1
continue
end
opens = opens + 1
i = i + 1
v = tokens[i]
local func_name = ''
while v and v.tk != TK_lparen do
func_name = func_name..v.val
i = i + 1
v = tokens[i]
end
func_data[func_name] = { name = func_name, comments = comments_stack }
end
comments_stack = {}
end
return func_data
end
local function extract_functions_from_files(folder)
local stdlib, crates, plugins = {}, {}, {}
local files = File.get_list(folder)
for k, v in ipairs(files) do
if v:ends('.lua') then
if v:find('plugins/') then
local plugin_name = v:match('plugins/([%w_%.]+)')
if !plugin_name then continue end
plugins[plugin_name] = plugins[plugin_name] or {}
table.Merge(plugins[plugin_name], extract_functions(File.read(v)))
elseif v:find('crates/') then
local crate_name = v:match('crates/([%w_%.]+)/')
if !crate_name then continue end
crates[crate_name] = crates[crate_name] or {}
table.Merge(crates[crate_name], extract_functions(File.read(v)))
else
table.Merge(stdlib, extract_functions(File.read(v)))
end
end
end
return stdlib, crates, plugins
end
local function render_html_for(name, data)
local globals = {}
local class_methods = {}
local modules = {}
local hooks = {}
for k, v in SortedPairs(data) do
if k:find('%.') then
if k:find(':') then
table.insert(class_methods, k)
else
table.insert(modules, k)
end
elseif k:find(':') then
if k:find('^GM:') then
table.insert(hooks, k)
else
table.insert(class_methods, k)
end
else
table.insert(globals, k)
end
end
local out = '<!DOCTYPE html><html lang="en"><head><style>.function { display: flex; flex-flow: row; padding: 4px; }'
out = out..'.container { display: flex; flex-flow: column; font-family: Arial; }'
out = out..'.category_title { font-size: 32px; font-weight: bold; padding: 8px; }'
out = out..'</style><body>'
out = out..'<div class="container">'
out = out..'<div class="category_title">'..name..'</div>'
out = out..'<div class="category_title">Globals</div>'
for k, v in ipairs(globals) do
out = out..'<div class="function">'..tostring(v)..'( ... )</div>'
end
out = out..'<div class="category_title">Class Methods</div>'
for k, v in ipairs(class_methods) do
out = out..'<div class="function">'..tostring(v)..'( ... )</div>'
end
out = out..'<div class="category_title">Module Methods</div>'
for k, v in ipairs(modules) do
out = out..'<div class="function">'..tostring(v)..'( ... )</div>'
end
out = out..'<div class="category_title">Hooks</div>'
for k, v in ipairs(hooks) do
out = out..'<div class="function">'..tostring(v)..'( ... )</div>'
end
out = out..'</div></body></html>'
return out
end
function analyze_folder(folder)
print('Analyzing: '..folder)
local stdlib, crates, plugins = extract_functions_from_files(folder)
local index_file = '<!DOCTYPE html><html lang="en"><body>'
print 'Rendering HTML documentation...'
print ' -> stdlib'
File.write('gamemodes/flux/docs/stdlib/index.html', render_html_for('stdlib', stdlib))
index_file = index_file..'<h2>Flux</h2><a href="stdlib/index.html">stdlib</a><br><h2>Crates</h2>'
print ' -> crates'
for name, data in SortedPairs(crates) do
print(' '..name)
File.write('gamemodes/flux/docs/crates/'..name:underscore()..'.html', render_html_for(name, data))
index_file = index_file..'<a href="crates/'..name:underscore()..'.html">'..name..'</a><br>'
end
index_file = index_file..'<h2>Plugins</h2>'
print ' -> plugins'
for name, data in SortedPairs(plugins) do
print(' '..name)
File.write('gamemodes/flux/docs/plugins/'..name:underscore()..'.html', render_html_for(name, data))
index_file = index_file..'<a href="plugins/'..name:underscore()..'.html">'..name..'</a><br>'
end
File.write('gamemodes/flux/docs/index.html', index_file..'</body></html>')
end
analyze_folder('gamemodes/flux/')
|
local awful = require('awful')
local theme = require('beautiful')
local cairo = require('lgi').cairo
local rsvg = require('lgi').Rsvg
local menu_utils = {}
-- Get geometry to position menu at corner
function menu_utils.get_position(corner)
local width = 0
local height = 0
local index = awful.screen.focused().index
local menu_width = theme.menu_width or 160
local border_width = theme.menu_border_width or 0
local total_width = menu_width+(border_width*2)
for s = 1, screen.count() do
width = width + screen[s].geometry.width
height = screen[s].geometry.height
if s == index then break end
end
-- Top left
if corner == 'tl' then
return { x = 0, y = 0 }
-- Top right
elseif corner == 'tr' then
return { x = width-total_width, y = 0 }
-- Bottom left
elseif corner == 'bl' then
return { x = 0, y = height }
-- Bottom right
elseif corner == 'br' then
return { x = width-total_width, y = height }
end
end
-- /usr/share/awesome/themes/gtk/theme.lua
local color_utils = {}
color_utils.hex_color_match = '[a-fA-F0-9][a-fA-F0-9]'
function color_utils.darker(color_value, darker_n)
local result = '#'
local channel_counter = 1
for s in color_value:gmatch(color_utils.hex_color_match) do
local bg_numeric_value = tonumber('0x'..s)
if channel_counter <= 3 then
bg_numeric_value = bg_numeric_value - darker_n
end
if bg_numeric_value < 0 then bg_numeric_value = 0 end
if bg_numeric_value > 255 then bg_numeric_value = 255 end
result = result .. string.format('%02x', bg_numeric_value)
channel_counter = channel_counter + 1
end
return result
end
function color_utils.is_dark(color_value)
local bg_numeric_value = 0;
local channel_counter = 1
for s in color_value:gmatch(color_utils.hex_color_match) do
bg_numeric_value = bg_numeric_value + tonumber('0x'..s);
if channel_counter == 3 then
break
end
channel_counter = channel_counter + 1
end
local is_dark_bg = (bg_numeric_value < 383)
return is_dark_bg
end
function color_utils.mix(color1, color2, ratio)
ratio = ratio or 0.5
local result = '#'
local channels1 = color1:gmatch(color_utils.hex_color_match)
local channels2 = color2:gmatch(color_utils.hex_color_match)
for _ = 1,3 do
local bg_numeric_value = math.ceil(
tonumber('0x'..channels1())*ratio +
tonumber('0x'..channels2())*(1-ratio)
)
if bg_numeric_value < 0 then bg_numeric_value = 0 end
if bg_numeric_value > 255 then bg_numeric_value = 255 end
result = result .. string.format('%02x', bg_numeric_value)
end
return result
end
function color_utils.reduce_contrast(color, ratio)
ratio = ratio or 50
return color_utils.darker(color, color_utils.is_dark(color) and -ratio or ratio)
end
function color_utils.choose_contrast_color(reference, candidate1, candidate2)
if color_utils.is_dark(reference) then
if not color_utils.is_dark(candidate1) then
return candidate1
else
return candidate2
end
else
if color_utils.is_dark(candidate1) then
return candidate1
else
return candidate2
end
end
end
local svg_utils = {}
-- Render SVG from string
function svg_utils.new_from_str(data, color, replace, size)
if not data then return end
color = color or nil
replace = replace or '#ffffff'
size = size or 16
local surface = cairo.ImageSurface(cairo.Format.ARGB32, size, size)
local context = cairo.Context(surface)
if color then
data = string.gsub(data, replace, color)
end
rsvg.Handle.new_from_data(data):render_cairo(context)
return surface
end
-- Render SVG from file
function svg_utils.new_from_file(file, size)
if not file then return end
size = size or 16
local surface = cairo.ImageSurface(cairo.Format.ARGB32, size, size)
local context = cairo.Context(surface)
rsvg.Handle.new_from_file(file):render_cairo(context)
return surface
end
return {
colors = color_utils,
menus = menu_utils,
svg = svg_utils,
}
|
local Misc = {}
local Lib
Misc.Mouse = {X = 0, Y = 0}
Misc.WorldMouse = {X = 0, Y = 0}
Misc.GridMouse = {X = 0, Y = 0}
Misc.Screen = {X = 0, Y = 0}
Misc.Delta = 0
Misc.FPS = 0
Misc.ElapsedTime = 0
Misc.Update = function(Self, Delta)
Self.Mouse = {X = love.mouse.getX(), Y = love.mouse.getY()}
local WX, WY = Lib.Universe:ToWorldCoordinates(Self.Mouse.X, Self.Mouse.Y)
Self.WorldMouse = {X = WX, Y = WY}
local GX, GY = Lib.Universe:ToGrid(WX, WY)
Self.GridMouse = {X = GX, Y = GY}
Self.Delta = Delta
Self.FPS = love.timer.getFPS()
Self.ElapsedTime = Self.ElapsedTime + Delta
end
setmetatable(Misc, {
__call = function(Self, GLib)
Self.Screen = {X = love.graphics.getWidth(), Y = love.graphics.getHeight()}
Lib = GLib
return Self
end
})
return Misc |
local L = BigWigs:NewBossLocale("Siamat", "ptBR")
if not L then return end
if L then
L.servant = "Sumonar Serviçal"
L.servant_desc = "Avisa quando um Serviçal de Siamat é sumonado."
end
|
module(...,package.seeall)
local debug = true
local ffi = require("ffi")
local C = ffi.C
local packet = require("core.packet")
require("core.packet_h")
require("core.link_h")
local band = require("bit").band
local size = C.LINK_RING_SIZE -- NB: Huge slow-down if this is not local
max = C.LINK_MAX_PACKETS
function new (receiving_app)
return ffi.new("struct link", {receiving_app = receiving_app})
end
function receive (r)
-- if debug then assert(not empty(r), "receive on empty link") end
local p = r.packets[r.read]
r.read = band(r.read + 1, size - 1)
r.stats.rxpackets = r.stats.rxpackets + 1
r.stats.rxbytes = r.stats.rxbytes + p.length
return p
end
function transmit (r, p)
-- assert(p)
if full(r) then
r.stats.txdrop = r.stats.txdrop + 1
else
r.packets[r.write] = p
r.write = band(r.write + 1, size - 1)
r.stats.txpackets = r.stats.txpackets + 1
r.stats.txbytes = r.stats.txbytes + p.length
r.has_new_data = true
end
end
-- Return true if the ring is empty.
function empty (r)
return r.read == r.write
end
-- Return true if the ring is full.
function full (r)
return band(r.write + 1, size - 1) == r.read
end
-- Return the number of packets that are ready for read.
function nreadable (r)
if r.read > r.write then
return r.write + size - r.read
else
return r.write - r.read
end
end
function nwritable (r)
return max - nreadable(r)
end
function stats (r)
return r.stats
end
function selftest ()
print("selftest: link")
local r = new()
local p = packet.allocate()
packet.tenure(p)
assert(r.stats.txpackets == 0 and empty(r) == true and full(r) == false)
assert(nreadable(r) == 0)
transmit(r, p)
assert(r.stats.txpackets == 1 and empty(r) == false and full(r) == false)
for i = 1, max-2 do
transmit(r, p)
end
assert(r.stats.txpackets == max-1 and empty(r) == false and full(r) == false)
assert(nreadable(r) == r.stats.txpackets)
transmit(r, p)
assert(r.stats.txpackets == max and empty(r) == false and full(r) == true)
transmit(r, p)
assert(r.stats.txpackets == max and r.stats.txdrop == 1)
assert(not empty(r) and full(r))
while not empty(r) do
receive(r)
end
assert(r.stats.rxpackets == max)
print("selftest OK")
end
|
function onAttach()
LOG_INFO("attach")
end
local rad = math.rad
local cos = math.cos
local sin = math.sin
local speed = 15.0
local rotationSpeed = 60
local currentSpeed, currentRotationSpeed = 0, 0
local Position, Rotation = {x = 0, y = 0, z = 0}
local KeyActions = {
["W"] = function(delta)
currentSpeed = currentSpeed + speed
end,
["S"] = function(delta)
currentSpeed = currentSpeed - speed
end,
["D"] = function(delta)
currentRotationSpeed = currentRotationSpeed + rotationSpeed
end,
["A"] = function(delta)
currentRotationSpeed = currentRotationSpeed - rotationSpeed
end,
["Space"] = function(delta)
Position.y = Position.y + (speed * delta)
end,
["LeftControl"] = function(delta)
Position.y = Position.y - (speed * delta)
end
}
function onUpdate(delta)
currentSpeed, currentRotationSpeed = 0, 0
Position, Rotation = Get("position"), Get("rotation")
for key, func in pairs(KeyActions) do
if IsKeyPressed(key) then
func(delta)
end
end
Rotation.y = Rotation.y + (currentRotationSpeed * delta)
local distance = currentSpeed * delta
local yRad = rad(Rotation.y + 270)
local dx = distance * cos(yRad)
local dz = distance * sin(yRad)
Position.x = Position.x + dx
Position.z = Position.z + dz
Set("position", Position)
Set("rotation", Rotation)
end
function onDetach()
LOG_INFO("detach")
end |
--黒炎の騎士-ブラック・フレア・ナイト-
function c911000462.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,46986414,(45231177 or 511001128),true,true)
--Special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(911000462,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c911000462.spcon)
--e1:SetTarget(c911000462.sptg)
e1:SetOperation(c911000462.spop2)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetValue(1)
c:RegisterEffect(e2)
end
function c911000462.spfilter(c,e,tp)
return c:IsCode(49217579) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c911000462.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c911000462.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c911000462.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c911000462.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
--
function c911000462.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local token=Duel.CreateToken(tp,49217579)
Duel.MoveToField(token,tp,tp,LOCATION_MZONE,c:GetPreviousPosition(),true)
token:SetStatus(STATUS_PROC_COMPLETE,true)
token:SetStatus(STATUS_SPSUMMON_TURN,true)
end |
--!A cross-platform build utility based on Lua
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-- Copyright (C) 2015-present, TBOOX Open Source Group.
--
-- @author ruki
-- @file reset.lua
--
-- imports
import("core.base.option")
import("lib.detect.find_tool")
-- reset files
--
-- @param opt the argument options
--
-- @code
--
-- import("devel.git")
--
-- git.reset()
-- git.reset({repodir = "/tmp/xmake", force = true})
--
-- @endcode
--
function main(opt)
-- init options
opt = opt or {}
-- find git
local git = assert(find_tool("git"), "git not found!")
-- init argv
local argv = {"reset"}
-- verbose?
if not option.get("verbose") then
table.insert(argv, "-q")
end
-- hard?
if opt.hard then
table.insert(argv, "--hard")
end
-- soft?
if opt.soft then
table.insert(argv, "--soft")
end
-- keep?
if opt.keep then
table.insert(argv, "--keep")
end
-- reset to the given commit
if opt.commit then
table.insert(argv, opt.commit)
end
-- reset it
os.vrunv(git.program, argv, {curdir = opt.repodir})
end
|
-- Target Component
--
local Base = require 'modern'
local Target = Base:extend()
-- New
--
function Target:new(host, data)
self.host = host
--
-- properties
self._targets = {}
self._targetCount = 0
self._detects = data.detects or {}
end
-- Get/set `detects` value.
--
function Target:detects(value)
if value == nil then
return self._detects
end
if type(value) ~= 'table' then
value = { value }
end
self._detects = Util:toBoolean(value)
end
function Target:addTarget(other)
if not self:hasTarget(other.id) then
self._targets[other.id] = other
self._targetCount = self._targetCount + 1
--
self.host:dispatch('targetAdded', other)
end
end
function Target:removeTarget(other)
if self:hasTarget(other.id) then
self._targets[other.id] = nil
self._targetCount = self._targetCount - 1
--
self.host:dispatch('targetRemoved', other)
end
end
-- Has target with `id`.
--
function Target:hasTarget(id)
return self._targets[id]
end
-- Has 1 or many targets?
--
function Target:hasTargets()
return self._targetCount > 0
end
return Target |
--[[
Sample
Author: Guillaume Cartier
Version: 1.0 - Initial release
]]
-- Version
Version = 1.0
--
--- Sample
--
function Sample()
end
function SampleMsg(message)
MessageBox(message);
end
--
--- Events
--
function SampleOnEvent(event)
-- X
if ( event == "X" ) then
SampleMsg("X");
-- Y
elseif (event == "Y") then
SampleMsg("Y");
end
end
|
(setfenv and rawlen)(setfenv and rawlen)
|
local S = aurum.get_translator()
aurum.mobs.register("aurum_mobs_monsters:wose", {
description = S"Wose",
herd = "aurum:elemental",
longdesc = S"Born in the depths of Primus Hortum, this creature desires only to reclaim dust to dust and mud to mud. It is not aggressive in the sunlight.",
box = {-0.35, -0.35, -0.35, 0.35, 0.85, 0.35},
initial_properties = {
visual = "sprite",
textures = {"aurum_mobs_monsters_wose.png"},
visual_size = {x = 1, y = 2},
hp_max = 60,
},
initial_data = {
drops = {"aurum_trees:pander_sapling", "aurum_farming:fertilizer"},
habitat_nodes = {"group:leaves"},
xmana = 20,
pathfinder = {
clearance_height = 2,
drop_height = -1,
},
attack = b.t.combine(aurum.mobs.initial_data.attack, {
damage = {pierce = 6, impact = 6},
}),
base_speed = 1,
},
armor_groups = {chill = 50, burn = 150, pierce = 50, impact = 75, psyche = 110},
gemai = {
global_actions = {
"aurum_mobs:physics",
"aurum_mobs:environment",
},
global_events = {
stuck = "roam",
timeout = "roam",
punch = "fight",
lost = "roam",
interact = "",
herd_alerted = "",
},
states = {
init = {
events = {
init = "roam",
},
},
roam = {
actions = {
"aurum_mobs:light_switch",
},
events = {
light_day = "passive_roam",
light_night = "hostile_roam",
},
},
stand = {
actions = {
"aurum_mobs:light_switch",
},
events = {
light_day = "passive_stand",
light_night = "hostile_stand",
},
},
hostile_roam = {
actions = {
"aurum_mobs:find_prey",
"aurum_mobs:find_habitat",
"aurum_mobs:find_random",
},
events = {
found_prey = "go_fight",
found_habitat = "go",
found_random = "go",
},
},
hostile_stand = {
actions = {
"aurum_mobs:find_prey",
"aurum_mobs:timeout",
},
events = {
found_prey = "go_fight",
},
},
passive_roam = {
actions = {
"aurum_mobs:find_habitat",
"aurum_mobs:find_random",
},
events = {
found_habitat = "go",
found_random = "go",
},
},
passive_stand = {
actions = {
"aurum_mobs:timeout",
},
},
go = {
actions = {
"aurum_mobs:go",
"aurum_mobs:timeout",
},
events = {
reached = "stand",
},
},
go_fight = {
actions = {
"aurum_mobs:adrenaline",
"aurum_mobs:go",
"aurum_mobs:timeout",
},
events = {
reached = "fight",
},
},
fight = {
actions = {
"aurum_mobs:adrenaline",
"aurum_mobs:attack",
},
events = {
noreach = "go_fight",
},
},
},
},
})
aurum.mobs.register_spawn{
mob = "aurum_mobs_monsters:wose",
chance = 17 ^ 3,
biomes = b.set.to_array(b.set._and(b.set(aurum.biomes.get_all_group("forest")), b.set(aurum.biomes.get_all_group("dark")))),
light_max = 9,
}
|
--------------------------------------------------------------------------
-- GTFO_Fail_BFA.lua
--------------------------------------------------------------------------
--[[
GTFO Fail List - Battle for Azeroth
Author: Zensunim of Malygos
]]--
--- ******************************
--- * Battle for Azeroth (World) *
--- ******************************
GTFO.SpellID["268216"] = {
--desc = "Earth Shattering (Azerite War Machine)";
sound = 3;
};
GTFO.SpellID["269560"] = {
--desc = "Landmine Explosion ";
sound = 3;
};
GTFO.SpellID["262250"] = {
--desc = "Blinded by the Light";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["263626"] = {
--desc = "Icy Glare (Lady Jaina Proudmoore)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["263874"] = {
--desc = "Blizzard (Lady Jaina Proudmoore)";
sound = 3;
};
GTFO.SpellID["264973"] = {
--desc = "Frost Barrage (Lady Jaina Proudmoore)";
sound = 3;
};
GTFO.SpellID["276899"] = {
--desc = "Tempest Strike (Lord Stormsong)";
sound = 3;
};
GTFO.SpellID["276914"] = {
--desc = "Wrath of Storms";
sound = 3;
};
GTFO.SpellID["215705"] = {
--desc = "Gasp of Unmaking (Azshj'thul the Drowned)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["270662"] = {
--desc = "Boulder (Demolisher)";
sound = 3;
};
GTFO.SpellID["271437"] = {
--desc = "Sapper Charge";
sound = 3;
};
GTFO.SpellID["276973"] = {
--desc = "Meteor (Champion Lockjaw)";
sound = 3;
};
GTFO.SpellID["276763"] = {
--desc = "Lava Storm (Yarsel'ghun)";
sound = 3;
};
GTFO.SpellID["244787"] = {
--desc = "Wide Swipe (Crazed Bone Snapper)";
sound = 3;
};
GTFO.SpellID["265481"] = {
--desc = "Big Knock Back";
sound = 3;
};
GTFO.SpellID["276262"] = {
--desc = "Lightning Storm (Lady Rash'iss)";
sound = 3;
};
GTFO.SpellID["264465"] = {
--desc = "Barrel Aged (Barman Bill)";
sound = 3;
};
GTFO.SpellID["264403"] = {
--desc = "Hoppy Finish (Barman Bill)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["266288"] = {
--desc = "Gnash (Vicious Vicejaw)";
sound = 3;
};
GTFO.SpellID["270460"] = {
--desc = "Stone Eruption (Goldenvein)";
sound = 3;
};
GTFO.SpellID["257351"] = {
--desc = "Thorned Burst (Rindlewoe)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["277044"] = {
--desc = "Tidal Force (Kvaldir Dreadbringer)";
sound = 3;
};
GTFO.SpellID["271713"] = {
--desc = "Elemental Slam (Unbound Azerite)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["266288"] = {
--desc = "Gnash (Mudsnout Thornback)";
sound = 3;
};
GTFO.SpellID["244882"] = {
--desc = "Cracking Blow (Guuru the Mountain-Breaker)";
sound = 3;
};
GTFO.SpellID["277347"] = {
--desc = "Whirling Venom (Shipwrecked Strongarm)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["275823"] = {
--desc = "Ground Spike (Duster)";
sound = 3;
};
GTFO.SpellID["273909"] = {
--desc = "Steelclaw Trap";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["250509"] = {
--desc = "Shadow Bomb (Icetusk Prophet)";
sound = 3;
};
GTFO.SpellID["263940"] = {
--desc = "Trample (Gahz'ralka)";
sound = 3;
};
GTFO.SpellID["260273"] = {
--desc = "Void Swipe (Overseer Bates)";
sound = 3;
};
GTFO.SpellID["280422"] = {
--desc = "Crushing Dread (Gorak Tul)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["257336"] = {
--desc = "Mighty Slam (Lumbergrasp Sentinel)";
sound = 3;
};
GTFO.SpellID["265720"] = {
--desc = "Poison Spray (Thu'zun the Vile)";
sound = 1;
applicationOnly = true;
};
GTFO.SpellID["266144"] = {
--desc = "Poison Bomb (Thu'zun the Vile)";
sound = 1;
applicationOnly = true;
};
GTFO.SpellID["275243"] = {
--desc = "Soulburst (Erupting Servant)";
sound = 3;
};
GTFO.SpellID["271805"] = {
--desc = "Rez'okun's Rake (Captain Rez'okun)";
sound = 3;
};
GTFO.SpellID["259669"] = {
--desc = "Slowed by Snow";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["278177"] = {
--desc = "Trample (Evergrove Keeper)";
sound = 3;
};
GTFO.SpellID["257880"] = {
--desc = "Aquabomb (Deepsea Tidecrusher)";
sound = 3;
};
GTFO.SpellID["270814"] = {
--desc = "Hydro Eruption (Deepsea Tidecrusher)";
sound = 3;
};
GTFO.SpellID["265721"] = {
--desc = "Web Spray (Ironweb Weaver)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["261735"] = {
--desc = "Scouring Sand (Ghost of the Deep)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["274904"] = {
--desc = "Reality Tear (Warbringer Yenajz)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["277632"] = {
--desc = "Demolisher Cannon (Doom's Howl Turret)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["271163"] = {
--desc = "Shattering Pulse (Doom's Howl)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["264687"] = {
--desc = "Unleashed Justice (Echo of Myzrael)";
sound = 3;
};
GTFO.SpellID["269794"] = {
--desc = "Throw Boulder (Fozruk)";
sound = 3;
};
GTFO.SpellID["278120"] = {
--desc = "Star Shower (Ragebeak)";
sound = 3;
};
GTFO.SpellID["269680"] = {
--desc = "Entanglement (Branchlord Aldrus)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["274829"] = {
--desc = "Gale Force (Azurethos)";
sound = 3;
};
GTFO.SpellID["274840"] = {
--desc = "Azurethos' Fury (Azurethos)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["265752"] = {
--desc = "Devastator Cannon (War Machine)";
sound = 3;
};
GTFO.SpellID["274206"] = {
--desc = "Blood Wave (Grand Ma'da Ateena)";
sound = 3;
};
GTFO.SpellID["258094"] = {
--desc = "Breath of Vol'jamba (Vol'jamba)";
sound = 3;
};
GTFO.SpellID["269823"] = {
--desc = "Ball Lightning";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["283876"] = {
--desc = "High-Explosive Bomb (Base Cap'n Crankshot)";
sound = 3;
};
GTFO.SpellID["257971"] = {
--desc = "Leaping Thrash (Bajiatha)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["287537"] = {
--desc = "Plague Breath (Ivus the Decayed)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["287537"] = {
--desc = "Plague Breath (Ivus the Decayed)";
sound = 3;
};
-- ***********************
-- * Shrine of the Storm *
-- ***********************
GTFO.SpellID["267973"] = {
--desc = "Wash Away (Temple Attendant)";
sound = 3;
};
GTFO.SpellID["268059"] = {
--desc = "Anchor of Binding (Tidesage Spiritualist)";
sound = 3;
};
GTFO.SpellID["264773"] = {
--desc = "Choking Brine (Aqu'sirr)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["267899"] = {
--desc = "Hindering Cleave (Brother Ironhull)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["268280"] = {
--desc = "Tidal Pod (Tidesage Enforcer)";
sound = 3;
};
GTFO.SpellID["268391"] = {
--desc = "Mental Assault (Abyssal Cultist)";
applicationOnly = true;
test = true; -- Is this actually avoidable?
sound = 3;
};
GTFO.SpellID["269104"] = {
--desc = "Explosive Void (Lord Stormsong)";
sound = 3;
};
GTFO.SpellID["267956"] = {
--desc = "Zap (Jellyfish)";
sound = 3;
};
GTFO.SpellID["267385"] = {
--desc = "Tentacle Slam (Vol'zith the Whisperer)";
sound = 3;
};
-- ******************
-- * Waycrest Manor *
-- ******************
GTFO.SpellID["263905"] = {
--desc = "Marking Cleave (Heartsbane Runeweaver)";
sound = 3;
tankSound = 0;
test = true;
};
GTFO.SpellID["264531"] = {
--desc = "Shrapnel Trap (Maddened Survivalist)";
sound = 3;
test = true;
};
GTFO.SpellID["264476"] = {
--desc = "Tracking Explosive (Crazed Marksman)";
sound = 3;
test = true;
};
GTFO.SpellID["271174"] = {
--desc = "Retch (Pallid Gorger)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["264923"] = {
--desc = "Tenderize (Raal the Gluttonous)";
sound = 3;
};
GTFO.SpellID["265757"] = {
--desc = "Splinter Spike (Matron Bryndle)";
sound = 3;
};
GTFO.SpellID["264150"] = {
--desc = "Shatter (Thornguard)";
sound = 3;
test = true;
};
GTFO.SpellID["265372"] = {
--desc = "Shadow Cleave (Enthralled Guard)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["265352"] = {
--desc = "Toad Blight (Blight Toad)";
applicationOnly = true;
sound = 3;
};
-- ************
-- * Freehold *
-- ************
GTFO.SpellID["258673"] = {
--desc = "Azerite Grenade (Irontide Crackshot)";
sound = 3;
};
GTFO.SpellID["256106"] = {
--desc = "Azerite Powder Shot (Skycap'n Kragg)";
sound = 3;
tankSound = 0;
test = true;
};
GTFO.SpellID["258773"] = {
--desc = "Charrrrrge (Skycap'n Kragg)";
sound = 3;
};
GTFO.SpellID["258779"] = {
--desc = "Sea Spout (Irontide Oarsman)";
sound = 3;
negatingDebuffSpellID = 274389; -- Rat Trap
-- negatingDebuffSpellID = 274400; -- Duelist Dash
-- TODO: Add support for multiple spell IDs
};
GTFO.SpellID["272374"] = {
--desc = "Whirlpool of Blades (Captain Jolly)";
sound = 3;
};
GTFO.SpellID["267523"] = {
--desc = "Cutting Surge (Captain Jolly)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["256594"] = {
--desc = "Barrel Smash (Captain Raoul)";
sound = 3;
};
GTFO.SpellID["257310"] = {
--desc = "Cannon Barrage (Harlan Sweete)";
sound = 3;
test = true;
};
GTFO.SpellID["257315"] = {
--desc = "Black Powder Bomb (Harlan Sweete)";
sound = 3;
test = true;
};
GTFO.SpellID["272397"] = {
--desc = "Whirlpool of Blades";
sound = 3;
};
GTFO.SpellID["276061"] = {
--desc = "Boulder Throw (Irontide Crusher)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["258199"] = {
--desc = "Ground Shatter (Irontide Crusher)";
sound = 3;
};
GTFO.SpellID["257902"] = {
--desc = "Shell Bounce (Ludwig Von Tortollan)";
sound = 3;
};
-- *************
-- * Tol Dagor *
-- *************
GTFO.SpellID["257119"] = {
--desc = "Sand Trap (The Sand Queen)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["257785"] = {
--desc = "Flashing Daggers (Jes Howlis)";
sound = 3;
};
GTFO.SpellID["256710"] = {
--desc = "Burning Arsenal";
sound = 3;
};
GTFO.SpellID["256955"] = {
--desc = "Cinderflame (Knight Captain Valyri)";
sound = 3;
test = true; -- Avoidable by tank?
};
GTFO.SpellID["256976"] = {
--desc = "Ignition (Knight Captain Valyri)";
sound = 3;
};
GTFO.SpellID["258917"] = {
--desc = "Righteous Flames (Ashvane Priest)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["259711"] = {
--desc = "Lockdown (Ashvane Warden)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["258634"] = {
--desc = "Fuselighter (Ashvane Flamecaster)";
sound = 3;
};
-- ****************
-- * The Underrot *
-- ****************
GTFO.SpellID["265019"] = {
--desc = "Savage Cleave (Chosen Blood Matron)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["265665"] = {
--desc = "Foul Sludge (Living Rot)";
sound = 3;
};
GTFO.SpellID["260793"] = {
--desc = "Indigestion (Cragmaw the Infested)";
sound = 3;
};
GTFO.SpellID["259720"] = {
--desc = "Upheaval (Sporecaller Zancha)";
sound = 3;
};
GTFO.SpellID["273226"] = {
--desc = "Decaying Spores (Sporecaller Zancha)";
applicationOnly = true;
sound = 3;
minimumStacks = 3;
test = true;
};
GTFO.SpellID["265511"] = {
--desc = "Spirit Drain (Spirit Drain Totem)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["272609"] = {
--desc = "Maddening Gaze (Faceless Corruptor)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["273475"] = {
--desc = "Rotten Breath (Rotmaw)";
sound = 3;
applicationOnly = true;
};
-- ************************
-- * Temple of Sethraliss *
-- ************************
GTFO.SpellID["272657"] = {
--desc = "Noxious Breath (Scaled Krolusk Rider)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["273225"] = {
--desc = "Volley (Sandswept Marksman)";
sound = 3;
};
GTFO.SpellID["264206"] = {
--desc = "Burrow (Merektha)";
sound = 3;
};
GTFO.SpellID["269970"] = {
--desc = "Blinding Sand (Merektha)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["267483"] = {
--desc = "Loose Sparks (Loose Spark)";
sound = 3;
};
GTFO.SpellID["264763"] = {
--desc = "Spark (Static-charged Dervish)";
sound = 3;
};
GTFO.SpellID["272821"] = {
--desc = "Call Lightning (Imbued Stormcaller)";
sound = 3;
};
GTFO.SpellID["255741"] = {
--desc = "Cleave (Scaled Krolusk Rider)";
sound = 3;
tankSound = 0;
test = true; -- Restrict to this NPC only
};
-- ********************
-- * The MOTHERLODE!! *
-- ********************
GTFO.SpellID["256137"] = {
--desc = "Timed Detonation (Azerite Footbomb)";
sound = 3;
};
GTFO.SpellID["268365"] = {
--desc = "Mining Charge";
sound = 3;
};
GTFO.SpellID["271583"] = {
--desc = "Black Powder Special";
sound = 3;
};
GTFO.SpellID["263105"] = {
--desc = "Blowtorch (Feckless Assistant)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["269092"] = {
--desc = "Artillery Barrage (Ordnance Specialist)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["262377"] = {
--desc = "Seek and Destroy (Crawler Mine)";
applicationOnly = true;
sound = 3;
tankSound = 0;
};
-- **************
-- * Atal'Dazar *
-- **************
GTFO.SpellID["255558"] = {
--desc = "Tainted Blood (Gilded Priestess)";
applicationOnly = true;
sound = 3;
test = true; -- Negating debuff during boss ability?
};
GTFO.SpellID["255620"] = {
--desc = "Festering Eruption (Reanimated Honor Guard)";
sound = 3;
};
GTFO.SpellID["255620"] = {
--desc = "Festering Eruption (Reanimated Honor Guard)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["257483"] = {
--desc = "Pile of Bones (Rezan)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["255371"] = {
--desc = "Terrifying Visage (Rezan)";
applicationOnly = true;
sound = 3;
test = true; -- Bugged?
};
GTFO.SpellID["258986"] = {
--desc = "Stink Bomb (Shadowblade Razi)";
applicationOnly = true;
sound = 3;
};
-- ***************
-- * King's Rest *
-- ***************
-- TODO: Gale Slash (Dazar, The First King)
-- TODO: Impaling Spear (Dazar, The First King)
GTFO.SpellID["270003"] = {
--desc = "Suppression Slam (Animated Guardian)";
sound = 3;
};
GTFO.SpellID["265781"] = {
--desc = "Serpentine Gust (The Golden Serpent)";
sound = 3;
};
GTFO.SpellID["270872"] = {
--desc = "Shadow Whirl (Bloodsworn Agent)";
sound = 3;
};
GTFO.SpellID["275212"] = {
--desc = "Bisecting Strike (Weaponmaster Halu)";
sound = 3;
};
GTFO.SpellID["270289"] = {
--desc = "Purification Beam";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["267105"] = {
--desc = "Torrent (Torrent Totem)";
sound = 3;
};
-- ********************
-- * Siege of Boralus *
-- ********************
GTFO.SpellID["256866"] = {
--desc = "Iron Ambush (Riptide Shredder)";
sound = 3;
applicationOnly = true;
};
GTFO.SpellID["272426"] = {
--desc = "Sighted Artillery";
sound = 3;
};
GTFO.SpellID["274942"] = {
--desc = "Banana Rampage";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["272713"] = {
--desc = "Crushing Slam (Bilge Rat Demolisher)";
sound = 3;
};
GTFO.SpellID["277535"] = {
--desc = "Viq'Goth's Wrath (Viq'Goth)";
sound = 3;
};
-- TODO: Cannon Barrage (Chopper Redhook) -- Avoidable?
-- TODO: Heavy Slash (Irontide Cleaver) -- Non-Tank only? Avoidable?
-- TODO: Clear the Deck (Dread Captain Lockwood) -- Non-Tank only? Avoidable?
-- TODO: Crimson Swipe (Ashvane Deckhand) -- Non-Tank only? Avoidable?
-- TODO: Broadside (Ashvane Cannoneer) -- Avoidable?
GTFO.SpellID["261565"] = {
--desc = "Crashing Tide (Hadal Darkfathom)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["257883"] = {
--desc = "Break Water (Hadal Darkfathom)";
sound = 3;
test = true;
};
GTFO.SpellID["276042"] = {
--desc = "Tidal Surge";
sound = 3;
};
-- TODO: Eradication (Viq'Goth) -- Avoidable?
GTFO.SpellID["269266"] = {
--desc = "Slam (Demolishing Terror)";
sound = 3;
};
-- *********
-- * Uldir *
-- *********
GTFO.SpellID["271885"] = {
--desc = "Retrieve Cudgel (Taloc)";
sound = 3;
};
GTFO.SpellID["272582"] = {
--desc = "Sanguine Static (Taloc)";
sound = 3;
};
-- TODO: Hardened Arteries (Taloc) -- Explosion, avoidable?
GTFO.SpellID["267803"] = {
--desc = "Purifying Flame (MOTHER)";
sound = 3;
};
GTFO.SpellID["267787"] = {
--desc = "Sanitizing Strike (MOTHER)";
applicationOnly = true;
sound = 3;
tankSound = 0;
};
GTFO.SpellID["277794"] = {
--desc = "Paw Swipe (Malformed Lion)";
applicationOnly = true;
sound = 3;
tankSound = 0;
};
-- TODO: Spreading Epidemic (MOTHER) -- What does this do?
-- TODO: Surging Darkness (Zek'voz) -- Avoidable for big pools? Different spell IDs for pool damage vs. incidental
-- TODO: Void Lash (Zek'voz) -- For tanks only, stack tracking, fail at 100% reduction
-- TODO: Ominous Cloud (Zek'voz) -- Touching the cloud failure
-- TODO: Void Wall (Zek'voz) -- Mythic only - Avoidable?
-- TODO: Blood Geyser (Vectis) -- What is this?
-- TODO: Pit of Despair (Zul) -- Avoidable?
-- TODO: Tendrils of Corruption (G'huun) -- Mythic only
-- TODO: Wave of Corruption (G'huun)
-- TODO: Explosive Corruption (G'huun) -- If standing too close to a player that's infected, not for the infected
GTFO.SpellID["277545"] = {
--desc = "Shadow Crash (C'Thraxxi Breaker)";
sound = 3;
};
GTFO.SpellID["277810"] = {
--desc = "Congealed Plague (Nazmani Defiler)";
sound = 3;
};
GTFO.SpellID["277813"] = {
--desc = "Blood Ritual (Speaker Obara)";
sound = 3;
};
GTFO.SpellID["278933"] = {
--desc = "Bursting Surge";
sound = 3;
};
GTFO.SpellID["278890"] = {
--desc = "Violent Hemorrhage (Nazmani Veinsplitter)";
applicationOnly = true;
sound = 3;
};
GTFO.SpellID["274358"] = {
--desc = "Rupturing Blood (Zul)";
applicationOnly = true;
sound = 3;
tankSound = 0;
};
GTFO.SpellID["273316"] = {
--desc = "Bloody Cleave (Nazmani Crusher)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["273554"] = {
--desc = "Obliteration Blast (Mythrax the Unraveler)";
sound = 3;
negatingDebuffSpellID = 272407; -- Oblivion Sphere
};
GTFO.SpellID["273282"] = {
--desc = "Essence Shear (Mythrax the Unraveler)";
sound = 3;
tankSound = 0;
};
GTFO.SpellID["262292"] = {
--desc = "Rotting Regurgitation (Fetid Devourer)";
sound = 3;
};
GTFO.SpellID["278988"] = {
--desc = "Wild Leap (Nazmani Dominator)";
sound = 3;
};
GTFO.SpellID["273486"] = {
--desc = "Virulent Corruption (G'huun)";
sound = 3;
};
GTFO.SpellID["273401"] = {
--desc = "Mind Thrall (G'huun)";
applicationOnly = true;
sound = 1;
};
GTFO.SpellID["267700"] = {
--desc = "Gaze of G'huun (G'huun)";
applicationOnly = true;
sound = 3;
};
|
SILE.baseClass:loadPackage("rebox")
SILE.baseClass:loadPackage("raiselower")
SILE.registerCommand("tkanav", function(options, content)
SILE.settings.temporarily(function()
SILE.call("font", {size= "0.42em", filename= "./FRBTaiwaneseKana.otf", features="+ruby"})
local i = 0
local tkana = {}
SU.dump(content)
for p, c in utf8.codes(content[1]) do
i = i + 1
tkana[i] = c
end
content[1] = utf8.char(tkana[1])
local hascomb, hascomb2 = false
if tkana[2] == 0x0323 or tkana[2] == 0x0305 then
content[1] = content[1] .. utf8.char(tkana[2])
hascomb = true
end
if tkana[3] == 0x0323 or tkana[3] == 0x0305 then
content[1] = content[1] .. utf8.char(tkana[3])
hascomb2 = true
end
SILE.call("rebox", {width = 0}, function()
SILE.call("raise", {height = SILE.measurement("1em")}, content)
end)
local idx = nil
local nkana = nil
local lower = SILE.measurement(0)
if hascomb2 then idx=4 else if hascomb then idx=3 else idx=2 end end
if hascomb2 then nkana=#tkana-2 else if hascomb then nkana=#tkana-1 else nkana=#tkana end end
if idx+1 < #tkana then
SILE.call("rebox", {width = 0}, function() SILE.call("raise", {height = SILE.measurement("0.6ex")}, {utf8.char(tkana[idx])}) end)
lower = SILE.measurement("1.0ex")
content[1] = utf8.char(tkana[idx+1])
elseif (tkana[#tkana] <= 0x1AFF0-1 or tkana[#tkana] >= 0x1AFFF) and nkana > 2 then
SILE.call("rebox", {width = 0}, function() SILE.call("raise", {height = SILE.measurement("0.6ex")}, {utf8.char(tkana[idx])}) end)
lower = SILE.measurement("1.0ex")
content[1] = utf8.char(tkana[#tkana])
else
content[1] = utf8.char(tkana[idx])
end
SILE.call("rebox", {width = 0}, function() SILE.call("lower", {height = lower}, content) end)
content[1] = utf8.char(tkana[#tkana])
if tkana[#tkana] >= 0x1AFF0-1 and tkana[#tkana] <= 0x1AFFF then
SILE.call("font", {size= "1.2em"})
local hbox = nil
SILE.call("rebox", {width = 0}, function()
SILE.call("glue", {width = SILE.measurement("0.8em")})
SILE.call("raise", {height = SILE.measurement("0.33em")}, function()
hbox = SILE.call("hbox", {}, content)
end)
end)
SILE.call("glue", {width = SILE.measurement("0.8em"):absolute()+hbox.width})
else
SILE.call("glue", {width = SILE.measurement("1em")})
end
end)
end, "Taiwanese kana vertical")
|
local utils = require("core.utils")
-- vim-bbye configurations
-- --------------------------------------
utils.keymap("n", "gb", "<cmd>Bdelete<cr>")
-- vim-markdown configurations
-- --------------------------------------
vim.g.markdown_syntax_conceal = 0
vim.g.markdown_fenced_languages = {
"cmake", "c", "cpp", "vim", "sh", "rust",
"viml=vim", "bash=sh"
}
-- ft-sh-syntax configurations
-- --------------------------------------
vim.g.sh_fold_enabled = 5
-- fzf configurations
-- --------------------------------------
vim.g.fzf_buffers_jump = 1
vim.g.fzf_preview_window = ""
vim.g.fzf_layout = {down = "~25%"}
-- override default Rg implementation to include hidden files
-- TODO: find better way to do this in lua
vim.api.nvim_exec(
[[
command! -bang -nargs=* Rg call fzf#vim#grep('rg --column --line-number --no-heading --color=always' . ' --smart-case --hidden --glob "!.git" --glob "!dependency/**" ' . shellescape(<q-args>), 1, <bang>0)
]]
, false)
-- hide statusline in fzf buffer
-- TODO: find better way to do this in lua
vim.api.nvim_exec(
[[
augroup hide_fzf_statusline
autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler | autocmd BufLeave <buffer> set laststatus=2 ruler
augroup END
]]
, false)
-- custom keybindings for fzf
utils.keymap("n", "<F2>", "<cmd>Files<cr>")
utils.keymap("n", "<leader>fr", "<cmd>Rg<cr>")
utils.keymap("n", "<leader><F2>", "<cmd>Buffers<cr>")
-- undotree configurations
-- --------------------------------------
vim.g.undotree_HelpLine = 0
vim.g.undotree_SplitWidth = 35
vim.g.undotree_WindowLayout = 2
vim.g.undotree_DiffpanelHeight = 15
vim.g.undotree_SetFocusWhenToggle = 1
|
require "helpers"
local tables = {}
tables.public_transport_point = osm2pgsql.define_table({
name = 'public_transport_point',
schema = schema_name,
ids = { type = 'node', id_column = 'osm_id' },
columns = {
{ column = 'osm_type', type = 'text', not_null = true },
{ column = 'osm_subtype', type = 'text', not_null = false },
{ column = 'public_transport', type = 'text', not_null = true },
{ column = 'layer', type = 'int', not_null = true },
{ column = 'name', type = 'text' },
{ column = 'ref', type = 'text' },
{ column = 'operator', type = 'text' },
{ column = 'network', type = 'text' },
{ column = 'surface', type = 'text' },
{ column = 'bus', type = 'text' },
{ column = 'shelter', type = 'text' },
{ column = 'bench', type = 'text' },
{ column = 'lit', type = 'text' },
{ column = 'wheelchair', type = 'text'},
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'geom', type = 'point', projection = srid }
}
})
tables.public_transport_line = osm2pgsql.define_table({
name = 'public_transport_line',
schema = schema_name,
ids = { type = 'way', id_column = 'osm_id' },
columns = {
{ column = 'osm_type', type = 'text', not_null = true },
{ column = 'osm_subtype', type = 'text', not_null = false },
{ column = 'public_transport', type = 'text', not_null = true },
{ column = 'layer', type = 'int', not_null = true },
{ column = 'name', type = 'text' },
{ column = 'ref', type = 'text' },
{ column = 'operator', type = 'text' },
{ column = 'network', type = 'text' },
{ column = 'surface', type = 'text' },
{ column = 'bus', type = 'text' },
{ column = 'shelter', type = 'text' },
{ column = 'bench', type = 'text' },
{ column = 'lit', type = 'text' },
{ column = 'wheelchair', type = 'text'},
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'geom', type = 'linestring', projection = srid }
}
})
tables.public_transport_polygon = osm2pgsql.define_table({
name = 'public_transport_polygon',
schema = schema_name,
ids = { type = 'area', id_column = 'osm_id' },
columns = {
{ column = 'osm_type', type = 'text', not_null = true },
{ column = 'osm_subtype', type = 'text', not_null = false },
{ column = 'public_transport', type = 'text', not_null = true },
{ column = 'layer', type = 'int', not_null = true },
{ column = 'name', type = 'text' },
{ column = 'ref', type = 'text' },
{ column = 'operator', type = 'text' },
{ column = 'network', type = 'text' },
{ column = 'surface', type = 'text' },
{ column = 'bus', type = 'text' },
{ column = 'shelter', type = 'text' },
{ column = 'bench', type = 'text' },
{ column = 'lit', type = 'text' },
{ column = 'wheelchair', type = 'text'},
{ column = 'wheelchair_desc', type = 'text'},
{ column = 'geom', type = 'multipolygon', projection = srid }
}
})
local function get_osm_type_subtype(object)
local osm_type_table = {}
if object.tags.bus then
osm_type_table['osm_type'] = 'bus'
osm_type_table['osm_subtype'] = object.tags.bus
elseif object.tags.railway then
osm_type_table['osm_type'] = 'railway'
osm_type_table['osm_subtype'] = object.tags.railway
elseif object.tags.lightrail then
osm_type_table['osm_type'] = 'lightrail'
osm_type_table['osm_subtype'] = object.tags.lightrail
elseif object.tags.train then
osm_type_table['osm_type'] = 'train'
osm_type_table['osm_subtype'] = object.tags.train
elseif object.tags.aerialway then
osm_type_table['osm_type'] = 'aerialway'
osm_type_table['osm_subtype'] = object.tags.aerialway
elseif object.tags.highway then
osm_type_table['osm_type'] = 'highway'
osm_type_table['osm_subtype'] = object.tags.highway
else
osm_type_table['osm_type'] = object.tags.public_transport
if osm_type_table['osm_type'] == nil then
osm_type_table['osm_type'] = 'unknown'
end
osm_type_table['osm_subtype'] = nil
end
return osm_type_table
end
local public_transport_first_level_keys = {
'public_transport',
'aerialway',
'railway'
-- NOTE: Bus is not included, duplicates data in `road*` layers
}
local is_first_level_public_transport = make_check_in_list_func(public_transport_first_level_keys)
local function public_transport_process_node(object)
if not is_first_level_public_transport(object.tags)
then
return
end
local osm_types = get_osm_type_subtype(object)
local public_transport = object.tags.public_transport
if public_transport == nil then
public_transport = 'other'
end
local name = get_name(object.tags)
local ref = get_ref(object.tags)
local wheelchair = object.tags.wheelchair
local wheelchair_desc = get_wheelchair_desc(object.tags)
local operator = object.tags.operator
local layer = parse_layer_value(object.tags.layer)
local network = object.tags.network
local surface = object.tags.surface
local bus = object.tags.bus
local shelter = object.tags.shelter
local bench = object.tags.bench
local lit = object.tags.lit
tables.public_transport_point:add_row({
osm_type = osm_types.osm_type,
osm_subtype = osm_types.osm_subtype,
public_transport = public_transport,
name = name,
ref = ref,
operator = operator,
layer = layer,
network = network,
surface = surface,
bus = bus,
shelter = shelter,
bench = bench,
lit = lit,
wheelchair = wheelchair,
wheelchair_desc = wheelchair_desc,
geom = { create = 'point' }
})
end
local function public_transport_process_way(object)
if not is_first_level_public_transport(object.tags)
then
return
end
local osm_types = get_osm_type_subtype(object)
local public_transport = object.tags.public_transport
if public_transport == nil then
public_transport = 'other'
end
local name = get_name(object.tags)
local ref = get_ref(object.tags)
local wheelchair = object.tags.wheelchair
local wheelchair_desc = get_wheelchair_desc(object.tags)
local operator = object.tags.operator
local layer = parse_layer_value(object.tags.layer)
local network = object.tags.network
local surface = object.tags.surface
local bus = object.tags.bus
local shelter = object.tags.shelter
local bench = object.tags.bench
local lit = object.tags.lit
-- temporarily discarding polygons
if (object.tags.area == 'yes' or object.is_closed)
then
tables.public_transport_polygon:add_row({
osm_type = osm_types.osm_type,
osm_subtype = osm_types.osm_subtype,
public_transport = public_transport,
name = name,
ref = ref,
operator = operator,
layer = layer,
network = network,
surface = surface,
bus = bus,
shelter = shelter,
bench = bench,
lit = lit,
wheelchair = wheelchair,
wheelchair_desc = wheelchair_desc,
geom = { create = 'area' }
})
else
tables.public_transport_line:add_row({
osm_type = osm_types.osm_type,
osm_subtype = osm_types.osm_subtype,
public_transport = public_transport,
name = name,
ref = ref,
operator = operator,
layer = layer,
network = network,
surface = surface,
bus = bus,
shelter = shelter,
bench = bench,
lit = lit,
wheelchair = wheelchair,
wheelchair_desc = wheelchair_desc,
geom = { create = 'line' }
})
end
end
function public_transport_process_relation(object)
if not is_first_level_public_transport(object.tags) then
return
end
local osm_types = get_osm_type_subtype(object)
local public_transport = object.tags.public_transport
if public_transport == nil then
public_transport = 'other'
end
local name = get_name(object.tags)
local ref = get_ref(object.tags)
local wheelchair = object.tags.wheelchair
local wheelchair_desc = get_wheelchair_desc(object.tags)
local operator = object.tags.operator
local layer = parse_layer_value(object.tags.layer)
local network = object.tags.network
local surface = object.tags.surface
local bus = object.tags.bus
local shelter = object.tags.shelter
local bench = object.tags.bench
local lit = object.tags.lit
if object.tags.type == 'multipolygon' then
tables.public_transport_polygon:add_row({
osm_type = osm_types.osm_type,
osm_subtype = osm_types.osm_subtype,
public_transport = public_transport,
name = name,
ref = ref,
operator = operator,
layer = layer,
network = network,
surface = surface,
bus = bus,
shelter = shelter,
bench = bench,
lit = lit,
wheelchair = wheelchair,
wheelchair_desc = wheelchair_desc,
geom = { create = 'area' }
})
end
end
if osm2pgsql.process_node == nil then
-- Change function name here
osm2pgsql.process_node = public_transport_process_node
else
local nested = osm2pgsql.process_node
osm2pgsql.process_node = function(object)
local object_copy = deep_copy(object)
nested(object)
-- Change function name here
public_transport_process_node(object_copy)
end
end
if osm2pgsql.process_way == nil then
-- Change function name here
osm2pgsql.process_way = public_transport_process_way
else
local nested = osm2pgsql.process_way
osm2pgsql.process_way = function(object)
local object_copy = deep_copy(object)
nested(object)
-- Change function name here
public_transport_process_way(object_copy)
end
end
if osm2pgsql.process_relation == nil then
osm2pgsql.process_relation = public_transport_process_relation
else
local nested = osm2pgsql.process_relation
osm2pgsql.process_relation = function(object)
local object_copy = deep_copy(object)
nested(object)
public_transport_process_relation(object_copy)
end
end
|
-- Generated by CSharp.lua Compiler
local System = System
local SlipeMtaDefinitions
local SlipeSharedElements
System.import(function (out)
SlipeMtaDefinitions = Slipe.MtaDefinitions
SlipeSharedElements = Slipe.Shared.Elements
end)
System.namespace("Slipe.Client.Gui", function (namespace)
-- <summary>
-- Represents a custom Gui Font
-- </summary>
namespace.class("GuiFont", function (namespace)
local __ctor1__, __ctor2__
__ctor1__ = function (this, element)
SlipeSharedElements.Element.__ctor__[2](this, element)
end
__ctor2__ = function (this, filePath, size)
__ctor1__(this, SlipeMtaDefinitions.MtaClient.GuiCreateFont(filePath, size))
end
return {
__inherits__ = function (out)
return {
out.Slipe.Shared.Elements.Element
}
end,
__ctor__ = {
__ctor1__,
__ctor2__
},
__metadata__ = function (out)
return {
methods = {
{ ".ctor", 0x106, __ctor1__, out.Slipe.MtaDefinitions.MtaElement },
{ ".ctor", 0x206, __ctor2__, System.String, System.Int32 }
},
class = { 0x6 }
}
end
}
end)
end)
|
-- Bundled: ${date}
assert(slot1.getElementClass() == "ManualButtonUnit")
-- ensure initial state, set up globals
pressedCount = 0
releasedCount = 0
-- prep for user interaction
assert(slot1.getState() == 0)
system.print("please enable and disable the button")
|
---@diagnostic disable: undefined-global
-- Success
function Success()
end
-- Failed
function Failed(error)
print("Error:", error)
end
--
-- data = {"function":3,"address":0,"quantity":1," value":1}
-- data = {"function":3,"address":1,"quantity":1," value":1}
-- -----------------------
-- |电压 |电流
-- -----------------------
-- |0x00 0x00 | 0x00 0x00
-- -----------------------
Actions = {
function(data)
rulexlib:log("data:", data)
local json = require("json")
local table = json.decode(data)
local value = table['value']
local parseTable = rulexlib:MatchBinary(">u:16 v:16", value, false)
rulexlib:log("UA:", json.encode(parseTable))
return true, data
end
}
|
-- Gather diagnostics
local levels = {
errors = vim.diagnostic.severity.ERROR,
warnings = vim.diagnostic.severity.WARN,
info = vim.diagnostic.severity.INFO,
hints = vim.diagnostic.severity.HINT,
}
local function get_all_diagnostics(bufnr)
local result = {}
for k, level in pairs(levels) do
result[k] = #vim.diagnostic.get(bufnr, { severity = level })
end
return result
end
return get_all_diagnostics
|
-- Workspace definition
workspace "FilePatcher"
configurations { "Debug", "Release" }
platforms { "Win32", "Win64" }
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
filter "configurations:Debug"
defines { "DEBUG" }
runtime "Debug"
flags { "symbols" }
filter "configurations:Release"
defines { "NODEBUG" }
runtime "Release"
symbols "On"
filter "platforms:Win32"
system "Windows"
architecture "x86"
defines { "WINDOWS_PLATFORM" }
filter "platforms:Win32"
system "Windows"
architecture "x86_64"
defines { "WINDOWS_PLATFORM" }
-- Engine Module
project "FilePatcher"
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
location "Intermediate/ProjectFiles"
targetdir ("%{wks.location}/Binaries/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/Intermediate/" .. outputdir .. "/%{prj.name}")
includedirs { "" }
files {
"**.cpp",
"**.h"
}
-- Copy the config to the exe file to make testing more easy
buildmessage 'Moving config file to module folder.'
postbuildcommands {
("{COPY} %{wks.location}/config.json %{wks.location}/Binaries/" ..outputdir.. "/%{prj.name}")
}
|
local KeyHandler = Class(function(self, inst)
self.inst = inst
self.handler = TheInput:AddKeyHandler(function(key, down) self:OnRawKey(key, down) end )
end)
function KeyHandler:OnRawKey(key, down)
local player = ThePlayer
if (key and not down) and not IsPaused() then
player:PushEvent("keypressed", {inst = self.inst, player = player, key = key})
elseif key and down and not IsPaused() then
player:PushEvent("keydown", {inst = self.inst, player = player, key = key})
end
end
function KeyHandler:AddActionListener(Namespace, Key, Action)
self.inst:ListenForEvent("keypressed", function(inst, data)
if data.inst == ThePlayer then
if data.key == Key then
if TheWorld.ismastersim then
ThePlayer:PushEvent("keyaction"..Namespace..Action, { Namespace = Namespace, Action = Action, Fn = MOD_RPC_HANDLERS[Namespace][MOD_RPC[Namespace][Action].id] })
else
SendModRPCToServer( MOD_RPC[Namespace][Action] )
end
end
end
end)
if TheWorld.ismastersim then
self.inst:ListenForEvent("keyaction"..Namespace..Action, function(inst, data)
if not data.Action == Action and not data.Namespace == Namespace then
return
end
data.Fn(inst)
end, self.inst)
end
end
return KeyHandler |
local ffi = require "ffi"
require "resty.openssl.include.ossl_typ"
require "resty.openssl.include.param"
ffi.cdef [[
typedef struct ossl_provider_st OSSL_PROVIDER;
typedef struct ossl_lib_ctx_st OSSL_LIB_CTX;
void OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *libctx,
const char *path);
OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *libctx, const char *name);
OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *libctx, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_available(OSSL_LIB_CTX *libctx, const char *name);
const OSSL_PARAM *OSSL_PROVIDER_gettable_params(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, OSSL_PARAM params[]);
// int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *libctx, const char *name,
// ossl_provider_init_fn *init_fn);
const char *OSSL_PROVIDER_get0_name(const OSSL_PROVIDER *prov);
int OSSL_PROVIDER_self_test(const OSSL_PROVIDER *prov);
]]
|
object_intangible_beast_bm_spiderclan_consort = object_intangible_beast_shared_bm_spiderclan_consort:new {
}
ObjectTemplates:addTemplate(object_intangible_beast_bm_spiderclan_consort, "object/intangible/beast/bm_spiderclan_consort.iff")
|
position = {x = -0.986122131347656, y = 1.4300149679184, z = -18.040979385376}
rotation = {x = -0.000122623663628474, y = 269.991760253906, z = 0.00591064570471644}
|
lesser_spend_mana_regenerate_mana = class({})
function lesser_spend_mana_regenerate_mana:OnCreated( data )
-- ### VALUES START ### --
self.mana_refund = 100
self.duration = 8
-- ### VALUES END ### --
end
function lesser_spend_mana_regenerate_mana:DeclareFunctions()
local funcs = {
MODIFIER_EVENT_ON_SPENT_MANA
}
return funcs
end
function lesser_spend_mana_regenerate_mana:OnSpentMana( params )
if not IsServer() then return end
local caster = self:GetParent()
local mana_spent = params.cost
local duration = self.duration
local interval = 0.1
local mana_refund = ( mana_spent * (self.mana_refund / 100) ) / ( duration / interval )
local timer = Timers:CreateTimer(0, function()
caster:GiveMana(mana_refund)
return interval
end)
Timers:CreateTimer(duration, function()
Timers:RemoveTimer(timer)
end)
end
function lesser_spend_mana_regenerate_mana:GetAttributes()
return MODIFIER_ATTRIBUTE_PERMANENT + MODIFIER_ATTRIBUTE_IGNORE_INVULNERABLE + MODIFIER_ATTRIBUTE_MULTIPLE
end
function lesser_spend_mana_regenerate_mana:IsHidden()
return true
end
function lesser_spend_mana_regenerate_mana:IsPurgable()
return false
end
function lesser_spend_mana_regenerate_mana:IsPurgeException()
return false
end
function lesser_spend_mana_regenerate_mana:IsStunDebuff()
return false
end
function lesser_spend_mana_regenerate_mana:IsDebuff()
return false
end
|
local ops = require"src.ops"
require"src.color"
sound = require"src.sound"
git_hash,git_count = "missing git.lua",-1
pcall( function() return require("src.git") end );
print("# Click4 Documentation")
print()
print("__v"..git_count.." #"..git_hash.."__")
print()
for opi,opv in pairs(ops) do
print("## "..(opi-1)..": "..opv.label)
print()
local c = color(opi-1)
print("* Info: "..(opv.info or "This op is not defined."))
print("* Args: "..(opv.arg))
print("* Color: "..c[1]..","..c[2]..","..c[3])
print("* Sound: "..sound[opi-1].i.." ["..(sound[opi-1].f)..".wav]") --todo
print()
end
|
object_mobile_naboo_stonewall_labs_battledroid_green = object_mobile_shared_naboo_stonewall_labs_battledroid_green:new {
}
ObjectTemplates:addTemplate(object_mobile_naboo_stonewall_labs_battledroid_green, "object/mobile/naboo_stonewall_labs_battledroid_green.iff")
|
#!/usr/bin/env lua
--- Tests on dumocks.Library.
-- @see dumocks.Library
-- set search path to include src directory
package.path = "src/?.lua;" .. package.path
local lu = require("luaunit")
local ml = require("dumocks.Library")
require("test.Utilities")
_G.TestLibrary = {}
--- Verify results pre-load properly for systemResolution3.
function _G.TestLibrary.testSystemResolution3()
local library = ml:new()
local closure = library:mockGetClosure()
local expected, actual
local resultSequence = {}
resultSequence[1] = {1, 2, 3}
resultSequence[2] = {2, 3, 4}
-- load results in order into solutions list
table.insert(library.systemResolution3Solutions, resultSequence[1])
table.insert(library.systemResolution3Solutions, resultSequence[2])
expected = resultSequence[1]
actual = closure.systemResolution3({1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {0, 1, 2})
lu.assertEquals(actual, expected)
expected = resultSequence[2]
actual = closure.systemResolution3({1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {0, 1, 2})
lu.assertEquals(actual, expected)
end
--- Verify error when attempting to run without loading results.
function _G.TestLibrary.testSystemResolution3Error()
local library = ml:new()
local closure = library:mockGetClosure()
-- no results primed
lu.assertErrorMsgContains("Solution 1 not loaded.", closure.systemResolution3, {1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {0, 1, 2})
end
--- Verify results pre-load properly for systemResolution2.
function _G.TestLibrary.testSystemResolution2()
local library = ml:new()
local closure = library:mockGetClosure()
local expected, actual
local resultSequence = {}
resultSequence[1] = {1, 2}
resultSequence[2] = {2, 3}
-- load results in order into solutions list
table.insert(library.systemResolution2Solutions, resultSequence[1])
table.insert(library.systemResolution2Solutions, resultSequence[2])
expected = resultSequence[1]
actual = closure.systemResolution2({1, 2, 3}, {4, 5, 6}, {7, 8, 9})
lu.assertEquals(actual, expected)
expected = resultSequence[2]
actual = closure.systemResolution2({1, 2, 3}, {4, 5, 6}, {7, 8, 9})
lu.assertEquals(actual, expected)
end
--- Verify error when attempting to run without loading results.
function _G.TestLibrary.testSystemResolution2Error()
local library = ml:new()
local closure = library:mockGetClosure()
-- no results primed
lu.assertErrorMsgContains("Solution 1 not loaded.", closure.systemResolution2, {1, 2, 3}, {4, 5, 6}, {7, 8, 9})
end
--- Characterization test to determine in-game behavior, can run on mock and uses assert instead of luaunit to run
-- in-game.
--
-- Test setup:
-- 1. 1x Programming Board, no connections
--
-- Exercises:
function _G.TestLibrary.testGameBehavior()
local mock = ml:new()
local library = mock:mockGetClosure()
-- stub this in directly to supress print in the unit test
local unit = {}
unit.exit = function() end
local system = {}
system.print = function() end
---------------
-- copy from here to unit.start()
---------------
-- verify expected functions
local expectedFunctions = {"systemResolution3", "systemResolution2", "load"}
_G.Utilities.verifyExpectedFunctions(library, expectedFunctions)
system.print("Success")
unit.exit()
---------------
-- copy to here to unit.start()
---------------
end
os.exit(lu.LuaUnit.run()) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.