content
stringlengths 5
1.05M
|
|---|
local Cell = require('mob.cell')
local Item = require('mob.item')
local Pack = require('pack')
local Starrot = require('mob.enemy.starrot')
local BiomeStar = {}
BiomeStar.__index = BiomeStar
setmetatable(BiomeStar, {__index = Cell})
function BiomeStar.new(item)
local self = setmetatable(Cell.new(), BiomeStar)
self.tags.save = true
self.tags.biome = true
self.is_solid = true
self.item = item
self.sprite = item.sprite
return self
end
function BiomeStar:tick(dt, game) Cell.tick(self, dt, game) end
function BiomeStar:onMine(miner, game)
if self.is_alive then
if self.item.id == 'volcano_star' then
-- summon Starrot
-- the Starrot will make the biome star drop when the Starrot is destroyed
local boss_exists = false
for mob in pairs(game.world:tagged('starrot')) do
boss_exists = true
break
end
if not boss_exists then
local boss = Starrot.new(game.assets)
boss.x = self.x
boss.y = self.y
game.world:addMob(boss)
end
else
-- drop item
local item = Item.new(Pack.Slot.new(self.item, 1))
item.x = self.x
item.y = self.y
game.world:addMob(item)
self.is_alive = false
end
end
end
function BiomeStar:save()
local save = Cell.save(self)
save.module = 'mob.cell.biome_star'
save.item = self.item.id
return save
end
function BiomeStar.load(save, assets, mob)
local self = Cell.load(save, assets, BiomeStar.new(assets.items[save.item]))
return self
end
return BiomeStar
|
local bitLib = require("plugin.bit" )
local band = bitLib.band
local Transition = class('Transition')
local getters = Transition.getters
local setters = Transition.setters
local OPTION_IGNORE_DISPLAY_CONTROLLER = 1
local OPTION_AUTO_STOP_DISABLED = 2
local OPTION_AUTO_STOP_AT_END = 4
function Transition:ctor(owner)
self._owner = owner
self._timeScale = 1
self._ignoreEngineTimeScale = true
self._totalDuration = 0
end
function Transition:play(times, delay, startTime, endTime, onComplete)
if type(times)=='function' then
self:_play(1, 0, 0, -1, times, false)
elseif type(startTime)=='function' then
self:_play(times, delay, 0, -1, startTime, false)
else
self:_play(times, delay, startTime, endTime, onComplete, false)
end
end
function Transition:playReverse(times, delay, onComplete)
if type(times)=='function' then
self:_play(1, 0, 0, -1, times, true)
else
self:_play(times, delay, 0, - 1, onComplete, true)
end
end
function Transition:changePlayTimes(value)
self._totalTimes = value
end
function Transition:setAutoPlay(autoPlay, times, delay)
if self._autoPlay ~= autoPlay then
self._autoPlay = autoPlay
self._autoPlayTimes = times
self._autoPlayDelay = delay
if self._autoPlay then
if self._owner.onStage then
self:play(times, delay)
end
else
if not self._owner.onStage then
self:stop(false, true)
end
end
end
end
function Transition:_play(times, delay, startTime, endTime, onComplete, reverse)
self:stop(true, true)
self._totalTimes = times or 1
self._reversed = reverse
self._startTime = startTime or 0
self._endTime = endTime or -1
self._playing = true
self._paused = false
self._onComplete = onComplete
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.target == nil then
if #item.targetId > 0 then
item.target = self._owner:getChildById(item.targetId)
else
item.target = self._owner
end
elseif item.target ~= self._owner and item.target.parent ~= self._owner then
item.target = nil
end
if item.target ~= nil and item.type == TransitionActionType.Transition then
local value = item.value
local trans = item.target:getTransition(value.transName)
if trans == this then
trans = nil
end
if trans ~= nil then
if value.playTimes == 0 then
local j = i - 1
while j >= 1 do
local item2 = self._items[j]
if item2.type == TransitionActionType.Transition then
local value2 = item2.value
if value2.trans == trans then
value2.stopTime = item.time - item2.time
break
end
end
j = j - 1
end
if j < 0 then
value.stopTime = 0
else
trans = nil
end
--no need to handle stop anymore
else
value.stopTime = - 1
end
end
value.trans = trans
end
i = i + 1
end
if not delay or delay == 0 then
self:onDelayedPlay()
else
GTween.delayedCall(delay):setTarget(self):onComplete(self.onDelayedPlay, self)
end
end
function Transition:stop(setToComplete, processCallback)
if not self._playing then
return
end
self._playing = false
self._totalTasks = 0
self._totalTimes = 0
local func = self._onComplete
self._onComplete = nil
GTween.kill(self)
--delay start
local cnt = #self._items
if self._reversed then
for i = cnt, 1, -1 do
local item = self._items[i]
if item.target ~= nil then
self:stopItem(item, setToComplete)
end
end
else
for i=1,cnt do
local item = self._items[i]
if item.target ~= nil then
self:stopItem(item, setToComplete)
end
end
end
if processCallback and func ~= nil then
func()
end
end
function Transition:stopItem(item, setToComplete)
if item.displayLockToken ~= 0 then
item.target:releaseDisplayLock(item.displayLockToken)
item.displayLockToken = 0
end
if item.tweener ~= nil then
item.tweener:kill(setToComplete)
item.tweener = nil
if item.type == TransitionActionType.Shake and not setToComplete then
item.target._gearLocked = true
item.target:setPosition(item.target.x - item.value.lastOffset.x, item.target.y - item.value.lastOffset.y)
item.target._gearLocked = false
end
end
if item.type == TransitionActionType.Transition then
local value = item.value
if value.trans ~= nil then
value.trans:stop(setToComplete, false)
end
end
end
function Transition:setPaused(paused)
if not self._playing or self._paused == paused then
return
end
self._paused = paused
local tweener = GTween.getTween(this)
if tweener ~= nil then
tweener:setPaused(paused)
end
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.target ~= nil then
if item.type == TransitionActionType.Transition then
if item.value.trans ~= nil then
item.value.trans:setPaused(paused)
end
elseif item.type == TransitionActionType.Animation then
if paused then
item.value.flag = item.target.playing
item.target.playing = false
else
item.target.playing = item.value.flag
end
end
if item.tweener ~= nil then
item.tweener:setPaused(paused)
end
end
end
end
function Transition:dispose()
if self._playing then
GTween.kill(self)
end
--delay start
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.tweener ~= nil then
item.tweener:kill(false)
item.tweener = nil
end
item.target = nil
item.hook = nil
if item.tweenConfig ~= nil then
item.tweenConfig.endHook = nil
end
end
self._playing = false
self._onComplete = nil
end
function getters:playing()
return self._playing
end
-- <param name="aParams"></param>
function Transition:setValue(label, ...)
local args = {...}
local cnt = #self._items
local value
local found = false
for i=1,cnt do
local item = self._items[i]
local continue = false
if item.label == label then
if item.tweenConfig ~= nil then
value = item.tweenConfig.startValue
else
value = item.value
end
found = true
elseif item.tweenConfig ~= nil and item.tweenConfig.endLabel == label then
value = item.tweenConfig.endValue
found = true
else
continue = true
break
end
if not continue then
local default = item.type
if default == TransitionActionType.XY or default == TransitionActionType.Size
or default == TransitionActionType.Pivot or default == TransitionActionType.Scale or default == TransitionActionType.Skew then
value.b1 = true
value.b2 = true
value.f1 = args[1]
value.f2 = args[2]
elseif default == TransitionActionType.Alpha then
value.f1 = args[1]
break
elseif default == TransitionActionType.Rotation then
value.f1 = args[1]
break
elseif default == TransitionActionType.Color then
value.color = args[1]
break
elseif default == TransitionActionType.Animation then
value.frame = args[1]
if #args>1 then
value.playing = args[2]
end
elseif default == TransitionActionType.Visible then
value.visible = args[1]
break
elseif default == TransitionActionType.Sound then
value.sound = args[1]
if #args > 1 then
value.volume = args[2]
end
elseif default == TransitionActionType.Transition then
value.transName = args[1]
if #args > 1 then
value.playTimes = args[2]
end
elseif default == TransitionActionType.Shake then
value.amplitude = args[1]
if #args > 1 then
value.duration = args[2]
end
elseif default == TransitionActionType.ColorFilter then
value.f1 = args[1]
value.f2 = args[2]
value.f3 = args[3]
value.f4 = args[4]
elseif default == TransitionActionType.Text or default == TransitionActionType.Icon then
value.text = args[1]
end
end
end
assert(found, "label not exists")
end
function Transition:setHook(label, callback)
local cnt = #self._items
local found = false
for i=1,cnt do
local item = self._items[i]
if item.label == label then
item.hook = callback
found = true
break
elseif item.tweenConfig ~= nil and item.tweenConfig.endLabel == label then
item.tweenConfig.endHook = callback
found = true
break
end
end
assert(found, "label not exists")
end
function Transition:clearHooks()
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
item.hook = nil
if item.tweenConfig ~= nil then
item.tweenConfig.endHook = nil
end
end
end
function Transition:setTarget(label, newTarget)
local cnt = #self._items
local found = false
for i=1,cnt do
local item = self._items[i]
if item.label == label then
item.targetId = (newTarget == self._owner or newTarget == nil) and "" or newTarget.id
if self._playing then
if #item.targetId > 0 then
item.target = self._owner:getChildById(item.targetId)
else
item.target = self._owner
end
else
item.target = nil
end
found = true
end
end
assert(found, "label not exists")
end
function Transition:setDuration(label, value)
local cnt = #self._items
local found = false
for i=1,cnt do
local item = self._items[i]
if item.tweenConfig ~= nil and item.label == label then
item.tweenConfig.duration = value
found = true
end
end
assert(found, "label not exists or not a tween label")
end
function Transition:getLabelTime(label)
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.label == label then
return item.time
elseif item.tweenConfig ~= nil and item.tweenConfig.endLabel == label then
return item.time + item.tweenConfig.duration
end
end
end
function getters:timeScale()
return self._timeScale
end
function setters:timeScale(value)
if self._timeScale ~= value then
self._timeScale = value
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.tweener ~= nil then
item.tweener:setTimeScale(value)
elseif item.type == TransitionActionType.Transition then
if item.value.trans ~= nil then
item.value.trans.timeScale = value
end
elseif item.type == TransitionActionType.Animation then
if item.target ~= nil then
item.target.timeScale = value
end
end
end
end
end
function getters:ignoreEngineTimeScale()
return self._ignoreEngineTimeScale
end
function setters:ignoreEngineTimeScale(value)
if self._ignoreEngineTimeScale ~= value then
self._ignoreEngineTimeScale = value
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.tweener ~= nil then
item.tweener:SetIgnoreEngineTimeScale(value)
elseif item.type == TransitionActionType.Transition then
if item.value.trans ~= nil then
item.value.trans.ignoreEngineTimeScale = value
end
elseif item.type == TransitionActionType.Animation then
if item.target ~= nil then
item.target.ignoreEngineTimeScale = value
end
end
end
end
end
function Transition:updateFromRelations(targetId, dx, dy)
local cnt = #self._items
if cnt == 0 then
return
end
for i=1,cnt do
local item = self._items[i]
if item.type == TransitionActionType.XY and item.targetId == targetId then
if item.tweenConfig ~= nil then
item.tweenConfig.startValue.f1 = item.tweenConfig.startValue.f1 + dx
item.tweenConfig.startValue.f2 = item.tweenConfig.startValue.f2 + dy
item.tweenConfig.endValue.f1 = item.tweenConfig.endValue.f1 + dx
item.tweenConfig.endValue.f2 = item.tweenConfig.endValue.f2 + dy
else
item.value.f1 = item.value.f1 + dx
item.value.f2 = item.value.f2 + dy
end
end
end
end
function Transition:onOwnerAddedToStage()
if self._autoPlay and not self._playing then
self:play(self._autoPlayTimes, self._autoPlayDelay)
end
end
function Transition:onOwnerRemovedFromStage()
if band(self._options, OPTION_AUTO_STOP_DISABLED) == 0 then
self:stop(band(self._options, OPTION_AUTO_STOP_AT_END) ~= 0 and true or false, false)
end
end
function Transition:onDelayedPlay()
self:internalPlay()
self._playing = self._totalTasks > 0
if self._playing then
if band(self._options, OPTION_IGNORE_DISPLAY_CONTROLLER) ~= 0 then
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.target ~= nil and item.target ~= self._owner then
item.displayLockToken = item.target:addDisplayLock()
end
end
end
elseif self._onComplete ~= nil then
local func = self._onComplete
self._onComplete = nil
func()
end
end
function Transition:internalPlay()
self._ownerBaseX = self._owner.x
self._ownerBaseY = self._owner.y
self._totalTasks = 0
local needSkipAnimations = false
local cnt = #self._items
if not self._reversed then
for i=1,cnt do
local item = self._items[i]
if item.target ~= nil then
if item.type == TransitionActionType.Animation and self._startTime ~= 0 and item.time <= self._startTime then
needSkipAnimations = true
item.value.flag = false
else
self:playItem(item)
end
end
end
else
for i = cnt, 1, -1 do
local item = self._items[i]
if item.target ~= nil then
self:playItem(item)
end
end
end
if needSkipAnimations then
self:skipAnimations()
end
end
function Transition:playItem(item)
local time
if item.tweenConfig ~= nil then
if self._reversed then
time = (self._totalDuration - item.time - item.tweenConfig.duration)
else
time = item.time
end
if self._endTime == - 1 or time <= self._endTime then
local startValue
local endValue
if self._reversed then
startValue = item.tweenConfig.endValue
endValue = item.tweenConfig.startValue
else
startValue = item.tweenConfig.startValue
endValue = item.tweenConfig.endValue
end
item.value.b1 = startValue.b1 or endValue.b1
item.value.b2 = startValue.b2 or endValue.b2
local default = item.type
if default == TransitionActionType.XY or default == TransitionActionType.Size
or default == TransitionActionType.Scale or default == TransitionActionType.Skew then
item.tweener = GTween.to(startValue.f1, startValue.f2, endValue.f1, endValue.f2, item.tweenConfig.duration)
elseif default == TransitionActionType.Alpha or default == TransitionActionType.Rotation then
item.tweener = GTween.to(startValue.f1, endValue.f1, item.tweenConfig.duration)
elseif default == TransitionActionType.Color then
item.tweener = GTween.toColor(startValue.color, endValue.color, item.tweenConfig.duration)
elseif default == TransitionActionType.ColorFilter then
item.tweener = GTween.to(startValue.f1, startValue.f2, startValue.f3, startValue.f4,
endValue.f1, endValue.f2, endValue.f3, endValue.f4, item.tweenConfig.duration)
end
item.tweener:setDelay(time):setEase(item.tweenConfig.easeType):setRepeat(item.tweenConfig.loop, item.tweenConfig.yoyo)
:setTimeScale(self._timeScale):setIgnoreEngineTimeScale(self._ignoreEngineTimeScale):setTarget(item)
:onStart(self.onTweenStart, self):onUpdate(self.onTweenUpdate, self):onComplete(self.onTweenComplete, self)
if self._endTime >= 0 then
item.tweener:setBreakpoint(self._endTime - time)
end
self._totalTasks = self._totalTasks + 1
end
elseif item.type == TransitionActionType.Shake then
local value = item.value
if self._reversed then
time = (self._totalDuration - item.time - value.duration)
else
time = item.time
end
if self._endTime == - 1 or time <= self._endTime then
value.lastOffsetX = 0
value.lastOffsetY = 0
value.offsetX = 0
value.offsetY = 0
item.tweener = GTween.shake(0, 0, value.amplitude, value.duration):setDelay(time):setTimeScale(self._timeScale)
:setIgnoreEngineTimeScale(self._ignoreEngineTimeScale):setTarget(item)
:onStart(self.onTweenStart, self):onUpdate(self.onTweenUpdate, self):onComplete(self.onTweenComplete, self)
if self._endTime >= 0 then
item.tweener:setBreakpoint(self._endTime - item.time)
end
self._totalTasks = self._totalTasks + 1
end
else
if self._reversed then
time = (self._totalDuration - item.time)
else
time = item.time
end
if time <= self._startTime then
self:applyValue(item)
self:callHook(item, false)
elseif self._endTime == - 1 or time <= self._endTime then
self._totalTasks = self._totalTasks + 1
item.tweener = GTween.delayedCall(time):setTimeScale(self._timeScale):setIgnoreEngineTimeScale(self._ignoreEngineTimeScale)
:setTarget(item):onComplete(self.onDelayedPlayItem, self)
end
end
if item.tweener ~= nil then
item.tweener:seek(self._startTime)
end
end
function Transition:skipAnimations()
local frame
local playStartTime
local playTotalTime
local value
local target
local item
local cnt = #self._items
for i=1,cnt do
item = self._items[i]
if item.type == TransitionActionType.Animation and item.time <= self._startTime and not item.value.flag then
value = item.value
target = item.target
frame = target.frame
playStartTime = target.playing and 0 or - 1
playTotalTime = 0
for j=i,cnt do
item = self._items[j]
if item.type == TransitionActionType.Animation and item.target == target and item.time <= self._startTime then
value = item.value
value.flag = true
if value.frame ~= - 1 then
frame = value.frame
if value.playing then
playStartTime = item.time
else
playStartTime = - 1
end
playTotalTime = 0
else
if value.playing then
if playStartTime < 0 then
playStartTime = item.time
end
else
if playStartTime >= 0 then
playTotalTime = playTotalTime + (item.time - playStartTime)
end
playStartTime = - 1
end
end
self:callHook(item, false)
end
end
if playStartTime >= 0 then
playTotalTime = playTotalTime + (self._startTime - playStartTime)
end
target.playing = playStartTime >= 0
target.frame = frame
if playTotalTime > 0 then
target:advance(playTotalTime)
end
end
end
end
function Transition:onDelayedPlayItem(tweener)
local item = tweener.target
item.tweener = nil
self._totalTasks = self._totalTasks - 1
self:applyValue(item)
self:callHook(item, false)
self:checkAllComplete()
end
function Transition:onTweenStart(tweener)
local item = tweener.target
if item.type == TransitionActionType.XY or item.type == TransitionActionType.Size then
local startValue
local endValue
if self._reversed then
startValue = item.tweenConfig.endValue
endValue = item.tweenConfig.startValue
else
startValue = item.tweenConfig.startValue
endValue = item.tweenConfig.endValue
end
if item.type == TransitionActionType.XY then
if item.target ~= self._owner then
if not startValue.b1 then
startValue.f1 = item.target.x
end
if not startValue.b2 then
startValue.f2 = item.target.y
end
else
if not startValue.b1 then
startValue.f1 = item.target.x - self._ownerBaseX
end
if not startValue.b2 then
startValue.f2 = item.target.y - self._ownerBaseY
end
end
else
if not startValue.b1 then
startValue.f1 = item.target.width
end
if not startValue.b2 then
startValue.f2 = item.target.height
end
end
if not endValue.b1 then
endValue.f1 = startValue.f1
end
if not endValue.b2 then
endValue.f2 = startValue.f2
end
tweener.startValue:setAll(startValue.f1, startValue.f2)
tweener.endValue:setAll(endValue.f1, endValue.f2)
end
self:callHook(item, false)
end
function Transition:onTweenUpdate(tweener)
local item = tweener.target
local default = item.type
if default == TransitionActionType.XY or default == TransitionActionType.Size or default == TransitionActionType.Scale or default == TransitionActionType.Skew then
item.value.f1 = tweener.value.x
item.value.f2 = tweener.value.y
elseif default == TransitionActionType.Alpha or default == TransitionActionType.Rotation then
item.value.f1 = tweener.value.x
elseif default == TransitionActionType.Color then
item.value.color = tweener.value:getColor()
elseif default == TransitionActionType.ColorFilter then
item.value.f1 = tweener.value.x
item.value.f2 = tweener.value.y
item.value.f3 = tweener.value.z
item.value.f4 = tweener.value.w
elseif default == TransitionActionType.Shake then
item.value.offsetX = tweener.value.x
item.value.offsetY = tweener.value.y
end
self:applyValue(item)
end
function Transition:onTweenComplete(tweener)
local item = tweener.target
item.tweener = nil
self._totalTasks = self._totalTasks - 1
if tweener.allCompleted then
self:callHook(item, true)
end
self:checkAllComplete()
end
function Transition:onPlayTransCompleted(item)
self._totalTasks = self._totalTasks - 1
self:checkAllComplete()
end
function Transition:callHook(item, tweenEnd)
if tweenEnd then
if item.tweenConfig ~= nil and item.tweenConfig.endHook ~= nil then
item.tweenConfig.endHook()
end
else
if item.time >= self._startTime and item.hook ~= nil then
item.hook()
end
end
end
function Transition:checkAllComplete()
if self._playing and self._totalTasks == 0 then
if self._totalTimes < 0 then
self:internalPlay()
else
self._totalTimes = self._totalTimes - 1
if self._totalTimes > 0 then
self:internalPlay()
else
self._playing = false
local cnt = #self._items
for i=1,cnt do
local item = self._items[i]
if item.target ~= nil and item.displayLockToken ~= 0 then
item.target:releaseDisplayLock(item.displayLockToken)
item.displayLockToken = 0
end
end
if self._onComplete ~= nil then
local func = self._onComplete
self._onComplete = nil
func()
end
end
end
end
end
function Transition:applyValue(item)
item.target._gearLocked = true
local default = item.type
if default == TransitionActionType.XY then
local value = item.value
if item.target == self._owner then
local f1, f2
if not value.b1 then
f1 = item.target.x
else
f1 = value.f1 + self._ownerBaseX
end
if not value.b2 then
f2 = item.target.y
else
f2 = value.f2 + self._ownerBaseY
end
item.target:setPosition(f1, f2)
else
if not value.b1 then
value.f1 = item.target.x
end
if not value.b2 then
value.f2 = item.target.y
end
item.target:setPosition(value.f1, value.f2)
end
elseif default == TransitionActionType.Size then
local value = item.value
if not value.b1 then
value.f1 = item.target.width
end
if not value.b2 then
value.f2 = item.target.height
end
item.target:setSize(value.f1, value.f2)
elseif default == TransitionActionType.Pivot then
item.target:setPivot(item.value.f1, item.value.f2, item.target.pivotAsAnchor)
elseif default == TransitionActionType.Alpha then
item.target.alpha = item.value.f1
elseif default == TransitionActionType.Rotation then
item.target.rotation = item.value.f1
elseif default == TransitionActionType.Scale then
item.target:setScale(item.value.f1, item.value.f2)
elseif default == TransitionActionType.Skew then
item.target:setskew(item.value.f1, item.value.f2)
elseif default == TransitionActionType.Color then
item.target.color = item.value.color
elseif default == TransitionActionType.Animation then
local value = item.value
if value.frame >= 0 then
item.target.frame = value.frame
end
item.target.playing = value.playing
item.target.timeScale = self._timeScale
item.target.ignoreEngineTimeScale = self._ignoreEngineTimeScale
elseif default == TransitionActionType.Visible then
item.target.visible = item.value.visible
elseif default == TransitionActionType.Shake then
local value = item.value
item.target:setPosition(item.target.x - value.lastOffsetX + value.offsetX, item.target.y - value.lastOffsetY + value.offsetY)
value.lastOffsetX = value.offsetX
value.lastOffsetY = value.offsetY
elseif default == TransitionActionType.Transition then
if self._playing then
local value = item.value
if value.trans ~= nil then
self._totalTasks = self._totalTasks + 1
local startTime = self._startTime > item.time and (self._startTime - item.time) or 0
local endTime = self._endTime >= 0 and (self._endTime - item.time) or - 1
if value.stopTime >= 0 and (endTime < 0 or endTime > value.stopTime) then
endTime = value.stopTime
end
value.trans.timeScale = self._timeScale
value.trans.ignoreEngineTimeScale = self._ignoreEngineTimeScale
value.trans:_play(value.playTimes, 0, startTime, endTime, value.playCompleteDelegate, self._reversed)
end
end
elseif default == TransitionActionType.Sound then
if self._playing and item.time >= self._startTime then
local value = item.value
if value.audioClip == nil then
value.audioClip = UIPackage.getItemAssetByURL(value.sound)
end
if value.audioClip ~= nil then
UIRoot:playOneShotSound(value.audioClip, value.volume)
end
end
elseif default == TransitionActionType.ColorFilter then
--[[local value = item.value
local cf = item.target.filter
if cf == nil then
cf = ColorFilter()
item.target:setfilter(cf)
else
cf:Reset()
end
cf:AdjustBrightness(value.f1)
cf:AdjustContrast(value.f2)
cf:AdjustSaturation(value.f3)
cf:AdjustHue(value.f4)]]
elseif default == TransitionActionType.Text then
item.target.text = item.value.text
elseif default == TransitionActionType.Icon then
item.target.icon = item.value.text
end
item.target._gearLocked = false
end
function Transition:setup(buffer)
self.name = buffer:readS()
self._options = buffer:readInt()
self._autoPlay = buffer:readBool()
self._autoPlayTimes = buffer:readInt()
self._autoPlayDelay = buffer:readFloat()
local cnt = buffer:readShort()
self._items = {}
for i=1,cnt do
local dataLen = buffer:readShort()
local curPos = buffer.pos
buffer:seek(curPos, 0)
local item = {
type = buffer:readByte(),
value = {}
}
table.insert(self._items, item)
item.time = buffer:readFloat()
local targetId = buffer:readShort()
if targetId < 0 then
item.targetId = ""
else
item.targetId = self._owner:getChildAt(targetId).id
end
item.label = buffer:readS()
if buffer:readBool() then
buffer:seek(curPos, 1)
item.tweenConfig = {
startValue = {},
endValue = {}
}
item.tweenConfig.duration = buffer:readFloat()
if item.time + item.tweenConfig.duration > self._totalDuration then
self._totalDuration = item.time + item.tweenConfig.duration
end
item.tweenConfig.easeType = buffer:readByte()
item.tweenConfig.loop = buffer:readInt()
item.tweenConfig.yoyo = buffer:readBool()
item.tweenConfig.endLabel = buffer:readS()
buffer:seek(curPos, 2)
self:decodeValue(item, buffer, item.tweenConfig.startValue)
buffer:seek(curPos, 3)
self:decodeValue(item, buffer, item.tweenConfig.endValue)
else
if item.time > self._totalDuration then
self._totalDuration = item.time
end
buffer:seek(curPos, 2)
self:decodeValue(item, buffer, item.value)
end
buffer.pos = curPos + dataLen
end
end
function Transition:decodeValue(item, buffer, value)
local default = item.type
if default == TransitionActionType.XY or default == TransitionActionType.Size or default == TransitionActionType.Pivot or default == TransitionActionType.Skew then
value.b1 = buffer:readBool()
value.b2 = buffer:readBool()
value.f1 = buffer:readFloat()
value.f2 = buffer:readFloat()
elseif default == TransitionActionType.Alpha or default == TransitionActionType.Rotation then
value.f1 = buffer:readFloat()
elseif default == TransitionActionType.Scale then
value.f1 = buffer:readFloat()
value.f2 = buffer:readFloat()
elseif default == TransitionActionType.Color then
value.color = buffer:readColor()
elseif default == TransitionActionType.Animation then
value.playing = buffer:readBool()
value.frame = buffer:readInt()
elseif default == TransitionActionType.Visible then
value.visible = buffer:readBool()
elseif default == TransitionActionType.Sound then
value.sound = buffer:readS()
value.volume = buffer:readFloat()
elseif default == TransitionActionType.Transition then
value.transName = buffer:readS()
value.playTimes = buffer:readInt()
elseif default == TransitionActionType.Shake then
value.amplitude = buffer:readFloat()
value.duration = buffer:readFloat()
elseif default == TransitionActionType.ColorFilter then
value.f1 = buffer:readFloat()
value.f2 = buffer:readFloat()
value.f3 = buffer:readFloat()
value.f4 = buffer:readFloat()
elseif default == TransitionActionType.Text or default == TransitionActionType.Icon then
value.text = buffer:readS()
end
end
return Transition
|
local included = pcall(debug.getlocal, 4, 1)
local T = require("test")
local ssh_config = require("ssh_config")
--# = ssh_config
--# :toc:
--# :toc-placement!:
--#
--# Get values from ~/.ssh/config
--#
--# toc::[]
--#
--# == *ssh_config.port*(_String_) -> _String_
--# Get configured Port for Host.
--#
--# === Arguments
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |string |Host
--# |===
--#
--# === Returns
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |string |Port
--# |===
local ssh_config_port = function()
T.is_function(ssh_config.port)
end
--#
--# == *ssh_config.hostname*(_String_) -> _String_
--# Get configured Hostname for Host.
--#
--# === Arguments
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |string |Host
--# |===
--#
--# === Returns
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |string |Hostname
--# |===
local ssh_config_hostname = function()
T.is_function(ssh_config.hostname)
end
--#
--# == *ssh_config.identity_file*(_String_) -> _String_
--# Get configured IdentityFile for Host.
--#
--# === Arguments
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |string |Host
--# |===
--#
--# === Returns
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |string |Path of key
--# |===
local ssh_config_identityfile = function()
T.is_function(ssh_config.identity_file)
end
--#
--# == *ssh_config.hosts*() -> _Table_
--# Get all hosts configured in ~/.ssh/config
--#
--# === Returns
--# [options="header",width="72%"]
--# |===
--# |Type |Description
--# |table|List of hosts
--# |===
local ssh_config_hosts = function()
T.is_function(ssh_config.hosts)
T.is_table(ssh_config.hosts())
end
if included then
return function()
T["ssh_config.port"] = ssh_config_port
T["ssh_config.hostname"] = ssh_config_hostname
T["ssh_config.identityfile"] = ssh_config_identityfile
T["ssh_config.hosts"] = ssh_config_hosts
end
else
T["ssh_config.port"] = ssh_config_port
T["ssh_config.hostname"] = ssh_config_hostname
T["ssh_config.identityfile"] = ssh_config_identityfile
T["ssh_config.hosts"] = ssh_config_hosts
end
|
local ppath = select(1, ...)
print("level1/level2/test.lua: ppath = " .. (ppath or "root"))
l0 = require "level1.base"
|
addEventHandler( "onPlayerStealthKill", root,
function ()
cancelEvent()
end
)
|
local can = {}
function can.number (max)
return __vega.set.random(max)
end
function can.string(length)
local s = ""
length = length or 10
local chars = {}
local s = "ABCDEGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
for i = 1, #s do
chars[i] = s:sub(i, i)
end
s = ""
while #s < length do
local r = chars[__vega.set.random(#chars) + 1]
s = s .. r
end
return s
end
function can.dump(object)
assert(object, "expecting passed object")
return __vega.set.dump(object)
end
function can.load(data)
assert(type(data) == 'string', "expecting passed data to be string")
return __vega.set.load(data)
end
function can.compare(left, right)
assert(left and right, "expecting passed operands")
return __vega.set.compare(left, right)
end
function can.info()
return __vega.set.info()
end
return can
|
#!/usr/bin/lua
--[[
Testing unit for service_wrapper.lua
TODO: more test cases are needed:
- test assertions and error conditions
- make test cases for each combination of options that can be combined together (is this feasible?)
- test list & repair of limbo transactions
- test tracer with OS threads
- bind & test fb_shutdown() (fbembed 2.5+)
]]
local config = require 'test_config'
function test_everything(env)
local api = require 'fbclient.service_wrapper'
require 'fbclient.error_codes'
require 'fbclient.binding'
require 'fbclient.status_vector'
local util = require 'fbclient.util'
local dump = util.dump
local asserts = util.asserts
local fbapi
local sv
local function attach()
local spb_opts = {
isc_spb_user_name = env.username,
isc_spb_password = env.password,
}
-- NOTE: 'service_mgr' is just a required magic word that is part of the syntax
local svh = api.attach(fbapi,sv,(env.server and env.server..':' or '')..'service_mgr',spb_opts)
print('**** attached ****')
return svh
end
local function detach(svh)
api.detach(fbapi,sv,svh)
print('**** detatched ****')
end
local function test_attachment(svh)
local function wait()
while true do
local info = api.query(fbapi,sv,svh,{isc_info_svc_running=true},{isc_info_svc_timeout=5})
if not info.isc_info_svc_running then break end
end
end
-- query the response one line at a time
local function query_action()
local t,buf,buf_size
while true do
t,buf,buf_size = api.query(fbapi,sv,svh,{isc_info_svc_line=true},nil,buf,buf_size)
if t.isc_info_svc_line == '' then
break
end
print(t.isc_info_svc_line)
end
end
-- query the response one buffer at a time
local function query_action_faster()
local t,buf,buf_size
while true do
t,buf,buf_size = api.query(fbapi,sv,svh,{isc_info_svc_to_eof=true},nil,buf,buf_size)
if t.isc_info_svc_to_eof == '' then
break
end
io.write(t.isc_info_svc_to_eof)
end
end
local function test_info()
print('**** test_info ****')
dump(api.query(fbapi,sv,svh,{
isc_info_svc_svr_db_info = not config.OS:find'^linux' or (not env.server_ver:find'^2%.1' and not env.server_ver:find'^2%.0') or nil, --ok
--isc_info_svc_get_license = true, --not supported on firebird
--isc_info_svc_get_license_mask = true, --not supported on firebird
isc_info_svc_get_config = true, --nothing on firebird (marked TODO in jrd/svc.cpp)
isc_info_svc_version = true, --ok
isc_info_svc_server_version = true, --ok
isc_info_svc_implementation = true, --ok
isc_info_svc_capabilities = true, --ok
isc_info_svc_user_dbpath = true, --ok
isc_info_svc_get_env = true, --ok
isc_info_svc_get_env_lock = true, --ok
isc_info_svc_get_env_msg = true, --ok
isc_info_svc_line = nil, --only in response to an action, so not now
isc_info_svc_to_eof = nil, --only in response to an action, so not now
--isc_info_svc_get_licensed_users = true, --not supported on firebird
isc_info_svc_limbo_trans = nil, --only in response to isc_action_svc_repair+isc_spb_rpr_list_limbo_trans
isc_info_svc_running = true, --ok
isc_info_svc_get_users = nil, --only in response to isc_action_svc_display_user, so not now
}, {isc_info_svc_timeout = 5}))
end
local function test_get_fb_log()
if config.OS:find'^linux' and (env.server_ver:find'^2%.0' or env.server_ver:find'^2%.1') then return end
print('**** test_get_fb_log ****')
api.start(fbapi,sv,svh,'isc_action_svc_get_fb_log')
query_action_faster()
end
local function test_backup()
print('**** test_backup ****')
api.start(fbapi,sv,svh,'isc_action_svc_backup', {
isc_spb_dbname = env.database_file,
isc_spb_bkp_file = {env.backup_file1, env.backup_file_length, env.backup_file2},
isc_spb_verbose = true,
isc_spb_bkp_factor = nil,-- blocking size for tape drives, whatever that means
isc_spb_options = {
isc_spb_bkp_ignore_checksums = true,
isc_spb_bkp_ignore_limbo = true,
isc_spb_bkp_metadata_only = nil,
isc_spb_bkp_no_garbage_collect = true,
isc_spb_bkp_old_descriptions = nil,
isc_spb_bkp_non_transportable = nil,
isc_spb_bkp_convert = nil,
isc_spb_bkp_expand = nil, -- undocumented and unimplemented in firebird!
},
})
query_action_faster()
print('**** test_restore ****')
api.start(fbapi,sv,svh,'isc_action_svc_restore', {
isc_spb_bkp_file = {env.backup_file1, env.backup_file2},
isc_spb_dbname = env.database_file,
isc_spb_verbose = true,
isc_spb_res_length = nil, -- TODO: what does this option do?
isc_spb_res_buffers = 128,
isc_spb_res_page_size = 1024*16,
isc_spb_res_access_mode = 'isc_spb_res_am_readwrite',
isc_spb_options = {
isc_spb_res_deactivate_idx = nil,
isc_spb_res_no_shadow = nil,
isc_spb_res_no_validity = true,
isc_spb_res_one_at_a_time = true,
isc_spb_res_replace = true,
isc_spb_res_create = true,
isc_spb_res_use_all_space = nil,
},
})
query_action_faster()
end
local function test_repair()
print('**** test_repair ****')
api.start(fbapi,sv,svh,'isc_action_svc_repair', {
isc_spb_dbname = env.database_file,
isc_spb_options = {
isc_spb_rpr_validate_db = true,
isc_spb_rpr_sweep_db = nil,
isc_spb_rpr_mend_db = nil,
isc_spb_rpr_check_db = true,
isc_spb_rpr_ignore_checksum = true,
isc_spb_rpr_kill_shadows = true,
isc_spb_rpr_full = true,
},
})
query_action()
end
local function test_limbo_transactions()
print('**** test_limbo_transactions ****')
api.start(fbapi,sv,svh,'isc_action_svc_repair', {
isc_spb_dbname = env.database_file,
isc_spb_options = {isc_spb_rpr_list_limbo_trans=true},
})
query_action()
dump(api.query(fbapi,sv,svh,{isc_info_svc_limbo_trans=true}))
-- TODO: finish this: we need a way to generate some limbo transactions!
do return end
api.start(fbapi,sv,svh,'isc_action_svc_repair', {
isc_spb_dbname = env.database_file,
isc_spb_rpr_commit_trans = nil,
isc_spb_rpr_rollback_trans = true,
isc_spb_rpr_recover_two_phase = nil,
isc_spb_tra_id = 123,
})
query_action()
end
local function test_user_actions()
if env.lib == 'fbembed' then return end --user actions not available on embedded server
local user_db_file = api.query(fbapi,sv,svh,{isc_info_svc_user_dbpath=true}).isc_info_svc_user_dbpath
pcall(function()
api.start(fbapi,sv,svh,'isc_action_svc_delete_user',{isc_spb_sec_username='test_user'})
end)
pcall(function() wait() end)
pcall(function() query_action() end)
print('**** test_user_actions/add_user ****')
api.start(fbapi,sv,svh,'isc_action_svc_add_user',{
isc_spb_sec_username = 'TEST_USER',
isc_spb_sec_password = '1234',
isc_spb_sec_firstname = 'Test',
isc_spb_sec_middlename = 'W',
isc_spb_sec_lastname = 'User',
isc_spb_dbname = user_db_file,
})
wait()
local function test_display_all_users()
print('**** test_user_actions/display_users (all) ****')
query_action()--a bug in firebird 2.0/2.1 needs this so the output buffer gets cleared!
api.start(fbapi,sv,svh,'isc_action_svc_display_user',{isc_spb_dbname=user_db_file})
dump(api.query(fbapi,sv,svh,{isc_info_svc_get_users=true}))
wait()
end
test_display_all_users()
print('**** test_user_actions/modify_user ****')
api.start(fbapi,sv,svh,'isc_action_svc_modify_user',{
isc_spb_sec_username = 'test_user',
isc_spb_sec_password = '12345',
isc_spb_sec_firstname = 'Test2',
isc_spb_sec_middlename = 'W2',
isc_spb_sec_lastname = 'User2',
isc_spb_dbname = user_db_file,
})
wait()
local function test_display_user(user)
print('**** test_user_actions/display_users (only for '..user..') ****')
api.start(fbapi,sv,svh,'isc_action_svc_display_user',{
isc_spb_sec_username = user,
isc_spb_dbname = user_db_file,
})
dump(api.query(fbapi,sv,svh,{isc_info_svc_get_users=true}))
wait()
end
test_display_user('wrong_user')
test_display_user('test_user')
print('**** test_user_actions/del_user ****')
api.start(fbapi,sv,svh,'isc_action_svc_delete_user',{
isc_spb_sec_username = 'test_user',
isc_spb_dbname = user_db_file,
})
wait()
query_action()
end
local function test_set_db_properties()
print('**** test_set_db_properties ****')
api.start(fbapi,sv,svh,'isc_action_svc_properties', {
isc_spb_dbname = env.database_file,
isc_spb_prp_page_buffers = 100,
isc_spb_prp_sweep_interval = 3600*24,
isc_spb_prp_reserve_space = 'isc_spb_prp_res',
--isc_spb_prp_write_mode = 'isc_spb_prp_wm_sync',
--isc_spb_prp_access_mode = 'isc_spb_prp_am_readwrite',
--isc_spb_prp_set_sql_dialect = 3,
--isc_spb_options = {
-- isc_spb_prp_activate = true,
-- isc_spb_prp_db_online = true,
--},
})
query_action()
end
local function test_shutdown()
if env.server_ver:find('^2%.1') then return end
if env.server_ver:find('^2%.0') then return end
print('**** test_shutdown/shutdown ****')
api.start(fbapi,sv,svh,'isc_action_svc_properties', {
isc_spb_dbname = env.database_file,
isc_spb_prp_shutdown_db = 30, -- shutdown after all attachments close or after timeout
--isc_spb_prp_deny_new_attachments = 30, -- shutdown if no transactions till timeout; deny new attachments in the meantime
--isc_spb_prp_deny_new_transactions = 30, -- shutdown if no transactions till timeout; deny new transactions in the meantime
isc_spb_prp_shutdown_mode = 'isc_spb_prp_sm_full',
})
query_action()
print('**** test_shutdown/online ****')
api.start(fbapi,sv,svh,'isc_action_svc_properties', {
isc_spb_dbname = env.database_file,
isc_spb_prp_online_mode = 'isc_spb_prp_sm_normal',
})
query_action()
end
local function test_db_stats()
print('**** test_db_stats ****')
api.start(fbapi,sv,svh,'isc_action_svc_db_stats', {
isc_spb_dbname = env.database_file,
isc_spb_options = {
isc_spb_sts_data_pages = true,
isc_spb_sts_hdr_pages = nil,
isc_spb_sts_idx_pages = true,
isc_spb_sts_sys_relations = true,
isc_spb_sts_record_versions = true,
isc_spb_sts_table = nil,
isc_spb_sts_nocreation = nil,
},
})
query_action()
end
local function test_trace()
if env.server_ver:find('^2%.1') then return end
if env.server_ver:find('^2%.0') then return end
print('**** start_trace ****')
api.start(fbapi,sv,svh,'isc_action_svc_trace_start',{
isc_spb_trc_name = 'test trace session',
isc_spb_trc_cfg = [[
<database>
enabled true
log_connections true
log_transactions true
log_statement_prepare true
log_statement_free true
log_statement_start true
log_statement_finish true
log_procedure_start true
log_procedure_finish true
log_trigger_start true
log_trigger_finish true
log_context true
print_plan true
print_perf true
log_dyn_requests true
print_dyn true
time_threshold 100
max_sql_length 65535
max_dyn_length 65535
max_arg_length 65535
max_arg_count 1000
</database>
<services>
enabled true
log_services true
#note: the combination of log_services and log_service_query causes infinite loop (CORE-2733)
# log_service_query true
</services>
]],
})
query_action()
--TODO: never reaching this line. find a (multithreaded) way to finish this test automatically.
print('**** test_trace/suspend ****')
api.start(fbapi,sv,svh,'isc_action_svc_trace_suspend',{isc_spb_trc_id=trace_id})
query_action()
print('**** test_trace/resume ****')
api.start(fbapi,sv,svh,'isc_action_svc_trace_resume',{isc_spb_trc_id=trace_id})
query_action()
print('**** test_trace/list ****')
api.start(fbapi,sv,svh,'isc_action_svc_trace_list')
query_action()
print('**** test_trace/stop ****')
api.start(fbapi,sv,svh,'isc_action_svc_trace_stop',{isc_spb_trc_id=trace_id})
query_action()
end
local function test_rdb_mapping()
if env.server_ver:find('^2%.1') then return end
if env.server_ver:find('^2%.0') then return end
if env.lib == 'fbembed' then return end
print('**** test_rdb_mapping/set ****')
api.start(fbapi,sv,svh,'isc_action_svc_set_mapping')
query_action()
print('**** test_rdb_mapping/drop ****')
api.start(fbapi,sv,svh,'isc_action_svc_drop_mapping')
query_action()
end
local function test_nbackup()
if env.server_ver:find('^2%.1') then return end
if env.server_ver:find('^2%.0') then return end
if env.lib == 'fbembed' then return end
print('**** test_nbackup/level0 ****')
os.remove(env.nbackup_file0) --nbackup fails if backup file exists
api.start(fbapi,sv,svh,'isc_action_svc_nbak', {
isc_spb_dbname = env.database_file,
isc_spb_nbk_file = env.nbackup_file0,
isc_spb_nbk_level = 0,
isc_spb_options = {
isc_spb_nbk_no_triggers = true,
},
})
query_action()
print('**** test_nbackup/level1 ****')
os.remove(env.nbackup_file1) --nbackup fails if backup file exists
api.start(fbapi,sv,svh,'isc_action_svc_nbak', {
isc_spb_dbname = env.database_file,
isc_spb_nbk_file = env.nbackup_file1,
isc_spb_nbk_level = 1,
isc_spb_options = {
isc_spb_nbk_no_triggers = true,
},
})
query_action()
print('**** test_nrestore ****')
os.remove(env.database_file) --nbackup fails if database file exists
api.start(fbapi,sv,svh,'isc_action_svc_nrest', {
isc_spb_nbk_file = {env.nbackup_file0, env.nbackup_file1},
isc_spb_dbname = env.database_file,
isc_spb_options = {
isc_spb_nbk_no_triggers = true,
},
})
query_action()
end
test_info()
test_get_fb_log()
test_backup()
test_repair()
test_limbo_transactions()
test_user_actions()
test_set_db_properties()
test_shutdown()
test_db_stats()
test_rdb_mapping()
test_nbackup()
--this blocks indefinitely: make some traffic on the test database if you wanna see any tracing info.
--test_trace()
end
fbapi = fbclient.binding.new(env.libname)
sv = fbclient.status_vector.new()
env:create_test_db():close()
svh = attach()
test_attachment(svh)
detach(svh)
return 1,0
end
--local comb = {{lib='fbembed',ver='2.5.0'}}
--local comb = {{lib='fbclient',ver='2.0.5',server_ver='2.5.0'}}
config.run(test_everything,comb,nil,...)
|
local CurrencyConstants_Mainline =
{
Tables =
{
{
Name = "CurrencyDestroyReason",
Type = "Enumeration",
NumValues = 12,
MinValue = 0,
MaxValue = 11,
Fields =
{
{ Name = "Cheat", Type = "CurrencyDestroyReason", EnumValue = 0 },
{ Name = "Spell", Type = "CurrencyDestroyReason", EnumValue = 1 },
{ Name = "VersionUpdate", Type = "CurrencyDestroyReason", EnumValue = 2 },
{ Name = "QuestTurnin", Type = "CurrencyDestroyReason", EnumValue = 3 },
{ Name = "Vendor", Type = "CurrencyDestroyReason", EnumValue = 4 },
{ Name = "Trade", Type = "CurrencyDestroyReason", EnumValue = 5 },
{ Name = "Capped", Type = "CurrencyDestroyReason", EnumValue = 6 },
{ Name = "Garrison", Type = "CurrencyDestroyReason", EnumValue = 7 },
{ Name = "DroppedToCorpse", Type = "CurrencyDestroyReason", EnumValue = 8 },
{ Name = "BonusRoll", Type = "CurrencyDestroyReason", EnumValue = 9 },
{ Name = "FactionConversion", Type = "CurrencyDestroyReason", EnumValue = 10 },
{ Name = "Last", Type = "CurrencyDestroyReason", EnumValue = 11 },
},
},
{
Name = "CurrencySource",
Type = "Enumeration",
NumValues = 53,
MinValue = 0,
MaxValue = 52,
Fields =
{
{ Name = "ConvertOldItem", Type = "CurrencySource", EnumValue = 0 },
{ Name = "ConvertOldPvPCurrency", Type = "CurrencySource", EnumValue = 1 },
{ Name = "ItemRefund", Type = "CurrencySource", EnumValue = 2 },
{ Name = "QuestReward", Type = "CurrencySource", EnumValue = 3 },
{ Name = "Cheat", Type = "CurrencySource", EnumValue = 4 },
{ Name = "Vendor", Type = "CurrencySource", EnumValue = 5 },
{ Name = "PvPKillCredit", Type = "CurrencySource", EnumValue = 6 },
{ Name = "PvPMetaCredit", Type = "CurrencySource", EnumValue = 7 },
{ Name = "PvPScriptedAward", Type = "CurrencySource", EnumValue = 8 },
{ Name = "Loot", Type = "CurrencySource", EnumValue = 9 },
{ Name = "UpdatingVersion", Type = "CurrencySource", EnumValue = 10 },
{ Name = "LfgReward", Type = "CurrencySource", EnumValue = 11 },
{ Name = "Trade", Type = "CurrencySource", EnumValue = 12 },
{ Name = "Spell", Type = "CurrencySource", EnumValue = 13 },
{ Name = "ItemDeletion", Type = "CurrencySource", EnumValue = 14 },
{ Name = "RatedBattleground", Type = "CurrencySource", EnumValue = 15 },
{ Name = "RandomBattleground", Type = "CurrencySource", EnumValue = 16 },
{ Name = "Arena", Type = "CurrencySource", EnumValue = 17 },
{ Name = "ExceededMaxQty", Type = "CurrencySource", EnumValue = 18 },
{ Name = "PvPCompletionBonus", Type = "CurrencySource", EnumValue = 19 },
{ Name = "Script", Type = "CurrencySource", EnumValue = 20 },
{ Name = "GuildBankWithdrawal", Type = "CurrencySource", EnumValue = 21 },
{ Name = "Pushloot", Type = "CurrencySource", EnumValue = 22 },
{ Name = "GarrisonBuilding", Type = "CurrencySource", EnumValue = 23 },
{ Name = "PvPDrop", Type = "CurrencySource", EnumValue = 24 },
{ Name = "GarrisonFollowerActivation", Type = "CurrencySource", EnumValue = 25 },
{ Name = "GarrisonBuildingRefund", Type = "CurrencySource", EnumValue = 26 },
{ Name = "GarrisonMissionReward", Type = "CurrencySource", EnumValue = 27 },
{ Name = "GarrisonResourceOverTime", Type = "CurrencySource", EnumValue = 28 },
{ Name = "QuestRewardIgnoreCaps", Type = "CurrencySource", EnumValue = 29 },
{ Name = "GarrisonTalent", Type = "CurrencySource", EnumValue = 30 },
{ Name = "GarrisonWorldQuestBonus", Type = "CurrencySource", EnumValue = 31 },
{ Name = "PvPHonorReward", Type = "CurrencySource", EnumValue = 32 },
{ Name = "BonusRoll", Type = "CurrencySource", EnumValue = 33 },
{ Name = "AzeriteRespec", Type = "CurrencySource", EnumValue = 34 },
{ Name = "WorldQuestReward", Type = "CurrencySource", EnumValue = 35 },
{ Name = "WorldQuestRewardIgnoreCaps", Type = "CurrencySource", EnumValue = 36 },
{ Name = "FactionConversion", Type = "CurrencySource", EnumValue = 37 },
{ Name = "DailyQuestReward", Type = "CurrencySource", EnumValue = 38 },
{ Name = "DailyQuestWarModeReward", Type = "CurrencySource", EnumValue = 39 },
{ Name = "WeeklyQuestReward", Type = "CurrencySource", EnumValue = 40 },
{ Name = "WeeklyQuestWarModeReward", Type = "CurrencySource", EnumValue = 41 },
{ Name = "AccountCopy", Type = "CurrencySource", EnumValue = 42 },
{ Name = "WeeklyRewardChest", Type = "CurrencySource", EnumValue = 43 },
{ Name = "GarrisonTalentTreeReset", Type = "CurrencySource", EnumValue = 44 },
{ Name = "DailyReset", Type = "CurrencySource", EnumValue = 45 },
{ Name = "AddConduitToCollection", Type = "CurrencySource", EnumValue = 46 },
{ Name = "Barbershop", Type = "CurrencySource", EnumValue = 47 },
{ Name = "ConvertItemsToCurrencyValue", Type = "CurrencySource", EnumValue = 48 },
{ Name = "PvPTeamContribution", Type = "CurrencySource", EnumValue = 49 },
{ Name = "Transmogrify", Type = "CurrencySource", EnumValue = 50 },
{ Name = "AuctionDeposit", Type = "CurrencySource", EnumValue = 51 },
{ Name = "Last", Type = "CurrencySource", EnumValue = 52 },
},
},
},
};
APIDocumentation:AddDocumentationTable(CurrencyConstants_Mainline);
|
-- configuration
Impl = {}
Impl.UILib = nil
PresenterPort =
interface.build_interface(
{
-- context could have access to both provider and highlights
-- This is Optional
{"context", {"table", "table"}},
{"convert", {"table", "->", "table"}},
{"draw", {{"table", "string"}, "->", "table"}}
}
)
Impl.make_view_binder = function(pos)
return function(drw_stack)
UI = Impl.UILib
-- stack -- > ENTITY --> NESTER<Usecases>
-- --> Converter<controller> --> UI object<presenter>
-- convert nested object to preseneter_obj
-- then handler will draw them later on
local obj = UI.convert(drw_stack)
UI.draw(obj, pos)
return drw_stack
end
end
return {PresenterPort, Impl}
|
return function(box, inventory, rowWidth, padding, backgroundColour)
local inventoryComponent = {}
local inventorySquare = ASSETS.textures.inventory.inventorySquare
inventoryComponent.box = box
inventoryComponent.inventory = inventory
inventoryComponent.rowWidth = rowWidth
inventoryComponent.backgroundColour = backgroundColour or {r = 0.5, g = 0.5, b = 0.5}
inventoryComponent.padding = padding or 0
function inventoryComponent:draw()
if self.backgroundColour ~= nil then
love.graphics.setColor(self.backgroundColour.r, self.backgroundColour.g, self.backgroundColour.b)
end
love.graphics.setColor(1, 1, 1, 1)
local i, j
local numRows = math.ceil(self.inventory.maxStacks / self.rowWidth)
local itemDim = math.min(self.box.width / self.rowWidth, self.box.height / numRows)
for i = 1, numRows do
for j = 1, self.rowWidth do
if (i - 1) * self.rowWidth + j > self.inventory.maxStacks then
break
end
local itemBox = {
x = self.box.x + itemDim * (j - 1) + self.padding / 2,
y = self.box.y + itemDim * (i - 1) + self.padding / 2,
width = itemDim - self.padding,
height = itemDim - self.padding
}
love.graphics.draw(
inventorySquare,
itemBox.x,
itemBox.y,
0,
itemBox.width / inventorySquare:getWidth(),
itemBox.height / inventorySquare:getHeight()
)
if i <= #self.inventory.stacks then
self.inventory.stacks[i].draw(itemBox)
end
end
end
end
return inventoryComponent
end
|
object_tangible_deed_pet_deed_dwarf_spider_droid_deed = object_tangible_deed_pet_deed_shared_dwarf_spider_droid_deed:new {
}
ObjectTemplates:addTemplate(object_tangible_deed_pet_deed_dwarf_spider_droid_deed, "object/tangible/deed/pet_deed/dwarf_spider_droid_deed.iff")
|
AddCSLuaFile('cl_lb.lua')
if CLIENT then return end
--Set up folders and file
if (not file.IsDir("vbtdm","DATA")) then
file.CreateDir("vbtdm")
end
if (not file.IsDir("vbtdm/leaderboards","DATA")) then
file.CreateDir("vbtdm/leaderboards")
end
if (not(file.Exists("vbtdm/leaderboards/users.txt","DATA"))) then
file.Write("vbtdm/leaderboards/users.txt","")
end
--Add a player to the file is they don't exist yet
function AddPlayer(ply)
if ply:IsBot() then return end
local data = file.Read("vbtdm/leaderboards/users.txt","DATA")
local id = ply:UniqueID()
local name = ply:Name()
name = string.Replace(name,","," ") -- replace any commas in their name with spaces so they don't mess up the data reading
if string.find(data,id) ~= nil then return end
file.Append("vbtdm/leaderboards/users.txt",id .. ",0,0," .. name .. "\n")
end
hook.Add("PlayerInitialSpawn","AddPlayerLB",AddPlayer)
--Add one death to the player's data
function AddDeath(ply)
if ply:IsBot() or ply:IsNPC() then return end
local data = file.Read("vbtdm/leaderboards/users.txt","DATA")
local id = ply:UniqueID()
if string.find(data,id) == nil then
AddPlayer(ply) end
local lineStart = string.find(data,id)
local lineEnd = string.find(data,"\n",lineStart)
local lineOld = ""
if lineEnd ~= nil then
lineOld = string.sub(data,lineStart,lineEnd - 1)
else
--this is the last line, it doesn't have a newline character yet
lineOld = string.sub(data,lineStart,string.len(data) - 1)
end
local info = string.Explode(",",lineOld)
info[3] = tonumber(info[3]) + 1
local name = ply:Name() --update their name in case they've changed it
name = string.Replace(name,","," ") -- replace any commas in their name with spaces so they don't mess up the data reading
local lineNew = info[1] .. "," .. info[2] .. "," .. info[3] .. "," .. name
data = string.Replace(data, lineOld, lineNew)
file.Write("vbtdm/leaderboards/users.txt",data)
end
--Add one kill to the player's data
function AddKill(ply,tk)
if ply:IsBot() or ply:IsNPC() then return end
local Add
if tk then
Add = -1
else
Add = 1
end
local data = file.Read("vbtdm/leaderboards/users.txt","DATA")
local id = ply:UniqueID()
if string.find(data,id) == nil then
AddPlayer(ply) end
local lineStart = string.find(data,id)
local lineEnd = string.find(data,"\n",lineStart)
local lineOld = ""
if lineEnd ~= nil then
lineOld = string.sub(data,lineStart,lineEnd - 1)
else
--this is the last line, it doesn't have a newline character yet
lineOld = string.sub(data,lineStart,string.len(data) - 1)
end
local info = string.Explode(",",lineOld)
info[2] = tonumber(info[2]) + Add
local name = ply:Name() --update their name in case they've changed it
name = string.Replace(name,","," ") -- replace any commas in their name with spaces so they don't mess up the data reading
local lineNew = info[1] .. "," .. info[2] .. "," .. info[3] .. "," .. name
data = string.Replace(data, lineOld, lineNew)
file.Write("vbtdm/leaderboards/users.txt",data)
end
--when someone dies, add appropriate kill/death
function UpdateLeaderBoard(died,weapon,killer)
if not(IsValid(died) and IsValid(killer)) then return end
if died == killer then --they committed suicide, don't give them a kill
AddDeath(died)
else
if died:Team() == killer:Team() then
if(killer:IsPlayer()) then
AddKill(killer,true) --they tk'd, take away a kill
end
else
AddKill(killer,false)
AddDeath(died)
end
end
end
hook.Add("PlayerDeath","UpdateLB",UpdateLeaderBoard)
function ShowLB(ply)
local data = file.Read("vbtdm/leaderboards/users.txt","DATA")
local lines = string.Explode("\n",data)
if not(#lines > 0) then return end
umsg.Start("LeaderboardsLB",ply)
umsg.End()
for i, line in ipairs(lines) do
if line == "" then
break
end
local info = string.Explode(",",line)
local plyName = info[4]
local kills = info[2]
local deaths = info[3]
local kd = 0
if not(deaths == 0) then
kd = kills / deaths
end
umsg.Start("LBData",ply)
umsg.String(plyName)
umsg.Short(kills)
umsg.Short(deaths)
umsg.Float(kd)
umsg.End()
end
end
function ShowRankLB(ply)
if ply:IsBot() or ply:IsNPC() then return end
local data = file.Read("vbtdm/leaderboards/users.txt","DATA")
local id = ply:UniqueID()
if string.find(data,id) == nil then
AddPlayer(ply) end
local lineStart = string.find(data,id)
local lineEnd = string.find(data,"\n",lineStart)
local Line = ""
if lineEnd ~= nil then
Line = string.sub(data,lineStart,lineEnd - 1)
else
--this is the last line, it doesn't have a newline character yet
Line = string.sub(data,lineStart,string.len(data) - 1)
end
local info = string.Explode(",",Line)
local plyKills = tonumber(info[2])
local rank = 1
local players = 0
local lines = string.Explode("\n",data)
for i, line in ipairs(lines) do
if line == "" then break end
local lineInfo = string.Explode(",",line)
local kills = tonumber(lineInfo[2])
players = players + 1
if plyKills < kills then -- if they have less kills that someone, their rank is lower ( higher number)
rank = rank + 1
end
end
umsg.Start("RankLB",ply)
umsg.Short(rank)
umsg.Short(players)
umsg.End()
end
function CheckSaidLB(ply,said)
local words = string.Explode(" ", said)
if words[1] == "!lbs" or words[1] == "!leaderboards" then
ShowLB(ply)
end
if words[1] == "!rank" then
ShowRankLB(ply)
end
end
hook.Add("PlayerSay","CheckSaidLB",CheckSaidLB)
|
require "torch"
require "nn"
require "math"
--require "cunn"
--require "cutorch"
require "image"
-- global variables
DataMean = 0
DataStd = 0;
w = 32
h = 32
hand = 1
nonhand = 2
torch.manualSeed(1)
network = torch.load('network.dat')
--network=network:cuda()
function predict(network,input,confidence)
local inp = torch.Tensor(1,h,w):zero()
if input:size(3) ~= w then
return 1
end
if input:size(2) ~= h then
return 1
end
inp[1] = input
--inp[{ {}, {}, {} }]:add(-DataMean) -- mean subtraction
--inp[{ {}, {}, {} }]:div(DataStd) -- std scaling
local responses_per_class = network:forward(inp)
local probabilites_per_class = torch.exp(responses_per_class)
local probability, prediction = torch.max(probabilites_per_class, 2)
--output = prediction[1];
output = 1;
if probabilites_per_class[1][1]<confidence then
output =2;
end
return output,probabilites_per_class[1][1]
end
function loadAndTestFrame(frameNo,confidence,mode)
local name_format = "Skin_%01d.jpg"
local folder = 'hand_dataset/training_dataset/training_data/images/'
local folder1 = ''
local folder5 = 'FinalExp/BS_outputFrames/'
local filename = string.format(name_format,frameNo)
frame = image.load(folder .. filename) -- images_set is global
if(frame:size(1) == 3) then
frame = (frame[{{1},{},{}}] + frame[{{2},{},{}}] + frame[{{3},{},{}}] ) / 3
end
frameProcessed,frameProcessedUsingBS = processFrame(network,frame,confidence,frameNo,mode);
image.save(filename,frameProcessed)
image.save(filename,frameProcessedUsingBS)
end
function processFrame(network,frame,confidence,frameNo,mode)
--frame[{ {}, {}, {} }]:add(-DataMean) -- mean subtraction
--frame[{ {}, {}, {} }]:div(DataStd) -- std scaling
local folder2 = 'FinalExp/BS_inputFrames/'
local folder3 = 'FinalExp/BS_outputFrames/'
local folder4 = 'FinalExp/BS_processedFrames/'
local name_format = "Skin_%01d.jpg"
local filename = string.format(name_format,frameNo)
local ref = torch.Tensor(1000,4)
local refc = 1
local framet = torch.Tensor(frame)
--framet:cuda()
local window = {}
local y = 0
local th = 0
ww = 32*2
wh = 32*2
------------------------------------------------------- Background subtraction
if mode ~= 'normal' then
BS = image.load(folder2 .. filename,1)
BS1 = -(BS-1)
mask= torch.Tensor(wh,ww):zero()+1/(ww*wh) --
BS2 = image.convolve(BS1, mask,'same');
BS3 = BS2:ge(0.9)
--ratio = BS3:sum() / BS3:nElement()
--print('ratio = ',1-ratio)
BS3[{{},{1,torch.round(ww/2)}}] = 1
BS3[{{},{-torch.round(ww/2),-1}}] = 1
BS3[{{1,torch.round(wh/2)},{}}] = 1
BS3[{{-torch.round(wh/2),-1},{}}] = 1
BS4 = torch.Tensor(1,BS3:size(1),BS3:size(2))
BS4[{{1},{},{}}] = BS3
image.save(folder4 .. filename,BS4)
else
BS3 = torch.Tensor(frame:size(2),frame:size(3)):zero()
end
-------------------------------------------------------
local frameProcessed = torch.Tensor(3,frame:size(2),frame:size(3)):zero()
frameProcessed[{{1},{},{}}] = frame
frameProcessed[{{2},{},{}}] = frame
frameProcessed[{{3},{},{}}] = frame
n = frame:size(2)
m = frame:size(3)
s = 5;
for i=1,n-wh,s do
for j=1,m-ww,s do
resizedFrame = image.scale(framet[{{1}, {i,i+wh-1},{j,j+ww-1} }],w,h,'simple')
y,prob = predict(network, resizedFrame ,confidence)
if y == 1 then
if ((mode == 'BS') and (BS3[i+wh/2][j+ww/2] ==0)) or (mode ~= 'BS') then
flag = 1;
for k=1,(refc-1) do
d = ((ref[k][1] - i)^2 + (ref[k][2] - j)^2)^0.5
if d <(wh) then --wh or wh/2 ...
if prob<=ref[k][3] then
flag = 0 -- set to 1 if u want to cancel averaging
else
ref[k][3] = 0
end
end
end
if(flag == 1) then
ref[refc][1] = i
ref[refc][2] = j
ref[refc][3] = prob
ref[refc][4] = BS3[i+wh/2][j+ww/2] --(0) ==> using Background subtraction
refc = refc+1
end
end
end
end
end
local frameProcessedUsingBS = frameProcessed:clone()
----------------------------------------------------------------
nWindows = 0
nWindowsBS = 0
for k = 1,(refc-1) do
i = ref[k][1]
j = ref[k][2]
if (ref[k][3] > 0) and (ref[k][4] == 0) then
frameProcessedUsingBS[{{}, {i,i+th},{j,j+ww-1} }] = 0;
frameProcessedUsingBS[{{}, {i,i+wh-1},{j,j+th} }] = 0;
frameProcessedUsingBS[{{}, {i+wh-1,i+wh-1+th},{j,j+ww-1} }] = 0;
frameProcessedUsingBS[{{}, {i,i+wh-1},{j+ww-1,j+ww-1+th} }] = 0;
frameProcessedUsingBS[{{2}, {i,i+th},{j,j+ww-1} }] = 1;
frameProcessedUsingBS[{{2}, {i,i+wh-1},{j,j+th} }] = 1;
frameProcessedUsingBS[{{2}, {i+wh-1,i+wh-1+th},{j,j+ww-1} }] = 1;
frameProcessedUsingBS[{{2}, {i,i+wh-1},{j+ww-1,j+ww-1+th} }] = 1;
nWindowsBS = nWindowsBS+1
--frameProcessedUsingBS[{{2},{i+wh/2,i+wh/2+5},{j+ww/2,j+ww/2+5}}] = 1
--frameProcessedUsingBS[{{1},{i+wh/2,i+wh/2+5},{j+ww/2,j+ww/2+5}}] = 0
--frameProcessedUsingBS[{{3},{i+wh/2,i+wh/2+5},{j+ww/2,j+ww/2+5}}] = 0
end
end
for k = 1,(refc-1) do
i = ref[k][1]
j = ref[k][2]
if ref[k][3] > 0 then
frameProcessed[{{}, {i,i+th},{j,j+ww-1} }] = 0;
frameProcessed[{{}, {i,i+wh-1},{j,j+th} }] = 0;
frameProcessed[{{}, {i+wh-1,i+wh-1+th},{j,j+ww-1} }] = 0;
frameProcessed[{{}, {i,i+wh-1},{j+ww-1,j+ww-1+th} }] = 0;
frameProcessed[{{2}, {i,i+th},{j,j+ww-1} }] = 1;
frameProcessed[{{2}, {i,i+wh-1},{j,j+th} }] = 1;
frameProcessed[{{2}, {i+wh-1,i+wh-1+th},{j,j+ww-1} }] = 1;
frameProcessed[{{2}, {i,i+wh-1},{j+ww-1,j+ww-1+th} }] = 1;
nWindows = nWindows+1
--frameProcessed[{{2},{i+wh/2,i+wh/2+5},{j+ww/2,j+ww/2+5}}] = 1
--frameProcessed[{{1},{i+wh/2,i+wh/2+5},{j+ww/2,j+ww/2+5}}] = 0
--frameProcessed[{{3},{i+wh/2,i+wh/2+5},{j+ww/2,j+ww/2+5}}] = 0
end
end
print('nWindows =', nWindows)
print('nWindowsBS =', nWindowsBS)
return frameProcessed,frameProcessedUsingBS
end
|
local hotkey = require "mjolnir.hotkey"
local grid = require "mjolnir.bg.grid"
local sizeUp = {}
local function snapWindow(direction)
grid.GRIDHEIGHT = 2
grid.GRIDWIDTH = 2
if direction == "left" or direction == "right" then
grid.resizewindow_thinner()
if direction == "left" then
grid.pushwindow_left()
elseif direction == "right" then
grid.pushwindow_right()
end
grid.pushwindow_up()
grid.resizewindow_taller()
elseif direction == "up" or direction == "down" then
grid.resizewindow_shorter()
if direction == "up" then
grid.pushwindow_up()
elseif direction == "down" then
grid.pushwindow_down()
end
grid.pushwindow_left()
grid.resizewindow_wider()
end
end
function sizeUp.init(modifier)
hotkey.bind(modifier, "left", function()
snapWindow("left")
end)
hotkey.bind(modifier, "right", function()
snapWindow("right")
end)
hotkey.bind(modifier, "up", function()
snapWindow("up")
end)
hotkey.bind(modifier, "down", function()
snapWindow("down")
end)
end
return sizeUp
|
-- Set vim as local variable for lua diagnostics
local vim = vim
-- Plugins
-- Install packer
local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
Packer_bootstrap =
fn.system({"git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path})
end
local use = require("packer").use
require("packer").startup(
function()
-- Package manager
use "wbthomason/packer.nvim"
-- Better nvim startup performance
use "lewis6991/impatient.nvim"
-- Set background to transparent
use "tribela/vim-transparent"
-- autopairs
use "cohama/lexima.vim"
-- Smooth scroll for Neovim
use {"karb94/neoscroll.nvim"}
-- Distruction free mode
use "Pocco81/TrueZen.nvim"
-- Neovim + TMux integration
use "christoomey/vim-tmux-navigator"
-- Themes
-- use "joshdick/onedark.vim" -- Theme inspired by Atom
-- use "folke/tokyonight.nvim"
-- use "ayu-theme/ayu-vim"
-- use "marko-cerovac/material.nvim"
-- use "dracula/vim" -- Theme Dracula
use "rebelot/kanagawa.nvim" -- Kanagawa Theme
-- use(
-- {
-- "catppuccin/nvim",
-- as = "catppuccin"
-- }
-- )
-- File explorer for Neovim
use {
"kyazdani42/nvim-tree.lua",
requires = {
"kyazdani42/nvim-web-devicons" -- optional, for file icon
}
}
-- Git integration for Neovim
use "voldikss/vim-floaterm" -- used to display lazygit in Neovim
use "lewis6991/gitsigns.nvim"
use "APZelos/blamer.nvim" -- Git Blame inspired by VS Code
-- "gc" to comment visual regions/lines
use "numToStr/Comment.nvim"
-- Display todo comments in code
use {
"folke/todo-comments.nvim",
requires = "nvim-lua/plenary.nvim",
config = function()
end
}
-- Helper Plugin to comment in embeded files e.g Vue
use "JoosepAlviste/nvim-ts-context-commentstring"
-- Surround everything
use "tpope/vim-surround"
-- UI to select things (files, grep results, open buffers...)
use {"nvim-telescope/telescope.nvim", requires = {"nvim-lua/plenary.nvim"}}
-- Fancy start screen for Vim
use {
"startup-nvim/startup.nvim",
requires = {"nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim"}
}
-- Which Key
use {
"folke/which-key.nvim"
}
-- Formatter: Syntax formatter for programming languages
use "mhartington/formatter.nvim"
-- Fancier statusline and tabline
use {
"tamton-aquib/staline.nvim",
requires = {"kyazdani42/nvim-web-devicons", opt = true}
}
use {"nvim-lua/lsp-status.nvim"}
use {"phaazon/hop.nvim"} -- Jump to anywhere
-- Highlight, edit, and navigate code using a fast incremental parsing library
use "nvim-treesitter/nvim-treesitter"
-- Additional textobjects for treesitter
use "nvim-treesitter/nvim-treesitter-textobjects"
-- Rainbow Brakets
use "p00f/nvim-ts-rainbow"
-- Snippets
use "rafamadriz/friendly-snippets"
use "L3MON4D3/LuaSnip"
-- LSP Plugins
use(
{
"hrsh7th/nvim-cmp",
requires = {
{"hrsh7th/cmp-nvim-lsp"},
{"hrsh7th/cmp-nvim-lua"},
{"hrsh7th/cmp-buffer"},
{"hrsh7th/cmp-path"},
{"hrsh7th/cmp-cmdline"},
{"saadparwaiz1/cmp_luasnip"},
{"f3fora/cmp-spell", {"hrsh7th/cmp-calc"}, {"hrsh7th/cmp-emoji"}}
}
}
)
use "neovim/nvim-lspconfig"
use({"onsails/lspkind-nvim", requires = {"famiu/bufdelete.nvim"}})
-- Icons
use {
"yamatsum/nvim-nonicons",
requires = {"kyazdani42/nvim-web-devicons"}
}
-- Golang
use "fatih/vim-go"
-- use {
-- "folke/trouble.nvim",
-- requires = "kyazdani42/nvim-web-devicons",
-- config = function()
-- require("trouble").setup {}
-- end
-- }
if Packer_bootstrap then
require("packer").sync()
end
end
)
|
RegisterCommand(
"vehicle",
function(source, args)
local category = args[1]
if category == "spawn" then
local vehicle = args[2]
local carPaint = colors.metal["Pure Gold"]
local veh = spawnVeh(vehicle, true)
print(string.format("Spawned in a(n) %s.", GetLabelText(GetDisplayNameFromVehicleModel(vehicle))))
SetVehicleColours(veh, carPaint, carPaint)
elseif category == "customize" then
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
SetVehicleModKit(veh, 0)
for modType = 0, 10, 1 do
-- You can do 50 iterations total
-- to loop through ALL customizations
-- the first 10 iterations will
-- apply body features
local bestMod = GetNumVehicleMods(veh, modType)-1 -- we will subtract by one to notice differences easier (imo)
SetVehicleMod(veh, modType, bestMod, false)
end
elseif category == "extras" then
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
for id=0, 20 do
if DoesExtraExist(veh, id) then
SetVehicleExtra(veh, id, 1) -- p3 should be 0 for off or 1 for on
end
end
elseif category == "repair" then
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
SetVehicleFixed(veh)
SetVehicleEngineHealth(veh, 1000.0) -- https://runtime.fivem.net/doc/natives/?_0x45F6D8EEF34ABEF1
elseif category == "doors" then
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
local open = GetVehicleDoorAngleRatio(veh, 0) < 0.1
if open then
for i = 0, 7, 1 do
SetVehicleDoorOpen(veh, i, false, false)
end
else
SetVehicleDoorsShut(veh, false)
end
elseif category == "upgrade" then
--[[
16 - Armor
15 - Suspension
13 - Transmission
14 - Horn
12 - Brakes
11 - Engine
]]
--https://github.com/Sighmir/FiveM-Scripts/blob/master/vrp/vrp_lscustoms/client.lua
--https://github.com/TomGrobbe/vMenu/blob/master/vMenu/menus/VehicleOptions.cs#L1713
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
local color = colors.matte["Red"]
local ourSelection = {
-- These will be the upgrades we want to install
["Armour"] = "Armor Upgrade 100%",
["Engine"] = "EMS Upgrade, Level 4",
["Transmission"] = "Race Transmission",
["Suspension"] = "Competition Suspension",
["Horns"] = "Sadtrombone Horn",
["Brakes"] = "Race Brakes",
["Lights"] = "Xenon Lights",
["Turbo"] = "Turbo Tuning"
}
SetVehicleModKit(veh, 0) -- this has to be called before setting vehicle mods
for k, v in pairs(ourSelection) do
local modType = upgrades[k].type
local mod = upgrades[k].types[v].index
ApplyVehicleMod(veh, modType, mod)
end
SetVehicleColours(veh, color, color)
ToggleVehicleMod(veh, upgrades["Lights"].type, true)
-- pretty sure light colors will only work if you have xenon lights equipped
SetVehicleXenonLightsColour(veh, upgrades["Lights"].xenonHeadlightColors["Red"].index)
end
end
)
|
local available = "$AVAILABLE$"
local randomized = "$RANDOMIZED$"
local hashstring = "$HASHSTRING$"
local rand_ord = '$RANDORD$'
local DEF_LEN = 260
local seed_func = os.time
local function to_table(str)
local res = {}
for i = 1, #str do
res[i] = str:sub(i, i)
end
return res
end
local function get_pos(val, table)
for k, v in pairs(table) do
if v == val then
return k
end
end
return false
end
local function get_sum(value)
local sums = 0
for k, v in ipairs(to_table(value)) do
sums = sums + string.byte(v) + (k-1) --0, 1, 2, 3, 4....
end
return sums
end
local function get_request()
math.randomseed(seed_func())
local strlen = math.random(50, 80)
local pos = math.random(1, DEF_LEN-strlen)+1
local substr = hashstring:sub(pos+1, pos+strlen)
local rand_ord_local = math.random(1, rand_ord) + 1
--print(pos)
--print(substr)
--print(rand_ord_local)
local moved_av = randomized:sub(rand_ord_local, -1) .. randomized:sub(1, rand_ord_local-1)
local newstr = ""
for _, v in pairs(to_table(substr)) do
local indx = get_pos(v, to_table(randomized))
newstr = newstr .. moved_av:sub(indx, indx)
end
return randomized:sub(rand_ord_local, rand_ord_local) .. string.format("%.2x", pos) .. newstr
end
local function check_activation_code(request, activation)
local request_tab = to_table(request)
local activation_tab = to_table(activation)
if not get_pos(request_tab[1], to_table(randomized)) or request:len() < 10 then
return false
end
if tonumber(request:sub(2, 3), 16) == nil then
return false
end
local rand_ord_local = get_pos(request_tab[1], to_table(randomized))
local pos = tonumber(request:sub(2, 3), 16)
--print(rand_ord_local)
--print(pos)
local moved_av = randomized:sub(rand_ord_local, -1) .. randomized:sub(1, rand_ord_local-1)
--print(moved_av)
local oldstr = ""
for _, i in pairs(to_table(request:sub(4, -1))) do
local indx = get_pos(i, to_table(moved_av))
oldstr = oldstr .. randomized:sub(indx, indx)
end
--print("---")
--print(oldstr)
--print("---")
local ln = oldstr:len()
if hashstring:sub(pos+1, pos+ln) ~= oldstr then
return false
end
local sumsr = 0
for k, v in pairs(to_table(oldstr)) do
sumsr = sumsr + string.byte(v) + (k-1) + pos
end
local sums = get_sum(hashstring)
sumsr = sums - sumsr
--print(sumsr)
local actpos = get_pos(activation_tab[1], to_table(randomized)) + 1
--print(actpos)
local code = activation:sub(actpos, actpos + 3)
--print(code)
local hexad = ""
for i = 1, #code do
hexad = hexad .. string.format("%x", get_pos(code:sub(i, i), to_table(randomized)) - i)
end
--print(hexad)
local ax = activation:sub(-1, -1)
local sumnstrlen = get_pos(ax, to_table(randomized))-1
local sumstr = activation:sub(-(sumnstrlen+1), -2)
local strsum = ""
for i, v in pairs(to_table(sumstr)) do
strsum = strsum..tostring(get_pos(v, to_table(randomized))-1)
end
--print(sumnstrlen, sumstr, strsum, get_sum(activation:sub(1, -(sumnstrlen+2))) )
return tonumber(hexad, 16) == sumsr and tonumber(strsum) == get_sum(activation:sub(1, -(sumnstrlen+2)))
end
print("Your request code is:")
print(get_request())
print()
print("Enter request code:")
request = io.read()
print("Enter activation code:")
activation = io.read()
print("")
print("Your code is:")
print(check_activation_code(request, activation) and "Valid" or "Invalid")
|
--[[
© CloudSixteen.com do not share, re-distribute or modify
without permission of its author (kurozael@gmail.com).
Clockwork was created by Conna Wiles (also known as kurozael.)
http://cloudsixteen.com/license/clockwork.html
--]]
local COMMAND = Clockwork.command:New("Announce");
COMMAND.tip = "CmdAnnounce";
COMMAND.text = "CmdAnnounceDesc";
COMMAND.arguments = 1;
COMMAND.access = "o";
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local text = table.concat(arguments, " ");
if (text ~= "") then
Clockwork.player:NotifyAll(text);
end;
end;
COMMAND:Register();
|
---@class FIFOQueue
local FIFOQueue = {}
function FIFOQueue:pop()
if self:is_empty() then
return nil
end
local r = self[self.pop_from]
self[self.pop_from] = nil
self.pop_from = self.pop_from - 1
return r
end
function FIFOQueue:peek()
return self[self.pop_from]
end
function FIFOQueue:push(val)
self[self.push_to] = val
self.push_to = self.push_to - 1
end
function FIFOQueue:is_empty()
return self:length() == 0
end
function FIFOQueue:length()
return self.pop_from - self.push_to
end
function FIFOQueue:iter()
local i = self.pop_from + 1
return function()
if i > self.push_to + 1 then
i = i - 1
return self[i]
end
end
end
function FIFOQueue:new()
local queue = {
pop_from = 1,
push_to = 1,
}
self.__index = self
setmetatable(queue, self)
return queue
end
---@return FIFOQueue
return function()
return FIFOQueue:new()
end
|
local i = require "luci.sys"
local t, e, o
t = Map("timewol", translate("定时网络唤醒"),
translate("定时唤醒你的局域网设备"))
t.template = "timewol/index"
e = t:section(TypedSection, "basic", translate("Running Status"))
e.anonymous = true
o = e:option(DummyValue, "timewol_status", translate("当前状态"))
o.template = "timewol/timewol"
o.value = translate("Collecting data...")
e = t:section(TypedSection, "basic", translate("基本设置"))
e.anonymous = true
o = e:option(Flag, "enable", translate("开启"))
o.rmempty = false
e = t:section(TypedSection, "macclient", translate("客户端设置"))
e.template = "cbi/tblsection"
e.anonymous = true
e.addremove = true
nolimit_mac = e:option(Value, "macaddr", translate("客户端MAC"))
nolimit_mac.rmempty = false
i.net.mac_hints(function(e, t) nolimit_mac:value(e, "%s (%s)" % {e, t}) end)
nolimit_eth = e:option(Value, "maceth", translate("网络接口"))
nolimit_eth.rmempty = false
for t, e in ipairs(i.net.devices()) do if e ~= "lo" then nolimit_eth:value(e) end end
a = e:option(Value, "minute", translate("分钟"))
a.optional = false
a = e:option(Value, "hour", translate("小时"))
a.optional = false
a = e:option(Value, "day", translate("日"))
a.optional = false
a = e:option(Value, "month", translate("月"))
a.optional = false
a = e:option(Value, "weeks", translate("星期"))
a.optional = false
local e = luci.http.formvalue("cbi.apply")
if e then io.popen("/etc/init.d/timewol restart") end
return t
|
-- The MIT License (MIT)
-- Copyright (c) 2015 Eugene Aksenov
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
-------------------------------------------------------------------------------
-- Create and register addon
-------------------------------------------------------------------------------
MyBuild = {}
MyBuild.name = "MyBuild"
function MyBuild:Chooselanguage()
local lang = GetCVar("Language.2")
if lang == "en" then
self.LANG = MyBuild.EN
elseif lang == "de" then
self.LANG = MyBuild.DE
end
end
function MyBuild:Initialize()
--register all necessary events
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_PLAYER_ACTIVATED, MyBuild.OnPlayerActivated)
self.updateEnabled = false
end
function MyBuild:ToggleUpdate()
if self.updateEnabled then
self.updateEnabled = true
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_STATS_UPDATED, MyBuild.OnUpdate)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_LEVEL_UPDATE, MyBuild.OnUpdate)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_TITLE_UPDATE, MyBuild.OnUpdate)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_MOUNTS_FULL_UPDATE, MyBuild.OnRefresh)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_MOUNT_UPDATE, MyBuild.OnRefresh)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_EFFECT_CHANGED, MyBuild.OnRefresh)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_EFFECTS_FULL_UPDATE, MyBuild.OnRefresh)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_ATTRIBUTE_UPGRADE_UPDATED, MyBuild.OnRefresh)
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_PLAYER_TITLES_UPDATE, MyBuild.OnRefresh)
else
self.updateEnabled = false
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_STATS_UPDATED)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_LEVEL_UPDATE)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_TITLE_UPDATE)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_MOUNTS_FULL_UPDATE)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_MOUNT_UPDATE)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_EFFECT_CHANGED)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_EFFECTS_FULL_UPDATE)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_ATTRIBUTE_UPGRADE_UPDATED)
EVENT_MANAGER:UnregisterForEvent(MyBuild.name, EVENT_PLAYER_TITLES_UPDATE)
end
end
function MyBuild.OnAddOnLoaded(_, addonName)
if addonName == MyBuild.name then
MyBuild:Initialize()
MyBuild:Chooselanguage()
MyBuild.ui = MyBuild.UI.CreateUI()
MyBuild.ui.mainWindow:SetHidden(true)
end
end
-- update information on player
function MyBuild.OnUpdate (_, unitTag)
if unitTag == "player" then
MyBuild.Char:UpdateInfo()
MyBuild.UI.UpdateUI()
end
end
-- refresh information on player
function MyBuild.OnRefresh (_)
MyBuild.Char:UpdateInfo()
MyBuild.UI.UpdateUI()
end
-- update info on player first time
function MyBuild.OnPlayerActivated(_)
MyBuild.Char:UpdateInfo()
MyBuild.UI.UpdateUI()
end
-- toggle visibility of main window
function MyBuild.ToggleHide()
MyBuild:ToggleUpdate()
MyBuild.ui.mainWindow:ToggleHidden()
end
-- Register addon
EVENT_MANAGER:RegisterForEvent(MyBuild.name, EVENT_ADD_ON_LOADED, MyBuild.OnAddOnLoaded)
-- create command to show/hide information window
SLASH_COMMANDS["/mybuild"] = MyBuild.ToggleHide
-- register menu binding name
ZO_CreateStringId("SI_BINDING_NAME_MYBUILD_SHOWHIDE", "My Build: show/hide")
|
--[[
Copyright (c) 2022 Jason Morley, Tom Sutcliffe
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
_ENV = module()
function parseRsc(data)
local result = {}
local tocOffset, len = string.unpack("<I2I2", data)
local endBytes = string.unpack("<I2", data, #data - 1)
assert(tocOffset == endBytes, "Data is not a ER5 resource file!")
local tocEnd = tocOffset + len
local i = 1
while tocOffset < tocEnd - 2 do
local offset, next = string.unpack("<I2I2", data, 1 + tocOffset)
-- print(offset, next)
local val = string.sub(data, 1 + offset, next)
result[i] = val
i = i + 1
tocOffset = tocOffset + 2
end
local first = result[1]
if first and #first == 8 then
local len, id = string.unpack("<I4I4", first)
if len == 4 then
result.idOffset = id
end
end
return result
end
return _ENV
|
-- scaffolding entry point for incbin
return dofile("incbin.lua")
|
sven_great_cleave_lua = class({})
LinkLuaModifier( "modifier_sven_great_cleave_lua", LUA_MODIFIER_MOTION_NONE )
--------------------------------------------------------------------------------
function sven_great_cleave_lua:GetIntrinsicModifierName()
return "modifier_sven_great_cleave_lua"
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
|
(terralib.loadfile("test.t"))()
import "darkroom"
local const = darkroomSimple.load("frame_1024.bmp")
im a(x,y) [float](const(x,y)) end
im b(x,y) a(x-20,y-1)+a(x+20,y+1) end
im c(x,y) b(x-20,y-1)+b(x+20,y+1) end
im d(x,y) c(x-20,y-1)+c(x+20,y+1) end
im e(x,y) d(x-20,y-1)+d(x+20,y+1) end
im f(x,y) [uint8]((e(x-20,y-1)+e(x+20,y+1))/32) end
test(f)
|
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ───────────────────────────────────────────────── --
-- Plugin: indent-blankline.nvim
-- Github: github.com/lukas-reineke/indent-blankline.nvim
-- ───────────────────────────────────────────────── --
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━❰ configs ❱━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
require("indent_blankline").setup {
show_end_of_line = true,
space_char_blankline = " ",
show_current_context = true,
show_current_context_start = true,
-- char_list = {'|', '¦', '┆', '┊'},
filetype_exclude = {
'help',
'startify',
'alpha',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'lsp-installer',
},
buftype_exclude = {'terminal'},
use_treesitter = true,
show_trailing_blankline_indent = false,
-- context_char = '┃' -- pecifies the character to be used for the current context indent line
-- context_patterns = {'class, function', 'method', '^if'},
}
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━❰ end configs ❱━━━━━━━━━━━━━━━━━ --
-- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ --
|
--
-- channel.lua -- shows how to pass / wait data between channels
--
local SDL = require "SDL"
SDL.init { SDL.flags.Video }
local t, err = SDL.createThread("test",
function ()
local SDL = require "SDL"
local channel = SDL.getChannel "Test"
print("Waiting...")
local v = channel:wait()
print("Received: " .. tostring(v))
return 0
end
)
if not t then
error(err)
end
SDL.delay(1000)
print("Main...")
SDL.delay(3000)
local channel = SDL.getChannel "Test"
print("Pushing...")
channel:supply(true)
print("He received")
|
local World = {}; World.__index = World
local function getUserDataName(userData)
return userData.name or (userData.properties and userData.properties.name)
end
local function verifyUserData(a, b, firstType, secondType)
if getUserDataName(a:getUserData()) == firstType and getUserDataName(b:getUserData()) == secondType then return a, b
elseif getUserDataName(b:getUserData()) == firstType and getUserDataName(a:getUserData()) == secondType then return b, a
else return false, false
end
end
local beginContact = function(a, b, coll)
local bullet, enemy, death_sensor, playerFixture, platforms = nil, nil, nil, nil, nil
playerFixture, platforms = verifyUserData(a, b, "Player", "platforms")
if not playerFixture then playerFixture, enemy = verifyUserData(a, b, "Player", "Enemy") end
if not playerFixture then playerFixture, death_sensor = verifyUserData(a, b, "Player", "death-sensor") end
if not playerFixture then playerFixture, bullet = verifyUserData(a, b, "Player", "Bullet") end
if not bullet and not enemy then enemy, bullet = verifyUserData(a, b, "Enemy", "Bullet") end
if not enemy and not platforms then enemy, platforms = verifyUserData(a, b, "Enemy", "platforms") end
if platforms and (playerFixture or enemy) then
local entity = (playerFixture and gameDirector:getPlayer():getBody()) or (enemy and enemy:getUserData().object)
entity:touchGround(true)
elseif playerFixture and enemy then
gameDirector:getEntityByFixture(playerFixture):takeDamage(
gameDirector:getEnemiesController():getDamage(enemy:getUserData().type)
)
gameDirector:getPlayer():retreat()
elseif playerFixture and death_sensor then
gameDirector:getEntityByFixture(playerFixture):instantDeath()
elseif bullet and (enemy or playerFixture) then
local entity = (enemy and enemy:getUserData().object) or (playerFixture and gameDirector:getPlayer())
entity:takeDamage(1); bullet:getUserData().object:explode()--gameDirector:removeBullet(nil, bullet)
end
end
local endContact = function(a, b, coll)
local entity, bullet = verifyUserData(a, b, "Player", "Bullet")
if entity then entity = gameDirector:getPlayer()
else entity, bullet = verifyUserData(a, b, "Enemy", "Bullet"); if entity then entity = entity:getUserData().object end end
if entity and bullet then
if entity.endContact then entity:endContact() end
end
end
function World:new()
world = love.physics.newWorld(0, 512); love.physics.setMeter(64)
world:setCallbacks(beginContact, endContact)
return setmetatable({world = world}, World)
end
function World:update(dt) self.world:update(dt) end
return World
|
local Root = script.Parent.Parent
local ItemType = require(Root.Enums.ItemType)
local PurchaseError = require(Root.Enums.PurchaseError)
local Symbol = require(Root.Symbols.Symbol)
local KeyMappings = require(script.Parent.KeyMappings)
local GetFFlagProductPercentLocFix = require(Root.Flags.GetFFlagProductPercentLocFix)
local DEBUG_LOCALIZATION = false
--[[
Locale-specific group delimiters for displaying numbers. Used to
format values like 100000 to strings like "100,000". This table
does not provide any info regarding decimal separators
]]
local groupDelimiterByLocale = {
["en-us"] = ",",
["en-gb"] = ",",
["es-mx"] = ",",
["es-es"] = ".",
["fr-fr"] = " ",
["de-de"] = " ",
["pt-br"] = ".",
["zh-cn"] = ",",
["zh-cjv"] = ",",
["zh-tw"] = ",",
["ko-kr"] = ",",
["ja-jp"] = ",",
["it-it"] = " ",
["ru-ru"] = ".",
["id-id"] = ".",
["vi-vn"] = ".",
["th-th"] = ",",
["tr-tr"] = ".",
}
--[[
This is a marker used to indicate that a provided param needs a locale-aware
formatting pass. We need this for nested localization and number formatting
]]
local FormattedParamTag = Symbol.named("FormattedParam")
local function isFormattedParam(paramValue)
return typeof(paramValue) == "table" and paramValue[FormattedParamTag] == true
end
local function createFormattedParam(formatFunc)
return {
[FormattedParamTag] = true,
format = formatFunc,
}
end
--[[
Looks up the given key in the localization context's translation table
]]
local function getLocalizedString(localizationContext, key)
local translations = localizationContext.translations
local fallbackTranslations = localizationContext.fallbackTranslations
if DEBUG_LOCALIZATION and translations[key] == nil then
warn(("Missing translation for %s in locale %s"):format(key, localizationContext.locale))
end
if fallbackTranslations ~= nil and translations[key] == nil then
return fallbackTranslations[key]
end
return translations[key]
end
--[[
Separates digits in a number into groups of three using the given
delimiter and ignoring anything after a decimal point
This function is not locale-aware, and will not be useful for
formatting numbers in languages that use inconsistent group sizes like
Indian numbering systems and myriad-based Chinese numbering systems
]]
local function addGroupDelimiters(numberStr, delimiter)
local delimiterReplace = string.format("%%1%s%%2", delimiter)
-- Repeat substitution until there are no more unbroken four-digit sequences
local substitutions
repeat
numberStr, substitutions = string.gsub(numberStr, "^(-?%d+)(%d%d%d)", delimiterReplace)
until substitutions == 0
return numberStr
end
local LocalizationService = {}
function LocalizationService.formatNumber(localizationContext, number)
local delimiter = groupDelimiterByLocale[localizationContext.locale] or ","
return addGroupDelimiters(number, delimiter)
end
--[[
Generates a placeholder for a number param that needs locale-aware formatting
]]
function LocalizationService.numberParam(number)
return createFormattedParam(function(localizationContext)
return LocalizationService.formatNumber(localizationContext, number)
end)
end
--[[
Generates a placeholder for a param substitution that needs
its own localization pass
]]
function LocalizationService.nestedKeyParam(key)
return createFormattedParam(function(localizationContext)
return getLocalizedString(localizationContext, key)
end)
end
--[[
Utility function returns the localization key for a given item type
]]
function LocalizationService.getKeyFromItemType(itemType)
assert(ItemType.isMember(itemType) or typeof(itemType) == "number" or typeof(itemType) == "string",
"provided item type " ..tostring(itemType) .." must be a number, string, or ItemType enum")
local localizationKey
if itemType == ItemType.Bundle then
localizationKey = "CoreScripts.PurchasePrompt.ItemType.Bundle"
else
localizationKey = KeyMappings.AssetTypeById[tostring(itemType)]
end
if DEBUG_LOCALIZATION and localizationKey == nil then
warn("Invalid Asset Type id " .. tostring(itemType))
end
return localizationKey
end
--[[
Utility function to retrieve relevant localization key for various
types of errors that may be encountered
]]
function LocalizationService.getErrorKey(errorType)
assert(PurchaseError.isMember(errorType),
"provided value " .. tostring(errorType) .. " is not a member of PurchaseError enum")
return KeyMappings.PurchaseErrorKey[errorType]
end
--[[
The primary function of this object
Retrieves a localized string from the provided context with the
given key and performs parameter substitutions
]]
function LocalizationService.getString(localizationContext, key, params)
assert(localizationContext ~= nil, "Must provide valid localization context")
local localizedString = getLocalizedString(localizationContext, key)
if params ~= nil then
for param, value in pairs(params) do
local replacement = value
local paramPlaceholder = ("{%s}"):format(param)
if isFormattedParam(value) then
replacement = value.format(localizationContext)
end
if GetFFlagProductPercentLocFix() then
localizedString = string.gsub(localizedString, paramPlaceholder, function() return replacement end)
else
localizedString = string.gsub(localizedString, paramPlaceholder, replacement)
end
end
end
return localizedString
end
return LocalizationService
|
-- stop.lua
-- programme de stop
-- zf180716.0010
zBTN = 3 -- GPIO0 button
zRelay = 6 -- GPIO12 PWM0 relay (active high)
zLED = 7 -- GPIO13 PWM1 GREEN LED (active low)
gpio.mode(zLED,gpio.OUTPUT)
pwm.stop(zLED)
gpio.write(zLED,1)
|
function DefaultOptionScrollerActor(fontsize,sidespacing)
return Def.ActorFrame{
-- name
Def.BitmapText{
Name = "Name";
Font = Fonts.options["Main"];
InitCommand=cmd(horizalign,left;x,-sidespacing;zoom,fontsize;strokecolor,0.2,0.2,0.2,1);
GainFocusCommand=cmd(stoptweening;decelerate,0.15;diffuse,HighlightColor();strokecolor,BoostColor(HighlightColor(),0.2));
LoseFocusCommand=cmd(stoptweening;decelerate,0.15;diffuse,1,1,1,1;strokecolor,0.2,0.2,0.2,0.8);
DisabledCommand=cmd(stoptweening;decelerate,0.15;diffuse,0.6,0.6,0.6,0.5;strokecolor,0.2,0.2,0.2,0.8);
},
-- value
Def.BitmapText{
Name = "Value";
Font = Fonts.options["Main"];
InitCommand=cmd(horizalign,right;x,sidespacing;zoom,fontsize;strokecolor,0.2,0.2,0.2,1);
GainFocusCommand=cmd(stoptweening;decelerate,0.15;diffuse,HighlightColor();strokecolor,BoostColor(HighlightColor(),0.2));
LoseFocusCommand=cmd(stoptweening;decelerate,0.15;diffuse,1,1,1,1;strokecolor,0.2,0.2,0.2,0.8);
DisabledCommand=cmd(stoptweening;decelerate,0.15;diffuse,0.6,0.6,0.6,0.5;strokecolor,0.2,0.2,0.2,0.8);
},
}
end;
function OptionScrollerItem(spacing, actor)
local spacing = spacing or 16;
local move_time = 0.15;
local item_mt = {
__index = {
prev_index = -1;
create_actors = function(self, params)
self.name = params.name;
self.spacing = spacing;
self.move_time = move_time;
if actor then
return actor..{
InitCommand=function(subself)
self.container = subself;
end;
}
else
return DefaultOptionScrollerActor(self,0.5,64)..{
InitCommand=function(subself)
self.container = subself;
end;
}
end;
end;
transform = function(self, item_index, num_items, is_focus)
self.container:stoptweening();
self.container:y(item_index * self.spacing);
self.prev_index = item_index;
end;
set = function(self, info)
if info and info.Name then
self.container:GetChild("Name"):settext(tostring(info.Name));
else
self.container:GetChild("Name"):settext("");
end;
if info and info.Value then
self.container:GetChild("Value"):settext(tostring(info.Value));
else
self.container:GetChild("Value"):settext("");
end;
end;
}
}
return item_mt;
end;
--//================================================================
function GetCurrentStackInfo(stack, pn)
if not stack then return {} end;
local infotable = {};
local cur = stack[#stack]
for i=1,#cur do
local info = {}
info.Name = cur[i].Name;
if cur[i].Type ~= "noteskin" then
if cur[i].Type == "action" then
info.Value = "";
elseif cur[i].Options then
info.Value = "";
elseif cur[i].Type then
local optiondata = {
Option = cur[i],
Player = pn,
}
info.Value = GetConfig(optiondata);
else
info.Value = "";
end;
end;
info = FormatOptionConfigs(info.Name, info.Value, pn);
table.insert(infotable, info);
end
return infotable;
end
--//================================================================
function ScrollerFocus(s, index, currentoption)
local focused = s:get_items_by_info_index(index)[1];
for i=1,#s.items do
if s.items[i] == focused then
s.items[i].container:playcommand("GainFocus");
else
s.items[i].container:playcommand(currentoption ~= nil and "Disabled" or "LoseFocus");
end;
end;
return focused;
end;
--//================================================================
--[[
param.Input = "Prev", "Next"
param.Player = PLAYER_1, PLAYER_2
param.Option = {
Type = "pref", "config", "options"
Field = field name
Config = config file (if needed)
Default = "baz", 0, etc
Choices = { true, false, "foo", "bar", 5 }
Range = { Min = 0, Max = 10, Step = 1 }
};
]]--
--//================================================================
function ConfigRange(conf, field, default, min, max, step)
return {
Name = field,
Type = "range",
Field = field,
Config = conf,
Default = default,
Range = { Min = min, Max = max, Step = step } ,
}
end;
function ConfigChoices(conf, field, default, choices)
return {
Name = field,
Type = "choices",
Field = field,
Config = conf,
Default = default,
Choices = choices,
}
end;
function ConfigBool(conf, field, default, choices)
return {
Name = field,
Type = "bool",
Field = field,
Config = conf,
Default = default,
Choices = choices or { true, false },
}
end;
function ConfigNoteskin(name)
return {
Name = name,
Field = name,
Type = "noteskin",
}
end;
function ConfigAction(label, func)
return {
Name = label,
Type = "action",
Action = func,
}
end;
function ConfigExit(label)
return {
Name = label
}
end;
function GetConfig(param)
local pn = param and param.Player or nil;
local conf = param.Option.Config;
local field = param.Option.Field;
local ret = get_element_by_path(conf:get_data(pn), field)
return ((ret ~= nil or ret == 0) and ret) or false
end;
local function ChangeConfig(param)
local pn = param.Player or nil;
local conf = param.Option.Config;
local field = param.Option.Field;
local default = param.Option.Default;
local current;
current = GetConfig(param);
if type(current) == "number" then
current = math.round(current * 100000)/100000
end;
if param.Option.Choices and #param.Option.Choices > 1 then
local choices = param.Option.Choices;
local entry = GetEntry(current,choices);
if param.Input == "Prev" then entry = entry-1; end;
if param.Input == "Next" then entry = entry+1; end;
if entry < 1 then entry = #choices; end;
if entry > #choices then entry = 1; end;
newvalue = choices[entry];
elseif param.Option.Range then
local min = param.Option.Range.Min;
local max = param.Option.Range.Max;
local step = param.Option.Range.Step;
if param.Input == "Prev" then newvalue = current - step; end;
if param.Input == "Next" then
if current < step and min >= 0 then newvalue = step else newvalue = current + step; end;
end;
newvalue = clamp(newvalue, min, max);
newvalue = math.round(newvalue * 100000)/100000
else
LuaError("Invalid option choices/range");
end;
set_element_by_path(conf:get_data(pn), field, newvalue);
conf:set_dirty(pn);
end;
--//================================================================
function PropertyActor()
return Def.ActorFrame{
ChangePropertyMessageCommand=function(self,param)
if param and param.Input then
ChangeConfig(param);
MESSAGEMAN:Broadcast("PropertyChanged", param);
end;
end;
};
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 gen_token.lua
--
-- imports
import("core.base.option")
import("core.base.base64")
import("core.base.bytes")
import("core.base.hashset")
import("private.service.service")
import("private.service.config")
-- generate a token
function _generate_token()
return hash.md5(bytes(base64.encode(hash.uuid())))
end
function main()
-- generate token
local token = _generate_token()
-- save to configs
local configs = assert(config.configs(), "configs not found!")
configs.server = configs.server or {}
configs.server.tokens = configs.server.tokens or {}
if not hashset.from(configs.server.tokens):has(token) then
table.insert(configs.server.tokens, token)
else
cprint("Token ${yellow bright}%s${clear} has been added!", token)
return
end
config.save(configs)
cprint("New token ${yellow bright}%s${clear} is generated!", token)
end
|
--[[
--=====================================================================================================--
Script Name: Alias System, for SAPP (PC & CE)
Description: Query a player's hash to check what aliases have been used with it.
Command syntax: /alias ( 'me' or [number: 1-16] ) [page id]
IMPORTANT: If you have downloaded this mod prior to 17th May 2019, you will need to delete alias.txt and let this mod regenerate it.
Copyright (c) 2019, Jericho Crosby <jericho.crosby227@gmail.com>
* Notice: You can use this document subject to the following conditions:
https://github.com/Chalwk77/Halo-Scripts-Phasor-V2-/blob/master/LICENSE
* Written by Jericho Crosby (Chalwk)
- This script is included in the Velocity Multi-Mod with many improvements.
--=====================================================================================================--
]]--
api_version = "1.12.0.0"
-- Configuration [starts] >> ----------------------------------------------
local base_command = "alias"
local dir = "sapp\\alias.lua" -- File is saved to root/sapp/dir.lua
-- You can optionally display results for a specified amount of time.
-- Set 'use_timer' to true to enable this feature.
local use_timer = true
-- How long should the alias results be displayed for? (in seconds) --
local duration = 10
-- Minimum admin level required to use /base_command (-1 for all players, 1-4 for admins)
local privilege_level = 1
-- Message Alignment:
-- Left = l, Right = r, Center = c, Tab: t
local alignment = "|l"
-- Maximum number of names shown per page.
local max_results_per_page = 50
-- Configuration [ends] << ----------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------
local players, player_info, lower, concat, floor, gsub, gmatch = { }, { }, string.lower, table.concat, math.floor, string.gsub, string.gmatch
local format = string.format
local server_ip = "000.000.000.000"
local function InitPlayers()
players = {
["Alias System"] = { },
}
end
local function getip(p)
if (p) then
return get_var(p, "$ip"):match("(%d+.%d+.%d+.%d+)")
end
end
local function populateInfoTable(p)
player_info[p] = { }
local ip, level = getip(p), tonumber(get_var(p, "$lvl"))
table.insert(player_info[p], { ["ip"] = ip, ["level"] = level})
end
local function getPlayerInfo(Player, ID)
if player_present(Player) then
if (player_info[Player] ~= nil) or (player_info[Player] ~= {}) then
for key, _ in ipairs(player_info[Player]) do
return player_info[Player][key][ID]
end
else
return error('ALIAS SYSTEM: getPlayerInfo() -> Unable to get ' .. ID)
end
end
end
local max_columns, max_results = 5, 200
local startIndex, endIndex = 1, max_columns
local spaces = 2
local alias, alias_results = { }, { }
local initialStartIndex, known_pirated_hashes
local function PreLoad()
initialStartIndex = tonumber(startIndex)
known_pirated_hashes = { }
known_pirated_hashes = {
"388e89e69b4cc08b3441f25959f74103",
"81f9c914b3402c2702a12dc1405247ee",
"c939c09426f69c4843ff75ae704bf426",
"13dbf72b3c21c5235c47e405dd6e092d",
"29a29f3659a221351ed3d6f8355b2200",
"d72b3f33bfb7266a8d0f13b37c62fddb",
"76b9b8db9ae6b6cacdd59770a18fc1d5",
"55d368354b5021e7dd5d3d1525a4ab82",
"d41d8cd98f00b204e9800998ecf8427e",
"c702226e783ea7e091c0bb44c2d0ec64",
"f443106bd82fd6f3c22ba2df7c5e4094",
"10440b462f6cbc3160c6280c2734f184",
"3d5cd27b3fa487b040043273fa00f51b",
"b661a51d4ccf44f5da2869b0055563cb",
"740da6bafb23c2fbdc5140b5d320edb1",
"7503dad2a08026fc4b6cfb32a940cfe0",
"4486253cba68da6786359e7ff2c7b467",
"f1d7c0018e1648d7d48f257dc35e9660",
"40da66d41e9c79172a84eef745739521",
"2863ab7e0e7371f9a6b3f0440c06c560",
"34146dc35d583f2b34693a83469fac2a",
"b315d022891afedf2e6bc7e5aaf2d357",
"63bf3d5a51b292cd0702135f6f566bd1",
"6891d0a75336a75f9d03bb5e51a53095",
"325a53c37324e4adb484d7a9c6741314",
"0e3c41078d06f7f502e4bb5bd886772a",
"fc65cda372eeb75fc1a2e7d19e91a86f",
"f35309a653ae6243dab90c203fa50000",
"50bbef5ebf4e0393016d129a545bd09d",
"a77ee0be91bd38a0635b65991bc4b686",
"3126fab3615a94119d5fe9eead1e88c1",
}
end
local function resetAliasParams()
for i = 1, 16 do
if player_present(i) then
if (tonumber(get_var(i, "$lvl")) >= privilege_level) then
local ip = getip(i)
alias:reset(ip)
end
end
end
end
-- #Alias System
function alias:reset(ip)
alias_results[ip] = { }
players["Alias System"][ip] = {
eid = 0,
timer = 0,
current_page = 0,
total_pages = 0,
total_aliases = 0,
current_count = 0,
total_count = 0,
bool = false,
trigger = false,
shared = false,
}
end
function OnScriptLoad()
InitPlayers()
if (use_timer) then
register_callback(cb['EVENT_TICK'], "OnTick")
end
register_callback(cb['EVENT_COMMAND'], "OnServerCommand")
register_callback(cb['EVENT_JOIN'], "OnPlayerConnect")
register_callback(cb['EVENT_LEAVE'], "OnPlayerDisconnect")
register_callback(cb['EVENT_GAME_START'], "OnGameStart")
register_callback(cb['EVENT_GAME_END'], "OnGameEnd")
checkFile(dir)
resetAliasParams()
PreLoad()
alias:reset(server_ip)
for i = 1, 16 do
if player_present(i) then
populateInfoTable(i)
end
end
end
function OnScriptUnload()
--
end
function OnGameStart()
PreLoad()
resetAliasParams()
end
function OnGameEnd()
resetAliasParams()
end
local function stringSplit(inp, sep)
if (sep == nil) then sep = "%s" end
local t, i = {}, 1
for str in gmatch(inp, "([^" .. sep .. "]+)") do
t[i] = str
i = i + 1
end
return t
end
function OnTick()
for i = 1, 16 do
if player_present(i) then
local ip = getip(i)
if (players["Alias System"][ip] and players["Alias System"][ip].trigger) then
players["Alias System"][ip].timer = players["Alias System"][ip].timer + 0.030
alias:show(players["Alias System"][ip])
if players["Alias System"][ip].timer >= floor(duration) then
alias:reset(ip)
end
end
end
end
end
function OnPlayerConnect(PlayerIndex)
local p = tonumber(PlayerIndex)
local ip = getip(p)
local level = tonumber(get_var(p, "$lvl"))
local name, hash = get_var(p, "$name"), get_var(p, "$hash")
alias:add(name, hash)
populateInfoTable(PlayerIndex)
if (level >= privilege_level) then
alias:reset(ip)
end
end
function OnPlayerDisconnect(p)
local level = getPlayerInfo(p, "level")
local ip = getPlayerInfo(p, "ip")
if (tonumber(level) >= privilege_level) then
if (players["Alias System"][ip] ~= nil) then
alias:reset(ip)
end
end
end
local function isConsole(e)
if (e) then
if (e ~= -1 and e >= 1 and e < 16) then
return false
else
return true
end
end
end
local function checkAccess(e)
if (e ~= -1 and e >= 1 and e < 16) then
if (tonumber(get_var(e, "$lvl"))) >= privilege_level then
return true
else
rprint(e, "Command failed. Insufficient Permission.")
return false
end
else
return true
end
end
local function isOnline(t, e)
if (t) then
if (t > 0 and t < 17) then
if player_present(t) then
return true
else
respond(e, "Command failed. Player not online.", "rcon", 4 + 8)
return false
end
else
respond(e, "Invalid player id. Please enter a number between 1-16", "rcon", 4 + 8)
end
end
end
function OnServerCommand(PlayerIndex, Command)
local command, args = cmdsplit(Command)
local executor = tonumber(PlayerIndex)
local TargetID, target_all_players, is_error
local ip = getip(PlayerIndex)
local params = { }
local function validate_params(executor)
local function getplayer(arg, executor)
local pl = { }
if (arg == "me") then
TargetID = executor
table.insert(pl, executor)
elseif (arg:match("%d+")) then
TargetID = tonumber(arg)
table.insert(pl, tonumber(arg))
else
respond(executor, "Invalid player id. Usage: 'me' or [number: 1-16]", "rcon", 4 + 8)
is_error = true
return false
end
if pl[1] then
return pl
end
pl = nil
return false
end
local pl = getplayer(args[1], executor)
if pl then
for i = 1, #pl do
if pl[i] == nil then
break
end
params.eid, params.eip = executor, ip
params.tid = tonumber(pl[i])
params.th, params.tn = get_var(pl[i], "$hash"), get_var(pl[i], "$name")
if (params.eip == nil) then
params.eip = server_ip
end
local bool
if isConsole(executor) then
bool = false
else
bool = use_timer
end
if (args[2] ~= nil) then
params.page = args[2]
end
params.timer = bool
alias:reset(params.eip)
end
end
end
if (command == base_command) then
if (checkAccess(executor)) then
if (args[1] ~= nil) then
validate_params(executor)
if not (is_error) and isOnline(TargetID, executor) then
alias:cmdRoutine(params)
end
else
respond(executor, "Invalid syntax. Usage: /" .. base_command .. " ( 'me' or [number: 1-16] ) [page id]", "rcon", 4 + 8)
end
end
return false
elseif (players["Alias System"][ip] ~= nil) and (players["Alias System"][ip].trigger) then
alias:reset(ip)
cls(executor, 25)
return true
end
end
local getPageCount = function(total, max_results)
local pages = total / (max_results)
if ((pages) ~= floor(pages)) then
pages = floor(pages) + 1
end
return pages
end
function alias:cmdRoutine(params)
local params = params or {}
local eid = params.eid or nil
local eip = params.eip or nil
local use_timer = params.timer or nil
local current_page = params.page or nil
if (current_page == nil) then
current_page = 1
end
local tab = players["Alias System"][eip]
local max_results = max_results_per_page
tab.target_hash = params.th
tab.target_name = params.tn
tab.eid = eid
local aliases, content
local lines = lines_from(dir)
for _, v in pairs(lines) do
if (v:match(tab.target_hash)) then
aliases = v:match(":(.+)")
content = stringSplit(aliases, ",")
alias_results[eip][#alias_results[eip] + 1] = content
end
end
for i = 1, #known_pirated_hashes do
if (tab.target_hash == known_pirated_hashes[i]) then
tab.shared = true
end
end
for i = 1, #alias_results[eip][1] do
if (alias_results[eip][1][i]) then
tab.total_count = tab.total_count + 1
end
end
if (current_page == nil) or (type(current_page) == "string")then
current_page = 1
end
local start = (max_results) * current_page
local startpage = (start - max_results + 1)
local endpage = start
local table = { }
for page_num = startpage, endpage do
if (alias_results[eip][1][page_num]) then
table[#table + 1] = alias_results[eip][1][page_num]
end
end
local pages = getPageCount(tab.total_count, max_results)
if (#table > 0) then
alias_results[eip][1] = { }
for k, v in pairs(table) do
alias_results[eip][1][k] = v
end
for i = 1, max_results do
if (alias_results[eip][1][i]) then
tab.current_count = tab.current_count + 1
end
end
tab.current_page = current_page
tab.total_pages = pages
tab.results = alias_results[eip][1]
tab.max_results = max_results
if (use_timer) then
tab.trigger = true
tab.bool = true
else
alias:show(tab)
end
else
respond(eid, "Invalid Page ID. Valid pages: 1 to " .. pages, "rcon", 2 + 8)
end
end
function alias:show(tab)
alias:align(tab)
end
local function spacing(n)
local String, Seperator = "", ","
for i = 1, n do
if i == floor(n / 2) then
String = String .. ""
end
String = String .. " "
end
return Seperator .. String
end
local function FormatTable(table, rowlen, space)
local longest = 0
for _, v in ipairs(table) do
local len = string.len(v)
if (len > longest) then
longest = len
end
end
local rows = {}
local row = 1
local count = 1
for k, v in ipairs(table) do
if (count % rowlen == 0) or (k == #table) then
rows[row] = (rows[row] or "") .. v
else
rows[row] = (rows[row] or "") .. v .. spacing(longest - string.len(v) + space)
end
if (count % rowlen == 0) then
row = row + 1
end
count = count + 1
end
return concat(rows)
end
function alias:align(tab)
local tab = tab or { }
if (tab) then
local executor = tab.eid
local current_page = tab.current_page
local total_pages = tab.total_pages
local total_aliases = tab.total_aliases
local current_count = tab.current_count
local total_count = tab.total_count
local target_hash = tab.target_hash
local target_name = tab.target_name
local pirated = tab.shared
local results = tab.results
local max_results = tab.max_results
if not isConsole(executor) then
cls(executor, 25)
else
alignment = ""
end
local function formatResults()
local placeholder, row = { }
for i = tonumber(startIndex), tonumber(endIndex) do
if (results) then
placeholder[#placeholder + 1] = results[i]
row = FormatTable(placeholder, max_columns, spaces)
end
end
if (row == "") or (row == " ") then
row = nil -- just in case
end
if (row ~= nil) then
respond(executor, alignment .. " " .. row, "rcon")
end
for a in pairs(placeholder) do
placeholder[a] = nil
end
startIndex = (endIndex + 1)
endIndex = (endIndex + (max_columns))
end
while (endIndex < total_count + max_columns) do
formatResults()
end
if (startIndex >= total_count) then
startIndex = initialStartIndex
endIndex = max_columns
end
respond(executor, " ", "rcon", 2 + 8)
--[Page X/X] Showing (X/X) aliases for xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
respond(executor, alignment .. " " .. '[Page ' .. current_page .. '/' .. total_pages .. '] Showing (' .. current_count .. '/' .. total_count .. ') aliases for: "' .. target_hash .. '"', "rcon", 2 + 8)
if (pirated) then
respond(executor, alignment .. " " .. target_name .. ' is using a pirated copy of Halo.', "rcon", 2 + 8)
end
end
end
function alias:add(name, hash)
local lines = lines_from(dir)
local data, alias, name_found, index
for k, v in pairs(lines) do
if (v:match(hash)) then
data = stringSplit(gsub(v, hash .. ":", ""), ",")
alias = v .. "," .. name
index = k
end
end
if (data) then
local result, i = { }, 1
for j = 1, #data do
if (data[j] ~= nil) then
result[i] = data[j]
i = i + 1
end
end
if (result ~= nil) then
for i = 1, #result do
if (name == result[i]) then
-- Name entry already exists for this hash: (do nothing).
name_found = true
break
end
end
if not (name_found) then
-- Name entry does not eist for this hash: (create new name entry).
delete_from_file(dir, index, 1)
local file = assert(io.open(dir, "a+"))
file:write(alias .. "\n")
file:close()
end
end
else
-- Hash entry does not exist in the database: (create entry).
local file = assert(io.open(dir, "a+"))
file:write(hash .. ":" .. name .. "\n")
file:close()
end
end
function lines_from(file)
local lines = {}
for line in io.lines(file) do
lines[#lines + 1] = line
end
return lines
end
function checkFile()
local file = io.open(dir, "rb")
if file then
file:close()
return true
else
local file = io.open(dir, "a+")
if file then
file:close()
return true
end
end
end
function respond(executor, message, environment, color)
if (executor) then
color = color or 4 + 8
if not (isConsole(executor)) then
if (environment == "chat") then
Say(executor, message)
elseif (environment == "rcon") then
rprint(executor, message)
end
else
cprint(message, color)
end
end
end
function delete(dir, start_index, end_index)
local fp = io.open(dir, "r")
local t = {}
i = 1;
for line in fp:lines() do
if i < start_index or i >= start_index + end_index then
t[#t + 1] = line
end
i = i + 1
end
if i > start_index and i < start_index + end_index then
cprint("Warning: End of File! No entries to delete.")
end
fp:close()
fp = io.open(dir, "w+")
for i = 1, #t do
fp:write(format("%s\n", t[i]))
end
fp:close()
end
function cmdsplit(str)
local subs = {}
local sub = ""
local ignore_quote, inquote, endquote
for i = 1, string.len(str) do
local bool
local char = string.sub(str, i, i)
if char == " " then
if (inquote and endquote) or (not inquote and not endquote) then
bool = true
end
elseif char == "\\" then
ignore_quote = true
elseif char == "\"" then
if not ignore_quote then
if not inquote then
inquote = true
else
endquote = true
end
end
end
if char ~= "\\" then
ignore_quote = false
end
if bool then
if inquote and endquote then
sub = string.sub(sub, 2, string.len(sub) - 1)
end
if sub ~= "" then
table.insert(subs, sub)
end
sub = ""
inquote = false
endquote = false
else
sub = sub .. char
end
if i == string.len(str) then
if string.sub(sub, 1, 1) == "\"" and string.sub(sub, string.len(sub), string.len(sub)) == "\"" then
sub = string.sub(sub, 2, string.len(sub) - 1)
end
table.insert(subs, sub)
end
end
local cmd = subs[1]
local args = subs
table.remove(args, 1)
return cmd, args
end
function delete_from_file(dir, start_index, end_index)
local fp = io.open(dir, "r")
local t = {}
i = 1;
for line in fp:lines() do
if i < start_index or i >= start_index + end_index then
t[#t + 1] = line
end
i = i + 1
end
if i > start_index and i < start_index + end_index then
cprint("Warning: End of File! No entries to delete.")
end
fp:close()
fp = io.open(dir, "w+")
for i = 1, #t do
fp:write(format("%s\n", t[i]))
end
fp:close()
end
function cls(PlayerIndex, count)
if (PlayerIndex) then
for _ = 1, count do
respond(PlayerIndex, " ", "rcon")
end
end
end
|
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
description 'DevoNetwork'
ui_page('html/index.html')
client_scripts {
'jns_client.lua',
}
server_scripts {
'jns_server.lua',
}
files({
'html/index.html',
'html/css/style.css',
'html/css/bootstrap.min.css',
'html/js/script.js',
'html/js/bootstrap.min.js'
})
|
local make
make = function(x, y)
local block = {
x = x,
y = y,
tag = "block"
}
block.draw = function(self)
do
local _with_0 = love.graphics
_with_0.setColor(1, 1, 1)
_with_0.draw(sprites.rock, x, y, 0, 24 / sprites.grass:getWidth(), 24 / sprites.grass:getHeight())
return _with_0
end
end
world:add(block, x, y, 24, 24)
light_world:newRectangle(x + 12, y + 12, 24, 24)
return block
end
return {
make = make
}
|
object_mobile_zozpheratu_static = object_mobile_shared_zozpheratu_static:new {
}
ObjectTemplates:addTemplate(object_mobile_zozpheratu_static, "object/mobile/zozpheratu_static.iff")
|
function GetRGB(r, g, b)
return {r / 255, g / 255, b / 255}
end
return {
WHITE = GetRGB(255, 255, 255), -- #ffffff
BLACK_ZEUS = GetRGB(43, 40, 33), -- #2b2821
BROWN_KABUL = GetRGB(98, 76, 60), -- #624c3c
BROWN_BRANDY = GetRGB(217, 172, 139), -- #d9ac8b
BROWN_GRAIN = GetRGB(227, 207, 180), -- #e3cfb4
BLUE_CLOUD_BURST = GetRGB(36, 61, 92), -- #243d5c
BLUE_NEVADA = GetRGB(93, 114, 117), -- #5d7275
BLUE_SMALT = GetRGB(92, 139, 147), -- #5c8b93
RED_HILLARY = GetRGB(177, 165, 141), -- #b1a58d
RED_NIGHT_SHADZ = GetRGB(176, 58, 72), -- #b03a48
ORANGE_RAW_SIENNA = GetRGB(212, 128, 77), -- #d4804d
YELLOW_CHENIN = GetRGB(224, 200, 114), -- #e0c872
GREEN_MINERAL = GetRGB(62, 105, 88) -- #3e6958
}
|
local log = require "telescope.log"
local deprecated = {}
deprecated.picker_window_options = function(opts)
local messages = {}
-- Deprecated: PR:922, 2021/06/25
-- Can be removed in a few weeks.
if opts.width then
table.insert(messages, "'opts.width' is no longer valid. Please use 'layout_config.width' instead")
end
if opts.height then
table.insert(messages, "'opts.height' is no longer valid. Please use 'layout_config.height' instead")
end
if opts.results_height then
table.insert(messages, "'opts.results_height' is no longer valid. Please see ':help telescope.changelog-922'")
end
if opts.results_width then
table.insert(messages,
"'opts.results_width' actually didn't do anything. Please see ':help telescope.changelog-922'"
)
end
if opts.prompt_position then
table.insert(messages,
"'opts.prompt_position' is no longer valid. Please use 'layout_config.prompt_position' instead."
)
end
if opts.preview_cutoff then
table.insert(messages,
"'opts.preview_cutoff' is no longer valid. Please use 'layout_config.preview_cutoff' instead."
)
end
if #messages > 0 then
table.insert(messages, 1, "Deprecated window options. Please see ':help telescope.changelog'")
vim.api.nvim_err_write(table.concat(messages, "\n \n ") .. "\n \nPress <Enter> to continue\n")
end
end
deprecated.layout_configuration = function(user_defaults)
if user_defaults.layout_defaults then
if user_defaults.layout_config == nil then
log.warn "Using 'layout_defaults' in setup() is deprecated. Use 'layout_config' instead."
user_defaults.layout_config = user_defaults.layout_defaults
else
error "Using 'layout_defaults' in setup() is deprecated. Remove this key and use 'layout_config' instead."
end
end
return user_defaults
end
return deprecated
|
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
dashboard.section.header.val = vim.fn.readfile(vim.fn.expand(
'~/.config/nvim/rc/files/dashboard_custom_header.txt'))
dashboard.section.buttons.val = {
dashboard.button('l', ' Open last session', ':SearchSession<CR>'),
dashboard.button('h', ' Recently opened files', ':Telescope my_mru<CR>'),
dashboard.button('f', ' Find file', ':Telescope find_files<CR>'),
dashboard.button('e', ' New file', ':enew<CR>'),
dashboard.button('b', ' Jump to bookmarks', ':Telescope marks<CR>'),
dashboard.button('n', ' Memo New', ':NeuronNew<CR>'),
dashboard.button('m', ' Memo List', ':NeuronFindZettels<CR>')
}
alpha.setup(dashboard.opts)
|
return {
"mickael-menu/zk-nvim",
-- ft = { "markdown" },
config = function()
local zk = require('zk')
local map = vim.api.nvim_set_keymap
local silent = { noremap = true, silent = true }
---- MARK: Key Mappings ----
map("n", "<leader>zf", "<cmd>ZkNotes { sort = { 'modified' } }<CR>", silent)
-- map( "n", "<leader>zj", "<cmd>ZkNotes { path = 'journal', sort = { 'created' } }<CR>", opts)
map("n", "<leader>zt", "<cmd>ZkTags<CR>", silent)
map("n", "<leader>zi", "<cmd>ZkIndex<CR>", silent)
-- Search note that matches the selection under curosr
map("v", "zm", "<cmd>'<,'>ZkMatch<CR>", silent)
map("n", "<leader>zN", "<cmd>ZkNew { title = vim.fn.input('Zettel Title: ') }<CR>", silent)
map("n", "<leader>zD", "<cmd>ZkNew { dir= 'journal/daily' }<CR>", silent)
map("n", "<leader>zW", "<cmd>ZkNew { dir= 'journal/weekly' }<CR>", silent)
map("v", "<leader>znt", ":'<,'>ZkNewFromTitleSelection<CR>", silent)
map("v", "<leader>znc", ":'<,'>ZkNewFromContentSelection { itle = vim.fn.input('Zettel Title: ') }<CR>", silent)
---- MARK: Set up ----
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
zk.setup({
picker = "telescope",
lsp = {
-- `config` is passed to `vim.lsp.start_client(config)`
config = {
cmd = { "zk", "lsp" },
name = "zk",
capabilities = capabilities,
autostart = true,
-- Override and enable virtual text; disable sign on sign columns
handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = {
spacing = 2,
prefix = ""
},
signs = false
}
),
}
},
-- automatically attach buffers in a zk notebook that match the given filetypes
auto_attach = {
enabled = true,
filetypes = { "markdown" },
},
},
})
end
}
|
local prosody = prosody;
local core_process_stanza = prosody.core_process_stanza;
local wrapclient = require "net.server".wrapclient;
local s2s_new_outgoing = require "core.s2smanager".new_outgoing;
local initialize_filters = require "util.filters".initialize;
local st = require "util.stanza";
local portmanager = require "core.portmanager";
local softreq = require "util.dependencies".softreq;
local bit;
pcall(function() bit = require"bit"; end);
bit = bit or softreq"bit32"
if not bit then module:log("error", "No bit module found. Either LuaJIT 2, lua-bitop or Lua 5.2 is required"); end
local band = bit.band;
local rshift = bit.rshift;
local lshift = bit.lshift;
local byte = string.byte;
local c = string.char;
module:depends("s2s");
local proxy_ip = module:get_option("onions_socks5_host") or "127.0.0.1";
local proxy_port = module:get_option("onions_socks5_port") or 9050;
local forbid_else = module:get_option("onions_only") or false;
local torify_all = module:get_option("onions_tor_all") or false;
local onions_map = module:get_option("onions_map") or {};
local sessions = module:shared("sessions");
-- The socks5listener handles connection while still connecting to the proxy,
-- then it hands them over to the normal listener (in mod_s2s)
local socks5listener = { default_port = proxy_port, default_mode = "*a", default_interface = "*" };
local function socks5_connect_sent(conn, data)
local session = sessions[conn];
if #data < 5 then
session.socks5_buffer = data;
return;
end
request_status = byte(data, 2);
if not request_status == 0x00 then
module:log("debug", "Failed to connect to the SOCKS5 proxy. :(");
session:close(false);
return;
end
module:log("debug", "Succesfully connected to SOCKS5 proxy.");
local response = byte(data, 4);
if response == 0x01 then
if #data < 10 then
-- let's try again when we have enough
session.socks5_buffer = data;
return;
end
-- this means the server tells us to connect on an IPv4 address
local ip1 = byte(data, 5);
local ip2 = byte(data, 6);
local ip3 = byte(data, 7);
local ip4 = byte(data, 8);
local port = band(byte(data, 9), lshift(byte(data, 10), 8));
module:log("debug", "Should connect to: "..ip1.."."..ip2.."."..ip3.."."..ip4..":"..port);
if not (ip1 == 0 and ip2 == 0 and ip3 == 0 and ip4 == 0 and port == 0) then
module:log("debug", "The SOCKS5 proxy tells us to connect to a different IP, don't know how. :(");
session:close(false);
return;
end
-- Now the real s2s listener can take over the connection.
local listener = portmanager.get_service("s2s").listener;
module:log("debug", "SOCKS5 done, handing over listening to "..tostring(listener));
session.socks5_handler = nil;
session.socks5_buffer = nil;
local w, log = conn.send, session.log;
local filter = initialize_filters(session);
session.version = 1;
session.sends2s = function (t)
log("debug", "sending (s2s over socks5): %s", (t.top_tag and t:top_tag()) or t:match("^[^>]*>?"));
if t.name then
t = filter("stanzas/out", t);
end
if t then
t = filter("bytes/out", tostring(t));
if t then
return conn:write(tostring(t));
end
end
end
session.open_stream = function ()
session.sends2s(st.stanza("stream:stream", {
xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback',
["xmlns:stream"]='http://etherx.jabber.org/streams',
from=session.from_host, to=session.to_host, version='1.0', ["xml:lang"]='en'}):top_tag());
end
conn.setlistener(conn, listener);
listener.register_outgoing(conn, session);
listener.onconnect(conn);
end
end
local function socks5_handshake_sent(conn, data)
local session = sessions[conn];
if #data < 2 then
session.socks5_buffer = data;
return;
end
-- version, method
local request_status = byte(data, 2);
module:log("debug", "SOCKS version: "..byte(data, 1));
module:log("debug", "Response: "..request_status);
if not request_status == 0x00 then
module:log("debug", "Failed to connect to the SOCKS5 proxy. :( It seems to require authentication.");
session:close(false);
return;
end
module:log("debug", "Sending connect message.");
-- version 5, connect, (reserved), type: domainname, (length, hostname), port
conn:write(c(5) .. c(1) .. c(0) .. c(3) .. c(#session.socks5_to) .. session.socks5_to);
conn:write(c(rshift(session.socks5_port, 8)) .. c(band(session.socks5_port, 0xff)));
session.socks5_handler = socks5_connect_sent;
end
function socks5listener.onconnect(conn)
module:log("debug", "Connected to SOCKS5 proxy, sending SOCKS5 handshake.");
-- Socks version 5, 1 method, no auth
conn:write(c(5) .. c(1) .. c(0));
sessions[conn].socks5_handler = socks5_handshake_sent;
end
function socks5listener.register_outgoing(conn, session)
session.direction = "outgoing";
sessions[conn] = session;
end
function socks5listener.ondisconnect(conn, err)
sessions[conn] = nil;
end
function socks5listener.onincoming(conn, data)
local session = sessions[conn];
if session.socks5_buffer then
data = session.socks5_buffer .. data;
end
if session.socks5_handler then
session.socks5_handler(conn, data);
end
end
local function connect_socks5(host_session, connect_host, connect_port)
local conn, handler = socket.tcp();
module:log("debug", "Connecting to " .. connect_host .. ":" .. connect_port);
-- this is not necessarily the same as .to_host (it can be that this is from the onions_map)
host_session.socks5_to = connect_host;
host_session.socks5_port = connect_port;
conn:settimeout(0);
local success, err = conn:connect(proxy_ip, proxy_port);
conn = wrapclient(conn, connect_host, connect_port, socks5listener, "*a");
socks5listener.register_outgoing(conn, host_session);
host_session.conn = conn;
end
local bouncy_stanzas = { message = true, presence = true, iq = true };
local function bounce_sendq(session, reason)
local sendq = session.sendq;
if not sendq then return; end
session.log("info", "Sending error replies for "..#sendq.." queued stanzas because of failed outgoing connection to "..tostring(session.to_host));
local dummy = {
type = "s2sin";
send = function(s)
(session.log or log)("error", "Replying to to an s2s error reply, please report this! Traceback: %s", traceback());
end;
dummy = true;
};
for i, data in ipairs(sendq) do
local reply = data[2];
if reply and not(reply.attr.xmlns) and bouncy_stanzas[reply.name] then
reply.attr.type = "error";
reply:tag("error", {type = "cancel"})
:tag("remote-server-not-found", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}):up();
if reason then
reply:tag("text", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"})
:text("Server-to-server connection failed: "..reason):up();
end
core_process_stanza(dummy, reply);
end
sendq[i] = nil;
end
session.sendq = nil;
end
-- Try to intercept anything to *.onion
local function route_to_onion(event)
local stanza = event.stanza;
local to_host = event.to_host;
local onion_host = nil;
local onion_port = nil;
if not to_host:find(".onion(.?)$") then
if onions_map[to_host] then
if type(onions_map[to_host]) == "string" then
onion_host = onions_map[to_host];
else
onion_host = onions_map[to_host].host;
onion_port = onions_map[to_host].port;
end
elseif forbid_else then
module:log("debug", event.to_host .. " is not an onion. Blocking it.");
return false;
elseif not torify_all then
return;
end
end
module:log("debug", "Onion routing something to ".. to_host);
if hosts[event.from_host].s2sout[to_host] then
return;
end
local host_session = s2s_new_outgoing(event.from_host, to_host);
host_session.bounce_sendq = bounce_sendq;
host_session.sendq = { {tostring(stanza), stanza.attr and stanza.attr.type ~= "error" and stanza.attr.type ~= "result" and st.reply(stanza)} };
hosts[event.from_host].s2sout[to_host] = host_session;
connect_socks5(host_session, onion_host or to_host, onion_port or 5269);
return true;
end
module:log("debug", "Onions ready and loaded");
hosts[module.host].events.add_handler("route/remote", route_to_onion, 200);
|
--
-- Created by IntelliJ IDEA.
-- User: robinchugh
-- Date: 12/07/17
-- Time: 10:37 AM
-- To change this template use File | Settings | File Templates.
--
require("os")
request = function()
local path = wrk.path .. "&time=" .. os.date("%m/%d/%Y:%H:%M:%S")
print(path)
return wrk.format(nil, path)
end
|
local hsl = require('wlanimation.hsl')
local M = {}
M.get_hl_color = function(hl)
local cmd = vim.api.nvim_exec('highlight ' .. hl, true)
local _, _, bg = string.find(cmd, "guibg%=(%#%w*)")
local _, _, fg = string.find(cmd, "guifg%=(%#%w*)")
return fg, bg
end
---@return HSL
M.rgb_to_hsl = function(rgb)
local h, s, l = hsl.rgb_string_to_hsl(rgb)
return hsl.new(h, s, l)
end
M.get_hsl_color = function(hl)
local c1, c2 = M.get_hl_color(hl)
local fg, bg
if c1 then fg = M.rgb_to_hsl(c1) end
if c2 then bg = M.rgb_to_hsl(c2) end
return fg, bg
end
M.highlight = function(group, fg, bg)
fg = fg and 'guifg=' .. fg:to_rgb() or 'guifg=NONE'
bg = bg and 'guibg=' .. bg:to_rgb() or 'guibg=NONE'
vim.api.nvim_command(string.format('highlight %s %s %s', group, fg, bg))
end
return M
|
---@class eHelicopter
eHelicopter = {}
---@field hoverOnTargetDuration number|boolean How long the helicopter will hover over the player, this is subtracted from every tick
eHelicopter.hoverOnTargetDuration = false
---@field searchForTargetDurationMS number How long the helicopter will search for last seen targets
eHelicopter.searchForTargetDuration = 30000
---@field shadow boolean | WorldMarkers.GridSquareMarker
eHelicopter.shadow = true
---@field crashType boolean
eHelicopter.crashType = {"UH1HFuselage"}
---@field addedCrashChance number
eHelicopter.addedCrashChance = 0
---Useful for submodders seeking to add more functionality to events.
---Simply make your preset's table filled with the names of functions you want to call.
---NOTE: Presets' file must be loaded after any called function's file to work.
---If you want your event to occur only once simply set the entry to false afterwards.
---
---All functions called have the following arguments: self (eHelicopter)
---OnCrash has the additional argument of: currentSquare (IsoGridSquare)
---OnAttack has the additional argument of: targetHostile (IsoObject|IsoMovingObject|IsoGameCharacter|IsoPlayer|IsoZombie)
---@field addedFunctionsToEvents table
eHelicopter.addedFunctionsToEvents = {["OnCrash"] = false, ["OnHover"] = false, ["OnFlyaway"] = false, ["OnAttack"] = false,}
---@field scrapAndParts table
eHelicopter.scrapAndParts = {["vehicleSection"]="UH1HTail"} -- {["vehicleSection"]="Base.TYPE",["scrapItem"]="Base.TYPE"}
---@field crew table list of IDs and chances (similar to how loot distribution is handled)
---Example: crew = {"pilot", 100, "crew", 75, "crew", 50}
---If there is no number following a string a chance of 100% will be applied.
eHelicopter.crew = {"AirCrew", 100}
---@field formation table table of IDs to generate follower helis
eHelicopter.formationIDs = {}
---@field dropItems table
eHelicopter.dropItems = false
---@field dropPackages table
eHelicopter.dropPackages = false
---@field eventSoundEffects table
eHelicopter.eventSoundEffects = {
--{"hoverOverTarget"]=nil,["flyOverTarget"]=nil}
--["lostTarget"]=nil, ["foundTarget"]=nil, ["droppingPackage"]=nil,
--["additionalAttackingSound"]=nil, ["additionalFlightSound"]=nil,
["attackSingle"] = "eHeli_machine_gun_fire_single",
["attackLooped"] = "eHeli_machine_gun_fire_looped",
["attackImpacts"] = "eHeli_fire_impact",
["flightSound"] = "eHelicopter", ["crashEvent"] = "eHelicopterCrash"
}
---@field announcerVoice string
eHelicopter.announcerVoice = false
---@field randomEdgeStart boolean
eHelicopter.randomEdgeStart = true
---example: {["preset1"]=0,["preset2"]=25,["preset3"]=50} = at 0% (days out of cutoff day) preset1 is chosen, at 25% preset2 is chosen, etc.
---@field presetProgression table Table of presetIDs and corresponding % preset is compared to Days/CuttOffDay
eHelicopter.presetProgression = false
---Example: {"preset1",2,"preset2","preset3",4} = a list equal to {"preset1","preset1","preset2","preset3","preset3","preset3","preset3"}
---@field presetRandomSelection table Table of presetIDs and optional corresponding weight (weight is 1 if none found) in list to be chosen from.
eHelicopter.presetRandomSelection = false
---@field frequencyFactor number This is multiplied against the min/max day range; less than 1 results in higher frequency, more than 1 results in less frequency
eHelicopter.frequencyFactor = 1
---@field cutOffFactor number This is multiplied against eHelicopterSandbox.config.cutOffDay
eHelicopter.cutOffFactor = 1
---@field speed number
eHelicopter.speed = 0.08
---@field topSpeedFactor number speed x this = top "speed"
eHelicopter.topSpeedFactor = 3
---@field flightVolume number
eHelicopter.flightVolume = 75
---@field hostilePreference string
---set to 'false' for *none*, otherwise has to be 'IsoPlayer' or 'IsoZombie' or 'IsoGameCharacter'
eHelicopter.hostilePreference = false
---@field attackDelay number delay in milliseconds between attacks
eHelicopter.attackDelay = 85
---@field attackScope number number of rows from "center" IsoGridSquare out
--- **area formula:** ((Scope*2)+1) ^2
---
--- scope:⠀0=1x1;⠀1=3x3;⠀2=5x5;⠀3=7x7;⠀4=9x9
eHelicopter.attackScope = 1
---@field attackSpread number number of rows made of "scopes" from center-scope out
---**formula for ScopeSpread area:**
---
---((Scope * 2)+1) * ((Spread * 2)+1) ^2
---
--- **Examples:**
---
---⠀ ⠀*scope* 🡇
--- -----------------------------------
--- *spread*⠀🡆 ⠀ | 00 | 01 | 02 | 03 |
--- -----------------------------------
--- ⠀ ⠀⠀⠀ ⠀| 00 | 01 | 09 | 25 | 49 |
--- -----------------------------------
--- ⠀ ⠀⠀⠀ ⠀| 01 | 09 | 81 | 225 | 441 |
--- -----------------------------------
--- ⠀ ⠀⠀⠀⠀ | 02 | 25 | 225 | 625 | 1225 |
--- -----------------------------------
--- ⠀ ⠀⠀⠀ ⠀| 03 | 49 | 441 | 1225 | 2401 |
--- -----------------------------------
eHelicopter.attackSpread = 3
---@field attackHitChance number multiplied against chance to hit in attacking
eHelicopter.attackHitChance = 85
---@field attackDamage number damage dealt to zombies/players on hit (gets randomized to: attackDamage * random(1 to 1.5))
eHelicopter.attackDamage = 20
---// UNDER THE HOOD STUFF //---
---This function, when called stores the above listed variables, on game load, for reference later
---
---NOTE: Any variable which is by default `nil` can't be loaded over - consider making it false if you need it
---@param listToSaveTo table
---@param checkIfNotIn table
function eHelicopter_variableBackUp(listToSaveTo, checkIfNotIn)--, debugID)
for k,v in pairs(eHelicopter) do
if ((not checkIfNotIn) or (checkIfNotIn[k] == nil)) then
--[DEBUG]] print("EHE: "..debugID..": "..k.." = ".."("..type(v)..") "..tostring(v))
--tables have to be copied piece by piece or risk creating a direct reference link
if type(v) == "table" then
--[DEBUG]] print("--- "..k.." is a table (#"..#v.."); generating copy:")
local tmpTable = {}
for kk,vv in pairs(v) do
--[DEBUG]] print( "------ "..kk.." = ".."("..type(vv)..") "..tostring(vv))
tmpTable[kk] = vv
end
listToSaveTo[k]=tmpTable
else
listToSaveTo[k]=v
end
end
end
end
--store "initial" vars to reference when loading presets
eHelicopter_initialVars = {}
eHelicopter_variableBackUp(eHelicopter_initialVars, nil, "initialVars")
--the below variables are to be considered "temporary"
---@field height number
eHelicopter.height = 7
---@field state string
eHelicopter.state = false
---@field crashing
eHelicopter.crashing = false
---@field timeUntilCanAnnounce number
eHelicopter.timeUntilCanAnnounce = -1
---@field preflightDistance number
eHelicopter.preflightDistance = false
---@field announceEmitter FMODSoundEmitter | BaseSoundEmitter
eHelicopter.announceEmitter = false
---@field lastAnnouncedLine string
eHelicopter.lastAnnouncedLine = false
---@field heldEventSoundEffectEmitters table
eHelicopter.heldEventSoundEffectEmitters = {}
---@field delayedEventSounds table
eHelicopter.delayedEventSounds = {}
---@field target IsoObject
eHelicopter.target = false
---@field trueTarget IsoGameCharacter
eHelicopter.trueTarget = false
---@field timeSinceLastSeenTarget number
eHelicopter.timeSinceLastSeenTarget = -1
---@field timeSinceLastRoamed number
eHelicopter.timeSinceLastRoamed = -1
---@field attackDistance number
eHelicopter.attackDistance = false
---@field targetPosition Vector3 "position" of target, pair of coordinates which can utilize Vector3 math
eHelicopter.targetPosition = false
---@field lastMovement Vector3 consider this to be velocity (direction/angle and speed/step-size)
eHelicopter.lastMovement = false
---@field currentPosition Vector3 consider this a pair of coordinates which can utilize Vector3 math
eHelicopter.currentPosition = false
---@field lastAttackTime number
eHelicopter.lastAttackTime = -1
---@field hostilesToFireOnIndex number
eHelicopter.hostilesToFireOnIndex = 0
---@field hostilesToFireOn table
eHelicopter.hostilesToFireOn = {}
---@field hostilesAlreadyFiredOn table
eHelicopter.hostilesAlreadyFiredOn = {}
---@field lastScanTime number
eHelicopter.lastScanTime = -1
---@field shadowBobRate number
eHelicopter.shadowBobRate = 0.05
---@field timeSinceLastShadowBob number
eHelicopter.timeSinceLastShadowBob = -1
---@field formationFollowingHelis table table of actual flying helis
eHelicopter.formationFollowingHelis = {}
---@field currentPresetID string
eHelicopter.currentPresetID = "<none>"
--This stores the above "temporary" variables for resetting eHelicopters later
eHelicopter_temporaryVariables = {}
eHelicopter_variableBackUp(eHelicopter_temporaryVariables, eHelicopter_initialVars, "temporaryVariables")
--ID must not be reset ever
---@field ID number
eHelicopter.ID = 0
---returns heli's ID and preset; optionally: returns location's x and y
---@param location boolean return x and y coords with ID and preset
function eHelicopter:heliToString(location)
local returnString = "HELI "..self.ID.." ("..self.currentPresetID..")"
if location then
local h_x, h_y, _ = self:getXYZAsInt()
if h_x and h_y then
returnString = returnString.." (x:"..h_x..", y:"..h_y..")"
else
returnString = returnString.." (x:?, y:?)"
end
end
return returnString
end
|
-- Copyright (C) 2020 Igara Studio S.A.
-- Copyright (C) 2018 David Capello
--
-- This file is released under the terms of the MIT license.
-- Read LICENSE.txt for more information.
do
local s = Sprite(32, 32)
for i = 1,7 do s:newFrame() end
assert(#s.frames == 8)
a = s:newTag(1, 8)
assert(a.sprite == s)
assert(a.fromFrame.frameNumber == 1)
assert(a.toFrame.frameNumber == 8)
assert(a.frames == 8)
a.fromFrame = 2
a.toFrame = 5
assert(a.fromFrame.frameNumber == 2)
assert(a.toFrame.frameNumber == 5)
assert(a.name == "Tag")
a.name = "Tag A"
assert(a.name == "Tag A")
assert(a.aniDir == AniDir.FORWARD) -- Default AniDir is FORWARD
a.aniDir = AniDir.REVERSE
assert(a.aniDir == AniDir.REVERSE)
a.aniDir = AniDir.PING_PONG
assert(a.aniDir == AniDir.PING_PONG)
a.aniDir = AniDir.FORWARD
assert(a.aniDir == AniDir.FORWARD)
assert(a.color == Color(0, 0, 0))
a.color = Color(255, 0, 0)
assert(a.color == Color(255, 0, 0))
end
|
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
ACF.RegisterClassLink("acf_radar", "acf_rack", function(Radar, Target)
if Radar.Weapons[Target] then return false, "This rack is already linked to this radar!" end
if Target.Radar == Radar then return false, "This rack is already linked to this radar!" end
Radar.Weapons[Target] = true
Target.Radar = Radar
Radar:UpdateOverlay()
Target:UpdateOverlay()
return true, "Rack linked successfully!"
end)
ACF.RegisterClassUnlink("acf_radar", "acf_rack", function(Radar, Target)
if Radar.Weapons[Target] or Target.Radar == Radar then
Radar.Weapons[Target] = nil
Target.Radar = nil
Radar:UpdateOverlay()
Target:UpdateOverlay()
return true, "Rack unlinked successfully!"
end
return false, "This rack is not linked to this radar."
end)
--===============================================================================================--
-- Local Funcs and Vars
--===============================================================================================--
local Radars = ACF.ActiveRadars
local CheckLegal = ACF_CheckLegal
local ClassLink = ACF.GetClassLink
local ClassUnlink = ACF.GetClassUnlink
local UnlinkSound = "physics/metal/metal_box_impact_bullet%s.wav"
local MaxDistance = ACF.RefillDistance * ACF.RefillDistance
local TraceData = { start = true, endpos = true, mask = MASK_SOLID_BRUSHONLY }
local Gamemode = GetConVar("acf_gamemode")
local Indexes = {}
local Unused = {}
local IndexCount = 0
local TraceLine = util.TraceLine
local TimerExists = timer.Exists
local TimerCreate = timer.Create
local TimerRemove = timer.Remove
local function Overlay(Ent)
if Ent.Disabled then
Ent:SetOverlayText("Disabled: " .. Ent.DisableReason .. "\n" .. Ent.DisableDescription)
else
local Text = "%s\n\n%s\nDetection range: %s\nScanning angle: %s degrees"
local Status, Range, Cone
if Ent.TargetCount > 0 then
Status = Ent.TargetCount .. " target(s) detected"
elseif not Ent.Active then
Status = "Idle"
else
Status = Ent.Scanning and "Active" or "Activating"
end
Range = Ent.Range and math.Round(Ent.Range / 39.37 , 2) .. " meters" or "Infinite"
Cone = Ent.ConeDegs and math.Round(Ent.ConeDegs, 2) or 360
Ent:SetOverlayText(Text:format(Status, Ent.EntType, Range, Cone))
end
end
-- TODO: Optimize this so the entries are only cleared when the target is no longer detected by the radar
local function ClearTargets(Entity)
local TargetInfo = Entity.TargetInfo
local Targets = Entity.Targets
for Target in pairs(Targets) do
Targets[Target] = nil
end
for _, List in pairs(TargetInfo) do
for Index in ipairs(List) do
List[Index] = nil
end
end
end
local function ResetOutputs(Entity)
if Entity.TargetCount == 0 then return end
local TargetInfo = Entity.TargetInfo
ClearTargets(Entity)
Entity.TargetCount = 0
WireLib.TriggerOutput(Entity, "Detected", 0)
WireLib.TriggerOutput(Entity, "ClosestDistance", 0)
WireLib.TriggerOutput(Entity, "IDs", TargetInfo.ID)
WireLib.TriggerOutput(Entity, "Owner", TargetInfo.Owner)
WireLib.TriggerOutput(Entity, "Position", TargetInfo.Position)
WireLib.TriggerOutput(Entity, "Velocity", TargetInfo.Velocity)
WireLib.TriggerOutput(Entity, "Distance", TargetInfo.Distance)
end
local function SetSequence(Entity, Active)
local SequenceName = Active and "active" or "idle"
local Sequence = Entity:LookupSequence(SequenceName)
Entity:ResetSequence(Sequence or 0)
Entity.AutomaticFrameAdvance = Active
end
local function CheckLOS(Start, End)
TraceData.start = Start
TraceData.endpos = End
return not TraceLine(TraceData).Hit
end
local function GetEntityIndex(Entity)
if Indexes[Entity] then return Indexes[Entity] end
if next(Unused) then
local Index = next(Unused)
Indexes[Entity] = Index
Unused[Index] = nil
else
IndexCount = IndexCount + 1
Indexes[Entity] = IndexCount
end
local EntID = Indexes[Entity]
Entity:CallOnRemove("Radar Index", function()
Indexes[Entity] = nil
Unused[EntID] = true
end)
return EntID
end
local function GetEntityOwner(Owner, Entity)
-- If the server is competitive and the radar owner doesn't has permissions on this entity then return Unknown
if Gamemode:GetInt() == 2 and not Entity:CPPICanTool(Owner) then
return "Unknown"
end
local EntOwner = Entity:CPPIGetOwner()
if not IsValid(EntOwner) then
EntOwner = EntOwner == game.GetWorld() and "World" or "Unknown"
else
EntOwner = EntOwner:GetName()
end
return EntOwner
end
local function ScanForEntities(Entity)
ClearTargets(Entity)
if not Entity.GetDetected then return end
local Detected = Entity:GetDetected()
local Origin = Entity:LocalToWorld(Entity.Origin)
local TargetInfo = Entity.TargetInfo
local Targets = Entity.Targets
local Closest = math.huge
local Count = 0
local IDs = TargetInfo.ID
local Own = TargetInfo.Owner
local Position = TargetInfo.Position
local Velocity = TargetInfo.Velocity
local Distance = TargetInfo.Distance
for Ent in pairs(Detected) do
local EntPos = Ent.CurPos or Ent:GetPos()
if CheckLOS(Origin, EntPos) then
local Spread = VectorRand(-Entity.Spread, Entity.Spread)
local EntVel = Ent.LastVel or Ent:GetVelocity()
local Owner = GetEntityOwner(Entity.Owner, Ent)
local Index = GetEntityIndex(Ent)
EntPos = EntPos + Spread
EntVel = EntVel + Spread
Count = Count + 1
local EntDist = Origin:Distance(EntPos)
Targets[Ent] = {
Index = Index,
Owner = Owner,
Position = EntPos,
Velocity = EntVel,
Distance = EntDist
}
IDs[Count] = Index
Own[Count] = Owner
Position[Count] = EntPos
Velocity[Count] = EntVel
Distance[Count] = EntDist
if EntDist < Closest then
Closest = EntDist
end
end
end
Closest = Closest < math.huge and Closest or 0
WireLib.TriggerOutput(Entity, "ClosestDistance", Closest)
WireLib.TriggerOutput(Entity, "IDs", IDs)
WireLib.TriggerOutput(Entity, "Owner", Own)
WireLib.TriggerOutput(Entity, "Position", Position)
WireLib.TriggerOutput(Entity, "Velocity", Velocity)
WireLib.TriggerOutput(Entity, "Distance", Distance)
WireLib.TriggerOutput(Entity, "Detected", Count)
if Count ~= Entity.TargetCount then
if Count > Entity.TargetCount then
local Sound = Entity.Sound or ACFM.DefaultRadarSound
Entity:EmitSound(Sound, 500, 100)
end
Entity.TargetCount = Count
Entity:UpdateOverlay()
end
end
local function SetScanning(Entity, Active)
Entity.Scanning = Active
Entity:UpdateOverlay()
ResetOutputs(Entity)
SetSequence(Entity, Active)
Radars[Entity] = Active or nil
WireLib.TriggerOutput(Entity, "Scanning", Active and 1 or 0)
if Active then
TimerCreate("ACF Radar Scan " .. Entity:EntIndex(), Entity.ThinkDelay, 0, function()
if IsValid(Entity) and Entity.Scanning then
return ScanForEntities(Entity)
end
TimerRemove("ACF Radar Scan " .. Entity:EntIndex())
end)
end
end
local function SetActive(Entity, Active)
if Entity.Active == Active then return end
Entity.Active = Active
Entity:UpdateOverlay()
if TimerExists("ACF Radar Switch " .. Entity:EntIndex()) then
TimerRemove("ACF Radar Switch " .. Entity:EntIndex())
end
if not Active then return SetScanning(Entity, Active) end
TimerCreate("ACF Radar Switch " .. Entity:EntIndex(), Entity.SwitchDelay, 1, function()
if IsValid(Entity) then
return SetScanning(Entity, Active)
end
end)
end
local function CheckDistantLinks(Entity, Source)
local Position = Entity:GetPos()
for Link in pairs(Entity[Source]) do
if Position:DistToSqr(Link:GetPos()) > MaxDistance then
Entity:EmitSound(UnlinkSound:format(math.random(1, 3)), 500, 100)
Link:EmitSound(UnlinkSound:format(math.random(1, 3)), 500, 100)
Entity:Unlink(Link)
end
end
end
--===============================================================================================--
function MakeACF_Radar(Owner, Pos, Angle, Id, Data)
if not Owner:CheckLimit("_acf_radar") then return false end
local RadarData = ACF.Weapons.Radar[Id]
if not RadarData then return end
local Radar = ents.Create("acf_radar")
if not IsValid(Radar) then return end
local RadarClass = ACF.Classes.Radar[RadarData.class]
local OriginAttach = Radar:LookupAttachment(RadarData.origin)
local AttachData = Radar:GetAttachment(OriginAttach)
Radar:SetModel(RadarData.model)
Radar:SetPlayer(Owner)
Radar:SetAngles(Angle)
Radar:SetPos(Pos)
Radar:Spawn()
Radar:PhysicsInit(SOLID_VPHYSICS)
Radar:SetMoveType(MOVETYPE_VPHYSICS)
Owner:AddCount("_acf_radar", Radar)
Owner:AddCleanup("acfmenu", Radar)
Radar.Id = Id
Radar.Owner = Owner
Radar.Model = RadarData.model
Radar.Mass = RadarData.weight
Radar.Name = RadarData.name
Radar.ShortName = Radar.Name
Radar.EntType = RadarClass.name
Radar.ClassType = RadarClass.type
Radar.ConeDegs = RadarData.viewcone
Radar.Range = RadarData.range
Radar.Armor = 20
Radar.Active = false
Radar.Scanning = false
Radar.SwitchDelay = RadarData.delay
Radar.ThinkDelay = 0.1
Radar.TargetCount = 0
Radar.Spread = 0
Radar.Weapons = {}
Radar.Targets = {}
Radar.Inputs = WireLib.CreateInputs(Radar, { "Active" })
Radar.Outputs = WireLib.CreateOutputs(Radar, { "Scanning", "Detected", "ClosestDistance", "IDs [ARRAY]", "Owner [ARRAY]", "Position [ARRAY]", "Velocity [ARRAY]", "Distance [ARRAY]" })
Radar.GetDetected = RadarClass.detect
Radar.Origin = AttachData and Radar:WorldToLocal(AttachData.Pos) or Vector()
-- Used by Outputs
Radar.TargetInfo = {
ID = {},
Owner = {},
Position = {},
Velocity = {},
Distance = {},
}
Radar:SetNWString("WireName", "ACF " .. Radar.Name)
local PhysObj = Radar:GetPhysicsObject()
if IsValid(PhysObj) then
PhysObj:SetMass(Radar.Mass)
end
ACF_Activate(Radar)
Radar.ACF.Model = Radar.Model
Radar.ACF.LegalMass = Radar.Mass
Radar:UpdateOverlay(true)
do -- Mass entity mod removal
local EntMods = Data and Data.EntityMods
if EntMods and EntMods.mass then
EntMods.mass = nil
end
end
CheckLegal(Radar)
TimerCreate("ACF Radar Clock " .. Radar:EntIndex(), 3, 0, function()
if IsValid(Radar) then
CheckDistantLinks(Radar, "Weapons")
else
timer.Remove("ACF Radar Clock " .. Radar:EntIndex())
end
end)
return Radar
end
-- Backwards compatibility
list.Set("ACFCvars", "acf_missileradar", {"id"})
duplicator.RegisterEntityClass("acf_missileradar", MakeACF_Radar, "Pos", "Angle", "Id", "Data")
list.Set("ACFCvars", "acf_radar", {"id"})
duplicator.RegisterEntityClass("acf_radar", MakeACF_Radar, "Pos", "Angle", "Id", "Data")
ACF.RegisterLinkSource("acf_radar", "Weapons")
--===============================================================================================--
-- Meta Funcs
--===============================================================================================--
function ENT:ACF_Activate(Recalc)
local PhysObj = self.ACF.PhysObj
local Count
if PhysObj:GetMesh() then
Count = #PhysObj:GetMesh()
end
if IsValid(PhysObj) and Count and Count > 100 then
if not self.ACF.Area then
self.ACF.Area = PhysObj:GetSurfaceArea() * 6.45
end
else
local Size = self:OBBMaxs() - self:OBBMins()
if not self.ACF.Area then
self.ACF.Area = ((Size.x * Size.y) + (Size.x * Size.z) + (Size.y * Size.z)) * 6.45
end
end
self.ACF.Ductility = self.ACF.Ductility or 0
local Area = self.ACF.Area
local Armour = self.Armor
local Health = Area / ACF.Threshold
local Percent = 1
if Recalc and self.ACF.Health and self.ACF.MaxHealth then
Percent = self.ACF.Health / self.ACF.MaxHealth
end
self.ACF.Health = Health * Percent
self.ACF.MaxHealth = Health
self.ACF.Armour = Armour * (0.5 + Percent / 2)
self.ACF.MaxArmour = Armour * ACF.ArmorMod
self.ACF.Mass = self.Mass
self.ACF.Type = "Prop"
end
function ENT:ACF_OnDamage(Entity, Energy, FrArea, Angle, Inflictor)
local HitRes = ACF.PropDamage(Entity, Energy, FrArea, Angle, Inflictor)
self.Spread = ACF.MaxDamageInaccuracy * (1 - math.Round(self.ACF.Health / self.ACF.MaxHealth, 2))
return HitRes
end
function ENT:Link(Target)
if not IsValid(Target) then return false, "Attempted to link an invalid entity." end
if self == Target then return false, "Can't link a radar to itself." end
local Function = ClassLink("acf_radar", Target:GetClass())
if Function then
return Function(self, Target)
end
return false, "Radars can't be linked to '" .. Target:GetClass() .. "'."
end
function ENT:Unlink(Target)
if not IsValid(Target) then return false, "Attempted to unlink an invalid entity." end
if self == Target then return false, "Can't unlink a radar from itself." end
local Function = ClassUnlink("acf_radar", Target:GetClass())
if Function then
return Function(self, Target)
end
return false, "Radars can't be unlinked from '" .. Target:GetClass() .. "'."
end
function ENT:TriggerInput(_, Value)
if self.Disabled then return end
SetActive(self, tobool(Value))
end
function ENT:Enable()
if not CheckLegal(self) then return end
self.Disabled = nil
self.DisableReason = nil
if self.Inputs.Active.Path then
self:TriggerInput("Active", self.Inputs.Active.Value)
end
self:UpdateOverlay()
end
function ENT:Disable()
self:TriggerInput("Active", 0)
self.Disabled = true
end
function ENT:UpdateOverlay(Instant)
if Instant then
return Overlay(self)
end
if TimerExists("ACF Overlay Buffer" .. self:EntIndex()) then return end
TimerCreate("ACF Overlay Buffer" .. self:EntIndex(), 1, 1, function()
if IsValid(self) then Overlay(self) end
end)
end
function ENT:OnRemove()
for Weapon in pairs(self.Weapons) do
self:Unlink(Weapon)
end
if Radars[self] then
Radars[self] = nil
end
WireLib.Remove(self)
end
|
--Copyright (C) 2009 <SWGEmu>
--This File is part of Core3.
--This program is free software; you can redistribute
--it and/or modify it under the terms of the GNU Lesser
--General Public License as published by the Free Software
--Foundation; either version 2 of the License,
--or (at your option) any later version.
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
--See the GNU Lesser General Public License for
--more details.
--You should have received a copy of the GNU Lesser General
--Public License along with this program; if not, write to
--the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--Linking Engine3 statically or dynamically with other modules
--is making a combined work based on Engine3.
--Thus, the terms and conditions of the GNU Lesser General Public License
--cover the whole combination.
--In addition, as a special exception, the copyright holders of Engine3
--give you permission to combine Engine3 program with free software
--programs or libraries that are released under the GNU LGPL and with
--code included in the standard release of Core3 under the GNU LGPL
--license (or modified versions of such code, with unchanged license).
--You may copy and distribute such a system following the terms of the
--GNU LGPL for Engine3 and the licenses of the other code concerned,
--provided that you include the source code of that other code when
--and as the GNU LGPL requires distribution of source code.
--Note that people who make modified versions of Engine3 are not obligated
--to grant this special exception for their modified versions;
--it is their choice whether to do so. The GNU Lesser General Public License
--gives permission to release a modified version without this exception;
--this exception also makes it possible to release a modified version
--which carries forward this exception.
object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:armor_effectiveness_intensifier_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:armor_effectiveness_intensifier_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2303674527,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk1, "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk1.iff")
object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:armor_effectiveness_intensifier_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:armor_effectiveness_intensifier_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1381556232,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk2, "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk2.iff")
object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:armor_effectiveness_intensifier_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:armor_effectiveness_intensifier_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 458590085,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk3, "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk3.iff")
object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:armor_effectiveness_intensifier_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:armor_effectiveness_intensifier_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3770068113,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk4, "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk4.iff")
object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:armor_effectiveness_intensifier_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:armor_effectiveness_intensifier_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2847656732,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_armor_effectiveness_intensifier_mk5, "object/tangible/ship/crafted/weapon/shared_armor_effectiveness_intensifier_mk5.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/xwing_weapon_neg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level1"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@base_weapon:base",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@base_weapon:s01",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2953001640,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon, "object/tangible/ship/crafted/weapon/shared_base_weapon.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:base_weapon_subcomponent",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon_subcomponent",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1696759306,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent, "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:base_weapon_subcomponent_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon_subcomponent_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4144294137,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk1, "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:base_weapon_subcomponent_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon_subcomponent_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 739459182,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk2, "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:base_weapon_subcomponent_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon_subcomponent_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1696475107,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk3, "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:base_weapon_subcomponent_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon_subcomponent_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2667384055,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk4, "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff")
object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:base_weapon_subcomponent_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon_subcomponent_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3622857594,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_base_weapon_subcomponent_mk5, "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff")
object_tangible_ship_crafted_weapon_shared_basic_weapon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_basic_weapon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/xwing_weapon_neg_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level1"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_n:base_weapon",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:base_weapon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3239954606,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_basic_weapon, "object/tangible/ship/crafted/weapon/shared_basic_weapon.iff")
object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:max_damage_intensifier_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:max_damage_intensifier_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2497461315,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk1, "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk1.iff")
object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:max_damage_intensifier_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:max_damage_intensifier_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1338741972,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk2, "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk2.iff")
object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:max_damage_intensifier_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:max_damage_intensifier_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 113701721,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk3, "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk3.iff")
object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:max_damage_intensifier_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:max_damage_intensifier_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4247115853,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk4, "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk4.iff")
object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:max_damage_intensifier_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:max_damage_intensifier_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3022569408,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_max_damage_intensifier_mk5, "object/tangible/ship/crafted/weapon/shared_max_damage_intensifier_mk5.iff")
object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:min_damage_intensifier_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:min_damage_intensifier_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 610130248,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk1, "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk1.iff")
object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:min_damage_intensifier_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:min_damage_intensifier_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4283068895,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk2, "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk2.iff")
object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:min_damage_intensifier_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:min_damage_intensifier_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3058112082,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk3, "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk3.iff")
object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:min_damage_intensifier_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:min_damage_intensifier_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1302609222,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk4, "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk4.iff")
object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:min_damage_intensifier_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:min_damage_intensifier_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 78207691,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_min_damage_intensifier_mk5, "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk5.iff")
object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:quick_shot_upgrade_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:quick_shot_upgrade_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1346962133,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk1, "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk1.iff")
object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:quick_shot_upgrade_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:quick_shot_upgrade_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2338236994,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk2, "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk2.iff")
object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:quick_shot_upgrade_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:quick_shot_upgrade_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3260272079,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk3, "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk3.iff")
object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:quick_shot_upgrade_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:quick_shot_upgrade_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 967894747,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk4, "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk4.iff")
object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:quick_shot_upgrade_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:quick_shot_upgrade_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1891467606,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_quick_shot_upgrade_mk5, "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk5.iff")
object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:shield_effectiveness_intensifier_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:shield_effectiveness_intensifier_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1809056781,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk1, "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk1.iff")
object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:shield_effectiveness_intensifier_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:shield_effectiveness_intensifier_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2965613722,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk2, "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk2.iff")
object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:shield_effectiveness_intensifier_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:shield_effectiveness_intensifier_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4191079191,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk3, "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk3.iff")
object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:shield_effectiveness_intensifier_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:shield_effectiveness_intensifier_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 36560899,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk4, "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk4.iff")
object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:shield_effectiveness_intensifier_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:shield_effectiveness_intensifier_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1260423054,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_shield_effectiveness_intensifier_mk5, "object/tangible/ship/crafted/weapon/shared_shield_effectiveness_intensifier_mk5.iff")
object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk1 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk1.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:speed_limiter_upgrade_mk1",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:speed_limiter_upgrade_mk1",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 560730926,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk1.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk1, "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk1.iff")
object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk2 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk2.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:speed_limiter_upgrade_mk2",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:speed_limiter_upgrade_mk2",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 4202412985,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk2.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk2, "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk2.iff")
object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk3 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk3.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:speed_limiter_upgrade_mk3",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:speed_limiter_upgrade_mk3",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3010911284,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk3.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk3, "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk3.iff")
object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk4 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk4.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:speed_limiter_upgrade_mk4",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:speed_limiter_upgrade_mk4",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1217787680,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk4.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk4, "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk4.iff")
object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk5 = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk5.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:speed_limiter_upgrade_mk5",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:speed_limiter_upgrade_mk5",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 26775725,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_subcomponent_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon_subcomponent_mk5.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_speed_limiter_upgrade_mk5, "object/tangible/ship/crafted/weapon/shared_speed_limiter_upgrade_mk5.iff")
object_tangible_ship_crafted_weapon_shared_weapon_incom_disruptor = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_weapon_incom_disruptor.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level2"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:weapon_incom_disruptor_d",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:weapon_incom_disruptor_n",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2853736517,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_weapon_incom_disruptor, "object/tangible/ship/crafted/weapon/shared_weapon_incom_disruptor.iff")
object_tangible_ship_crafted_weapon_shared_weapon_slayn_ioncannon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_weapon_slayn_ioncannon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level4"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:weapon_slayn_ioncannon_d",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:weapon_slayn_ioncannon_n",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1179374625,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_weapon_slayn_ioncannon, "object/tangible/ship/crafted/weapon/shared_weapon_slayn_ioncannon.iff")
object_tangible_ship_crafted_weapon_shared_weapon_subpro_tripleblaster = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_weapon_subpro_tripleblaster.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level4"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space/space_item:weapon_subpro_tripleblaster_d",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space/space_item:weapon_subpro_tripleblaster_n",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2659812079,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/components/base/shared_ship_component_loot_base.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_weapon_subpro_tripleblaster, "object/tangible/ship/crafted/weapon/shared_weapon_subpro_tripleblaster.iff")
object_tangible_ship_crafted_weapon_shared_wpn_advanced_blaster = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_advanced_blaster.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level7"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_advanced_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_advanced_blaster",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 442446187,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_advanced_blaster, "object/tangible/ship/crafted/weapon/shared_wpn_advanced_blaster.iff")
object_tangible_ship_crafted_weapon_shared_wpn_advanced_blaster_green = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_advanced_blaster_green.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level7"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_advanced_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_advanced_blaster_green",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1237633285,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_advanced_blaster_green, "object/tangible/ship/crafted/weapon/shared_wpn_advanced_blaster_green.iff")
object_tangible_ship_crafted_weapon_shared_wpn_advanced_disruptor = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_advanced_disruptor.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level7"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_advanced_disruptor",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_advanced_disruptor",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 155333164,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_advanced_disruptor, "object/tangible/ship/crafted/weapon/shared_wpn_advanced_disruptor.iff")
object_tangible_ship_crafted_weapon_shared_wpn_advanced_ioncannon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_advanced_ioncannon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level7"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_advanced_ioncannon",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_advanced_ioncannon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1500710454,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_advanced_ioncannon, "object/tangible/ship/crafted/weapon/shared_wpn_advanced_ioncannon.iff")
object_tangible_ship_crafted_weapon_shared_wpn_experimental_blaster = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_experimental_blaster.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level9"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_experimental_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_experimental_blaster",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2125855304,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_experimental_blaster, "object/tangible/ship/crafted/weapon/shared_wpn_experimental_blaster.iff")
object_tangible_ship_crafted_weapon_shared_wpn_experimental_blaster_green = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_experimental_blaster_green.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level9"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_experimental_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_experimental_blaster_green",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2441037978,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_experimental_blaster_green, "object/tangible/ship/crafted/weapon/shared_wpn_experimental_blaster_green.iff")
object_tangible_ship_crafted_weapon_shared_wpn_experimental_disruptor = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_experimental_disruptor.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level9"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_experimental_disruptor",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_experimental_disruptor",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 209959232,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_experimental_disruptor, "object/tangible/ship/crafted/weapon/shared_wpn_experimental_disruptor.iff")
object_tangible_ship_crafted_weapon_shared_wpn_experimental_ioncannon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_experimental_ioncannon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level9"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_experimental_ioncannon",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_experimental_ioncannon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1555205466,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_experimental_ioncannon, "object/tangible/ship/crafted/weapon/shared_wpn_experimental_ioncannon.iff")
object_tangible_ship_crafted_weapon_shared_wpn_heavy_blaster = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_heavy_blaster.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level5"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_heavy_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_heavy_blaster",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2536076684,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_heavy_blaster, "object/tangible/ship/crafted/weapon/shared_wpn_heavy_blaster.iff")
object_tangible_ship_crafted_weapon_shared_wpn_heavy_blaster_green = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_heavy_blaster_green.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level5"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_heavy_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_heavy_blaster_green",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2144438671,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_heavy_blaster_green, "object/tangible/ship/crafted/weapon/shared_wpn_heavy_blaster_green.iff")
object_tangible_ship_crafted_weapon_shared_wpn_heavy_disruptor = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_heavy_disruptor.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level5"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_heavy_disruptor",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_heavy_disruptor",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 678304198,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_heavy_disruptor, "object/tangible/ship/crafted/weapon/shared_wpn_heavy_disruptor.iff")
object_tangible_ship_crafted_weapon_shared_wpn_heavy_ioncannon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_heavy_ioncannon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level5"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_heavy_ioncannon",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_heavy_ioncannon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2019503580,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_heavy_ioncannon, "object/tangible/ship/crafted/weapon/shared_wpn_heavy_ioncannon.iff")
object_tangible_ship_crafted_weapon_shared_wpn_light_blaster = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_light_blaster.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level1"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_light_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_light_blaster",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 449015883,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_light_blaster, "object/tangible/ship/crafted/weapon/shared_wpn_light_blaster.iff")
object_tangible_ship_crafted_weapon_shared_wpn_light_blaster_green = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_light_blaster_green.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level1"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_light_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_light_blaster_green",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 2431967026,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_light_blaster_green, "object/tangible/ship/crafted/weapon/shared_wpn_light_blaster_green.iff")
object_tangible_ship_crafted_weapon_shared_wpn_light_disruptor = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_light_disruptor.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level1"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_light_disruptor",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_light_disruptor",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1483969238,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_light_disruptor, "object/tangible/ship/crafted/weapon/shared_wpn_light_disruptor.iff")
object_tangible_ship_crafted_weapon_shared_wpn_light_ioncannon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_light_ioncannon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level1"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_light_ioncannon",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_light_ioncannon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 138585804,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_light_ioncannon, "object/tangible/ship/crafted/weapon/shared_wpn_light_ioncannon.iff")
object_tangible_ship_crafted_weapon_shared_wpn_medium_blaster = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_medium_blaster.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level3"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_medium_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_medium_blaster",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 3503157273,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_medium_blaster, "object/tangible/ship/crafted/weapon/shared_wpn_medium_blaster.iff")
object_tangible_ship_crafted_weapon_shared_wpn_medium_blaster_green = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_medium_blaster_green.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s02.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level3"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_medium_blaster",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_medium_blaster_green",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 928727391,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_medium_blaster_green, "object/tangible/ship/crafted/weapon/shared_wpn_medium_blaster_green.iff")
object_tangible_ship_crafted_weapon_shared_wpn_medium_disruptor = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_medium_disruptor.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level3"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_medium_disruptor",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_medium_disruptor",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 232741717,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_medium_disruptor, "object/tangible/ship/crafted/weapon/shared_wpn_medium_disruptor.iff")
object_tangible_ship_crafted_weapon_shared_wpn_medium_ioncannon = SharedTangibleObjectTemplate:new {
clientTemplateFileName = "object/tangible/ship/crafted/weapon/shared_wpn_medium_ioncannon.iff"
--Data below here is deprecated and loaded from the tres, keeping for easy lookups
--[[
appearanceFilename = "appearance/ship_component_weapon_s01.apt",
arrangementDescriptorFilename = "",
certificationsRequired = {"cert_ordnance_level3"},
clearFloraRadius = 0,
clientDataFile = "",
clientGameObjectType = 1073741829,
collisionActionBlockFlags = 0,
collisionActionFlags = 51,
collisionActionPassFlags = 1,
collisionMaterialBlockFlags = 0,
collisionMaterialFlags = 1,
collisionMaterialPassFlags = 0,
containerType = 0,
containerVolumeLimit = 1,
customizationVariableMapping = {},
detailedDescription = "@space_crafting_d:wpn_medium_ioncannon",
gameObjectType = 1073741829,
locationReservationRadius = 0,
lookAtText = "string_id_table",
noBuildRadius = 0,
objectName = "@space_crafting_n:wpn_medium_ioncannon",
onlyVisibleInTools = 0,
paletteColorCustomizationVariables = {},
portalLayoutFilename = "",
rangedIntCustomizationVariables = {},
scale = 1,
scaleThresholdBeforeExtentTest = 0.5,
sendToClient = 1,
slotDescriptorFilename = "",
snapToTerrain = 1,
socketDestinations = {},
structureFootprintFileName = "",
surfaceType = 0,
targetable = 1,
totalCellNumber = 0,
useStructureFootprintOutline = 0,
clientObjectCRC = 1575907151,
derivedFromTemplates = {"object/object/base/shared_base_object.iff", "object/tangible/base/shared_tangible_base.iff", "object/tangible/ship/components/base/shared_ship_component_base.iff", "object/tangible/ship/crafted/weapon/shared_base_weapon.iff"}
]]
}
ObjectTemplates:addClientTemplate(object_tangible_ship_crafted_weapon_shared_wpn_medium_ioncannon, "object/tangible/ship/crafted/weapon/shared_wpn_medium_ioncannon.iff")
|
-- require 'strict'
scratchy = require 'scratchy'
function love.load()
love.window.setMode(800, 600, {})
width = love.graphics.getWidth()
height = love.graphics.getHeight()
space = scratchy.sprite({
image = "space.jpg",
x = width / 2,
y = height / 2,
scale = 0.8,
})
player_ship = scratchy.sprite({
image = "ship_basic.png",
x = width / 2,
y = height / 2,
direction = 0,
scale = 2
})
player_ship:load_sound('shot', 'Shot01.wav', 1.2, 1.5)
player_ship.shoot = function(self)
shot = scratchy.sprite({
image = "shot.png",
x = self.x,
y = self.y,
direction = self.direction
})
player_ship:start_sound('shot')
shot.update = function(self, dt)
if not self:on_screen() then
self:delete()
end
self:move(200 * dt)
if self:touching(enemy_ship) then
enemy_ship:delete()
self:delete()
end
end
end
enemy_ship = scratchy.sprite({
image = "evil_ship.png",
x = width / 2 + 100,
y = height / 2 + 100,
direction = -3.14,
scale = 0.2,
})
enemy_ship.shoot = function(self)
print "enemy shoots"
shot = scratchy.sprite({
image = "enemy_shot.png",
x = self.x,
y = self.y,
direction = self.direction,
scale = 0.3
})
shot.update = function(self, dt)
if not self:on_screen() then
self:delete()
end
self:move(150 * dt)
if self:touching(player_ship) then
player_ship:delete()
self:delete()
game_over = true
end
end
end
enemy_ship.cool_down = 5
enemy_ship.update = function(self, dt)
self:point_towards(player_ship)
self:move(20 * dt)
if self:touching(player_ship) then
player_ship:delete()
game_over = true
end
self.cool_down = self.cool_down - dt
if self.cool_down < 0 then
self.cool_down = 5
self:shoot()
end
end
Vx = 0
Vy = 0
-- touching_debug = true
end
function love.update(dt)
if game_over then
return
end
if love.keyboard.isDown('up') then
player_ship:move(100 * dt)
end
if not player_ship:on_screen() then
player_ship:move(-100 * dt)
end
if love.keyboard.isDown('left') then
player_ship:turn(-180 * dt)
end
if love.keyboard.isDown('right') then
player_ship:turn(180 * dt)
end
scratchy.update(dt)
-- if love.keyboard.isDown('down') then
-- Vx = 0
-- Vy = 0
-- end
-- if love.keyboard.isDown('left') then
-- rotation = rotation - math.pi * dt
-- end
-- if love.keyboard.isDown('right') then
-- rotation = rotation + math.pi * dt
-- end
-- x = x + Vx * dt
-- y = y - Vy * dt
-- force_screen_boundaries()
end
-- function force_screen_boundaries()
-- if y > height + 20 then y = -20 end
-- if x > width + 20 then x = -20 end
-- if x < -20 then x = width + 20 end
-- if y < -20 then y = height + 20 end
-- end
function love.keypressed(key, unicode)
if key == 'escape' then
love.event.quit()
elseif key == 'space' and not game_over then
player_ship:shoot()
elseif key == 'kp+' then
player_ship:go_to_front_layer()
player_ship.scale = player_ship.scale * 1.1
elseif key == 'kp-' then
player_ship:go_to_back_layer()
player_ship.scale = player_ship.scale * 0.9
end
end
function love.draw()
scratchy.draw()
if game_over then
love.graphics.print("GAME OVER", width/2, height / 2, 0, 5, 5, 35, 10)
end
end
|
RegisterNetEvent('esx_addons_gcphone:call')
AddEventHandler('esx_addons_gcphone:call', function(data)
local playerPed = PlayerPedId()
local coords = GetEntityCoords(playerPed)
local message = data.message
local number = data.number
if message == nil then
DisplayOnscreenKeyboard(1, "FMMC_MPM_NA", "", "", "", "", "", 200)
while (UpdateOnscreenKeyboard() == 0) do
DisableAllControlActions(0);
Citizen.Wait(0);
end
if (GetOnscreenKeyboardResult()) then
message = GetOnscreenKeyboardResult()
end
end
if message ~= nil and message ~= "" then
TriggerServerEvent('esx_addons_gcphone:startCall', number, message, {
x = coords.x,
y = coords.y,
z = coords.z
})
end
end)
|
local AS = unpack(AddOnSkins)
if not AS:CheckAddOn('Examiner') then return end
function AS:Examiner()
AS:SkinFrame(Examiner)
AS:SkinScrollBar(ExaminerStatsScrollScrollBar)
AS:SkinScrollBar(ExaminerFeatsScrollScrollBar)
AS:SkinScrollBar(ExaminerGearScrollScrollBar)
local Slots = {
'Head',
'Neck',
'Shoulder',
'Back',
'Chest',
'Shirt',
'Tabard',
'Wrist',
'Hands',
'Waist',
'Legs',
'Feet',
'Finger0',
'Finger1',
'Trinket0',
'Trinket1',
'MainHand',
'SecondaryHand',
}
for _, Slot in pairs(Slots) do
local Button = _G['ExaminerItemButton'..Slot..'Slot']
AS:SkinTexture(Button.texture)
AS:SkinFrame(Button)
Button.texture:SetInside()
Button.border:SetAlpha(0)
Button.texture:SetDrawLayer('OVERLAY')
Button:SetFrameLevel(Button:GetFrameLevel() + 2)
hooksecurefunc(Button.border, 'SetVertexColor', function(self, r, g, b)
Button:SetBackdropBorderColor(r, g, b)
end)
hooksecurefunc(Button.border, 'Hide', function(self)
Button:SetBackdropBorderColor(unpack(AS.BorderColor))
end)
AS:StyleButton(Button)
end
for i = 1, Examiner:GetNumChildren() do
local object = select(i, Examiner:GetChildren())
if object:IsObjectType('Button') then
if object:GetText() ~= nil then
AS:SkinButton(object, true)
else
AS:SkinCloseButton(object, true)
end
end
end
AS:Kill(Examiner.portrait)
AS:Kill(Examiner.bgBottomLeft)
AS:Kill(Examiner.dlgBottomLeft)
AS:Kill(Examiner.bgTopLeft)
AS:Kill(Examiner.dlgTopLeft)
AS:Kill(Examiner.bgBottomRight)
AS:Kill(Examiner.dlgBottomRight)
AS:Kill(Examiner.bgTopRight)
AS:Kill(Examiner.dlgTopRight)
Examiner:Size(360, 464)
Examiner.model:ClearAllPoints()
Examiner.model:Point('BOTTOMLEFT', Examiner, 'BOTTOMLEFT', 22, 22)
end
AS:RegisterSkin('Examiner', AS.Examiner)
|
CLASS.name = "Citizen"
CLASS.faction = FACTION_CITIZEN
CLASS.isDefault = true
CLASS.color = Color(150, 125, 100, 255);
CLASS_CITIZEN = CLASS.index
|
if not SF.Require("xinput") then return function() end end
local checkluatype = SF.CheckLuaType
SF.hookAdd("xinputConnected", "xinputconnected")
SF.hookAdd("xinputDisconnected", "xinputdisconnected")
SF.hookAdd("xinputPressed", "xinputpressed")
SF.hookAdd("xinputReleased", "xinputreleased")
SF.hookAdd("xinputTrigger", "xinputtrigger")
SF.hookAdd("xinputStick", "xinputstick")
--- A simpler, hook-based, and more-powerful controller input library. Inputs are not lost between rendered frames, and there is support for rumble. Note: the client must have the XInput lua binary module installed in order to access this library. See more at https://github.com/mitterdoo/garrysmod-xinput
-- @name xinput
-- @class library
-- @libtbl xinput_library
SF.RegisterLibrary("xinput")
return function(instance)
local checkpermission = instance.player ~= NULL and SF.Permissions.check or function() end
instance:AddHook("initialize", function()
instance.data.xinputRumble = {}
for i = 0, 3 do
instance.data.xinputRumble[i] = {0, 0}
end
end)
instance:AddHook("deinitialize", function()
for i = 0, 3 do
local rumble = instance.data.xinputRumble[i]
if rumble[1] > 0 or rumble[2] > 0 then
xinput.setRumble(i, 0, 0)
end
end
end)
local xinput_library = instance.Libraries.xinput
--- Gets the state of the controller.
-- @name xinput_library.getState
-- @class function
-- @param id Controller number. Starts at 0
-- @return Table containing all input data of the controller, or false if the controller is not connected. The table uses this struct: https://github.com/mitterdoo/garrysmod-xinput#xinput_gamepad
xinput_library.getState = xinput.getState
--- Gets whether the button on the controller is currently pushed down.
-- @name xinput_library.getButton
-- @class function
-- @param id Controller number. Starts at 0
-- @param button The button to check for. See https://github.com/mitterdoo/garrysmod-xinput#xinput_gamepad_
-- @return bool
xinput_library.getButton = xinput.getButton
--- Gets the current position of the trigger on the controller.
-- @name xinput_library.getTrigger
-- @class function
-- @param id Controller number. Starts at 0
-- @param trigger Which trigger to use. 0 is left
-- @return 0-255 inclusive
xinput_library.getTrigger = xinput.getTrigger
--- Gets the current coordinates of the stick on the controller.
-- @name xinput_library.getStick
-- @class function
-- @param id Controller number. Starts at 0
-- @param stick Which stick to use. 0 is left
-- @return Two numbers for the X and Y coordinates, respectively, each being between -32768 - 32767 inclusive
xinput_library.getStick = xinput.getStick
--- Attempts to check the battery level of the controller.
-- @name xinput_library.getBatteryLevel
-- @class function
-- @param id Controller number. Starts at 0
-- @return If successful: a number between 0.0-1.0 inclusive. If unsuccessful: false, and a string error message
xinput_library.getBatteryLevel = xinput.getBatteryLevel
--- Gets all of the connected controllers.
-- @name xinput_library.getControllers
-- @class function
-- @return A table where each key is the ID of the controller that is connected. Disconnected controllers are not placed in the table.
xinput_library.getControllers = xinput.getControllers
--- Sets the rumble on the controller.
-- @param id Controller number. Starts at 0
-- @param softPercent A number between 0.0-1.0 for how much the soft rumble motor should vibrate.
-- @param hardPercent A number between 0.0-1.0 for how much the hard rumble motor should vibrate.
function xinput_library.setRumble(id, softPercent, hardPercent)
-- This longer function makes sure that the rumble doesn't continue when the instance is gone.
checkluatype(id, TYPE_NUMBER)
id = math.floor(id)
xinput.setRumble(id, softPercent, hardPercent) -- Does the rest of the type checking
instance.data.xinputRumble[id][1] = softPercent
instance.data.xinputRumble[id][2] = hardPercent
end
end
--- Called when a controller has been connected. Client must have XInput Lua binary installed.
-- @client
-- @name xinputConnected
-- @class hook
-- @param id Controller number. Starts at 0
-- @param when The timer.realtime() at which this event occurred.
--- Called when a controller has been disconnected. Client must have XInput Lua binary installed.
-- @client
-- @name xinputDisconnected
-- @class hook
-- @param id Controller number. Starts at 0
-- @param when The timer.realtime() at which this event occurred.
--- Called when a controller button has been pressed. Client must have XInput Lua binary installed.
-- @client
-- @name xinputPressed
-- @class hook
-- @param id Controller number. Starts at 0
-- @param button The button that was pushed. See https://github.com/mitterdoo/garrysmod-xinput#xinput_gamepad_
-- @param when The timer.realtime() at which this event occurred.
--- Called when a controller button has been released. Client must have XInput Lua binary installed.
-- @client
-- @name xinputReleased
-- @class hook
-- @param id Controller number. Starts at 0
-- @param button The button that was released. See https://github.com/mitterdoo/garrysmod-xinput#xinput_gamepad_
-- @param when The timer.realtime() at which this event occurred.
--- Called when a trigger on the controller has moved. Client must have XInput Lua binary installed.
-- @client
-- @name xinputTrigger
-- @class hook
-- @param id Controller number. Starts at 0
-- @param value The position of the trigger. 0-255 inclusive
-- @param trigger The trigger that was moved. 0 is left
-- @param when The timer.realtime() at which this event occurred.
--- Called when a stick on the controller has moved. Client must have XInput Lua binary installed.
-- @client
-- @name xinputStick
-- @class hook
-- @param id Controller number. Starts at 0
-- @param x The X coordinate of the trigger. -32768 - 32767 inclusive
-- @param y The Y coordinate of the trigger. -32768 - 32767 inclusive
-- @param stick The stick that was moved. 0 is left
-- @param when The timer.realtime() at which this event occurred.
|
local U = require "us4l".U
local TestCases = {
{
Conversion = "Lowercase";
{ U[[ tHe QUIcK bRoWn]], U[[ the quick brown]] };
--{ U[[aBI\u{3A3}\u{DF}\u{3A3}/\u{5FFFF}\u{10405}]], U[[abi\u{3C3}\u{DF}\u{3C2}/\u{5FFFF}\u{1042D}]] }; --TODO: Need support for unassigned characters
};
{
Conversion = "Uppercase";
{ U[[ tHe QUIcK bRoWn]], U[[ THE QUICK BROWN]] };
--{ U[[aBi\u{3C3}\u{DF}\u{3C2}/\u{FB03}\u{5FFFF}\u{1042D}]], U[[ABI\u{3A3}SS\u{3A3}/FFI\u{5FFFF}\u{10405}]] }; --TODO: Need support for unassigned characters
};
{
Conversion = "Titlecase";
{ U[[\u{2BB}aMeLikA huI P\u{16B} \u{2BB}\u{2BB}\u{2BB}iA]], U[[\u{2BB}Amelika Hui P\u{16B} \u{2BB}\u{2BB}\u{2BB}Ia]] };
{ U[[ tHe QUIcK bRoWn]], U[[ The Quick Brown]] };
{ U[[\u{1C9}ubav ljubav]], U[[\u{1C8}ubav Ljubav]] };
{ U[[ijssel igloo IJMUIDEN]], U[[Ijssel Igloo Ijmuiden]] };
{ U[['oH dOn'T tItLeCaSe AfTeR lEtTeR+']], U[['Oh Don't Titlecase After Letter+']] };
{ U[[a \u{2BB}CaT. A \u{2BB}dOg! \u{2BB}eTc.]], U[[A \u{2BB}Cat. A \u{2BB}Dog! \u{2BB}Etc.]] };
};
--[=[
{
Conversion = "Casefold";
--{ U[[aB\u{130}I\u{131}\u{3D0}\u{DF}\u{FB03}\u{5FFFF}]], U[[abi\u{307}i\u{131}\u{3B2}ssffi\u{5FFFF}]] }; --TODO: Need support for unassigned characters
};
--]=]
}
for _, cases in ipairs( TestCases ) do
local any_failed = false
print( string.format( "Trying test cases for '%s'", cases.Conversion ) )
local method_name = "To" .. cases.Conversion
for i = 1, #cases do
local input = cases[i][1]
local expected = cases[i][2]
local actual = input[ method_name ]( input )
if expected ~= actual then
any_failed = true
print( string.format( "Failed case #%i: expected:\n%s\ngot:\n%s", i, expected:PrettyPrint(), actual:PrettyPrint() ) )
end
end
if not any_failed then
print "All test cases successful!"
end
end
|
local table, tostring, format, pairs, print, ipairs, type, unpack =
table, tostring, string.format, pairs, print, ipairs, type, unpack
-- #############################################################
local T = {}
DEVT_Table = T
-- ###################### Start Here ###########################
local function Trim(s) return (s:gsub("^%s*(.-)%s*$", "%1")) end
function T.parseSpaceSeparatedVar(text)
local rt = {}
for a in text:gmatch("%S+") do table.insert(rt, a) end
return rt
end
function T.parseCSV(text)
local rt = {}
for a,v in text:gmatch("([^,]+)") do
local a2 = Trim(a)
table.insert(rt, a2)
end
return rt
end
function T.size(t)
local count = 0
for _ in pairs(t) do count = count + 1 end
return count
end
function T.isEmpty(t)
if t == nil then return true end
return table.size(t) <= 0
end
function T.members()
print('table members: ')
for key, _ in pairs(T) do
print(" " .. key);
end
end
function T.shallow_copy(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end
function T.append(source, target)
local t2 = target or {}
for k,v in pairs(source) do
if t2[k] == nil then t2[k] = v end
end
return t2
end
function T.sliceAndPack(t, startIndex)
local sliced = T.slice(t, startIndex)
if type(unpack) ~= 'nil' then
return T.pack(unpack(sliced))
end
return T.pack(table.unpack(sliced))
end
---Fail-safe unpack
---@param t table The table to unpack
function T.unpackIt(t)
if type(unpack) == 'function' then
return unpack(t)
end
return table.unpack(t)
end
function T.slice (t, startIndex, stopIndex)
local pos, new = 1, {}
if not stopIndex then stopIndex = #t end
for i = startIndex, stopIndex do
new[pos] = t[i]
pos = pos + 1
end
return new
end
function T.concatkv(t)
if type(t) ~= 'table' then return tostring(t) end
local s = '{ '
for k,v in pairs(t) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. T.concatkv(v) .. ','
end
return s .. '} '
end
function T.getSortedKeys(t)
if type(t) ~= 'table' then return tostring(t) end
local keys = {}
for k in pairs(t) do table.insert(keys, k) end
table.sort(keys)
return keys
end
function T.concatkvs(t)
if type(t) ~= 'table' then return tostring(t) end
local keys = T.getSortedKeys(t)
local s = '{ \n'
for _, k in pairs(keys) do
local ko = k
if type(k) ~= 'number' then k = '"'..k..'"' end
if type(t[ko]) ~= 'function' then
s = s .. '['..k..'] = ' .. T.concatkvs(t[ko]) .. ','
end
end
return s .. '} '
end
function T.toString(t) return T.concatkv(t) end
function T.toStringSorted(t) return T.concatkvs(t) end
function T.toString2(t)
if type(t) ~= 'table' then return tostring(t) end
local s = '\n{'
for k,v in pairs(t) do
s = string.format("%s\n %s: %s,", s, tostring(k), T.toString2(v))
end
return s .. '\n}'
end
function T.pack(...)
return { len = select("#", ...), ... }
end
function T.isTable(t) return type(t) == 'table' end
function T.isNotTable(t) return not T.isTable(t) end
function T.print(t) print(T.toString(t)) end
function T.printkv(t) print(T.concatkv(t)) end
function T.printkvs(t)
local keys = T.getSortedKeys(t)
for _, k in ipairs(keys) do print(k, t[k]) end
end
function T.println(t)
if type(t) ~= 'table' then return tostring(t) end
for k,v in pairs(t) do
print(format("%s: %s", tostring(k), T.println(v)))
end
end
function T.printG() T.printkvs(_G) end
function T.printLoaded() T.printkvs(package.loaded) end
-- ### Redirects ---
function T.insert(list, value) table.insert(list, value) end
|
---
-- @author wesen
-- @copyright 2020-2021 wesen <wesen-ac@web.de>
-- @release 0.1
-- @license MIT
--
local TestCase = require "wLuaUnit.TestCase"
---
-- Checks that the LuaServerApi works as expected.
--
-- @type TestLuaServerApi
--
local TestLuaServerApi = TestCase:extend()
---
-- The require path for the class that is tested by this TestCase
--
-- @tfield string testClassPath
--
TestLuaServerApi.testClassPath = "AC-LuaServer.Core.LuaServerApi"
---
-- Checks that LuaServer Api functions with no arguments can be called with emitting of the
-- "before_<function name>" and "after_<function name>" events.
--
function TestLuaServerApi:testCanCallLuaServerApiFunctionsWithNoArgumentsWithEmittingEvents()
local EventCallback = require "AC-LuaServer.Core.Event.EventCallback"
local LuaServerApi = self.testClass
local removebansMock = self.mach.mock_function("removebansMock")
_G.removebans = function(...)
removebansMock(...)
end
local onBeforeBansRemoveListener = self.mach.mock_function("onBeforeBansRemoveListener")
local onBansRemovedListener = self.mach.mock_function("onBansRemovedListener")
LuaServerApi:on(
"before_removebans",
EventCallback(function(...) return onBeforeBansRemoveListener(...) end)
)
LuaServerApi:on(
"after_removebans",
EventCallback(function(...) onBansRemovedListener(...) end)
)
-- removebans is cancelled by the "before_removebans" event listeners
onBeforeBansRemoveListener.should_be_called()
:and_will_return("won't let you do this")
:when(
function()
LuaServerApi:removebans()
end
)
-- removebans is not cancelled by the "before_removebans" event listeners
onBeforeBansRemoveListener.should_be_called()
:and_then(
removebansMock.should_be_called()
)
:and_then(
onBansRemovedListener.should_be_called()
)
:when(
function()
LuaServerApi:removebans()
end
)
end
---
-- Checks that LuaServer Api functions with a single argument can be called with emitting of the
-- "before_<function name>" and "after_<function name>" events.
--
function TestLuaServerApi:testCanCallLuaServerApiFunctionsWithSingleArgumentWithEmittingEvents()
local EventCallback = require "AC-LuaServer.Core.Event.EventCallback"
local LuaServerApi = self.testClass
local removemapMock = self.mach.mock_function("removemapMock")
_G.removemap = function(...)
removemapMock(...)
end
local onBeforeMapRemoveListener = self.mach.mock_function("onBeforeMapRemoveListener")
local onMapRemovedListener = self.mach.mock_function("onMapRemovedListener")
LuaServerApi:on(
"before_removemap",
EventCallback(function(...) return onBeforeMapRemoveListener(...) end)
)
LuaServerApi:on(
"after_removemap",
EventCallback(function(...) onMapRemovedListener(...) end)
)
-- removemap is cancelled by the "before_removemap" event listeners
onBeforeMapRemoveListener.should_be_called_with("unplayable-gema-map")
:and_will_return("dont do that!")
:when(
function()
LuaServerApi:removemap("unplayable-gema-map")
end
)
-- removemap is not cancelled by the "before_removemap" event listeners
onBeforeMapRemoveListener.should_be_called_with("RoofTopGemaEasy")
:and_then(
removemapMock.should_be_called_with("RoofTopGemaEasy")
)
:and_then(
onMapRemovedListener.should_be_called_with("RoofTopGemaEasy")
)
:when(
function()
LuaServerApi:removemap("RoofTopGemaEasy")
end
)
end
---
-- Checks that LuaServer Api functions with mulitple arguments can be called with emitting of the
-- "before_<function name>" and "after_<function name>" events.
--
function TestLuaServerApi:testCanCallLuaServerApiFunctionsWithMultipleArgumentsWithEmittingEvents()
local EventCallback = require "AC-LuaServer.Core.Event.EventCallback"
local LuaServerApi = self.testClass
local disconnectMock = self.mach.mock_function("disconnectMock")
_G.disconnect = function(...)
disconnectMock(...)
end
local onBeforeDisconnectListener = self.mach.mock_function("onBeforeDisconnectListener")
local onDisconnectedListener = self.mach.mock_function("onDisconnectedListener")
LuaServerApi:on(
"before_disconnect",
EventCallback(function(...) return onBeforeDisconnectListener(...) end)
)
LuaServerApi:on(
"after_disconnect",
EventCallback(function(...) onDisconnectedListener(...) end)
)
-- disconnect is cancelled by the "before_disconnect" event listeners
onBeforeDisconnectListener.should_be_called_with(5, 19)
:and_will_return("100% not a cheater")
:when(
function()
LuaServerApi:disconnect(5, 19)
end
)
-- disconnect is not cancelled by the "before_disconnect" event listeners
onBeforeDisconnectListener.should_be_called_with(15, 17)
:and_then(
disconnectMock.should_be_called_with(15, 17)
)
:and_then(
onDisconnectedListener.should_be_called_with(15, 17)
)
:when(
function()
LuaServerApi:disconnect(15, 17)
end
)
end
---
-- Checks that LuaServer Api functions can be called without emitting of the "before_<function name>"
-- and "after_<function name>" events.
--
function TestLuaServerApi:testCanCallLuaServerApiFunctionsWithoutEmittingEvents()
local LuaServerApi = self.testClass
-- No arguments
local shuffleteamsMock = self.mach.mock_function("shuffleteamsMock")
_G.shuffleteams = function(...)
shuffleteamsMock(...)
end
shuffleteamsMock:should_be_called()
:when(
function()
LuaServerApi.shuffleteams()
end
)
-- Single argument
local spawnitemMock = self.mach.mock_function("spawnitemMock")
_G.spawnitem = function(...)
spawnitemMock(...)
end
spawnitemMock:should_be_called_with(37)
:when(
function()
LuaServerApi.spawnitem(37)
end
)
-- Multiple arguments
local pickupasMock = self.mach.mock_function("pickupasMock")
_G.pickupas = function(...)
pickupasMock(...)
end
pickupasMock:should_be_called_with(4, 23)
:when(
function()
LuaServerApi.pickupas(4, 23)
end
)
end
---
-- Checks that the return values of LuaServer Api functions are returned as expected.
--
function TestLuaServerApi:testCanReturnReturnValuesOfApiFunctions()
local LuaServerApi = self.testClass
-- No return values
local setscoreMock = self.mach.mock_function("setscoreMock")
_G.setscore = function(...)
return setscoreMock(...)
end
setscoreMock:should_be_called_with(7, 311)
:when(
function()
self:assertNil(LuaServerApi.setscore(7, 311))
end
)
-- Single return value
local getnameMock = self.mach.mock_function("getnameMock")
_G.getname = function(...)
return getnameMock(...)
end
getnameMock:should_be_called_with(5)
:and_will_return("unarmed")
:when(
function()
self:assertEquals("unarmed", LuaServerApi.getname(5))
end
)
-- Multiple return values
local getposMock = self.mach.mock_function("getposMock")
_G.getpos = function(...)
return getposMock(...)
end
getposMock:should_be_called_with(8)
:and_will_return(1, 4, 2)
:when(
function()
self:assertEquals({1, 4, 2}, { LuaServerApi.getpos(8) })
end
)
end
---
-- Checks that global API constants can be returned by the LuaServerApi as expected.
--
function TestLuaServerApi:testCanReturnGlobalApiConstants()
local LuaServerApi = self.testClass
_G.SA_MAP = 7
_G.GM_CTF = 5
_G.VOTEE_INVALID = 6
self:assertEquals(7, LuaServerApi.SA_MAP)
self:assertEquals(5, LuaServerApi.GM_CTF)
self:assertEquals(6, LuaServerApi.VOTEE_INVALID)
end
---
-- Checks that the methods of the base Object from which LuaServerApi extends are accessible.
--
function TestLuaServerApi:testCanAccessBaseObjectMethods()
local Object = require "classic"
local LuaServerApi = self.testClass
self:assertTrue(LuaServerApi:is(Object))
local DifferentObject = Object:extend()
self:assertFalse(LuaServerApi:is(DifferentObject))
end
---
-- Checks that API event listeners can be set up via the LuaServerApi as expected.
--
function TestLuaServerApi:testCanSetApiEventListeners()
local LuaServerApi = self.testClass
local eventListenerMock = self.mach.mock_function("onPlayerCallVoteMock")
self:assertNil(_G.onPlayerCallVote)
LuaServerApi.onPlayerCallVote = eventListenerMock
self:assertIs(eventListenerMock, _G.onPlayerCallVote)
end
return TestLuaServerApi
|
-- 'Statistics' tab
local settings = {id = 1, title = "Statistics"}
local content = nil
local items = {
["input_search"] = {type = "input", placeholder = "Search for a player...", x = 0, y = 0, width = panel.width, height = panel.fontHeight * 2, maxLength = 20},
["gridlist_players"] = {type = "gridlist", x = 0, y = panel.fontHeight * 2, width = panel.width, height = panel.height - panel.fontHeight * 2, customBlockHeight = panel.fontHeight * 4, columns = (screenWidth < 1000 and 2 or 3), readOnly = true}
}
playerFromID = {}
-- Optimization
local dxCreateRenderTarget = dxCreateRenderTarget
local dxSetRenderTarget = dxSetRenderTarget
local dxSetBlendMode = dxSetBlendMode
local dxDrawRectangle = dxDrawRectangle
local dxDrawText = dxDrawText
local dxDrawImage = dxDrawImage
local dxDrawImageSection = dxDrawImageSection
local unpack = unpack
local tocolor = tocolor
local math_min = math.min
local math_max = math.max
local math_floor = math.floor
local tableInsert = table.insert
local tableRemove = table.remove
local pairs = pairs
local interpolateBetween = interpolateBetween
-- Calculations
local function precacheStuff()
content.avatarSize = math.floor(items["gridlist_players"].blockHeight * 0.5)
content.avatarOffset = (items["gridlist_players"].blockHeight - content.avatarSize)/2
content.rankSize = 10
end
-- Initialization
local function initTab()
-- Tab registration
content = panel.initTab(settings.id, settings, items)
precacheStuff()
-- Customization
items["gridlist_players"].customBlockRendering = function(x, y, row, item, i, hover)
local player = content.players[i]
if not player then
return
end
local logged = getElementData(player, "LoggedIn")
if getElementData(player, "donator") then
dxDrawImage(x + 1, y + content.avatarOffset - 9, content.avatarSize + 18, content.avatarSize + 18, "img/highlight.png", 0, 0, 0, tocolor(55, 255, 55, 255))
end
dxDrawPlayerAvatar(player, x + 10, y + content.avatarOffset, content.avatarSize, 255)
dxDrawText(row.text, x + content.avatarSize + 20, y, x + item.blockWidth, y + item.blockHeight, tocolor(255, 255, 255, 255), item.fontScale, item.font, "left", "center", false, false, false, true)
dxDrawText("playing at "..content.userdata[player].arena, x + content.avatarSize + 20, y, x + item.blockWidth - 10, y + item.blockHeight - 10, tocolor(255, 255, 255, 155), item.fontScale, dxlib.getFont("Roboto-Regular", 11), "right", "bottom", true)
if not logged and hover > 0 then
dxDrawRectangle(x, y, item.blockWidth, item.blockHeight, tocolor(25, 25, 25, 225 * hover))
dxDrawText("User is not logged in", x, y, x + item.blockWidth, y + item.blockHeight - 10 * (1 - hover), tocolor(255, 255, 255, 255 * hover), item.fontScale, dxlib.getFont("Roboto-Regular", 11), "center", "center", false, false, false, true)
end
end
-- Functions
-- 'Select player'
items["gridlist_players"].onSelect = function(id)
local player = content.players[id]
if isElement(player) then
cachePlayerStatistics(player)
triggerServerEvent("mysql:onRequestPlayerStats", localPlayer, player)
end
end
updatePlayers()
end
addEventHandler("onClientResourceStart", resourceRoot, initTab)
-- Update player list
function updatePlayers(exceptionPlayer)
content.players = {}
content.playerNames = {}
content.userdata = {}
playerFromID = {}
local players = getElementsByType("player")
for i, player in pairs(players) do
if player == localPlayer then
table.remove(players, i)
table.insert(players, 1, localPlayer)
break
end
end
for i, player in pairs(getElementsByType("player")) do
if not exceptionPlayer or player ~= exceptionPlayer then
table.insert(content.players, player)
table.insert(content.playerNames, getPlayerName(player))
content.userdata[player] = {}
content.userdata[player].arena = (getElementData(player, "arena") or "n/a"):upper()
local id = tonumber(getElementData(player, "account_id"))
if id then
playerFromID[id] = player
end
end
end
dxlib.setGridlistContent(items["gridlist_players"], content.playerNames)
end
addEventHandler("onClientPlayerJoin", root, updatePlayers)
addEventHandler("onClientPlayerQuit", root, function() updatePlayers(source) end)
addEventHandler("onClientPlayerChangeNick", root,
function()
content.refreshReqired = true
end)
addEvent("panel:onVisibilityChanged", true)
addEventHandler("panel:onVisibilityChanged", localPlayer,
function(state)
if state and content.refreshReqired then
updatePlayers()
content.refreshReqired = nil
end
end)
-- Search filter
function applyPlayerFilter(filter)
local filter = filter and filter or (items["input_search"].text or "")
if filter == "" then
updatePlayers()
return
end
content.players = {}
content.playerNames = {}
local filter = filter:gsub("#%x%x%x%x%x%x", ""):lower()
for i, player in pairs(getElementsByType("player")) do
local playerName = getPlayerName(player)
if playerName:gsub("#%x%x%x%x%x%x", ""):lower():find(filter, 1, true) then
table.insert(content.players, player)
table.insert(content.playerNames, playerName)
end
end
dxlib.setGridlistContent(items["gridlist_players"], content.playerNames)
end
items["input_search"].onTextChange = applyPlayerFilter
-- Catching data updates
local dataToCatch = {username = true, arena = true, Clan = true}
addEventHandler("onClientElementDataChange", root,
function(dataName)
local text = items["input_search"].text or ""
if getElementType(source) == "player" and dataToCatch[dataName] and text == "" then
updatePlayers()
applyPlayerFilter()
end
end)
|
-- This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
--
-- This file is compatible with Lua 5.3
local class = require("class")
require("kaitaistruct")
local str_decode = require("string_decode")
GranTurismoVol = class.class(KaitaiStruct)
function GranTurismoVol:_init(io, parent, root)
KaitaiStruct._init(self, io)
self._parent = parent
self._root = root or self
self:_read()
end
function GranTurismoVol:_read()
self.magic = self._io:read_bytes(8)
if not(self.magic == "\071\084\070\083\000\000\000\000") then
error("not equal, expected " .. "\071\084\070\083\000\000\000\000" .. ", but got " .. self.magic)
end
self.num_files = self._io:read_u2le()
self.num_entries = self._io:read_u2le()
self.reserved = self._io:read_bytes(4)
if not(self.reserved == "\000\000\000\000") then
error("not equal, expected " .. "\000\000\000\000" .. ", but got " .. self.reserved)
end
self.offsets = {}
for i = 0, self.num_files - 1 do
self.offsets[i + 1] = self._io:read_u4le()
end
end
GranTurismoVol.property.ofs_dir = {}
function GranTurismoVol.property.ofs_dir:get()
if self._m_ofs_dir ~= nil then
return self._m_ofs_dir
end
self._m_ofs_dir = self.offsets[1 + 1]
return self._m_ofs_dir
end
GranTurismoVol.property.files = {}
function GranTurismoVol.property.files:get()
if self._m_files ~= nil then
return self._m_files
end
local _pos = self._io:pos()
self._io:seek((self.ofs_dir & 4294965248))
self._m_files = {}
for i = 0, self._root.num_entries - 1 do
self._m_files[i + 1] = GranTurismoVol.FileInfo(self._io, self, self._root)
end
self._io:seek(_pos)
return self._m_files
end
GranTurismoVol.FileInfo = class.class(KaitaiStruct)
function GranTurismoVol.FileInfo:_init(io, parent, root)
KaitaiStruct._init(self, io)
self._parent = parent
self._root = root or self
self:_read()
end
function GranTurismoVol.FileInfo:_read()
self.timestamp = self._io:read_u4le()
self.offset_idx = self._io:read_u2le()
self.flags = self._io:read_u1()
self.name = str_decode.decode(KaitaiStream.bytes_terminate(KaitaiStream.bytes_strip_right(self._io:read_bytes(25), 0), 0, false), "ASCII")
end
GranTurismoVol.FileInfo.property.size = {}
function GranTurismoVol.FileInfo.property.size:get()
if self._m_size ~= nil then
return self._m_size
end
self._m_size = ((self._root.offsets[(self.offset_idx + 1) + 1] & 4294965248) - self._root.offsets[self.offset_idx + 1])
return self._m_size
end
GranTurismoVol.FileInfo.property.body = {}
function GranTurismoVol.FileInfo.property.body:get()
if self._m_body ~= nil then
return self._m_body
end
if not(self.is_dir) then
local _pos = self._io:pos()
self._io:seek((self._root.offsets[self.offset_idx + 1] & 4294965248))
self._m_body = self._io:read_bytes(self.size)
self._io:seek(_pos)
end
return self._m_body
end
GranTurismoVol.FileInfo.property.is_dir = {}
function GranTurismoVol.FileInfo.property.is_dir:get()
if self._m_is_dir ~= nil then
return self._m_is_dir
end
self._m_is_dir = (self.flags & 1) ~= 0
return self._m_is_dir
end
GranTurismoVol.FileInfo.property.is_last_entry = {}
function GranTurismoVol.FileInfo.property.is_last_entry:get()
if self._m_is_last_entry ~= nil then
return self._m_is_last_entry
end
self._m_is_last_entry = (self.flags & 128) ~= 0
return self._m_is_last_entry
end
|
include "./vendor/premake/premake_customization/solution_items.lua"
include "Dependencies.lua"
workspace "Triger"
architecture "x86_64"
startproject "Tridor"
configurations
{
"Debug",
"Release",
"Dist"
}
solution_items
{
".editorconfig"
}
flags
{
"MultiProcessorCompile"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
group "Dependencies"
include "vendor/premake"
include "Triger/vendor/Box2D"
include "Triger/vendor/GLFW"
include "Triger/vendor/Glad"
include "Triger/vendor/ImGui"
include "Triger/vendor/yaml-cpp"
group ""
include "Triger"
include "Tridor"
|
-- config.lua
-- Apr 2017
-- Configuration Options
--
-- You should be able to leave most of the settings here as defaults.
-- The only thing you definitely want to change are the welcome messages.
--------------------------------------------------------------------------------
-- Messages
-- You will want to change some of these to be your own.
-- Make sure SERVER_OWNER_IS_OARC = false
--------------------------------------------------------------------------------
-- This stuff is printed in the console. It's probably ignored most of the time.
WELCOME_MSG = "Join and play Coop !"
GAME_MODE_MSG = "In the current game mode, a satellite must be launched from an existing far away rocket silo to win!"
MODULES_ENABLED = "Mods Enabled: Separate Spawns, RSO, Long-Reach, Autofill, Undecorator, Player List"
-- This stuff is shown in the welcome GUI. Make sure it's valid.
WELCOME_MSG_TITLE = "Join and play Coop ! "
SERVER_MSG = "Rules: Be polite. Ask before changing other players's stuff. Every hour permissions are applied\n"..
"Here you can join the discord : discord.joinandplaycoop.com Here you can look at the status of the server status.joinandplaycoop.com"
SCENARIO_INFO_MSG = "Latest updates in this scenario version:\n"..
"0.16 experimental release. Tweaks to fix spawn issues / text / difficulty.\n"..
"This scenario gives you and/or your friends your own starting area.\n"..
"You can be on the main team or your own. All teams are friendly.\n"..
"If you leave in the first 15 minutes, your base and character will be deleted!"
SPAWN_WARN_MSG = "Due to the way this scenario works, it may take some time for the land around your new spawn area to generate... Please wait for 10-20 seconds when you select your first spawn."
CONTACT_MSG = "Contact: admin@poli.fun (thanks to Oarc for the scenario) discord.joinandplaycoop.com"
-- This should be false for you, it's just a convenience for me.
SERVER_OWNER_IS_OARC = false
--------------------------------------------------------------------------------
-- Module Enables
-- These enables are not fully tested! For example, disabling separate spawns
-- will probably break the frontier rocket silo mode
--------------------------------------------------------------------------------
-- Separate spawns
-- This is the core of the mod. Probably not a good idea to disable it.
ENABLE_SEPARATE_SPAWNS = true
-- This allows 2 players to spawn next to each other in the wilderness,
-- each with their own starting point. It adds more GUI selection options.
ENABLE_BUDDY_SPAWN = true
-- RSO soft-mod (included in the scenario)
ENABLE_RSO = true
-- Frontier style rocket silo mode
FRONTIER_ROCKET_SILO_MODE = true
-- Enable Undecorator
-- Removes decorative items to reduce save file size.
ENABLE_UNDECORATOR = true
-- Enable Tags
ENABLE_TAGS = true
-- Enable Long Reach
ENABLE_LONGREACH = true
-- Enable Autofill
ENABLE_AUTOFILL = true
-- Enable Playerlist
ENABLE_PLAYER_LIST = true
PLAYER_LIST_OFFLINE_PLAYERS = true -- List offline players as well.
-- Enable Gravestone Chests
ENABLE_GRAVESTONE_ON_DEATH = false
-- Items dumped into chest when you leave.
ENABLE_GRAVESTONE_ON_LEAVING = false
-- If anyone leaves within first X minutes, items get dumped into chest.
ENABLE_GRAVESTONE_ON_LEAVING_TIME_MINS = 15
-- Enable quick start items
ENABLE_POWER_ARMOR_QUICK_START = false
-- Enable shared vision between teams (all teams are COOP regardless)
ENABLE_SHARED_TEAM_VISION = true
-- Enable map regrowth, see regrowth_map.lua for more info.
-- I'm not a fan of this anymore, but it helps keep the map size down
ENABLE_REGROWTH = false
-- If you have regrowth enabled, this should also be enabled.
-- It removes bases for players that join and leave the game quickly.
-- This can also be used without enabling regrowth.
ENABLE_ABANDONED_BASE_REMOVAL = true
--------------------------------------------------------------------------------
-- Spawn Options
--------------------------------------------------------------------------------
---------------------------------------
-- Starting Items
---------------------------------------
-- Items provided to the player the first time they join
PLAYER_SPAWN_START_ITEMS = {
{name="pistol", count=1},
{name="firearm-magazine", count=100},
{name="iron-plate", count=8},
{name="burner-mining-drill", count = 1},
{name="stone-furnace", count = 1},
-- {name="iron-plate", count=20},
-- {name="burner-mining-drill", count = 1},
-- {name="stone-furnace", count = 1},
-- {name="power-armor", count=1},
-- {name="fusion-reactor-equipment", count=1},
-- {name="battery-mk2-equipment", count=3},
-- {name="exoskeleton-equipment", count=1},
-- {name="personal-roboport-mk2-equipment", count=3},
-- {name="solar-panel-equipment", count=7},
-- {name="construction-robot", count=100},
-- {name="repair-pack", count=100},
-- {name="steel-axe", count=3},
}
-- Items provided after EVERY respawn (disabled by default)
PLAYER_RESPAWN_START_ITEMS = {
-- {name="pistol", count=1},
-- {name="firearm-magazine", count=100}
}
---------------------------------------
-- Distance Options
---------------------------------------
-- This is the radius, in chunks, that a spawn area is from any other generated
-- chunks. It ensures the spawn area isn't too near generated/explored/existing
-- area. The larger you make this, the further away players will spawn from
-- generated map area (even if it is not visible on the map!).
CHECK_SPAWN_UNGENERATED_CHUNKS_RADIUS = 5
-- Near Distance in chunks
NEAR_MIN_DIST = 2
NEAR_MAX_DIST = 50
-- Far Distance in chunks
FAR_MIN_DIST = 200
FAR_MAX_DIST = 300
---------------------------------------
-- Resource & Spawn Circle Options
---------------------------------------
-- Enable this to have a vanilla style starting spawn for all new spawns.
-- This scenario normally gives you a fixed circle with resources.
-- USE_VANILLA_STARTING_SPAWN = true
-- TODO - Requires pre-allocating spawns...
-- Allow players to choose to spawn with a moat
SPAWN_MOAT_CHOICE_ENABLED = true
-- If you change the spawn area size, you might have to adjust this as well
MOAT_SIZE_MODIFIER = 1
-- THIS IS WHAT SETS THE SPAWN CIRCLE SIZE!
-- Create a circle of land area for the spawn
-- If you make this much bigger than a few chunks, good luck.
ENFORCE_LAND_AREA_TILE_DIST = CHUNK_SIZE*1.8
-- Location of water strip (horizontal)
WATER_SPAWN_OFFSET_X = -4
WATER_SPAWN_OFFSET_Y = -38
WATER_SPAWN_LENGTH = 8
-- Start resource amounts (per tile/oil spot)
START_IRON_AMOUNT = 1500
START_COPPER_AMOUNT = 1500
START_STONE_AMOUNT = 1000
START_COAL_AMOUNT = 1500
START_URANIUM_AMOUNT = 1000
START_OIL_AMOUNT = 300000
-- Start resource shape
-- If this is true, it will be a circle
-- If false, it will be a square
ENABLE_RESOURCE_SHAPE_CIRCLE = true
-- Start resource position and size
-- Position is relative to player starting location
START_RESOURCE_STONE_POS_X = -27
START_RESOURCE_STONE_POS_Y = -34
START_RESOURCE_STONE_SIZE = 12
START_RESOURCE_COAL_POS_X = -27
START_RESOURCE_COAL_POS_Y = -20
START_RESOURCE_COAL_SIZE = 12
START_RESOURCE_COPPER_POS_X = -28
START_RESOURCE_COPPER_POS_Y = -3
START_RESOURCE_COPPER_SIZE = 14
START_RESOURCE_IRON_POS_X = -29
START_RESOURCE_IRON_POS_Y = 16
START_RESOURCE_IRON_SIZE = 16
START_RESOURCE_URANIUM_POS_X = 17
START_RESOURCE_URANIUM_POS_Y = -34
START_RESOURCE_URANIUM_SIZE = 0 -- Disabled by default.
-- Specify 2 oil spot locations for starting oil.
START_RESOURCE_OIL_NUM_PATCHES = 2
-- The first patch
START_RESOURCE_OIL_POS_X = -39
START_RESOURCE_OIL_POS_Y = -2
-- How far each patch is offset from the others and in which direction
-- Default (x=0, y=-4) means that patches spawn in a vertical row downwards.
START_RESOURCE_OIL_X_OFFSET = 0
START_RESOURCE_OIL_Y_OFFSET = -4
-- Force the land area circle at the spawn to be fully grass
ENABLE_SPAWN_FORCE_GRASS = true
-- Set this to true for the spawn area to be surrounded by a circle of trees
SPAWN_TREE_CIRCLE_ENABLED = true
-- Set this to true for the spawn area to be surrounded by an octagon of trees
-- I don't recommend using this with moatsm
SPAWN_TREE_OCTAGON_ENABLED = true
---------------------------------------
-- Safe Spawn Area Options
---------------------------------------
-- Safe area has no aliens
-- +/- this in x and y direction
SAFE_AREA_TILE_DIST = CHUNK_SIZE*5
-- Warning area has reduced aliens
-- +/- this in x and y direction
WARNING_AREA_TILE_DIST = CHUNK_SIZE*10
-- 1 : X (spawners alive : spawners destroyed) in this area
WARN_AREA_REDUCTION_RATIO = 10
---------------------------------------
-- Other Forces/Teams Options
---------------------------------------
-- Separate teams
-- This allows you to join your own force/team. Everyone is still COOP/PvE, all
-- teams are friendly and cease-fire.
ENABLE_SEPARATE_TEAMS = true
-- Main force is what default players join
MAIN_FORCE = "Main Force"
-- Enable if people can spawn at the main base
-- THIS CURRENTLY IS BROKEN! YOU WILL NOT GET ANY RESOURCES IF YOU USE RSO!
ENABLE_DEFAULT_SPAWN = false -- DON'T USE THIS
-- Enable if people can allow others to join their base
ENABLE_SHARED_SPAWNS = true
MAX_ONLINE_PLAYERS_AT_SHARED_SPAWN = 0
-- Share local team chat with all teams
-- This makes it so you don't have to use /s
-- but it means you can't talk privately with your own team.
ENABLE_SHARED_TEAM_CHAT = true
---------------------------------------
-- Special Action Cooldowns
---------------------------------------
RESPAWN_COOLDOWN_IN_MINUTES = 15
RESPAWN_COOLDOWN_TICKS = TICKS_PER_MINUTE * RESPAWN_COOLDOWN_IN_MINUTES
-- Require playes to be online for at least 5 minutes
-- Else their character is removed and their spawn point is freed up for use
MIN_ONLINE_TIME_IN_MINUTES = 15
MIN_ONLINE_TIME = TICKS_PER_MINUTE * MIN_ONLINE_TIME_IN_MINUTES
--------------------------------------------------------------------------------
-- Alien Options
--------------------------------------------------------------------------------
-- Enable/Disable enemy expansion
ENEMY_EXPANSION = true
-- Divide the alien evolution factors by this number to reduce it (or multiply if < 1)
ENEMY_TIME_FACTOR_DISABLE = false -- Set this to true to disable time based evolution completely.
ENEMY_TIME_FACTOR_DIVISOR = 10
ENEMY_POLLUTION_FACTOR_DISABLE = false -- Set this to true to disable pollution based evolution completely.
ENEMY_POLLUTION_FACTOR_DIVISOR = 10
ENEMY_DESTROY_FACTOR_DISABLE = false -- Set this to true to disable spawner destruction based evolution completely.
ENEMY_DESTROY_FACTOR_DIVISOR = 1
--------------------------------------------------------------------------------
-- Frontier Rocket Silo Options
--------------------------------------------------------------------------------
-- Number of silos found in the wild.
-- These will spawn in a circle at given distance from the center of the map
-- If you set this number too high, you'll have a lot of delay at the start of the game.
SILO_NUM_SPAWNS = 3
-- How many chunks away from the center of the map should the silo be spawned
SILO_CHUNK_DISTANCE = 200
-- If this is enabled, you get ONE silo at the location specified below.
SILO_FIXED_POSITION = false
-- If you want to set a fixed spawn location for a single silo
SILO_POSITION = {x = 0, y = 100}
-- Set this to false so that you have to search for the silo's.
ENABLE_SILO_VISION = true
-- Add beacons around the silo (Philip's modm)
ENABLE_SILO_BEACONS = false
ENABLE_SILO_RADAR = false
--------------------------------------------------------------------------------
-- Long Reach Options
--------------------------------------------------------------------------------
BUILD_DIST_BONUS = 64
REACH_DIST_BONUS = BUILD_DIST_BONUS
RESOURCE_DIST_BONUS = 2
--------------------------------------------------------------------------------
-- Autofill Options
--------------------------------------------------------------------------------
AUTOFILL_TURRET_AMMO_QUANTITY = 10
--------------------------------------------------------------------------------
-- RSO Soft-Mod Configurations
-- Configure these to tweak the RSO values.
--------------------------------------------------------------------------------
-- CONFIGURE STUFF INSIDE rso_config.lua
-- RSO resources can be very lucky/unlucky...
-- don't complain if you can't find a resource.
--------------------------------------------------------------------------------
-- MAP CONFIGURATION OPTIONS
-- Configure these if you are running headless since there is no way to set
-- resources otherwise.
--------------------------------------------------------------------------------
-- Set this to true if you are creating the scenario at the cmd line.
CMD_LINE_MAP_GEN = true
-- Adjust settings here to set your map stuff.
-- "Sizes can be specified as none, very-low, low, normal, high, very-high"
global.clMapGen = {}
global.clMapGen.terrain_segmentation="normal"
global.clMapGen.water="normal"
global.clMapGen.starting_area="very-high"
global.clMapGen.peaceful_mode=false
global.clMapGen.seed=nil;
-- These are my go to default vanilla settings, it's not RSO, but it's okay.
global.clMapGen.autoplace_controls = {
-- Resources and enemies only matter if you are NOT using RSO.
["coal"]={frequency="normal", size= "normal", richness= "very-high"},
["copper-ore"]={frequency= "normal", size= "low", richness= "very-high"},
["crude-oil"]={frequency= "normal", size= "low", richness= "very-high"},
["enemy-base"]={frequency= "very-low", size= "low", richness= "normal"},
["iron-ore"]={frequency= "normal", size= "very-high", richness= "very-high"},
["stone"]={frequency= "normal", size= "normal", richness= "high"},
["uranium-ore"]={frequency= "normal", size= "normal", richness= "high"},
["desert"]={frequency= "low", size= "low", richness= "low"},
["dirt"]={frequency= "low", size= "low", richness= "low"},
["grass"]={frequency= "normal", size= "normal", richness= "normal"},
["sand"]={frequency= "low", size= "low", richness= "low"},
["trees"]={frequency= "low", size= "normal", richness= "normal"}
}
-- Cliff defaults are 10 and 10, set both to 0 to turn cliffs off I think?
global.clMapGen.cliff_settings={cliff_elevation_0=10, cliff_elevation_interval=10, name="cliff"}
--------------------------------------------------------------------------------
-- ANTI-Griefing stuff ( I don't personally maintain this as I don't care for it.)
-- These things were added from other people's requests/changes and are disabled by default.
--------------------------------------------------------------------------------
-- Enable this to disable some basic things like friendly fire, deconstructing from map view, etc.
ENABLE_ANTI_GRIEFING = false
-- Makes blueprint ghosts dissapear if they have been placed longer than this
GHOST_TIME_TO_LIVE = 0 * TICKS_PER_MINUTE -- set to 0 for infinite ghost life
-------------------------------------------------------------------------------
-- DEBUG / Custom stuff
--------------------------------------------------------------------------------
OARC_DIFFICULTY_CUSTOM = false
-- DEBUG prints for me
global.oarcDebugEnabled = false
-- These are my specific welcome messages that get used only if I am the user
-- that creates the game.
WELCOME_MSG_OARC = "Welcome to Oarc's official server! Join the discord here: discord.gg/TPYxRrS"
WELCOME_MSG_TITLE_OARC = "Welcome to Oarc's Server!"
|
return {
new = function(_, input)
local whole, areaCode, exchangeCode, subscriberNumber
= input:gsub("%D", ""):match("^1?((...)(...)(....))$")
local formatted = string.format("(%s) %s-%s", areaCode, exchangeCode, subscriberNumber)
return setmetatable({
number = whole or string.rep("0", 10),
areaCode = function() return areaCode end
},
{
__tostring = function() return formatted end,
}
)
end
}
|
-----------------------------------
-- Area: East Ronfaure [S]
-- NPC: qm4 "???"
-- Involved in Quests: Steamed Rams
-- !pos 541.425 -49.83 178.563
-----------------------------------
require("scripts/globals/keyitems")
local ID = require("scripts/zones/East_Ronfaure_[S]/IDs")
-----------------------------------
function onTrade(player, npc, trade)
end
function onTrigger(player, npc)
if (player:getQuestStatus(CRYSTAL_WAR, tpz.quest.id.crystalWar.STEAMED_RAMS) == QUEST_ACCEPTED) then
if (player:hasKeyItem(tpz.ki.PIECE_OF_SHATTERED_LUMBER)) then
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
else
player:startEvent(2)
end
else
player:messageSpecial(ID.text.NOTHING_OUT_OF_ORDINARY)
end
end
function onEventUpdate(player, csid, option)
end
function onEventFinish(player, csid, option)
-- print("CSID:", csid)
-- print("RESULT:", option)
if (csid == 2) then
player:addKeyItem(tpz.ki.PIECE_OF_SHATTERED_LUMBER)
player:messageSpecial(ID.text.KEYITEM_OBTAINED, tpz.ki.PIECE_OF_SHATTERED_LUMBER)
end
end
|
--[[
This file is part of halimede. It is subject to the licence terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/pallene/halimede/master/COPYRIGHT. No part of halimede, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
Copyright © 2015 The developers of halimede. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/pallene/halimede/master/COPYRIGHT.
]]--
local halimede = require('halimede')
local assert = halimede.assert
local sibling = halimede.io.shellScript
local type = halimede.type
local isNil = type.isNil
local isBoolean = type.isBoolean
local isString = type.isString
local isNumber = type.isNumber
local isPositiveInteger = type.isPositiveInteger
local hasPackageChildFieldOfTypeString = type.hasPackageChildFieldOfTypeString
local tabelize = halimede.table.tabelize
local unique = halimede.table.unique
local packageConfiguration = halimede.packageConfiguration
local getenv = halimede.getenv
local exception = halimede.exception
local isInstanceOf = halimede.type.isInstanceOf
local Path = halimede.io.paths.Path
local PathStyle = halimede.io.paths.PathStyle
local Relative = halimede.io.paths.PathRelativity.Relative
local ShellArgument = sibling.ShellArgument
local FileHandleStream = halimede.io.FileHandleStream
local ShellLanguage = halimede.moduleclass('ShellLanguage')
local executeFunction
if type.hasPackageChildFieldOfTypeFunctionOrCall('os', 'execute') then
executeFunction = os.execute
else
executeFunction = function(command)
assert.parameterTypeIsStringOrNil('command', command)
if command == nil then
return false
end
return nil, 'exit', 126
end
end
module.static.execute = executeFunction
module.static.shellIsAvailable = executeFunction() == true
-- other things returning (read) file handles are io.open(file) and io.tmpfile()
local validModes = {
'r',
'w'
}
local popenFunction
if type.hasPackageChildFieldOfTypeFunctionOrCall('io', 'popen') then
popenFunction = io.popen
else
popenFunction = function(command, mode)
assert.parameterTypeIsString('command', command)
assert.parameterTypeIsStringOrNil('mode', mode)
if mode ~= nil then
if validModes[mode] == nil then
return nil, "mode '" .. mode .. "' is not valid"
end
end
return nil, 'io.popen is not available'
end
end
local noRedirection = false
module.static.noRedirection = noRedirection -- Bizarre but works
module.static.standardIn = 0
module.static.standardOut = 1
module.static.standardError = 2
-- The reason we have a lower case and title case variant is that we avoid the need to use string:lower(), which depends on os.setlocale('all', 'C') to be deterministic, which isn't safe to use (we could be Lua code in a thread or embedded in an application that has already set setlocale())
function module:initialize(lowerCasedName, titleCasedName, pathStyle, newline, shellScriptFileExtensionExcludingLeadingPeriod, pathSeparator, silenced, searchesCurrentPath, commandInterpreterName)
assert.parameterTypeIsString('lowerCasedName', lowerCasedName)
assert.parameterTypeIsString('titleCasedName', titleCasedName)
assert.parameterTypeIsInstanceOf('pathStyle', pathStyle, PathStyle)
assert.parameterTypeIsString('newline', newline)
assert.parameterTypeIsStringOrNil('shellScriptFileExtensionExcludingLeadingPeriod', shellScriptFileExtensionExcludingLeadingPeriod)
assert.parameterTypeIsStringOrNil('pathSeparator', pathSeparator)
assert.parameterTypeIsString('silenced', silenced)
assert.parameterTypeIsBoolean('searchesCurrentPath', searchesCurrentPath)
assert.parameterTypeIsString('commandInterpreterName', commandInterpreterName)
self.lowerCasedName = lowerCasedName
self.titleCasedName = titleCasedName
self.pathStyle = pathStyle
self.newline = newline
self.shellScriptFileExtensionExcludingLeadingPeriod = shellScriptFileExtensionExcludingLeadingPeriod
self.pathSeparator = pathSeparator
self.silenced = silenced
self.searchesCurrentPath = searchesCurrentPath
self.commandInterpreterName = commandInterpreterName
self.binarySearchPathCached = nil
self:_initializeSpecialDirectory('parentPath', pathStyle.parentDirectory)
self:_initializeSpecialDirectory('currentPath', pathStyle.currentDirectory)
end
function module:appendShellScriptExtension(filePathWithoutFileExtension)
assert.parameterTypeIsTable('filePathWithoutFileExtension', filePathWithoutFileExtension)
return filePathWithoutFileExtension:appendFileExtension(self.shellScriptFileExtensionExcludingLeadingPeriod)
end
function module:executeCommandExpectingSuccess(standardIn, standardOut, standardError, ...)
local success, terminationKind, exitCode, command = self:executeCommand(standardIn, standardOut, standardError, ...)
if not success then
exception.throw("Could not execute shell command, returned exitCode '%s' for command (%s)", exitCode, command)
end
end
assert.globalTypeIsFunctionOrCall('unpack')
function module:_appendRedirectionsAndCreateCommandString(standardIn, standardOut, standardError, ...)
local arguments = tabelize({...})
if standardIn then
arguments:insert(self:redirectStandardInput(standardIn))
end
if standardOut then
arguments:insert(self:redirectStandardOutput(standardOut))
end
if standardError then
arguments:insert(self:redirectStandardError(standardError))
end
return self:_toShellCommandStringIncludingRedirections(unpack(arguments))
end
function module:executeCommand(standardIn, standardOut, standardError, ...)
local command = self:_appendRedirectionsAndCreateCommandString(standardIn, standardOut, standardError, ...)
-- Lua 5.1: returns an exit code
-- Lua 5.2 / 5.3: returns true or nil, string ('exit' or 'signal'), exit/signal code
local exitCodeOrBoolean, terminationKind, exitCode = executeFunction(command)
if isNil(exitCodeOrBoolean) then
return false, terminationKind, exitCode, command
elseif isBoolean(exitCodeOrBoolean) then
return exitCodeOrBoolean, terminationKind, exitCode, command
else
return exitCodeOrBoolean == 0, 'exit', exitCodeOrBoolean, command
end
end
function module:_popen(standardIn, standardOut, standardError, mode, ...)
assert.parameterTypeIsStringOrNil('mode', mode)
local command = self:_appendRedirectionsAndCreateCommandString(standardIn, standardOut, standardError, ...)
local fileHandle, errorMessage = popenFunction(command, mode)
if fileHandle == nil then
exception.throw("Could not popen shell because of error '%s' for command (%s)", errorMessage, command)
end
return FileHandleStream:new(fileHandle, 'popen (' .. command .. ')')
end
function module:popenReadingFromSubprocess(standardIn, standardError, ...)
return self:_popen(standardIn, noRedirection, standardError, 'r', ...)
end
function module:popenWritingToSubprocess(standardOut, standardError, ...)
return self:_popen(noRedirection, standardOut, standardError, 'w', ...)
end
-- NOTE: This approach is slow, as it opens the executable for reading
-- NOTE: This approach can not determine if a binary is +x (executable) or not
local openBinaryFileForReading = FileHandleStream.openBinaryFileForReading
assert.globalTypeIsFunctionOrCall('pcall')
function module:commandExistsAt(command, path)
assert.parameterTypeIsString('command', command)
assert.parameterTypeIsInstanceOf('path', path, Path)
path:assertIsFolderPath('path')
self:_guardCommandIsValid(command)
local function callback(binaryFileExtensionOrNil)
local pathToBinary = path:appendFile(command, binaryFileExtensionOrNil)
local ok, fileHandleStreamOrError = pcall(openBinaryFileForReading, pathToBinary, command)
if ok then
fileHandleStreamOrError:close()
return true, pathToBinary
end
return false, nil
end
local ok, pathToBinary = self:iterateOverBinaryFileExtensions(callback)
if ok then
return ok, pathToBinary
end
return false, nil
end
assert.globalTypeIsFunctionOrCall('ipairs')
function module:commandIsOnPath(command)
for _, path in ipairs(self:binarySearchPath()) do
local ok, pathToBinary = self:commandExistsAt(command, path)
if ok then
return ok, pathToBinary
end
end
return false, nil
end
function module:_guardCommandIsValid(command)
if self.pathStyle:isReservedPathElement(command) then
exception.throw("%s shell script commands such as '%s' are not valid", self.titleCasedName, command)
end
end
function module:iterateOverBinaryFileExtensions(callback)
assert.parameterTypeIsFunctionOrCall('callback', callback)
return self:_iterateOverBinaryFileExtensions(callback)
end
function module:_iterateOverBinaryFileExtensions(callback)
exception.throw('Abstract Method')
end
function module:commandIsOnPathAndShellIsAvailableToUseIt(command)
assert.parameterTypeIsString('command', command)
module:_guardCommandIsValid(command)
if ShellLanguage.shellIsAvailable then
return self:commandIsOnPath(command)
else
return false
end
end
function module:escapeToPathsStringShellArgument(paths, specifyCurrentDirectoryExplicitlyIfAppropriate)
assert.parameterTypeIsTable('paths', paths) -- shell paths
assert.parameterTypeIsBoolean('specifyCurrentDirectoryExplicitlyIfAppropriate', specifyCurrentDirectoryExplicitlyIfAppropriate)
local result = tabelize()
local uniquePaths = unique(paths)
for _, path in ipairs(uniquePaths) do
path:escapeToShellArgument(specifyCurrentDirectoryExplicitlyIfAppropriate, self):insertValue(result)
end
return ShellArgument:new(result:concat(self.pathSeparator))
end
function module:escapeToShellSafeString(argument)
if isString(argument) then
return self:_escapeToShellSafeString(argument)
end
assert.parameterTypeIsInstanceOf('argument', argument, ShellArgument)
return argument.argument
end
function module:quoteEnvironmentVariable(argument)
assert.parameterTypeIsString('argument', argument)
return self:_quoteEnvironmentVariable(argument)
end
function module:_escapeToShellSafeString(argument)
exception.throw('Abstract Method')
end
function module:_quoteEnvironmentVariable(argument)
exception.throw('Abstract Method')
end
function module:_redirect(fileDescriptor, filePathOrFileDescriptor, symbol)
local redirection
if isPositiveInteger(filePathOrFileDescriptor) then
redirection = '&' .. filePathOrFileDescriptor
elseif isString(filePathOrFileDescriptor) then
redirection = self:escapeToShellSafeString(filePathOrFileDescriptor)
elseif isInstanceOf(filePathOrFileDescriptor, ShellArgument) then
redirection = filePathOrFileDescriptor.argument
else
exception.throw("filePathOrFileDescriptor must be a positive integer (or zero), string or ShellArgument")
end
return ShellArgument:new(fileDescriptor .. symbol .. redirection)
end
function module:redirectInput(fileDescriptor, filePathOrFileDescriptor)
assert.parameterTypeIsPositiveInteger('fileDescriptor', fileDescriptor)
return self:_redirect(fileDescriptor, filePathOrFileDescriptor, '<')
end
function module:redirectOutput(fileDescriptor, filePathOrFileDescriptor)
assert.parameterTypeIsPositiveInteger('fileDescriptor', fileDescriptor)
return self:_redirect(fileDescriptor, filePathOrFileDescriptor, '>')
end
function module:appendOutput(fileDescriptor, filePathOrFileDescriptor)
assert.parameterTypeIsPositiveInteger('fileDescriptor', fileDescriptor)
return self:_redirect(fileDescriptor, filePathOrFileDescriptor, '>>')
end
function module:redirectStandardInput(filePathOrFileDescriptor)
return self:redirectInput(ShellLanguage.standardIn, filePathOrFileDescriptor)
end
function module:redirectStandardOutput(filePathOrFileDescriptor)
return self:redirectOutput(ShellLanguage.standardOut, filePathOrFileDescriptor)
end
function module:redirectStandardError(filePathOrFileDescriptor)
return self:redirectOutput(ShellLanguage.standardError, filePathOrFileDescriptor)
end
function module:appendStandardOutput(filePathOrFileDescriptor)
return self:appendOutput(ShellLanguage.standardOut, filePathOrFileDescriptor)
end
function module:appendStandardError(filePathOrFileDescriptor)
return self:appendOutput(ShellLanguage.standardError, filePathOrFileDescriptor)
end
assert.globalTypeIsFunctionOrCall('ipairs')
function module:_toShellCommandStringIncludingRedirections(...)
local arguments = {...}
local commandBuffer = tabelize()
for _, argument in ipairs(arguments) do
if argument ~= nil then
local escapedArgumentStringValue
if isPositiveInteger(argument) then
escapedArgumentStringValue = '' .. argument
elseif isString(argument) then
escapedArgumentStringValue = self:escapeToShellSafeString(argument)
elseif isInstanceOf(argument, ShellArgument) then
escapedArgumentStringValue = argument.argument
else
exception.throw("argument must be nil (in which case it is ignored), a positive integer (including zero), string or ShellArgument")
end
commandBuffer:insert(escapedArgumentStringValue)
end
end
return commandBuffer:concat(' ')
end
function module:appendCommandLineToScript(tabelizedScriptBuffer, ...)
assert.parameterTypeIsTable('tabelizedScriptBuffer', tabelizedScriptBuffer)
local commandString = self:_toShellCommandStringIncludingRedirections(...)
tabelizedScriptBuffer:insert(self:terminateShellCommandString(commandString))
self:_appendCommandLineToScript_applyChecksForNonZeroExitCode(tabelizedScriptBuffer)
end
function module:_appendCommandLineToScript_applyChecksForNonZeroExitCode(tabelizedScriptBuffer)
exception.throw('Abstract Method')
end
function module:terminateShellCommandString(commandString)
assert.parameterTypeIsString('commandString', commandString)
return commandString .. self.newline
end
function module:parentPaths(count)
assert.parameterTypeIsNumberOrNil('count', count)
if count == nil then
return self.parentPath
end
assert.parameterTypeIsPositiveInteger('count', count)
if count == 0 then
exception.throw("Parameter 'count' can not be zero")
end
local parentPath = self.parentPath
local remaining = count
while remaining > 1
do
parentPath = parentPath:appendRelativePath(self.parentPath)
remaining = remaining - 1
end
return parentPath
end
function module:parsePath(pathString, isFile)
assert.parameterTypeIsString('pathString', pathString)
assert.parameterTypeIsBoolean('isFile', isFile)
return self.pathStyle:parse(pathString, isFile)
end
function module:_initializeSpecialDirectory(name, value)
if value and not value:isEmpty() then
self[name] = self:relativeFolderPath(value)
else
self[name] = nil
end
end
function module:relativeFolderPath(...)
return Path:new(self.pathStyle, Relative, nil, {...}, false, nil)
end
function module:relativeFilePath(...)
return Path:new(self.pathStyle, Relative, nil, {...}, true, nil)
end
function module:appendFileExtension(fileName, fileExtension)
assert.parameterTypeIsString('fileName', fileName)
assert.parameterTypeIsStringOrNil('fileExtension', fileExtension)
return self.pathStyle:appendFileExtension(fileName, fileExtension)
end
assert.globalTypeIsFunctionOrCall('ipairs', 'pcall')
assert.globalTableHasChieldFieldOfTypeFunctionOrCall('string', 'split', 'isEmpty')
function module:uniqueValidPathsFromEnvironmentVariable(environmentVariableName, isFilePath, prependCurrentDirectory)
assert.parameterTypeIsString('environmentVariableName', environmentVariableName)
assert.parameterTypeIsBoolean('isFilePath', isFilePath)
assert.parameterTypeIsBoolean('prependCurrentDirectory', prependCurrentDirectory)
local paths = tabelize()
local stringPaths = getenv(environmentVariableName)
if stringPaths == nil or stringPaths:isEmpty() then
return paths
end
local function parse(potentialPath)
return self.pathStyle:parse(potentialPath, isFilePath)
end
if self.searchesCurrentPath then
paths:insert(self.currentPath)
end
local potentialPaths = stringPaths:split(self.pathSeparator)
for _, potentialPath in ipairs(potentialPaths) do
if not potentialPath:isEmpty() then
local ok, path = pcall(parse, potentialPath)
if ok then
paths:insert(path)
end
end
end
return unique(paths)
end
assert.globalTableHasChieldFieldOfTypeFunctionOrCall('string', 'split')
function module:binarySearchPath()
if self.binarySearchPathCached == nil then
self.binarySearchPathCached = self:uniqueValidPathsFromEnvironmentVariable('PATH', false, self.searchesCurrentPath)
end
return self.binarySearchPathCached
end
local PosixShellLanguage = halimede.class('PosixShellLanguage', ShellLanguage)
-- We really should look at trying to obtain '$SHELL' for commandInterpeterName / Path
function PosixShellLanguage:initialize()
ShellLanguage.initialize(self, 'posix', 'Posix', PathStyle.Posix, '\n', nil, ':', '/dev/null', false, 'sh')
end
assert.globalTableHasChieldFieldOfTypeFunctionOrCall('string', 'find', 'gsub')
function PosixShellLanguage:_escapeToShellSafeString(argument)
if argument:find('\0') ~= nil then
exception.throw("POSIX shell script arguments can not contain ASCII NUL (0x00)")
end
return "'" .. argument:gsub("'", "'\\''") .. "'"
end
function PosixShellLanguage:_quoteEnvironmentVariable(argument)
return '"${' .. argument .. '}"'
end
function PosixShellLanguage:_appendCommandLineToScript_applyChecksForNonZeroExitCode(tabelizedScriptBuffer)
end
function PosixShellLanguage:_iterateOverBinaryFileExtensions(callback)
return callback(nil)
end
ShellLanguage.static.Posix = PosixShellLanguage:new()
local CmdShellLanguage = halimede.class('CmdShellLanguage', ShellLanguage)
-- We really should look at trying to obtain '%COMSPEC%' for commandInterpeterName / Path
function CmdShellLanguage:initialize()
ShellLanguage.initialize(self, 'cmd', 'Cmd', PathStyle.Cmd, '\r\n', 'cmd', ';', 'NUL', true, 'CMD')
self.binaryFileExtensionsCached = nil
self.nonZeroExitChecksCommandStringLine = self:terminateShellCommandString('IF %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%')
end
local slash = '\\'
local cmdCharactersToEscape = {
['%'] = '%%',
['"'] = '\\"',
}
assert.globalTableHasChieldFieldOfTypeFunctionOrCall('string', 'rep')
local function cmdEscaperA(capture1, capture2)
return slash:rep(2 * #capture1 - 1) .. (capture2 or slash)
end
local function cmdEscaperB(value)
return value .. value .. '"%"'
end
-- Quoting is a mess in Cmd; these rules only work for cmd.exe /C (it's a per-program thing)
assert.globalTableHasChieldFieldOfTypeFunctionOrCall('string', 'match', 'gsub')
function CmdShellLanguage:_escapeToShellSafeString(argument)
-- Quote a DIR including any drive or UNC letters, replacing any POSIX-isms
if argument:match('^[%.a-zA-Z]?:?[\\/]') then
argument = argument:gsub('/', slash)
end
-- Special handling for CHDIR with \
if argument == slash then
return argument
end
-- Quoting for URLs
argument = argument:gsub('(\\+)(")', cmdEscaperA)
argument = argument:gsub('(\\+)$', cmdEscaperA)
argument = argument:gsub('[%%"]', cmdCharactersToEscape)
argument = argument:gsub('(\\*)%%', cmdEscaperB)
return '"' .. argument .. '"'
end
function CmdShellLanguage:_quoteEnvironmentVariable(argument)
return '"%' .. argument .. '%"'
end
-- http://lua-users.org/lists/lua-l/2013-11/msg00367.html
function CmdShellLanguage:_toShellCommandStringIncludingRedirections(...)
return 'type NUL && ' .. ShellLanguage._toShellCommandStringIncludingRedirections(self, ...)
end
function CmdShellLanguage:_appendCommandLineToScript_applyChecksForNonZeroExitCode(tabelizedScriptBuffer)
tabelizedScriptBuffer:insert(self.nonZeroExitChecksCommandStringLine)
end
local DefaultPathExt = ".com; .exe; .bat; .cmd"
CmdShellLanguage.static.DefaultPathExt = DefaultPathExt
assert.globalTypeIsFunctionOrCall('ipairs')
assert.globalTableHasChieldFieldOfTypeFunctionOrCall('string', 'gsub', 'split')
function CmdShellLanguage:_iterateOverBinaryFileExtensions(callback)
if self.binaryFileExtensionsCached == nil then
local pathExt = getenv('PATHEXT')
if pathExt == nil then
pathExt = DefaultPathExt
end
-- There may be whitespace (eg '; ')
self.binaryFileExtensionsCached = pathExt:gsub(';[ ]+', ';'):split(';')
end
for _, binaryFileExtension in ipairs(self.binaryFileExtensionsCached) do
local ok, result = callback(binaryFileExtension)
if ok then
return true, result
end
end
return false, nil
end
ShellLanguage.static.Cmd = CmdShellLanguage:new()
-- Windows, Linux, OSX, BSD, POSIX, Other (not supported)
local operatingSystemNamesToShellLanguages = {
Windows = ShellLanguage.Cmd,
Linux = ShellLanguage.Posix,
OSX = ShellLanguage.Posix,
BSD = ShellLanguage.Posix,
POSIX = ShellLanguage.Posix
}
local cachedDefault = false
assert.globalTypeIsFunctionOrCall('pcall')
ShellLanguage.static.default = function()
if cachedDefault ~= false then
return cachedDefault
end
local function determineDefault()
if type.hasFfi() then
local ffi = require('ffi')
local name = ffi.os
if name ~= nil then
local shellLanguage = operatingSystemNamesToShellLanguages[name]
if shellLanguage ~= nil then
return shellLanguage
end
end
end
-- Not the best test; doesn't work for Symbian (which doesn't have a shell), can't distinguish OpenVms from RISC OS
-- Running uname on the PATH works on POSIX systems, as does ver on Windows (which is a builtin of cmd)... and the shell isn't available on Unikernels like RumpKernel
local folderSeparator = packageConfiguration.folderSeparator
if folderSeparator == '/' then
return ShellLanguage.Posix
elseif folderSeparator == '\\' then
-- Might be Symbian, too, but that's dead
return ShellLanguage.Cmd
elseif folderSeparator == '.' then
-- Could be OpenVMS, Could be Risc OS
local ok, result = pcall(require, 'riscos')
if ok then
exception.throw("RISC OS (RiscLua) is not yet supported")
end
exception.throw("OpenVMS is not yet supported")
else
exception.throw("Could not determine ShellLanguage using packageConfiguration folderSeparator '%s'", folderSeparator)
end
end
cachedDefault = determineDefault()
return cachedDefault
end
|
package.path = "src/?.lua;"..package.path
local mgl = require("MGL")
|
--- Armour is the @{Entity} definition for an armour object.
-- Only Armour entities can be equipped in a character's armour slot.
--
-- Subclass of @{Collectable}.
-- @entity Armour
|
meta.name = "Poison Run"
meta.version = "1.1"
meta.description = "You're always poisoned. Can you survive?"
meta.author = "garebear"
register_option_int(
"poison_ticks",
"Number of game ticks until you're damaged from poison.",
1800,
0,
18000
)
DEBUG = false
function debug(msg)
if DEBUG then
message(tostring(msg))
end
end
function clear_poison()
for i, player in ipairs(players) do
if player.health ~= 0 and player:is_poisoned() then
debug("Clearing poison on player " .. tostring(i))
player:poison(-1)
end
end
end
function set_poison()
for i, player in ipairs(players) do
if player.health ~= 0 and not player:is_poisoned() then
debug("Setting poison on player " .. tostring(i))
player:poison(options.poison_ticks)
end
end
end
function increment_health()
for i, player in ipairs(players) do
if player.health ~= 0 then
debug("Giving health to player " .. tostring(i))
player.health = player.health + 1
end
end
end
function pets_saved()
saved = state.saved_dogs + state.saved_cats + state.saved_hamsters
debug("Pets saved: " .. tostring(saved))
return saved
end
LAST_PETS_SAVED = 0
set_callback(function()
debug("Starting new run")
LAST_PETS_SAVED = 0
end, ON.START)
set_callback(function()
current_saved = pets_saved()
if current_saved > LAST_PETS_SAVED then
increment_health()
end
LAST_PETS_SAVED = current_saved
end, ON.TRANSITION)
set_callback(function()
clear_poison()
end, ON.LEVEL)
set_callback(function()
set_poison()
end, ON.FRAME)
|
describe("test LuaPatch api return value", function ()
-- body
local luapatch = require("luapatch")
local TestCallSelectorArgument = luapatch.packClass("TestCallSelectorArgument")
it("test makeOCStruct", function()
local ret = luapatch.makeOCStruct("CGRect",1,2,3,4)
assert.truthy(ret)
print("CGRect in test makeOCStruct")
assert.equal(luapatch.convertCGRectToStr(ret),"1.000000,2.000000,3.000000,4.000000")
local rect = ret
ret = luapatch.makeOCStruct("CGPoint",1,2)
assert.truthy(ret)
print("CGPoint in test makeOCStruct")
assert.equal(luapatch.convertCGPointToStr(ret),"1.000000,2.000000")
local point = ret
ret = luapatch.makeOCStruct("CGSize",1,2)
assert.truthy(ret)
print("CGSize in test makeOCStruct")
assert.equal(luapatch.convertCGSizeToStr(ret),"1.000000,2.000000")
local size = ret
ret = luapatch.makeOCStruct("NSRange",1,2)
assert.truthy(ret)
print("NSRange in test makeOCStruct")
assert.equal(luapatch.convertNSRangeToStr(ret),"1,2")
local range = ret
--测试是否能在oc中正确接收到
TestCallSelectorArgument.checkOCStructWithRect_Point_Size_Range(rect,point,size,range)
end)
end)
|
-- =====================================================
-- Imports
-- =====================================================
local Objects = require( "dmc_objects" )
--====================================================================--
-- Setup, Constants
--====================================================================--
-- setup some aliases to make code cleaner
local inheritsFrom = Objects.inheritsFrom
local CoronaBase = Objects.CoronaBase
-- =====================================================
-- Crate Base Class
-- =====================================================
local CrateBase = inheritsFrom( CoronaBase )
CrateBase.IMAGE_SRC = nil
--== Start: Setup DMC Objects
-- do basic object init()
function CrateBase:_init()
self:superCall( "_init" )
--==--
--== Create Properties ==--
self.density = nil
self.friction = nil
self.bounce = nil
end
-- reverse init() setup
function CrateBase:_undoInit()
self.density = nil
self.friction = nil
self.bounce = nil
--==--
self:superCall( "_undoInit" )
end
-- create basic object view
function CrateBase:_createView()
self:superCall( "_createView" )
--==--
local o -- object tmp
o = display.newImage( self.IMAGE_SRC )
--self:insert( o )
--self:setReferencePoint(display.CenterReferencePoint)
-- here we use our image for our view instead of default display group
-- physics works better this way
self:_setView( o )
end
--[[
if our setup was more complex than just Corona elements,
we could specifically tear down the object's view here.
however, dmc_objects will automatically remove pure-Corona elements automatically
function Shape:_undoCreateView()
--==--
self:superCall( "_undoCreateView" )
end
--]]
--== END: Setup DMC Objects
--== Public Methods
function CrateBase:getPhysicsProps()
return {
density = self.density,
friction = self.friction,
bounce = self.bounce,
}
end
--== Private Methods
-- none
-- =====================================================
-- LARGE CRATE CLASS
-- =====================================================
local LargeCrate = inheritsFrom( CrateBase )
LargeCrate.IMAGE_SRC = "assets/crateB.png"
function LargeCrate:_init()
self:superCall( "_init" )
--==--
--== Create Properties ==--
self.density = 1.4
self.friction = 0.3
self.bounce = 0.3
end
-- =====================================================
-- MEDIUM CRATE CLASS
-- =====================================================
local MediumCrate = inheritsFrom( CrateBase )
MediumCrate.IMAGE_SRC = "assets/crate.png"
function MediumCrate:_init()
self:superCall( "_init" )
--==--
--== Create Properties ==--
self.density = 0.9
self.friction = 0.3
self.bounce = 0.3
end
-- =====================================================
-- SMALL CRATE CLASS
-- =====================================================
local SmallCrate = inheritsFrom( CrateBase )
SmallCrate.IMAGE_SRC = "assets/crateC.png"
function SmallCrate:_init()
self:superCall( "_init" )
--==--
--== Create Properties ==--
self.density = 0.3
self.friction = 0.2
self.bounce = 0.5
end
-- =====================================================
-- CRATE FACTORY
-- =====================================================
local function selectRandomCrate()
local rand = math.random( 100 )
local crateType = ""
if rand < 60 then
crateType = "medium"
elseif rand < 80 then
crateType = "large"
else
crateType = "small"
end
return crateType
end
local CrateFactory = {}
CrateFactory.create = function( crateType )
local crateType = crateType or selectRandomCrate()
local crate
if crateType == "small" then
crate = SmallCrate:new()
elseif crateType == "medium" then
crate = MediumCrate:new()
elseif crateType == "large" then
crate = LargeCrate:new()
end
return crate
end
return CrateFactory
|
FACTION.name = "Admin On Duty"
FACTION.description = "Aberration Networks Administration On Duty."
FACTION.color = Color(0, 255, 255, 255)
FACTION.isDefault = false
FACTION.isGloballyRecognized = true
FACTION_ADMIN = FACTION.index
|
local _PACKAGE = (...):match("^(.+)[%./][^%./]+") or ""
local util = require(_PACKAGE .. "/util")
local dep = require(_PACKAGE .. "/dep")
local Vector = dep.Vector
local Menu = require(_PACKAGE .. "/menu")
local TimedUpdateManager = require(_PACKAGE .. "/timed_update_manager")
local Button = require(_PACKAGE .. "/button")
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
local DropDown = Button:extend()
DropDown.classname = "DropDown"
function DropDown:new(args)
Button.new(self, args)
self.value = args.value or ""
assert(args.menu, "maupassant ERROR: must supply a menu object to dropdown (" .. self.name ..")")
self:createMenu(args.menu)
self.canvas = love.graphics.newCanvas(self.menu.size.x, self.menu.size.y)
self.onSelectItem = args.onSelectItem
end
function DropDown:createMenu(args_menu)
self.menu = args_menu -- you need to supply this yourself
self:addChild(self.menu)
self.menu:setVisible(false)
self.menu.onSelectItem = function(index, item)
self:setText(item)
if self.onSelectItem then self.onSelectItem(index, item) end
end
self.menu:move(self.pos.x, self.pos.y + self.size.y)
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function DropDown:setValue(value)
self:setText(value)
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function DropDown:updateSize()
Button.updateSize(self)
self.canvas = love.graphics.newCanvas(self.menu.size.x, self.menu.size.y)
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
function DropDown:pressed(button, x, y)
self:setState("pressed")
self.menu:setVisible(true)
end
function DropDown:releasedAnywhere()
-- do nothing
end
function DropDown:mouseleft()
-- do nothing
end
function DropDown:onLoseFocus()
self:setState("unpressed")
self.menu:setVisible(false)
end
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
return DropDown
|
return function(a, b, alpha)
return (1 - alpha) * a + b * alpha
end
|
--[[
file:slotsAlgor.lua
desc:slots算法
auth:Caorl Luo
]]
local class = require("class")
local gameAlgor = require("game.algor")
---@class slotsAlgor:gameAlgor
local algor = class(gameAlgor)
local this = algor
---构造
function algor:ctor()
end
---普通图标轴概率
---@param nWgt slots_weight @普通图标轴权重
---@param wWgt slots_weight @wild图标轴权重
---@param fWgt slots_weight @免费图标轴权重
---@param sWgt slots_weight @轴总图标轴权重
---@param fPro slots_axlepro @免费图标轴概率
---@return slots_axlepro @轴概率
function algor.normatAxlePro(nWgt,wWgt,fWgt,sWgt,fPro)
---@type slots_weight @总权重-免费图标权重
local snwgt = sWgt - sWgt
return (nWgt+wWgt)/snwgt*(1-(fPro/3))
end
---wild图标轴概率
---@param wWgt slots_weight @wild图标轴权重
---@param sWgt slots_weight @轴总图标轴权重
---@param fPro slots_axlepro @免费图标轴概率
---@return slots_axlepro @轴概率
function algor.wildAxlePro(wWgt,sWgt,fPro)
---@type slots_weight @总权重-免费图标权重
local snwgt = sWgt - sWgt
return wWgt/snwgt*(1-(fPro/3))
end
---scatter图标轴概率
---@param fWgt slots_weight @免费图标轴权重
---@param sWgt slots_weight @所有图标轴权重
function algor.scatterAxlePro(fWgt,sWgt)
local x = fWgt/sWgt
return x+(1-x)*x+(1-x-(1-x)*x)*x
end
return algor
|
--[[
LuaJIT-Request
Lucien Greathouse
Wrapper for LuaJIT-cURL for easy HTTP(S) requests.
Copyright (c) 2016 Lucien Greathouse
This software is provided 'as-is', without any express
or implied warranty. In no event will the authors be held
liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, andto alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
]]
local path = (...):gsub("%/init$", ""):match("%.?(.-)$") .. "."
local ffi = require("ffi")
local curl = require(path .. "luajit-curl")
local request
local function url_encode(str)
if (str) then
str = str:gsub("\n", "\r\n")
str = str:gsub("([^%w %-%_%.%~])", function(c)
return string.format ("%%%02X", string.byte(c))
end)
str = str:gsub(" ", "%%20")
end
return str
end
local function cookie_encode(str, name)
str = str:gsub("[,;%s]", "")
if (name) then
str = str:gsub("=", "")
end
return str
end
local auth_map = {
BASIC = ffi.cast("long", curl.CURLAUTH_BASIC),
DIGEST = ffi.cast("long", curl.CURLAUTH_DIGEST),
NEGOTIATE = ffi.cast("long", curl.CURLAUTH_NEGOTIATE)
}
local errors = {
unknown = 0,
timeout = 1,
connect = 2,
resolve_host = 3
}
local code_map = {
[curl.CURLE_OPERATION_TIMEDOUT] = {
errors.timeout, "Connection timed out"
},
[curl.CURLE_COULDNT_RESOLVE_HOST] = {
errors.resolve_host, "Couldn't resolve host"
},
[curl.CURLE_COULDNT_CONNECT] = {
errors.connect, "Couldn't connect to host"
}
}
request = {
error = errors,
version = "2.4.0",
version_major = 2,
version_minor = 4,
version_patch = 0,
--[[
Send an HTTP(S) request to the URL at 'url' using the HTTP method 'method'.
Use the 'args' parameter to optionally configure the request:
- method: HTTP method to use. Defaults to "GET", but can be any HTTP verb like "POST" or "PUT"
- headers: Dictionary of additional HTTP headers to send with request
- data: Dictionary or string to send as request body
- cookies: Dictionary table of cookies to send
- timeout: How long to wait for the connection to be made before giving up
- allow_redirects: Whether or not to allow redirection. Defaults to true
- body_stream_callback: A method to call with each piece of the response body.
- header_stream_callback: A method to call with each piece of the resulting header.
- transfer_info_callback: A method to call with transfer progress data.
- auth_type: Authentication method to use. Defaults to "none", but can also be "basic", "digest" or "negotiate"
- username: A username to use with authentication. 'auth_type' must also be specified.
- password: A password to use with authentication. 'auth_type' must also be specified.
- files: A dictionary of file names to their paths on disk to upload via stream.
If both body_stream_callback and header_stream_callback are defined, a boolean true will be returned instead of the following object.
The return object is a dictionary with the following members:
- code: The HTTP status code the response gave. Will not exist if header_stream_callback is defined above.
- body: The body of the response. Will not exist if body_stream_callback is defined above.
- headers: A dictionary of headers and their values. Will not exist if header_stream_callback is defined above.
- headers_raw: A raw string containing the actual headers the server sent back. Will not exist if header_stream_callback is defined above.
- set_cookies: A dictionary of cookies given by the "Set-Cookie" header from the server. Will not exist if the server did not set any cookies.
If an error occured, false will be returned along with a curl error code and a message.
]]
send = function(url, args)
local handle = curl.curl_easy_init()
local header_chunk
local out_buffer
local headers_buffer
args = args or {}
local callbacks = {}
local gc_handles = {}
curl.curl_easy_setopt(handle, curl.CURLOPT_URL, url)
curl.curl_easy_setopt(handle, curl.CURLOPT_SSL_VERIFYPEER, 1)
curl.curl_easy_setopt(handle, curl.CURLOPT_SSL_VERIFYHOST, 2)
if (args.data and type(args.data) ~= "table") then
local default_content_type = "application/octet-stream"
if (not args.headers) then
args.headers = {
["content-type"] = default_content_type
}
else
local has_content_type = false
for header_name, _ in pairs(args.headers) do
if header_name:lower() == "content-type" then
has_content_type = true
break
end
end
if not has_content_type then
args.headers["content-type"] = default_content_type
end
end
end
if (args.method) then
local method = string.upper(tostring(args.method))
if (method == "GET") then
curl.curl_easy_setopt(handle, curl.CURLOPT_HTTPGET, 1)
elseif (method == "POST") then
curl.curl_easy_setopt(handle, curl.CURLOPT_POST, 1)
args.data = args.data or "" -- https://github.com/curl/curl/issues/1625#issuecomment-312456910
else
curl.curl_easy_setopt(handle, curl.CURLOPT_CUSTOMREQUEST, method)
end
end
if (args.headers) then
for key, value in pairs(args.headers) do
header_chunk = curl.curl_slist_append(header_chunk, tostring(key) .. ":" .. tostring(value))
end
curl.curl_easy_setopt(handle, curl.CURLOPT_HTTPHEADER, header_chunk)
end
if (args.auth_type) then
local auth = string.upper(tostring(args.auth_type))
if (auth_map[auth]) then
curl.curl_easy_setopt(handle, curl.CURLOPT_HTTPAUTH, auth_map[auth])
curl.curl_easy_setopt(handle, curl.CURLOPT_USERNAME, tostring(args.username))
curl.curl_easy_setopt(handle, curl.CURLOPT_PASSWORD, tostring(args.password or ""))
elseif (auth ~= "NONE") then
error("Unsupported authentication type '" .. auth .. "'")
end
end
if (args.body_stream_callback) then
local callback = ffi.cast("curl_callback", function(data, size, nmeb, user)
args.body_stream_callback(ffi.string(data, size * nmeb))
return size * nmeb
end)
table.insert(callbacks, callback)
curl.curl_easy_setopt(handle, curl.CURLOPT_WRITEFUNCTION, callback)
else
out_buffer = {}
local callback = ffi.cast("curl_callback", function(data, size, nmeb, user)
table.insert(out_buffer, ffi.string(data, size * nmeb))
return size * nmeb
end)
table.insert(callbacks, callback)
curl.curl_easy_setopt(handle, curl.CURLOPT_WRITEFUNCTION, callback)
end
if (args.header_stream_callback) then
local callback = ffi.cast("curl_callback", function(data, size, nmeb, user)
args.header_stream_callback(ffi.string(data, size * nmeb))
return size * nmeb
end)
table.insert(callbacks, callback)
curl.curl_easy_setopt(handle, curl.CURLOPT_HEADERFUNCTION, callback)
else
headers_buffer = {}
local callback = ffi.cast("curl_callback", function(data, size, nmeb, user)
table.insert(headers_buffer, ffi.string(data, size * nmeb))
return size * nmeb
end)
table.insert(callbacks, callback)
curl.curl_easy_setopt(handle, curl.CURLOPT_HEADERFUNCTION, callback)
end
if (args.transfer_info_callback) then
local callback = ffi.cast("curl_xferinfo_callback", function(client, dltotal, dlnow, ultotal, ulnow)
args.transfer_info_callback(tonumber(dltotal), tonumber(dlnow), tonumber(ultotal), tonumber(ulnow))
return 0
end)
table.insert(callbacks, callback)
curl.curl_easy_setopt(handle, curl.CURLOPT_NOPROGRESS, 0)
curl.curl_easy_setopt(handle, curl.CURLOPT_XFERINFOFUNCTION, callback)
end
if (args.follow_redirects == nil) then
curl.curl_easy_setopt(handle, curl.CURLOPT_FOLLOWLOCATION, true)
else
curl.curl_easy_setopt(handle, curl.CURLOPT_FOLLOWLOCATION, not not args.follow_redirects)
end
if (args.data) then
if (type(args.data) == "table") then
local buffer = {}
for key, value in pairs(args.data) do
table.insert(buffer, ("%s=%s"):format(url_encode(key), url_encode(value)))
end
curl.curl_easy_setopt(handle, curl.CURLOPT_POSTFIELDS, table.concat(buffer, "&"))
else
curl.curl_easy_setopt(handle, curl.CURLOPT_POSTFIELDS, tostring(args.data))
end
end
local post
if (args.files) then
post = ffi.new("struct curl_httppost*[1]")
local lastptr = ffi.new("struct curl_httppost*[1]")
for key, value in pairs(args.files) do
local file = ffi.new("char[?]", #value, value)
table.insert(gc_handles, file)
local res = curl.curl_formadd(
post, lastptr,
ffi.new("int", curl.CURLFORM_COPYNAME), key,
ffi.new("int", curl.CURLFORM_FILE), file,
ffi.new("int", curl.CURLFORM_END)
)
end
curl.curl_easy_setopt(handle, curl.CURLOPT_HTTPPOST, post[0])
end
-- Enable the cookie engine
curl.curl_easy_setopt(handle, curl.CURLOPT_COOKIEFILE, "")
if (args.cookies) then
local cookie_out
if (type(args.cookies) == "table") then
local buffer = {}
for key, value in pairs(args.cookies) do
table.insert(buffer, ("%s=%s"):format(cookie_encode(key, true), cookie_encode(value)))
end
cookie_out = table.concat(buffer, "; ")
else
cookie_out = tostring(args.cookies)
end
curl.curl_easy_setopt(handle, curl.CURLOPT_COOKIE, cookie_out)
end
if (tonumber(args.timeout)) then
curl.curl_easy_setopt(handle, curl.CURLOPT_CONNECTTIMEOUT, tonumber(args.timeout))
end
local code = curl.curl_easy_perform(handle)
if (code ~= curl.CURLE_OK) then
local num = tonumber(code)
if (code_map[num]) then
return false, code_map[num][1], code_map[num][2]
end
return false, request.error.unknown, "Unknown error", num
end
local out
if (out_buffer or headers_buffer) then
local headers, status, parsed_headers, raw_cookies, set_cookies
if (headers_buffer) then
-- In case we got multiple responses (e.g. 100 - Continue or 302 Redirects)
-- we want to only return the last response
local start_index = 1
for i, resp_line in ipairs(headers_buffer) do
if resp_line:match("^HTTP/(.-)%s+(%d+)%s+(.+)\r\n$") then
start_index = i
end
end
local last_request_headers = {}
for i = start_index, #headers_buffer do
table.insert(last_request_headers, headers_buffer[i])
end
headers = table.concat(last_request_headers)
status = tonumber(headers:match("%s+(%d+)%s+"))
parsed_headers = {}
for key, value in headers:gmatch("\n([^:]+): *([^\r\n]*)") do
parsed_headers[key] = value
end
end
local cookielist = ffi.new("struct curl_slist*[1]")
curl.curl_easy_getinfo(handle, curl.CURLINFO_COOKIELIST, cookielist)
if cookielist[0] ~= nil then
raw_cookies, set_cookies = {}, {}
local cookielist = ffi.gc(cookielist[0], curl.curl_slist_free_all)
local cookie = cookielist
repeat
local raw = ffi.string(cookie[0].data)
table.insert(raw_cookies, raw)
local domain, subdomains, path, secure, expiration, name, value = raw:match("^(.-)\t(.-)\t(.-)\t(.-)\t(.-)\t(.-)\t(.*)$")
set_cookies[name] = value
cookie = cookie[0].next
until cookie == nil
end
out = {
body = table.concat(out_buffer),
headers = parsed_headers,
raw_cookies = raw_cookies,
set_cookies = set_cookies,
code = status,
raw_headers = headers
}
else
out = true
end
curl.curl_easy_cleanup(handle)
curl.curl_slist_free_all(header_chunk)
if (post) then
curl.curl_formfree(post[0])
end
gc_handles = {}
for i, v in ipairs(callbacks) do
v:free()
end
return out
end,
init = function()
curl.curl_global_init(curl.CURL_GLOBAL_ALL)
end,
close = function()
curl.curl_global_cleanup()
end
}
request.init()
return request
|
--[[
C Context.
The C context is used to traverse an AST while generating C code,
it works similar to the analyzer context, visiting a specialized function for each node tag.
It contains many functions to assist generating C code.
]]
local VisitorContext = require 'nelua.visitorcontext'
local class = require 'nelua.utils.class'
local cdefs = require 'nelua.cdefs'
local cbuiltins = require 'nelua.cbuiltins'
local traits = require 'nelua.utils.traits'
local CEmitter = require 'nelua.cemitter'
local stringer = require 'nelua.utils.stringer'
local fs = require 'nelua.utils.fs'
local tabler = require 'nelua.utils.tabler'
local pegger = require 'nelua.utils.pegger'
local config = require 'nelua.configer'.get()
local luatype = type
-- The C context class.
local CContext = class(VisitorContext)
-- Used to quickly check whether a table is a C context.
CContext._ccontext = true
--[[
Initializes a C context context using `visitors` table to visit AST nodes,
and `typevisitors` table to visit types classes.
]]
function CContext:_init(visitors, typevisitors)
assert(self.context, 'initialization from a promotion expected')
self.visitors = visitors
self.typevisitors = typevisitors
self.latedecls = {}
self.typedecldepth = 0
self.declarations = {}
self.ctypedefs = {}
self.definitions = {}
self.cfiles = {}
self.linklibs = {}
self.directives = {}
self.compileopts = {
cflags = {},
ldflags = {},
linklibs = {},
cfiles = {},
incdirs = {},
}
self.stringliterals = {}
self.quotedliterals = {}
self.uniquecounters = {}
self.printcache = {}
self.usedbuiltins = {}
self.builtins = cbuiltins
end
function CContext:genuniquename(kind)
local count = self.uniquecounters[kind] or 0
count = count + 1
self.uniquecounters[kind] = count
return string.format('%s_%d', kind, count)
end
function CContext:declname(attr)
if attr.declname then
return attr.declname
end
local declname = attr.codename
assert(attr._attr and attr.codename)
if not attr.nodecl and not attr.cimport then
declname = cdefs.quotename(declname)
if attr.shadows and not attr.staticstorage then
declname = self:genuniquename(declname)
end
end
attr.declname = declname
return declname
end
function CContext:funcrettypename(functype)
return self.typevisitors.FunctionReturnType(self, functype)
end
function CContext:add_directive(code)
local directives = self.directives
directives[#directives+1] = code
end
function CContext:add_declaration(code, name)
local declarations = self.declarations
if name then
assert(not declarations[name], name)
self.declarations[name] = true
end
declarations[#declarations+1] = code
end
function CContext:add_definition(code, name)
local definitions = self.definitions
if name then
assert(not definitions[name])
definitions[name] = true
end
definitions[#definitions+1] = code
end
function CContext:is_declared(name)
return self.declarations[name] == true
end
-- Ensures type `type` is declared and returns its C typedef name.
function CContext:ensure_type(type)
local codename = type.codename
local declarations = self.declarations
local typename = declarations[codename]
if typename then -- already declared
return typename
end
-- translate codename for primitive types
typename = cdefs.primitive_typenames[codename]
if typename then
if luatype(typename) == 'table' then -- has include
self:ensure_include(typename[2])
typename = typename[1]
end
declarations[codename] = typename -- mark as declared
return typename
end
self.typedecldepth = self.typedecldepth + 1
declarations[codename] = codename -- mark as declared
-- search visitor for any inherited type class
local typevisitors = self.typevisitors
local mt, visitor = getmetatable(type)
repeat
local mtindex = rawget(mt, '__index')
if not mtindex then break end
visitor = typevisitors[mtindex]
mt = getmetatable(mtindex)
if not mt then break end
until visitor
-- visit the declaration function
if visitor then
if config.check_type_shape then
assert(type:shape())
end
local cinclude = type.cinclude
if cinclude then -- include headers before declaring
self:ensure_include(cinclude)
end
if not type.nodecl then -- only declare when needed
visitor(self, type)
elseif type.ctypedef then
local kind
if type.is_record then kind = 'struct'
elseif type.is_union then kind = 'union'
elseif type.is_enum then kind = 'enum'
end
if kind then
local ctype = luatype(type.ctypedef) == 'string' and type.ctypedef or codename
local code = 'typedef '..kind..' '..ctype..' '..codename..';\n'
declarations[#declarations+1] = code
end
end
end
self.typedecldepth = self.typedecldepth - 1
if self.typedecldepth == 0 then
local latedecls = self.latedecls
while #latedecls > 0 do -- declare struct/union of pointers
self:ensure_type(table.remove(latedecls))
end
end
return codename
end
--[[
Ensures C header file `filename` is included when compiling.
If the file name is not an absolute path and not between `<>` or `""`,
then looks for files in the current source file directory.
]]
function CContext:ensure_include(name)
local directives = self.directives
if directives[name] then return end
-- normalize include code
local inccode = name
local searchinc = false
if not inccode:find('[#\n]') then
if not name:match('^["<].*[>"]$') then
inccode = '<'..name..'>'
searchinc = true
end
inccode = '#include '..inccode..'\n'
if directives[inccode] then return end
end
-- add include directive
directives[inccode] = true
directives[name] = true
directives[#directives+1] = inccode
-- make sure to add the include directory for that file
if searchinc and not fs.isabs(name) then
local dirpath = self:get_visiting_directory()
if dirpath then
local filepath = fs.join(dirpath, name)
local incdirs = self.compileopts.incdirs
if fs.isfile(filepath) and not tabler.ifind(incdirs, dirpath) then
table.insert(incdirs, dirpath)
end
end
end
end
-- Ensures function `name` from C math library included.
function CContext:ensure_cmath_func(name, type)
if type.is_cfloat then
name = name..'f'
elseif type.is_clongdouble then
name = name..'l'
elseif type.is_float128 then
name = name..'q'
self:ensure_linklib('quadmath')
end
self:ensure_builtin(name)
return name
end
--[[
Ensures C source file `filename` is compiled and linked when compiling the application binary.
If the file name is not an absolute path, then looks for files in the current source file directory.
]]
function CContext:ensure_cfile(filename)
-- search the file relative to the current source file
if not fs.isabs(filename) then
local dirpath = self:get_visiting_directory()
if dirpath then
local filepath = fs.join(dirpath, filename)
if fs.isfile(filepath) then
filename = filepath
end
end
end
-- add cfile to compile options
local cfiles = self.cfiles
if cfiles[filename] then return end
cfiles[filename] = true
cfiles[#cfiles+1] = filename
table.insert(self.compileopts.cfiles, filename)
end
-- Ensures library `libname` is marked be linked when compiling the application binary.
function CContext:ensure_linklib(libname)
local linklibs = self.linklibs
if linklibs[libname] then return end
linklibs[libname] = true
linklibs[#linklibs+1] = libname
table.insert(self.compileopts.linklibs, libname)
end
-- Ensures `defname` is defined in the C preprocessor.
function CContext:ensure_define(defname)
local directives = self.directives
if directives[defname] then return end
directives[defname] = true
directives[#directives+1] = '#define '..defname..'\n'
end
--[[
Ensures builtin `name` is declared and defined and returns the defined builtin name.
Arguments `...` are forwarded to the function that defines the builtin.
The returned name is the `name` with a suffix depending on the extra arguments.
]]
function CContext:ensure_builtin(name, ...)
if select('#',...) == 0 and self.usedbuiltins[name] then
return name
end
local func = self.builtins[name]
assert(func, 'builtin not defined')
local newname = func(self, ...)
name = newname or name
self.usedbuiltins[name] = true
return name
end
-- Like `ensure_builtin`, but accept many builtins (it's a shortcut).
function CContext:ensure_builtins(...)
for i=1,select('#',...) do
self:ensure_builtin((select(i, ...)))
end
end
-- Defines C builtin macro `name` with source code `code`.
function CContext:define_builtin_macro(name, code)
assert(not self.usedbuiltins[name])
self:add_directive(stringer.ensurenewline(code))
self.usedbuiltins[name] = true
end
-- Defines C builtin declaration `name` with source code `code`.
function CContext:define_builtin_decl(name, code)
assert(not self.usedbuiltins[name])
self:add_declaration(stringer.ensurenewline(code))
self.usedbuiltins[name] = true
end
-- Defines C builtin function `name` with source code `code`.
function CContext:define_function_builtin(name, qualifier, ret, args, body)
if self.usedbuiltins[name] then return end
local heademitter, declemitter, defnemitter = CEmitter(self), CEmitter(self), CEmitter(self)
-- build return part
if traits.is_type(ret) then
ret = self:ensure_type(ret)
end
heademitter:add(ret, ' ', name)
-- build arguments part
if #args > 0 then
heademitter:add_text('(')
for i=1,#args do
if i > 1 then
heademitter:add_text(', ')
end
local arg = args[i]
local argtype = arg[1] or arg.type
local argname = arg[2] or arg.name
heademitter:add(argtype, ' ', argname)
end
heademitter:add_text(')')
else
heademitter:add_text('(void)')
end
-- build qualifier part
if not self.pragmas.nostatic then
declemitter:add_text('static ')
end
if qualifier and qualifier ~= '' then
declemitter:add_builtin(qualifier)
declemitter:add_text(' ')
end
-- build head part
defnemitter:add(heademitter)
declemitter:add(heademitter)
declemitter:add_ln(';')
-- build body part
defnemitter:add_text(' ')
if type(body) == 'table' then
defnemitter:add(table.unpack(body))
else
defnemitter:add(body)
end
defnemitter:add_ln()
-- add function declaration and definition
self:add_declaration(declemitter:generate())
self:add_definition(defnemitter:generate())
self.usedbuiltins[name] = true
end
--[[
Concatenate all generated code chunks into the final generated C source code.
Called when finalizing the code generation.
]]
function CContext:concat_chunks(template)
return pegger.substitute(template, {
directives = table.concat(self.directives):sub(1, -2),
declarations = table.concat(self.declarations):sub(1, -2),
definitions = table.concat(self.definitions):sub(1, -2)
})
end
return CContext
|
return require(script.Parent._Index["sleitnick_shake@0.1.4"]["shake"])
|
---
-- Face.lua - Face editor
--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UI = ReplicatedStorage.Common.UI
local ColorPicker = require(UI.ColorPicker)
local PaginatedSelector = require(UI.PaginatedSelector)
local Utils = require(UI.Utils)
local LabeledFrame = require(UI.LabeledFrame)
local Create = ReplicatedStorage.Common.Create
local CreateModule = require(Create.CreateModule)
local FaceStyles = require(Create.Data.FaceStyles)
local SelectorFrame = require(script.Parent.SelectorFrame)
local FaceFrame = setmetatable({}, { __index = SelectorFrame })
FaceFrame.__index = FaceFrame
function FaceFrame.new(EditorModule)
local self = setmetatable(SelectorFrame.new(EditorModule, "Face", "Customize your fumo's face"), FaceFrame)
self._colorPicker = nil
self.Selectors = {}
return self
end
function FaceFrame:load()
for dType, data in pairs(FaceStyles) do
local internalFrame = LabeledFrame.new(dType, self.Frame)
local selector = PaginatedSelector.new(internalFrame, CreateModule.keysToList(data), true, false)
selector.GetItemContent = function(frame, item)
local itemInfo = data[item]
frame.BackgroundColor3 = Color3.fromRGB(255, 240, 208)
if dType == "Eyes" then
local eyes = Utils.createIcon(itemInfo.Eyes)
eyes.Size = UDim2.fromScale(1, 1)
eyes.Parent = frame
local shine = Utils.createIcon(itemInfo.Shine)
shine.Size = UDim2.fromScale(1, 1)
shine.Parent = frame
else
local image = Utils.createIcon(itemInfo.Id)
image.Size = UDim2.fromScale(1, 1)
image.Parent = frame
end
end
selector.ItemSelected.Event:Connect(function(item)
local appearance = self.EM.currentAppearanceInfo
if not appearance then
return
end
appearance.Appearance[dType] = item
self.EM:save()
end)
selector.ItemDeselected.Event:Connect(function()
if #selector.SelectedItems ~= 0 then
return
end
local appearance = self.EM.currentAppearanceInfo
if not appearance then
return
end
appearance.Appearance[dType] = ""
self.EM:save()
end)
selector:loadItems()
self.Selectors[dType] = selector
end
local pickerFrame = LabeledFrame.new("Eye Color", self.Frame)
self._colorPicker = ColorPicker.new(pickerFrame)
self._colorPicker.ColorChanged.Event:Connect(function(color)
local appearanceInfo = self.EM.currentAppearanceInfo
if not appearanceInfo then
return
end
appearanceInfo.Appearance.EyesColor = color
self.EM:save()
end)
end
function FaceFrame:update(appearance)
if self._colorPicker then
self._colorPicker:setColor(appearance.Appearance.EyesColor)
end
for key, sel in pairs(self.Selectors) do
sel:setSelection({ appearance.Appearance[key] })
end
end
return FaceFrame
|
Scorpio "AshToAsh.BlizzardSkin.Template.AuraContainer" ""
__Sealed__()
interface "AuraFilter"(function()
property "MaxPriority" {
type = Number,
default = 1
}
property "Data" {
type = RawTable,
default = {}
}
property "SpecID" {
type = Number,
default = 0
}
property "Class" {
type = String,
default = UnitClassBase("player")
}
__Abstract__()
function Filter(...) end
__Abstract__()
function SortDisplayOrder(...) end
end)
-------------------------------------------------
-- Buff filter
-------------------------------------------------
--@retail@
__Sealed__()
class "BuffFilter"(function()
extend "AuraFilter"
function ShouldDisplayBuff(self, unitCaster, spellId, canApplyAura)
local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellId, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT")
if ( hasCustom ) then
return showForMySpec or (alwaysShowMine and (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle"))
else
return (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") and canApplyAura and not SpellIsSelfBuff(spellId)
end
end
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return (not isBossAura and self:ShouldDisplayBuff(caster, spellID, canApplyAura)) and self.MaxPriority or nil
end
end)
--@end-retail@
--[===[@non-version-retail@
__Sealed__()
class "BuffFilter"(function()
extend "AuraFilter"
-- 同一个职业会互相顶的Buff
local classBuffList = {
PALADIN = {
-- 强效王者祝福
[25898] = true,
-- 王者祝福
[20217] = true,
-- 强效庇护祝福
[27169] = true,
-- 庇护祝福
[27168] = true,
-- 强效力量祝福
[27141] = true,
-- 力量祝福
[27140] = true,
-- 强效智慧祝福
[27143] = true,
-- 智慧祝福
[27142] = true,
-- 强效光明祝福
[27145] = true,
-- 光明祝福
[27144] = true,
-- 强效拯救祝福
[25895] = true,
-- 拯救祝福
[1038] = true
},
MAGE = {
-- 奥术智慧
[27126] = true,
-- 奥术光辉
[27127] = true
},
DRUID = {
-- 野性赐福
[26991] = true,
-- 野性印记
[26990] = true,
-- 荆棘术
[26992] = true,
-- 自然之握
[27009] = true
},
PRIEST = {
-- 坚韧祷言
[25392] = true,
-- 真言术:韧
[25389] = true,
-- 精神祷言
[32999] = true,
-- 神圣之灵
[25312] = true,
-- 暗影防护祷言
[39374] = true,
-- 防护暗影
[25433] = true
},
SHAMAN = {
-- 大地之盾
[32594] = true
}
}
local classBuffPriority = 0
local function shouldShowClassBuff(self, spellId)
local buffs = classBuffList[self.Class]
return buffs and buffs[spellId]
end
function ShouldDisplayBuff(self, unitCaster, spellId, canApplyAura)
local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellId, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT")
local isClassBuff = shouldShowClassBuff(self, spellId)
if ( hasCustom ) then
return showForMySpec or (alwaysShowMine and (isClassBuff or unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle")), isClassBuff
else
return (isClassBuff or unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") and canApplyAura and not SpellIsSelfBuff(spellId), isClassBuff
end
end
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
if not isBossAura then
local display, isClassBuff = self:ShouldDisplayBuff(caster, spellID, canApplyAura)
if display then
if isClassBuff then return classBuffPriority end
return self.MaxPriority
end
end
end
-- 如果职业buff会被显示的话,将职业buff添加到所有buff的最前面
function SortDisplayOrder(self, src, maxCount)
local count = #src
if count > 1 then
-- 在显示范围内的职业buff全部挪到最前面
for i = 2, math.min(count, maxCount) do
local aura = src[i]
if aura.Priority == classBuffPriority then
tremove(src, i)
tinsert(src, 1, aura)
end
end
end
end
end)
--@end-non-version-retail@]===]
-------------------------------------------------
-- Debuff filter
-------------------------------------------------
--@retail@
__Sealed__()
class "DebuffFilter"(function()
extend "AuraFilter"
property "MaxPriority" {
type = Integer,
default = 255
}
local isPriorityDebuff
local classFileName = UnitClassBase("player")
if classFileName == "PALADIN" then
isPriorityDebuff = function(spellID)
local isForbearance = (spellId == 25771)
return isForbearance or SpellIsPriorityAura(spellID)
end
else
isPriorityDebuff = function(spellID)
return SpellIsPriorityAura(spellID)
end
end
function ShouldDisplayDebuff(self, unitCaster, spellID)
local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellID, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT")
if ( hasCustom ) then
return showForMySpec or (alwaysShowMine and (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") )
else
return true
end
end
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
if not isBossAura then
if isPriorityDebuff(spellID) then return self.MaxPriority end
if self:ShouldDisplayDebuff(caster, spellID) then return 1 end
end
end
function FilterPriorityAura(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return not isBossAura and isPriorityDebuff(spellID) and self.MaxPriority or nil
end
function FilterRaidAura(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return not isBossAura and not isPriorityDebuff(spellID) and self:ShouldDisplayDebuff(caster, spellID) and 1 or nil
end
end)
--@end-retail@
--[===[@non-version-retail@
__Sealed__()
class "DebuffFilter"(function()
property "MaxPriority" {
type = Integer,
default = 255
}
local isPriorityDebuff
local classFileName = UnitClassBase("player")
if ( classFileName == "PALADIN" ) then
isPriorityDebuff = function(spellID)
return spellID == 25771
end
elseif (classFileName == "PRIEST") then
isPriorityDebuff = function(spellID)
return spellID == 6788
end
else
isPriorityDebuff = function()
return false
end
end
function ShouldDisplayDebuff(self, unitCaster, spellID)
local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(spellID, UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT")
if ( hasCustom ) then
return showForMySpec or (alwaysShowMine and (unitCaster == "player" or unitCaster == "pet" or unitCaster == "vehicle") )
else
return true
end
end
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
if not isBossAura then
if isPriorityDebuff(spellID) then return self.MaxPriority end
if self:ShouldDisplayDebuff(caster, spellID) then return 1 end
end
end
function FilterPriorityAura(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return not isBossAura and isPriorityDebuff(spellID) and self.MaxPriority or nil
end
function FilterRaidAura(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return not isBossAura and not isPriorityDebuff(spellID) and self:ShouldDisplayDebuff(caster, spellID) and 1 or nil
end
end)
--@end-non-version-retail@]===]
-------------------------------------------------
-- Class buff filter
-------------------------------------------------
__Sealed__()
class "ClassBuffFilter"(function()
extend "AuraFilter"
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
local aura = self.Data[spellID] or self.Data[name]
if aura then
return type(aura) == "table" and aura.Priority or self.MaxPriority
end
end
end)
-------------------------------------------------
-- Dispel debuff filter
-------------------------------------------------
--@retail@
__Sealed__()
class "DispelDebuffFilter"(function()
extend "AuraFilter"
local classDispelType = {
-- 奶骑
[65] = {
Magic = true,
Disease = true,
Poison = true
},
-- 防骑
[66] = {
Disease = true,
Poison = true
},
-- 惩戒
[70] = {
Disease = true,
Poison = true
},
-- 奶萨
[264] = {
Magic = true,
Curse = true
},
--增强
[263] = {
Curse = true
},
-- 元素
[262] = {
Curse = true
},
-- 戒律
[256] = {
Magic = true,
Disease = true
},
-- 神牧
[257] = {
Magic = true,
Disease = true
},
-- 暗牧
[258] = {
Magic = true,
Disease = true
},
-- 奶僧
[270] = {
Magic = true,
Disease = true,
Poison = true
},
-- 踏风
[269] = {
Disease = true,
Poison = true
},
-- 酒仙
[268] = {
Disease = true,
Poison = true
},
-- 火法
[63] = {
Curse = true
},
-- 冰法
[64] = {
Curse = true
},
-- 奥法
[62] = {
Curse = true
},
-- 鸟德
[102] = {
Curse = true,
Poison = true
},
-- 野德
[103] = {
Curse = true,
Poison = true
},
-- 熊
[104] = {
Curse = true,
Poison = true
},
-- 奶德
[105] = {
Magic = true,
Curse = true,
Poison = true
}
}
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return classDispelType[self.SpecID] and classDispelType[self.SpecID][dtype]
end
end)
--@end-retail@
--[===[@non-version-retail@
__Sealed__()
class "DispelDebuffFilter"(function()
extend "AuraFilter"
local classDispelType = {
PALADIN = {
Magic = true,
Disease = true,
Poison = true
},
SHAMAN = {
Disease = true,
Poison = true
},
DRUID = {
Curse = true,
Poison = true
},
PRIEST = {
Magic = true,
Disease = true
},
MAGE = {
Curse = true
}
}
function Filter(self, unit, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer, ...)
return classDispelType[self.Class] and classDispelType[self.Class][dtype]
end
end)
--@end-non-version-retail@]===]
-------------------------------------------------
-- Auras
-------------------------------------------------
-- Aura data
__Sealed__() struct "AuraData" {
{ name = "Unit" },
{ name = "Index" },
{ name = "Name" },
{ name = "Icon" },
{ name = "Count" },
{ name = "DebuffType" },
{ name = "Stealeable" },
{ name = "Caster" },
{ name = "SpellID" },
{ name = "IsBossAura" },
{ name = "CasterByPlayer" },
{ name = "Filter" },
{ name = "Duration" },
{ name = "ExpirationTime" },
{ name = "Priority" }
}
-- Base aura icon
__Sealed__()
class "BaseAuraIcon"(function()
inherit "Frame"
local function OnEnter(self)
if self.ShowTooltip and self.AuraIndex then
GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT')
GameTooltip:SetUnitAura(self.Unit, self.AuraIndex, self.AuraFilter)
end
end
local function OnUpdate(self, elapsed)
self.timer = (self.timer or 0) + elapsed
if self.timer < 0.5 then
return
end
self.timer = 0
if self.ShowTooltip and GameTooltip:IsOwned(self) then
GameTooltip:SetUnitAura(self.Unit, self.AuraIndex, self.AuraFilter)
end
end
local function OnLeave(self)
GameTooltip:Hide()
end
function SetAuraData(self, data)
self.AuraIndex = data.Index
self.AuraFilter = data.Filter
self.AuraCaster = data.Caster
self.Unit = data.Unit
end
property "AuraData" {
type = AuraData,
set = function(self, data)
if data then
self:SetAuraData(data)
self:Show()
else
self:Hide()
end
end
}
property "ShowTooltip" { type = Boolean, default = true }
property "AuraIndex" { type = Number }
property "AuraFilter" { type = String }
property "AuraCaster" { type = String }
property "Unit" { type = String }
function __ctor(self)
self.OnEnter = self.OnEnter + OnEnter
self.OnLeave = self.OnLeave + OnLeave
self.OnUpdate = self.OnUpdate + OnUpdate
end
end)
-- Aura icon
__Sealed__()
class "AuraIcon"(function()
inherit "BaseAuraIcon"
function SetAuraData(self, data)
super.SetAuraData(self, data)
self:SetLabel(data.Count)
self:GetChild("Icon"):SetTexture(data.Icon)
self:GetChild("Cooldown"):SetCooldown(data.ExpirationTime - data.Duration, data.Duration)
end
function SetLabel(self, auraCount)
local label = auraCount
if auraCount >= 100 then
label = BUFF_STACKS_OVERFLOW
elseif auraCount <= 1 then
label = ""
end
self:GetChild("Label"):SetText(label)
end
__Template__{
Cooldown = OmniCCCooldown,
Icon = Texture,
Label = FontString
}
function __ctor(self)
end
end)
-- Buff icon
class "BuffIcon"(function()
inherit "AuraIcon"
function SetAuraData(self, data)
super.SetAuraData(self, data)
if UnitExists(data.Caster) and UnitIsUnit("player", data.Caster) then
self:SetAlpha(1)
else
self:SetAlpha(0.5)
end
end
function __ctor(self)
super(self)
end
end)
-- Debuff icon
class "DebuffIcon"(function()
inherit "AuraIcon"
function SetAuraData(self, data)
super.SetAuraData(self, data)
local color = DebuffTypeColor[data.DebuffType or ""]
self:GetChild("Background"):SetVertexColor(color.r, color.g, color.b, color.a)
end
__Template__{
Background = Texture
}
function __ctor(self)
end
end)
-- Dispel debuff icon
class "DispelDebuffIcon"(function()
inherit "BaseAuraIcon"
function SetAuraData(self, data)
self.Unit = data.Unit
self.AuraIndex = data.Index
self.AuraFilter = data.Filter
self.AuraCaster = data.Caster
if data.DebuffType then
self:GetChild("Icon"):SetTexture("Interface\\RaidFrame\\Raid-Icon-Debuff" .. data.DebuffType)
end
end
__Template__{
Icon = Texture
}
function __ctor(self)
end
end)
-- Boss Debuff icon
class "BossAuraIcon" { DebuffIcon }
-- Class buff icon
class "ClassBuffIcon" { AuraIcon }
-- Enlarge buff icon
class "EnlargeBuffIcon" { AuraIcon }
-- Enlarge Debuff icon
class "EnlargeDebuffIcon" { DebuffIcon }
__ChildProperty__(Scorpio.Secure.UnitFrame, "AshBlzSkinAuraContainer")
__Sealed__()
class "AuraContainer"(function()
inherit "Frame"
-- 可驱散Debuff类型
local dispelDebuffTypes = { Magic = true, Curse = true, Disease = true, Poison = true }
local dispelDebuffColor = {}
local buffFilter = BuffFilter()
local debuffFilter = DebuffFilter()
local classBuffFilter = ClassBuffFilter()
local dispelDebuffFilter = DispelDebuffFilter()
local auraDataPool = Recycle()
local buffCache = {}
local debuffCache = {}
local bossAuraCache = {}
local dispelDebuffs = {}
local dispelDebuffCache = {}
local classBuffCache = {}
local canDispelType = nil
local bossBuffPriority = 1
local bossDebuffPriority = 2
-------------------------------------------------
-- Functions
-------------------------------------------------
-- Increase debuff color's lightness
local function getDispellDebuffColor(dType)
local color = dispelDebuffColor[dType]
if not color then
local r, g, b = DebuffTypeColor[dType]
local h, s, l = Color(r, g, b):ToHSL()
color = Color.FromHSL(h, s, l * 1.3)
dispelDebuffColor[dType] = color
end
return color
end
local function wipeCache(cache)
for _, auraData in ipairs(cache) do
auraDataPool(auraData)
end
wipe(cache)
end
local function wipeCaches()
wipeCache(buffCache)
wipeCache(debuffCache)
wipeCache(bossAuraCache)
wipe(dispelDebuffs)
wipeCache(dispelDebuffCache)
wipeCache(classBuffCache)
canDispelType = nil
end
local function cacheAuraData(cache, priority, unit, index, filter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
local auraData = auraDataPool()
auraData.Priority = priority
auraData.Unit = unit
auraData.Index = index
auraData.Name = name
auraData.Icon = icon
auraData.Count = count
auraData.DebuffType = dtype
auraData.Duration = duration
auraData.ExpirationTime = expires
auraData.Caster = caster
auraData.SpellID = spellID
auraData.IsBossAura = isBossAura
auraData.CasterByPlayer = castByPlayer
auraData.Filter = filter
auraData.Stealeable = isStealable and not UnitIsUnit(unit, "player")
tinsert(cache, auraData)
end
local function compareAuraData(a, b)
return a.Priority > b.Priority
end
--@retail@
local foreachAura = AuraUtil.ForEachAura
--@end-retail@
--[===[@non-version-retail@
local foreachAura = function(unit, filter, maxCount, func)
if maxCount and maxCount <= 0 then
return
end
local index = 1
while true do
if func(UnitAura(unit, index, filter)) then break end
index = index + 1
end
end
--@end-non-version-retail@]===]
function Refresh(self, unit)
if not UnitExists(unit) then return self:HideAllAuras() end
wipeCaches()
local index = 1
local auraFilter
local displayOnlyDispellableDebuffs = self.DisplayOnlyDispellableDebuffs
local blackAuraList = self.BlackAuraList
-- Harmful
auraFilter = "HARMFUL"
local maxDebuffPriority, maxDebuffCount, debuffCount = debuffFilter.MaxPriority, self.DebuffCount, 0
local maxBossDebuffCount, bossDebuffCount = self.BossAuraCount, 0
foreachAura(unit, auraFilter, math.max(maxDebuffCount, maxBossDebuffCount), function(name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- compat classic
if not name then return true end
if blackAuraList[spellID] then return false end
if not displayOnlyDispellableDebuffs and debuffCount < maxDebuffCount then
-- Debuff filter
local priority = debuffFilter:Filter(unit, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
if priority then
cacheAuraData(debuffCache, priority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- just check max priority aura count to reduce loop
if priority == maxDebuffPriority then
debuffCount = debuffCount + 1
end
end
elseif debuffCount < maxDebuffCount then
-- Priority debuff
local priority = debuffFilter:FilterPriorityAura(unit, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
if priority then
cacheAuraData(debuffCache, priority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- just check max priority aura count to reduce loop
if priority == maxDebuffPriority then
debuffCount = debuffCount + 1
end
end
end
-- Boss debuff filter
if isBossAura and bossDebuffCount < maxBossDebuffCount then
cacheAuraData(bossAuraCache, bossDebuffPriority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
bossDebuffCount = bossDebuffCount + 1
end
index = index + 1
return not (debuffCount < maxDebuffCount or bossDebuffCount < maxBossDebuffCount)
end)
-- Harmful|Raid
auraFilter, index = "HARMFUL|RAID", 1
local maxDispelCount, dispelCount = self.DispelDebuffCount, 0
local checkDispelAbility = self.CheckDispelAbilityEnable
foreachAura(unit, auraFilter, math.max(maxDispelCount, debuffCount), function(name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- compat classic
if not name then return true end
if blackAuraList[spellID] then return false end
if displayOnlyDispellableDebuffs and debuffCount < maxDebuffCount then
-- Debuff filter
local priority = debuffFilter:FilterRaidAura(unit, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
if priority then
cacheAuraData(debuffCache, priority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- just check max priority aura count to reduce loop
if priority == maxDebuffPriority then
debuffCount = debuffCount + 1
end
end
end
-- Dispel debuff filter
if dispelDebuffTypes[dtype] and not dispelDebuffs[dtype] then
cacheAuraData(dispelDebuffCache, 0, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
dispelDebuffs[dtype] = true
dispelCount = dispelCount + 1
end
-- Dispel ability filter
if (checkDispelAbility and not canDispelType) then
local canDispel = dispelDebuffFilter:Filter(unit, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
if canDispel then
canDispelType = dtype
end
end
index = index + 1
return not (dispelCount < maxDispelCount or (displayOnlyDispellableDebuffs and debuffCount < maxDebuffCount) or (checkDispelAbility and not canDispelType))
end)
-- Helpful
auraFilter, index = "HELPFUL", 1
local maxBuffPriority, maxBuffCount, buffCount = buffFilter.MaxPriority, self.BuffCount, 0
local maxBossBuffCount, bossBuffCount = self.BossAuraCount - bossDebuffCount, 0
local maxClassBuffPriority, maxClassBuffCount, classBuffCount = classBuffFilter.MaxPriority, self.ClassBuffCount, 0
foreachAura(unit, auraFilter, math.max(maxClassBuffCount, maxBuffCount, maxBossBuffCount), function(name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- compat classic
if not name then return true end
if blackAuraList[spellID] then return false end
local filtered = false
if classBuffCount < maxClassBuffCount then
-- Class buff filter
local priority = classBuffFilter:Filter(unit, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
if priority then
filtered = true
cacheAuraData(classBuffCache, priority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- just check max priority aura count to reduce loop
if priority == maxClassBuffPriority then
classBuffCount = classBuffCount + 1
end
end
end
-- Boss buff filter
if not filtered and isBossAura and bossBuffCount < maxBossBuffCount then
filtered = true
cacheAuraData(bossAuraCache, bossBuffPriority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
bossBuffCount = bossBuffCount + 1
end
if not filtered and buffCount < maxBuffCount then
-- Buff filter
local priority = buffFilter:Filter(unit, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
if priority then
filtered = true
cacheAuraData(buffCache, priority, unit, index, auraFilter, name, icon, count, dtype, duration, expires, caster, isStealable, nameplateShowPersonal, spellID, canApplyAura, isBossAura, castByPlayer)
-- just check max priority aura count to reduce loop
if priority == maxBuffPriority then
buffCount = buffCount + 1
end
end
end
index = index + 1
return not (buffCount < maxBuffCount or bossBuffCount < maxBossBuffCount or classBuffCount < maxClassBuffCount)
end)
-- sort auras
sort(buffCache, compareAuraData)
buffFilter:SortDisplayOrder(buffCache, maxBuffCount)
sort(bossAuraCache, compareAuraData)
sort(debuffCache, compareAuraData)
sort(classBuffCache, compareAuraData)
-- Show auras
self:ShowBuffs()
self:ShowBossAuras()
self:ShowDebuffs()
self:ShowDispelDebuffs()
self:ShowClassBuffs()
self:ShowDispelAbiility()
end
local function getScaleSize(self, value)
local componentScale = min(self:GetWidth() / 72, self:GetHeight() / 36)
return (value or 10) * componentScale
end
function ShowBuffs(self)
local size = #buffCache
for i = 1, self.BuffCount do
local icon = self.BuffIcons[i]
if not icon and i <= size then
icon = BuffIcon("BuffIcon" .. i, self)
local auraSize = getScaleSize(self, self.BuffSize)
icon:SetSize(auraSize, auraSize)
if i == 1 then
icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -self.PaddingRight, self.PaddingBottom)
else
icon:SetPoint("RIGHT", self:GetChild("BuffIcon" .. (i-1)), "LEFT", -1, 0)
end
self.BuffIcons[i] = icon
end
if icon then
icon.AuraData = buffCache[i]
end
end
end
function ShowBossAuras(self)
local size = #bossAuraCache
for i = 1, self.BossAuraCount do
local icon = self.BossAuraIcons[i]
if not icon and i <= size then
icon = BossAuraIcon("BossAuraIcon" .. i, self)
local auraSize = getScaleSize(self, self.BossAuraSize)
icon:SetSize(auraSize, auraSize)
if i == 1 then
icon:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", self.PaddingLeft, self.PaddingBottom)
else
icon:SetPoint("LEFT", self:GetChild("BossAuraIcon" .. (i-1)), "RIGHT", 1.5, 0)
end
self.BossAuraIcons[i] = icon
end
if icon then
icon.AuraData = bossAuraCache[i]
end
end
self.__DisplayBossAuraCount = math.min(size, self.BossAuraCount)
end
function ShowDebuffs(self)
local size = #debuffCache
local debuffCount = (self.__DisplayBossAuraCount > 0) and self.DebuffCountWhenBossAura or self.DebuffCount
for i = 1, debuffCount do
local icon = self.DebuffIcons[i]
if not icon and i <= size then
icon = DebuffIcon("DebuffIcon" .. i, self)
local auraSize = getScaleSize(self, self.DebuffSize)
icon:SetSize(auraSize, auraSize)
if i ~= 1 then
icon:SetPoint("LEFT", self:GetChild("DebuffIcon" .. (i-1)), "RIGHT", 1.5, 0)
end
self.DebuffIcons[i] = icon
end
if icon then
if i == 1 then
icon:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", self.PaddingLeft + self.__DisplayBossAuraCount * (getScaleSize(self, self.BossAuraSize) + 1.5), self.PaddingBottom)
end
icon.AuraData = debuffCache[i]
end
end
end
function ShowDispelDebuffs(self)
local size = #dispelDebuffCache
for i = 1, self.DispelDebuffCount do
local icon = self.DispelDebuffIcons[i]
if not icon and i <= size then
icon = DispelDebuffIcon("DispelDebuffIcon" .. i, self)
local auraSize = getScaleSize(self, self.DispelDebuffSize)
icon:SetSize(auraSize, auraSize)
if i == 1 then
icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", -self.PaddingRight, -self.PaddingTop)
else
icon:SetPoint("RIGHT", self:GetChild("DispelDebuffIcon" .. (i-1)), "LEFT", -1, 0)
end
self.DispelDebuffIcons[i] = icon
end
if icon then
icon.AuraData = dispelDebuffCache[i]
end
end
end
function ShowClassBuffs(self)
local size = #classBuffCache
local count = self.ClassBuffCount
local auraSize = getScaleSize(self, self.ClassBuffSize)
local margin = 1
for i = 1, count do
local icon = self.ClassBuffIcons[i]
if not icon and i <= size then
icon = ClassBuffIcon("ClassBuffIcon" .. i, self)
icon:SetSize(auraSize, auraSize)
if i ~= 1 then
icon:SetPoint("LEFT", self:GetChild("ClassBuffIcon" .. (i-1)), "RIGHT", margin, 0)
end
self.ClassBuffIcons[i] = icon
end
if icon then
if i == 1 then
icon:SetPoint("LEFT", self, "CENTER", -(((auraSize + margin) * size - margin)/2), 0)
end
icon.AuraData = classBuffCache[i]
end
end
end
function ShowDispelAbiility(self)
local glow = self:GetChild("PixelGlow")
if canDispelType then
glow.Color = getDispellDebuffColor(canDispelType)
glow:Show()
else
glow:Hide()
end
end
function HideAllAuras(self)
self:HideAuras(self.BuffIcons)
self:HideAuras(self.DebuffIcons)
self:HideAuras(self.ClassBuffIcons)
self:HideAuras(self.DispelDebuffIcons)
self:HideAuras(self.BossAuraIcons)
end
function HideAuras(self, auras, newCount, oldCount)
if newCount and oldCount then
if newCount < oldCount then
for i = newCount + 1, oldCount do
if auras[i] then auras[i]:Hide() end
end
end
else
for i = 1, #auras do
if auras[i] then auras[i]:Hide() end
end
end
end
function ResizeAllAuras(self)
self:ResizeAuras(self.BuffIcons, self.BuffSize)
self:ResizeAuras(self.DebuffIcons)
self:ResizeAuras(self.ClassBuffIcons)
self:ResizeAuras(self.DispelDebuffIcons)
self:ResizeAuras(self.BossAuraIcons)
end
function ResizeAuras(self, auras, size)
size = getScaleSize(self, size)
for i = 1, #auras do
if auras[i] then
auras[i]:SetSize(size, size)
end
end
end
function OnPaddingChanged(self, paddingLeft, paddingTop, paddingRight, paddingBottom)
if paddingTop or paddingRight then
local icon = self.DispelDebuffIcons[1]
if icon then
icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", -self.PaddingRight, -self.PaddingTop)
end
end
if paddingLeft or paddingBottom then
local icon = self.BossAuraIcons[1]
if icon then
icon:SetPoint("BOTTOMLEFT", self, "BOTTOMLEFT", self.PaddingLeft, self.PaddingBottom)
end
end
if paddingRight or paddingBottom then
local icon = self.BuffIcons[1]
if icon then
icon:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -self.PaddingRight, self.PaddingBottom)
end
end
end
local function OnSizeChanged(self, width, height)
self:ResizeAllAuras()
end
-------------------------------------------------
-- Propertys
-------------------------------------------------
-------------------------------------------------
-- Buff --
-------------------------------------------------
property "BuffCount" {
type = NaturalNumber,
default = 3,
handler = function(self, new, old)
self:HideAuras(self.BuffIcons, new, old)
end
}
property "BuffSize" {
type = Number,
default = 1,
handler = function(self, size)
self:ResizeAuras(self.BuffIcons, size)
end
}
-------------------------------------------------
-- Debuff --
-------------------------------------------------
property "DebuffCount" {
type = NaturalNumber,
default = 3,
handler = function(self, new, old)
self:HideAuras(self.DebuffIcons, new, old)
end
}
property "DebuffCountWhenBossAura" {
type = NaturalNumber,
default = 1,
handler = function(self, new, old)
self:HideAuras(self.DebuffIcons, new, old)
end
}
property "DebuffSize" {
type = Number,
default = 1,
handler = function(self, size)
self:ResizeAuras(self.DebuffIcons, size)
end
}
property "DisplayOnlyDispellableDebuffs" {
type = Boolean,
default = false
}
-------------------------------------------------
-- Boss Aura --
-------------------------------------------------
property "BossAuraCount" {
type = NaturalNumber,
default = 1,
set = Toolset.fakefunc
}
property "BossAuraSize" {
type = Number,
default = 1,
handler = function(self, size)
self:ResizeAuras(self.BossAuraIcons, size)
end
}
-------------------------------------------------
-- Dispel debuff --
-------------------------------------------------
property "DispelDebuffCount" {
type = NaturlNumber,
default = 4,
set = Toolset.fakefunc
}
property "DispelDebuffSize" {
type = Number,
default = 1,
handler = function(self, size)
self:ResizeAuras(self.DispelDebuffIcons, size)
end
}
-------------------------------------------------
-- Class buff --
-------------------------------------------------
property "ClassBuffCount" {
type = NaturlNumber,
default = 2,
handler = function(self, new, old)
self:HideAuras(self.ClassBuffIcons, new, old)
end
}
property "ClassBuffSize" {
type = Number,
default = 1,
handler = function(self, size)
self:ResizeAuras(self.ClassBuffIcons, size)
end
}
property "ClassBuffFilterData" {
type = RawTable,
handler = function(self, data)
classBuffFilter.Data = data
end
}
property "Refresh" {
set = "Refresh"
}
property "PaddingLeft" {
type = NaturlNumber,
default = 0,
handler = function(self, paddingLeft)
self:OnPaddingChanged(paddingLeft)
end
}
property "PaddingRight" {
type = NaturlNumber,
default = 0,
handler = function(self, paddingRight)
self:OnPaddingChanged(nil, nil, paddingRight)
end
}
property "PaddingTop" {
type = NaturlNumber,
default = 0,
handler = function(self, paddingTop)
self:OnPaddingChanged(nil, paddingTop)
end
}
property "PaddingBottom" {
type = NaturlNumber,
default = 0,
handler = function(self, paddingBottom)
self:OnPaddingChanged(nil, nil, nil, paddingBottom)
end
}
property "CheckDispelAbilityEnable"{
type = Boolean,
default = false
}
property "SpecID" {
type = Number,
default = 0,
handler = function(self, specID)
dispelDebuffFilter.SpecID = specID
end
}
property "BlackAuraList" {
type = RawTable
}
__Template__{
PixelGlow = SpaUI.Widget.PixelGlow
}
function __ctor(self)
self.BuffIcons = {}
self.DebuffIcons = {}
self.ClassBuffIcons = {}
self.DispelDebuffIcons = {}
self.BossAuraIcons = {}
self.OnSizeChanged = self.OnSizeChanged + OnSizeChanged
end
end)
TEMPLATE_SKIN_STYLE = {
[BaseAuraIcon] = {
enableMouse = AshBlzSkinApi.AuraTooltipEnable(),
},
[AuraIcon] = {
Icon = {
drawLayer = "ARTWORK",
setAllPoints = true,
},
Label = {
drawLayer = "OVERLAY",
fontObject = NumberFontNormalSmall,
location = {
Anchor("BOTTOMRIGHT", 0, 0)
}
}
},
-- Class buff icon
[ClassBuffIcon] = {
topLevel = true,
enableMouse = false
},
-- Debuff icon
[DebuffIcon] = {
Background = {
drawLayer = "OVERLAY",
file = "Interface\\Buttons\\UI-Debuff-Overlays",
location = {
Anchor("TOPLEFT", -1, 1),
Anchor("BOTTOMRIGHT", 1, -1)
},
texCoords = RectType(0.296875, 0.5703125, 0, 0.515625)
},
},
-- -- Enlarge debuff icon
-- [EnlargeDebuffIcon] = {
-- topLevel = true,
-- PixelGlow = {
-- period = 2,
-- visible = true
-- }
-- },
-- -- Enlarge buff icon
-- [EnlargeBuffIcon] = {
-- topLevel = true,
-- },
-- Dispel debuff icon
[DispelDebuffIcon] = {
Icon = {
drawLayer = "ARTWORK",
setAllPoints = true,
texCoords = RectType(0.125, 0.875, 0.125, 0.875)
}
}
}
Style.UpdateSkin(SKIN_NAME, TEMPLATE_SKIN_STYLE)
|
pg = pg or {}
pg.enemy_data_statistics_55 = {
[10001] = {
cannon = 48,
reload = 150,
speed_growth = 0,
cannon_growth = 350,
pilot_ai_template_id = 20005,
air = 0,
rarity = 1,
dodge = 0,
torpedo = 85,
durability_growth = 8820,
antiaircraft = 80,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 160,
star = 2,
hit = 14,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 20,
base = 105,
durability = 620,
armor_growth = 0,
torpedo_growth = 3000,
luck_growth = 0,
speed = 15,
luck = 0,
id = 10001,
antiaircraft_growth = 920,
antisub = 0,
armor = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
100216,
100406,
313091
}
},
[10002] = {
cannon = 45,
reload = 150,
speed_growth = 0,
cannon_growth = 350,
rarity = 1,
air = 0,
torpedo = 78,
dodge = 0,
durability_growth = 8680,
antiaircraft = 80,
luck = 0,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 160,
star = 2,
hit = 14,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 20,
base = 104,
durability = 600,
armor_growth = 0,
torpedo_growth = 2800,
luck_growth = 0,
speed = 15,
armor = 0,
id = 10002,
antiaircraft_growth = 920,
antisub = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
100216,
100406,
313091
}
},
[10003] = {
cannon = 40,
armor = 0,
battle_unit_type = 20,
speed_growth = 0,
pilot_ai_template_id = 20005,
air = 0,
speed = 15,
dodge = 0,
id = 10003,
cannon_growth = 350,
rarity = 1,
reload_growth = 0,
dodge_growth = 0,
friendly_cld = 1,
star = 2,
hit = 14,
antisub_growth = 0,
air_growth = 0,
reload = 150,
base = 101,
durability = 550,
armor_growth = 0,
torpedo_growth = 2800,
luck_growth = 0,
hit_growth = 160,
luck = 0,
torpedo = 70,
durability_growth = 8260,
antisub = 0,
antiaircraft = 80,
antiaircraft_growth = 920,
appear_fx = {
"appearQ"
},
equipment_list = {
100226,
100406,
313091
}
},
[10004] = {
cannon = 55,
reload = 150,
speed_growth = 0,
cannon_growth = 600,
pilot_ai_template_id = 20005,
air = 0,
rarity = 1,
dodge = 0,
torpedo = 60,
durability_growth = 15000,
antiaircraft = 125,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 120,
star = 2,
hit = 8,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 25,
base = 108,
durability = 880,
armor_growth = 0,
torpedo_growth = 1800,
luck_growth = 0,
speed = 15,
luck = 0,
id = 10004,
antiaircraft_growth = 2500,
antisub = 0,
armor = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
100337,
313092,
319532
}
},
[10005] = {
cannon = 75,
reload = 150,
speed_growth = 0,
cannon_growth = 700,
pilot_ai_template_id = 20005,
air = 0,
rarity = 1,
dodge = 0,
torpedo = 80,
durability_growth = 16000,
antiaircraft = 85,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 120,
star = 2,
hit = 8,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 25,
base = 110,
durability = 920,
armor_growth = 0,
torpedo_growth = 2200,
luck_growth = 0,
speed = 15,
luck = 0,
id = 10005,
antiaircraft_growth = 1500,
antisub = 0,
armor = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
100337,
313092,
319532
}
},
[10006] = {
cannon = 65,
reload = 150,
speed_growth = 0,
cannon_growth = 650,
pilot_ai_template_id = 20005,
air = 0,
rarity = 1,
dodge = 0,
torpedo = 70,
durability_growth = 14000,
antiaircraft = 85,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 120,
star = 2,
hit = 8,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 25,
base = 107,
durability = 860,
armor_growth = 0,
torpedo_growth = 2000,
luck_growth = 0,
speed = 15,
luck = 0,
id = 10006,
antiaircraft_growth = 1500,
antisub = 0,
armor = 0,
appear_fx = {
"appearsmall"
},
equipment_list = {
100317,
313092,
319532
}
},
[10007] = {
cannon = 90,
reload = 150,
speed_growth = 0,
cannon_growth = 850,
pilot_ai_template_id = 20003,
air = 0,
rarity = 2,
dodge = 0,
torpedo = 50,
durability_growth = 28000,
antiaircraft = 75,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 120,
star = 2,
hit = 8,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 30,
base = 114,
durability = 1600,
armor_growth = 0,
torpedo_growth = 1500,
luck_growth = 0,
speed = 15,
luck = 0,
id = 10007,
antiaircraft_growth = 1200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
100207,
100517,
100417
}
},
[10008] = {
cannon = 84,
reload = 150,
speed_growth = 0,
cannon_growth = 800,
pilot_ai_template_id = 20004,
air = 0,
rarity = 2,
dodge = 0,
torpedo = 55,
durability_growth = 26000,
antiaircraft = 75,
reload_growth = 0,
dodge_growth = 0,
hit_growth = 120,
star = 2,
hit = 8,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 30,
base = 115,
durability = 1480,
armor_growth = 0,
torpedo_growth = 1600,
luck_growth = 0,
speed = 15,
luck = 0,
id = 10008,
antiaircraft_growth = 1200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
100207,
100517,
100417
}
},
[10009] = {
cannon = 100,
reload = 150,
speed_growth = 0,
cannon_growth = 640,
pilot_ai_template_id = 10001,
air = 0,
rarity = 3,
dodge = 18,
torpedo = 260,
durability_growth = 27500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 60,
base = 174,
durability = 4500,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10009,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319001,
319002,
319003,
319004
}
},
[10010] = {
cannon = 80,
reload = 150,
speed_growth = 0,
cannon_growth = 590,
pilot_ai_template_id = 10001,
air = 0,
rarity = 2,
dodge = 18,
torpedo = 200,
durability_growth = 24500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 60,
base = 159,
durability = 4300,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10010,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319005,
319006,
319007
}
},
[10011] = {
cannon = 90,
reload = 150,
speed_growth = 0,
cannon_growth = 590,
pilot_ai_template_id = 10001,
air = 0,
rarity = 3,
dodge = 18,
torpedo = 240,
durability_growth = 25500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 60,
base = 171,
durability = 4500,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10011,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319008,
319009,
319010,
319011
}
},
[10012] = {
cannon = 100,
reload = 150,
speed_growth = 0,
cannon_growth = 640,
pilot_ai_template_id = 10001,
air = 0,
rarity = 3,
dodge = 18,
torpedo = 260,
durability_growth = 27500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 50,
base = 169,
durability = 4900,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10012,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319012,
319013
}
},
[10013] = {
cannon = 100,
reload = 150,
speed_growth = 0,
cannon_growth = 640,
pilot_ai_template_id = 10001,
air = 0,
rarity = 2,
dodge = 18,
torpedo = 260,
durability_growth = 27500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 50,
base = 170,
durability = 4900,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10013,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319014,
319015
}
},
[10014] = {
cannon = 95,
reload = 150,
speed_growth = 0,
cannon_growth = 630,
pilot_ai_template_id = 10001,
air = 0,
rarity = 3,
dodge = 18,
torpedo = 250,
durability_growth = 26500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 50,
base = 165,
durability = 5000,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10014,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
equipment_list = {
319016,
319017
}
},
[10015] = {
cannon = 95,
reload = 150,
speed_growth = 0,
cannon_growth = 630,
pilot_ai_template_id = 10001,
air = 0,
rarity = 3,
dodge = 18,
torpedo = 250,
durability_growth = 26500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 50,
base = 166,
durability = 5000,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10015,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319018,
319019
}
},
[10016] = {
cannon = 95,
reload = 150,
speed_growth = 0,
cannon_growth = 640,
pilot_ai_template_id = 10001,
air = 0,
rarity = 3,
dodge = 18,
torpedo = 250,
durability_growth = 29500,
antiaircraft = 105,
reload_growth = 0,
dodge_growth = 270,
hit_growth = 210,
star = 3,
hit = 20,
antisub_growth = 0,
air_growth = 0,
battle_unit_type = 50,
base = 175,
durability = 5100,
armor_growth = 0,
torpedo_growth = 5200,
luck_growth = 0,
speed = 36,
luck = 0,
id = 10016,
antiaircraft_growth = 2200,
antisub = 0,
armor = 0,
appear_fx = {
"appearQ"
},
equipment_list = {
319020,
319021
}
}
}
return
|
local ADDON_NAME, namespace = ...
local L = namespace.L
local addonName = "AdiBags"
local AdiBagsMixin = {}
function AdiBagsMixin:GetName()
return addonName
end
function AdiBagsMixin:Init()
local AdiBags = LibStub('AceAddon-3.0'):GetAddon('AdiBags')
self.mod = AdiBags:NewModule("CaerdonWardrobeAdiBagsUpdate", "ABEvent-1.0")
self.mod.uiName = L["Caerdon Wardrobe"]
self.mod.uiDesc= L["Identifies transmog appearances that still need to be learned"]
self.mod.OnEnable = function(mod)
mod:RegisterMessage('AdiBags_UpdateButton', 'UpdateButton')
end
self.mod.UpdateButton = function(mod, event, button)
local bag = button.bag
local slot = button.slot
local options = {
showMogIcon=true,
showBindStatus=true,
showSellables=true,
iconPosition="TOPRIGHT"
}
local item = CaerdonItem:CreateFromBagAndSlot(bag, slot)
CaerdonWardrobe:UpdateButton(button, item, self, { bag = bag, slot = slot }, options)
end
end
function AdiBagsMixin:SetTooltipItem(tooltip, item, locationInfo)
if locationInfo.bag == BANK_CONTAINER then
local hasItem, hasCooldown, repairCost, speciesID, level, breedQuality, maxHealth, power, speed, name = tooltip:SetInventoryItem("player", BankButtonIDToInvSlotID(locationInfo.slot))
else
local hasCooldown, repairCost, speciesID, level, breedQuality, maxHealth, power, speed, name = tooltip:SetBagItem(locationInfo.bag, locationInfo.slot)
end
end
function AdiBagsMixin:Refresh()
self.mod:SendMessage('AdiBags_FiltersChanged')
end
local Version = nil
if select(4, GetAddOnInfo(addonName)) then
if IsAddOnLoaded(addonName) then
Version = GetAddOnMetadata(addonName, 'Version')
CaerdonWardrobe:RegisterFeature(AdiBagsMixin)
end
end
|
require("lib/class")
require("servers/udp_session")
local lkcp = require("lkcp")
local lutl = require("lutl")
local luv = require("luv")
UdpClient = class()
function UdpClient:ctor()
end
function UdpClient:Update()
local current = lutl.getsystime()
self._session:Update(current)
end
function UdpClient:UdpRecv(err, chunk, addr, flags)
if err then
print("UdpRecv err:", err)
return
end
if chunk == nil then
return
end
local conv = lkcp.getconv(chunk)
if conv == nil or conv ~= self._conv then
return
end
if addr.ip ~= self._addr.ip or addr.port ~= self._addr.port then
return
end
self._session:Recv(chunk)
end
function UdpClient:Connect(server_ip, server_port, port, recv_callback)
self._udp = luv.new_udp()
self._timer = luv.new_timer()
if self._udp == nil or self._timer == nil then
self._udp = nil
self._timer = nil
return false
end
self._addr = {}
self._addr.ip = server_ip
self._addr.port = server_port
self._recv_callback = recv_callback
luv.udp_bind(self._udp, "0.0.0.0", port, {reuseaddr=true,})
luv.udp_recv_start(self._udp, function(err, chunk, addr, flags)
self:UdpRecv(err, chunk, addr, flags)
end)
self._conv = math.floor(math.random() * 65536 * 65536)
self._session = UdpSession.new(1, self._conv, self._addr, self._udp, self, self._recv_callback)
-- start timer
luv.timer_start(self._timer, 10, 10, function()
self:Update()
end)
end
function UdpClient:Run(mode)
luv.run(mode)
end
function UdpClient:Send(data)
if data == nil or data == "" then
return false
end
self._session:Send(data)
return true
end
function UdpClient:Close()
luv.close(self._timer)
luv.walk(luv.close)
luv.run()
luv.loop_close()
end
|
return PlaceObj("ModDef", {
"title", "Deep Resources Never Run Out",
"version", 5,
"version_major", 0,
"version_minor", 5,
"id", "ChoGGi_DeepResourcesNeverRunOut",
"author", "ChoGGi",
"steam_id", "1775640697",
--~ "pops_desktop_uuid", "0a776f42-0e6b-4521-a5a3-9ceeb7c176af",
"pops_any_uuid", "a468ea08-8d6f-4e23-99a4-a45b2a3e9ffe",
"code", {
"Code/Script.lua",
},
"image", "Preview.png",
"lua_revision", 1007000, -- Picard
"has_options", true,
"TagGameplay", true,
"description", [[Deep resources amounts are all set to 500k and get refilled every new Sol (also kicks in when a deposit is revealed).
Mod Options:
Do the same for regular underground deposits.
Set grade to very high (less waste rock).
Deposits will be refreshed when you apply mod options (if needed).
Requested by Mephane
https://steamcommunity.com/workshop/discussions/18446744073709551615/3211505894135785138/]],
})
|
-- register aliases for retro compat
minetest.register_alias("ks_terrain:wetsoil", "ks_terrain:silt_soil")
minetest.register_alias("ks_terrain:drysoil", "ks_terrain:coarse_soil")
minetest.register_alias("ks_terrain:wetsoil_with_grass", "ks_terrain:silt_soil_with_grass")
minetest.register_alias("ks_terrain:drysoil_with_grass", "ks_terrain:coarse_soil_with_grass")
minetest.register_node("ks_terrain:snowpile", {
description = "Snow Pile",
tiles = {"terrain.snow.png"},
inventory_image = "terrain.snowball.png",
wield_image = "terrain.snowball.png",
paramtype = "light",
buildable_to = true,
floodable = true,
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
},
collision_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -6 / 16, 0.5},
},
},
groups = {diggable = 1, falling_node = 1, snow = 1},
sounds = ks_sounds.snowynode_sounds,
})
minetest.register_node("ks_terrain:ice_sheet", {
description = "Ice Sheet",
tiles = {"terrain.ice_sheet.png"},
groups = {ice = 1, float = 1, chippable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:silt_soil_with_grass", {
description = "Silt Soil with Grass",
tiles = {"terrain.grass.png", "terrain.silt_soil.png", "terrain.silt_soil.png^terrain.grass_side.png"},
groups = {silt_soil = 1, wet_soil = 1, soil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:mulchy_soil_with_grass", {
description = "Mulchy Soil with Grass",
tiles = {"terrain.grass.png", "terrain.mulchy_soil.png", "terrain.mulchy_soil.png^terrain.grass_side.png"},
groups = {mulchy_soil = 1, wet_soil = 1, soil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:coarse_soil_with_grass", {
description = "Coarse Soil with Grass",
tiles = {"terrain.grass.png", "terrain.coarse_soil.png", "terrain.coarse_soil.png^terrain.grass_side.png"},
groups = {coarse_soil = 1, soil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:silt_soil", {
description = "Silt Soil",
tiles = {"terrain.silt_soil.png"},
groups = {silt_soil = 1, wet_soil = 1, soil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:mulchy_soil", {
description = "Mulchy Soil",
tiles = {"terrain.mulchy_soil.png"},
groups = {mulchy_soil = 1, wet_soil = 1, soil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:coarse_soil", {
description = "Coarse Soil",
tiles = {"terrain.coarse_soil.png"},
groups = {coarse_soil = 1, soil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:fine_sand", {
description = "Fine Sand",
tiles = {"terrain.fine_sand.png"},
groups = {fine_sand = 1, sand = 1, diggable = 1, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:coarse_sand", {
description = "Coarse Sand",
tiles = {"terrain.coarse_sand.png"},
groups = {coarse_sand = 1, sand = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:dolomite", {
description = "Dolomite Stone",
tiles = {"terrain.dolomite.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
drop = "ks_tools:dolomite_rock 4",
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:dolomite_gravel", {
description = "Dolomite Gravel",
tiles = {"terrain.dolomite_gravel.png"},
groups = {wetsoil = 1, diggable = 2, falling_node = 1},
is_ground_content = true,
drop = "ks_tools:dolomite_rock 2",
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:aragonite", {
description = "Aragonite Stone",
tiles = {"terrain.aragonite.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
drop = "ks_tools:aragonite_rock 4",
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:feldspar", {
description = "Feldspar Stone",
tiles = {"terrain.feldspar.png"},
groups = {stone = 1, igneousrock = 1, chippable = 2},
is_ground_content = true,
sounds = ks_sounds.bedrocknode_sounds,
})
minetest.register_node("ks_terrain:feldspar_red", {
description = "Feldspar-Granite Stone",
tiles = {"terrain.feldspar_red.png"},
groups = {stone = 1, igneousrock = 1, chippable = 2},
is_ground_content = true,
sounds = ks_sounds.bedrocknode_sounds,
})
minetest.register_node("ks_terrain:limestone", {
description = "Limestone",
tiles = {"terrain.limestone.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:feldspar_with_bauxite", {
description = "Feldspar Stone with Bauxite",
tiles = {"terrain.feldspar.png^terrain.mineral_bauxite_overlay.png"},
groups = {stone = 1, igneousrock = 1, chippable = 2},
is_ground_content = true,
sounds = ks_sounds.bedrocknode_sounds,
})
minetest.register_node("ks_terrain:feldspar_with_uranium", {
description = "Feldspar Stone with Uranium",
tiles = {"terrain.feldspar.png^terrain.mineral_uranium_overlay.png"},
groups = {stone = 1, igneousrock = 1, chippable = 2},
is_ground_content = true,
sounds = ks_sounds.bedrocknode_sounds,
})
minetest.register_node("ks_terrain:feldspar_with_bornite", {
description = "Feldspar Stone with Bornite",
tiles = {"terrain.feldspar.png^terrain.mineral_bornite_overlay.png"},
groups = {stone = 1, igneousrock = 1, chippable = 2},
is_ground_content = true,
sounds = ks_sounds.bedrocknode_sounds,
})
minetest.register_node("ks_terrain:limestone_with_rose_quartz", {
description = "Limestone with Rose Quartz",
tiles = {"terrain.limestone.png^terrain.mineral_rose_quartz_overlay.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
drop = {
max_items = 4,
items = {
{items = {"ks_ores:rose_quartz 3"}},
{items = {"ks_ores:rose_quartz 1"}, rarity = 2},
{items = {"ks_ores:rose_quartz 2"}, rarity = 4},
{items = {"ks_ores:rose_quartz 1"}, rarity = 4},
}
},
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:limestone_with_fluorite", {
description = "Limestone with Fluorite",
tiles = {"terrain.limestone.png^terrain.mineral_fluorite_overlay.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
drop = {
max_items = 4,
items = {
{items = {"ks_ores:fluorite 3"}},
{items = {"ks_ores:fluorite 1"}, rarity = 2},
{items = {"ks_ores:fluorite 2"}, rarity = 4},
{items = {"ks_ores:fluorite 1"}, rarity = 4},
}
},
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:dolomite_with_bauxite", {
description = "Dolomite Stone with Bauxite",
tiles = {"terrain.dolomite.png^terrain.mineral_bauxite_overlay.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:dolomite_with_chalcocite", {
description = "Dolomite Stone with Chalcocite",
tiles = {"terrain.dolomite.png^terrain.mineral_chalcocite_overlay.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1},
is_ground_content = true,
})
minetest.register_node("ks_terrain:dolomite_with_coal_seam", {
description = "Dolomite Stone with a Coal Seam",
tiles = {"terrain.dolomite.png", "terrain.dolomite.png", "terrain.dolomite.png^terrain.mineral_coal_seam_overlay.png"},
groups = {stone = 1, sedimentaryrock = 1, chippable = 1, coal_seam = 1},
is_ground_content = true,
drop = {
max_items = 5,
items = {
{items = {"ks_tools:dolomite_rock 2"}},
{items = {"ks_ores:coal 2"}},
{items = {"ks_ores:coal 1"}, rarity = 2},
{items = {"ks_ores:coal 1"}, rarity = 4},
{items = {"ks_ores:coal 1"}, rarity = 4},
}
},
sounds = ks_sounds.generalnode_sounds,
})
minetest.register_node("ks_terrain:eclogite", {
description = "Eclogite Stone",
tiles = {"terrain.eclogite.png"},
groups = {stone = 1, metamorphicrock = 1, chippable = 3},
is_ground_content = true,
sounds = ks_sounds.bedrocknode_sounds,
})
minetest.register_node("ks_terrain:water_source", {
description = "Source Water",
drawtype = "liquid",
tiles = {
{
name = "terrain.water.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 8,
},
},
{
name = "terrain.water.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 8,
},
},
},
paramtype = "light",
use_texture_alpha = "blend",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
liquidtype = "source",
liquid_alternative_flowing = "ks_terrain:water_flowing",
liquid_alternative_source = "ks_terrain:water_source",
liquid_viscosity = 1,
liquid_range = 8,
groups = {water = 1, liquid = 3}
})
minetest.register_node("ks_terrain:water_flowing", {
description = "Flowing Water",
drawtype = "flowingliquid",
tiles = {"terrain.water.png"},
special_tiles = {
{
name = "terrain.water.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 8,
},
},
{
name = "terrain.water.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 8,
},
},
},
use_texture_alpha = "blend",
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
liquidtype = "flowing",
liquid_alternative_flowing = "ks_terrain:water_flowing",
liquid_alternative_source = "ks_terrain:water_source",
liquid_viscosity = 1,
liquid_range = 8,
groups = {water = 1, liquid = 3}
})
|
function mixDrugs(drug1, drug2, drug1name, drug2name)
-- 30 = Cannabis Sativa
-- 31 = Cocaine Alkaloid
-- 32 = Lysergic Acid
-- 33 = Unprocessed PCP
-- 34 = Cocaine
-- 35 = Drug 2
-- 36 = Drug 3
-- 37 = Drug 4
-- 38 = Marijuana
-- 39 = Drug 6
-- 40 = Drug 7
-- 41 = LSD
-- 42 = Drug 9
-- 43 = Angel Dust
local drugName
local drugID
if (drug1 == 31 and drug2 == 31) then -- Cocaine
drugID = 34
elseif (drug1==30 and drug2==31) or (drug1==31 and drug2==30) then -- Drug 2
drugID = 35
elseif (drug1==32 and drug2==31) or (drug1==31 and drug2==32) then -- Drug 3
drugID = 36
elseif (drug1==33 and drug2==31) or (drug1==31 and drug2==33) then -- Drug 4
drugID = 37
elseif (drug1==30 and drug2==30) then -- Marijuana
drugID = 38
elseif (drug1==30 and drug2==32) or (drug1==32 and drug2==30) then -- Drug 6
drugID = 39
elseif (drug1==30 and drug2==33) or (drug1==33 and drug2==30) then -- Drug 7
drugID = 40
elseif (drug1==32 and drug2==32) then -- LSD
drugID = 41
elseif (drug1==32 and drug2==33) or (drug1==33 and drug2==32) then -- Drug 9
drugID = 42
elseif (drug1==33 and drug2==33) then -- Angel Dust
drugID = 43
end
drugName = getItemName(drugID)
if (drugName == nil or drugID == nil) then
outputChatBox("Error #1000 - Report on https:/www.Melanciaroleplay.com/ucp", source, 255, 0, 0)
return
end
exports.mrp_global:takeItem(source, drug1)
exports.mrp_global:takeItem(source, drug2)
local given = exports.mrp_global:giveItem(source, drugID, 1)
if (given) then
outputChatBox("You mixed '" .. drug1name .. "' and '" .. drug2name .. "' to form '" .. drugName .. "'", source)
exports.mrp_global:sendLocalMeAction(source, "mixes some chemicals together.")
else
outputChatBox("You do not have enough space to mix these chemicals.", source, 255, 0, 0)
exports.mrp_global:giveItem(source, drug1, 1)
exports.mrp_global:giveItem(source, drug2, 1)
end
end
addEvent("mixDrugs", true)
addEventHandler("mixDrugs", getRootElement(), mixDrugs)
function bagimlilikArttir()
local bagimlilikOrani = getElementData(source, "saglik:uyusturucu_bagimlilik") or 0
if bagimlilikOrani < 5 then
setElementData(source, "saglik:uyusturucu_bagimlilik", 5)
elseif bagimlilikOrani < 15 then
setElementData(source, "saglik:uyusturucu_bagimlilik", 15)
elseif bagimlilikOrani < 25 then
setElementData(source, "saglik:uyusturucu_bagimlilik", 25)
elseif bagimlilikOrani < 35 then
setElementData(source, "saglik:uyusturucu_bagimlilik", 35)
elseif bagimlilikOrani < 45 then
setElementData(source, "saglik:uyusturucu_bagimlilik", 45)
elseif bagimlilikOrani < 100 then
setElementData(source, "saglik:uyusturucu_bagimlilik", 100)
end
if not (bagimlilikOrani >= 99) then
outputChatBox("** #f0f0f0Uyuşturucuya bağımlılık oranınız artık %" .. getElementData(source, "saglik:uyusturucu_bagimlilik") .. " olmuştur!", source, 0, 0, 255, true)
else
outputChatBox("** #f0f0f0Bir uyuşturucu bağımlısısınız!", source, 0, 0, 255, true)
end
end
addEvent("bagimlilikArttir", true)
addEventHandler("bagimlilikArttir", root, bagimlilikArttir)
function setBagimlilik(thePlayer, cmd, targetPlayerName, oran)
if exports.mrp_integration:isPlayerLeadAdmin(thePlayer) then
if not targetPlayerName or not oran then
outputChatBox("KULLANIM: /" .. cmd .. " [Partial Player Nick] [Oran]", thePlayer, 255, 194, 14)
else
local targetPlayer, targetPlayerName = exports.mrp_global:findPlayerByPartialNick( thePlayer, targetPlayerName )
if not targetPlayer then
elseif getElementData( targetPlayer, "loggedin" ) ~= 1 then
outputChatBox( "Player is not logged in.", thePlayer, 255, 0, 0 )
else
setElementData(targetPlayer, "saglik:uyusturucu_bagimlilik", tonumber(oran))
outputChatBox("You've set ".. targetPlayerName .. "'s bagimlilik to " .. oran .. ".", thePlayer, 0, 255, 0)
--outputChatBox("An admin set your bagimlilik to " .. hunger .. ".", targetPlayer, 0, 255, 0)
end
end
end
end
addCommandHandler("setbagimlilik", setBagimlilik)
addCommandHandler("bagimlilikayarla", setBagimlilik)
|
AddCSLuaFile()
local DbgPrint = GetLogging("MapScript")
local MAPSCRIPT = {}
MAPSCRIPT.PlayersLocked = false
MAPSCRIPT.DefaultLoadout =
{
Weapons =
{
"weapon_lambda_medkit",
"weapon_crowbar",
"weapon_pistol",
"weapon_smg1",
"weapon_357",
"weapon_physcannon",
"weapon_frag",
"weapon_shotgun",
"weapon_ar2",
},
Ammo =
{
["Pistol"] = 20,
["SMG1"] = 45,
["357"] = 6,
["Grenade"] = 3,
["Buckshot"] = 12,
["AR2"] = 50,
["SMG1_Grenade"] = 3,
},
Armor = 60,
HEV = true,
}
MAPSCRIPT.InputFilters =
{
}
MAPSCRIPT.EntityFilterByClass =
{
--["env_global"] = true,
}
MAPSCRIPT.EntityFilterByName =
{
--["test_name"] = true,
["player_spawn_items"] = true,
["player_spawn_items_maker"] = true,
["invulnerable"] = true,
}
MAPSCRIPT.ImportantPlayerNPCNames =
{
["citizen_b_regular_original"] = true,
["rocketman"] = true,
["gatekeeper"] = true,
}
MAPSCRIPT.VehicleGuns = true
function MAPSCRIPT:Init()
end
function MAPSCRIPT:PostInit()
if SERVER then
-- Combine and their binoculars... it just fucks your game up, nothing else.
ents.WaitForEntityByName("telescope", function(ent)
ent:SetKeyValue("wait", "20")
ent:SetKeyValue("spawnflags", "4")
end)
ents.WaitForEntityByName("citizen_b_regular_original", function(ent)
ent:SetHealth(100)
end)
ents.WaitForEntityByName("rocketman", function(ent)
ent:SetHealth(100)
end)
ents.WaitForEntityByName("gatekeeper", function(ent)
ent:SetHealth(100)
end)
ents.WaitForEntityByName("killed_critical_npc", function(ent)
ent:SetName("killed_critical_npc_2")
end)
ents.WaitForEntityByName("rocketman", function(ent)
ent:Fire("AddOutput", "OnDeath killed_critical_npc_2,ShowMessage,0") -- Use one with no delay.
end)
GAMEMODE:WaitForInput("spawner_rpg", "ForceSpawn", function(ent)
local entityData = game.FindEntityInMapData("rpg_weapon")
local pos = util.StringToType(entityData["origin"], "Vector")
local ang = util.StringToType(entityData["angles"], "Angle")
local newRPG = ents.Create("weapon_rpg")
newRPG:SetPos(pos)
newRPG:SetAngles(ang)
newRPG:Spawn()
TriggerOutputs({
{"first_train_rl", "Trigger", 0.0, ""},
{"train_horn", "PlaySound", 0.0, ""},
{"template_rpg", "Kill", 0.0, ""},
{"spawner_rpg", "Kill", 0.1, ""},
})
return true -- Suppress
end)
local checkpoint1 = GAMEMODE:CreateCheckpoint(Vector(-5971.663574, 3534.091064, 269.338867), Angle(4.653, 55.612, 0.000))
GAMEMODE:WaitForInput("spypost_template", "ForceSpawn", function(ent)
GAMEMODE:SetPlayerCheckpoint(checkpoint1)
GAMEMODE:SetVehicleCheckpoint(Vector(-5811.580566, 3605.574463, 257.262878), Angle(0, 0, 0))
end)
local checkpoint2 = GAMEMODE:CreateCheckpoint(Vector(6494.825195, 4199.202637, 260.031250), Angle(0, 0, 0))
checkpoint2:SetVisiblePos(Vector(7322.962402, 4037.665527, 257.896637))
GAMEMODE:WaitForInput("aisc_pre_ingreeterrange", "Enable", function(ent)
GAMEMODE:SetPlayerCheckpoint(checkpoint2)
GAMEMODE:SetVehicleCheckpoint(Vector(6610.592285, 4405.477539, 264.207794), Angle(0.091, -121.466, 0.363))
end)
GAMEMODE:WaitForInput("gunship_spawner_2", "Spawn", function(ent)
ent:RemoveTemplateData("OnDeath")
ent:AddTemplateData("squadname", "lambda_gunships")
ent:SetKeyValue("SpawnFrequency", "10")
ent:Enable()
ent.OnAllSpawnedDead = function(e)
TriggerOutputs({
{"ag_siren", "StopSound", 0.0, ""},
{"lr_radioloop", "Disable", 0.0, ""},
{"citizen_standoff", "Kill", 0.0, ""},
{"aigf_combat", "Kill", 0.0, ""},
{"aisc_odessapostgunship", "Enable", 0.0, ""},
{"lr_squad_follow_*", "Kill", 0.0, ""},
{"post_gunship_jeep_relay*", "Enable", 0.0, ""},
{"aigf_odessapostgunship*", "Activate", 0.10, ""},
{"ss_post**", "BeginSequence", 2.00, ""},
{"gunshipdown_music*", "PlaySound", 3.00, ""},
})
end
return true
end)
end
end
function MAPSCRIPT:PostPlayerSpawn(ply)
--DbgPrint("PostPlayerSpawn")
end
return MAPSCRIPT
|
-- do some test iterations
local userIndexKey = KEYS[2];
local cardinality = ARGV[1];
|
local gbc = cc.import("#gbc")
local TestAction = cc.class("TestAction", gbc.ActionBase)
local sensitive = cc.import("#sensitive")
local sensitive_library = sensitive.library
function TestAction:checkAction(args)
if args.name then
return sensitive_library:replace(args.name)
end
end
return TestAction
|
---------------------------------------------
-- Horrid Roar (Tiamat, Jormungand, Vrtra, Ouryu)
-- Dispels all buffs including food. Lowers Enmity.
---------------------------------------------
require("scripts/globals/monstertpmoves")
require("scripts/globals/settings")
require("scripts/globals/status")
require("scripts/globals/msg")
---------------------------------------------
function onMobSkillCheck(target, mob, skill)
if (mob:hasStatusEffect(tpz.effect.MIGHTY_STRIKES)) then
return 1
elseif (mob:hasStatusEffect(tpz.effect.INVINCIBLE)) then
return 1
elseif (mob:hasStatusEffect(tpz.effect.BLOOD_WEAPON)) then
return 1
elseif (target:isBehind(mob, 48) == true) then
return 1
elseif (mob:AnimationSub() == 1) then
return 1
end
return 0
end
function onMobWeaponSkill(target, mob, skill)
local dispel = target:dispelAllStatusEffect(bit.bor(tpz.effectFlag.DISPELABLE, tpz.effectFlag.FOOD))
if (dispel == 0) then
-- no effect
skill:setMsg(tpz.msg.basic.SKILL_NO_EFFECT) -- no effect
else
skill:setMsg(tpz.msg.basic.DISAPPEAR_NUM)
end
mob:lowerEnmity(target, 70)
return dispel
end
|
-- https://github.com/glepnir/dashboard-nvim/
local h = require('helpful')
-- headers {{{
local headers = {
ayaya = {
'⡿⠋⠄⣀⣀⣤⣴⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣌⠻⣿⣿',
'⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⠹⣿',
'⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠹',
'⣿⣿⡟⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡛⢿⣿⣿⣿⣮⠛⣿⣿⣿⣿⣿⣿⡆',
'⡟⢻⡇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣣⠄⡀⢬⣭⣻⣷⡌⢿⣿⣿⣿⣿⣿',
'⠃⣸⡀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠈⣆⢹⣿⣿⣿⡈⢿⣿⣿⣿⣿',
'⠄⢻⡇⠄⢛⣛⣻⣿⣿⣿⣿⣿⣿⣿⣿⡆⠹⣿⣆⠸⣆⠙⠛⠛⠃⠘⣿⣿⣿⣿',
'⠄⠸⣡⠄⡈⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠁⣠⣉⣤⣴⣿⣿⠿⠿⠿⡇⢸⣿⣿⣿',
'⠄⡄⢿⣆⠰⡘⢿⣿⠿⢛⣉⣥⣴⣶⣿⣿⣿⣿⣻⠟⣉⣤⣶⣶⣾⣿⡄⣿⡿⢸',
'⠄⢰⠸⣿⠄⢳⣠⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣼⣿⣿⣿⣿⣿⣿⡇⢻⡇⢸',
'⢷⡈⢣⣡⣶⠿⠟⠛⠓⣚⣻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⢸⠇⠘',
'⡀⣌⠄⠻⣧⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠛⠛⢿⣿⣿⣿⣿⣿⡟⠘⠄⠄',
'⣷⡘⣷⡀⠘⣿⣿⣿⣿⣿⣿⣿⣿⡋⢀⣠⣤⣶⣶⣾⡆⣿⣿⣿⠟⠁⠄⠄⠄⠄',
'⣿⣷⡘⣿⡀⢻⣿⣿⣿⣿⣿⣿⣿⣧⠸⣿⣿⣿⣿⣿⣷⡿⠟⠉⠄⠄⠄⠄⡄⢀',
'⣿⣿⣷⡈⢷⡀⠙⠛⠻⠿⠿⠿⠿⠿⠷⠾⠿⠟⣛⣋⣥⣶⣄⠄⢀⣄⠹⣦⢹⣿',
},
default = {
' ██████╗ █████╗ ███████╗██╗ ██╗██████╗ ██████╗ █████╗ ██████╗ ██████╗ ',
' ██╔══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔═══██╗██╔══██╗██╔══██╗██╔══██╗ ',
' ██║ ██║███████║███████╗███████║██████╔╝██║ ██║███████║██████╔╝██║ ██║ ',
' ██║ ██║██╔══██║╚════██║██╔══██║██╔══██╗██║ ██║██╔══██║██╔══██╗██║ ██║ ',
' ██████╔╝██║ ██║███████║██║ ██║██████╔╝╚██████╔╝██║ ██║██║ ██║██████╔╝ ',
' ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ',
},
neovim = {
' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗',
' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║',
' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║',
' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║',
' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║',
' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝',
},
}
-- }}}
h.setglobal(
{
dashboard_custom_header = headers.ayaya,
dashboard_default_executive = 'telescope',
dashboard_custom_shortcut = {
last_session = 'SPC s l',
find_history = 'SPC f h',
find_file = 'SPC f f',
new_file = 'SPC n f',
change_colorscheme = 'SPC t c',
find_word = 'SPC f a',
book_marks = 'SPC f b',
},
}
)
vim.api.nvim_exec(
[[autocmd FileType dashboard set showtabline=0 | autocmd WinLeave <buffer> set showtabline=2]],
true
)
|
--[[
© 2021 Tony Ferguson, do not share, re-distribute or modify
without permission of its author ( devultj@gmail.com - Tony Ferguson, http://www.tferguson.co.uk/ )
]]
dHeists.LOOT_MULTIPLIER = 2
dHeists.LOOT_CASH_ROLL_SMALL = dHeists.loot:registerLoot( "loot_cash_roll_small", {
model = "models/mark2580/gtav/mp_office_03c/accessories/swag_counterfeit1.mdl",
moneyGiven = 500 * dHeists.LOOT_MULTIPLIER
} )
dHeists.LOOT_SECUROSERV_DIAMOND_FIGURE = dHeists.loot:registerLoot( "loot_diamond_figure", {
model = "models/mark2580/gtav/mp_office_03c/accessories/award_diamond.mdl",
moneyGiven = 5000 * dHeists.LOOT_MULTIPLIER,
actionTime = 2
} )
dHeists.LOOT_SECUROSERV_GOLDEN_FIGURE = dHeists.loot:registerLoot( "loot_golden_figure", {
model = "models/mark2580/gtav/mp_office_03c/accessories/award_gold.mdl",
moneyGiven = 2000 * dHeists.LOOT_MULTIPLIER,
actionTime = 2
} )
dHeists.LOOT_SECUROSERV_SILVER_FIGURE = dHeists.loot:registerLoot( "loot_silver_figure", {
model = "models/mark2580/gtav/mp_office_03c/accessories/award_silver.mdl",
moneyGiven = 500 * dHeists.LOOT_MULTIPLIER,
actionTime = 1
} )
dHeists.LOOT_CASH_CASE = dHeists.loot:registerLoot( "loot_cash_case", {
model = "models/mark2580/gtav/mp_office_03c/accessories/cash_case.mdl",
moneyGiven = 2000 * dHeists.LOOT_MULTIPLIER,
actionTime = 2
} )
dHeists.LOOT_CASH_CRATE = dHeists.loot:registerLoot( "loot_cash_crate", {
model = "models/mark2580/gtav/mp_office_03c/accessories/cash_crate_01.mdl",
moneyGiven = 10000 * dHeists.LOOT_MULTIPLIER,
actionTime = 3
} )
|
local json = {}
local cjson = require("cjson")
function json.encode(var)
local status, result = pcall(cjson.encode, var)
if status then return result end
if DEBUG > 1 then
echoError("json.encode() - encoding failed: %s", tostring(result))
end
end
function json.decode(text)
local status, result = pcall(cjson.decode, text)
if status then return result end
if DEBUG > 1 then
echoError("json.decode() - decoding failed: %s", tostring(result))
end
end
json.null = cjson.null
return json
|
local module = {}
function module.init(Modules)
local Tween = Modules["Menu"]["tween"]
local function display(Target,String,Color,Time,Audio,Texture)
local Gui = Target:FindFirstChild("CurrencyGui")
if Gui == nil then
Gui = script.Parent.CurrencyGui:Clone()
Gui.Parent = Target
Gui.Adornee = Target
Gui.Enabled = true
end
if Audio then
local Sound = Instance.new("Sound")
Sound.Volume = 0.05
Sound.MaxDistance = 75
Sound.SoundId = "rbxassetid://"..Audio
Sound.Name = tostring(Audio)
Sound.Parent = Target
Sound:Play()
game.Debris:AddItem(Sound,2)
end
local Msg = Gui.Sample:Clone()
local X,Y = (math.random(15,85)/100), (math.random(50,100)/100)
Msg.Icon.Visible = false
if Texture ~= nil then
Msg.TextXAlignment = Enum.TextXAlignment.Left
Msg.Icon.Visible = true
Msg.Icon.Image = Texture
--print("Applying "..Texture)
Msg.Icon.ImageTransparency = 1
Tween(Msg.Icon,{"ImageTransparency"},0,Time/2,Enum.EasingStyle.Linear)
end
Msg.Position = UDim2.new(X,0,Y,0)
Msg.TextTransparency = 1
Msg.TextStrokeTransparency = 1
Msg.Text = String
Msg.TextColor3 = Color
Msg.Parent = Gui
Msg.Visible = true
game.Debris:AddItem(Msg,Time)
Tween(Msg,{"TextTransparency","TextStrokeTransparency","Position"},{0,0,UDim2.new(X,0,Y-0.25,0)},Time/2,Enum.EasingStyle.Linear)
wait(Time/2)
if Msg.Icon.Visible then
Tween(Msg.Icon,{"ImageTransparency"},{1},Time/2,Enum.EasingStyle.Linear)
end
Tween(Msg,{"TextTransparency","TextStrokeTransparency","Position"},{1,1,UDim2.new(X,0,Y-0.5,0)},Time/2,Enum.EasingStyle.Linear)
end
game.ReplicatedStorage.CurrencyItem.OnClientEvent:connect(function(Target, Item, Time)
local String = Modules.Translate.ItemName(Item)
local Tier = game.ReplicatedStorage.Tiers:FindFirstChild(tostring(Item.Tier.Value))
local Color = Color3.new(1,1,1)
if Tier then
Color = Tier.TierColor.Value
end
local Texture = "rbxassetid://"..Item.ThumbnailId.Value
display(Target,String,Color,Time,nil,Texture)
end)
--game.ReplicatedStorage.CurrencyItem:FireClient(Player,script.Parent,Item,3)
game.ReplicatedStorage.Currency.OnClientEvent:connect(display)
end
return module
|
return {
id = "insert",
name = "Element Insertion",
repeats = 1e4,
nocollect = true,
variables = {
count = { min = 100, max = 1000, name = "Elements inserted" },
},
cases = {
ArrayTable = [[
local array = {}
for i = (-count), -1 do
array[#array+1] = i
end
]],
LinkedList = [[
local list
for i = (-count), -1 do
list = {data=i, next=list}
end
]],
OrderedSet = [[
local next, head = {}
for i = (-count), -1 do
head, next[i] = i, head
end
]],
}
}
|
local _M = {
_VERSION = "1.0.0",
_MODULE_TYPE = "http"
}
local CONFIG = ngx.shared.config
function _M.config()
CONFIG:set("amqp.async_queue_size", 2000)
CONFIG:set("amqp.pool_size", 10)
CONFIG:set("amqp.timeout", 60)
CONFIG:set("amqp.retry", 1)
CONFIG:set("amqp.host", "unix:logs/amqp-proxy.sock")
--CONFIG:set("amqp.host", "rabbitmq")
--CONFIG:set("amqp.port", 5672)
CONFIG:set("amqp.user", "root")
CONFIG:set("amqp.password", "1111")
CONFIG:set("amqp.vhost", "/")
CONFIG:set("amqp.ssl", false)
CONFIG:set("amqp.trace_ddl", true)
CONFIG:set("amqp.trace_publish", false)
CONFIG:set("amqp.conn_timeout", 30)
CONFIG:set("amqp.read_timeout", 30)
CONFIG:set("amqp.inactive_timeout", 120)
CONFIG:set("amqp.heartbeat", 60)
end
return _M
|
function run()
Log("Logged from autotest script")
end
|
local Addon = select(2, ...)
local Button = Addon:CreateClass('Button')
function Button:New(options)
local button = self:Bind(CreateFrame('Button', nil, options.parent, 'UIPanelButtonTemplate'))
if options.name then
button:SetText(options.name)
end
if options.width then
button:SetWidth(options.width)
end
if options.height then
button:SetHeight(options.height)
end
if options.click then
button:SetScript('OnClick', options.click)
end
return button
end
Addon.Button = Button
|
local GAME = "lovers/story.lua"
if love then
isLove = true
isCLI = false
elseif not love then
print("WARNING! Not running in Love2D")
love = {}
isCLI = true
isLove = false
end
require("script_lua/script")
local serpent = require("script_lua/serpent")
function string.occures(str, patt)
return select(2, str:gsub(patt, ""))
end
effects = {
animation = false,
fade = {
enabled = false,
fadein = true,
tick = 0,
colorr = 0,
colorg = 0,
colorb = 0,
time = 0,
interrupt = false
},
sleep = {
enabled = false,
starttime = 0,
endttime = 0
},
music = {
enabled = false,
volume = false,
object = false,
},
audio = {
muted = false
},
image = {
enabled = false,
image = nil,
fadeing = false,
fadein = false,
tick = 0,
interrupt = false,
},
text = {
time = 0,
}
}
deltatime = 0
ui = {}
ui.currentFrame = 0
ui.text = "Starting..."
ui.textFrame = 0
ui.textWritten = false
ui.selected = ""
ui.questions = {}
ui.font = love.graphics.newFont(28)
--ui.background = nil
--ui.image = nil
local FADE_CONSTANT = (256 / math.sqrt(98))
function drawFade()
local w, h = love.graphics.getDimensions()
local effect = effects.fade
--local alpha = effect.tick / 99 * 255
local alpha = FADE_CONSTANT * math.sqrt(effect.tick)
--alpha = effect.fadein and alpha or 255 - alpha
love.graphics.setColor(effect.colorr, effect.colorg, effect.colorb, alpha)
love.graphics.rectangle("fill", 0, 0, w, h)
--print(percentage, alpha, effect.tick)
if effect.enabled then
if effect.fadein then
effect.tick = effect.tick + (1/effect.time * 100 * deltatime)
else
effect.tick = effect.tick - (1/effect.time * 100 * deltatime)
end
end
if effect.enabled then
effects.animation = true
if effect.tick > 100 then
--effect.fadein = false
effect.enabled = false
effect.interrupt = true
effects.animation = false
elseif not effect.fadein and effect.tick < 0 then
effect.enabled = false
effect.interrupt = true
effects.animation = false
end
end
end
function drawText()
local w, h = love.graphics.getDimensions()
local margin = 48
local padding = 16
local leftm = margin
local rightm = w - margin - margin
local topm = margin
local bottomm = h - margin - margin
local textheight = ui.font:getHeight()
local topBarHeight = 0
love.graphics.setFont(ui.font)
local limit = rightm - padding * 2
--local text = ui.text:sub(1, ui.currentFrame - ui.textFrame)
local characterstoshow = effects.text.time * 40 --ui.currentFrame - ui.textFrame
if ui.textWritten then
characterstoshow = #ui.text
end
local ncharacters = characterstoshow
local text = ui.text
--local nLines = math.ceil(ui.font:getWidth(ui.text) / limit) + string.occures(ui.text, "\n")
local maxwidth, lines = ui.font:getWrap(text, limit)
local nLines = #lines
local topBarHeight = nLines * ui.font:getHeight() + padding * 2
if #ui.text > 0 then
love.graphics.setColor(255, 255, 255, 200)
love.graphics.rectangle("fill", leftm, topm, rightm, topBarHeight)
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("line", leftm, topm, rightm, topBarHeight)
love.graphics.setColor(0, 0, 0)
for index, line in ipairs(lines) do
local charactersline = #line <= ncharacters and #line or ncharacters
ncharacters = ncharacters - charactersline
local printedline = line:sub(1, charactersline)
love.graphics.printf(printedline, leftm + padding, topm + padding + textheight * (index - 1), limit, "left")
end
end
--if #text - (ui.currentFrame - ui.textFrame) <= 0 then
if #ui.text - characterstoshow <= 0 then
ui.textWritten = true
end
return topBarHeight
end
function drawButtons()
local w, h = love.graphics.getDimensions()
local margin = 48
local padding = 16
local leftm = margin
local rightm = w - margin - margin
local topm = margin
local bottomm = h - margin - margin
local mouseX, mouseY = love.mouse.getPosition()
local bottomBarHeight = margin
local buttonHeight = margin
local textheight = ui.font:getHeight()
local by = h - margin / 2
for index = #ui.questions, 1, -1 do
local question = ui.questions[index]
local text = question.text
local bw = rightm
local maxlimit = bw - padding * 2
local maxwidth, lines = ui.font:getWrap(text, maxlimit)
local bx = leftm
local bh = textheight * #lines + 16
by = by - bh - padding
question.x = bx
question.y = by
question.w = bw
question.h = bh
love.graphics.setColor(255, 255, 255, 200)
love.graphics.rectangle("fill", bx, by, bw, bh)
if ui.textWritten and mouseX > bx and mouseX < bx + bw and mouseY > by and mouseY < by + bh then
if love.mouse.isDown(1) then
love.graphics.setColor(200, 200, 200)
else
love.graphics.setColor(100, 100, 100)
end
else
love.graphics.setColor(0, 0, 0)
end
love.graphics.printf(text, bx + padding, by + padding / 2, maxlimit, "center")
love.graphics.rectangle("line", bx, by, bw, bh)
end
end
function drawMuteButton()
local mx, my = love.mouse.getPosition()
local over = math.sqrt((mx - 20)^2 + (my - 20)^2) <= 17
local down = love.mouse.isDown(1)
if not effects.audio.muted then
if over then
if down then
love.graphics.setColor(200, 200, 200, 200)
else
love.graphics.setColor(255, 255, 255, 220)
end
else
love.graphics.setColor(255, 255, 255, 200)
end
elseif effects.audio.muted then
if over then
if down then
love.graphics.setColor(150, 150, 150, 200)
else
love.graphics.setColor(200, 200, 200, 220)
end
else
love.graphics.setColor(200, 200, 200, 200)
end
end
love.graphics.ellipse("fill", 20, 20, 15, 15)
love.graphics.setColor(0, 0, 0)
love.graphics.ellipse("line", 20, 20, 15, 15)
end
local IMAGE_FADE_CONSTANT = (256 / math.sqrt(98))
local IMAGE_TIME = 1 / .2 * 100
function drawImage()
local w, h = love.graphics.getDimensions()
if effects.image.enabled and effects.image.image then
local alpha = IMAGE_FADE_CONSTANT * math.sqrt(effects.image.tick)
love.graphics.setColor(255, 255, 255, alpha)
--local height = h - topBarHeight - bottomBarHeight - margin)
local ih = h * .5 -- (buttonHeight + margin) * 4
local iw = ih / effects.image.image:getHeight() * effects.image.image:getWidth()
local x = (w - iw) * .5
local y = (h - ih) * .5
love.graphics.draw(effects.image.image, x, y, 0, iw / effects.image.image:getWidth(), ih / effects.image.image:getHeight())
if effects.image.fading then
effects.animation = true
if effects.image.fadein then
effects.image.tick = effects.image.tick + IMAGE_TIME * deltatime
if effects.image.tick >= 100 then
effects.image.fading = false
effects.image.tick = 100
effects.image.interrupt = true
effects.animation = false
end
else
effects.image.tick = effects.image.tick - IMAGE_TIME * deltatime
if effects.image.tick <= 0 then
effects.image.tick = 100
effects.image.fading = false
effects.image.image = nil
effects.image.enabled = false
effects.image.interrupt = true
effects.animation = false
end
end
end
elseif effects.image.enabled then
effects.image.enabled = false
effects.image.interrupt = true
end
end
function love.draw()
ui.currentFrame = ui.currentFrame + 1
love.graphics.setBackgroundColor(255, 0, 255)
-- Draw the background
local w, h = love.graphics.getDimensions()
local margin = 48
local padding = 16
if ui.background then
love.graphics.setColor(255, 255, 255)
local iw, ih = ui.background:getDimensions()
love.graphics.draw(ui.background, 0, 0, 0, w / iw, h / ih)
end
local leftm = margin
local rightm = w - margin - margin
local topm = margin
local bottomm = h - margin - margin
-- Draw the image, if any
drawImage()
-- Draw the text and box
local topBarHeight = drawText()
-- Draw the question boxes
drawButtons()
drawMuteButton()
-- Draw a fade effect if there is one
drawFade()
end
function love.update(dt)
deltatime = dt
if effects.fade.interrupt then
effects.fade.interrupt = false
story()
elseif effects.sleep.enabled then
local time = love.timer.getTime()
if time >= effects.sleep.endtime then
effects.sleep.enabled = false
story()
end
elseif effects.image.interrupt then
effects.image.interrupt = false
story()
end
if effects.music.enabled then
if effects.music.object:isStopped() then
effects.music.object:play()
end
end
effects.text.time = effects.text.time + dt
end
function love.mousereleased(x, y, button)
-- Check if the entire text has already been displayed
--local left = #ui.text - ui.currentFrame + ui.textFrame
--if left > 0 then
if math.sqrt((x - 20)^2 + (y - 20)^2) <= 17 then
effects.audio.muted = not effects.audio.muted
if effects.audio.muted then
love.audio.setVolume(0.0)
else
love.audio.setVolume(1.0)
end
elseif not ui.textWritten then
--ui.textFrame = ui.textFrame - #ui.text + ui.currentFrame - ui.textFrame
ui.textWritten = true
elseif not effects.animation then
-- Check if a button is pressed
for index, question in ipairs(ui.questions) do
if question.x then
local bx = question.x
local by = question.y
local bw = question.w
local bh = question.h
if x > bx and x < bx + bw and y > by and y < by + bh then
ui.selected = question.name
print("Player chose " .. ui.selected)
story()
return
end
end
end
else
print("Ongoing animation")
end
end
function script.ext.say(text)
ui.text = text
ui.textFrame = ui.currentFrame
ui.textWritten = false
effects.text.time = 0
end
function script.ext.ask(questions)
ui.questions = questions
coroutine.yield()
return ui.selected
end
function script.ext.clearask(question)
ui.questions = {}
end
function script.ext.background(filename)
ui.background = love.graphics.newImage(filename)
end
function script.ext.image(filename)
if filename then
effects.image.image = love.graphics.newImage(filename)
effects.image.fading = true
effects.image.fadein = true
effects.image.tick = 0
effects.image.enabled = true
else
effects.image.fading = true
effects.image.fadein = false
effects.image.tick = 100
effects.image.enabled = true
end
coroutine.yield()
end
function script.ext.fadein(colorr, colorg, colorb, time)
effects.fade.enabled = true
effects.fade.colorr = colorr
effects.fade.colorg = colorg
effects.fade.colorb = colorb
effects.fade.time = time
effects.fade.tick = 0
effects.fade.fadein = true
effects.fade.interrupt = false
end
function script.ext.fadeout(colorr, colorg, colorb, time)
effects.fade.enabled = true
effects.fade.colorr = colorr
effects.fade.colorg = colorg
effects.fade.colorb = colorb
effects.fade.time = time
effects.fade.tick = 100
effects.fade.fadein = false
effects.fade.interrupt = false
end
function script.ext.waitforfade()
coroutine.yield()
end
function script.ext.save(tbl, name)
local dump = serpent.dump(tbl, {
comment = false,
compact = true,
})
local file, err = love.filesystem.newFile(name .. ".dat", "w")
if not file then
error(err)
end
file:write(dump)
file:close()
end
function script.ext.load(name)
local content, size = love.filesystem.read(name .. ".dat")
return loadstring(content)()
end
function script.ext.saveexists(name)
return love.filesystem.exists(name .. ".dat")
end
function script.ext.sleep(amount)
effects.sleep.enabled = true
effects.sleep.starttime = love.timer.getTime()
effects.sleep.endtime = effects.sleep.starttime + amount
coroutine.yield()
end
function script.ext.music(filename)
if not filename then
effects.music.enabled = false
effects.music.object:stop()
else
filename = script.directory .. filename
effects.music.filename = filename
effects.music.object = love.audio.newSource(filename)
effects.music.enabled = true
effects.music.object:play()
end
end
-- Love routines
function love.load(args)
if not args[2] then
args[2] = GAME
end
local storyFile = args[2]
storyCode = script.load(storyFile)
if love then
love.window.setTitle("Storyclicker Alpha")
love.window.setMode(800, 600, {
resizable = true,
minwidth = 640,
minheight = 480
})
end
story = script.init(storyCode)
story()
end
if isCLI then
local args = {...}
table.insert(args, 1, "lua")
love.load(args)
end
|
---@class LinkedList : java.util.LinkedList
---@field size int
---@field first LinkedList.Node|Unknown
---@field last LinkedList.Node|Unknown
---@field private serialVersionUID long
LinkedList = {}
---@public
---@param arg0 Object
---@return boolean
function LinkedList:offerLast(arg0) end
---@public
---@return Object
---@overload fun(arg0:int)
---@overload fun(arg0:Object)
function LinkedList:remove() end
---@public
---@param arg0 int
---@return Object
function LinkedList:remove(arg0) end
---@public
---@param arg0 Object
---@return boolean
function LinkedList:remove(arg0) end
---@public
---@param arg0 int
---@return Object
function LinkedList:get(arg0) end
---@public
---@return int
function LinkedList:size() end
---@private
---@param arg0 ObjectInputStream
---@return void
function LinkedList:readObject(arg0) end
---@public
---@return Iterator|Unknown
function LinkedList:descendingIterator() end
---@public
---@return Spliterator|Unknown
function LinkedList:spliterator() end
---@public
---@param arg0 Object
---@return void
function LinkedList:addLast(arg0) end
---@private
---@return LinkedList|Unknown
function LinkedList:superClone() end
---@public
---@param arg0 int
---@param arg1 Object
---@return Object
function LinkedList:set(arg0, arg1) end
---@public
---@param arg0 Object
---@return int
function LinkedList:indexOf(arg0) end
---@private
---@param arg0 int
---@return String
function LinkedList:outOfBoundsMsg(arg0) end
---@public
---@return Object
function LinkedList:pop() end
---@public
---@return Object
function LinkedList:pollLast() end
---@public
---@return Object
function LinkedList:peekFirst() end
---@private
---@param arg0 ObjectOutputStream
---@return void
function LinkedList:writeObject(arg0) end
---@public
---@return void
function LinkedList:clear() end
---@public
---@return Object
function LinkedList:peekLast() end
---@public
---@return Object
function LinkedList:removeFirst() end
---@public
---@param arg0 Object
---@return boolean
function LinkedList:offer(arg0) end
---@public
---@return Object
function LinkedList:pollFirst() end
---@public
---@param arg0 Object
---@return boolean
function LinkedList:offerFirst(arg0) end
---@private
---@param arg0 int
---@return void
function LinkedList:checkPositionIndex(arg0) end
---@public
---@param arg0 Object
---@return boolean
---@overload fun(arg0:int, arg1:Object)
function LinkedList:add(arg0) end
---@public
---@param arg0 int
---@param arg1 Object
---@return void
function LinkedList:add(arg0, arg1) end
---@public
---@param arg0 Object
---@return void
function LinkedList:push(arg0) end
---@private
---@param arg0 LinkedList.Node|Unknown
---@return Object
function LinkedList:unlinkFirst(arg0) end
---@public
---@return Object
function LinkedList:getLast() end
---@public
---@return Object
function LinkedList:peek() end
---@param arg0 LinkedList.Node|Unknown
---@return Object
function LinkedList:unlink(arg0) end
---@public
---@return Object
function LinkedList:getFirst() end
---@public
---@param arg0 Collection|Unknown
---@return boolean
---@overload fun(arg0:int, arg1:Collection|Unknown)
function LinkedList:addAll(arg0) end
---@public
---@param arg0 int
---@param arg1 Collection|Unknown
---@return boolean
function LinkedList:addAll(arg0, arg1) end
---@public
---@return Object
function LinkedList:poll() end
---@public
---@return Object
function LinkedList:clone() end
---@public
---@param arg0 int
---@return ListIterator|Unknown
function LinkedList:listIterator(arg0) end
---@public
---@param arg0 Object
---@return boolean
function LinkedList:removeLastOccurrence(arg0) end
---@private
---@param arg0 int
---@return boolean
function LinkedList:isPositionIndex(arg0) end
---@public
---@return Object[]
---@overload fun(arg0:Object[])
function LinkedList:toArray() end
---@public
---@param arg0 Object[]
---@return Object[]
function LinkedList:toArray(arg0) end
---@private
---@param arg0 int
---@return void
function LinkedList:checkElementIndex(arg0) end
---@param arg0 int
---@return LinkedList.Node|Unknown
function LinkedList:node(arg0) end
---@private
---@param arg0 LinkedList.Node|Unknown
---@return Object
function LinkedList:unlinkLast(arg0) end
---@public
---@param arg0 Object
---@return void
function LinkedList:addFirst(arg0) end
---@public
---@param arg0 Object
---@return boolean
function LinkedList:removeFirstOccurrence(arg0) end
---@public
---@return Object
function LinkedList:removeLast() end
---@public
---@param arg0 Object
---@return boolean
function LinkedList:contains(arg0) end
---@private
---@param arg0 int
---@return boolean
function LinkedList:isElementIndex(arg0) end
---@param arg0 Object
---@param arg1 LinkedList.Node|Unknown
---@return void
function LinkedList:linkBefore(arg0, arg1) end
---@param arg0 Object
---@return void
function LinkedList:linkLast(arg0) end
---@public
---@return Object
function LinkedList:element() end
---@private
---@param arg0 Object
---@return void
function LinkedList:linkFirst(arg0) end
---@public
---@param arg0 Object
---@return int
function LinkedList:lastIndexOf(arg0) end
|
----------------------------------<
-- Bluebird GUI
-- elements/dxRectangle.lua
----------------------------------<
-- Element variables
--[[------------------------------<
dxElement -> dxRectangle
-------------------
[Includes Basic Indicators]
x : X position
y : Y position
sx : SX position
sy : SY position
color : The color of the rectangle (includes alpha)
parent : Parent table
--]]------------------------------<
-- Creator
----------------------------------<
function dxCreateRectangle(x,y,sx,sy,parent,relativeX, relativeY,color)
if (x == nil) or (y == nil) or (sx == nil) or (sy == nil) then pushError(1, 'dxCreateRectangle') return false end
if type(x) ~= 'number' then pushError(2, 'dxCreateRectangle', 'X Position', 'number') return false end
if type(y) ~= 'number' then pushError(2, 'dxCreateRectangle', 'Y Position', 'number') return false end
if type(sx) ~= 'number' then pushError(2, 'dxCreateRectangle', 'Width', 'number') return false end
if type(sy) ~= 'number' then pushError(2, 'dxCreateRectangle', 'Height', 'number') return false end
if (parent == nil) or (parent == false) then
parent = dxContainer
else
if (not isElement(parent)) then
pushError(2, 'dxCreateRectangle', 'Parent', 'dxElement')
return false
end
local elementType = dxElementsList[parent]["type"]
if (elementType ~= "dxTile") and (elementType ~= "dxScrollPane") and (elementType ~= "dxContainer") then
pushError(4, 'dxCreateRectangle', 'Parent')
return false
end
parent = dxElementsList[parent]
end
if (relativeX == nil) then
relativeX = false
else
if type(relativeX) ~= "boolean" then
pushError(3, 'dxCreateRectangle', 'X Relativity', 'boolean')
relativeX = false
end
if (relativeX == true) then
x = parent.sx*x
sx = parent.sx*sx
end
end
if (relativeY == nil) then
relativeY = false
else
if type(relativeY) ~= "boolean" then
pushError(3, 'dxCreateRectangle', 'Y Relativity', 'boolean')
relativeY = false
end
if (relativeY == true) then
y = parent.sy*y
sy = parent.sy*sy
end
end
if (color == nil) then
color = dxGetColor("Accent", false)
else
if type(color) ~= "number" then
pushError(3, 'dxCreateTile', 'Color', 'number')
color = dxGetColor("Accent", false)
end
if (color < -2147483648) or (color > 2147483647) then
pushError(5, 'dxCreateTile', 'Color')
return false
end
end
local ElementTable = {
["type"] = "dxRectangle",
["element"] = createElement("dxGUI", "dxRectangle"),
["creator"] = getResourceName(sourceResource or getThisResource()),
["x"] = x,
["y"] = y,
["sx"] = sx,
["sy"] = sy,
["Color"] = color,
["Enabled"] = true,
["parent"] = parent,
}
table.insert(parent["children"], ElementTable)
dxElementsList[ElementTable["element"]] = ElementTable
triggerEvent("onDXElementCreation", root)
return ElementTable["element"]
end
fileDelete("elements/dxRectangle.lua")
|
-- https://github.com/petertriho/nvim-scrollbar
local colors = {
color = "#292E42",
Search = "#FC867",
Error = "#FD6883",
Warn = "#FFD886",
Info = "A9DC76",
Hint = "#78DCE8",
Misc = "#AB9DF2"
}
require("scrollbar").setup(
{
handle = {
-- 滚动条颜色
color = colors.color
},
marks = {
-- 诊断颜色,需要 LSP 支持
Search = {color = colors.Search},
Error = {color = colors.Error},
Warn = {color = colors.Warn},
Info = {color = colors.Info},
Hint = {color = colors.Hint},
Misc = {color = colors.Misc}
}
}
)
|
GM.UMsgRedun = {};
function PLAYER:SetUMsgString ( StringID, StringValue )
self.StringRedun = self.StringRedun or {};
if StringValue == nil then
self.StringRedun[StringID] = nil;
umsg.Start("perp_ums");
umsg.Entity(self);
umsg.String(StringID);
umsg.Short(5);
umsg.End();
return;
end
self.StringRedun[StringID] = {entity = self, value = StringValue};
self:SendUMsgVar("perp_ums", nil, self, StringID, StringValue);
end
PLAYER.SetUMsgInt = PLAYER.SetUMsgString;
PLAYER.SetUMsgBool = PLAYER.SetUMsgString;
function PLAYER:SendUMsgVar ( Type, ToWho, Entity, StringID, StringValue, loadVar )
if (ToWho && !IsValid(ToWho)) then return; end
umsg.Start(Type, ToWho);
if (Type == "perp_ums") then
umsg.Entity(Entity);
end
umsg.String(StringID);
if type(StringValue) == "string" then
umsg.Short(1);
umsg.String(StringValue);
elseif type(StringValue) == "number" then
if (math.floor(StringValue) != StringValue) then
umsg.Short(2);
umsg.Float(StringValue);
else
umsg.Short(3);
if (StringID == "cash" || StringID == "bank") then
umsg.Long(StringValue);
else
umsg.Short(StringValue);
end
end
elseif type(StringValue) == "boolean" then
umsg.Short(4);
umsg.Bool(StringValue);
end
if (loadVar) then
umsg.Bool(true);
else
umsg.Bool(false);
end
umsg.End();
end
function PLAYER:FindRunSpeed()
if (!self.Stamina) then return; end
self.LastSetSprint = self.LastSetSprint or "";
local newSetSprint = {200, 300};
if self.Crippled || self.currentlyRestrained then
newSetSprint = {50, 75};
else
if GAMEMODE.IsSerious then
if (self.Stamina > 0) then
newSetSprint = {100, 300};
else
newSetSprint = {100, 100};
end
else
if (self.Stamina > 0) then
newSetSprint = {200, 300};
else
newSetSprint = {200, 200};
end
end
end
local prospectiveNewSprint = tostring(newSetSprint[1]) .. tostring(newSetSprint[2]);
if (prospectiveNewSprint == self.LastSetSprint) then return; end
self.LastSetSprint = prospectiveNewSprint;
GAMEMODE:SetPlayerSpeed(self, newSetSprint[1], newSetSprint[2]);
end
function PLAYER:ForceRename ( )
self.CanRenameFree = true;
umsg.Start("perp_rename", self);
umsg.End();
end
function PLAYER:ForceFUN ( )
umsg.Start("perp_fun", self);
umsg.End();
end
function PLAYER:HasBuddy ( otherPlayer )
if (self == otherPlayer) then return true; end
for k, v in pairs(self.Buddies) do
if (v == tostring(otherPlayer:UniqueID())) then
return true;
end
end
return false;
end
function PLAYER:SpawnProp ( ItemTable, overrideType )
if (self.lastSpawnProp && self.lastSpawnProp > CurTime() && !self:IsAdmin()) then
self:Notify("Please slow down your prop spawning.");
return false;
end;
self.lastSpawnProp = CurTime() + 2;
self.theirNumItems = self.theirNumItems or 0;
if (self.theirNumItems >= MAX_PROPS_VIP && !self:IsAdmin() || (!self:IsBronze() && self.theirNumItems >= MAX_PROPS_NORM) && !self:IsAdmin()) then
self:Notify("You have reached the prop limit.");
return;
end;
self.theirNumItems = self.theirNumItems + 1;
local ty = overrideType or "ent_prop_item";
local trace = {};
trace.start = self:GetShootPos();
trace.endpos = self:GetShootPos() + self:GetAimVector() * 50;
trace.filter = self;
local tRes = util.TraceLine(trace);
local itemDrop = ents.Create(ty);
if (!overrideType || overrideType == "prop_vehicle_prisoner_pod") then
itemDrop:SetModel(ItemTable.WorldModel);
end
if (overrideType == "prop_vehicle_prisoner_pod") then
itemDrop:SetKeyValue("vehiclescript", "scripts/vehicles/prisoner_pod.txt");
local SeatDatabase = list.Get("Vehicles")["Seat_Jeep"];
if SeatDatabase.Members then table.Merge(itemDrop, SeatDatabase.Members); end
if SeatDatabase.KeyValues then
for k, v in pairs(SeatDatabase.KeyValues) do
itemDrop:SetKeyValue(k, v);
end
end
end
if (itemDrop.SetContents) then
itemDrop:SetContents(ItemTable.ID, self);
end
itemDrop:SetPos(tRes.HitPos);
itemDrop:Spawn();
itemDrop.pickupTable = ItemTable.ID;
itemDrop.pickupPlayer = self;
return itemDrop;
end
local allPossibleBlacklists = {'a', 'b'};
for k, v in pairs(GM.teamToBlacklist) do table.insert(allPossibleBlacklists, v); end
function PLAYER:RecompileBlacklists ( )
local blacklistString = "";
for k, v in pairs(allPossibleBlacklists) do
local hasBL = self:HasBlacklist(v, true);
if (hasBL) then
blacklistString = blacklistString .. v .. "," .. hasBL .. ";";
end
end
if (blacklistString == self:GetPrivateString("blacklists", "")) then return; end
self:SetPrivateString("blacklists", blacklistString)
tmysql.query("UPDATE `perp_users` SET `blacklists`='" .. blacklistString .. "' WHERE `id`='" .. self.SMFID .. "'");
end
function PLAYER:GiveBlacklist ( id, time )
if self:HasBlacklist(id) then return; end
local endTime = os.time() + (time * 60 * 60);
if (time == 0) then endTime = 0; end
local newString = self:GetPrivateString("blacklists", "") .. id .. "," .. endTime .. ";";
self:SetPrivateString("blacklists", newString);
tmysql.query("UPDATE `perp_users` SET `blacklists`='" .. newString .. "' WHERE `id`='" .. self.SMFID .. "'");
end
function PLAYER:StripMains ( )
if (self.PlayerItems[1]) then
self.PlayerItems[1].Table.Holster(self);
end
if (self.PlayerItems[2]) then
self.PlayerItems[2].Table.Holster(self);
end
end
function PLAYER:EquipMains ( )
if (self.PlayerItems[1]) then
self.PlayerItems[1].Table.Equip(self);
end
if (self.PlayerItems[2]) then
self.PlayerItems[2].Table.Equip(self);
end
end
function PLAYER:RemoveEquipped ( ID )
local id;
if (ID == EQUIP_MAIN) then id = 1; end
if (ID == EQUIP_SIDE) then id = 2; end
if (!id) then return; end
self.PlayerItems[id].Table.Holster(self);
self.PlayerItems[id] = nil;
umsg.Start("perp_rem_eqp", self);
umsg.Short(id);
umsg.End();
end
function PLAYER:Arrest ( byWho )
if (self:Team() != TEAM_CITIZEN) then return; end
self.currentlyRestrained = !self.currentlyRestrained
self.arrestingOfficer = byWho
if (self.currentlyRestrained) then
self:StripWeapons()
else
GAMEMODE:PlayerLoadout(self)
end
self:FindRunSpeed()
/*
if (self.CurrentlyJailed) then return; end
if (self:Team() != TEAM_CITIZEN) then return; end
local goTime = JAIL_TIME;
if (self:GetNetworkedBool("warrent", false)) then
goTime = JAIL_TIME_WARRENTED;
self:SetNetworkedBool("warrent", false);
end
local arrestPos = GAMEMODE.JailLocations[1];
for k, v in pairs(GAMEMODE.JailLocations) do
local dontDo;
for _, ent in pairs(player.GetAll()) do
if (ent:GetPos():Distance(v) <= 100) then
dontDo = true;
end
end
if (!dontDo) then
arrestPos = v;
break;
end
end
umsg.Start('perp_arrested', self);
umsg.Short(goTime);
umsg.End();
for i = 1, 2 do
if (self.PlayerItems[i]) then
self.PlayerItems[i] = nil;
end
end
umsg.Start('perp_strip_main', self); umsg.End();
self.CurrentlyJailed = true;
self:SetPos(arrestPos);
timer.Simple(goTime, function ( )
if (self && IsValid(self) && self:IsPlayer()) then
self.CurrentlyJailed = nil;
local arrestPos = GAMEMODE.UnjailLocations[1];
for k, v in pairs(GAMEMODE.UnjailLocations) do
local dontDo;
for _, ent in pairs(player.GetAll()) do
if (ent:GetPos():Distance(v) <= 100) then
dontDo = true;
end
end
if (!dontDo) then
arrestPos = v;
break;
end
end
self:SetPos(arrestPos);
end
end);
*/
end
local saveString = "UPDATE `perp_users` SET `cash`='%d', `time_played`='%d', `last_played`='%d', `items`='%s', `storage`='%s', `skills`='%s', `genes`='%s', `formulas`='%s', `bank`='%d', `ringtone`='%d', `ammo_pistol`='%d', `ammo_rifle`='%d', `ammo_shotgun`='%d', `fuelleft`='%d', `lastcar`='%s' WHERE `id`='%s'";
function PLAYER:Save ( )
if (!self.SMFID) then return false; end
local rpName = tmysql.escape(self:GetRPName())
tmysql.query("UPDATE `ip_intel` SET `rp_name`='" .. rpName .. "' WHERE `steamid`='" .. self:SteamID() .. "' LIMIT 1")
if (!self.AlreadyLoaded) then
for i = 1, 5 do
self:ChatPrint("Your account is not authorized to save. Reconnect or your progress will not be saved.");
end
Msg("Refused to save " .. self:Nick() .. ".\n");
return
end
Msg("Saved " .. self:Nick() .. ".\n");
local timeSinceJoin = CurTime() - math.Round(self.joinTime or CurTime());
local skills = "";
for i = 1, #SKILLS_DATABASE do
skills = skills .. self:GetPrivateInt("s_" .. i, 0) .. ";";
end
local genes = self:GetPrivateInt("gpoints", 0) .. ";";
for i = 1, #GENES_DATABASE do
genes = genes .. self:GetPrivateInt("g_" .. i, 0) .. ";";
end
local formulas = self:GetPrivateString("mixtures", "");
tmysql.query(string.format(saveString,
self:GetPrivateInt("cash", 0),
self:GetPrivateInt("time_played", 0) + timeSinceJoin,
os.time(),
self:CompileItems(),
self:CompileStorage(),
skills,
genes,
formulas,
self:GetPrivateInt("bank", 0),
tonumber(self:GetUMsgInt("ringtone", 1)),
self:GetAmmoCount('pistol'),
self:GetAmmoCount('smg1'),
self:GetAmmoCount('buckshot'),
self:GetPrivateInt("fuelleft", 0),
self:GetPrivateInt("lastcar", 0),
self.SMFID
)
);
end
|
local config = require('config');
local party = require('party');
local actions = require('actions');
local packets = require('packets');
local buffs = require('behaviors.buffs')
local healing = require('behaviors.healing');
local nukes = require('behaviors.nukes');
local spell_levels = {};
spell_levels[packets.spells.DIA] = 3;
spell_levels[packets.spells.BANISH] = 5;
spell_levels[packets.spells.POISONA] = 6;
spell_levels[packets.spells.PROTECT] = 7;
spell_levels[packets.spells.PROTECTRA] = 7;
spell_levels[packets.spells.PARALYNA] = 9;
spell_levels[packets.spells.BLINDNA] = 14;
spell_levels[packets.spells.DEODORIZE] = 15;
spell_levels[packets.spells.SHELL] = 17;
spell_levels[packets.spells.SHELLRA] = 17;
spell_levels[packets.spells.SNEAK] = 20;
spell_levels[packets.spells.INVISIBLE] = 25;
spell_levels[packets.spells.PROTECTRA_II] = 27;
spell_levels[packets.spells.STONESKIN] = 28;
spell_levels[packets.spells.CURSNA] = 29;
spell_levels[packets.spells.BANISH_II] = 30;
spell_levels[packets.spells.DIA_II] = 36;
spell_levels[packets.spells.SHELLRA_II] = 37;
spell_levels[packets.spells.STONA] = 39;
spell_levels[packets.spells.PROTECTRA_III] = 47;
spell_levels[packets.spells.AUSPICE] = 55;
spell_levels[packets.spells.SHELLRA_III] = 57;
spell_levels[packets.spells.PROTECTRA_IV] = 63;
spell_levels[packets.spells.BANISH_III] = 65;
spell_levels[packets.spells.SHELLRA_IV] = 68;
local jwhm = {
spell_levels = spell_levels,
};
function jwhm:tick()
local cnf = config:get();
local tid = AshitaCore:GetDataManager():GetTarget():GetTargetServerId();
if (cnf.ATTACK_TID and tid ~= cnf.ATTACK_TID) then
cnf.ATTACK_TID = nil;
end
if (actions.busy) then return end
if (healing:Heal(spell_levels)) then return end -- first priority...
if (buffs:Cleanse(spell_levels)) then return end
if (buffs:SneakyTime(spell_levels)) then return end
if (buffs:IdleBuffs(spell_levels)) then return end
end
function jwhm:attack(tid)
actions:queue(actions:new()
:next(function(self)
AshitaCore:GetChatManager():QueueCommand('/attack ' .. tid, 0);
end)
:next(function(self)
config:get().ATTACK_TID = tid;
end));
end
function jwhm:nuke(tid)
if (AshitaCore:GetDataManager():GetParty():GetMemberCurrentMPP(0) < 50) then return end
-- nukes:Nuke(tid, spell_levels);
AshitaCore:GetChatManager():QueueCommand('/magic Banish ' .. tid, 0);
end
return jwhm;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.